
/* Ballpark: crisp light ground, one stadium-seat blue, cards you can pick up.
   Layout: one centered column on phones; on desktop the game splits into clue | cards. */
:root {
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --ink: #14161B;
  --ink-2: #3A3F4B;
  --muted: #5B6170;
  --line: #E3E6EC;
  --chip: #F0F2F6;
  --accent: #2450D6;
  --accent-ink: #FFFFFF;
  --exact: #17804A;
  --off1: #F2C230;
  --off2: #F08A3C;
  --off3: #C93A34;
  --shadow: 0 10px 30px rgba(20,22,27,0.07);
  --lift: 0 16px 34px rgba(20,22,27,0.18);
  --display: 'Bricolage Grotesque', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1115; --surface: #171A21; --ink: #F2F4F8; --ink-2: #C9CED8; --muted: #9AA1B0;
    --line: #2A2F3A; --chip: #222733; --accent: #5B82F0; --accent-ink: #0B0E14;
    --shadow: 0 10px 30px rgba(0,0,0,0.35); --lift: 0 16px 34px rgba(0,0,0,0.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1115; --surface: #171A21; --ink: #F2F4F8; --ink-2: #C9CED8; --muted: #9AA1B0;
  --line: #2A2F3A; --chip: #222733; --accent: #5B82F0; --accent-ink: #0B0E14;
  --shadow: 0 10px 30px rgba(0,0,0,0.35); --lift: 0 16px 34px rgba(0,0,0,0.55);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); }
body { min-height: 100vh; }
button, a { font-family: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
header.top { background: var(--surface); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.logo { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 0; }
.logo span { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -0.5px; }
.pill { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; background: var(--surface); color: var(--ink); }
.linkbtn { white-space: nowrap; background: none; border: 0; color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer; padding: 8px; }
main { padding: 24px 0 64px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; }
.hero { padding: 24px; box-shadow: var(--shadow); display: flex; flex-wrap: wrap; gap: 28px; }
.hero > div { flex: 1 1 300px; display: flex; flex-direction: column; gap: 14px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.6px; color: var(--muted); text-transform: uppercase; }
.clue { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(40px, 7vw, 68px); line-height: 1; letter-spacing: -1.5px; }
.lede { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink-2); max-width: 46ch; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px; border-radius: 14px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 17px; cursor: pointer; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.outline { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.block { width: 100%; }
.preview { display: flex; flex-direction: column; gap: 8px; }
.preview div { height: 48px; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; padding: 0 16px; font-weight: 700; background: var(--bg); }
.section { margin-top: 32px; display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.section-head h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 26px; }
.section-head span { font-size: 14px; color: var(--muted); }
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mode { padding: 18px; display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer; color: var(--ink); }
.mode:hover { border-color: var(--accent); }
.mode b { font-family: var(--display); font-weight: 800; font-size: 22px; }
.mode span { font-size: 13px; line-height: 1.4; color: var(--muted); }
.intro { margin: 8px 0 22px; }
.intro h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(30px, 5vw, 44px); line-height: 1.05; letter-spacing: -1px; }
.intro p { margin: 6px 0 0; font-size: 17px; color: var(--ink-2); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tile { padding: 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); min-height: 300px; }
.tile-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.tile .clue { font-size: clamp(38px, 5.5vw, 56px); }
.tile-title { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(28px, 4vw, 38px); line-height: 1.05; }
.tile-foot { display: flex; flex-direction: column; gap: 8px; }
.tile-daily { border: 2px solid var(--accent); }
.archive-card { margin-top: 16px; display: flex; align-items: center; gap: 20px; padding: 20px 24px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
.archive-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.archive-card .stack { position: relative; width: 74px; height: 64px; flex: none; }
.archive-card .stack span { position: absolute; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.archive-card .stack span:nth-child(1) { left: 0; top: 12px; transform: rotate(-8deg); background: var(--bg); }
.archive-card .stack span:nth-child(2) { left: 11px; top: 6px; transform: rotate(-3deg); color: var(--ink-2); }
.archive-card .stack span:nth-child(3) { left: 22px; top: 0; background: var(--accent); border-color: var(--accent); color: #fff; font-size: 15px; }
.archive-text { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.archive-text b { font-family: var(--display); font-weight: 800; font-size: 22px; }
.archive-text span { color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.archive-go { flex: none; white-space: nowrap; }
@media (max-width: 640px) { .archive-card { flex-wrap: wrap; padding: 20px; } .archive-go { width: 100%; justify-content: center; } }
.statstrip { margin-top: 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 14px 8px; }
.statstrip div { display: flex; flex-direction: column; align-items: center; gap: 2px; border-right: 1px solid var(--line); }
.statstrip div:last-child { border-right: 0; }
.statstrip b { font-family: var(--display); font-weight: 800; font-size: 26px; font-variant-numeric: tabular-nums; }
.statstrip span { font-size: 12px; color: var(--muted); }
.back { padding: 8px 0; margin-top: 4px; }
@media (max-width: 760px) { .tiles { grid-template-columns: minmax(0, 1fr); } .tile { min-height: 0; } }
.picker { padding: 20px; display: flex; flex-direction: column; gap: 18px; box-shadow: var(--shadow); }
.picker-row { display: flex; flex-direction: column; gap: 10px; }
.picker-label { font-size: 12px; font-weight: 700; letter-spacing: 0.6px; color: var(--muted); }
.seg { display: inline-grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--chip); border-radius: 14px; padding: 4px; gap: 4px; max-width: 420px; width: 100%; }
.seg button { min-height: 52px; border: 0; border-radius: 11px; background: transparent; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 6px; }
.seg button b { font-family: var(--display); font-weight: 800; font-size: 18px; }
.seg button span { font-size: 12px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 2px 8px rgba(20,22,27,0.12); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.chips button small { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.chips button:hover { border-color: var(--accent); }
.chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chips button[aria-pressed="true"] small { color: var(--accent-ink); opacity: 0.85; }
.picker-go { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 16px; }
.stat b { display: block; font-family: var(--display); font-weight: 800; font-size: 30px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.soon { padding: 16px 18px; display: flex; align-items: center; gap: 12px; }
.soon div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.soon b { font-family: var(--display); font-weight: 800; font-size: 20px; }
.soon span { font-size: 13px; color: var(--ink-2); }
.tag { font-size: 11px; font-weight: 700; letter-spacing: 0.4px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.tag.accent { color: var(--accent); border-color: var(--accent); }

/* Game */
.game { padding: 24px; box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "left right" "lock right"; column-gap: 32px; row-gap: 20px; }
.game .left { grid-area: left; display: flex; flex-direction: column; gap: 14px; }
.game .right { grid-area: right; display: flex; flex-direction: column; gap: 10px; }
.game .lock { grid-area: lock; align-self: end; }
@media (max-width: 760px) { .game { grid-template-columns: minmax(0, 1fr); grid-template-areas: "left" "right" "lock"; } }
.statline { font-family: var(--display); font-weight: 800; font-size: clamp(28px, 4.5vw, 40px); line-height: 1.05; margin: 0; }
.hint { font-size: 15px; color: var(--ink); background: var(--chip); border-radius: 12px; padding: 12px 14px; }
.ends { font-size: 12px; font-weight: 700; letter-spacing: 0.6px; color: var(--muted); }
ol.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
ol.rank li { position: relative; display: flex; align-items: center; gap: 14px; min-height: 62px; padding: 8px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }
ol.rank li.dragging { cursor: grabbing; z-index: 5; box-shadow: var(--lift); border: 2px solid var(--accent); transition: box-shadow 160ms ease; }
ol.rank li.selected { border: 2px solid var(--accent); }
ol.rank li .num { width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--chip); display: flex; align-items: center; justify-content: center; font-weight: 700; font-variant-numeric: tabular-nums; }
ol.rank li .name { flex: 1; font-weight: 700; font-size: 18px; line-height: 1.2; }
ol.rank li svg { flex: none; color: var(--muted); }
.tip { font-size: 13px; color: var(--muted); }

/* Results */
.results { padding: 24px; box-shadow: var(--shadow); display: flex; flex-wrap: wrap; gap: 32px; }
.results .left { flex: 1 1 300px; display: flex; flex-direction: column; gap: 16px; }
.results .right { flex: 1 1 340px; display: flex; flex-direction: column; }
.score { display: flex; align-items: baseline; gap: 6px; }
.score b { font-family: var(--display); font-weight: 800; font-size: clamp(72px, 12vw, 112px); line-height: 0.85; letter-spacing: -3px; font-variant-numeric: tabular-nums; }
.score span { font-size: 22px; font-weight: 700; color: var(--muted); }
.squares { display: flex; gap: 6px; }
.squares i { width: 26px; height: 26px; border-radius: 7px; display: block; }
.reveal { background: var(--accent); color: var(--accent-ink); border-radius: 18px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.reveal small { font-size: 12px; font-weight: 700; letter-spacing: 0.6px; opacity: 0.85; }
.reveal b { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.1; }
.reveal span { font-size: 13px; opacity: 0.9; }
.dyk { border: 1.5px dashed var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.dyk small { font-size: 12px; font-weight: 700; letter-spacing: 0.6px; color: var(--accent); }
.dyk p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); opacity: 0; transform: translateY(6px); animation: rowIn 380ms ease forwards; }
.row:last-child { border-bottom: 0; }
.row .r { width: 22px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.row .n { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.row .n b { font-size: 17px; }
.row .n span { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chipr { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
@keyframes rowIn { to { opacity: 1; transform: none; } }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.actions .btn { flex: 1 1 150px; }
.note { font-size: 13px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 200ms; }
.toast.show { opacity: 1; }
.acctbtn { width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: inline-grid; place-items: center; cursor: pointer; }
.acctbtn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.syncline { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; font-size: 14px; color: var(--muted); }
.syncline .linkbtn { font-size: 14px; color: var(--accent); padding: 4px 2px; }
.synced { display: inline-flex; align-items: center; gap: 6px; }
.tabs2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg); border-radius: 14px; }
.tabs2 button { min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font: inherit; font-weight: 700; cursor: pointer; }
.tabs2 button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field input { height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.formerr { color: #D93F3F; font-size: 14px; min-height: 0; margin: 0; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.dlg-actions .btn { min-height: 48px; font-size: 16px; }
.dlg-actions .btn.block { flex: 1; }
.dangerlink { color: #D93F3F !important; }
dialog { border: 1px solid var(--line); border-radius: 22px; padding: 0; max-width: 520px; width: calc(100% - 32px); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(10,12,16,0.5); }
dialog .inner { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
dialog h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 28px; }
dialog p, dialog li { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
dialog ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
footer { padding: 24px 16px 40px; font-size: 12px; color: var(--muted); text-align: center; display: flex; flex-direction: column; gap: 10px; }
.foot { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; }
.foot a { color: var(--ink-2); font-size: 14px; font-weight: 700; text-decoration: none; padding: 6px 2px; }
.foot a:hover { color: var(--accent); }
.page { max-width: 68ch; padding: 28px; box-shadow: var(--shadow); }
.page h1 { margin: 0 0 6px; font-family: var(--display); font-weight: 800; font-size: clamp(32px, 5vw, 44px); line-height: 1.05; }
.page h2 { margin: 26px 0 8px; font-family: var(--display); font-weight: 800; font-size: 22px; }
.page p, .page li { font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.page p { margin: 0 0 12px; }
.page ul { margin: 0 0 12px; padding-left: 20px; }
.page a { color: var(--accent); }
.page .updated { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.ph { background: var(--chip); border-radius: 6px; padding: 1px 6px; font-weight: 700; color: var(--ink); }
@media (max-width: 560px) {
  .picker { padding: 16px; }
  .chips button { min-height: 40px; padding: 0 13px; font-size: 14px; }
  .picker-go .btn { width: 100%; }
  .wide { display: none; }
  .logo span { font-size: 22px; }
  .hero, .game, .results { padding: 18px; border-radius: 18px; }
  .modes { gap: 8px; }
  .mode { padding: 14px 12px; }
  .mode b { font-size: 19px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding-top: 16px; }
  .game { gap: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .row { animation: none; opacity: 1; transform: none; }
  ol.rank li { transition: none; }
}

.page-wrap { padding: 24px 0 64px; }
.page { margin: 0 auto; }
.top a.logo { text-decoration: none; }
.top .play { text-decoration: none; }
.archive { list-style: none; padding: 0; margin: 0; }
.archive li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.archive a { font-weight: 700; text-decoration: none; }
.answer { list-style: none; padding: 0; margin: 8px 0 16px; counter-reset: r; }
.answer li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.answer li span:first-child::before { counter-increment: r; content: counter(r) ". "; color: var(--muted); }
.answer li span:last-child { font-weight: 700; white-space: nowrap; }
.cta { display: inline-flex; margin-top: 8px; text-decoration: none; }
.page a.btn { color: var(--accent-ink); }
.page a.btn.outline { color: var(--accent); }
