/* The app's look (Views.swift) as plain CSS: the felt, the cards, the
   tiles, the info column. Two themes, design/theme.json's (Theme.swift's
   numbers), set by Settings/Theme.js; these are the dark ones, so the
   page is right before the file arrives. As in sws, the MENUS swap fully
   - backdrop and ink - and the TABLE stays a table: the felt steps into
   daylight, the ink on it stays light (.game below). */
:root {
  color-scheme: dark;
  --ink-rgb: 242 245 242;
  --backdrop-top: rgb(23 56 41);
  --backdrop-bottom: rgb(13 31 23);
  --felt-top: rgb(23 56 41);
  --felt-bottom: rgb(13 31 23);
  --surface: rgb(41 51 48);
  --field: rgb(0 0 0 / 0.25);
  --orange: #ff9f0a;
  --red: #ff453a;
  --green: #30d158;
  --card-top: rgb(237 242 255);
  --card-bottom: rgb(191 209 242);
  --card-ink: rgb(26 38 89);
  /* THE STACKING ORDER is design/table.json's `layers` (sws's bands
     and names): App.js sets each as --z-<name> when the page starts.
     The number after the comma is only the fallback, held equal to the
     file by web/tests - a new layer goes into a gap of the file. */
  --pc-w: 66px; --pc-h: 94px;
  --pcs-w: 52px; --pcs-h: 74px;
  --prize-w: 108px; --prize-h: 148px;
}
/* The light theme's numbers, the same file's: index.html's head sets
   data-theme from the remembered choice before the first paint, so a
   light page starts light instead of blinking from dark when Theme.js
   runs; Theme.js sets the file's own numbers over these once it is in.
   web/tests/engine.test.mjs holds both blocks to design/theme.json. */
:root[data-theme="light"] {
  color-scheme: light;
  --ink-rgb: 26 36 31;
  --backdrop-top: rgb(232 237 222);
  --backdrop-bottom: rgb(201 217 196);
  --felt-top: rgb(84 143 102);
  --felt-bottom: rgb(64 115 82);
  --surface: rgb(250 250 247);
  --field: rgb(255 255 255 / 0.75);
}
/* The ink and what is derived from it - declared where the ink is, so the
   table's own ink (.game) derives its own. */
:root, .game {
  --ink: rgb(var(--ink-rgb));
  --secondary: rgb(var(--ink-rgb) / 0.62);
  --tertiary: rgb(var(--ink-rgb) / 0.38);
  --quaternary: rgb(var(--ink-rgb) / 0.22);
  --panel: rgb(var(--ink-rgb) / 0.05);
  --line: rgb(var(--ink-rgb) / 0.15);
}
/* the table stays a table: light ink on the felt, in both themes */
.game { --ink-rgb: 242 245 242; color: var(--ink); color-scheme: dark; min-height: 100dvh;
        background: linear-gradient(var(--felt-top), var(--felt-bottom)) fixed; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink); background: linear-gradient(var(--backdrop-top), var(--backdrop-bottom)) fixed;
  font: 13px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4, p { margin: 0; }
.muted { color: var(--secondary); }
.faint { color: var(--tertiary); }
.small { font-size: 12px; }
.tiny { font-size: 10px; }
.ink { color: var(--ink); }
.grow { flex: 1; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.icon { display: inline-block; vertical-align: -2px; }

/* --- controls --------------------------------------------------------- */
button {
  font: inherit; color: var(--ink); cursor: pointer; border-radius: 7px;
  padding: 4px 11px; border: 0.5px solid rgb(var(--ink-rgb) / 0.18); background: rgb(var(--ink-rgb) / 0.1);
  box-shadow: 0 1px 1px rgb(0 0 0 / 0.2);
}
button:hover:not(:disabled) { background: rgb(var(--ink-rgb) / 0.17); }
button:disabled { opacity: 0.4; cursor: default; }
button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
button.primary { background: var(--orange); border-color: transparent; color: #fff; font-weight: 600; }
button.primary:hover:not(:disabled) { background: #ffb340; }
button.big { font-size: 15px; padding: 7px 26px; }
button.small { font-size: 11px; padding: 3px 9px; }
button.plain { background: none; border: 0; box-shadow: none; padding: 2px; color: var(--secondary); }
button.danger-text { color: #ff6961; }
button.danger { background: var(--red); border-color: transparent; color: #fff; font-weight: 600; }
select, input[type=text] {
  font: inherit; color: var(--ink); background: var(--field);
  border: 0.5px solid rgb(var(--ink-rgb) / 0.2); border-radius: 6px; padding: 4px 6px;
}


/* --- boot, dialog, stamp --------------------------------------------- */
.boot { position: fixed; inset: 0; display: grid; place-items: center; align-content: center; gap: 22px; background: linear-gradient(var(--backdrop-top), var(--backdrop-bottom)); z-index: var(--z-overlay, 10010); }   /* over everything: no click lands until the page is whole */
.boot-bird { font-size: 56px; animation: breathe 1.4s ease-in-out infinite; }
.boot.failed { font-size: 15px; color: var(--secondary); padding: 16px; text-align: center; }
/* the busy sign (index.html #bootBusy): its word in four languages, html's lang shows one */
.busy-line { display: flex; align-items: center; gap: 12px; font-size: 17px; color: var(--secondary); white-space: nowrap; }
.busy-line::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--secondary); animation: spin 0.9s linear infinite; flex: none; }
#bootBusy [lang] { display: none; }
html[lang="de"] #bootBusy [lang="de"], html[lang="en"] #bootBusy [lang="en"],
html[lang="fr"] #bootBusy [lang="fr"], html[lang="it"] #bootBusy [lang="it"] { display: inline; }
@keyframes breathe { 50% { opacity: 0.4; transform: scale(0.94); } }
.dialog { position: fixed; inset: 0; background: rgb(0 0 0 / 0.5); display: grid; place-items: center; z-index: var(--z-overlay, 10010); padding: 16px; }
.dialog-box { background: var(--surface); border: 0.5px solid var(--line); border-radius: 14px; padding: 20px; width: min(340px, 100%); box-shadow: 0 20px 50px rgb(0 0 0 / 0.5); text-align: center; }
.dialog-box h3 { font-size: 15px; margin-bottom: 6px; }
.dialog-box p { color: var(--secondary); font-size: 12px; }
.dialog-buttons { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.stamp { position: fixed; right: 8px; bottom: 3px; font-size: 9px; color: var(--tertiary); pointer-events: none; z-index: var(--z-controls, 5030); }

/* --- setup ------------------------------------------------------------- */
.setup { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 30px 16px; text-align: center; }
/* the gear top right, the way back top left (as in sws) */
.setup .corner { position: absolute; top: 20px; right: 20px; display: flex; align-items: center; gap: 6px; }
/* the rules' ⓘ beside the gear, dressed as the gear */
.setup .corner .info-button { padding: 6px; color: rgb(var(--ink-rgb) / 0.55); }
.setup .corner .info-button:hover, .setup .corner .info-button[aria-expanded="true"] { color: var(--ink); }
.setup .corner-left { position: absolute; top: 20px; left: 20px; }
.gear { color: rgb(var(--ink-rgb) / 0.55); padding: 6px; border-radius: 50%; line-height: 0; }
.gear:hover:not(:disabled), .gear.on { color: var(--ink); }
.screen-title { font-size: 20px; }
/* the intro's doors, as sws's: two by two, the fifth centred; one that
   leads nowhere yet is dashed and dim */
.doors { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; max-width: 578px; width: 100%; }
.door { width: 280px; height: 130px; border-radius: 16px; background: rgb(var(--ink-rgb) / 0.10); border: 1px solid rgb(var(--ink-rgb) / 0.25);
  color: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px;
  box-shadow: 0 6px 14px rgb(0 0 0 / 0.18); font: inherit; }
.door .icon { width: 34px; height: 34px; }
.door b { font-size: 19px; }
.door small { font-size: 12px; opacity: 0.6; }
.door:hover:not(:disabled) { background: rgb(var(--ink-rgb) / 0.14); }
.door:disabled { background: rgb(var(--ink-rgb) / 0.06); border: 1.5px dashed rgb(var(--ink-rgb) / 0.35); opacity: 0.65; box-shadow: 0 2px 5px rgb(0 0 0 / 0.12); }
@media (max-width: 640px) { .door { width: 100%; height: 110px; } }
/* Weiterspielen (sws's resume door): under the variant, two doors wide and low, the gold ▶ beside the words */
.door.resume { width: 578px; max-width: 100%; height: 92px; flex-direction: row; justify-content: flex-start; gap: 16px; padding: 0 20px;
  margin: -18px auto -4px; border: 1.5px solid rgb(232 190 40 / 0.75); text-align: left; }
.door.resume .resume-play { width: 46px; height: 46px; flex: none; border-radius: 50%; background: rgb(240 200 40 / 0.9); color: #000;
  display: flex; align-items: center; justify-content: center; padding-left: 3px; box-sizing: border-box; }
.door.resume .resume-play .icon { width: 22px; height: 22px; }
/* one sign for playing a game (playDisc): gold ▶ plays on, blue ↻ plays back */
.play-disc { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%;
  background: rgb(92 168 240); color: rgb(16 21 26); vertical-align: middle; }
.play-disc.live { background: rgb(240 200 40 / 0.9); color: #000; }
.play-disc.live .icon { margin-left: 8%; }
button.link:has(> .play-disc) { padding: 0 2px; }
button.link:hover:not(:disabled) > .play-disc { filter: brightness(1.12); }
/* Play on: the disc and its words in a pill edged in gold */
button.play-on { display: inline-flex; align-items: center; gap: 8px; border-radius: 19px; padding: 4px 16px 4px 5px;
  border: 1.5px solid rgb(240 200 40 / 0.9); font-size: 15px; font-weight: 600; }
.door.resume > span:last-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
@media (max-width: 640px) { .door.resume { width: 100%; height: auto; min-height: 84px; padding: 10px 16px; } }
/* the first start: one question at a time */
.wizard { justify-content: center; min-height: 100dvh; }
.wizard .welcome { font-size: 22px; }
.wizard-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 560px; }
.wizard-tile { font-size: 16px; padding: 12px 20px; border-radius: 12px; background: rgb(var(--ink-rgb) / 0.07); border: 1.5px solid rgb(var(--ink-rgb) / 0.15); }
.wizard-tile.on { background: rgb(var(--ink-rgb) / 0.16); border-color: var(--orange); font-weight: 700; }
.wizard-tile.look { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 16px; }
.look-preview { width: 140px; height: 90px; border-radius: 8px; display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.15); }
.look-felt { width: 96px; height: 52px; border-radius: 26px; box-shadow: 0 2px 6px rgb(0 0 0 / 0.3); }
.wizard .start { font-size: 18px; padding: 10px 36px; }
.hero { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hero-bird { font-size: 56px; line-height: 1.1; }
.hero h1 { font: 800 38px/1.1 ui-serif, Georgia, "Times New Roman", serif; }
.tabs { display: flex; padding: 2px; border-radius: 8px; background: var(--field); min-width: min(420px, 100%); max-width: 100%; }
.tabs button { flex: 1; border: 0; background: none; box-shadow: none; padding: 3px 12px; border-radius: 6px; white-space: nowrap; }
.tabs button.selected { background: rgb(var(--ink-rgb) / 0.2); box-shadow: 0 1px 2px rgb(0 0 0 / 0.3); }
.tabs.sub-tabs { min-width: min(280px, 100%); }
/* four homes on a phone: the names may take two lines */
@media (max-width: 520px) { .tabs button { white-space: normal; padding: 3px 6px; line-height: 1.15; } }
.setup-card { width: min(560px, 100%); padding: 20px; border-radius: 16px; background: rgb(var(--ink-rgb) / 0.06); display: flex; flex-direction: column; gap: 14px; text-align: left; }
.setup-row, .bot-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.setup-label { width: 110px; }
.name-field { width: 160px; }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper button { padding: 0 9px; font-size: 15px; line-height: 20px; }
.stepper b { min-width: 18px; text-align: center; white-space: nowrap; }
.bot-name { width: 110px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.bot-row select { flex: 1 1 100px; min-width: 0; }
.setup-start { display: flex; justify-content: center; padding-top: 4px; }

/* --- the game screen: play column + info column ----------------------- */
.game { display: grid; grid-template-columns: minmax(0, 1fr) auto; height: 100dvh; }
.play { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; overflow: hidden;
         background: var(--floor, linear-gradient(var(--felt-top), var(--felt-bottom))) repeat;
         background-size: var(--floortile, 300px) var(--floortile, 300px); }
/* WHAT THE GAME IS PLAYED ON (App/Ground.js, the appearance's): the floor is
   the column's background; the table top and the cloth lie round the stage's
   cards, placed and sized by layTable(); the ground's canvas under the table,
   the air's over the cards and under the panels. */
.play > .fx { position: absolute; left: 0; top: 0; pointer-events: none; }
.ground-fx { z-index: var(--z-ground, 10); }
.air-fx { z-index: var(--z-air, 4000); }
.tabletop { position: absolute; z-index: var(--z-tabletop, 1500); background-size: 100% 100%; background-repeat: no-repeat; pointer-events: none; }
.cloth { position: absolute; z-index: var(--z-cloth, 1600); pointer-events: none; border: 1px solid;
         background-size: 100% 100%, 100% 100%; box-shadow: 0 2px 6px rgb(0 0 0 / 0.35), inset 0 0 18px rgb(0 0 0 / 0.25); }
/* The light drifting over the pool and the breeze over a field (Theme.js applyLook, sws's):
   moved by the compositor, by whole tiles so the loop has no seam - still when the table is. */
.play > .shimmer { position: absolute; inset: calc(-1 * var(--floortile, 300px)); pointer-events: none; z-index: var(--z-background, 0);
                   background-repeat: repeat; background-size: var(--floortile, 300px) var(--floortile, 300px);
                   animation: drift linear infinite; will-change: transform; }
@keyframes drift { from { transform: translate(0, 0); }
                   to { transform: translate(calc(var(--dx) * var(--floortile, 300px)), calc(var(--dy) * var(--floortile, 300px))); } }
.play > .breeze { position: absolute; inset: 0; pointer-events: none; z-index: var(--z-background, 0); animation: breeze linear infinite; will-change: transform; }
.play > .breeze > div { position: absolute; top: -50%; height: 200%; width: var(--bw, 45%); left: calc(50% - var(--bw, 45%) / 2); transform: rotate(var(--bd, 20deg));
                        background: linear-gradient(90deg, transparent, rgb(255 255 255 / var(--bo, 0.08)), transparent); }
@keyframes breeze { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
/* The Schüür's lantern (palette.json barn `_lantern`): a warm pool over everything on the
   table, the dark beyond it - and while the table moves, the flame flickers. */
.lantern { position: absolute; inset: 0; pointer-events: none; z-index: var(--z-air, 4000);
           background: radial-gradient(circle farthest-corner at var(--lx) var(--ly), var(--lc), transparent var(--lr)),
                       radial-gradient(circle farthest-corner at var(--lx) var(--ly), transparent 30%, var(--ldark) var(--lr));
           animation: flicker 2.3s ease-in-out infinite alternate; }
@keyframes flicker { 0% { opacity: 1; } 31% { opacity: calc(var(--lflicker) + (1 - var(--lflicker)) * 0.6); } 47% { opacity: 0.97; }
                     70% { opacity: var(--lflicker); } 100% { opacity: 1; } }
body.still .play > .shimmer, body.still .play > .breeze, body.still .lantern { animation: none; }
body.still .play > .breeze { display: none; }
/* The panels round the table are glass over the floor, dark in both themes - the table stays a table. */
.play .player-tile, .play .human-panel { background: rgb(14 20 17 / 0.74); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.play .topbar { border-bottom: 0; }
/* what is written on the table reads on any top: on the felt, on marble, in a nest */
.table-view .deck-left { color: var(--secondary); }
.table-view .col-label, .table-view .deck-left, .table-view .status p, .table-view .result { text-shadow: 0 1px 2px rgb(0 0 0 / 0.85), 0 0 8px rgb(0 0 0 / 0.5); }
.play .finish { flex: none; margin: 18px auto; width: min(760px, calc(100% - 24px)); border-radius: 18px; background: rgb(14 20 17 / 0.8);
                -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 6px 24px rgb(0 0 0 / 0.4); }
.play.bare .table-view .status:not(.table-dialog) > :not(button):not(.primary):not(.table-dialog) { background: rgb(0 0 0 / 0.42); border-radius: 12px; padding: 4px 12px; }
.topbar { display: flex; gap: 10px; padding: 8px 12px; border-bottom: 0.5px solid var(--line); position: relative; z-index: var(--z-bubble, 5020); }  /* the bots' bubbles hang over the felt */
.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; position: relative; z-index: var(--z-felt, 2000); }

.player-tile { flex: 1; min-width: 0; position: relative; padding: 8px; border-radius: 10px; background: var(--panel); border: 1.5px solid var(--c); display: flex; flex-direction: column; gap: 5px; }
.tile-head { display: flex; align-items: center; gap: 7px; }
.tile-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tile-title { display: flex; align-items: center; gap: 3px; min-width: 0; }
.tile-title .info-button { flex: none; }
.tile-name b { font-size: 13px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-name small { font-size: 9px; color: var(--secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 14px; background: var(--fill); box-shadow: inset 0 0 0 1.5px var(--c); }
.score { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; }
.score b { font-size: 19px; }
.score b.negative { color: var(--red); }
.score small { font-size: 7px; color: var(--tertiary); letter-spacing: 0.02em; }
.hand-text { font: 500 10px/1.35 ui-monospace, "SF Mono", Menlo, monospace; color: var(--secondary); min-height: 2.7em; }
.hand-text.closed { font-style: italic; font-weight: 400; color: var(--quaternary); }
/* a bot's open hand: tiny cards, a white frame and the number */
.mini-hand { display: flex; flex-wrap: wrap; gap: 3px; min-height: 2.7em; align-content: flex-start; }
.mini-card { width: 17px; height: 23px; box-sizing: border-box; border-radius: 3px; border: 1.5px solid #fff; display: grid; place-items: center;
  background: linear-gradient(rgb(237 242 255), rgb(191 209 242)); color: var(--card-ink); font: 700 10px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.4); }
.mini-card.played { border: 2px solid var(--frame); }
.won-prizes { display: flex; flex-wrap: wrap; gap: 3px; min-height: 30px; align-items: flex-start; }
.won-prizes.none { font-size: 9px; color: var(--quaternary); align-items: center; }

/* --- the table ---------------------------------------------------------- */
.table-view { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 0 16px; }
.filler { flex: 1; min-height: 4px; }
.table-row { display: flex; align-items: center; justify-content: center; gap: 26px; flex-wrap: wrap; }
.bots-group { display: flex; gap: 14px; }
.table-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.col-label { font-size: 12px; font-weight: 700; white-space: nowrap; }
.col-label.stake { color: var(--orange); }
.prize-fan { position: relative; height: var(--prize-h); }
.prize-fan .prize-card { position: absolute; left: 50%; top: 0; margin-left: calc(var(--prize-w) / -2); transform-origin: 50% 90%; }
.deck-stack { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.deck-left { font-size: 9px; line-height: 1.2; color: var(--tertiary); width: var(--prize-w); text-align: center; text-wrap: balance; }
.deck-left.balance { visibility: hidden; }
.status { min-height: 72px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.status p { font-size: 13px; }
.result { font-size: 18px; font-weight: 600; max-width: 640px; }

/* --- cards --------------------------------------------------------------- */
.prize-card {
  width: var(--prize-w); height: var(--prize-h); border-radius: 14px; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.45);
}
.prize-card.mouse { background: linear-gradient(rgb(250 209 89), rgb(230 158 38)); color: #000; }
.prize-card.vulture { background: linear-gradient(rgb(166 38 38), rgb(102 13 26)); color: #fff; }
.prize-card .face { font-size: 36px; line-height: 1; }
.prize-card .value { font-size: 30px; font-weight: 900; line-height: 1; }
.prize-card .caption { font-size: 7px; font-weight: 700; opacity: 0.65; text-align: center; white-space: pre-line; }

.tiny-prize { width: 22px; height: 30px; border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 1px 1px rgb(0 0 0 / 0.4); }
.tiny-prize span { font-size: 8px; }
.tiny-prize b { font-size: 9px; font-weight: 900; }
.tiny-prize.mouse { background: linear-gradient(rgb(250 209 89), rgb(230 158 38)); color: #000; }
.tiny-prize.vulture { background: linear-gradient(rgb(166 38 38), rgb(102 13 26)); color: #fff; }

.playing-card {
  width: var(--pc-w); height: var(--pc-h); border-radius: 9px; position: relative; flex: none;
  display: grid; place-items: center; padding: 0; border: 0;
  background: linear-gradient(rgb(237 242 255), rgb(191 209 242)); color: var(--card-ink);
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.4);
}
.playing-card .big { font-size: 26px; font-weight: 700; }
.playing-card .corner { position: absolute; font-size: 10px; font-weight: 700; opacity: 0.55; line-height: 1; }
.playing-card .corner.tl { top: 5px; left: 5px; }
.playing-card .corner.br { bottom: 5px; right: 5px; transform: rotate(180deg); }
.playing-card.small { width: var(--pcs-w); height: var(--pcs-h); border-radius: 7px; }
.playing-card.small .big { font-size: 20px; }
.playing-card.small .corner { font-size: 8px; }
.playing-card.small .corner.tl { top: 3px; left: 3px; }
.playing-card.small .corner.br { bottom: 3px; right: 3px; }
.playing-card.highlighted { box-shadow: 0 0 0 3px var(--orange), 0 4px 16px rgb(0 0 0 / 0.5); }
.playing-card.faded { opacity: 0.8; }
button.playing-card { cursor: pointer; transition: transform 0.12s; }
button.playing-card:hover:not(:disabled) { transform: translateY(-5px); background: linear-gradient(#fff, rgb(205 220 246)); }
button.playing-card:disabled { opacity: 0.45; }

.card-back {
  width: var(--pc-w); height: var(--pc-h); border-radius: 9px; flex: none; display: grid; place-items: center;
  /* its player's colour over the dark it always lay on (whatever the table is now made of),
     the appearance's pattern over both (palette.json `_backs`, --back from Views.js cardBack) */
  background: var(--back, none) center / 100% 100% no-repeat, linear-gradient(135deg, var(--c), var(--c2)), rgb(19 34 27);
  box-shadow: inset 0 0 0 1.5px var(--edge), 0 2px 6px rgb(0 0 0 / 0.4);
}
.card-back span { font-size: 20px; opacity: 0.5; }
.card-back.thinking { animation: breathe 1s ease-in-out infinite; }
.empty-slot { width: var(--pc-w); height: var(--pc-h); border-radius: 9px; border: 1.5px dashed rgb(var(--ink-rgb) / 0.35); background: rgb(0 0 0 / 0.18); display: grid; place-items: center; font-size: 22px; color: rgb(var(--ink-rgb) / 0.35); }
.flip { animation: flip 0.45s cubic-bezier(0.3, 1.4, 0.6, 1) both; }
@keyframes flip { from { transform: perspective(400px) rotateY(90deg) scale(0.9); } }

/* --- speech bubbles ------------------------------------------------------- */
.bubble-anchor { position: absolute; left: 50%; width: 0; display: flex; justify-content: center; z-index: var(--z-bubble, 5020); pointer-events: none; }
.bubble-anchor.below { top: 100%; align-items: flex-start; }
.bubble-anchor.above { bottom: 100%; align-items: flex-end; height: 0; }
.bubble-anchor .bubble { pointer-events: auto; }
/* a bot's words hang off its avatar: the tail on the avatar's middle (the tile's padding + half the avatar) */
.bubble-anchor.at-avatar { top: 34px; left: 8px; width: auto; justify-content: flex-start; align-items: flex-start; }
.bubble-anchor.at-avatar .bubble::before { left: 13px; }
.bubble-anchor.at-avatar .bubble.pop { transform-origin: 13px 0; }
/* your words hang off your avatar too: beside it in your box's foot, the tail on its middle */
.panel-foot { position: relative; }
.bubble-anchor.beside-avatar { top: 50%; left: 28px; width: auto; height: 0; justify-content: flex-start; align-items: center; }
.bubble-anchor.beside-avatar .bubble.pop { transform-origin: 0 50%; }
.panel-foot.talking > .tile-name { visibility: hidden; }
.avatar.pokeable { cursor: pointer; }
.avatar.pokeable:hover { box-shadow: inset 0 0 0 2.5px var(--c); }
.bubble { position: relative; filter: drop-shadow(0 2px 4px rgb(0 0 0 / 0.35)); }
.bubble-text {
  width: 146px; padding: 5px 8px; border-radius: 8px; text-align: center;
  font-size: 10px; font-weight: 500; color: rgb(0 0 0 / 0.85); background: rgb(var(--ink-rgb) / 0.92);
  box-shadow: inset 0 0 0 1.5px var(--c);
}
.bubble::before { content: ""; position: absolute; left: 50%; margin-left: -6px; border: 6px solid transparent; }
.bubble.tail-top { margin-top: 7px; }
.bubble.tail-top::before { bottom: 100%; border-bottom: 7px solid rgb(255 255 255 / 0.92); border-top: 0; }
.bubble.tail-bottom { margin-bottom: 7px; }
.bubble.tail-bottom::before { top: 100%; border-top: 7px solid rgb(255 255 255 / 0.92); border-bottom: 0; }
.bubble.tail-left { margin-left: 7px; }
.bubble.tail-left::before { right: 100%; left: auto; top: 50%; margin: -6px 0 0; border-right: 7px solid rgb(255 255 255 / 0.92); border-left: 0; }
/* your bubble with its field (GameView talkBubble), opened by a tap on your face: white, your colour round it */
.say-bubble { display: flex; align-items: center; gap: 4px; padding: 3px 3px 3px 10px; border-radius: 17px; background: rgb(255 255 255 / 0.95); box-shadow: inset 0 0 0 1.5px var(--c); }
.say-bubble.tail-left::before { border-right-color: rgb(255 255 255 / 0.95); }
.bubble-input { width: min(200px, 46vw); border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: rgb(0 0 0 / 0.85); padding: 4px 0; }
.bubble-input::placeholder { color: rgb(0 0 0 / 0.4); }
.panel-foot .avatar { position: relative; }
/* the little "…" bubble on your face after a reveal: a tap there speaks (GameView yourFace) */
.say-hint { position: absolute; right: -13px; top: -11px; min-width: 20px; height: 14px; padding: 0 4px; border-radius: 7px; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; line-height: 1; letter-spacing: 0.5px; color: rgb(0 0 0 / 0.75); background: rgb(255 255 255 / 0.95);
  box-shadow: inset 0 0 0 1.2px var(--c), 0 1px 3px rgb(0 0 0 / 0.4); pointer-events: none; }
.say-hint.pop { animation: pop 0.35s 0.25s cubic-bezier(0.3, 1.5, 0.6, 1) both; }
.say-hint::before { content: ""; position: absolute; left: 3px; bottom: -4px; border: 4px solid transparent; border-top-color: rgb(255 255 255 / 0.95); border-bottom: 0; border-left-width: 2px; }
.say-send { width: 28px; height: 28px; flex: none; border: 0; border-radius: 50%; padding: 0; display: grid; place-items: center; background: var(--orange); color: #222; cursor: pointer; }
.pop { animation: pop 0.35s cubic-bezier(0.3, 1.5, 0.6, 1) both; }
@keyframes pop { from { opacity: 0; transform: scale(0.6); } }

/* --- your panel ----------------------------------------------------------- */
.human-panel { position: relative; margin: 0 10px 10px; padding: 10px; border-radius: 12px; background: var(--panel); border: 1.5px solid rgb(89 204 242 / 0.45); display: flex; flex-direction: column; gap: 8px; z-index: var(--z-hand, 5010); }
.panel-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hand { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.hand-slot { display: flex; flex-direction: column; align-items: center; gap: 2px; }
/* all fifteen on one row while they can stay four fifths of their size:
   a second row takes the table's room, and with it the verdict and the replay bar */
@media (min-width: 641px) {
  .hand { container-type: inline-size; }
  .hand .playing-card.small { width: max(var(--pcs-w) * 0.8, min(var(--pcs-w), (100cqw - 14 * 6px) / 15)); height: auto; aspect-ratio: 52 / 74; }
}
.hint-pct { font-size: 8px; font-weight: 500; color: var(--secondary); }
.hint-pct.best { color: var(--orange); font-weight: 700; }
.panel-foot { display: flex; align-items: center; gap: 8px; }
.panel-foot .tile-name { flex: none; }

/* --- the info column ----------------------------------------------------- */
.sidebar { width: 310px; overflow-y: auto; padding: 10px; background: rgb(0 0 0 / 0.42); border-left: 0.5px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.side-head { margin-bottom: -6px; display: flex; justify-content: space-between; align-items: center; }
.side-head-end { display: flex; align-items: center; gap: 14px; }
/* the appearance at the table: the settings' box in a panel off the palette */
.popover:has(> .look-card) { width: min(400px, calc(100vw - 32px)); max-height: calc(100dvh - 60px); overflow-y: auto; }
.look-card { display: flex; flex-direction: column; gap: 10px; }
.look-card-head { display: flex; justify-content: space-between; align-items: baseline; }
.look-card-head button { color: var(--secondary); font-size: 13px; }
.look-card-head button:hover:not(:disabled) { color: var(--ink); }
.look-card .look-tiles { gap: 10px; }
.game.side-off .topbar { padding-right: 44px; }
.sidebar-show { position: fixed; top: 6px; right: 6px; border-radius: 50%; padding: 6px; background: rgb(0 0 0 / 0.4); border: 0; color: var(--secondary); z-index: var(--z-controls, 5030); line-height: 0; }
/* each card hangs in sws's Tischbuech frame (design/table.json infoColumn, theme.json book*):
   a dark page in a frame of charcoal, the frame's edges a hairline darker */
.side-card { padding: 10px 12px; border-radius: var(--cardcorner, 16px); background: var(--book-page, rgb(28 33 36));
             border: var(--cardframe, 10px) solid var(--book-frame, rgb(61 61 64));
             box-shadow: 0 0 0 1px var(--book-frame-edge, rgb(15 15 18)), inset 0 0 0 1px var(--book-frame-edge, rgb(15 15 18));
             display: flex; flex-direction: column; gap: 8px; }
.side-title { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; }
.side-title b { color: var(--secondary); font-size: 12px; }
.round-row { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.round-row .rn { width: 24px; }
.prize-chip { width: 26px; text-align: center; font-weight: 700; border-radius: 3px; padding: 1px 0; }
.prize-chip.mouse { background: rgb(255 159 10 / 0.35); }
.prize-chip.vulture { background: rgb(255 69 58 / 0.4); }
.plays { display: inline-flex; gap: 2px; }
.strategy { display: flex; flex-direction: column; gap: 5px; padding: 2px 0; }
.strategy-head { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.strategy-head .label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.strategy-head .grow, .strategy-head b, .strategy-head .muted { flex: none; }
.strategy-head .grow { flex: 1 0 0; }
.strategy-head b { font-size: 12px; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 4px; }
.chip { display: inline-flex; gap: 3px; align-items: baseline; padding: 2px 5px; border-radius: 4px; background: var(--bg); box-shadow: inset 0 0 0 1px transparent; }
.chip b { color: var(--c); font-size: 11px; }
.chip span { font-size: 9px; color: var(--secondary); }
.chip.chosen { box-shadow: inset 0 0 0 1px var(--c); }
.chip.coach { --c: var(--orange); --bg: color-mix(in srgb, var(--orange) 12%, transparent); }
.chip.coach.chosen { --bg: color-mix(in srgb, var(--orange) 30%, transparent); }
/* the info column's Coach card: its title folds it */
button.fold { all: unset; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; }
button.fold .icon { transition: transform 0.15s; vertical-align: -1px; }
button.fold[aria-expanded="true"] .icon { transform: rotate(90deg); }
button.fold:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
.coach-row { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.coach-row .chip { flex: none; }
.tip-coach { display: flex; flex-direction: column; gap: 4px; padding-bottom: 8px; border-bottom: 0.5px solid var(--line); }
/* the ⓘ panels: one fixed layer above the table, the columns and the
   bubbles - below the confirmation dialog only (Popover in Views.js) */
.info-button { padding: 2px; line-height: 0; color: var(--secondary); border-radius: 50%; }
.cheat-badge { margin-left: 4px; cursor: help; }
.voice-switch { color: var(--tertiary); line-height: 0; }
.voice-switch.on { color: var(--orange); }
.backlink { flex: none; width: 34px; height: 34px; border: 0; padding: 8px; border-radius: 50%; background: rgb(var(--ink-rgb) / 0.12); color: rgb(var(--ink-rgb) / 0.75); cursor: pointer; box-shadow: none; }
.backlink svg { width: 100%; height: 100%; display: block; }
.backlink:hover:not(:disabled) { color: var(--ink); background: rgb(var(--ink-rgb) / 0.18); }
.arena-screen { position: relative; }
.arena-screen .backlink { position: absolute; top: 20px; left: 20px; }
.rule { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0; }
.rule input { margin-top: 3px; }
.rule span { display: flex; flex-direction: column; gap: 1px; }
/* Settings: fine-tuning the bots, one disclosure each */
.tuning-list { display: flex; flex-direction: column; gap: 2px; }
details.tuning summary { cursor: pointer; font-size: 13px; padding: 3px 0; }
.tuned-tag { margin-left: 6px; padding: 0 6px; border-radius: 8px; font-size: 10px; background: rgb(var(--ink-rgb) / 0.14); color: var(--orange); }
.knobs { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px 16px; align-items: flex-start; }
.knob { display: flex; flex-direction: column; gap: 2px; width: min(420px, 100%); }
.knob-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.knob-value { font-variant-numeric: tabular-nums; }
.knob input[type=range] { width: 100%; accent-color: var(--orange); }
.rule.knob-switch { margin: 0; width: min(420px, 100%); }
.info-button[aria-expanded="true"] { color: var(--orange); }
.popover-layer { position: fixed; z-index: var(--z-card, 10040); }
.popover { width: min(320px, calc(100vw - 32px)); max-height: calc(100dvh - 16px); overflow-y: auto; padding: 14px; border-radius: 12px; background: var(--surface); border: 0.5px solid var(--line); box-shadow: 0 12px 36px rgb(0 0 0 / 0.35); display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.popover h4 { font-size: 14px; }
/* a tooltip shown by a tap (touchTip): as wide as its words */
.popover:has(> p.touch-tip:only-child) { width: max-content; max-width: min(320px, calc(100vw - 32px)); padding: 8px 12px; }
.popover p.touch-tip { color: var(--ink); }
.popover dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; padding-bottom: 8px; border-bottom: 0.5px solid var(--line); }
.popover dt { color: var(--secondary); }
.popover dd { margin: 0; }
.popover p { color: var(--secondary); }

/* --- the finish view ------------------------------------------------------ */
.finish { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 30px 16px; text-align: center; }
.finish h2 { font-size: 20px; }
.finish .headline { font-size: 20px; }
/* the game's box: who won on top, the points, the rating below */
.final-board { position: relative; padding: 20px; border-radius: 14px; background: rgb(var(--ink-rgb) / 0.06); display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 100%; }
.final-rows { display: flex; flex-direction: column; gap: 8px; max-width: 100%; }
.final-board .saved p { margin: 0; }
/* your win: the headline jumps once every five seconds, fireworks over the box (GameView.js Cheer) */
.final-board .headline.cheer { animation: cheer 5s infinite; }
@keyframes cheer {
  0% { transform: scale(1); }
  3% { transform: scale(1.12) rotate(-1.5deg); }
  7% { transform: scale(0.97) rotate(1deg); }
  11% { transform: scale(1.04); }
  16%, 100% { transform: scale(1); }
}
.final-board .fireworks { position: absolute; inset: -60px; width: calc(100% + 120px); height: calc(100% + 120px); pointer-events: none; }
.final-row { display: flex; align-items: center; gap: 10px; }
.final-name { flex: none; width: 130px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* fixed columns: the scores stand under each other */
.final-score { flex: none; width: 44px; text-align: right; }
.final-prizes { flex: 1; min-width: 0; display: flex; gap: 3px; flex-wrap: wrap; }

/* --- narrower screens ------------------------------------------------------ */
@media (max-width: 900px) {
  .game { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 100dvh; }
  .play { min-height: 100dvh; }
  .sidebar { width: auto; border-left: 0; border-top: 0.5px solid var(--line); }
}
@media (max-width: 640px) {
  :root { --pc-w: 42px; --pc-h: 60px; --pcs-w: 40px; --pcs-h: 58px; --prize-w: 76px; --prize-h: 106px; }
  .table-view .playing-card .big { font-size: 18px; }
  .table-view .playing-card .corner { font-size: 8px; }
  .card-back span { font-size: 15px; }
  .prize-card .caption { font-size: 6px; }
  .topbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .table-row { gap: 10px; }
  .bots-group { gap: 6px; }
  .col-label { font-size: 10px; }
  .stamp { display: none; }
  .prize-card .face { font-size: 28px; }
  .prize-card .value { font-size: 24px; }
  .playing-card .big { font-size: 20px; }
  .playing-card.small .big { font-size: 16px; }
  .hand { gap: 4px; }
  .result { font-size: 15px; }
  .final-board { padding: 16px 14px; }
  .final-name { width: 92px; }
  .final-score { width: 32px; }
  .hero h1 { font-size: 30px; }
  .setup-label, .bot-name { width: 100%; }
}

/* --- step 3/4: database, profiles, coach, arena, replay ------------------- */
button.link { background: none; border: 0; box-shadow: none; padding: 1px 3px; color: var(--orange); font-size: 11px; }
button.link:hover:not(:disabled) { background: none; text-decoration: underline; }
button.link.faint { color: var(--tertiary); }
button.link.quiet { color: var(--secondary); }   /* add player: the colour of its remove − */
button.teal { background: #30b0c7; }
button.teal:hover:not(:disabled) { background: #4cc4d9; }
.orange { color: var(--orange); }
.good { color: var(--green); }
.setup-body { width: min(620px, 100%); display: flex; justify-content: center; }
.setup-body > .setup-card { width: 100%; }
/* the help book (HelpView.js): its tabs, its topics beside the page - on a phone a strip above it */
.setup-body.wide { width: min(820px, 100%); }
.help { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.help-book { width: 100%; display: flex; align-items: flex-start; gap: 18px; }
.help-topics { flex: 0 0 210px; display: flex; flex-direction: column; gap: 2px; }
.help-topics button { display: flex; align-items: center; gap: 8px; text-align: left; padding: 6px 10px; border-radius: 8px;
  color: rgb(var(--ink-rgb) / 0.65); font-size: 14px; white-space: nowrap; }
.help-topics button:hover { color: var(--ink); }
.help-topics button.on { color: var(--ink); font-weight: 600; background: rgb(var(--ink-rgb) / 0.10); }
.help-page { flex: 1; min-width: 0; text-align: left; padding: 20px; border-radius: 16px; background: rgb(var(--ink-rgb) / 0.06);
  color: rgb(var(--ink-rgb) / 0.85); font-size: 15px; line-height: 1.5; }
.help-page h3 { margin: 0 0 10px; color: var(--ink); font-size: 19px; }
.help-page p { margin: 0 0 10px; }
.help-page ul { margin: 0 0 10px; padding-left: 20px; }
.help-page li { margin: 2px 0; }
.help-version { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; padding: 10px; border-radius: 8px;
  background: rgb(var(--ink-rgb) / 0.06); user-select: text; }
@media (max-width: 640px) {
  .help-book { flex-direction: column; gap: 10px; }
  .help-topics { flex: none; width: 100%; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .help-page { padding: 14px; }
}
.segmented { align-self: flex-start; display: inline-flex; padding: 2px; border-radius: 7px; background: var(--field); }
.segmented button { border: 0; background: none; box-shadow: none; padding: 2px 9px; border-radius: 5px; font-size: 12px; }
.segmented button.selected { background: rgb(var(--ink-rgb) / 0.2); }
.roster-row { display: flex; align-items: center; gap: 6px; }
.roster-row .bot-row { flex: 1; }
.small-select { font-size: 11px; padding: 2px 4px; }
.spinner { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--tertiary); border-top-color: var(--orange); animation: spin 0.8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }

.profile-card { padding: 10px; border-radius: 10px; background: rgb(var(--ink-rgb) / 0.04); display: flex; flex-direction: column; gap: 6px; }
.profile-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12px; }
button.link.coach-link { align-self: flex-start; font-weight: 700; font-size: 12px; padding-left: 0; }
h3.coach-title { color: var(--orange); }
.coach-head { display: flex; align-items: center; gap: 6px; }
.game-coach { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.game-coach h3 { margin: 0; font-size: 13px; }
.finish .game-coach { width: 100%; max-width: 560px; padding: 14px 16px; border-radius: 14px; background: rgb(var(--ink-rgb) / 0.04); }
.coach-picks { display: inline-flex; justify-content: flex-end; gap: 8px; white-space: nowrap; }
.setup-card.learning > p:not(.tiny) { margin: 0; line-height: 1.45; }
.how-tips { margin: 0; padding-left: 18px; display: grid; gap: 8px; line-height: 1.45; }
/* the Übungen: the ladder (SetupView drillsSection), and a drill at the table (GameView) */
.drill-level { display: flex; flex-direction: column; gap: 6px; }
.drill-level h3 { margin: 6px 0 2px; }
.drill-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-align: left; background: rgb(var(--ink-rgb) / 0.05); border: 1px solid transparent; }
.drill-row:hover { background: rgb(var(--ink-rgb) / 0.1); }
.drill-num { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgb(var(--ink-rgb) / 0.12); font-weight: 700; font-size: 12px; }
.drill-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.drill-row .tiny-prize { flex: none; }
.drill-level.mine { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid rgb(var(--ink-rgb) / 0.12); }
.drill-level.mine:last-child { margin: 10px 0 0; padding: 10px 0 0; border-bottom: 0; border-top: 1px solid rgb(var(--ink-rgb) / 0.12); }
.drill-tick { width: 16px; flex: none; font-weight: 700; text-align: center; }
.drill-ask .drill-intro { font-size: 14px; line-height: 1.45; color: var(--secondary); }
.drill-feedback { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.verdict.drill-grade.costly { color: var(--red); }
.drill-why { font-size: 13.5px; line-height: 1.5; text-align: left; margin: 0; }
.drill-chart { margin: 0; width: 100%; display: flex; flex-direction: column; gap: 4px; }
.dc-cols { display: flex; justify-content: center; align-items: stretch; gap: 3px; height: 96px; }
.dc-col { flex: 0 1 36px; min-width: 14px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dc-val { min-height: 12px; font-size: 9.5px; font-weight: 700; white-space: nowrap; color: var(--secondary); }
.dc-track { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; }
.dc-bar { width: 100%; border-radius: 3px 3px 0 0; background: rgb(var(--ink-rgb) / 0.22); }
.dc-col.best .dc-bar { background: var(--orange); }
.dc-col.yours .dc-bar { outline: 2px solid var(--ink); outline-offset: 1px; }
.dc-col.best .dc-val { color: var(--orange); }
.dc-card { font-size: 10.5px; font-weight: 700; color: var(--secondary); white-space: nowrap; }
.dc-col.yours .dc-card { color: var(--ink); }
.drill-end { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.drill-end p { margin: 0; font-size: 13px; }
.drill-card > b { font-size: 13px; }
.coach-results { display: flex; flex-direction: column; gap: 4px; }
.blunder button.link { font-size: 10px; }
.coach-table-wrap { overflow-x: auto; }
.coach-table { border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.coach-table th, .coach-table td { padding: 2px 10px 2px 0; text-align: right; white-space: nowrap; }
.coach-table th:first-child { text-align: left; font-weight: 400; color: var(--secondary); }
.coach-table thead th { color: var(--orange); font-weight: 700; vertical-align: bottom; }
.coach-table thead th small { display: block; font-weight: 400; color: var(--secondary); }

.setup-card.db { gap: 10px; }
.db-scroll { max-height: min(460px, 60vh); overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding-right: 4px; }
.db-section { display: flex; flex-direction: column; gap: 6px; }
.db-head { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.db-head b { font-size: 12px; }
.db-row { padding: 4px 10px; border-radius: 8px; background: rgb(var(--ink-rgb) / 0.04); }
.db-row > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; list-style: none; flex-wrap: wrap; min-height: 26px; }
.db-row > summary::-webkit-details-marker { display: none; }
.db-row > summary::before { content: "›"; color: var(--tertiary); transition: transform 0.15s; display: inline-block; width: 16px; font-size: 22px; line-height: 1; text-align: center; }
/* a row's signs as large as its replay disc, each its own 32px to tap: the coach, the star and the
   trash can stand apart, so a tap meant for one never lands on its neighbour (iPad, 2026-11-01) */
.db-row > summary > button { min-width: 32px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.db-row[open] > summary::before { transform: rotate(90deg); }
.lead-date { min-width: 104px; color: var(--secondary); font-variant-numeric: tabular-nums; }
/* the scores take the row's room and wrap in it, the buttons stay on the first line */
.db-row > summary .score-line { flex: 1 1 0; min-width: 120px; }
.db-row > summary .score-line > span { white-space: nowrap; }   /* a name keeps its score */
.trophy { width: 20px; text-align: center; }
.rating { color: var(--orange); }
.date { white-space: nowrap; }
.star { color: var(--tertiary); }
.star.on { color: #ffd60a; }
.db-detail { display: flex; flex-direction: column; gap: 4px; padding: 6px 0 4px 16px; font-size: 11px; }
.db-detail p { font-size: 10px; }
.db-detail hr { border: 0; border-top: 0.5px solid var(--line); width: 100%; margin: 4px 0; }
.db-detail-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.db-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 0.5px solid var(--line); padding-top: 10px; }
.empty { padding: 8px 0; }
.popover code { font-size: 11px; color: var(--ink); }

.table-scroll { overflow-x: auto; max-width: 100%; }
.grid-table { border-collapse: collapse; font-size: 11px; }
.grid-table th, .grid-table td { padding: 3px 7px; text-align: left; white-space: nowrap; }
.grid-table th { font-size: 10px; color: var(--secondary); }
.grid-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.grid-table.cross th, .grid-table.cross td { text-align: center; }
.grid-table.cross th.left { text-align: left; }
.grid-table td.lead { color: rgb(48 209 88 / 0.9); }
.grid-table td.trail { color: rgb(255 69 58 / 0.85); }
.grid-table td.best { color: var(--orange); font-weight: 700; }

.arena-screen { min-height: 100dvh; }
.arena { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 30px 16px; text-align: center; }
.arena h2 { font-size: 30px; }
.arena-progress { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.arena-progress b { font-size: 15px; }
.arena-progress progress { width: min(440px, 90vw); accent-color: var(--orange); }
.panel-box { padding: 14px 18px; border-radius: 14px; background: rgb(var(--ink-rgb) / 0.06); }
.standings { font-size: 13px; }
.standings th { font-size: 11px; }
.standings td, .standings th { padding: 5px 9px; }
.who { display: inline-flex; align-items: center; gap: 6px; }
.arena-grids { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; max-width: 100%; }

.transport-slot { display: flex; align-items: center; justify-content: center; }
/* never scrolled away: when the table runs out of room the bar sticks to its foot */
.filler.transport-slot { flex: 1 0 auto; position: sticky; bottom: 8px; z-index: var(--z-bar, 10030); }
.transport {
  position: relative; z-index: var(--z-bar, 10030);
  display: inline-flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 999px; white-space: nowrap;
  background: rgb(20 30 26 / 0.55); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: inset 0 0 0 2px rgb(255 159 10 / 0.55), 0 6px 24px rgb(0 0 0 / 0.55);
}
.tgroup { display: inline-flex; align-items: center; gap: 4px; }
.tbtn { background: none; border: 0; box-shadow: none; padding: 0; width: 26px; height: 22px; display: inline-grid; place-items: center; color: var(--ink); border-radius: 4px; }
.tbtn:hover:not(:disabled) { background: rgb(var(--ink-rgb) / 0.12); }
.tbtn.tplay { color: var(--orange); }
.tbtn.on { color: var(--orange); }
.tbtn:not(.on):not(.tplay) { color: var(--ink); }
/* your panel's controls: icons only, a touch target each */
.panel-head .tbtn { width: 40px; height: 36px; border-radius: 8px; }
.panel-head .tbtn.on { background: rgb(var(--ink-rgb) / 0.10); }
.panel-head .tbtn.danger-text { color: #ff6961; }
.dots { display: inline-flex; align-items: center; gap: 3px; }
.rdot { width: 6px; height: 6px; padding: 0; border: 0; box-shadow: none; border-radius: 3px; background: rgb(var(--ink-rgb) / 0.15); transition: width 0.2s; }
.rdot.past { background: rgb(var(--ink-rgb) / 0.55); }
.rdot.current { width: 14px; background: var(--orange); }
.rdot:hover { background: rgb(var(--ink-rgb) / 0.8); }
.counter { font-size: 12px; color: var(--secondary); }
.speed { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--secondary); }
.speed span { filter: grayscale(1); opacity: 0.7; }
.speed input { width: 80px; accent-color: var(--orange); }
.tdivider { width: 1px; height: 14px; background: var(--line); }
.verdict { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 999px; background: rgb(0 0 0 / 0.25); color: var(--orange); font-size: 13px; }
.verdict.good { color: var(--green); }
.result-plate { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.result-plate .verdict { background: none; padding: 0; text-shadow: 0 1px 2px rgb(0 0 0 / 0.85), 0 0 8px rgb(0 0 0 / 0.5); }
.play.bare .table-view .status > .result-plate { padding: 6px 14px 7px; }
.hand-slot.dim .playing-card { opacity: 0.6; }
.hint-pct.good { color: var(--green); font-weight: 700; }
.link-row { background: none; border: 0; box-shadow: none; padding: 1px 0; width: 100%; text-align: left; color: var(--ink); border-radius: 4px; }
.link-row:hover { background: rgb(var(--ink-rgb) / 0.06); }
.finish-buttons { display: flex; gap: 12px; align-items: center; }
.saved { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.saved .best { color: var(--orange); font-size: 15px; }

@media (max-width: 640px) {
  .transport { gap: 8px; padding: 8px 10px; flex-wrap: wrap; justify-content: center; border-radius: 18px; white-space: normal; }
  .speed input { width: 60px; }
  .db-row > summary { gap: 6px; }
  .roster-row { align-items: flex-start; }
}
select:disabled { opacity: 0.4; }

/* --- a match (Match.js): the board after a game, the info column's card, Play's running match */
.match-board { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.match-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.match-table th { font-size: 11px; font-weight: 500; color: rgb(var(--ink-rgb) / 0.55); padding: 2px 8px; }
.match-table td { padding: 4px 8px; border-top: 1px solid rgb(var(--ink-rgb) / 0.08); }
.match-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.match-table td.key { font-weight: 800; }
.match-table tr.won td { color: var(--orange); }
.match-verdict { margin: 4px 0 0; }
.match-card .match-line { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 2px 0; }
.match-running { padding: 10px 12px; border-radius: 12px; background: rgb(255 159 10 / 0.12); border: 1px solid rgb(255 159 10 / 0.35); display: flex; flex-direction: column; gap: 4px; }
.match-running p { margin: 0; }
.match-running .finish-buttons { justify-content: flex-start; margin-top: 4px; }
.match-note { margin: -4px 0 0; }
.team-note { margin: 4px 0 0; }
.match-row > summary { flex-wrap: wrap; }
.match-row .match-rule { flex: none; }
.match-row .round-row .rn { width: auto; min-width: 56px; }

/* --- the house (Online/): the door and the room */
.online-problem { color: var(--orange); margin: 6px 0 0; }
.online-status { margin: 6px 0 0; }
.online-table b { min-width: 64px; font-family: ui-monospace, monospace; letter-spacing: 1px; }
.code-field { width: 110px; font-family: ui-monospace, monospace; letter-spacing: 2px; text-transform: uppercase; }
.online-mine { border: 1px solid rgb(255 159 10 / 0.35); background: rgb(255 159 10 / 0.08); }
.online-card .match-line { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 2px 0; }

/* --- the Team (Match.js Team): your partner's badge, the lead's gold ring, the pairs' standing */
.player-tile.partner { border-color: rgb(var(--ink-rgb) / 0.35); }
.player-tile.lead { box-shadow: 0 0 0 2px rgb(255 204 0 / 0.9); }
.partner-badge { font-size: 10px; font-weight: 600; margin-left: 6px; padding: 1px 6px; border-radius: 8px; background: rgb(var(--ink-rgb) / 0.1); vertical-align: middle; }
.team-lead { margin: 4px 0 0; font-size: 13px; text-align: center; }
.team-lead.you { color: var(--orange); }
.team-standing { font-size: 20px; font-weight: 800; text-align: center; margin: 4px 0; font-variant-numeric: tabular-nums; }
.team-card .team-standing { font-size: 18px; }

/* --- the Differenzler: your announcement, where the table asks for a card */
/* a dialog on the table - the Differenzler's question, a drill's question and its
   coaching: in the result's dark glass (.play .finish), shadowed, so it reads on any top */
.table-dialog { align-self: center; width: min(604px, calc(100% - 24px)); box-sizing: border-box; padding: 16px 22px;
                   border-radius: 18px; background: rgb(14 20 17 / 0.8); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
                   box-shadow: 0 6px 24px rgb(0 0 0 / 0.4); }
.status.announce { gap: 8px; }
.announce-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.announce-go { align-self: center; min-width: 140px; }
.announce-row button.mini { min-width: 36px; padding: 4px 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.announce-n { width: 84px; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; padding: 2px 6px; }
.announce-scale { display: flex; align-items: center; gap: 8px; width: min(420px, 100%); margin: 0 auto; }
.announce-scale span { min-width: 22px; font-size: 12px; opacity: 0.75; text-align: center; font-variant-numeric: tabular-nums; }
.announce-slider { flex: 1; accent-color: var(--orange); }

/* --- the game variant, on the home screen above the doors (as sws's games) */
.segmented.variants { display: flex; justify-content: center; margin: 4px auto 18px; width: fit-content; max-width: 100%; flex-wrap: wrap; }
.title-variant { font-weight: 500; opacity: 0.7; }
.segmented.variants button { font-size: 15px; padding: 6px 16px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.segmented.variants button svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.segmented.variants button span { white-space: nowrap; }
/* a phone: three to a row, as sws's intro (perRow 3) - five are 3 + 2 */
@media (max-width: 520px) { .segmented.variants { width: 100%; } .segmented.variants button { flex: 1 1 30%; min-width: 0; padding: 6px 6px; gap: 5px; font-size: 14px; }
  .segmented.variants button span { overflow: hidden; text-overflow: ellipsis; } }
.db-selectors { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 10px; }
.db-selectors .segmented { align-self: center; flex-wrap: wrap; justify-content: center; }
.db-selectors .segmented button { font-size: 13px; padding: 4px 12px; }

/* --- installed on a phone (manifest.json, apple-mobile-web-app-*): the page
   reaches under the status bar and the notch - keep clear of them. The
   insets are 0 everywhere else. */
body { box-sizing: border-box; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.game { height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 0; }
/* a narrow screen: the play column a screen tall, the info column below it -
   the page scrolls on to it */
@media (max-width: 900px) {
  .game { height: auto; }
  .play { min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
}
.sidebar-show { top: calc(6px + env(safe-area-inset-top)); right: calc(6px + env(safe-area-inset-right)); }

/* --- the appearance (Settings, the wizard): the looks as tiles, the editor ---- */
.look-tiles { display: flex; flex-wrap: wrap; gap: 14px; }
.look-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; box-shadow: none; cursor: pointer; font-size: 12px; color: var(--ink); }
.look-scene { width: 96px; height: 96px; border-radius: 14px; display: grid; place-items: center; background-size: 48px 48px; background-repeat: repeat;
              box-shadow: 0 2px 6px rgb(0 0 0 / 0.25); border: 3px solid transparent; }
.look-tile.on .look-scene { border-color: rgb(255 204 0); }
.look-tile.on .look-name { font-weight: 700; }
.look-top { width: 66px; height: 66px; border-radius: 12px; background-size: 100% 100%; display: grid; place-items: center; box-shadow: 2px 4px 8px rgb(0 0 0 / 0.4); }
.look-top.round { border-radius: 50%; }
.look-cloth { width: 34px; height: 34px; border-radius: 6px; box-shadow: 0 1px 3px rgb(0 0 0 / 0.4); }
.look-name { max-width: 104px; text-align: center; }
.look-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.look-editor { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px; background: rgb(var(--ink-rgb) / 0.06); }
.look-line { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; font-size: 13px; }
.look-line > span { color: var(--secondary); }
.segmented.wrap { flex-wrap: wrap; }
.look-name-field { font: inherit; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--field); color: var(--ink); max-width: 320px; }
.look-buttons { display: flex; justify-content: flex-end; gap: 10px; }
.setting-line { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.wizard-choices.looks { max-width: 620px; gap: 16px; }
.wizard-choices.looks .look-tile { font-size: 14px; }
@media (max-width: 480px) { .look-line { grid-template-columns: 1fr; gap: 4px; } }
