:root {
  --bg: #f6f3ec;
  --surface: #fffdf8;
  --surface-2: #efeae0;
  --ink: #1d1e21;
  --ink-2: #5d5f66;
  --line: #ddd6c8;
  --line-strong: #bdb4a3;
  --accent: #1f5c43;
  --accent-ink: #ffffff;
  --danger: #b3261e;

  --correct: #3d8b5f;
  --present: #d9a23a;
  --absent: #7b7d84;
  --tile-ink: #ffffff;
  --key: #e3ddd0;
  --key-ink: #1d1e21;

  --radius: 12px;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 6px 20px rgb(0 0 0 / .06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16171a; --surface: #1f2024; --surface-2: #2a2b30; --ink: #eceae4; --ink-2: #a3a3a8;
    --line: #34353b; --line-strong: #4a4b52; --accent: #58b88a; --accent-ink: #0f1a14; --danger: #ff8a80;
    --correct: #3f9466; --present: #c9962f; --absent: #3d3e44; --key: #3a3b41; --key-ink: #eceae4;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16171a; --surface: #1f2024; --surface-2: #2a2b30; --ink: #eceae4; --ink-2: #a3a3a8;
  --line: #34353b; --line-strong: #4a4b52; --accent: #58b88a; --accent-ink: #0f1a14; --danger: #ff8a80;
  --correct: #3f9466; --present: #c9962f; --absent: #3d3e44; --key: #3a3b41; --key-ink: #eceae4;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
  color-scheme: dark;
}
:root[data-cb="1"] { --correct: #e8743b; --present: #5aa9e6; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5;
  min-height: 100dvh; display: flex; flex-direction: column; -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.center { text-align: center; }
.noscript { padding: 2rem; text-align: center; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px max(16px, env(safe-area-inset-left)); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.brand-mark { display: inline-flex; gap: 2px; }
.brand-mark i { width: 9px; height: 16px; border-radius: 2px; background: var(--correct); }
.brand-mark i:nth-child(2) { background: var(--present); }
.brand-mark i:nth-child(3) { background: var(--absent); }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  text-decoration: none; color: var(--ink-2); padding: 7px 11px; border-radius: 999px; font-weight: 600; font-size: .92rem;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.nav .nav-cta { background: var(--accent); color: var(--accent-ink); }
.nav .nav-cta:hover { background: var(--accent); color: var(--accent-ink); filter: brightness(1.08); }
@media (max-width: 520px) {
  .brand-name { display: none; }
  .nav a { padding: 7px 9px; font-size: .88rem; }
}

main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 20px 16px 40px; outline: none; }
main.wide { max-width: 980px; }
main.game-main { display: flex; flex-direction: column; padding-bottom: max(12px, env(safe-area-inset-bottom)); }

/* ---------- common ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 650; cursor: pointer; text-decoration: none; transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: .88rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }

label.field { display: block; }
label.field > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
input[type=text], input[type=password], input:not([type]) {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--ink);
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.hint { font-size: .82rem; color: var(--ink-2); margin-top: 4px; }
.error-box { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border-radius: 10px; padding: 10px 12px; font-size: .92rem; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.switch:first-of-type { border-top: 0; }
.switch strong { display: block; }
.toggle { position: relative; width: 48px; height: 28px; flex: none; }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background .2s; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgb(0 0 0 / .25); }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(20px); }
.toggle input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }

/* ---------- landing ---------- */
.hero { text-align: center; padding: 28px 0 8px; }
.hero h1 { font-size: clamp(2rem, 7vw, 3.2rem); letter-spacing: -.035em; margin-bottom: .3em; }
.hero p.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 30em; margin: 0 auto 1.4em; }
.hero .row { justify-content: center; }
.demo-tiles { display: flex; justify-content: center; gap: 6px; margin: 8px 0 26px; }
.demo-tiles .tile { width: 52px; height: 52px; font-size: 1.6rem; animation: demo-flip .6s ease both; }
.demo-tiles .tile:nth-child(2) { animation-delay: .12s } .demo-tiles .tile:nth-child(3) { animation-delay: .24s }
.demo-tiles .tile:nth-child(4) { animation-delay: .36s } .demo-tiles .tile:nth-child(5) { animation-delay: .48s }
@keyframes demo-flip { from { transform: rotateX(90deg); } to { transform: rotateX(0); } }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 28px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.feature h3 { margin-bottom: .3em; }
.feature p { margin: 0; color: var(--ink-2); font-size: .94rem; }
.feature .num { font-family: var(--mono); font-size: .8rem; color: var(--accent); font-weight: 700; display: block; margin-bottom: 6px; }

/* ---------- auth ---------- */
.auth { max-width: 400px; margin: 24px auto; }
.auth h1 { font-size: 1.6rem; }
.auth .alt { text-align: center; margin-top: 16px; color: var(--ink-2); font-size: .94rem; }

/* ---------- game ---------- */
.game { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; max-width: 500px; margin: 0 auto; }
.game-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.game-head .title { font-weight: 700; }
.game-head .tags { display: flex; gap: 6px; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.tag.hard { background: color-mix(in srgb, var(--present) 25%, transparent); color: var(--ink); }
.guest-note { width: 100%; font-size: .88rem; color: var(--ink-2); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 8px 12px; text-align: center; }

.board-wrap { flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 0; }
.board { display: grid; grid-template-rows: repeat(6, 1fr); gap: 6px; width: min(100%, 330px, calc((100dvh - 330px) * 5 / 6)); min-width: 230px; aspect-ratio: 5 / 6; }
.board-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tile {
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--line); border-radius: 6px;
  font-weight: 800; font-size: clamp(1.4rem, 7vw, 2rem); text-transform: uppercase; user-select: none;
  background: var(--surface); color: var(--ink); aspect-ratio: 1;
}
.tile.filled { border-color: var(--line-strong); animation: pop .1s ease; }
.tile.correct, .tile.present, .tile.absent { color: var(--tile-ink); border-color: transparent; }
.tile.correct { background: var(--correct); }
.tile.present { background: var(--present); }
.tile.absent { background: var(--absent); }
.tile.reveal { animation: flip .5s ease both; }
.board-row.shake { animation: shake .45s; }
.board-row.win .tile { animation: bounce .5s ease both; }
@keyframes pop { 50% { transform: scale(1.08); } }
@keyframes flip {
  0% { transform: rotateX(0); background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
  49% { transform: rotateX(90deg); background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
  50% { transform: rotateX(90deg); }
  100% { transform: rotateX(0); }
}
@keyframes shake { 10%, 90% { transform: translateX(-2px) } 20%, 80% { transform: translateX(4px) } 30%, 50%, 70% { transform: translateX(-6px) } 40%, 60% { transform: translateX(6px) } }
@keyframes bounce { 0%, 20% { transform: translateY(0) } 40% { transform: translateY(-18px) } 60% { transform: translateY(0) } 80% { transform: translateY(-5px) } 100% { transform: translateY(0) } }
@media (prefers-reduced-motion: reduce) { .tile, .board-row, .demo-tiles .tile { animation: none !important; } }

.keyboard { width: 100%; max-width: 500px; display: flex; flex-direction: column; gap: 7px; user-select: none; }
.kb-row { display: flex; gap: 5px; justify-content: center; }
.key {
  flex: 1; min-width: 0; height: 56px; border: 0; border-radius: 6px; background: var(--key); color: var(--key-ink);
  font-weight: 700; font-size: 1.05rem; text-transform: uppercase; cursor: pointer; padding: 0; touch-action: manipulation;
}
.key.wide { flex: 1.55; font-size: .78rem; letter-spacing: .02em; }
.key.spacer { flex: .5; visibility: hidden; }
.key.correct { background: var(--correct); color: var(--tile-ink); }
.key.present { background: var(--present); color: var(--tile-ink); }
.key.absent { background: var(--absent); color: var(--tile-ink); opacity: .75; }
:root[data-theme="dark"] .key.absent { opacity: .6; }
.key:active { filter: brightness(.9); }
.key svg { width: 22px; height: 22px; }

.done-bar { width: 100%; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- toasts & modal ---------- */
.toasts { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-weight: 650; font-size: .95rem; box-shadow: var(--shadow); animation: toast-in .15s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

.modal-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / .45); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s ease; }
.modal { background: var(--surface); color: var(--ink); border-radius: 16px; width: 100%; max-width: 440px; max-height: calc(100dvh - 32px); overflow: auto; padding: 22px; position: relative; box-shadow: 0 20px 60px rgb(0 0 0 / .3); }
.modal .close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; font-size: 1.4rem; color: var(--ink-2); }
.modal .close:hover { background: var(--surface-2); }
@keyframes fade { from { opacity: 0; } }

/* ---------- stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; margin: 12px 0 18px; }
.stat-grid .n { font-size: 1.8rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-grid .l { font-size: .75rem; color: var(--ink-2); line-height: 1.2; }
.dist { display: flex; flex-direction: column; gap: 5px; }
.dist-row { display: grid; grid-template-columns: 14px 1fr; gap: 8px; align-items: center; font-size: .88rem; font-weight: 700; }
.dist-bar { background: var(--absent); color: #fff; text-align: right; padding: 2px 8px; border-radius: 4px; min-width: 26px; font-variant-numeric: tabular-nums; }
.dist-bar.hi { background: var(--correct); }
.countdown { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.result-answer { font-size: 1.1rem; margin-bottom: 12px; }
.result-answer b { letter-spacing: .15em; text-transform: uppercase; }

/* ---------- leagues ---------- */
.league-list { display: grid; gap: 12px; }
.league-item { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; transition: border-color .15s, transform .1s; }
.league-item:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.league-item .rank { flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; font-size: 1.15rem; line-height: 1; }
.league-item .rank small { font-size: .62rem; font-weight: 600; color: var(--ink-2); margin-top: 3px; }
.league-item .rank.first { background: color-mix(in srgb, var(--present) 30%, var(--surface)); }
.league-item .info { flex: 1; min-width: 0; }
.league-item .info strong { display: block; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.league-item .info span { color: var(--ink-2); font-size: .88rem; }
.league-item .chev { color: var(--ink-2); font-size: 1.3rem; }
.empty { text-align: center; padding: 32px 16px; color: var(--ink-2); }

.invite { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.invite .code { font-family: var(--mono); font-weight: 800; font-size: 1.2rem; letter-spacing: .12em; }

.board-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.board-table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 700; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.board-table td { padding: 10px 6px; border-bottom: 1px solid var(--line); }
.board-table tr:last-child td { border-bottom: 0; }
.board-table .num { text-align: right; }
.board-table th.num { text-align: right; }
.board-table .c { text-align: center; }
.board-table tr.you td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.board-table .pos { width: 34px; font-weight: 800; color: var(--ink-2); }
.board-table .pos.p1 { color: var(--present); }
.board-table .who { font-weight: 650; }
.board-table .who small { display: block; font-weight: 400; color: var(--ink-2); font-size: .78rem; }
.board-table .pts { font-weight: 800; font-size: 1.05rem; }
.table-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }

.day-cell { display: inline-flex; width: 28px; height: 28px; border-radius: 6px; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; background: var(--surface-2); color: var(--ink-2); }
.day-cell.won { background: var(--correct); color: #fff; }
.day-cell.won.g1, .day-cell.won.g2 { box-shadow: inset 0 0 0 2px color-mix(in srgb, #fff 45%, transparent); }
.day-cell.lost { background: var(--absent); color: #fff; }
.day-cell.playing { background: transparent; border: 2px dashed var(--line-strong); }
.day-cell.future { background: transparent; border: 1px solid var(--line); }
.board-table th.c, .board-table td.c { padding-left: 2px; padding-right: 2px; width: 34px; }

.today-list { display: grid; gap: 10px; }
.today-item { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.today-item.you { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.today-item .who { flex: 1; min-width: 0; font-weight: 650; }
.today-item .who small { display: block; color: var(--ink-2); font-weight: 500; font-size: .85rem; }
.mini-grid { display: grid; grid-template-columns: repeat(5, 11px); gap: 2px; }
.mini-grid i { width: 11px; height: 11px; border-radius: 2px; background: var(--absent); }
.mini-grid i.correct { background: var(--correct); }
.mini-grid i.present { background: var(--present); }
.mini-grid i.absent { background: var(--absent); opacity: .55; }
.pill { font-size: .8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.won { background: color-mix(in srgb, var(--correct) 18%, transparent); color: var(--correct); }
.pill.lost { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
:root[data-cb="1"] .pill.won { color: var(--ink); }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.league-title { margin-bottom: 4px; }
.members-list { list-style: none; margin: 0; padding: 0; }
.members-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.members-list li:first-child { border-top: 0; }
.members-list .grow small { color: var(--ink-2); display: block; font-size: .82rem; }

details.manage summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.manage summary::-webkit-details-marker { display: none; }
details.manage summary::after { content: "+"; font-size: 1.3rem; color: var(--ink-2); }
details.manage[open] summary::after { content: "–"; }
details.manage[open] summary { margin-bottom: 14px; }

.admin-table td, .admin-table th { font-size: .88rem; }
.badge { font-size: .7rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); margin-left: 4px; vertical-align: middle; }
.badge.admin { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.badge.off { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.copy-field { display: flex; gap: 8px; margin-top: 8px; }
.copy-field input { font-family: var(--mono); font-size: .82rem; }

.loading { display: flex; justify-content: center; padding: 48px 0; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.help-tiles { display: flex; gap: 4px; margin: 6px 0; }
.help-tiles .tile { width: 36px; height: 36px; font-size: 1.1rem; border-radius: 4px; }
.footer-note { text-align: center; margin-top: 32px; font-size: .82rem; color: var(--ink-2); }

.show-sm { display: none; }
@media (max-width: 520px) {
  main { padding: 14px 12px 32px; }
  .card { padding: 16px; }
  .key { height: 52px; font-size: .95rem; }
  .stat-grid .n { font-size: 1.5rem; }
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  .day-cell { width: 24px; height: 24px; font-size: .78rem; border-radius: 5px; }
  .board-table th.c, .board-table td.c { width: 26px; padding-left: 1px; padding-right: 1px; }
  .board-table th, .board-table td { padding-left: 4px; padding-right: 4px; }
}
@media (max-height: 640px) { .key { height: 46px; } .board { gap: 4px; } .board-row { gap: 4px; } }

/* ---------- logging results ---------- */
textarea, select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--ink); font: inherit;
}
textarea { min-height: 128px; resize: vertical; font-family: var(--mono); font-size: .92rem; line-height: 1.35; }
select { min-height: 44px; }
textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.preview { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 10px; background: var(--surface-2); }
.preview strong { display: block; }
.label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.score-picker { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.score-picker button {
  min-height: 46px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface);
  font-weight: 800; font-size: 1.05rem; cursor: pointer;
}
.score-picker button[aria-pressed="true"] { background: var(--correct); border-color: var(--correct); color: #fff; }
.score-picker button:last-child[aria-pressed="true"] { background: var(--absent); border-color: var(--absent); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; cursor: pointer; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }
details.manual { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
details.manual summary { cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--accent); }
.card.logged { border-color: color-mix(in srgb, var(--correct) 45%, var(--line)); }
.logged-title { font-weight: 800; font-size: 1.15rem; }
.big-score { width: 56px; height: 56px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.6rem; color: #fff; background: var(--correct); flex: none; }
.big-score.lost { background: var(--absent); }
.card .mini-grid { flex: none; }
.below-game { width: 100%; max-width: 760px; margin: 20px auto 0; }
.below-game:empty { display: none; }
main.game-main:not(.finished) .game { min-height: calc(100dvh - 110px); }
