/* Aemazon Ghost Course Card v1 */
.ghost-preview {
  --ghost-orange: #ff4b16;
  --ghost-orange-dark: #d93800;
  --ghost-ink: #171719;
  --ghost-muted: #6e7177;
  --ghost-line: #e7e8ea;
}

.ghost-map-shell {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #ebeef1;
}

.ghost-course-map {
  width: 100%;
  height: 100%;
  min-height: 180px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.7), rgba(255,255,255,.12)),
    #e8ebee;
}

.ghost-course-map:not(.is-map-ready):not(.ghost-map-unavailable)::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #e9ecef 20%, #f7f8f9 42%, #e9ecef 64%);
  background-size: 220% 100%;
  animation: ghost-map-loading 1.25s linear infinite;
  z-index: 1;
}

.ghost-course-map.ghost-map-unavailable {
  display: grid;
  place-items: center;
  padding: 20px;
  color: #777b81;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

@keyframes ghost-map-loading {
  to { background-position-x: -220%; }
}

.ghost-map-label {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 999px;
  background: rgba(20,21,23,.84);
  color: #fff;
  box-shadow: 0 5px 16px rgba(0,0,0,.17);
  backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .06em;
  pointer-events: none;
}

.ghost-map-label::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ghost-orange);
  box-shadow: 0 0 0 4px rgba(255,75,22,.22);
}

.ghost-map-marker {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--ghost-orange);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.28);
  font: 950 10px/1 Segoe UI, Arial, sans-serif;
}

.ghost-map-marker.is-finish {
  width: 32px;
  height: 32px;
  background: #171719;
}

/* 게시글 목록 카드 */
.ghost-list-preview {
  display: grid;
  grid-template-columns: minmax(300px, 1.18fr) minmax(250px, .82fr);
  min-height: 238px;
  margin: 4px 0 12px;
  overflow: hidden;
  border: 1px solid #e1e3e6;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(24,28,35,.07);
}

.ghost-list-map-shell {
  min-height: 238px;
  border-right: 1px solid #e5e6e8;
}

.ghost-list-map,
.ghost-compact-map {
  pointer-events: none;
}

.ghost-list-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
  background:
    radial-gradient(circle at 100% 0, rgba(255,75,22,.10), transparent 42%),
    #fff;
}

.ghost-list-kicker,
.ghost-share-kicker {
  color: var(--ghost-orange-dark) !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  letter-spacing: .08em !important;
}

.ghost-list-name {
  margin-top: 5px;
  overflow: hidden;
  color: var(--ghost-ink);
  font-size: 18px;
  font-weight: 950;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghost-list-vehicle {
  min-height: 20px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ghost-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghost-list-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 14px;
}

.ghost-list-stat {
  min-width: 0;
  padding: 10px 6px;
  border: 1px solid #eceef0;
  border-radius: 11px;
  background: #f7f8f9;
  text-align: center;
}

.ghost-list-stat span {
  display: block;
  color: #85888e;
  font-size: 9px;
  line-height: 1.2;
}

.ghost-list-stat strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #202124;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghost-list-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  margin-top: auto;
  padding: 0 14px;
  border-radius: 11px;
  background: #1e2024;
  color: #fff !important;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.ghost-list-link::after {
  content: '→';
  color: #ff774d;
  font-size: 16px;
}

.ghost-list-link:hover { background: #08090a; }

/* 축약형 목록의 코스 썸네일 */
.ghost-compact-preview {
  position: relative;
  width: 124px;
  height: 82px;
  flex: 0 0 124px;
  overflow: hidden;
  border: 1px solid #dfe1e4;
  border-radius: 10px;
  background: #eceff1;
}

.ghost-compact-preview .ghost-course-map { min-height: 82px; }
.ghost-compact-preview .ghost-map-label {
  top: 7px;
  left: 7px;
  min-height: 20px;
  padding: 0 7px;
  font-size: 8px;
}
.ghost-compact-preview .ghost-map-marker {
  width: 20px;
  height: 20px;
  border-width: 2px;
  font-size: 8px;
}
.ghost-compact-preview .ghost-map-marker.is-finish {
  width: 22px;
  height: 22px;
}

/* 게시글 상세 카드 */
.ghost-share-card.ghost-preview {
  margin: 18px 0 !important;
  padding: 12px !important;
  overflow: hidden;
  border: 1px solid #dedfe2 !important;
  border-radius: 22px !important;
  background: #fff !important;
  box-shadow: 0 14px 36px rgba(21,25,31,.10) !important;
}

.ghost-share-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.12fr) minmax(320px, .88fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid #e3e4e6;
  border-radius: 15px;
}

.ghost-detail-map-shell {
  min-height: 370px;
  border-right: 1px solid #e3e4e6;
}

.ghost-detail-map { min-height: 370px; }

.ghost-detail-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px;
  background:
    radial-gradient(circle at 100% 0, rgba(255,75,22,.12), transparent 42%),
    linear-gradient(155deg, #fff 0%, #fffaf7 100%);
}

.ghost-share-head {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.ghost-share-icon {
  display: grid !important;
  place-items: center !important;
  width: 44px !important;
  height: 44px !important;
  flex: 0 0 44px !important;
  border-radius: 14px !important;
  background: #1d1f22 !important;
  color: #fff !important;
}

.ghost-share-icon svg { width: 23px; height: 23px; }

.ghost-share-name {
  margin-top: 3px !important;
  overflow: hidden;
  color: var(--ghost-ink) !important;
  font-size: 20px !important;
  font-weight: 950 !important;
  line-height: 1.25 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghost-share-vehicle {
  margin-top: 4px !important;
  color: var(--ghost-muted) !important;
  font-size: 12px !important;
}

.ghost-share-stats {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-top: 18px !important;
}

.ghost-stat {
  padding: 12px 9px !important;
  border: 1px solid #e7e8ea !important;
  border-radius: 12px !important;
  background: rgba(255,255,255,.84) !important;
  text-align: left !important;
}

.ghost-stat-label {
  margin-bottom: 5px !important;
  color: #8b8e94 !important;
  font-size: 10px !important;
}

.ghost-stat-value {
  color: #202124 !important;
  font-size: 14px !important;
  font-weight: 950 !important;
}

.ghost-share-note {
  margin: 13px 0 0 !important;
  color: #777b81 !important;
  font-size: 11px !important;
  line-height: 1.5 !important;
}

.ghost-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
}

.ghost-challenge-btn {
  min-height: 44px;
  margin: 0 !important;
  padding: 0 12px !important;
  border: 1px solid transparent;
  border-radius: 11px !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

.ghost-challenge-btn.ghost-primary {
  grid-column: 1 / -1;
  background: var(--ghost-orange) !important;
}
.ghost-challenge-btn.ghost-primary:hover { background: var(--ghost-orange-dark) !important; }
.ghost-challenge-btn.ghost-download-btn {
  background: #fff !important;
  color: #202124 !important;
  border-color: #dcdfe3 !important;
}
.ghost-challenge-btn.ghost-download-btn:hover { background: #f5f6f7 !important; }
.ghost-challenge-btn.ghost-records-btn {
  background: #202226 !important;
  color: #fff !important;
}
.ghost-challenge-btn.ghost-records-btn:hover { background: #090a0b !important; }

@media (max-width: 820px) {
  .ghost-list-preview,
  .ghost-share-layout { grid-template-columns: 1fr; }

  .ghost-list-map-shell {
    min-height: 230px;
    border-right: 0;
    border-bottom: 1px solid #e5e6e8;
  }

  .ghost-detail-map-shell {
    min-height: 310px;
    border-right: 0;
    border-bottom: 1px solid #e3e4e6;
  }

  .ghost-detail-map { min-height: 310px; }
  .ghost-list-info { padding: 17px; }
  .ghost-detail-panel { padding: 19px; }
}

@media (max-width: 560px) {
  .ghost-list-preview {
    width: calc(100% + 28px);
    margin-left: -14px;
    margin-right: -14px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .ghost-list-map-shell,
  .ghost-list-map { min-height: 210px; }
  .ghost-list-info { padding: 16px 14px; }
  .ghost-list-name { font-size: 17px; }
  .ghost-list-link { margin-top: 14px; }

  .ghost-compact-preview {
    width: 94px;
    height: 68px;
    flex-basis: 94px;
  }
  .ghost-compact-preview .ghost-course-map { min-height: 68px; }

  .ghost-share-card.ghost-preview {
    width: calc(100% + 28px);
    margin-right: -14px !important;
    margin-left: -14px !important;
    padding: 0 !important;
    border-right: 0 !important;
    border-left: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .ghost-share-layout { border-right: 0; border-left: 0; border-radius: 0; }
  .ghost-detail-map-shell,
  .ghost-detail-map { min-height: 255px; }
  .ghost-share-name { font-size: 18px !important; }
  .ghost-actions { grid-template-columns: 1fr; }
  .ghost-challenge-btn.ghost-primary { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .ghost-course-map:not(.is-map-ready):not(.ghost-map-unavailable)::before {
    animation: none;
  }
}
