/* =========================================================
   무한의 계단 · 등반 타워 LMS — 던전/미스틱 픽셀아트 테마
   세로 등반. 딥 퍼플·청록, 횃불, 돌계단, 은은한 발광.
   ========================================================= */
:root {
  --bg0: #0c0818;
  --bg1: #140f28;
  --panel: #1a1436;
  --panel2: #221a44;
  --stone: #2a2348;
  --stone-hi: #3a3162;
  --stone-lo: #17122c;
  --line: #362c5e;
  --purple: #8a5cf0;
  --purple-dim: #5b3fa8;
  --glow: #b98bff;
  --teal: #2fd3c4;
  --teal-dim: #1c9a90;
  --gold: #f4c04a;
  --moss: #6fae45;
  --danger: #f0607a;
  --txt: #ece7ff;
  --muted: #a99fd0;
  --muted2: #7d739e;
  --ok: #43e6b0;
  --shadow: 0 12px 34px rgba(0,0,0,.55);
  --px: 3px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", system-ui, sans-serif;
  color: var(--txt);
  background: var(--bg0);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
button { font-family: inherit; cursor: pointer; }
b { font-weight: 800; }

/* ---------- 던전 배경 ---------- */
.cave {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(1100px 700px at 70% -10%, #24184a 0%, transparent 60%),
    radial-gradient(900px 600px at 10% 110%, #10233a 0%, transparent 55%),
    linear-gradient(180deg, #0e0920 0%, #0b0716 100%);
}
.cave-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(3px 3px at 20% 30%, rgba(185,139,255,.5), transparent 60%),
    radial-gradient(2px 2px at 80% 20%, rgba(47,211,196,.45), transparent 60%),
    radial-gradient(2px 2px at 60% 70%, rgba(244,192,74,.35), transparent 60%),
    radial-gradient(2px 2px at 35% 85%, rgba(185,139,255,.35), transparent 60%);
  opacity: .8; animation: twinkle 6s ease-in-out infinite;
}
@keyframes twinkle { 0%,100%{opacity:.55} 50%{opacity:.95} }
.embers { position: absolute; inset: 0; pointer-events: none; }
.ember {
  position: absolute; width: 3px; height: 3px; border-radius: 1px;
  background: var(--gold); box-shadow: 0 0 6px 1px rgba(244,192,74,.7);
  bottom: -10px; opacity: 0; animation: rise linear infinite;
}
@keyframes rise {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  15% { opacity: .9; }
  100% { transform: translateY(-105vh) translateX(14px) scale(.4); opacity: 0; }
}

/* ---------- 앱 셸 ---------- */
.app {
  position: relative; z-index: 1;
  height: 100vh; display: flex; flex-direction: column;
}

/* ---------- 상단바 ---------- */
.topbar {
  flex: none; display: flex; align-items: center; gap: 16px;
  padding: 10px 18px;
  background: linear-gradient(180deg, rgba(26,20,54,.96), rgba(20,15,40,.92));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  flex-wrap: wrap;
}
.menu-toggle {
  display: none; background: var(--stone); color: var(--txt);
  border: 1px solid var(--line); border-radius: 8px; width: 40px; height: 40px; font-size: 18px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-badge {
  width: 42px; height: 42px; display: grid; place-items: center; font-size: 22px;
  background: radial-gradient(circle at 35% 30%, #3a2f66, #1c1436);
  border: 1px solid var(--purple-dim); border-radius: 10px;
  box-shadow: inset 0 0 12px rgba(138,92,240,.4), 0 0 14px rgba(138,92,240,.25);
}
.brand-txt .kicker { font-size: 10px; letter-spacing: 2px; color: var(--glow); font-weight: 800; text-transform: uppercase; opacity: .85; }
.brand-txt .name { font-size: 17px; font-weight: 800; letter-spacing: .3px; }

.altimeter {
  min-width: 190px; padding: 6px 14px; border-radius: 12px;
  background: linear-gradient(180deg, var(--stone), var(--stone-lo));
  border: 1px solid var(--line);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.05), inset -2px -2px 0 rgba(0,0,0,.4);
}
.alt-read { display: flex; align-items: baseline; gap: 3px; font-variant-numeric: tabular-nums; }
.alt-now { font-size: 22px; font-weight: 900; color: var(--teal); text-shadow: 0 0 10px rgba(47,211,196,.5); }
.alt-sep { color: var(--muted2); }
.alt-tot { font-size: 15px; color: var(--muted); font-weight: 700; }
.alt-unit { font-size: 12px; color: var(--muted); margin-left: 2px; }
.alt-bar { height: 7px; margin: 4px 0 3px; border-radius: 4px; background: #0e0a1e; overflow: hidden; border: 1px solid var(--stone-lo); }
.alt-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--teal-dim), var(--teal), var(--glow));
  box-shadow: 0 0 10px rgba(47,211,196,.6); transition: width .6s cubic-bezier(.2,.8,.2,1);
}
.alt-cap { font-size: 10.5px; color: var(--muted); letter-spacing: .3px; }

.stats { display: flex; gap: 8px; margin-left: auto; }
.stat {
  display: flex; align-items: center; gap: 5px; padding: 7px 12px; border-radius: 10px;
  background: var(--panel2); border: 1px solid var(--line); font-size: 13px; font-weight: 700;
}
.stat .s-ic { font-size: 14px; }
.stat.xp .s-ic { color: var(--gold); text-shadow: 0 0 8px rgba(244,192,74,.6); }
.stat.xp b { color: var(--gold); }
.stat .s-u { font-size: 10px; color: var(--muted); }

.views { display: flex; gap: 4px; padding: 3px; background: var(--bg1); border: 1px solid var(--line); border-radius: 11px; }
.view-tab {
  background: transparent; color: var(--muted); border: 0; padding: 8px 15px; border-radius: 8px;
  font-size: 13px; font-weight: 700;
}
.view-tab.active { background: linear-gradient(180deg, var(--purple), var(--purple-dim)); color: #fff; box-shadow: 0 0 14px rgba(138,92,240,.4); }
.tb-btn {
  background: var(--stone); color: var(--muted); border: 1px solid var(--line); border-radius: 9px;
  width: 40px; height: 40px; font-size: 17px;
}
.tb-btn:hover { color: var(--txt); border-color: var(--purple-dim); }

/* ---------- 바디 (등반로 + 무대) ---------- */
.body { flex: 1; display: flex; min-height: 0; }

/* ---------- 등반로(타워) ---------- */
.rail {
  flex: none; width: 320px; display: flex; flex-direction: column; min-height: 0;
  background: linear-gradient(180deg, rgba(20,15,40,.9), rgba(14,10,28,.92));
  border-right: 1px solid var(--line);
}
.rail-head {
  flex: none; padding: 13px 18px; font-size: 12px; letter-spacing: 3px; font-weight: 800;
  color: var(--glow); text-transform: uppercase; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
.rail-head .rh-ic { font-size: 15px; }
.tower { flex: 1; overflow-y: auto; padding: 20px 16px 40px; display: flex; flex-direction: column; }
.tower::-webkit-scrollbar { width: 9px; }
.tower::-webkit-scrollbar-thumb { background: var(--stone-hi); border-radius: 5px; }
.tower::-webkit-scrollbar-track { background: transparent; }

/* 정상/지상 캡 */
.cap {
  text-align: center; padding: 12px; border-radius: 12px; margin: 0 6px 6px;
  font-weight: 800; font-size: 13px; letter-spacing: .4px;
}
.cap.summit {
  background: linear-gradient(180deg, rgba(138,92,240,.25), transparent);
  border: 1px dashed var(--purple-dim); color: var(--glow);
}
.cap.summit.lit { background: linear-gradient(180deg, rgba(244,192,74,.28), transparent); border-color: var(--gold); color: var(--gold); box-shadow: 0 0 22px rgba(244,192,74,.35); }
.cap.ground {
  margin-top: auto; background: linear-gradient(0deg, rgba(111,174,69,.16), transparent);
  border: 1px dashed var(--teal-dim); color: var(--muted); position: relative;
}
.cap .cap-t { display: block; }
.cap .cap-s { display: block; font-size: 10px; font-weight: 600; color: var(--muted2); margin-top: 2px; letter-spacing: 1px; }

/* 층계참(랜딩) */
.landing {
  display: flex; align-items: center; gap: 9px; margin: 8px 4px; padding: 9px 13px;
  border-radius: 10px; background: repeating-linear-gradient(45deg, #241a44 0 8px, #1d1638 8px 16px);
  border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700;
}
.landing .ld-ic { font-size: 15px; }
.landing.lit { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 16px rgba(244,192,74,.25); }
.landing.lit .ld-ic { filter: drop-shadow(0 0 5px rgba(244,192,74,.7)); }

/* 계단 노드(미션) */
.floor {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 3px 2px; margin: 3px 0; background: none; border: 0; text-align: left; color: inherit;
}
.floor.zig-r { flex-direction: row-reverse; }
.floor .fl-step {
  flex: none; width: 62px; height: 44px; position: relative;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--stone-hi), var(--stone));
  border: 1px solid var(--stone-lo); border-radius: 3px;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.06), inset -3px -3px 0 rgba(0,0,0,.45), 0 4px 0 var(--stone-lo);
  transition: transform .15s, box-shadow .3s;
}
.floor .fl-num { font-size: 15px; font-weight: 900; color: var(--muted); text-shadow: 0 1px 0 #000; }
.floor .fl-info { flex: 1; min-width: 0; }
.floor.zig-r .fl-info { text-align: right; }
.fl-ico { font-size: 13px; margin-right: 5px; }
.fl-label { font-size: 12.5px; font-weight: 700; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-tag {
  display: inline-block; margin-top: 3px; font-size: 9.5px; font-weight: 800; letter-spacing: .5px;
  padding: 1px 7px; border-radius: 20px; background: var(--panel2); color: var(--muted2); border: 1px solid var(--line);
}
.floor:hover .fl-step { transform: translateY(-2px); }
.floor:hover .fl-label { color: var(--txt); }

/* 완료된 계단: 발광 */
.floor.done .fl-step {
  background: linear-gradient(180deg, #2b6f68, #1c5b55);
  border-color: var(--teal-dim);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.12), inset -3px -3px 0 rgba(0,0,0,.4), 0 4px 0 #123f3a, 0 0 16px rgba(47,211,196,.4);
}
.floor.done .fl-num { color: #eafffb; }
.floor.done .fl-label { color: #cfeee9; }

/* 현재 위치 */
.floor.active .fl-step {
  border-color: var(--gold);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.1), inset -3px -3px 0 rgba(0,0,0,.4), 0 4px 0 var(--stone-lo), 0 0 20px rgba(244,192,74,.5);
  animation: activePulse 1.8s ease-in-out infinite;
}
.floor.active .fl-num { color: var(--gold); }
.floor.active .fl-label { color: #fff; }
@keyframes activePulse { 0%,100%{ box-shadow: inset 2px 2px 0 rgba(255,255,255,.1), inset -3px -3px 0 rgba(0,0,0,.4), 0 4px 0 var(--stone-lo), 0 0 12px rgba(244,192,74,.4);} 50%{ box-shadow: inset 2px 2px 0 rgba(255,255,255,.1), inset -3px -3px 0 rgba(0,0,0,.4), 0 4px 0 var(--stone-lo), 0 0 26px rgba(244,192,74,.75);} }

/* 픽셀 아바타(등반가) */
.climber {
  position: absolute; width: 30px; height: 34px; top: -30px; left: 50%; margin-left: -15px;
  background-repeat: no-repeat; background-size: contain; background-position: center bottom;
  image-rendering: pixelated; image-rendering: crisp-edges;
  filter: drop-shadow(0 0 7px rgba(185,139,255,.65));
  animation: bob 1.6s ease-in-out infinite; z-index: 5;
}
.floor.zig-r .climber { left: auto; right: 50%; margin-right: -15px; margin-left: 0; }
.cap.ground .climber { top: -30px; }
@keyframes bob { 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-4px); } }
.climber.hop { animation: hop .7s ease; }
@keyframes hop {
  0% { transform: translateY(14px) scale(.9); }
  40% { transform: translateY(-16px) scale(1.05); }
  70% { transform: translateY(-4px); }
  100% { transform: translateY(0) scale(1); }
}

/* ---------- 무대 ---------- */
.stage-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.scroll { flex: 1; overflow-y: auto; }
.scroll::-webkit-scrollbar { width: 11px; }
.scroll::-webkit-scrollbar-thumb { background: var(--stone-hi); border-radius: 6px; }
.stage { max-width: 1240px; margin: 0 auto; padding: 30px 30px 60px; }

.step-hd { margin-bottom: 20px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 2px; font-weight: 800; color: var(--glow); text-transform: uppercase; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 2px; background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.step-hd h1 { margin: 10px 0 6px; font-size: 26px; font-weight: 900; letter-spacing: -.3px; }
.step-hd .sub { margin: 0; color: var(--muted); font-size: 14px; }

.card {
  background: linear-gradient(180deg, var(--panel), var(--bg1));
  border: 1px solid var(--line); border-radius: 16px; padding: 22px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }

/* 홈(타워 개요) */
.home-hero {
  text-align: center; padding: 40px 28px; border-radius: 20px; margin-bottom: 22px;
  background:
    radial-gradient(600px 300px at 50% -20%, rgba(138,92,240,.35), transparent 70%),
    linear-gradient(180deg, var(--panel2), var(--bg1));
  border: 1px solid var(--purple-dim); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.home-hero .h-badge { font-size: 46px; filter: drop-shadow(0 0 16px rgba(138,92,240,.6)); }
.home-hero h1 { margin: 12px 0 8px; font-size: 30px; font-weight: 900; }
.home-hero .h-intro { max-width: 560px; margin: 0 auto; color: var(--muted); font-size: 14.5px; }
.home-alt { display: inline-flex; align-items: center; gap: 14px; margin-top: 20px; padding: 12px 22px; border-radius: 14px; background: rgba(12,8,24,.6); border: 1px solid var(--line); }
.home-alt .ha-big { font-size: 30px; font-weight: 900; color: var(--teal); }
.home-alt .ha-lbl { font-size: 12px; color: var(--muted); text-align: left; }
.home-alt .ha-lbl b { color: var(--txt); }

.zones { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }
.zone {
  padding: 18px; border-radius: 15px; background: linear-gradient(180deg, var(--panel), var(--bg1));
  border: 1px solid var(--line); box-shadow: var(--shadow); position: relative;
}
.zone .z-top { display: flex; align-items: center; justify-content: space-between; }
.zone .z-num { font-size: 11px; letter-spacing: 1.5px; font-weight: 800; color: var(--glow); }
.zone .z-state { font-size: 11px; font-weight: 800; color: var(--muted2); padding: 3px 9px; border-radius: 20px; border: 1px solid var(--line); background: var(--bg1); }
.zone.cleared .z-state { color: var(--gold); border-color: var(--gold); }
.zone h3 { margin: 8px 0 6px; font-size: 16px; }
.zone .z-sub { color: var(--muted); font-size: 12.5px; min-height: 34px; }
.zone .z-bar { height: 6px; margin-top: 10px; border-radius: 4px; background: #0e0a1e; overflow: hidden; }
.zone .z-fill { height: 100%; background: linear-gradient(90deg, var(--teal-dim), var(--teal)); border-radius: 4px; }
.zone .z-meta { display: flex; gap: 10px; margin-top: 8px; font-size: 11px; color: var(--muted2); }

.goals { margin-top: 4px; }
.goals h3, .card h3 { margin: 0 0 12px; font-size: 15px; color: var(--glow); }
.goals ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.goals li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.goals .g-ic { color: var(--teal); font-weight: 900; }

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.reflist { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.ref-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 11px;
  background: var(--stone); color: var(--txt); border: 1px solid var(--line); font-size: 13px; font-weight: 700;
}
.ref-btn:hover { border-color: var(--purple); box-shadow: 0 0 14px rgba(138,92,240,.3); }

/* 영상 */
.video-card video { width: 100%; border-radius: 12px; background: #000; display: block; aspect-ratio: 16/9; }
.video-meta { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.role-pill { font-size: 11px; font-weight: 800; padding: 4px 11px; border-radius: 20px; background: linear-gradient(180deg, var(--purple), var(--purple-dim)); color: #fff; }
.vtitle { font-size: 13px; color: var(--muted); }
.transcript { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.transcript summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--glow); list-style: none; user-select: none; }
.transcript summary::-webkit-details-marker { display: none; }
.transcript summary::before { content: "📜 "; }
.transcript .tbody { margin-top: 12px; font-size: 13.5px; line-height: 1.85; color: var(--muted); white-space: pre-wrap; max-height: 320px; overflow-y: auto; padding-right: 8px; }

/* 퀴즈 */
.quiz-q { padding: 16px 0; border-bottom: 1px dashed var(--line); }
.quiz-q:last-of-type { border-bottom: 0; }
.qn { font-size: 11px; font-weight: 900; color: var(--purple); letter-spacing: 1px; }
.qt { font-size: 15px; font-weight: 700; margin: 4px 0 12px; }
.choices { display: grid; gap: 9px; }
.choice {
  display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 11px; text-align: left;
  background: var(--bg1); border: 1px solid var(--line); color: var(--txt); font-size: 14px; transition: .12s;
}
.choice .mark { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; background: var(--stone); font-weight: 800; font-size: 12px; color: var(--muted); }
.choice:hover:not(:disabled) { border-color: var(--purple); }
.choice.sel { border-color: var(--purple); background: rgba(138,92,240,.15); }
.choice.sel .mark { background: var(--purple); color: #fff; }
.choice.correct { border-color: var(--ok); background: rgba(67,230,176,.13); }
.choice.correct .mark { background: var(--ok); color: #06231a; }
.choice.wrong { border-color: var(--danger); background: rgba(240,96,122,.12); }
.choice.wrong .mark { background: var(--danger); color: #fff; }
.choice:disabled { cursor: default; }
.explain { display: none; margin-top: 11px; padding: 12px 14px; border-radius: 10px; background: rgba(12,8,24,.5); border: 1px solid var(--line); font-size: 13px; color: var(--muted); line-height: 1.7; }
.quiz.graded .explain { display: block; }
.verdict { display: inline-block; font-weight: 900; font-size: 11px; padding: 2px 9px; border-radius: 20px; margin-right: 8px; }
.verdict.ok { background: var(--ok); color: #06231a; }
.verdict.no { background: var(--danger); color: #fff; }
.quiz-foot { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.quiz-score { font-size: 13px; color: var(--muted); }
.quiz-score .num { font-size: 20px; font-weight: 900; color: var(--teal); }

/* 따라하기 */
.follow-intro { color: var(--muted); font-size: 14px; margin: -6px 0 16px; }
.follow-steps { display: grid; gap: 10px; counter-reset: fs; }
.follow-step {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 11px;
  background: var(--bg1); border: 1px solid var(--line); cursor: pointer; transition: .12s;
}
.follow-step:hover { border-color: var(--teal-dim); }
.follow-step input { display: none; }
.follow-step .box { flex: none; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--stone-hi); display: grid; place-items: center; font-size: 14px; color: transparent; transition: .12s; }
.follow-step.on { background: rgba(47,211,196,.1); border-color: var(--teal-dim); }
.follow-step.on .box { background: var(--teal); border-color: var(--teal); color: #06231a; }
.follow-step .fs-t { font-size: 14px; line-height: 1.6; }
.follow-step.on .fs-t { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--teal-dim); }
.follow-prog { margin-top: 14px; font-size: 12px; color: var(--muted); }

/* 실습(빌드) */
.brief { font-size: 14.5px; line-height: 1.75; color: var(--muted); margin: -4px 0 16px; }
.hint-list, .check-list { display: grid; gap: 8px; margin: 0 0 6px; padding: 0; list-style: none; }
.hint-list li { display: flex; gap: 9px; font-size: 13.5px; color: var(--muted); padding: 9px 12px; background: var(--bg1); border: 1px solid var(--line); border-radius: 9px; }
.hint-list .h-ic { color: var(--gold); }
.build-check { display: flex; gap: 10px; align-items: center; padding: 9px 12px; background: var(--bg1); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: 13.5px; }
.build-check input { display: none; }
.build-check .box { flex: none; width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--stone-hi); display: grid; place-items: center; font-size: 12px; color: transparent; }
.build-check.on .box { background: var(--teal); border-color: var(--teal); color: #06231a; }
.build-check.on { color: var(--muted); }
.sect-label { font-size: 12px; font-weight: 800; letter-spacing: .5px; color: var(--glow); margin: 18px 0 9px; }
.field { margin-top: 6px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
textarea {
  width: 100%; min-height: 88px; resize: vertical; padding: 12px 14px; border-radius: 11px;
  background: var(--bg0); border: 1px solid var(--line); color: var(--txt); font-family: inherit; font-size: 14px; line-height: 1.6;
}
textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(138,92,240,.2); }
textarea::placeholder { color: var(--muted2); }

/* 개발일지 */
.devlog-item { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.devlog-item:last-child { border-bottom: 0; }
.dl-prompt { font-size: 14.5px; font-weight: 700; margin-bottom: 6px; }
.dl-prompt .dl-n { color: var(--purple); font-weight: 900; margin-right: 7px; }
.dl-hint { font-size: 12.5px; color: var(--gold); margin-bottom: 8px; }

.save-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.saved-tag { font-size: 12px; color: var(--ok); opacity: 0; transition: .2s; }
.saved-tag.show { opacity: 1; }

/* 정상 완료 카드 */
.summit-card { text-align: center; padding: 40px 26px; }
.summit-card .big { font-size: 60px; filter: drop-shadow(0 0 18px rgba(244,192,74,.6)); }
.summit-card h1 { margin: 14px 0 8px; font-size: 26px; }
.summit-card p { color: var(--muted); margin: 0 0 18px; }

/* ---------- 기록 뷰 ---------- */
.rec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.rec-stat { padding: 18px; border-radius: 14px; text-align: center; background: linear-gradient(180deg, var(--panel2), var(--bg1)); border: 1px solid var(--line); box-shadow: var(--shadow); }
.rec-stat .rs-big { font-size: 30px; font-weight: 900; color: var(--teal); }
.rec-stat.gold .rs-big { color: var(--gold); }
.rec-stat .rs-lbl { font-size: 12px; color: var(--muted); margin-top: 4px; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge {
  display: flex; align-items: center; gap: 12px; padding: 13px; border-radius: 13px;
  background: var(--bg1); border: 1px solid var(--line); opacity: .5; filter: grayscale(.8); transition: .3s;
}
.badge.earned { opacity: 1; filter: none; border-color: var(--gold); background: linear-gradient(180deg, rgba(244,192,74,.12), var(--bg1)); box-shadow: 0 0 16px rgba(244,192,74,.18); }
.badge .b-ic { font-size: 30px; }
.badge .b-name { font-size: 13.5px; font-weight: 800; }
.badge .b-desc { font-size: 11px; color: var(--muted); }
.rec-note { white-space: pre-wrap; font-size: 13.5px; color: var(--muted); background: var(--bg0); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; margin-top: 8px; line-height: 1.7; }
.rec-q { font-size: 13px; font-weight: 700; color: var(--glow); margin-top: 14px; }
.rec-empty { color: var(--muted2); font-size: 13px; text-align: center; padding: 20px; }

/* ---------- 하단 내비 ---------- */
.climbnav {
  flex: none; display: flex; align-items: center; gap: 16px; padding: 12px 26px;
  background: linear-gradient(180deg, rgba(26,20,54,.7), rgba(20,15,40,.95));
  border-top: 1px solid var(--line);
}
.nx-info { margin-left: auto; text-align: right; }
.nx-info .lbl { font-size: 10px; letter-spacing: 1px; color: var(--muted2); text-transform: uppercase; }
.nx-info .val { font-size: 13px; font-weight: 700; color: var(--muted); }
.btn {
  border: 0; border-radius: 11px; padding: 12px 22px; font-size: 14px; font-weight: 800; transition: .15s;
}
.btn.primary { background: linear-gradient(180deg, var(--purple), var(--purple-dim)); color: #fff; box-shadow: 0 6px 18px rgba(138,92,240,.4); }
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 9px 24px rgba(138,92,240,.55); }
.btn.primary.pulse { animation: btnPulse 1s ease infinite; }
@keyframes btnPulse { 0%,100%{ box-shadow: 0 6px 18px rgba(138,92,240,.4);} 50%{ box-shadow: 0 6px 26px rgba(185,139,255,.8);} }
.btn.ghost { background: var(--stone); color: var(--muted); border: 1px solid var(--line); }
.btn.ghost:hover { color: var(--txt); }
.btn.teal { background: linear-gradient(180deg, var(--teal), var(--teal-dim)); color: #052b27; box-shadow: 0 6px 18px rgba(47,211,196,.35); }
.btn:disabled { opacity: .4; cursor: default; transform: none; box-shadow: none; }

/* ---------- 가이드 정령 (클릭 통과 필수) ---------- */
.spirit {
  position: fixed; right: 22px; bottom: 92px; z-index: 40; width: 260px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  pointer-events: none; /* ★ 클릭 통과 — 버튼 막힘 방지 */
}
.spirit-bubble {
  background: linear-gradient(180deg, var(--panel2), var(--bg1)); border: 1px solid var(--purple-dim);
  border-radius: 14px 14px 4px 14px; padding: 11px 14px; font-size: 12.5px; color: var(--txt);
  box-shadow: 0 10px 28px rgba(0,0,0,.5), 0 0 18px rgba(138,92,240,.25); line-height: 1.55;
  max-width: 240px; opacity: 0; transform: translateY(8px); transition: .3s;
}
.spirit-bubble.show { opacity: 1; transform: translateY(0); }
.spirit-body { font-size: 30px; filter: drop-shadow(0 0 12px rgba(185,139,255,.7)); animation: floaty 3s ease-in-out infinite; }
@keyframes floaty { 0%,100%{ transform: translateY(0) rotate(-4deg);} 50%{ transform: translateY(-8px) rotate(4deg);} }

/* ---------- 축하 배너 (클릭 통과 · 자동 닫힘) ---------- */
.celebrate {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%) translateY(-14px); z-index: 50;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; opacity: 0; transition: .35s;
}
.celebrate.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.celebrate .cel {
  padding: 12px 22px; border-radius: 40px; font-size: 14px; font-weight: 800;
  background: linear-gradient(180deg, var(--panel2), var(--bg1)); border: 1px solid var(--gold);
  color: var(--gold); box-shadow: 0 12px 34px rgba(0,0,0,.5), 0 0 26px rgba(244,192,74,.35);
}
.celebrate .cel.badge-pop { color: var(--glow); border-color: var(--purple); box-shadow: 0 12px 34px rgba(0,0,0,.5), 0 0 26px rgba(138,92,240,.4); }

/* ---------- 토스트 ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); z-index: 60;
  background: var(--panel2); border: 1px solid var(--line); color: var(--txt);
  padding: 12px 20px; border-radius: 12px; font-size: 13.5px; font-weight: 700;
  box-shadow: var(--shadow); opacity: 0; transition: .25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 모달 ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: none; }
.modal.open { display: block; }
.modal-bg { position: absolute; inset: 0; background: rgba(6,4,14,.8); backdrop-filter: blur(3px); }
.modal-panel {
  position: absolute; inset: 4vh 4vw; background: var(--bg1); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.modal-head .mt { font-weight: 800; font-size: 14px; }
.modal-head .mx { margin-left: auto; background: var(--stone); color: var(--txt); border: 1px solid var(--line); width: 34px; height: 34px; border-radius: 8px; font-size: 15px; }
.modal-panel iframe { flex: 1; width: 100%; border: 0; background: #fff; }

/* ---------- 반응형 ---------- */
.rail-scrim { display: none; }
@media (max-width: 940px) {
  .menu-toggle { display: block; }
  .altimeter { order: 5; min-width: 150px; }
  .rail {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 70; width: 300px;
    transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow);
  }
  .rail.open { transform: translateX(0); }
  .rail-scrim.show { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(0,0,0,.5); }
  .stage { padding: 22px 18px 50px; }
  .zones { grid-template-columns: 1fr; }
  .rec-grid { grid-template-columns: 1fr; }
  .spirit { display: none; }
}
