/* =========================================================
   AI 레이싱 게임 만들기 — 그랑프리 랩 서킷 대시보드
   네온 아케이드 레이싱 테마 · 자기완결(file://)
   ========================================================= */
:root {
  --asphalt:  #0b0d12;
  --asphalt2: #12151d;
  --panel:    #171b25;
  --panel2:   #1e2432;
  --line:     #2b3242;
  --ink:      #eef2fb;
  --ink-dim:  #9aa6bd;
  --ink-mute: #66708a;
  --red:      #ff2740;
  --red-glow: #ff3b56;
  --amber:    #ffd21e;
  --lime:     #38ff9b;
  --cyan:     #21e6ff;
  --radius:   16px;
  --shadow:   0 18px 44px rgba(0,0,0,.5);
  --mono: "SFMono-Regular", ui-monospace, "Consolas", "Courier New", monospace;
  --sans: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 520px at 80% -10%, rgba(255,39,64,.14), transparent 60%),
    radial-gradient(900px 480px at 8% 0%, rgba(33,230,255,.08), transparent 55%),
    var(--asphalt);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---------- 상단 바 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 12px 22px;
  background: linear-gradient(180deg, rgba(12,14,20,.96), rgba(12,14,20,.86));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.brand-flag {
  font-size: 26px; line-height: 1;
  filter: drop-shadow(0 0 10px rgba(255,210,30,.5));
}
.brand-txt { display: flex; flex-direction: column; }
.brand-txt b { font-size: 17px; letter-spacing: .3px; }
.brand-txt i {
  font-style: normal; font-family: var(--mono); font-size: 10px;
  letter-spacing: 2.5px; color: var(--red-glow); font-weight: 700;
}
.topnav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav-btn {
  border: 1px solid var(--line); background: var(--panel);
  color: var(--ink-dim); font-weight: 700; font-size: 13px;
  padding: 8px 13px; border-radius: 10px; transition: .15s;
}
.nav-btn:hover { color: var(--ink); border-color: #3a4358; }
.nav-btn.active { color: #10131b; background: var(--amber); border-color: var(--amber); }
.nav-btn.ghost { color: var(--ink-mute); }
.nav-btn.ghost:hover { color: var(--red-glow); border-color: var(--red); }

/* ---------- 전역 진행 레일 ---------- */
.progress-rail {
  position: sticky; top: 61px; z-index: 29;
  height: 4px; background: #05060a; overflow: hidden;
}
.progress-rail #railFill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--lime), var(--amber) 55%, var(--red));
  box-shadow: 0 0 12px rgba(255,210,30,.6);
  transition: width .5s cubic-bezier(.22,1,.36,1);
}

/* ---------- 뷰 컨테이너 ---------- */
.view { max-width: 1240px; margin: 0 auto; padding: 26px 20px 90px; }

/* =========================================================
   HUD — 서킷 트랙 + 계기판
   ========================================================= */
.hud {
  background:
    linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 18px;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.hud::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.02) 0 2px, transparent 2px 26px);
  opacity: .5;
}
.hud-gauges {
  display: grid; grid-template-columns: 190px 1fr 1fr; gap: 12px;
  align-items: stretch; margin-bottom: 14px; position: relative;
}
.gauge {
  background: #0c0f16; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; display: flex; flex-direction: column; justify-content: center;
}
.gauge .g-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 2px;
  color: var(--ink-mute); font-weight: 700;
}
.gauge .g-big {
  font-family: var(--mono); font-weight: 800; letter-spacing: 1px;
  font-size: 34px; line-height: 1; margin-top: 2px;
  text-shadow: 0 0 16px currentColor;
}
.gauge .g-unit { font-size: 12px; color: var(--ink-mute); font-family: var(--mono); }
.gauge.lap .g-big { color: var(--cyan); }
.gauge.pos .g-big { color: var(--amber); }

/* 반원형 속도계(택오미터) */
.tach { align-items: center; padding-bottom: 4px; }
.tach svg { width: 160px; height: 92px; display: block; }
.tach .g-caption {
  font-family: var(--mono); font-weight: 800; font-size: 22px; letter-spacing: 1px;
  color: var(--red-glow); text-shadow: 0 0 14px rgba(255,59,86,.7); margin-top: -6px;
}
.tach .g-caption small { font-size: 10px; color: var(--ink-mute); letter-spacing: 2px; }
#needle { transition: transform .6s cubic-bezier(.22,1,.36,1); transform-origin: 80px 78px; }

/* 서킷 트랙 */
.track-wrap { position: relative; margin-top: 2px; }
.track {
  position: relative; height: 96px; border-radius: 12px;
  background:
    linear-gradient(180deg, #22262f, #171a22);
  border: 1px solid #333a4c;
  overflow: hidden;
}
.track::before { /* 도로 노면 질감 */
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, rgba(0,0,0,.18) 0 3px, transparent 3px 30px);
}
.track .center-line { /* 중앙 점선 */
  position: absolute; left: 3%; right: 8%; top: 50%; height: 4px; transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, var(--amber) 0 26px, transparent 26px 52px);
  opacity: .8; border-radius: 4px;
}
.track .start-flag, .track .finish-flag {
  position: absolute; top: 0; bottom: 0; width: 16px;
  background-image:
    linear-gradient(45deg,#000 25%,transparent 25%,transparent 75%,#000 75%),
    linear-gradient(45deg,#000 25%,#fff 25%,#fff 75%,#000 75%);
  background-size: 8px 8px; background-position: 0 0, 4px 4px; background-color: #fff;
  opacity: .85;
}
.track .start-flag { left: 0; }
.track .finish-flag { right: 0; }
.track .cp {
  position: absolute; top: 50%; transform: translate(-50%,-50%);
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #0d1017; border: 2px solid #3a4358; font-size: 14px; z-index: 2;
  transition: .3s;
}
.track .cp .cp-num { font-family: var(--mono); font-size: 11px; font-weight: 800; color: var(--ink-mute); }
.track .cp.done { border-color: var(--lime); background: #0f2019; box-shadow: 0 0 12px rgba(56,255,155,.4); }
.track .cp.done .cp-num { color: var(--lime); }
.track .cp.current { border-color: var(--amber); background: #241f0c; box-shadow: 0 0 16px rgba(255,210,30,.6); transform: translate(-50%,-50%) scale(1.15); }
.track .cp.current .cp-num { color: var(--amber); }
.track .car {
  position: absolute; top: 50%; transform: translate(-50%,-50%);
  font-size: 30px; z-index: 5; left: 4%;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.6));
  transition: left .8s cubic-bezier(.22,1,.36,1);
}
.track .car::after { /* 스피드라인 */
  content: ""; position: absolute; right: 100%; top: 50%; transform: translateY(-50%);
  width: 34px; height: 3px; margin-right: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan));
  border-radius: 3px; opacity: .7;
}
.track.moving .car { animation: bump .4s ease; }
@keyframes bump { 0%,100%{ margin-top:0 } 50%{ margin-top:-4px } }

.hud-caption {
  margin-top: 12px; font-size: 13px; color: var(--ink-dim);
  display: flex; align-items: center; gap: 8px;
}
.hud-caption b { color: var(--amber); }

/* =========================================================
   홈(피트) 화면
   ========================================================= */
.hero {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 30px 26px; margin-bottom: 18px; position: relative; overflow: hidden;
  background:
    radial-gradient(700px 300px at 90% 0%, rgba(255,39,64,.18), transparent 60%),
    linear-gradient(180deg, var(--panel2), var(--panel));
  box-shadow: var(--shadow);
}
.hero::after { /* 체커 스트립 */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px;
  background-image:
    linear-gradient(45deg,#000 25%,transparent 25%,transparent 75%,#000 75%),
    linear-gradient(45deg,#000 25%,var(--amber) 25%,var(--amber) 75%,#000 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px; background-color: var(--amber);
}
.hero .eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 3px; font-weight: 800;
  color: var(--red-glow); display: inline-flex; align-items: center; gap: 8px;
}
.hero .eyebrow .flag { font-size: 15px; }
.hero h1 { font-size: 34px; margin: 10px 0 8px; letter-spacing: -.5px; line-height: 1.15; }
.hero p.lead { color: var(--ink-dim); font-size: 15px; line-height: 1.7; max-width: 640px; margin: 0 0 6px; }
.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #0c0f16; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 13px; font-size: 13px; font-weight: 700; color: var(--ink-dim);
}
.chip b { color: var(--amber); font-family: var(--mono); }

.home-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.goals-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 10px;
  margin: 18px 0 4px;
}
.goal-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; display: flex; gap: 10px; align-items: flex-start;
}
.goal-card .g-ic { font-size: 20px; }
.goal-card .g-tx b { display: block; font-size: 14px; margin-bottom: 3px; }
.goal-card .g-tx span { font-size: 12.5px; color: var(--ink-mute); line-height: 1.5; }

.reflist { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.ref-btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-dim);
  padding: 9px 14px; border-radius: 10px; font-weight: 700; font-size: 13px; transition: .15s;
}
.ref-btn:hover { color: var(--ink); border-color: var(--amber); }

/* ---------- 공용 버튼 ---------- */
.btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 11px 20px; border-radius: 11px; font-weight: 800; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px; transition: .16s; letter-spacing: .2px;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(180deg, var(--red-glow), var(--red));
  border-color: var(--red); color: #fff; box-shadow: 0 8px 22px rgba(255,39,64,.35);
}
.btn.primary:hover { box-shadow: 0 12px 30px rgba(255,39,64,.5); }
.btn.go {
  background: linear-gradient(180deg, #46ffa6, #17c977);
  border-color: var(--lime); color: #06231a; box-shadow: 0 8px 22px rgba(56,255,155,.3);
}
.btn.amber { background: var(--amber); border-color: var(--amber); color: #14140a; }
.btn.ghost { background: transparent; color: var(--ink-dim); }
.btn.ghost:hover { color: var(--ink); border-color: #3a4358; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

/* =========================================================
   미션 러너
   ========================================================= */
.mission-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 18px 2px 12px; flex-wrap: wrap;
}
.mission-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 2px; font-weight: 800;
  padding: 6px 12px; border-radius: 999px; border: 1px solid;
}
.mission-tag.watch  { color: var(--cyan);  border-color: rgba(33,230,255,.4);  background: rgba(33,230,255,.08); }
.mission-tag.quiz   { color: var(--amber); border-color: rgba(255,210,30,.4);  background: rgba(255,210,30,.08); }
.mission-tag.follow { color: var(--lime);  border-color: rgba(56,255,155,.4);  background: rgba(56,255,155,.08); }
.mission-tag.build  { color: var(--red-glow); border-color: rgba(255,59,86,.4); background: rgba(255,59,86,.08); }
.mission-tag.devlog { color: #c39bff; border-color: rgba(195,155,255,.4); background: rgba(195,155,255,.08); }
.mission-count { font-family: var(--mono); font-size: 12px; color: var(--ink-mute); font-weight: 700; }

.card {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin-top: 12px;
}
.card h2 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.3px; }
.card .sub { color: var(--ink-dim); font-size: 14px; margin: 0 0 16px; line-height: 1.6; }
.role-line { color: var(--ink-mute); font-size: 13px; margin-bottom: 14px; }

/* watch */
.video-card video {
  width: 100%; border-radius: 12px; background: #05060a; display: block;
  border: 1px solid var(--line); aspect-ratio: 16/9;
}
.video-meta {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-dim);
}
.transcript { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.transcript summary {
  cursor: pointer; padding: 12px 14px; font-weight: 700; font-size: 13.5px;
  color: var(--ink-dim); background: #0c0f16; list-style: none;
}
.transcript summary::-webkit-details-marker { display: none; }
.transcript summary::before { content: "📝 "; }
.transcript[open] summary { border-bottom: 1px solid var(--line); color: var(--ink); }
.transcript .tbody {
  padding: 16px; font-size: 14px; line-height: 1.9; color: var(--ink-dim);
  max-height: 320px; overflow: auto; white-space: pre-wrap;
}

/* quiz */
.quiz-q { padding: 16px 0; border-bottom: 1px dashed var(--line); }
.quiz-q:last-of-type { border-bottom: none; }
.qn { font-family: var(--mono); font-weight: 800; color: var(--amber); font-size: 13px; }
.qt { font-size: 16px; font-weight: 700; margin: 4px 0 12px; line-height: 1.5; }
.choices { display: grid; gap: 8px; }
.choice {
  display: flex; align-items: center; gap: 11px; text-align: left; width: 100%;
  background: #0c0f16; border: 1px solid var(--line); color: var(--ink);
  padding: 12px 14px; border-radius: 10px; font-size: 14.5px; transition: .13s;
}
.choice:hover:not(:disabled) { border-color: #45506a; }
.choice .mark {
  flex: none; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center;
  background: var(--panel2); border: 1px solid var(--line); font-family: var(--mono);
  font-weight: 800; font-size: 12px; color: var(--ink-dim);
}
.choice.sel { border-color: var(--amber); background: rgba(255,210,30,.08); }
.choice.sel .mark { background: var(--amber); color: #14140a; border-color: var(--amber); }
.choice.correct { border-color: var(--lime); background: rgba(56,255,155,.12); }
.choice.correct .mark { background: var(--lime); color: #06231a; border-color: var(--lime); }
.choice.wrong { border-color: var(--red); background: rgba(255,39,64,.12); }
.choice.wrong .mark { background: var(--red); color: #fff; border-color: var(--red); }
.choice:disabled { cursor: default; }
.explain {
  display: none; margin-top: 10px; padding: 12px 14px; border-radius: 10px;
  background: #0c0f16; border: 1px solid var(--line); font-size: 13.5px; line-height: 1.7; color: var(--ink-dim);
}
.quiz.graded .explain { display: block; }
.verdict { font-weight: 800; margin-right: 8px; padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.verdict.ok { background: rgba(56,255,155,.15); color: var(--lime); }
.verdict.no { background: rgba(255,39,64,.15); color: var(--red-glow); }
.quiz-foot {
  display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap;
  padding-top: 16px; border-top: 1px solid var(--line);
}
.quiz-score { font-family: var(--mono); color: var(--ink-dim); font-weight: 700; }
.quiz-score .num { color: var(--amber); font-size: 20px; }

/* follow */
.steps-list { display: grid; gap: 9px; }
.stepitem {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px;
  background: #0c0f16; border: 1px solid var(--line); border-radius: 10px; transition: .15s;
}
.stepitem.checked { border-color: var(--lime); background: rgba(56,255,155,.07); }
.stepitem input { display: none; }
.stepitem .box {
  flex: none; width: 24px; height: 24px; border-radius: 7px; border: 2px solid #3a4358;
  display: grid; place-items: center; margin-top: 1px; transition: .15s;
  font-family: var(--mono); font-weight: 800; font-size: 12px; color: var(--ink-mute);
}
.stepitem.checked .box { background: var(--lime); border-color: var(--lime); color: #06231a; }
.stepitem .stx { font-size: 14.5px; line-height: 1.55; }
.stepitem.checked .stx { color: var(--ink-dim); }
.follow-prog {
  margin-top: 14px; font-family: var(--mono); font-size: 13px; color: var(--ink-dim); font-weight: 700;
}
.follow-prog b { color: var(--lime); }

/* build / devlog */
.hint-list { margin: 6px 0 16px; padding: 0; list-style: none; display: grid; gap: 7px; }
.hint-list li {
  font-size: 13.5px; color: var(--ink-dim); line-height: 1.6;
  padding: 9px 12px; background: #0c0f16; border: 1px solid var(--line);
  border-left: 3px solid var(--amber); border-radius: 8px;
}
.check-list { margin: 4px 0 16px; padding: 0; list-style: none; display: grid; gap: 6px; }
.check-list li { font-size: 13.5px; color: var(--ink-dim); display: flex; gap: 8px; }
.check-list li::before { content: "✓"; color: var(--lime); font-weight: 800; }
.field { margin: 14px 0; }
.field label { display: block; font-size: 13px; font-weight: 800; margin-bottom: 7px; color: var(--ink); }
.field label .req { color: var(--red-glow); }
.field textarea {
  width: 100%; min-height: 96px; resize: vertical; font-family: var(--sans); font-size: 14px;
  line-height: 1.6; color: var(--ink); background: #0c0f16; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 13px;
}
.field textarea:focus { border-color: var(--amber); outline: none; }
.devlog-block { padding: 6px 0 16px; border-bottom: 1px dashed var(--line); }
.devlog-block:last-of-type { border-bottom: none; }
.devlog-q { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.devlog-hint { font-size: 12.5px; color: var(--ink-mute); margin-bottom: 8px; }
.saved-tag {
  font-family: var(--mono); font-size: 12px; color: var(--lime); font-weight: 700;
  opacity: 0; transition: .2s;
}
.saved-tag.show { opacity: 1; }

/* 미션 하단 내비 */
.mission-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 20px; flex-wrap: wrap;
}
.foot-coach {
  font-size: 13px; color: var(--ink-dim); display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 200px;
}
.foot-coach .cf { font-size: 16px; }

/* =========================================================
   기록실 / 포디움
   ========================================================= */
.podium-hero {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; margin-bottom: 18px; text-align: center; position: relative; overflow: hidden;
  background:
    radial-gradient(600px 300px at 50% -20%, rgba(255,210,30,.16), transparent 60%),
    linear-gradient(180deg, var(--panel2), var(--panel));
}
.podium-hero h1 { font-size: 26px; margin: 6px 0; }
.podium-hero p { color: var(--ink-dim); font-size: 14px; margin: 4px 0 0; }
.podium {
  display: flex; align-items: flex-end; justify-content: center; gap: 8px; margin: 22px auto 6px; max-width: 380px;
}
.pod { flex: 1; border-radius: 10px 10px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 10px 6px; border: 1px solid var(--line); border-bottom: none; }
.pod .who { font-size: 22px; margin-bottom: 6px; }
.pod .rank { font-family: var(--mono); font-weight: 800; font-size: 16px; }
.pod.p1 { height: 120px; background: linear-gradient(180deg, rgba(255,210,30,.25), rgba(255,210,30,.05)); }
.pod.p1 .rank { color: var(--amber); }
.pod.p2 { height: 92px; background: linear-gradient(180deg, rgba(200,210,230,.18), transparent); }
.pod.p2 .rank { color: #cdd6ea; }
.pod.p3 { height: 74px; background: linear-gradient(180deg, rgba(205,130,80,.18), transparent); }
.pod.p3 .rank { color: #e0965a; }

.badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 10px; margin: 6px 0; }
.badge {
  background: #0c0f16; border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  display: flex; gap: 11px; align-items: center; opacity: .38; transition: .2s;
}
.badge.earned { opacity: 1; border-color: var(--amber); box-shadow: 0 0 16px rgba(255,210,30,.15); }
.badge .b-ic { font-size: 26px; filter: grayscale(1); }
.badge.earned .b-ic { filter: none; }
.badge .b-tx b { display: block; font-size: 13.5px; }
.badge .b-tx span { font-size: 11.5px; color: var(--ink-mute); }

.rec-section { margin-top: 20px; }
.rec-section > h3 {
  font-size: 15px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); letter-spacing: 1px; color: var(--ink-dim);
}
.rec-item {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 15px; margin-bottom: 8px;
}
.rec-item .rq { font-weight: 700; font-size: 13.5px; color: var(--ink); margin-bottom: 5px; }
.rec-item .ra { font-size: 13.5px; color: var(--ink-dim); white-space: pre-wrap; line-height: 1.6; }
.rec-empty { color: var(--ink-mute); font-size: 13px; padding: 12px; text-align: center; border: 1px dashed var(--line); border-radius: 10px; }

/* =========================================================
   모달
   ========================================================= */
.modal { position: fixed; inset: 0; z-index: 60; display: none; }
.modal.open { display: block; }
.modal-bg { position: absolute; inset: 0; background: rgba(4,5,9,.72); backdrop-filter: blur(3px); }
.modal-box {
  position: absolute; inset: 4% 5%; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.modal-hd { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 800; }
.modal-x { border: none; background: var(--panel2); color: var(--ink); width: 32px; height: 32px; border-radius: 8px; font-size: 15px; }
.modal-box iframe { flex: 1; width: 100%; border: none; background: #fff; }

/* =========================================================
   이펙트 레이어 (반드시 클릭 통과)
   ========================================================= */
.fx-layer { position: fixed; inset: 0; z-index: 50; pointer-events: none; overflow: hidden; }
.fx-layer * { pointer-events: none; }
.crew {
  position: fixed; left: 18px; bottom: 18px; display: flex; align-items: flex-end; gap: 8px; opacity: .96;
}
.crew-face { font-size: 34px; filter: drop-shadow(0 3px 6px rgba(0,0,0,.5)); }
.crew-bubble {
  background: var(--amber); color: #14140a; font-weight: 800; font-size: 12.5px;
  padding: 8px 12px; border-radius: 12px 12px 12px 3px; max-width: 230px; line-height: 1.4;
  box-shadow: 0 8px 20px rgba(0,0,0,.4);
}
/* 부스트 플래시 */
.boost {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%,-50%) scale(.6);
  font-family: var(--mono); font-weight: 800; font-size: 46px; letter-spacing: 2px;
  color: var(--amber); text-shadow: 0 0 30px rgba(255,210,30,.9);
  animation: boostpop 1s ease forwards;
}
@keyframes boostpop {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.4); }
  30% { opacity: 1; transform: translate(-50%,-52%) scale(1.1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%,-64%) scale(1); }
}
.confetti { position: fixed; top: -20px; width: 10px; height: 14px; opacity: .95; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: .2; } }
.badge-pop {
  position: fixed; left: 50%; top: 30%; transform: translate(-50%,-50%);
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--amber); border-radius: 14px; padding: 16px 22px; text-align: center;
  box-shadow: 0 0 40px rgba(255,210,30,.35); animation: badgepop 2.2s ease forwards;
}
.badge-pop .bp-ic { font-size: 40px; }
.badge-pop .bp-name { font-weight: 800; margin-top: 4px; color: var(--amber); }
.badge-pop .bp-sub { font-size: 11px; color: var(--ink-mute); font-family: var(--mono); letter-spacing: 1px; }
@keyframes badgepop {
  0% { opacity: 0; transform: translate(-50%,-40%) scale(.8); }
  12% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  82% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%,-56%) scale(.98); }
}

/* 토스트 (클릭 통과) */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: #0c0f16; border: 1px solid var(--amber); color: var(--ink);
  padding: 11px 18px; border-radius: 12px; font-weight: 700; font-size: 13.5px;
  box-shadow: var(--shadow); opacity: 0; transition: .25s; z-index: 55; pointer-events: none;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================
   반응형
   ========================================================= */
@media (max-width: 720px) {
  .hud-gauges { grid-template-columns: 1fr 1fr; }
  .tach { grid-column: 1 / -1; }
  .hero h1 { font-size: 26px; }
  .topnav .nav-btn { padding: 7px 10px; font-size: 12px; }
  .brand-txt i { display: none; }
}
