/* Layout: one narrow column on graph paper, like a puzzle notebook; each game owns one ink color. */
:root {
  --paper: #F1F4F6; --grid: #E2E8EC; --card: #FFFFFF; --ink: #16212A; --ink-2: #56646F; --line: #D3DCE2; --chip: #EDF1F4;
  --knot: #CF4630; --steps: #13786A; --alibi: #5B43C4; --tally: #A86F00;
  --good: #1D7F47; --bad: #BF3628; --focus: #2B63D6;
  --f-display: 'Plus Jakarta Sans', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --f-body: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --r: 14px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #10161B; --grid: #182028; --card: #182028; --ink: #E8EEF2; --ink-2: #9AA8B3; --line: #2A3540; --chip: #212B35;
  --knot: #FF7A5E; --steps: #3BC4AE; --alibi: #A48FFF; --tally: #F0B43A;
  --good: #4CC384; --bad: #FF7A6B; --focus: #82A9FF; color-scheme: dark;
} }
:root[data-theme="dark"] {
  --paper: #10161B; --grid: #182028; --card: #182028; --ink: #E8EEF2; --ink-2: #9AA8B3; --line: #2A3540; --chip: #212B35;
  --knot: #FF7A5E; --steps: #3BC4AE; --alibi: #A48FFF; --tally: #F0B43A;
  --good: #4CC384; --bad: #FF7A6B; --focus: #82A9FF; color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  background-color: var(--paper); color: var(--ink); font: 16px/1.5 var(--f-body);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px; min-height: 100vh;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.app { max-width: 560px; margin: 0 auto; padding-inline: 16px; padding-block: 16px calc(96px + var(--adpad, 0px)); }
h1, h2, h3 { font-family: var(--f-display); margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
.muted { color: var(--ink-2); }
.eyebrow { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); font-weight: 700; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* top bar */
.top { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 18px; }
.wordmark { font-family: var(--f-display); font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.wordmark svg { width: 34px; height: 34px; flex: none; }
.wordmark span { font-size: 30px; letter-spacing: -0.025em; }
@media (max-width: 440px) { .wordmark span { font-size: 25px; } .wordmark svg { width: 28px; height: 28px; } .toprow .iconbtn { min-width: 40px; height: 40px; padding: 0 9px; } .toprow { gap: 6px; } }
@media (max-width: 360px) { .wordmark span { font-size: 21px; } }
.iconbtn { border: 1px solid var(--line); background: var(--card); border-radius: 999px; min-width: 44px; height: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: 14px; }
.iconbtn svg { width: 20px; height: 20px; }
.toprow { display: flex; gap: 8px; }

.dayline { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.dayline h2 { font-size: 22px; }
.weekly { margin: -4px 0 14px; padding: 10px 14px; border-radius: var(--r); background: var(--ink); color: var(--paper); font-size: 15px; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.weekly b { font-family: var(--f-display); font-size: 16px; color: var(--tally); }
.streaks { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pill svg { width: 16px; height: 16px; }

/* game cards */
.cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .cards { grid-template-columns: 1fr 1fr; } }
.gcard { --c: var(--ink); text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: var(--r); padding: 16px; display: grid; grid-template-columns: 52px 1fr; gap: 4px 14px; align-items: center; position: relative; transition: transform .15s ease, border-color .15s; }
.gcard:hover { transform: translateY(-2px); border-color: var(--c); }
.gcard .gicon { grid-row: span 2; width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, var(--card)); color: var(--c); }
.gcard .gicon svg { width: 30px; height: 30px; }
.gcard h3 { font-size: 21px; display: flex; align-items: center; gap: 8px; }
.gcard .meta { font-size: 14px; color: var(--ink-2); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.gcard .status { grid-column: 1 / -1; margin-top: 10px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 700; border-top: 1px dashed var(--line); padding-top: 10px; }
.gcard .go { color: var(--c); }
.done-badge { display: inline-flex; align-items: center; gap: 4px; color: var(--good); }
.done-badge svg { width: 16px; height: 16px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); display: block; }
.dots i.on { background: var(--ink-2); }

.notice { border: 1px solid var(--line); background: var(--card); border-radius: var(--r); padding: 14px 16px; margin: 14px 0; display: grid; gap: 8px; }
.notice h3 { font-size: 18px; }
.notice .row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { border: 0; border-radius: 999px; padding: 11px 18px; font-weight: 700; background: var(--ink); color: var(--paper); min-height: 44px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.c { background: var(--c); color: var(--card); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; font-weight: 700; color: var(--ink); }
.foot { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

.adbar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; }
.adbox { max-width: 528px; width: 100%; height: 50px; border: 1px dashed var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; font-size: 13px; color: var(--ink-2); gap: 10px; }

/* game screen */
.ghead { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ghead .title { flex: 1; min-width: 0; }
.ghead h1 { font-size: 28px; line-height: 1.1; color: var(--c); }
.ghead .sub { font-size: 13px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.msg { min-height: 24px; font-weight: 700; text-align: center; margin: 10px 0; }
.msg.bad { color: var(--bad); } .msg.good { color: var(--good); }
.hintbtn { color: var(--c); }
.hintbtn[disabled] { opacity: .4; }
.progress { display: flex; gap: 6px; justify-content: center; margin-bottom: 12px; }
.progress span { width: 30px; height: 6px; border-radius: 3px; background: var(--line); }
.progress span.cur { background: var(--c); }
.progress span.ok { background: color-mix(in srgb, var(--c) 55%, var(--card)); }

/* keyboard */
.kb { display: grid; gap: 6px; margin-top: 14px; user-select: none; position: sticky; bottom: 0; background: var(--paper); padding-block: 8px calc(8px + env(safe-area-inset-bottom, 0px)); margin-inline: -16px; padding-inline: 8px; border-top: 1px solid var(--line); z-index: 2; }
.kb .r { display: flex; gap: 5px; justify-content: center; }
.kb button { flex: 1 1 0; max-width: 46px; height: 52px; border-radius: 8px; border: 0; background: var(--chip); font-family: var(--f-mono); font-weight: 700; font-size: 16px; padding: 0; }
.kb button.wide { max-width: 72px; flex: 1.6 1 0; font-family: var(--f-body); font-size: 13px; }
.kb button:active { background: var(--line); }

/* knot */
.cues { display: grid; gap: 8px; text-align: center; margin: 4px 0 14px; }
.cue { font-family: var(--f-display); font-weight: 800; font-size: clamp(24px, 8vw, 34px); letter-spacing: 0.02em; line-height: 1.1; }
.cue.locked { border: 2px dashed color-mix(in srgb, var(--c) 60%, var(--line)); background: color-mix(in srgb, var(--c) 6%, var(--card)); border-radius: 12px; padding: 8px 14px; font-family: var(--f-body); font-size: 16px; font-weight: 700; color: var(--c); letter-spacing: 0; justify-self: center; display: flex; gap: 8px; align-items: center; min-height: 44px; }
.cue.locked span { font-weight: 400; color: var(--ink-2); font-size: 14px; }
.progress span.bonus { width: 18px; border-radius: 999px; }
.bonusknot { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 15%, transparent); }
.knotline { width: 60%; height: 2px; margin: 0 auto; background: repeating-linear-gradient(90deg, var(--c) 0 6px, transparent 6px 12px); opacity: .6; }
.slots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.slot { width: 40px; height: 48px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; font-family: var(--f-mono); font-weight: 700; font-size: 22px; text-transform: uppercase; background: var(--card); }
.slot.filled { border-color: var(--ink-2); }
.slot.given { background: color-mix(in srgb, var(--c) 14%, var(--card)); border-color: var(--c); }
.slot.ok { background: color-mix(in srgb, var(--good) 16%, var(--card)); border-color: var(--good); }
.slot.miss { background: color-mix(in srgb, var(--bad) 12%, var(--card)); border-color: var(--bad); }
.tries { display: flex; justify-content: center; gap: 8px; margin-top: 10px; font-size: 14px; color: var(--ink-2); flex-wrap: wrap; }
.tries s { color: var(--bad); }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.linkcard { margin-top: 12px; padding: 12px; border-radius: 10px; background: color-mix(in srgb, var(--c) 10%, var(--card)); text-align: center; }

/* steps */
.ladder { display: grid; gap: 6px; justify-items: center; }
.rung { display: flex; gap: 4px; }
.rung .t { width: 40px; height: 42px; border-radius: 8px; display: grid; place-items: center; font-family: var(--f-mono); font-weight: 700; font-size: 21px; text-transform: uppercase; border: 2px solid var(--line); background: var(--card); }
.rung.start .t, .rung.end .t { background: color-mix(in srgb, var(--c) 14%, var(--card)); border-color: var(--c); }
.rung .t.ch { border-color: var(--c); color: var(--c); }
.rung.input .t { border-style: dashed; }
.rung.input .t.filled { border-style: solid; border-color: var(--ink-2); }
.between { font-size: 13px; color: var(--ink-2); }
.counter { display: flex; justify-content: center; gap: 14px; font-size: 14px; color: var(--ink-2); margin: 10px 0 0; font-variant-numeric: tabular-nums; }
.counter b { color: var(--ink); }

/* alibi */
.clues { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.clues button { width: 100%; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; }
.clues button .n { font-family: var(--f-mono); font-size: 13px; color: var(--c); font-weight: 700; padding-top: 2px; }
.clues button.struck { color: var(--ink-2); }
.clues button.struck span:last-child { text-decoration: line-through; }
.people { display: grid; gap: 10px; }
.person { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: 12px 14px; }
.person h3 { font-size: 19px; margin-bottom: 6px; }
.facet { display: grid; grid-template-columns: 58px 1fr; gap: 8px; align-items: center; padding: 4px 0; }
.facet .lab { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--chip); border-radius: 999px; padding: 6px 12px; font-size: 14px; min-height: 36px; }
.chip.on { background: var(--c); border-color: var(--c); color: var(--card); font-weight: 700; }
.chip.taken { opacity: .45; }
.chip.no { background: transparent; border-style: dashed; color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--bad); }
.chip.no span { color: var(--bad); font-weight: 700; text-decoration: none; display: inline-block; margin-right: 4px; }
.chip.lock { outline: 2px solid var(--good); outline-offset: 1px; }
.actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

/* tally */
.hand { text-align: center; }
.target { font-family: var(--f-display); font-weight: 800; font-size: 56px; line-height: 1; color: var(--c); font-variant-numeric: tabular-nums; }
.tiles { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 18px 0 14px; min-height: 64px; }
.tile { min-width: 64px; height: 64px; padding: 0 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); font-family: var(--f-mono); font-weight: 700; font-size: 24px; font-variant-numeric: tabular-nums; }
.tile.sel { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--card)); }
.tile.hint { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 45%, transparent); }
.ops { display: flex; gap: 8px; justify-content: center; }
.op { width: 56px; height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--chip); font-size: 24px; font-weight: 700; }
.op.sel { background: var(--ink); color: var(--paper); }
.work { font-family: var(--f-mono); font-size: 14px; color: var(--ink-2); min-height: 22px; margin-top: 10px; }

/* result */
.result { text-align: center; display: grid; gap: 12px; }
.bigscore { font-family: var(--f-display); font-weight: 800; font-size: 54px; line-height: 1; color: var(--c); }
.bigscore.long { font-size: 30px; line-height: 1.15; }
.sharebox { font-family: var(--f-mono); background: var(--chip); border-radius: 10px; padding: 10px; white-space: pre-wrap; font-size: 14px; }
.solve { text-align: left; border-top: 1px dashed var(--line); padding-top: 12px; display: grid; gap: 8px; }
.solve h3 { font-size: 18px; }
.solve ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.tip { border-left: 3px solid var(--c); padding: 6px 10px; background: color-mix(in srgb, var(--c) 8%, var(--card)); border-radius: 0 8px 8px 0; font-size: 15px; }
.mono { font-family: var(--f-mono); }
.result .msg:empty { display: none; }
.result { position: relative; overflow: hidden; }
.verdict { font-family: var(--f-display); font-weight: 800; font-size: 44px; line-height: 1.05; color: var(--c); }
.vline { margin: -4px 0 0; color: var(--ink-2); }
.scoreline { font-size: 17px; }
.statline { margin: 0; font-size: 15px; color: var(--ink-2); }
.answers { display: grid; gap: 8px; text-align: left; }
.result.fresh .answers { animation: rise .45s .15s ease-out both; }
.syms { font-size: 26px; line-height: 1.25; letter-spacing: 2px; }
.sharepeek { text-align: left; font-size: 14px; }
.sharepeek summary { cursor: pointer; color: var(--ink-2); text-align: center; list-style: none; }
.sharepeek summary::-webkit-details-marker { display: none; }
.sharepeek summary::after { content: ' ▾'; }
.sharepeek[open] summary::after { content: ' ▴'; }
.sharepeek .sharebox { margin-top: 8px; font-size: 13px; }
.nextcard { display: grid; gap: 10px; justify-items: center; padding: 14px; border-radius: 14px; background: var(--chip); }
.setdots { display: flex; gap: 8px; }
.setdots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--b); background: transparent; }
.setdots i.on { background: var(--b); }
.result.fresh .setdots i.now { animation: dotpop .55s .35s ease-out both; }
.result.fresh .syms, .result.fresh .scoreline, .result.fresh .vline { animation: rise .45s ease-out both; }
.result.fresh .vline { animation-delay: .12s; } .result.fresh .scoreline { animation-delay: .2s; } .result.fresh .syms { animation-delay: .3s; }
.result.fresh .nextcard { animation: rise .45s .45s ease-out both; }
.nexttext { margin: 0; }
.nextbtn { display: inline-flex; align-items: center; gap: 8px; }
.nextbtn .gicon { width: 22px; height: 22px; display: inline-flex; }
.nextbtn .gicon svg { width: 22px; height: 22px; }
.muted2 { opacity: .8; font-weight: 500; font-size: 14px; }
.fullset { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 28px; background: linear-gradient(90deg, var(--knot), var(--steps), var(--alibi), var(--tally)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.burst { position: absolute; inset: 0; pointer-events: none; }
.burst i { position: absolute; left: 50%; top: 96px; width: 12px; height: 12px; border-radius: 50%; background: var(--b); opacity: 0; }
.result.fresh .burst i { animation: burst 1.1s cubic-bezier(.2,.7,.3,1) both; }
.result.fresh .burst i:nth-child(1) { --x: -120px; --y: -60px; }
.result.fresh .burst i:nth-child(2) { --x: -50px; --y: -86px; animation-delay: .05s; }
.result.fresh .burst i:nth-child(3) { --x: 50px; --y: -86px; animation-delay: .1s; }
.result.fresh .burst i:nth-child(4) { --x: 120px; --y: -60px; animation-delay: .15s; }

.result.fresh .verdict { animation: vpop .5s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes burst { 0% { opacity: 0; transform: translate(-50%, 0) scale(.4); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--x)), var(--y)) scale(1.1); } }
@keyframes vpop { 0% { transform: scale(.8); opacity: 0; } 60% { transform: scale(1.04); opacity: 1; } 100% { transform: scale(1); } }
@keyframes dotpop { 0% { transform: scale(.4); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* web ad: in the page, under the content */
.webad { max-width: 560px; margin: -64px auto 96px; padding-inline: 16px; display: grid; gap: 6px; }
.webad .adbox { height: 100px; }

/* accounts */
.auth { gap: 14px; }
.authbtns { display: grid; gap: 10px; }
.applebtn, .googlebtn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; font-size: 16px; }
.applebtn { background: #000; color: #fff; }
:root[data-theme="dark"] .applebtn { background: #fff; color: #000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .applebtn { background: #fff; color: #000; } }
.googlebtn { background: #fff; color: #1f1f1f; border: 1px solid #747775; }
.gbtn { display: flex; justify-content: center; align-items: center; min-height: 48px; border-radius: 999px; overflow: hidden; }
/* Google draws its button in its own frame; keep that frame light so dark mode doesn't paint a square behind the pill */
.gbtn iframe { color-scheme: light; background: transparent; border-radius: 999px; }
.ordiv { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13px; }
.ordiv::before, .ordiv::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.authform { display: grid; gap: 8px; }
.authform input { font: inherit; font-size: 17px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.authform input#authcode { font-family: var(--f-mono); font-size: 26px; letter-spacing: .3em; text-align: center; }
.sheet .msg:empty { display: none; }

/* overlay */
.overlay { position: fixed; inset: 0; background: color-mix(in srgb, var(--ink) 45%, transparent); display: grid; place-items: center; padding: 16px; z-index: 20; }
.sheet { background: var(--card); color: var(--ink); border-radius: 18px; max-width: 460px; width: 100%; padding: 20px; display: grid; gap: 12px; max-height: calc(100vh - 32px); overflow: auto; }
.sheet h2 { font-size: 24px; }
.sheet ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.adfull { height: 220px; border: 1px dashed var(--line); border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); text-align: center; padding: 16px; }

/* archive */
.month h3 { font-size: 18px; margin: 18px 0 8px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .wd { font-size: 11px; text-align: center; color: var(--ink-2); font-weight: 700; }
.cal button { aspect-ratio: 1; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 2px; display: grid; place-items: center; font-variant-numeric: tabular-nums; font-size: 14px; max-width: 100%; }
.cal button[disabled] { opacity: .35; cursor: default; }
.cal button.today { border-color: var(--ink); font-weight: 700; }
.cal .mini { display: flex; gap: 2px; }
.cal .mini i { width: 5px; height: 5px; border-radius: 50%; background: var(--line); }
.daylist { display: grid; gap: 8px; }

/* stats */
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-family: var(--f-display); font-size: 28px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--ink-2); }
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 64px 1fr 48px; gap: 10px; align-items: center; font-size: 14px; }
.bar .track { height: 12px; background: var(--chip); border-radius: 6px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--c); border-radius: 6px; }
.bar .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.section { margin-top: 22px; display: grid; gap: 10px; }
.section > h2 { font-size: 20px; }
.toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.toggle .btn { white-space: nowrap; flex: none; }


/* alibi: case, compact clues, grid */
.case { padding: 12px 14px; margin-bottom: 10px; display: grid; gap: 6px; }
.story { margin: 0; font-size: 16px; }
.twist { margin: 0; font-size: 15px; font-weight: 700; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.twist span { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--card); background: var(--ink); border-radius: 999px; padding: 2px 8px; }
.pairrow { display: grid; gap: 6px; justify-items: center; }
.tipoff { margin: 0; font-size: 15px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tipoff span { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--card); background: var(--c); border-radius: 999px; padding: 2px 8px; }
.clues.compact { gap: 4px; margin-bottom: 10px; }
.clues.compact button { padding: 6px 10px; font-size: 15px; line-height: 1.35; border-radius: 8px; }
.penrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.pen { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--card); padding: 3px; }
.pen button { border: 0; background: transparent; border-radius: 999px; padding: 6px 14px; font-weight: 700; min-height: 36px; }
.pen button.on { background: var(--c); color: var(--card); }
.mist { font-size: 14px; }
.agrid { border-collapse: separate; border-spacing: 3px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 6px; }
.agrid thead th { font-family: var(--f-display); font-size: 15px; font-weight: 800; text-align: center; padding: 2px 0 4px; }
.agrid tr.cat th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--c); font-weight: 700; text-align: left; padding: 8px 2px 0; }
.agrid tbody th[scope="row"] { font-size: 14px; font-weight: 400; text-align: right; padding-right: 8px; color: var(--ink-2); white-space: nowrap; }
.cell { width: 44px; height: 34px; border-radius: 7px; border: 1px solid var(--line); background: var(--chip); font-size: 18px; font-weight: 800; padding: 0; display: grid; place-items: center; }
.cell.yes { background: var(--c); border-color: var(--c); color: var(--card); }
.cell.no { background: transparent; color: color-mix(in srgb, var(--ink-2) 70%, transparent); font-weight: 400; }
.cell[disabled] { cursor: default; }
.cell.auto.no { color: color-mix(in srgb, var(--ink-2) 45%, transparent); }
.cell.auto.yes { background: color-mix(in srgb, var(--c) 70%, var(--card)); }
.clues button.suspect { border-color: var(--bad); border-style: dashed; }
.clues button em { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 700; color: var(--bad); text-transform: uppercase; letter-spacing: .06em; }
.btn.small { min-width: 44px; padding: 8px 12px; }
.clues button.hinted { border-color: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 35%, transparent); }
.accuse { margin-top: 12px; display: grid; gap: 10px; text-align: center; }
.accuse h3 { font-size: 20px; }
.accuse .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.accuse .btn { min-width: 76px; }
.soltable { border-collapse: collapse; width: 100%; font-size: 15px; }
.soltable th, .soltable td { text-align: left; padding: 4px 8px 4px 0; }
.soltable tr.culprit td { color: var(--c); }

/* huddle */
.hfound { display: grid; gap: 8px; margin-bottom: 8px; }
.hbar { background: color-mix(in srgb, var(--t) 22%, var(--card)); border: 2px solid var(--t); border-radius: var(--r); padding: 10px 12px; text-align: center; display: grid; gap: 2px; animation: pop .3s ease; }
.hbar b { font-family: var(--f-display); font-size: 16px; letter-spacing: .02em; }
.hbar span { font-size: 14px; font-weight: 700; letter-spacing: .03em; }
.hbar em { font-style: normal; font-size: 13px; color: var(--ink-2); }
.hbar.missed { border-style: dashed; }
.hbar.small { text-align: left; }
@keyframes pop { from { transform: scale(.96); opacity: .4; } }
.hgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.htile { aspect-ratio: 1 / .78; min-height: 64px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-weight: 700; font-size: 14px; letter-spacing: .01em; padding: 2px; overflow-wrap: anywhere; line-height: 1.1; box-shadow: 0 2px 0 var(--line); transition: transform .1s; }
.htile.l { font-size: 12.5px; }
.htile.xl { font-size: 11px; }
.htile.xxl { font-size: 9.5px; letter-spacing: -.02em; }
.htile.sel { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: translateY(1px); box-shadow: none; }
.hslips { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.hslips span { display: inline-flex; gap: 6px; }
.hslips i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink-2); display: block; }
.hslips i.used { background: var(--bad); border-color: var(--bad); }

/* whittle */
.wpanel { text-align: center; }
.wtrail { font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 22px; margin: 8px 0 12px; }
.wtrail i { font-style: normal; opacity: .6; }
.wword { display: flex; gap: 5px; justify-content: center; flex-wrap: nowrap; }
.wl { width: min(46px, calc((100vw - 90px) / 9)); height: 56px; border-radius: 10px; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 10%, var(--card)); font-family: var(--f-mono); font-weight: 700; font-size: clamp(18px, 6vw, 26px); padding: 0; transition: transform .1s; }
.wl:hover:not([disabled]) { transform: translateY(-3px); }
.wl:active:not([disabled]) { background: var(--c); color: var(--card); }
.wl[disabled] { border-color: var(--line); background: var(--chip); opacity: 1; cursor: default; }
.wstuck { margin: 12px 0 0; color: var(--bad); font-weight: 700; }

/* balance */
.scales { display: grid; gap: 34px; margin: 18px 0 26px; }
.scale { position: relative; padding: 6px 6px 14px; }
.beam { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; border-bottom: 4px solid var(--ink-2); border-radius: 2px; transform-origin: 50% 100%; transition: transform .4s ease; }
.fulcrum { position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%); border: 10px solid transparent; border-top: 0; border-bottom: 13px solid var(--ink-2); }
.scale.q .beam { border-bottom-color: var(--c); }
.scale.q .fulcrum { border-bottom-color: var(--c); }
.stag { position: absolute; left: 50%; top: 2px; transform: translateX(-50%); font-family: var(--f-mono); font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.balrule { margin: 4px 0 0; text-align: center; font-size: 14px; color: var(--ink-2); }
.balhint { display: flex; gap: 6px; align-items: center; justify-content: center; margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--c); }
.balhint svg { width: 16px; height: 16px; }
.pan { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 3px; min-height: 34px; padding-bottom: 5px; }
.shp { width: 28px; height: 28px; display: block; }
.wt { font-family: var(--f-mono); font-weight: 700; font-size: 19px; background: var(--ink); color: var(--paper); border-radius: 9px 9px 4px 4px; padding: 3px 10px; min-width: 42px; text-align: center; font-variant-numeric: tabular-nums; }
.wt.ask { background: transparent; color: var(--c); border: 2px dashed var(--c); min-width: 56px; }
.wt.ask.typed { border-style: solid; }
.wt.ask.ok { background: var(--good); border-color: var(--good); color: var(--card); }
.wt.ask.miss { background: var(--bad); border-color: var(--bad); color: var(--card); }
#qscale { margin: 22px 0 26px; }
.askwrap { display: inline-flex; align-items: center; gap: 4px; }
.legend { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; font-family: var(--f-mono); font-weight: 700; margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend .shp { width: 20px; height: 20px; }
.kb.num .r { gap: 8px; }
.kb.num button { max-width: 120px; font-size: 22px; height: 46px; }
.kb.num button.wide { max-width: 120px; flex: 1 1 0; font-size: 15px; }
.oldcard { opacity: .85; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* round wins: quick, gentle, once */
.slot.flip { animation: flip .42s calc(var(--i) * 55ms) cubic-bezier(.3,1.4,.5,1) both; }
@keyframes flip { 0% { transform: rotateX(90deg) scale(.9); } 100% { transform: none; } }
#qscale.win .wt.ask.ok { animation: dotpop .5s ease-out both; }
#qscale.win .beam { animation: settle .7s ease-out; }
@keyframes settle { 0% { transform: rotate(-3deg); } 40% { transform: rotate(2deg); } 70% { transform: rotate(-1deg); } 100% { transform: none; } }
.hbar.win { animation: hwin .55s cubic-bezier(.3,1.4,.5,1) both; }
@keyframes hwin { 0% { transform: scale(.9); opacity: .3; } 60% { transform: scale(1.03); box-shadow: 0 0 0 6px color-mix(in srgb, var(--t) 25%, transparent); } 100% { transform: none; box-shadow: 0 0 0 0 transparent; } }
.linkcard.rise { animation: rise .4s .25s ease-out both; }
.progress span.pop { animation: dotpop .5s ease-out; }
@keyframes rise { 0% { transform: translateY(8px); opacity: 0; } 100% { transform: none; opacity: 1; } }
/* Share all four: the Full Set brag button */
.btn.setshare { background: linear-gradient(90deg, var(--knot), var(--steps), var(--alibi), var(--tally)); color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.setwrap { display: grid; justify-items: center; gap: 6px; margin-top: 14px; }
.setwrap .sharebox, .nextcard .sharebox { width: 100%; box-sizing: border-box; text-align: left; }
.sharebox[hidden], .msg[hidden] { display: none; }
