:root { color-scheme: dark; --canvas: #121713; --surface: #1c241f; --surface-subtle: #273029; --surface-strong: #0d120f; --ink: #f0f2eb; --ink-muted: #9ba69d; --line: #313c34; --line-strong: #526057; --accent: #78a784; --accent-hover: #8ab896; --accent-soft: #26372c; --accent-ink: #dff0e2; --on-accent: #101712; --danger: #e37a70; --danger-fill: #963f38; --danger-soft: #3b2522; --focus: #75c7ee; --board-light: #e9edcc; --board-dark: #6f8f57; --board-last-move: rgb(255 206 60 / 0.5); --board-selected: rgb(20 85 30 / 0.45); --board-selected-ring: rgb(20 85 30 / 0.85); --board-premove: rgb(20 30 85 / 0.4); --board-hint: rgb(0 0 0 / 0.14); --board-hint-strong: rgb(0 0 0 / 0.5); --board-drop: rgb(0 0 0 / 0.12); --board-check: rgb(235 60 60 / 0.6); --board-coord: #9ba69d; --board-shadow: 0 4px 16px rgb(0 0 0 / 0.3); --board-edge: inset 0 0 0 1px rgb(0 0 0 / 0.18); --board-scrim: rgb(0 0 0 / 0.45); --board-focus: #0b1f3a; --board-focus-inner: #ffffff; --piece-white-fill: #f4f1ea; --piece-white-detail: #2b2b2b; --piece-black-fill: #1f1f1f; --piece-black-detail: #8a8a8a; --piece-shadow: rgb(0 0 0 / 0.35); --piece-ghost-shadow: rgb(0 0 0 / 0.45); --captured-halo: rgb(255 255 255 / 0.45); --piece-lift-shadow: rgb(0 0 0 / 0.4); --brush-green: #15781b; --brush-red: #882020; --brush-blue: #003088; --brush-yellow: #e68f00; --brush-green-soft: rgb(21 120 27 / 0.45); --brush-red-soft: rgb(136 32 32 / 0.45); --brush-blue-soft: rgb(0 48 136 / 0.45); --brush-yellow-soft: rgb(230 143 0 / 0.45); --board-gutter: 1.2rem; --turn-pulse: rgb(120 167 132 / 0.55); --radius-surface: 12px; --radius-control: 8px; --radius-item: 6px; --radius-pill: 999px; --move-row-stripe: rgb(255 255 255 / 0.025); --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24); --shadow-md: 0 18px 48px rgba(0, 0, 0, 0.28); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-synthesis: none; text-rendering: optimizeLegibility; }
*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); scrollbar-gutter: stable; }
body { min-height: 100vh; min-height: 100svh; margin: 0; color: var(--ink); background: var(--canvas); line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }
::selection { color: var(--on-accent); background: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1[tabindex="-1"]:focus-visible, h2[tabindex="-1"]:focus-visible { outline: 0; }
.visually-hidden, .status-announcement, .board-instructions, .dialog-focus-sentinel { width: 1px; height: 1px; overflow: hidden; padding: 0; position: absolute; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.shell { width: min(calc(100% - 2rem), 72rem); margin-inline: auto; }
.eyebrow, .section-label, .step, .system-label { margin-bottom: 0.65rem; color: var(--accent); font-size: 0.7rem; font-weight: 820; letter-spacing: 0.12em; text-transform: uppercase; }
.primary-action { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 1rem; padding: 0.7rem 1rem; color: var(--on-accent); border: 0; border-radius: var(--radius-control); background: var(--accent); font-weight: 800; text-decoration: none; cursor: pointer; transition: background 140ms ease, translate 140ms ease; }
.quiet-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0.6rem 0.85rem; color: var(--ink); border: 0; border-radius: var(--radius-control); background: var(--surface-subtle); font-size: 0.76rem; font-weight: 760; text-decoration: none; cursor: pointer; transition: background 140ms ease; }
.quiet-button.destructive { color: var(--danger); }
.primary-action.wide, .quiet-button.wide { width: 100%; }
.icon-button { width: 44px; height: 44px; display: grid; flex: 0 0 auto; place-items: center; margin: 0; padding: 0; color: var(--ink-muted); border: 0; border-radius: var(--radius-control); background: transparent; transition: background 140ms ease, color 140ms ease; }
.icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-button:disabled { opacity: 0.35; }
.history-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.25rem; }
.history-controls .icon-button { width: 100%; background: var(--surface-subtle); }
/* An unavailable step loses its fill as well as its contrast, so it reads as unavailable at a glance. */
.history-controls .icon-button:disabled { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.primary-action.wide { justify-content: space-between; }
.primary-action:disabled, .quiet-button:disabled { opacity: 0.6; }
.field { min-width: 0; margin: 0 0 0.85rem; padding: 0; border: 0; }
.field > label, .field > legend { display: block; margin-bottom: 0.45rem; color: var(--ink); font-size: 0.72rem; font-weight: 780; letter-spacing: 0.05em; text-transform: uppercase; }
.field > label small { color: var(--ink-muted); font-size: 0.64rem; font-weight: 600; }
.field input, .field textarea { width: 100%; min-height: 44px; padding: 0.62rem 0.75rem; color: var(--ink); border: 1px solid transparent; border-radius: var(--radius-control); outline: 0; background: var(--surface-subtle); transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-muted); }
.field input:focus, .field textarea:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--accent); }
.field input:user-invalid, .field input[aria-invalid="true"] { box-shadow: 0 0 0 2px var(--danger); }
.field input::file-selector-button { margin-right: 0.75rem; padding: 0.4rem 0.75rem; color: var(--ink); border: 0; border-radius: var(--radius-item); background: var(--surface); font: inherit; font-weight: 760; cursor: pointer; }
.field .choice-input, .choice-input { width: 1px; height: 1px; min-height: 0; overflow: hidden; padding: 0; position: absolute; clip-path: inset(50%); border: 0; white-space: nowrap; }
.choice-input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }
.setting-toggle { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0; padding: 0.45rem 0.65rem; color: var(--ink-muted); border: 1px solid transparent; border-radius: var(--radius-control); background: var(--surface-subtle); text-align: left; cursor: pointer; }
.setting-toggle > span:first-child { min-width: 0; display: grid; gap: 0.1rem; }
.setting-toggle strong { color: var(--ink); font-size: 0.72rem; }
.setting-toggle small { font-size: 0.62rem; line-height: 1.4; }
.switch-track { width: 34px; height: 20px; flex: 0 0 auto; padding: 2px; border-radius: var(--radius-pill); background: var(--line-strong); transition: background 140ms ease; }
.switch-track i { width: 16px; height: 16px; display: block; border-radius: 50%; background: var(--ink); transition: translate 140ms ease; }
.setting-toggle[aria-checked="true"] .switch-track, .choice-input:checked + .setting-toggle .switch-track { background: var(--accent); }
.setting-toggle[aria-checked="true"] .switch-track i, .choice-input:checked + .setting-toggle .switch-track i { translate: 14px 0; background: var(--on-accent); }
/* Move list: numbered rows of half-moves, the move on the board marked as the current step. Shared by the game room and replays. */
.move-rows { margin: 0; padding: 0; display: grid; list-style: none; }
.move-row { display: grid; grid-template-columns: 2rem minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 2px; padding: 1px; border-radius: var(--radius-item); }
.move-row:nth-child(even) { background: var(--move-row-stripe); }
.move-number { padding-left: 0.5rem; color: var(--ink-muted); font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.move { min-width: 0; min-height: 1.875rem; display: flex; align-items: center; margin: 0; padding: 0 0.625rem; overflow: hidden; color: var(--ink); border: 0; border-radius: var(--radius-item); background: transparent; font: inherit; font-size: 0.8125rem; font-variant-numeric: tabular-nums; font-weight: 600; text-align: left; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; transition: background 140ms ease, color 140ms ease; }
.move[aria-current="step"] { color: var(--accent-ink); background: var(--accent-soft); font-weight: 750; }
.privacy-note { margin: 0.6rem 0 0; color: var(--ink-muted); font-size: 0.66rem; text-align: center; }
.privacy-note span { color: var(--accent); }
.submit-error, .room-error { color: var(--danger); font-size: 0.78rem; line-height: 1.45; }
.system-page { min-height: calc(100vh - 188px); min-height: calc(100svh - 188px); display: grid; place-items: center; align-content: center; padding-block: 2.5rem; text-align: center; }
.system-card { width: min(100%, 36rem); padding: clamp(1.5rem, 7vw, 3rem); position: relative; overflow: hidden; border: 0; border-radius: var(--radius-surface); background: var(--surface); box-shadow: var(--shadow-md); }
.system-piece { position: absolute; top: -1.5rem; right: 0.5rem; color: var(--accent-soft); font-size: clamp(7rem, 28vw, 11rem); line-height: 1; pointer-events: none; }
.system-card h1 { max-width: 16ch; margin-bottom: 0.6rem; position: relative; font-size: clamp(1.8rem, 7.5vw, 3.2rem); font-weight: 760; letter-spacing: -0.045em; line-height: 1.04; }
.system-card > p:not(.system-label, .system-reference) { max-width: 46ch; margin-bottom: 1.35rem; position: relative; color: var(--ink-muted); }
.system-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; position: relative; }
.system-reference { display: grid; gap: 0.25rem; margin-bottom: 1.35rem; color: var(--ink-muted); font-size: 0.76rem; }
.system-reference span { font-weight: 750; }
.system-reference code { overflow-wrap: anywhere; color: var(--ink); }
@media (pointer: coarse) {
  .move { min-height: 44px; }
}
@media (hover: hover) {
  .move:hover:not([aria-current="step"]) { background: var(--surface-subtle); }
  .primary-action:hover:not(:disabled) { background: var(--accent-hover); translate: 0 -1px; }
  .quiet-button:hover:not(:disabled), .setting-toggle:hover { background: var(--accent-soft); }
  .quiet-button.destructive:hover:not(:disabled) { background: var(--danger-soft); }
  .icon-button:hover:not(:disabled) { color: var(--ink); background: var(--surface-subtle); }
  .history-controls .icon-button:hover:not(:disabled) { background: var(--accent-soft); }
}
@media (prefers-color-scheme: dark) {
  :root { --board-light: #d3d8b8; --board-dark: #60784b; --board-last-move: rgb(255 206 60 / 0.5); --board-selected: rgb(20 85 30 / 0.45); --board-selected-ring: rgb(20 85 30 / 0.85); --board-premove: rgb(20 30 85 / 0.4); --board-hint: rgb(0 0 0 / 0.16); --board-hint-strong: rgb(0 0 0 / 0.55); --board-drop: rgb(0 0 0 / 0.12); --board-check: rgb(235 60 60 / 0.6); --board-coord: #8c957f; --board-shadow: 0 4px 16px rgb(0 0 0 / 0.3); --board-edge: inset 0 0 0 1px rgb(0 0 0 / 0.18); --board-scrim: rgb(0 0 0 / 0.5); --board-focus: #0b1f3a; --board-focus-inner: #ffffff; --piece-white-fill: #f4f1ea; --piece-white-detail: #2b2b2b; --piece-black-fill: #1f1f1f; --piece-black-detail: #8a8a8a; --piece-shadow: rgb(0 0 0 / 0.35); --piece-ghost-shadow: rgb(0 0 0 / 0.45); --captured-halo: rgb(255 255 255 / 0.45); --piece-lift-shadow: rgb(0 0 0 / 0.4); }
}
/* Phones draw the coordinates inside the edge squares, so no gutter takes width from the board. */
@media (max-width: 34.999rem) {
  :root { --board-gutter: 0px; }
}
@media (min-width: 48rem) {
  :root { --board-gutter: 1.75rem; }
}
.share-panel { display: grid; gap: 0.6rem; }
.share-panel [hidden] { display: none; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.share-buttons > .quiet-button { flex: 1 1 0; }
.share-buttons .quiet-button[aria-disabled="true"] { opacity: 0.6; pointer-events: none; }
.share-progress { width: 100%; height: 6px; accent-color: var(--accent); }
.share-status { min-height: 1.2em; margin: 0; color: var(--ink-muted); font-size: 0.76rem; }
.share-status:empty { min-height: 0; }
.share-native { gap: 0.4rem; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media (prefers-contrast: more) {
  :root { --ink-muted: #cbd2cc; --line: #728077; --line-strong: #a7b1a9; --accent: #a0d0ab; --danger: #ff9d93; --focus: #a4ddf8; }
}
@media (forced-colors: active) {
  input, .quiet-button, .primary-action, .danger-action, .icon-button, .setting-toggle { border: 1px solid ButtonText; }
  .move[aria-current="step"] { outline: 2px solid Highlight; }
}
.mini-board { display: block; width: 100%; height: auto; border-radius: var(--radius-item); overflow: hidden; }
.mini-board .mini-light { fill: var(--board-light); }
.mini-board .mini-dark { fill: var(--board-dark); }
.mini-piece.white { fill: var(--piece-white-fill); color: var(--piece-white-detail); }
.mini-piece.black { fill: var(--piece-black-fill); color: var(--piece-black-detail); }
.text-button { justify-self: start; min-height: 44px; padding: 0; color: var(--ink-muted); border: 0; background: none; font: inherit; font-size: 0.74rem; font-weight: 650; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.text-button:hover { color: var(--ink); }
.text-button:disabled { cursor: default; opacity: 0.6; }
.piece-sprite { width: 0; height: 0; position: absolute; overflow: hidden; }
.danger-action { min-height: 44px; padding: 0.6rem 0.85rem; color: #ffffff; border: 0; border-radius: var(--radius-control); background: var(--danger-fill); font-size: 0.76rem; font-weight: 760; cursor: pointer; }
.danger-action:disabled { opacity: 0.6; cursor: default; }
[hidden] { display: none !important; }
.eval-bar { position: relative; overflow: hidden; border-radius: var(--radius-item); }
.eval-bar svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.eval-bar-black { fill: #1b1b1b; }
.eval-bar-white { fill: #f2f0e8; transition: y 220ms cubic-bezier(0.2, 0, 0, 1), height 220ms cubic-bezier(0.2, 0, 0, 1); }
.eval-bar-label { position: absolute; left: 0; right: 0; font-size: 0.55rem; font-weight: 800; text-align: center; writing-mode: vertical-rl; transform: rotate(180deg); }
.eval-bar-label.white { bottom: 0.3rem; color: #1b1b1b; }
.eval-bar-label.black { top: 0.3rem; color: #f2f0e8; }
@media (prefers-reduced-motion: reduce) { .eval-bar-white { transition: none; } }

/* Every page that runs the browser client shows this bar when the client fails; it stays hidden until Blazor reveals it. */
#blazor-error-ui { width: 100%; display: none; padding: 0.8rem 4rem 0.8rem 1rem; position: fixed; z-index: 1100; bottom: 0; left: 0; color: #ffffff; background: #7f302b; box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18); }
#blazor-error-ui a { color: inherit; font-weight: 800; }
#blazor-error-ui .dismiss { min-width: 44px; min-height: 44px; position: absolute; top: 50%; right: 0.5rem; translate: 0 -50%; color: #ffffff; border: 0; background: transparent; font-size: 1.4rem; }
