﻿:root {
  --desk: #d9d0c0;
  --desk-2: #cfc5b2;
  --ink: #1c1a16;
  --ink-2: #4a453c;
  --muted: #7a7366;
  --paper: #fffcf5;
  --paper-line: #e6dfd0;
  --active: #fff3a8;
  --active-edge: #e8d56a;
  --ok: #1a7a45;
  --no: #c62828;
  --accent: #2a5a8c;
  /* 편 강조색 (빨주노초파남보) — app.js 가 data-vol / --vol 로 덮어씀 */
  --vol: #c44b3c;
  --vol-2: #d97868;
  --shadow: 0 18px 50px rgba(60, 45, 20, .22), 0 2px 6px rgba(60, 45, 20, .08);
  --serif: "Nanum Myeongjo", "Batang", serif;
  --sans: "Pretendard Variable", Pretendard, "Malgun Gothic", sans-serif;
  --mono: "JetBrains Mono", "Pretendard Variable", "Malgun Gothic", monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--desk);
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button { font-family: inherit; border: none; background: none; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.desk {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 255, 255, .35), transparent 60%),
    repeating-linear-gradient(90deg, transparent 0 47px, rgba(90, 70, 40, .03) 47px 48px),
    linear-gradient(165deg, var(--desk) 0%, var(--desk-2) 100%);
}

.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  height: 58px; padding: 0 22px;
  background: rgba(255, 252, 245, .78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(90, 70, 40, .12);
}

/* 공통 탑바와 이중 바가 되지 않게 — 로컬 헤더는 숨기고 정보는 탑바에 녹임 */
body.has-ym-topbar header.top {
  display: none !important;
}
/* ≡ 는 공통 탑바로 편입됨 (upnav.js / topbar.js) */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 28px; height: 28px; }
.brand-name { font-family: var(--serif); font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.brand-edition {
  display: inline-block;
  margin-left: .12em;
  font-size: .58em;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--vol);
  vertical-align: .18em;
}
.home-hero h1 .brand-edition {
  margin-left: .18em;
  vertical-align: .28em;
  font-weight: 800;
  color: var(--vol);
}
.sheet-brand .brand-edition {
  margin-left: .14em;
  font-size: .72em;
  letter-spacing: .02em;
  vertical-align: .12em;
  color: var(--vol);
}
.top-note { margin-left: auto; font-size: 13px; color: var(--muted); }
.auth-bar {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; margin-left: 12px;
}
.auth-who { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.auth-paid {
  font-size: 11px; font-weight: 800; color: #2f6b45;
  background: rgba(47, 107, 69, .1); padding: 3px 8px; border-radius: 999px;
}
.auth-link {
  font-size: 13px; font-weight: 650; color: var(--muted);
  padding: 4px 2px;
}
.auth-link:hover { color: var(--ink); }
.auth-cta { padding: 7px 12px !important; font-size: 13px !important; }
.auth-switch {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.auth-switch-btn {
  border: 0;
  background: transparent;
  color: #2a5a8c;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

main { width: min(980px, 100%); margin: 0 auto; padding: 28px 18px 148px; }
.view { animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.home-hero { text-align: center; padding: 28px 12px 36px; }
.home-kicker {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .22em; color: var(--vol);
}
.home-hero h1 {
  margin-top: 10px;
  font-family: var(--serif); font-size: clamp(40px, 8vw, 64px); font-weight: 800;
  letter-spacing: -.04em; line-height: 1.05;
}
.home-lead {
  margin: 16px auto 0; max-width: 420px;
  font-size: 15px; line-height: 1.7; color: var(--ink-2);
}
.home-warm {
  margin-top: 22px;
  display: grid;
  gap: 8px;
  justify-items: center;
}
.home-warm .btn-primary {
  background: rgba(255, 252, 245, .88);
  color: var(--ink);
  border: 1px solid rgba(90, 70, 40, .14);
  box-shadow: 0 1px 2px rgba(60, 45, 20, .04);
}
.home-warm .btn-primary:hover {
  background: #fff;
  border-color: rgba(90, 70, 40, .22);
}
.home-warm-note {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.home-warm.is-passed .btn-primary {
  background: rgba(255, 252, 245, .72);
  color: var(--ink-2);
  border-color: rgba(90, 70, 40, .12);
  box-shadow: none;
}
.home-warm.is-passed .home-warm-note {
  color: var(--muted);
  font-weight: 500;
}
.home-auth-cta {
  margin: 18px auto 0;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 252, 245, .55);
  border: 1px solid rgba(90, 70, 40, .1);
}
.home-auth-cta > p {
  font-size: 13px; color: var(--ink-2); font-weight: 600;
}
.home-auth-actions {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px;
}
.home-auth-cta .btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid color-mix(in srgb, var(--vol) 55%, rgba(90, 70, 40, .35));
  box-shadow: 0 2px 8px rgba(60, 45, 20, .08);
}
.home-auth-cta .btn-ghost:hover {
  background: color-mix(in srgb, var(--vol) 10%, #fff);
  border-color: var(--vol);
  color: var(--vol);
}
.unit-paywall {
  margin: 0 0 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 243, 168, .45), rgba(255, 252, 245, .9));
  border: 1px solid rgba(200, 150, 40, .25);
}
.unit-paywall p { font-size: 14px; color: var(--ink-2); margin-bottom: 10px; }
.unit-block.is-paylocked .course-list { opacity: .55; }
.stage-go.is-pay { color: #b86a12; }
.stage-exports.is-paywalled button { opacity: .55; }
.report-paywall {
  margin-top: 12px; padding: 18px; border-radius: 14px;
  background: rgba(255, 252, 245, .9); border: 1px dashed rgba(90, 70, 40, .22);
  text-align: center;
}
.report-paywall p { font-size: 14px; color: var(--ink-2); margin: 0 0 8px; }
.report-paywall .btn { margin-top: 8px; }

.auth-modal {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center; padding: 18px;
}
.auth-modal[hidden] { display: none !important; }
.auth-backdrop { position: absolute; inset: 0; background: rgba(28, 26, 22, .45); }
.auth-card {
  position: relative; z-index: 1;
  width: min(560px, 100%);
  max-height: min(90vh, 760px);
  overflow: auto;
  padding: 22px 22px 20px;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.auth-card.pay-card { width: min(440px, 100%); }
.auth-x {
  position: absolute; top: 12px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 22px; line-height: 1; color: var(--muted);
}
.auth-x:hover { background: rgba(0,0,0,.05); color: var(--ink); }
.auth-card h2 {
  font-family: var(--serif); font-size: 24px; font-weight: 800; margin-bottom: 12px;
}
.auth-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.auth-tab {
  flex: 1; padding: 9px 10px; border-radius: 10px;
  font-size: 14px; font-weight: 700; color: var(--muted);
  background: rgba(90, 70, 40, .06);
}
.auth-tab.is-on { background: var(--ink); color: #fff; }
.auth-pane { display: grid; gap: 10px; }
.af { display: grid; gap: 5px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.af input, .af select, .af textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(90, 70, 40, .18);
  background: #fff; font: inherit; font-weight: 500; color: var(--ink);
}
.af select.is-locked { background: #f3efe6; color: var(--ink-2); }
.af-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.af-row.is-disabled .af span { color: #9a9184; }
.af-row.is-disabled input {
  background: #f0ebe3;
  color: #9a9184;
  border-color: rgba(90, 70, 40, .1);
  cursor: not-allowed;
}
.af.check {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; grid-template-columns: none;
}
.af.check input { width: 16px; height: 16px; }
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid rgba(90, 70, 40, .16);
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.mode-opt:has(input:checked) {
  border-color: rgba(42, 90, 140, .45);
  background: rgba(42, 90, 140, .06);
}
.school-hint { font-size: 12px; color: var(--muted); margin-top: -2px; }
.school-hits {
  max-height: 160px; overflow: auto;
  border: 1px solid rgba(90, 70, 40, .12);
  border-radius: 12px; background: #fff;
}
.school-hit {
  display: grid; gap: 2px; width: 100%;
  text-align: left; padding: 9px 12px;
  border-bottom: 1px solid rgba(90, 70, 40, .08);
}
.school-hit:hover { background: rgba(255, 243, 168, .35); }
.school-hit b { font-size: 13px; }
.school-hit small { font-size: 11px; color: var(--muted); }
.school-empty { padding: 12px; font-size: 13px; color: var(--muted); }
.auth-error { min-height: 18px; font-size: 13px; color: var(--no); }
.su-note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 4px; }
.btn-block { width: 100%; }
.pay-lead { font-size: 14px; color: var(--ink-2); margin-bottom: 12px; }
.pay-benefits { margin: 0 0 14px 18px; font-size: 14px; color: var(--ink); }
.pay-benefits li { margin: 4px 0; }
.pay-box {
  display: grid; gap: 8px; padding: 14px;
  border-radius: 12px; background: rgba(90, 70, 40, .05);
  margin-bottom: 12px;
}
.pay-box div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.pay-box span { color: var(--muted); }
.pay-amount { color: #b86a12; font-size: clamp(14px, 3.6vw, 16px); line-height: 1.35; text-align: right; }
.pay-note { font-size: 12px; color: var(--muted); line-height: 1.5; }
.auth-card.journal-card {
  width: min(640px, 100%);
  max-height: min(92vh, 820px);
}
.journal-body { margin-top: 4px; }
.journal-loading { font-size: 14px; color: var(--muted); padding: 12px 0; }
.journal-head { margin-bottom: 14px; }
.journal-who { display: block; font-size: 15px; font-weight: 750; color: var(--ink); margin-bottom: 4px; }
.journal-summary { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.journal-summary b { color: var(--ink); }
.journal-sec { margin-top: 16px; }
.journal-sec h3 {
  font-size: 13px; font-weight: 800; letter-spacing: -.01em;
  color: var(--muted); margin-bottom: 8px;
}
.journal-table-wrap {
  overflow: auto;
  border: 1px solid rgba(90, 70, 40, .12);
  border-radius: 12px;
  background: #fff;
}
.journal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.journal-table th,
.journal-table td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(90, 70, 40, .08);
  white-space: nowrap;
}
.journal-table th {
  font-size: 11px; font-weight: 750; color: var(--muted);
  background: rgba(90, 70, 40, .04);
}
.journal-table tr:last-child td { border-bottom: none; }
.journal-table .is-pass { color: #2f6b45; font-weight: 700; }
.journal-table .is-fail { color: #a13a2a; font-weight: 650; }
.journal-empty { text-align: center !important; color: var(--muted); padding: 18px 10px !important; white-space: normal !important; }
.journal-plan { list-style: none; display: grid; gap: 8px; }
.journal-plan-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(255, 252, 245, .9);
  border: 1px solid rgba(90, 70, 40, .1);
}
.journal-plan-item b { display: block; font-size: 14px; margin-bottom: 3px; }
.journal-plan-item p { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.journal-plan-item.is-retry { border-color: rgba(180, 100, 60, .22); }
.journal-plan-item.is-next { border-color: rgba(42, 90, 140, .2); }
.journal-plan-item.is-goal { background: rgba(90, 70, 40, .04); }
.journal-go { flex-shrink: 0; height: 34px; padding: 0 12px; font-size: 12.5px; }
.journal-dl { display: grid; gap: 10px; margin-top: 8px; }
.journal-dl > div {
  display: grid; grid-template-columns: 72px 1fr; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid rgba(90, 70, 40, .08);
  font-size: 14px;
}
.journal-dl dt { color: var(--muted); font-weight: 650; }
@media (max-width: 720px) {
  .top-note { display: none; }
  .auth-bar { margin-left: auto; }
  .af-row, .mode-pick { grid-template-columns: 1fr; }
}

.stage-list {
  list-style: none; display: grid; gap: 22px;
  max-width: 640px; margin: 0 auto;
}
.unit-block {
  --obi: #f2f0ea;
  --obi-edge: rgba(40, 30, 20, .18);
  --obi-knot: #e8e4dc;
  list-style: none;
  position: relative;
  padding: 18px 16px 14px;
  border-radius: 18px;
  background: rgba(255, 252, 245, .45);
  border: 1px solid rgba(90, 70, 40, .1);
  animation: rise .5s var(--ease) both;
  overflow: visible;
}
.unit-block.is-done {
  border-color: color-mix(in srgb, var(--obi) 45%, rgba(26, 122, 69, .28));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--obi) 28%, transparent), transparent 34%),
    rgba(232, 245, 236, .55);
}
.unit-block--belt-w { --obi: #f7f4ee; --obi-edge: rgba(90, 75, 55, .28); --obi-knot: #f0ebe3; }
.unit-block--belt-y { --obi: #ffd400; --obi-edge: rgba(140, 100, 0, .35); --obi-knot: #f0c400; }
.unit-block--belt-g { --obi: #1f9a45; --obi-edge: rgba(8, 50, 22, .4); --obi-knot: #178a3c; }
.unit-block--belt-b { --obi: #1e56c8; --obi-edge: rgba(8, 28, 80, .45); --obi-knot: #184db8; }
.unit-block--belt-r { --obi: #d41818; --obi-edge: rgba(70, 8, 8, .42); --obi-knot: #c01010; }
.unit-block--belt-br { --obi: #141414; --obi-edge: rgba(0, 0, 0, .5); --obi-knot: #c62828; }
.unit-block--belt-k { --obi: #161616; --obi-edge: rgba(0, 0, 0, .55); --obi-knot: #101010; }
.unit-block--belt-kk { --obi: #101010; --obi-edge: rgba(0, 0, 0, .6); --obi-knot: #0a0a0a; }

/* —— 연산마스터 띠 (실사 직물 톤) —— */
.unit-obi {
  --obi: #f4f1ea;
  --obi-deep: #e4dfd4;
  --obi-hi: #fffef9;
  --obi-edge: rgba(70, 60, 50, .28);
  --obi-knot: #ebe7de;
  --obi-cloth: linear-gradient(
    180deg,
    var(--obi-hi) 0%,
    var(--obi) 28%,
    var(--obi-deep) 62%,
    color-mix(in srgb, var(--obi-deep) 70%, #000) 100%
  );
  position: relative;
  margin: 10px -22px 14px;
  min-height: 34px;
  display: grid;
  align-items: center;
  z-index: 2;
  cursor: default;
  transition: transform .3s cubic-bezier(.2, .9, .3, 1), filter .3s ease;
}
.unit-obi--w {
  --obi: #f7f4ee; --obi-deep: #e8e2d6; --obi-hi: #ffffff; --obi-knot: #f0ebe3;
  --obi-edge: rgba(90, 75, 55, .32);
}
.unit-obi--y {
  --obi: #ffd400; --obi-deep: #e6b800; --obi-hi: #ffe95a; --obi-knot: #f0c400;
  --obi-edge: rgba(140, 100, 0, .42);
}
.unit-obi--g {
  --obi: #1f9a45; --obi-deep: #0f6f2e; --obi-hi: #3bc463; --obi-knot: #178a3c;
  --obi-edge: rgba(8, 50, 22, .45);
}
.unit-obi--b {
  --obi: #1e56c8; --obi-deep: #123a8f; --obi-hi: #4a7ef0; --obi-knot: #184db8;
  --obi-edge: rgba(8, 28, 80, .5);
}
.unit-obi--r {
  --obi: #d41818; --obi-deep: #9a0e0e; --obi-hi: #f03a3a; --obi-knot: #c01010;
  --obi-edge: rgba(70, 8, 8, .48);
}
.unit-obi--br {
  --obi: #141414; --obi-deep: #0a0a0a; --obi-hi: #2a2a2a; --obi-knot: #c62828;
  --obi-edge: rgba(0, 0, 0, .55);
}
.unit-obi--k {
  --obi: #161616; --obi-deep: #050505; --obi-hi: #2c2c2c; --obi-knot: #101010;
  --obi-edge: rgba(0, 0, 0, .58);
}
.unit-obi--kk {
  --obi: #101010; --obi-deep: #000; --obi-hi: #262626; --obi-knot: #0a0a0a;
  --obi-edge: rgba(0, 0, 0, .62);
}

.unit-obi-band {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 0 18px;
  filter: drop-shadow(0 3px 4px rgba(40, 30, 20, .18));
  transition: filter .3s ease;
}
.unit-obi-wrap {
  position: relative;
  display: block;
  height: 17px;
  border-radius: 2px;
  overflow: hidden;
  isolation: isolate;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 2px,
      rgba(255,255,255,.04) 2px 3px
    ),
    var(--obi-cloth);
  border: 1px solid var(--obi-edge);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.35),
    inset 0 -2px 3px rgba(0,0,0,.18);
  transition: filter .3s ease, box-shadow .3s ease, transform .3s ease;
}
.unit-obi-wrap::before {
  /* 직사 직물 세로 결 */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(0,0,0,.06) 0,
    transparent 8%,
    rgba(255,255,255,.08) 22%,
    transparent 40%,
    rgba(0,0,0,.05) 70%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}
.unit-obi-wrap::after {
  content: "";
  position: absolute;
  inset: -30% -55%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    transparent 36%,
    rgba(255,255,255,0) 42%,
    rgba(255,255,255,.85) 49%,
    rgba(255,255,255,.35) 53%,
    rgba(255,255,255,0) 58%,
    transparent 68%,
    transparent 100%
  );
  transform: translateX(-140%) skewX(-16deg);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}
.unit-obi--br .unit-obi-wrap {
  background:
    repeating-linear-gradient(90deg, transparent 0 2px, rgba(255,255,255,.03) 2px 3px),
    linear-gradient(180deg, rgba(255,255,255,.12), transparent 40%, rgba(0,0,0,.25)),
    linear-gradient(90deg, #0e0e0e 0 48%, #c62828 52% 100%);
}
.unit-obi--kk .unit-obi-wrap,
.unit-obi--kk .unit-obi-wrap--extra {
  height: 11px;
  background:
    repeating-linear-gradient(90deg, transparent 0 2px, rgba(255,255,255,.03) 2px 3px),
    linear-gradient(180deg, #2a2a2a, #0a0a0a 45%, #000 100%);
}
.unit-obi-wrap--extra { margin-top: 0; }

/* 미획득: 흐릿 / 획득·호버: 실사색 */
.unit-obi.is-locked {
  filter: saturate(.35) brightness(1.05);
}
.unit-obi.is-locked .unit-obi-wrap,
.unit-obi.is-locked .unit-obi-knot,
.unit-obi.is-locked .unit-obi-tail {
  opacity: .62;
}
.unit-obi.is-earned {
  filter: none;
}
.unit-obi.is-earned .unit-obi-wrap,
.unit-obi.is-earned .unit-obi-knot,
.unit-obi.is-earned .unit-obi-tail {
  opacity: 1;
}
.unit-obi.is-earned .unit-obi-band {
  filter: drop-shadow(0 5px 10px rgba(40, 30, 20, .26));
}
.unit-obi.is-earned .unit-obi-wrap {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.45),
    inset 0 -2px 4px rgba(0,0,0,.22),
    0 0 0 1px color-mix(in srgb, var(--obi) 25%, transparent);
}

/* 호버: 실사색 풀업 + 빛 휘익 */
.unit-obi:hover,
.unit-obi:focus-within {
  transform: translateY(-5px) scale(1.02);
  z-index: 5;
  filter: none !important;
}
.unit-obi:hover .unit-obi-wrap,
.unit-obi:hover .unit-obi-knot,
.unit-obi:hover .unit-obi-tail,
.unit-obi:focus-within .unit-obi-wrap,
.unit-obi:focus-within .unit-obi-knot,
.unit-obi:focus-within .unit-obi-tail {
  opacity: 1 !important;
}
.unit-obi:hover .unit-obi-band,
.unit-obi:focus-within .unit-obi-band {
  filter: drop-shadow(0 10px 16px color-mix(in srgb, var(--obi) 35%, rgba(20, 15, 10, .28)));
}
.unit-obi:hover .unit-obi-wrap,
.unit-obi:focus-within .unit-obi-wrap {
  transform: scaleY(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 -2px 4px rgba(0,0,0,.2),
    0 0 14px color-mix(in srgb, var(--obi) 45%, transparent);
}
.unit-obi:hover .unit-obi-wrap::after,
.unit-obi:focus-within .unit-obi-wrap::after {
  opacity: 1;
  animation: obiSheen .75s cubic-bezier(.15, .85, .25, 1) forwards;
}
.unit-obi--y:hover .unit-obi-wrap,
.unit-obi--y:focus-within .unit-obi-wrap,
.unit-obi--y.is-earned .unit-obi-wrap {
  background:
    repeating-linear-gradient(90deg, transparent 0 2px, rgba(255,255,255,.07) 2px 3px),
    linear-gradient(180deg, #fff3a0 0%, #ffd400 32%, #f0bc00 68%, #c99600 100%);
}

.unit-obi-knot {
  position: absolute;
  right: 42px;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%) rotate(45deg);
  background:
    linear-gradient(135deg, rgba(255,255,255,.35), transparent 48%),
    var(--obi-knot);
  border: 1px solid var(--obi-edge);
  box-shadow: 0 2px 5px rgba(0,0,0,.25);
  z-index: 2;
  transition: filter .3s ease, box-shadow .3s ease;
}
.unit-obi--br .unit-obi-knot {
  background: linear-gradient(135deg, #1a1a1a 0 48%, #d41818 52% 100%);
}
.unit-obi-tail {
  position: absolute;
  right: 14px;
  width: 34px;
  height: 11px;
  border-radius: 1px;
  background: var(--obi-cloth);
  border: 1px solid var(--obi-edge);
  z-index: 1;
  transition: filter .3s ease;
}
.unit-obi--br .unit-obi-tail--a {
  background: linear-gradient(180deg, #2a2a2a, #0a0a0a);
}
.unit-obi--br .unit-obi-tail--b {
  background: linear-gradient(180deg, #f03a3a, #9a0e0e);
}
.unit-obi-tail--a {
  top: calc(50% - 10px);
  transform: rotate(18deg);
}
.unit-obi-tail--b {
  top: calc(50% + 2px);
  transform: rotate(-14deg);
  right: 18px;
}
.unit-obi--kk .unit-obi-tail { height: 8px; }

.unit-obi-label {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 252, 245, .9);
  border: 1px solid rgba(90, 70, 40, .12);
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(40, 30, 20, .08);
  pointer-events: none;
}
.unit-obi--g .unit-obi-label,
.unit-obi--b .unit-obi-label,
.unit-obi--r .unit-obi-label,
.unit-obi--k .unit-obi-label,
.unit-obi--kk .unit-obi-label,
.unit-obi--br.is-earned .unit-obi-label,
.unit-obi--y.is-earned .unit-obi-label {
  background: rgba(20, 18, 16, .72);
  border-color: rgba(255,255,255,.14);
  color: #fff;
}
.unit-obi.is-earned .unit-obi-label {
  border-color: color-mix(in srgb, var(--obi) 45%, rgba(90, 70, 40, .15));
}

@keyframes obiSheen {
  0% { transform: translateX(-145%) skewX(-16deg); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateX(145%) skewX(-16deg); opacity: .2; }
}

/* 띠 현황 랙 */
.belt-rack {
  list-style: none;
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: rgba(255, 252, 245, .7);
  border: 1px solid rgba(90, 70, 40, .12);
  box-shadow: 0 8px 22px rgba(60, 45, 20, .06);
}
.belt-rack-kicker {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--muted);
}
.belt-rack-lead {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
}
.belt-rack-list {
  list-style: none;
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.belt-chip {
  --obi: #e8e4dc;
  --obi-deep: #d4cec2;
  --obi-hi: #faf7f1;
  --obi-edge: rgba(90, 70, 40, .2);
  --obi-cloth: linear-gradient(180deg, var(--obi-hi), var(--obi) 40%, var(--obi-deep));
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 8px 4px 7px;
  border-radius: 12px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(90, 70, 40, .1);
  cursor: default;
  transition:
    transform .3s cubic-bezier(.2, .9, .3, 1),
    box-shadow .3s ease,
    border-color .3s ease,
    background .3s ease,
    filter .3s ease;
}
.belt-chip.unit-obi--w { --obi: #f7f4ee; --obi-deep: #e8e2d6; --obi-hi: #fff; }
.belt-chip.unit-obi--y { --obi: #ffd400; --obi-deep: #e6b800; --obi-hi: #ffe95a; --obi-edge: rgba(140,100,0,.4); }
.belt-chip.unit-obi--g { --obi: #1f9a45; --obi-deep: #0f6f2e; --obi-hi: #3bc463; --obi-edge: rgba(8,50,22,.4); }
.belt-chip.unit-obi--b { --obi: #1e56c8; --obi-deep: #123a8f; --obi-hi: #4a7ef0; --obi-edge: rgba(8,28,80,.45); }
.belt-chip.unit-obi--r { --obi: #d41818; --obi-deep: #9a0e0e; --obi-hi: #f03a3a; --obi-edge: rgba(70,8,8,.45); }
.belt-chip.unit-obi--br { --obi: #141414; --obi-deep: #0a0a0a; --obi-hi: #2a2a2a; }
.belt-chip.unit-obi--k { --obi: #161616; --obi-deep: #050505; --obi-hi: #2c2c2c; }
.belt-chip.unit-obi--kk { --obi: #101010; --obi-deep: #000; --obi-hi: #262626; }

.belt-chip-band {
  position: relative;
  width: 100%;
  height: 11px;
  border-radius: 2px;
  overflow: hidden;
  isolation: isolate;
  background:
    repeating-linear-gradient(90deg, transparent 0 2px, rgba(255,255,255,.05) 2px 3px),
    var(--obi-cloth);
  border: 1px solid var(--obi-edge);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
  transition: box-shadow .3s ease, transform .3s ease, filter .3s ease;
}
.belt-chip-band::after {
  content: "";
  position: absolute;
  inset: -40% -60%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    transparent 38%,
    rgba(255,255,255,.9) 50%,
    rgba(255,255,255,.25) 56%,
    transparent 66%,
    transparent 100%
  );
  transform: translateX(-145%) skewX(-16deg);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}
.belt-chip.unit-obi--br .belt-chip-band {
  background:
    linear-gradient(180deg, rgba(255,255,255,.12), transparent 45%, rgba(0,0,0,.22)),
    linear-gradient(90deg, #0e0e0e 0 48%, #d41818 52% 100%);
}
.belt-chip.unit-obi--kk .belt-chip-band {
  height: 13px;
  background:
    linear-gradient(180deg, #2a2a2a, #0a0a0a 42%, #000 48%, #0a0a0a 55%, #222);
}
.belt-chip.unit-obi--y.is-earned .belt-chip-band,
.belt-chip.unit-obi--y:hover .belt-chip-band {
  background:
    repeating-linear-gradient(90deg, transparent 0 2px, rgba(255,255,255,.08) 2px 3px),
    linear-gradient(180deg, #fff3a0, #ffd400 36%, #f0bc00 72%, #c99600);
}

.belt-chip-n {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--muted);
}
.belt-chip-name {
  font-size: 11px;
  font-weight: 750;
  color: var(--ink);
  text-align: center;
  line-height: 1.2;
}

.belt-chip.is-locked {
  filter: saturate(.3) brightness(1.04);
  opacity: .7;
}
.belt-chip.is-earned {
  filter: none;
  opacity: 1;
  border-color: color-mix(in srgb, var(--obi) 55%, rgba(90, 70, 40, .15));
  box-shadow: 0 5px 14px color-mix(in srgb, var(--obi) 28%, transparent);
}
.belt-chip.is-earned .belt-chip-band {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.45),
    0 0 8px color-mix(in srgb, var(--obi) 30%, transparent);
}

.belt-chip:hover,
.belt-chip:focus-visible {
  transform: translateY(-6px) scale(1.05);
  background: rgba(255,255,255,.95);
  border-color: color-mix(in srgb, var(--obi) 55%, rgba(90, 70, 40, .15));
  box-shadow: 0 12px 22px color-mix(in srgb, var(--obi) 32%, rgba(40, 30, 20, .14));
  filter: none !important;
  opacity: 1 !important;
  z-index: 3;
}
.belt-chip:hover .belt-chip-band,
.belt-chip:focus-visible .belt-chip-band {
  transform: scaleY(1.18);
  box-shadow: 0 0 14px color-mix(in srgb, var(--obi) 50%, transparent);
}
.belt-chip:hover .belt-chip-band::after,
.belt-chip:focus-visible .belt-chip-band::after {
  opacity: 1;
  animation: obiSheen .7s cubic-bezier(.15, .85, .25, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .unit-obi,
  .unit-obi-band,
  .unit-obi-wrap,
  .belt-chip,
  .belt-chip-band {
    transition: none !important;
  }
  .unit-obi:hover,
  .unit-obi:focus-within,
  .belt-chip:hover,
  .belt-chip:focus-visible {
    transform: none;
  }
  .unit-obi:hover .unit-obi-wrap::after,
  .unit-obi:focus-within .unit-obi-wrap::after,
  .belt-chip:hover .belt-chip-band::after,
  .belt-chip:focus-visible .belt-chip-band::after {
    animation: none;
    opacity: 0;
  }
}

.cele-belt {
  --obi: #f0d12e;
  display: grid;
  gap: 8px;
  justify-items: center;
  margin: 8px 0 4px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18);
}
.cele-belt-band {
  width: min(220px, 70%);
  height: 16px;
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.3), transparent 45%, rgba(0,0,0,.18)),
    var(--obi);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.cele-belt.unit-obi--br .cele-belt-band {
  background: linear-gradient(90deg, #141414 0 50%, #c62828 50% 100%);
}
.cele-belt.unit-obi--kk .cele-belt-band {
  height: 22px;
  background:
    linear-gradient(180deg, #222, #111 38%, transparent 40%, transparent 48%, #111 50%, #000);
  background-color: #111;
}
.cele-belt-label {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.01em;
}

@media (max-width: 560px) {
  .belt-rack-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unit-obi { margin-left: -12px; margin-right: -12px; }
  .unit-obi-label { left: 16px; font-size: 10px; }
}

.unit-head { margin-bottom: 8px; }
.unit-kicker {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .16em; color: var(--muted);
}
.unit-title {
  margin-top: 4px;
  font-family: var(--serif); font-size: 22px; font-weight: 800;
  letter-spacing: -.03em;
}
.unit-reason {
  margin: 8px 0 12px;
  font-size: 13px; line-height: 1.65; color: var(--ink-2);
}
.course-list {
  list-style: none; display: grid; gap: 8px;
}

.stage-card {
  background: var(--paper);
  border: 1px solid rgba(90, 70, 40, .12);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(60, 45, 20, .06);
  overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.stage-card:hover {
  transform: translateY(-2px);
  border-color: rgba(42, 90, 140, .35);
  box-shadow: 0 10px 28px rgba(60, 45, 20, .12);
}
.stage-card.is-locked {
  opacity: .55;
  filter: grayscale(.35);
}
.stage-card.is-locked:hover {
  transform: none;
  border-color: rgba(90, 70, 40, .12);
  box-shadow: 0 4px 14px rgba(60, 45, 20, .06);
}
.stage-card.is-clear {
  border-color: rgba(26, 122, 69, .28);
  background:
    linear-gradient(135deg, rgba(255, 248, 220, .55), transparent 42%),
    var(--paper);
  box-shadow: 0 6px 18px rgba(26, 122, 69, .08);
}
.stage-card.is-clear .stage-no {
  background: linear-gradient(160deg, #ffe27a, #f0c94a);
  color: #5a4208;
  border: 1px solid rgba(180, 130, 30, .35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}
.stage-card.is-clear .stage-go { color: var(--ok); }
.stage-medal {
  --medal: #f0c24a;
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 72px;
  margin-top: -2px;
  transform: rotate(-4deg);
}
.stage-medal-badge {
  position: relative;
  width: 44px;
  height: 48px;
  display: grid;
  place-items: start center;
}
.stage-medal-ribbon {
  position: absolute;
  top: 28px;
  left: 50%;
  width: 14px;
  height: 22px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--medal) 75%, #fff), color-mix(in srgb, var(--medal) 55%, #8a4a20));
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  box-shadow: 11px 0 0 color-mix(in srgb, var(--medal) 65%, #7a3a18);
  z-index: 0;
  opacity: .92;
}
.stage-medal-face {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 28%, #fffaf0, color-mix(in srgb, var(--medal) 55%, #fff) 48%, color-mix(in srgb, var(--medal) 80%, #c4891e) 100%);
  border: 2px solid color-mix(in srgb, var(--medal) 40%, #fff);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.75),
    0 0 0 2px color-mix(in srgb, var(--medal) 28%, transparent),
    0 4px 10px rgba(90, 60, 20, .12);
}
.stage-medal-animal { display: block; }
.stage-medal-label {
  margin-top: 2px;
  font-family: "Nanum Pen Script", var(--serif);
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  color: #c62828;
  letter-spacing: -.02em;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255,255,255,.65);
}
.stage-medal.is-bronze .stage-medal-face {
  border-color: rgba(180, 120, 70, .35);
}
.stage-medal.is-silver {
  transform: rotate(-2deg);
}
.stage-medal.is-silver .stage-medal-face {
  background:
    radial-gradient(circle at 30% 28%, #fff, color-mix(in srgb, var(--medal) 35%, #e8eef5) 50%, color-mix(in srgb, var(--medal) 55%, #9aabb8) 100%);
  border-color: rgba(140, 160, 180, .45);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.85),
    0 0 0 2px rgba(160, 180, 200, .28),
    0 4px 10px rgba(60, 80, 100, .12);
}
.stage-medal.is-silver .stage-medal-ribbon {
  background: linear-gradient(180deg, #c5d2de, #8a9aad);
  box-shadow: 11px 0 0 #7d8fa3;
}
.stage-medal.is-gold {
  transform: rotate(-6deg);
}
.stage-medal.is-gold .stage-medal-face {
  background:
    radial-gradient(circle at 30% 28%, #fff8dc, #ffe08a 45%, #e0a020 100%);
  border-color: rgba(220, 170, 40, .55);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.8),
    0 0 0 3px rgba(240, 190, 60, .28),
    0 5px 12px rgba(160, 110, 20, .16);
}
.stage-medal.is-gold .stage-medal-ribbon {
  background: linear-gradient(180deg, #f0c24a, #c4891e);
  box-shadow: 11px 0 0 #a87418;
  height: 24px;
}
.stage-medal.is-gold .stage-medal-label {
  color: #b71c1c;
  font-size: 19px;
}
.stage-medal.is-pro {
  transform: rotate(-7deg);
}
.stage-medal.is-pro .stage-medal-face {
  background:
    radial-gradient(circle at 30% 28%, #fff8e8, #ffe6a0 40%, #f0b020 78%, #c47820 100%);
  border-color: rgba(200, 130, 20, .55);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.85),
    0 0 0 3px rgba(240, 180, 40, .32),
    0 6px 14px rgba(140, 90, 20, .18);
}
.stage-medal.is-pro .stage-medal-ribbon {
  background: linear-gradient(180deg, #f5c43a, #b8731a);
  box-shadow: 11px 0 0 #9a6216;
  height: 26px;
}
.stage-medal.is-pro .stage-medal-label {
  color: #9b1c1c;
  font-size: 19px;
}
.stage-btn:disabled { cursor: not-allowed; }
.stage-btn {
  width: 100%; text-align: left;
  display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 14px;
  padding: 16px 18px 12px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.stage-btn:hover {
  transform: none;
  border-color: transparent;
  box-shadow: none;
}
.stage-exports {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 16px 14px 72px;
}
.stage-exports button {
  height: 30px; padding: 0 11px; border-radius: 8px;
  font-size: 12px; font-weight: 700; color: var(--ink-2);
  background: #f3eee3; border: 1px solid rgba(90, 70, 40, .16);
}
.stage-exports button:hover {
  background: #fff; color: var(--accent); border-color: rgba(42, 90, 140, .35);
}
body.is-exporting, body.is-exporting .stage-exports button { cursor: progress; }
@media (max-width: 600px) {
  .stage-exports { padding-left: 16px; }
}
.stage-no {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 16px; font-weight: 700;
  background: #efe8d8; color: var(--ink);
  margin-top: 2px;
}
.stage-main { min-width: 0; }
.stage-title { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.stage-sub { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stage-reason {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-2);
  font-weight: 500;
  text-align: left;
}
.stage-go { font-size: 13px; font-weight: 650; color: var(--accent); margin-top: 4px; white-space: nowrap; }

.exam-toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.tb-btn {
  height: 38px; padding: 0 14px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  background: rgba(255, 252, 245, .7); border: 1px solid rgba(90, 70, 40, .14);
}
.tb-btn:hover { background: #fff; }
.tb-center { flex: 1; min-width: 0; text-align: center; }
.tb-stage { font-family: var(--serif); font-size: 18px; font-weight: 800; }
.tb-desc { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.tb-sample {
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 6px; height: 28px; padding: 0 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: #5a5348;
  background: rgba(255, 252, 245, .95); border: 1px dashed rgba(90, 70, 40, .35);
}
.tb-sample:hover { background: #fff; border-style: solid; color: var(--ink); }
.sheet.is-graded ~ * .tb-sample,
#examView.is-graded .tb-sample { display: none; }
.tb-right {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-left: auto;
  position: relative;
  z-index: 6;
}
.hint-bulb {
  position: relative;
  flex: 0 0 auto;
}
.hint-bulb[hidden] { display: none !important; }
.hint-bulb-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(90, 70, 40, .14);
  background: rgba(255, 252, 245, .9);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}
.hint-bulb-btn:hover { background: #fff; }
.hint-bulb-icon { display: block; line-height: 0; }
.hint-bulb .hb-glass { fill: #d8d0c4; transition: fill .25s ease; }
.hint-bulb .hb-base { fill: #9a9084; }
.hint-bulb .hb-filament {
  fill: none;
  stroke: #7a7268;
  stroke-width: 1.6;
  opacity: .55;
  transition: stroke .25s ease, opacity .25s ease;
}
.hint-bulb.is-lit .hint-bulb-btn {
  background: linear-gradient(180deg, #fff8d4, #ffe7a0);
  border-color: rgba(220, 160, 40, .55);
  box-shadow: 0 0 0 3px rgba(255, 210, 80, .22), 0 8px 20px rgba(220, 150, 20, .28);
  animation: hintBulbGlow 1.4s ease-in-out infinite;
}
.hint-bulb.is-lit .hb-glass { fill: #ffe566; }
.hint-bulb.is-lit .hb-base { fill: #c9a227; }
.hint-bulb.is-lit .hb-filament {
  stroke: #f0a020;
  opacity: 1;
}
.hint-bubble {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(260px, 72vw);
  padding: 12px 14px 13px;
  border-radius: 14px;
  background: #fffdf6;
  border: 1px solid rgba(201, 148, 36, .35);
  box-shadow: 0 14px 32px rgba(40, 28, 10, .2);
  text-align: left;
  z-index: 20;
}
.hint-bubble[hidden] { display: none !important; }
.hint-bubble::before {
  content: '';
  position: absolute;
  top: -6px; right: 16px;
  width: 12px; height: 12px;
  background: #fffdf6;
  border-left: 1px solid rgba(201, 148, 36, .35);
  border-top: 1px solid rgba(201, 148, 36, .35);
  transform: rotate(45deg);
}
.hint-bubble-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  color: #b7791f;
}
.hint-bubble-text {
  margin-top: 5px;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.45;
  color: var(--ink);
}
@keyframes hintBulbGlow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255, 210, 80, .18), 0 8px 18px rgba(220, 150, 20, .22); }
  50% { box-shadow: 0 0 0 5px rgba(255, 210, 80, .32), 0 10px 24px rgba(220, 150, 20, .34); }
}
@media (prefers-reduced-motion: reduce) {
  .hint-bulb.is-lit .hint-bulb-btn { animation: none; }
}
.tb-timer {
  display: flex; flex-direction: column; align-items: stretch; gap: 5px;
  min-width: 118px;
  padding: 7px 12px 8px; border-radius: 12px;
  background: rgba(255, 252, 245, .85); border: 1px solid rgba(90, 70, 40, .14);
  font-variant-numeric: tabular-nums;
}
.tb-timer-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.tb-timer-label { font-size: 11px; color: var(--muted); }
.tb-timer b { font-family: var(--mono); font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.tb-timer-track {
  height: 5px; border-radius: 999px; overflow: hidden;
  background: rgba(90, 70, 40, .12);
}
.tb-timer-fill {
  display: block; height: 100%; width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--vol), var(--vol-2));
  transform-origin: left center;
  transform: scaleX(1);
  transition: transform .1s linear, background-color .2s ease;
}
.tb-timer.is-urgent {
  border-color: rgba(198, 40, 40, .45);
  background: rgba(255, 235, 238, .95);
}
.tb-timer.is-urgent b { color: #c62828; }
.tb-timer.is-urgent .tb-timer-fill {
  background: linear-gradient(90deg, #c62828, #ef6c00);
}

.edit-tip {
  margin: -6px 0 12px;
  padding: 8px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #5a5348;
  background: rgba(255, 252, 245, .88);
  border: 1px dashed rgba(90, 70, 40, .28);
  border-radius: 10px;
}

.sheet-wrap {
  display: flex; justify-content: center;
  perspective: 1200px;
}
.sheet {
  --sheet-w: min(100%, 794px, calc((100vh - 170px) * 210 / 297));
  width: var(--sheet-w);
  aspect-ratio: 210 / 297;
  max-height: calc(100vh - 170px);
  padding: clamp(18px, 3.2vw, 34px) clamp(16px, 3vw, 36px) clamp(14px, 2vw, 24px);
  background: #fff;
  border: 1px solid #d2c8b4;
  box-shadow: var(--shadow);
  border-radius: 1px;
  position: relative;
  display: flex;
  flex-direction: column;
  transform-origin: top center;
  animation: sheetIn .55s var(--ease) both;
}
/* 프로(50문제) 2장: 책상 위에 시험지를 겹쳐 둔 느낌 */
.sheet.is-multipage {
  --sheet-w: min(100%, 794px);
  aspect-ratio: auto;
  max-height: none;
  height: auto;
  gap: 0;
  padding: clamp(14px, 2.4vw, 22px) clamp(12px, 2.4vw, 22px) clamp(12px, 2vw, 18px);
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(255, 250, 235, .9), transparent 55%),
    linear-gradient(180deg, #ebe3d4, #e2d8c6);
  border-color: rgba(90, 70, 40, .18);
  box-shadow: none;
}
.sheet.is-multipage::before { display: none; }
.sheet.is-multipage .sheet-head {
  background: #fff;
  margin: 0 0 14px;
  padding: 12px 16px 10px;
  border: 1px solid #d2c8b4;
  border-radius: 2px;
  box-shadow: 0 6px 18px rgba(40, 30, 16, .1);
}
.sheet.is-multipage .sheet-note {
  background: #fff;
  margin-bottom: 14px;
}
.sheet.is-multipage .sheet-foot {
  background: #fff;
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid #d2c8b4;
  border-radius: 2px;
  box-shadow: 0 6px 18px rgba(40, 30, 16, .08);
}
@keyframes sheetIn {
  from { opacity: 0; transform: translateY(18px) rotateX(4deg); }
  to { opacity: 1; transform: none; }
}
.sheet::before {
  content: ""; position: absolute; inset: 8px; pointer-events: none;
  border: 1px solid rgba(90, 70, 40, .1);
}
.sheet.is-graded { box-shadow: var(--shadow), inset 0 0 0 2px rgba(198, 40, 40, .08); }

.sheet-head {
  flex: none;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: end; gap: 12px;
  padding-bottom: 10px; margin-bottom: 8px;
  border-bottom: 2.5px double var(--ink);
  position: relative; z-index: 1;
}
.sheet-brand { font-family: var(--serif); font-size: 14px; font-weight: 800; letter-spacing: .06em; }
.sheet-meta { text-align: center; }
.sheet-meta span:first-child {
  display: block; font-family: var(--serif); font-size: clamp(18px, 2.4vw, 22px); font-weight: 800;
}
.sheet-meta span:last-child { font-size: 12px; color: var(--muted); }
.sheet-clock {
  text-align: right; font-size: 11px; color: var(--muted);
  justify-self: end;
}
.sheet-clock b {
  display: block; margin-top: 2px;
  font-family: var(--mono); font-size: clamp(14px, 1.8vw, 17px); font-weight: 700; color: var(--ink);
  letter-spacing: -.02em;
}
.sheet.is-graded .sheet-clock { opacity: .35; }
.score-stamp-slot {
  position: absolute;
  right: 2px;
  top: -10px;
  z-index: 5;
  pointer-events: none;
}
.score-stamp {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: rotate(var(--rot, -3deg)) scale(var(--sc, 1));
  transform-origin: 70% 40%;
  filter: contrast(1.06) saturate(1.05);
  animation: pencilStamp .35s ease-out both;
}
.score-num {
  color: #c62828;
  font-family: "Nanum Pen Script", "Nanum Myeongjo", cursive;
  font-weight: 400;
  font-size: clamp(68px, 11vw, 96px);
  line-height: .78;
  letter-spacing: .02em;
  text-shadow: 0.4px 0.6px 0 rgba(183, 28, 28, .18);
}
.score-lines {
  width: clamp(84px, 14vw, 128px);
  height: 18px;
  margin-top: -4px;
  overflow: visible;
}

.sheet-page-nav {
  display: flex; gap: 6px; justify-content: center;
  margin: 0 0 8px; flex-wrap: wrap;
}
.sheet-page-btn {
  height: 28px; padding: 0 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
  background: rgba(90, 70, 40, .08); color: var(--ink-2);
  border: 1px solid rgba(90, 70, 40, .12);
}
.sheet-page-btn:hover { background: rgba(90, 70, 40, .14); }
.sheet-pages {
  display: grid;
  gap: 18px;
  flex: 1 1 auto;
  min-height: 0;
}
.sheet.is-multipage .sheet-pages {
  gap: 28px;
}
.sheet-page {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.sheet-page.is-multipage {
  position: relative;
  min-height: min(72vh, 920px);
  margin: 0;
  padding: clamp(14px, 2.2vw, 22px) clamp(12px, 2vw, 20px) clamp(16px, 2.2vw, 24px);
  background: #fff;
  border: 1px solid #d2c8b4;
  border-radius: 2px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .7) inset,
    0 10px 28px rgba(40, 30, 16, .14),
    0 2px 6px rgba(40, 30, 16, .08);
}
.sheet-page.is-multipage + .sheet-page.is-multipage {
  margin-top: 6px;
}
.sheet-page.is-multipage + .sheet-page.is-multipage::before {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  top: -18px;
  height: 10px;
  border-radius: 999px;
  background: rgba(60, 45, 25, .07);
  box-shadow: 0 0 12px rgba(60, 45, 25, .06);
  pointer-events: none;
}
.sheet-page-label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  letter-spacing: .04em; margin: 0 0 4px; text-align: center;
}
.sheet-page.is-multipage .sheet-page-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(90, 70, 40, .06);
  border: 1px dashed rgba(90, 70, 40, .22);
  color: #6a5a40;
  font-size: 12px;
  letter-spacing: .06em;
}
.sheet-page.is-multipage .sheet-page-label::before,
.sheet-page.is-multipage .sheet-page-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(90, 70, 40, .28), transparent);
}
.sheet-note {
  flex: none;
  margin: 0 0 8px;
  padding: 8px 12px;
  border-radius: 4px;
  background: rgba(42, 90, 140, .06);
  border: 1px solid rgba(42, 90, 140, .16);
  font-size: clamp(11.5px, 1.45vw, 13px);
  line-height: 1.55;
  color: var(--ink-2);
  position: relative;
  z-index: 1;
}

.q-grid {
  --rows: 10;
  /* 행이 많을수록(20·30·50문제) 채점 ○/★ 를 비례해 축소 */
  --mark-size: clamp(24px, calc(520px / var(--rows, 5)), 96px);
  list-style: none;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(var(--rows), 1fr);
  grid-auto-flow: column;
  column-gap: 0;
  position: relative;
  z-index: 1;
  padding: 4px 0;
}
.q-grid::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 2%;
  bottom: 2%;
  width: 0;
  border-left: 1.5px solid #b9ae98;
  transform: translateX(-50%);
  pointer-events: none;
}
.q-item {
  display: grid;
  grid-template-columns: 2.6em minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 0;
  height: 100%;
  padding: 0 clamp(10px, 1.6vw, 18px);
  border-bottom: 1px solid rgba(90, 70, 40, .08);
  transition: background .2s;
  position: relative;
}
.q-item.is-clickable { cursor: pointer; }
.q-item.is-clickable:hover:not(.is-active) {
  background: rgba(42, 90, 140, .05);
  border-radius: 4px;
}
.q-item.is-left { padding-right: clamp(14px, 2.2vw, 28px); }
.q-item.is-right { padding-left: clamp(14px, 2.2vw, 28px); }
/* 5문제 묶음 사이 호흡선 (가운데 세로선과 같은 톤) */
.q-item.is-breath {
  border-bottom: none;
}
.q-item.is-breath::after {
  content: "";
  position: absolute;
  left: clamp(10px, 1.6vw, 18px);
  right: clamp(10px, 1.6vw, 18px);
  bottom: 0;
  height: 0;
  border-bottom: 1.5px solid #b9ae98;
  pointer-events: none;
}
.q-item.is-left.is-breath::after { right: clamp(14px, 2.2vw, 28px); }
.q-item.is-right.is-breath::after { left: clamp(14px, 2.2vw, 28px); }
.q-item.is-active {
  background: rgba(255, 243, 168, .42);
  border-radius: 4px;
  border-bottom-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(232, 213, 106, .45);
}
.q-item.is-active.is-breath::after { opacity: .55; }
.q-item.is-done:not(.is-active) { opacity: .94; }

/* 5문제 구간 힘내기 포인트 (대개 4·5번, 가끔 3번) */
.q-item.is-cheer {
  background: linear-gradient(90deg, rgba(255, 236, 120, .55), rgba(255, 248, 190, .35));
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(220, 170, 40, .35);
}
.q-item.is-cheer .q-no-text {
  color: #a07810;
  font-weight: 800;
}
.q-item.is-cheer .q-expr {
  color: #7a5a08;
}
.q-item.is-cheer.is-active {
  background: linear-gradient(90deg, rgba(255, 228, 90, .72), rgba(255, 243, 150, .55));
  box-shadow: inset 0 0 0 1.5px rgba(200, 150, 20, .55);
}
.q-item.is-cheer.is-done:not(.is-active) {
  opacity: 1;
  background: linear-gradient(90deg, rgba(255, 236, 120, .28), rgba(255, 248, 190, .16));
}
.q-no {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-width: 1.6em;
  font-family: var(--mono); font-size: clamp(12px, 1.5vw, 14px); font-weight: 700; color: var(--muted);
  z-index: 2;
}
.q-no-text { position: relative; z-index: 1; }
.q-expr {
  font-family: var(--mono); font-size: clamp(13px, 1.7vw, 17px); font-weight: 700;
  letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.q-answer {
  display: flex; align-items: center; gap: 3px;
  position: relative;
  padding-right: 18px;
}
.digit {
  width: clamp(18px, 2.2vw, 24px);
  height: clamp(22px, 2.6vw, 28px);
  display: grid; place-items: center;
  border: 1.5px solid #a89f8c;
  border-radius: 2px;
  font-family: var(--mono); font-size: clamp(12px, 1.6vw, 15px); font-weight: 700;
  background: #fff;
  color: var(--ink);
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.q-item.is-active .digit {
  background: var(--active);
  border-color: var(--active-edge);
  box-shadow: 0 0 0 1px rgba(232, 213, 106, .4);
}
.q-item.is-active .digit.is-cursor {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.q-item.is-active .digit.is-selected {
  background: #ebe7df;
  border-color: #b0a898;
  color: #9a9488;
  box-shadow: none;
  outline: none;
  filter: grayscale(1);
}
.mark {
  pointer-events: none;
}
.mark-img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--mark-size, 72px);
  height: var(--mark-size, 72px);
  transform:
    translate(calc(-50% + var(--dx, 0px)), calc(-52% + var(--dy, 0px)))
    rotate(var(--rot, 0deg))
    skewX(var(--skew, 0deg))
    scale(var(--sc, 1));
  transform-origin: 50% 50%;
  z-index: 3;
  opacity: 0;
  animation: pencilStamp .32s ease-out var(--delay, 0s) both;
  filter: contrast(1.04) saturate(1.08);
}
.mark-img.no {
  width: calc(var(--mark-size, 72px) * 0.9);
  height: calc(var(--mark-size, 72px) * 0.9);
}
.mark-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
@keyframes pencilStamp {
  from {
    opacity: 0;
    transform:
      translate(calc(-50% + var(--dx, 0px)), calc(-52% + var(--dy, 0px)))
      rotate(var(--rot, 0deg))
      skewX(var(--skew, 0deg))
      scale(calc(var(--sc, 1) * 1.18));
  }
  to {
    opacity: 1;
    transform:
      translate(calc(-50% + var(--dx, 0px)), calc(-52% + var(--dy, 0px)))
      rotate(var(--rot, 0deg))
      skewX(var(--skew, 0deg))
      scale(var(--sc, 1));
  }
}
.q-fix {
  position: absolute; left: 0; top: calc(100% - 2px);
  font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--no);
  white-space: nowrap; line-height: 1;
}

.sheet-foot {
  flex: none;
  margin-top: 6px; padding-top: 8px;
  border-top: 1px solid var(--paper-line);
  position: relative; z-index: 1;
}
.sheet-sign {
  text-align: center;
  font-size: clamp(11px, 1.4vw, 12.5px);
  color: var(--muted);
  letter-spacing: .02em;
}
.exam-hint {
  margin: 10px auto 0;
  max-width: min(100%, 794px);
  padding: 0 12px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.exam-hint.hidden { display: none; }

.grade-stamp {
  margin-top: 8px; text-align: center;
  font-family: var(--serif); font-size: 15px; font-weight: 800;
  color: var(--no);
}
.grade-stamp b { font-family: var(--mono); margin: 0 4px; }

.keypad {
  display: none;
  margin: 20px auto 0;
  max-width: 360px;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.keypad button {
  height: 52px; border-radius: 12px;
  font-family: var(--mono); font-size: 22px; font-weight: 700;
  background: rgba(255, 252, 245, .9);
  border: 1px solid rgba(90, 70, 40, .14);
  box-shadow: 0 2px 0 rgba(90, 70, 40, .08);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.keypad button:active { transform: translateY(1px); }
.keypad .key-fn { font-size: 15px; font-family: var(--sans); font-weight: 700; color: var(--ink-2); }
.keypad [data-key="back"] { grid-column: span 2; }
.keypad [data-key="enter"] { grid-column: span 3; }

.warm-toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.warm-progress {
  margin-left: auto;
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  color: var(--muted); letter-spacing: .04em;
}
.warm-skip { opacity: .75; }
.warm-panel {
  background: rgba(255, 252, 245, .92);
  border: 1px solid rgba(90, 70, 40, .14);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px 22px 26px;
  min-height: 320px;
}
.warm-kicker {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .18em; color: var(--muted);
}
.warm-panel h2 {
  margin-top: 8px;
  font-family: var(--serif); font-size: clamp(26px, 5vw, 36px); font-weight: 800;
  letter-spacing: -.03em; line-height: 1.15;
}
.warm-lead {
  margin-top: 12px; max-width: 460px;
  font-size: 15px; line-height: 1.7; color: var(--ink-2);
}
.warm-steps {
  margin: 20px 0 0; padding: 0; list-style: none;
  display: grid; gap: 10px;
}
.warm-steps li {
  display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(90, 70, 40, .05);
  border: 1px solid rgba(90, 70, 40, .08);
  font-size: 14px; line-height: 1.55; color: var(--ink-2);
}
.warm-steps .warm-step-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--active); border: 1px solid var(--active-edge);
  font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--ink);
  flex: none;
}
.warm-steps .warm-step-txt {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: keep-all;
}
.warm-steps .warm-step-txt strong {
  font-weight: 800;
  color: var(--ink);
  background: none;
  border: none;
  display: inline;
  width: auto; height: auto;
}
.warm-actions {
  margin-top: 22px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.warm-hint { font-size: 13px; color: var(--muted); }

.warm-seat {
  margin-top: 16px;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.warm-cell {
  width: 52px; height: 58px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  border: 2px solid rgba(90, 70, 40, .2);
  background: #fff;
  font-family: var(--mono); font-size: 26px; font-weight: 700;
}
.warm-cell.is-active {
  background: var(--active);
  border-color: var(--active-edge);
  box-shadow: 0 0 0 3px rgba(232, 213, 106, .35);
}
.warm-cell.is-done {
  border-color: rgba(26, 122, 69, .45);
  color: var(--ok);
}
.warm-cell.is-bad {
  animation: warmShake .28s var(--ease);
  border-color: rgba(198, 40, 40, .55);
}
@keyframes warmShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.warm-goal {
  margin: 18px auto 0;
  max-width: 420px;
  padding: 18px 20px 16px;
  text-align: center;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff8d6 0%, #ffe9a8 100%);
  border: 2px solid #d4b84a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 8px 22px rgba(90, 70, 40, .12);
}
.warm-goal-cmd {
  font-size: clamp(18px, 4.2vw, 24px);
  font-weight: 800;
  letter-spacing: -.02em;
  color: #1c1a16;
  text-shadow: 0 1px 0 rgba(255,255,255,.55);
}
.warm-goal-num {
  margin: 8px auto 4px;
  width: min(120px, 34vw);
  height: min(120px, 34vw);
  display: grid; place-items: center;
  border-radius: 20px;
  background: #1c1a16;
  color: #fff8e7;
  font-family: var(--mono);
  font-size: clamp(56px, 16vw, 84px);
  font-weight: 800;
  letter-spacing: -.06em;
  line-height: 1;
  box-shadow: 0 10px 0 #0f0e0c, 0 14px 28px rgba(0,0,0,.22);
}
.warm-goal-sub {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #5a5348;
}
.warm-lead-foot {
  margin: 14px auto 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.warm-arena {
  margin-top: 18px;
  min-height: 200px;
  display: grid; place-items: center;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 243, 168, .45), transparent 55%),
    rgba(90, 70, 40, .04);
  border: 1px dashed rgba(90, 70, 40, .18);
  position: relative;
}
.warm-digit {
  font-family: var(--mono); font-size: clamp(72px, 18vw, 120px); font-weight: 800;
  letter-spacing: -.06em; line-height: 1;
  color: var(--ink);
  transition: transform .12s var(--ease), opacity .12s ease;
}
.warm-digit.is-wait { opacity: .2; transform: scale(.86); font-size: 28px; letter-spacing: 0; }
.warm-digit.is-hit { color: var(--ok); transform: scale(1.06); }
.warm-digit.is-miss { color: var(--no); transform: scale(.94); }
.warm-stats {
  margin-top: 16px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  text-align: center;
}
.warm-stats div {
  padding: 10px 8px; border-radius: 12px;
  background: rgba(90, 70, 40, .05);
}
.warm-stats dt { font-size: 11px; color: var(--muted); }
.warm-stats dd { margin-top: 4px; font-family: var(--mono); font-size: 18px; font-weight: 700; }
.warm-bar {
  margin-top: 14px; height: 8px; border-radius: 999px;
  background: rgba(90, 70, 40, .12); overflow: hidden;
}
.warm-bar > i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--vol), var(--vol-2));
  border-radius: inherit;
  transition: width .2s ease;
}
.warm-pass {
  margin-top: 18px; padding: 16px 16px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--vol) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--vol) 32%, transparent);
}
.warm-pass h3 {
  font-family: var(--serif); font-size: 22px; font-weight: 800;
}
.warm-pass p { margin-top: 6px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.warm-fail {
  margin-top: 18px; padding: 16px;
  border-radius: 14px;
  background: rgba(198, 40, 40, .08);
  border: 1px solid rgba(198, 40, 40, .22);
}
.warm-fail h3 { font-size: 18px; font-weight: 800; color: var(--no); }
.warm-fail p { margin-top: 6px; font-size: 14px; color: var(--ink-2); line-height: 1.55; }

.warm-keypad {
  display: grid;
  margin: 18px auto 0;
  max-width: 320px;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.warm-keypad button {
  height: 52px; border-radius: 12px;
  font-family: var(--mono); font-size: 22px; font-weight: 700;
  background: rgba(255, 252, 245, .9);
  border: 1px solid rgba(90, 70, 40, .14);
  box-shadow: 0 2px 0 rgba(90, 70, 40, .08);
}
.warm-keypad button:active { transform: translateY(1px); }
.warm-keypad button.is-flash {
  background: var(--active);
  border-color: var(--active-edge);
}
.warm-keypad .key-fn { font-size: 15px; font-family: var(--sans); font-weight: 700; color: var(--ink-2); }
.warm-keypad.is-guide-only button { pointer-events: none; opacity: .55; }
.warm-keypad.is-hidden { display: none; }

@media (max-width: 720px) {
  .warm-stats { grid-template-columns: 1fr 1fr 1fr; }
  .warm-cell { width: 44px; height: 50px; font-size: 22px; }
}

.result-banner {
  position: sticky; bottom: 48px; z-index: 30;
  margin-top: 20px;
}
.result-banner.is-pass .rb-inner {
  background: linear-gradient(135deg, rgba(45, 90, 55, .96), rgba(28, 26, 22, .94));
  box-shadow: 0 16px 40px rgba(40, 90, 50, .28);
}
.rb-inner {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(28, 26, 22, .92);
  color: #f5f1e8;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .28);
  animation: rise .4s var(--ease) both;
}
.rb-score { display: flex; align-items: baseline; gap: 2px; min-width: 88px; }
.rb-score b { font-family: var(--mono); font-size: 36px; font-weight: 700; }
.rb-score span { font-size: 14px; color: rgba(245, 241, 232, .65); }
.rb-text { flex: 1; min-width: 160px; }
.rb-text h2 { font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
.rb-text p { margin-top: 3px; font-size: 13px; color: rgba(245, 241, 232, .7); }
.rb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rb-actions .hidden { display: none !important; }

.sheet.is-wrong-focus .q-item:not(.is-wrong) {
  opacity: .28;
  filter: grayscale(.35);
}
.sheet.is-wrong-focus .q-item.is-wrong {
  outline: 2px solid rgba(198, 40, 40, .55);
  outline-offset: 2px;
  background: rgba(255, 235, 238, .55);
  border-radius: 8px;
}
.q-item.is-wrong-flash {
  animation: wrongFlash .9s ease;
}
@keyframes wrongFlash {
  0%, 100% { box-shadow: none; }
  40% { box-shadow: 0 0 0 4px rgba(198, 40, 40, .35); }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 16px; border-radius: 999px;
  font-size: 13.5px; font-weight: 700;
  transition: transform .15s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: #fff; color: #1c1a16; }
.btn-ghost { background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .2); }
.btn-text { color: rgba(245, 241, 232, .75); }

.report-panel {
  margin: 18px auto 40px;
  max-width: 720px;
  animation: rise .45s var(--ease) both;
}
.report {
  background: var(--paper);
  border: 1px solid rgba(90, 70, 40, .14);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px 22px 26px;
}
.report-head { text-align: center; margin-bottom: 18px; }
.report-kicker {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .2em; color: var(--muted);
}
.report-head h2 {
  margin-top: 8px;
  font-family: var(--serif); font-size: clamp(22px, 4vw, 28px); font-weight: 800;
  letter-spacing: -.03em;
}
.report-head p { margin-top: 6px; font-size: 13.5px; color: var(--ink-2); }
.report-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-bottom: 20px;
}
.report-stats > div {
  padding: 12px 10px; border-radius: 12px;
  background: #f6f1e6; border: 1px solid rgba(90, 70, 40, .1);
  text-align: center;
}
.report-stats dt {
  font-size: 11px; font-weight: 700; color: var(--muted);
  letter-spacing: .02em;
}
.report-stats dd {
  margin-top: 4px;
  font-family: var(--mono); font-size: 26px; font-weight: 700;
  letter-spacing: -.03em; line-height: 1.1;
}
.report-stats small {
  display: inline; margin-left: 2px;
  font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--muted);
}
.report-chart-wrap { margin-top: 6px; }
.report-chart-wrap h3,
.report-focus h3,
.report-coach h3,
.norm-chart-wrap h3 {
  font-family: var(--serif); font-size: 17px; font-weight: 800;
  letter-spacing: -.02em; margin-bottom: 10px;
}
.report-chart {
  display: flex; align-items: flex-end; gap: 3px;
  height: 140px; padding: 8px 4px 0;
  border-bottom: 1px solid var(--paper-line);
  overflow-x: auto;
}
.rp-col {
  flex: 1 0 14px; max-width: 28px; min-width: 12px;
  height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; gap: 4px;
}
.rp-bar {
  width: 100%; border-radius: 4px 4px 1px 1px;
  background: #7aa3c9;
}
.rp-bar.ok { background: linear-gradient(180deg, #6fb48a, #3d8f5f); }
.rp-bar.no { background: linear-gradient(180deg, #e88888, #c62828); }
.rp-col.hot .rp-bar {
  outline: 2px solid #c62828;
  outline-offset: 1px;
}
.rp-col.soft .rp-bar {
  opacity: .72;
  background: linear-gradient(180deg, #c4a35a, #a67c2e);
}
.rp-col.soft.hot .rp-bar {
  opacity: 1;
  background: linear-gradient(180deg, #e88888, #c62828);
}
.rp-col span {
  font-family: var(--mono); font-size: 9px; color: var(--muted);
}
.report-chart-note {
  margin-top: 8px; font-size: 12px; color: var(--muted); line-height: 1.5;
}

.report-rank {
  display: grid; grid-template-columns: 200px 1fr; gap: 14px;
  margin: 4px 0 18px; align-items: stretch;
}
.rank-badge {
  padding: 16px 14px; border-radius: 14px;
  background: linear-gradient(160deg, #1c1a16 0%, #3a342c 100%);
  color: #f5f1e8; text-align: center;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
}
.rank-kicker {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: .18em; color: rgba(245,241,232,.55);
}
.rank-badge strong {
  display: block; margin-top: 4px;
  font-family: var(--mono); font-size: 28px; font-weight: 700;
  letter-spacing: -.03em;
}
.rank-level {
  font-family: var(--serif); font-size: 15px; font-weight: 800;
  color: #f0d78c;
}
.rank-badge p {
  margin-top: 8px; font-size: 11.5px; line-height: 1.45;
  color: rgba(245,241,232,.7);
}
.norm-chart-wrap {
  padding: 12px 14px 10px; border-radius: 14px;
  background: #f6f1e6; border: 1px solid rgba(90, 70, 40, .1);
  position: relative;
}
.norm-chart {
  height: 88px; padding: 0;
  border-bottom: 1px solid rgba(90, 70, 40, .12);
}
.norm-svg {
  display: block; width: 100%; height: 100%;
  overflow: visible;
}
.norm-line {
  stroke: #4a6f93; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.norm-gate {
  stroke: #7a5a2a; stroke-width: 1.5; stroke-dasharray: 3.5 3;
  vector-effect: non-scaling-stroke;
}
.norm-me-line {
  stroke: #c62828; stroke-width: 1.4; stroke-opacity: .55;
  vector-effect: non-scaling-stroke;
}
.norm-me-dot {
  fill: #c62828; stroke: #fff; stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}
.norm-marker,
.norm-gate-label {
  position: absolute; transform: translateX(-50%);
  pointer-events: none; z-index: 1;
}
.norm-marker { top: 34px; }
.norm-gate-label { top: 14px; }
.norm-gate-label.is-near { top: 8px; }
.norm-marker.is-near { top: 52px; }
.norm-marker span,
.norm-gate-label span {
  display: inline-block; padding: 2px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 4px 10px rgba(60, 45, 20, .12);
}
.norm-marker span {
  background: #c62828; color: #fff;
  box-shadow: 0 4px 10px rgba(198, 40, 40, .25);
}
.norm-gate-label span {
  background: #f3e6cf; color: #5a4018;
  border: 1px solid rgba(122, 90, 42, .35);
  letter-spacing: -.01em;
}
.norm-axis {
  display: flex; justify-content: space-between;
  margin-top: 6px; font-size: 10px; color: var(--muted);
  font-family: var(--mono);
}
.report-chart-note b { color: var(--ink-2); font-weight: 700; }

.pace-grid {
  display: grid; gap: 8px; margin-top: 14px;
}
.pace-card {
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid rgba(90, 70, 40, .12);
  background: #faf7f0;
}
.pace-card h4 {
  font-size: 13.5px; font-weight: 750; margin-bottom: 4px;
  letter-spacing: -.02em;
}
.pace-card p {
  font-size: 13.5px; line-height: 1.65; color: var(--ink-2);
}
.pace-focus { border-color: rgba(166, 124, 46, .45); background: #fbf4e4; }
.pace-focus h4 { color: #8a5a12; }
.pace-spike { border-color: rgba(198, 40, 40, .28); background: #fbf0f0; }
.pace-spike h4 { color: #a12828; }
.pace-unstable { border-color: rgba(42, 90, 140, .28); background: #f0f5fa; }
.pace-unstable h4 { color: #2a5a8c; }
.pace-stable { border-color: rgba(26, 122, 69, .28); background: #eef7f1; }
.pace-stable h4 { color: #1a7a45; }

.report-focus,
.report-coach {
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--paper-line);
}
.report-q {
  font-size: 15px; line-height: 1.55; color: var(--ink);
}
.report-why {
  margin-top: 8px; font-size: 14px; line-height: 1.7; color: var(--ink-2);
}
.report-coach ul {
  margin-left: 1.1em; display: grid; gap: 8px;
  font-size: 14px; line-height: 1.65; color: var(--ink-2);
}

@media (max-width: 720px) {
  .report-rank { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .report-stats { grid-template-columns: repeat(2, 1fr); }
  .report { padding: 16px 14px 20px; }
  .sheet {
    --sheet-w: 100%;
    aspect-ratio: auto;
    max-height: none;
    min-height: auto;
    height: auto;
  }
  .q-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-flow: row;
    grid-auto-rows: minmax(44px, auto);
    flex: none;
  }
  .q-grid::before { display: none; }
  .q-item.is-left,
  .q-item.is-right { padding-left: 8px; padding-right: 8px; }
  .sheet-head { grid-template-columns: 1fr; text-align: center; gap: 6px; }
  .sheet-brand, .sheet-clock { text-align: center; }
  .keypad {
    --keypad-h: calc(128px + env(safe-area-inset-bottom, 0px));
    display: grid;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 34px;
    z-index: 65;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    gap: 6px;
    grid-template-columns: repeat(5, 1fr);
    background: rgba(236, 230, 218, .97);
    border-top: 1px solid rgba(90, 70, 40, .14);
    box-shadow: 0 -8px 24px rgba(40, 30, 20, .12);
    backdrop-filter: blur(12px);
  }
  .keypad button {
    height: 46px;
    font-size: 20px;
    border-radius: 10px;
    background: #fffcf5;
  }
  .keypad [data-key="back"] { grid-column: span 2; }
  .keypad [data-key="enter"] {
    grid-column: span 3;
    background: linear-gradient(180deg, #fff3c4, #f0d98a);
    border-color: rgba(180, 140, 40, .35);
  }
  #examView:not(.hidden) {
    padding-bottom: calc(34px + var(--keypad-h, 128px) + 12px);
  }
  #examView:has(.sheet.is-graded) .keypad,
  #examView.is-graded .keypad {
    display: none;
  }
  #examView:has(.sheet.is-graded):not(.hidden),
  #examView.is-graded:not(.hidden) {
    padding-bottom: 48px;
  }
  .top-note { display: none; }
  .exam-hint { font-size: 11px; margin-top: 8px; }
}

.status-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 12px;
  background: rgba(28, 26, 22, .92);
  color: rgba(247, 241, 230, .78);
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 12px;
  backdrop-filter: blur(10px);
}
.status-admin {
  display: inline-flex; align-items: center;
  height: auto; padding: 0;
  margin-right: 12px;
  background: transparent; color: rgba(247, 241, 230, .28);
  text-decoration: none;
  font-size: 11px; font-weight: 500; letter-spacing: .02em;
  border: none; border-radius: 0; cursor: pointer;
  transition: color .15s ease;
}
.status-admin:hover { color: rgba(247, 241, 230, .62); background: transparent; }
.status-admin.hidden { display: none !important; }
.status-spacer { flex: 1; }
.status-meta { font-variant-numeric: tabular-nums; opacity: .8; }

.micro-admin {
  position: fixed;
  left: 12px; right: 12px; bottom: 42px;
  z-index: 85;
  width: min(560px, calc(100vw - 24px));
  max-height: min(70vh, 520px);
  overflow: auto;
  margin: 0 auto;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 252, 245, .97);
  border: 1px solid rgba(90, 70, 40, .16);
  box-shadow: 0 18px 50px rgba(30, 24, 16, .28);
}
.micro-admin[hidden] { display: none !important; }
.micro-admin-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}
.micro-kicker {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: .18em; color: var(--muted);
}
.micro-admin-head h2 {
  margin-top: 4px;
  font-family: var(--serif); font-size: 22px; font-weight: 800;
}
.micro-admin-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.micro-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.micro-kpis article {
  padding: 10px 10px 8px; border-radius: 12px;
  background: rgba(90, 70, 40, .05);
  border: 1px solid rgba(90, 70, 40, .08);
}
.micro-kpis dt { font-size: 11px; color: var(--muted); }
.micro-kpis dd { margin-top: 4px; font-family: var(--mono); font-size: 18px; font-weight: 700; }
.micro-kpis small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); font-weight: 600; }
.micro-section { margin-top: 14px; }
.micro-section h3 { font-size: 13px; font-weight: 800; margin-bottom: 8px; }
.micro-spark {
  display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px;
  align-items: end; height: 72px;
}
.micro-spark span {
  display: block; border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, var(--vol-2), var(--vol));
  min-height: 4px;
}
.micro-paths { list-style: none; display: grid; gap: 6px; }
.micro-paths li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  background: rgba(90, 70, 40, .04); font-size: 13px;
}
.micro-paths b { font-family: var(--mono); }
.micro-note { margin-top: 10px; font-size: 12px; color: var(--muted); }
@media (max-width: 720px) {
  .micro-kpis { grid-template-columns: repeat(2, 1fr); }
  .micro-admin { left: 8px; right: 8px; width: auto; }
}

/* —— 콤보 HUD · 색종이 —— */
.combo-hud {
  position: fixed;
  left: var(--cx, 50%);
  top: var(--cy, 42%);
  z-index: 89;
  /* 기본: 화면 가운데 앵커 */
  transform: translate(-50%, -50%) scale(.78);
  display: grid;
  justify-items: center;
  gap: 1px;
  min-width: min(46vw, 168px);
  max-width: min(56vw, 200px);
  padding: 10px 16px 9px;
  border-radius: 16px;
  background:
    radial-gradient(ellipse 80% 70% at 50% 30%, rgba(255, 220, 120, .28), transparent 55%),
    linear-gradient(160deg, rgba(28, 22, 14, .94), rgba(16, 14, 22, .92));
  color: #fff8e8;
  border: 1.5px solid rgba(255, 210, 90, .55);
  box-shadow:
    0 0 0 4px rgba(232, 184, 74, .12),
    0 12px 28px rgba(10, 8, 4, .4),
    0 0 28px rgba(255, 190, 60, .22);
  pointer-events: none;
  opacity: 0;
  transition: opacity .14s ease, transform .14s ease, left .18s ease, top .18s ease;
  text-align: center;
  overflow: hidden;
}
.combo-hud.is-on {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.combo-hud.is-pop {
  animation: comboPop .55s cubic-bezier(.15, 1.15, .3, 1);
}
.combo-hud.is-tier2 {
  border-color: rgba(120, 200, 255, .55);
  box-shadow:
    0 0 0 7px rgba(90, 170, 255, .14),
    0 18px 50px rgba(10, 8, 4, .45),
    0 0 48px rgba(80, 170, 255, .35);
}
.combo-hud.is-tier2 .combo-word { color: #9ad4ff; }
.combo-hud.is-tier3 {
  border-color: rgba(180, 140, 255, .6);
  box-shadow:
    0 0 0 8px rgba(160, 120, 255, .16),
    0 18px 50px rgba(10, 8, 4, .45),
    0 0 56px rgba(170, 120, 255, .4);
}
.combo-hud.is-tier3 .combo-word { color: #d2b8ff; }
.combo-hud.is-tier4 {
  border-color: rgba(255, 120, 160, .65);
  box-shadow:
    0 0 0 9px rgba(255, 100, 140, .18),
    0 18px 50px rgba(10, 8, 4, .45),
    0 0 64px rgba(255, 90, 140, .45);
}
.combo-hud.is-tier4 .combo-word { color: #ffb0c8; }
.combo-hud.is-cheer {
  background:
    radial-gradient(ellipse 80% 70% at 50% 30%, rgba(255, 230, 120, .4), transparent 55%),
    linear-gradient(160deg, rgba(90, 55, 10, .95), rgba(30, 20, 8, .94));
  border-color: rgba(255, 220, 100, .75);
}
.combo-hud.is-cheer .combo-word { color: #ffe08a; }
.combo-hud.is-cheer .combo-x { color: #fff8d8; font-size: clamp(28px, 6vw, 36px); }
.combo-hud[hidden] { display: none !important; }
.combo-burst {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 220, 100, .35), transparent 28%),
    radial-gradient(circle at 80% 25%, rgba(120, 200, 255, .25), transparent 26%),
    radial-gradient(circle at 50% 80%, rgba(255, 120, 160, .22), transparent 30%);
  animation: comboBurst .55s ease-out both;
  pointer-events: none;
}
.combo-word {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: clamp(10px, 2vw, 12px);
  font-weight: 800;
  letter-spacing: .18em;
  color: #e8b84a;
  text-shadow: 0 0 14px rgba(255, 200, 80, .45);
}
.combo-x {
  position: relative;
  z-index: 1;
  font-family: "Nanum Pen Script", var(--serif);
  font-size: clamp(30px, 7vw, 40px);
  font-weight: 700;
  line-height: .85;
  letter-spacing: -.02em;
  color: #fff;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, .25),
    0 0 22px rgba(255, 210, 90, .55);
}
.combo-sub {
  position: relative;
  z-index: 1;
  margin-top: 1px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: rgba(255, 248, 230, .7);
}
@keyframes comboPop {
  0% { transform: translate(-50%, -50%) scale(.5) rotate(-3deg); filter: brightness(1.35); }
  55% { transform: translate(-50%, -50%) scale(1.08) rotate(1deg); }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0); filter: none; }
}
@keyframes comboBurst {
  0% { opacity: 0; transform: scale(.6); }
  40% { opacity: 1; }
  100% { opacity: .55; transform: scale(1.15); }
}

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 87;
  pointer-events: none;
  overflow: hidden;
}
.confetti-layer.is-front { z-index: 93; }
.confetti-bit {
  position: absolute;
  width: var(--w, 8px);
  height: var(--h, 5px);
  border-radius: 1px;
  background: var(--c, #e8b84a);
  opacity: 0;
  will-change: transform, opacity;
  /* 부드럽게 떠올랐다 미끄러지듯 낙하 · 스르르 사라짐 */
  animation: confettiDrift var(--t, 2.8s) linear var(--d, 0s) both;
}
.confetti-bit.is-round { border-radius: 50%; }
@keyframes confettiDrift {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(.75);
    opacity: 0;
  }
  6% { opacity: .9; }
  /* 살짝 떠오름 */
  16% {
    transform: translate3d(var(--dx1), var(--lift), 0) rotate(var(--rot1, 30deg)) scale(1);
    opacity: 1;
  }
  /* 천천히 내려오기 시작 */
  38% {
    transform: translate3d(var(--dx2), var(--mid), 0) rotate(var(--rot2, 120deg)) scale(.98);
    opacity: .95;
  }
  /* 중후반: 가속 낙하 */
  72% {
    transform: translate3d(
      calc(var(--dx2) * 0.35 + var(--dx3) * 0.65),
      calc(var(--mid) * 0.28 + var(--fall) * 0.72),
      0
    ) rotate(calc(var(--rot2, 120deg) * 0.35 + var(--rot3, 280deg) * 0.65)) scale(.9);
    opacity: .55;
  }
  /* 스르르 소멸 */
  100% {
    transform: translate3d(var(--dx3), var(--fall), 0) rotate(var(--rot3, 280deg)) scale(.78);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .combo-hud, .combo-hud.is-pop, .combo-burst { animation: none; transition: none; }
  .confetti-bit { animation: none; display: none; }
}

.celebrate {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 10, 8, .52);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease;
  overflow: hidden;
}
.celebrate.is-on {
  opacity: 1;
  pointer-events: auto;
}
.celebrate[hidden] { display: none !important; }
.cele-glow {
  position: absolute;
  left: 50%; top: 48%;
  width: min(92vw, 520px);
  height: min(92vw, 520px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 230, 120, .55) 0%, rgba(255, 180, 60, .22) 35%, transparent 68%);
  animation: celeGlowPulse 1.8s ease-in-out infinite;
  pointer-events: none;
}
.celebrate.is-perfect .cele-glow {
  background:
    radial-gradient(circle, rgba(255, 240, 160, .7) 0%, rgba(255, 120, 160, .28) 38%, transparent 70%);
}
.celebrate.is-great .cele-glow {
  background:
    radial-gradient(circle, rgba(255, 230, 140, .58) 0%, rgba(255, 160, 80, .24) 38%, transparent 70%);
}
.celebrate.is-good .cele-glow {
  background:
    radial-gradient(circle, rgba(200, 240, 160, .45) 0%, rgba(120, 180, 80, .2) 40%, transparent 70%);
}
.celebrate.is-miss .cele-glow,
.celebrate.is-timeout .cele-glow {
  background:
    radial-gradient(circle, rgba(180, 200, 255, .35) 0%, rgba(100, 140, 200, .16) 40%, transparent 70%);
}
.cele-rays {
  position: absolute;
  left: 50%; top: 48%;
  width: min(110vw, 640px);
  height: min(110vw, 640px);
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 236, 150, .28) 0deg 8deg,
    transparent 8deg 22deg
  );
  -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 62%);
  mask-image: radial-gradient(circle, #000 18%, transparent 62%);
  animation: celeRaysSpin 12s linear infinite;
  pointer-events: none;
  opacity: .85;
}
.cele-sparks {
  position: absolute;
  left: 50%; top: 48%;
  width: 0; height: 0;
  pointer-events: none;
}
.cele-spark {
  position: absolute;
  left: 0; top: 0;
  width: var(--s, 8px);
  height: var(--s, 8px);
  border-radius: 50%;
  background: #ffe08a;
  box-shadow: 0 0 10px rgba(255, 230, 120, .9);
  transform: rotate(var(--a)) translateY(calc(var(--r) * -1)) scale(.4);
  opacity: 0;
  animation: celeSparkPop 1.6s ease-out var(--d) infinite;
}
.cele-spark.is-star {
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  width: 0; height: 0;
  border-left: calc(var(--s) * .45) solid transparent;
  border-right: calc(var(--s) * .45) solid transparent;
  border-bottom: var(--s) solid #ff6b6b;
  filter: drop-shadow(0 0 6px rgba(255, 120, 100, .8));
}
.cele-spark.is-glint {
  border-radius: 1px;
  width: calc(var(--s) * 1.6);
  height: 3px;
  background: #fff;
  box-shadow: 0 0 12px #fff8c8;
}
.cele-spark.is-ray {
  width: 3px;
  height: calc(var(--s) * 2.2);
  border-radius: 2px;
  background: linear-gradient(180deg, #fff, rgba(255, 210, 80, .2));
  box-shadow: 0 0 8px rgba(255, 230, 120, .7);
}
.cele-card {
  position: relative;
  z-index: 2;
  width: min(440px, 100%);
  max-height: min(92vh, 760px);
  overflow: auto;
  padding: 24px 18px 18px;
  text-align: center;
  border: 0;
  border-radius: 24px;
  font: inherit;
  color: inherit;
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(255, 236, 160, .55), transparent 55%),
    linear-gradient(180deg, #fffaf0, #fff7e4 55%, #ffefc8);
  box-shadow:
    0 0 0 3px rgba(255, 220, 100, .45),
    0 0 40px rgba(255, 200, 60, .35),
    0 22px 56px rgba(20, 14, 6, .4);
  transform: translateY(14px) scale(.9);
  transition: transform .28s cubic-bezier(.15, 1.1, .3, 1);
}
.celebrate.is-on .cele-card { transform: none; animation: celeCardBob 2.4s ease-in-out infinite; }
.celebrate.is-perfect .cele-card {
  box-shadow:
    0 0 0 4px rgba(255, 140, 180, .4),
    0 0 48px rgba(255, 160, 80, .45),
    0 22px 56px rgba(20, 14, 6, .4);
}
.celebrate.is-great .cele-card {
  box-shadow:
    0 0 0 3px rgba(255, 180, 60, .4),
    0 0 40px rgba(255, 170, 50, .35),
    0 22px 56px rgba(20, 14, 6, .4);
}
.celebrate.is-good .cele-card {
  box-shadow:
    0 0 0 3px rgba(140, 190, 70, .35),
    0 0 36px rgba(140, 180, 60, .28),
    0 22px 56px rgba(20, 14, 6, .4);
}
.cele-kicker {
  font-family: var(--mono); font-size: 12px; font-weight: 800;
  letter-spacing: .22em; color: #c47a12;
  text-shadow: 0 0 12px rgba(255, 200, 80, .5);
}
.celebrate.is-perfect .cele-kicker { color: #d62858; }
.celebrate.is-great .cele-kicker { color: #c45a10; }
.celebrate.is-good .cele-kicker { color: #3d7a28; }
.cele-title {
  margin-top: 6px;
  font-family: "Nanum Pen Script", var(--serif);
  font-size: clamp(40px, 9vw, 56px);
  line-height: .95;
  color: #c62828;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .6), 0 0 24px rgba(255, 120, 80, .35);
}
.celebrate.is-great .cele-title { color: #c45a10; }
.celebrate.is-good .cele-title { color: #2f6b22; }
.cele-line {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: #4a3a22;
}
.cele-sub {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}
.cele-hots {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cele-hot {
  padding: 10px 8px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(201, 148, 36, .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}
.cele-hot b {
  display: block;
  font-family: var(--mono);
  font-size: clamp(18px, 4.5vw, 22px);
  font-weight: 800;
  color: #1a1520;
  line-height: 1.1;
}
.cele-hot span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #8a7040;
}
.cele-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #5a3a08;
  background: linear-gradient(180deg, #ffe08a, #f0b84a);
  box-shadow: 0 4px 0 rgba(180, 120, 20, .35), 0 8px 18px rgba(200, 140, 20, .25);
  animation: celeCtaPulse 1.4s ease-in-out infinite;
}
.cele-rank {
  margin-top: 14px;
  text-align: left;
}
.cele-rank-loading,
.cele-rank-empty {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .65);
  font-size: 12.5px;
  font-weight: 650;
  color: #6a5a40;
  line-height: 1.4;
}
.cele-rank-summary {
  display: grid;
  gap: 6px;
}
.cele-rank-pill {
  margin: 0;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 750;
  color: #3a2a12;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(201, 148, 36, .22);
}
.cele-rank-pill b {
  font-family: var(--mono);
  font-size: 1.15em;
  color: #c62828;
}
.cele-rank-pill.is-region b { color: #1a5f9e; }
.cele-rank-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}
.cele-rank-tab {
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(90, 70, 40, .18);
  background: rgba(255, 255, 255, .55);
  font-size: 12px;
  font-weight: 800;
  color: #6a5a40;
  cursor: pointer;
}
.cele-rank-tab.is-on {
  background: #1a1520;
  border-color: #1a1520;
  color: #fff8e8;
}
.cele-rank-tab:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.cele-rank-pane { display: none; margin-top: 8px; }
.cele-rank-pane.is-on { display: block; }
.cele-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow: auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(90, 70, 40, .12);
}
.cele-rank-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1.2fr) minmax(0, 1fr) 44px 58px;
  gap: 4px;
  align-items: center;
  padding: 7px 8px;
  border-bottom: 1px solid rgba(90, 70, 40, .08);
  font-size: 11.5px;
  font-weight: 650;
  color: #3a3228;
}
.cele-rank-row:last-child { border-bottom: 0; }
.cele-rank-row.is-me {
  background: rgba(255, 230, 120, .45);
  font-weight: 800;
}
.cr-no {
  font-family: var(--mono);
  font-weight: 800;
  text-align: center;
  color: #8a7040;
}
.cele-rank-row.is-me .cr-no { color: #c62828; }
.cr-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cr-name b { color: #c62828; font-weight: 800; }
.cr-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #7a6a50;
  font-size: 11px;
}
.cr-score {
  font-family: var(--mono);
  font-weight: 800;
  text-align: right;
}
.cr-time {
  font-family: var(--mono);
  font-size: 10.5px;
  text-align: right;
  color: #6a5a40;
}
@keyframes celeGlowPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: .85; }
  50% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}
@keyframes celeRaysSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes celeSparkPop {
  0% { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--r) * -.55)) scale(.2); }
  25% { opacity: 1; }
  55% { opacity: .9; transform: rotate(var(--a)) translateY(calc(var(--r) * -1)) scale(1); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--r) * -1.2)) scale(.6); }
}
@keyframes celeCardBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes celeCtaPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  .cele-glow, .cele-rays, .cele-spark, .celebrate.is-on .cele-card, .cele-cta { animation: none; }
}

.ask-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.ask-modal.is-on {
  opacity: 1;
  pointer-events: auto;
}
.ask-modal[hidden] { display: none !important; }
.ask-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(28, 26, 22, .45);
  backdrop-filter: blur(3px);
}
.ask-modal-card {
  position: relative;
  z-index: 1;
  width: min(380px, 100%);
  padding: 22px 20px 16px;
  border-radius: 18px;
  background: #fffcf5;
  border: 1px solid rgba(90, 70, 40, .16);
  box-shadow: 0 22px 50px rgba(30, 24, 16, .28);
  transform: translateY(8px) scale(.98);
  transition: transform .18s ease;
}
.ask-modal.is-on .ask-modal-card {
  transform: none;
}
.ask-modal-msg {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -.02em;
  color: var(--ink);
  text-align: center;
}
.ask-modal-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 10px;
}
.ask-modal .btn-ghost {
  min-width: 88px;
  background: rgba(90, 70, 40, .06);
  color: var(--ink);
  border: 1px solid rgba(90, 70, 40, .16);
}
.ask-modal .btn-primary {
  min-width: 88px;
}

.area-tag {
  position: fixed;
  right: 14px;
  bottom: 48px;
  z-index: 80;
  max-width: min(92vw, 420px);
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(40, 34, 28, .88);
  color: #f7f1e6;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(30, 24, 16, .18);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .15s ease, transform .15s ease;
}
.area-tag.is-on {
  opacity: 1;
  transform: translateY(0);
}
.area-tag[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tb-timer-fill { transition: none; }
  .area-tag { transition: none; }
}
