/* ==========================================================================
   수달이의 장성 드라이브 — 전체 스타일시트
   테마: 옐로우시티 장성 (노란꽃길 · 편백숲 · 황룡강 · 단풍)
   ========================================================================== */

:root {
  /* 브랜드 & 자연 팔레트 */
  --bg-page: #faf8f2;
  --bg-section-alt: #f3efe2;
  --bg-card: #ffffff;
  --bg-stage: #14261f;

  --yellow-primary: #f5b700;
  --yellow-hover: #e2a500;
  --yellow-soft: #fff5cc;
  --yellow-border: #f0d77d;

  --forest-primary: #266c4f;
  --forest-dark: #1a4d38;
  --forest-soft: #e6f4ed;
  --forest-border: #b8dfca;

  --otter-brown: #8b5a2b;
  --maple-red: #d95d39;
  --lake-blue: #2b7bb9;

  --text-main: #1f2922;
  --text-sub: #546258;
  --text-muted: #7a887e;

  --border-subtle: #e7e1cf;
  --border-strong: #d5ccb4;

  --shadow-sm: 0 2px 8px rgba(31, 41, 34, 0.06);
  --shadow-md: 0 8px 24px rgba(31, 41, 34, 0.08);
  --shadow-lg: 0 18px 46px rgba(20, 38, 31, 0.16);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --container-max: 1200px;
  --header-height: 70px;
  --transition: 0.18s ease;
}

/* 기본 리셋 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 12% 0%, rgba(245, 183, 0, 0.13), transparent 36%),
    radial-gradient(circle at 88% 8%, rgba(38, 108, 79, 0.09), transparent 38%),
    var(--bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img,
svg,
canvas {
  max-width: 100%;
}

button,
input {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

section[id] {
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
  background: #f5f2e8;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
}

/* 포커스 접근성 */
:focus-visible {
  outline: 3px solid var(--yellow-primary);
  outline-offset: 2px;
}

/* ==========================================================================
   시작 오버레이 (#start-overlay)
   ========================================================================== */
.start-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(18, 32, 25, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.25s ease-out;
}

.start-overlay.hidden,
.start-overlay.is-hidden,
.start-overlay[hidden] {
  display: none !important;
}

.overlay-card {
  width: 100%;
  max-width: 470px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 32px 28px 28px;
  background: linear-gradient(180deg, #fffdf7 0%, #ffffff 100%);
  border: 1px solid var(--yellow-border);
  border-radius: 26px;
  box-shadow: 0 24px 64px rgba(10, 22, 16, 0.34);
  text-align: center;
  animation: popIn 0.28s cubic-bezier(0.2, 0.85, 0.3, 1);
}

.overlay-badge {
  display: inline-block;
  padding: 5px 12px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--forest-dark);
  background: var(--yellow-soft);
  border: 1px solid var(--yellow-border);
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}

.overlay-otter-emblem {
  font-size: 2.8rem;
  line-height: 1.1;
  margin-bottom: 10px;
}

.overlay-title {
  margin: 0 0 8px;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.overlay-subtitle {
  margin: 0 0 24px;
  font-size: 0.93rem;
  color: var(--text-sub);
  word-break: keep-all;
}

.overlay-form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.nickname-input {
  width: 100%;
  padding: 13px 16px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  background: #faf8f2;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.nickname-input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--yellow-primary);
  box-shadow: 0 0 0 4px rgba(245, 183, 0, 0.2);
}

.color-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.color-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: #faf8f2;
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.color-choice:hover {
  transform: translateY(-1px);
  border-color: var(--yellow-primary);
  background: #ffffff;
}

.color-choice.active,
.color-choice.selected,
.color-choice.is-selected,
.color-choice[aria-pressed="true"] {
  background: var(--yellow-soft);
  border-color: var(--yellow-hover);
  box-shadow: 0 0 0 3px rgba(245, 183, 0, 0.25);
}

.swatch-dot {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--swatch-color, #8b5a2b);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(31, 41, 34, 0.2);
}

.swatch-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.btn-start-drive {
  width: 100%;
  padding: 15px 20px;
  margin-top: 4px;
  font-size: 1.06rem;
  font-weight: 800;
  color: #241d09;
  background: linear-gradient(135deg, #ffd038 0%, #f5b700 100%);
  border: 1px solid #e0a400;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(245, 183, 0, 0.35);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

.btn-start-drive:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(245, 183, 0, 0.42);
  filter: brightness(1.02);
}

.btn-start-drive:active {
  transform: translateY(0);
}

.overlay-hint {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ==========================================================================
   상단 헤더
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(250, 248, 242, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.brand-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  background: linear-gradient(135deg, var(--yellow-soft), #ffe27a);
  border: 1px solid var(--yellow-border);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--forest-primary);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-link {
  padding: 8px 14px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-sub);
  border-radius: var(--radius-pill);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.nav-link:hover {
  color: var(--text-main);
  background: rgba(245, 183, 0, 0.16);
}

.nav-link-cta {
  color: #241d09;
  background: var(--yellow-primary);
  box-shadow: 0 4px 12px rgba(245, 183, 0, 0.28);
}

.nav-link-cta:hover {
  color: #241d09;
  background: var(--yellow-hover);
  transform: translateY(-1px);
}

/* ==========================================================================
   홈 히어로 섹션 (#section-home)
   ========================================================================== */
.hero-section {
  padding: 36px 0 28px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 28px;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--forest-dark);
  background: var(--forest-soft);
  border: 1px solid var(--forest-border);
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}

.hero-title {
  margin: 0 0 12px;
  font-size: clamp(1.85rem, 3.2vw, 2.65rem);
  font-weight: 800;
  line-height: 1.24;
  letter-spacing: -0.03em;
  word-break: keep-all;
}

.text-highlight {
  position: relative;
  display: inline-block;
  color: var(--forest-dark);
  background: linear-gradient(transparent 62%, rgba(245, 183, 0, 0.45) 62%);
  padding: 0 4px;
}

.hero-desc {
  margin: 0 0 22px;
  font-size: 0.98rem;
  color: var(--text-sub);
  word-break: keep-all;
  max-width: 580px;
}

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

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: 12px;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn-primary {
  color: #241d09;
  background: linear-gradient(135deg, #ffd038, var(--yellow-primary));
  border: 1px solid #e0a400;
  box-shadow: 0 6px 16px rgba(245, 183, 0, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(245, 183, 0, 0.36);
}

.btn-secondary {
  color: var(--forest-dark);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: var(--forest-soft);
  border-color: var(--forest-border);
}

.hero-highlights {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.highlight-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.highlight-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: var(--yellow-soft);
  border-radius: 12px;
}

.highlight-card strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.highlight-card span {
  display: block;
  font-size: 0.82rem;
  color: var(--text-sub);
}

/* ==========================================================================
   공통 섹션 헤더
   ========================================================================== */
.section-header {
  margin-bottom: 24px;
}

.section-tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--forest-primary);
  margin-bottom: 4px;
}

.section-title {
  margin: 0 0 6px;
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.section-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-sub);
  word-break: keep-all;
}

/* ==========================================================================
   3D 주행 섹션 (#section-drive)
   ========================================================================== */
.drive-section {
  padding: 20px 0 56px;
}

.drive-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.mp-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mp-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-sub);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}

.mp-status::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--yellow-primary);
  box-shadow: 0 0 0 3px rgba(245, 183, 0, 0.25);
  flex-shrink: 0;
}

.mp-status.connected,
.mp-status.online {
  color: var(--forest-dark);
  background: var(--forest-soft);
  border-color: var(--forest-border);
}

.mp-status.connected::before,
.mp-status.online::before {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.mp-status.error,
.mp-status.offline {
  color: #8c3720;
  background: #fdf0ec;
  border-color: #f3c4b7;
}

.mp-status.error::before,
.mp-status.offline::before {
  background: var(--maple-red);
  box-shadow: 0 0 0 3px rgba(217, 93, 57, 0.2);
}

.player-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--forest-dark);
  background: var(--yellow-soft);
  border: 1px solid var(--yellow-border);
  border-radius: var(--radius-pill);
}

.player-count-badge strong {
  font-size: 0.92rem;
  font-weight: 800;
}

/* 3D 캔버스 프레임 + 캡션 바 */
.stage-frame {
  background: var(--bg-stage);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(31, 41, 34, 0.14);
  box-shadow: var(--shadow-lg);
  margin-bottom: 18px;
}

.drive-canvas-container {
  position: relative;
  width: 100%;
  height: clamp(320px, 56vh, 600px);
  min-height: 300px;
  background:
    radial-gradient(circle at 50% 35%, #244a3c 0%, #14261f 75%);
  overflow: hidden;
}

.drive-canvas-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.caption-bar {
  padding: 14px 20px;
  font-size: 0.98rem;
  font-weight: 700;
  color: #fffaf0;
  background: linear-gradient(90deg, #1b362b 0%, #244839 60%, #2c4a35 100%);
  border-top: 2px solid rgba(245, 183, 0, 0.55);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  word-break: keep-all;
}

/* 컨트롤 패널 + 멀티플레이어 패널 그리드 */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 18px;
  align-items: start;
}

.control-panel,
.mp-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.control-row {
  display: grid;
  gap: 16px;
}

.control-row-modes {
  grid-template-columns: 1.25fr 1fr;
}

.control-row-driving {
  grid-template-columns: 1.25fr 1fr;
}

.control-group {
  background: #fbf9f4;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.control-title {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-header-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.control-header-inline .control-title {
  margin-bottom: 0;
}

.control-subhint {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* 카메라 / 시간대 필 버튼 */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pill-btn {
  padding: 8px 13px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-sub);
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}

.pill-btn:hover {
  color: var(--text-main);
  border-color: var(--forest-primary);
  background: var(--forest-soft);
}

.pill-btn:active {
  transform: scale(0.97);
}

.cam-btn.active,
.cam-btn.is-active,
.cam-btn[aria-pressed="true"] {
  color: #ffffff;
  background: var(--forest-primary);
  border-color: var(--forest-dark);
  box-shadow: 0 4px 10px rgba(38, 108, 79, 0.25);
}

.time-btn.active,
.time-btn.is-active,
.time-btn[aria-pressed="true"] {
  color: #241d09;
  background: var(--yellow-primary);
  border-color: var(--yellow-hover);
  box-shadow: 0 4px 10px rgba(245, 183, 0, 0.3);
}

/* 속도 제어 */
.speed-readout {
  padding: 3px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--forest-dark);
  background: var(--forest-soft);
  border-radius: var(--radius-pill);
}

.speed-readout strong {
  font-size: 0.96rem;
  font-weight: 800;
  margin-left: 2px;
}

.speed-slider-wrap {
  margin-bottom: 12px;
}

.speed-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #b8dfca 0%, var(--yellow-primary) 70%, var(--maple-red) 100%);
  outline: none;
  cursor: pointer;
}

.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--forest-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.14s ease;
}

.speed-slider::-webkit-slider-thumb:hover {
  transform: scale(1.12);
}

.speed-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--forest-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.speed-btn-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ctrl-btn {
  padding: 10px 10px;
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.ctrl-btn:active {
  transform: translateY(1px) scale(0.98);
}

.ctrl-btn-primary {
  color: #ffffff;
  background: var(--forest-primary);
  border-color: var(--forest-dark);
}

.ctrl-btn-primary:hover {
  background: var(--forest-dark);
}

.ctrl-btn-sub {
  color: var(--text-main);
  background: #ffffff;
  border-color: var(--border-strong);
}

.ctrl-btn-sub:hover {
  background: #f3efe2;
}

.ctrl-btn-danger {
  color: #8c2614;
  background: #fdece8;
  border-color: #f4beb2;
}

.ctrl-btn-danger:hover {
  background: #fbd7cf;
}

/* 좌우 조향 버튼 */
.steer-group {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.steer-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: 1;
}

.steer-btn {
  min-height: 68px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-main);
  background: linear-gradient(180deg, #ffffff 0%, #f7f3e7 100%);
  border: 2px solid var(--border-strong);
  border-bottom-width: 4px;
  border-radius: 14px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform 0.1s ease, background var(--transition), border-color var(--transition);
}

.steer-btn:hover {
  border-color: var(--yellow-hover);
  background: var(--yellow-soft);
}

.steer-btn:active,
.steer-btn.active,
.steer-btn.pressed {
  transform: translateY(2px);
  border-bottom-width: 2px;
  background: var(--yellow-primary);
  border-color: var(--yellow-hover);
  color: #241d09;
}

.steer-arrow {
  font-size: 1.05rem;
}

/* 수달 인터랙션 5종 */
.action-btn-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 11px 8px;
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.action-btn:hover {
  transform: translateY(-2px);
  background: var(--yellow-soft);
  border-color: var(--yellow-hover);
  box-shadow: var(--shadow-sm);
}

.action-btn:active,
.action-btn.active {
  transform: translateY(0) scale(0.96);
  background: var(--yellow-primary);
}

.action-emoji {
  font-size: 1.3rem;
  line-height: 1.1;
}

/* ==========================================================================
   멀티플레이어 패널 (.mp-panel / #player-list)
   ========================================================================== */
.mp-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mp-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mp-panel-header .control-title {
  margin-bottom: 0;
}

.mp-live-tag {
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--forest-dark);
  background: var(--forest-soft);
  border: 1px solid var(--forest-border);
  border-radius: var(--radius-pill);
}

.player-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.player-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  background: #fbf9f4;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}

.player-list .player-dot,
.player-list .color-dot,
.player-list .player-color,
.player-list .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(31, 41, 34, 0.22);
  display: inline-block;
}

.player-placeholder {
  color: var(--text-muted);
  font-weight: 600;
}

.shortcut-box {
  padding: 14px;
  background: #f6f3e8;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.shortcut-title {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-sub);
}

.shortcut-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.8rem;
  color: var(--text-sub);
}

.shortcut-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ==========================================================================
   코스 소개 섹션 (#section-course)
   ========================================================================== */
.course-section {
  padding: 64px 0;
  background: var(--bg-section-alt);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.course-timeline {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.course-step {
  position: relative;
  padding: 18px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #241d09;
  background: var(--yellow-primary);
  border-radius: 50%;
}

.course-step strong {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-main);
  word-break: keep-all;
}

.course-step span:last-child {
  font-size: 0.82rem;
  color: var(--text-sub);
}

.course-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature-card {
  padding: 22px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.feature-icon {
  font-size: 1.7rem;
  margin-bottom: 10px;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  font-weight: 800;
}

.feature-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-sub);
  word-break: keep-all;
}

/* ==========================================================================
   관광지 5곳 카드 섹션 (#section-stops / .stop-card)
   ========================================================================== */
.stops-section {
  padding: 64px 0 72px;
}

.stops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
}

.stop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-top: 5px solid var(--yellow-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.stop-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stop-theme-yellow {
  border-top-color: #f5b700;
}

.stop-theme-hanok {
  border-top-color: #9c6644;
}

.stop-theme-forest {
  border-top-color: #266c4f;
}

.stop-theme-lake {
  border-top-color: #2b7bb9;
}

.stop-theme-autumn {
  border-top-color: #d95d39;
}

.stop-card.visited,
.stop-card.is-visited {
  border-color: var(--forest-border);
  box-shadow: 0 10px 26px rgba(38, 108, 79, 0.13);
}

.stop-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.stop-index {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: #f5f2e8;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

/* 방문 완료 배지 (.visited-badge) */
.visited-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 11px;
  font-size: 0.76rem;
  font-weight: 800;
  border-radius: var(--radius-pill);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.visited-badge:empty {
  color: var(--text-muted);
  background: #f2efe6;
  border: 1px dashed var(--border-strong);
}

.visited-badge:empty::after {
  content: "미방문";
}

.visited-badge:not(:empty),
.visited-badge.visited,
.visited-badge.active,
.visited-badge.show,
.stop-card.visited .visited-badge {
  color: #ffffff;
  background: linear-gradient(135deg, #2e8b57, #1f6b48);
  border: 1px solid #1b5c3e;
  box-shadow: 0 4px 10px rgba(38, 108, 79, 0.28);
}

.visited-badge:not(:empty)::before {
  content: "✓";
  font-weight: 900;
}

.stop-visual {
  font-size: 1.9rem;
  line-height: 1.2;
  margin-bottom: 10px;
}

.stop-name {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  word-break: keep-all;
}

.stop-desc {
  margin: 0 0 16px;
  font-size: 0.92rem;
  color: var(--text-sub);
  word-break: keep-all;
  flex: 1;
}

.stop-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.stop-badge {
  padding: 4px 10px;
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--forest-dark);
  background: var(--yellow-soft);
  border: 1px solid var(--yellow-border);
  border-radius: var(--radius-pill);
}

.stop-coords {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   푸터
   ========================================================================== */
.site-footer {
  padding: 32px 0;
  background: #1b2f26;
  color: #d7e2db;
}

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

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-brand strong {
  font-size: 1rem;
  color: #ffffff;
}

.footer-brand span {
  font-size: 0.82rem;
  color: #a9bdb1;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.86rem;
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--yellow-primary);
}

/* ==========================================================================
   애니메이션
   ========================================================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   반응형 (태블릿 & 모바일)
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero-highlights {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .course-timeline {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 62px;
  }

  .container {
    padding: 0 14px;
  }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .brand {
    justify-content: center;
  }

  .main-nav {
    justify-content: center;
    gap: 4px;
  }

  .nav-link {
    padding: 6px 11px;
    font-size: 0.84rem;
  }

  .hero-section {
    padding: 24px 0 18px;
  }

  .hero-highlights {
    grid-template-columns: 1fr;
  }

  .drive-section {
    padding: 14px 0 42px;
  }

  .drive-canvas-container {
    height: 46vh;
    min-height: 260px;
  }

  .caption-bar {
    padding: 12px 14px;
    font-size: 0.9rem;
  }

  .control-panel,
  .mp-panel {
    padding: 14px;
    border-radius: var(--radius-md);
  }

  .control-row-modes,
  .control-row-driving {
    grid-template-columns: 1fr;
  }

  .steer-btn {
    min-height: 58px;
  }

  .action-btn-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .course-section,
  .stops-section {
    padding: 44px 0;
  }

  .course-timeline {
    grid-template-columns: 1fr 1fr;
  }

  .course-feature-grid {
    grid-template-columns: 1fr;
  }

  .stops-grid {
    grid-template-columns: 1fr;
  }

  .overlay-card {
    padding: 24px 18px 20px;
  }

  .color-picker {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 420px) {
  .course-timeline {
    grid-template-columns: 1fr;
  }

  .action-btn-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .speed-btn-row {
    gap: 6px;
  }

  .ctrl-btn {
    font-size: 0.8rem;
    padding: 9px 6px;
  }
}
