:root {
  color-scheme: light;
  --panel: rgba(255, 250, 242, 0.84);
  --text: #1f1d1a;
  --muted: #6d665d;
  --accent: #d14c1f;
  --accent-strong: #9e2e09;
  --line: rgba(31, 29, 26, 0.08);
  --shadow: 0 24px 60px rgba(71, 42, 12, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "SUIT", "Pretendard", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(209, 76, 31, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(73, 112, 88, 0.12), transparent 24%),
    linear-gradient(180deg, #f7f2e9 0%, #efe7d6 100%);
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.hero {
  margin-bottom: 24px;
}

.eyebrow,
.section-label,
.status-label {
  margin: 0 0 8px;
  font-size: 0.78rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.8rem, 5vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero-copy {
  margin-top: 14px;
  max-width: 680px;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted);
}

.status-grid,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.status-card,
.detail-card,
.map-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  border-radius: 28px;
}

.status-card,
.detail-card {
  padding: 20px 22px;
}

.status-card strong,
.detail-card h3 {
  display: block;
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.status-card span:last-child,
.detail-card p {
  line-height: 1.6;
  color: var(--muted);
}

.map-card {
  margin-top: 16px;
  padding: 20px;
}

.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.map-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button {
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 0.98rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.primary-button {
  border: 0;
  color: #fff8f1;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.secondary-button {
  border: 1px solid rgba(31, 29, 26, 0.12);
  color: var(--text);
  background: rgba(255, 249, 241, 0.88);
}

.map-view {
  width: 100%;
  height: min(62vh, 620px);
  margin-top: 16px;
  border-radius: 24px;
  overflow: hidden;
}

.map-view .leaflet-container {
  width: 100%;
  height: 100%;
  font-family: "SUIT", "Pretendard", sans-serif;
}

.map-view .leaflet-control-attribution {
  background: rgba(255, 249, 241, 0.88);
  border-radius: 12px 0 0 0;
  color: rgba(31, 29, 26, 0.76);
}

.course-station-marker {
  background: transparent;
  border: 0;
}

.course-station-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 249, 241, 0.96);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(31, 29, 26, 0.1);
}

.runner-marker-icon {
  background: transparent;
  border: 0;
  overflow: visible;
}

.runner-marker {
  position: relative;
  width: 74px;
  height: 74px;
  user-select: none;
  pointer-events: none;
}

.runner-badge {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  width: max-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(31, 29, 26, 0.88);
  color: #fff9f1;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.runner-sprite {
  position: absolute;
  inset: 0;
  width: 74px;
  height: 74px;
}

.runner-sprite-image,
.runner-sprite-fallback {
  width: 100%;
  height: 100%;
}

.runner-sprite-image {
  display: none;
  object-fit: contain;
  transform: rotate(var(--runner-angle, 0deg));
  transform-origin: 50% 50%;
}

.runner-sprite-fallback {
  display: grid;
  place-items: center;
  color: #fff7ec;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.runner-marker.is-moving .runner-sprite {
  animation: runner-bob 0.38s infinite alternate ease-in-out;
}

@keyframes runner-bob {
  from {
    transform: translateY(0) rotate(-2deg);
  }

  to {
    transform: translateY(-4px) rotate(2deg);
  }
}

.map-message {
  margin-top: 14px;
  min-height: 24px;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 900px) {
  .app-shell {
    width: min(1120px, calc(100% - 20px));
    padding: 24px 0 40px;
  }

  .status-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .map-header {
    flex-direction: column;
    align-items: stretch;
  }

  .map-actions {
    width: 100%;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .map-view {
    height: 54vh;
  }

  .course-station-label {
    font-size: 0.8rem;
  }

  .runner-sprite {
    width: 60px;
    height: 60px;
  }

  .runner-marker {
    width: 60px;
    height: 60px;
  }
}
