/* The card table's interface kit: the text around the table. Everything here is drawn by CSS: no image, no web font.
   (3.6.0) Its look is tokens: an interface look (card-table/looks/ui) changes them, and a few rules, under
   :root[data-ui="<id>"]. The default is the one below. */

/* (3.7.0) the package's own faces, shipped as files (card-table/fonts, SIL Open Font License 1.1, Latin): Gelasio, a book
   serif drawn on Georgia's metrics (the same widths and line heights: nothing moves), for every title, total and the
   brand; Source Sans 3 for the sentences where the machine has no Segoe UI. Nothing is fetched from the web. */
/* (Gelasio's line box set to Georgia's own: ascent 1878, descent 449 of 2048, no gap; its widths are Georgia's already,
   so a button or a line in the serif keeps its height and nothing around it moves) */
@font-face { font-family: "Gelasio"; font-style: normal; font-weight: 400; font-display: block; ascent-override: 91.7%; descent-override: 21.92%; line-gap-override: 0%; src: url("../fonts/gelasio-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Gelasio"; font-style: italic; font-weight: 400; font-display: block; ascent-override: 91.7%; descent-override: 21.92%; line-gap-override: 0%; src: url("../fonts/gelasio-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Gelasio"; font-style: normal; font-weight: 700; font-display: block; ascent-override: 91.7%; descent-override: 21.92%; line-gap-override: 0%; src: url("../fonts/gelasio-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Gelasio"; font-style: italic; font-weight: 700; font-display: block; ascent-override: 91.7%; descent-override: 21.92%; line-gap-override: 0%; src: url("../fonts/gelasio-latin-700-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }

:root {
  --ivory: #f4ecd8;
  --ivory-dim: rgba(244, 236, 216, 0.66);
  --ivory-2: rgba(244, 236, 216, 0.84);   /* a second line that must still be read */
  --gold: #e7c46a;
  --gold-deep: #b98f35;
  --panel: rgba(9, 16, 13, 0.78);
  --panel-solid: #0c1712;
  --line: rgba(240, 215, 150, 0.2);
  --red: #d2504a;
  /* (3.6.0) no Times anywhere. (3.7.0) The serif is the package's own file, Gelasio (Georgia's metrics: the word on the
     felt, drawn on the canvas, stays Georgia); the sans is the machine's Segoe UI where it has one, else the package's
     Source Sans 3 (never a system face that changes by machine) */
  --serif: "Gelasio", Georgia, Constantia, "Palatino Linotype", var(--ct-fb, serif);
  --sans: "Segoe UI Variable Text", "Segoe UI", "Source Sans 3", var(--ct-fb, sans-serif);
  --display: var(--serif);
  /* the type scale: a floor for small words, the body, the prompt, the display */
  --t-small: 13px; --t-body: 15px; --t-prompt: 17px;
  /* radii: a pill, a control, a panel */
  --r-pill: 999px; --r-ctl: 12px; --r-panel: 20px;
  /* buttons: the primary's fill and ink, the plain one's */
  --primary: linear-gradient(#ecd28c, #cfa64f); --primary-ink: #1c1608; --primary-edge: #f7e3a8;
  --plain: rgba(244, 236, 216, 0.1); --plain-hover: rgba(244, 236, 216, 0.18);
  --icon-size: 34px;
  --panel-strong: rgba(9, 16, 13, 0.92);   /* a panel over the table that must be read through nothing */
  --cap-bg: rgba(6, 10, 8, 0.88);          /* a caption under a name */
  --hi: rgba(255, 230, 160, 0.75);          /* the edge of what is lit (whose turn) */
  --red-ink: #ff7d74;                       /* red words on the panels (a red King's name) */
  /* (3.6.0) a game's own marks of a good and a bad outcome (a bonus struck on a total, a chip on the scores) follow
     these where an interface look sets them, and keep the game's own colours where none does (each is read with the
     game's value as its fallback, so none is set here): --good, --good-ink (the fill and its type), --good-glow (what
     lies round a mark on the table), and --bad, --bad-ink, --bad-glow likewise; --mark-r (their corners), --mark-edge
     (round a chip on a panel). A game's title of a win (its winner's screen) likewise: --win-ink (its colour) and
     --win-shade (its text-shadow). A look that letters every panel title its own way reads --panel-title and
     --panel-shade on them (its own values as their fallbacks), which a game sets on its own title only: so that the
     look's rule lets the game's title through. */
}
/* numbers read as numbers: lining, every digit the same width */
.total, .tpoints, .plate b, .me b, #mytotal, .srow .tot, .srow .round, .srow .rank, .sgrid .sr span, .tscoreboard b, .tscorechip b, .tbid { font-variant-numeric: lining-nums tabular-nums; }
/* (3.6.0) scrollbars of the kit's own panels: thin, in the kit's colours (never the browser's grey bar) */
.panel, .screen, .sr-body { scrollbar-width: thin; scrollbar-color: rgba(240, 215, 150, 0.35) transparent; }
.panel::-webkit-scrollbar, .screen::-webkit-scrollbar { width: 8px; height: 8px; }
.panel::-webkit-scrollbar-thumb, .screen::-webkit-scrollbar-thumb { background: rgba(240, 215, 150, 0.3); border-radius: 4px; }
.panel::-webkit-scrollbar-track, .screen::-webkit-scrollbar-track { background: transparent; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #020403; color: var(--ivory); font-family: var(--sans); overflow: hidden; overscroll-behavior: none; }
body { user-select: none; -webkit-user-select: none; }
/* the page's height follows a phone's bars as they slide in and out, and full screen */
body { height: 100dvh; }
/* The narrow rules at the end are container queries on the page: the body, or a frame that shows the table at a
   chosen size (the showroom's window sizes), so that a phone-sized frame gets the phone's interface. */
body { container-type: size; }
/* touch-action: a quick tap after another one is a press, never half of a double-tap that swallows the click */
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.hidden { display: none !important; }

#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
/* (3.8.0) the table reached by Tab: a quiet gilt line round the window says the arrows now move on the table */
#stage.kfocus { outline: 2px solid rgba(231, 196, 106, 0.55); outline-offset: -2px; }
/* (3.8.0) The text size (Settings › General: Large 1.15, Larger 1.3; `--tz`): the interface's words and panels drawn
   larger as a whole (zoom: a panel keeps its proportions and stays inside the window), the names and captions at the
   seats, the totals and the table's words; the table is framed again round the taller bar. What is placed by the kit at
   a point (a label, the coach line, points in flight) grows by its type only, so that it stays where it is placed. */
:root[data-text] #bar, :root[data-text] #roundinfo, :root[data-text] #topbar .chip, :root[data-text] .plate > *, :root[data-text] .total > *,
:root[data-text] .tbubble > span, :root[data-text] .tchip > span, :root[data-text] .tbanner .bin,
:root[data-text] .tscoreboard, :root[data-text] .tscorechip { zoom: var(--tz); }
/* (a zoomed panel's own percentages grow with it: held to the window as drawn) */
:root[data-text] #screens .screen > .panel { --pz: var(--tz); zoom: var(--pz); max-width: calc(100% / var(--pz)); max-height: calc(100% / var(--pz)); }
/* (on a phone a panel takes the larger text at most 1.12 times: its rows and buttons keep the window's width) */
@container (max-width: 480px) { :root[data-text] #screens .screen > .panel { --pz: min(var(--tz), 1.12); } }
:root[data-text] .tlabel { font-size: calc(13px * var(--tz)); }
:root[data-text] .tally { font-size: calc(12.5px * var(--tz)); }
:root[data-text] #coach { font-size: calc(14.5px * var(--tz)); }
:root[data-text] .tpoints { font-size: calc(28px * var(--size, 1) * var(--tz)); }
/* (3.8.0) words for a screen reader only (ui/access.js): out of sight, never out of the page */
.ct-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* --- the table's HUD ------------------------------------------------------------------------------------ */

#hud { position: fixed; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
#plates, #floaters { pointer-events: none !important; position: absolute; inset: 0; }
/* (4.25.0) names kept out of sight while the table is set, then shown where they stay */
#plates { transition: opacity 0.3s; }
#plates.wait { opacity: 0; transition: none; }

#topbar {
  position: absolute; left: 0; right: 0; top: 0; height: 44px; padding: 0 10px 0 14px;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(rgba(2, 5, 4, 0.82), rgba(2, 5, 4, 0));
}
/* the quality's Top bar shade, behind its words only: the shade at its two ends, none between them */
:root[data-top-shade="sides"] #topbar { background: none; isolation: isolate; }
:root[data-top-shade="sides"] #topbar::before {
  content: ""; position: absolute; inset: 0 0 -10px; z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(2, 5, 4, 0.82), rgba(2, 5, 4, 0));
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 30%, transparent 44%, transparent 62%, #000 76%, #000 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 30%, transparent 44%, transparent 62%, #000 76%, #000 100%);
}
.brand { font-family: var(--display); font-style: italic; font-weight: bold; font-size: 22px; color: var(--gold); letter-spacing: 0.5px; }
#roundinfo { font-size: 14px; color: var(--ivory-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
#roundinfo b { color: var(--ivory); font-weight: 600; }
.tools { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.tool {
  height: var(--icon-size); min-width: var(--icon-size); padding: 0 10px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600;
  background: rgba(244, 236, 216, 0.08); border: 1px solid var(--line); color: var(--ivory);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.tool:hover { background: rgba(244, 236, 216, 0.17); border-color: rgba(240, 215, 150, 0.4); }
.tool:active { transform: scale(0.94); }
.tool.icon { padding: 0; width: var(--icon-size); display: grid; place-items: center; }
.tool svg { width: 17px; height: 17px; display: block; }
/* (3.6.0) the technical settings live in Settings: a page that still carries them in its top bar shows none of them */
#topbar #quality, #topbar #resolution, #topbar #pace { display: none; }
/* the screens as data (ui/layout.js): a tool the look's layout leaves out is not shown; the limit said short is for a
   look that sets the round as a block (it shows it on a phone) */
#topbar .tool[data-off] { display: none; }
#roundinfo .short { display: none; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: rgba(244, 236, 216, 0.05); }
.seg button { padding: 9px 16px; font-size: 14.5px; font-weight: 600; color: var(--ivory-dim); transition: background 0.15s, color 0.15s; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; }
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button:hover { color: var(--ivory); background: rgba(244, 236, 216, 0.08); }
.seg button.on { background: var(--primary); color: var(--primary-ink); }
/* (3.8.0) a choice of a row reached by the keyboard: its ring inside it (the row clips what lies outside) */
.seg button:focus-visible { outline: 2px solid var(--gold); outline-offset: -4px; }
.seg.small button { padding: 0 10px; height: 28px; font-size: 12px; }

/* the players' names, at their seats */
.plate {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px; white-space: nowrap;
  will-change: transform;
}
/* (4.25.0) a name on two lines (a phone held upright, many players): the dot and the name, then its counts and score */
.plate .tag.two { display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center; column-gap: 5px; row-gap: 1px; padding: 3px 9px 4px; border-radius: 12px; }
.plate .tag.two .l2 { grid-column: 1 / 3; display: flex; align-items: center; justify-content: center; gap: 6px; }
.plate .tag.two b { font-size: 14px; min-width: 0; }
.plate .tag {
  display: flex; align-items: center; gap: 7px; padding: 3px 11px 3px 9px; border-radius: var(--r-pill);
  background: var(--panel); border: 1px solid var(--line); font-size: 14px; font-weight: 600;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.plate .dot, .me .dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(244, 236, 216, 0.25); transition: background 0.25s, box-shadow 0.25s; }
/* (3.6.0) the score beside a name reads from arm's length: larger and bold, the name stays as it was praised */
.plate b, .me b { color: var(--gold); min-width: 1.2em; text-align: end; font-size: 16px; font-weight: 700; line-height: 1.2; }
/* a hand or won tricks shown as a badge: how many, beside the name */
.plate .count, .me .count { font-style: normal; font-size: 12.5px; font-weight: 700; color: #1c1608; background: var(--ivory); border-radius: 999px; padding: 1px 6px; font-variant-numeric: lining-nums tabular-nums; display: inline-flex; gap: 6px; }
.plate .count span, .me .count span { display: inline-flex; align-items: center; gap: 3px; }
.plate .count .c::before, .me .count .c::before { content: ''; width: 6px; height: 9px; border: 1.5px solid currentColor; border-radius: 2px; }
.plate .count .t::before, .me .count .t::before { content: ''; width: 9px; height: 6px; border: 1.5px solid currentColor; border-radius: 2px; box-shadow: -2px 2px 0 -0.5px #f4ecd8, -2px 2px 0 1px currentColor; }
/* (3.4.1) tricks counted in words beside their number; such a name shows the won pile's label over it on hover */
.plate .count .tw, .me .count .tw { margin-inline-start: -0.15em; font-weight: 600; }
.tlabel.name { transform: translate(-50%, calc(-100% - 8px)); }
.plate.active .tag, .me.active { border-color: rgba(255, 230, 160, 0.75); box-shadow: 0 0 18px rgba(255, 215, 130, 0.35); background: rgba(40, 34, 14, 0.85); }
.plate.active .dot, .me.active .dot { background: #ffe39a; box-shadow: 0 0 8px #ffd676; }
/* (3.8.0) told apart without colour: whose turn has a shape of its own (the dot becomes a pointer), in every look */
.plate.active .dot, .me.active .dot { clip-path: polygon(12% 0, 100% 50%, 12% 100%); border-radius: 0; width: 9px; height: 10px; }
/* (4.25.0) the pointer keeps the dot's room, so that a name never grows by a pixel when its turn comes */
.plate.active .dot, .me.active .dot { margin: -1px -0.5px; }
/* what a bot does, under its name: read in the second it shows, so as large as the name, and it may take two lines */
.plate .cap {
  position: relative; font-size: 13.5px; font-weight: 500; line-height: 1.25; padding: 3px 10px; border-radius: 11px; background: var(--cap-bg); color: var(--ivory);
  opacity: 0; transform: translateY(-3px); transition: opacity 0.2s, transform 0.2s; max-width: min(240px, 58vw);
  white-space: normal; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.plate .cap.show { opacity: 1; transform: none; }
.plate .cap.cut { background: #fff6dd; color: #20170a; font-weight: 800; letter-spacing: 1px; box-shadow: 0 0 20px rgba(255, 245, 210, 0.8); }
.plate .cap.wrong { background: #5c1c18; color: #ffd2cc; }
.plate.right-of { transform: translate(8px, -50%); align-items: flex-start; }

/* numbers that appear on the table: totals at the reveal, the bonus and the penalty */
.total {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  font-family: var(--serif); font-weight: bold; font-size: 30px; color: var(--ivory); text-shadow: 0 2px 10px #000, 0 0 2px #000;
  font-variant-numeric: lining-nums tabular-nums; display: flex; align-items: baseline; gap: 6px; white-space: nowrap;
  animation: pop 0.28s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.total small { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--ivory-dim); }
.total.low { color: #ffe9a6; text-shadow: 0 0 18px rgba(255, 215, 120, 0.9), 0 2px 10px #000; }
/* (3.8.0) the lowest total told apart without colour: a rule under it (a look that marks it with a shape of its own, a
   framed chip, sets --low-mark: none) */
.total.low::after { content: ''; display: var(--low-mark, block); position: absolute; left: 50%; bottom: -5px; width: 72%; height: 3px; transform: translateX(-50%); border-radius: 2px; background: currentColor; box-shadow: 0 1px 4px #000; }
.sgrid .sr.low .tot { text-decoration: underline 2px; text-underline-offset: 4px; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -50%) scale(0.6); } }

/* (3.6.0) a first-time tip, once: in the interface's own panel and gilt line, never a blue tooltip */
#coach {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: max-content; max-width: min(400px, 92vw); padding: 9px 16px;
  border-radius: var(--r-ctl); background: var(--panel-strong); border: 1px solid rgba(240, 215, 150, 0.45); color: var(--ivory);
  font-size: 14.5px; line-height: 1.35; text-align: center; pointer-events: none !important; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}
#coach b { color: var(--gold); font-weight: 700; }
/* (3.7.0) beside the zone it names, a point toward it */
#coach.at::after {
  content: ''; position: absolute; left: var(--point, 50%); width: 12px; height: 12px; margin-left: -6px; transform: rotate(45deg);
  background: inherit; border: inherit; border-width: 0;
}
#coach.at.above::after { bottom: -7px; border-right-width: 1px; border-bottom-width: 1px; }
#coach.at.below::after { top: -7px; border-left-width: 1px; border-top-width: 1px; }
/* (4.17.0) a guided game's words. What to do: the coach line, pointing at it, with no button; it says itself again
   (a short nudge) when something else is pressed. What happens and why: a panel, read at the player's pace, its title in
   the display face, a strip of real cards when cards say it better, and Next; in the middle, the table waiting behind it. */
#coach.guide-do { font-size: 15.5px; padding: 10px 18px; }
#coach.nudge { animation: guideNudge 0.42s ease-out; }
@keyframes guideNudge { 30% { box-shadow: 0 0 0 4px rgba(231, 196, 106, 0.55), 0 6px 24px rgba(0, 0, 0, 0.45); } }
#hud #coach.guide-do { z-index: 8; }
#hud #coach.guide-panel { z-index: 8; background: rgb(11, 19, 15); pointer-events: auto !important; width: min(440px, calc(100vw - 24px)); max-width: none; padding: 16px 20px 14px; text-align: start; border-color: rgba(240, 215, 150, 0.6); box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55); cursor: default; }
#coach.guide-panel .gp-title { font-family: var(--display); font-size: 20px; font-weight: 700; color: var(--gold); margin-bottom: 6px; line-height: 1.2; }
#coach.guide-panel .gp-text { font-size: 15px; line-height: 1.45; color: var(--ivory); }
#coach.guide-panel .gp-body { display: flex; align-items: flex-end; gap: 16px; }
#coach.guide-panel .gp-body .gp-text { flex: 1; min-width: 0; }
#coach.guide-panel .gp-foot { display: flex; justify-content: flex-end; margin-top: 10px; }
#coach.guide-panel .gp-next { flex: none; padding: 7px 20px; font-size: 14.5px; min-height: 0; }
@media (max-width: 480px) { #coach.guide-panel .gp-body { flex-direction: column; align-items: flex-end; gap: 10px; } #coach.guide-panel .gp-body .gp-text { align-self: stretch; } }
#coach.gp-middle { width: min(480px, calc(100vw - 24px)); }
/* (4.18.0) behind a panel in the middle the table is not dimmed: the veil only keeps the table from being played */
.guide-veil { position: absolute; inset: 0; background: transparent; pointer-events: auto; }
/* the cards of a panel, in a row that overlaps as a hand does, its two ends named under it */
.gp-strip { margin-top: 12px; container-type: inline-size; --w: min(56px, calc(100cqw / (var(--n) * 0.56 + 0.44))); }
.gp-cards { display: flex; justify-content: center; padding: 10px 0 2px; }
.gp-card { width: var(--w); height: auto; border-radius: 4px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.gp-card + .gp-card { margin-inline-start: calc(var(--w) * -0.44); }
/* a few cards side by side, each in full */
.gp-strip.few { --w: 56px; } .gp-strip.few .gp-card + .gp-card { margin-inline-start: 8px; }
.gp-card.mark { transform: translateY(-8px); box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(231, 196, 106, 0.7); position: relative; z-index: 1; }
.gp-ends { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ivory-dim, #c9c0a8); margin-top: 6px; }
/* (4.19.0) a strip in groups: a row each, its cards overlapping enough to tell them apart, its words beside them */
.gp-strip.gp-groups { --w: 52px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.gp-group { display: flex; align-items: center; gap: 12px; }
.gp-groups .gp-cards { justify-content: flex-start; padding: 2px 0; }
.gp-groups .gp-card + .gp-card { margin-inline-start: calc(var(--w) * -0.58); }
.gp-label { font-size: 14.5px; color: var(--ivory, #f4ecd8); white-space: nowrap; }
.gp-cap { margin-top: 10px; font-size: 14.5px; color: var(--ivory, #f4ecd8); }
.gp-cap + .gp-strip { margin-top: 4px; }
/* the hand that shows a gesture */
/* the gesture shown to a player who seems stuck: a pointing hand, ivory with a fine gold edge (a picture), and a ring of
   gold where it presses */
.guide-hand { position: absolute; left: 0; top: 0; width: 30px; height: 30px; pointer-events: none !important; z-index: 9; }
.guide-hand .gh-look { position: absolute; inset: 0; display: block; }
.guide-hand .gh-look img { width: 100%; height: 100%; display: block; -webkit-user-drag: none; user-select: none; }
.guided-offer h2 { margin-bottom: 14px; }
.guide-hand .gh-look { filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 6px rgba(231, 196, 106, 0.3)); }
.guide-hand .ripple { position: absolute; width: 0; height: 0; border-radius: 50%; border: 2px solid rgba(231, 196, 106, 0.95); box-shadow: 0 0 10px rgba(231, 196, 106, 0.6); transform: translate(-50%, -50%); opacity: 0; }
.guide-hand .ripple.go { animation: guideRipple 0.65s ease-out; }
@keyframes guideRipple { 0% { width: 8px; height: 8px; opacity: 1; } 100% { width: 58px; height: 58px; opacity: 0; } }
.guided-offer p { margin: 6px 0 16px; }
@media (prefers-reduced-motion: reduce) { #coach.nudge { animation: none; } }

/* the bar under the person's hand: who they are, what can be done now, the two buttons */
#bar {
  position: absolute; left: 0; right: 0; bottom: 0; min-height: 58px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(rgba(2, 5, 4, 0), rgba(2, 5, 4, 0.88) 40%);
}
.me {
  display: flex; align-items: center; gap: 7px; padding: 5px 13px 5px 10px; border-radius: var(--r-pill); flex: none;
  background: var(--panel); border: 1px solid var(--line); font-size: 15px; font-weight: 600; transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.me b { font-size: 17px; }
/* (its height is the bar's on a phone, which frames the table: kept as it was) */
.me { min-height: 33px; }
.say { flex: 1; min-width: 0; text-align: center; }
/* the prompt says what to do now, verb first: the line the eye reads */
#prompt { font-size: var(--t-prompt); font-weight: 600; line-height: 1.22; text-shadow: 0 1px 6px #000; }
#prompt em { font-style: normal; color: var(--gold); }
#prompt .red { color: #ff8d86; }
#prompt small { font-size: 0.86em; font-weight: 500; color: var(--ivory-2); }
/* one line, always: a message that wrapped would grow the bar and move the whole table. (3.6.0) Read, not guessed at:
   the reminder of a rule that holds at every moment is as legible as any other line */
#cuthint { font-size: 13.5px; font-weight: 500; line-height: 1.25; color: var(--ivory-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#cuthint.live { color: #fff3d0; }
#cuthint.note { color: #ffe9a6; font-weight: 600; }
#cuthint em { font-style: normal; color: var(--gold); }
#cuthint.off { visibility: hidden; }
/* the turn hints turned off (Settings, General): the running line and the hint while a card is carried keep their room,
   unseen; a short answer to a press (a toast) still shows */
:root[data-hints="off"] #prompt, :root[data-hints="off"] #cuthint.live { visibility: hidden; }

/* a button that asks a second press before it does something that cannot be undone */
.btn.armed { animation: armed 0.5s ease-in-out 4 alternate; box-shadow: 0 0 0 2px rgba(255, 240, 200, 0.85); }
@keyframes armed { to { box-shadow: 0 0 0 3px rgba(255, 240, 200, 0.85), 0 4px 30px rgba(255, 160, 60, 0.8); } }
/* a ring runs out around a button: what will happen by itself */
.btn.counting { position: relative; }
/* (3.6.0) a bar that can be seen running out, inside the button's lower edge */
.btn.counting::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 4px; border-radius: 2px;
  background: rgba(28, 22, 8, 0.82); transform-origin: left; animation: countdown var(--count, 4s) linear both;
}
@keyframes countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* a few words beside a thing on the table: what choosing it, or letting a card go over it, will do */
.tlabel {
  position: absolute; left: 0; top: 0; transform: translate(-50%, calc(-100% - 46px)); pointer-events: none !important;
  padding: 4px 11px; border-radius: 999px; white-space: nowrap; font-size: 13px; font-weight: 700;
  background: rgba(9, 16, 13, 0.9); border: 1px solid rgba(255, 230, 160, 0.6); color: #fff3d0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5); animation: tlabelIn 0.14s ease-out both; z-index: 5;
}
.tlabel.hover { opacity: 0.92; font-weight: 600; }
.tlabel.over { background: linear-gradient(#f3d98f, #c79b3f); color: #1c1608; border-color: #f7e3a8; }
.tlabel.cut { background: #fff6dd; color: #20170a; border-color: #fff; box-shadow: 0 0 20px rgba(255, 245, 210, 0.7); }
.tlabel.no { background: rgba(60, 20, 18, 0.92); border-color: rgba(255, 140, 120, 0.6); color: #ffd2cc; }
.tlabel em { font-style: normal; opacity: 0.75; font-weight: 600; }
@keyframes tlabelIn { from { opacity: 0; margin-top: 6px; } }
/* how many cards are selected: a small gilt count over the group, following it */
.tally {
  position: absolute; left: 0; top: 0; transform: translate(-50%, calc(-100% - 28px)); pointer-events: none !important;
  padding: 2px 10px; border-radius: 999px; white-space: nowrap; font-size: 12.5px; font-weight: 700; z-index: 5;
  background: linear-gradient(#f3d98f, #c79b3f); color: #1c1608; border: 1px solid #f7e3a8; box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
}
.acts { display: flex; gap: 8px; flex: none; min-width: 84px; justify-content: flex-end; }

.btn {
  padding: 10px 18px; border-radius: var(--r-pill); font-weight: 700; font-size: 15px; white-space: nowrap;
  background: var(--plain); border: 1px solid var(--line); color: var(--ivory);
  transition: transform 0.1s, filter 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--plain-hover); border-color: rgba(240, 215, 150, 0.38); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary-edge); box-shadow: inset 0 1px 0 rgba(255, 250, 230, 0.55), 0 2px 8px rgba(0, 0, 0, 0.35); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.big { padding: 14px 30px; font-size: 18px; }
/* a button that will be pressed by itself soon breathes twice, then rests: no endless glow beside text being read */
.btn.pulse { animation: glowpulse 1.6s ease-in-out 3; }
@keyframes glowpulse { 50% { box-shadow: 0 4px 30px rgba(240, 205, 110, 0.75); } }
/* (3.6.0) a range in the kit's own colours (the volume), never the browser's */
input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; height: 28px; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: rgba(244, 236, 216, 0.16); border: 1px solid var(--line); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--primary); border: 1px solid var(--primary-edge); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(244, 236, 216, 0.16); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--gold); border: 1px solid var(--primary-edge); }
input[type="range"]:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* (3.6.0) the game's own reduce motion (Settings), as the system's: no breathing, no overshoot */
body.calm .btn.pulse, body.calm .btn.armed, body.calm .power-mark { animation: none !important; }
body.calm .total, body.calm .total .delta, body.calm .tbubble > span, body.calm .panel { animation-duration: 0.01ms !important; }

/* --- screens ------------------------------------------------------------------------------------------- */

#screens { position: fixed; inset: 0; pointer-events: none; }
.screen {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; overflow: auto; pointer-events: auto;
  animation: fade 0.3s ease both;
}
.screen.veil { background: radial-gradient(ellipse at 50% 45%, rgba(3, 8, 6, 0.5), rgba(2, 4, 3, 0.62)); }
.start-version { position: fixed; inset-inline-end: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(10px + env(safe-area-inset-bottom, 0px)); font: 12px/1 ui-monospace, Consolas, monospace; color: #d8c9a0; opacity: 0.5; pointer-events: none; user-select: text; }
/* the way back to the studio's site at the start screen's upper corner where a line starts, full screen at the other */
.start-site, .start-full { position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); z-index: 2; }
.start-site { inset-inline-start: calc(12px + env(safe-area-inset-left, 0px)); display: inline-flex; align-items: center; gap: 7px; padding: 0 12px 0 10px; text-decoration: none; white-space: nowrap; }
.start-site svg { width: 16px; height: 16px; display: block; }
.start-full { inset-inline-end: calc(12px + env(safe-area-inset-right, 0px)); }
/* (a short window, a phone held sideways: the house alone, clear of the panel; its words stay its label) */
@container (max-height: 520px) { .start-site { width: var(--icon-size); padding: 0; justify-content: center; } .start-site span { display: none; } }
/* the start screen keeps the corner row clear of its panel: upright, a band above it as tall as the row; a short window
   (a phone held sideways), a gutter at each side as wide as a corner button */
/* (a panel opened over the start screen, Settings or How to play, covers its corner row: the row steps aside) */
#screens > #start-screen:not(:last-child) > :is(.start-site, .start-full) { visibility: hidden; }
@container (max-aspect-ratio: 1/1) { #start-screen:has(> .start-site, > .start-full) { padding-top: calc(env(safe-area-inset-top, 0px) + 18px + var(--icon-size)); } }
@container (max-height: 520px) { #start-screen:has(> .start-site, > .start-full) { padding-inline: calc(env(safe-area-inset-left, 0px) + 20px + var(--icon-size)) calc(env(safe-area-inset-right, 0px) + 20px + var(--icon-size)); } }
.btn.with-icon { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn .item-icon svg { width: 1em; height: 1em; display: block; }
#start-screen { background: radial-gradient(ellipse at 50% 45%, rgba(3, 8, 6, 0.45) 20%, rgba(2, 4, 3, 0.12) 75%); }
.screen.light { background: rgba(2, 4, 3, 0.3); pointer-events: none; }
.screen.light > * { pointer-events: auto; }
@keyframes fade { from { opacity: 0; } }
.panel {
  width: min(560px, 100%); max-height: 100%; overflow: auto; padding: 22px 24px; border-radius: var(--r-panel);
  background: var(--panel-solid); border: 1px solid var(--line); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  animation: panelIn 0.28s cubic-bezier(0.22, 0.75, 0.25, 1) both;
}
/* (3.7.0) a soft landing, no overshoot */
@keyframes panelIn { from { opacity: 0; transform: translateY(12px) scale(0.985); } }
.panel h1 { font-family: var(--display); font-style: italic; font-size: clamp(54px, 13vw, 84px); line-height: 0.95; margin: 0; color: var(--gold); text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5); }
.panel h2 { font-family: var(--display); font-size: 24px; margin: 0 0 12px; color: var(--gold); }
.panel h3 { font-family: var(--display); font-size: 16.5px; margin: 16px 0 4px; color: var(--gold); }
.panel p { margin: 4px 0; line-height: 1.45; font-size: var(--t-body); color: var(--ivory); }
.tagline { color: var(--ivory-2); font-size: 16px; margin: 8px 0 22px; }

.start { text-align: center; }
.settings { display: grid; gap: 11px; margin: 4px 0 20px; text-align: start; }
.setting { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 10px; }
.setting > label { font-size: 14px; color: var(--ivory-2); font-weight: 600; }
.setting .seg { justify-self: start; }
.setting .note { grid-column: 2; font-size: var(--t-small); color: var(--ivory-2); margin-top: -4px; }
.start .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; align-items: center; }
/* (3.6.0) a short first screen: the title, one button, the game's settings in one line that unfolds them */
.start { width: min(520px, 100%); padding: 28px 30px 22px; }
/* a language whose words run longer than English gets a little more room, so a row of choices stays beside its label (English keeps its width) */
:root:not(:lang(en)) .start { width: min(600px, 100%); }
.panel .tagline { margin: 10px 0 24px; }
/* no tagline: the rows keep their distance from the name */
.start h1 + .start-choices { margin-top: 26px; }
.start .settings { width: max-content; max-width: 100%; margin: 0 auto 20px; }
/* (3.9.0) the settings as large choices, in sight, before the button that deals (big pills, as the first Gobo had) */
.start .start-choices { gap: 12px; margin: 0 auto 24px; }
.start .start-choices .setting { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.start .start-choices .setting > label { flex: 0 0 132px; }
.start .start-choices .setting > label { font-size: 15.5px; color: var(--ivory); }
.start .start-choices .seg button { min-height: 44px; min-width: 56px; padding: 0 18px; font-size: 16px; font-weight: 600; }
.start .start-choices .setting .note { font-size: 13px; max-width: 290px; margin-top: -2px; }
@container (max-width: 480px) {
  .start .start-choices .setting { gap: 6px; }
  .start .start-choices .setting > label { flex-basis: 100%; }
  .start .start-choices .setting .note { grid-column: 1; }
}
.start-links { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.btn.quiet { padding: 7px 14px; font-size: 14px; font-weight: 600; background: transparent; border-color: transparent; color: var(--ivory-2); }
.btn.quiet:hover { color: var(--ivory); background: var(--plain); border-color: var(--line); }

.howto { text-align: start; }
.howto ul { margin: 4px 0; padding-inline-start: 18px; }
.howto li { font-size: 14.5px; line-height: 1.45; margin: 3px 0; }
.howto .close { position: sticky; bottom: -22px; display: flex; justify-content: center; gap: 12px; padding: 14px 0 0; margin-top: 12px; background: linear-gradient(transparent, var(--panel-solid) 35%); }
/* (4.18.0) real cards in a How to play text ([data-cards]): side by side when few (.few), overlapping as a hand when
   many, never wider than their line; the marked ones raised and edged in gold */
.howto [data-cards] { display: flex; align-items: flex-end; container-type: inline-size; --w: min(var(--card-w, 40px), calc((100cqw - 6px) / (var(--n) * 0.56 + 0.88))); padding: 7px 0 2px; }
.howto [data-cards] .hc { flex: none; width: var(--w); height: auto; border-radius: 3px; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5); }
.howto [data-cards] .hc + .hc { margin-inline-start: calc(var(--w) * -0.44); }
.howto [data-cards].few { --w: var(--card-w, 34px); }
.howto [data-cards].few .hc + .hc { margin-inline-start: 4px; }
.howto [data-cards]:not(.few) .hc.mark { margin-inline-start: 6px; }
.howto [data-cards] .hc.mark { transform: translateY(-5px); box-shadow: 0 0 0 2px var(--gold), 0 0 12px rgba(231, 196, 106, 0.6); position: relative; z-index: 1; }

.rows { position: relative; }
.srow {
  position: absolute; left: 0; right: 0; height: 46px; display: grid; grid-template-columns: 26px 1fr 54px 64px; align-items: center; gap: 8px;
  padding: 0 12px; border-radius: 12px; background: rgba(244, 236, 216, 0.05); transition: transform 0.55s cubic-bezier(0.3, 1.1, 0.4, 1), background 0.3s;
}
.srow.lead { background: rgba(231, 196, 106, 0.16); }
.srow .rank { font-family: var(--sans); font-weight: 600; color: var(--ivory-2); font-size: 15px; }
.srow .who { font-weight: 600; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow .round { text-align: end; color: var(--ivory-2); font-size: 15px; }
.srow .tot { text-align: end; font-family: var(--serif); font-weight: bold; font-size: 22px; font-variant-numeric: lining-nums tabular-nums; color: var(--gold); }
.shead { display: grid; grid-template-columns: 26px 1fr 54px 64px; gap: 8px; padding: 0 12px 4px; font-size: var(--t-small); font-weight: 600; color: var(--ivory-2); }
.shead span:nth-child(n+3) { text-align: end; }

.confirm { width: min(360px, 100%); text-align: center; }
.confirm .row { display: flex; justify-content: center; gap: 10px; margin-top: 16px; }

/* --- the table's words in the page (3.4.0: tv.banner, tv.bubble, tv.points, tv.chip, tv.goOut's role, ui.scoreSheet).
   Made when a game first says them; they follow the table (ui/hud.js places them every frame). ------------------ */

.tbubble, .tchip, .tpoints { position: absolute; left: 0; top: 0; pointer-events: none !important; z-index: 6; will-change: transform; }
/* a few words at a seat, pointing at its cards */
.tbubble > span {
  position: relative; display: block; transform: translate(-50%, calc(-100% - 10px)); padding: 5px 13px; border-radius: 14px;
  white-space: nowrap; font-size: calc(14px * var(--size, 1)); font-weight: 700; color: var(--ivory);
  background: var(--panel-solid); border: 1px solid rgba(255, 230, 160, 0.45); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  animation: bubbleIn 0.18s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.tbubble > span::after {
  content: ''; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; transform: translateX(-50%) rotate(45deg);
  background: var(--panel-solid); border-inline-end: 1px solid rgba(255, 230, 160, 0.45); border-bottom: 1px solid rgba(255, 230, 160, 0.45);
}
/* why a play was refused */
.tbubble.no > span, .tbubble.no > span::after { background: #3c1412; border-color: rgba(255, 140, 120, 0.6); }
.tbubble.no > span { color: #ffd2cc; }
.tbubble.gone > span { animation: bubbleOut 0.24s ease-in both; }
/* under a name at the top of the screen: it points up */
.tbubble.below > span { transform: translate(-50%, 10px); animation-name: bubbleInBelow; }
.tbubble.below > span::after { bottom: auto; top: -6px; transform: translateX(-50%) rotate(225deg); }
.tbubble.below.gone > span { animation: bubbleOutBelow 0.24s ease-in both; }
@keyframes bubbleInBelow { from { opacity: 0; transform: translate(-50%, 2px) scale(0.7); } }
@keyframes bubbleOutBelow { to { opacity: 0; transform: translate(-50%, 18px); } }
@keyframes bubbleIn { from { opacity: 0; transform: translate(-50%, calc(-100% - 2px)) scale(0.7); } }
@keyframes bubbleOut { to { opacity: 0; transform: translate(-50%, calc(-100% - 18px)); } }

/* what the trick asks, above it; the order, below it */
.tchip > span {
  display: inline-block; transform: translate(-50%, -100%); padding: 3px 11px; border-radius: 999px; white-space: nowrap;
  font-size: 12.5px; font-weight: 700; color: var(--ivory); background: var(--panel); border: 1px solid var(--line);
}
.tchip.order > span { transform: translate(0, -50%); font-weight: 600; color: var(--ivory-dim); }
.tchip.order.under > span { transform: translate(-50%, 0); }
.tchip.closed > span { color: var(--ivory-dim); border-style: dashed; }
.tchip.turn > span { animation: chipTurn 0.44s ease-in-out; }
@keyframes chipTurn { 50% { scale: 1 0.06; } }

/* points on their way from a seat to its total; the total takes them */
.tpoints {
  font-family: var(--serif); font-weight: bold; font-size: calc(28px * var(--size, 1)); white-space: nowrap;
  font-variant-numeric: lining-nums tabular-nums; text-shadow: 0 2px 10px #000, 0 0 2px #000;
}
.tpoints.gone { opacity: 0; transition: opacity 0.25s; }
.plate b.hit, #mytotal.hit { animation: totalHit 0.55s ease-out; }
@keyframes totalHit { 0% { color: var(--hit); scale: 1.6; } }

/* a role beside a seat's name */
.trole { font-style: normal; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 999px; color: #1c1608; background: var(--c, var(--ivory)); }
.trole.turn { animation: roleIn 0.4s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
@keyframes roleIn { from { scale: 0.4; opacity: 0; } }

/* (3.5.0) the dealer's token, just before the dealer's name; a seat's bid and lives on its name; a seat out greys */
.tdealer { position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none !important; will-change: transform; }
.tdealer span {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 800;
  color: #1c1608; background: linear-gradient(#f3d98f, #c79b3f); border: 1px solid #f7e3a8; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.tbid { font-style: normal; font-size: 12.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; color: var(--ivory); background: rgba(244, 236, 216, 0.12); border: 1px solid var(--line); font-variant-numeric: lining-nums tabular-nums; }
.tbid span { font-weight: 600; color: var(--ivory-dim); margin-inline-end: 4px; }
.tbid.settle { animation: bidIn var(--in, 400ms) cubic-bezier(0.2, 1.5, 0.4, 1) both; }
@keyframes bidIn { from { scale: 1.8; opacity: 0; } }
.tlives { font-style: normal; display: inline-flex; gap: 3px; align-items: center; }
.tlives .pip { width: 7px; height: 7px; border-radius: 50%; border: 1px solid rgba(244, 236, 216, 0.45); }
.tlives .pip.on { background: var(--ivory); border-color: var(--ivory); }
.tlives .pip.lost { animation: pipOut 0.6s ease-out both; }
@keyframes pipOut { from { background: var(--red); border-color: var(--red); scale: 1.8; } }
.plate.out .tag, .me.out { filter: grayscale(1); opacity: 0.5; }

/* a banner across the screen: a band, a ribbon under the top bar, a plate */
.tbanner { position: absolute; left: 0; right: 0; top: 40%; z-index: 7; display: flex; justify-content: center; pointer-events: none !important; }
.tbanner .bin { text-align: center; }
.tbanner .bt { font-family: var(--serif); font-style: italic; font-weight: bold; line-height: 1.05; white-space: nowrap; color: var(--c, var(--gold)); text-shadow: 0 0 30px rgba(231, 196, 106, 0.35), 0 2px 12px #000; }
.tbanner .bs { margin-top: 5px; font-size: 12.5px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ivory-dim); }
.tbanner.band {
  transform: translateY(-50%); padding: 14px 0 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, transparent, rgba(9, 16, 13, 0.86) 20%, rgba(9, 16, 13, 0.86) 80%, transparent);
  animation: bandIn var(--in) cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.tbanner.band .bt { font-size: calc(clamp(30px, 6.5vw, 54px) * var(--size, 1)); }
.tbanner.band.out { animation: bandOut var(--out) ease-in both; }
@keyframes bandIn { from { clip-path: inset(0 50% 0 50%); opacity: 0; } }
@keyframes bandOut { to { clip-path: inset(0 0 0 100%); opacity: 0; } }
.tbanner.ribbon { top: 46px; }
.tbanner.ribbon .bin { padding: 6px 22px 7px; border-radius: 0 0 14px 14px; background: var(--panel); border: 1px solid var(--line); border-top: 0; animation: ribbonIn var(--in) ease-out both; }
.tbanner.ribbon .bt { font-size: calc(24px * var(--size, 1)); }
.tbanner.ribbon.out .bin { animation: ribbonOut var(--out) ease-in both; }
@keyframes ribbonIn { from { transform: translateY(-120%); opacity: 0; } }
@keyframes ribbonOut { to { transform: translateY(-120%); opacity: 0; } }
.tbanner.plate { transform: translateY(-50%); }
.tbanner.plate .bin { padding: 18px 34px 16px; border-radius: 20px; background: var(--panel-solid); border: 1px solid var(--line); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7); animation: plateIn var(--in) cubic-bezier(0.2, 1.2, 0.4, 1) both; }
.tbanner.plate .bt { font-size: calc(clamp(28px, 5.5vw, 44px) * var(--size, 1)); }
.tbanner.plate.out .bin { animation: plateOut var(--out) ease-in both; }
@keyframes plateIn { from { opacity: 0; transform: translateY(14px) scale(0.9); } }
@keyframes plateOut { to { opacity: 0; transform: scale(0.96); } }
/* reduced motion: it only fades */
.tbanner.calm, .tbanner.calm .bin { animation: fade var(--in) ease both !important; }
.tbanner.calm.out, .tbanner.calm.out .bin { animation: fadeAway var(--out) ease both !important; }
@keyframes fadeAway { to { opacity: 0; } }

/* the score sheet: points by round or phase, the totals, the lowest marked */
.panel.sheet { width: min(640px, 100%); cursor: pointer; }
.sgrid { display: grid; gap: 4px; }
.sgrid .sh, .sgrid .sr { display: grid; grid-template-columns: minmax(64px, 1.4fr) repeat(var(--cols), minmax(30px, 1fr)) minmax(44px, 1fr); gap: 6px; align-items: center; padding: 0 10px; }
.sgrid .sh { font-size: var(--t-small); font-weight: 600; color: var(--ivory-2); padding-bottom: 2px; }
.sgrid .sh span:not(:first-child), .sgrid .sr span:not(:first-child) { text-align: end; font-variant-numeric: lining-nums tabular-nums; }
.sgrid .sr { height: 38px; border-radius: 10px; background: rgba(244, 236, 216, 0.05); font-size: 14.5px; }
.sgrid .sr span { color: var(--ivory-dim); }
.sgrid .sr .who, .sgrid .sr .now, .sgrid .sh .now { color: var(--ivory); }
.sgrid .sr .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sgrid .sr .tot { font-family: var(--serif); font-weight: bold; font-size: 19px; color: var(--gold); }
.sgrid .sr.low { background: rgba(231, 196, 106, 0.16); }
.sgrid .sr.low .tot { color: #ffe9a6; text-shadow: 0 0 14px rgba(255, 215, 120, 0.8); }
/* (4.24.0) on a phone held upright, the rounds down the side and the players across: a round's name as wide as it needs */
.sgrid.down .sh, .sgrid.down .sr { grid-template-columns: minmax(88px, 1.7fr) repeat(var(--cols), minmax(34px, 1fr)); gap: 4px; padding: 0 8px; }
.sgrid.down .sh .who { color: var(--ivory); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sgrid.down .sh .who.best { color: var(--gold); }
.sgrid.down .sr { height: auto; min-height: 30px; padding-block: 3px; font-size: 14px; }
/* (4.24.2) a long round's name goes on two lines rather than lose its end; in Japanese the break falls between
   phrases where the browser knows them ("ハートの / キング"), between any two characters elsewhere */
.sgrid.down .sr .rname { line-height: 1.15; word-break: auto-phrase; overflow-wrap: anywhere; color: var(--ivory-2); }
.sgrid.down .sr.now span { color: var(--ivory); }
.sgrid.down .sr.stot { height: 38px; margin-top: 2px; background: rgba(244, 236, 216, 0.09); }
.sgrid.down .sr.stot > span:first-child { color: var(--ivory); font-weight: 600; }
.sgrid.down .sr .tot { font-size: 17px; }
.sgrid.down .sr .tot.best { text-decoration: underline 2px; text-underline-offset: 4px; }
.panel.sheet .snote { font-size: var(--t-small); color: var(--ivory-2); margin-top: 10px; }

/* --- (3.5.0) the templates a game fills (ui/screens.js): the kit's own panels and buttons, placed by variant ---- */
.screen.tpl { z-index: 20; }
.screen.tpl-dark { background: radial-gradient(ellipse at 50% 45%, rgba(3, 8, 6, 0.74), rgba(2, 4, 3, 0.92)); }
.screen.tpl-side-left { place-items: center start; padding-inline-start: 4%; background: linear-gradient(90deg, rgba(2, 5, 4, 0.74), rgba(2, 5, 4, 0) 60%); pointer-events: none; }
/* (3.7.0) a panel at the right is as tall as what it holds, under the top bar (the table framed beside it if it asks) */
.screen.tpl-side-right { place-items: start end; padding: 54px 0 70px; }
/* (3.9.0) Settings on its Look tab: no veil, the panel at the right, the table framed beside it (a choice is seen on it) */
.screen.tpl.tpl-preview { background: none !important; place-items: start end; padding: 58px 12px 76px 0; }
.screen.tpl.tpl-preview .tpl-panel.options.tabbed { width: min(700px, 44vw); height: 100%; max-height: 100%; }
.screen.tpl-side-right:not(.veil), .screen.tpl-bottom { background: none; pointer-events: none; }
.screen.tpl-side-left > *, .screen.tpl-side-right > *, .screen.tpl-bottom > * { pointer-events: auto; }
.screen.tpl-bottom { place-items: end center; padding-bottom: 88px; }
.tpl-panel.menu { width: min(400px, 100%); }
/* (3.7.0) a column menu's title fits its column in every look (an upper-case display face is wider) */
.tpl-panel.menu h1 { font-size: clamp(40px, 5.2vw, 56px); overflow-wrap: anywhere; }
.tpl-panel.menu.title h1 { font-size: clamp(46px, 8vw, 78px); }
.screen.tpl-corner { place-items: start end; padding: 54px 12px; background: none; pointer-events: none; }
.screen.tpl-corner > * { pointer-events: auto; }
.tpl-panel.tpl-step.small { width: min(330px, 100%); }
.tpl-panel.menu.title { width: min(560px, 100%); text-align: center; }
.tpl-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; margin-top: 16px; }
.tpl-buttons.column { flex-direction: column; align-items: stretch; }
.tpl-panel.tpl-card { width: min(340px, 100%); text-align: center; }
.tpl-panel.tpl-sheet { width: min(370px, 100%); max-height: 100%; border-radius: var(--r-panel) 0 0 var(--r-panel); animation: sheetIn 0.32s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
/* (3.7.0) a menu read in one glance: the primary large, the game's steps under it, the ways out apart and quiet */
.tpl-menu { display: grid; gap: 10px; margin-top: 18px; }
.tpl-menu.column > .btn.primary { width: 100%; }
.tpl-menu .tpl-buttons { margin-top: 0; }
.tpl-menu.column .tpl-buttons.column .btn { width: 100%; }
.tpl-menu .tpl-exits { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.tpl-menu.column .tpl-exits .btn.quiet { padding: 9px 14px; }
.tpl-menu.title { justify-items: center; margin-top: 22px; }
.tpl-menu.title .tpl-steps { gap: 8px; }
.tpl-menu.title .tpl-exits { border-top: 0; padding-top: 0; margin-top: -2px; }
.tpl-panel.menu.live, .tpl-panel.menu.still { text-align: start; }
.tpl-panel.pause h2 { margin-bottom: 4px; }
.tpl-sub { font-size: var(--t-body); color: var(--ivory-2) !important; margin: 2px 0 0 !important; }
.tpl-sub b { color: var(--ivory); }
/* a key said once, where the eye ends (not on a touch screen) */
.tpl-keyline { margin: 12px 0 0 !important; font-size: 13.5px !important; color: var(--ivory-2) !important; text-align: center; }
.tpl-keyline kbd, .tpl-kicker kbd { font-family: var(--sans); font-size: 12.5px; font-weight: 700; padding: 1px 7px; margin-inline-end: 4px; border-radius: 6px; border: 1px solid var(--line); background: var(--plain); color: var(--ivory); }
@media (pointer: coarse) { .tpl-keyline { display: none; } }
/* a word over a title (a page's number, what a title is) */
.tpl-kicker { margin: 0 0 4px !important; font-size: 13px !important; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ivory-2) !important; }
/* the corner card of the scores at the seats: its title on one line, a line of who leads, two buttons */
.tpl-panel.tpl-corner-card { width: min(360px, 100%); padding: 14px 16px 14px; }
.tpl-corner-card .tpl-steptext { font-family: var(--display); font-size: 20px; font-weight: bold; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl-corner-card .tpl-buttons { margin-top: 12px; justify-content: flex-end; }
.tpl-corner-card .tpl-sheetgrid { margin-top: 12px; }
/* the scores beside the table: the sheet's height, under the top bar */
.tpl-panel.sheet.tpl-side { width: min(420px, 100%); cursor: default; }
.tpl-panel.sheet.tpl-side .tpl-buttons { justify-content: flex-end; }
@keyframes sheetIn { from { opacity: 0; transform: translateX(46px); } }
.tpl-link { display: block; margin: 14px auto 0; font-size: 14px; font-weight: 600; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.tpl-slider { display: flex; align-items: center; gap: 10px; }
.tpl-slider input { flex: 1; min-width: 0; accent-color: #e7c46a; height: 28px; }
.tpl-slider output { min-width: 54px; font-variant-numeric: lining-nums tabular-nums; font-weight: 600; }
.tpl-tabs { margin-bottom: 14px; }
.tpl-tabs button { padding: 8px 13px; font-size: 14px; }
.tpl-keys { display: grid; gap: 7px; margin: 4px 0; }
.tpl-key { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.tpl-key kbd { min-width: 34px; padding: 2px 8px; border-radius: 7px; border: 1px solid var(--line); background: rgba(244, 236, 216, 0.08); font-family: var(--sans); font-size: 13px; font-weight: 700; text-align: center; color: var(--ivory); }
.tpl-pic { display: flex; justify-content: center; gap: 8px; margin: 12px 0; }
.tpl-pic .tpl-card { width: 66px; height: auto; border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55); }
.tpl-dots { display: flex; gap: 6px; }
.tpl-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(244, 236, 216, 0.25); }
.tpl-dots span.on { background: var(--gold); }
.tpl-panel.tpl-step { width: min(560px, 100%); display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; }
.tpl-steptext { flex: 1; font-size: 15px; font-weight: 600; }
.tpl-sheetgrid { flex-basis: 100%; }
.tpl-panel.result { width: min(520px, 100%); text-align: center; }
.tpl-panel.result h2 { font-size: 32px; margin-bottom: 6px; }
.tpl-panel.result.lose h2 { color: var(--ivory); }
/* (3.5.0) transitions: a veil through black; a panel leaving as it closes (fades, slides back, shrinks into its
   button, turns like a card) */
.tfade { position: absolute; inset: 0; background: #020403; opacity: 0; pointer-events: none; z-index: 30; }
/* (3.7.0) a screen leaving (ui/screens.js panelOut: the page's own animations) takes no click */
.screen.tpl-leaving, .screen.tpl-leaving * { pointer-events: none !important; }
/* the totals flying from the seats into the scores' panel (the scores transition `seats`) */
.total.tflying { z-index: 25; pointer-events: none; animation: none; }

/* (3.5.0) the in-game compositions (ui.composition): table only, a scoreboard, a phone's */
.comp-table #topbar .tools > :not(#help) { display: none; }
.comp-table #bar { background: none; justify-content: center; pointer-events: none; }
.comp-table #bar .me { display: none; }
.comp-table #bar .say { flex: 0 1 auto; }
.comp-table #prompt { display: inline-block; padding: 5px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 14.5px; }
.comp-table #cuthint { display: none; }
/* (3.7.0) everything at the spot: the prompt over the person's cards, each button beside the cards it acts on (placed
   every frame by ui/screens.js) */
.comp-table #bar .say, .comp-table #bar .declare, .comp-table #bar .acts > .btn { position: absolute; left: 0; top: 0; z-index: 6; pointer-events: auto; }
.comp-table #bar .say { width: max-content; max-width: min(520px, 90%); pointer-events: none; }
/* (over the cards, a plain button needs a ground of its own to be read) */
.comp-table #bar .acts > .btn:not(.primary), .comp-table #bar .declare .btn { background: var(--panel-strong); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); }
.comp-table #bar .acts { position: static; min-width: 0; }
.tscoreboard {
  position: absolute; left: 10px; top: 48px; z-index: 6; min-width: 160px; padding: 8px 10px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); display: grid; gap: 3px; font-size: 13.5px;
}
.tscoreboard div { display: flex; justify-content: space-between; gap: 14px; padding: 2px 4px; border-radius: 8px; }
.tscoreboard b { font-variant-numeric: lining-nums tabular-nums; color: var(--gold); }
.tscoreboard .low { background: rgba(231, 196, 106, 0.16); }
.comp-phone #topbar .tools, .comp-phone .brand, .comp-phone #roundinfo { display: none; }
.tool.tmenu { width: 36px; height: 34px; padding: 0 9px; display: grid; align-content: center; gap: 4px; }
.tool.tmenu span { display: block; height: 2px; border-radius: 1px; background: var(--ivory); }
.tscorechip { position: absolute; right: 10px; top: 8px; z-index: 6; display: flex; gap: 8px; align-items: baseline; padding: 5px 13px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; }
.tscorechip span { color: var(--ivory-dim); font-weight: 600; }
.tscorechip b { color: var(--gold); font-size: 16px; font-variant-numeric: lining-nums tabular-nums; }
.comp-phone #bar .btn { padding: 14px 26px; font-size: 17px; min-height: 52px; }
.comp-phone .plate .tag { font-size: 12px; padding: 2px 7px 2px 5px; gap: 5px; }

/* (3.6.0) the settings in tabs: wider (the Look page shows every back and face small), one height for every tab, the
   head (title, close, tabs) and Done always in sight, the page between them scrolling when it must */
.tpl-panel.options.wide { width: min(700px, 100%); }
.tpl-panel.options.tabbed { display: flex; flex-direction: column; height: min(680px, 100%); padding: 0; overflow: hidden; }
.tpl-panel.options .tpl-head { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px 10px; padding: 18px 20px 12px 24px; border-bottom: 1px solid var(--line); }
.tpl-panel.options .tpl-head h2 { margin: 0; }
.tpl-panel.options .tpl-head .tpl-tabs { grid-column: 1 / -1; justify-self: start; }
.tpl-panel.options .tpl-tabs { flex-wrap: wrap; margin: 0; }
.tpl-panel.options .tpl-tabs button { padding: 8px 16px; font-size: 20px; }
.tpl-panel.options .tpl-foot .btn, .tpl-panel.options .look-default { font-size: 20px; }
.tpl-panel.options .tpl-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 24px 56px; margin: 0; align-content: start; }
/* a page longer than the panel says so: its lower edge fades (a scrollbar that only shows while scrolling, on a phone
   or a Mac, says nothing); at its end the fade is over the padding only. A mask, so every interface's colours keep it */
.tpl-panel.options.tabbed .tpl-body { -webkit-mask-image: linear-gradient(#000 calc(100% - 56px), transparent); mask-image: linear-gradient(#000 calc(100% - 56px), transparent); }
.tpl-panel.options .tpl-foot { margin: 0; padding: 12px 20px 16px; border-top: 1px solid var(--line); justify-content: flex-end; }
.tpl-x { flex: none; }
/* (3.7.0) the one-page options with every setting: Done held at the foot of the panel while the page scrolls under it,
   the page's lower edge fading into it; the scrollbar hidden (the fade and the held Done say there is more) */
.tpl-panel.options.tpl-long { scrollbar-width: none; }
.tpl-panel.options.tpl-long::-webkit-scrollbar { display: none; }
.tpl-panel .tpl-stickfoot { position: sticky; bottom: -22px; z-index: 2; margin: 14px -24px -22px; padding: 14px 24px 18px; background: inherit; border-radius: 0 0 var(--r-panel) var(--r-panel); box-shadow: 0 -18px 18px -6px var(--panel-solid); }
/* the table stays in sight behind the settings: a look chosen shows at once around the panel */
/* (3.9.0) the settings' veil lies under the panel, not on the screen itself: it fades as the Look tab lifts it (an
   interface look that draws its own veil draws it on this ::before) */
.screen.tpl-options.veil { background: none !important; }
.screen.tpl-options.veil::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, rgba(3, 8, 6, 0.18), rgba(2, 4, 3, 0.42)); transition: opacity 0.32s ease; }
.screen.tpl-options.tpl-preview::before, .screen.tpl-options.tpl-clear::before, .screen.tpl-options.tpl-peek::before { opacity: 0; }
/* (3.9.0) a Preview button held: the settings out of sight until it is let go */
.screen.tpl-options .tpl-panel { transition: opacity 0.18s ease; }
.screen.tpl-options.tpl-peek .tpl-panel { opacity: 0; }
.tpl-panel.options .tpl-foot .tpl-peekbtn { margin-inline-end: auto; }
/* (4.12.0) a group's heading in a game's rows: a line above, as the Look tab's groups, and its action at the end */
.tpl-grouphead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.tpl-grouphead h3 { margin: 0 !important; font-size: 16.5px; }
.tpl-grouphead .btn { flex: none; font-size: 15px; padding: 5px 14px; }
.tpl-grouphead .btn:disabled { opacity: 0.45; cursor: default; }
body.calm .screen.tpl-options.veil::before, body.calm .screen.tpl-options .tpl-panel { transition: none; }
/* the Look page: the presets, then each layer, every entry drawn small; the one in use ringed */
.looks { display: grid; gap: 14px; margin: 2px 0 6px; }
.look-row { display: grid; grid-template-columns: 1fr; gap: 8px; align-items: start; }
.look-label { font-size: 20px; font-weight: 600; color: var(--ivory-dim); }
/* the Table row's switch between families: its words as large as the panel's, wrapping onto a second line when it must */
.looks .look-families { display: flex; flex-wrap: wrap; justify-self: start; border-radius: 22px; }
.looks .look-families button { font-size: 20px; padding: 8px 18px; }
/* the size of a place's table: a switch as wide as its three words, as the families' */
.looks .look-tablesize .seg, .looks .look-placelight .seg { justify-self: start; width: max-content; max-width: 100%; }
.looks .look-tableopt .qslider { display: flex; align-items: center; gap: 12px; width: min(420px, 100%); }
.look-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.look-choice {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 12px; border-radius: 12px;
  background: rgba(244, 236, 216, 0.06); border: 1px solid var(--line); font-size: 20px; font-weight: 600; color: var(--ivory);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.look-choice:hover { background: rgba(244, 236, 216, 0.13); }
.look-choice.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; background: rgba(231, 196, 106, 0.12); }
/* (3.8.0) the choice in use told apart without colour too: a tick in its corner (a tile with a picture, a quality level) */
.look-choice.pictured, .look-choice.preset, .qlevel { position: relative; }
.look-choice.pictured.on::after, .look-choice.preset.on::after, .qlevel.on::after {
  content: ''; position: absolute; right: 7px; top: 5px; width: 5px; height: 10px; border: solid var(--gold); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.look-choice.pictured { flex-direction: column; gap: 5px; padding: 7px 10px 6px; min-width: 76px; }
.look-choice.preset { flex-direction: column; gap: 6px; padding: 8px 10px 7px; }
.look-pics { display: flex; gap: 4px; align-items: center; }
.look-pic.card { width: 44px; height: auto; border-radius: 4px; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5); }
.look-choice.preset .look-pic.card { width: 30px; }
.look-pic.cloth {
  display: block; width: 92px; height: 40px; border-radius: 10px;
  background: var(--preview, none) center / cover, radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--cloth) 100%, white 12%), var(--cloth) 55%, color-mix(in srgb, var(--cloth) 70%, black) 100%);
  box-shadow: 0 0 0 4px var(--rail), 0 3px 8px rgba(0, 0, 0, 0.5);
  margin: 4px 4px 6px;
}
.look-choice.preset .look-pic.cloth { width: 34px; height: 44px; border-radius: 6px; box-shadow: 0 0 0 3px var(--rail); margin: 3px 4px; }
.look-name { white-space: nowrap; }
.look-default { justify-self: start; margin-top: 2px; }
/* (4.14.0) the Look tab's first line: its rule, and the way back to the default look at its end */
.look-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.tpl-panel.options .look-top .look-default { margin: 0; font-size: 15px; padding: 5px 14px; }
.look-default:disabled { opacity: 0.45; cursor: default; }
/* the place's own section and the groups after it (cards, effects, finish, interface): each under its heading, the
   place's parts (its table, its light, its floor, its air) under small ones; the quality's rows drawn as on the Quality tab */
.looks .look-group { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.looks .look-head { margin: 0 !important; font-size: 16.5px; }
.looks .look-sub { gap: 2px; padding-top: 2px; border-top: 0; }
.looks h4.look-head { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ivory-2); }
.looks .look-qcustom { min-height: 0; }
.look-hint { margin: 2px 0 0 !important; font-size: 13.5px !important; line-height: 1.35; color: var(--ivory-2) !important; font-style: italic; }
.qwas { color: var(--ivory); }
.look-intro, .qintro { margin: 0 !important; font-size: 14px !important; color: var(--ivory-2) !important; }
.qnote { margin: 2px 0 0 !important; font-size: 13.5px !important; line-height: 1.35; color: var(--ivory-2) !important; }
.qpage [hidden] { display: none !important; }
@container (max-width: 480px) {
  .look-row { gap: 6px; }
  .look-label { font-size: 16px; }
  .look-choice { font-size: 16px; }
  /* a phone: the Table row's switch in two rows of two */
  .looks .look-families { display: grid; grid-template-columns: 1fr 1fr; justify-self: stretch; border-radius: 16px; }
  .looks .look-families button { font-size: 16px; padding: 6px 12px; }
  .looks .look-families button:nth-child(odd) { border-inline-start: 0; }
  .looks .look-families button:nth-child(n+3) { border-top: 1px solid var(--line); }
  .look-pic.card { width: 38px; }
}

/* (3.7.0) the quality, as a game's options screen: the four levels as a quick switch (each its name and one line), Custom
   said under them, then every setting in its group, in the control that fits it, each with a line on its cost */
.qpage { display: grid; gap: 16px; margin: 2px 0 6px; }
/* the levels and Custom's line stay in sight while the settings scroll under them (in the tabs' scrolling page) */
.qtop { display: grid; gap: 8px; }
.qtop:empty { display: none; }
.tpl-body .qtop { position: sticky; top: -16px; z-index: 2; margin: -16px 0 0; padding: 16px 0 10px; background: var(--panel-solid); box-shadow: 0 1px 0 var(--line); }
.qtop .qback:not(.hidden) + * { margin-top: 0; }
/* (on a phone the levels take two rows: they scroll with the page rather than hold its top) */
@container (max-width: 480px) { .tpl-body .qtop { position: static; margin: 0; padding: 0 0 6px; } }
.qlevels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.qlevel {
  display: grid; gap: 4px; align-content: start; text-align: start; min-height: 74px; padding: 10px 12px 11px; border-radius: var(--r-ctl);
  background: var(--plain); border: 1px solid var(--line); color: var(--ivory); transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.qlevel b { font-size: 15px; font-weight: 700; }
.qlevel span { font-size: 13px; line-height: 1.3; color: var(--ivory-2); }
.qlevel:hover { background: var(--plain-hover); }
.qlevel.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; background: color-mix(in srgb, var(--gold) 12%, transparent); }
.qlevel.on b { color: var(--gold); }
.qswitch.compact .qlevel { min-height: 0; padding: 8px 10px; text-align: center; }
/* (the compact levels stay in one row, however narrow the panel: their names are short) */
.qswitch.compact .qlevels { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.qback b { color: var(--ivory); }
.qcustom { margin-top: 8px; font-size: 14px; color: var(--ivory-2); }
.qcustom b { color: var(--ivory); }
.qback { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--ivory-2); min-height: 36px; }
.qback .btn { margin-inline-start: auto; }
.qgroup { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.qgroup h3 { margin: 0 0 4px !important; font-size: 16.5px; }
.qrow { display: grid; gap: 2px; padding: 5px 0 7px; }
.qrow[hidden] { display: none; }
.qhead { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 12px; }
.qhead > label { font-size: 15px; font-weight: 600; color: var(--ivory); }
/* a setting changed by hand, away from its level, carries a small mark */
.qrow.changed .qhead > label::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-inline-start: 8px; border-radius: 50%; background: var(--gold); vertical-align: 2px; }
.qhead .seg { justify-self: start; flex-wrap: wrap; max-width: 100%; border-radius: 1.25em; }
.qabout { margin: 0 0 0 162px !important; font-size: 13.5px !important; line-height: 1.35; color: var(--ivory-2) !important; }
.qslider output { min-width: 58px; text-align: end; }
/* (3.7.0) where 100 % is, on a slider that goes past it: a small notch under the track (the thumb passes over it) */
.qtrack { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.qtrack input { position: relative; z-index: 1; width: 100%; }
.qtrack.ticked::before { content: ''; position: absolute; left: calc(8px + var(--k) * (100% - 16px)); bottom: -1px; width: 2px; height: 9px; margin-inline-start: -1px; border-radius: 1px; background: var(--ivory-2); pointer-events: none; }
.qtoggle { justify-self: start; display: inline-flex; align-items: center; gap: 10px; min-height: 32px; font-size: 14.5px; font-weight: 600; color: var(--ivory-2); }
.qtoggle i { position: relative; width: 44px; height: 24px; border-radius: 12px; background: var(--plain); border: 1px solid var(--line); transition: background 0.18s, border-color 0.18s; }
.qtoggle i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ivory-2); transition: transform 0.18s cubic-bezier(0.22, 0.75, 0.25, 1), background 0.18s; }
.qtoggle.on { color: var(--ivory); }
.qtoggle.on i { background: var(--primary); border-color: var(--primary-edge); }
.qtoggle.on i::after { transform: translateX(20px); background: var(--primary-ink); }
.qtoggle:hover i { border-color: var(--gold); }
.tpl-quality h3 { margin-top: 6px !important; }
.tpl-quality .tpl-more { margin-top: 10px; }
.tpl-quality .qpage { margin-top: 12px; }
@container (max-width: 720px) {
  .qlevels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qhead { grid-template-columns: 1fr; gap: 6px; }
  .qabout { margin-inline-start: 0 !important; }
}
@media (pointer: coarse) { .qtoggle { min-height: 44px; } .qlevel { min-height: 64px; } .qswitch.compact .qlevel { min-height: 44px; } }

/* the scores step aside while the person looks at the table behind them */
.screen.tpl-away { background: none !important; }
.screen.tpl-away .panel { transform: translateY(var(--away, calc(100% - 64px))); opacity: 0.94; transition: transform 0.25s ease; }
/* (3.9.0) the way back stays in sight: the button rides at the top of what is left of the panel */
.screen.tpl-away .panel .tpl-look-back { position: absolute; top: 12px; inset-inline-end: 14px; z-index: 2; margin: 0; }
@container (max-width: 480px) {
  /* a phone: every panel a sheet from the bottom, as wide as the screen */
  .screen.tpl, .screen.tpl-bottom, .screen.tpl-side-left, .screen.tpl-side-right, .screen.tpl-corner { place-items: end stretch; padding: 0; }
  /* (3.9.0) the Look tab on a phone: a lower sheet, the table framed above it */
  .screen.tpl.tpl-preview { place-items: end stretch; padding: 0; }
  .screen.tpl.tpl-preview .tpl-panel.options.tabbed { width: 100%; height: 56%; }
  .screen.tpl.tpl-preview .tpl-panel.options.tabbed:has(.langlist) { height: 86%; }
  .screen.tpl .tpl-panel { width: 100%; max-height: 84%; height: auto; border-radius: 20px 20px 0 0; }
  /* the settings keep one height, their head and Done in sight; tabs and choices as large as a finger */
  .screen.tpl .tpl-panel.options.tabbed { height: 84%; }
  .tpl-panel.options .tpl-head { padding: 14px 14px 10px 18px; }
  .tpl-panel.options .tpl-body { padding: 12px 16px 56px; }
  .tpl-panel.options .tpl-tabs button { min-height: 44px; padding: 8px 13px; font-size: 16px; }
  .tpl-panel.options .tpl-foot .btn, .tpl-panel.options .look-default { font-size: 16px; }
  /* (3.8.0) the tabs in one row across the sheet on a phone (360 px wide and more), each as wide as its word */
  .tpl-panel.options .tpl-head .tpl-tabs { display: flex; justify-self: stretch; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tpl-panel.options .tpl-head .tpl-tabs::-webkit-scrollbar { display: none; }
  .tpl-panel.options .tpl-head .tpl-tabs button { flex: 1 0 auto; padding: 8px 8px; }
  /* the settings upright: a tall sheet (the table still seen above it on the Look tab), the head on fewer lines */
  .screen.tpl.tpl-preview .tpl-panel.options.tabbed { height: 84%; }
  .tpl-panel.options .tpl-head { padding: 8px 10px 8px 16px; gap: 8px; }
  .tpl-panel.options .tpl-head h2 { font-size: 24px; }
  .tpl-panel.options .tpl-head .tpl-tabs button { min-height: 40px; }
  .look-choice { min-height: 44px; }
  .screen.tpl-bottom .tpl-panel { margin-bottom: 0; }
  .tpl-panel.menu h1 { font-size: 46px; }
  /* (3.7.0) a result's title on one line where it can */
  .tpl-panel.result h2 { font-size: 26px; }
  /* (3.7.0) every choice and quiet button of a panel as large as a finger (44 px) */
  .screen .panel .btn, .screen .panel .seg button, .screen .panel .qtoggle { min-height: 44px; }
  .screen .panel .seg button { min-width: 44px; }
}

/* (3.6.0) a finger: every target at least 44 px, the bar's buttons larger still */
@media (pointer: coarse) {
  :root { --icon-size: 44px; }
  #bar .btn, .panel .btn, #skip { min-height: 48px; }
  .seg button { min-height: 44px; }
  /* (3.8.0) a slider as tall as a finger */
  input[type="range"] { height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn.pulse { animation: none; }
  .tbanner, .tbanner .bin { animation: fade var(--in) ease both !important; }
  .tbanner.out, .tbanner.out .bin { animation: fadeAway var(--out) ease both !important; }
}

/* --- narrow windows ------------------------------------------------------------------------------------ */

@container (max-width: 720px) {
  #topbar { gap: 8px; padding: 0 6px 0 10px; }
  .brand { font-size: 19px; }
  #roundinfo { font-size: 11.5px; }
  .seg.small button { padding: 0 7px; font-size: 11px; }
  .tool { padding: 0 8px; font-size: 11.5px; }
  #bar { flex-wrap: wrap; gap: 6px 8px; padding-top: 6px; }
  .say { order: -1; flex-basis: 100%; }
  #prompt { font-size: 14px; }
  /* (4.24.1) the bar keeps its height while its words come and go: an empty line keeps its room, so that the table is
     not framed again at each play (the camera rose and fell with the prompt) */
  #prompt:empty::before, #cuthint:empty::before { content: "\00a0"; }
  .acts { margin-inline-start: auto; }
  .btn { padding: 9px 14px; font-size: 14px; }
  /* (3.8.0) 13 px: a phone's body text, nothing smaller for a name or what a bot does */
  .plate .tag { font-size: 13px; padding: 3px 9px 3px 7px; }
  .plate b { font-size: 14px; }
  .plate .cap { font-size: 13px; max-width: min(160px, 36cqw); }
  .total { font-size: 22px; }
  .setting { grid-template-columns: 1fr; gap: 4px; }
  .setting .note { grid-column: 1; margin-top: 0; }
  .seg button { padding: 9px 13px; font-size: 14px; }
  .panel { padding: 18px 16px; }
  #coach { font-size: 12.5px; }
}
@container (max-width: 480px) {
  .brand { display: none; }
  #roundinfo .long, #pace .long { display: none; }
  #roundinfo { font-size: 13px; }
  /* only the quality in use is shown; pressing it goes to the next */
  #quality button:not(.on), #resolution button:not(.on) { display: none; }
  #quality button, #resolution button { padding: 0 11px; border-inline-start: 0; }
  .plate .count { font-size: 12px; padding: 0 5px; gap: 4px; }
  .tbubble > span { font-size: calc(12.5px * var(--size, 1)); padding: 4px 10px; }
  .tchip > span { font-size: 11.5px; padding: 2px 9px; }
  .tpoints { font-size: calc(22px * var(--size, 1)); }
  .sgrid .sh, .sgrid .sr { gap: 4px; padding: 0 6px; }
  .sgrid .sr { height: 34px; font-size: 13px; }
  .sgrid .sr .tot { font-size: 16px; }
}
@container (max-height: 520px) {
  .panel h1 { font-size: 46px; }
  .settings { gap: 7px; margin-bottom: 12px; }
  .seg button { padding: 6px 13px; }
}
/* (3.9.0) an archived look, and a layer left with one choice, are not offered */
.looks [hidden] { display: none !important; }

/* The Language row of the settings and the list it opens: each entry in its own language, its own script and direction */
.lang-open { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding-inline: 16px; max-width: 100%; }
.lang-open > span { overflow-wrap: anywhere; text-align: start; }
.chev { font-style: normal; opacity: 0.7; line-height: 1; }
:root[dir="rtl"] .chev { display: inline-block; transform: scaleX(-1); }
.langlist { display: flex; flex-direction: column; gap: 10px; }
.lang-head { display: flex; align-items: center; gap: 10px; }
.lang-head h3 { margin: 0; flex: 1; font-size: 16.5px; }
.lang-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding-inline: 12px; }
.lang-search { width: 100%; min-height: 44px; padding: 0 14px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--panel-solid); color: var(--ivory); font: inherit; font-size: 15px; }
.lang-search::placeholder { color: var(--ivory-dim); }
.lang-search:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.lang-items { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; }
.lang-item { display: grid; grid-template-columns: minmax(0, 1fr) 1.2em; align-items: center; column-gap: 12px; min-height: 48px; padding: 6px 14px; text-align: start; color: var(--ivory); background: transparent; border: 0; border-bottom: 1px solid var(--line); }
.lang-item:last-child { border-bottom: 0; }
.lang-item:hover { background: rgba(244, 236, 216, 0.08); }
.lang-item:focus-visible { outline: 2px solid var(--gold); outline-offset: -3px; }
.lang-item[aria-selected="true"] { background: rgba(231, 196, 106, 0.14); }
.lang-item .lang-name { grid-column: 1; font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.lang-item small { grid-column: 1; font-size: 12.5px; color: var(--ivory-dim); }
.lang-item .tick { grid-column: 2; grid-row: 1 / span 2; color: var(--gold); font-style: normal; text-align: center; }
.lang-item[hidden] { display: none; }
.lang-none { margin: 4px 2px; color: var(--ivory-dim); font-size: var(--t-small); }
@media (pointer: coarse) { .lang-item { min-height: 52px; } }

/* long words: a row of choices that does not fit in one line puts each choice on its own line, and no row pushes its panel wider than the window */
.seg:not(.tpl-tabs) { flex-wrap: wrap; max-width: 100%; border-radius: 22px; }
.seg:not(.tpl-tabs) button { flex: 1 1 auto; text-align: center; overflow-wrap: anywhere; }
.setting, .setting > * { min-width: 0; }
.settings.tpl-body { grid-template-columns: minmax(0, 1fr); }

/* names:begin (made by lang.mjs fonts) */
@font-face { font-family: "CT Name vi"; src: url("../fonts/lang/name-vi.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
.lang-item[lang="vi"] .lang-name, .lang-open [lang="vi"] { font-family: "CT Name vi", sans-serif; }
@font-face { font-family: "CT Name ru"; src: url("../fonts/lang/name-ru.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
.lang-item[lang="ru"] .lang-name, .lang-open [lang="ru"] { font-family: "CT Name ru", sans-serif; }
@font-face { font-family: "CT Name uk"; src: url("../fonts/lang/name-uk.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
.lang-item[lang="uk"] .lang-name, .lang-open [lang="uk"] { font-family: "CT Name uk", sans-serif; }
@font-face { font-family: "CT Name el"; src: url("../fonts/lang/name-el.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
.lang-item[lang="el"] .lang-name, .lang-open [lang="el"] { font-family: "CT Name el", sans-serif; }
@font-face { font-family: "CT Name ja"; src: url("../fonts/lang/name-ja.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
.lang-item[lang="ja"] .lang-name, .lang-open [lang="ja"] { font-family: "CT Name ja", sans-serif; }
@font-face { font-family: "CT Name ko"; src: url("../fonts/lang/name-ko.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
.lang-item[lang="ko"] .lang-name, .lang-open [lang="ko"] { font-family: "CT Name ko", sans-serif; }
@font-face { font-family: "CT Name zh-hans"; src: url("../fonts/lang/name-zh-hans.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
.lang-item[lang="zh-hans"] .lang-name, .lang-open [lang="zh-hans"] { font-family: "CT Name zh-hans", sans-serif; }
@font-face { font-family: "CT Name zh-hant"; src: url("../fonts/lang/name-zh-hant.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
.lang-item[lang="zh-hant"] .lang-name, .lang-open [lang="zh-hant"] { font-family: "CT Name zh-hant", sans-serif; }
@font-face { font-family: "CT Name th"; src: url("../fonts/lang/name-th.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
.lang-item[lang="th"] .lang-name, .lang-open [lang="th"] { font-family: "CT Name th", sans-serif; }
@font-face { font-family: "CT Name hi"; src: url("../fonts/lang/name-hi.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
.lang-item[lang="hi"] .lang-name, .lang-open [lang="hi"] { font-family: "CT Name hi", sans-serif; }
@font-face { font-family: "CT Name ar"; src: url("../fonts/lang/name-ar.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
.lang-item[lang="ar"] .lang-name, .lang-open [lang="ar"] { font-family: "CT Name ar", sans-serif; }
@font-face { font-family: "CT Name ext"; src: url("../fonts/lang/fredoka-latin-ext-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
.lang-item[lang="pl"] .lang-name, .lang-open [lang="pl"], .lang-item[lang="cs"] .lang-name, .lang-open [lang="cs"], .lang-item[lang="hu"] .lang-name, .lang-open [lang="hu"], .lang-item[lang="ro"] .lang-name, .lang-open [lang="ro"], .lang-item[lang="tr"] .lang-name, .lang-open [lang="tr"] { font-family: "Fredoka", "Source Sans 3", "CT Name ext", sans-serif; }
/* names:end */

#topbar .chip { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#topbar .tools { flex: none; }

/* right to left: what slides or measures along a line goes the other way; the table and its cards are a scene and stay put */
:root[dir="rtl"] .qtoggle i::after { left: auto; right: 3px; }
:root[dir="rtl"] .qtoggle.on i::after { transform: translateX(-20px); }
:root[dir="rtl"] .qtrack.ticked::before { left: auto; right: calc(8px + var(--k) * (100% - 16px)); margin-inline-start: 0; margin-inline-end: -1px; }
:root[dir="rtl"] .chev.back { display: inline-block; }

/* (4.20.0) A speech bubble over a player's name (ui.sayBubble): thinking (three dots), then what they say. The
   bubble and its tail are one filled shape (--fill); its outline (--edge) is drawn round that whole shape by stacked
   drop shadows, never a line crossing where the tail joins. Its looks: parchment (the default: the cards' ivory),
   parchment-line (the same, a deep gold outline), night (the panels' dark, a faint gold line), night-underlined (night,
   a line drawn under the words as they land); a game may add its own as classes. Its tones: warm and cool, each look's two inks */
#me { position: relative; }
.say-bubble { position: absolute; left: 50%; bottom: calc(100% + 9px); transform: translateX(calc(-50% + var(--dx, 0px))); z-index: 8; pointer-events: none; white-space: nowrap;
  --fill: #fbf7ee; --edge: transparent; --dot: #3a3426; --warm: var(--red); --cool: #1d4a34; }
.plate .say-bubble { bottom: calc(100% + 5px); }
#me .say-bubble { left: -2px; transform: translateX(var(--dx, 0px)); }
.say-bubble .cb { position: relative; display: flex; align-items: center; gap: 8px; border-radius: 18px; background: var(--fill); transform-origin: 50% 100%;
  filter: drop-shadow(1.3px 0 0 var(--edge)) drop-shadow(-1.3px 0 0 var(--edge)) drop-shadow(0 1.3px 0 var(--edge)) drop-shadow(0 -1.3px 0 var(--edge)) drop-shadow(0 6px 9px rgba(0, 0, 0, 0.45)); }
.say-bubble .cb::after { content: ""; position: absolute; left: 50%; top: calc(100% - 1px); margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: var(--fill); }
#me .say-bubble .cb { transform-origin: 20% 100%; }
#me .say-bubble .cb::after { left: 28px; }
.say-bubble .ic { display: none; }
.say-bubble.think .cb { padding: 8px 13px; animation: sayIn 0.22s ease-out both; }
.say-bubble .dots { display: flex; gap: 5px; }
.say-bubble .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); animation: sayDot 1s ease-in-out infinite; }
.say-bubble .dots i:nth-child(2) { animation-delay: 0.16s; }
.say-bubble .dots i:nth-child(3) { animation-delay: 0.32s; }
.say-bubble.say .cb { padding: 8px 20px 9px; font: italic 700 21px var(--display); animation: sayGrow 0.46s cubic-bezier(0.3, 1.2, 0.5, 1) both; }
.say-bubble.say.warm .cb { color: var(--warm); }
.say-bubble.say.cool .cb { color: var(--cool); }
.say-bubble.say.gone .cb { opacity: 0; transform: translateY(-10px); transition: opacity 0.35s, transform 0.35s; }
.say-bubble.look-parchment-line { --fill: #f6eedb; --edge: var(--gold-deep); }
.say-bubble.look-parchment { --fill: #f6eedb; }
.say-bubble.look-night, .say-bubble.look-night-underlined { --fill: var(--panel-solid); --edge: rgba(240, 215, 150, 0.5); --dot: var(--gold); --warm: var(--red-ink); --cool: var(--gold); }
.say-bubble.look-night.say .cb, .say-bubble.look-night-underlined.say .cb { font-style: normal; font-size: 20px; }
.say-bubble.look-night-underlined.say .cb { padding-bottom: 12px; }
.say-bubble.look-night.say.warm .cb, .say-bubble.look-night-underlined.say.warm .cb { text-shadow: 0 0 14px rgba(255, 125, 116, 0.45); }
.say-bubble.look-night.say.cool .cb, .say-bubble.look-night-underlined.say.cool .cb { text-shadow: 0 0 14px rgba(231, 196, 106, 0.4); }
.say-bubble.look-night-underlined.say .w { position: relative; }
.say-bubble.look-night-underlined.say .w::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; border-radius: 2px; background: currentColor; opacity: 0.8; transform-origin: 0 50%; animation: sayStroke 0.4s ease-out 0.25s both; }
@keyframes sayStroke { from { transform: scaleX(0); } }
@keyframes sayIn { from { opacity: 0; transform: translateY(6px) scale(0.85); } }
@keyframes sayDot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.45; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes sayGrow { 0% { opacity: 0; transform: scale(0.45); } 60% { opacity: 1; transform: scale(1.07); } 100% { transform: scale(1); } }
@media (max-width: 480px) { .say-bubble.say .cb { font-size: 16px !important; padding-top: 7px; padding-bottom: 8px; } }
body.calm .say-bubble .dots i, body.calm .say-bubble .cb { animation: none; }

/* the settings on a phone held sideways: the panel the window's whole height (at the right on the Look and Quality tabs,
   the table beside it), the title set aside and the tabs in one row on the close button's line, scrolling sideways
   where they do not fit, so that the page they show gets most of the height */
@container (max-height: 519px) and (min-aspect-ratio: 1/1) {
  .screen.tpl.tpl-options, .screen.tpl.tpl-options.tpl-preview { place-items: stretch center; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px); }
  .screen.tpl.tpl-options.tpl-preview { place-items: stretch end; }
  .screen.tpl.tpl-options .tpl-panel.options.tabbed { width: min(700px, 100%); height: 100%; max-height: 100%; border-radius: 20px 20px 0 0; }
  .screen.tpl.tpl-options.tpl-preview .tpl-panel.options.tabbed { width: min(460px, 62%); border-radius: 20px 0 0 20px; }
  .screen.tpl.tpl-options .tpl-panel.options .tpl-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 8px; }
  .screen.tpl.tpl-options .tpl-panel.options .tpl-head h2 { display: none; }
  .screen.tpl.tpl-options .tpl-panel.options .tpl-head .tpl-tabs { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .screen.tpl.tpl-options .tpl-panel.options .tpl-head .tpl-tabs::-webkit-scrollbar { display: none; }
  .screen.tpl.tpl-options .tpl-panel.options .tpl-head .tpl-tabs button { flex: 0 0 auto; min-height: 40px; padding: 6px 12px; font-size: 15px; }
  .screen.tpl.tpl-options .tpl-panel.options .tpl-body { padding: 8px 16px 40px; }
  .screen.tpl.tpl-options .tpl-panel.options .tpl-foot { padding: 4px 12px calc(4px + env(safe-area-inset-bottom, 0px)); }
}
