/* Tallynight in the browser (/app/): the app's own look, from the studio's house style (StudioKit Theme) and
   Tallynight's leaf accent (DESIGN.md). Light and dark follow the system, as the app does. */
@font-face { font-family: "Bricolage"; src: url("/fonts/BricolageGrotesque-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url("/fonts/BricolageGrotesque-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url("/fonts/BricolageGrotesque-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/IBMPlexMono-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/IBMPlexMono-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: light dark;
  --background: #f5f1e8;
  --surface: #fbf9f4;
  --surface-2: #efe9dc;
  --line: #e3dbcb;
  --line-strong: #c2b69f;
  --text: #1b1915;
  --soft: #4a443b;
  --muted: #6e665a;
  --accent: #4d824a;
  --accent-text: #ffffff;
  --accent-light: #3f6b3c;
  --accent-soft: #e4e6d8;
  --accent-border: #b5c7ac;
  --ink: #121314;
  --paper: #eeebe5;
  --amber: #f2b23a;
  --danger: #b4452f;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
  --bar: rgba(251, 249, 244, 0.82);
  --display: "Bricolage", system-ui, sans-serif;
  --mono: "Plex Mono", ui-monospace, monospace;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #121314;
    --surface: #1c1e20;
    --surface-2: #26292c;
    --line: #2a2d30;
    --line-strong: #3a3e42;
    --text: #eeebe5;
    --soft: #d8d4cc;
    --muted: #a6a29a;
    --accent: #5e9e5a;
    --accent-text: #121314;
    --accent-light: #8ebb8c;
    --accent-soft: #181e1a;
    --accent-border: #273a28;
    --danger: #e98a74;
    --bar: rgba(28, 30, 32, 0.82);
  }
}

/* Taps are taps: no double-tap zoom on a fast +1 +1 (iOS), no text selection or callout on a press. Pinch still zooms. */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
[hidden] { display: none !important; }
button, .tile, .tabbar, .keys, .board-bar { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html, body { margin: 0; height: 100%; background: var(--background); color: var(--text); font-family: var(--display); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
body { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-light); }
svg { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { position: fixed; inset: 0; display: flex; justify-content: center; background: var(--background); }
.shell { position: relative; width: 100%; max-width: 560px; height: 100%; overflow: hidden; }
@media (min-width: 760px) {
  .shell { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .shell.wide { max-width: 1100px; }
}

/* Screens: one per tab or pushed on top; each scrolls by itself */
.screen { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(var(--top) + 18px) 18px calc(var(--bottom) + 110px); background: var(--background); }
.screen.full { padding-bottom: calc(var(--bottom) + 18px); }
.screen-wrap { position: absolute; inset: 0; }
.push-in { animation: push-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
.pop-in { animation: pop-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.fade-in { animation: fade-in 0.2s ease-out; }
@keyframes push-in { from { transform: translateX(100%); box-shadow: -20px 0 40px rgba(0, 0, 0, 0.12); } to { transform: none; } }
@keyframes pop-in { from { transform: translateX(-24%); opacity: 0.6; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; margin-bottom: 10px; }
.circle { width: 48px; height: 48px; flex-shrink: 0; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center; }
.circle.accent { color: var(--accent); }
.circle:active, .press:active { transform: scale(0.96); }
.meta { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0; }
.meta.accent { color: var(--accent-light); }
.title { font-family: var(--display); font-weight: 800; font-size: 34px; letter-spacing: -0.02em; line-height: 1.08; margin: 6px 0 18px; }
.title.mid { font-size: 28px; }
.label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 26px 0 10px; }
.note { color: var(--muted); font-size: 15px; line-height: 1.45; margin: 8px 0 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 16px; box-shadow: var(--shadow); }
.button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; padding: 0 20px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-text); font-weight: 600; font-size: 17px; text-decoration: none; }
.button.pill { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.button.small { width: auto; min-height: 44px; font-size: 16px; padding: 0 18px; }
.button.danger { background: var(--surface); color: var(--danger); border: 1px solid var(--line); }
.button:active { filter: brightness(0.95); transform: scale(0.99); }
.button:disabled { opacity: 0.4; }
.stack { display: grid; gap: 10px; }

/* Tonight */
.playing { display: grid; gap: 14px; }
.playing-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.art { width: 86px; height: 86px; flex-shrink: 0; border-radius: 16px; background-size: 82%; background-position: center; background-repeat: no-repeat; }
.art.small { width: 52px; height: 52px; border-radius: 12px; }
.art.mono { display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 24px; color: var(--ink); background-image: none; }
.art.small.mono { font-size: 17px; }
.playing-head .name { font-weight: 800; font-size: 26px; letter-spacing: -0.01em; margin-top: 4px; }
.pills { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.pill-score { display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 14px; border-radius: 12px; color: var(--ink); font-weight: 600; font-size: 17px; }
.pill-score b { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.pill-score svg { flex-shrink: 0; }
.grid-games { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 760px) { .grid-games { grid-template-columns: repeat(3, 1fr); } }
.grid-games .game-card { flex: none; }
.grid-games .game-card .art { height: 120px; }
.carousel { display: flex; gap: 12px; overflow-x: auto; margin: 0 -18px; padding: 2px 18px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.game-card { flex: 0 0 176px; scroll-snap-align: start; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 8px 8px 12px; color: var(--text); }
.game-card .art { width: 100%; height: 140px; border-radius: 14px; background-size: 78%; }
.game-card strong { display: block; font-size: 17px; margin: 10px 6px 2px; }
.game-card span { display: block; font-size: 14px; color: var(--muted); margin: 0 6px; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick button { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; color: var(--text); }
.quick .icon { width: 44px; height: 44px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent-light); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.quick strong { display: block; font-size: 17px; }
.quick span { display: block; font-size: 14px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.callout { display: flex; gap: 14px; align-items: flex-start; background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 20px; padding: 16px; margin-top: 22px; }
.callout p { margin: 0; color: var(--soft); font-size: 15px; line-height: 1.45; }
.callout strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.callout .button { margin-top: 12px; }
.callout .x { margin-left: auto; width: 32px; height: 32px; border: 0; background: none; color: var(--muted); font-size: 20px; flex-shrink: 0; }

/* Lists of rows (the game picker, history) */
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; min-height: 50px; color: var(--muted); margin-bottom: 6px; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 17px; color: var(--text); }
.rows { display: grid; gap: 10px; }
.row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; color: var(--text); text-decoration: none; }
.row .icon { width: 48px; height: 48px; border-radius: 999px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--text); }
.row .words { flex: 1; min-width: 0; }
.row strong { display: block; font-size: 17px; font-weight: 600; }
.row span.line { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.row .chev { color: var(--muted); flex-shrink: 0; }
.belt { background: var(--accent-soft); border-color: var(--accent-border); padding: 16px; }
.belt strong { font-size: 21px; font-weight: 800; }
.crowned { position: relative; flex-shrink: 0; }
.crowned .crown-badge { position: absolute; right: -6px; top: -6px; width: 22px; height: 22px; border-radius: 999px; background: var(--amber); color: var(--ink); display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface); }
.avatar { width: 40px; height: 40px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); font-weight: 800; font-size: 16px; flex-shrink: 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.empty strong { display: block; color: var(--text); font-size: 20px; margin-bottom: 6px; }

/* Players */
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 760px) { .people { grid-template-columns: repeat(3, 1fr); } }
.person { position: relative; text-align: left; border: 0; border-radius: 22px; padding: 10px; color: var(--ink); }
.person .face { height: 132px; border-radius: 14px; background: rgba(0, 0, 0, 0.09); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 72px; letter-spacing: -0.03em; }
.person .who { font-weight: 800; font-size: 20px; margin: 12px 6px 0; overflow-wrap: anywhere; }
.person .holds { font-size: 14px; margin: 2px 6px 0; opacity: 0.8; }
.person .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.person .stats div { background: rgba(0, 0, 0, 0.09); border-radius: 10px; padding: 8px 10px; }
.person .stats b { display: block; font-size: 19px; font-weight: 800; }
.person .stats span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.person .crown { position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: 999px; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.person.add { border: 2px dashed var(--line-strong); background: none; display: flex; align-items: center; justify-content: center; min-height: 250px; color: var(--accent-light); }
.person.add .plus { width: 72px; height: 72px; border-radius: 999px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; }

/* The tab bar, floating as the app's */
.tabbar { position: absolute; left: 14px; right: 14px; bottom: calc(var(--bottom) + 12px); padding: 6px; border-radius: 999px; background: var(--bar); border: 1px solid var(--line); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12); z-index: 5; }
.tabbar .tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.tabbar .tabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; border-radius: 999px; padding: 8px 0 6px; color: var(--text); font-size: 12px; font-weight: 600; }
.tabbar .tabs button[aria-current="page"] { color: var(--accent-light); background: rgba(127, 127, 127, 0.14); }
.top-brand, .top-end { display: none; }

/* Sheets: up from the bottom, as the app's */
.backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.32); z-index: 10; }
.backdrop.anim { animation: fade-in 0.2s ease-out; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(100% - var(--top) - 24px); display: flex; flex-direction: column; background: var(--background); border-radius: 26px 26px 0 0; z-index: 11; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18); }
.sheet.tall { height: calc(100% - var(--top) - 24px); }
.sheet .grab { width: 40px; height: 5px; border-radius: 999px; background: var(--line-strong); margin: 8px auto 0; flex-shrink: 0; }
.sheet .body { flex: 1; overflow-y: auto; padding: 10px 18px 18px; }
.sheet .foot { padding: 12px 18px calc(var(--bottom) + 14px); border-top: 1px solid var(--line); background: var(--background); flex-shrink: 0; }
.sheet .bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; }
.sheet .bar .meta { flex: 1; text-align: center; }
.sheet .bar .side { min-width: 92px; }
.sheet .bar .side:last-child { display: flex; justify-content: flex-end; }
.link { border: 1px solid var(--line); background: var(--surface); color: var(--accent-light); border-radius: 999px; padding: 10px 16px; font-weight: 600; font-size: 16px; }
.sheet.anim { animation: sheet-up 0.34s cubic-bezier(0.2, 0.9, 0.25, 1); }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.actions { display: grid; gap: 10px; padding: 6px 0 4px; }
.actions .title { font-size: 22px; margin: 6px 0 4px; }
.actions .note { margin: 0 0 8px; }

/* Setting up a game */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 600; font-size: 16px; }
.chip.on { border-color: transparent; color: var(--ink); padding-left: 8px; }
.chip .seat { width: 28px; height: 28px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 13px; display: flex; align-items: center; justify-content: center; }
.field { display: flex; gap: 8px; margin-top: 10px; }
.field input { flex: 1; min-width: 0; min-height: 48px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); padding: 0 18px; font-size: 17px; outline: none; }
.field input:focus { border-color: var(--accent); }
.settings { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting > span { font-weight: 600; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.seg button { border: 0; background: none; border-radius: 999px; padding: 8px 14px; font-size: 15px; color: var(--muted); font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--background); }
.setting input { width: 96px; min-height: 40px; text-align: right; border-radius: 12px; border: 1px solid var(--line); background: var(--background); padding: 0 12px; font-size: 17px; font-variant-numeric: tabular-nums; outline: none; }
.guide { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.guide li { position: relative; padding-left: 30px; color: var(--soft); line-height: 1.45; }
.guide li::before { content: ""; position: absolute; left: 6px; top: 8px; width: 8px; height: 8px; border-radius: 999px; background: var(--accent); }
.problem { color: var(--danger); font-weight: 600; margin: 10px 0 0; }

/* The table: a tile per player, the top row turned to the other side */
.board { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; padding: calc(var(--top) + 10px) 10px calc(var(--bottom) + 10px); background: var(--background); }
.board .top { margin: 0 0 0 4px; min-height: 48px; }
.board-tiles { flex: 1; min-height: 0; display: grid; gap: 10px; }
.board-tiles.scroll { overflow-y: auto; grid-auto-rows: minmax(210px, 1fr); }
.tile { position: relative; min-height: 0; border-radius: 26px; color: var(--ink); container-type: size; border: 4px solid transparent; overflow: hidden; }
.tile.leads { border-color: var(--ink); }
.tile.turned .tile-in { transform: rotate(180deg); }
.tile-in { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 12px 14px; }
.tile-head { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.tile-name { font-weight: 600; font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 999px; padding: 3px 8px; background: rgba(0, 0, 0, 0.16); }
.tag.dark { background: var(--ink); color: var(--paper); }
.tile-score { flex: 1; min-height: 0; border: 0; background: none; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; letter-spacing: -0.04em; line-height: 0.9; font-variant-numeric: tabular-nums; font-size: min(34cqh, 30cqw); padding: 0; }
.tile-score small { font-family: var(--mono); font-weight: 500; font-size: 14px; letter-spacing: 0; margin-top: 10px; opacity: 0.75; min-height: 18px; }
.tile-score.bump { animation: bump 0.25s ease-out; }
@keyframes bump { 50% { transform: scale(1.05); } }
.tile-keys { display: flex; align-items: flex-end; justify-content: space-between; }
.tile-keys .minus { width: 52px; height: 52px; border-radius: 999px; border: 0; background: rgba(0, 0, 0, 0.14); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.tile-keys .plus { width: 72px; height: 72px; border-radius: 999px; border: 0; background: var(--ink); display: flex; align-items: center; justify-content: center; }
.tile-keys button:active { transform: scale(0.93); }
.board-bar { display: flex; align-items: center; gap: 8px; }
.board-bar .circle { width: 50px; height: 50px; }
.undo { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: left; }
.undo:disabled { opacity: 0.5; }
.undo b { display: block; font-size: 16px; }
.undo small { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.undo span { min-width: 0; }
.steps { display: flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.steps button { min-width: 44px; height: 42px; border: 0; background: none; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 16px; }
.steps button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.end { min-height: 50px; padding: 0 20px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-text); font-weight: 600; font-size: 17px; }
.set-pill { min-height: 50px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 18px; background: var(--accent-soft); border: 1px solid var(--accent-border); }
.banner div { flex: 1 1 180px; }
.banner strong { display: block; font-size: 17px; }
.banner span { color: var(--soft); font-size: 15px; }
.banner .button { width: auto; min-height: 42px; font-size: 15px; padding: 0 16px; }

/* Rounds */
.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 6px 4px; overflow-x: auto; }
.rounds { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.rounds th, .rounds td { padding: 11px 4px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rounds th { font-weight: 600; font-size: 15px; }
.rounds th:first-child, .rounds td:first-child { text-align: left; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--muted); font-weight: 400; width: 58px; padding-left: 10px; }
.rounds tfoot td b { max-width: 100%; }
.rounds tbody td { font-family: var(--mono); font-size: 16px; border-top: 1px solid var(--line); }
.rounds tbody tr { cursor: pointer; }
.rounds tbody tr:active td { background: var(--surface-2); }
.rounds tfoot td { border-top: 1px solid var(--line); font-weight: 800; font-size: 19px; }
.rounds tfoot td b { display: inline-block; min-width: 50px; padding: 4px 10px; border-radius: 999px; color: var(--text); }
.rounds tfoot td b.lead { color: var(--ink); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 999px; margin-right: 6px; vertical-align: 1px; }
/* Full screen (the game's menu), on a laptop on the TV or a projector: the whole width, numbers the room can read */
:fullscreen .shell { max-width: none; border: 0; }
:fullscreen .rounds th { font-size: clamp(15px, 2.2vw, 34px); }
:fullscreen .rounds tbody td { font-size: clamp(16px, 2.4vw, 38px); padding-top: clamp(11px, 1.2vw, 20px); padding-bottom: clamp(11px, 1.2vw, 20px); }
:fullscreen .rounds tfoot td { font-size: clamp(19px, 3.8vw, 64px); }
:fullscreen .rounds th:first-child, :fullscreen .rounds td:first-child { width: clamp(58px, 9vw, 140px); font-size: clamp(12px, 1.4vw, 22px); }
:fullscreen .rounds tfoot td b { min-width: 1.6em; }
.dock { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 18px calc(var(--bottom) + 14px); background: linear-gradient(to top, var(--background) 70%, transparent); display: grid; gap: 10px; }

/* The number pad: a row per player, then the keys */
.entries { display: grid; gap: 8px; }
.entry { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 14px; border-radius: 16px; border: 2px solid transparent; background: var(--surface); text-align: left; width: 100%; color: var(--text); }
.entry.on { border-color: var(--accent); }
.entry .who { flex: 1; min-width: 0; font-weight: 600; font-size: 17px; }
.entry .value { font-weight: 800; font-size: 26px; font-variant-numeric: tabular-nums; min-width: 60px; text-align: right; }
.entry .value.blank { color: var(--line-strong); }
.check { font-size: 15px; color: var(--muted); margin: 10px 2px 0; min-height: 20px; }
.check.good { color: var(--accent-light); font-weight: 600; }
.moon { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; color: var(--muted); }
.moon button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 14px; color: var(--text); }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.keys button { height: 54px; border-radius: 14px; border: 0; background: var(--surface); color: var(--text); font-size: 24px; font-weight: 600; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 0 var(--line); }
.keys button:active { background: var(--surface-2); }
.pad-value { text-align: center; font-weight: 800; font-size: 64px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin: 6px 0 2px; min-height: 76px; }
.pad-value.blank { color: var(--line-strong); }
.foot-row { display: flex; gap: 10px; }
.foot-row .button { flex: 1; }

/* The result: the winner's card */
.winner { border-radius: 26px; padding: 20px 18px 16px; color: var(--ink); }
.winner .meta { color: var(--ink); opacity: 0.8; }
.winner h2 { font-weight: 800; font-size: 38px; letter-spacing: -0.02em; line-height: 1.05; margin: 14px 0 12px; overflow-wrap: anywhere; }
.winner .belt-line { display: inline-block; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.podium { display: flex; align-items: flex-end; gap: 8px; background: var(--ink); border-radius: 16px; padding: 18px 12px 0; min-height: 240px; }
.podium .step { flex: 1; display: flex; flex-direction: column; align-items: center; color: var(--paper); min-width: 0; }
.podium .step .avatar { width: 52px; height: 52px; font-size: 20px; }
.podium .step.first .avatar { width: 66px; height: 66px; font-size: 26px; }
.podium .step .n { font-size: 14px; margin-top: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .step .t { font-weight: 800; font-size: 18px; margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
.podium .block { width: 100%; border-radius: 10px 10px 0 0; display: flex; align-items: flex-start; justify-content: center; color: var(--ink); font-weight: 800; font-size: 28px; padding-top: 10px; }
.others { display: grid; gap: 6px; margin-top: 8px; }
.others div { display: flex; align-items: center; gap: 12px; background: rgba(0, 0, 0, 0.1); border-radius: 12px; padding: 10px 14px; font-weight: 600; }
.others div b { margin-left: auto; font-variant-numeric: tabular-nums; }
.others div span:first-child { font-family: var(--mono); font-size: 12px; opacity: 0.7; width: 14px; }
.winner .brand { text-align: right; margin-top: 14px; font-size: 11px; }

/* A tablet or a computer: the sheets are dialogs in the middle of the window */
@media (min-width: 760px) {
  .backdrop { position: fixed; background: rgba(0, 0, 0, 0.45); }
  .sheet { position: fixed; left: 50%; top: 50%; right: auto; bottom: auto; width: min(580px, calc(100vw - 48px)); max-height: min(88vh, 900px); transform: translate(-50%, -50%); border-radius: 26px; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); overflow: hidden; }
  .sheet.tall { height: min(88vh, 900px); }
  .sheet .grab { display: none; }
  .sheet .body { padding: 14px 22px 20px; }
  .sheet .foot { padding: 14px 22px 18px; }
  .sheet.anim { animation: dialog-in 0.24s cubic-bezier(0.2, 0.9, 0.25, 1); }
}
@keyframes dialog-in { from { opacity: 0; transform: translate(-50%, -47%) scale(0.98); } to { opacity: 1; transform: translate(-50%, -50%); } }

/* A wide screen: the whole window, the tabs a bar along the top with New game, the lists across the width */
@media (min-width: 900px) {
  .shell, .shell.wide { max-width: none; border: 0; }
  .tabbar { left: 0; right: 0; top: 0; bottom: auto; height: calc(var(--top) + 76px); display: flex; align-items: center; gap: 16px; padding: var(--top) max(40px, calc((100% - 1040px) / 2)) 0; border-radius: 0; border: 0; border-bottom: 1px solid var(--line); background: var(--background); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .top-brand { flex: 1 1 0; display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; color: var(--text); }
  .top-brand img { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; }
  .tabbar .tabs { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
  .tabbar .tabs button { flex-direction: row; gap: 8px; padding: 9px 16px 9px 13px; font-size: 15px; white-space: nowrap; }
  .tabbar .tabs button svg { width: 20px; height: 20px; }
  .tabbar .tabs button:hover { background: rgba(127, 127, 127, 0.08); }
  .tabbar .tabs button[aria-current="page"] { background: rgba(127, 127, 127, 0.16); }
  .tabbar .tabs { flex-shrink: 0; }
  .top-end { flex: 1 1 0; display: flex; justify-content: flex-end; }
  .top-end .button { gap: 6px; padding: 0 18px 0 14px; white-space: nowrap; }
  .shell.tabbed .screen { top: calc(var(--top) + 76px); padding: 36px max(40px, calc((100% - 1040px) / 2)) 56px; }
  .title { font-size: 40px; }
  .search { max-width: 520px; }
  .grid-games { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .people { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
  .history-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-rows .belt { grid-column: 1 / -1; }
  .tonight-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 36px; align-items: start; }
  .tonight-main > .callout:first-child { margin-top: 0; }
  .tonight-side > .label:first-child { margin-top: 0; }
  .tonight-side .grid-games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tonight-side .grid-games .game-card .art { height: 128px; }
  .tonight-main .pills { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
  .tonight-main .pill-score { padding: 0 12px; font-size: 16px; }
  /* A game, its rounds and its result use the window; the rounds' table and the result stay a readable width */
  .board { padding: calc(var(--top) + 16px) 20px 20px; gap: 12px; }
  .board-tiles.scroll { grid-auto-rows: minmax(240px, 1fr); }
  .shell[data-kind="rounds"] .screen { padding-left: max(32px, calc((100% - 960px) / 2)); padding-right: max(32px, calc((100% - 960px) / 2)); }
  .shell[data-kind="rounds"] .dock { padding-left: max(32px, calc((100% - 560px) / 2)); padding-right: max(32px, calc((100% - 560px) / 2)); }
  .shell[data-kind="rounds"] .rounds th { font-size: 17px; }
  .shell[data-kind="rounds"] .rounds tbody td { font-size: 19px; padding-top: 14px; padding-bottom: 14px; }
  .shell[data-kind="rounds"] .rounds tfoot td { font-size: 24px; padding-top: 14px; padding-bottom: 14px; }
  .shell[data-kind="result"] .screen { padding-left: max(32px, calc((100% - 620px) / 2)); padding-right: max(32px, calc((100% - 620px) / 2)); }
}
@media (min-width: 900px) and (max-width: 1099px) {
  .top-brand span { display: none; }
  .tabbar .tabs button { gap: 6px; padding: 9px 12px 9px 10px; }
}
@media (hover: hover) and (pointer: fine) {
  .game-card:hover, .row:hover, .quick button:hover { border-color: var(--line-strong); }
  .button.pill:hover, .link:hover, .circle:hover { border-color: var(--line-strong); }
  .person:hover { filter: brightness(1.04); }
  .rounds tbody tr:hover td { background: var(--surface-2); }
}
.keys-hint { text-align: center; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  .push-in, .pop-in, .sheet.anim { animation: fade-in 0.2s ease-out; }
  .tile-score.bump { animation: none; }
}

/* The words and links in the page itself, for search engines and anyone without JavaScript; the app replaces them */
.js .seo { display: none; }
.seo { max-width: 680px; margin: 0 auto; padding: calc(var(--top) + 28px) 20px 60px; overflow-y: auto; height: 100%; line-height: 1.55; color: var(--soft); }
.seo h1 { font-weight: 800; font-size: 36px; letter-spacing: -0.02em; line-height: 1.1; color: var(--text); margin: 8px 0 14px; }
.seo h2 { font-weight: 800; font-size: 22px; color: var(--text); margin: 28px 0 10px; }
.seo ul.games { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; list-style: none; }
