/* Shared interface. Game pieces keep their own geometry and semantic colors. */
:root {
  --ui-bg: #f6f7fc;
  --ui-surface: #ffffff;
  --ui-soft: #eef1f8;
  --ui-ink: #1d2639;
  --ui-muted: #626e83;
  --ui-line: #e0e5f0;
  --ui-strong: #9aa8c0;
  --ui-accent: var(--ui-game-light, #6950c8);
  --ui-accent-soft: color-mix(in srgb, var(--ui-accent) 9%, var(--ui-surface));
  --ui-on-accent: #ffffff;
  --ui-danger: #b33232;
  --ui-success: #286442;
  --ui-shadow: 0 16px 44px #25345b12;
  --ui-display-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --ui-mono-font: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --ui-feature-bg: #33236b;
  --ui-feature-ink: #ffffff;
  --ui-feature-muted: #d4d0f2;
  --ui-feature-line: #7c6dad;
  --ui-feature-accent: #eee9ff;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ui-bg: #111521;
  --ui-surface: #1c2232;
  --ui-soft: #252e42;
  --ui-ink: #f4f6ff;
  --ui-muted: #adb9d0;
  --ui-line: #36415a;
  --ui-strong: #788aa8;
  --ui-accent: var(--ui-game-dark, #bcabff);
  --ui-accent-soft: color-mix(in srgb, var(--ui-accent) 12%, var(--ui-surface));
  --ui-on-accent: #151b2b;
  --ui-danger: #ff9a96;
  --ui-success: #8bccaa;
  --ui-shadow: 0 18px 48px #00000038;
  color-scheme: dark;
}
:root, :root[data-theme], :root[data-game], :root[data-social-game],
:root[data-theme][data-game], :root[data-theme][data-social-game],
:root body, :root body[data-game], :root[data-theme] body[data-game] {
  --bg: var(--ui-bg);
  --paper: var(--ui-bg);
  --surface: var(--ui-surface);
  --surface-soft: var(--ui-soft);
  --surface-raised: var(--ui-surface);
  --panel: var(--ui-surface);
  --panel-solid: var(--ui-surface);
  --soft: var(--ui-soft);
  --header: var(--ui-surface);
  --ink: var(--ui-ink);
  --muted: var(--ui-muted);
  --line: var(--ui-line);
  --line-strong: var(--ui-strong);
  --accent: var(--ui-accent);
  --accent-strong: var(--ui-accent);
  --accent-soft: var(--ui-accent-soft);
  --accent-contrast: var(--ui-on-accent);
  --game-accent-ink: var(--ui-on-accent);
  --pill: var(--ui-soft);
  --danger: var(--ui-danger);
  --success: var(--ui-success);
  --shadow: var(--ui-shadow);
  --shadow-sm: 0 3px 12px #17244908;
  --shadow-lg: var(--ui-shadow);
  --radius: 16px;
  --text: var(--ui-ink);
  --text-dim: var(--ui-muted);
}
:root body {
  color: var(--ui-ink);
  background: var(--ui-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
:root body::before, :root body::after { display: none; }
:root body :is(h1, h2, h3, h4) { font-family: var(--ui-display-font); font-weight: 700; letter-spacing: -.035em; }
:root body :is(button, input, select, textarea) { font-family: inherit; }
:root body :is(button, summary, .game-switcher-button, .primary-nav a) { border-radius: 4px; }
:root body :is(button, .btn, .btn-outline, .button, .chip) { font-weight: 600; }
:root body :is(b, strong) { font-weight: 650; }
:root body :is(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--ui-accent);
  outline-offset: 3px;
}
:root body :is(.page-eyebrow, .eyebrow, .eyebrow-label, .banner-kicker, .game-dropdown-label) {
  color: var(--ui-accent); font-family: var(--ui-mono-font); font-size: 10px; font-weight: 600; letter-spacing: .1em;
}
:root body :is(.topbar, .site-header) {
  background: var(--ui-surface);
  border-bottom: 1px solid var(--ui-line);
  box-shadow: none;
  backdrop-filter: none;
}
:root body .topbar { min-height: 64px; }
:root body :is(.brand, .game-switcher) { font-weight: 650; letter-spacing: -.02em; }
:root body :is(.game-switcher, .brand .logo, .brand-game-icon, .game-dropdown) {
  border-radius: 4px; box-shadow: none; filter: none;
}
:root body .game-dropdown { background: var(--ui-surface); box-shadow: var(--ui-shadow); }
/* A compact game directory with an unmistakable current location. */
:root body .game-dropdown {
  width: min(340px, calc(100vw - 16px)); padding: 8px;
  border-color: var(--ui-strong);
}
:root body .game-dropdown-label { padding: 7px 10px 9px; }
:root body .game-dropdown-list { gap: 3px; }
:root body .game-dropdown-item {
  min-height: 56px; grid-template-columns: 32px minmax(0, 1fr) auto;
  padding: 9px; gap: 10px; border: 1px solid transparent;
}
:root body .game-dropdown-item[aria-current="page"] {
  background: var(--ui-accent-soft); border-color: var(--ui-line);
  box-shadow: inset 3px 0 var(--ui-accent);
}
:root body .game-dropdown-item:hover,
:root body .game-dropdown-item:focus-visible {
  background: var(--ui-soft); border-color: var(--ui-strong);
}
:root body .game-dropdown-icon { width: 32px; height: 32px; border-radius: 4px; }
:root body .game-dropdown-copy { gap: 3px; }
:root body .game-dropdown-copy strong { font-size: 14px; font-weight: 650; line-height: 1.2; }
:root body .game-dropdown-copy small { font-size: 11px; font-weight: 400; line-height: 1.35; white-space: normal; }
:root body .game-current-indicator {
  padding: 4px 5px; border: 0; border-radius: 3px;
  color: var(--ui-on-accent); background: var(--ui-accent);
  font-size: 9px; font-weight: 650; letter-spacing: .02em;
}
:root body .game-dropdown-more { background: var(--ui-soft); border-color: var(--ui-line); }
@media (max-width: 680px) {
  :root body .topbar .game-dropdown {
    width: calc(100vw - 16px); top: calc(100% + 66px);
    max-height: calc(100dvh - 129px);
  }
}
:root body :is(.tabs, .nav-tabs, .directory-tabs, .main-nav) {
  border-radius: 4px; background: var(--ui-soft); box-shadow: none;
}
:root body .primary-nav { border-radius: 4px; background: var(--ui-soft); border: 1px solid var(--ui-line); box-shadow: none; }
:root body .primary-nav a { border-radius: 2px; font-weight: 600; box-shadow: none; }
:root body .primary-nav a[aria-current="page"] { color: var(--ui-accent); background: var(--ui-surface); box-shadow: none; }
:root body :is(.account-button, .theme-toggle, .choice, .rating-mode-tag, .pill-btn,
  .duel-visibility-option, .duel-rated-option, .random-choice, .random-option,
  .random-setting-option, .duel-settings-toggle, .rush-mode-option) { border-radius: 4px; box-shadow: none; }
:root body .choice:focus-within { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
:root body :is(.duel-page-guide, .duel-page-guide > span, .duel-visibility > span,
  .duel-rating-note, .duel-target-field, .duel-advanced, .setup-rule-choice,
  .rush-duel-cta, .connection-quality, .arena-counts span, .rating-mode-pill) {
  border-radius: 4px; box-shadow: none;
}
:root body .rush-duel-cta { background: var(--ui-surface); border-color: var(--ui-line); }
:root body :is(.tabs a, .nav-tabs a, .directory-tab, .main-nav a, .account-link) {
  border-radius: 2px; font-weight: 600; box-shadow: none;
}
:root body :is(.tabs a.active, .nav-tabs a.active, .directory-tab.active) {
  color: var(--ui-accent); background: var(--ui-surface); box-shadow: none;
}
:root body :is(.page, .table-view) { animation: none; }
:root body .page { padding-top: 28px; }
:root body .page-heading { align-items: center; margin-bottom: 24px; }
:root body .page-heading h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; }
:root body :is(.page-heading .sub, .panel-sub, .hero-subtitle) { color: var(--ui-muted); }

/* Rectangular controls and a single, consistent surface hierarchy. */
:root body :is(.btn, .btn-outline, .button, .chip, .account-nav, .theme-btn,
  .icon-btn, .hub-theme-button, .filter-chip, .lobby-code, .today-tag,
  .pill, .badge, .source-badge, .visibility-badge, .game-dropdown-item,
  .logic-cookie-button, .logic-cookie-settings, .mini-sudoku-keypad button,
  .mini-sudoku-tools button, .minesweeper-mode-button) {
  border-radius: 4px;
  box-shadow: none;
  text-shadow: none;
}
:root body :is(.btn, .button.primary, .daily-mix-action) {
  color: var(--ui-on-accent); background: var(--ui-accent); border-color: var(--ui-accent);
}
:root body :is(.btn.secondary, .btn-outline, .button:not(.primary), .account-nav,
  .chip, .theme-btn, .hub-theme-button) {
  color: var(--ui-ink); background: var(--ui-surface); border: 1px solid var(--ui-line);
}
:root body :is(.chip.active, .chip.selected, .chip[aria-pressed="true"]) {
  color: var(--ui-accent); background: var(--ui-accent-soft); border-color: var(--ui-accent);
}
:root body :is(.btn, .button, .btn-outline, .chip, .account-nav, .theme-btn):hover {
  transform: none; filter: none; box-shadow: none;
}
:root body :is(.btn, .button, .btn-outline):hover:not(:disabled) { filter: brightness(.94); }
:root body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
  color: var(--ui-ink); background-color: var(--ui-surface);
  border-color: var(--ui-line); border-radius: 4px; box-shadow: none;
}
:root body input::placeholder, :root body textarea::placeholder { color: var(--ui-muted); opacity: 1; }
:root body :is(.day-card, .pz-card, .stat-card, .heading-badge, .filters,
  .random-panel, .random-panel-head, .daily-card, .daily-summary, .daily-run-card,
  .duel-card, .duel-create-card, .duel-form-card, .match-directory, .directory-panel,
  .duel-create-panel, .arena-directory, .arena-match, .arena-empty, .arena-rating-board,
  .duel-form-head, .duel-create-footer, .duel-puzzle-settings,
  .leaderboard-card, .leaderboard-panel, .duel-leaderboard, .rush-card, .rush-panel,
  .rush-create-card, .rush-lobby-card, .rush-room-card, .rush-empty,
  .auth-card, .auth-form-panel, .account-card, .profile-card,
  .panel, .lobby-seat, .table-banner, .table-card, .empty-state, .empty-page,
  .howto-guide, .howto-step, .howto-preview,
  .modal, .modal-card, .logic-cookie-card) {
  color: var(--ui-ink); background: var(--ui-surface); border: 1px solid var(--ui-line);
  border-radius: 4px; box-shadow: none; backdrop-filter: none;
}
:root body :is(.day-card, .pz-card, .table-card):hover { transform: none; border-color: var(--ui-strong); box-shadow: none; }
:root body :is(.duel-form-head, .duel-create-footer) { border: 0; border-radius: 0; }
:root body .duel-form-head { border-bottom: 1px solid var(--ui-line); }
:root body .duel-create-footer { border-top: 1px solid var(--ui-line); }
:root body .day-card::after, :root body .pz-mystery::after,
:root body :is(.random-visual, .daily-hero, .auth-intro)::before,
:root body :is(.random-visual, .daily-hero, .auth-intro)::after { display: none; }
:root body .day-card { min-height: 190px; padding: 18px; }
:root body .day-card.today { border-color: var(--ui-accent); box-shadow: inset 3px 0 var(--ui-accent); }
:root body .day-card.any-day { color: var(--ui-ink); background: var(--ui-soft); border-color: var(--ui-line); }
:root body .day-card.any-day :is(.day-meta, .crowns) { color: var(--ui-muted) !important; }
:root body .day-card.any-day .btn { color: var(--ui-on-accent); background: var(--ui-accent); }
:root body .day-card.any-day .btn.secondary { color: var(--ui-ink); background: var(--ui-surface); }
:root body :is(.progress, .progress > div) { border-radius: 1px; }
:root body .progress > div { background: var(--ui-accent); }
:root body :is(.random-visual, .daily-hero, .profile-hero, .auth-intro, .watch-summary,
  .hero, .tables-hero, .rush-hero, .duel-hero) {
  color: var(--ui-ink); background: var(--ui-surface); border: 1px solid var(--ui-line);
  border-radius: 4px; box-shadow: none;
}
:root body :is(.random-visual, .daily-hero, .profile-hero, .auth-intro, .watch-summary,
  .hero, .tables-hero, .rush-hero, .duel-hero) :is(p, small, .sub) { color: var(--ui-muted); }
:root body :is(.daily-hero, .auth-intro, .profile-hero) :is(h1, h2, h3) { color: var(--ui-ink); }
:root body .modal { box-shadow: var(--ui-shadow); }
:root body[data-game] :is(.random-visual, .daily-hero, .profile-hero, .auth-intro, .watch-summary) {
  color: var(--ui-ink); background: var(--ui-surface); border-color: var(--ui-line); box-shadow: none;
}
:root body[data-game] :is(.daily-kicker, .daily-action small, .daily-code) { color: var(--ui-muted); }
:root body[data-game] .daily-action .btn { color: var(--ui-on-accent); background: var(--ui-accent); border-color: var(--ui-accent); }
:root body :is(.daily-code, .daily-empty) { background: var(--ui-soft); border-color: var(--ui-line); border-radius: 4px; }
:root body :is(.daily-standings, .stats-leaderboard-hub, .stats-leaderboard-link,
  .full-leaderboard-panel, .practice-nav-action) {
  color: var(--ui-ink); background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: 4px; box-shadow: none;
}
:root body .practice-nav-icon { border-radius: 3px; box-shadow: none; }
:root body .auth-intro { display: none; }
:root body .auth-page { width: min(100%, 460px); grid-template-columns: minmax(0, 1fr); }
:root body .auth-guest-note { width: min(100%, 460px); }
:root body .logic-cookie-card { box-shadow: var(--ui-shadow); grid-template-columns: minmax(0, 1fr); }
:root body .logic-cookie-art { display: none; }
:root body .logic-cookie-copy { grid-column: 1; }

/* The board is the focus; its surround should not compete with it. */
:root body[data-game] #view-game { background: transparent; }
:root body[data-game] #view-game :is(.g-header, .g-bar) {
  color: var(--ui-ink); background: var(--ui-surface); border: 1px solid var(--ui-line);
  border-radius: 4px; box-shadow: none; backdrop-filter: none;
}
:root body[data-game] #view-game .g-header { padding: 8px; margin-bottom: 12px; }
:root body[data-game] #view-game .g-title { font-size: 17px; font-weight: 650; }
:root body[data-game] #view-game .board-holder {
  padding: 0; border: 0; border-radius: 4px; background: transparent; box-shadow: none;
}
:root body[data-game] #view-game .board { border-radius: 4px; box-shadow: none; }
:root body[data-game] #view-game :is(.g-diff, .g-timer, .g-actions) { box-shadow: none; }
:root body[data-game] #view-game :is(.g-actions, .g-subhead) .pill-btn {
  min-width: 0; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; line-height: 1.2;
}
:root body[data-game] #view-game .control-icon {
  width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
:root body[data-game] #view-game .g-actions { gap: 8px; }
:root body[data-game] #view-game .g-actions .pill-btn {
  color: var(--ui-ink); background: var(--ui-surface); border: 1px solid var(--ui-line);
  border-radius: 4px; box-shadow: none; font-size: 13px; font-weight: 600;
}
:root body[data-game] #view-game .g-actions .pill-btn:hover:not(:disabled) {
  color: var(--ui-accent); background: var(--ui-accent-soft); border-color: var(--ui-accent);
  transform: none; box-shadow: none;
}
/* Theme colors must change together; interpolating through gray hides labels. */
:root body[data-game] #view-game :is(.pill-btn, .icon-btn, .start-btn,
  .mini-sudoku-tools button, .mini-sudoku-keypad button,
  .minesweeper-mode-button, .nonogram-tools button, .wordle-key) {
  transition: transform 140ms ease, filter 140ms ease;
}
:root body[data-game="fifteen"] #view-game .g-subhead {
  padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
:root body .launch { border-radius: 4px; }
:root body .nudge { border-radius: 12px; padding: 14px 16px; font-size: 13px; line-height: 1.6; box-shadow: none; }
:root body .nudge[data-kind="hint"] { border-color: transparent; border-left: 3px solid var(--ui-accent); background: var(--ui-accent-soft); }
:root body .nudge[data-kind="error"] { border-left: 3px solid var(--ui-danger); }
:root body :is(.g-diff, .howto, .howto-summary-icon, .howto-chevron,
  .howto-demo, .howto-rule-number) { border-radius: 4px; box-shadow: none; }
:root body .howto { background: var(--ui-surface); border-color: var(--ui-line); }
:root body .howto-summary-icon { color: var(--ui-accent); background: var(--ui-accent-soft); }
:root body :is(.patch-clue-body, .patch-size-clue) { border-radius: 3px; box-shadow: none; text-shadow: none; }
:root body .patch-clue::before, :root body .patch-clue::after { border-radius: 3px; }
:root[data-theme] body[data-game="zip"] :is(.board.zip-board, .watch-board.zip-board) {
  --zip-path-start: #e88732; --zip-path-end: #e88732; --zip-path-shadow: transparent;
}
:root[data-theme] body[data-game="zip"] .zip-cell.zip-visited { background: #e8873214; box-shadow: none; }
:root body[data-game="wordle"] #view-game .board-holder {
  width: min(100%, 330px, max(200px, calc((100dvh - 430px) * .8333)));
}
:root body :is(.mini-sudoku-tools, .wordle-keyboard) { margin-top: 16px; }
:root body[data-game="mini-sudoku"] #view-game .mini-sudoku-keypad button { color: var(--ui-ink); background: var(--ui-surface); border: 1px solid var(--ui-line); box-shadow: none; }
:root body[data-game="mini-sudoku"] #view-game .mini-sudoku-keypad button:disabled { color: var(--ui-muted); background: var(--ui-soft); }
:root body[data-game="mini-sudoku"] #view-game .mini-sudoku-tools { gap: 8px; }
:root body[data-game="mini-sudoku"] #view-game .mini-sudoku-tools button {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px; line-height: 1.2;
  color: var(--ui-ink); background: var(--ui-surface); border: 1px solid var(--ui-line);
}
:root body[data-game="mini-sudoku"] #view-game .mini-sudoku-tools button > span { display: inline-flex; align-items: center; gap: 4px; }
:root body[data-game="mini-sudoku"] #view-game .mini-sudoku-tools button > svg { flex: none; }
:root body[data-game="mini-sudoku"] #view-game .mini-sudoku-tools [data-mini-notes].active {
  color: var(--ui-accent); background: var(--ui-accent-soft); border: 1px solid var(--ui-accent);
}
:root body[data-game="mini-sudoku"] #view-game .mini-sudoku-tools small { color: var(--ui-muted); }
:root body .minesweeper-tools { width: 100%; gap: 8px; }
:root body :is(.minesweeper-mode-switch, .minesweeper-remaining) {
  color: var(--ui-ink); background: var(--ui-surface); border-color: var(--ui-line); border-radius: 4px; box-shadow: none;
}
:root[data-theme] .minesweeper-cell.mine-hidden {
  background: var(--ui-line); border: 1px solid var(--ui-strong); box-shadow: none;
}

/* Game catalogue: a directory of clear, readable cards. */
:root body.game-catalog { display: block; padding: 40px 24px; }
:root .game-catalog main { width: min(100%, 1180px); margin: auto; }
:root .game-catalog header { padding-bottom: 28px; margin-bottom: 24px; border-bottom: 1px solid var(--ui-line); }
:root .game-catalog .hub-mark { width: 42px; height: 42px; border-radius: 4px; box-shadow: none; }
:root .game-catalog h1 { margin: 3px 0 8px; font-size: clamp(38px, 5vw, 56px); line-height: 1; letter-spacing: -.055em; }
:root .game-catalog .intro { color: var(--ui-muted); font-size: 14px; }
:root .game-catalog :is(#session, .catalog-search) {
  color: var(--ui-muted); background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: 4px; box-shadow: none;
}
:root .game-catalog .catalog-search { max-width: 430px; }
:root .game-catalog .catalog-search input { background: transparent; border: 0; color: var(--ui-ink); }
:root .game-catalog .section-heading { align-items: center; margin: 28px 0 14px; }
:root .game-catalog .section-heading h2 { font-size: 20px; }
:root .game-catalog .games { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
:root .game-catalog .game {
  width: 100%; max-width: none;
  min-height: 182px; aspect-ratio: auto; padding: 20px; border: 1px solid var(--ui-line);
  border-radius: 4px; color: var(--ui-ink); background: var(--ui-surface); box-shadow: none;
  animation: none; transform: none; opacity: 1; transition: border-color 120ms ease;
}
:root .game-catalog .game:hover { border-color: var(--ui-accent); transform: none; box-shadow: none; }
:root .game-catalog :is(.game, .daily-mix-card)::before,
:root .game-catalog :is(.game, .daily-mix-card)::after { display: none; }
:root .game-catalog .game .board-preview {
  width: 84px; height: 84px; top: 20px; right: 20px; object-fit: contain;
  transform: none; opacity: 1; filter: none; border-radius: 2px;
}
:root .game-catalog .game-top { position: static; display: flex; align-items: center; justify-content: flex-start; gap: 9px; padding-right: 100px; }
:root .game-catalog .game .mark { width: 24px; height: 24px; flex: none; border-radius: 3px; background: transparent; border: 0; box-shadow: none; }
:root .game-catalog .game .number { position: static; padding: 0; color: var(--ui-muted); background: transparent; border: 0; font-size: 11px; box-shadow: none; text-shadow: none; }
:root .game-catalog .game-copy { display: flex; flex: 1; flex-direction: column; padding: 0; margin-top: 12px; }
:root .game-catalog .game h3 { margin: 0; color: var(--ui-ink); font-size: 20px; line-height: 1.25; letter-spacing: -.025em; overflow-wrap: normal; }
:root .game-catalog .game p { display: block; max-width: none; margin: 0 100px 18px 0; color: var(--ui-muted); font-size: 13px; line-height: 1.5; }
:root .game-catalog .game .enter { margin-top: auto; color: var(--ui-accent); font-size: 12px; font-weight: 600; }
:root .game-catalog .game-copy :is(h3, p, .enter) { text-shadow: none; }
:root .game-catalog .game .enter i { color: inherit; background: transparent; border: 0; }
:root .game-catalog .daily-mix-card {
  grid-template-columns: minmax(0, 1fr) 290px; gap: 28px; padding: 24px;
  color: var(--ui-ink); background: var(--ui-surface); border: 1px solid var(--ui-line);
  border-radius: 4px; box-shadow: none;
}
:root .game-catalog .daily-mix-copy h2 { color: var(--ui-ink); font-size: 28px; }
:root .game-catalog :is(.daily-mix-kicker, .daily-mix-copy p, .daily-mix-meta span, .daily-mix-leader) { color: var(--ui-muted); }
:root .game-catalog :is(.daily-mix-meta strong, .daily-mix-leader time) { color: var(--ui-ink); }
:root .game-catalog .daily-mix-game { border: 1px solid var(--ui-line); border-radius: 3px; background: var(--ui-soft); box-shadow: none; }
:root .game-catalog .daily-mix-game b { color: var(--ui-ink); background: var(--ui-surface); }
:root .game-catalog .daily-mix-side { padding: 16px; border: 0; border-left: 1px solid var(--ui-line); border-radius: 0; background: transparent; }
:root .game-catalog :is(.daily-mix-action, .daily-mix-share) { border-radius: 4px; font-weight: 600; box-shadow: none; }
:root .game-catalog .daily-mix-share { color: var(--ui-ink); background: var(--ui-soft); border-color: var(--ui-line); }
:root .game-catalog footer { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--ui-line); color: var(--ui-muted); }

/* Tabletop pages use the same navigation, forms, and room surfaces. */
:root[data-social-game] body { background: var(--ui-bg); }
:root[data-social-game] :is(.hero, .table-banner, .panel, .directory-card, .room-card,
  .lobby-seat, .rules-card, .stat-card, .scoreboard, .turn-banner, .action-panel) {
  color: var(--ui-ink); background: var(--ui-surface); border-color: var(--ui-line); border-radius: 4px; box-shadow: none;
}
:root[data-social-game] :is(.hero, .table-banner)::before,
:root[data-social-game] :is(.hero, .table-banner)::after { display: none; }
:root[data-social-game] :is(.hero h1, .banner-copy h1) { font-size: clamp(26px, 4vw, 36px); color: var(--ui-ink); }
:root[data-social-game] .page-head h1 { font-size: clamp(28px, 4vw, 36px); line-height: 1.2; }
:root[data-social-game] .page-head p { font-size: 14px; }
:root[data-social-game] :is(.hero p, .banner-copy p, .panel-sub) { color: var(--ui-muted); }
:root[data-social-game] :is(.seat-grid, .lobby-table) { gap: 14px; }
:root[data-social-game] .pill { color: var(--ui-muted); border-color: var(--ui-line); background: var(--ui-soft); }

@media (max-width: 900px) {
  :root .game-catalog .games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root .game-catalog .daily-mix-card { grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; }
}
@media (max-width: 620px) {
  :root body.game-catalog { padding: 24px 16px; }
  :root .game-catalog header { gap: 16px; align-items: flex-start; }
  :root .game-catalog .hub-mark { display: none; }
  :root .game-catalog .header-actions { align-items: flex-end; gap: 8px; }
  :root .game-catalog .games { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  :root .game-catalog .game { min-height: 172px; padding: 16px; }
  :root .game-catalog .game .board-preview { top: 16px; right: 16px; width: 76px; height: 76px; }
  :root .game-catalog .game-top { padding-right: 90px; }
  :root .game-catalog .game p { margin-right: 90px; }
  :root .game-catalog .daily-mix-card { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  :root .game-catalog .daily-mix-side { border-left: 0; border-top: 1px solid var(--ui-line); padding: 16px 0 0; }
  :root .game-catalog .daily-mix-games { gap: 5px; flex-wrap: wrap; }
  :root .game-catalog .section-heading { align-items: flex-start; gap: 8px; }
  :root body .page { padding: 22px 16px 48px; }
  :root body .page-heading h1 { font-size: 28px; }
  :root body .day-grid { gap: 10px; }
  :root body .practice-nav { width: 100%; grid-template-columns: minmax(0, 1fr); }
  :root body .day-card { min-height: 176px; padding: 14px; }
  :root body :is(.btn, .btn-outline, .button, .chip, .theme-btn, .account-nav) { min-height: 44px; }
  :root body[data-game] #view-game .g-title { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  :root body *, :root body *::before, :root body *::after { scroll-behavior: auto; }
}

/* Small fields of color give every game an identity within the shared grid. */
:root[data-game="queens"], :root[data-social-game="queens"], .game-catalog .game.queens { --ui-game-light: #7550c7; --ui-game-dark: #bda3ff; }
:root[data-game="tango"], :root[data-social-game="tango"], .game-catalog .game.tango { --ui-game-light: #b64b1d; --ui-game-dark: #ffb27e; }
:root[data-game="zip"], :root[data-social-game="zip"], .game-catalog .game.zip { --ui-game-light: #237a4b; --ui-game-dark: #81ddb0; }
:root[data-game="patches"], :root[data-social-game="patches"], .game-catalog .game.patches { --ui-game-light: #b43f71; --ui-game-dark: #ffa3c9; }
:root[data-game="mini-sudoku"], :root[data-social-game="mini-sudoku"], .game-catalog .game.mini-sudoku { --ui-game-light: #26796c; --ui-game-dark: #81dbcd; }
:root[data-game="akari"], :root[data-social-game="akari"], .game-catalog .game.akari { --ui-game-light: #98620a; --ui-game-dark: #ffd16e; }
:root[data-game="minesweeper"], :root[data-social-game="minesweeper"], .game-catalog .game.minesweeper { --ui-game-light: #376a91; --ui-game-dark: #93c8f6; }
:root[data-game="wordle"], :root[data-social-game="wordle"], .game-catalog .game.wordle { --ui-game-light: #387a42; --ui-game-dark: #9cdb9d; }
:root[data-game="nonogram"], :root[data-social-game="nonogram"], .game-catalog .game.nonogram { --ui-game-light: #177a80; --ui-game-dark: #8cdee2; }
:root[data-game="fifteen"], :root[data-social-game="fifteen"], .game-catalog .game.fifteen { --ui-game-light: #4268c2; --ui-game-dark: #a5c0ff; }
:root[data-game="set"], .game-catalog .game.set { --ui-game-light: #9551b7; --ui-game-dark: #dfa9fa; }
:root[data-game="dixit"], :root[data-social-game="dixit"], .game-catalog .game.dixit { --ui-game-light: #775298; --ui-game-dark: #d4b2ef; }
:root[data-game="catan"], :root[data-social-game="catan"], .game-catalog .game.catan { --ui-game-light: #9c492c; --ui-game-dark: #f5b294; }
:root[data-game="codenames"], :root[data-social-game="codenames"], .game-catalog .game.codenames { --ui-game-light: #315e77; --ui-game-dark: #a4cfe6; }
:root[data-game="coup"], :root[data-social-game="coup"], .game-catalog .game.coup { --ui-game-light: #913f48; --ui-game-dark: #edabb4; }
:root[data-game="wavelength"], :root[data-social-game="wavelength"], .game-catalog .game.wavelength { --ui-game-light: #a13560; --ui-game-dark: #ed8dad; }

:root body :is(.topbar, .site-header) { box-shadow: inset 0 3px var(--ui-accent); }
:root body :is(.primary-nav a[aria-current="page"], .nav-tabs a.active, .tabs a.active, .directory-tab.active) {
  box-shadow: inset 0 -2px var(--ui-accent);
}
:root body :is(.page-eyebrow, .eyebrow, .eyebrow-label) {
  display: inline-flex; align-items: center; gap: 8px;
}
:root body :is(.page-eyebrow, .eyebrow, .eyebrow-label)::before {
  content: ""; width: 6px; height: 6px; flex: none; background: var(--ui-accent);
}
:root body :is(.g-timer, .day-num, .stat-value, .lobby-code, .catalog-count) {
  font-family: var(--ui-mono-font); font-variant-numeric: tabular-nums; letter-spacing: -.03em;
}
:root body :is(.random-panel, .duel-create-card, .rush-create-card) { border-top: 3px solid var(--ui-accent); }
:root body .random-panel-head { border: 0; border-bottom: 1px solid var(--ui-line); border-radius: 0; padding-bottom: 18px; }
:root body[data-game] .random-visual {
  background: var(--ui-accent-soft); border-color: transparent;
}
:root body .random-choice span { border-radius: 3px; }
:root body[data-game] #view-game .g-header { box-shadow: inset 0 2px var(--ui-accent); }
:root body :is(.btn, .btn-outline, .button, .daily-mix-action) { transition: background-color 140ms ease, border-color 140ms ease, filter 140ms ease; }

/* A single deep-green feature panel, with a crisp grid and a citron action. */
:root .game-catalog .daily-mix-card {
  color: var(--ui-feature-ink); background: var(--ui-feature-bg);
  border-color: var(--ui-feature-line); border-top: 3px solid var(--ui-feature-accent);
  padding: 28px;
}
:root .game-catalog .daily-mix-card::before {
  content: ""; display: block; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  opacity: 1; background-image: linear-gradient(#eee9ff08 1px, transparent 1px), linear-gradient(90deg, #eee9ff08 1px, transparent 1px);
  background-size: 28px 28px; mask-image: linear-gradient(90deg, transparent 35%, #000);
}
:root .game-catalog .daily-mix-card .daily-mix-copy h2 { color: var(--ui-feature-ink); font-size: clamp(30px, 4vw, 38px); letter-spacing: -.04em; }
:root .game-catalog .daily-mix-card :is(.daily-mix-copy p, .daily-mix-meta span, .daily-mix-leader) { color: var(--ui-feature-muted); }
:root .game-catalog .daily-mix-card :is(.daily-mix-meta strong, .daily-mix-leader time) { color: var(--ui-feature-ink); }
:root .game-catalog .daily-mix-card .daily-mix-kicker { color: var(--ui-feature-accent); font: 600 10px var(--ui-mono-font); letter-spacing: .12em; }
:root .game-catalog .daily-mix-card .daily-mix-side { border-color: var(--ui-feature-line); }
:root .game-catalog .daily-mix-card .daily-mix-game { background: #152b24; border-color: var(--ui-feature-line); }
:root .game-catalog .daily-mix-card .daily-mix-game b { color: var(--ui-feature-ink); background: #152b24; font-family: var(--ui-mono-font); }
:root .game-catalog .daily-mix-card .daily-mix-action {
  color: #203024; background: var(--ui-feature-accent); border: 1px solid var(--ui-feature-accent);
  min-height: 46px; box-shadow: 0 3px 0 #101e18; transform: none;
}
:root .game-catalog .daily-mix-card .daily-mix-action:hover { background: #e5f6ae; transform: none; }
:root .game-catalog .daily-mix-card .daily-mix-share { color: var(--ui-feature-ink); background: #152b24; border-color: var(--ui-feature-line); }
:root .game-catalog .daily-mix-card :is(.daily-mix-action, .daily-mix-share):focus-visible { outline: 2px solid var(--ui-feature-accent); outline-offset: 4px; }

:root .game-catalog header { border-bottom: 2px solid var(--ui-ink); }
:root .game-catalog .section-heading h2 { font-size: 22px; }
:root .game-catalog .game {
  --ui-card-accent: var(--ui-game-light, var(--ui-accent));
  border-top: 3px solid var(--ui-card-accent);
  background: linear-gradient(120deg, color-mix(in srgb, var(--ui-card-accent) 4%, var(--ui-surface)), var(--ui-surface) 65%);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
:root[data-theme="dark"] .game-catalog .game { --ui-card-accent: var(--ui-game-dark, var(--ui-accent)); }
:root .game-catalog .game :is(.number, .enter) { color: var(--ui-card-accent); }
:root .game-catalog .game .number { font-family: var(--ui-mono-font); letter-spacing: .05em; }
:root .game-catalog .game .enter { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--ui-line); }
:root .game-catalog .game .enter i { border: 0; border-radius: 0; width: 24px; height: 24px; font-size: 18px; transform: none; }
:root .game-catalog .game .board-preview { box-shadow: 3px 3px 0 color-mix(in srgb, var(--ui-card-accent) 22%, transparent); }
:root .game-catalog .game:is(:hover, :focus-visible) { border-color: var(--ui-card-accent); box-shadow: 3px 3px 0 color-mix(in srgb, var(--ui-card-accent) 25%, transparent); }
:root .game-catalog .game:is(:hover, :focus-visible) .enter i { background: transparent; color: var(--ui-card-accent); transform: none; }
@media (max-width: 620px) {
  :root .game-catalog .daily-mix-card { padding: 18px; }
  :root .game-catalog .game .enter { padding-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  :root body :is(.btn, .btn-outline, .button, .daily-mix-action), :root .game-catalog .game { transition: none; }
}

/* Keep each game's palette across page surfaces, not only its buttons. */
:root:is([data-game], [data-social-game]) {
  --ui-game-tone: var(--game-hero-mid, var(--ui-game-light));
  --ui-bg: color-mix(in srgb, var(--ui-game-light) 2%, #f6f7fc);
  --ui-surface: #ffffff;
  --ui-soft: color-mix(in srgb, var(--ui-game-light) 4%, #f1f3fa);
  --ui-ink: #1d2639;
  --ui-muted: #626e83;
  --ui-line: color-mix(in srgb, var(--ui-game-light) 5%, #e0e5f0);
  --ui-strong: #9aa8c0;
  --ui-on-accent: #ffffff;
}
:root[data-theme="dark"]:is([data-game], [data-social-game]) {
  --ui-bg: color-mix(in srgb, var(--ui-game-light) 4%, #111521);
  --ui-surface: color-mix(in srgb, var(--ui-game-light) 5%, #1c2232);
  --ui-soft: color-mix(in srgb, var(--ui-game-light) 8%, #252e42);
  --ui-ink: color-mix(in srgb, var(--ui-game-dark) 7%, #ffffff);
  --ui-muted: #adb9d0;
  --ui-line: color-mix(in srgb, var(--ui-game-light) 8%, #36415a);
  --ui-strong: #788aa8;
  --ui-on-accent: #151c26;
}

/* Reuse the original game hero colors inside the rectangular components. */
:root body[data-game] :is(.daily-hero, .profile-hero, .watch-summary, .day-card.any-day, .random-visual) {
  --ui-surface: var(--game-hero-start);
  --ui-soft: color-mix(in srgb, var(--game-hero-start) 75%, var(--game-hero-mid));
  --ui-ink: var(--game-hero-ink);
  --ui-muted: var(--game-hero-muted);
  --ui-line: color-mix(in srgb, var(--game-hero-ink) 30%, var(--game-hero-start));
  --ui-strong: var(--game-hero-button);
  --ui-accent: var(--game-hero-button);
  --ui-accent-soft: var(--ui-soft);
  --ui-on-accent: var(--game-hero-button-ink);
  color: var(--ui-ink);
  background: var(--ui-surface);
  border-color: var(--ui-line);
}
:root body[data-game] :is(.daily-hero, .profile-hero, .watch-summary, .day-card.any-day) {
  border-top: 3px solid var(--game-hero-button);
}
:root body[data-game] :is(.random-panel-head, .duel-form-head, .duel-create-footer) {
  background: var(--ui-soft);
}
:root body[data-game] .random-panel-head { padding: 14px; border-radius: 3px; }
:root body[data-game] .stat-card { border-top: 3px solid var(--ui-accent); }
:root body[data-game] .stat-card :is(.stat-value, .stat-num) { color: var(--ui-accent); }

/* Quieter controls, clear choices, and balanced page layouts. */
:root body[data-game] :is(.page-eyebrow, .random-section-label) {
  font-size: 11px;
  letter-spacing: .085em;
}
:root body[data-game] .page-heading .sub { max-width: 65ch; line-height: 1.55; }
:root body[data-game] .random-panel { padding: clamp(20px, 3vw, 28px); }
:root body[data-game] .random-panel-head { margin-bottom: 24px; }
:root body[data-game] .random-field { margin-bottom: 24px; }
:root body[data-game] .random-field legend { font-size: 14px; font-weight: 650; margin-bottom: 10px; }
:root body[data-game] :is(.random-size-row, .random-difficulty-row) {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
}
:root body[data-game] .random-size-row:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
:root body[data-game] .random-size-row:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
:root body[data-game] .random-choice span {
  min-height: 46px; padding: 10px 8px; font-size: 13px; font-weight: 600;
  color: var(--ui-ink); background: var(--ui-surface); border: 1px solid var(--ui-line);
  border-radius: 3px; box-shadow: none; transform: none; transition: none;
}
:root body[data-game] .random-choice:hover span { border-color: var(--ui-accent); }
:root body[data-game] .random-choice input:checked + span {
  color: var(--ui-on-accent); background: var(--ui-accent); border-color: var(--ui-accent);
  box-shadow: none; transform: none;
}
:root body[data-game] .random-generate { min-height: 48px; font-size: 15px; font-weight: 650; box-shadow: none; }
:root body[data-game] .random-status:empty { display: none; }
:root body[data-game] .practice-nav { flex-basis: 430px; width: min(100%, 430px); }
:root body[data-game] .practice-nav-copy :is(strong, small) { white-space: normal; overflow: visible; text-overflow: clip; }
:root body[data-game] .practice-nav-copy strong { font-weight: 650; line-height: 1.25; }
:root body[data-game] .practice-nav-copy small { font-size: 11px; font-weight: 500; line-height: 1.4; }
:root body[data-game] .practice-nav-action:hover { transform: none; box-shadow: none; }
:root body[data-game] .day-card { padding: 18px; min-height: 190px; }
:root body[data-game] .day-name { font-weight: 700; }
:root body[data-game] .day-actions .btn { min-height: 44px; }
:root body[data-game] .arena-directory-head { flex-wrap: wrap; gap: 12px; align-items: center; }
:root body[data-game] .arena-directory-head > div:first-child { flex: 1 1 220px; min-width: 0; }
:root body[data-game] .arena-counts { flex: 0 0 auto; gap: 6px; }
:root body[data-game] .arena-counts span { white-space: nowrap; font-size: 11px; font-weight: 600; }
:root body[data-game] :is(.duel-target-field, .duel-settings-toggle, .duel-visibility-option, .duel-rated-option) {
  background: var(--ui-surface); border-color: var(--ui-line); box-shadow: none;
}
:root body[data-game] :is(.duel-visibility-option, .duel-rated-option):has(input:checked) {
  border-color: var(--ui-accent); background: var(--ui-accent-soft);
}
:root body[data-game] :is(.bar-chart, .weekday-manager, .recent-panel) {
  color: var(--ui-ink); background: var(--ui-surface); border: 1px solid var(--ui-line);
  border-radius: 20px; box-shadow: 0 4px 20px #17244904;
}
:root body[data-game] .stats-layout {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; gap: 18px;
}
:root body[data-game] table.recent { min-width: 0; }
:root body[data-game] table.recent tr { border-radius: 12px; }
:root body[data-game] .bar-chart { padding: 24px; }
:root body[data-game] .bar-chart .panel-heading p { margin: 5px 0 0; color: var(--ui-muted); font-size: 12px; line-height: 1.5; }
:root body[data-game] .bar-row { font-size: 12px; margin-block: 16px; grid-template-columns: 34px minmax(0, 1fr) 68px; gap: 12px; }
:root body[data-game] .bar-track { height: 8px; background: var(--ui-soft); }
:root body[data-game] :is(.bar-track, .bar-fill) { border-radius: 4px; }
:root body[data-game] .bar-fill { background: var(--ui-accent); }
:root body[data-game] .bar-val { font-variant-numeric: tabular-nums; font-weight: 650; }
:root body[data-game] .bar-val small { display: block; margin-top: 1px; font-size: 10px; font-weight: 400; color: var(--ui-muted); }
:root body[data-game] .stat-card .v { font-size: clamp(26px, 3vw, 34px); font-weight: 650; letter-spacing: -.04em; }
:root body[data-game] .stat-card .k { font-size: 12px; font-weight: 500; }
:root body[data-game] .stats-leaderboard-link i { border-radius: 12px; }
:root body[data-game] .stats-chart-empty { display: grid; justify-items: start; gap: 12px; padding: 22px 0 4px; }
:root body[data-game] .stats-chart-empty svg { width: 64px; height: 48px; padding: 8px; box-sizing: content-box; border-radius: 14px; color: var(--ui-accent); background: var(--ui-accent-soft); fill: none; stroke: currentColor; stroke-width: 6; stroke-linecap: round; }
:root body[data-game] .stats-chart-empty strong { font-size: 17px; letter-spacing: -.025em; font-weight: 650; }
:root body[data-game] .stats-chart-empty p { margin: -7px 0 2px; color: var(--ui-muted); font-size: 13px; }
:root body[data-game] .stats-chart-empty .btn { gap: 8px; }
:root body[data-game] .recent-panel .panel-heading { padding: 24px 24px 0; }
:root body[data-game] table.recent th { background: var(--ui-soft); color: var(--ui-muted); font-size: 10px; font-weight: 600; letter-spacing: .03em; }
:root body[data-game] table.recent td { font-variant-numeric: tabular-nums; }
:root body[data-game] .stats-puzzle-link { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: var(--ui-accent); text-decoration: none; font-weight: 650; }
:root body[data-game] .stats-puzzle-link:hover { text-decoration: underline; }
:root body[data-game] .stats-run { font-size: 11px; line-height: 1.5; }
:root body[data-game] .stats-run.clean { display: inline-block; padding: 3px 8px; color: var(--ui-success); background: color-mix(in srgb, var(--ui-success) 10%, var(--ui-surface)); border-radius: 6px; }
:root body[data-game] table.recent .recent-empty { padding: 36px 24px; text-align: left; }
:root body[data-game] table.recent .recent-empty :is(strong, span) { display: block; }
:root body[data-game] table.recent .recent-empty strong { margin-bottom: 7px; color: var(--ui-ink); font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
:root body[data-game] table.recent .recent-empty span { max-width: 340px; font-size: 13px; line-height: 1.6; }
:root body[data-game] .weekday-manager { margin-top: 18px; padding: 0; }
:root body[data-game] .weekday-manager > summary {
  min-height: 52px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; list-style: none; cursor: pointer; font-size: 14px; font-weight: 600;
}
:root body[data-game] .weekday-manager > summary::-webkit-details-marker { display: none; }
:root body[data-game] .weekday-manager > summary::after {
  content: ''; width: 7px; height: 7px; flex: none; border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin-top: -4px;
}
:root body[data-game] .weekday-manager[open] > summary { border-bottom: 1px solid var(--ui-line); }
:root body[data-game] .weekday-manager[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
:root body[data-game] .history-management-body { padding: 0 20px 20px; }
:root body[data-game] .history-management-body > p { color: var(--ui-muted); font-size: 13px; line-height: 1.5; }
:root body[data-game] .weekday-reset-list { gap: 0; }
:root body[data-game] .weekday-reset-row {
  border: 0; border-bottom: 1px solid var(--ui-line); border-radius: 0; padding: 10px 0;
  background: transparent; box-shadow: none;
}
:root body[data-game] .weekday-reset-button { min-height: 44px; padding: 8px 14px; border-radius: 3px; }
:root body[data-game] .history-management-body .stats-toolbar { margin-top: 18px; justify-content: flex-end; }
@media (max-width: 680px) {
  :root body[data-game] .practice-nav { flex-basis: 100%; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root body[data-game] .practice-nav-copy small { display: block; }
  :root body[data-game] .stats-layout { grid-template-columns: minmax(0, 1fr); }
  :root body[data-game] .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root body[data-game] .stat-card:first-child { grid-column: 1 / -1; }
  :root body[data-game] .stat-card { padding: 16px; }
  :root body[data-game] .random-panel { padding: 18px; }
  :root body[data-game] .random-field { margin-bottom: 20px; }
  :root body[data-game] .random-panel-head { margin-bottom: 20px; padding: 12px; gap: 12px; }
  :root body[data-game] .random-choice span { font-size: 12px; }
  :root body[data-game] .day-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  :root body[data-game] .day-card { min-height: 180px; padding: 12px; }
  :root body[data-game] .day-name { font-size: 16px; }
  :root body[data-game] .day-level { font-size: 9px; letter-spacing: .04em; }
  :root body[data-game] .day-actions { gap: 6px; }
  :root body[data-game] .day-actions .btn { padding-inline: 5px; font-size: 12px; }
  :root body[data-game] .day-head { display: block; min-height: 52px; }
  :root body[data-game] .day-meta { flex-wrap: wrap; gap: 3px; }
  :root body[data-game] .today-tag { display: inline-block; margin-top: 4px; font-size: 8px; padding: 2px 5px; }
  :root body[data-game] .crowns { letter-spacing: 0; }
}

/* A quiet, game-colored frame before the board opens. */
:root body[data-game]:not([data-game="fifteen"]) #view-game .launch {
  inset: 0; padding: 20px; gap: 12px;
  color: var(--game-hero-ink); background: var(--game-hero-start);
  border: 1px solid var(--game-hero-mid); border-top: 3px solid var(--game-hero-button);
  backdrop-filter: none; box-shadow: none;
}
:root body[data-game]:not([data-game="fifteen"]) .launch .big-crown {
  width: 76px; min-height: 76px; margin-bottom: 4px;
  border: 1px solid color-mix(in srgb, var(--game-hero-ink) 20%, transparent);
  border-radius: 4px; background: color-mix(in srgb, var(--game-hero-ink) 7%, transparent);
  filter: none;
}
:root body[data-game]:not([data-game="fifteen"]) .launch .launch-crown {
  width: 44px; height: 40px; fill: var(--game-hero-button); filter: none;
}
:root body[data-game]:not([data-game="fifteen"]) .launch .l-num {
  color: var(--game-hero-ink); font-size: 24px; font-weight: 700; line-height: 1.2;
}
:root body[data-game]:not([data-game="fifteen"]) .launch .l-date {
  padding: 0; color: var(--game-hero-muted); font-size: 12px; line-height: 1.5;
}
:root body[data-game]:not([data-game="fifteen"]) .launch .start-btn {
  min-height: 48px; min-width: 176px; margin-top: 6px; padding: 12px 24px;
  color: var(--game-hero-button-ink); background: var(--game-hero-button);
  border: 1px solid var(--game-hero-button); border-radius: 4px; box-shadow: none;
  font-size: 15px; font-weight: 650;
}
:root body[data-game]:not([data-game="fifteen"]) .launch .start-btn:focus-visible {
  outline-color: var(--game-hero-button);
}

/* Completion has one clear next step, with replay and sharing alongside. */
:root body[data-game] .single-puzzle-results { padding: 0; text-align: center; }
:root body[data-game] .single-puzzle-results .result-heading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding-inline: 32px; margin-bottom: 20px;
}
:root body[data-game] .single-puzzle-results .result-icon {
  display: grid; place-items: center; flex: 0 0 52px; width: 52px; height: 52px;
  padding: 0; margin: 0; border: 1px solid color-mix(in srgb, var(--ui-accent) 16%, transparent);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--ui-accent) 9%, transparent);
  border-radius: 16px; color: var(--ui-accent); background: var(--ui-accent-soft);
}
:root body[data-game] .single-puzzle-results .result-icon > :is(svg, img),
:root body[data-game] .single-puzzle-results .result-icon > span > svg { width: 32px; height: 32px; filter: none; }
:root body[data-game="tango"] .single-puzzle-results .tango-result-icons { gap: 3px; }
:root body[data-game="tango"] .single-puzzle-results .tango-result-icons .tango-symbol { width: 18px; height: 18px; }
:root body[data-game]:not([data-game="fifteen"]) .launch .classic-launch-icon { width: 48px; height: 48px; color: var(--game-hero-button); }
:root body[data-game="queens"] .results .result-icon svg { color: var(--ui-accent); filter: none; }
:root body[data-game="queens"] .results .result-icon svg:not([fill="none"]) { fill: currentColor; }
:root body[data-game="queens"] .results .result-icon use { fill: currentColor; }
:root body[data-game] .single-puzzle-results .result-title {
  color: var(--ui-ink); margin: 0 !important; font-size: 28px !important;
  font-weight: 750; line-height: 1.2; letter-spacing: -.035em;
}
:root body[data-game] .result-time-card {
  padding: 24px 16px; margin-bottom: 18px; text-align: center;
  color: var(--ui-accent);
  background: linear-gradient(135deg, var(--ui-accent-soft), color-mix(in srgb, var(--ui-accent) 4%, var(--ui-surface)));
  border: 1px solid color-mix(in srgb, var(--ui-accent) 15%, var(--ui-line)); border-radius: 18px;
}
:root body[data-game] .result-time-label {
  color: var(--ui-muted); font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1.4;
  letter-spacing: .01em; text-transform: none;
}
:root body[data-game] .single-puzzle-results .r-time {
  margin-top: 6px; color: var(--ui-accent); font-size: clamp(46px, 12vw, 64px);
  line-height: 1.1; font-weight: 750; letter-spacing: -.055em; font-variant-numeric: tabular-nums;
}
:root body[data-game] .single-puzzle-results .r-sub {
  margin-bottom: 10px; color: var(--ui-muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere;
}
:root body[data-game] .results .r-pill {
  border-radius: 3px; font-size: 12px; font-weight: 600; padding: 5px 8px; margin: 3px 4px 3px 0;
}
:root body[data-game] .single-puzzle-results .r-pill {
  padding: 7px 10px; margin: 0; border: 1px solid var(--ui-line); border-radius: 9px;
  color: var(--ui-muted); background: var(--ui-soft); font-size: 11px; line-height: 1.4;
}
:root body[data-game] .result-badges { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
:root body[data-game] .single-puzzle-results .r-pill.gold { color: var(--ui-accent); background: var(--ui-accent-soft); }
:root body[data-game] .single-puzzle-results .modal-actions {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  padding-top: 20px; margin-top: 18px; border-top: 1px solid var(--ui-line);
}
:root body[data-game] .single-puzzle-results .modal-actions > button {
  min-height: 46px; min-width: 0; padding: 11px 12px; border-radius: 12px; line-height: 1.4;
}
:root body[data-game] .single-puzzle-results .modal-actions :is(#res-next, #random-next) { grid-column: 1 / -1; }
:root body[data-game] .single-puzzle-results .result-share {
  position: static; min-width: 0; min-height: 44px; border-width: 1px; font-size: 14px; font-weight: 600;
}
:root body[data-game] .result-community { border-radius: 12px; gap: 14px; }
:root body[data-game] .single-puzzle-results .result-community {
  grid-template-columns: repeat(2, minmax(0, 1fr)); text-align: center;
  padding: 14px; margin-top: 16px; background: var(--ui-soft); border-color: var(--ui-line);
}
:root body[data-game] .result-community strong { font-size: 16px; font-weight: 650; }
:root body[data-game] .result-community span { font-size: 12px; line-height: 1.5; }
:root body[data-game] .single-puzzle-results .community-average { font-size: 18px; font-weight: 700; text-align: center; }
:root body[data-game] .single-puzzle-results .community-average small {
  font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none;
}
@media (max-height: 600px) {
  :root body[data-game]:not([data-game="fifteen"]) .launch .big-crown { width: 52px; min-height: 52px; margin: 0; }
  :root body[data-game]:not([data-game="fifteen"]) .launch .l-num { font-size: 20px; }
}

/* Clear dialog hierarchy and comfortable settings hit areas. */
:root body[data-game] .scrim {
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgb(8 16 24 / 56%); backdrop-filter: blur(4px);
}
:root body[data-game] .modal {
  padding: 24px; border-top: 3px solid var(--ui-accent);
  max-height: min(88dvh, 760px); overscroll-behavior: contain;
}
:root body[data-game] .modal > h3 {
  margin: 0 40px 12px 0; font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -.025em;
}
:root body[data-game] .modal > p { font-size: 14px; line-height: 1.6; margin-block: 12px 20px; }
:root body[data-game] .modal .close-x { top: 12px; right: 12px; border-radius: 10px; color: var(--ui-muted); background: var(--ui-soft); }
:root body[data-game] .modal-actions { gap: 10px; margin-top: 24px; }
:root body[data-game] .modal-actions :is(.btn, .btn-outline) { min-height: 44px; font-size: 14px; padding: 10px 18px; }
:root body[data-game] .game-settings-modal .settings-heading { display: flex; align-items: center; gap: 14px; padding: 6px 30px 24px 0; }
:root body[data-game] .game-settings-modal .settings-heading h3 { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: -.04em; }
:root body[data-game] .game-settings-modal .settings-symbol { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 14px; color: var(--ui-accent); background: var(--ui-accent-soft); }
:root body[data-game] .game-settings-modal .settings-symbol svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
:root body[data-game] .game-settings-modal .settings-intro { margin: 6px 0 0; color: var(--ui-muted); font-size: 13px; line-height: 1.5; }
:root body[data-game] .game-settings-modal .toggle-row {
  min-height: 82px; padding: 16px; gap: 20px; margin-bottom: 10px; cursor: pointer;
  border: 1px solid transparent; border-radius: 14px; background: var(--ui-soft);
}
:root body[data-game] .game-settings-modal .toggle-row:has(input:checked) { border-color: color-mix(in srgb, var(--ui-accent) 22%, var(--ui-line)); background: var(--ui-accent-soft); }
:root body[data-game] .game-settings-modal .toggle-row:hover { border-color: var(--ui-accent); }
:root body[data-game] .setting-copy { display: grid; gap: 4px; min-width: 0; }
:root body[data-game] .toggle-row .lbl { display: block; font-size: 14px; font-weight: 650; line-height: 1.3; }
:root body[data-game] .toggle-row .desc { display: block; font-size: 13px; line-height: 1.5; font-weight: 400; }
:root body[data-game] .game-settings-modal .switch { width: 44px; height: 26px; }
:root body[data-game] .game-settings-modal .switch input { z-index: 1; }
:root body[data-game] .game-settings-modal .knob { border-radius: 20px; background: var(--ui-strong); transition: none; }
:root body[data-game] .game-settings-modal .knob::after {
  top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 50%;
  box-shadow: 0 1px 2px rgb(0 0 0 / 15%); transition: left 140ms ease;
}
:root body[data-game] .game-settings-modal input:checked + .knob { background: var(--ui-accent); }
:root body[data-game] .game-settings-modal input:checked + .knob::after { left: 22px; background: var(--ui-on-accent); }
:root body[data-game] .game-settings-modal input:focus-visible + .knob {
  outline: 2px solid var(--ui-accent); outline-offset: 4px;
}
:root body[data-game] .settings-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--ui-line); }
:root body[data-game] .settings-footer > span { color: var(--ui-muted); font-size: 12px; line-height: 1.5; }
:root body[data-game] .settings-footer .btn { min-height: 44px; min-width: 88px; }

/* Keep the help frame still while its arrow indicates expanded content. */
:root body[data-game] .howto-chevron { transform: none; transition: none; border: 0; background: transparent; }
:root body[data-game] .howto-chevron svg { transition: transform 160ms ease; }
:root body[data-game] .howto[open] .howto-chevron svg { transform: rotate(180deg); }
:root body[data-game] .howto-content { padding: 20px; gap: 20px; background: var(--ui-surface); }
:root body[data-game] .howto-demo { border: 0; background: var(--ui-soft); }
:root body[data-game] .howto-modal-content { border: 0; border-radius: 0; padding: 12px 0 0; }
:root body[data-game] .howto-rules { gap: 16px; }
:root body[data-game] .howto-rule { grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
:root body[data-game] .howto-rule-number {
  width: 28px; height: 28px; border-radius: 9px; color: var(--ui-accent); background: var(--ui-accent-soft);
  font: 650 12px/28px var(--ui-display-font);
}
:root body[data-game] .howto-rule-copy { gap: 5px; }
:root body[data-game] .howto-rule-copy strong { font-size: 14px; font-weight: 650; line-height: 1.3; }
:root body[data-game] .howto-rule-copy span { font-size: 13px; line-height: 1.55; }
:root body[data-game="queens"] .howto-summary-icon svg { color: var(--ui-accent); }
:root body[data-game="queens"] .howto-summary-icon use { fill: currentColor; }
@media (max-width: 500px) {
  :root body[data-game] .modal { padding: 20px; max-height: calc(100dvh - 32px); border-radius: 4px; }
  :root body[data-game] .modal > h3 { font-size: 21px; }
  :root body[data-game] .howto-content { padding: 16px; gap: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  :root body[data-game] .howto-chevron svg,
  :root body[data-game] .game-settings-modal .knob::after { transition: none; }
}

/* Daily challenge: a visible five-board journey and a calm standings table. */
:root body[data-game] #view-daily .daily-page-feature { grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
:root body[data-game] #view-daily .daily-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding: 28px; gap: 24px; }
:root body[data-game] #view-daily .daily-kicker { font: 600 10px/1.5 var(--ui-mono-font); letter-spacing: .08em; margin-bottom: 12px; }
:root body[data-game] #view-daily .daily-hero h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.2; }
:root body[data-game] #view-daily .daily-hero p { font-size: 14px; line-height: 1.6; margin-top: 12px; }
:root body[data-game] #view-daily .daily-code {
  display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding: 0;
  border: 0; background: none; color: var(--ui-muted); font-family: inherit; font-size: 12px; font-weight: 500; line-height: 1.5;
}
:root body[data-game] #view-daily .daily-code span:last-child { font-variant-numeric: tabular-nums; }
:root body[data-game] #view-daily .daily-stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
:root body[data-game] #view-daily .daily-stages:empty { display: none; }
:root body[data-game] #view-daily .daily-stages li {
  display: grid; place-items: center; height: 46px; border: 1px solid var(--ui-line); border-radius: 3px;
  color: var(--ui-muted); background: var(--ui-soft); font: 600 15px var(--ui-mono-font);
}
:root body[data-game] #view-daily .daily-stages [data-state="complete"] { color: var(--ui-on-accent); background: var(--ui-accent); border-color: var(--ui-accent); }
:root body[data-game] #view-daily .daily-stages [data-state="current"] { color: var(--ui-accent); border-color: var(--ui-accent); box-shadow: inset 0 -3px var(--ui-accent); }
:root body[data-game] #view-daily .daily-action { justify-items: stretch; padding-top: 20px; border-top: 1px solid var(--ui-line); gap: 10px; }
:root body[data-game] #view-daily .daily-action-buttons { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
:root body[data-game] #view-daily .daily-action-buttons > :is(a, button) { min-height: 46px; display: flex; align-items: center; justify-content: center; padding: 11px 14px; line-height: 1.3; font-size: 14px; }
:root body[data-game] #view-daily .daily-action small { font-size: 12px; line-height: 1.5; text-align: center; }
:root body[data-game] #view-daily .daily-standings { min-height: 0; padding: 22px; }
:root body[data-game] #view-daily .daily-standings-head { flex-direction: column; gap: 4px; padding-bottom: 18px; border-bottom: 1px solid var(--ui-line); }
:root body[data-game] #view-daily .daily-standings h3 { font-size: 20px; line-height: 1.3; }
:root body[data-game] #view-daily .daily-standings-head > span { font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; }
:root body[data-game] #view-daily .daily-leaderboard-labels {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; padding: 14px 8px 0;
  color: var(--ui-muted); font: 500 10px var(--ui-mono-font); text-transform: uppercase; letter-spacing: .04em;
}
:root body[data-game] #view-daily .daily-standings:not(:has(.daily-rank)) .daily-leaderboard-labels { display: none; }
:root body[data-game] #view-daily .daily-leaderboard { gap: 0; margin-top: 10px; }
:root body[data-game] #view-daily .daily-rank { min-height: 48px; gap: 10px; padding: 10px 8px; border-radius: 0; border-bottom: 1px solid var(--ui-line); background: transparent; font-size: 13px; }
:root body[data-game] #view-daily .daily-rank:first-child { background: var(--ui-accent-soft); box-shadow: inset 2px 0 var(--ui-accent); }
:root body[data-game] #view-daily .daily-rank :is(.profile-link, time) { font-weight: 600; }
:root body[data-game] #view-daily .daily-empty { padding: 26px 8px; border: 0; background: transparent; font-size: 14px; color: var(--ui-ink); }
:root body[data-game] #view-daily .daily-empty > span { display: block; max-width: 28ch; margin: 8px auto 0; color: var(--ui-muted); font-size: 13px; line-height: 1.6; }
@media (max-width: 860px) {
  :root body[data-game] #view-daily .daily-page-feature { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 500px) {
  :root body[data-game] #view-daily :is(.daily-hero, .daily-standings) { padding: 20px; }
  :root body[data-game] #view-daily .daily-stages { gap: 6px; }
  :root body[data-game] #view-daily .daily-action-buttons { grid-template-columns: minmax(0, 1fr); }
}

/* Archive: orderly filters and spoiler-free cards that retain each game's accent. */
:root body #view-browse .archive-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
:root body #view-browse .archive-search { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 0 16px; border: 1px solid var(--ui-line); border-radius: 14px; background: var(--ui-surface); }
:root body #view-browse .archive-search:focus-within { border-color: var(--ui-accent); box-shadow: 0 0 0 3px var(--ui-accent-soft); }
:root body #view-browse .archive-search svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--ui-muted); stroke-width: 1.8; stroke-linecap: round; }
:root body #view-browse .archive-search input { width: 100%; min-width: 0; min-height: 52px; padding: 12px 0; border: 0; outline: 0; background: transparent; font-size: 16px; box-shadow: none; }
:root body #view-browse .archive-toolbar .btn-outline { min-height: 52px; flex: none; border-color: transparent; background: var(--ui-accent-soft); color: var(--ui-accent); }
:root body #view-browse .filters { position: static; padding: 20px; gap: 16px; margin-bottom: 24px; }
:root body #view-browse .filter-summary { min-height: 44px; cursor: pointer; list-style: none; }
:root body #view-browse .filter-summary::-webkit-details-marker { display: none; }
:root body #view-browse .filter-summary strong { margin-right: auto; }
:root body #view-browse .archive-filter-panel[open] .filter-summary { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--ui-line); }
:root body #view-browse .archive-filter-chevron { width: 16px; height: 16px; flex: 0 0 16px; color: var(--ui-muted); }
:root body #view-browse .archive-filter-panel[open] .archive-filter-chevron { transform: rotate(180deg); }
:root body #view-browse .filter-summary strong { font-size: 14px; font-weight: 650; }
:root body #view-browse #browse-count { padding: 5px 10px; border-radius: 8px; color: var(--ui-accent); background: var(--ui-accent-soft); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
:root body #view-browse .filter-groups { display: grid; gap: 14px; }
:root body #view-browse .filter-group { display: flex; align-items: center; gap: 6px; }
:root body #view-browse .filter-label { width: 84px; flex: 0 0 84px; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
:root body #view-browse .chip { font-size: 12px; font-weight: 550; min-width: 44px; border-color: transparent; background: var(--ui-soft); }
:root body #view-browse .chip.on { color: var(--ui-accent); background: var(--ui-accent-soft); border-color: color-mix(in srgb, var(--ui-accent) 45%, var(--ui-line)); }
:root body #view-browse .puzzle-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
:root body #view-browse .pz-card { gap: 12px; padding: 12px; }
:root body #view-browse :is(.pz-mystery, .pz-card canvas) { border-radius: 12px; }
:root body #view-browse .pz-card canvas { object-fit: contain; background: var(--ui-soft); }
:root body #view-browse .pz-mystery { background: linear-gradient(145deg, var(--ui-accent-soft), color-mix(in srgb, var(--ui-accent) 15%, var(--ui-surface))); }
:root body #view-browse .pz-mystery::after { display: none; }
:root body #view-browse .pz-mystery > svg { fill: color-mix(in srgb, var(--ui-accent) 55%, var(--ui-surface)); }
:root body #view-browse .pz-title { font-size: 14px; font-weight: 650; gap: 6px; flex-wrap: wrap; }
:root body #view-browse .pz-solved { padding: 3px 6px; border-radius: 6px; background: color-mix(in srgb, var(--ui-success) 9%, var(--ui-surface)); font-size: 11px; color: var(--ui-success); }
:root body #view-browse .pz-meta { padding-top: 8px; border-top: 1px solid var(--ui-line); font-size: 11px; gap: 4px; flex-wrap: wrap; }
:root body #view-browse .archive-empty { grid-column: 1 / -1; padding: 48px 24px; text-align: center; border: 1px solid var(--ui-line); border-radius: 20px; background: var(--ui-surface); }
:root body #view-browse .archive-empty-mark { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--ui-accent-soft); color: var(--ui-accent); font-size: 22px; }
:root body #view-browse .archive-empty h2 { margin: 16px 0 8px; font-size: 18px; font-weight: 650; }
:root body #view-browse .archive-empty p { margin: 0 auto 20px; max-width: 34ch; color: var(--ui-muted); font-size: 14px; line-height: 1.5; }
@media (max-width: 600px) {
  :root body #view-browse .archive-toolbar { flex-wrap: wrap; gap: 8px; }
  :root body #view-browse .archive-search { flex-basis: 100%; }
  :root body #view-browse .archive-toolbar .btn-outline { min-height: 44px; padding: 8px 12px; margin-left: auto; }
  :root body #view-browse .puzzle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  :root body #view-browse .filters { padding: 12px; gap: 12px; }
  :root body #view-browse .filter-groups { gap: 12px; }
  :root body #view-browse .filter-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  :root body #view-browse .filter-group:first-child { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  :root body #view-browse .filter-label { width: auto; grid-column: 1 / -1; }
  :root body #view-browse .chip { padding-inline: 4px; }
  :root body #view-browse .pz-card { padding: 10px; gap: 10px; }
}

/* Versus setup: one aligned form surface, readable controls, and a complete match summary. */
:root body[data-game] .duel-create-panel { padding: 0; border-top: 3px solid var(--ui-accent); }
:root body[data-game] .duel-create-panel :is(.duel-form-head, .duel-create-main, .duel-create-footer) { padding: 20px; }
:root body[data-game] .duel-create-panel .duel-form-head { background: var(--ui-surface); }
:root body[data-game] .duel-create-panel .duel-form-head h2 { font-size: 20px; font-weight: 700; }
:root body[data-game] .duel-create-panel .panel-sub { margin-top: 5px; font-size: 13px; line-height: 1.5; }
:root body[data-game] .duel-create-main { gap: 20px; }
:root body[data-game] .duel-create-panel .duel-field { gap: 8px; min-width: 0; }
:root body[data-game] .duel-create-panel :is(.duel-field > span, .duel-field legend) { font-size: 13px; font-weight: 650; }
:root body[data-game] .duel-create-panel .duel-input { min-height: 46px; font-size: 16px; border-radius: 3px; }
:root body[data-game] .duel-create-panel .duel-field-note { font-size: 12px; line-height: 1.45; }
:root body[data-game] .duel-create-panel .duel-visibility-row { margin-top: 6px; }
:root body[data-game] .duel-create-panel .duel-choice > span { border-radius: 3px; box-shadow: none; }
:root body[data-game] .duel-create-panel .duel-visibility > span { min-height: 64px; padding: 11px 10px; gap: 8px; }
:root body[data-game] .duel-create-panel .duel-choice b { font-size: 13px; font-weight: 650; }
:root body[data-game] .duel-create-panel .duel-choice small { margin-top: 4px; font-size: 11px; line-height: 1.35; font-weight: 500; }
:root body[data-game] .duel-create-panel .duel-choice input:checked + span { border-color: var(--ui-accent); background: var(--ui-accent-soft); color: var(--ui-accent); }
:root body[data-game] .duel-create-panel .duel-game-choices { gap: 8px; }
:root body[data-game] .duel-create-panel .duel-game-choices span { min-height: 44px; display: grid; place-items: center; border-radius: 3px; font-size: 12px; font-weight: 600; }
:root body[data-game] .duel-create-panel .duel-game-choices input:focus-visible + span { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
:root body[data-game] .duel-create-panel .duel-rating-note { min-height: 0; padding: 12px; background: var(--ui-soft); border: 0; gap: 12px; }
:root body[data-game] .duel-create-panel .duel-rating-note b { font-size: 13px; font-weight: 650; }
:root body[data-game] .duel-create-panel .duel-rating-note small { font-size: 12px; line-height: 1.4; margin-top: 3px; }
:root body[data-game] .duel-create-panel .duel-format-pair { gap: 18px 12px; }
:root body[data-game] .duel-create-panel .duel-target-field { padding: 14px; background: var(--ui-soft); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
:root body[data-game] .duel-create-panel .duel-target-field .duel-field-note { grid-column: 1 / -1; }
:root body[data-game] .duel-create-panel .duel-target-control { display: flex; justify-content: flex-start; gap: 12px; }
:root body[data-game] .duel-create-panel .duel-target-control .duel-input { width: 80px; flex: 0 0 80px; font-size: 20px; font-weight: 700; }
:root body[data-game] .duel-create-panel .duel-advanced summary { min-height: 64px; padding: 12px 14px; gap: 12px; }
:root body[data-game] .duel-create-panel .duel-advanced summary b { font-size: 13px; font-weight: 650; }
:root body[data-game] .duel-create-panel .duel-advanced summary small { margin-top: 4px; font-size: 12px; font-weight: 500; line-height: 1.4; white-space: normal; }
:root body[data-game] .duel-create-panel .duel-advanced summary::after { font-size: 11px; font-weight: 600; border-radius: 3px; padding: 6px 8px; }
:root body[data-game] .duel-create-panel .duel-advanced-body { display: grid; gap: 22px; padding: 18px; }
:root body[data-game] .duel-create-panel .duel-advanced-grid { gap: 18px 12px; }
:root body[data-game] .duel-create-panel .duel-create-footer { gap: 14px; }
:root body[data-game] .duel-create-panel .duel-create-summary { display: grid; gap: 5px; font-size: 12px; line-height: 1.5; }
:root body[data-game] .duel-create-panel .duel-create-summary b { font-size: 13px; font-weight: 650; text-align: left; white-space: normal; overflow: visible; }
:root body[data-game] .duel-create-panel .duel-create-footer .btn { min-height: 48px; font-size: 14px; font-weight: 650; }
@media (max-width: 500px) {
  :root body[data-game] .duel-create-panel :is(.duel-form-head, .duel-create-main, .duel-create-footer) { padding: 18px 16px; }
}

/* Puzzle Rush keeps its racing character with readable, aligned setup controls. */
:root body[data-game] #view-rush .rush-page-heading {
  min-height: 0; padding: 24px; border-radius: 4px; border-color: var(--ui-line);
  background: var(--ui-surface); box-shadow: none;
}
:root body[data-game] #view-rush .rush-page-heading::after {
  height: 4px; opacity: .6; background: repeating-linear-gradient(90deg, var(--ui-accent) 0 8px, transparent 8px 16px);
}
:root body[data-game] #view-rush .rush-create-panel { padding: 0; border-top: 3px solid var(--ui-accent); }
:root body[data-game] #view-rush .rush-create-panel :is(.rush-form-head, .rush-create-main, .rush-create-footer) { padding: 20px; }
:root body[data-game] #view-rush .rush-form-head h2 { font-size: 20px; font-weight: 700; }
:root body[data-game] #view-rush .rush-form-head .panel-sub { font-size: 13px; line-height: 1.5; margin-top: 5px; }
:root body[data-game] #view-rush .rush-create-main { gap: 20px; }
:root body[data-game] #view-rush .rush-field { gap: 8px; }
:root body[data-game] #view-rush .rush-field :is(legend, .rush-field-note),
:root body[data-game] #view-rush .rush-field > span { font-size: 13px; font-weight: 600; }
:root body[data-game] #view-rush .rush-field legend { margin-bottom: 8px; }
:root body[data-game] #view-rush .rush-field .rush-field-note { font-size: 12px; font-weight: 400; line-height: 1.5; }
:root body[data-game] #view-rush .rush-input { min-height: 46px; font-size: 16px; border-radius: 3px; }
:root body[data-game] #view-rush .rush-choice > span {
  min-height: 46px; border-radius: 3px; background: var(--ui-surface); font-weight: 600;
  transition: none; box-shadow: none;
}
:root body[data-game] #view-rush .rush-choice > input:checked + span { color: var(--ui-accent); background: var(--ui-accent-soft); border-color: var(--ui-accent); box-shadow: none; }
:root body[data-game] #view-rush .rush-choice > input:focus-visible + span { outline: 2px solid var(--ui-accent); outline-offset: 3px; }
:root body[data-game] #view-rush .rush-choice :is(b, small) { display: block; }
:root body[data-game] #view-rush .rush-choice b { font-size: 13px; font-weight: 650; }
:root body[data-game] #view-rush .rush-choice small { margin-top: 4px; font-size: 12px; line-height: 1.45; font-weight: 400; }
:root body[data-game] #view-rush .rush-visibility > span { min-height: 66px; padding: 11px 10px; }
:root body[data-game] #view-rush .rush-guest-note { padding: 12px; border: 0; border-radius: 3px; background: var(--ui-soft); }
:root body[data-game] #view-rush .rush-guest-note b { font-size: 13px; font-weight: 650; }
:root body[data-game] #view-rush .rush-guest-note small { font-size: 12px; line-height: 1.5; }
:root body[data-game] #view-rush .rush-mode-picks { grid-template-columns: minmax(0, 1fr); gap: 8px; }
:root body[data-game] #view-rush .rush-mode-choice > span { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; min-height: 76px; padding: 12px; }
:root body[data-game] #view-rush .rush-mode-choice .rush-mode-icon { width: 32px; height: 32px; color: var(--ui-accent); border-radius: 3px; background: var(--ui-soft); }
:root body[data-game] #view-rush .rush-mode-choice input:checked + span { box-shadow: inset 3px 0 var(--ui-accent); }
:root body[data-game] #view-rush .rush-time-picks { gap: 6px; }
:root body[data-game] #view-rush .rush-time-picks .rush-choice > span { min-height: 44px; font-size: 12px; padding-inline: 3px; }
:root body[data-game] #view-rush .rush-target-control { border-radius: 3px; background: var(--ui-surface); }
:root body[data-game] #view-rush .rush-target-control .rush-input { border: 0; border-radius: 0; }
:root body[data-game] #view-rush .rush-custom-time { margin-top: 12px; }
:root body[data-game] #view-rush .rush-settings { border-radius: 3px; }
:root body[data-game] #view-rush .rush-settings summary { min-height: 66px; padding: 12px; }
:root body[data-game] #view-rush .rush-settings summary b { font-size: 13px; font-weight: 650; }
:root body[data-game] #view-rush .rush-settings summary small { font-size: 12px; font-weight: 400; line-height: 1.5; margin-top: 4px; }
:root body[data-game] #view-rush .rush-settings summary::after { padding: 6px 8px; font-size: 11px; border-radius: 3px; color: var(--ui-accent); }
:root body[data-game] #view-rush .rush-settings-body { gap: 18px; padding: 14px; }
:root body[data-game] #view-rush .rush-settings-rule { border-radius: 3px; }
:root body[data-game] #view-rush .rush-car-control { border-radius: 3px; box-shadow: none; }
:root body[data-game] #view-rush .rush-create-footer { gap: 14px; }
:root body[data-game] #view-rush .rush-create-summary { display: grid; gap: 5px; font-size: 12px; line-height: 1.5; }
:root body[data-game] #view-rush .rush-create-summary b { font-size: 13px; font-weight: 650; text-align: left; white-space: normal; overflow: visible; }
:root body[data-game] #view-rush .rush-submit { min-height: 48px; font-size: 14px; }
:root body[data-game] #view-rush .rush-directory { padding: 0; }
:root body[data-game] #view-rush .rush-directory-head { padding: 20px; gap: 8px; flex-wrap: wrap; }
:root body[data-game] #view-rush :is(.rush-directory-head, .rush-rating-head) h2 { font-size: 20px; line-height: 1.3; }
:root body[data-game] #view-rush .rush-directory-head span { font-size: 12px; line-height: 1.5; }
:root body[data-game] #view-rush .rush-directory-list .rush-empty { border: 0; border-radius: 0; padding: 24px 20px; min-height: 130px; font-size: 13px; line-height: 1.5; gap: 8px; }
:root body[data-game] #view-rush .rush-room-card { border: 0; border-radius: 0; border-bottom: 1px solid var(--ui-line); padding: 16px 20px; }
:root body[data-game] #view-rush .rush-mode-tag { border-radius: 3px; font-size: 10px; font-weight: 600; letter-spacing: 0; text-transform: none; }
:root body[data-game] #view-rush .rush-room-meta { font-size: 12px; line-height: 1.6; margin-top: 8px; }
:root body[data-game] #view-rush .rush-room-meta > span { display: block; }
:root body[data-game] #view-rush .rush-room-card .btn { min-height: 44px; display: flex; align-items: center; justify-content: center; font-size: 13px; }
@media (max-width: 500px) {
  :root body[data-game] #view-rush .rush-page-heading { padding: 20px 16px; }
  :root body[data-game] #view-rush .rush-create-panel :is(.rush-form-head, .rush-create-main, .rush-create-footer) { padding: 18px 16px; }
  :root body[data-game] #view-rush .rush-inline-grid { grid-template-columns: minmax(0, 1fr); }
  :root body[data-game] #view-rush .rush-custom-time { grid-template-columns: minmax(0, 1fr); }
  :root body[data-game] #view-rush .rush-room-card { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px; }
  :root body[data-game] #view-rush .rush-room-card .btn { justify-self: end; width: auto; min-width: 88px; }
}

/* Keep race identities and secondary actions clear at narrow widths. */
:root body[data-game] #view-rush .rush-player { border-radius: 3px; }
:root body[data-game] #view-rush .rush-player-copy { flex: 1; }
:root body[data-game] #view-rush .rush-player-identity { display: flex; align-items: center; gap: 8px; min-width: 0; }
:root body[data-game] #view-rush .rush-player-identity b { min-width: 0; flex: 1; font-size: 13px; font-weight: 650; }
:root body[data-game] #view-rush .rush-you-tag {
  flex: none; padding: 3px 6px; border-radius: 3px; color: var(--ui-accent);
  background: var(--ui-accent-soft); font-size: 11px; font-weight: 600; line-height: 1.3;
}
:root body[data-game] #view-rush .rush-player small { margin-top: 5px; font-size: 12px; line-height: 1.5; }
:root body[data-game] #view-rush .rush-rule { align-items: start; }
:root body[data-game] #view-rush .rush-rule i { border-radius: 3px; }
:root body[data-game] #view-rush .rush-rule b { font-size: 14px; font-weight: 650; line-height: 1.5; }
:root body[data-game] #view-rush .rush-rule span { margin-top: 3px; font-size: 12px; line-height: 1.5; }
:root body[data-game] #view-rush .rush-lobby-actions .rush-leave-link {
  min-height: 44px; border-color: transparent; color: var(--ui-muted);
  background: transparent; font-weight: 500;
}
:root body[data-game] #view-rush .rush-lobby-actions .rush-leave-link:hover { color: var(--ui-ink); background: var(--ui-soft); }
@media (max-width: 360px) {
  :root body[data-game] #view-rush .rush-time-picks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  :root body[data-game] #view-rush .rush-custom-time-choice { grid-column: 1 / -1; }
}

/* Editorial page rhythm: a firm masthead, generous canvas, and clear actions. */
:root body .topbar {
  min-height: 76px; gap: 24px; padding-inline: max(24px, calc((100vw - 1200px) / 2));
  box-shadow: none; border-top: 3px solid var(--ui-accent); border-bottom: 1px solid var(--ui-line);
}
:root body .topbar .game-switcher { padding: 5px 0; border: 0; background: transparent; gap: 10px; font-size: 20px; }
:root body .topbar .tabs { padding: 0; gap: 4px; background: transparent; border: 0; border-radius: 0; }
:root body .topbar .tabs a { display: flex; align-items: center; min-height: 46px; padding: 10px 16px; color: var(--ui-muted); border: 0; border-radius: 0; font-size: 14px; }
:root body .topbar .tabs a.active { color: var(--ui-ink); background: transparent; box-shadow: inset 0 -3px var(--ui-accent); }
:root body .topbar .tabs a:hover { color: var(--ui-ink); background: var(--ui-soft); }
:root body .topbar :is(.theme-btn, .account-nav) { min-height: 42px; border-color: var(--ui-line); }
:root body .page { max-width: 1200px; padding-top: 44px; padding-bottom: 72px; }
:root body .page-heading { gap: 24px; align-items: end; padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--ui-line); }
:root body .page-heading h1 { font-size: clamp(36px, 4.2vw, 54px); line-height: 1.06; font-weight: 750; letter-spacing: -.055em; }
:root body .page-heading .sub { font-size: 15px; max-width: 64ch; margin-top: 12px; font-weight: 400; }
:root body .page-eyebrow { margin-bottom: 12px; font-size: 10px; letter-spacing: .12em; }
:root body .page-eyebrow::before { display: none; }
:root body .section-heading { margin-block: 28px 18px; }
:root body .section-heading h2 { font-size: 23px; font-weight: 700; }
:root body :is(.btn, .btn-outline, .button) { min-height: 46px; padding: 11px 20px; line-height: 1.35; border-radius: 3px; font-size: 14px; letter-spacing: -.01em; }
:root body :is(.btn, .button.primary) { border: 1px solid var(--ui-accent); box-shadow: inset 0 -2px rgb(0 0 0 / 12%); }
:root body :is(.btn.secondary, .btn-outline, .button:not(.primary)) { box-shadow: none; }
:root body :is(.btn, .btn-outline, .button):active:not(:disabled) { transform: translateY(1px); }
:root body :is(.btn, .btn-outline, .button):disabled { cursor: not-allowed; opacity: .5; }
:root body :is(.duel-input, .rush-input, .auth-input) { min-height: 46px; font-size: 15px; border-color: var(--ui-strong); }
:root body :is(.duel-field, .rush-field) > :is(span, legend) { font-size: 13px; font-weight: 650; }

/* Practice reads as a workspace rather than a stack of duplicate headings. */
:root body[data-game] #view-random { max-width: 1080px; }
:root body[data-game] #view-random .random-panel {
  display: grid; grid-template-columns: 230px minmax(0, 1fr); column-gap: 40px; row-gap: 24px;
  padding: 32px; border: 1px solid var(--ui-line); border-top: 3px solid var(--ui-accent);
}
:root body[data-game] #view-random .random-panel-head {
  grid-column: 1; grid-row: 1 / span 4; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start;
  margin: 0; padding: 12px 28px 12px 0; gap: 24px; background: transparent; border: 0; border-right: 1px solid var(--ui-line); border-radius: 0;
}
:root body[data-game] #view-random .random-visual { width: 96px; height: 96px; flex: none; border-radius: 3px; }
:root body[data-game] #view-random .random-panel-title h2 { font-size: 28px; letter-spacing: -.04em; line-height: 1.15; margin-top: 8px; }
:root body[data-game] #view-random .random-section-label { font-size: 10px; letter-spacing: .1em; }
:root body[data-game] #view-random .random-field { grid-column: 2; margin: 0; }
:root body[data-game] #view-random .random-field legend { font-size: 15px; margin-bottom: 14px; }
:root body[data-game] #view-random :is(.random-generate, .random-status) { grid-column: 2; margin: 0; }
:root body[data-game] #view-random .random-choice span { min-height: 50px; font-size: 14px; background: var(--ui-bg); border-color: var(--ui-line); }
:root body[data-game] #view-random .random-choice input:checked + span { color: var(--ui-accent); background: var(--ui-accent-soft); border-color: var(--ui-accent); box-shadow: inset 0 -2px var(--ui-accent); }
:root body[data-game] #view-random .random-generate { min-height: 52px; margin-top: 4px; }
:root body[data-game] .day-grid { gap: 16px; }
:root body[data-game] .day-card { padding: 22px; min-height: 214px; border-top: 2px solid var(--ui-line); }
:root body[data-game] .day-card.today { border-top-color: var(--ui-accent); box-shadow: none; background: var(--ui-accent-soft); }
:root body[data-game] .day-name { font-size: 22px; letter-spacing: -.035em; }
:root body[data-game] .day-level { font-size: 10px; letter-spacing: .08em; }
:root body[data-game] .practice-nav-action { min-height: 70px; padding: 14px; background: transparent; }
:root body[data-game] .heading-badge { background: transparent; border: 0; border-left: 1px solid var(--ui-line); border-radius: 0; padding-left: 24px; }

/* Match creation gets equal columns and fewer competing surfaces. */
:root body[data-game] .duel-create-layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 24px; }
:root body[data-game] .duel-form-head { padding: 24px; background: transparent; }
:root body[data-game] .duel-form-head h2 { font-size: 26px; letter-spacing: -.04em; }
:root body[data-game] .duel-create-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px 16px; padding: 24px; }
:root body[data-game] .duel-create-main > :is(.duel-fieldset, .duel-identity, .duel-rating-note, .duel-format-pair, .duel-advanced),
:root body[data-game] .duel-create-main > .duel-field:first-child,
:root body[data-game] .duel-create-main > .duel-target-field { grid-column: 1 / -1; }
:root body[data-game] .duel-create-main > .duel-field { margin: 0; }
:root body[data-game] .duel-target-field { padding: 0; border: 0; border-radius: 0; background: transparent; }
:root body[data-game] .duel-target-control { min-height: 46px; justify-content: flex-start; gap: 10px; }
:root body[data-game] .duel-target-control .duel-input { width: 70px; height: 46px; min-height: 46px; }
:root body[data-game] .duel-rating-note { padding: 12px 0; border-block: 1px solid var(--ui-line); border-radius: 0; background: transparent; }
:root body[data-game] .duel-create-footer { padding: 20px 24px 24px; background: var(--ui-soft); }
:root body[data-game] .duel-create-footer .btn { min-height: 50px; }
:root body[data-game] .duel-field-note { font-size: 12px; font-weight: 400; line-height: 1.5; }
:root body[data-game] .duel-visibility > span { min-height: 64px; padding: 12px; background: var(--ui-bg); }
:root body[data-game] .duel-choice input:checked + span { background: var(--ui-accent-soft); border-color: var(--ui-accent); }
:root body[data-game] .duel-page-guide { gap: 0; border: 0; background: transparent; }
:root body[data-game] .duel-page-guide > span { border: 0; border-left: 1px solid var(--ui-line); padding: 0 18px; background: transparent; }
:root body[data-game] .arena-directory-head { padding: 22px; }
:root body[data-game] .arena-directory-head h2 { font-size: 22px; }
:root body[data-game] .arena-empty { padding: 24px 16px; border: 0; background: var(--ui-bg); font-size: 13px; line-height: 1.55; }
:root body[data-game] .arena-rating-board { padding: 24px; }
:root body[data-game] .arena-rating-head h2 { font-size: 22px; }
:root body[data-game] .arena-rating-head > span { border-radius: 2px; font-size: 9px; }

/* The playing frame stays compact and level, leaving the board in control. */
:root body[data-game] #view-game .g-header { min-height: 60px; padding: 7px 0; margin-bottom: 16px; background: transparent; border: 0; border-bottom: 2px solid var(--ui-accent); border-radius: 0; }
:root body[data-game] #view-game .g-title { font-size: 20px; font-weight: 700; letter-spacing: -.035em; }
:root body[data-game] #view-game .g-header .icon-btn { width: 40px; height: 40px; border: 0; background: transparent; }
:root body[data-game] #view-game .g-header .icon-btn:hover { background: var(--ui-soft); }
:root body[data-game] #view-game .g-subhead { margin-bottom: 16px; }
:root body[data-game] #view-game .g-timer { font-size: 19px; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
:root body[data-game] #view-game .g-diff { background: transparent; border: 0; color: var(--ui-muted); font-size: 10px; letter-spacing: .08em; }
:root body[data-game] #view-game .g-actions { margin-top: 16px; gap: 10px; }
:root body[data-game] #view-game .howto { margin-top: 18px; border: 0; border-top: 1px solid var(--ui-line); border-bottom: 1px solid var(--ui-line); background: transparent; border-radius: 0; }
:root body[data-game] #view-game .howto > summary { padding: 16px 4px; }
:root body[data-game] .modal { border-top-width: 3px; border-radius: 4px; padding: 28px; box-shadow: 0 20px 80px rgb(0 0 0 / 22%); }
:root body[data-game] .game-settings-modal .toggle-row { min-height: 82px; }
:root body[data-game] .game-settings-modal .settings-intro { color: var(--ui-muted); font-weight: 400; }
:root body[data-game] #view-daily .daily-hero { padding: 36px; gap: 28px; }
:root body[data-game] #view-daily .daily-hero h2 { font-size: clamp(30px, 3vw, 40px); letter-spacing: -.05em; }
:root body[data-game] #view-daily .daily-stages li { height: 56px; font-size: 18px; }
:root body[data-game] #view-daily .daily-standings { padding: 28px; }
:root body[data-game] .stat-card { border-top: 1px solid var(--ui-line); padding: 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
:root body[data-game] .stat-card:first-child { background: linear-gradient(145deg, var(--ui-accent-soft), var(--ui-surface)); }
:root body[data-game] .stat-card .k { margin: 0; font-size: 12px; color: var(--ui-muted); font-weight: 550; }
:root body[data-game] .stat-card .v { font-size: clamp(28px, 3vw, 38px); font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
:root body[data-game] .stat-card :is(.stat-total, .stat-unit) { font-size: 14px; font-weight: 500; letter-spacing: -.01em; color: var(--ui-muted); }
:root body[data-game] .stat-note { margin-top: auto; font-size: 11px; line-height: 1.5; color: var(--ui-muted); }
:root body[data-game] .stat-progress { width: 100%; height: 4px; border: 0; border-radius: 4px; overflow: hidden; appearance: none; background: var(--ui-soft); }
:root body[data-game] .stat-progress::-webkit-progress-bar { background: var(--ui-soft); }
:root body[data-game] .stat-progress::-webkit-progress-value { background: var(--ui-accent); border-radius: 4px; }
:root body[data-game] .stat-progress::-moz-progress-bar { background: var(--ui-accent); border-radius: 4px; }
:root body[data-game] .stats-leaderboard-hub { padding: 24px; border-radius: 20px; background: var(--ui-surface); box-shadow: 0 4px 20px #17244904; }
:root body[data-game] .stats-leaderboard-link { padding: 18px 14px; background: var(--ui-surface); border-radius: 14px; }
:root body[data-game] .stats-leaderboard-link:hover { background: var(--ui-accent-soft); transform: none; }
:root body[data-game] #view-stats .stats-leaderboard-link { background: var(--ui-surface); }
:root body[data-game] #view-stats .stats-leaderboard-link:hover { background: var(--ui-accent-soft); }
:root body[data-game] .stats-leaderboard-link b { font-size: 13px; white-space: normal; }
:root body[data-game] .stats-leaderboard-link small { font-size: 11px; line-height: 1.5; }
:root body .logic-cookie-footer { max-width: 1200px; margin-inline: auto; border-top-color: var(--ui-line); }
@media (max-width: 960px) {
  :root body[data-game] .duel-create-layout { grid-template-columns: minmax(0, 1fr); }
  :root body .topbar { gap: 12px; padding-inline: 20px; }
  :root body .topbar .tabs a { padding-inline: 12px; }
}
@media (max-width: 680px) {
  :root body .topbar { min-height: 112px; gap: 10px; padding: 10px 16px 0; }
  :root body .topbar .game-switcher { font-size: 18px; }
  :root body .topbar .tabs { width: 100%; gap: 0; border-top: 1px solid var(--ui-line); }
  :root body .topbar .tabs a { flex: 1; justify-content: center; padding: 12px 6px; font-size: 12px; min-height: 44px; }
  :root body .page { padding: 28px 16px 48px; }
  :root body .page-heading { gap: 20px; padding-bottom: 22px; margin-bottom: 22px; }
  :root body .page-heading h1 { font-size: 38px; }
  :root body .page-heading .sub { font-size: 14px; line-height: 1.55; }
  :root body[data-game] #view-random .random-panel { grid-template-columns: minmax(0, 1fr); padding: 20px; gap: 22px; }
  :root body[data-game] #view-random .random-panel-head { grid-row: auto; grid-column: 1; flex-direction: row; align-items: center; gap: 16px; padding: 0 0 20px; border: 0; border-bottom: 1px solid var(--ui-line); }
  :root body[data-game] #view-random .random-visual { width: 56px; height: 56px; }
  :root body[data-game] #view-random .random-panel-title h2 { font-size: 22px; margin-top: 4px; }
  :root body[data-game] #view-random :is(.random-field, .random-generate, .random-status) { grid-column: 1; }
  :root body[data-game] #view-random .random-choice span { min-height: 46px; font-size: 12px; }
  :root body[data-game] .day-card { padding: 16px; min-height: 200px; }
  :root body[data-game] .day-name { font-size: 21px; }
  :root body[data-game] .duel-create-main { gap: 20px 14px; padding: 20px; }
  :root body[data-game] .duel-form-head { padding: 22px 20px; }
  :root body[data-game] .duel-create-footer { padding: 20px; }
  :root body[data-game] .duel-page-guide { display: none; }
  :root body[data-game] #view-daily :is(.daily-hero, .daily-standings) { padding: 24px; }
  :root body[data-game] .modal { padding: 22px; }
}
@media (max-width: 380px) {
  :root body[data-game] .duel-create-main { grid-template-columns: minmax(0, 1fr); }
  :root body .page-heading h1 { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  :root body :is(.btn, .btn-outline, .button):active:not(:disabled) { transform: none; }
}
@media (max-width: 680px) {
  :root body[data-game] .day-head { position: relative; min-height: 76px; }
  :root body[data-game] .day-head .today-tag { position: absolute; top: 50px; left: 0; margin: 0; font-size: 9px; line-height: 1.3; padding: 3px 6px; }
}

@media (max-width: 500px) {
  :root body[data-game] .duel-create-panel .duel-target-field { grid-template-columns: minmax(0, 1fr); }
  :root body[data-game] .duel-create-panel .duel-target-field > span { white-space: nowrap; }
}


/* Modern shared surfaces. These selectors deliberately exclude game pieces. */
:root body {
  background: radial-gradient(ellipse at 8% 0%, color-mix(in srgb, var(--ui-accent) 7%, transparent), transparent 48%), var(--ui-bg);
  background-attachment: fixed;
}
:root body:is([data-game], [data-social-game], .game-catalog) :is(.page-eyebrow, .eyebrow, .eyebrow-label, .banner-kicker, .game-dropdown-label) {
  font-family: var(--ui-display-font); font-size: 11px; font-weight: 700; letter-spacing: .075em;
}
:root body:is([data-game], [data-social-game], .game-catalog) :is(.page-eyebrow, .eyebrow, .eyebrow-label)::before { border-radius: 50%; }
:root body:is([data-game], [data-social-game], .game-catalog) :is(.g-timer, .day-num, .stat-value, .catalog-count) { font-family: var(--ui-display-font); }
:root body:is([data-game], [data-social-game], .game-catalog) :is(.topbar, .site-header) {
  background: color-mix(in srgb, var(--ui-surface) 90%, transparent);
  border-top: 0; box-shadow: 0 4px 24px #17244905;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
:root body .topbar {
  width: calc(100% - 32px); max-width: 1200px; margin: 16px auto 0; top: 12px;
  padding: 10px 16px; gap: 20px; min-height: 76px;
  border: 1px solid color-mix(in srgb, var(--ui-line) 80%, transparent); border-radius: 20px;
  box-shadow: 0 8px 32px #17244908;
}
:root body .topbar .tabs { padding: 4px; gap: 3px; border-radius: 14px; background: transparent; }
:root body .topbar .tabs a { min-height: 44px; gap: 8px; border-radius: 11px; padding: 10px 13px; font-size: 13px; }
:root body .topbar .tabs .nav-icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
:root body .topbar .tabs a.active {
  color: var(--ui-accent); background: var(--ui-accent-soft); box-shadow: none;
}
:root body .topbar .brand { border: 0; padding: 6px; background: transparent; }
:root body .topbar .brand-game-icon { width: 34px; height: 34px; box-shadow: 0 4px 12px color-mix(in srgb, var(--ui-accent) 20%, transparent); }
:root body:is([data-game], [data-social-game], .game-catalog) :is(.game-switcher, .brand .logo, .brand-game-icon, .game-dropdown-icon) { border-radius: 10px; }
:root body .game-dropdown { border-radius: 16px; border-color: var(--ui-line); box-shadow: var(--ui-shadow); }
:root body .game-dropdown-item { border-radius: 10px; }
:root body .game-dropdown-item[aria-current="page"] { box-shadow: none; border-color: transparent; }
:root body:is([data-game], [data-social-game], .game-catalog) :is(.game-current-indicator, .today-tag, .rating-mode-tag, .visibility-badge, .source-badge, .badge) { border-radius: 6px; }
:root body .page-heading { border-bottom: 0; padding-bottom: 8px; }
:root body .page-heading h1 { font-size: clamp(36px, 4.6vw, 56px); letter-spacing: -.055em; line-height: 1.08; }
:root body .page-heading .sub { line-height: 1.65; }
:root body:is([data-game], [data-social-game], .game-catalog) :is(.btn, .btn-outline, .button, .chip, .account-nav, .theme-btn,
  .icon-btn, .hub-theme-button, .filter-chip, .logic-cookie-button, .logic-cookie-settings) {
  border-radius: 10px; box-shadow: none;
}
:root body:is([data-game], [data-social-game], .game-catalog) :is(.btn, .button.primary) {
  background-image: linear-gradient(180deg, #ffffff0c, #00000006);
  box-shadow: inset 0 1px #ffffff26, 0 4px 10px color-mix(in srgb, var(--ui-accent) 16%, transparent);
}
:root body:is([data-game], [data-social-game], .game-catalog) :is(.btn.secondary, .btn-outline, .button:not(.primary)) { box-shadow: 0 2px 4px #17244904; }
:root body:is([data-game], [data-social-game], .game-catalog) :is(.btn, .button, .btn-outline, .chip, .theme-btn) { transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
:root body:is([data-game], [data-social-game], .game-catalog) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
  border-radius: 10px; background-color: var(--ui-surface);
}
:root body:is([data-game], [data-social-game], .game-catalog) :is(.day-card, .pz-card, .stat-card, .filters, .random-panel, .daily-card,
  .daily-summary, .daily-run-card, .duel-card, .duel-create-card, .duel-form-card,
  .match-directory, .directory-panel, .duel-create-panel, .arena-directory,
  .arena-match, .arena-empty, .arena-rating-board, .leaderboard-card,
  .leaderboard-panel, .duel-leaderboard, .rush-card, .rush-panel, .rush-create-card,
  .rush-lobby-card, .rush-room-card, .rush-empty, .auth-card, .auth-form-panel,
  .account-card, .profile-card, .panel, .lobby-seat, .table-banner, .table-card,
  .empty-state, .empty-page, .howto-guide, .modal, .modal-card, .logic-cookie-card) {
  border-radius: 20px; border-color: color-mix(in srgb, var(--ui-line) 75%, transparent);
  box-shadow: 0 2px 3px #17244903, 0 12px 32px #17244906;
}
:root body:is([data-game], [data-social-game], .game-catalog) :is(.modal, .modal-card, .logic-cookie-card) { box-shadow: var(--ui-shadow); border-top-width: 1px; }
:root body:is([data-game], [data-social-game], .game-catalog) :is(.random-panel, .duel-create-card, .rush-create-card) { border-top-width: 1px; }
:root body[data-game] .day-card { border-top-width: 1px; padding: 24px; background-image: none; }
:root body[data-game] .day-card .day-name { font-size: 23px; }
:root body[data-game] .day-card .day-level { margin-top: 5px; font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; }
:root body[data-game] .day-card .crowns { margin: 16px 0 8px; gap: 3px; }
:root body[data-game] .day-card .progress { height: 4px; }
:root body[data-game] .day-card .day-meta { margin-block: 10px 16px; }
:root body[data-game] .day-card .day-actions { gap: 8px; }
:root body[data-game] .day-card:not(.any-day) .day-actions .btn.secondary { border-color: transparent; background: var(--ui-soft); color: var(--ui-ink); }
:root body[data-game] .day-card.today {
  background: linear-gradient(145deg, var(--ui-accent-soft), var(--ui-surface) 75%);
  border-color: color-mix(in srgb, var(--ui-accent) 38%, var(--ui-line)); box-shadow: 0 4px 20px #17244906;
}
:root body:is([data-game], [data-social-game], .game-catalog) :is(.day-card, .pz-card, .table-card):hover {
  border-color: color-mix(in srgb, var(--ui-accent) 48%, var(--ui-line)); box-shadow: var(--ui-shadow);
}
:root body[data-game] .day-card.any-day {
  color: #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--ui-game-light) 80%, #202348), color-mix(in srgb, var(--ui-game-light) 55%, #15172f));
  border-color: transparent;
}
:root body[data-game] .day-card.any-day :is(.day-meta, .crowns) { color: #e7e9f5 !important; }
:root body[data-game] .day-card.any-day .btn { color: var(--ui-game-light); background: #fff; border-color: #fff; box-shadow: 0 4px 14px #0002; }
:root body[data-game] .day-card.any-day .btn.secondary { color: #fff; border-color: #ffffff55; background: #ffffff12; }
:root body:is([data-game], [data-social-game], .game-catalog) :is(.progress, .progress > div) { border-radius: 4px; }
:root body[data-game] #view-random .random-panel { border-top-width: 1px; border-radius: 24px; gap: 28px 36px; }
:root body[data-game] #view-random .random-panel-head { border: 0; padding: 24px; border-radius: 16px; background: var(--ui-accent-soft); }
:root body[data-game] #view-random .random-panel-title h2 { font-size: 30px; line-height: 1.15; }
:root body[data-game] #view-random .random-section-label { letter-spacing: .055em; font-size: 10px; }
:root body[data-game] #view-random .random-choice span { background: var(--ui-surface); border-color: var(--ui-line); }
:root body[data-game] #view-random .random-choice input:checked + span { border-color: var(--ui-accent); background: var(--ui-accent-soft); }
:root body[data-game] #view-random .random-generate { margin-top: 0; }
:root body[data-game] #view-random .random-visual {
  border-radius: 20px; background: linear-gradient(145deg, var(--ui-accent-soft), color-mix(in srgb, var(--ui-accent) 17%, var(--ui-surface)));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ui-accent) 12%, transparent);
}
:root body:is([data-game], [data-social-game], .game-catalog) :is(.random-choice span, .random-setting-option, .duel-visibility-option,
  .duel-rated-option, .duel-settings-toggle, .rush-mode-option, .choice,
  .duel-target-field, .duel-advanced, .setup-rule-choice) { border-radius: 10px; }
:root body:is([data-game], [data-social-game], .game-catalog) :is(.duel-advanced, .setup-rule-choice, .duel-target-field) { background: var(--ui-soft); }
:root body[data-game] .heading-badge { border: 0; border-radius: 12px; background: var(--ui-accent-soft); padding: 14px 18px; }
:root body[data-game] #view-game .g-header {
  background: color-mix(in srgb, var(--ui-accent) 4%, var(--ui-surface));
  border: 1px solid var(--ui-line); border-radius: 18px;
  box-shadow: 0 6px 24px #17244906; padding: 12px;
}
:root body[data-game] #view-game .g-subhead { padding: 4px 0; gap: 8px; }
:root body[data-game] #view-game .g-subhead:has(#g-connection.hidden) {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}
:root body[data-game] .g-subhead:has(#g-connection.hidden) #g-timer { grid-column: 1; justify-self: start; }
:root body[data-game] .g-subhead:has(#g-connection.hidden) #g-diff { grid-column: 2; justify-self: center; max-width: 100%; }
:root body[data-game] .g-subhead:has(#g-connection.hidden) #g-reset { grid-column: 3; justify-self: end; }
:root body[data-game] #view-game .g-timer { letter-spacing: -.035em; font-weight: 650; padding: 7px 10px; border-radius: 10px; background: var(--ui-surface); border: 1px solid var(--ui-line); }
:root body[data-game] #view-game .g-diff { padding: 5px 9px; border-radius: 7px; background: var(--ui-soft); letter-spacing: .04em; }
:root body[data-game] #view-game .g-actions { padding: 7px; gap: 7px; border: 1px solid var(--ui-line); border-radius: 16px; background: var(--ui-surface); }
:root body[data-game] #view-game .g-actions .pill-btn { min-height: 46px; border-color: transparent; background: var(--ui-soft); }
:root body[data-game] #view-game .g-actions #g-hint { color: var(--ui-accent); border-color: transparent; background: var(--ui-accent-soft); }
@media (max-width: 500px) {
  :root body[data-game] #view-game .g-title { font-size: clamp(13px, 3.7vw, 17px); }
}
:root body:is([data-game], [data-social-game], .game-catalog) :is(.primary-nav, .nav-tabs, .directory-tabs, .main-nav) { border-radius: 12px; }
:root body:is([data-game], [data-social-game], .game-catalog) :is(.primary-nav a, .nav-tabs a, .directory-tab, .main-nav a) { border-radius: 8px; }
:root body:is([data-game], [data-social-game], .game-catalog) :is(.primary-nav a[aria-current="page"], .nav-tabs a.active, .directory-tab.active) { box-shadow: 0 2px 8px #1724490a; }
:root body[data-game="patches"] .random-visual { background: linear-gradient(135deg, #f8d5eb, #e0ddff 45%, #cdf1e7) !important; }
:root[data-theme="dark"] body[data-game="patches"] .random-visual { background: linear-gradient(135deg, #49314c, #343355 45%, #244440) !important; }
:root body[data-game="tango"] .random-visual { background: linear-gradient(135deg, #ffe2bd, #ffeccd 45%, #c9e6ff) !important; }
:root[data-theme="dark"] body[data-game="tango"] .random-visual { background: linear-gradient(135deg, #5a3823, #403b3b 45%, #244564) !important; }
@media (min-width: 681px) and (max-width: 1000px) {
  :root body .topbar { gap: 10px; }
  :root body .topbar .tabs a { padding-inline: 9px; }
  :root body .topbar .tabs .nav-icon { display: none; }
}
@media (max-width: 680px) {
  :root body .topbar { width: calc(100% - 20px); margin-top: 10px; top: 8px; padding: 10px; gap: 8px; border-radius: 18px; }
  :root body .topbar .tabs { border: 0; padding: 4px; gap: 2px; }
  :root body .topbar .tabs a { flex-direction: column; gap: 5px; padding: 8px 4px; min-height: 58px; font-size: 11px; }
  :root body .topbar .game-dropdown { left: -10px; width: calc(100vw - 20px); top: calc(100% + 84px); max-height: calc(100dvh - 170px); }
  :root body .page { padding-top: 26px; }
  :root body .page-heading h1 { font-size: 36px; }
  :root body[data-game] .day-card { padding: 16px; }
  :root body[data-game] .day-card .day-name { font-size: 20px; }
  :root body[data-game] .day-head { min-height: 72px; }
  :root body[data-game] #view-random .random-panel { border-radius: 20px; gap: 24px; padding: 18px; }
  :root body[data-game] #view-random .random-panel-head { padding: 16px; gap: 14px; }
  :root body[data-game] #view-random .random-panel-title h2 { font-size: 22px; }
  :root body[data-game] #view-game .g-header { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  :root body:is([data-game], [data-social-game], .game-catalog) :is(.btn, .button, .btn-outline, .chip, .theme-btn) { transition: none; }
}

:root body[data-game], :root body[data-social-game] {
  --game-hero-start: color-mix(in srgb, var(--ui-game-light) 65%, #202348);
  --game-hero-mid: color-mix(in srgb, var(--ui-game-light) 80%, #25203d);
  --game-hero-end: color-mix(in srgb, var(--ui-game-light) 55%, #15172f);
  --game-hero-ink: #ffffff; --game-hero-muted: #e4e3f3;
  --game-hero-button: #ffffff; --game-hero-button-ink: var(--ui-game-light);
}
:root body[data-game] :is(.daily-hero, .profile-hero, .watch-summary, .random-visual) { border-radius: 18px; }
:root body[data-game] #view-random .random-visual {
  --ui-accent: var(--ui-game-light); --ui-surface: #ffffff;
  --ui-accent-soft: color-mix(in srgb, var(--ui-game-light) 10%, #ffffff);
}
:root[data-theme="dark"] body[data-game] #view-random .random-visual {
  --ui-accent: var(--ui-game-dark); --ui-surface: #242c40;
  --ui-accent-soft: color-mix(in srgb, var(--ui-game-dark) 12%, #242c40);
}
:root body[data-game] :is(.duel-create-panel, .duel-create-card) { border-top-width: 1px; overflow: hidden; }
:root body[data-game] .duel-create-panel :is(.duel-target-field, .duel-rating-note, .duel-advanced, .duel-visibility > span) { border-radius: 10px; }
:root body[data-game] .duel-create-footer .btn { border-radius: 10px; }
:root body[data-game] :is(.rush-duel-cta, .rush-create-panel, .rush-directory-panel, .rush-directory-section, .rush-watch-preview) { border-radius: 16px; }
:root body[data-game] #view-rush .rush-create-panel { border-top-width: 1px; }
:root body[data-game] #view-rush :is(.rush-input, .rush-choice > span, .rush-settings, .rush-target-control, .rush-settings-rule, .rush-car-control) { border-radius: 10px; }
:root body[data-game] .modal { border-radius: 20px; border-top-width: 1px; }
:root body[data-game] .game-settings-modal .knob { border-radius: 20px; }
:root body[data-game] .game-settings-modal .knob::after { border-radius: 50%; }
:root body[data-game]:not([data-game="fifteen"]) .launch { border-radius: 18px; }
:root body[data-game]:not([data-game="fifteen"]) .launch .start-btn { border-radius: 10px; }
:root body[data-game] .topbar :is(.game-switcher, .theme-btn, .account-nav) { border-radius: 10px; }
:root body[data-game] #view-random .random-choice span { border-radius: 10px; }
:root body[data-game] #view-random .random-choice input:checked + span { box-shadow: none; }
:root body[data-game] #view-game .pill-btn { border-radius: 10px; }
:root body[data-game] #view-game .howto { border: 1px solid var(--ui-line); border-radius: 14px; background: var(--ui-surface); overflow: hidden; }
:root body[data-game] #view-game .howto > summary { padding: 16px; }
:root body[data-game] :is(.practice-archive-link, .practice-random-link) { border-radius: 12px; }
