/* Front Nine — one stylesheet for the hub and all four games. */
:root {
  --bg: #f4f2ea;
  --surface: #ffffff;
  --surface-2: #ebe8dd;
  --text: #17201b;
  --muted: #56625c;
  --line: #d6d2c4;
  --accent: #1f6f4a;
  --accent-strong: #165838;
  --accent-ink: #ffffff;
  --accent-soft: #dcefe2;
  --gold: #b8860b;
  --warn: #b5501c;
  --danger: #b3261e;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 6px 18px rgba(20, 30, 25, .07);
  --radius: 14px;
  --cell-hidden: #bfd0c5;
  --cell-hidden-hi: #d3e1d8;
  --cell-hidden-lo: #9fb5a8;
  --cell-rev: #f6f4ec;
  --cell-line: #d2cfc2;
  --n1: #1d4fd8; --n2: #1a7a33; --n3: #c0262d; --n4: #4b2a91;
  --n5: #8a3b12; --n6: #0f6e78; --n7: #222222; --n8: #6b6b6b;
  --tray: #e3d6bf;
  --tray-line: #cbbb9c;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Color Emoji", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1512; --surface: #18201c; --surface-2: #222c27; --text: #e8eee9; --muted: #a3b0a9; --line: #33403a;
    --accent: #48b07c; --accent-strong: #5cc48f; --accent-ink: #08130d; --accent-soft: #1f3a2c; --gold: #e3b341;
    --warn: #f0894e; --danger: #ff7b72; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
    --cell-hidden: #3b4c43; --cell-hidden-hi: #4b5f54; --cell-hidden-lo: #2a3630; --cell-rev: #1d2521; --cell-line: #2c3832;
    --n1: #7ab0ff; --n2: #6fd28a; --n3: #ff8a80; --n4: #c4a5ff; --n5: #ffb36b; --n6: #5fd6e0; --n7: #f0f0f0; --n8: #b9b9b9;
    --tray: #3b3428; --tray-line: #4d4535;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1512; --surface: #18201c; --surface-2: #222c27; --text: #e8eee9; --muted: #a3b0a9; --line: #33403a;
  --accent: #48b07c; --accent-strong: #5cc48f; --accent-ink: #08130d; --accent-soft: #1f3a2c; --gold: #e3b341;
  --warn: #f0894e; --danger: #ff7b72; --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
  --cell-hidden: #3b4c43; --cell-hidden-hi: #4b5f54; --cell-hidden-lo: #2a3630; --cell-rev: #1d2521; --cell-line: #2c3832;
  --n1: #7ab0ff; --n2: #6fd28a; --n3: #ff8a80; --n4: #c4a5ff; --n5: #ffb36b; --n6: #5fd6e0; --n7: #f0f0f0; --n8: #b9b9b9;
  --tray: #3b3428; --tray-line: #4d4535;
  color-scheme: dark;
}
:root.colorblind { --n1: #0072b2; --n2: #009e73; --n3: #d55e00; --n4: #7a4fa0; --n5: #a05a00; --n6: #2a8fb8; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: .4em 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
main:focus, main:focus-visible { outline: none; }
main { outline: none; padding: 0 16px calc(32px + env(safe-area-inset-bottom)); max-width: 760px; margin: 0 auto; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent); font-size: 18px; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav-link { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; }
.nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--text); }
.nav-link:hover { background: var(--surface-2); }
.top-actions { display: flex; gap: 2px; }
@media (max-width: 640px) { .nav-text { display: none; } .nav-link { padding: 6px 8px; font-size: 1.05rem; } }
@media (max-width: 380px) { .brand > span:last-child { display: none; } }

.icon-btn {
  min-width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; cursor: pointer;
  font-size: 1.15rem; display: inline-grid; place-items: center; color: var(--text);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:disabled { opacity: .4; cursor: default; }

/* ---------- Buttons ---------- */
.btn {
  min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 650; box-shadow: 0 1px 0 rgba(0, 0, 0, .03);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: var(--text);
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); }
.btn-lg { min-height: 52px; font-size: 1.05rem; padding: 12px 22px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Hub ---------- */
.hub { padding-top: 20px; }
.hub-hero h1 { font-size: clamp(1.8rem, 6vw, 2.4rem); letter-spacing: -.02em; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--accent); margin: 0 0 4px; }
.streak-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0; }
.streak-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 8px; text-align: center; display: grid; gap: 2px; }
.streak-tile strong { font-size: 1.25rem; }
.streak-tile span { font-size: .78rem; color: var(--muted); }
.game-list { display: grid; gap: 12px; }
@media (min-width: 680px) { .game-list { grid-template-columns: 1fr 1fr; } }
.game-card {
  display: flex; gap: 14px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); text-decoration: none; color: var(--text); transition: transform .15s ease, border-color .15s ease;
}
.game-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.game-card.won { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.gc-icon { font-size: 2rem; width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); display: grid; place-items: center; flex: none; }
.gc-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.gc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.gc-top h2 { font-size: 1.15rem; }
.gc-day { font-size: .82rem; color: var(--muted); font-weight: 600; }
.gc-blurb { margin: 0; color: var(--muted); font-size: .92rem; }
.gc-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.gc-status { font-size: .88rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); }
.gc-status.won { background: var(--accent-soft); }
.gc-status.progress { background: color-mix(in srgb, var(--gold) 22%, transparent); }
.gc-cta { font-weight: 700; color: var(--accent); font-size: .92rem; }
.combined { margin: 20px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; }
.share-preview { margin: 0; font-family: var(--font); white-space: pre-wrap; background: var(--surface-2); padding: 10px 12px; border-radius: 10px; font-size: .92rem; }
.countdown { text-align: center; color: var(--muted); margin: 18px 0 6px; font-size: .95rem; }
.countdown .mono { color: var(--text); font-weight: 700; }
.footer-note { text-align: center; max-width: 520px; margin: 6px auto; }

/* ---------- Shared game chrome ---------- */
.screen-holder { max-width: 560px; margin: 0 auto; }
.loading, .empty { text-align: center; padding: 60px 16px; color: var(--muted); display: grid; gap: 12px; justify-items: center; }
.game-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 0 6px; }
.game-title { font-size: 1.35rem; letter-spacing: -.01em; }
.day-chip { font-size: .88rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.day-chip.as-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 2px 10px; cursor: pointer; min-height: 30px; }
.head-actions { display: flex; gap: 2px; }
.status-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-weight: 650; font-size: .92rem; }
.bottom-bar {
  position: sticky; bottom: 0; z-index: 10; display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); margin-top: 10px;
  background: linear-gradient(to top, var(--bg) 75%, color-mix(in srgb, var(--bg) 0%, transparent));
}
.bottom-bar[hidden] { display: none; }
.coach { background: var(--accent-soft); border-radius: 12px; padding: 10px 12px; font-weight: 550; }
.scratch-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 0 8px; flex-wrap: wrap; }
.scratch-head h2 { font-size: 1.2rem; }
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 650; opacity: 0;
  pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Result ---------- */
.result-wrap:empty { display: none; }
.result { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 16px; margin: 14px 0; box-shadow: var(--shadow); text-align: center; display: grid; gap: 6px; position: relative; overflow: hidden; }
.result-label { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; }
.big-emoji { font-size: 2.4rem; }
.result-time { font-weight: 650; color: var(--muted); }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.squares { font-size: 1.1rem; letter-spacing: 1px; word-break: break-all; }
.roast { font-style: italic; color: var(--muted); }
.recap, .tip { background: var(--surface-2); border-radius: 12px; padding: 12px; margin-top: 8px; display: grid; gap: 6px; justify-items: center; }
.recap h3 { font-size: 1rem; }
.liar-note { font-weight: 600; }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(8, 12, 10, .5); display: grid; place-items: center; z-index: 60; padding: 16px; animation: fade .15s ease; }
.modal { background: var(--surface); color: var(--text); border-radius: 18px; width: min(420px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal-wide { width: min(560px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 10px 4px 18px; position: sticky; top: 0; background: var(--surface); }
.modal-head h2 { font-size: 1.15rem; }
.modal-body { padding: 4px 18px 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 18px 16px; flex-wrap: wrap; }
.help h3 { font-size: .98rem; margin-top: 14px; }
.help p, .help li { color: var(--muted); }
.help ul { padding-left: 20px; margin: 4px 0; }
.rule-text { font-size: 1.12rem; font-weight: 650; }
.rule-card { display: grid; gap: 10px; }
.mini-diagram { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mini-cell { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; font-weight: 800; background: var(--cell-rev); border: 1px solid var(--cell-line); font-size: 1.2rem; }
.mini-arrow { color: var(--muted); font-size: .9rem; }
.settings h3 { font-size: .98rem; margin: 16px 0 6px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.set-row > span { display: grid; }
.set-row select { min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); padding: 4px 8px; }
.set-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); }
.code-box { width: 100%; margin: 8px 0; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); padding: 8px; font-family: var(--mono); font-size: .8rem; }

/* ---------- Stats ---------- */
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.stat-tile { display: grid; text-align: center; background: var(--surface-2); border-radius: 12px; padding: 10px 4px; }
.stat-tile strong { font-size: 1.4rem; }
.stat-tile span { font-size: .78rem; color: var(--muted); }
.stats h3 { font-size: .95rem; margin: 14px 0 6px; }
.histo { display: grid; gap: 5px; }
.histo-row { display: grid; grid-template-columns: 7.5em 1fr 2em; align-items: center; gap: 8px; font-size: .9rem; }
.histo-bar-wrap { background: var(--surface-2); border-radius: 6px; height: 18px; overflow: hidden; }
.histo-bar { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.histo-n { text-align: right; font-weight: 700; }
.weekday-table { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.wd-cell { display: grid; text-align: center; background: var(--surface-2); border-radius: 8px; padding: 6px 0; font-size: .85rem; }

/* ---------- Sweepday ---------- */
.sw-board-wrap { position: relative; display: flex; justify-content: center; margin: 0 -12px; max-height: calc(100vh - 260px); max-height: calc(100dvh - 250px); overflow-y: auto; overflow-x: hidden; border-radius: 14px; padding: 6px 0; }
.sw-grid { display: grid; gap: 0; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.sw-row { display: contents; }
.sw-cell {
  width: var(--cell); height: var(--cell); display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--bg);
  font-weight: 800; font-size: calc(var(--cell) * .5); cursor: pointer; position: relative; font-variant-numeric: tabular-nums;
}
.sw-cell.hid { background: linear-gradient(180deg, var(--cell-hidden-hi), var(--cell-hidden)); box-shadow: inset 0 -3px 0 var(--cell-hidden-lo); }
.sw-cell.hid:hover { filter: brightness(1.04); }
.sw-cell.pressed { transform: translateY(1px); box-shadow: inset 0 -1px 0 var(--cell-hidden-lo); filter: brightness(.95); }
.sw-cell.rev { background: var(--cell-rev); box-shadow: inset 0 0 0 1px var(--cell-line); cursor: default; }
.sw-cell.fog { background-image: repeating-linear-gradient(45deg, transparent 0 5px, color-mix(in srgb, var(--muted) 22%, transparent) 5px 7px); }
.sw-cell.hid.fog { background-image: repeating-linear-gradient(45deg, transparent 0 5px, rgba(0, 0, 0, .12) 5px 7px), linear-gradient(180deg, var(--cell-hidden-hi), var(--cell-hidden)); }
.sw-cell.n1 { color: var(--n1); } .sw-cell.n2 { color: var(--n2); } .sw-cell.n3 { color: var(--n3); } .sw-cell.n4 { color: var(--n4); }
.sw-cell.n5 { color: var(--n5); } .sw-cell.n6 { color: var(--n6); } .sw-cell.n7 { color: var(--n7); } .sw-cell.n8 { color: var(--n8); }
.sw-cell.n2 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.sw-cell.n3 { font-style: italic; }
.sw-cell.n4 { box-shadow: inset 0 0 0 1px var(--cell-line), inset 0 0 0 3px color-mix(in srgb, var(--n4) 25%, transparent); }
.sw-cell.flag, .sw-cell.mine, .sw-cell.boom, .sw-cell.wrong { font-size: calc(var(--cell) * .48); }
.sw-cell.boom { background: var(--danger); }
.sw-cell.wrong { color: var(--danger); font-weight: 900; }
.sw-cell.shielded { box-shadow: inset 0 0 0 2px var(--gold); }
.sw-cell.selected { outline: 3px solid var(--accent); outline-offset: -1px; z-index: 2; }
.sw-cell.proof { box-shadow: inset 0 0 0 3px var(--gold); }
.sw-cell.hinted { animation: glow 1.5s ease; }
.sw-cell.nbhd { outline: 2px dashed var(--accent); outline-offset: -2px; }
.sw-cell.coach-target { animation: glow 1.2s ease infinite; }
.sw-cell.liar { box-shadow: inset 0 0 0 3px var(--warn); }
.sw-cell.liar::after { content: "🤥" attr(data-true); position: absolute; top: -12px; right: -8px; font-size: 12px; line-height: 18px; background: var(--warn); color: #fff; border-radius: 9px; padding: 0 5px; font-style: normal; text-decoration: none; white-space: nowrap; z-index: 3; pointer-events: none; }
.sw-cell.pop { animation: pop .35s ease backwards; }
.sw-cell.fade-in { animation: fade .25s ease; }
.sw-board-wrap.veiled .sw-grid { filter: blur(9px); pointer-events: none; }
.show-board { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 3; box-shadow: var(--shadow); }
.paused-overlay { position: absolute; inset: 0; display: grid; place-content: center; gap: 4px; background: color-mix(in srgb, var(--bg) 40%, transparent); border: 0; cursor: pointer; z-index: 4; font-size: 1.3rem; font-weight: 800; color: var(--text); }
.paused-overlay[hidden] { display: none; }
.paused-overlay small { font-weight: 600; font-size: .9rem; color: var(--muted); }
.is-paused .sw-grid { filter: blur(10px); }
.segmented { display: inline-flex; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 4px; }
.seg { min-height: 48px; min-width: 96px; border: 0; border-radius: 10px; background: transparent; font-weight: 750; cursor: pointer; font-size: 1rem; }
.seg[aria-pressed="true"] { background: var(--surface); box-shadow: var(--shadow); color: var(--accent); outline: 2px solid var(--accent); }
.btn-hint, .btn-confirm { min-height: 52px; }
.btn-confirm[hidden] { display: none; }
.picture { display: grid; width: min(220px, 70%); margin: 8px auto; aspect-ratio: 9 / 12; border-radius: 10px; overflow: hidden; animation: fade .8s ease; }
.picture span { display: block; }

/* ---------- Tidy ---------- */
.tray-wrap { display: flex; justify-content: center; padding: 6px 22px 6px 0; }
.tray {
  position: relative; width: min(100%, 420px); aspect-ratio: 1; background: var(--tray); border-radius: 16px;
  box-shadow: inset 0 0 0 6px var(--tray-line), var(--shadow); touch-action: none; user-select: none;
}
.tray-grid { position: absolute; inset: 6px; display: grid; grid-template-columns: repeat(6, 1fr); }
.tray-grid span { border: 1px solid color-mix(in srgb, var(--tray-line) 70%, transparent); }
.tray-exit { position: absolute; right: -24px; width: 22px; display: grid; place-items: center; color: var(--accent); font-weight: 900; font-size: 1.2rem; }
.tray-exit::before { content: ""; position: absolute; left: -6px; top: 8%; bottom: 8%; width: 8px; background: var(--tray); }
.block {
  position: absolute; padding: 0; border: 0; cursor: grab; background: transparent;
  transition: left .18s ease, top .18s ease;
}
.block::before {
  content: ""; position: absolute; inset: 9%; border-radius: 10px; background-color: var(--bc);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .22), 0 2px 4px rgba(0, 0, 0, .2);
}
.block.pat-stripe::before { background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .22) 0 6px, transparent 6px 12px); }
.block.pat-stripe2::before { background-image: repeating-linear-gradient(-45deg, rgba(0, 0, 0, .18) 0 4px, transparent 4px 10px); }
.block.pat-dots::before { background-image: radial-gradient(rgba(255, 255, 255, .35) 2px, transparent 2.5px); background-size: 12px 12px; }
.block.pat-grid::before { background-image: linear-gradient(rgba(255, 255, 255, .2) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .2) 1px, transparent 1px); background-size: 10px 10px; }
.block.mug::before { background: linear-gradient(180deg, #f4efe6, #e0d5c3); box-shadow: inset 0 0 0 3px #b5652d, inset 0 -4px 0 rgba(0, 0, 0, .15), 0 2px 4px rgba(0, 0, 0, .2); }
.mug-icon { position: relative; font-size: clamp(22px, 7vw, 32px); }
.block.selected::before { outline: 4px solid var(--text); outline-offset: 1px; }
.block.selected::after { content: ""; position: absolute; inset: 9%; border-radius: 10px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .25) 0 3px, transparent 3px 8px); pointer-events: none; }
.block.hinted::before { outline: 4px dashed var(--gold); outline-offset: 2px; }
.block.dragging { transition: none; z-index: 5; cursor: grabbing; }
.block:focus-visible { outline: none; }
.block:focus-visible::before { outline: 4px solid var(--accent); }
.block.exit-slide { transition: left .5s ease-in; left: 100% !important; opacity: .0; }
.tidy-arrows { display: flex; justify-content: center; gap: 12px; min-height: 60px; align-items: center; margin-top: 8px; }
.arrow-btn { min-width: 76px; min-height: 52px; font-size: 1.3rem; }

/* ---------- Tell ---------- */
.opening { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.banner { text-align: center; font-weight: 800; color: var(--warn); margin: 6px 0; letter-spacing: .03em; animation: pulse 1.2s ease infinite; }
.tell-grid { display: grid; gap: 8px; margin: 8px 0; }
.tell-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.tell-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.tell-grid.mini .tell-card { min-height: 48px; font-size: .9rem; }
.tell-card {
  min-height: 56px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); cursor: pointer;
  font-weight: 800; letter-spacing: .06em; font-size: clamp(.92rem, 4.2vw, 1.15rem); display: grid; place-items: center; padding: 6px 2px;
  box-shadow: 0 2px 0 var(--line); transition: transform .12s, opacity .2s; position: relative;
}
.tell-grid.cols-4 .tell-card { font-size: clamp(.8rem, 3.4vw, 1rem); letter-spacing: .03em; }
.tell-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 2px 0 var(--accent); }
.tell-card.out { opacity: .38; text-decoration: line-through; text-decoration-thickness: 3px; background: var(--surface-2); box-shadow: none; }
.tell-card.shaded { background-image: repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--warn) 20%, transparent) 6px 9px); border-style: dashed; border-color: var(--warn); }
.tell-card.pulse { animation: pulse 1s ease infinite; border-color: var(--accent); }
.tell-card.caught { border-color: var(--accent); background: var(--accent-soft); }
.tell-card.decoy::after { content: "🪤"; position: absolute; top: -8px; right: -6px; font-size: 16px; text-decoration: none; }
.tell-card.flip { animation: flip .45s ease; }
.tell-card.wink { animation: wink .45s ease; }
.ask-log { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ask-log li { font-size: .85rem; background: var(--surface-2); border-radius: 999px; padding: 3px 10px; }
.ask-log li.cracked { background: color-mix(in srgb, var(--warn) 25%, transparent); text-decoration: line-through wavy var(--warn); }
.menu-wrap { overflow-x: auto; padding: 4px 0; }
.menu-wrap[hidden] { display: none; }
.chips { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); gap: 8px; justify-content: start; }
.tell-tutorial .chips, .lock-ui .chips { grid-auto-flow: row; grid-template-rows: none; display: flex; flex-wrap: wrap; }
.chip {
  min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; font-weight: 650; white-space: nowrap; box-shadow: 0 2px 0 var(--line);
}
.chip:hover:not(:disabled) { border-color: var(--accent); }
.chip.asked { background: var(--accent-soft); box-shadow: none; }
.chip:disabled { cursor: default; }
.chip:disabled:not(.asked) { opacity: .5; }
.chip.cracked { background: color-mix(in srgb, var(--warn) 25%, transparent); }
.tell-bottom .btn { min-width: 200px; min-height: 52px; }
.stamp {
  position: absolute; top: 12px; right: -8px; transform: rotate(12deg); border: 4px solid var(--danger); color: var(--danger);
  font-weight: 900; letter-spacing: .12em; padding: 2px 12px; border-radius: 8px; font-size: 1.2rem; animation: stamp .4s ease backwards;
}

/* ---------- Tip the Scale ---------- */
.mood { color: var(--muted); margin: 2px 0 4px; }
.weights-strip { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-weight: 650; }
.weight-chip { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-width: 34px; text-align: center; padding: 2px 8px; font-variant-numeric: tabular-nums; }
.scale-graphic { position: relative; height: 150px; margin: 14px auto 4px; width: min(100%, 420px); }
.scale-graphic .post { position: absolute; left: 50%; bottom: 0; width: 12px; height: 110px; transform: translateX(-50%); background: linear-gradient(var(--muted), var(--line)); border-radius: 6px 6px 0 0; }
.scale-graphic .post::after { content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 90px; height: 12px; border-radius: 6px; background: var(--muted); }
.beam { position: absolute; left: 6%; right: 6%; top: 34px; height: 8px; background: var(--text); border-radius: 4px; transform-origin: 50% 50%; }
.pan {
  position: absolute; top: 8px; width: 42%; min-height: 56px; border: 3px solid var(--text); border-top: 0; border-radius: 0 0 50% 50% / 0 0 40% 40%;
  background: var(--surface); display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; align-content: center; padding: 6px;
}
.pan-left { left: -4%; }
.pan-right { right: -4%; }
.carl-says { text-align: center; font-weight: 650; min-height: 1.5em; color: var(--accent); }
.gem-tray { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 6px 0; }
.gem-tray[hidden] { display: none; }
.gem-btn {
  width: 60px; height: 72px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); cursor: pointer;
  display: grid; place-items: center; padding: 4px; gap: 0; position: relative;
}
.gem-btn[data-pos="left"] { border-color: #0072B2; background: color-mix(in srgb, #0072B2 12%, var(--surface)); }
.gem-btn[data-pos="right"] { border-color: #D55E00; background: color-mix(in srgb, #D55E00 12%, var(--surface)); }
.gem-btn.kbd-sel { box-shadow: 0 0 0 2px var(--accent-soft); }
.gem-pos { font-size: .72rem; font-weight: 800; min-height: 1em; color: var(--muted); }
.gem { width: 36px; height: 36px; display: grid; place-items: center; background: var(--gc); color: #fff; font-weight: 900; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
.gem.small { width: 28px; height: 28px; font-size: .8rem; }
.gem-letter { line-height: 1; }
.shape-circle { border-radius: 50%; }
.shape-square { border-radius: 5px; }
.shape-triangle { clip-path: polygon(50% 4%, 98% 94%, 2% 94%); padding-top: 8px; }
.shape-diamond { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.shape-hexagon { clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); }
.shape-star { clip-path: polygon(50% 0, 62% 35%, 98% 35%, 69% 57%, 79% 91%, 50% 70%, 21% 91%, 31% 57%, 2% 35%, 38% 35%); }
.weigh-note { text-align: center; min-height: 1.2em; margin: 0; }
.btn-weigh { min-width: 120px; min-height: 52px; letter-spacing: .06em; }
.section-label { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 4px; }
.scale-history { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.scale-history li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: .92rem; }
.scale-history li.lie { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, var(--surface)); }
.lie-tag { color: var(--warn); font-weight: 700; }
.reveal-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.reveal-gem { display: inline-flex; align-items: center; gap: 4px; font-weight: 750; }
.lock-ui { display: grid; gap: 10px; }
.lock-gems { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lock-gem { display: flex; align-items: center; gap: 6px; justify-content: center; min-height: 52px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 800; }
.lock-gem.active { border-color: var(--accent); background: var(--accent-soft); }
.counter { font-weight: 700; }
.pans-text { text-align: center; font-weight: 700; font-family: var(--mono); }

/* ---------- Motion ---------- */
@keyframes pop { from { transform: scale(.6); opacity: .2; } to { transform: scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes glow { 0%, 100% { box-shadow: inset 0 0 0 0 var(--gold); } 50% { box-shadow: inset 0 0 0 4px var(--gold); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes wink { 0%, 100% { transform: scaleY(1); } 40% { transform: scaleY(.15); } }
@keyframes stamp { from { transform: rotate(12deg) scale(2.4); opacity: 0; } to { transform: rotate(12deg) scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
