:root {
  color-scheme: dark;
  --bg: #14161b;
  --panel: #1d2027;
  --panel-hi: #252830;
  --line: #313541;
  --ink: #f3f3f0;
  --muted: #a3a7af;
  --lime: #d0fc73;
  --danger: #ff9499;
  --round: 16px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; background: var(--bg); color: var(--ink); }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
button:disabled { cursor: default; }
svg { display: block; width: 19px; height: 19px; flex: none; }
.shell { width: min(100% - 40px, 862px); margin-inline: auto; }
.masthead { display: flex; justify-content: space-between; align-items: center; height: 75px; border-bottom: 1px solid var(--line); }
.brand, .masthead-right { display: flex; align-items: center; gap: 11px; }
.brand { border: 0; padding: 0; background: none; font-size: 27px; line-height: 1; font-weight: 850; letter-spacing: -.08em; }
.brand-dot { color: var(--lime); }
.brand-mark { display: grid; grid-template: repeat(3, 4px) / repeat(3, 4px); gap: 2px; place-content: center; width: 30px; height: 30px; border-radius: 9px; background: var(--lime); }
.brand-mark i { background: var(--bg); border-radius: 1px; }
.brand-mark i:nth-child(3), .brand-mark i:nth-child(7) { opacity: .26; }
.club-tag, .eyebrow { font-size: 10px; letter-spacing: .16em; font-weight: 800; }
.club-tag { color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); font-size: 12px; font-weight: 750; }
.app { padding: 32px 0 12px; min-height: 400px; }
.hero { margin-bottom: 19px; }
.hero-top, .hero-label, .side-head, .side-title { display: flex; align-items: center; gap: 9px; }
.hero-top { justify-content: space-between; margin-bottom: 8px; }
.hero-label { color: var(--lime); }
.hero-label i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 16px #d0fc7380; }
h1, h2, p { margin: 0; }
.hero h1 { margin-bottom: 5px; font-size: clamp(37px, 7vw, 59px); line-height: .99; letter-spacing: -.08em; font-weight: 830; }
.hero p { color: var(--muted); font-size: 14px; }
.edition { color: var(--muted); font: 12px ui-monospace, monospace; letter-spacing: .05em; }
.game-layout { display: grid; grid-template-columns: minmax(0, 480px) minmax(245px, 1fr); gap: 24px; align-items: start; }
.metric-strip { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; margin-bottom: 10px; }
.metric { min-width: 0; display: flex; flex-direction: column; gap: 1px; justify-content: center; padding: 5px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); min-height: 44px; }
.metric span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.metric strong { font-size: 14px; font-weight: 780; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric .accent { color: var(--lime); }
.board { width: 100%; aspect-ratio: 1; display: grid; grid-template-columns: repeat(9, minmax(0,1fr)); grid-template-rows: repeat(9, minmax(0,1fr)); border: 2px solid #585c68; border-radius: 13px; background: var(--panel); overflow: hidden; }
.cell { position: relative; display: grid; place-items: center; min-width: 0; padding: 0; margin: 0; border: 0; border-right: 1px solid #353945; border-bottom: 1px solid #353945; border-radius: 0; background: #1f222b; color: #e8edce; font-weight: 620; font-variant-numeric: tabular-nums; font-size: clamp(17px, 5.7vw, 28px); line-height: 1; user-select: none; }
.cell.given { color: #f5f5f3; font-weight: 700; }
.cell:nth-child(3n):not(:nth-child(9n)) { border-right: 2px solid #585c68; }
.cell:nth-child(n+19):nth-child(-n+27), .cell:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid #585c68; }
.cell:nth-child(9n) { border-right: 0; }
.cell:nth-child(n+73) { border-bottom: 0; }
.cell.related { background: #2b3038; }
.cell.same { color: var(--lime); background: #383f37; }
.cell.conflict { color: var(--danger); }
.cell.selected { background: var(--lime); color: var(--bg); box-shadow: inset 0 0 0 1px #14161b15; }
.cell.selected.conflict { background: #ffb1b5; }
.cell:focus-visible { z-index: 1; outline: 2px solid var(--lime); outline-offset: -4px; }
.cell.selected:focus-visible { outline-color: var(--bg); }
.candidates { width: 100%; height: 100%; display: grid; grid-template: repeat(3, minmax(0,1fr)) / repeat(3, minmax(0,1fr)); align-items: center; padding: 2px; color: #a6b09f; font-size: clamp(7px, 2.2vw, 12px); font-weight: 750; }
.selected .candidates { color: #354423; }
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 10px; }
.tool { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--muted); font-weight: 650; font-size: 12px; white-space: nowrap; }
.tool:disabled { opacity: .58; }
.tool[aria-pressed="true"] { color: var(--lime); background: #2c3428; border-color: #53633d; }
.tool svg { width: 16px; height: 16px; }
.keypad { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); margin-top: 8px; gap: 5px; }
.number-key { min-width: 0; min-height: 45px; padding: 0; border: 1px solid #343947; border-radius: 9px; background: var(--panel-hi); font-size: 22px; font-weight: 700; }
.number-key:disabled { opacity: .45; }
.game-side { display: grid; gap: 12px; }
.side-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--round); padding: 18px; }
.side-head { justify-content: space-between; margin-bottom: 10px; }
.side-title { font-weight: 760; font-size: 15px; }
.side-title svg { color: var(--lime); }
.side-card p, .side-note { color: var(--muted); font-size: 13px; line-height: 1.48; }
.side-card strong { color: var(--ink); }
.side-card .progress-text { color: var(--lime); font: 12px ui-monospace, monospace; white-space: nowrap; }
.meter { height: 5px; background: #373b46; overflow: hidden; border-radius: 3px; margin: 15px 0 12px; }
.meter div { height: 100%; background: var(--lime); border-radius: 3px; transition: width .2s ease; }
.next { margin-top: 15px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 11px; align-items: center; justify-content: space-between; font-size: 12px; }
.countdown { color: var(--ink); font: 12px ui-monospace, monospace; }
.rules-card { border-style: dashed; background: transparent; }
.rules-card p+p { margin-top: 8px; }
.action-btn { min-height: 41px; border: 1px solid transparent; padding: 9px 12px; border-radius: 9px; background: var(--lime); color: var(--bg); font-size: 13px; font-weight: 780; }
.action-btn.secondary { color: var(--ink); background: var(--panel-hi); border-color: var(--line); }
.action-btn:disabled { opacity: .7; }
.ranking-action { width: 100%; margin-top: 12px; }
.win { background: #283529; border: 1px solid #485d3f; border-radius: 13px; padding: 12px; margin: 0 0 10px; color: var(--lime); display: flex; align-items: center; flex-wrap: wrap; gap: 7px 9px; }
.win strong { font-size: 14px; }
.win span { color: var(--ink); font-size: 12px; }
.win .action-btn { margin-left: auto; min-height: 32px; padding: 4px 9px; }
.tabs { display: flex; align-items: stretch; gap: 6px; border-top: 1px solid var(--line); margin-top: 12px; padding: 9px 0; }
.tab { flex: 1; display: flex; justify-content: center; align-items: center; gap: 7px; min-height: 43px; min-width: 0; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; }
.tab[aria-current="page"] { color: var(--lime); background: #262d25; border-color: #384334; }
.online-results { border: 1px solid var(--line); border-radius: var(--round); background: var(--panel); padding: 16px; margin: 16px 0; }
.online-results h2 { font-size: 17px; margin-bottom: 9px; }
.online-results ul { margin: 0; padding: 0; list-style: none; }
.online-results li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; min-height: 37px; border-top: 1px solid var(--line); font-size: 14px; }
.online-results li span:first-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.online-results strong { color: var(--lime); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (hover: hover) {
  .tab:not([aria-current]):hover, .tool:not(:disabled):hover, .number-key:not(:disabled):hover { background: #303542; color: var(--ink); }
  .cell:not(.selected):hover { box-shadow: inset 0 0 0 1px #9295a4; }
  .action-btn:not(:disabled):hover { filter: brightness(1.09); }
}
@media (min-width: 670px) {
  .tabs { width: min(100%, 480px); }
}
@media (max-width: 669px) {
  .shell { width: min(100% - 28px, 488px); }
  .shell { width: min(100% - 28px, 488px, max(286px, calc(100svh - 365px))); }
  .masthead { height: 58px; }
  .app { padding-top: 22px; padding-bottom: calc(82px + env(safe-area-inset-bottom)); min-height: 0; }
  .hero { margin-bottom: 15px; }
  .hero p { font-size: 12px; }
  .game-layout { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .game-side { gap: 9px; }
  .side-card { padding: 14px; }
  .rules-card { display: none; }
  .tabs { position: fixed; z-index: 2; bottom: 0; left: 0; right: 0; margin-top: 0; padding: 6px max(10px, calc((100vw - 488px)/2)) calc(6px + env(safe-area-inset-bottom)); background: var(--bg); }
  .tab { flex-direction: column; gap: 3px; min-height: 47px; font-size: 10px; border-radius: 9px; }
  .tab svg { width: 16px; height: 16px; }
}
@media (max-width: 350px) {
  .shell { width: calc(100% - 20px); }
  .keypad { gap: 3px; }
  .number-key { font-size: 18px; }
  .tool { gap: 4px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { .meter div { transition: none; } }
