/* Layout: phone-first shell carried over from the app (sticky top bar, bottom nav on phones, dark "studio" stage); on wide screens a top nav, a 720px reading column and a sticky sidebar. */
:root {
  --paper: #F2F3F7;
  --card: #FFFFFF;
  --card-2: #F7F8FB;
  --ink: #151722;
  --ink-2: #474B5E;
  --muted: #7A7F92;
  --line: #E0E2EA;
  --line-2: #CBCFDB;
  --slip: #D42E58;
  --slip-ink: #FFFFFF;
  --slip-soft: #FBE4EB;
  --teal: #0F8C86;
  --teal-soft: #DDF3F1;
  --good: #16895E;
  --good-soft: #DDF3E9;
  --warn: #A96F00;
  --warn-soft: #FBF0D8;
  --studio: #0D1328;
  --studio-2: #18234A;
  --studio-ink: #E9ECF8;
  --studio-muted: #8E97B8;
  --shadow: 0 1px 2px rgba(20, 24, 40, .06), 0 6px 18px rgba(20, 24, 40, .06);
  --b1: #FBC400; --b1-hi: #FFE27A; --b1-lo: #C99A00;
  --b2: #69C8F2; --b2-hi: #B8E7FB; --b2-lo: #3C9CC8;
  --b3: #FF7272; --b3-hi: #FFB3B3; --b3-lo: #D24848;
  --b4: #AAAAAA; --b4-hi: #D8D8D8; --b4-lo: #818181;
  --b5: #B0D840; --b5-hi: #D8F08C; --b5-lo: #86AC1E;
  --font-display: "Black Han Sans", "IBM Plex Sans KR", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-body: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, "Noto Sans Mono CJK KR", monospace;
  --r-lg: 22px; --r-md: 14px; --r-sm: 10px;
  --nav-h: 64px;
  --ad-h: 0px;
  --top-inset: env(safe-area-inset-top, 0px);
  --bottom-inset: env(safe-area-inset-bottom, 0px);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0A0E1A; --card: #131a2b; --card-2: #182033; --ink: #EDEFF7; --ink-2: #B7BCCD; --muted: #8990A5;
    --line: #232B41; --line-2: #333C58; --slip: #FF5C80; --slip-ink: #1A0710; --slip-soft: #3B1624;
    --teal: #3CC7BE; --teal-soft: #0F2F2E; --good: #45C98F; --good-soft: #10291F; --warn: #E7B24A; --warn-soft: #2E2410;
    --studio: #060A16; --studio-2: #111A38; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0A0E1A; --card: #131a2b; --card-2: #182033; --ink: #EDEFF7; --ink-2: #B7BCCD; --muted: #8990A5;
  --line: #232B41; --line-2: #333C58; --slip: #FF5C80; --slip-ink: #1A0710; --slip-soft: #3B1624;
  --teal: #3CC7BE; --teal-soft: #0F2F2E; --good: #45C98F; --good-soft: #10291F; --warn: #E7B24A; --warn-soft: #2E2410;
  --studio: #060A16; --studio-2: #111A38; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { background: var(--paper); color: var(--ink); }
body {
  margin: 0; word-break: keep-all; overflow-wrap: break-word; font-family: var(--font-body); font-size: 15px; line-height: 1.55; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--slip); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3 { margin: 0; font-weight: 400; text-wrap: balance; }
p { margin: 0; }
.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.tab-num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  padding: calc(var(--top-inset) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
html.artifact .topbar { top: env(safe-area-inset-top, 0px); padding-top: 10px; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-in { max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-family: var(--font-display); font-size: 21px; line-height: 1; letter-spacing: -0.02em; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.draw-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.draw-chip b { color: var(--slip); font-weight: 700; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink-2);
  transition: background .15s, transform .25s var(--spring);
}
.icon-btn:hover { background: var(--card); }
.icon-btn:active { transform: scale(.9); }
.icon-btn svg, .nav-btn svg, .btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }


.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 6px 8px calc(6px + var(--bottom-inset));
  background: color-mix(in srgb, var(--card) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line);
}
.nav-in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.nav-btn {
  border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px;
  height: 52px; justify-content: center; border-radius: 16px; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: 0;
  transition: color .2s, background .2s;
}
.nav-btn .pill { width: 52px; height: 30px; border-radius: 999px; display: grid; place-items: center; transition: background .25s, transform .35s var(--spring); }
.nav-btn[aria-selected="true"] { color: var(--ink); }
.nav-btn[aria-selected="true"] .pill { background: var(--slip-soft); color: var(--slip); transform: scale(1.04); }
.nav-btn:active .pill { transform: scale(.9); }

/* ---------- type ---------- */
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.eyebrow.slip { color: var(--slip); }
.h-display { font-family: var(--font-display); font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; }
.h-section { font-family: var(--font-display); font-size: 25px; line-height: 1.2; letter-spacing: -0.02em; }
.h-card { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.lede { color: var(--ink-2); font-size: 15px; }
.small { font-size: 13px; color: var(--muted); }
.tiny { font-size: 12px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.section { padding-top: 30px; display: flex; flex-direction: column; gap: 14px; }
.section + .section { border-top: 1px solid var(--line); margin-top: 30px; }
.section-head { display: flex; flex-direction: column; gap: 6px; }

.promise {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 0 14px; font-size: 13px; color: var(--ink-2); line-height: 1.5;
}
.promise b { color: var(--ink); font-weight: 700; }
.promise .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--slip); margin-top: 6px; flex: none; box-shadow: 0 0 0 4px var(--slip-soft); }

/* ---------- surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card.flat { box-shadow: none; }
.card.tight { padding: 14px; }
.well { background: var(--card-2); border-radius: var(--r-md); padding: 14px; min-width: 0; }
.note {
  font-size: 13px; color: var(--ink-2); background: var(--card-2); border-radius: var(--r-md); padding: 12px 14px; line-height: 1.55;
}
.note b { color: var(--ink); }
.note.slip { background: var(--slip-soft); }
.note.teal { background: var(--teal-soft); }
details.method { border-top: 1px dashed var(--line-2); padding-top: 10px; }
details.method summary { font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
details.method summary::-webkit-details-marker { display: none; }
details.method summary::before { content: "+"; font-family: var(--font-mono); width: 16px; height: 16px; border: 1px solid var(--line-2); border-radius: 5px; display: grid; place-items: center; font-size: 12px; line-height: 1; }
details.method[open] summary::before { content: "−"; }
details.method .method-body { font-size: 13px; color: var(--ink-2); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 16px;
  border: 1px solid var(--line-2); background: var(--card); font-weight: 700; font-size: 15px; letter-spacing: -0.01em; color: var(--ink);
  transition: transform .3s var(--spring), background .2s, box-shadow .2s, opacity .2s; user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(.96); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--slip); color: var(--slip-ink); border-color: transparent; box-shadow: 0 6px 16px color-mix(in srgb, var(--slip) 30%, transparent); }
.btn.ink { background: var(--ink); color: var(--paper); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.sm { min-height: 38px; padding: 0 13px; font-size: 13.5px; border-radius: 12px; }
.btn.xl { min-height: 58px; font-size: 17px; border-radius: 18px; }
.btn.block { width: 100%; }
.btn-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }

.seg { display: flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 3px; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 1 0 auto; border: 0; background: transparent; min-height: 36px; padding: 0 12px; border-radius: 11px; font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap;
  transition: background .2s, color .2s, box-shadow .2s;
}
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--card-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.chip.slip { background: var(--slip-soft); color: var(--slip); border-color: transparent; }
.chip.teal { background: var(--teal-soft); color: var(--teal); border-color: transparent; }
.chip.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.solid { background: var(--ink); color: var(--paper); border-color: transparent; }
button.chip { cursor: pointer; }
.toggle-chip { height: 36px; padding: 0 12px; font-size: 13px; }
.toggle-chip[aria-pressed="true"] { background: var(--slip-soft); color: var(--slip); border-color: color-mix(in srgb, var(--slip) 45%, transparent); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.switch input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; transition: background .2s; cursor: pointer; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .3s var(--spring); }
.switch input:checked { background: var(--slip); }
.switch input:checked::after { transform: translateX(18px); }
.switch .label { font-size: 14.5px; font-weight: 600; }
.switch .label small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }

/* ---------- balls ---------- */
.ball {
  --s: 36px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  font-family: var(--font-body); font-weight: 700; font-size: calc(var(--s) * .42); color: #fff; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; text-shadow: 0 1px 1.5px rgba(0, 0, 0, .38), 0 0 1px rgba(0, 0, 0, .25);
  background: radial-gradient(circle at 34% 28%, var(--hi) 0%, var(--c) 42%, var(--lo) 100%);
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, .14), 0 1px 2px rgba(0, 0, 0, .12);
  position: relative;
}
.ball::after { content: ""; position: absolute; top: 12%; left: 22%; width: 30%; height: 20%; border-radius: 50%; background: rgba(255, 255, 255, .55); filter: blur(1px); transform: rotate(-24deg); }
.ball.g1 { --c: var(--b1); --hi: var(--b1-hi); --lo: var(--b1-lo); }
.ball.g2 { --c: var(--b2); --hi: var(--b2-hi); --lo: var(--b2-lo); }
.ball.g3 { --c: var(--b3); --hi: var(--b3-hi); --lo: var(--b3-lo); }
.ball.g4 { --c: var(--b4); --hi: var(--b4-hi); --lo: var(--b4-lo); }
.ball.g5 { --c: var(--b5); --hi: var(--b5-hi); --lo: var(--b5-lo); }
.ball.sm { --s: 28px; }
.ball.xs { --s: 22px; font-size: 10px; }
.ball.lg { --s: 44px; }
.ball.dim { filter: saturate(.15); opacity: .38; box-shadow: none; }
.ball.hit { transform: scale(1.04); }
.ball.hit-b { box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--warn); }
.nowrap { white-space: nowrap; }
.balls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.balls .plus { color: var(--muted); font-weight: 700; font-size: 16px; margin: 0 1px; }
.balls.fit { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) auto minmax(0, 1fr); gap: 6px; align-items: center; max-width: 380px; }
.balls.fit .ball { width: 100%; height: auto; aspect-ratio: 1; max-width: 48px; font-size: clamp(12px, 4.3vw, 19px); justify-self: center; }
.ball.pop { animation: pop .55s var(--spring) both; }
@keyframes pop { 0% { transform: scale(.2) translateY(-14px); opacity: 0; } 60% { transform: scale(1.14); opacity: 1; } 100% { transform: scale(1); } }

/* ---------- draw stage ---------- */
.stage {
  position: relative; border-radius: 28px; overflow: hidden; color: var(--studio-ink);
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(98, 126, 255, .26), transparent 60%),
    radial-gradient(80% 60% at 50% 100%, rgba(212, 46, 88, .16), transparent 70%),
    linear-gradient(180deg, var(--studio-2), var(--studio));
  box-shadow: 0 18px 40px rgba(10, 16, 40, .28), inset 0 0 0 1px rgba(142, 151, 184, .14);
  isolation: isolate;
}
.stage::before { /* studio floor grid */
  content: ""; position: absolute; inset: auto 0 0 0; height: 38%; z-index: -1; opacity: .35;
  background-image: linear-gradient(rgba(142, 151, 184, .18) 1px, transparent 1px), linear-gradient(90deg, rgba(142, 151, 184, .18) 1px, transparent 1px);
  background-size: 22px 22px; mask-image: linear-gradient(transparent, #000); -webkit-mask-image: linear-gradient(transparent, #000);
}
.stage-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 0; gap: 8px; }
.stage-label { font-size: 12px; letter-spacing: .08em; font-weight: 700; color: var(--studio-muted); display: flex; align-items: center; gap: 8px; }
.stage-label .led { width: 7px; height: 7px; border-radius: 50%; background: #5B6488; transition: background .3s, box-shadow .3s; }
.stage.running .stage-label .led { background: #4DF2B0; box-shadow: 0 0 10px #4DF2B0; }
.stage-tools { display: flex; gap: 4px; }
.stage-tools button { width: 36px; height: 36px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .06); color: var(--studio-ink); display: grid; place-items: center; }
.stage-tools button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stage-tools .speed { width: auto; padding: 0 10px; font-size: 12px; font-weight: 700; }
.machine-wrap { position: relative; }
.machine-wrap canvas { display: block; width: 100%; height: auto; touch-action: manipulation; }
.tray { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 12px 18px; min-height: 64px; }
.slot { width: 40px; height: 40px; border-radius: 50%; border: 1.5px dashed rgba(233, 236, 248, .25); display: grid; place-items: center; flex: none; }
.slot .ball { --s: 40px; }
.tray .plus { color: var(--studio-muted); font-weight: 700; }
.tray .slot.bonus { border-color: rgba(231, 178, 74, .45); }
.stage-caption { text-align: center; font-size: 12.5px; color: var(--studio-muted); padding: 0 16px 16px; margin-top: -6px; min-height: 18px; }

/* ---------- ticket (receipt) ---------- */
.ticket {
  --notch: 8px; position: relative; background: var(--card); border-radius: 6px; padding: 18px 16px 16px; min-width: 0;
  font-family: var(--font-mono); font-size: 13px; box-shadow: var(--shadow);
  -webkit-mask: radial-gradient(var(--notch) at var(--notch) 0, #0000 98%, #000) calc(var(--notch) * -1) 0 / calc(var(--notch) * 2.6) 51% repeat-x,
    radial-gradient(var(--notch) at var(--notch) 100%, #0000 98%, #000) calc(var(--notch) * -1) 100% / calc(var(--notch) * 2.6) 51% repeat-x;
  mask: radial-gradient(var(--notch) at var(--notch) 0, #0000 98%, #000) calc(var(--notch) * -1) 0 / calc(var(--notch) * 2.6) 51% repeat-x,
    radial-gradient(var(--notch) at var(--notch) 100%, #0000 98%, #000) calc(var(--notch) * -1) 100% / calc(var(--notch) * 2.6) 51% repeat-x;
}
.ticket-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-bottom: 10px; border-bottom: 1px dashed var(--line-2); margin-bottom: 6px; font-size: 12px; color: var(--muted); }
.ticket-head b { color: var(--ink); font-size: 14px; font-family: var(--font-body); font-weight: 700; letter-spacing: -0.01em; }
.tline { display: grid; grid-template-columns: 22px 34px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px dotted var(--line); }
.tline:last-child { border-bottom: 0; }
.tline .lbl { font-weight: 700; color: var(--ink); }
.tline .kind { font-size: 11px; color: var(--muted); font-family: var(--font-body); }
.tline .balls { gap: 4px; flex-wrap: nowrap; }
.tline .end { display: flex; gap: 4px; align-items: center; }
button.tline { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px dotted var(--line); font: inherit; color: inherit; padding: 8px 0; }
.ticket-foot { display: flex; justify-content: space-between; gap: 8px; padding-top: 10px; margin-top: 4px; border-top: 1px dashed var(--line-2); font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }

/* ---------- result board ---------- */
.result-card { display: flex; flex-direction: column; gap: 14px; }
.prize-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.prize-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.prize-table td { padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.prize-table td:last-child, .prize-table th:last-child { text-align: right; }
.prize-table tr:last-child td { border-bottom: 0; }
.rank-badge { display: inline-grid; place-items: center; width: 34px; height: 22px; border-radius: 7px; font-size: 12px; font-weight: 700; background: var(--card-2); color: var(--ink-2); }
.rank-badge.r1 { background: var(--slip); color: var(--slip-ink); }
.rank-badge.r2 { background: var(--slip-soft); color: var(--slip); }
.rank-badge.r3 { background: var(--warn-soft); color: var(--warn); }
.rank-badge.r4, .rank-badge.r5 { background: var(--good-soft); color: var(--good); }
.countdown { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600; }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--card-2); border-radius: var(--r-md); padding: 12px; min-width: 0; }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.25; margin-top: 2px; overflow-wrap: anywhere; }
.stat .s { font-size: 12px; color: var(--ink-2); margin-top: 2px; }

.big-figure { font-family: var(--font-display); font-size: 44px; line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.big-figure small { font-size: 22px; margin-left: 2px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile {
  text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 6px; min-height: 118px;
  transition: transform .3s var(--spring), border-color .2s; min-width: 0;
}
.tile:active { transform: scale(.97); }
.tile .eyebrow { font-size: 11px; }
.tile strong { font-size: 15.5px; line-height: 1.35; letter-spacing: -0.02em; }
.tile span.go { margin-top: auto; font-size: 12.5px; color: var(--slip); font-weight: 700; }

/* ---------- slip grid (OMR style) ---------- */
.omr { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.omr .cell {
  position: relative; aspect-ratio: 1 / 1.08; max-width: 100%; border: 0; background: transparent; padding: 0; border-radius: 6px;
  display: grid; place-items: center; font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--slip);
  transition: transform .25s var(--spring);
}
.omr .cell::before { /* the printed bracket box */
  content: ""; position: absolute; inset: 2px 3px; border: 1.5px solid color-mix(in srgb, var(--slip) 55%, transparent); border-radius: 4px;
}
.omr .cell:active { transform: scale(.9); }
.omr .cell.fix { color: #fff; }
.omr .cell.fix::after { content: ""; position: absolute; inset: 5px 7px; background: var(--ink); border-radius: 3px; z-index: -0; }
.omr .cell.fix span { position: relative; z-index: 1; color: var(--paper); }
.omr .cell.out { color: var(--muted); }
.omr .cell.out::before { border-style: dashed; border-color: var(--line-2); }
.omr .cell.out span { text-decoration: line-through; text-decoration-thickness: 2px; }
.omr .cell.pick::after { content: ""; position: absolute; inset: 5px 7px; background: var(--ink); border-radius: 3px; }
.omr .cell.pick span { position: relative; z-index: 1; color: var(--paper); }
.omr.heat .cell { color: var(--ink); font-size: 13px; cursor: default; flex-direction: column; }
.omr.heat .cell::before { inset: 1px; border: 0; background: var(--heat); border-radius: 8px; }
.omr.heat .cell span { position: relative; z-index: 1; line-height: 1.05; display: flex; flex-direction: column; align-items: center; }
.omr.heat .cell em { font-style: normal; font-size: 9.5px; font-weight: 500; opacity: .85; }
.legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.legend .bar { flex: 1; height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--teal), var(--card-2), var(--slip)); }

/* ---------- charts ---------- */
.chart { width: 100%; min-width: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font-mono); font-size: 10px; fill: var(--muted); }
.chart .axis { stroke: var(--line-2); stroke-width: 1; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .exp { stroke: var(--ink); stroke-width: 1.3; stroke-dasharray: 4 3; fill: none; }
.chart .band { fill: var(--ink); opacity: .06; }
.chart .theory { stroke: var(--slip); stroke-width: 2; fill: none; }
.chart .theory-dot { fill: var(--slip); }
.chart .bar-obs { fill: var(--line-2); }
.chart .bar-obs.acc { fill: var(--ink); }
.chart .lbl-strong { fill: var(--ink); font-weight: 600; }
.chart-tip { font-size: 13px; color: var(--ink-2); min-height: 20px; }
.chart-scroll { overflow-x: auto; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.input, textarea.input, select.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--card); font-size: 15px; outline: none;
}
.input:focus { border-color: var(--slip); box-shadow: 0 0 0 3px var(--slip-soft); }
textarea.input { min-height: 90px; resize: vertical; font-family: var(--font-mono); font-size: 13px; }
.range-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; background: var(--card); }
.stepper button { width: 40px; height: 44px; border: 0; background: transparent; font-size: 18px; font-weight: 600; color: var(--ink-2); }
.stepper input { width: 100%; min-width: 0; border: 0; text-align: center; font-family: var(--font-mono); font-size: 15px; font-weight: 600; background: transparent; outline: none; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- sheets / toasts ---------- */
.scrim { position: fixed; inset: 0; background: rgba(8, 10, 20, .45); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; max-height: 88vh; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border-radius: 26px 26px 0 0; padding: 10px 18px calc(22px + var(--bottom-inset));
  transform: translateY(105%); visibility: hidden; box-shadow: 0 -10px 40px rgba(0, 0, 0, .2);
  transition: transform .42s cubic-bezier(.2, .9, .25, 1), visibility 0s linear .42s;
}
.sheet.on { transform: none; visibility: visible; transition: transform .42s cubic-bezier(.2, .9, .25, 1), visibility 0s; }
.sheet-in { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.sheet .grab { width: 42px; height: 5px; border-radius: 9px; background: var(--line-2); margin: 0 auto 4px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--bottom-inset) + var(--ad-h) + 14px); z-index: 80; display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
.toast {
  background: var(--ink); color: var(--paper); padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  transform: translateY(20px); opacity: 0; transition: transform .35s var(--spring), opacity .25s; max-width: 520px;
}
.toast.on { transform: none; opacity: 1; }

.empty { text-align: center; padding: 34px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ink-2); }
.empty .art { width: 96px; height: 96px; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.list-item .t { font-weight: 600; font-size: 14.5px; }
.list-item .d { font-size: 12.5px; color: var(--muted); }
.progress { height: 6px; border-radius: 99px; background: var(--card-2); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--slip); border-radius: 99px; transition: width .2s; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.hr { height: 1px; background: var(--line); border: 0; margin: 4px 0; }
.banner-data { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.help-line { font-family: var(--font-mono); font-size: 18px; font-weight: 600; }

@media (min-width: 520px) {
  .h-display { font-size: 34px; }
  .stat-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 370px) {
  .brand-name { font-size: 18px; }
  .ball { --s: 32px; }
  .slot, .slot .ball { width: 34px; height: 34px; --s: 34px; }
  .tline { grid-template-columns: 18px 30px minmax(0, 1fr) auto; }
  .tline .ball.sm { --s: 24px; font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =====================================================================
   website layer
   ===================================================================== */
[hidden] { display: none !important; }
figure { margin: 0; }
a { color: inherit; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 10px; text-decoration: none; font-weight: 700; }
.skip:focus { top: 12px; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 30;
  padding: calc(var(--top-inset) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header-in { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.brand { text-decoration: none; color: var(--ink); }
.site-header .spacer { flex: 1; }
.top-nav { display: none; gap: 2px; margin-left: 18px; }
.top-nav a { text-decoration: none; font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 8px 11px; border-radius: 10px; white-space: nowrap; transition: background .15s, color .15s; }
.top-nav a:hover { background: var(--card); color: var(--ink); }
.top-nav a[aria-current="page"] { color: var(--slip); background: var(--slip-soft); }
.draw-chip { text-decoration: none; color: var(--ink); }
.menu-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.menu-links a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--card-2); text-decoration: none; min-width: 0; }
.menu-links a b { font-size: 14.5px; }
.menu-links a span { font-size: 12px; color: var(--muted); }

/* bottom nav (phones) */
.nav-btn { text-decoration: none; }
.nav-btn[aria-current="page"] { color: var(--ink); }
.nav-btn[aria-current="page"] .pill { background: var(--slip-soft); color: var(--slip); transform: scale(1.04); }

/* page layout */
.layout { max-width: 1120px; margin: 0 auto; padding: 4px 16px calc(var(--nav-h) + var(--bottom-inset) + 28px); display: block; }
.main-col { min-width: 0; max-width: 720px; margin: 0 auto; }
.aside-col { display: none; }
.page-head { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.page-head .lede { max-width: 62ch; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12.5px; color: var(--muted); padding: 6px 0 2px; list-style: none; margin: 0; }
.breadcrumb li { display: flex; align-items: center; gap: 4px; }
.breadcrumb li + li::before { content: "›"; color: var(--line-2); }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); text-decoration: underline; }
.meta-line { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.draw-controls { margin-top: 14px; }
.machine-wrap { display: flex; justify-content: center; }
.busy { opacity: .5; transition: opacity .2s; }
.sub { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.rule { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.prize-table.full td:first-child { width: 42%; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 9px 6px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td.r, .data-table th.r { text-align: right; }
.data-table a { text-decoration: none; font-weight: 600; }
.data-table a:hover { text-decoration: underline; }
.link-more { font-size: 13.5px; font-weight: 700; color: var(--slip); text-decoration: none; }
.link-more:hover { text-decoration: underline; }
.tile { text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--line-2); }

/* draw rows (archives) */
.draw-list { display: flex; flex-direction: column; }
.draw-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.draw-row:last-child { border-bottom: 0; }
.draw-row:hover .dn { color: var(--slip); }
.draw-row .dn { font-weight: 700; font-size: 14.5px; }
.draw-row .dd { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.draw-row .balls { gap: 4px; flex-wrap: nowrap; }
.draw-row .dw { text-align: right; font-size: 12px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.draw-row .dw b { display: block; font-size: 13px; color: var(--ink); }
.year-links { display: flex; flex-wrap: wrap; gap: 6px; }
.year-links a { text-decoration: none; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); text-decoration: none; min-width: 0; }
.pager a.next { text-align: right; }
.pager a span { font-size: 12px; color: var(--muted); }
.pager a b { font-size: 14.5px; }
.pager .empty-cell { visibility: hidden; }
.jump { display: flex; gap: 8px; }
.jump .input { max-width: 160px; }

/* facts list on draw pages */
.facts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.facts li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.facts li:last-child { border-bottom: 0; }
.facts .fk { color: var(--muted); font-weight: 600; font-size: 13px; }
.facts .fv b { font-weight: 700; }
.lead-box { font-size: 15.5px; line-height: 1.75; color: var(--ink-2); }
.lead-box b { color: var(--ink); }

/* number page */
.num-hero { display: flex; align-items: center; gap: 16px; }
.num-hero .ball { --s: 72px; font-size: 30px; }
.co-list { display: flex; flex-wrap: wrap; gap: 10px; }
.co-list a { display: flex; align-items: center; gap: 6px; text-decoration: none; font-size: 13px; color: var(--ink-2); }

/* articles */
.prose { font-size: 16px; line-height: 1.85; color: var(--ink); max-width: 68ch; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-family: var(--font-display); font-size: 23px; line-height: 1.3; margin-top: 2em; letter-spacing: -0.02em; scroll-margin-top: 80px; }
.prose h3 { font-size: 18px; font-weight: 700; margin-top: 1.6em; letter-spacing: -0.02em; }
.prose p, .prose li { color: var(--ink-2); }
.prose strong, .prose b { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose a { color: var(--slip); text-underline-offset: 3px; }
.prose blockquote { margin-left: 0; padding: 12px 16px; border-radius: var(--r-md); background: var(--card-2); color: var(--ink-2); font-size: 15px; }
.prose .table-wrap { margin-top: 1.2em; }
.prose table { font-size: 14px; }
.prose figure { margin: 1.4em 0 0; }
.prose figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.prose .card, .prose .note, .prose .omr, .prose .legend { font-size: 14px; line-height: 1.55; }
.prose .note { font-size: 14px; }
.toc { background: var(--card-2); border-radius: var(--r-md); padding: 14px 16px; font-size: 14px; }
.toc b { display: block; font-size: 12px; color: var(--muted); letter-spacing: .06em; margin-bottom: 6px; }
.toc ol { margin: 0; padding-left: 1.2em; color: var(--ink-2); }
.toc li + li { margin-top: 4px; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.guide-list { display: grid; grid-template-columns: 1fr; gap: 10px; }
.guide-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); text-decoration: none; color: var(--ink); min-width: 0; transition: border-color .2s; }
.guide-card:hover { border-color: var(--line-2); }
.guide-card strong { font-size: 16px; line-height: 1.4; letter-spacing: -0.02em; }
.guide-card span { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.faq { display: flex; flex-direction: column; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 15px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin-top: 8px; color: var(--ink-2); font-size: 14.5px; line-height: 1.7; }

/* ad slots: reserved space so the page does not jump; hidden when Google has nothing to show */
.ad-slot { margin: 22px 0; min-height: 120px; display: flex; flex-direction: column; gap: 4px; }
.ad-slot .ad-label { font-size: 10.5px; letter-spacing: .08em; color: var(--muted); }
.ad-slot ins { display: block; min-height: 100px; }
.ad-slot.sidebar { min-height: 280px; }
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad-slot.preview { border: 1.5px dashed var(--line-2); border-radius: var(--r-md); align-items: center; justify-content: center; color: var(--muted); font-size: 12.5px; background: repeating-linear-gradient(45deg, transparent 0 10px, color-mix(in srgb, var(--line) 40%, transparent) 10px 11px); }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--card-2); padding: 28px 16px calc(var(--nav-h) + var(--bottom-inset) + 24px); }
.site-footer-in { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; font-size: 13px; color: var(--ink-2); }
.footer-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.footer-cols b { display: block; font-size: 12px; color: var(--muted); letter-spacing: .06em; margin-bottom: 8px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.footer-cols a { text-decoration: none; }
.footer-cols a:hover { text-decoration: underline; }
.footer-note { font-size: 12px; color: var(--muted); line-height: 1.7; }

/* aside (wide screens) */
.aside-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.aside-card h2 { font-size: 14px; font-weight: 700; }
.aside-card .balls { gap: 4px; }
.aside-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.aside-card a { text-decoration: none; }
.aside-card a:hover { text-decoration: underline; }
.aside-sticky { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }

@media (min-width: 640px) {
  .guide-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .menu-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .top-nav { display: flex; }
  .nav, #btnMenu { display: none; }
  .layout { padding-bottom: 48px; }
  .site-footer { padding-bottom: 32px; }
  .toast-wrap { bottom: 24px; }
  .h-display { font-size: 38px; }
  .prose { font-size: 16.5px; }
}
@media (min-width: 1140px) {
  .layout { display: grid; grid-template-columns: minmax(0, 720px) 300px; gap: 48px; justify-content: center; }
  .main-col { margin: 0; }
  .aside-col { display: block; padding-top: 18px; }
}
@media (max-width: 370px) {
  .draw-row { grid-template-columns: 74px minmax(0, 1fr); }
  .draw-row .dw { display: none; }
  .facts li { grid-template-columns: 92px minmax(0, 1fr); }
}
.seg a { flex: 1 0 auto; display: grid; place-items: center; min-height: 36px; padding: 0 12px; border-radius: 11px; font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; text-decoration: none; }
.seg a:hover { color: var(--ink); background: var(--card); }
.home-head { padding-top: 6px; gap: 2px; }
.home-head h1 { font-size: 12px; }

/* 긴 사이트 이름이 좁은 화면에서 회차 칩과 겹치지 않도록 */
.brand-name { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 440px) {
  .brand-name { font-size: 18px; }
  .draw-chip { font-size: 13px; padding-inline: 10px; }
}
@media (max-width: 400px) {
  #drawChip { display: none; }
}
@media (max-width: 340px) {
  .brand-name { font-size: 16px; }
}
