/* Chess Trainer — one stylesheet, no build step. */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #f0ede6;
  --ink: #1f2328;
  --ink-2: #57606a;
  --ink-3: #8a8f98;
  --line: #e2ddd3;
  --accent: #2f6f4f;
  --accent-ink: #ffffff;
  --accent-soft: #e3efe8;
  --good: #2f7d4f;
  --good-soft: #e4f3ea;
  --bad: #b3432f;
  --bad-soft: #f8e6e1;
  --warn: #9a6b00;
  --warn-soft: #fbf0d6;
  --review: #7a4fb0;
  --review-soft: #eee6f8;
  --sq-light: #f0d9b5;
  --sq-dark: #b58863;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  --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 {
    --bg: #16181b;
    --surface: #1f2226;
    --surface-2: #272b30;
    --ink: #e8e6e3;
    --ink-2: #aab1ba;
    --ink-3: #7d858f;
    --line: #33383e;
    --accent: #5fb487;
    --accent-ink: #0f1a14;
    --accent-soft: #1f3329;
    --good: #6cc18f;
    --good-soft: #1e3327;
    --bad: #ec8a74;
    --bad-soft: #3a231e;
    --warn: #e2b54f;
    --warn-soft: #3a3020;
    --review: #b893e6;
    --review-soft: #2e2540;
    --sq-light: #d9c3a0;
    --sq-dark: #9c7454;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: .5rem; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: 20px; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.num { font-variant-numeric: tabular-nums; }

/* ---- top bar ---- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 56px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.nav > a, .menu summary { color: var(--ink-2); text-decoration: none; padding: .4rem .7rem; border-radius: 8px; cursor: pointer; }
.nav > a:hover, .menu summary:hover { background: var(--surface-2); color: var(--ink); }
.nav > a[aria-current="page"] { color: var(--ink); background: var(--surface-2); font-weight: 600; }
.badge { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 99px; background: var(--review); color: #fff; font-size: .75rem; text-align: center; font-weight: 700; }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " ▾"; font-size: .8em; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .35rem; min-width: 190px; display: grid; }
.menu-pop a, .menu-pop .linklike { padding: .45rem .7rem; border-radius: 6px; color: var(--ink); text-decoration: none; text-align: left; }
.menu-pop a:hover, .menu-pop .linklike:hover { background: var(--surface-2); }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; width: 100%; }

main { padding-block: 28px 40px; }
.foot { color: var(--ink-3); font-size: .8rem; padding-block: 0 32px; }
.flash { background: var(--good-soft); color: var(--good); border-radius: var(--radius); padding: .6rem 1rem; margin-bottom: 1rem; }
.flash p { margin: 0; }

/* ---- generic pieces ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600; padding: .55rem 1rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; min-height: 40px; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; }
.btn.small { padding: .3rem .7rem; min-height: 32px; font-size: .875rem; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); }
.pill.solved { background: var(--good-soft); color: var(--good); }
.pill.failed { background: var(--bad-soft); color: var(--bad); }
.pill.review { background: var(--review-soft); color: var(--review); }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; }
.table-scroll { overflow-x: auto; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 0; }

/* ---- dashboard ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { font-size: .78rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat .value { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .82rem; color: var(--ink-2); }
.dash { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .dash { grid-template-columns: 1fr; } }
.continue { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.activity { display: flex; align-items: flex-end; gap: 3px; height: 110px; margin-top: 10px; }
.activity .day { flex: 1; display: flex; flex-direction: column-reverse; height: 100%; min-width: 4px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.activity .day .s { background: var(--good); }
.activity .day .f { background: var(--bad); opacity: .75; }
.legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--ink-2); margin-top: .5rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; }
.section-rows { display: grid; gap: 12px; }
.section-row { display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; align-items: center; text-decoration: none; color: inherit; padding: 8px 10px; margin: -8px -10px; border-radius: 8px; }
.section-row:hover { background: var(--surface-2); }
.section-row .bar { grid-column: 1 / -1; }
.recent li { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.recent { list-style: none; margin: 0; padding: 0; }

/* ---- section grid ---- */
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.cell { display: flex; align-items: center; justify-content: center; height: 36px; border-radius: 6px; font-size: .8rem; font-variant-numeric: tabular-nums; text-decoration: none; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); }
.cell:hover { border-color: var(--accent); color: var(--ink); }
.cell.solved { background: var(--good-soft); color: var(--good); border-color: transparent; }
.cell.failed { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.cell.review { background: var(--review-soft); color: var(--review); border-color: transparent; }
.cell.disabled { opacity: .35; text-decoration: line-through; }
.keyrow { display: flex; gap: .75rem; flex-wrap: wrap; margin: 10px 0 16px; }

/* ---- trainer ---- */
.trainer { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .trainer { grid-template-columns: 1fr; } }
.board-col { max-width: min(640px, calc(100vh - 150px)); width: 100%; margin-inline: auto; }
@media (max-width: 900px) { .board-col { max-width: 640px; } }
.board-tools { display: flex; align-items: center; gap: .5rem; margin-top: 10px; flex-wrap: wrap; }
.board-tools form { display: flex; gap: .4rem; flex: 1; min-width: 200px; }
.board-tools input { flex: 1; min-width: 0; font: inherit; font-family: var(--mono); padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.panel { display: grid; gap: 14px; }
.panel .card { padding: 16px 18px; }
.task { font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: .6rem; }
.turn-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink-2); flex: none; }
.turn-dot.white { background: #fff; }
.turn-dot.black { background: #222; }
.meta { display: flex; justify-content: space-between; gap: .5rem; color: var(--ink-2); font-size: .85rem; flex-wrap: wrap; }
.modes { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 9px; padding: 3px; }
.modes a { text-align: center; padding: .45rem .5rem; border-radius: 7px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .9rem; }
.modes a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.status { border-radius: 8px; padding: .65rem .85rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); min-height: 2.8em; }
.status.good { background: var(--good-soft); color: var(--good); }
.status.bad { background: var(--bad-soft); color: var(--bad); }
.status.warn { background: var(--warn-soft); color: var(--warn); }
.status.info { background: var(--accent-soft); color: var(--accent); }
.moves { font-family: var(--mono); font-size: .92rem; line-height: 1.9; min-height: 1.9em; word-break: break-word; }
.moves .mv { padding: .05rem .25rem; border-radius: 4px; }
.moves .mv.ok { background: var(--good-soft); color: var(--good); }
.moves .mv.bad { background: var(--bad-soft); color: var(--bad); }
.moves .mv.opp { color: var(--ink-2); }
.moves .no { color: var(--ink-3); margin-right: .15rem; }
.moves .placeholder { font-family: var(--font); color: var(--ink-2); font-size: .9rem; line-height: 1.5; }
.task-mobile { display: none; margin: 0 0 10px; font-weight: 700; align-items: center; gap: .5rem; }
@media (max-width: 900px) { .task-mobile { display: flex; } }
.timer { font-variant-numeric: tabular-nums; }
.solution { font-family: var(--mono); font-size: .92rem; line-height: 1.9; }
.solution button.mv { font: inherit; background: none; border: 0; padding: .05rem .25rem; border-radius: 4px; color: var(--ink); cursor: pointer; }
.solution button.mv:hover { background: var(--surface-2); }
.solution button.mv.current { background: var(--accent); color: var(--accent-ink); }
.solution button.mv.computed { color: var(--ink-2); font-style: italic; }
.solution .var { color: var(--ink-2); }
.solution .var button.mv { color: var(--ink-2); }
.solution .cmt { font-family: var(--font); color: var(--ink-3); font-size: .85rem; }
.solution .no { color: var(--ink-3); }
.viewer-nav { display: flex; gap: .35rem; margin-top: .5rem; }
.notes { font-size: .82rem; color: var(--ink-2); margin: .5rem 0 0; padding-left: 1.1rem; }
.lead { font-family: var(--mono); font-size: .85rem; color: var(--ink-2); max-height: 7.5em; overflow: auto; }
details.box > summary { cursor: pointer; font-weight: 600; }
kbd { font-family: var(--mono); font-size: .78rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 .3rem; background: var(--surface); }

/* ---- board ---- */
.cb { position: relative; width: 100%; aspect-ratio: 1; max-width: 100%; user-select: none; -webkit-user-select: none; touch-action: none; border-radius: 6px; overflow: hidden; box-shadow: var(--shadow); }
.cb-grid { display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); width: 100%; height: 100%; }
.cb-sq { position: relative; }
.cb-sq.l { background: var(--sq-light); }
.cb-sq.d { background: var(--sq-dark); }
.cb-sq.last::before { content: ""; position: absolute; inset: 0; background: rgba(155, 199, 0, .41); }
.cb-sq.sel::before { content: ""; position: absolute; inset: 0; background: rgba(20, 85, 30, .5); }
.cb-sq.hint::before { content: ""; position: absolute; inset: 0; background: rgba(40, 110, 220, .45); animation: pulse 1.2s ease-in-out 3; }
.cb-sq.check { background-image: radial-gradient(ellipse at center, rgba(255,0,0,1) 0%, rgba(231,0,0,1) 25%, rgba(169,0,0,0) 89%, rgba(158,0,0,0) 100%); }
.cb-sq.wrong::before { content: ""; position: absolute; inset: 0; background: rgba(200, 40, 20, .45); }
.cb-sq.dest::after { content: ""; position: absolute; left: 50%; top: 50%; width: 30%; height: 30%; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(20, 85, 30, .45); pointer-events: none; }
.cb-sq.dest.occ::after { width: 100%; height: 100%; background: radial-gradient(transparent 0 79%, rgba(20, 85, 30, .45) 80%); }
.cb-sq.hover { box-shadow: inset 0 0 0 4px rgba(255,255,255,.65); }
.cb-pc { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.cb-pc.anim { transition: transform .18s ease-out; }
.cb-pc.dragging { opacity: .35; }
.cb-ghost { position: fixed; pointer-events: none; z-index: 50; transform: translate(-50%, -50%); }
.cb-coord { position: absolute; font-size: clamp(8px, 1.6vw, 12px); font-weight: 700; z-index: 2; pointer-events: none; }
.cb-coord.file { right: 4%; bottom: 1%; }
.cb-coord.rank { left: 4%; top: 2%; }
.cb-sq.l .cb-coord { color: var(--sq-dark); }
.cb-sq.d .cb-coord { color: var(--sq-light); }
.cb.locked .cb-grid { cursor: default; }
.cb-promo { position: absolute; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 20; }
.cb-promo-box { display: flex; gap: 6px; background: var(--surface); padding: 8px; border-radius: 10px; box-shadow: var(--shadow); }
.cb-promo-box button { width: 64px; height: 64px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); cursor: pointer; padding: 4px; }
.cb-promo-box button:hover, .cb-promo-box button:focus-visible { background: var(--accent-soft); }
.cb-promo-box img { width: 100%; height: 100%; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .cb-pc.anim { transition: none; } .cb-sq.hint::before { animation: none; } }

/* ---- forms / auth ---- */
.auth { max-width: 400px; margin: 40px auto; }
.form-row { display: grid; gap: .3rem; margin-bottom: 1rem; }
.form-row label { font-weight: 600; font-size: .9rem; }
.form-row input[type=text], .form-row input[type=password] { font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.helptext, .form-row .help { font-size: .8rem; color: var(--ink-2); }
.errorlist { color: var(--bad); padding-left: 1rem; margin: .2rem 0; font-size: .85rem; }
.checks { display: grid; gap: .6rem; margin: 1rem 0; }
.checks label { display: flex; gap: .5rem; align-items: flex-start; }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
legend { font-weight: 700; margin-bottom: .4rem; }
.radio-cards ul, .radio-cards div { display: grid; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.radio-cards label { display: flex; gap: .5rem; align-items: center; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.empty { text-align: center; padding: 30px 10px; color: var(--ink-2); }
.pager { display: flex; gap: .5rem; align-items: center; justify-content: center; margin-top: 1rem; }

/* ---- openings ---- */
.mono { font-family: var(--mono); }
.tiny { font-size: .72rem; }
.lichess-card { margin-bottom: 16px; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.rep-head { display: flex; gap: .8rem; align-items: center; margin-bottom: .9rem; }
.rep-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: .8rem; }
.rep-stats > div { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.rep-stats .label { font-size: .72rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.rep-stats .value { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rep-stats .sub { font-size: .75rem; color: var(--ink-2); }
details.settings { margin-top: .9rem; border-top: 1px solid var(--line); padding-top: .6rem; }
details.settings summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.settings-form { margin-top: .6rem; }
.settings-form select { font: inherit; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chips label { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .55rem; border: 1px solid var(--line); border-radius: 99px; font-size: .82rem; cursor: pointer; }
.chips ul, .chips div { display: contents; }
.howto { margin: 0; padding-left: 1.2rem; display: grid; gap: .5rem; }
a.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.builder .board-col { max-width: min(600px, calc(100vh - 190px)); }
.line-card { margin-top: 12px; padding: 10px 14px; }
.line-label { margin-bottom: .2rem; }
#line button.mv { font: inherit; background: none; border: 0; padding: .05rem .25rem; border-radius: 4px; color: var(--ink); cursor: pointer; }
#line button.mv:hover { background: var(--surface-2); }
#line button.mv.current { background: var(--accent); color: var(--accent-ink); }
#line button.mv.ahead { color: var(--ink-3); }
#line button.mv.unsaved { text-decoration: underline dashed; text-underline-offset: 3px; }
.cov-head { display: flex; justify-content: space-between; align-items: flex-end; gap: .6rem; flex-wrap: wrap; }
.cov-head .label { font-size: .72rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.cov-value #cov-value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.gaps summary { cursor: pointer; color: var(--ink-2); margin-top: .4rem; }
.gaps-list { margin: .4rem 0 0; padding-left: 1.3rem; font-size: .85rem; display: grid; gap: .2rem; max-height: 14rem; overflow: auto; }
.gaps-list .linklike { width: auto; padding: 0; text-align: left; color: var(--accent); }
.tabs { display: flex; gap: .25rem; margin-bottom: .5rem; }
.tab { font: inherit; font-size: .85rem; font-weight: 600; padding: .3rem .7rem; border-radius: 7px; border: 1px solid transparent; background: none; color: var(--ink-2); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.moves-table td, .moves-table th { padding: .35rem .4rem; }
.moves-table tbody tr { cursor: pointer; }
.moves-table tbody tr:hover { background: var(--surface-2); }
.moves-table tr.in-rep td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.mv-btn { font: inherit; font-family: var(--mono); font-weight: 600; background: none; border: 0; padding: 0; color: var(--ink); cursor: pointer; }
.wdl { display: flex; height: 12px; min-width: 90px; border-radius: 3px; overflow: hidden; border: 1px solid var(--line); }
.wdl .w { background: #fafafa; }
.wdl .d { background: #a0a4aa; }
.wdl .b { background: #2b2d31; }
.engine-lines { margin-top: .5rem; display: grid; gap: .15rem; color: var(--ink-2); }
.engine-lines .eval { display: inline-block; min-width: 3.2em; font-weight: 700; color: var(--ink); }
.import-form { display: grid; gap: .5rem; margin-top: .6rem; }
.import-form textarea { font: inherit; font-family: var(--mono); font-size: .85rem; padding: .5rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); resize: vertical; }
.nowrap { white-space: nowrap; }
.panel { min-width: 0; }
.builder { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); }
@media (max-width: 900px) { .builder, .trainer { grid-template-columns: minmax(0, 1fr); } }
.panel { grid-template-columns: minmax(0, 1fr); } .panel > * { min-width: 0; }
@media (max-width: 480px) { .moves-table th:nth-child(3), .moves-table td:nth-child(3) { display: none; } }

/* ---- games ---- */
.game-view .board-col { max-width: min(600px, calc(100vh - 230px)); }
@media (max-width: 900px) { .game-view .board-col { max-width: 600px; } }
.player-strip { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: 6px 2px; font-size: .9rem; min-height: 2.2em; }
.player-strip .who { display: inline-flex; align-items: center; gap: .35rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-strip .clock { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 700; padding: .1rem .5rem; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); }
.player-strip .clock.on { background: var(--ink); color: var(--bg); }
.game-moves { max-height: 22rem; overflow: auto; font-family: var(--mono); font-size: .9rem; margin-top: .4rem; }
@media (max-width: 900px) { .game-moves { max-height: 16rem; } }
.game-moves .mrow { display: grid; grid-template-columns: 2.6em 1fr 1fr; align-items: stretch; }
.game-moves .mrow:nth-child(odd) { background: var(--surface-2); }
.game-moves .no { color: var(--ink-3); padding: .25rem .3rem; }
.game-moves .mv { font: inherit; display: flex; justify-content: space-between; align-items: baseline; gap: .3rem; background: none; border: 0; padding: .25rem .4rem; color: var(--ink); cursor: pointer; text-align: left; border-radius: 4px; }
.game-moves .mv:hover { background: var(--accent-soft); }
.game-moves .mv.current { background: var(--accent); color: var(--accent-ink); }
.game-moves .mv .t { font-size: .72rem; color: var(--ink-3); }
.game-moves .mv .t.long { color: var(--warn); font-weight: 700; }
.game-moves .mv.current .t { color: inherit; opacity: .8; }
.nag { margin-left: .1rem; font-weight: 700; }
.mv.inaccuracy .nag { color: #56b4e9; }
.mv.mistake .nag { color: #e69f00; }
.mv.blunder .nag { color: #df5353; }
.mv.current .nag { color: inherit; }
.nag-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .4rem; vertical-align: middle; }
.nag-dot.inaccuracy, .dot.inaccuracy { background: #56b4e9; fill: #56b4e9; }
.nag-dot.mistake, .dot.mistake { background: #e69f00; fill: #e69f00; }
.nag-dot.blunder, .dot.blunder { background: #df5353; fill: #df5353; }
.graph-wrap { margin-top: .6rem; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); cursor: pointer; }
.graph-wrap svg { display: block; width: 100%; height: 110px; }
.g-black { fill: #3b3d42; }
.g-white { fill: #f2f0ea; }
.g-mid { stroke: #9a9ca2; stroke-width: 1; stroke-dasharray: 3 3; }
.g-line { fill: none; stroke: #d49a2a; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.g-cursor { stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.dot { stroke: #fff; stroke-width: 1; vector-effect: non-scaling-stroke; }
.acc-line { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-top: .15rem; }
.acc-line .acc { display: inline-flex; align-items: center; gap: .25rem; font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.counts { margin-top: .5rem; font-size: .85rem; }
.counts td, .counts th { padding: .3rem .4rem; }
.game-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; margin-top: .6rem; }
.game-form .full { grid-column: 1 / -1; }
.game-form .form-row { margin-bottom: .6rem; }
.game-form input, .game-form select, .game-form textarea { font: inherit; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); width: 100%; min-width: 0; }
.delete-form { text-align: right; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.phone-card .continue { align-items: center; }
@media (max-width: 640px) { .hide-sm { display: none; } }
.rep-check .linklike.jump { display: inline; width: auto; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---- accounts (sign in, sign up, email, password) ---- */
.nav > a.nav-cta { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nav > a.nav-cta:hover { background: var(--accent); filter: brightness(1.07); color: var(--accent-ink); }
main.auth-page { max-width: 440px; margin-top: 36px; margin-bottom: 36px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding-block: 26px; }
@media (max-width: 480px) { main.auth-page { margin: 12px 10px 24px; width: auto; border-radius: 12px; } }
main.auth-page h1 { font-size: 1.5rem; margin: 0 0 .8rem; }
main.manage-page { max-width: 680px; }
.auth-h2 { font-size: 1.05rem; margin: 1.2rem 0 .5rem; }
.auth-p { margin: 0 0 1rem; line-height: 1.5; }
.auth-foot { margin: 1.1rem 0 0; font-size: .92rem; color: var(--ink-2); text-align: center; }
.auth-form { display: grid; gap: .15rem; }
.auth-form .form-row { margin-bottom: .75rem; }
.auth-form input[type=text], .auth-form input[type=email], .auth-form input[type=password], .auth-form input[type=number], .auth-form select {
  font: inherit; font-size: 16px; width: 100%; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); }
.auth-form input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.auth-form .check-row label { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.auth-form .has-error input { border-color: var(--bad); }
.auth-form .field-error { color: var(--bad); font-size: .85rem; }
.auth-form .help { font-size: .82rem; color: var(--ink-2); }
.auth-form .help ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.auth-form .help a { color: var(--ink-2); }
.form-errors { background: var(--bad-soft); color: var(--bad); border-radius: 9px; padding: .55rem .8rem; margin-bottom: .8rem; font-size: .9rem; }
.form-errors p { margin: 0; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .3rem; }
main.auth-page .form-actions .btn { width: 100%; }
.btn.big { min-height: 48px; font-size: 1rem; }
.providers { display: grid; gap: .5rem; }
.providers form { margin: 0; }
.provider-btn { width: 100%; gap: .6rem; background: var(--surface); }
.provider-btn .g-logo { flex-shrink: 0; }
.or { display: flex; align-items: center; gap: .8rem; color: var(--ink-3); font-size: .82rem; margin: 1.1rem 0; text-transform: uppercase; letter-spacing: .06em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.linklike.inline { width: auto; padding: 0; color: var(--accent); text-decoration: underline; }
.account-tabs { display: flex; gap: .25rem; flex-wrap: wrap; margin: 6px 0 18px; border-bottom: 1px solid var(--line); }
.account-tabs a { padding: .5rem .8rem; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: .92rem; }
.account-tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.manage-page .auth-form { max-width: 440px; }
.manage-page .auth-panel { margin-bottom: 14px; }
.manage-page table.list td:first-child { word-break: break-all; }
.manage-page .radio-list label, .manage-page .auth-form label:has(input[type=radio]) { font-weight: 500; }

/* ---- clubs ---- */
.club-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 18px; align-items: start; }
@media (max-width: 900px) { .club-grid { grid-template-columns: minmax(0, 1fr); } }
.club-grid > .panel { display: grid; gap: 14px; }
.card-title { font-size: 1.05rem; margin: 0 0 .6rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.club-row { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.club-row:last-child { border-bottom: 0; }
.club-row .pill { margin-left: .3rem; }
.h2h-row { display: flex; justify-content: space-between; gap: .5rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.h2h-row:last-child { border-bottom: 0; }
.search-row { display: flex; gap: .5rem; margin-bottom: .6rem; }
.search-row input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.copy-row { display: flex; gap: .4rem; }
.copy-row input { flex: 1; min-width: 0; font-family: var(--mono); font-size: .8rem; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.club-tabs { margin-top: 0; }
.member-menu { position: relative; }
.member-menu summary { list-style: none; }
.member-menu summary::-webkit-details-marker { display: none; }
.member-menu .menu-pop form { margin: 0; }
.member-menu .linklike { text-align: left; padding: .45rem .6rem; border-radius: 6px; }
.member-menu .linklike:hover { background: var(--surface-2); }
table.standings tr.me td { background: var(--accent-soft); }
a.plain { color: inherit; text-decoration: none; }
a.plain:hover { text-decoration: underline; }
.radio-list { display: grid; gap: .35rem; }
.radio-list label { display: flex; gap: .5rem; align-items: flex-start; font-weight: 500; font-size: .92rem; }
.club-form textarea, .auth-form textarea { font: inherit; width: 100%; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); }
.share-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.share-form { display: grid; gap: .5rem; margin-top: .6rem; }
.share-form select { font: inherit; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); max-width: 100%; }
.share-tags { display: grid; gap: .4rem; }
.share-tags label { display: flex; align-items: center; gap: .4rem; }
.share-tags select { flex: 1; min-width: 0; }
.banner { background: var(--accent-soft); color: var(--ink); border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: 1rem; display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
@media (max-width: 640px) {
  .topbar-inner { gap: .3rem; padding-block: 6px; }
  .nav { gap: .1rem; }
  .nav > a, .menu summary { padding: .3rem .45rem; font-size: .88rem; }
  .club-tabs a { padding: .45rem .55rem; font-size: .88rem; }
}

/* ---- long-form pages (privacy) ---- */
main.prose-page { max-width: 760px; }
.prose { line-height: 1.6; }
.prose h1 { margin-bottom: .2rem; }
.prose h2 { font-size: 1.2rem; margin: 1.8rem 0 .5rem; }
.prose h3 { font-size: 1rem; margin: 1.2rem 0 .3rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: .25rem 0; }
.foot a { color: var(--ink-2); }
.prose address.contact { font-style: normal; line-height: 1.7; }
.flash .msg-error { color: var(--bad); }
