@font-face { font-family: 'Plex Mono'; src: url('fonts/IBMPlexMono-Regular-Latin1.woff2') format('woff2'); font-weight: 400; }
@font-face { font-family: 'Plex Mono'; src: url('fonts/IBMPlexMono-Medium-Latin1.woff2') format('woff2'); font-weight: 500; }
@font-face { font-family: 'Plex Mono'; src: url('fonts/IBMPlexMono-SemiBold-Latin1.woff2') format('woff2'); font-weight: 600; }

:root {
  --bg: #0f1412;
  --bg-2: #131917;
  --panel: #161d1a;
  --felt: #132019;
  --line: #24302b;
  --line-2: #2f3d37;
  --text: #e7e9e3;
  --muted: #8b968f;
  --faint: #5c6862;
  --accent: #7fc4a0;
  --accent-ink: #0d1a14;
  --bad: #e07a68;
  --warn: #d8b36a;
  --card: #ece9df;
  --card-ink: #1b1f1d;
  --card-red: #b8483e;
  --mono: 'Plex Mono', ui-monospace, 'Roboto Mono', monospace;
  --sans: system-ui, -apple-system, 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
  --nav-h: 62px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { height: 100%; }
body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--sans);
  font-size: 15px; line-height: 1.5; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
}
button { font: inherit; color: inherit; }
.muted { color: var(--muted); font-weight: 400; }
.num, output, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 10px calc(16px + env(safe-area-inset-left)); background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--mono); letter-spacing: .18em; font-size: 13px; }
.brand-mark { font-weight: 600; }
.brand-sub { color: var(--accent); margin-left: .5em; font-weight: 500; }
.deck-src { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .06em; }
.deck-src i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.deck-src.api i { background: var(--accent); }
.deck-src.local i { background: var(--warn); }

main { padding: 12px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- stats ---------- */
.stats { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; background: var(--bg-2); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.stat .k { font-size: 11px; color: var(--muted); }
.stat .v { font-family: var(--mono); font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat .v small { font-size: 12px; color: var(--muted); margin-left: 1px; }
.stat.ok .v { color: var(--accent); }
.stat.ng .v { color: var(--bad); }
.stats-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 10px; }
.hist { display: flex; gap: 3px; flex: 1; }
.hist i { flex: 1; max-width: 12px; height: 6px; border-radius: 1px; background: var(--line); }
.hist i.o { background: var(--accent); }
.hist i.x { background: var(--bad); }
.reset { background: none; border: 0; padding: 2px 0; font-size: 12px; color: var(--faint); }
.reset.arm { color: var(--bad); }
.reset-confirm { display: flex; gap: 8px; font-size: 12px; }
.reset-confirm button { background: none; border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 8px; font-size: 12px; }
.reset-confirm button.yes { border-color: var(--bad); color: var(--bad); }

/* ---------- table panel ---------- */
.table-panel {
  position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 12px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(127,196,160,.07), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 22px),
    var(--felt);
}
.street { font-size: 12px; letter-spacing: .02em; color: var(--accent); margin-bottom: 10px; }
.street b { color: var(--text); font-weight: 500; }
.row-label { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--muted); margin: 6px 0 6px; }
.board, .hole { display: flex; gap: 6px; min-height: 40px; }
.board .card, .board .slot { width: calc((100% - 24px) / 5); max-width: 74px; }
.hole .card { width: 21%; max-width: 82px; min-width: 58px; }
.vs .hole .card { width: 46%; max-width: 74px; min-width: 0; }
.card { aspect-ratio: 226 / 314; border-radius: 6%/4.3%; position: relative; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,.45); background: var(--card); animation: deal .22s ease-out both; }
.card img { width: 100%; height: 100%; display: block; }
.card:nth-child(2) { animation-delay: .04s; } .card:nth-child(3) { animation-delay: .08s; } .card:nth-child(4) { animation-delay: .12s; } .card:nth-child(5) { animation-delay: .16s; }
@keyframes deal { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
.card.css { color: var(--card-ink); font-family: var(--mono); }
.card.css.red { color: var(--card-red); }
.card.css .cr { position: absolute; left: 8%; top: 4%; font-size: clamp(13px, 4.6vw, 20px); font-weight: 600; line-height: 1; }
.card.css .cs { position: absolute; left: 8%; top: calc(4% + 1.15em); font-size: clamp(11px, 3.4vw, 15px); line-height: 1; }
.card.css .cc { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(22px, 8vw, 38px); padding-top: 12%; }
.slot { aspect-ratio: 226/314; border: 1px dashed var(--line-2); border-radius: 6%/4.3%; display: grid; place-items: center; font-family: var(--mono); font-size: 9px; letter-spacing: .1em; color: var(--faint); }
.card.ghost { background: rgba(255,255,255,.04); box-shadow: none; animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.rule-note { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.06); font-size: 12px; color: var(--muted); line-height: 1.55; }
.rule-note b { color: var(--text); font-weight: 500; }
.hand-key { font-family: var(--mono); font-size: 13px; margin-top: 8px; color: var(--text); letter-spacing: .04em; }

/* seats */
.seats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 2px 0 6px; }
.seat { border: 1px solid var(--line-2); border-radius: 7px; padding: 6px 0 5px; text-align: center; font-family: var(--mono); font-size: 12px; color: var(--faint); position: relative; }
.seat small { display: block; font-size: 9px; letter-spacing: .06em; }
.seat.folded { color: var(--faint); text-decoration: line-through; text-decoration-color: rgba(255,255,255,.18); }
.seat.me { border-color: var(--accent); color: var(--accent-ink); background: var(--accent); font-weight: 600; }
.seat.me small { color: var(--accent-ink); opacity: .7; }

/* vs */
.vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.vs-mid { font-family: var(--mono); font-size: 12px; color: var(--faint); letter-spacing: .14em; padding-top: 16px; }
.vs-side .hole { gap: 6px; }

/* money */
.money { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 10px; margin: 12px 0; overflow: hidden; }
.money > div { padding: 9px 10px; border-right: 1px solid var(--line); }
.money > div:last-child { border-right: 0; }
.money .k { font-size: 11px; color: var(--muted); }
.money .v { font-family: var(--mono); font-size: 21px; font-weight: 500; line-height: 1.3; }
.money .s { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* fields */
.field { margin: 12px 0; }
.field-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field.optional { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field.optional .field-label { margin: 0; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.stepper button { width: 40px; background: var(--bg-2); border: 0; font-size: 18px; color: var(--muted); }
.stepper button:active { background: var(--line); }
.stepper output { min-width: 52px; display: grid; place-items: center; font-size: 17px; font-weight: 500; border-left: 1px solid var(--line); border-right: 1px solid var(--line); padding: 6px 0; }
.stepper.big { display: flex; }
.stepper.big button { width: 48px; height: 48px; }
.stepper.big output { flex: 1; font-size: 22px; }
.inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inputs .field { margin: 12px 0 4px; }
.pct-input { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 9px; height: 50px; padding: 0 12px; background: var(--bg-2); }
.pct-input input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font-family: var(--mono); font-size: 22px; font-weight: 500; -webkit-user-select: text; user-select: text; }
.pct-input:focus-within { border-color: var(--accent); }
.pct-input span { font-family: var(--mono); color: var(--muted); }
.pct-input input::-webkit-outer-spin-button, .pct-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tol { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 4px; }
.tol .field-label { margin: 0; }
.chips { display: flex; gap: 4px; }
.chips button { background: none; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.chips button.on { border-color: var(--accent); color: var(--accent); }
.toggle { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); margin: 12px 0 2px; }
.toggle input { accent-color: var(--accent); width: 18px; height: 18px; margin: 1px 0 0; flex: none; }
.toggle em { font-style: normal; color: var(--faint); }

/* choices */
.choices { display: grid; gap: 8px; margin: 14px 0 10px; }
.choices.two { grid-template-columns: 1fr 1fr; }
.choices button, .scale button {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 14px 0; font-size: 16px; font-weight: 600; letter-spacing: .02em;
  transition: border-color .12s, background .12s;
}
.choices button.sel, .scale button.sel { border-color: var(--accent); background: rgba(127,196,160,.12); color: var(--accent); }
.choices button.right, .scale button.right { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.choices button.wrong, .scale button.wrong { border-color: var(--bad); background: rgba(224,122,104,.14); color: var(--bad); }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 14px 0 6px; }
.scale button { padding: 9px 0 8px; font-size: 12px; font-weight: 500; line-height: 1.3; }
.scale button b { display: block; font-family: var(--mono); font-size: 15px; font-weight: 600; }
.scale-legend { font-size: 11.5px; color: var(--faint); text-align: center; margin-bottom: 10px; font-variant-numeric: tabular-nums; }

.primary {
  display: block; width: 100%; height: 50px; border: 0; border-radius: 11px; background: var(--text); color: var(--bg);
  font-size: 16px; font-weight: 700; letter-spacing: .02em; margin-top: 6px;
}
.primary:disabled { background: var(--line); color: var(--faint); }
.primary.next { background: var(--accent); color: var(--accent-ink); }
.primary:active:not(:disabled) { transform: scale(.99); }

/* ---------- explanation ---------- */
.explain { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg-2); animation: fade .2s ease-out; }
.verdict { padding: 12px 14px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.verdict .res { font-size: 17px; font-weight: 700; }
.verdict.ok .res { color: var(--accent); }
.verdict.ng .res { color: var(--bad); }
.verdict .ans { font-size: 13px; color: var(--muted); text-align: right; }
.verdict .ans b { color: var(--text); }
.step { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step-h { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.step-h .i { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: .08em; }
.step-h .t { font-size: 13px; color: var(--muted); }
.formula { font-family: var(--mono); font-size: 15px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.formula .hl { color: var(--accent); font-weight: 600; }
.formula .wa { color: var(--warn); font-weight: 600; }
.formula .bd { color: var(--bad); font-weight: 600; }
.note { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin-top: 6px; }
.note b { color: var(--text); font-weight: 500; }
.outs-group { display: grid; grid-template-columns: 74px 1fr; gap: 6px 8px; align-items: start; margin-top: 6px; font-size: 12px; }
.outs-group .g { color: var(--muted); padding-top: 3px; }
.mini-cards { display: flex; flex-wrap: wrap; gap: 3px; }
.mc { font-family: var(--mono); font-size: 12px; padding: 2px 5px; border-radius: 4px; background: var(--card); color: var(--card-ink); line-height: 1.35; font-weight: 500; }
.mc.red { color: var(--card-red); }
.mc.dup { outline: 2px solid var(--warn); outline-offset: -1px; }
.tag { display: inline-block; font-size: 11.5px; border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 8px; margin: 0 4px 4px 0; color: var(--text); }

/* bars */
.meter { position: relative; height: 26px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; margin: 24px 0 22px; }
.meter .fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(127,196,160,.28); border-right: 2px solid var(--accent); border-radius: 5px 0 0 5px; }
.meter .need { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--warn); }
.meter .lab { position: absolute; top: 100%; margin-top: 3px; font-family: var(--mono); font-size: 10.5px; white-space: nowrap; transform: translateX(-50%); }
.meter .lab.e { color: var(--accent); }
.meter .lab.n { color: var(--warn); }
.ticks { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 9.5px; color: var(--faint); margin-top: -18px; margin-bottom: 4px; }

.stack { display: flex; height: 30px; border-radius: 6px; overflow: hidden; margin: 8px 0 6px; font-family: var(--mono); font-size: 11px; }
.stack div { display: grid; place-items: center; white-space: nowrap; overflow: hidden; }
.stack .a { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.stack .t { background: var(--line-2); color: var(--muted); }
.stack .b { background: #c9a463; color: #1d170c; font-weight: 600; }
.stack-legend { display: flex; justify-content: space-between; font-size: 12px; font-variant-numeric: tabular-nums; }
.stack-legend .a { color: var(--accent); }
.stack-legend .b { color: #d8b36a; }
.big-eq { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--mono); }
.big-eq .v { font-size: 26px; font-weight: 600; }
.big-eq .v.a { color: var(--accent); }
.big-eq .v.b { color: #d8b36a; }
.big-eq .k { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.zones { position: relative; height: 34px; margin: 8px 0 4px; }
.zones .z { position: absolute; top: 0; height: 14px; border-right: 1px solid var(--bg-2); }
.zones .z.c { background: #2b3631; } .zones .z.s { background: #3b5248; } .zones .z.d { background: #4f7a66; }
.zones .mk { position: absolute; top: -3px; width: 2px; height: 20px; background: var(--text); }
.zones .zl { position: absolute; top: 18px; font-family: var(--mono); font-size: 10px; color: var(--muted); transform: translateX(-50%); }
.progress { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; margin: 8px 0; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .08s; }

/* range grid */
.grid13 { display: grid; grid-template-columns: repeat(13, 1fr); gap: 1px; margin-top: 8px; background: var(--bg); border: 1px solid var(--line); }
.grid13 div { aspect-ratio: 1; display: grid; place-items: center; font-family: var(--mono); font-size: clamp(6.5px, 2.15vw, 10px); letter-spacing: -.04em; color: var(--faint); background: #18201d; }
.grid13 div.in { background: rgba(127,196,160,.30); color: var(--text); }
.grid13 div.pr.in { background: rgba(127,196,160,.42); }
.grid13 div.me { outline: 2px solid var(--warn); outline-offset: -2px; color: #fff; font-weight: 600; z-index: 1; }
.pos-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 4px; }
.pos-strip div { border: 1px solid var(--line-2); border-radius: 7px; text-align: center; padding: 5px 0; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.pos-strip div b { display: block; font-size: 14px; }
.pos-strip div.y b { color: var(--accent); }
.pos-strip div.n b { color: var(--faint); }
.pos-strip div.cur { border-color: var(--text); color: var(--text); }
.pos-strip small { display: block; font-size: 9.5px; color: var(--faint); }

.loading { font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 6px 0; }

/* ---------- nav ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--bg-2); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabs button { height: var(--nav-h); background: none; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--faint); position: relative; }
.tabs .n { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; }
.tabs .t { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.tabs .acc { font-family: var(--mono); font-size: 9.5px; white-space: nowrap; }
.tabs button.active { color: var(--text); }
.tabs button.active::before { content: ''; position: absolute; top: -1px; left: 26%; right: 26%; height: 2px; background: var(--accent); }
.tabs button.active .n, .tabs button.active .acc { color: var(--accent); }

/* ===================== v1.2 challenge ===================== */
.faint { color: var(--faint); }
.qtype { display: inline-block; background: var(--accent); color: var(--accent-ink); border-radius: 4px; padding: 0 6px; margin-right: 8px; font-weight: 700; font-size: 11px; }
.stepper.locked, .choices.locked, .scale.locked { pointer-events: none; }
.today { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); margin-bottom: 4px; overflow: hidden; }
.today > div { padding: 9px 12px; border-right: 1px solid var(--line); }
.today > div:last-child { border-right: 0; }
.today .k { font-size: 11px; color: var(--muted); }
.today .v { font-family: var(--mono); font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.today .v small { font-size: 12px; color: var(--muted); }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); margin: 18px 0 8px; letter-spacing: .02em; }
.type-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.type-chips::-webkit-scrollbar { display: none; }
.type-chips button { flex: none; border: 1px solid var(--line-2); background: none; border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--muted); }
.type-chips button.on { border-color: var(--accent); color: var(--accent); background: rgba(127,196,160,.08); font-weight: 600; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.mode { text-align: left; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px; min-height: 140px; display: flex; flex-direction: column; color: var(--text); }
.mode:active:not(:disabled) { border-color: var(--accent); }
.mode .en { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--accent); }
.mode .nm { font-size: 16px; font-weight: 700; margin-top: 2px; }
.mode .ds { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.45; flex: 1; }
.mode .best { font-family: var(--mono); font-size: 17px; font-weight: 600; margin-top: 8px; font-variant-numeric: tabular-nums; }
.mode .best small { display: block; font-family: var(--sans); font-size: 10.5px; font-weight: 400; color: var(--faint); }
.mode:disabled { opacity: .42; }
.rec { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 12.5px; }
.rec > div { padding: 7px 10px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.rec > div:nth-last-child(-n+4) { border-bottom: 0; }
.rec .h { font-family: var(--sans); color: var(--faint); font-size: 11px; background: var(--bg-2); }
.rec .r { font-family: var(--sans); color: var(--muted); }
.rec .cur { background: rgba(127,196,160,.07); color: var(--text); }
.an-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; background: var(--bg-2); }
.an-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.an-h b { font-size: 14px; }
.an-h span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.an-g { font-size: 11px; color: var(--faint); margin: 10px 0 2px; letter-spacing: .04em; }
.an-row { display: grid; grid-template-columns: 1fr 84px 62px; gap: 8px; align-items: center; font-size: 12.5px; padding: 3px 0; }
.an-row .lb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-row .pc { font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.an-row .pc small { color: var(--faint); font-size: 10px; }
.an-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.an-bar i { display: block; height: 100%; background: var(--accent); }
.an-bar.mid i { background: var(--warn); }
.an-bar.lo i { background: var(--bad); }
.insight { font-size: 12.5px; line-height: 1.55; border-left: 2px solid var(--warn); padding: 3px 0 3px 10px; margin-top: 10px; color: var(--muted); }
.insight b { color: var(--text); font-weight: 600; }
.danger-row { display: flex; justify-content: space-between; margin: 14px 2px 0; }

.runbar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-bottom: 10px; }
.quit { border: 1px solid var(--line-2); background: none; border-radius: 8px; padding: 7px 10px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.quit.arm { border-color: var(--bad); color: var(--bad); }
.rb-mid { text-align: center; }
.rb-mode { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--accent); }
.rb-type { font-size: 12px; color: var(--muted); }
.rb-right { text-align: right; min-width: 92px; }
.rb-big { font-family: var(--mono); font-size: 26px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rb-sub { font-size: 11px; color: var(--muted); white-space: nowrap; }
.drain { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; margin: -4px 0 10px; }
.drain i { display: block; height: 100%; width: 100%; background: var(--accent); transition: width .1s linear; }
.drain.low i { background: var(--bad); }
.run-submit { margin-top: 12px; }
.fb { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom)); z-index: 20; border-radius: 12px; padding: 12px 14px 10px; box-shadow: 0 10px 28px rgba(0,0,0,.55); animation: pop .14s ease-out; max-width: 536px; margin: 0 auto; }
.fb[hidden] { display: none !important; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fb b { display: block; font-size: 16px; }
.fb b em { font-style: normal; font-family: var(--mono); margin-left: 8px; font-size: 14px; }
.fb span { display: block; font-size: 13px; margin-top: 2px; line-height: 1.45; }
.fb i { display: block; font-style: normal; font-size: 10.5px; opacity: .6; margin-top: 4px; text-align: right; }
.fb.ok { background: var(--accent); color: var(--accent-ink); }
.fb.ng { background: #2a1814; border: 1px solid var(--bad); color: var(--text); }
.fb.ng b { color: var(--bad); }
.end-hero { text-align: center; padding: 14px 0 14px; }
.end-hero .k { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--accent); }
.end-hero .v { font-family: var(--mono); font-size: 58px; font-weight: 600; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.end-hero .u { font-size: 13px; color: var(--muted); margin-top: 2px; }
.end-best { font-size: 12px; color: var(--faint); margin-top: 6px; font-family: var(--mono); }
.badge-new { display: inline-block; margin-top: 8px; background: var(--warn); color: #1d170c; font-weight: 700; font-size: 12px; padding: 2px 12px; border-radius: 999px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.btn-row .primary { margin-top: 0; }
.ghost-btn { height: 50px; border: 1px solid var(--line-2); background: none; border-radius: 11px; font-weight: 600; font-size: 15px; }
.rv { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg-2); }
.rv-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.rv-row:last-of-type { border-bottom: 0; }
.rv-row.open { background: rgba(255,255,255,.03); }
.rv-row .ix { font-family: var(--mono); color: var(--faint); font-size: 11px; }
.rv-row .ds { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-row .ds b { color: var(--text); font-weight: 600; margin-right: 4px; }
.rv-row .ok, .rv-row .ng { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.rv-row .ok { color: var(--accent); }
.rv-row .ng { color: var(--bad); }
.rv-row small { color: var(--faint); font-weight: 400; font-size: 10.5px; }
.rv-detail { border-bottom: 1px solid var(--line); background: var(--bg); }
.rv-pad .verdict { border-top: 0; }

/* ===================== v1.3 position ===================== */
.type-chips.sub { margin-bottom: 12px; }
.type-chips.sub button { padding: 5px 11px; font-size: 12.5px; }
.seats.s7 { grid-template-columns: repeat(7, 1fr); gap: 3px; }
.seats.s7 .seat { font-size: 10.5px; padding: 6px 0 5px; }
.seats.s7 .seat small { font-size: 8.5px; }
.seat.opener { border-color: var(--warn); color: var(--warn); }
.seat.opener small { color: var(--warn); }
.choices.three { grid-template-columns: repeat(3, 1fr); }
.choices.list { grid-template-columns: 1fr; }
.choices.list button { text-align: left; padding: 13px 14px; font-size: 14px; font-weight: 500; line-height: 1.45; }
.concept-q { font-size: 16px; line-height: 1.55; font-weight: 600; color: var(--text); padding: 4px 0 2px; }
.legend3 { display: flex; gap: 12px; font-family: var(--mono); font-size: 11.5px; margin-bottom: 2px; }
.legend3 span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.legend3 .r { color: var(--warn); } .legend3 .r::before { background: rgba(216,179,106,.55); }
.legend3 .c { color: var(--accent); } .legend3 .c::before { background: rgba(127,196,160,.42); }
.legend3 .f { color: var(--faint); } .legend3 .f::before { background: #18201d; border: 1px solid var(--line-2); }
.grid13 div.r { background: rgba(216,179,106,.42); color: var(--text); }
.grid13 div.c { background: rgba(127,196,160,.30); color: var(--text); }
.posb { display: inline-block; border-radius: 4px; padding: 0 6px; font-weight: 700; color: var(--accent-ink); }
.posb.ip { background: var(--accent); }
.posb.oop { background: var(--bad); color: #fff; }
.assume { font-size: 12px; color: var(--muted); border-left: 2px solid var(--line-2); padding: 2px 0 2px 10px; margin: 0 0 4px; line-height: 1.55; }
.assume b { color: var(--text); font-weight: 600; }
.pv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 6px; }
.pv > div { border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 10px; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.pv > div.cur { border-color: var(--text); color: var(--text); }
.pv b { grid-row: span 2; font-size: 15px; align-self: center; }
.pv em { grid-column: 1 / -1; font-style: normal; font-family: var(--sans); font-weight: 700; font-size: 14px; }
.pv em.y { color: var(--accent); } .pv em.n { color: var(--bad); }
.order { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.order span { border: 1px solid var(--line-2); border-radius: 7px; padding: 4px 8px; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.order span small { color: var(--faint); margin-right: 4px; font-size: 9.5px; }
.order span.h { color: var(--text); border-color: var(--muted); }
.order span.a { border-color: var(--accent); color: var(--accent); }

.verdict .res { flex: none; white-space: nowrap; }

/* ===================== v1.4 guide ===================== */
.top-r { display: flex; align-items: center; gap: 10px; }
.goal-mini { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 8px; font-variant-numeric: tabular-nums; }
.goal-mini.done { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.guide-btn { border: 1px solid var(--line-2); background: none; border-radius: 8px; padding: 4px 10px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.guide-btn.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.see { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 14px 12px; border-top: 1px solid var(--line); }
.see span { font-size: 11px; color: var(--faint); margin-right: 2px; }
.see button { border: 1px solid var(--line-2); background: none; border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--accent); }
.goal { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); margin: 8px 2px 0; }
.goal b { color: var(--text); font-family: var(--mono); }
.gbar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.gbar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }

#guide { padding-bottom: 20px; }
.g-top { position: sticky; top: calc(45px + env(safe-area-inset-top)); z-index: 4; background: var(--bg); padding: 4px 0 8px; margin: -4px 0 4px; }
.g-search { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-2); padding: 0 10px; }
.g-search input { flex: 1; min-width: 0; height: 42px; background: none; border: 0; outline: 0; color: var(--text); font-size: 16px; -webkit-user-select: text; user-select: text; }
.g-search input::-webkit-search-cancel-button { display: none; }
.g-search button { background: none; border: 0; color: var(--muted); font-size: 14px; padding: 6px; }
.g-chips { display: flex; gap: 6px; overflow-x: auto; padding-top: 8px; scrollbar-width: none; }
.g-chips::-webkit-scrollbar { display: none; }
.g-chips button { flex: none; border: 1px solid var(--line-2); background: none; border-radius: 999px; padding: 5px 11px; font-size: 12.5px; color: var(--muted); }
.g-empty { text-align: center; color: var(--faint); padding: 30px 0; font-size: 13px; }
#guide.searching .g-sec:not(#g-terms):not(#g-formulas) { display: none; }
#guide.searching .g-sec h2 { display: none; }
.g-sec { margin-top: 18px; }
.g-sec h2 { font-size: 17px; margin: 0 0 10px; display: flex; align-items: baseline; gap: 8px; }
.g-sec h2 small { font-size: 12px; font-weight: 400; color: var(--faint); }
.g-sub { font-size: 12px; color: var(--muted); margin: 14px 0 6px; }
.g-cat { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--accent); margin: 14px 0 6px; }
.term, .fcard, .rule { border: 1px solid var(--line); border-radius: 11px; background: var(--bg-2); padding: 11px 13px; margin-bottom: 6px; }
.term .tt { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.term .tt b { font-size: 14.5px; }
.term .tt span { font-size: 11px; color: var(--faint); font-family: var(--mono); text-align: right; }
.term p, .fcard p, .rule p { margin: 5px 0 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.tex, .fex { margin-top: 6px; font-size: 12.5px; color: var(--text); background: rgba(255,255,255,.03); border-radius: 6px; padding: 5px 8px; line-height: 1.5; }
.tlink { background: none; border: 0; padding: 6px 0 0; color: var(--accent); font-size: 12.5px; }
.fcard .ft { font-size: 13px; color: var(--accent); font-weight: 600; }
.fcard .ff { font-family: var(--mono); font-size: 14.5px; margin-top: 4px; line-height: 1.5; color: var(--text); }
.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0%, 30% { border-color: var(--warn); box-shadow: 0 0 0 2px rgba(216,179,106,.35); } 100% { border-color: var(--line); box-shadow: none; } }

.calc { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); padding: 12px; margin-bottom: 8px; }
.cin { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cin label { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.cin input { height: 42px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--text); font-family: var(--mono); font-size: 17px; padding: 0 10px; width: 100%; outline: 0; -webkit-user-select: text; user-select: text; }
.cin input:focus { border-color: var(--accent); }
.cout { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.cout > div { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; display: flex; flex-direction: column; }
.cout span { font-size: 11px; color: var(--muted); }
.cout b { font-family: var(--mono); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cout small { font-family: var(--mono); font-size: 10px; color: var(--faint); }
.cout .wide { grid-column: 1 / -1; }
.cout .wide b { font-size: 15px; }
.cout .wide.y { border-color: var(--accent); } .cout .wide.y b { color: var(--accent); }
.cout .wide.n { border-color: var(--bad); } .cout .wide.n b { color: var(--bad); }
.cin2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cin2 .field-label { margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 8px 12px; font-size: 12.5px; color: var(--muted); }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
#g-ranges .seg { margin-bottom: 8px; }

.eslots { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; }
.eslots .eg:last-child { grid-column: 1 / -1; }
.eg .row-label { display: block; margin: 0 0 4px; }
.es { display: flex; gap: 4px; }
.slotb { width: 38px; height: 50px; border: 1px dashed var(--line-2); background: none; border-radius: 6px; font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--card-ink); padding: 0; }
.slotb small { font-family: var(--sans); font-size: 9.5px; color: var(--faint); font-weight: 400; }
.slotb.fill { background: var(--card); border: 1px solid var(--card); }
.slotb.fill.red { color: var(--card-red); }
.slotb.act { border: 2px solid var(--accent); }
.eg:last-child .slotb { width: 38px; }
.epick { margin-top: 12px; display: grid; gap: 3px; }
.prow { display: grid; grid-template-columns: repeat(13, 1fr); gap: 3px; }
.prow button { height: 38px; border: 0; border-radius: 5px; background: var(--card); color: var(--card-ink); font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 0; line-height: 1.05; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.prow button small { font-size: 10px; }
.prow button.red { color: var(--card-red); }
.prow button:disabled { opacity: .15; }
#eOut { margin-top: 10px; }

.otable { display: grid; grid-template-columns: 36px 1fr 74px 82px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 12.5px; }
.otable > div { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.otable .oh { background: var(--bg-2); color: var(--faint); font-size: 11px; line-height: 1.3; }
.otable .oh small { font-size: 9.5px; }
.otable .on { font-family: var(--mono); font-weight: 600; color: var(--accent); }
.otable .od { color: var(--muted); }
.otable .ov { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; }
.hrank { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.hr { display: grid; grid-template-columns: 22px 1fr 110px; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.hr:last-child { border-bottom: 0; }
.hr .hi { font-family: var(--mono); color: var(--faint); font-size: 11px; }
.hr b { display: block; font-size: 13.5px; }
.hr .hx { font-family: var(--mono); font-size: 12px; color: var(--text); }
.hr small { display: block; font-size: 11px; color: var(--faint); }
.hp { font-family: var(--mono); font-size: 12px; text-align: right; display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.hb { flex: 1; height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; }
.hb i { display: block; height: 100%; background: var(--accent); }
.ptable { display: grid; grid-template-columns: 1fr auto; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ptable > div { padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.ptable .pl small { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.ptable .pv2 { font-family: var(--mono); font-weight: 600; text-align: right; color: var(--accent); }
.seat-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.st-row { display: grid; grid-template-columns: 46px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.st-row:last-child { border-bottom: 0; }
.st-row > b { font-family: var(--mono); color: var(--accent); }
.st-row em { font-style: normal; font-size: 11px; color: var(--faint); margin-left: 4px; }
.st-row small { display: block; font-size: 11.5px; color: var(--muted); }
.st-p { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.ord-row { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin: 6px 0; }
.ord-row .ol { font-size: 11px; color: var(--faint); width: 52px; }
.ord-row span:not(.ol) { font-family: var(--mono); font-size: 11.5px; border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 6px; }
.ord-row i { font-style: normal; color: var(--faint); font-size: 10px; }
.mrow { border: 1px solid var(--line); border-radius: 11px; background: var(--bg-2); padding: 10px 12px; margin-bottom: 6px; }
.mh { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mh b { font-family: var(--mono); font-size: 14px; }
.mh span { font-size: 11.5px; color: var(--muted); text-align: right; }
.mc2 { display: flex; align-items: center; gap: 3px; margin: 6px 0 2px; }
.mc2 em { font-style: normal; font-size: 11px; color: var(--faint); margin: 0 6px; }
.stack.sm { height: 8px; margin: 6px 0 4px; }
.rule b { font-size: 13.5px; }
.rule .chips { margin-top: 8px; }
.rule textarea { width: 100%; margin-top: 8px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; color: var(--text); font-family: var(--mono); font-size: 11px; padding: 8px; resize: vertical; -webkit-user-select: text; user-select: text; }
.rule .btn-row { margin-top: 8px; align-items: center; }
.rule .ghost-btn { height: 42px; font-size: 13.5px; }
.bk-msg { font-size: 12px; color: var(--muted); }
.ver { text-align: center; font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 18px; }

/* ===================== v1.5 web app (iPhone) ===================== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.rule textarea { font-size: 16px; }
main { padding-left: calc(16px + env(safe-area-inset-left)); padding-right: calc(16px + env(safe-area-inset-right)); }

/* ===================== v1.7 ads hooks ===================== */
.hint-row { margin: 10px 0 2px; }
.hint-btn { width: 100%; background: none; border: 1px dashed var(--line-2); border-radius: 10px; padding: 10px; font-size: 13px; color: var(--muted); }
.hint-btn:disabled { opacity: .6; }
.hint-box { border: 1px solid var(--warn); border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.55; color: var(--muted); background: rgba(216,179,106,.06); }
.hint-box b { color: var(--text); }
.hint-box > b:first-child { color: var(--warn); margin-right: 4px; }
.revive { border: 1px solid var(--warn); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: rgba(216,179,106,.06); animation: pop .15s ease-out; }
.revive .rv-k { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--warn); }
.revive .rv-k b { font-size: 14px; color: var(--text); }
.revive p { font-size: 13px; color: var(--muted); margin: 6px 0 12px; line-height: 1.5; }
.revive .ghost-btn { width: 100%; margin-top: 8px; }
.revive .rv-msg { font-size: 12px; color: var(--bad); margin-top: 6px; }

/* ===================== v1.8 language ===================== */
.tabs button { min-width: 0; }
html:not([lang="ko"]) .tabs .t { font-size: 11px; letter-spacing: -.01em; }
.lang-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 8px; }
.lang-grid button { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); }
.lang-grid button b { font-size: 14px; font-weight: 600; color: var(--text); }
.lang-grid button small { font-family: var(--mono); font-size: 10px; color: var(--faint); letter-spacing: .04em; }
.lang-grid button.on { border-color: var(--accent); }
.lang-grid button.on b, .lang-grid button.on small { color: var(--accent); }
@media (max-width: 340px) { .lang-grid { grid-template-columns: repeat(2, 1fr); } }
.an-row .lb { white-space: normal; overflow: visible; line-height: 1.25; font-size: 12px; }

/* ===================== v1.9 daily hand + attendance streak ===================== */
:root { --fire: #e8a24f; --fire-2: #e07a3c; }
.streak-chip { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 8px 0 6px; border: 1px solid var(--line-2); border-radius: 999px; background: none; font-family: var(--mono); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.streak-chip svg { width: 14px; height: 14px; fill: var(--faint); }
.streak-chip.due svg { fill: var(--fire); animation: chipPulse 2.2s ease-in-out infinite; transform-origin: 50% 90%; }
.streak-chip.lit { border-color: rgba(232,162,79,.55); background: rgba(232,162,79,.12); color: var(--fire); }
.streak-chip.lit svg { fill: var(--fire); }
.streak-chip.on { border-color: var(--text); }
@keyframes chipPulse { 0%, 100% { opacity: .45; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.08); } }
@media (max-width: 370px) { .deck-src span { display: none; } .top-r { gap: 7px; } }

.d-card, .d-head, .d-result { background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.d-card { background: linear-gradient(160deg, rgba(232,162,79,.07), transparent 55%), var(--panel); }
.d-ch { display: flex; flex-direction: column; gap: 1px; margin-bottom: 10px; }
.d-ch .en { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--fire); text-transform: uppercase; }
.d-ch b { font-size: 18px; }
.d-ch small { font-size: 12.5px; color: var(--muted); }
.d-card .primary, .d-card .ghost-btn { width: 100%; margin-top: 12px; }
.d-streak { display: grid; grid-template-columns: 44px auto 1fr; align-items: center; gap: 10px; }
.d-fl .flame { width: 44px; height: 44px; filter: grayscale(.85) brightness(.7); transition: filter .3s; }
.d-streak.lit .d-fl .flame { filter: drop-shadow(0 0 8px rgba(232,162,79,.45)); animation: flick 2.6s ease-in-out infinite; transform-origin: 50% 92%; }
.d-sn b { display: block; font-family: var(--mono); font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.d-streak.lit .d-sn b { color: var(--fire); }
.d-sn span { font-size: 11.5px; color: var(--muted); }
.d-sm { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 11.5px; color: var(--faint); font-family: var(--mono); }
.d-msg { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.d-msg b { color: var(--fire); }
.wk { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wd i { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); display: block; position: relative; }
.wd span { font-size: 10.5px; color: var(--faint); }
.wd.now span { color: var(--text); font-weight: 600; }
.wd.on i { background: var(--fire); border-color: var(--fire); }
.wd.on.pf i::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: #fff3d4; }
.wd.rep i { border-style: dashed; border-color: var(--fire); background: rgba(232,162,79,.15); }
.wd.todo i { border-style: dashed; border-color: var(--muted); animation: todo 1.8s ease-in-out infinite; }
@keyframes todo { 50% { border-color: var(--fire); } }
.d-repair { margin-top: 12px; padding: 10px 12px; border: 1px dashed rgba(232,162,79,.5); border-radius: 10px; }
.d-repair b { font-size: 13.5px; }
.d-repair p { margin: 2px 0 8px; font-size: 12.5px; color: var(--muted); }
.d-repair .ghost-btn { height: 40px; width: 100%; color: var(--fire); border-color: rgba(232,162,79,.5); font-size: 14px; }

.d-prog { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.d-prog div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.d-prog i { height: 4px; border-radius: 2px; background: var(--line-2); display: block; transition: background .3s; }
.d-prog span { font-size: 10px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-prog .ok i { background: var(--accent); } .d-prog .ng i { background: var(--bad); }
.d-prog .cur i { background: var(--fire); animation: todo 1.6s ease-in-out infinite; } .d-prog .cur span { color: var(--text); }
.d-step { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg-2); animation: fade .25s ease-out; }
.d-step.active { border-color: rgba(232,162,79,.45); }
.d-step .step-h .i { color: var(--fire); }
.d-q { font-size: 14.5px; line-height: 1.6; }
.d-q .mc { vertical-align: 1px; }
.d-step .primary { width: 100%; margin-top: 4px; }
.d-step .explain { margin-top: 10px; }
.d-story { font-size: 13px; color: var(--text); margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--fire); }
.d-outs-ans { margin: 10px 0 0; font-family: var(--mono); font-size: 13px; }
.d-outs-ans .y { color: var(--accent); } .d-outs-ans .n { color: var(--bad); }
#daily > .primary { width: 100%; margin-top: 12px; }
.choices.four { grid-template-columns: 1fr 1fr; }
.ord-row span.me { border-color: var(--accent); color: var(--accent); }
.ord-row span.vl { border-color: var(--bad); color: var(--bad); }
.ord-row span.dim { opacity: .45; }
.d-result { margin-top: 14px; animation: fade .3s ease-out; }
.d-rh { font-size: 12px; color: var(--muted); }
.d-score { display: flex; align-items: baseline; gap: 4px; margin: 2px 0 10px; }
.d-score b { font-family: var(--mono); font-size: 40px; line-height: 1; }
.d-score span { font-family: var(--mono); font-size: 18px; color: var(--muted); }
.d-score em { font-style: normal; margin-left: 10px; font-size: 12px; font-weight: 700; color: var(--accent-ink); background: var(--fire); border-radius: 999px; padding: 2px 9px; align-self: center; }
.d-marks { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 14px; }
.d-marks div { text-align: center; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 2px; min-width: 0; }
.d-marks b { display: block; font-size: 15px; }
.d-marks .ok b { color: var(--accent); } .d-marks .ng b { color: var(--bad); }
.d-marks span { font-size: 9.5px; color: var(--faint); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* streak celebration */
.sfx { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(6,9,8,0); transition: background .3s; }
.sfx.in { background: rgba(8,11,10,.95); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sfx.out { background: rgba(6,9,8,0); }
.sfx-card { width: 100%; max-width: 330px; text-align: center; opacity: 0; transform: translateY(16px) scale(.96); transition: opacity .3s, transform .35s cubic-bezier(.2,.9,.3,1.2); }
.sfx.in .sfx-card { opacity: 1; transform: none; }
.sfx.out .sfx-card { opacity: 0; transform: scale(.97); }
.sfx-fl { position: relative; width: 120px; height: 120px; margin: 0 auto 4px; }
.sfx-fl .flame { position: relative; width: 120px; height: 120px; transform: scale(0); transform-origin: 50% 90%; }
.sfx.in .sfx-fl .flame { animation: flamePop .6s cubic-bezier(.2,.9,.3,1.4) .1s forwards, flick 2.4s ease-in-out .7s infinite; }
.sfx-fl .glow { position: absolute; inset: 10px; border-radius: 50%; background: radial-gradient(circle, rgba(232,162,79,.55), transparent 65%); opacity: 0; }
.sfx.in .sfx-fl .glow { animation: glow 1.4s ease-out .45s forwards; }
.sfx-fl .sp { position: absolute; left: 50%; top: 58%; }
.sfx-fl .sp i { position: absolute; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: var(--fire); opacity: 0; }
.sfx-fl .sp i:nth-child(3n) { background: #f2cf7a; width: 4px; height: 4px; }
.sfx.in .sfx-fl .sp i { animation: spark .9s ease-out .55s forwards; }
@keyframes flamePop { 0% { transform: scale(0) rotate(-8deg); } 70% { transform: scale(1.12) rotate(2deg); } 100% { transform: scale(1); } }
@keyframes flick { 0%, 100% { transform: scale(1, 1); } 30% { transform: scale(.97, 1.04) skewX(-1.5deg); } 60% { transform: scale(1.02, .97) skewX(1deg); } }
@keyframes glow { 0% { opacity: 0; transform: scale(.6); } 40% { opacity: 1; } 100% { opacity: .55; transform: scale(1.25); } }
@keyframes spark { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--d))) scale(.3); } }
.sfx-num { position: relative; height: 64px; overflow: hidden; font-family: var(--mono); font-size: 58px; font-weight: 600; line-height: 64px; color: var(--fire); font-variant-numeric: tabular-nums; }
.sfx-num span { position: absolute; left: 0; right: 0; }
.sfx-num .o { color: var(--muted); }
.sfx-num .n { transform: translateY(100%); }
.sfx.in .sfx-num .o { animation: numOut .45s cubic-bezier(.5,0,.2,1) .5s forwards; }
.sfx.in .sfx-num .n { animation: numIn .55s cubic-bezier(.2,.9,.3,1.3) .55s forwards; }
@keyframes numOut { to { transform: translateY(-100%); opacity: 0; } }
@keyframes numIn { to { transform: translateY(0); } }
.sfx-t { font-size: 20px; font-weight: 700; margin-top: 4px; opacity: 0; }
.sfx.in .sfx-t { animation: rise .4s ease-out .8s forwards; }
.sfx-ms, .sfx-pf { display: inline-block; margin: 8px 4px 0; font-size: 12.5px; font-weight: 700; padding: 3px 12px; border-radius: 999px; opacity: 0; }
.sfx-ms { color: var(--accent-ink); background: var(--fire); }
.sfx-pf { color: var(--fire); border: 1px solid var(--fire); }
.sfx.in .sfx-ms, .sfx.in .sfx-pf { animation: rise .4s ease-out 1s forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sfx .wk { margin: 22px auto 0; max-width: 300px; }
.sfx .wk.anim .wd i { transform: scale(.6); opacity: .3; }
.sfx.in .wk.anim .wd i { animation: dotIn .35s ease-out forwards; animation-delay: calc(1.05s + var(--i) * .07s); }
.sfx.in .wk.anim .wd.now i { animation: dotIn .35s ease-out forwards, ring 1s ease-out forwards; animation-delay: 1.6s, 1.75s; }
.sfx .wk.anim .wd.todo i { animation: none; }
@keyframes dotIn { to { transform: scale(1); opacity: 1; } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(232,162,79,.7); } 100% { box-shadow: 0 0 0 14px rgba(232,162,79,0); } }
.sfx small { display: block; margin-top: 22px; font-size: 11.5px; color: var(--faint); opacity: 0; }
.sfx.in small { animation: rise .4s ease-out 2s forwards; }
.sfx.ms .sfx-fl .flame { filter: drop-shadow(0 0 14px rgba(242,207,122,.6)); }
@media (prefers-reduced-motion: reduce) {
  .sfx *, .sfx { animation-duration: .01s !important; animation-delay: 0s !important; transition-duration: .01s !important; }
  .streak-chip.due svg, .d-streak.lit .d-fl .flame, .wd.todo i, .d-prog .cur i { animation: none; }
}
