/* 레시피알려줘 — 따뜻한 요리책 종이 + 터미널 */
:root {
  --bg: #f6f1e8;
  --surface: #fffcf7;
  --surface-2: #f2ebdf;
  --ink: #1f1b16;
  --ink-2: #4d463e;
  --muted: #8b8278;
  --line: #e6ddcf;
  --line-strong: #d6cab8;
  --accent: #e4572e;
  --accent-strong: #c9441d;
  --accent-ink: #ffffff;
  --accent-soft: #fde4d9;
  --term-bg: #1f1b16;
  --term-ink: #f3ece2;
  --term-dim: #8f8578;
  --term-accent: #ffae85;
  --ok: #1f8a4c;
  --ok-soft: #dcf2e4;
  --bad: #d23a2a;
  --bad-soft: #fbe0dc;
  --warn: #b7650a;
  --warn-soft: #fbead2;
  --over: #7347d6;
  --over-soft: #ebe3fb;
  --gray: #6b645c;
  --gray-soft: #ece7df;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(60, 40, 20, 0.06), 0 6px 24px -12px rgba(60, 40, 20, 0.18);
  --font: "Pretendard", system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Mono", "D2Coding", Consolas, monospace;
  /* 난이도 색: Lv. 1~5, 6~10, 11~15, 16~20, 21~25, 26~30 */
  --t0: #c27c0e; --t0-soft: #fbefd6;
  --t1: #8f7a12; --t1-soft: #f4efcf;
  --t2: #d23a2a; --t2-soft: #fbe0dc;
  --t3: #9a3412; --t3-soft: #f6e0d5;
  --t4: #7347d6; --t4-soft: #ebe3fb;
  --t5: #a77b0c; --t5-soft: #1f1b16;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15130f;
    --surface: #1d1a16;
    --surface-2: #26221c;
    --ink: #f1eae0;
    --ink-2: #cfc6ba;
    --muted: #978d80;
    --line: #322d26;
    --line-strong: #453e35;
    --accent: #ff7a4f;
    --accent-strong: #ff9670;
    --accent-ink: #1a0e07;
    --accent-soft: #3a2117;
    --term-bg: #0e0c0a;
    --ok: #4fd08a; --ok-soft: #173325;
    --bad: #ff7a6b; --bad-soft: #3b1c18;
    --warn: #f3b15a; --warn-soft: #3a2a14;
    --over: #b39cff; --over-soft: #2a2242;
    --gray: #a69d92; --gray-soft: #2b2721;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px -14px rgba(0, 0, 0, 0.6);
    --t0: #f0b04a; --t0-soft: #33270f;
    --t1: #d9c45a; --t1-soft: #2f2b12;
    --t2: #ff7a6b; --t2-soft: #3b1c18;
    --t3: #ef8a5a; --t3-soft: #3a2014;
    --t4: #b39cff; --t4-soft: #2a2242;
    --t5: #f3c44e; --t5-soft: #0a0907;
  }
}

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.65; -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: break-word; }
pre, code, textarea { word-break: normal; }
a { color: var(--accent-strong); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
code, pre, kbd { font-family: var(--mono); font-size: 0.86rem; }
code { background: var(--surface-2); padding: 0.1em 0.4em; border-radius: 5px; }
pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.8rem 1rem; margin: 0.35rem 0 1rem; white-space: pre-wrap; word-break: break-word; max-height: 30rem; overflow: auto; line-height: 1.55; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.25; }
h1 { font-size: clamp(1.6rem, 2.4vw, 2rem); font-weight: 800; margin: 0.2rem 0 0.4rem; }
h2 { font-size: 1.2rem; font-weight: 750; margin: 0; }
h3 { font-size: 1rem; margin: 1rem 0 0.4rem; }
h4 { font-size: 0.78rem; color: var(--muted); margin: 0.7rem 0 0.25rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.center { text-align: center; }
.hint { color: var(--muted); font-size: 0.84rem; font-weight: 400; }
.eyebrow { color: var(--accent-strong); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; margin: 0; }
.pid { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.hidden { display: none !important; }

/* ---------- 머리말 ---------- */
header.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1120px; margin: 0 auto; padding: 0.7rem 1.5rem; display: flex; align-items: center; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: 0.5rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.logo-mark { width: 26px; height: 26px; color: var(--accent); }
.logo { font-weight: 850; font-size: 1.12rem; letter-spacing: -0.03em; }
.tmtr { font-family: var(--mono); font-size: 0.66rem; font-weight: 700; color: var(--accent-strong); background: var(--accent-soft); border-radius: 5px; padding: 0.05rem 0.35rem; }
.main-nav { display: flex; gap: 0.25rem; flex: 1; }
.main-nav a { color: var(--ink-2); padding: 0.35rem 0.7rem; border-radius: 999px; font-weight: 550; font-size: 0.95rem; }
.main-nav a:hover { background: var(--surface-2); text-decoration: none; }
.main-nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.account { display: flex; align-items: center; gap: 0.8rem; }
.nav-quiet { color: var(--ink-2); font-weight: 550; }
.who { color: var(--ink-2); font-weight: 600; font-size: 0.92rem; }
form.inline { display: inline; }

main { max-width: 1120px; margin: 0 auto; padding: 1.8rem 1.5rem 3rem; }
footer { border-top: 1px solid var(--line); margin-top: 3rem; }
.footer-inner { max-width: 1120px; margin: 0 auto; padding: 1.3rem 1.5rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 0.86rem; color: var(--muted); }
.prompt-line { font-family: var(--mono); }
.caret { color: var(--accent); font-weight: 700; }

/* ---------- 공통 조각 ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; margin: 1rem 0; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card-pad { padding: 1.1rem 1.4rem 0.6rem; }
.card-title { margin-bottom: 0.7rem; }
.card.narrow { max-width: 27rem; margin: 2.5rem auto; }
.card.auth h1 { margin-bottom: 1rem; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 2.4rem 0 0.2rem; }
.crumbs { display: flex; gap: 0.45rem; font-size: 0.86rem; color: var(--muted); margin-bottom: 0.4rem; }
.crumbs a { color: var(--muted); }
.meta-line { display: flex; flex-wrap: wrap; gap: 0.45rem; color: var(--muted); font-size: 0.92rem; margin: 0 0 0.5rem; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty p { margin: 0 0 0.8rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 1rem; }

.flash { border-radius: var(--radius-sm); padding: 0.75rem 1rem; margin-bottom: 1rem; border: 1px solid var(--line); background: var(--surface); font-weight: 550; }
.flash.error { border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: var(--bad-soft); color: var(--bad); }

.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.chip { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 0.08rem 0.5rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }

/* 난이도 배지 */
.tier { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; font-weight: 750; padding: 0.18rem 0.6rem; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.tier::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; }
.tier.sm { font-size: 0.72rem; padding: 0.1rem 0.5rem; }
.tier.t0 { color: var(--t0); background: var(--t0-soft); }
.tier.t1 { color: var(--t1); background: var(--t1-soft); }
.tier.t2 { color: var(--t2); background: var(--t2-soft); }
.tier.t3 { color: var(--t3); background: var(--t3-soft); }
.tier.t4 { color: var(--t4); background: var(--t4-soft); }
.tier.t5 { color: #f3c44e; background: var(--t5-soft); border-color: #a77b0c; }
.tier.guess { background: transparent; border: 1px dashed currentColor; }

/* 판정 배지 */
.badge { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 750; font-size: 0.82rem; padding: 0.15rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.badge.v-AC { color: var(--ok); background: var(--ok-soft); }
.badge.v-WA { color: var(--bad); background: var(--bad-soft); }
.badge.v-PS { color: var(--accent-strong); background: var(--accent-soft); }
.badge.v-FE { color: var(--warn); background: var(--warn-soft); }
.badge.v-OLE { color: var(--over); background: var(--over-soft); }
.badge.v-RE, .badge.v-SE { color: var(--gray); background: var(--gray-soft); }
.badge.pending { color: var(--ink-2); background: var(--surface-2); }
.dot-spin { width: 0.6rem; height: 0.6rem; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 막대 */
.bar { display: inline-block; height: 0.42rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; vertical-align: middle; }
.bar .fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width 0.6s ease; }
.bar.mini { width: 4.5rem; margin-right: 0.5rem; }
.bar.wide { display: block; width: 100%; max-width: 22rem; margin-top: 0.4rem; }
.num-label { font-variant-numeric: tabular-nums; font-size: 0.86rem; color: var(--ink-2); }

/* 표 */
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list th { font-size: 0.74rem; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; background: var(--surface-2); }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.list th.center, table.list td.center { text-align: center; }
.title-cell .ptitle { color: var(--ink); font-weight: 650; font-size: 1rem; }
.title-cell .ptitle:hover { color: var(--accent-strong); }
td.ratio { white-space: nowrap; }
.mine { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; font-weight: 800; font-size: 0.85rem; }
.mine.ok { color: var(--ok); background: var(--ok-soft); }
.mine.tried { color: var(--bad); background: var(--bad-soft); }
.mine.part { width: auto; padding: 0 0.5rem; border-radius: 999px; font-size: 0.75rem; color: var(--accent-strong); background: var(--accent-soft); }
.case-score { margin-left: 0.4rem; font-weight: 700; color: var(--accent-strong); font-variant-numeric: tabular-nums; }
table.list tr.me td { background: var(--accent-soft); }

/* ---------- 버튼과 입력 ---------- */
button, .button { font: inherit; font-weight: 650; font-size: 0.95rem; border-radius: 10px; padding: 0.58rem 1.1rem; cursor: pointer; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; transition: transform 0.06s ease, background 0.15s ease, border-color 0.15s ease; }
button:hover, .button:hover { border-color: var(--ink-2); text-decoration: none; }
button:active, .button:active { transform: translateY(1px); }
.button.primary, button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.button.primary:hover, button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.button.ghost, button.ghost { background: transparent; }
.button.danger, button.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.button.danger:hover, button.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.button.sm, button.sm { font-size: 0.84rem; padding: 0.35rem 0.75rem; border-radius: 8px; }
.block { width: 100%; }
button.link { border: 0; background: none; padding: 0; color: var(--ink-2); font-weight: 550; font-size: 0.92rem; }
button.link:hover { color: var(--accent-strong); }
.icon-btn { width: 2.1rem; height: 2.1rem; padding: 0; border-radius: 8px; font-size: 1.2rem; line-height: 1; color: var(--muted); background: transparent; }
button:disabled { opacity: 0.55; cursor: progress; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

form.stack { display: flex; flex-direction: column; gap: 1rem; }
form.stack label, .field { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 650; font-size: 0.92rem; }
.field > button { align-self: flex-start; }
input, textarea, select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 0.6rem 0.75rem; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
textarea { font-family: var(--mono); font-size: 0.87rem; line-height: 1.55; resize: vertical; width: 100%; background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
fieldset.mode-fields { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1rem; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.25rem; background: var(--surface-2); border-radius: 12px; align-self: flex-start; }
.seg { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 0.4rem 0.9rem; border-radius: 9px; font-weight: 650; font-size: 0.9rem; color: var(--ink-2); }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.seg-sub { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.pick-row { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.pick-label { font-size: 0.85rem; font-weight: 650; color: var(--ink-2); min-width: 2.2rem; }
.model-tiers { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; }
table.list .model-tiers { flex-direction: column; align-items: flex-start; }
.model-tier-row { display: flex; align-items: center; gap: 0.4rem; margin: 0.15rem 0; }
table.list th a.sort { color: inherit; }
table.list th:not([aria-sort]) a.sort { text-decoration: underline dotted; text-underline-offset: 3px; }
table.list th a.sort:hover { color: var(--ink); }
table.list th[aria-sort] { color: var(--ink); }
table.list th[aria-sort] a.sort::after { content: " ↓"; }
.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; padding-top: 0.3rem; }
.actions .hint { margin-left: auto; }
form.row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
form.stack-sm { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-start; }
.limits-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem 1.2rem; margin-bottom: 0.8rem; }
label.limit { display: flex; flex-direction: column; gap: 0.3rem; }
.limit-name { font-weight: 700; font-size: 0.9rem; }
ul.legend { margin: 0.4rem 0 0.8rem; padding-left: 1.1rem; color: var(--ink-2); font-size: 0.88rem; }
ul.legend li { margin: 0.2rem 0; }
label.check, label.small { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; font-weight: 550; }
label.small input { width: 3.6rem; padding: 0.3rem 0.45rem; }
label.small select, form.row select { padding: 0.3rem 0.45rem; font-size: 0.85rem; }

/* ---------- 첫 화면 ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; padding: 1.5rem 0 1rem; }
.hero h1 { font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1.15; margin: 0 0 0.8rem; }
.hero .hl { color: var(--accent); }
.hero-copy p { color: var(--ink-2); font-size: 1.05rem; max-width: 34rem; }
.hero-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 1.3rem 0 1.5rem; }
.stats { display: flex; gap: 2rem; margin: 0; }
.stats div { display: flex; flex-direction: column; }
.stats dt { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.stats dd { margin: 0; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.terminal { order: 2; background: var(--term-bg); color: var(--term-ink); border-radius: 16px; padding: 0 1.4rem 1.6rem; box-shadow: 0 24px 50px -24px rgba(30, 20, 10, 0.55); transform: rotate(-1.2deg); }
.term-bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.9rem 0 1.1rem; }
.term-bar span { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #ff6159; }
.term-bar span:nth-child(2) { background: #ffbd2e; }
.term-bar span:nth-child(3) { background: #28c941; }
.term-bar em { margin-left: auto; font-style: normal; font-family: var(--mono); font-size: 0.75rem; color: var(--term-dim); }
.term-line { font-family: var(--mono); font-size: clamp(1rem, 1.7vw, 1.22rem); line-height: 1.7; margin: 0; }
.term-line .caret { color: var(--term-accent); }
.word { color: var(--term-accent); background: rgba(255, 174, 133, 0.12); border-radius: 4px; padding: 0 0.25rem; transition: opacity 0.25s ease; white-space: nowrap; }
.word.swap { opacity: 0; }
.cursor { display: inline-block; width: 0.6em; height: 1.1em; background: var(--term-accent); vertical-align: text-bottom; margin-left: 0.15rem; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- 문제 화면 ---------- */
.problem-head .title-row { display: flex; align-items: center; gap: 0.6rem; }
.facts { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0 0.4rem; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0.55rem 0.9rem; min-width: 8.5rem; }
.facts div.wide { flex: 1 1 18rem; }
.facts dt { font-size: 0.74rem; color: var(--muted); font-weight: 600; }
.facts dd { margin: 0.1rem 0 0; font-weight: 700; font-size: 0.95rem; }
.statement { font-size: 0.98rem; line-height: 1.8; }
.statement p { margin: 0 0 0.7rem; }
.statement ul, .statement ol { margin: 0 0 0.7rem; padding-left: 1.3rem; }
.statement li { margin: 0.15rem 0; }
.source { margin: 0.9rem 0 0; padding-top: 0.7rem; border-top: 1px solid var(--line); }
.stmt-desc { margin-bottom: 0.4rem; }
.stmt-sec { margin: 1.1rem 0 0; padding: 0.2rem 0 0.1rem 1rem; border-left: 3px solid var(--accent); }
.stmt-sec h3 { margin: 0 0 0.45rem; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.04em; color: var(--accent-strong); }
.stmt-sec.sample { border-left-color: var(--line-strong); }
.stmt-sec.sample h3 { color: var(--ink-2); }
.stmt-sec.sample pre { margin: 0; background: var(--surface-2); font-size: 0.88rem; }
.stmt-sec p:last-child, .stmt-sec ul:last-child, .stmt-sec ol:last-child { margin-bottom: 0.2rem; }
.example { border-top: 1px dashed var(--line); padding-top: 0.2rem; }
.example:first-of-type { border-top: 0; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 1rem; }
.ex-col.wide { grid-column: 1 / -1; }

/* ---------- 결과 화면 ---------- */
.verdict-card { border-radius: var(--radius); padding: 1.3rem 1.4rem; margin: 1rem 0; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); border-left: 6px solid var(--line-strong); }
.verdict-card.v-AC { border-left-color: var(--ok); background: linear-gradient(90deg, var(--ok-soft), var(--surface) 55%); }
.verdict-card.v-PS { border-left-color: var(--accent); background: linear-gradient(90deg, var(--accent-soft), var(--surface) 55%); }
.verdict-card.v-WA { border-left-color: var(--bad); background: linear-gradient(90deg, var(--bad-soft), var(--surface) 55%); }
.verdict-card.v-FE { border-left-color: var(--warn); background: linear-gradient(90deg, var(--warn-soft), var(--surface) 55%); }
.verdict-card.v-OLE { border-left-color: var(--over); background: linear-gradient(90deg, var(--over-soft), var(--surface) 55%); }
.verdict-card.pending { border-left-color: var(--accent); }
.verdict-main { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.verdict-main .badge { font-size: 1.15rem; padding: 0.35rem 1rem; }
.score { font-size: 1.05rem; flex: 1; min-width: 14rem; }
.score strong { font-size: 1.5rem; }
.error-text { color: var(--bad); white-space: pre-wrap; }
.case-dots { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.8rem; }
.case-dot { display: inline-grid; place-items: center; min-width: 2rem; height: 2rem; padding: 0 0.3rem; border-radius: 8px; font-weight: 700; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.case-dot:hover { text-decoration: none; filter: brightness(0.95); }
.case-dot.v-AC { color: var(--ok); background: var(--ok-soft); }
.case-dot.v-WA { color: var(--bad); background: var(--bad-soft); }
.case-dot.v-PS { color: var(--accent-strong); background: var(--accent-soft); }
.case-dot.v-FE { color: var(--warn); background: var(--warn-soft); }
.case-dot.v-OLE { color: var(--over); background: var(--over-soft); }
.case-dot.v-RE, .case-dot.v-SE { color: var(--gray); background: var(--gray-soft); }
details.case { border: 1px solid var(--line); border-radius: 12px; padding: 0 1rem; margin: 0.6rem 0; background: color-mix(in srgb, var(--surface-2) 30%, var(--surface)); }
details.case summary { cursor: pointer; display: flex; align-items: center; gap: 0.7rem; padding: 0.75rem 0; font-weight: 700; list-style: none; }
details.case summary::-webkit-details-marker { display: none; }
details.case summary::before { content: "▸"; color: var(--muted); transition: transform 0.15s ease; }
details.case[open] summary::before { transform: rotate(90deg); }
.reason { color: var(--bad); margin: 0 0 0.4rem; font-weight: 550; }
pre.output { max-height: 36rem; }

/* ---------- 랭킹 ---------- */
.podiums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0; }
.podiums:empty { display: none; }
.podium { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.35rem; align-items: flex-start; box-shadow: var(--shadow); }
.podium .place { font-size: 0.8rem; font-weight: 800; width: 1.9rem; height: 1.9rem; display: grid; place-items: center; border-radius: 50%; color: #fff; }
.podium.p1 .place { background: linear-gradient(135deg, #f6c94b, #c99511); }
.podium.p2 .place { background: linear-gradient(135deg, #c9ced6, #8d96a3); }
.podium.p3 .place { background: linear-gradient(135deg, #e3a06d, #a5622e); }
.podium strong { font-size: 1.1rem; }
.podium .pts { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.explain ul { margin: 0 0 0.8rem; padding-left: 1.2rem; color: var(--ink-2); }
.explain li { margin: 0.25rem 0; }
.tier-legend { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 1.5rem; }
  .terminal { order: 0; transform: none; }
  .podiums { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  main { padding: 1.2rem 1rem 2rem; }
  .top-inner { padding: 0.6rem 1rem; gap: 0.8rem; flex-wrap: wrap; }
  .main-nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .card { padding: 1rem; }
  table.list th, table.list td { padding: 0.6rem 0.65rem; }
  table.problems th:nth-child(1), table.problems td:nth-child(1), table.problems th:nth-child(5), table.problems td:nth-child(5) { display: none; }
  .actions .hint { margin-left: 0; flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .terminal { transform: none; }
}
