/* Golf — sticker design system.
   Fonts use font-display: block, and the app waits for them before its first
   page (app.js), so text never flashes in a fallback face and then swaps.
   1rem = 10 design px. The Figma frames are 402 × 874, so every size below is
   the Figma value divided by ten, and --u rescales the whole interface. */
@font-face {
  font-family: "FOT-Seurat Pro";
  src:
    local("FOT-Seurat Pro B"),
    local("FOT-SeuratPro-B"),
    url(fonts/seurat-pro-b.woff2) format("woff2");
  font-weight: 700;
  font-display: block;
}
/* Seurat is a Japanese face, so its ellipsis floats at mid-height. That one
   character is taken from SF Pro Rounded instead, whose dots sit on the
   baseline. Declared after the face above, it wins for U+2026 only, and it
   covers both typed "…" and the ones the browser adds when text is cut off. */
@font-face {
  font-family: "FOT-Seurat Pro";
  src:
    local("SF Pro Rounded Bold"),
    local("SFProRounded-Bold"),
    url(fonts/sf-pro-rounded-bold.woff2) format("woff2");
  font-weight: 700;
  unicode-range: U+2026;
  font-display: block;
}
/* The stickers' fonts with the rough paper edge baked into the letters, cut for a
   ladder of sizes so the grain is the same on screen at every size (made by
   tools/design/roughen.py; web/ui.js gives each piece of sticker text the cut for
   its size: see roughCuts). Never taken from the computer: no local() source. */
@font-face {
  font-family: "Golf Rough Seurat 14";
  src: url(fonts/seurat-pro-b-rough-14.woff2) format("woff2");
  font-weight: 600 900;
  font-display: block;
}
@font-face {
  font-family: "Golf Rough Seurat 20";
  src: url(fonts/seurat-pro-b-rough-20.woff2) format("woff2");
  font-weight: 600 900;
  font-display: block;
}
@font-face {
  font-family: "Golf Rough Seurat 28";
  src: url(fonts/seurat-pro-b-rough-28.woff2) format("woff2");
  font-weight: 600 900;
  font-display: block;
}
@font-face {
  font-family: "Golf Rough Seurat 40";
  src: url(fonts/seurat-pro-b-rough-40.woff2) format("woff2");
  font-weight: 600 900;
  font-display: block;
}
@font-face {
  font-family: "Golf Rough Seurat 56";
  src: url(fonts/seurat-pro-b-rough-56.woff2) format("woff2");
  font-weight: 600 900;
  font-display: block;
}
@font-face {
  font-family: "Golf Rough Seurat 80";
  src: url(fonts/seurat-pro-b-rough-80.woff2) format("woff2");
  font-weight: 600 900;
  font-display: block;
}
@font-face {
  font-family: "Golf Rough Round 14";
  src: url(fonts/sf-pro-rounded-bold-rough-14.woff2) format("woff2");
  font-weight: 600 900;
  font-display: block;
}
@font-face {
  font-family: "Golf Rough Round 20";
  src: url(fonts/sf-pro-rounded-bold-rough-20.woff2) format("woff2");
  font-weight: 600 900;
  font-display: block;
}
@font-face {
  font-family: "Golf Rough Round 28";
  src: url(fonts/sf-pro-rounded-bold-rough-28.woff2) format("woff2");
  font-weight: 600 900;
  font-display: block;
}
@font-face {
  font-family: "Golf Rough Round 40";
  src: url(fonts/sf-pro-rounded-bold-rough-40.woff2) format("woff2");
  font-weight: 600 900;
  font-display: block;
}
@font-face {
  font-family: "Golf Rough Round 56";
  src: url(fonts/sf-pro-rounded-bold-rough-56.woff2) format("woff2");
  font-weight: 600 900;
  font-display: block;
}
@font-face {
  font-family: "Golf Rough Round 80";
  src: url(fonts/sf-pro-rounded-bold-rough-80.woff2) format("woff2");
  font-weight: 600 900;
  font-display: block;
}
@font-face {
  font-family: "SF Pro Rounded";
  src:
    local("SF Pro Rounded Bold"),
    local("SFProRounded-Bold"),
    url(fonts/sf-pro-rounded-bold.woff2) format("woff2");
  font-weight: 700;
  font-display: block;
}
@font-face {
  font-family: "SF Pro Rounded";
  src:
    local("SF Pro Rounded Heavy"),
    local("SFProRounded-Heavy"),
    url(fonts/sf-pro-rounded-heavy.woff2) format("woff2");
  font-weight: 800;
  font-display: block;
}
:root {
  /* the dim (and slight blur) behind results, sheets and popups: deep enough
     that the table behind stops competing with what's on top */
  --scrim: rgb(20 44 12 / 0.58);
  --scrim-blur: blur(3px);
}
/* on the dark tables a green tint would muddy them: a plain deeper dark */
:root:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) {
  --scrim: rgb(0 0 0 / 0.6);
}
/* The room kept at the foot of the screen for an iPhone's home bar, by the panels that
   run off the bottom (the name tag and rules bar at the table, the tab bar): the home
   bar's safe area less 2rem, so they tuck partly down beside it and save that height,
   but keep their words clear of the bar and of the screen's rounded corners. */
:root {
  --home-bar: max(0px, env(safe-area-inset-bottom) - 2rem);
}
:root {
  --u: min(1px, 100vw / 402);
  font-size: calc(var(--u) * 10);
  --bg: #c4efab;
  --edge: #cff5bc; /* the course's color at the screen's top and bottom on a phone */
  --fw: #73d542;
  --fw2: #a0e970;
  --fw3: #c3f3a4;
  --fw-text: #224715;
  --accent: #b5e59e;
  --ink: #333;
  --black: #000; /* primary text */
  --gray: #8e8e93; /* secondary text */
  --flame: #ff8a3d; /* the win streak, lit */
  --flame-edge: var(--paper); /* the lit flame's outline */
  --paper: #fff;
  --red: #f47979;
  --red2: #fde6e6;
  --p1: #53aaef;
  --p1b: #c8f8f8;
  --p1t: #0f3c51;
  --p2: #f55753;
  --p2b: #f6cbc5;
  --p2t: #63201a;
  --p3: #ffcb20;
  --p3b: #f6e7c5;
  --p3t: #634c1a;
  --p4: #c945f1;
  --p4b: #eac5f6;
  --p4t: #3b1547;
  /* players 5–8: orange, dark blue, lavender, dark green */
  --p5: #ff8a2b;
  --p5b: #f9dcc4;
  --p5t: #5e2d0c;
  --p6: #2f55c2;
  --p6b: #c9d3f3;
  --p6t: #121f4a;
  --p7: #a99af0;
  --p7b: #e6e1fb;
  --p7t: #2e2654;
  --p8: #2e8a4a;
  --p8b: #c6ebd1;
  --p8t: #0f3a1d;
  --shadow: rgb(0 0 0 / 0.25);
  --shadow-alpha: 0.25; /* (the same, as a strength: the sticker letters' shadow copies) */
  --text: "FOT-Seurat Pro", "Hiragino Maru Gothic ProN", "Arial Rounded MT Bold",
    system-ui, sans-serif;
  /* SF Pro Rounded is for sticker numerals only (score, "pts", card ranks), as in Figma. */
  --round: "SF Pro Rounded", ui-rounded, "FOT-Seurat Pro",
    "Arial Rounded MT Bold", system-ui, sans-serif;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  /* a soft landing with no bounce (the tab bar, pages coming to rest) */
  --glide: cubic-bezier(0.22, 1, 0.36, 1);
  --c: var(--fw);
  --c2: var(--fw3);
  --ct: var(--fw-text);
  /* text that sits straight on the table, not on a panel */
  --on-bg: var(--fw-text);
  --on-bg2: var(--fw);
}
:root.in-game {
  --u: min(100vw / 402, 100dvh / 880, 1.5px);
}
.c-fw {
  --c: var(--fw);
  --c2: var(--fw3);
  --ct: var(--fw-text);
}
/* the Quickplay stickers' edge: white on Original, and on the dark themes a dark
   yellow from whichever yellow the theme uses */
:root {
  --p3-edge: var(--paper);
  --p1-edge: var(--paper);
}
:root:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) {
  --p3-edge: color-mix(in srgb, var(--p3) 62%, #000);
  --p1-edge: color-mix(in srgb, var(--p1) 62%, #000);
}
/* a rule's state in the rules panel ("active", "one move away"): the panel's
   text color as the fill, its accent color as the words */
.pill.rule-state {
  background: var(--ct);
  color: var(--c);
}
/* "active": filled with the panel's text color, its words in the page color
   (white on Original, the dark page on the dark themes) */
.pill.rule-state.active {
  background: var(--ct);
  color: var(--paper);
}
/* dark themes: "one move away" is filled with a dark shade of the accent (a step
   up from the panel itself), its words in the panel's light text color */
:root:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) .pill.rule-state.near {
  background: color-mix(in srgb, var(--c) 40%, var(--c2));
  color: var(--ct);
}
/* Original: "one move away" is filled with the accent, its words in the pale
   secondary accent */
:root:is(:not([data-theme]), [data-theme="pool"]) .pill.rule-state.near {
  background: var(--c);
  color: var(--c2);
}
/* Seat colors: the same for everyone at the table. Inside the table, --p1
   ("mine") is re-pointed at the viewer's own seat color. */
:root {
  --s0: var(--p1);
  --s0b: var(--p1b);
  --s0t: var(--p1t);
  --s1: var(--p2);
  --s1b: var(--p2b);
  --s1t: var(--p2t);
  --s2: var(--p3);
  --s2b: var(--p3b);
  --s2t: var(--p3t);
  --s3: var(--p4);
  --s3b: var(--p4b);
  --s3t: var(--p4t);
  --s4: var(--p5);
  --s4b: var(--p5b);
  --s4t: var(--p5t);
  --s5: var(--p6);
  --s5b: var(--p6b);
  --s5t: var(--p6t);
  --s6: var(--p7);
  --s6b: var(--p7b);
  --s6t: var(--p7t);
  --s7: var(--p8);
  --s7b: var(--p8b);
  --s7t: var(--p8t);
  /* text on a solid seat color (the graph's tags): white, but dark on yellow */
  --s0on: #fff;
  --s1on: #fff;
  --s2on: var(--p3t);
  --s3on: #fff;
  --s4on: #fff;
  --s5on: #fff;
  --s6on: var(--p7t);
  --s7on: #fff;
  /* losing: a soft, sad purple */
  --sad: #8b80c4;
}
/* ---------- themes ----------
   A theme is, almost entirely, a set of these tokens: every surface, sticker
   and line of text takes its color from them. "Golf" is the set above.
   "Poker" is a felt table: deep greens underneath, ivory instead of white,
   seat colors that are darker and quieter, and a little antique gold where
   Golf uses pale green. The few rules a theme needs beyond its tokens (its
   backdrop, its card back) sit beside the rule they replace, marked "Poker:". */
/* (also on a preview of the theme inside another: the locked theme on a flag) */
[data-theme-art="poker"],
:root[data-theme="poker"] {
  --bg: #021b14;
  --edge: #032017;
  --felt: #17573b; /* the lit middle of the table */
  --gold: #c9a961;
  --fw: #3f8a64;
  --fw2: #4f9674;
  --fw3: #183d2c;
  --fw-text: #e2ecdc;
  --accent: #b89b5e;
  --ink: #ece4cf;
  --black: #ece4cf;
  --gray: #9a9682;
  --flame: #d67a34;
  --paper: #18241d;
  --red: #c4544f;
  --red2: #3a1f1d;
  --p1: #4f82b0;
  --p1b: #1c2c3a;
  --p1t: #cfe1f2;
  --p2: #b8524c;
  --p2b: #3a1f1d;
  --p2t: #f3d2cc;
  --p3: #c9a043;
  --p3b: #362b17;
  --p3t: #f2e1b4;
  --p4: #8a63a3;
  --p4b: #2d2238;
  --p4t: #e6d5f0;
  --p5: #c27236;
  --p5b: #3a2416;
  --p5t: #f5dcc6;
  --p6: #3d5a9e;
  --p6b: #1a2238;
  --p6t: #d3dcf3;
  --p7: #8f86c2;
  --p7b: #26233a;
  --p7t: #e2ddf5;
  --p8: #4f9a62;
  --p8b: #16301e;
  --p8t: #d4ecd9;
  --s2on: #fff;
  --s6on: #fff;
  --on-bg: #efe7cf;
  --on-bg2: var(--gold);
  --sad: #7d78a8;
  --shadow: rgb(0 0 0 / 0.45);
  --shadow-alpha: 0.45;
}
/* "Pool" (unlocked by the Adult swim flag): the same light, sticker look as Original,
   the course moved into a swimming pool: turquoise water with its tiled lane markers
   (assets/pool.svg) and sunlight playing over everything (the caustics, below); the
   seat colors as they are */
[data-theme-art="pool"],
:root[data-theme="pool"] {
  --scrim: rgb(6 48 50 / 0.55);
  --bg: #a8ecea;
  /* (the water's own color: the page around the pool, and a phone's bars over it) */
  --edge: #a8ecea;
  --fw: #22bdb4;
  --fw2: #6fd9d2;
  --fw3: #c6f4f1;
  --fw-text: #08403c;
  /* text straight on the water (hints, pile labels, the credit line) and the links
     in it: deeper teals than the old theme's, which sat on a paler fairway and
     would vanish into the water here */
  --accent: #2a958e;
  --on-bg2: #14756f;
}
/* "Night Golf" is the same course after dark: the fairway in moonlit greens,
   the seat colors kept bright enough to read but laid on deep surfaces. */
/* (also on a preview of the theme inside another: the locked theme on a flag) */
[data-theme-art="night"],
:root[data-theme="night"] {
  --bg: #0f2018;
  --edge: #193422;
  --fw: #3f8f5a;
  --fw2: #57a86f;
  --fw3: #17301f;
  --fw-text: #dcefd2;
  --accent: #5b8a66;
  --ink: #e4eee0;
  --black: #e4eee0;
  --gray: #8e9a90;
  --paper: #13221a;
  --red: #e06c6c;
  --red2: #3a1b1a;
  --p1: #4a9ee0;
  --p1b: #142a3b;
  --p1t: #cfeaff;
  --p2: #e0605b;
  --p2b: #3a1b1a;
  --p2t: #ffd6d2;
  --p3: #e8b923;
  --p3b: #352b0f;
  --p3t: #fde9b0;
  --p4: #b65ad8;
  --p4b: #2c1938;
  --p4t: #f0d6fb;
  --p5: #f08a3c;
  --p5b: #3a2312;
  --p5t: #ffe0c7;
  --p6: #4a6fd6;
  --p6b: #151f3d;
  --p6t: #d6e0ff;
  --p7: #a99af0;
  --p7b: #25203f;
  --p7t: #e9e4ff;
  --p8: #3fae62;
  --p8b: #12301c;
  --p8t: #d2f3dc;
  --s2on: var(--p3b);
  --s6on: var(--p7b);
  --flame: #ffa152; /* a touch brighter against the night */
  --on-bg: #dcefd2;
  --on-bg2: #7fd18f;
  --sad: #8b80c4;
  --shadow: rgb(0 0 0 / 0.45);
  --shadow-alpha: 0.45;
}
/* "Focus" takes the color out: a black room and one dark gray for everything
   on it, every button, panel, seat and sticker alike. Only the cards keep a
   suit color (red, or the high contrast orange and blue), and the decorative
   icons beside labels go (see the end of the file). */
[data-theme-art="focus"],
:root[data-theme="focus"] {
  --f-edge: #4a4a4a; /* every border and sticker outline */
  --f-fill: #161616; /* every panel and button */
  --f-text: #cfcfcf; /* every label */
  --scrim: rgb(0 0 0 / 0.72);
  --bg: #000;
  --edge: #000;
  --fw: var(--f-edge);
  --fw2: var(--f-edge);
  --fw3: var(--f-fill);
  --fw-text: var(--f-text);
  --accent: #6a6a6a;
  --ink: #dcdcdc;
  --black: #dcdcdc;
  --gray: #858585;
  --flame: #9a9a9a; /* lit is a lighter gray than unlit */
  --paper: #0e0e0e;
  --red: #b04a46; /* the red suits */
  --red2: var(--f-fill);
  --p1: var(--f-edge);
  --p1b: var(--f-fill);
  --p1t: var(--f-text);
  --p2: var(--f-edge);
  --p2b: var(--f-fill);
  --p2t: var(--f-text);
  --p3: var(--f-edge);
  --p3b: var(--f-fill);
  --p3t: var(--f-text);
  --p4: var(--f-edge);
  --p4b: var(--f-fill);
  --p4t: var(--f-text);
  --p5: var(--f-edge);
  --p5b: var(--f-fill);
  --p5t: var(--f-text);
  --p6: var(--f-edge);
  --p6b: var(--f-fill);
  --p6t: var(--f-text);
  --p7: var(--f-edge);
  --p7b: var(--f-fill);
  --p7t: var(--f-text);
  --p8: var(--f-edge);
  --p8b: var(--f-fill);
  --p8t: var(--f-text);
  --s0on: var(--f-text);
  --s1on: var(--f-text);
  --s2on: var(--f-text);
  --s3on: var(--f-text);
  --s4on: var(--f-text);
  --s5on: var(--f-text);
  --s6on: var(--f-text);
  --s7on: var(--f-text);
  --p3-edge: var(--f-edge);
  --p1-edge: var(--f-edge);
  --on-bg: var(--f-text);
  --on-bg2: #6a6a6a;
  --sad: var(--f-edge);
  --shadow: rgb(0 0 0 / 0.6);
  --shadow-alpha: 0.6;
}
/* Dark themes: the lit flame keeps an outline of its own orange, dimmer than
   its fill, instead of vanishing into the dark sticker edge */
:root:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) {
  --flame-edge: color-mix(in srgb, var(--flame) 55%, var(--paper));
}
:root[data-theme="night"] {
  --flame-edge: color-mix(in srgb, var(--flame) 68%, var(--paper));
}
/* Both dark themes: buttons keep their color in a quiet outline rather than
   a bold one, so the dark surfaces carry the look. */
:root:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) :is(.btn, .chip) {
  border-color: color-mix(in srgb, var(--c) 30%, var(--c2));
}
.c-s0 {
  --c: var(--s0);
  --c2: var(--s0b);
  --ct: var(--s0t);
}
.c-s1 {
  --c: var(--s1);
  --c2: var(--s1b);
  --ct: var(--s1t);
}
.c-s2 {
  --c: var(--s2);
  --c2: var(--s2b);
  --ct: var(--s2t);
}
.c-s3 {
  --c: var(--s3);
  --c2: var(--s3b);
  --ct: var(--s3t);
}
.c-s4 {
  --c: var(--s4);
  --c2: var(--s4b);
  --ct: var(--s4t);
}
.c-s5 {
  --c: var(--s5);
  --c2: var(--s5b);
  --ct: var(--s5t);
}
.c-s6 {
  --c: var(--s6);
  --c2: var(--s6b);
  --ct: var(--s6t);
}
.c-s7 {
  --c: var(--s7);
  --c2: var(--s7b);
  --ct: var(--s7t);
}
.board[data-seat="1"] {
  --p1: var(--s1);
  --p1b: var(--s1b);
  --p1t: var(--s1t);
}
.board[data-seat="2"] {
  --p1: var(--s2);
  --p1b: var(--s2b);
  --p1t: var(--s2t);
}
.board[data-seat="3"] {
  --p1: var(--s3);
  --p1b: var(--s3b);
  --p1t: var(--s3t);
}
.board[data-seat="4"] {
  --p1: var(--s4);
  --p1b: var(--s4b);
  --p1t: var(--s4t);
}
.board[data-seat="5"] {
  --p1: var(--s5);
  --p1b: var(--s5b);
  --p1t: var(--s5t);
}
.board[data-seat="6"] {
  --p1: var(--s6);
  --p1b: var(--s6b);
  --p1t: var(--s6t);
}
.board[data-seat="7"] {
  --p1: var(--s7);
  --p1b: var(--s7b);
  --p1t: var(--s7t);
}
/* Pass & Play: the dark green of the 8th seat on the dark themes, and the
   fairway's own light green on Original */
:root:not([data-theme]) .c-passplay {
  --c: var(--fw);
  --c2: var(--fw3);
  --ct: var(--fw-text);
}
.c-p1 {
  --c: var(--p1);
  --c2: var(--p1b);
  --ct: var(--p1t);
}
.c-p2 {
  --c: var(--p2);
  --c2: var(--p2b);
  --ct: var(--p2t);
}
.c-p3 {
  --c: var(--p3);
  --c2: var(--p3b);
  --ct: var(--p3t);
}
.c-p4 {
  --c: var(--p4);
  --c2: var(--p4b);
  --ct: var(--p4t);
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  min-height: 100%;
}
html {
  background: var(--bg);
}
/* Room for the page's scrollbar is kept whether or not the page is long enough to
   scroll. Without it, a short page (Watch with no games on) sat half a scrollbar's
   width to the right of a long one, and everything jumped across on changing tabs. */
/* (overflow-y: scroll does it where scrollbar-gutter does not: browsers ignore the
   gutter for a scrollbar restyled as ours is.) */
:root:not(.in-game) {
  scrollbar-gutter: stable;
  overflow-y: scroll;
}
body {
  font: 700 1.6rem/1.4 var(--text);
  color: var(--on-bg);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}
:root.in-game,
:root.in-game body {
  overflow: hidden;
  height: 100%;
  position: fixed;
  inset: 0;
  -webkit-user-select: none;
  user-select: none;
}
/* The rough is the page color; the fairway sits centered on top of it, a
   quarter taller than the screen so its rounded ends run off the top and
   bottom (the fairway is 1076 of the image's 1276 units; the rest is the
   first cut around it). On narrow phones it shrinks with the width so its
   side edges stay in view, but its ends still just leave the screen. */
/* The backdrop is as tall as the screen with Safari's bars put away (100lvh),
   so the toolbar never shows its edge. */
#backdrop {
  position: fixed;
  inset: 0;
  min-height: 100lvh;
  z-index: -1;
  background: url(assets/fairway.svg) center / auto
    min(148vh, max(122vh, 250vw)) no-repeat;
}
/* Safari (iOS 26) never shows the page under its status bar and toolbar: it
   fills them with one flat color, the page's background or a fixed element's.
   On a phone the course fills the screen, so both are the course's own color
   at its edges (--edge), and the bars run on from it without a seam. */
@media (max-width: 759px) {
  html,
  #backdrop {
    background-color: var(--edge);
  }
}
/* Night Golf: the same course after dark */
:root[data-theme="night"] #backdrop {
  background-image: url(assets/fairway-night.svg);
}
/* Pool: the water, as tall as the screen, its lane markers (the T's) running
   on past the bottom edge; the page is the water's own color around it */
:root[data-theme="pool"] #backdrop {
  background: var(--edge) url(assets/pool.svg) center top / auto 100% no-repeat;
}
/* Pool: sunlight on the water plays over everything, a faint web of
   caustics laid over the whole screen. Two layers of the same web, at
   different sizes, drift different ways, so the light shifts as they cross.
   Each layer runs a tile past the screen and slides one tile, so it loops
   without a jump; it never takes a tap. */
/* (The layers drift inside #caustics, a still sheet pinned to the screen and
   exactly its size, which clips them. They were once pinned to the screen
   themselves, larger than it and moving: on an iPhone that left everything else
   pinned there, the tab bar and Start a Game, stranded part way up the page
   after a scroll.) */
#caustics {
  display: none;
}
:root[data-theme="pool"] #caustics {
  display: block;
  position: fixed;
  inset: 0;
  min-height: 100lvh;
  z-index: 1000;
  overflow: hidden;
  contain: strict;
  pointer-events: none;
}
:root[data-theme="pool"] #caustics::before,
:root[data-theme="pool"] #caustics::after {
  content: "";
  position: absolute;
  inset: -480px 0 0 -480px;
  background: url(assets/caustics.svg) 0 0 / 480px repeat;
  opacity: 0.19;
  animation: caustics 38s linear infinite;
}
:root[data-theme="pool"] #caustics::after {
  inset: 0 -640px -640px 0;
  background-size: 640px;
  opacity: 0.13;
  animation: caustics-back 52s linear infinite;
}
@keyframes caustics {
  to {
    translate: 480px 480px;
  }
}
@keyframes caustics-back {
  to {
    translate: -640px -640px;
  }
}
/* (held still for anyone who has asked for less motion, in their system or in Settings) */
:root.reduce-motion[data-theme="pool"] #caustics::before,
:root.reduce-motion[data-theme="pool"] #caustics::after {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  :root[data-theme="pool"] #caustics::before,
  :root[data-theme="pool"] #caustics::after {
    animation: none;
  }
}
/* Focus: nothing behind the table but black */
:root[data-theme="focus"] #backdrop {
  background: none;
}
/* Poker: a felt card table in place of the fairway, the same shape and size,
   with the dark room around it running out to every edge of the screen */
:root[data-theme="poker"] #backdrop {
  background-image: url(assets/poker-table.svg);
}
.svg-defs {
  position: absolute;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
}
button:disabled {
  cursor: not-allowed;
}
a {
  color: var(--p1t);
}
h1,
h2,
h3,
p {
  margin: 0;
}
[hidden] {
  display: none !important;
}
/* Focus rings are for the keyboard: they only show once a key has been used,
   and go again with the next tap or click (phones otherwise ring whatever a
   dialog focuses on opening, or a field after its picker closes). */
:root.keyboard :focus-visible {
  outline: 0.3rem solid var(--p1);
  outline-offset: 0.3rem;
}
:root:not(.keyboard) :focus-visible {
  outline: none;
}

/* ---------- stickers: fill + stroke + hard shadow + gentle idle drift ---------- */
.ico {
  display: inline-block;
  flex: none;
  overflow: visible;
  /* --shx/--shy keep the shadow falling down-right even on rotated stickers. (The rough
     paper edge is in the icon's own outline: tools/design/roughen.py.) */
  filter: drop-shadow(var(--shx, 0.3rem) var(--shy, 0.3rem) 0 var(--shadow));
}
.ico path {
  fill: var(--fill, var(--c));
  stroke: var(--stroke, var(--paper));
  stroke-linejoin: round;
  stroke-linecap: round;
  paint-order: stroke fill;
}
.ico path.cut {
  fill: var(--stroke, var(--paper));
  stroke: none;
}
.ico.flat {
  filter: none;
}
/* lying flat on the page: no drop shadow (unchecked circles) */
.ico.bare {
  filter: none;
}
.ico.ink path {
  fill: currentColor;
  stroke: none;
}
/* symbols set like letters in the surrounding text */
.text-symbol {
  display: inline-block;
  fill: currentColor;
  overflow: visible;
}
/* marks your own name */
.you-star {
  width: 0.86em;
  /* (as close to the name as its letters are to each other) */
  margin-right: 0.12em;
  vertical-align: -0.06em;
}
/* follows a link that leaves the game */
.out-arrow {
  width: 0.62em;
  margin: 0 0.12em 0 0.2em;
  vertical-align: 0.02em;
}
.stk {
  display: inline-block;
  color: var(--fill, var(--c));
  -webkit-text-stroke: var(--sw, 0.6rem) var(--stroke, var(--paper));
  paint-order: stroke fill;
  /* (The rough paper edge is in the letters themselves: the rough cut of the font for
     their size, given by web/ui.js as data-cut.) */
  position: relative;
  isolation: isolate;
}
/* The shadow is a copy of the letter (data-t), outline and all, in solid black, made
   see-through as one piece and set behind it. Not a filter: Safari draws a filtered
   element only within its own box, and the thick outline reaching past it was cut off.
   Not a text shadow: that is drawn once for the outline and again for the fill, and
   the fill's lay over the outline. */
.stk::before {
  content: attr(data-t);
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: inherit;
  white-space: pre;
  color: #000;
  -webkit-text-stroke-color: #000;
  opacity: var(--shadow-alpha, 0.25);
  translate: var(--shx, 0.3rem) var(--shy, 0.3rem);
  pointer-events: none;
}
/* The static tilt lives on `transform`; idle motion uses the independent
   translate/rotate properties so the two never fight. */
.idle {
  animation: idle var(--idle-d, 5s) ease-in-out var(--idle-delay, 0s) infinite
    alternate;
  will-change: translate, rotate;
}
/* (--idle-scale turns a sticker's drift down: 1 is the usual amount) */
@keyframes idle {
  from {
    translate: calc(var(--ix, 0.08rem) * var(--idle-scale, 1) * -1) calc(var(--iy, 0.1rem) * var(--idle-scale, 1) * -1);
    rotate: calc(var(--ir, 1.5deg) * var(--idle-scale, 1) * -1);
  }
  to {
    translate: calc(var(--ix, 0.08rem) * var(--idle-scale, 1)) calc(var(--iy, 0.1rem) * var(--idle-scale, 1));
    rotate: calc(var(--ir, 1.5deg) * var(--idle-scale, 1));
  }
}
.tilt {
  display: inline-flex;
  transform: rotate(var(--tilt, -6deg));
}
.tilt.mirror {
  transform: rotate(calc(var(--tilt, -6deg) * -1)) scaleX(-1);
}

/* ---------- pages ---------- */
#app {
  min-height: 100dvh;
}
.loading,
.empty {
  padding: 4rem 1.6rem;
  text-align: center;
  color: var(--on-bg2);
}
/* While the app starts, the loading line only shows if the start is slow: a
   quick refresh goes straight to the page instead of flashing it. */
.loading.boot {
  animation: boot-late 0.25s ease 0.8s both;
}
@keyframes boot-late {
  from {
    visibility: hidden;
    opacity: 0;
  }
}
/* Until the first page is drawn, nothing the browser counts as content is
   painted (see booted() in ui.js); the plain page color stays underneath. */
:root.booting #backdrop {
  visibility: hidden;
}
/* the first page after a load or refresh is simply there; later pages slide in */
.page.instant {
  animation: none;
}
.page {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 1.6rem;
  padding-top: max(1.6rem, env(safe-area-inset-top));
  padding-bottom: max(1.6rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  /* content hangs from the top, so anything that expands only pushes what is
     below it; the closing row of buttons stays pinned to the bottom */
  justify-content: flex-start;
  gap: 2.4rem;
  animation: page-in 0.35s var(--spring) both;
}
.page:not(.scroll) > :last-child:not(:first-child) {
  margin-top: auto;
}
/* a page whose content all hangs from the top, with nothing pinned to the foot */
.page.top > :last-child:not(:first-child) {
  margin-top: 0;
}
/* the home menu sits in the middle of the space under the logo */
.page.home > .stack {
  margin-block: auto;
}
/* the credit line rests at the foot of the page, below the centered menu */
.page.home:not(.scroll) > .credit:last-child:not(:first-child) {
  margin-top: 0;
}
/* a short screen with nothing that expands (name and match type) sits centered */
.page.centered {
  justify-content: space-between;
}
.page.centered:not(.scroll) > :last-child:not(:first-child) {
  margin-top: 0;
}
.page.scroll {
  justify-content: flex-start;
  max-width: 76rem;
}
@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(1.2rem) scale(0.985);
  }
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 6.5rem;
  flex: none;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 5.9rem;
  height: 6.5rem;
  flex: none;
  --fill: var(--paper);
  --stroke: var(--ink);
  transition: transform 0.25s var(--spring);
}
/* Dark themes: the icon's light outline, softened toward the table */
:root:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) .icon-btn {
  --stroke: color-mix(in srgb, var(--ink) 50%, var(--paper));
}
.icon-btn:hover {
  transform: scale(1.1);
}
.icon-btn:active {
  transform: scale(0.9);
}
.logo {
  display: flex;
  align-items: center;
  height: 6.4rem;
  font: 700 6.4rem/1 var(--text);
  text-decoration: none;
  transition: opacity 0.25s;
}
/* held back until the club artwork and the display font have loaded */
.logo.pending {
  opacity: 0;
}
.logo .lg {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 6.4rem;
  margin-right: -1rem;
}
.logo .lg:last-child {
  margin-right: 0;
}
.logo .stk {
  --sw: 1.2rem;
}
.logo .club {
  /* 0.4rem wider than its design box, and the club drawn 0.4rem further in,
     so it stands a little right of the "o" with the gap to the "f" unchanged */
  width: 2.514rem;
  /* the "f" tucks in 0.3rem closer than the other letters do */
  margin-right: -1.3rem;
  /* the club is the logo's red letter: a light body in a red sticker outline */
  --club-fill: var(--p2b);
  --club-stroke: var(--p2);
}
.logo .club-box {
  position: relative;
  flex: none;
  width: 1.86rem;
  height: 7.334rem;
  transform: rotate(2deg);
}
.logo .club-art {
  position: absolute;
  left: 0.4rem;
  top: -0.3rem;
  height: 8.3rem;
  width: auto;
  overflow: visible;
  /* (the rough sticker edge is in its own outline) */
}
.page-title {
  font: 700 2.4rem/1.1 var(--text);
  color: var(--on-bg);
  flex: 1;
  min-width: 0;
}
/* an empty list's message fills the free space on the page, centered both ways */
.empty-fill {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
}
.page:not(.scroll) > .empty-fill + :last-child {
  margin-top: 0;
}
/* a page's title, on its own line under the Back button and logo (Refresh beside it) */
.row.page-head {
  align-items: center;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.stack.wide {
  gap: 2.4rem;
}
.row {
  display: flex;
  gap: 0.8rem;
  align-items: stretch;
}
.row.split {
  gap: 1rem;
}
.grow {
  flex: 1 1 0;
  min-width: 0;
}
.hint {
  color: var(--accent);
  font-size: 1.6rem;
  line-height: 1.4;
}
/* the Profile page's avatar and name sit straight on the page, saving as they change */
.profile-form {
  margin-bottom: 2.4rem;
}
.profile-status {
  min-height: 1.4em;
  margin: -0.6rem 0 0;
  opacity: 0;
}
.profile-status.show {
  animation: profile-saved 1.8s ease-out;
}
@keyframes profile-saved {
  10%,
  70% {
    opacity: 1;
  }
}
.hint.dark {
  color: var(--on-bg2);
}
/* inside a themed surface, notes take that surface's primary color */
.sheet .hint,
.summary .hint,
.modal .hint,
.panel .hint.dark,
.sheet .empty,
.sheet .loading {
  color: var(--c);
}

/* Scrollbars: a slim pill, with no track, in a lighter shade of the surrounding
   theme color (half way between it and the surface it lies on). */
:root {
  --scroll-thumb: color-mix(in srgb, var(--c, var(--fw)) 50%, var(--c2, var(--fw3)));
}
* {
  --scroll-thumb: color-mix(in srgb, var(--c, var(--fw)) 50%, var(--c2, var(--fw3)));
}
::-webkit-scrollbar {
  width: 1.2rem;
  height: 1.2rem;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  border: 0.35rem solid transparent;
  border-radius: 99rem;
  background: var(--scroll-thumb) padding-box;
}
/* (the full color while it is under the pointer or being dragged) */
::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:active {
  background-color: var(--c, var(--fw));
}
/* (a table that scrolls sideways has a darker one: the full color of the card it is in,
   as its row lines are, kept inside the card's padding) */
.table-wrap {
  --scroll-thumb: var(--c, var(--fw));
}
.panel .table-wrap::-webkit-scrollbar-track {
  margin-inline: 1.4rem;
}
/* keep the pill clear of rounded corners */
.sheet::-webkit-scrollbar-track,
.summary::-webkit-scrollbar-track,
.social-dialog::-webkit-scrollbar-track {
  margin-block: 2.4rem;
}
@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
  }
}
.credit {
  font: 700 1.6rem/1 var(--round);
  /* the fairway's secondary text color, as on hints and pile labels */
  color: var(--accent);
  text-align: center;
  padding-top: 0.6rem;
}
/* our names are links to our own sites, in the primary fairway green */
.credit a {
  color: var(--on-bg2);
  text-decoration: none;
  white-space: nowrap;
}
.credit a:hover {
  text-decoration: underline;
  text-decoration-thickness: 0.15em;
  text-underline-offset: 0.2em;
}

/* ---------- buttons, fields, chips ---------- */
.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  min-height: 7.2rem;
  padding: 1rem;
  border: 0.4rem solid var(--c);
  border-radius: 2.4rem;
  background: var(--c2);
  color: var(--ct);
  font: 700 2.4rem/1 var(--text);
  text-align: center;
  text-decoration: none;
  --fill: var(--c2);
  --stroke: var(--c);
  transition:
    transform 0.28s var(--spring),
    box-shadow 0.2s,
    filter 0.2s;
}
@media (hover: hover) {
  .btn:hover:not(:disabled),
  .chip:hover,
  .list-item:is(button):hover {
    transform: translate(-0.15rem, -0.15rem);
    box-shadow: 0.3rem 0.3rem 0 var(--shadow);
  }
}
.btn:active:not(:disabled) {
  transform: scale(0.96);
  box-shadow: none;
  transition-duration: 0.08s;
}
.btn:disabled {
  filter: saturate(0.35) opacity(0.65);
}
.btn > span {
  white-space: nowrap;
}
/* a note standing where a button would be (a guest's "Play again"): the same
   frame, muted like a button that can't be pressed, its text centered in it */
.btn.btn-note {
  font-size: 1.6rem;
  line-height: 1.3;
  text-wrap: balance;
  filter: saturate(0.35) opacity(0.65);
  cursor: default;
  pointer-events: none;
}
.btn.tile {
  flex-direction: column;
  gap: 1.2rem;
  min-height: 10.8rem;
}
/* the paired home tiles: a touch smaller, so "Leaderboard" has room to breathe */
.split .btn.tile {
  font-size: 2.1rem;
}
/* room for the controller glyph beside "Leaderboard" */
:root.pad-on .split .btn.tile {
  font-size: 1.85rem;
}
.btn.round {
  width: 7.2rem;
  height: 7.2rem;
  min-height: 0;
  flex: none;
  border-radius: 50%;
  color: var(--c);
}
.btn.small {
  min-height: 4.8rem;
  padding: 0.6rem 1.4rem;
  border-radius: 1.8rem;
  font-size: 1.6rem;
}
.btn .sub {
  display: block;
  margin-top: 0.8rem;
  font-size: 1.6rem;
  color: var(--c);
}
.btn .badge {
  position: absolute;
  top: -1rem;
  right: -0.6rem;
  min-width: 2.8rem;
  height: 2.8rem;
  padding: 0 0.7rem;
  border-radius: 1.4rem;
  display: grid;
  place-items: center;
  /* in the button's own color: its border color, with its fill color for the number */
  background: var(--c);
  color: var(--c2);
  font: 700 1.6rem/1 var(--text);
  box-shadow: 0.2rem 0.2rem 0 var(--shadow);
}
.btn .badge[hidden],
.btn .sub[hidden] {
  display: none;
}
.field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 7.2rem;
  padding: 0.8rem 1.2rem;
  border: 0.4rem solid var(--c);
  border-radius: 2.4rem;
  background: var(--c2);
  color: var(--ct);
  font: 700 2.4rem/1 var(--text);
  --fill: var(--c2);
  --stroke: var(--c);
  text-align: left;
  width: 100%;
}
.field > .label {
  position: absolute;
  left: 2rem;
  top: -1.25rem;
  font: 700 1.6rem/1.4 var(--text);
  color: var(--c2);
  -webkit-text-stroke: 0.5rem var(--c);
  paint-order: stroke fill;
  white-space: nowrap;
  pointer-events: none;
}
.field input,
.field select {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  line-height: 1.4;
  color: inherit;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  text-overflow: ellipsis;
}
.field select {
  cursor: pointer;
}
:root.keyboard .field:focus-within {
  outline: 0.3rem solid var(--p1);
  outline-offset: 0.2rem;
}
.field .value {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.field select.cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 1.6rem;
}
/* an info sticker on the border's top edge, at the opposite end from the label */
.field > .field-info {
  position: absolute;
  right: 1.2rem;
  top: -1.9rem;
  z-index: 1; /* above the invisible picker that covers the field */
  display: grid;
  place-items: center;
  padding: 0.8rem; /* a fingertip-sized target around the small sticker */
  border: 0;
  background: none;
  cursor: pointer;
}
.field > .field-info .ico {
  filter: none; /* drawn flat on the border, like the label */
}
/* the explanation under a field unfolds when its info sticker is tapped
   (closed, it also gives back the stack's gap above it) */
.info-hint {
  display: grid;
  grid-template-rows: 0fr;
  margin-top: -1rem;
  opacity: 0;
  transform: translateY(-0.6rem);
  transition: grid-template-rows 0.28s ease, margin-top 0.28s ease,
    opacity 0.2s ease, transform 0.28s ease, visibility 0s 0.28s;
  visibility: hidden;
}
.info-hint > .hint {
  min-height: 0;
  overflow: hidden;
}
.info-hint.open {
  grid-template-rows: 1fr;
  margin-top: 0;
  opacity: 1;
  transform: none;
  transition: grid-template-rows 0.28s ease, margin-top 0.28s ease,
    opacity 0.24s ease 0.06s, transform 0.28s ease, visibility 0s;
  visibility: visible;
}
@media (prefers-reduced-motion: reduce) {
  .info-hint,
  .info-hint.open {
    transition: none;
  }
}
:root.reduce-motion .info-hint,
:root.reduce-motion .info-hint.open {
  transition: none;
}
.field.hug {
  width: auto;
  flex: none;
  padding-right: 2.4rem;
}
.field.hug .value {
  flex: none;
}
.field.locked {
  filter: saturate(0.5) opacity(0.7);
}
.chips {
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
}
.chip {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  min-height: 6.4rem;
  padding: 1.2rem 0.8rem;
  border: 0.4rem solid var(--c);
  border-radius: 2.4rem;
  background: var(--c2);
  color: var(--ct);
  font: 700 1.6rem/1.4 var(--text);
  --fill: var(--c2);
  --stroke: var(--c);
  transition:
    transform 0.28s var(--spring),
    box-shadow 0.2s;
}
.chip:active {
  transform: scale(0.94);
}
.chip[aria-pressed="true"] {
  --c: var(--p1);
  --c2: var(--p1b);
  --ct: var(--p1t);
}
.panel {
  border: 0.4rem solid var(--c);
  border-radius: 2.4rem;
  background: var(--c2);
  color: var(--ct);
  padding: 1.6rem 1.4rem;
  --fill: var(--c2);
  --stroke: var(--c);
}
.panel h2,
.panel h3 {
  font: 700 2rem/1.2 var(--text);
  margin-bottom: 0.8rem;
}
.panel h2 > .tilt,
.social-dialog h2 > .tilt,
.panel p > .tilt {
  margin-right: 0.8rem;
  vertical-align: middle;
}
.panel p + p {
  margin-top: 0.8rem;
}
/* Notifications: the steps to put Golf on an iPhone's Home Screen, each with
   a picture of what to tap */
.guide {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.6rem;
}
.guide-shot {
  display: block;
  width: 100%;
  max-width: 24rem;
  height: auto;
  margin: 0.8rem auto 0;
  border: 0.3rem solid var(--c);
  border-radius: 1.6rem;
  background: #fff;
}
.new-tag {
  display: inline-grid;
  place-items: center;
  padding: 0.3rem;
  border-radius: 0.4rem;
  background: var(--p2);
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.4;
  vertical-align: middle;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 1rem;
  border-radius: 1.4rem;
  background: var(--c);
  color: #fff;
  font-size: 1.3rem;
  white-space: nowrap;
}

/* a lobby's rules chip opens its rules sheet */
button.pill {
  border: none;
  font-family: inherit;
  font-weight: inherit;
  line-height: inherit;
  cursor: pointer;
  transition: transform 0.25s var(--spring);
}
button.pill:active {
  transform: scale(0.92);
}

/* ---------- avatar carousel ---------- */
.avatar-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  padding: 2.4rem 0;
}
.avatar-pick .pointer {
  color: var(--on-bg2);
  animation: bob 1.4s ease-in-out infinite alternate;
}
@keyframes bob {
  to {
    transform: translateY(0.4rem);
  }
}
.avatar-strip {
  display: flex;
  width: calc(100% + 3.2rem);
  margin: 0 -1.6rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 24%, #000 76%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 24%, #000 76%, transparent);
}
.avatar-strip::-webkit-scrollbar {
  display: none;
}
/* The track is what scrolls: one snap stop per avatar. The stage rides along
   pinned to the viewport, and app.js places the avatars on it every frame. */
.avatar-track {
  --pitch: 8.8rem;
  --more: calc(var(--stops, 0) * var(--pitch));
  flex: none;
  display: flex;
  align-items: flex-start;
  width: calc(100% + var(--more));
}
.avatar-stage {
  position: sticky;
  left: 0;
  flex: none;
  box-sizing: content-box;
  width: calc(100% - var(--more));
  margin-right: calc(var(--more) - 100%);
  height: 7.2rem;
  /* room for the arc: side avatars sit lower, as on the rim of a big wheel */
  padding: 1.6rem 0 6.4rem;
  overflow: hidden;
}
.avatar-stops {
  flex: none;
  display: flex;
  height: 1px;
  pointer-events: none;
}
.avatar-stops i {
  flex: none;
  width: var(--pitch);
  scroll-snap-align: start;
}
.avatar {
  position: absolute;
  left: calc(50% - 3.6rem);
  top: 1.6rem;
  display: grid;
  place-items: center;
  width: 7.2rem;
  height: 7.2rem;
  --fill: var(--fw3);
  --stroke: var(--fw);
  will-change: transform, opacity, filter;
}
/* the art's shadow is the flat copy underneath */
.avatar > .ico {
  filter: none;
}
.avatar-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: grid;
  place-items: center;
  opacity: 0.25;
  pointer-events: none;
  will-change: transform;
}
.avatar-shade .ico path,
.avatar-shade .ico path.cut {
  fill: #000;
  stroke: #000;
}
/* the avatar under the pointer wears your player color (player 1 blue,
   2 red, …); the color flows from one to the next as the wheel turns */
.avatar.near {
  --fill: var(--c2);
  --stroke: var(--c);
}
.avatar > .ico path {
  transition:
    fill 0.18s,
    stroke 0.18s;
}
.avatar-pick {
  gap: 0.4rem;
}
.avatar-pick .avatar-name {
  margin-top: -3.6rem;
}
.avatar-name {
  font: 700 2.4rem/1 var(--text);
  text-align: center;
}
.avatar-badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 4.4rem;
  height: 4.4rem;
  /* just the sticker: no box or outline around it */
  --fill: var(--c2);
  --stroke: var(--c);
}

/* ---------- rules picker ---------- */
.rules-box {
  position: relative;
  border: 0.4rem solid var(--fw);
  border-radius: 2.4rem;
  background: var(--fw3);
  --fill: var(--fw3);
  --stroke: var(--fw);
}
.rules-box > .label {
  position: absolute;
  left: 2rem;
  top: -1.25rem;
  font-size: 1.6rem;
  color: var(--fw3);
  -webkit-text-stroke: 0.5rem var(--fw);
  paint-order: stroke fill;
  pointer-events: none;
}
.rules-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 6.4rem;
  padding: 0.8rem 1.2rem;
  font: 700 2.4rem/1 var(--text);
  color: var(--fw-text);
  text-align: left;
}
.rules-head span {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.rules-head .chev {
  display: inline-flex;
  /* as far in from the right edge as it is from the top */
  margin-right: 1.3rem;
  transition: transform 0.3s var(--spring);
}
.rules-box.open .rules-head .chev {
  /* turned, it is wider than tall, so it steps in a touch to stay centered */
  transform: translateX(-0.3rem) rotate(90deg);
}
/* height animates by growing a grid row from 0fr to 1fr */
.collapse {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.45s cubic-bezier(0.3, 1, 0.3, 1),
    opacity 0.3s;
}
.collapse.open {
  grid-template-rows: 1fr;
  opacity: 1;
}
.collapse > div {
  min-height: 0;
  overflow: hidden;
}
.rules-body {
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
  padding: 1.4rem 1.2rem 1.6rem;
}
/* the clip box is widened a little so chip shadows are not cut off */
[data-rules-closed] > div {
  margin: 0 -0.6rem;
  padding: 0 0.6rem;
}
.rules-closed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0 0.6rem;
}
/* the three presets share the row evenly and may shrink, so none runs off
   the edge of a narrow screen */
.rules-closed .chip {
  flex: 1 1 0;
  min-width: 0;
  gap: 0.5rem;
  padding: 1.2rem 0.4rem;
  font-size: 1.5rem;
  white-space: nowrap;
}
.rules-box.opening .rule-row {
  animation: row-in 0.4s var(--spring) both;
  animation-delay: calc(var(--i, 0) * 22ms + 80ms);
}
@keyframes row-in {
  from {
    opacity: 0;
    transform: translateX(-1.2rem) scale(0.9);
  }
}
.rule-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  margin-top: 0.6rem;
}
.rule-variants span {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.3rem;
}
.rule-group {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  align-items: flex-start;
}
.rule-group > h4 {
  margin: 0;
  font-size: 1.6rem;
  color: var(--fw-text);
}
.rule-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.6rem;
  color: var(--fw);
  text-align: left;
  --fill: var(--fw3);
  --stroke: var(--fw);
}
.rule-row[aria-checked="true"] {
  color: var(--fw-text);
  --fill: var(--p1b);
  --stroke: var(--p1);
}
.rule-row:disabled {
  cursor: default;
}
.rule-row small {
  display: block;
  font-size: 1.2rem;
  color: var(--fw);
  line-height: 1.3;
}

/* ---------- lists & tables for the long pages ---------- */
.list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.2rem 1.4rem;
  border: 0.4rem solid var(--c);
  border-radius: 2.4rem;
  background: var(--c2);
  color: var(--ct);
  --fill: var(--c2);
  --stroke: var(--c);
  text-align: left;
  width: 100%;
  transition:
    transform 0.28s var(--spring),
    box-shadow 0.2s;
}
.list-item strong {
  display: block;
  font-size: 2rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.list-item small {
  display: block;
  font-size: 1.3rem;
  line-height: 1.4;
  opacity: 0.75;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.table-wrap {
  overflow-x: auto;
  margin: 0.8rem -0.4rem 0;
  padding: 0 0.4rem;
}
/* In a card, a table that scrolls sideways runs out to the card's edges: the card's own
   padding is inside it, so what scrolls by is cut off at the card's border, not short of it */
.panel .table-wrap {
  margin-inline: -1.4rem;
  padding-inline: 1.4rem;
}
/* (a card that ends with such a table ends with it: the room under its last row is the
   table's own, as much as is beside its first column, the card's 1.4rem and the cell's 0.3rem
   either way, so the table sits evenly in the card's corner) */
article.panel:has(> .table-wrap:last-child) {
  padding-bottom: 0;
}
article.panel > .table-wrap:last-child {
  padding-bottom: 0.7rem; /* (+ the last row's own 0.7rem, less its line's own room under the words) */
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.4rem;
}
th,
td {
  padding: 0.7rem 0.8rem;
  text-align: left;
  border-bottom: 0.2rem solid var(--c);
  white-space: nowrap;
}
tbody th {
  white-space: normal;
}
/* the last row of a table has no line under it: the totals' last row, or with no totals
   the body's (the table's last part either way). Not `table:not(:has(tfoot))`: with that,
   anything added anywhere on a page had the whole page styled again, which made a long
   page of tables slower to add to with every table on it */
tfoot tr:last-child > *,
table > tbody:where(:last-child) > tr:last-child > :is(th, td) {
  border-bottom: 0;
}
td {
  font-family: var(--text);
}
/* Advanced stats: a rule's parts, tucked under it */
tr.sub-rule > * {
  padding-block: 0.4rem;
  font-size: 1.25rem;
  border-bottom-width: 0.1rem;
  border-bottom-color: color-mix(in srgb, var(--c) 45%, transparent);
}
/* (the arrow hangs, so a long name wraps under itself) */
tr.sub-rule > th {
  padding-left: 3.6rem;
  text-indent: -1.6rem;
  font-weight: 600;
  opacity: 0.85;
}
.sub-rule-arrow {
  width: 0.95em;
  margin-right: calc(1.6rem - 0.95em);
  vertical-align: -0.05em;
  opacity: 0.8;
}
/* the rule's own line runs lightly into its parts, which end on the full line (classes the
   table is written with, not `tr:has(+ tr.sub-rule)`: with that, anything added anywhere
   on any page had the whole page styled again) */
tr.has-parts > * {
  border-bottom-width: 0.1rem;
  border-bottom-color: color-mix(in srgb, var(--c) 45%, transparent);
}
tr.sub-rule.sub-last > * {
  border-bottom-width: 0.2rem;
  border-bottom-color: var(--c);
}
details > summary {
  cursor: pointer;
  list-style: none;
  font-size: 1.6rem;
  padding: 0.4rem 0;
}
details > summary::-webkit-details-marker {
  display: none;
}
details > summary::before {
  content: "▸ ";
}
details[open] > summary::before {
  content: "▾ ";
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.8rem 1rem;
  margin-top: 1.2rem;
}
.field.compact {
  min-height: 5.6rem;
  font-size: 1.8rem;
  border-radius: 2rem;
}
.check {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
}
.check input {
  width: 2.4rem;
  height: 2.4rem;
  accent-color: var(--p1);
}
.share {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
/* Copy: a sticker over its label, like Quit and View under the results */
.share-copy {
  margin-top: 0.4rem;
}
.share .field {
  font-size: 1.5rem;
  min-height: 5.6rem;
}
.form-wrap {
  max-width: 76rem;
  margin: 0 auto;
  padding: 1.6rem;
}
.form-wrap h1 {
  font-size: 2.8rem;
  margin: 1.2rem 0;
}
.form-wrap h2 {
  font-size: 2rem;
  margin: 1.6rem 0 0.6rem;
}
.form-wrap .panel {
  font-family: var(--text);
  font-size: 1.6rem;
}
body > header.topbar .brand {
  font-size: 3.2rem;
  text-decoration: none;
  color: var(--on-bg2);
}
/* Poker: a link on the bare table needs a light color, not the seat's dark one */
:root:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) body > header.topbar a:not(.brand) {
  color: var(--on-bg);
}
body > header.topbar {
  padding: 0 1.6rem;
  max-width: 76rem;
  margin: 0 auto;
}

/* ---------- game board ---------- */
.board {
  position: fixed;
  inset: 0;
  margin: 0 auto;
  width: 40.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  touch-action: none;
}
.board > .layer {
  display: contents;
}
.b-top,
.b-bottom {
  display: flex;
  gap: 0.8rem;
  padding: 0 0.8rem;
  flex: none;
}
.b-top {
  align-items: flex-start;
}
.b-bottom {
  align-items: flex-end;
}
.b-main {
  width: 28.066rem;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.b-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}
.tag {
  display: block;
  width: 100%;
  background: var(--c);
  color: var(--ct);
  /* the chin: the thick edge of the frame, where the turn labels sit */
  padding: 0 0.8rem 2rem;
  border-radius: 0 0 2.4rem 2.4rem;
  --fill: var(--c);
  --stroke: var(--paper);
  transition: background 0.3s;
  text-align: left;
}
/* "YOUR TURN" sits in the top band of your score tag, and your tags' frame
   breathes a little darker while the table waits on you */
.tag-score {
  position: relative;
}
.turn-label {
  position: absolute;
  inset: 0 0 auto;
  height: 2.6rem;
  display: grid;
  place-items: center;
  color: #000;
  mix-blend-mode: multiply;
  font: 800 1.2rem/1 var(--round);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(0.5rem) scale(0.7);
  transition:
    opacity 0.2s,
    transform 0.4s var(--spring);
  pointer-events: none;
}
/* the chin of a player's score tag is deeper than the frame's other edges,
   to give its label room; the rules tag has no label, and no chin: its frame
   is the same width all round */
.b-top .tag-score {
  padding-bottom: 2.6rem;
}
.b-top .tag-rules {
  padding-bottom: 0.8rem;
}
/* The opponent's tag carries the same label along its foot ("THEIR TURN"), and
   at tables of three or more either tag can read "UP NEXT" instead */
.b-top .turn-label {
  inset: auto 0 0;
  transform: translateY(-0.5rem) scale(0.7);
}
.my-turn > .turn-label,
.their-turn > .turn-label,
.up-next > .turn-label {
  opacity: 1;
  transform: none;
}
/* whose turn it is reads in white; who is up next is a darker shade of the
   frame: black multiplied onto it at 45% */
.my-turn > .turn-label,
.their-turn > .turn-label {
  color: #fff;
  mix-blend-mode: normal;
}
.up-next > .turn-label {
  opacity: 0.45;
}
/* The last seconds of a move's time (people playing each other): the band counts them
   down in place of whose turn it is, flashing white. The s of "15s" stays small. */
.clock-low > .turn-label {
  opacity: 1;
  transform: none;
  color: #fff;
  mix-blend-mode: normal;
  animation: clock-flash 1s steps(1, end) infinite;
}
.turn-label .lc {
  text-transform: none;
}
@keyframes clock-flash {
  50% {
    color: color-mix(in srgb, #fff 45%, transparent);
  }
}
.tag.my-turn {
  animation: turn-pulse 0.9s ease-in-out infinite alternate;
}
@keyframes turn-pulse {
  to {
    background-color: color-mix(in srgb, var(--c) 93%, black);
  }
}
.tag > .tag-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--c2);
  border-radius: 0 0 1.6rem 1.6rem;
  padding: 1.2rem;
  min-height: 6.018rem;
  overflow: hidden;
  transition: background 0.3s;
}
/* A score tag clips only top and bottom (where the rolling digits come and go):
   at the sides a wide number's sticker edge and shadow may reach past the panel.
   (overflow: clip, unlike clip-path, leaves the stickers' texture filter alone.) */
.tag-score > .tag-in {
  overflow-x: visible;
  overflow-y: clip;
}
/* (what a tag shows is redrawn too: the tag itself takes the pointer) */
.tag > .tag-in > * {
  pointer-events: none;
}
.b-top .tag {
  padding-top: env(safe-area-inset-top);
}
.b-bottom .tag {
  padding: 2rem 0.8rem 0;
  border-radius: 2.4rem 2.4rem 0 0;
}
.b-bottom .tag-score {
  padding-top: 2.6rem;
}
.b-bottom .tag-rules {
  padding-top: 0.8rem;
}
.b-bottom .tag > .tag-in {
  border-radius: 1.6rem 1.6rem 0 0;
  /* (the fill runs on down into the phone's home bar area, inside the tag's border, so
     the bottom of the screen is the tag's own filled card rather than a band of its
     border color) */
  padding-bottom: calc(1.2rem + var(--home-bar));
}
.tag-rules .txt {
  font-size: 1.6rem;
  line-height: 1.4;
  white-space: nowrap;
}
.tag-rules .icons {
  display: flex;
  align-items: center;
}
.tag-rules .icons > * + * {
  margin-left: -0.6rem;
}
button.tag-rules:active > .tag-in {
  filter: brightness(0.96);
}
.tag-score > .tag-in {
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  padding: 1.2rem 0.6rem;
  min-height: 10.71rem;
}
/* a name too long for one line takes a second, and the tag grows to fit it */
.tag-score .who {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  max-width: 100%;
  font-size: 1.6rem;
  line-height: 1.4;
  margin: -0.52rem 0;
  text-align: center;
  overflow-wrap: anywhere;
  overflow: hidden;
}
.score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.3rem;
  font-family: var(--round);
}
.score .digits {
  display: flex;
  justify-content: center;
  height: 3.5rem;
  align-items: center;
}
/* Each digit's box is padded out past its outline (the margins take the room
   back): while a digit rolls, Safari on iPhone draws it on a layer the size of
   its box, which would shave the sides off the outline. */
.score .digits .stk {
  font: 700 4.8rem/1 var(--round);
  letter-spacing: -0.144rem;
  --sw: 0.8rem;
  padding-inline: 0.6rem;
  margin-inline: -0.6rem calc(-0.6rem - 0.12rem);
  transform: rotate(2deg);
}
.score .digits .stk:nth-child(even) {
  transform: rotate(-2deg);
}
.score .digits .stk:last-child {
  margin-right: -0.6rem;
}
.score .digits.long .stk {
  font-size: 3.6rem;
}
.score .pts {
  font: 700 2rem/1 var(--round);
  letter-spacing: -0.06rem;
  --sw: 0.6rem;
  height: 1.4rem;
  display: flex;
  align-items: center;
}
/* spectators: each player's chance of winning, tucked into the top of their points
   (the numerals overlap its bottom edge), in the seat's light color inside an
   outline of its own color */
.tag-score .score {
  position: relative;
  z-index: 1;
}
.tag-score .odds {
  display: flex;
  justify-content: center;
  margin: -0.6rem 0 -1.1rem;
  --fill: var(--c2);
  --stroke: var(--c);
}
.tag-score .odds[hidden] {
  display: none;
}
.tag-score .odds .stk {
  font: 700 1.5rem/1 var(--round);
  letter-spacing: 0;
  --sw: 0.4rem;
  margin-right: 0.18rem;
}
/* the characters overlap leftmost on top, down to the % at the bottom; their
   layers stay inside the percent, which still sits under the points numerals */
.tag-score .odds {
  position: relative;
  z-index: 0;
}
.tag-score .odds .stk {
  position: relative;
  /* without a shadow of its own: one shadow falls from the whole percent (below),
     never from one character onto the next */
}
.tag-score .odds .stk::before {
  content: none;
}
.tag-score .odds {
  filter: drop-shadow(var(--shx, 0.3rem) var(--shy, 0.3rem) 0 var(--shadow));
}
.tag-score .odds .stk:nth-child(1) {
  z-index: 4;
}
.tag-score .odds .stk:nth-child(2) {
  z-index: 3;
}
.tag-score .odds .stk:nth-child(3) {
  z-index: 2;
}
.tag-score .odds .stk:nth-child(4) {
  z-index: 1;
}
/* the percent sways only a little, a third of the other stickers' idle drift */
.tag-score .odds .idle {
  animation-name: idle-soft;
}
@keyframes idle-soft {
  from {
    translate: calc(var(--ix, 0.08rem) * -0.35) calc(var(--iy, 0.1rem) * -0.35);
    rotate: calc(var(--ir, 1.5deg) * -0.35);
  }
  to {
    translate: calc(var(--ix, 0.08rem) * 0.35) calc(var(--iy, 0.1rem) * 0.35);
    rotate: calc(var(--ir, 1.5deg) * 0.35);
  }
}
/* the old score, scrolling out over the new one (see rollScore) */
/* the Spectate list: each player's name over their points, as stickers like the table's */
.watch-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  margin-bottom: 0.4rem;
}
/* a solo player's streak against Golfbot, at the end of their row: gray at zero, lit once it is running */
.watch-streak {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex: none;
  --fill: var(--gray);
  --stroke: var(--paper);
  opacity: 0.5;
  font: 800 2.2rem/1 var(--round);
}
.watch-streak.hot {
  --fill: var(--flame);
  --stroke: var(--flame-edge);
  opacity: 1;
}
.watch-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  color: var(--ink);
  --fill: var(--c);
  --stroke: var(--paper);
}
.watch-player .who {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.4rem;
}
.watch-player .score {
  flex-direction: row;
  align-items: flex-end;
  gap: 0.2rem;
  padding: 0;
}
.watch-player .score .digits {
  height: 3rem;
}
.watch-player .score .digits .stk {
  font-size: 3.4rem;
  --sw: 0.7rem;
}
.watch-player .score .digits.long .stk {
  font-size: 2.8rem;
}
.watch-player .score .pts {
  font-size: 1.5rem;
  --sw: 0.5rem;
}
.score:has(> .roll-out) {
  position: relative;
}
.score .digits.roll-out {
  position: absolute;
  pointer-events: none;
}
.score.bump .digits {
  animation: bump 0.5s var(--spring);
}
@keyframes bump {
  30% {
    transform: scale(1.3) rotate(-4deg);
  }
}
/* Each player's avatar peeks out from behind their score tag: above yours,
   below the opponent's. Colored and outlined like the points numerals. */
.tag-avatar {
  position: relative;
  z-index: -1;
  display: grid;
  place-items: center;
  --fill: var(--c);
  --stroke: var(--paper);
  pointer-events: none;
  rotate: -6deg;
}
.b-bottom .tag-avatar {
  margin: 0.4rem 0 -1.6rem;
}
/* Dark themes: the avatar and the points numerals take the avatar picker's
   look, a dark fill of the seat's color inside an outline of that color */
:root:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) :is(.tag-avatar, .tag-score .score, .watch-badge) {
  --fill: var(--c2);
  --stroke: var(--c);
}
/* the opponent sits across the table, so their avatar hangs upside down; the
   shadow offset flips with it so it still falls down-right on screen */
.b-top .tag-avatar {
  margin: -1rem 0 0;
  rotate: 174deg;
  --shx: -0.3rem;
  --shy: -0.3rem;
}
/* The gap kept under the opponent's avatar for the turn tooltip, which points
   up at them or down at the cycle button below (board.js) */
.turn-slot {
  flex: none;
  width: 100%;
  height: 3rem;
}
/* The streak and the cycle button share one row under the opponent's tag,
   side by side and a size down so both fit across the column */
.side-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  max-width: 100%;
}
/* a size down only when both share the row; on its own, either is full size */
.side-row:has(.cycle:not([hidden])) > .streak,
.side-row:has(> .streak:not([hidden])) .cycle:not([hidden]) {
  zoom: 0.72;
}
.side-row > .streak {
  margin-top: 0;
}
/* Solo: your win streak against Golfbot, under its score tag. A faded gray
   flame at zero; lit in full color with a glow that brightens as it grows. */
.streak {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin-top: 0.6rem;
  --fill: var(--gray);
  --stroke: var(--paper);
  opacity: 0.5;
  transition: opacity 0.4s;
  pointer-events: none;
}
.streak[hidden] {
  display: none;
}
.streak.hot {
  --fill: var(--flame);
  opacity: 1;
}
.streak .flame {
  display: grid;
}
.streak.hot :is(.flame, .score) {
  --stroke: var(--flame-edge);
}
.streak.hot .flame {
  /* two glows that both grow with the streak: a wide warm haze and a tight bright core */
  filter: drop-shadow(0 0 calc(0.3rem + var(--heat, 1) * 0.3rem) rgb(255 140 40 / calc(0.3 + var(--heat, 1) * 0.06)))
    drop-shadow(0 0 calc(var(--heat, 1) * 0.1rem) rgb(255 210 90 / calc(var(--heat, 1) * 0.07)));
  animation: flame-glow 1.6s ease-in-out infinite alternate;
}
@keyframes flame-glow {
  to {
    filter: drop-shadow(0 0 calc(0.45rem + var(--heat, 1) * 0.4rem) rgb(255 160 50 / calc(0.4 + var(--heat, 1) * 0.06)))
      drop-shadow(0 0 calc(var(--heat, 1) * 0.16rem) rgb(255 220 100 / calc(var(--heat, 1) * 0.08)));
  }
}
.streak .score {
  padding: 0;
}
.streak .score .digits {
  height: 3rem;
}
.streak .score .digits .stk {
  font-size: 3.8rem;
}
/* offline: marked in the corner of the tag, where it can't push the name onto a second line */
.tag-score.offline > .tag-in {
  position: relative;
}
.tag-score.offline > .tag-in::after {
  content: "⌁";
  position: absolute;
  top: 0.1rem;
  right: 0.6rem;
  font-size: 1.4rem;
  line-height: 1;
}
.cycle {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--ct);
  --fill: var(--c2);
  --stroke: var(--c);
  touch-action: none;
  max-width: 100%;
}
.cycle-wrap {
  position: relative;
  display: grid;
  justify-items: center;
  max-width: 100%;
}
/* the next player's name, set on an arc that hugs the bottom of the arrows */
.cycle-name {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12rem;
  height: 12rem;
  translate: -50% -50%;
  pointer-events: none;
}
.cycle-name svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
/* lettered like the arrows above: their pale fill inside their color, with
   the same drop shadow (in every theme) */
.cycle-name svg {
  filter: drop-shadow(0.15rem 0.15rem 0 var(--shadow));
}
.cycle-name text {
  font: 800 12px var(--text);
  letter-spacing: 0.16em;
  fill: var(--c2);
  stroke: var(--c);
  stroke-width: 3.2px;
  stroke-linejoin: round;
  paint-order: stroke fill;
  transition:
    fill 0.4s,
    stroke 0.4s;
}
/* the arrows turn once round each time the table moves on (board.js) */
.cycle-ico {
  display: grid;
}
.cycle .ico {
  transition: transform 0.45s var(--spring);
}
/* its color is the opponent it turns to: it fades from one to the next */
.cycle .ico path {
  transition:
    fill 0.4s,
    stroke 0.4s;
}
.cycle:active .ico {
  transform: scale(0.86);
}
/* Moving on to another opponent: their whole side of the table slides across
   as one page while a copy of the side being left (.board-ghost) slides off.
   Each fades and blurs a little with its distance from rest (board.js), so
   nothing is cut off at the table's edge; the cycle button stays where it is. */
.board-ghost {
  pointer-events: none;
}
.board-ghost > .b-top {
  will-change: translate, opacity, filter;
}
.board-ghost .cycle-wrap {
  visibility: hidden;
}
.b-top.sliding > .b-main,
.b-top.sliding > .b-side > :not(.side-row),
.b-top.sliding .side-row > :not(.cycle-wrap) {
  translate: var(--slide, 0) 0;
  opacity: var(--slide-opacity, 1);
  filter: var(--slide-blur, none);
  will-change: translate, opacity, filter;
}
.b-top.sliding .tag,
.b-top.sliding .tag > .tag-in {
  transition: none;
}
.hand {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}
.b-mid {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 1.6rem;
  /* on phones the piles sit a little left of center, leaving room beside the
     discard pile for End Turn / Confirm */
  padding: 0 2rem 0 0.8rem;
  flex: none;
  position: relative;
}
.pile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}
.pile-label {
  font-size: 1.6rem;
  line-height: 1.2rem;
  height: 1.2rem;
  color: var(--accent);
  white-space: nowrap;
}
.pile-area {
  position: relative;
  width: 12.39rem;
  height: 8.95rem;
}

/* ---------- cards ---------- */
.slot {
  position: relative;
  display: block;
  width: 8.822rem;
  height: 12.3rem;
  touch-action: none;
  outline-offset: 0.1rem;
  border-radius: 1.6rem;
  -webkit-touch-callout: none;
}
.hand .slot {
  width: 100%;
  height: auto;
  aspect-ratio: 88.22 / 123;
}
.pile-area .slot {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -6.15rem 0 0 -4.411rem;
}
.slot.under {
  pointer-events: none;
}
.pile-area .slot.held {
  margin: -6.6rem 0 0 -4.8rem;
  z-index: 2;
}
.slot.empty .card {
  visibility: hidden;
}
.slot.empty {
  pointer-events: none;
}
.card {
  position: absolute;
  inset: 0;
  transform: translate(var(--dx, 0px), var(--dy, 0px))
    rotate(calc(var(--rot, 0deg) + var(--lean, 0deg))) scale(var(--scale, 1));
  transform-style: preserve-3d;
  will-change: transform;
}
.card-flip {
  position: absolute;
  inset: 0;
  /* Redrawn whenever the card changes. A scroll or a press belongs to the
     card around it, which stays: browsers keep sending a trackpad's scroll to
     whatever it began on, and lose it if that has been replaced. */
  pointer-events: none;
  transform-style: preserve-3d;
  /* The perspective lives in the card's own transform, not on the slot: a
     perspective on the slot makes Safari depth-sort the slot's layers, so the
     card, its shadow and the drop-target outline (all at the same depth)
     flicker over one another instead of keeping their stacking order. */
  /* --face is the flip in motion (set on the slot while a card turns); at
     rest a card lies by --rest-face. Setting --face here instead would beat
     the slot's value and snap a card face-up without turning it over. */
  transform: perspective(60rem) rotateX(var(--rx, 0deg))
    rotateY(calc(var(--ry, 0deg) + var(--face, var(--rest-face, 180deg))));
}
.is-face > .card > .card-flip,
.card.is-face > .card-flip {
  --rest-face: 0deg;
}
.face {
  position: absolute;
  inset: -0.1rem;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: center / 100% 100% no-repeat;
  border-radius: 1.6rem;
}
.face.back {
  background-image: url(assets/card-back.png);
  transform: rotateY(180deg);
}
/* Night Golf: the same textured back, in the fairway's after-dark green */
:root[data-theme="night"] .face.back {
  background-image: url(assets/card-back-night.png);
}
/* Poker: the same textured back, in oxblood instead of fairway green */
:root[data-theme="poker"] .face.back {
  background-image: url(assets/card-back-poker.png);
}
/* Focus: the same back in grays */
:root[data-theme="focus"] .face.back {
  background-image: url(assets/card-back-focus.png);
}
.face.front {
  background-image: url(assets/card-face-black.png);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.2rem 0.9rem;
  --fill: var(--ink);
  --stroke: var(--paper);
}
.face.front.red {
  background-image: url(assets/card-face-red.png);
  color: var(--red);
  --fill: var(--red);
}
/* Dark themes: the same hand-drawn face turned inside out, a dark card with
   a light border, so a hand doesn't glare against the table. */
:root:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) .face.front {
  background-image: url(assets/card-face-black-dark.png);
}
:root:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) .face.front.red {
  background-image: url(assets/card-face-red-dark.png);
  color: #f08a86;
  --fill: #f08a86;
}
/* Focus: the red suits in its muted red */
:root[data-theme="focus"] .face.front.red {
  color: #c25e59;
  --fill: #c25e59;
}
/* Night Golf's borders are brighter, to stand out on its darker table */
:root[data-theme="night"] .face.front {
  background-image: url(assets/card-face-black-night.png);
}
:root[data-theme="night"] .face.front.red {
  background-image: url(assets/card-face-red-night.png);
}
/* High contrast cards (Settings): four suits, four colors. Diamonds turn
   orange and clubs blue, so no two suits share a color. */
:root.contrast-cards .face.front.suit-D {
  background-image: url(assets/card-face-orange.png);
  color: #e8782a;
  --fill: #e8782a;
}
:root.contrast-cards .face.front.suit-C {
  background-image: url(assets/card-face-blue.png);
  color: #3f7fd6;
  --fill: #3f7fd6;
}
:root.contrast-cards:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) .face.front.suit-D {
  background-image: url(assets/card-face-orange-dark.png);
  color: #f2a061;
  --fill: #f2a061;
}
:root.contrast-cards:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) .face.front.suit-C {
  background-image: url(assets/card-face-blue-dark.png);
  color: #7fb0f2;
  --fill: #7fb0f2;
}
:root.contrast-cards[data-theme="night"] .face.front.suit-D {
  background-image: url(assets/card-face-orange-night.png);
}
:root.contrast-cards[data-theme="night"] .face.front.suit-C {
  background-image: url(assets/card-face-blue-night.png);
}
/* The ripped 5 (the 5 of diamonds): the same face, torn across the middle.
   Its faces are made from the ordinary ones by tools/design/make_ripped_five.py
   (the torn edges carry that face's own border), so rerun it when the faces
   change. The face is drawn as two halves, each masked to its side of the
   tear, so the halves can come apart as the card turns over. */
.face.front.ripped {
  --rip-face: url(assets/card-face-red-ripped.png);
  /* the halves draw the face; the whole face behind them would fill the tear
     (and every theme's face rule outranks this one, hence !important) */
  background-image: none !important;
}
:root:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) .face.front.ripped {
  --rip-face: url(assets/card-face-red-dark-ripped.png);
}
:root[data-theme="night"] .face.front.ripped {
  --rip-face: url(assets/card-face-red-night-ripped.png);
}
:root.contrast-cards .face.front.ripped {
  --rip-face: url(assets/card-face-orange-ripped.png);
}
:root.contrast-cards:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) .face.front.ripped {
  --rip-face: url(assets/card-face-orange-dark-ripped.png);
}
:root.contrast-cards[data-theme="night"] .face.front.ripped {
  --rip-face: url(assets/card-face-orange-night-ripped.png);
}
.rip-half {
  position: absolute;
  inset: 0;
  background: var(--rip-face) center / 100% 100% no-repeat;
}
.rip-half.top {
  -webkit-mask: url(assets/ripped-five-top.svg) center / 100% 100% no-repeat;
  mask: url(assets/ripped-five-top.svg) center / 100% 100% no-repeat;
  transform-origin: 0% 55%; /* the tear starts at the left: it opens from there */
}
.rip-half.bottom {
  -webkit-mask: url(assets/ripped-five-bottom.svg) center / 100% 100% no-repeat;
  mask: url(assets/ripped-five-bottom.svg) center / 100% 100% no-repeat;
  transform-origin: 100% 45%;
}
/* the rank and suit ride on their own halves, above them */
.ripped > .corner {
  position: relative;
  z-index: 1;
}
/* layered like this, each part needs hiding on its own when the card is face
   down (the face's backface-visibility no longer covers them) */
.ripped > * {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
/* Turned face up: the halves start pressed together over the tear, pull
   apart a touch past where they rest, and settle. Small: it's a tear, not a
   card falling in two. (translate/rotate, so the corners keep their tilt.) */
.ripped.tearing > .rip-half.top,
.ripped.tearing > .rip-half + .rip-half + .corner {
  animation: tear-top 0.75s cubic-bezier(0.25, 0.9, 0.3, 1.25) 0.12s backwards;
}
.ripped.tearing > .rip-half.bottom,
.ripped.tearing > .corner + .corner {
  animation: tear-bottom 0.75s cubic-bezier(0.25, 0.9, 0.3, 1.25) 0.12s backwards;
}
@keyframes tear-top {
  from {
    translate: 0.3% 2.6%;
    rotate: 1.2deg;
  }
  45% {
    translate: -0.5% -0.9%;
    rotate: -1.6deg;
  }
}
@keyframes tear-bottom {
  from {
    translate: -0.3% -2.6%;
    rotate: 1.2deg;
  }
  45% {
    translate: 0.5% 0.9%;
    rotate: -1.4deg;
  }
}
.corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  width: 2.2rem;
  transform: rotate(1.4deg);
  /* (the stickers' rough edge, from the rough cut for its size; without their drop shadow) */
}
.corner + .corner {
  align-self: flex-end;
  transform: rotate(181.4deg);
}
.corner b {
  font: 700 2rem/0.72 var(--round);
  letter-spacing: -0.06rem;
  -webkit-text-stroke: 0.5rem var(--paper);
  paint-order: stroke fill;
}
/* The shadow is its own flat layer behind the card, so a tilting or flipping
   card can never dip through it. */
.shadow {
  position: absolute;
  inset: 0.3rem;
  border-radius: 1.4rem;
  background: rgb(20 60 10 / 0.26);
  opacity: max(var(--lift, 0), var(--rest, 0));
  transform: translate(
      calc(var(--dx, 0px) + var(--base, 0rem) + var(--lift, 0) * 0.5rem),
      calc(var(--dy, 0px) + var(--base, 0rem) + var(--lift, 0) * 1.4rem)
    )
    rotate(calc(var(--rot, 0deg) + var(--lean, 0deg)))
    scale(calc(var(--scale, 1) * 0.97));
  filter: blur(calc(0.12rem + var(--lift, 0) * 0.4rem));
  pointer-events: none;
}
.pile-area .slot {
  --rest: 0.8;
  --base: 0.3rem;
}
.slot.empty > .shadow,
.slot.incoming > .shadow {
  visibility: hidden;
}
.flyer > .shadow {
  --lift: 0.7;
}
/* sheen: a faint white highlight that slides across a tilted card */
.face::after {
  content: "";
  position: absolute;
  inset: 0.5rem;
  border-radius: 1.1rem;
  background: linear-gradient(
      112deg,
      transparent 32%,
      rgb(255 255 255 / 0.45) 50%,
      transparent 68%
    )
    no-repeat;
  background-size: 240% 100%;
  background-position: calc(50% + var(--sheen-x, 0) * 38%) 0;
  opacity: var(--sheen, 0);
  pointer-events: none;
}
.slot.dragging {
  z-index: 60;
}
.slot.dragging .card {
  cursor: grabbing;
}
.slot.returning {
  z-index: 55;
}
.slot.can-act {
  cursor: grab;
}
.slot.selected {
  --scale: 1.07;
  --lift: 0.8;
  --dy: -0.6rem;
}
.slot.selected::after {
  content: "";
  position: absolute;
  inset: -0.5rem;
  border-radius: 2rem;
  border: 0.4rem dashed var(--p1);
  animation: march 1.6s ease-in-out infinite alternate;
  /* the card's own transform, so the outline stays centered on it as it lifts */
  transform: translate(var(--dx, 0px), var(--dy, 0px))
    rotate(calc(var(--rot, 0deg) + var(--lean, 0deg))) scale(var(--scale, 1));
  pointer-events: none;
}
.slot.incoming .card {
  visibility: hidden;
}
/* drop targets shown while a drag (or a selection) is active */
.slot.target::before {
  content: "";
  position: absolute;
  inset: -0.6rem;
  border-radius: 2.2rem;
  border: 0.4rem dashed var(--p1);
  background: color-mix(in srgb, var(--p1) 14%, transparent);
  transform: translate(var(--dx, 0px), var(--dy, 0px))
    rotate(calc(var(--rot, 0deg) + var(--lean, 0deg))) scale(var(--scale, 1));
  animation: target-pulse 1.6s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 3;
}
.slot.target.hot::before {
  border-style: solid;
  border-color: var(--p3);
  background: rgb(255 203 32 / 0.3);
  animation: none;
  transform: translate(var(--dx, 0px), var(--dy, 0px))
    rotate(calc(var(--rot, 0deg) + var(--lean, 0deg))) scale(calc(var(--scale, 1) * 1.06));
}
.slot .move-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  padding: 0.3rem 0.9rem;
  border-radius: 1.4rem;
  background: var(--p1);
  color: #fff;
  font-size: 1.3rem;
  line-height: 1.4;
  text-align: center;
  z-index: 4;
  pointer-events: none;
  box-shadow: 0.2rem 0.2rem 0 var(--shadow);
  transition: transform 0.25s var(--spring);
}
.slot.target .move-label {
  transform: translate(-50%, -50%) scale(1);
}
.slot.target.hot .move-label {
  background: var(--p3);
  color: var(--p3t);
  transform: translate(-50%, -50%) scale(1.15);
}
/* the dashed outlines breathe, gently */
@keyframes target-pulse {
  to {
    opacity: 0.8;
  }
}
@keyframes march {
  to {
    filter: hue-rotate(12deg);
    opacity: 0.82;
  }
}
.flyer {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  perspective: 60rem;
}
.drag-note {
  position: fixed;
  z-index: 90;
  transform: translate(-50%, -100%);
  padding: 0.3rem 1rem;
  border-radius: 1.4rem;
  background: var(--p3);
  color: var(--p3t);
  font-size: 1.3rem;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0.2rem 0.2rem 0 var(--shadow);
}

/* ---------- board chrome ---------- */
.callout {
  position: absolute;
  left: var(--callout-x, 50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 38rem;
  padding: 0.5rem 1.2rem;
  border-radius: 1.6rem;
  background: var(--c);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0.25rem 0.25rem 0 var(--shadow);
  transition:
    top 0.45s var(--spring),
    left 0.45s var(--spring),
    background 0.3s;
}
.callout::after {
  content: "";
  position: absolute;
  left: var(--tip-x, 50%);
  margin-left: -0.8rem;
  border: 0.8rem solid transparent;
}
.callout.down::after {
  top: calc(100% - 0.1rem);
  border-top-color: var(--c);
  border-bottom: 0;
}
.callout.up::after {
  bottom: calc(100% - 0.1rem);
  border-bottom-color: var(--c);
  border-top: 0;
}
/* (a rule puzzle's hint under your prompt, the one rule in play: a second line, in a
   light tint of the tooltip's own color) */
.callout.hinted {
  flex-direction: column;
  gap: 0;
  text-align: center;
}
.callout-hint {
  font-size: 1.2rem;
  line-height: 1.25;
  color: color-mix(in srgb, var(--c) 30%, #fff);
}
/* "Their turn" can be tapped to go to their board */
.callout[data-goto] {
  pointer-events: auto;
  cursor: pointer;
}
.callout[data-goto]:active {
  scale: 0.94;
}
.callout.pop {
  animation: pop 0.4s var(--spring);
}
/* "Sign in to keep your stats", hanging under the settings gear */
.topbar {
  position: relative;
}
@keyframes pop {
  from {
    scale: 0.6;
    opacity: 0;
  }
}
/* Beside the discard pile: Confirm (controller) and, on phones, End Turn.
   Same sticker-over-label look as the desktop action bar. */
.pile-side {
  /* each side is a column centered on a line the same distance from its pile,
     so every button's symbol sits equally far out whatever its label's width */
  --out: 3.2rem;
  position: absolute;
  left: calc(100% + var(--out));
  top: 50%;
  z-index: 5;
  display: grid;
  justify-items: center;
  transform: translate(-50%, -50%);
}
/* (the go-fish pile's fanned cards overhang its box a little) */
.pile-side.left {
  left: auto;
  right: calc(100% + var(--out) + 0.45rem);
  transform: translate(50%, -50%);
}
.side-act {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--p1t);
  font-size: 1.4rem;
  line-height: 1.3;
  white-space: nowrap;
  --fill: var(--p1);
  --stroke: var(--paper);
  transition: transform 0.28s var(--spring);
  animation: pop 0.4s var(--spring);
}
/* (on felt the labels are read against a dark table, not a pale fairway) */
:root:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) .side-act {
  color: var(--on-bg);
}
/* Confirm and Undo are wanted the instant a move is staged */
.side-act[data-confirm],
.side-act[data-undo] {
  animation-duration: 0.16s;
}
.side-act .act-ico {
  display: grid;
  place-items: center;
  height: 4.6rem;
}
/* the table actions, up to two a side on phones: a little smaller, and only
   there while they can be used */
.pile-side {
  gap: 0.3rem;
}
.bar-act {
  font-size: 1.3rem;
}
.bar-act .act-ico {
  height: 3.5rem;
}
.side-act:disabled {
  opacity: 0.35;
  cursor: default;
}
.side-act:active {
  transform: scale(0.9);
  transition-duration: 0.08s;
}
.side-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.act.side-act .pad-key {
  height: 2rem;
}
.board-btns {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}
/* the Quickplay sparkle is a little badge on the gear's top corner, so it never
   makes the column taller (pushing the action bar off the screen) and the
   turn tooltip above the hand never covers it */
.b-bottom .b-side {
  position: relative;
}
.board-extra {
  position: absolute;
  top: -0.8rem;
  left: calc(50% + 0.9rem);
  z-index: 21;
}
.board-extra .icon-btn.queue {
  --fill: var(--p3);
  --stroke: var(--p3-edge);
  width: 3.2rem;
  height: 3.2rem;
  animation: pop 0.4s var(--spring);
}
.actionbar {
  display: none;
}

/* ---------- controller ---------- */
/* The cursor glides between whatever can be pressed. */
#pad-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 400;
  box-sizing: border-box;
  border: 0.4rem solid var(--paper);
  border-radius: 2rem;
  box-shadow:
    0 0 0 0.3rem var(--ink),
    0.4rem 0.4rem 0 0.3rem var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.16s cubic-bezier(0.3, 1, 0.4, 1),
    width 0.16s cubic-bezier(0.3, 1, 0.4, 1),
    height 0.16s cubic-bezier(0.3, 1, 0.4, 1),
    border-radius 0.16s,
    opacity 0.15s;
}
#pad-cursor.on {
  opacity: 1;
}
#pad-cursor.jump {
  transition: opacity 0.15s;
}
:root.pad,
:root.pad * {
  cursor: none;
}
/* A controller button, drawn as its SF Symbol in the labels of the controller
   in hand (A/B/X/Y, cross/circle/square/triangle, or Nintendo's B/A/Y/X).
   Shown only while a controller is connected. */
.pad-key {
  display: none;
  align-items: center;
  justify-content: center;
  flex: none;
  height: 2.6rem;
  font: inherit;
  --fill: var(--ink);
  --stroke: var(--paper);
}
:root.pad-on .pad-key {
  display: inline-flex;
}
.pad-key .ico.pad-ico {
  width: auto !important;
  height: 100% !important;
  margin: 0 !important;
}
/* a quick action: the button that presses this control, just left of its words */
.pad-tag {
  height: 1.15em;
  margin-right: 0.45em;
  vertical-align: -0.2em;
  pointer-events: none;
}
/* a button that is only an icon: the glyph hangs off the bottom of the icon, on top */
.pad-tag.under {
  position: absolute;
  left: 50%;
  bottom: -1rem;
  z-index: 2;
  height: 2.8rem;
  margin: 0;
  translate: -50% 0;
}
.icon-btn {
  position: relative;
}
.icon-btn .pad-tag.under {
  bottom: -0.2rem;
}
/* With a controller, Back stays on screen instead of scrolling away with the page */
:root.pad-on .page {
  /* the entrance animation must not linger: a held transform would pin the button inside the page */
  animation-fill-mode: backwards;
  --page-w: 48rem;
}
:root.pad-on .page.scroll {
  --page-w: 76rem;
}
:root.pad-on .nav-float {
  position: fixed;
  z-index: 60;
  /* where it sat in the page's own column, measured from the window */
  left: calc(max(0px, (100% - var(--page-w)) / 2) + 1.6rem);
  box-shadow: 0.3rem 0.3rem 0 var(--shadow);
}
:root.pad-on .topbar > .nav-float {
  top: calc(max(1.6rem, env(safe-area-inset-top)) + 0.65rem);
}
:root.pad-on .topbar:has(> .nav-float) {
  padding-left: 5.2rem;
}
:root.pad-on .row > .nav-float {
  bottom: max(1.6rem, env(safe-area-inset-bottom));
}
:root.pad-on .row:has(> .nav-float) {
  padding-left: 8rem;
}
/* Sheets keep just their Close button in reach while they scroll; the title
   scrolls away with everything else. The head steps aside (display: contents)
   so the button can stick against the whole sheet, not only the head. */
/* On every sheet, Close floats at the top right and stays there as the sheet
   scrolls under it. */
.sheet .sheet-head {
  display: contents;
}
.sheet .sheet-head > h2 {
  float: left;
  max-width: calc(100% - 9rem);
  margin-bottom: 1.4rem;
}
.sheet .sheet-head > .close-btn {
  float: right;
  position: sticky;
  top: 0; /* measured inside the sheet's padding: it stays where it already sits */
  z-index: 5;
  margin: 0 0 1.4rem 1rem;
}
/* a line under a sheet's title: the rules sheet's modifier count */
.sheet-head h2 .sheet-sub {
  display: block;
  margin-top: 0.4rem;
  font: 700 1.5rem/1.3 var(--text);
  opacity: 0.75;
}
.sheet .sheet-head + * {
  clear: both;
}
.pad-help {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem 1.2rem;
  align-items: center;
  font-size: 1.4rem;
}
.pad-help .keys {
  display: flex;
  gap: 0.4rem;
}
.emote-pop {
  position: absolute;
  left: 7rem;
  bottom: 12rem;
  /* over every card, one lifted off the table too (.slot.dragging is 60) */
  z-index: 70;
  display: flex;
  gap: 0.6rem;
  padding: 0.8rem;
  border: 0.4rem solid var(--ink);
  border-radius: 2.4rem;
  background: var(--paper);
  box-shadow: 0.3rem 0.3rem 0 var(--shadow);
  animation: pop 0.3s var(--spring);
  transform-origin: 0 100%;
}
.emote-pop button {
  width: 5.2rem;
  height: 5.2rem;
  /* concentric with the panel (2.4rem outside, 0.4rem border, 0.8rem padding),
     so the controller cursor's ring follows the panel's own inner curve */
  border-radius: 1.2rem;
  display: grid;
  place-items: center;
  transition: transform 0.25s var(--spring);
  --fill: var(--paper);
  --stroke: var(--ink);
}
/* (only with a real pointer: on a touch screen the tilt would catch the drag
   meant to scroll the sayings, and stay stuck after a tap) */
@media (hover: hover) and (pointer: fine) {
  .emote-pop button:hover {
    transform: scale(1.15) rotate(-5deg);
  }
}
.emote-pop img {
  width: 4.6rem;
  height: 4.6rem;
  object-fit: contain;
}
.emote-pop {
  flex-direction: column;
}
.emote-row {
  display: flex;
  gap: 0.6rem;
}
/* the faces and the bell: on a narrow phone the menu keeps inside the screen
   (it starts 7rem in) and the buttons shrink to fit, staying square */
.emote-pop:not(.summary-emotes) {
  max-width: calc(100vw - 8.2rem);
}
/* with sayings to show it keeps the width of four and a half faces and the bell,
   however few faces are on it (the sayings take the faces' width); the bell keeps to the end */
.emote-pop:not(.summary-emotes):has(.emote-word) {
  min-width: min(33.2rem, calc(100vw - 8.2rem));
}
.emote-row > [data-emote-mute] {
  margin-left: auto;
}
.emote-row button {
  flex: 0 1 5.2rem;
  width: auto;
  min-width: 0;
  /* (the faces' large images would otherwise stretch the menu to its widest) */
  max-width: 5.2rem;
  height: auto;
  aspect-ratio: 1;
}
/* the faces: a strip that scrolls sideways, four and a half faces wide (4 faces,
   their 4 gaps and half a face), the half fading out to show there are more */
.emote-faces {
  display: flex;
  gap: 0.6rem;
  flex: 0 1 auto;
  min-width: 0;
  max-width: calc(4.5 * 5.2rem + 4 * 0.6rem + 0.6rem);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  touch-action: pan-x;
  /* (room for a face's tilt and its controller ring, taken back by the margin) */
  padding: 0.3rem;
  margin: -0.3rem;
  /* (a short fade at its very edge, hinting at more) */
  mask-image: linear-gradient(to right, #000 calc(100% - 1.2rem), transparent);
}
.emote-faces.at-end {
  mask-image: none;
}
.emote-faces::-webkit-scrollbar {
  display: none;
}
.emote-faces > button {
  flex: none;
  width: 5.2rem;
  max-width: none;
  scroll-snap-align: start;
}
.emote-row img {
  width: 88%;
  height: 88%;
}
/* the text emotes: two rows of short sayings under the faces, scrolling sideways
   (it takes the faces' width and never widens the pop-up itself) */
.emote-words {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 0;
  min-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  touch-action: pan-x;
  padding: 0.3rem 0.4rem 0.6rem 0.2rem;
  margin: -0.3rem -0.4rem -0.6rem -0.2rem;
  /* the last saying fades at the edge, so it reads as more to scroll to */
  mask-image: linear-gradient(to right, #000 calc(100% - 1.2rem), transparent);
}
.emote-words.at-end {
  mask-image: none;
}
/* turned over with a mouse wheel (see the wheel listener in board.js), the strips go
   exactly as far as the wheel says: snapping would pull a small step back */
:root.wheeled .emote-faces,
:root.wheeled .emote-words {
  scroll-snap-type: none;
}
.emote-words::-webkit-scrollbar {
  display: none;
}
.emote-words-row {
  display: flex;
  gap: 0.6rem;
  width: max-content;
}
.emote-words-row > .emote-word {
  flex: none;
  scroll-snap-align: start;
}
.emote-pop button.emote-word {
  width: auto;
  height: 4rem;
  padding: 0 0.8rem;
  border: 0.3rem solid color-mix(in srgb, var(--ink) 25%, var(--paper));
  border-radius: 1.2rem;
  color: var(--ink);
  font: 700 1.5rem/1 var(--text);
  white-space: nowrap;
}
/* (only with a real pointer: a tap would leave it stuck mid-tilt under the finger) */
@media (hover: hover) and (pointer: fine) {
  .emote-pop button.emote-word:hover {
    transform: scale(1.06) rotate(-2deg);
  }
}
/* Settings > Theme: a row for each theme, wearing that theme's own color tokens
   (app.js puts them on it), so every color here is the theme's and not the one in
   use: six tall swatches (its four player colors, its text on white, its table),
   then its name on a pill, with a check on the one chosen. */
.theme-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.theme-choice {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fw-text);
  font: 700 2rem/1.2 var(--text);
  text-align: left;
  transition: transform 0.28s var(--spring);
}
.theme-choice:active {
  transform: scale(0.97);
}
.theme-swatches {
  flex: none;
  display: flex;
  gap: 0.4rem;
}
.theme-swatches i {
  width: 1.9rem;
  min-height: 6.4rem;
  /* (the same stroke as the name's button beside them) */
  border: 0.4rem solid var(--sw-edge);
  border-radius: 99rem;
  background: var(--sw-fill);
}
.theme-swatches .ts-p1 { --sw-edge: var(--p1); --sw-fill: var(--p1b); }
.theme-swatches .ts-p2 { --sw-edge: var(--p2); --sw-fill: var(--p2b); }
.theme-swatches .ts-p3 { --sw-edge: var(--p3); --sw-fill: var(--p3b); }
.theme-swatches .ts-p4 { --sw-edge: var(--p4); --sw-fill: var(--p4b); }
.theme-swatches .ts-text { --sw-edge: var(--ink); --sw-fill: var(--paper); }
.theme-swatches .ts-bg { --sw-edge: var(--fw); --sw-fill: var(--bg); }
/* the name: a pill in the theme's own green */
.theme-name {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem 0.6rem 1.6rem;
  border: 0.4rem solid var(--fw);
  border-radius: 2.4rem;
  background: var(--fw3);
  --fill: var(--fw);
  --stroke: var(--paper);
}
.theme-choice[aria-checked="true"] .theme-name {
  box-shadow: 0.3rem 0.3rem 0 var(--shadow);
}
/* a theme its flag holds back: there to see, greyed out, with the flag that unlocks it
   and a lock on the right */
.theme-choice.locked {
  opacity: 0.55;
  filter: grayscale(1);
  cursor: default;
}
.theme-choice.locked .theme-name > .ico {
  margin-left: auto;
  --fill: var(--paper);
  --stroke: var(--ink);
}
.theme-choice.locked:active {
  transform: none;
}
/* (a locked theme goes unnamed: just the flag that unlocks it) */
.theme-choice .theme-flag {
  display: block;
  font: 700 1.3rem/1.25 var(--text);
}
.theme-name > .ico {
  flex: none;
}
/* Settings > Emotes: the bar as it stands, drawn like the bar itself, over the
   emotes left off it. One chosen on the bar is lifted, and wears an x that
   takes it off. */
/* the bar, then the emotes left off it (told apart by their frames alone) */
.emote-edit {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
/* (a little apart from the faces above it) */
.emote-edit.words {
  margin-top: 1.4rem;
}
.emote-choices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  /* (room for one row even when empty, so the box never collapses) */
  min-height: 7.6rem;
  padding: 0.8rem;
  border: 0.4rem dashed color-mix(in srgb, var(--c) 45%, transparent);
  border-radius: 2.4rem;
}
.emote-choices.bar {
  position: relative;
  /* (room above for its name, which sits on the frame, and inside so the emotes clear it) */
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border: 0.4rem solid var(--ink);
  background: var(--paper);
  box-shadow: 0.3rem 0.3rem 0 var(--shadow);
}
/* the bar's name on its top edge, written like a field's label: the box's
   own fill inside an outline of its frame */
.emote-bar-name {
  position: absolute;
  left: 2rem;
  top: -1.45rem;
  font: 700 1.6rem/1.4 var(--text);
  color: var(--paper);
  -webkit-text-stroke: 0.5rem var(--ink);
  paint-order: stroke fill;
  white-space: nowrap;
  pointer-events: none;
}
.emote-edit.words .emote-choices {
  min-height: 6.4rem;
}
.emote-none {
  padding: 0 0.8rem;
  font: 700 1.5rem/1.3 var(--text);
  color: var(--c);
}
.emote-choices.bar .emote-none {
  color: color-mix(in srgb, var(--ink) 55%, var(--paper));
}
/* (each box keeps its note for when it is empty; beside an emote it goes) */
.emote-choices:has(.emote-item) .emote-none {
  display: none;
}
.emote-edit {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.emote-item {
  position: relative;
  display: grid;
}
/* carried: over everything, lifted off the page, and never in the pointer's way */
.emote-item.dragging {
  z-index: 5;
  pointer-events: none;
}
.emote-item.dragging .emote-choice {
  transform: scale(1.15) rotate(-5deg);
  filter: drop-shadow(0.3rem 0.5rem 0 var(--shadow));
}
.emote-choice {
  width: 5.2rem;
  height: 5.2rem;
  border-radius: 1.2rem;
  display: grid;
  place-items: center;
  cursor: grab;
  transition: transform 0.25s var(--spring);
}
.emote-choice img {
  width: 88%;
  height: 88%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}
/* the faces keep to one row, as on the bar: on a narrow phone they shrink to fit */
.emote-edit.faces .emote-choices {
  flex-wrap: nowrap;
}
.emote-edit.faces .emote-item {
  flex: 0 1 5.2rem;
  min-width: 0;
}
.emote-edit.faces .emote-choice {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}
.emote-choice.emote-word {
  width: auto;
  height: 4rem;
  padding: 0 0.8rem;
  border: 0.3rem solid color-mix(in srgb, var(--ink) 25%, var(--paper));
  background: var(--paper);
  color: var(--ink);
  font: 700 1.5rem/1 var(--text);
  white-space: nowrap;
}
.emote-choice[aria-pressed="true"] {
  transform: scale(1.12) rotate(-5deg);
  outline: 0.4rem solid var(--p1);
  outline-offset: 0.1rem;
}
.emote-remove {
  position: absolute;
  top: -1.4rem;
  right: -1.4rem;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  --fill: var(--p2);
  --stroke: var(--paper);
  animation: pop 0.25s var(--spring);
  transition: transform 0.28s var(--spring);
}
/* (a bigger target than the sticker itself) */
.emote-remove::before {
  content: "";
  position: absolute;
  inset: -0.5rem;
}
.emote-remove:active {
  transform: scale(0.85);
}
/* a text emote as it is shown: a speech-bubble sticker */
.emote-say {
  display: block;
  padding: 0.8rem 1.4rem;
  border: 0.4rem solid var(--ink);
  border-radius: 2rem;
  background: var(--paper);
  color: var(--ink);
  font: 700 2rem/1.1 var(--text);
  white-space: nowrap;
  box-shadow: 0.3rem 0.3rem 0 var(--shadow);
}
.player-emote.other .emote-say {
  padding: 0.4rem 0.8rem;
  border-width: 0.3rem;
  font-size: 1.5rem;
  box-shadow: none;
}
.player-emote.tile .emote-say {
  padding: 0.4rem 0.9rem;
  border-width: 0.3rem;
  font-size: 1.4rem;
}
.player-emote {
  position: absolute;
  /* reactions show over the results too */
  z-index: 87;
  display: grid;
  justify-items: center;
  pointer-events: none;
  animation: emote 4s both;
}
.player-emote img {
  width: 7.2rem;
  height: 7.2rem;
  object-fit: contain;
  filter: drop-shadow(0.3rem 0.3rem 0 var(--shadow));
}

.player-emote.me {
  left: 10rem;
  bottom: 9rem;
}
.player-emote.them {
  right: 10rem;
  top: 9rem;
}
/* A player whose side of the table is not showing reacts from the cycle
   button that leads to them: a white tooltip with their avatar and name in
   their own color, its arrow pointing back at the button. */
.cycle-emotes {
  position: absolute;
  right: calc(100% + 1.2rem);
  top: 2.2rem;
  translate: 0 -50%;
  display: grid;
  justify-items: end;
  gap: 3.2rem; /* the emotes stand taller than their tooltips */
  pointer-events: none;
}
.player-emote.other {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.5rem 0.8rem 0.5rem 1rem;
  border-radius: 1.6rem;
  background: var(--paper);
  color: var(--c);
  font-size: 1.4rem;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: 0.25rem 0.25rem 0 var(--shadow);
  transform-origin: 100% 50%;
}
/* A spectator's emote, on behalf of the player they watch: a speech bubble in
   that player's color, its tail pointing at the screen edge it glides in from:
   the left for the hand at the bottom of the screen, the right for anyone
   across the table. It eases in, rests, then drifts back out and fades. */
.spectator-emote {
  /* pinned to the screen, not the board: its edge is the screen's edge at every size */
  position: fixed;
  z-index: 87;
  display: flex;
  align-items: center;
  padding: 0.3rem 1.1rem;
  /* the player's color inside a thick paper rim, like the stickers': white on
     Original, each theme's own paper elsewhere */
  border: 0.45rem solid var(--paper);
  border-radius: 1.5rem;
  background: var(--c);
  color: #fff;
  white-space: nowrap;
  box-shadow: 0.25rem 0.25rem 0 var(--shadow);
  pointer-events: none;
}
/* near the edge: the tail starts inside the 0.45rem rim and reaches 1.05rem
   out, so 0.6rem in would put its tip at the edge; a few pixels more keep it clear */
.spectator-emote.from-left {
  left: 0.9rem;
  top: 38%;
  transform-origin: 0 50%;
  animation: spectator-in-left 4s both;
}
.spectator-emote.from-right {
  right: 0.9rem;
  top: 36%;
  transform-origin: 100% 50%;
  animation: spectator-in-right 4s both;
}
/* the tail: a paper triangle, with the player's color inside it */
.spectator-emote::before,
.spectator-emote::after {
  content: "";
  position: absolute;
  top: 50%;
  border: solid transparent;
}
.spectator-emote::before {
  margin-top: -1rem;
  border-width: 1rem;
}
.spectator-emote::after {
  margin-top: -0.5rem;
  border-width: 0.5rem;
}
.spectator-emote.from-left::before {
  right: calc(100% + 0.05rem);
  border-right-color: var(--paper);
  border-left: 0;
}
.spectator-emote.from-left::after {
  right: calc(100% - 0.05rem);
  border-right-color: var(--c);
  border-left: 0;
}
.spectator-emote.from-right::before {
  left: calc(100% + 0.05rem);
  border-left-color: var(--paper);
  border-right: 0;
}
.spectator-emote.from-right::after {
  left: calc(100% - 0.05rem);
  border-left-color: var(--c);
  border-right: 0;
}
.spectator-emote img {
  /* a size up, spilling a little past the bubble's top and bottom (with room either side) */
  width: 4.6rem;
  height: 4.6rem;
  margin: -1rem 0;
  object-fit: contain;
  filter: drop-shadow(0.15rem 0.15rem 0 var(--shadow));
}
/* wider screens: the bubbles sit just outside the board's own edges (measured in
   board.js), not out at the screen's; where there's no room beside the board they
   stay on screen */
/* the spectator's name only shows on wide screens, lettered in the player's paler color */
.spectator-name {
  display: none;
}
@media (min-width: 700px) {
  .spectator-name {
    display: block;
    max-width: 14rem;
    margin-left: 0.7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--c2);
    font: 700 1.4rem/1.1 var(--text);
  }
  /* each spectator has their own row, so several can cheer at once */
  .spectator-emote.from-left,
  .spectator-emote.from-right {
    top: calc(18% + var(--slot, 0) * 7.4rem);
  }
  .spectator-emote.from-left {
    left: auto;
    right: min(calc(100vw - var(--board-l, 0px) + 1.4rem), calc(100vw - 9rem));
  }
  .spectator-emote.from-right {
    right: auto;
    left: min(calc(var(--board-r, 100vw) + 1.4rem), calc(100vw - 9rem));
  }
}
/* phones: the bubbles sit a few pixels from the screen edge, their tails tucked past it */
@media (max-width: 699px) {
  .spectator-emote.from-left {
    left: 0.5rem;
  }
  .spectator-emote.from-right {
    right: 0.5rem;
  }
}
.spectator-say {
  font: 700 1.5rem/1.1 var(--text);
}
@keyframes spectator-in-left {
  0% {
    translate: calc(-100% - 1.6rem) 0;
    scale: 0.85;
    opacity: 0;
    animation-timing-function: cubic-bezier(0.22, 1.2, 0.36, 1);
  }
  14% {
    translate: 0 0;
    scale: 1;
    opacity: 1;
  }
  84% {
    translate: 0 0;
    scale: 1;
    opacity: 1;
    animation-timing-function: cubic-bezier(0.55, 0, 0.75, 0.2);
  }
  100% {
    translate: calc(-60% - 1.6rem) 0;
    scale: 0.92;
    opacity: 0;
  }
}
@keyframes spectator-in-right {
  0% {
    translate: calc(100% + 1.6rem) 0;
    scale: 0.85;
    opacity: 0;
    animation-timing-function: cubic-bezier(0.22, 1.2, 0.36, 1);
  }
  14% {
    translate: 0 0;
    scale: 1;
    opacity: 1;
  }
  84% {
    translate: 0 0;
    scale: 1;
    opacity: 1;
    animation-timing-function: cubic-bezier(0.55, 0, 0.75, 0.2);
  }
  100% {
    translate: calc(60% + 1.6rem) 0;
    scale: 0.92;
    opacity: 0;
  }
}
.player-emote.other::after {
  content: "";
  position: absolute;
  left: calc(100% - 0.1rem);
  top: 50%;
  margin-top: -0.8rem;
  border: 0.8rem solid transparent;
  border-left-color: var(--paper);
  border-right: 0;
}
.player-emote.other img {
  width: 6.4rem;
  height: 6.4rem;
  margin: -1.5rem 0;
}
.emote-who {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  --fill: var(--c);
  --stroke: var(--paper);
}
.emote-who b {
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: inherit;
}
@keyframes emote {
  0% {
    transform: scale(0) rotate(-20deg);
  }
  8% {
    transform: scale(1.25) rotate(6deg);
  }
  14%,
  88% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
  100% {
    transform: scale(0.6) translateY(-2rem);
    opacity: 0;
  }
}
.summary {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 86;
  width: 36rem;
  max-width: calc(100vw - 1.6rem);
  max-height: 92%;
  overflow: auto;
  transform: translate(-50%, -50%);
  box-shadow:
    0.4rem 0.4rem 0 var(--shadow),
    0 0 0 200vmax var(--scrim);
  animation: summary-in 0.5s var(--spring) both;
}
.summary .row {
  align-items: center;
}
/* "Updated to 1.3": a small chip above the main buttons, leading to the notes */
.chip.patch-chip {
  flex: none;
  align-self: center;
  display: inline-flex;
  gap: 0.6rem;
  min-height: 0;
  padding: 0.5rem 1.2rem;
  border-width: 0.3rem;
  border-radius: 2rem;
  font-size: 1.4rem;
  animation: pop 0.45s var(--spring) both;
}
/* leaving Practice as a guest: the Leave sticker, then a wide Sign in */
.leave-dialog .dialog-actions.signin-actions {
  flex-wrap: nowrap;
  align-items: center;
  gap: 1.6rem;
}
.dialog-actions.signin-actions .btn {
  flex: 1 1 auto;
}
/* a dialog's dismiss x: a sticker sitting right on its top right corner, like
   the toast's (a size up), in the dialog's colors */
.leave-dialog {
  position: relative;
  overflow: visible;
}
/* the notes of a new patch, the first time it is opened: a sheet, its "New update" pill
   over the title, and Start golfing! at the end of the notes */
.patch-sheet .sheet-head h2 .pill {
  display: table;
  margin-bottom: 0.4rem;
  font-size: 1.4rem;
}
.patch-sheet .patch-notes p {
  margin: 0.5rem 0;
}
.patch-sheet .patch-start {
  width: 100%;
  margin-top: 1.6rem;
}
.dialog-x {
  position: absolute;
  top: -1.5rem;
  right: -1.5rem;
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  cursor: pointer;
  /* the dialog's own colors: its fill inside its border color */
  --fill: var(--c2);
  --stroke: var(--c);
  transition: transform 0.28s var(--spring);
}
.dialog-x:active {
  transform: scale(0.85);
  transition-duration: 0.08s;
}
.summary .close-btn {
  padding: 0 0.6rem;
}
/* the results panel's three stickers, spread edge to edge */
.summary-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.4rem 0.8rem 0;
}
/* the move that starts the next game: a full button between Quit and View */
.summary-actions .summary-main {
  flex: 1;
  min-width: 0;
  justify-content: center;
  white-space: nowrap;
}
/* a longer label ("Accept rematch"): smaller, on two lines set left beside its
   icon, inside the button */
.summary-actions .summary-main.two-line {
  padding-block: 0.6rem;
  font-size: 1.7rem;
  line-height: 1.1;
  text-align: left;
}
.summary-actions .summary-main:disabled {
  opacity: 0.6;
}
.summary-actions .close-btn:disabled {
  opacity: 0.6;
  transform: none;
}
@keyframes summary-in {
  from {
    transform: translate(-50%, -50%) scale(0.5) rotate(-4deg);
    opacity: 0;
  }
}
.summary h2 {
  font-size: 2.4rem;
  text-align: center;
}
/* a redraw (someone readies up) picks the animations up where they were */
.summary {
  animation-delay: var(--t, 0s);
}
/* "You Win!" / "You Lose": sticker letters with a mood of their own */
.result-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin: 0.2rem 0 0.2rem;
}
.result-title .word {
  display: flex;
  align-items: flex-end;
  padding-top: 0.6rem;
  font: 700 5rem/1 var(--round);
  letter-spacing: -0.03em;
  --sw: 1rem;
  --stroke: var(--paper);
}
.result-title .gap {
  width: 1.4rem;
}
/* a puzzle's verdict: the piece before the word, popping in just ahead of its letters */
.result-title .result-ico {
  display: grid;
  align-self: center;
  margin-right: 0.8rem;
}
.result-title .result-ico.right {
  margin: 0 0 0 0.8rem;
}
.result-title .result-ico {
  animation: win-pop 0.55s var(--spring) both;
  animation-delay: var(--t, 0s);
}
.result-title .stk {
  margin: 0 0.02em;
  transform-origin: 50% 100%;
  /* on their own layer throughout, like the other idle stickers: otherwise
     Safari repaints slow drift in whole-pixel steps */
  will-change: transform, translate, rotate, scale;
}
.result-title.win {
  --fill: var(--p3);
}
.result-title.lose {
  --fill: var(--sad);
}
.result-title.draw {
  --fill: var(--fw);
}
.result-title small {
  font: 1.4rem/1.2 var(--text);
  color: var(--ct);
  opacity: 0.8;
}
/* the slumped letters sit lower, so give them room above the line under them */
.result-title.lose small {
  margin-top: 0.9rem;
}
/* winning: the letters spring in, hop three times and ease out to one end of
   the idle sway, all in one animation; the idle then carries on from that end
   (alternate-reverse starts at its "to" pose). The single hand-off happens
   where the letter is momentarily still, so nothing jumps. */
.result-title.win .stk {
  animation:
    win-pop 0.55s var(--spring) both,
    win-hop 3s ease-in-out,
    idle var(--idle-d, 5s) ease-in-out infinite alternate-reverse;
  animation-delay:
    calc(var(--i) * 60ms + var(--t, 0s)),
    calc(var(--i) * 70ms + 0.55s + var(--t, 0s)),
    calc(var(--i) * 70ms + 3.55s + var(--t, 0s));
}
@keyframes win-pop {
  from {
    transform: scale(0) rotate(-24deg);
  }
}
@keyframes win-hop {
  0%,
  16.67%,
  33.33%,
  50% {
    translate: 0 0;
    rotate: 0deg;
    scale: 1;
  }
  8.33%,
  25%,
  41.67% {
    translate: 0 -0.4rem;
    rotate: calc(var(--sag) * 0.6);
    scale: 1.05;
  }
  100% {
    translate: var(--ix, 0.08rem) var(--iy, 0.1rem);
    rotate: var(--ir, 1.5deg);
    scale: 1;
  }
}
/* losing: the letters arrive, drop and slump, then sag slowly where they fell */
.result-title.lose .stk {
  transform: translateY(0.5rem) rotate(var(--sag));
  animation:
    lose-drop 1.4s ease-in-out both,
    lose-sag 2.8s ease-in-out infinite alternate;
  animation-delay:
    calc(var(--i) * 80ms + var(--t, 0s)),
    calc(var(--i) * 150ms + 1.5s + var(--t, 0s));
}
@keyframes lose-drop {
  0% {
    transform: translateY(-1.6rem) rotate(0deg);
    opacity: 0;
  }
  25% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  55% {
    transform: translateY(0.8rem) rotate(var(--sag));
  }
  72% {
    transform: translateY(0.35rem) rotate(calc(var(--sag) * 0.6));
  }
  100% {
    transform: translateY(0.5rem) rotate(var(--sag));
  }
}
@keyframes lose-sag {
  to {
    translate: 0 0.3rem;
    rotate: calc(var(--sag) * 0.5);
  }
}
.result-title.draw .stk {
  animation:
    win-pop 0.55s var(--spring) both,
    idle var(--idle-d, 5s) ease-in-out infinite alternate;
  animation-delay:
    calc(var(--i) * 60ms + var(--t, 0s)),
    calc(var(--i) * 60ms + 0.6s + var(--t, 0s));
}
/* Results after a game: the verdict and the graph float over the dimmed table,
   with only the player tiles and buttons on the green panel underneath */
.summary.floating {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  /* phones: nearly the full screen width (the table itself scales with the
     screen height, so a fixed width would leave wide empty margins) */
  width: calc(100vw - 2.4rem);
  max-width: 50rem;
  /* when it has to scroll, it scrolls the whole height of the screen, so the
     results slide off at the screen's own edges rather than being cut off in
     mid-air; its padding keeps them clear of the notch and home bar */
  max-height: 100%;
  padding: calc(env(safe-area-inset-top) + 0.6rem) 0 calc(env(safe-area-inset-bottom) + 1rem);
  box-shadow: none;
}
/* one even dim over the whole table, behind the floating pieces */
.summary-scrim {
  position: fixed;
  inset: 0;
  /* above everything on the table, lifted (60) and flying (80) cards included */
  z-index: 85;
  background: var(--scrim);
  -webkit-backdrop-filter: var(--scrim-blur);
  backdrop-filter: var(--scrim-blur);
  animation: scrim-in 0.4s ease-out both;
  animation-delay: var(--t, 0s);
}
@keyframes scrim-in {
  from {
    opacity: 0;
  }
}
.summary-panel {
  box-shadow: 0.4rem 0.4rem 0 var(--shadow);
}
/* the quick emotes under the results: a green tab tucked under the bottom of
   the ready-up card, in the card's own colors, that drops them down */
/* holds the tab, and the emotes below it; it only lays them out, so taps go
   through it to the tab tucked behind (and to the emotes) */
.summary-emote-anchor {
  pointer-events: none;
  align-self: center;
  /* never wider than the results, so the bar can't spill off the screen */
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.summary-emote-drawer {
  position: relative;
  z-index: -1; /* behind the card it peeks out from */
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -2rem;
  padding: 2rem 1.2rem 0.4rem;
  border: 0.4rem solid var(--c);
  border-top: none;
  border-radius: 0 0 1.8rem 1.8rem;
  background: var(--c2);
  color: var(--ct);
  box-shadow: 0.4rem 0.4rem 0 var(--shadow);
  --fill: var(--c2);
  --stroke: var(--c);
}
/* tucked away, the emotes still keep their room */
.emote-pop.summary-emotes.tucked {
  visibility: hidden;
  animation: none;
}
.emote-tab,
.summary-emote-anchor .emote-pop:not(.tucked) {
  pointer-events: auto;
}
.emote-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0.8rem;
  color: var(--ct);
  transition: transform 0.25s var(--spring);
}
.emote-tab:active {
  transform: scale(0.9);
}
.emote-pop.summary-emotes {
  position: static;
  max-width: 100%;
  margin-top: 0.6rem;
  justify-content: center;
  transform-origin: 50% 0;
  animation: pop 0.35s var(--spring) both;
}
/* under the results there is room to show the sayings whole: the menu takes
   their width too (up to the results' width, then they scroll) */
.summary-emotes .emote-words {
  width: auto;
  min-width: 0;
}
.summary-panel .ready-tiles {
  margin-top: 0;
}
/* the match style and the games left, above the player tiles */
.summary-match {
  margin: -0.2rem 0 0.8rem;
  text-align: center;
  color: var(--ct);
  font: 700 1.4rem/1.2 var(--text);
}
/* the line under the verdict: white, in an edge of the primary text color */
.summary.floating .result-title small {
  color: var(--paper);
  font-size: 1.6rem;
  -webkit-text-stroke: 0.45rem var(--black);
  paint-order: stroke fill;
  opacity: 1;
}
/* the post-game graph: points through the game, one line per player */
.eval-chart {
  margin: 0;
  padding: 0.8rem 0.6rem 0.2rem;
  background: var(--paper);
  border: 0.3rem solid var(--black);
  border-radius: 2rem;
  color: var(--black);
  box-shadow: 0.4rem 0.4rem 0 var(--shadow);
}
.eval-chart figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 0.6rem 0.4rem;
  font-size: 1.4rem;
}
/* the name-tag popup's Elo, streak and records */
.player-card {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.player-card .leader-list {
  margin: 0;
}
.player-card-head {
  font-size: 1.6rem;
}
/* spectators watching from a player's seat: on the front right corner of their name tag,
   the eye and the count as small stickers of the same size, in the tag's color inside a
   paper outline (white on Original, each theme's own paper elsewhere) */
.tag-score {
  position: relative;
}
.watch-badge {
  position: absolute;
  top: -1rem;
  right: -0.4rem;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0;
  pointer-events: none;
  --fill: var(--c);
  --stroke: var(--paper);
}
/* the opponent's tag hangs from the top of the screen: its front corner is the bottom one */
.b-top .watch-badge {
  top: auto;
  bottom: -0.2rem;
}
.watch-badge[hidden] {
  display: none;
}
.watch-badge .ico {
  width: 2.1rem !important;
  height: 2.1rem !important;
  margin: 0 -0.1rem 0 0 !important;
}
.watch-badge .stk {
  font: 700 1.6rem/1 var(--round);
  --sw: 0.45rem;
}
/* pass & play: the card that hands the device to whoever is up */
.pass-shade {
  z-index: 120;
}
.pass-wait {
  position: fixed;
  inset: 0;
}
.pass-card {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  text-align: center;
  --fill: var(--c);
  --stroke: var(--paper);
}
.pass-card h2 {
  font-size: 2.6rem;
}
.pass-card .btn {
  width: 100%;
}
.chart-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
/* steps the graph between this game, each game, and the series */
.chart-cycle {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  padding: 0;
  border: 0.2rem solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  pointer-events: auto;
}
.chart-cycle:active {
  transform: scale(0.9);
}
.eval-chart figcaption small {
  font-size: 1.1rem;
  color: var(--gray);
}
.eval-plot {
  position: relative;
  /* (a finger on the graph slides along it: it never scrolls or zooms the page) */
  touch-action: none;
  margin-inline: auto; /* narrowed to fit a short screen (fitSummary), it stays centered */
}
.eval-plot svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: var(--text);
  touch-action: none;
}
.eval-plot .grid {
  stroke: var(--gray);
  stroke-width: 1;
  opacity: 0.3;
}
.eval-plot .grid.zero {
  stroke-dasharray: 3 3;
  opacity: 0.6;
}
.eval-plot .tick,
.eval-plot .axis {
  font-size: 10px;
  fill: var(--gray);
}
.eval-plot .tick {
  text-anchor: end;
  dominant-baseline: middle;
}
.eval-plot .axis {
  text-anchor: middle;
}
.eval-plot path {
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.eval-plot .case {
  stroke: var(--case);
  stroke-width: 5;
}
.eval-plot .series .line {
  stroke: var(--line);
  stroke-width: 2.6;
}
.eval-plot .end {
  fill: var(--line);
  stroke: var(--case);
  stroke-width: 2;
}
.eval-plot .line.muted {
  stroke: var(--gray);
  stroke-width: 1.5;
  opacity: 0.35;
}
/* a tooltip-style tag at the end of each line, its arrow pointing back at it */
.eval-plot .tag-arrow {
  fill: var(--tip);
}
.end-tag {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  height: 1.7rem;
  padding: 0 0.6rem;
  border-radius: 0.6rem;
  background: var(--tip);
  color: var(--on);
  font-size: 1.15rem;
  line-height: 1;
  white-space: nowrap;
  transform: translateY(-50%);
  box-shadow: 0.1rem 0.1rem 0 var(--shadow);
  pointer-events: none;
}
.end-tag b {
  font: 700 1.15rem/1 var(--round);
}
.eval-plot .cross {
  display: none;
  stroke: var(--gray);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.5;
}
.eval-plot .cross.on {
  display: inline;
}
.eval-plot .hit {
  fill: transparent;
  cursor: crosshair;
}
.eval-tip {
  position: absolute;
  top: 0.2rem;
  z-index: 2;
  padding: 0.6rem 0.9rem;
  border: 0.2rem solid var(--gray);
  border-radius: 1rem;
  background: var(--paper);
  box-shadow: 0.2rem 0.2rem 0 var(--shadow);
  color: var(--black);
  font-size: 1.2rem;
  white-space: nowrap;
  pointer-events: none;
}
.eval-tip div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.eval-tip i {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
}
.eval-tip b {
  margin-left: auto;
  padding-left: 0.8rem;
  font-family: var(--round);
}
/* one tile per player under the graph: points, series so far, ready or not */
.ready-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.6rem, 1fr));
  gap: 0.6rem;
  margin: 0.4rem 0 1.2rem;
}
.ready-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.7rem 0.6rem 0.8rem;
  border: 0.3rem solid var(--c);
  border-radius: 1.4rem;
  background: var(--c2);
  color: var(--ct);
  text-align: center;
  --fill: var(--c);
  --stroke: var(--paper);
}
/* on the results, each player's reaction pops up above their own tile */
.tile-emote {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.2rem); /* resting on the tile's top edge, clear of the name */
  z-index: 2;
  translate: -50% 0;
  pointer-events: none;
}
.player-emote.tile {
  position: static;
  transform-origin: 50% 100%;
}
.player-emote.tile img {
  width: 5.2rem;
  height: 5.2rem;
}
.ready-tile .who {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  font-size: 1.4rem;
  white-space: nowrap;
}
/* only the name is cut short; the crown beside it keeps its outline and shadow */
.ready-tile .who .name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ready-tile .who > .ico {
  flex: none;
}
.ready-tile b {
  font: 700 2rem/1 var(--round);
}
.ready-tile small {
  font-size: 1.2rem;
  opacity: 0.75;
}
.ready-state {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 1.2rem;
  opacity: 0.55;
}
.ready-state.on {
  opacity: 1;
}
.summary.mini {
  top: auto;
  bottom: 43%;
  width: auto;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  transform: translate(-50%, 50%);
  animation: none;
  overflow: visible;
}
.modal-shade,
.sheet-shade {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--scrim);
  -webkit-backdrop-filter: var(--scrim-blur);
  backdrop-filter: var(--scrim-blur);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.6rem;
  animation: fade 0.2s both;
  touch-action: auto;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.modal {
  position: relative; /* for its corner x */
  width: 100%;
  max-width: 37rem;
  box-shadow: 0.4rem 0.4rem 0 var(--shadow);
  animation: pop 0.4s var(--spring);
}
.modal h2 {
  font-size: 2.2rem;
}
.ranks {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
  margin: 1.2rem 0;
}
/* Beggars ranks: sticker letters in the panel's accent, white-outlined, no boxes */
.rank-sticker {
  display: grid;
  place-items: center;
  min-height: 5.6rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: 700 3.8rem/1 var(--round);
  --sw: 0.7rem;
  /* the accent fill inside a paper outline (white on Original, the theme's paper elsewhere) */
  --fill: var(--c);
  --stroke: var(--paper);
  transition: transform 0.28s var(--spring);
}
.rank-sticker:hover {
  transform: scale(1.12) rotate(-3deg);
}
.rank-sticker:active {
  transform: scale(0.88);
  transition-duration: 0.08s;
}
/* debug: the card picker's suits, and the bar shown while a card tool is on */
.debug-suits {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.2rem;
}
.debug-suit {
  display: grid;
  place-items: center;
  width: 5.6rem;
  height: 5.6rem;
  border: 0.3rem solid transparent;
  border-radius: 1.6rem;
  background: var(--paper);
  cursor: pointer;
  --fill: var(--ink);
  --stroke: var(--paper);
}
.debug-suit.red {
  --fill: var(--p2);
}
.debug-suit.on {
  border-color: var(--c);
}
.debug-bar {
  position: fixed;
  left: 50%;
  top: calc(0.8rem + env(safe-area-inset-top));
  z-index: 90;
  max-width: calc(100% - 3.2rem);
  transform: translateX(-50%);
  animation: pop 0.4s var(--spring);
}
.debug-label {
  margin-top: 0.8rem;
}
.cols .btn {
  min-height: 4.8rem;
  border-radius: 1.6rem;
  font: 700 2rem/1 var(--text);
  padding: 0.4rem;
}
.cols {
  display: grid;
  gap: 0.6rem;
  margin: 1.2rem 0;
}
/* (while a pop-up is up, the page under it holds still: see the pop-ups' touchmove in
   app.js. Only for a finger: a mouse's wheel is held by the pop-ups' wheel listener
   instead, as taking the page's scrollbar away would shift everything sideways.) */
@media (pointer: coarse) {
  :root:has(#sheet:not([hidden]), dialog[open], .modal-shade),
  :root:has(#sheet:not([hidden]), dialog[open], .modal-shade) body {
    overflow: hidden;
  }
}
.sheet-shade {
  align-items: flex-end;
  padding: 0;
  /* the dim and blur are a layer of their own behind the sheet (below): fading
     the shade itself in would fade the sheet with it, so Safari would redraw
     the blurred table and the whole sheet together on every frame */
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  animation: none;
}
.sheet-shade::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--scrim);
  -webkit-backdrop-filter: var(--scrim-blur);
  backdrop-filter: var(--scrim-blur);
  animation: fade 0.2s both;
}
/* while the sheet rises, its stickers hold still: each drifting sticker is a
   layer of its own that would otherwise be redrawn into the moving, fading
   sheet on every frame */
.sheet.entering .idle {
  animation: none;
  will-change: auto;
}
.sheet {
  /* fixed to the screen's bottom (over the shade's dim, its ::before): Safari
     fills its toolbar with the color of a fixed element at the screen's edge,
     so the sheet runs on under the toolbar instead of the page's color */
  position: fixed;
  left: 0;
  right: 0;
  margin: 0 auto;
  /* the sheet runs on below the bottom of the screen (its tail), so however the
     screen's bottom edge moves (Safari's toolbar coming and going) no gap opens
     under it; the tail's padding lets its last line still scroll into view */
  --sheet-tail: max(10rem, 7dvh);
  bottom: calc(-1 * var(--sheet-tail));
  width: 100%;
  max-width: 48rem;
  max-height: calc(86dvh + var(--sheet-tail));
  overflow: auto;
  overscroll-behavior: contain;
  /* an equal gutter each side, so the scrollbar never pushes content off-center */
  scrollbar-gutter: stable both-edges;
  padding: 2rem 1.6rem calc(max(2rem, env(safe-area-inset-bottom)) + var(--sheet-tail));
  border: 0.4rem solid var(--c);
  border-bottom: 0;
  border-radius: 3.2rem 3.2rem 0 0;
  background: var(--c2);
  color: var(--ct);
  --fill: var(--c2);
  --stroke: var(--c);
  /* it springs up into place: the spring rises past its place by up to ~6% of
     the sheet's height before settling, which the tail (at least 7% of the
     screen) always covers. It moves as one layer, so its stickers aren't
     redrawn every frame. */
  animation: sheet-in 0.45s var(--spring) both;
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-user-select: text;
  user-select: text;
}
@keyframes sheet-in {
  from {
    transform: translateY(60%);
    opacity: 0;
  }
}
/* redrawn in place after a table update: it is already on screen */
.sheet.settled {
  animation: none;
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.sheet-head h2 {
  flex: 1;
  font-size: 2.4rem;
  line-height: 1.1;
}
.sheet h3 {
  font-size: 1.6rem;
  margin: 1.8rem 0 0.8rem;
  opacity: 0.7;
}
/* the credit at the foot of Settings; "Figma" opens the design file */
.sheet-note {
  margin-top: 2rem;
  text-align: center;
  text-wrap: balance;
}
.sheet-note a {
  color: inherit;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.2em;
}
.close-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: none;
  color: var(--ct);
  font-size: 1.6rem;
  line-height: 1.2;
  --fill: var(--c2);
  --stroke: var(--c);
  transition: transform 0.25s var(--spring);
}
.close-btn:hover {
  transform: scale(1.14);
}
.close-btn:active {
  transform: scale(0.88);
}
.tally {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.2rem 1.4rem;
  border-radius: 1.8rem;
  background: rgb(255 255 255 / 0.55);
  font-size: 1.6rem;
}
/* dark themes: a well a shade darker than the sheet, tinted with its color,
   rather than a pale wash that turns gray on the dark sheets (the stat tiles too) */
:root:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) :is(.tally, .stat-tiles > div) {
  background: color-mix(in srgb, var(--c2) 55%, #000);
}
/* the series tally, plain on light sheets, becomes the same rounded well */
:root:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) .tally.plain {
  padding: 1.2rem 1.4rem;
  border-radius: 1.8rem;
}
/* a tally that sits straight on its sheet, with no panel of its own */
.tally.plain {
  padding: 0;
  border-radius: 0;
  background: none;
}
.tally div {
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
}
/* a rule that is affecting the hand: its sticker(s), then what it does */
.tally .effect {
  justify-content: flex-start;
  align-items: center;
  gap: 0.8rem;
}
/* the rule on the left, its maths in the right-hand column with the points */
.tally .effect-op {
  margin-left: auto;
  padding-left: 0.8rem;
  white-space: nowrap;
  text-align: right;
}
.effect-ico {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  min-width: 3.4rem;
  justify-content: center;
}
/* a rule sticker; a variant rides small on its bottom-right corner */
.rule-stk {
  position: relative;
  display: inline-flex;
}
.rule-sub {
  position: absolute;
  right: -0.4rem;
  bottom: -0.4rem;
  z-index: 1;
  display: inline-flex;
  translate: calc(var(--n, 0) * -1.1rem) 0;
}
.tally b {
  font-family: var(--text);
  white-space: nowrap;
}
.tally .total {
  border-top: 0.3rem solid var(--c);
  padding-top: 0.6rem;
  margin-top: 0.3rem;
  font-size: 2rem;
}
/* a second total line (wins, then points) shares the first one's rule */
.tally .total.more {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
.rule-card {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 0.2rem solid rgb(0 0 0 / 0.08);
  --fill: var(--c);
  --stroke: var(--paper);
}
.rule-card:last-child {
  border-bottom: 0;
}
.rule-card .rule-ico {
  width: 4rem;
  display: grid;
  place-items: center;
  flex: none;
  padding-top: 0.2rem;
}
.rule-card strong {
  display: block;
  font-size: 1.7rem;
  line-height: 1.3;
}
.rule-card p {
  font: 700 1.4rem/1.35 var(--text);
  opacity: 0.8;
}
/* a rule not in play is dimmed, all but its checkbox and eye */
.rule-card.off > :not(.rule-side) {
  opacity: 0.5;
}
/* the right of a rule: (solo, before the first flip) its checkbox, an open
   circle when off and a filled one with a checkmark when on, above the
   examples eye */
.rule-side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.rule-check {
  display: grid;
  place-items: center;
  padding: 0.4rem;
  cursor: pointer;
  --fill: var(--c2);
  --stroke: color-mix(in srgb, var(--c) 55%, var(--c2));
  transition: transform 0.25s var(--spring);
}
/* checked: a filled circle with the check cut out of it, like the Ready marks */
.rule-check[aria-checked="true"] {
  --fill: var(--c);
  --stroke: var(--paper);
}
.rule-check:hover {
  transform: scale(1.12);
}
/* the rule just turned on or off, gliding to its new section over the others */
.rule-card.gliding {
  position: relative;
  z-index: 2;
  background: var(--c2);
  border-radius: 1.6rem;
  /* its shadow comes and goes with the glide (glideRules) */
}
.rule-section {
  margin: 1.6rem 0 0.2rem;
  font-size: 1.5rem;
  opacity: 0.7;
}
.menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.menu-list .btn {
  min-height: 5.6rem;
  font-size: 2rem;
  justify-content: flex-start;
  padding: 0.8rem 1.6rem;
  gap: 1.2rem;
}
.menu-list .pref {
  font-size: 1.7rem;
}
.pref .grow {
  min-width: 0;
  text-align: left;
  white-space: normal;
  line-height: 1.15;
}
.pref-value {
  flex: none;
  min-width: 5.6rem;
  padding: 0.2rem 1rem;
  border-radius: 99rem;
  background: var(--c);
  color: var(--paper);
  font: 700 1.5rem/1.5 var(--text);
  text-align: center;
  opacity: 0.45;
}
.pref-value.on {
  opacity: 1;
}
/* "Show tooltips" off: the labels that name a move go; highlights stay */
.no-tips .move-label,
.no-tips .drag-note {
  display: none;
}

/* ---------- haptics ---------- */
/* iOS plays a system tick when a native switch is toggled by a finger, so an
   invisible one covers each button. Its native appearance must stay intact
   (opacity, not display or appearance), or the tick is lost.
   The whole selector sits in :where() so it never outranks a button's own
   positioning (:has() would otherwise count as a class). */
:where(button:has(> .haptic-switch)) {
  position: relative;
}
.haptic-switch {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.slot > .haptic-switch,
.home-dock .haptic-switch {
  /* (a card is dragged; the dock is swiped sideways to turn the page) */
  touch-action: none;
}
.no-haptics .haptic-switch,
button:disabled > .haptic-switch {
  display: none;
}
.haptic-probe {
  position: fixed;
  left: -99rem;
  top: 0;
  opacity: 0;
  pointer-events: none;
}
.toast {
  position: fixed;
  /* centered by its margins (not a transform), so the pop-in is the only
     transform it ever has */
  left: 0;
  right: 0;
  margin-inline: auto;
  bottom: max(2.4rem, env(safe-area-inset-bottom));
  z-index: 200;
  /* wide and low: a line or two of text, read from the left */
  width: max-content;
  max-width: min(46rem, calc(100vw - 3.2rem));
  padding: 0.7rem 1.9rem 0.7rem 1.4rem;
  border: 0.4rem solid var(--ink);
  border-radius: 1.6rem;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1.3;
  text-align: left;
  box-shadow: 0.3rem 0.3rem 0 var(--shadow);
  animation: toast-in 0.4s var(--spring);
  /* drawn once onto its own layer and moved as a whole: redrawing the ✕
     sticker's textured filter on every frame of the pop-in and the slide away
     made it stutter and flicker in Safari (so the ✕ also holds still, without
     the idle drift) */
  will-change: transform, translate, opacity;
  backface-visibility: hidden;
  /* it can be swiped away (app.js) */
  touch-action: none;
  user-select: none;
  cursor: grab;
  transition:
    translate 0.3s var(--spring),
    opacity 0.25s;
}
/* the ✕ sticker on the top right corner also dismisses it */
.toast-close {
  position: absolute;
  top: -1.2rem;
  right: -1.2rem;
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  cursor: pointer;
  --fill: var(--ink);
  --stroke: var(--paper);
  transition: transform 0.28s var(--spring);
}
.toast-close:active {
  transform: scale(0.85);
  transition-duration: 0.08s;
}
/* on its way out: an ease that speeds up as it drops off the screen */
.toast.leaving {
  pointer-events: none;
  transition:
    translate 0.3s cubic-bezier(0.4, 0, 0.9, 0.6),
    opacity 0.18s ease-in 0.12s;
}
.toast.dragging {
  transition: none;
  cursor: grabbing;
}
@keyframes toast-in {
  from {
    transform: translateY(3rem) scale(0.8);
    opacity: 0;
  }
}
/* Quickplay: a small pill in the page's top bar, between its buttons (or,
   on a page without one, floating at the top). Never on the game board. */
.queue-banner {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 90;
  --safe-top: env(safe-area-inset-top);
}
/* at the table, the dropped-down pill can be swiped away */
.queue-banner.peek {
  touch-action: none;
  user-select: none;
}
/* scrolled past its spot, the pill floats at the top of the screen */
.queue-banner.pinned {
  position: fixed;
}
.queue-slot {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
}
.queue-slot.end {
  margin-left: auto;
}
/* the copy in the top bar only keeps the pill's room */
.queue-slot > * {
  visibility: hidden;
}
.queue-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  padding: 0.3rem 0.8rem 0.3rem 1.1rem;
  border: 0.3rem solid var(--p3);
  border-radius: 2rem;
  background: var(--p3b);
  color: var(--p3t);
  box-shadow: 0.25rem 0.25rem 0 var(--shadow);
  --c: var(--p3);
  --c2: var(--p3b);
  --ct: var(--p3t);
}
.queue-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  color: inherit;
  --fill: var(--p3);
  --stroke: var(--paper);
}
.queue-text {
  display: grid;
  min-width: 0;
  text-align: left;
  line-height: 1.15;
}
.queue-text b {
  font-size: 1.3rem;
}
.queue-text small {
  font-size: 1.1rem;
  opacity: 0.75;
}
.queue-text :is(b, small) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.queue-pill.offer .queue-text small {
  opacity: 1;
}
.side-act.queue-leave {
  flex: none;
  gap: 0;
  font-size: 1.05rem;
  line-height: 1.1;
  color: var(--p3t);
  --fill: var(--p3);
  --stroke: var(--p3-edge);
  animation: none;
}
.side-act.queue-leave .act-ico {
  height: 2.8rem;
}

/* With a match found, the pill opens out into the offer: what it is beside a
   Decline sticker, and Accept underneath. Kept to two short lines. */
.queue-pill.open {
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
  width: min(30rem, calc(100vw - 3.2rem));
  padding: 0.8rem 0.9rem 1rem 1.3rem;
  border-radius: 2.2rem;
}
.queue-offer-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.queue-offer-row .queue-text {
  flex: 1;
}
/* the match style shows in full, on a line of its own, in the same quieter
   secondary text as "In queue" */
.queue-pill.open .queue-text small {
  white-space: normal;
  overflow: visible;
  /* (faded by color, not opacity, so the opponent's name can be full strength) */
  opacity: 1;
  color: color-mix(in srgb, var(--ct) 75%, transparent);
}
/* the opponent's name, in the pill's primary text color */
.queue-pill.open .queue-who {
  color: var(--ct);
}
.queue-pill.open .queue-text b {
  font-size: 1.6rem;
}
.queue-pill.open .queue-text small {
  font-size: 1.2rem;
}
/* Open, the pill keeps a quieter secondary outline; Accept hangs below it as a
   button of its own in the primary outline, between two sparkles.
   (The pill is the root that grows, so Accept is placed out of its flow.) */
.queue-pill.open {
  position: relative;
  overflow: visible;
  margin-bottom: 5.4rem;
  border-color: color-mix(in srgb, var(--p3) 45%, var(--p3b));
}
.queue-pill.open .queue-accept {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.8rem);
  min-height: 4.6rem;
  border-color: var(--p3);
  font-size: 1.7rem;
  box-shadow: 0.25rem 0.25rem 0 var(--shadow);
  /* the sparkles: pale, inside the primary outline */
  --fill: var(--p3b);
  --stroke: var(--p3);
}
/* the right sparkle is mirrored; its shadow is offset the other way first, so
   once flipped it still falls down and to the right like the left one's */
.queue-pill.open .queue-accept .ico.mirrored {
  scale: -1 1;
  --shx: -0.3rem;
}
/* A table invitation: the Ranked "Match found!" pill, opened out, in blue. It
   drops in at the top of the screen, over any page. */
.invite-banner {
  position: fixed;
  left: 50%;
  top: max(0.8rem, env(safe-area-inset-top));
  z-index: 95;
  translate: -50% 0;
}
.queue-pill.invite-pill {
  border-color: color-mix(in srgb, var(--p1) 45%, var(--p1b));
  background: var(--p1b);
  color: var(--p1t);
  --c: var(--p1);
  --c2: var(--p1b);
  --ct: var(--p1t);
}
.invite-pill .side-act.queue-leave {
  color: var(--p1t);
  --fill: var(--p1);
  --stroke: var(--p1-edge);
}
.queue-pill.invite-pill .queue-accept {
  border-color: var(--p1);
  --fill: var(--p1b);
  --stroke: var(--p1);
}
/* A flag just earned: the invitation pill in purple, with the strokes the other way
   round (the pill in the primary outline, Dismiss in the quieter one), and the reward on
   the right where Decline would be. Over an invitation, if both come at once. */
.flag-banner {
  z-index: 96;
}
.queue-pill.flag-pill {
  border-color: var(--p4);
  background: var(--p4b);
  color: var(--p4t);
  --c: var(--p4);
  --c2: var(--p4b);
  --ct: var(--p4t);
}
.queue-pill.flag-pill .queue-accept {
  border-color: color-mix(in srgb, var(--p4) 45%, var(--p4b));
  --fill: var(--p4b);
  --stroke: color-mix(in srgb, var(--p4) 45%, var(--p4b));
}
.flag-pill-art {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 5.6rem;
}
.flag-pill-art .flag-art {
  margin: 0;
}
/* (the logo, a touch smaller here) */
.flag-pill-art .flag-art.f-theme {
  width: 10rem;
  height: 4.6rem;
}
.flag-pill-art .flag-art.f-theme .logo {
  transform: translate(-50%, -50%) scale(0.45);
}
.flag-pill-art .flag-art.open.f-word {
  min-width: 0;
  height: 3.4rem;
  font-size: 1.4rem;
}
.social-dialog {
  width: min(42rem, calc(100vw - 3.2rem));
  max-height: 86dvh;
  padding: 2rem 1.6rem;
  border: 0.4rem solid var(--p1);
  border-radius: 2.8rem;
  background: var(--p1b);
  color: var(--p1t);
  font: 700 1.6rem/1.4 var(--text);
  box-shadow: 0.4rem 0.4rem 0 var(--shadow);
  --c: var(--p1);
  --c2: var(--p1b);
  --ct: var(--p1t);
  --fill: var(--p1b);
  --stroke: var(--p1);
}
/* inviting players: the dismiss x on the corner (so the dialog doesn't clip it),
   and the players scrolling inside it instead */
.social-dialog.invite-dialog {
  overflow: visible;
}
.invite-list {
  margin-top: 1.2rem;
  max-height: 56dvh;
  overflow-y: auto;
  padding: 0.4rem 0.6rem 0.6rem 0.2rem;
  margin-inline: -0.2rem -0.6rem;
}
.invite-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.invite-row .list-item {
  min-width: 0;
}
/* the same width for Invite and Invited, so the cards line up */
.invite-row .close-btn {
  width: 6.6rem;
}
.invite-row .close-btn:disabled {
  opacity: 0.6;
  transform: none;
}
.social-dialog[open] {
  animation: pop 0.4s var(--spring);
}
.social-dialog::backdrop {
  background: var(--scrim);
  -webkit-backdrop-filter: var(--scrim-blur);
  backdrop-filter: var(--scrim-blur);
}
.social-dialog h2 {
  font-size: 2.4rem;
  line-height: 1.15;
  margin-bottom: 0.8rem;
}
.social-dialog .hint {
  color: var(--p1);
}
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.6rem;
}
.dialog-actions .btn {
  flex: 1 1 12rem;
  min-height: 5.6rem;
  font-size: 2rem;
}

/* ---------- a wide screen: the board expands and gains an action bar ----------
   (by the screen's width alone, so a tablet or a phone on its side has it too) */
@media (min-width: 760px) {
  /* (as wide as what is on the table: a hand and the name tag beside it) */
  .summary.floating {
    width: 42.4rem;
    padding: 0.6rem 0.8rem 1rem;
  }
  :root.in-game {
    /* (the table fills more of the screen's height now that the action bar stands at its side) */
    --u: min(100vw / 620, 100dvh / 860, 1.6px);
  }
  .board {
    width: 62rem;
  }
  .b-top,
  .b-bottom {
    justify-content: center;
    gap: 1.6rem;
    padding: 0;
  }
  .b-mid {
    gap: 5.6rem;
    padding: 0 0.8rem;
  }
  .b-top .b-side,
  .b-bottom .b-side {
    flex: 0 0 11.4rem;
  }
  /* your tags run off the bottom of the screen, as on a phone: square at the foot */
  /* Flip / Swap / Draw / Discard / End Turn stand in a column of their own on the board's
     left, level with its middle */
  .actionbar {
    position: absolute;
    /* (beside what is on the table, not the board's wider frame: the hands and tags span
       42.4rem of its 62rem, centered, and the bar stands clear of them, and of Undo, which
       comes out to the left of the draw pile a little further than the hands reach) */
    right: calc(100% - (62rem - 42.4rem) / 2 + 3.6rem);
    top: 50%;
    translate: 0 -50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.4rem 0.6rem 1.2rem;
    border: 0.8rem solid var(--p1);
    border-radius: 2.4rem;
    background: var(--p1b);
    color: var(--p1t);
    --c: var(--p1);
    --c2: var(--p1b);
    --ct: var(--p1t);
    --fill: var(--p1);
    --stroke: var(--paper);
  }
  /* Your move clock (people playing each other) heads the bar: the seconds as stickers,
     "left" under them, and a line between it and the actions. Full and faint while the
     table waits on someone else, as an action you cannot take is. */
  .act-clock {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    font-size: 1.6rem;
    line-height: 1.3;
    transition: opacity 0.2s;
  }
  .act-clock.resting {
    opacity: 0.35;
  }
  .clock-num {
    display: inline-flex;
    justify-content: center;
    min-width: 5rem;
    font: 700 3.4rem/1.1 var(--round);
    --sw: 0.6rem;
  }
  .act-rule {
    align-self: stretch;
    margin: 0.4rem 0.4rem 0.6rem;
    border: 0;
    border-top: 0.3rem solid color-mix(in srgb, var(--p1) 45%, transparent);
    border-radius: 0.2rem;
  }
  /* its frame breathes in step with your tags while the table waits on you */
  .actionbar.my-turn {
    animation: bar-pulse 0.9s ease-in-out infinite alternate;
  }
  @keyframes bar-pulse {
    to {
      border-color: color-mix(in srgb, var(--p1) 93%, black);
    }
  }
  .act {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    color: inherit;
    font-size: 1.6rem;
    line-height: 1.3;
    white-space: nowrap;
    transition:
      transform 0.28s var(--spring),
      opacity 0.2s;
  }
  .act-ico {
    display: grid;
    place-items: center;
    height: 5rem;
  }
  .act:hover:not(:disabled) {
    transform: translateY(-0.3rem) scale(1.08);
  }
  .act:active:not(:disabled) {
    transform: scale(0.92);
    transition-duration: 0.08s;
  }
  .act:disabled {
    opacity: 0.35;
    cursor: default;
  }
  .act {
    position: relative;
  }
  /* the controller button hangs off the bottom of the action's icon, on top */
  .act-ico {
    position: relative;
  }
  .act-ico .pad-key {
    position: absolute;
    left: 50%;
    bottom: -0.6rem;
    z-index: 1;
    height: 2.6rem;
    translate: -50% 0;
  }
  /* the table actions live in the action bar here */
  .pile-side .bar-act {
    display: none;
  }
  .side-act {
    font-size: 1.6rem;
  }
  .pile-side {
    --out: 5.4rem;
  }
  /* beside the chat button, as on phones (it sits further in on this layout) */
  .emote-pop {
    left: 17.2rem;
    bottom: 26rem;
  }
  .player-emote.me {
    left: 14rem;
    bottom: 20rem;
  }
  .player-emote.them {
    right: 14rem;
  }
  .sheet-shade {
    align-items: center;
    padding: 1.6rem;
  }
  .sheet {
    position: relative;
    bottom: auto;
    --sheet-tail: 0rem;
    border-bottom: 0.4rem solid var(--c);
    border-radius: 3.2rem;
    /* centered on a wide screen: it rises a little into place as it fades in */
    animation-name: sheet-in-center;
  }
  @keyframes sheet-in-center {
    from {
      transform: translateY(6rem);
      opacity: 0;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .result-title .stk {
    animation: none !important;
  }
  .idle,
  .avatar-pick .pointer,
  .slot.selected::after,
  .slot.target::before,
  .tag.my-turn,
  .actionbar.my-turn,
  .clock-low > .turn-label {
    animation: none;
  }
  .page,
  .modal,
  .sheet,
  .toast,
  .callout.pop,
  .summary {
    animation-duration: 0.01s;
  }
}
/* the same with Settings > Reduce motion on, whatever the device asks for */
:root.reduce-motion .result-title .stk {
  animation: none !important;
}
:root.reduce-motion .idle,
:root.reduce-motion .avatar-pick .pointer,
:root.reduce-motion .slot.selected::after,
:root.reduce-motion .slot.target::before,
:root.reduce-motion .tag.my-turn,
:root.reduce-motion .actionbar.my-turn {
  animation: none;
}
:root.reduce-motion .page,
:root.reduce-motion .modal,
:root.reduce-motion .sheet,
:root.reduce-motion .toast,
:root.reduce-motion .callout.pop,
:root.reduce-motion .summary {
  animation-duration: 0.01s;
}

/* ---------- leaderboard & player stats ---------- */
.board-row .rank {
  flex: none;
  display: grid;
  place-items: center;
  width: 4.4rem;
  font: 700 3rem/1 var(--round);
  --sw: 0.6rem;
  --fill: var(--c);
  --stroke: var(--paper);
}
.board-row .rate {
  flex: none;
  font: 700 2.4rem/1 var(--round);
  letter-spacing: -0.04rem;
}
/* a rule filter left out on purpose */
.filter-row.off {
  color: var(--fw-text);
  --fill: var(--p2b);
  --stroke: var(--p2);
}
.filter-row.on {
  color: var(--fw-text);
  --fill: var(--p1b);
  --stroke: var(--p1);
}
.rules-body .rule-row[aria-pressed="true"] {
  color: var(--fw-text);
}
.stat-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  text-align: center;
}
.stat-rate {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.2rem;
  height: 6rem;
  --fill: var(--c);
  --stroke: var(--paper);
}
.stat-rate .stk {
  font: 700 6.4rem/1 var(--round);
  --sw: 0.9rem;
  margin-right: -0.1rem;
}
.stat-rate .stk.pts {
  font-size: 3.2rem;
  margin: 0 0 0.6rem 0.2rem;
}
.stat-tiles {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  width: 100%;
}
.stat-tiles > div {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.8rem 0.4rem;
  border-radius: 1.6rem;
  background: rgb(255 255 255 / 0.55);
}
.stat-tiles b {
  display: block;
  font: 700 2rem/1.2 var(--round);
}
.stat-tiles span {
  display: block;
  font-size: 1.3rem;
  opacity: 0.75;
}
/* Patch 1.2: keep the paper-and-sticker palette. */
.leader-tabs { display:flex; gap:.7rem; margin-bottom:1.5rem; flex-wrap:wrap; }
.leader-tabs .btn { flex:1; white-space:nowrap; }
/* Solo and PVP leaderboards: the leader's card, then a green row for everyone */
.leader-hero {
  position: relative;
  animation: card-pop 0.45s var(--spring) both;
}
.leader-trophy {
  position: absolute;
  top: -2rem;
  left: -1.2rem;
  rotate: -12deg;
}
.leader-hero .stat-rate > .ico {
  align-self: center;
  margin-right: 0.4rem;
  --fill: var(--flame);
  --stroke: var(--flame-edge);
}
.leader-hero p strong {
  font-size: 2rem;
}
/* a streak is the flame's orange, number and all */
.leader-hero .stat-rate.streak-rate {
  --fill: var(--flame);
  --stroke: var(--flame-edge);
}
.board-row .rate .streak-num {
  color: var(--flame);
  -webkit-text-stroke: 0.4rem var(--flame-edge);
  paint-order: stroke fill;
}
/* the leader's card sits as far above the rows as the rows sit apart */
.leader-hero + .leader-list {
  margin-top: 1rem;
}
.leader-list .board-row {
  animation: row-in 0.45s var(--spring) both;
  animation-delay: calc(min(var(--i), 12) * 55ms + 180ms);
}
.board-row .rate {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}
.board-row .rate .ico {
  align-self: center;
  --fill: var(--flame);
  --stroke: var(--flame-edge);
}
.board-row .rate small {
  font-size: 1.3rem;
  opacity: 0.7;
}
/* Solo: the current streak, small and quiet, sitting on the bottom line to the
   left of the best */
.board-row .rate .streak-now {
  align-self: flex-end;
  margin-right: 0.4rem;
  font: 700 1.2rem/1.2 var(--text);
  white-space: nowrap;
}
/* Records: one card per all-time best, two to a row where there is room */
.records {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 2.2rem 1.6rem;
  margin-top: 2.4rem;
}
/* a record's card, with the viewer's own best (if any) underneath it */
.record-slot {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  animation: card-pop 0.45s var(--spring) both;
  /* (one after another, the first ten; the rest come with the tenth, so a long page is not kept waiting) */
  animation-delay: calc(min(var(--i), 9) * 45ms + 60ms);
}
.record-card {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  /* (room at the top for the corner icon, clear of the larger title) */
  padding: 2.8rem 1.4rem 1.6rem;
  text-align: center;
}
.record-card h3 {
  margin: 0;
  font: 700 1.9rem/1.15 var(--text);
}
.record-ico {
  position: absolute;
  top: -1.6rem;
  left: -0.8rem;
  rotate: -10deg;
}
/* each digit is its own sticker; they sit snug, with a little room before the unit */
.record-value {
  display: flex;
  align-items: baseline;
  /* (a number too wide for the card puts its unit on a line of its own under it) */
  flex-wrap: wrap;
  justify-content: center;
  font: 700 4.4rem/1 var(--round);
  --sw: 0.7rem;
}
.record-value .stk:not(.pts),
.record-pr-value .stk:not(.pts) {
  margin-right: -0.03em;
}
.record-value {
  column-gap: 0.5rem;
}
.record-value .pts {
  margin-left: 0;
  font-size: 1.8rem;
  --sw: 0.5rem;
}
.record-card p {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.35;
}
.record-card .record-note {
  font-size: 1.15rem;
  opacity: 0.7;
}
/* (a record nobody holds yet says so in the card's own text color, as its words would be) */
.record-card p.hint.dark {
  color: var(--ct);
}
/* the note under a board (what it's ranked by, or where its records come from) */
.leader-foot {
  margin-top: 2.4rem;
  text-align: center;
}
/* the viewer's own best (PR), under the record's card: a box only as tall as
   what it holds, in the card's fill with a softer second stroke (the cards in a
   row stretch to one height, so the boxes under them line up) */
.record-pr {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.5rem 1.2rem;
  color: var(--ct);
  /* its number is drawn like the card's: the card's fill, edged in its color */
  --fill: var(--c2);
  --stroke: var(--c);
  /* (as thick as the card's own edge, in a softer shade of it) */
  border: 0.4rem solid color-mix(in srgb, var(--c) 45%, var(--c2));
  border-radius: 2.4rem; /* the card's own (.panel) */
  background: var(--c2);
}
.record-pr-value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: center;
  font: 700 3.2rem/1 var(--round);
  --sw: 0.55rem;
}
.record-pr-value {
  column-gap: 0.4rem;
}
.record-pr-value .pts {
  margin-left: 0;
  font-size: 1.4rem;
  --sw: 0.4rem;
}
.record-pr-text {
  font: 700 1.25rem/1.2 var(--text);
  opacity: 0.8;
  text-align: center;
}
.record-pr.held .record-pr-text {
  padding: 0.5rem 0;
}
.leader-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  padding: 2.8rem 1.6rem;
  text-align: center;
}
/* Debug card gallery: every card, laid out in suits, free to drag about */
/* (cards keep the table's own card size, 8.822 x 12.3rem, which their faces
   and labels are drawn for, and the hand's spacing) */
.card-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, 8.822rem);
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1.6rem;
}
.gallery-slot {
  padding: 0;
  border: 0;
  background: none;
  cursor: grab;
}
.gallery-slot:active {
  cursor: grabbing;
}
.leader-empty > p:first-of-type {
  font: 700 2rem/1.2 var(--text);
}
@media (prefers-reduced-motion: reduce) {
  .leader-hero,
  .record-slot,
  .leader-list .board-row {
    animation: none;
  }
}
:root.reduce-motion .leader-hero,
:root.reduce-motion .record-slot,
:root.reduce-motion .leader-list .board-row {
  animation: none;
}
.rule-help-copy { min-width:0; flex:1; }
/* the examples toggle: a small eye on the right of the rule with "View" under it, no
   box; gold while open. Until it is opened the eye pulses a little, to say it can be pressed. */
.rule-eye { flex:none; display:flex; flex-direction:column; align-items:center; gap:.5rem; padding:.6rem .2rem; margin:-.2rem -.6rem 0 0; cursor:pointer; opacity:.85; color:inherit; transition:opacity .2s, transform .25s var(--spring); }
.rule-eye:hover { opacity:1; transform:scale(1.12); }
.rule-eye.c-p3 { opacity:1; }
.rule-eye-label { font:700 1.1rem/1.2 var(--text); }
.rule-eye:not(.c-p3) > .ico { animation: eye-pulse 1.2s ease-in-out infinite alternate; }
@keyframes eye-pulse { to { scale: 1.14; } }
@media (prefers-reduced-motion: reduce) { .rule-eye > .ico { animation: none !important; } }
:root.reduce-motion .rule-eye > .ico { animation: none !important; }
.rule-example { margin-top:1rem; }
.example-hand { display:grid; grid-template-columns:repeat(3,4.411rem); gap:.6rem; margin:.8rem 0; }
.example-card { position:relative; display:block; width:4.411rem; height:6.15rem; perspective:60rem; }
.example-card > .card { width:8.822rem; height:12.3rem; inset:0 auto auto 0; transform:scale(.5); transform-origin:top left; }
.example-caption { font-size:1.35rem; }
.leave-dialog .dialog-actions { flex-wrap:wrap; }


.rule-eye { --fill:var(--c); --stroke:var(--paper); }
.rule-eye.c-p3 { --fill:var(--p3); --stroke:var(--paper); }

/* Focus: only the icons that do something stay. Every .btn already says what
   it is in words, so the picture beside them goes (home buttons, settings
   rows, fields); the round icon buttons, Back and the table's own actions keep theirs. */
:root[data-theme="focus"] .btn > .tilt,
:root[data-theme="focus"] .field > .tilt {
  display: none;
}
:root[data-theme="focus"] .btn.tile {
  justify-content: center;
}
/* Focus: a card shows its rank and suit once, in the middle */
:root[data-theme="focus"] .face.front {
  justify-content: center;
  align-items: center;
}
:root[data-theme="focus"] .face.front > .corner + .corner {
  display: none;
}
:root[data-theme="focus"] .face.front > .corner {
  width: auto;
  transform: scale(1.6);
}

/* ---------- tournaments ----------
   The dashboard: matches in play, the bracket (a column a round, scrolling
   sideways when it is wide), and the standings. */
.section-title {
  font: 800 2rem/1.2 var(--round);
  margin: 0.6rem 0 0;
}
.tournament-page .meta {
  justify-content: flex-start;
}
/* (its trophy hangs on the banner's own corner, clear of the Back button above) */
.tournament-hero {
  position: relative;
  margin-top: 1.2rem;
}
.tournament-hero p {
  font-size: 2rem;
}
.tournament-you {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}
.list-item .versus {
  margin: 0 0.5rem;
  white-space: nowrap;
  opacity: 0.75;
}
.bracket-section h3 {
  margin: 0.8rem 0 0.6rem;
  font: 800 1.7rem/1.2 var(--round);
}
.bracket-section h3 small {
  font: 700 1.3rem/1.2 var(--text);
  opacity: 0.7;
}
.bracket {
  display: flex;
  gap: 1.4rem;
  overflow-x: auto;
  padding: 0.4rem 0.4rem 1.2rem;
  margin-inline: -0.4rem;
}
/* a round robin: its rounds side by side like a bracket's, each column from the top */
.bracket.robin > .bracket-round {
  justify-content: flex-start;
}
.robin-out {
  margin: 0;
  text-align: center;
  font: 700 1.3rem/1.2 var(--text);
  color: var(--fw-text);
  opacity: 0.7;
}
.bracket-round {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 1rem;
  flex: 0 0 auto;
}
.bracket-round h4 {
  margin: 0;
  font: 800 1.3rem/1.2 var(--round);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.65;
}
.bracket-match {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 21rem;
  padding: 0.7rem;
  /* in the colors of its c-* class, like a list row: green, or blue while it is being played */
  border: 0.3rem solid var(--c);
  border-radius: 1.6rem;
  background: var(--c2);
  color: var(--ct);
  box-shadow: 0.3rem 0.3rem 0 var(--shadow);
}
.bracket-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font: 700 1.15rem/1.2 var(--text);
  opacity: 0.75;
}
.bracket-meta .live {
  font-weight: 800;
}
.bracket-player {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.6rem;
  border-radius: 0.9rem;
  background: rgb(255 255 255 / 0.35);
  font: 700 1.5rem/1.3 var(--text);
}
.bracket-player .seed {
  flex: none;
  width: 1.8rem;
  font-size: 1.15rem;
  opacity: 0.55;
  text-align: center;
}
.bracket-player .who {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bracket-player .who small {
  margin-left: 0.5rem;
  font-size: 1.05rem;
  opacity: 0.6;
}
.bracket-player b {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: none;
}
.bracket-player.won {
  background: rgb(255 255 255 / 0.75);
}
.bracket-player.lost {
  opacity: 0.55;
}
.bracket-player.tbd {
  background: none;
  font-weight: 600;
  opacity: 0.7;
}
.bracket-player.mine {
  outline: 0.2rem solid currentColor;
  outline-offset: -0.2rem;
}
.bracket-match > .btn {
  align-self: stretch;
  margin-top: 0.3rem;
}
.tournament-page tr.mine {
  font-weight: 800;
}
.tournament-host {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.tournament-host summary {
  cursor: pointer;
  font: 800 1.6rem/1.4 var(--round);
}
.tournament-host .row {
  margin-top: 0.8rem;
}
/* a button that has asked "Sure?" */
.armed {
  filter: saturate(1.4) brightness(0.95);
  outline: 0.3rem solid var(--p2);
  outline-offset: 0.2rem;
}
.close-btn.small-x {
  flex: none;
}
/* Match history: the PVP / Solo / Tournaments pills under the title */
.list-tabs {
  margin-bottom: 1.6rem;
  flex-wrap: wrap;
}
.list-tabs .chip {
  /* as wide as its words need: "Tournaments" takes more of the row than "PVP" */
  flex: 1 1 auto;
  min-height: 5.2rem;
  padding: 0.8rem 1rem;
  gap: 0.5rem;
  font-size: 1.4rem;
  white-space: nowrap;
}

/* ---------- the home screen: five tabs along the bottom (tabs.js) ----------
   The top bar and the tab bar (with whatever sits on it: Start a Game, Aces'
   views) stay put; the tab between them slides across when it changes. */
/* a sideways swipe on the home screen changes tab: it never means Back */
:root.home-tabbed {
  overscroll-behavior-x: none;
}
/* The home screen itself does not slide in the way other pages do: an element
   animating its transform (even after it has finished, while the animation still
   holds) becomes what its fixed children are pinned to, and the tab bar would sit
   at the bottom of the page instead of the screen. Its top bar and tab ease in
   instead; the tab bar is simply there. */
.page.home.tabbed {
  animation: none;
}
.page.home.tabbed:not(.instant) > .topbar,
.page.home.tabbed:not(.instant) > .tab-stage {
  animation: page-in 0.35s var(--glide) backwards;
}
.page.home.tabbed {
  gap: 1.6rem;
  /* room under the last thing on the tab for the dock that floats over it */
  padding-bottom: calc(11rem + var(--home-bar));
}
.page.home.tabbed[data-tab="play"] {
  padding-bottom: calc(20rem + var(--home-bar));
}
.tab-stage {
  display: grid;
  min-width: 0;
}
.tab-pane {
  grid-area: 1 / 1;
  min-width: 0;
}
/* the page showing, and one on the move, are layers of their own, so nothing is drawn
   again when they start to move (a page only waiting off the screen is not one: see above) */
.tab-pane:not(.staged):not(.parked),
.tab-pane.neighbor {
  will-change: translate, opacity;
}
/* (A page on its way in or out takes no clicks: tabs.js turns them away. Not
   pointer-events here: being inherited, it would restyle the whole page each
   time a page changed places, in the middle of a swipe.) */
/* A page not showing is kept, parked: laid out (so bringing it in is free) but
   unseen, taking no room and adding nothing to scroll. */
.tab-stage {
  position: relative;
}
.tab-pane.parked {
  position: absolute;
  inset: 0 0 auto;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  will-change: auto;
  /* (and what is in it is left out of every restyle of the screen until it is wanted) */
  content-visibility: hidden;
}
/* A sticker's idle drift is worked out on the main thread for every frame (it
   cannot be handed to the GPU on an SVG). So while pages or the bar are moving,
   every sticker holds its pose: nothing then competes with the motion for a
   frame. They are only paused, each still on its own layer, so nothing is drawn
   again when the motion starts or ends. */
:root.home-moving .idle {
  animation-play-state: paused;
}
/* A parked page has no drift at all. */
.tab-pane.parked .idle {
  animation: none;
  will-change: auto;
}
/* A page brought in (.flat, until everything is at rest) has its stickers held
   still, each on the layer it drifts on, so nothing is drawn again when they start. */
.tab-pane.flat .idle {
  animation-play-state: paused;
}
/* A page in waiting off the screen's edge is one flat picture: its stickers hold
   still with no layers of their own. (Kept as layers, every sticker on every page
   in waiting was more than a phone keeps in its memory for the screen, and as the
   page was scrolled it dropped and redrew some, which flickered.) */
.tab-pane.staged:not(.neighbor) .idle {
  animation: none;
  will-change: auto;
}
/* A page in waiting off the screen's edge, one being dragged in, and one fading
   in over the stage: drawn in full, lying over the stage a screen's height deep
   and taking no room in the layout, moved off to its side by tabs.js. */
.tab-pane.staged,
.tab-pane.overlay {
  /* (Not clipped to a box of its own: that cut the stickers and shadows that reach past
     a page's edges for as long as it was fading in. What hangs below the foot of the
     page is cut off by the page itself; see below.) */
  position: absolute;
  inset: 0 0 auto;
}
.tab-pane.staged:not(.neighbor) {
  pointer-events: none;
}
/* (A page in waiting hangs past the foot of a short page: the home page cuts it off
   there, so it adds nothing to scroll. Only up and down: sideways, pages must not
   be cut at the page's own edges.) */
.page.home.tabbed {
  overflow-y: clip;
}
/* Pages carried in from the side are not cut off at the page's own edges: they
   fade and blur out as they go (tabs.js). Only the screen's edge ends them,
   so they never make the page scroll sideways. */
/* (Cut off inside the app itself, as wide as the screen: were the document to
   grow wider, a phone would zoom its layout out and the tab bar, pinned to the
   bottom of that layout, would drop off the screen until the page settled.) */
:root.home-tabbed #app {
  overflow-x: clip;
}
/* anywhere on the home screen, sideways drags are ours; up and down is the browser's */
:root.home-tabbed body {
  touch-action: pan-y pinch-zoom;
}
/* (a mouse dragging the pages across selects nothing) */
:root.paging,
:root.paging body {
  -webkit-user-select: none;
  user-select: none;
  cursor: grabbing;
}

.tab-body {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
/* a tab's big title: light blue sticker letters in a white edge, on a blue shadow */
.tab-head {
  text-align: center;
  margin-top: 0.4rem;
}
/* light blue letters in a blue edge, on the usual sticker shadow, set on an arch (arcText) */
.tab-title {
  margin: 0;
  padding-bottom: 0.6rem;
  font: 700 3.6rem/1.1 var(--round);
  --fill: var(--p1b);
  --stroke: var(--p1);
  --sw: 0.8rem;
  --shx: 0.3rem;
  --shy: 0.35rem;
}
.arc {
  /* the arched titles drift about half as much as other stickers */
  --idle-scale: 0.5;
  display: inline-flex;
  align-items: flex-end;
  white-space: nowrap;
}
.arc-ch {
  display: inline-block;
  transform-origin: 50% 100%;
}
.arc-ch.space {
  width: 0.3em;
}
.tab-sub {
  margin: 0.4rem 0 0;
  color: var(--ct, var(--fw-text));
  font: 700 1.45rem/1.3 var(--text);
}
/* a box with its name on its top edge, like a field's label */
.boxed {
  position: relative;
  padding: 1.8rem 1.4rem 1.2rem;
  border: 0.4rem solid var(--c);
  border-radius: 2rem;
  background: var(--c2);
  color: var(--ct);
  --fill: var(--c2);
  --stroke: var(--c);
}
.boxed > .box-label {
  position: absolute;
  left: 1.8rem;
  top: -1.3rem;
  font: 700 1.5rem/1.4 var(--text);
  color: var(--c2);
  -webkit-text-stroke: 0.5rem var(--c);
  paint-order: stroke fill;
  white-space: nowrap;
  pointer-events: none;
}
.boxed > .box-label.right {
  left: auto;
  right: 1.8rem;
}

/* the dock: the tab bar, and above it Start a Game (Play) or the views (Aces) */
.home-dock {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: min(100%, 48rem);
  translate: -50% 0;
  padding: 0 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  pointer-events: none;
}
.home-dock > * {
  pointer-events: auto;
}
.dock-extra:empty {
  display: none;
}
/* it runs off the bottom of the screen, like the name tag and rules bar at the
   table: rounded on top, open at the foot, with room for the home indicator */
.tab-bar {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding: 0.4rem 0.6rem calc(0.2rem + var(--home-bar));
  border: 0.4rem solid var(--fw);
  border-bottom: 0;
  border-radius: 2.4rem 2.4rem 0 0;
  background: var(--fw3);
  box-shadow: 0.3rem 0.3rem 0 var(--shadow);
}
/* The tab showing takes more room and its icon grows a touch, its name under it.
   When the tab changes the bar takes its new arrangement at once and tabs.js
   flows everything to it (flowTabBar), so nothing here animates the layout. */
.tab-btn {
  position: relative;
  /* each as wide as its own icon, the room left over shared out evenly between them */
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  place-items: center;
  /* every tab keeps the same room under its icon for a name, so nothing shifts
     up or down as the name comes and goes */
  padding: 0.4rem 0 3.2rem;
  color: var(--c);
  --fill: var(--c2);
  --stroke: var(--c);
}
.tab-btn.on {
  padding-inline: 3.5rem; /* (room for an arrow either side of it) */
}
/* (the first and last item have an arrow on one side only: no room is kept on the other;
   the arrows are the bar's last two children) */
.tab-btn.on:first-child {
  padding-left: 0;
}
.tab-btn.on:nth-last-child(3) {
  padding-right: 0;
}
/* (their names stay under the icon, which is no longer in the middle of its button) */
.tab-btn.on:first-child .tab-label {
  left: calc(50% - 1.75rem);
}
.tab-btn.on:nth-last-child(3) .tab-label {
  left: calc(50% + 1.75rem);
}
/* (sizes change on `transform`, which every browser animates on the GPU) */
.tab-btn .tab-ico {
  display: grid;
  place-items: center;
  height: 4.4rem;
  transition: transform 0.64s cubic-bezier(0.4, 0, 0.1, 1);
}
.tab-btn.on .tab-ico {
  transform: scale(1.2);
}
.tab-btn:active .tab-ico {
  transform: scale(0.95);
  transition-duration: 0.15s;
}
.tab-btn.on:active .tab-ico {
  transform: scale(1.14);
}
/* the name sits under the icon, out of the layout: it only fades and lifts into place */
.tab-btn .tab-label {
  position: absolute;
  left: 50%;
  /* (room round the word inside its own box, taken back off where it sits: Safari draws
     a fading, moving word on a layer only as big as its box, and cut off what hangs
     past it, the tail of a "y", a "g" or a "p") */
  bottom: calc(0.4rem - 0.4rem);
  padding: 0.4rem 0.4rem;
  transform: translate(-50%, -0.4rem);
  opacity: 0;
  color: var(--ct);
  font: 700 1.8rem/1 var(--text);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.35s ease;
}
.tab-btn.on .tab-label {
  opacity: 1;
  transform: translate(-50%, 0);
  /* (it follows the icon in, a beat behind) */
  transition: opacity 0.45s ease 0.14s, transform 0.64s cubic-bezier(0.4, 0, 0.1, 1) 0.06s;
}
/* The arrows: one pair for the whole bar, stickers in the colors of the tab
   showing, standing either side of its icon. tabs.js puts them there and carries
   them across when the tab changes; at the first and last tab the one with
   nowhere to go shrinks away. */
.tab-arrow {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 4.4rem;
  --fill: var(--c2);
  --stroke: var(--c);
  transition: opacity 0.25s ease, transform 0.34s var(--glide);
}
.tab-arrow.off {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
  pointer-events: none;
}
.tab-arrow:active {
  transform: translate(-50%, -50%) scale(0.88);
  transition-duration: 0.12s;
}
/* (they change color on the way: the old colors, on a copy laid over the arrow, fade away; see flowTabBar) */
.tab-arrow > .ico {
  grid-area: 1 / 1;
}
.tab-arrow > .ico.ghost {
  pointer-events: none;
  will-change: opacity;
}
.tab-btn .badge {
  position: absolute;
  top: 0;
  right: calc(50% - 3.4rem);
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 0.5rem;
  border-radius: 1.1rem;
  display: grid;
  place-items: center;
  background: var(--c);
  color: var(--c2);
  font: 700 1.3rem/1 var(--text);
}
/* (on Play, friend requests sit on the other side of the icon from the Ranked queue's count) */
.tab-btn .badge.left {
  right: auto;
  left: calc(50% - 3.4rem);
}
/* (on the tab showing, the icon is bigger and has an arrow either side: its counts ride higher, clear of them) */
.tab-btn.on .badge {
  top: -0.9rem;
  right: calc(50% - 3rem);
}
.tab-btn.on .badge.left {
  right: auto;
  left: calc(50% - 3rem);
}
.tab-btn .badge[hidden] {
  display: none;
}

/* Play: Start a Game, and the ways to play that rise out of it */
.start-game {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.start-modes {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.start-modes[hidden] {
  display: none;
}
.start-game .btn {
  min-height: 6.4rem;
  font-size: 2.2rem;
  box-shadow: 0.3rem 0.3rem 0 var(--shadow);
}
.start-game .btn .sub {
  margin-top: 0.4rem;
  font-size: 1.4rem;
}
/* open, Start a Game is the same yellow button saying Close, greyed back */
.start-btn {
  transition: filter 0.25s, transform 0.28s var(--spring), box-shadow 0.2s;
}
.start-btn.dimmed {
  filter: saturate(0.3) opacity(0.75);
}
.start-scrim {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: color-mix(in srgb, var(--ink) 35%, transparent);
  backdrop-filter: blur(2px);
}
.start-scrim[hidden] {
  display: none;
}
/* Start a Game's corner badges, side by side: the resume mark, then the queue count */
.btn .start-corner {
  position: absolute;
  top: -1rem;
  right: -0.6rem;
  display: flex;
  gap: 0.4rem;
}
.btn .start-corner .badge {
  position: static;
}
/* the resume mark: just the green play icon, as Resume your table has it in the list */
.btn .resume-badge {
  display: grid;
  place-items: center;
  margin-top: -0.4rem;
  --fill: var(--c2);
  --stroke: var(--c);
}

/* Play: today's puzzle */
.puzzle-section {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}
.puzzle-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.4rem;
  /* the scores fill the height of the hand beside them, however many there are */
  align-items: stretch;
}
.puzzle-hand .example-hand {
  margin: 0;
  grid-template-columns: repeat(3, 4.411rem);
}
/* (a still picture: each card simply shows the side it lies on, no 3D turn) */
.puzzle-hand .card-flip {
  transform: none !important;
}
.puzzle-hand .face {
  transform: none !important;
}
.puzzle-hand .example-card.is-face .face.back,
.puzzle-hand .example-card:not(.is-face) .face.front {
  display: none;
}
.puzzle-hand .example-card {
  animation: row-in 0.45s var(--spring) calc(var(--i, 0) * 45ms) both;
}
/* Best Scores: a row each, a set gap apart, the leader in yellow. The card is as
   tall as the hand beside it; the list fills it and scrolls inside it when there
   are more scores than fit (it is laid over the card, so it never makes it taller). */
.puzzle-board {
  min-width: 0;
  min-height: 11rem;
  padding: 0;
}
/* The scroller is the whole card, edge to edge, with no padding of its own: the
   room around the rows belongs to the list inside it, so it scrolls away with them
   and nothing is cut off short of the card's edge. */
.pb-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: inherit;
}
.pb-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-height: 100%;
  padding: 1.6rem 1rem 1rem;
}
/* (the card's name stays on top of the rows passing under it) */
/* the names in the box's own primary text color: its dark blue */
.puzzle-board .pb-name {
  color: var(--ct);
}
/* (more scores on the way: the line at the end of the list) */
.puzzle-board .pb-loading {
  color: var(--ct);
}
.puzzle-board > .box-label {
  z-index: 1;
}
/* nobody has finished it yet: the line sits in the middle of the card */
.pb-list.empty {
  justify-content: center;
  align-items: center;
}
.pb-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.4rem;
  animation: row-in 0.4s var(--spring) calc(var(--i, 0) * 50ms) both;
  /* avatar and margin as stickers: the accent for the edge, its light shade for the fill */
  --fill: var(--c2);
  --stroke: var(--c);
}
/* (the leader in gold) */
.pb-row.first {
  --fill: var(--p3b);
  --stroke: var(--p3);
}
.pb-ava {
  display: grid;
  place-items: center;
}
.pb-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fw-text);
  font: 700 1.5rem/1.2 var(--text);
}
/* a player's MMR after their name, lighter than the name: the secondary text color */
.pb-mmr {
  margin-left: 0.5rem;
  font: 700 0.8em/1 var(--text);
  color: var(--gray);
}
/* the margin: the accent itself for the fill, with a white edge (as a friend's points are) */
.pb-score {
  font: 700 1.7rem/1 var(--round);
  white-space: nowrap;
  --fill: var(--c);
  --stroke: var(--paper);
  --sw: 0.5rem;
  --shx: 0.2rem;
  --shy: 0.2rem;
}
/* (the leader's in gold) */
.pb-row.first .pb-score {
  --fill: var(--p3);
}
.pb-empty {
  margin: 0;
  font: 700 1.4rem/1.35 var(--text);
  text-align: center;
  color: var(--fw-text);
}
.solve-btn {
  min-height: 6.4rem;
  font-size: 2.2rem;
}
.solve-btn .sub {
  margin-top: 0.4rem;
  font-size: 1.4rem;
}
/* (on `transform`, which every browser animates on the GPU) */
@keyframes row-in {
  from {
    opacity: 0;
    transform: translateY(0.8rem);
  }
}
@keyframes card-pop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}

/* Play: friends and recent matches */
.friend-row {
  display: grid;
  grid-template-columns: 4rem 1fr auto auto;
  align-items: center;
  gap: 0.8rem;
  min-height: 4.8rem;
  animation: row-in 0.4s var(--spring) calc(var(--i, 0) * 50ms) both;
}
.friend-ava {
  display: grid;
  place-items: center;
}
/* An offline friend's avatar is faded and greyed, in its colors alone: paler toward the
   box behind it, and (where the browser can) with most of the color taken out.
   Not by a filter or opacity on the avatar: on iPhone, Safari can leave a filtered
   sticker undrawn, or drawn where it used to be, once the list changes. This way it
   is drawn exactly as an online friend's is. */
.friend-row.offline .friend-ava {
  --fill: var(--c2);
  --stroke: color-mix(in srgb, var(--c) 45%, var(--c2));
  --shadow: rgb(0 0 0 / calc(var(--shadow-alpha) * 0.75));
}
@supports (color: oklch(from red l c h)) {
  .friend-row.offline .friend-ava {
    --fill: color-mix(in srgb, oklch(from var(--c2) l calc(c * 0.4) h) 75%, var(--c2));
    --stroke: color-mix(in srgb, oklch(from var(--c) l calc(c * 0.4) h) 75%, var(--c2));
  }
}
.friend-name {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  /* (a button to their profile, looking just like the name it is) */
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s var(--spring);
}
.friend-name:active {
  transform: scale(0.96);
}
.friend-name b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 2rem/1.2 var(--text);
}
.friend-name small {
  font: 700 1.2rem/1 var(--text);
  opacity: 0.8;
}
.friend-status {
  font: 700 1.3rem/1.2 var(--text);
  color: var(--c);
  text-align: right;
}
.friend-row.in_game .friend-status,
.friend-row.online .friend-status,
.friend-row.puzzle .friend-status {
  color: var(--ct);
}
.friend-row.online .friend-status::before,
.friend-row.in_game .friend-status::before,
.friend-row.puzzle .friend-status::before {
  content: "";
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: var(--p2);
  vertical-align: 0.1em;
  animation: live-dot 1.6s ease-in-out infinite;
}
.friend-row.online .friend-status::before {
  background: var(--fw);
  animation: none;
}
@keyframes live-dot {
  50% {
    opacity: 0.35;
    scale: 0.8;
  }
}
.friend-watch {
  display: grid;
  place-items: center;
  /* (orange binoculars, as Watch's own) */
  --fill: var(--p5b);
  --stroke: var(--p5);
  transition: transform 0.25s var(--spring);
}
.friend-watch:active {
  transform: scale(0.88);
}
.friends-empty {
  margin: 0.4rem 0 0.8rem;
  font: 700 1.5rem/1.35 var(--text);
}
.friends-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.6rem;
  color: var(--c);
  font: 700 1.5rem/1.2 var(--text);
  --fill: var(--c2);
  --stroke: var(--c);
}
.friends-box .btn.small {
  margin-top: 0.4rem;
}
.friend-add-form .btn {
  min-height: 5.6rem;
  font-size: 1.9rem;
}
.sheet-sub {
  margin: 1.8rem 0 0.8rem;
  font: 700 1.7rem/1.2 var(--text);
}
.friend-req .btn.small {
  min-height: 4rem;
  padding: 0.4rem 1rem;
  font-size: 1.4rem;
}
.mh-row {
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: scale 0.2s var(--glide);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0 0.6rem 0.2rem;
  animation: row-in 0.4s var(--spring) calc(var(--i, 0) * 60ms) both;
}
.mh-row:active {
  scale: 0.98;
}
.mh-player .you-star {
  flex: none;
}
.match-sheet .btn {
  /* (as wide as the sheet, like Show my stats on the You tab) */
  width: 100%;
  margin-top: 1.2rem;
}
.mh-more {
  padding: 0.8rem 0 0.4rem;
  text-align: center;
  color: var(--fw);
  font: 700 1.5rem/1.2 var(--text);
}
/* (a column of its own, so every row's names line up) */
.mh-kind {
  display: grid;
  place-items: center;
  width: 3.2rem;
  --fill: var(--c2);
  --stroke: var(--c);
}
.mh-players {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
/* each player: their avatar (the winner's in yellow, the rest in green), name and MMR */
.mh-player {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  font: 700 1.7rem/1.2 var(--text);
  color: var(--fw-text);
  --fill: var(--fw3);
  --stroke: var(--fw);
}
/* (the winner's trophy keeps the usual look: yellow in a white edge) */
.mh-player.won {
  --fill: var(--p3);
  --stroke: var(--paper);
}
.mh-ava {
  display: grid;
  place-items: center;
  flex: none;
  width: 3rem;
}
.mh-player b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mh-mmr {
  flex: none;
  margin-left: 0.4rem;
  font-size: 1.3rem;
  color: var(--fw);
}
/* what the series did to their MMR: quiet, green for gained and red for lost */
.mh-delta {
  flex: none;
  margin-left: 0.3rem;
  font-size: 1.3rem;
  opacity: 0.8;
}
.mh-delta.up {
  color: var(--fw);
}
.mh-delta.down {
  color: var(--p2);
}
.mh-when {
  padding-right: 0.4rem;
  color: var(--fw);
  font: 700 1.6rem/1.2 var(--text);
  white-space: nowrap;
}
.mh-rule {
  margin: 0.4rem 0;
  border: 0;
  border-top: 0.2rem solid color-mix(in srgb, var(--c) 45%, transparent);
}

/* Watch: a card for each game in play */
.watch-cards {
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
  margin-top: 0.6rem;
}
.watch-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1.8rem 1.2rem 1rem;
  box-shadow: 0.3rem 0.3rem 0 var(--shadow);
  animation: row-in 0.45s var(--spring) calc(var(--i, 0) * 70ms) both;
  transition: transform 0.28s var(--spring), box-shadow 0.2s;
}
.watch-card:active {
  transform: scale(0.97);
  box-shadow: none;
}
.wc-players {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 1rem 0.6rem;
}
.wc-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-width: 9rem;
  color: var(--s4t);
}
.wc-who {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.wc-who > span {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.wc-who b {
  font: 700 1.45rem/1.15 var(--text);
  color: var(--s4t);
}
.wc-who small {
  font: 700 1.1rem/1.1 var(--text);
  color: var(--s4);
}
/* a player's wins and points: their color, in a white edge */
.wc-score {
  display: flex;
  align-items: baseline;
  font: 700 3.8rem/1 var(--round);
  --fill: var(--c);
  --stroke: var(--paper);
  --sw: 0.7rem;
}
.wc-score .pts {
  margin-left: 0.3rem;
  font-size: 1.5rem;
  --sw: 0.45rem;
}
.wc-pair {
  display: flex;
  gap: 1rem;
}
.wc-foot {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
  font: 700 1.4rem/1.2 var(--text);
  --fill: var(--c2);
  --stroke: var(--c);
}
.wc-kind {
  margin-left: auto;
}
.watch-empty {
  margin: 0;
  padding: 1.4rem;
  border: 0.3rem dashed color-mix(in srgb, var(--fw) 70%, transparent);
  border-radius: 1.8rem;
  text-align: center;
  color: var(--fw-text);
  font: 700 1.5rem/1.35 var(--text);
}
/* Watch's Refresh: the arrow sticker over its name, like Back and Close */
.watch-refresh {
  align-self: center;
  margin-top: 0.4rem;
  font: 700 1.8rem/1.2 var(--text);
  color: var(--fw-text);
}

/* Aces: Records, Solo and PvP, picked on the strip above the tab bar */
.aces-tabs {
  display: flex;
  justify-content: space-around;
  padding: 0.4rem 0.4rem 0.2rem;
  box-shadow: 0.3rem 0.3rem 0 var(--shadow);
}
.aces-tab {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0;
  color: var(--fw-text);
  font: 700 1.8rem/1.1 var(--text);
  --fill: var(--fw3);
  --stroke: var(--fw);
  transition: transform 0.4s var(--glide), color 0.3s ease;
}
.aces-tab > .tilt {
  height: 3.1rem;
  display: grid;
  place-items: center;
}
.aces-tab.on {
  color: var(--ct);
  --fill: var(--c2);
  --stroke: var(--c);
}
.aces-tab:active {
  transform: scale(0.96);
}
/* the sticker arrow over the view showing, half over the strip's edge: one for
   the strip, standing over the middle of that view's third of it (--at: 0, 1 or
   2); tabs.js slides it across when the view changes */
.aces-tabs {
  position: relative;
}
.aces-pointer {
  position: absolute;
  top: -0.9rem;
  left: calc(0.4rem + (100% - 0.8rem) * (var(--at, 0) + 0.5) / 3);
  transform: translateX(-50%);
  z-index: 1;
  display: grid;
  --fill: var(--c2);
  --stroke: var(--c);
  color: var(--c);
  pointer-events: none;
}
.aces-body .leader-body > .records {
  margin-top: 0.8rem;
}

/* You: your look, your emotes, your records and stats */
.you-profile {
  position: relative;
  gap: 0.8rem;
  margin-bottom: 0; /* (the account button follows straight on, at the tab's own spacing) */
}
.you-profile .field {
  margin-top: 0.8rem;
}
/* "Saved" shows under the field's corner for a moment, taking no room of its own */
.you-profile .profile-status {
  position: absolute;
  right: 0.6rem;
  top: 100%;
  min-height: 0;
  margin: 0;
  font-size: 1.3rem;
  pointer-events: none;
}

/* A Sign in button with Google's own laid invisibly over it (app.js: signInButton):
   it looks like ours and presses like Google's, so a tap goes straight to Google. */
.signin-wrap {
  position: relative;
  display: grid;
  min-width: 0;
}
.signin-wrap.small:not(.you-signin) {
  justify-self: start;
  align-self: flex-start;
}
.google-cover {
  position: absolute;
  left: 0;
  top: 0;
  height: 44px;
  overflow: hidden;
  transform-origin: 0 0;
  transform: scale(var(--gx, 1), var(--gy, 1));
  opacity: 0;
  z-index: 1;
}
.google-cover:empty {
  display: none;
}
/* the account button: its sticker, then its two lines, from the left */
.btn.you-signin {
  justify-content: flex-start;
  gap: 1rem;
  padding-left: 1.6rem;
  text-align: left;
}
.you-signin .sub {
  font-size: 1.3rem;
}
.you-empty {
  text-align: center;
}
.you-records {
  margin-top: 0;
}
.emote-compact {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.emote-box {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.8rem 1.2rem 1.2rem;
  border: 0.4rem solid var(--ink);
  border-radius: 2rem;
  background: var(--paper);
  box-shadow: 0.3rem 0.3rem 0 var(--shadow);
  --c: var(--ink);
  --c2: var(--paper);
}
.emote-box.off {
  border-style: dashed;
  border-color: var(--fw);
  background: transparent;
  box-shadow: none;
  --c: var(--fw);
  --c2: var(--fw3);
}
.emote-box > .box-label {
  position: absolute;
  left: 1.6rem;
  top: -1.3rem;
  font: 700 1.5rem/1.4 var(--text);
  color: var(--c2);
  -webkit-text-stroke: 0.5rem var(--c);
  paint-order: stroke fill;
  pointer-events: none;
}
.emote-compact .emote-choices {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  margin: 0;
  gap: 0.6rem;
}
.emote-compact .emote-choices.faces {
  flex-wrap: wrap;
}
.emote-compact .emote-choices.faces .emote-choice {
  width: 4.6rem;
  height: 4.6rem;
}
.emote-compact .emote-choices.words .emote-choice {
  height: 3.6rem;
  font-size: 1.4rem;
}
.emote-compact .emote-box.off .emote-none,
.emote-compact .emote-choices:empty,
.emote-compact .emote-box.off .emote-choices:not(:has(.emote-item)) {
  display: none;
}
.emote-compact .emote-box.on .emote-none {
  font: 700 1.35rem/1.3 var(--text);
  color: color-mix(in srgb, var(--ink) 55%, var(--paper));
}
.emote-all {
  margin: 0;
  font: 700 1.4rem/1.3 var(--text);
  color: var(--fw-text);
}
.emote-tip {
  margin: -0.8rem 0 0;
  font-size: 1.35rem;
}

/* Flags: achievements to earn, two columns */
/* Flags are laid out and drawn as the records are (.records, .record-slot,
   .record-card); only what a flag unlocks, in place of a record's number, is its own. */
.flag-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
  align-items: start;
  margin-top: 1.6rem;
}
.flag-col {
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
  min-width: 0;
}
/* (each hugs what is on it, with the same room on every side) */
.flag-grid .record-card {
  flex: none;
  padding: 1.6rem;
}
/* (with less room at the top, the corner badge sits further out, clear of the name) */
.flag-grid .record-card > .record-ico {
  top: -2.2rem;
  left: -1.4rem;
}
/* how far along a flag not yet earned is: a sticker percent to the right of the hourglass,
   in its colors */
.flag-card > .record-ico {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
/* (the note under the flags, on which games count) */
.flags-note {
  margin-top: 0.4rem;
  text-align: center;
}
.flag-pct {
  font: 700 2.8rem/1 var(--round);
  --sw: 0.6rem;
}
/* (what a flag unlocks is named in the card's own color, as large as the card's words) */
.flag-card .record-note {
  color: var(--c);
  opacity: 1;
}
.flag-card p.record-note {
  font-size: 1.35rem;
}
/* (the kind of thing it unlocks, right under the thing itself: closer to it than to the
   words that follow) */
.flag-card p.flag-kind {
  margin-top: -0.6rem;
}
/* what a flag unlocks, kept under a lock until it's earned */
.flag-art {
  display: grid;
  place-items: center;
  flex: none;
  margin: 0.4rem 0;
  --fill: var(--paper);
  --stroke: var(--ink);
}
.flag-art.f-word {
  width: 10rem;
  height: 3.6rem;
  border: 0.3rem solid var(--ink);
  border-radius: 1.2rem;
  background: var(--paper);
}
/* a theme: the Golf logo in that theme's own colors, well out of focus (straight
   on the card, nothing behind it), with the lock (in focus) over it */
.flag-art.f-theme {
  position: relative;
  width: 13.6rem;
  height: 6rem;
  /* (the blurred logo painted as one piece; its glow free to spread past the box) */
  isolation: isolate;
}
/* Nothing in the blurred logo moves: on Safari an animated letter is drawn on a
   layer of its own, outside the blur, and showed as a dark smear beside it. */
.flag-art.f-theme .logo,
.flag-art.f-theme .logo * {
  animation: none !important;
  transition: none !important;
}
.flag-art.f-theme .logo {
  position: absolute;
  left: 50%;
  top: 50%;
  /* (the top bar's logo, at a little under two thirds its size) */
  transform: translate(-50%, -50%) scale(0.6);
  /* (measured before the logo is scaled down: about 1.2rem as seen) */
  filter: blur(2rem);
  /* (in the colors of the theme the flag unlocks: given by tabs.js, on the logo itself) */
  --shadow-alpha: 0.25;
  pointer-events: none;
}
.flag-art.f-theme > .ico {
  position: relative;
}
/* Earned: the reward itself, in focus and unlocked (the logo, the face, the saying, the card) */
.flag-art.open.f-theme .logo,
.flag-art.open.f-face img {
  filter: none;
}
.flag-art.open.f-word {
  width: auto;
  min-width: 10rem;
  padding: 0 1.2rem;
  color: var(--ink);
  font: 700 1.6rem/1 var(--text);
  white-space: nowrap;
}
.flag-art.open.f-card .face.front {
  display: flex;
}
.flag-art.open.f-card .face.back {
  display: none;
}
/* a face emote: the emote itself, out of focus, under the lock */
.flag-art.f-face {
  position: relative;
  width: 5.6rem;
  height: 5.6rem;
}
.flag-art.f-face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: blur(1.6rem);
}
/* a card skin: the back of a card, under the lock */
.flag-art.f-card {
  position: relative;
  width: 4.411rem;
  height: 6.15rem;
}
.flag-art.f-card .example-card {
  position: absolute;
  inset: 0;
}
/* (a still picture: the card simply shows its back, no 3D turn) */
.flag-art.f-card :is(.card-flip, .face) {
  transform: none !important;
}
.flag-art.f-card .face.front {
  display: none;
}
.flag-art:is(.f-face, .f-card) > .ico {
  position: relative;
}

/* ---------- the Daily Puzzle at the table: its panel where an opponent would sit ---------- */
.board .b-top[hidden] {
  display: none;
}
/* today's best margins, in the white card a game's points graph comes in */
.pz-leaders {
  padding-bottom: 0.4rem;
}
/* (four rows show; the rest of the day's board scrolls inside the card) */
.pz-leaders-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  /* it shows four whole rows, and a scroll always comes to rest on a whole row: no
     avatar is left cut in half at the top or bottom */
  max-height: calc(var(--pz-pad) + 4 * var(--pz-row));
  scroll-snap-type: y mandatory;
}
.pz-leaders {
  /* (a row: its avatar sticker, edge and shadow included, and a little room around it;
     the box ends exactly where the fifth row begins, so none of it shows) */
  --pz-row: 5.2rem;
  --pz-gap: 0rem;
  --pz-pad: 0.2rem;
}
.pz-leaders .pb-row {
  min-height: var(--pz-row);
  scroll-snap-align: start;
  scroll-margin-top: var(--pz-pad);
}
.pz-leaders-scroll::-webkit-scrollbar {
  display: none;
}
.pz-leaders .pb-list {
  min-height: 0;
  gap: var(--pz-gap);
  padding: var(--pz-pad) 0.6rem var(--pz-pad) 0.8rem;
}
/* Aces: each ranked player's avatar by their name (a set width: the names line up) */
/* (the avatar beside the name only, on its line: not beside the stats under it) */
.board-row .lb-name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.board-row .lb-ava {
  flex: none;
  display: grid;
  place-items: center;
}
.leader-hero .lb-hero-ava {
  display: inline-grid;
  vertical-align: middle;
  margin-right: 0.4rem;
}
/* each player's place, before their avatar: lighter than the name, all one color, a set width so the avatars line up */
.pb-rank {
  flex: none;
  min-width: 1.2rem;
  text-align: left;
  font: 700 1.7rem/1 var(--round);
  color: var(--gray);
}
.pb-row.ranked {
  grid-template-columns: auto auto 1fr auto;
}
.pz-leaders .pb-ava {
  width: 4rem; /* (names line up whatever the avatar's shape) */
}
/* the names in the primary text color, a size up */
.pz-leaders .pb-name {
  font-size: 2.1rem;
  color: var(--black);
}
/* (under each name, how many tries they have had today: the secondary text color) */
.pb-who {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
}
.pb-tries {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 1.4rem/1.1 var(--text);
  color: var(--gray);
}
.pz-leaders .pb-score {
  font-size: 2.6rem;
  --sw: 0.6rem;
}
/* "pts" after each margin, smaller, as a score's unit is everywhere */
.pz-leaders .pb-score .pts {
  margin-left: 0.15rem;
  font-size: 0.6em;
  --sw: 0.45rem;
}
/* a row that opens a profile is a plain button, laid out as the others are */
button.pb-row {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.puzzle-result .ready-tile .who .name {
  font: 700 1.4rem/1.2 var(--text);
}

/* each player's avatar in their seat color; two players share the row evenly */
.wc-who {
  --fill: var(--c2);
  --stroke: var(--c);
}
.wc-players.n2 .wc-player {
  flex: 1 1 0;
  min-width: 0;
}
.wc-pair {
  gap: 0.6rem;
}
.wc-pair .wc-score {
  font-size: 3.2rem;
}
/* scores too long to sit side by side (see watchCardHtml): a row for each player */
.wc-players.n2.tall {
  flex-direction: column;
  align-items: center;
  row-gap: 1.2rem;
}
.wc-players.n2.tall .wc-player {
  flex: none;
}

/* Reduced motion on the home screen (the device's setting, or Settings > Reduce
   motion): things on a page do not animate in, and the tab bar changes without
   growing or sliding; only its fades are left. (tabs.js skips the slides.) */
:root.reduce-motion .tab-pane *,
:root.reduce-motion .home-dock * {
  animation: none !important;
}
:root.reduce-motion .tab-btn .tab-ico,
:root.reduce-motion .tab-btn .tab-label,
:root.reduce-motion .tab-arrow {
  transition: opacity 0.2s ease;
}
@media (prefers-reduced-motion: reduce) {
  .tab-pane *,
  .home-dock * {
    animation: none !important;
  }
  .tab-btn .tab-ico,
  .tab-btn .tab-label,
  .tab-arrow {
    transition: opacity 0.2s ease;
  }
}

/* The things on a home page animate in only when the page is opened by a press
   (a tab, or Records / Solo / PvP), which marks it .entering. Pages are built
   ahead of time and kept, so without this they would play it unseen, or again
   part-way through a swipe. A page swiped in arrives as it is. */
.tab-pane:not(.entering) :is(.leader-hero, .leader-list .board-row, .record-slot, .puzzle-hand .example-card, .pb-row, .friend-row, .mh-row, .watch-card) {
  animation: none;
}

/* points in a match's table: the board's sticker numbers, on one line and a little smaller */
.pts-inline {
  display: inline-flex;
  align-items: baseline;
  font: 700 2rem/1 var(--round);
  white-space: nowrap;
  /* (the player's color, in a white edge) */
  --fill: var(--c);
  --stroke: var(--paper);
  --sw: 0.5rem;
  --shx: 0.2rem;
  --shy: 0.2rem;
}
.pts-inline .pts {
  margin-left: 0.1rem;
  font-size: 1.3rem;
  letter-spacing: -0.04rem;
  --sw: 0.4rem;
}

/* a player at the head of their column in a match's table: their avatar in their
   seat's color (its edge the color, its fill the lighter one), then their name */
/* (its cells sit a little closer, so two players and the winner fit a phone's width) */
.match-table {
  font-size: 1.3rem;
}
/* (its row lines in the lighter rule Your Matches uses between matches, not the card's
   full border color) */
.match-table :is(th, td) {
  border-bottom-color: color-mix(in srgb, var(--c) 45%, transparent);
}
.match-table :is(th, td) {
  padding-inline: 0.3rem;
  vertical-align: middle;
}
/* (with room between the columns: the first keeps its 0.3rem to the card's edge) */
.match-table :is(th, td) + :is(th, td) {
  padding-left: 1.4rem;
}
/* a match's table still to be drawn (see fillMatchBody in app.js): the room it will take,
   which its rows fill from the top */
.match-lazy > .loading {
  margin: 0;
  padding: 1.2rem 0;
}
/* ...a part at a time, each part a table of its own under the last, with the first one's
   columns: so a part that is not the last keeps the line under its last row */
.match-table.match-part {
  table-layout: fixed;
}
.match-lazy > .table-wrap > :not(:last-child) > .match-table > tbody > tr:last-child > :is(th, td) {
  border-bottom: 0.2rem solid color-mix(in srgb, var(--c) 45%, transparent);
}
/* each later part in a box the browser leaves undrawn while it is off the screen (so a
   long table costs what is showing of it, not all of it); as wide as the first part,
   which a table of many players makes wider than the card (its frame scrolls sideways) */
.match-rows {
  content-visibility: auto;
}
/* a player in a match's table opens their profile */
button.mt-player {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button.mt-player:active {
  transform: scale(0.96);
}
.mt-player {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  gap: 0.3rem;
  white-space: nowrap;
}
.mt-ava {
  display: grid;
  place-items: center;
  flex: none;
  --fill: var(--c2);
  --stroke: var(--c);
}

/* the match pop-up's head: its name with its chips under it, beside Close */
.sheet .sheet-head > .match-head {
  /* (as a sheet's title sits: floated left, the room for Close kept clear) */
  float: left;
  max-width: calc(100% - 9rem);
  margin-bottom: 1.4rem;
}
.match-head h2 {
  font-size: 2.4rem;
  line-height: 1.1;
}
.match-head .meta {
  margin-top: 0.6rem;
}

/* a saved match's overall winner: the trophy, the words, then the winner, on one line and level */
.match-winner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.6rem;
  margin-top: 1rem;
}

/* Match history is laid out as the home screen is (.page.home.tabbed), its bar at the
   foot of the screen as the home screen's tab bar is */

/* ---------- every page's head, in the home screen's style ----------
   A page's name is set on an arch in sticker letters, centered (tabTitle), with
   its line of explanation under it; a section within the page has the same a
   size down (sectionTitle). */
.page > .tab-head {
  margin-bottom: 0.4rem;
}
.tab-title.section {
  margin-top: 0.8rem;
  text-align: center;
  font-size: 2.6rem;
  --sw: 0.6rem;
}
/* (a seat's own page, in Pass & Play, takes that seat's colors) */
.tab-title.seat {
  --fill: var(--c2);
  --stroke: var(--c);
}
/* what else sits at the head of a page (Refresh, Leave): centered under its name */
.page-extra {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-top: -0.6rem;
}
.meta.center {
  justify-content: center;
}

/* a title with an action (Refresh, Leave): the title keeps to the middle, the action to its right */
.head-row {
  position: relative;
}
.head-action {
  position: absolute;
  right: 0;
  top: 1.2rem;
  display: flex;
}
.head-action .watch-refresh {
  margin: 0;
  font-size: 1.4rem;
}

/* ---------- bordered text, everywhere ----------
   Every piece of text drawn with an outline has its corners cut flat (Figma's
   "join: bevel"): the default, a mitered join, throws a spike out past the outline
   wherever two strokes meet at a sharp angle (the foot of an N, the points of an
   M or a W). */
.stk,
.field > .label,
.rules-box > .label,
.corner b,
.emote-bar-name,
.summary.floating .result-title small,
.leader-hero .stat-rate.streak-rate,
.board-row .rate .streak-num,
.boxed > .box-label,
.emote-box > .box-label {
  stroke-linejoin: bevel;
}

/* What is written inside a dashed box (an empty list, the emotes not on your bar)
   is in the fairway's own green, like the dashes around it. */
.watch-empty,
.emote-box.off .emote-all,
.emote-box.off .emote-none,
.emote-choices > .emote-none {
  color: var(--fw);
}

/* ---------- a player's profile (its own page, or a sheet at the table) ---------- */
.profile-body {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
/* who they are: their avatar in their color, their name with their MMR after it, and
   their @name and when they were last on */
.profile-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  --fill: var(--c2);
  --stroke: var(--c);
}
.profile-ava {
  /* (a thicker edge than a sticker this size usually has, on a deeper shadow) */
  --shx: 0.5rem;
  --shy: 0.6rem;
  display: grid;
  place-items: center;
  min-height: 8.4rem;
  padding: 0.6rem 0 0.8rem; /* (a tall avatar keeps clear of the name under it) */
}
/* the name in the head's accent's primary text color: dark blue on a profile page */
.profile-name {
  margin: 0.4rem 0 0;
  font: 700 2.8rem/1.1 var(--text);
  color: var(--ct);
}
.profile-name small {
  margin-left: 0.6rem;
  font: 700 1.8rem/1 var(--text);
}
.profile-sub {
  margin: 0.2rem 0 0;
  font: 700 1.4rem/1.3 var(--text);
  color: var(--c);
}
.btn.profile-friend {
  width: 100%;
  justify-content: center;
}
/* their numbers */
.profile-rows .board-row {
  animation: none;
}
.profile-rows .rate small {
  margin-left: 0.3rem;
}
/* the two players being compared, side by side, then their numbers */
.profile-versus {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.profile-pick {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  font: 700 1.8rem/1.2 var(--text);
}
.profile-pick b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-compare .match-table :is(th, td) {
  text-align: center;
}
.profile-compare .match-table tbody th {
  color: var(--c);
}
/* in the sheet at the table the titles are a size down, and the sheet's own heading is not needed */
.profile-sheet .sheet-head h2:empty {
  display: none;
}
.profile-sheet .tab-title.section {
  margin-top: 1.2rem;
}
.profile-page > [data-profile-holder] {
  padding-bottom: 3rem;
}

/* what is being played at this table, at the head of a player's sheet: a filled
   well, as the scores on a rules sheet are */
.series-info {
  padding: 1.2rem 1.4rem;
  border-radius: 1.8rem;
  background: rgb(255 255 255 / 0.55);
}
:root:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) .series-info {
  background: color-mix(in srgb, var(--c2) 55%, #000);
}
.series-info .tally.plain {
  padding: 0;
  background: none;
}
/* The table scrolls sideways at a table of many players. Its scroller runs the
   full width of the card (out through the card's own padding, which it gives back
   inside as its own), so the columns slide out under the card's edge instead of
   being cut off short of it. */
.series-info {
  overflow: hidden;
}
.series-info .table-wrap {
  margin: 0 -1.4rem -0.6rem;
  padding: 0.4rem 1.4rem 0.6rem;
}
.series-info h3 {
  margin: 0 0 0.6rem;
}
.series-info .meta {
  margin-bottom: 0.8rem;
}
.series-info .tally:empty {
  display: none;
}
/* (on a sheet in the player's color, their name is in that color's own text) */
.profile-sheet .profile-name {
  color: var(--ct);
}

/* a chip that is a button (the rules in play, on a player's sheet) */
.pill.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: scale 0.15s ease;
}
.pill.pill-btn:active {
  scale: 0.95;
}

/* Where the star and the name are laid out with a gap between them (a row of avatar,
   star, name), the gap would add to the star's own spacing: it is taken back, so the
   star sits as close to the name there as anywhere else. */
.mt-player .you-star,
.mh-player .you-star {
  margin-right: calc(0.12em - 0.3rem);
}
/* A player's sheet has no title of its own: their avatar comes right up to the top
   edge, beside Close (which keeps its corner, and still follows the sheet down). */
/* (Close keeps floating in its corner and following the sheet down, but gives up the
   room under it: what comes after starts at the sheet's top edge, beside it.) */
.profile-sheet .sheet-head > .close-btn {
  margin-bottom: -7.4rem;
}
.profile-sheet .profile-ava {
  padding-top: 0;
}

/* On a phone the tab bar runs the full width of the screen, out through the dock's
   side padding, so its edges meet the screen's. (The strip above it keeps its inset.) */
@media (max-width: 560px) {
  .home-dock > .tab-bar {
    margin-inline: -1.6rem;
  }
}
/* (on a wider screen it reaches a little past the strip above it on each side) */
@media (min-width: 561px) {
  .home-dock > .tab-bar {
    margin-inline: -2.8rem;
  }
}
/* What scrolls by in the gap between the strip (Start a Game on Play, the views on
   Aces) and the tab bar is blurred, across the screen's width: from half way down the
   strip (fading in) to under the tab bar, which hides its foot.
   It stays on while the page scrolls and while pages slide (it is a thin band, cheap
   to work out again). */
.dock-extra {
  position: relative;
}
.dock-extra:not(:empty)::after {
  content: "";
  position: absolute;
  left: 50%;
  /* from half way down the strip to a little under the tab bar's top edge, fading in
     from nothing at its top so it has no hard edge there */
  top: 50%;
  height: calc(50% + 1rem + 1.6rem);
  width: 100vw;
  translate: -50% 0;
  z-index: -1;
  -webkit-backdrop-filter: blur(0.8rem);
  backdrop-filter: blur(0.8rem);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 55%);
  mask-image: linear-gradient(to bottom, transparent, #000 55%);
  pointer-events: none;
}
.home-dock:has(.start-game.open) .dock-extra::after,
.list-dock .dock-extra::after {
  display: none;
}

/* A page fading in (see revealPage): a screen's height of it, ready on its own layer
   (the rest is below the screen's edge then in any case: the page opens at its top) */
.tab-pane.revealing {
  max-height: 100vh;
  overflow-y: clip;
  will-change: opacity, filter;
}
.tab-pane.revealing.plain {
  will-change: opacity;
}

/* A phone saving its battery (see measureFrameRate): the stickers hold still, and the
   things on a page come in with the page rather than popping in one by one after it */
:root.low-fps .idle {
  animation: none;
  will-change: auto;
}
:root.low-fps .tab-pane :is(.leader-hero, .leader-list .board-row, .record-slot, .puzzle-hand .example-card, .pb-row, .friend-row, .mh-row, .watch-card) {
  animation: none;
}





/* ---------- the rough cut for each size ----------
   web/ui.js (roughCuts) marks every piece of sticker text with the rough cut of its
   typeface nearest its size on screen; these set it. (A scaled-down sticker says by
   how much in --grain-scale, so its cut is picked for the size it is seen at.) */
[data-cut="seurat-14"] {
  font-family: "Golf Rough Seurat 14", var(--text) !important;
}
[data-cut="seurat-20"] {
  font-family: "Golf Rough Seurat 20", var(--text) !important;
}
[data-cut="seurat-28"] {
  font-family: "Golf Rough Seurat 28", var(--text) !important;
}
[data-cut="seurat-40"] {
  font-family: "Golf Rough Seurat 40", var(--text) !important;
}
[data-cut="seurat-56"] {
  font-family: "Golf Rough Seurat 56", var(--text) !important;
}
[data-cut="seurat-80"] {
  font-family: "Golf Rough Seurat 80", var(--text) !important;
}
[data-cut="round-14"] {
  font-family: "Golf Rough Round 14", var(--round) !important;
}
[data-cut="round-20"] {
  font-family: "Golf Rough Round 20", var(--round) !important;
}
[data-cut="round-28"] {
  font-family: "Golf Rough Round 28", var(--round) !important;
}
[data-cut="round-40"] {
  font-family: "Golf Rough Round 40", var(--round) !important;
}
[data-cut="round-56"] {
  font-family: "Golf Rough Round 56", var(--round) !important;
}
[data-cut="round-80"] {
  font-family: "Golf Rough Round 80", var(--round) !important;
}
.flag-art.f-theme .logo {
  --grain-scale: 0.6;
}

/* At most three players to a row on a Watch card: each takes a third of the card (a
   fourth and fifth go to the next row, centered under the first three) */
.wc-players:not(.n2) .wc-player {
  flex: 0 0 calc((100% - 2 * 0.6rem) / 3);
  min-width: 0;
}
.wc-players:not(.n2) {
  justify-content: center;
  column-gap: 0.6rem;
}

/* a friend's name: two figures where your own has the star (a little wider than it) */
.friend-mark {
  width: 1.15em;
}

/* the tab bar's icons turn to their new lean as the current tab changes */
.tab-ico .tilt {
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}
/* the blur band under the strip above the tab bar comes and goes with the strip */
.dock-extra::after {
  transition: opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}
.dock-extra.blur-off::after {
  opacity: 0;
  transition-duration: 0.17s;
}
:root.reduce-motion .tab-ico .tilt,
:root.reduce-motion .dock-extra::after {
  transition: none;
}

/* A finished series on Watch (kept a minute): the winner's trophy, yellow in a white
   edge, in place of their avatar; everyone else greyed */
.wc-trophy {
  display: inline-grid;
  --fill: var(--p3);
  --stroke: var(--paper);
}
.watch-card.finished .wc-player.lost {
  filter: grayscale(1);
  opacity: 0.5;
}
/* (a card fading away takes no taps) */
.watch-card.wc-going {
  pointer-events: none;
  overflow: hidden;
}

/* A tournament on Watch: a big trophy beside its name and its matches in play */
.cup-main {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: 0.4rem 0.4rem 0;
}
.cup-trophy {
  flex: none;
  --fill: var(--p3);
  --stroke: var(--paper);
}
.cup-text {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  text-align: left;
}
.cup-name {
  font: 700 2.4rem/1.15 var(--text);
  color: var(--s4t);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cup-live {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font: 700 1.5rem/1.2 var(--text);
  color: var(--s4t);
  --fill: var(--c2);
  --stroke: var(--c);
}

/* ---------- the bracket: match cards ----------
   Each round is a column, its matches spread so each sits level with the two it follows
   from. A card's color says where its match has got to: orange while it is played,
   blue finished, green before it starts (players known or still to be decided). */
/* (the bracket runs the full width of the screen and scrolls sideways when it is wider) */
.bracket {
  gap: 1.6rem;
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  padding: 2rem 1.6rem 1.2rem;
  justify-content: safe center;
  overscroll-behavior-x: contain;
}
.bracket-round {
  gap: 2.2rem;
}
.bk-match {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 27rem;
  padding: 1.6rem 1.2rem 1rem;
  /* (its rows the full width, the score at the right: a button would gather them to the left) */
  align-items: stretch;
  text-align: left;
  color: var(--ct);
  box-shadow: 0.3rem 0.3rem 0 var(--shadow);
}
button.bk-match {
  font: inherit;
  cursor: pointer;
  transition: transform 0.28s var(--spring);
}
button.bk-match:active {
  transform: scale(0.97);
}
.bk-match > .box-label {
  left: 50%;
  translate: -50% 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
/* the binoculars on a live match's label: as its letters, pale in an orange edge */
.bk-match > .box-label .bk-label-ico {
  filter: none;
  --fill: var(--c2);
  --stroke: var(--c);
}
.bk-player,
.st-player {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  --fill: var(--c);
  --stroke: var(--paper);
}
.bk-ava {
  display: grid;
  place-items: center;
  flex: none;
  width: 3.2rem;
}
.bk-who {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.bk-who b {
  font: 700 1.5rem/1.15 var(--text);
  color: var(--fw-text, var(--ct));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bk-match .bk-who b {
  color: var(--ct);
}
.bk-who small {
  font: 700 1.2rem/1.1 var(--text);
  color: var(--c);
}
.bk-match .bk-who small {
  color: var(--bk-mmr, currentColor);
  opacity: 0.85;
}
.bk-match.c-s4 {
  --bk-mmr: var(--s4);
}
.bk-match.c-p1 {
  --bk-mmr: var(--p1);
}
.bk-score {
  flex: none;
  font-size: 3.2rem;
}
.bk-player.tbd .bk-who b {
  font-weight: 600;
}
/* the winner's trophy, yellow in a white edge; the loser greyed */
.bk-trophy {
  display: inline-grid;
  --fill: var(--p3);
  --stroke: var(--paper);
}
.bk-player.lost {
  filter: grayscale(1);
  opacity: 0.5;
}

/* ---------- standings: a card holding the table ---------- */
/* The table scrolls sideways edge to edge of the card: the room around it is the
   scroller's own padding (inside what scrolls), not the card's, so nothing is cut off
   short of the card's border. */
.standings-card {
  padding: 0;
  overflow: hidden;
}
.standings-card .table-wrap {
  margin: 0;
  padding: 0.8rem 1rem 0.4rem;
  border: 0;
  border-radius: inherit;
  background: none;
  box-shadow: none;
}
table.standings {
  width: 100%;
  border-collapse: collapse;
  font: 700 1.4rem/1.2 var(--text);
  color: var(--fw-text, var(--ct));
}
table.standings th[scope="col"] {
  padding: 0.6rem 0.4rem;
  border-bottom: 0.25rem solid var(--fw);
  font: 700 1.3rem/1.2 var(--text);
  text-align: center;
}
table.standings th[scope="col"]:first-child {
  width: 1%;
  padding-inline: 0.2rem 0.8rem;
  color: var(--fw);
}
table.standings th[scope="col"]:nth-child(2) {
  text-align: left;
}
table.standings td,
table.standings th[scope="row"] {
  padding: 0.7rem 0.4rem;
  text-align: center;
  border-bottom: 0.2rem solid color-mix(in srgb, var(--fw) 35%, transparent);
}
table.standings tr:last-child td,
table.standings tr:last-child th[scope="row"] {
  border-bottom: 0;
}
table.standings th[scope="row"] {
  color: var(--fw);
  font-weight: 700;
}
table.standings td:nth-child(2) {
  text-align: left;
}
table.standings .st-player small {
  color: var(--fw);
}
.st-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  --fill: var(--c2);
  --stroke: var(--c);
}

/* (the Rank column only as wide as its numbers) */
table.standings th[scope="row"] {
  width: 1%;
  padding-inline: 0.2rem 0.8rem;
}

/* a player in the standings opens their profile */
button.st-player {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.28s var(--spring);
}
button.st-player:active {
  transform: scale(0.96);
}

/* ---------- the tournament page's round selector ----------
   It follows the bracket: pinned to the foot of the screen while the bracket runs on
   below it, and in its own place under the bracket once that has been scrolled past. */
.round-dock {
  position: sticky;
  bottom: calc(1.2rem + env(safe-area-inset-bottom));
  z-index: 5;
  margin-top: 0.4rem;
}
.round-tabs .aces-tab span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  font-size: 1.5rem;
}
/* the bracket stops at each round's column */
.bracket {
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 1.6rem;
}
.bracket > .bracket-round {
  scroll-snap-align: start;
}
.round-tabs .aces-pointer {
  left: calc(0.4rem + (100% - 0.8rem) * (var(--at, 0) + 0.5) / var(--n, 3));
}
.round-tabs .aces-tab {
  flex: 1 1 0;
  min-width: 0;
}
/* a round's number in a ring, a sticker like the other selectors' icons */
.round-num {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 0.35rem solid var(--fw);
  border-radius: 50%;
  background: var(--fw3);
  color: var(--fw);
  font: 700 1.5rem/1 var(--round);
  box-shadow: 0.2rem 0.2rem 0 var(--shadow);
}
.aces-tab.on .round-num {
  border-color: var(--c);
  background: var(--c2);
  color: var(--c);
}

/* the standings' status, in the primary text color */
.st-status {
  color: var(--fw-text);
}

/* (the bracket scrolls sideways with no scrollbar: the round bar under it shows where you are) */
.bracket {
  scrollbar-width: none;
}
.bracket::-webkit-scrollbar {
  display: none;
}

/* the arrows carrying each winner on (drawn by drawBracketArrows), behind the cards */
.bracket {
  position: relative;
  gap: 5.6rem;
}
.bk-arrows {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}
.bk-arrows path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bk-arrows .edge {
  stroke: var(--paper);
  stroke-width: 8.5;
}
.bk-arrows .ink {
  stroke: var(--c);
  stroke-width: 3.5;
}
.bk-arrows g {
  filter: drop-shadow(0.2rem 0.2rem 0 var(--shadow));
}
.bracket > .bracket-round {
  position: relative;
  z-index: 1;
}

.round-dock[hidden] {
  display: none;
}

/* a round's name, over its topmost match */
.bk-round-name {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 1.8rem);
  translate: -50% 0;
  font: 700 1.5rem/1.2 var(--text);
  color: var(--fw-text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: none;
}
.bracket {
  padding-top: 5.2rem;
}

/* Player names in the bracket and standings: in the text color of the box they are in
   (its own --ct, noted before each row's player color takes the name --ct over) */
.bk-match {
  --box-text: var(--ct);
}
.bk-match .bk-who b {
  color: var(--box-text);
}
.standings-card .bk-who b {
  color: var(--fw-text);
}

/* the tournament's details, centered under its name */
.tournament-page .meta {
  justify-content: center;
}

/* a player's seed and the AI mark beside their name: smaller and lighter than the name */
.bk-seed,
.bk-ai {
  font-size: 0.82em;
  opacity: 0.55;
}

/* The words on every selector bar (Aces, You, a tournament's rounds) are in the primary
   text color, whichever is chosen: only the icons take its colors. (The bottom navigation
   bar's names are in their own item's text color: see .tab-btn .tab-label.) */
.aces-tab,
.aces-tab.on {
  color: var(--black);
}

/* The bracket scrolls whichever way a drag starts on it, on its cards as anywhere else
   (stated outright: a press on a card must never take the drag for itself) */
.bracket,
.bracket .bk-match,
.bracket .bk-match * {
  touch-action: pan-x pan-y pinch-zoom;
  -webkit-user-drag: none;
  user-select: none;
}
.bracket {
  cursor: grab;
}
.bracket.grabbing {
  cursor: grabbing;
  scroll-snap-type: none;
}
.bracket.grabbing .bk-match {
  pointer-events: none;
}

/* a finished tournament's winner: drawn as a big button is, but it is not one */
.cup-won {
  cursor: default;
  pointer-events: none;
}
.cup-won-trophy {
  display: inline-grid;
  --fill: var(--p3);
  --stroke: var(--paper);
}

/* The players on the results: no box of their own, just their avatar (a trophy for the
   game's winner, yellow in a white edge) over their name, their points, and the series
   so far as stickers in their color */
.ready-tile {
  border: 0;
  background: none;
  padding-top: 0.2rem;
  color: var(--fw-text);
}

.tile-trophy {
  display: inline-grid;
  --fill: var(--p3);
  --stroke: var(--paper);
}
/* this game's points: stickers in the player's color, in a white edge */
.tile-points {
  display: inline-flex;
  align-items: baseline;
  font: 700 3.6rem/1 var(--round);
  --sw: 0.7rem;
}
.tile-points .pts {
  margin-left: 0.3rem;
  font-size: 1.5rem;
  --sw: 0.45rem;
}
/* the series so far, in plain words */
.ready-tile .tile-tally {
  font: 700 1.4rem/1.2 var(--text);
  color: var(--fw-text);
  opacity: 1;
}

.tile-points .tile-trophy {
  align-self: center;
  margin-right: 0.4rem;
}
/* a game's loser: their avatar where the winner has the trophy, small, as their points are */
.tile-trophy.tile-ava {
  --fill: var(--c);
  --stroke: var(--paper);
}

/* the name centered on the player, the ready mark just to its left (out of the centering) */
.ready-tile .who {
  position: relative;
  justify-content: center;
  overflow: visible;
}
.ready-tile .who > .ready-state {
  position: absolute;
  right: calc(100% + 0.3rem);
  top: 50%;
  translate: 0 -50%;
}

/* With the action bar at the table's side, your spectators' bubbles stack up over it, and
   the other side's at the mirrored spot across the table (set by measureBoardEdges) */
:root.spectators-over-bar .spectator-emote.from-left,
:root.spectators-over-bar .spectator-emote.from-right {
  top: auto;
  bottom: calc(var(--spec-bottom, 40vh) + var(--slot, 0) * 6.4rem);
}
:root.spectators-over-bar .spectator-emote.from-left {
  left: var(--spec-left, 1rem);
  right: auto;
}
:root.spectators-over-bar .spectator-emote.from-right {
  right: var(--spec-right, 1rem);
  left: auto;
}

/* a player's place so far, beside their seed */
table.standings th[scope="col"]:nth-child(2),
table.standings td.st-rank {
  width: 1%;
  padding-inline: 0.4rem 0.8rem;
  white-space: nowrap;
  text-align: center;
}
table.standings td.st-rank {
  font-weight: 700;
}
table.standings th[scope="col"]:nth-child(3) {
  text-align: left;
}
table.standings td:nth-child(3) {
  text-align: left;
}

/* (with Seed and Rank both, the table stays on the card: names are cut short before it overflows) */
table.standings .bk-who {
  max-width: 9.6rem;
}
table.standings {
  font-size: 1.3rem;
}
table.standings .st-status {
  gap: 0.2rem;
}
table.standings .bk-who b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
table.standings td,
table.standings th {
  padding-inline: 0.3rem;
}

/* on a narrow screen the status is its icon alone (its word stays for screen readers) */
@media (max-width: 480px) {
  .st-status-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* A double elimination: both brackets in one scroller, a row each, their columns in line */
.bracket.double {
  flex-direction: column;
  gap: 1.2rem;
}
.bk-row {
  display: flex;
  gap: 5.6rem;
  position: relative;
  z-index: 1;
}
.bk-row > .bracket-round {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  scroll-snap-align: start;
}
/* each bracket's name stays at the left edge as the rows scroll under it */
.bracket-section .bk-row-title {
  position: sticky;
  left: 0;
  align-self: flex-start;
  /* (clear of the round names that stand over each column's top match) */
  margin: 0.4rem 0 4.4rem;
  /* (sticker lettering, a sticker per letter each with its own idle sway: pale blue in a blue edge) */
  padding-left: 0.25rem;
  font: 700 2rem/1.4 var(--text);
  --fill: var(--c2);
  --stroke: var(--c);
  white-space: nowrap;
}
.bracket-section .bk-row-title .stk + .stk {
  margin-left: 0.12rem;
}
.bracket-section .bk-row-title .stk[data-t=" "] {
  width: 0.3em;
}

/* a record's holder, on a line of their own under the number: avatar and name */
.record-card .record-holder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 0.2rem;
  font-size: 1.5rem;
}
.record-holder .ico {
  flex: none;
  --fill: var(--c);
  --stroke: var(--paper);
}
/* (a card that opens its holder's profile) */
button.record-card {
  width: 100%;
  font: inherit;
  /* (its words in the card's own text color, centered, as on every record card: not the
     page's green, left-aligned, that a button would otherwise take on) */
  color: var(--ct);
  text-align: center;
  cursor: pointer;
  transition: transform 0.28s var(--spring);
}
button.record-card:active {
  transform: scale(0.97);
}

/* a best that is the all-time record: a yellow trophy and the words, at the card's foot */
.record-card .record-alltime {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  margin: 0.4rem 0 0;
  font: 700 1.3rem/1.2 var(--text);
  color: var(--ct);
  white-space: nowrap;
}
.record-alltime .ico {
  flex: none;
  --fill: var(--p3);
  --stroke: var(--paper);
}

/* Compare Players: two boxes, half the width each; the other side is picked from a list */
.profile-versus > .boxed {
  min-width: 0;
  width: 100%;
  position: relative;
}
.profile-versus .profile-pick b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-versus select.cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
/* (a stat too long for its column goes onto a second line) */
.profile-compare .match-table :is(th, td) {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Compare Players' table: a narrow Stat column, rows closer together, and the lines between
   rows fainter than the one under the heading */
.profile-compare .match-table {
  table-layout: fixed;
}
.profile-compare .match-table thead th:first-child {
  width: 30%;
}
.profile-compare .match-table :is(th, td) {
  padding-block: 0.45rem;
}
.profile-compare .match-table tbody :is(th, td) {
  border-bottom-color: color-mix(in srgb, var(--c) 30%, transparent);
}
.profile-compare .match-table tbody tr:last-child :is(th, td) {
  border-bottom: 0;
}
section.panel.profile-compare {
  padding-block: 0.6rem 0.4rem;
}
section.panel.profile-compare .table-wrap {
  margin-top: 0;
}

/* Every stats card (yours, another player's, and their rule activations) in the Compare
   Players card's style: smaller type, a narrow stat column, rows close together, centered
   numbers, a full-strength line under the heading and faint ones between rows */
section.panel.stats-card {
  padding-block: 1rem 0.4rem;
}
.stats-card > h2 {
  margin-bottom: 0.4rem;
  font-size: 1.7rem;
  text-align: center;
}
.stats-card .table-wrap {
  margin-top: 0;
}
.stats-card table {
  font-size: 1.3rem;
}
.stats-card :is(th, td) {
  padding: 0.45rem 0.3rem;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  vertical-align: middle;
}
.stats-card tbody th {
  color: var(--c);
  font-weight: 700;
}
.stats-card tbody :is(th, td) {
  border-bottom-color: color-mix(in srgb, var(--c) 30%, transparent);
}
.stats-card tbody tr:last-child :is(th, td) {
  border-bottom: 0;
}
.stats-card > p {
  font-size: 1.2rem;
  text-align: center;
}
/* (as in Compare Players: the stat column narrower than the numbers beside it) */
.stats-card table {
  table-layout: fixed;
}
.stats-card thead th:first-child {
  width: 44%;
}
.stats-card.rule-activations thead th:first-child {
  width: 40%;
}

/* ---------- You: Profile and Your Deck, picked on the strip at the top ---------- */
/* (two halves, so the arrow stands over the middle of each) */
.you-tabs .aces-pointer {
  left: calc(0.4rem + (100% - 0.8rem) * (var(--at, 0) + 0.5) / 2);
}
.you-tabs .aces-tab {
  flex: 1 1 0;
  min-width: 0;
}
/* (the view's own parts sit in the tab's column as if the holder were not there) */
.you-view {
  display: contents;
}

/* Your Deck: each suit's cards 5 to a row, its collected designs in a dashed box under them */
.deck-suit {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.deck-suit-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font: 700 2.2rem/1.2 var(--text);
  /* the suit's name in the primary text color; its icon in its cards' colors: their
     edge (the suit's color) and their face's own background (sampled from the card
     face images) */
  color: var(--black);
  --suit: var(--ink);
  --stroke: var(--suit);
  --fill: #e7e7e7;
}
:root:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) .deck-suit-head {
  --fill: #1e211f;
}
.deck-suit.suit-H .deck-suit-head,
.deck-suit.suit-D .deck-suit-head {
  --suit: var(--red);
  --fill: #fce5e5;
}
:root:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) :is(.deck-suit.suit-H, .deck-suit.suit-D) .deck-suit-head {
  --suit: #f08a86;
  --fill: #2e1c1c;
}
:root[data-theme="focus"] :is(.deck-suit.suit-H, .deck-suit.suit-D) .deck-suit-head {
  --suit: #c25e59;
}
:root.contrast-cards .deck-suit.suit-D .deck-suit-head {
  --suit: #e8782a;
  --fill: #fcede2;
}
:root.contrast-cards .deck-suit.suit-C .deck-suit-head {
  --suit: #3f7fd6;
  --fill: #e5f0fc;
}
:root.contrast-cards:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) .deck-suit.suit-D .deck-suit-head {
  --suit: #f2a061;
  --fill: #2e2219;
}
:root.contrast-cards:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) .deck-suit.suit-C .deck-suit-head {
  --suit: #7fb0f2;
  --fill: #1c242e;
}
.deck-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem 0.6rem;
  justify-items: center;
}
/* a card at the size that fits five across (the face drawn at full size, scaled down) */
.deck-card.example-card {
  --deck-scale: 0.62;
  width: calc(8.822rem * var(--deck-scale));
  height: calc(12.3rem * var(--deck-scale));
}
/* (centered in its place, and moved, leaned and lifted by the same springs as a card at the table) */
.deck-card.example-card > .card {
  inset: auto;
  left: 50%;
  top: 50%;
  width: 8.822rem;
  height: 12.3rem;
  margin: -6.15rem 0 0 -4.411rem;
  transform-origin: 50% 50%;
  transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(var(--lean, 0deg)) scale(calc(var(--deck-scale) * var(--scale, 1)));
}
.deck-card {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
/* picked up with a tap: lifted, in the dashed outline a card picked up at the table wears */
.deck-card.selected::after {
  content: "";
  position: absolute;
  inset: -0.5rem;
  border-radius: 1.4rem;
  border: 0.35rem dashed var(--p1);
  animation: march 1.6s ease-in-out infinite alternate;
  transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(var(--scale, 1));
  pointer-events: none;
  z-index: 3;
}
.deck-card.selected {
  z-index: 50;
  /* (lifted: the springs take it from here once it is moving) */
  --scale: 1.07;
  --dy: -0.6rem;
}
/* the cards a carried one can swap with: outlined, as drop targets at the table are */
.deck-card.target::before {
  content: "";
  position: absolute;
  inset: -0.5rem;
  border-radius: 1.4rem;
  border: 0.35rem dashed var(--p1);
  background: color-mix(in srgb, var(--p1) 14%, transparent);
  animation: target-pulse 1.6s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 3;
}
.deck-card.target::after {
  content: "Swap";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0.2rem 0.7rem;
  border-radius: 1.2rem;
  background: var(--p1);
  color: #fff;
  font: 700 1.2rem/1.4 var(--text);
  box-shadow: 0.2rem 0.2rem 0 var(--shadow);
  z-index: 4;
  pointer-events: none;
  transition: transform 0.25s var(--spring);
}
button.deck-card {
  padding: 0;
  border: 0;
  background: none;
  transition: transform 0.25s var(--glide);
}
button.deck-card:not(.selected):active {
  transform: scale(0.94);
}
.deck-box button.deck-card {
  margin-bottom: 3rem; /* (its name, under it: two lines at most) */
}
.deck-name {
  position: absolute;
  left: 50%;
  top: calc(100% + 0.3rem);
  transform: translateX(-50%);
  width: calc(100% + 0.6rem);
  text-align: center;
  font: 700 1.15rem/1.1 var(--text);
  color: var(--fw);
}
.deck-box .deck-grid {
  padding-top: 0.4rem;
}

/* ---------- custom cards: a card in a color of its own ---------- */
/* the color, over the paper inside the drawn border (the face sets --skin-tint) */
.face.front.skin::before {
  content: "";
  position: absolute;
  inset: 0.7rem;
  border-radius: 1.1rem;
  background: var(--skin-tint, transparent);
  pointer-events: none;
}
.face.front.skin > * {
  position: relative;
}
.face.front.skin > *,
.face.front.skin::before {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
/* (on a dark color the corners are drawn light) */
.face.front.skin.inked > .corner {
  color: var(--skin-ink);
  --fill: var(--skin-ink);
}

/* The view strips at the top of Aces and You: in the page, scrolling with it, on a green
   card of their own */
.aces-tabs.top-tabs {
  /* on a green card, as the tab bar is */
  padding: 0.4rem 0.4rem 0.7rem;
  border: 0.4rem solid var(--fw);
  border-radius: 2rem;
  background: var(--fw3);
  box-shadow: 0.3rem 0.3rem 0 var(--shadow);
}
.aces-tabs.top-tabs .aces-tab {
  padding: 0.1rem 0;
}
/* (their words in the text color of the tab's own color: the picked one's, the rest the green's) */
.aces-tabs.top-tabs .aces-tab,
.aces-tabs.top-tabs .aces-tab.on {
  color: var(--ct);
}
/* (its arrow under the view showing, pointing up at it, half over the card's edge) */
.aces-tabs.top-tabs .aces-pointer {
  top: auto;
  bottom: -0.45rem;
}

/* a patch's opening line, above its headings */
.patch-intro {
  margin: 0.4rem 0 0.2rem;
  font: 700 1.8rem/1.3 var(--text);
}

/* Friends: the @name field's hint in the sheet's lighter green (each theme's own), and
   each request's actions beside its card, an icon over its word */
.friends-sheet input::placeholder {
  color: var(--c);
  opacity: 1;
}
.friend-req-row {
  gap: 0.8rem;
}
.friend-req-row .close-btn {
  font-size: 1.3rem;
}

/* a friend in a game: the points they have showing, red stickers with a white edge */
.friend-pts {
  display: flex;
  align-items: baseline;
  font: 700 2.6rem/1 var(--round);
  --fill: var(--p2);
  --stroke: var(--paper);
  --sw: 0.55rem;
}
.friend-pts .stk:not(.pts) {
  margin-right: -0.03em;
}
.friend-pts .pts {
  margin-left: 0.3rem;
  font-size: 1.3rem;
  --sw: 0.4rem;
}

/* a profile's streak: its best, and beside it the run on now, a little quieter, with a
   rule between them */
.streak-row .rate + .rate.streak-now {
  margin-left: 0.4rem;
  padding-left: 0.9rem;
  border-left: 0.25rem solid color-mix(in srgb, var(--c) 45%, transparent);
  opacity: 0.75;
}

/* A tournament's end: each player's emote beside their name in the standings, a
   spectator's bubble with its tail pointing back at the name, in their color (it floats
   over the row, so the table never moves for it) */
.st-player-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}
.spectator-emote.cup-emote {
  position: absolute;
  left: calc(100% + 1.4rem);
  right: auto;
  top: 50%;
  margin-top: -2rem;
  z-index: 3;
  transform-origin: 0 50%;
  animation: spectator-in-left 4s both;
}
/* the quick emotes under the standings, dropping down as at the end of a game */
.cup-emote-anchor {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* (tucked up under the standings card, as under the results) */
  margin-top: -1.2rem;
}

/* A lobby (a table's waiting room, a tournament gathering): the chat button of the game
   table sits at the end of your own name card, and the quick emotes float up from it as
   they do from the table's (over whatever is above the card) */
.list-item.lobby-me {
  position: relative;
}
.list-item.lobby-me:has(.lobby-pop) {
  z-index: 5;
}
.lobby-emote-btn {
  /* (smaller than at the table, to sit inside the card; it still reaches into the card's
     padding for a full-sized tap) */
  width: 4.8rem;
  height: 4.8rem;
  margin: -0.4rem -0.4rem -0.4rem 0;
}
.emote-pop.lobby-pop {
  left: auto;
  right: -0.4rem;
  bottom: calc(100% + 0.2rem);
  transform-origin: 100% 100%;
}
/* ...and each player's emote floats over their row of the list, as near their name as
   there is room for: an unseen copy of the name holds its place, and gives way (the
   bubble then covers the name's end) rather than let the bubble leave the row */
.lobby-who {
  position: relative;
  min-width: 0;
}
.lobby-say {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.lobby-say-gap {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  visibility: hidden;
  font-size: 2rem;
  font-weight: bolder;
}
:root .lobby-say .spectator-emote.cup-emote {
  position: relative;
  flex: none;
  inset: auto;
  margin: 0 0 0 1.4rem;
}

/* A record changing hands: the Flag Complete! pill in the records' gold (a lost one in red) */
.queue-pill.flag-pill.record-pill {
  border-color: var(--p3);
  background: var(--p3b);
  color: var(--p3t);
  --c: var(--p3);
  --c2: var(--p3b);
  --ct: var(--p3t);
}
.queue-pill.flag-pill.record-pill .queue-accept {
  border-color: color-mix(in srgb, var(--p3) 45%, var(--p3b));
  --fill: var(--p3b);
  --stroke: color-mix(in srgb, var(--p3) 45%, var(--p3b));
}
.queue-pill.flag-pill.record-pill.lost {
  border-color: var(--p2);
  background: var(--p2b);
  color: var(--p2t);
  --c: var(--p2);
  --c2: var(--p2b);
  --ct: var(--p2t);
}
.queue-pill.flag-pill.record-pill.lost .queue-accept {
  border-color: color-mix(in srgb, var(--p2) 45%, var(--p2b));
  background: var(--p2b);
  color: var(--p2t);
  --fill: var(--p2b);
  --stroke: color-mix(in srgb, var(--p2) 45%, var(--p2b));
}
.record-pill .flag-pill-art {
  --fill: var(--c2);
  --stroke: var(--c);
}

/* a record's number keeps its digits together; its unit stays on one line, beside it
   when there is room and under it when there is not */
.rv-num {
  display: flex;
  align-items: baseline;
  white-space: nowrap;
}
:is(.record-value, .record-pr-value) .pts {
  white-space: nowrap;
}

/* Under the results the menu is as wide as the results: the faces fill all of it up to
   the bell, rather than stopping at four and a half */
.summary-emotes .emote-faces {
  flex: 1 1 auto;
  max-width: none;
}

/* A table in a sheet scrolls sideways right to the sheet's edges: the sheet's side
   padding moves inside the table's scroll area, so the first column is not cut off
   short of the edge as the table is scrolled */
.sheet .table-wrap {
  margin-inline: -1.6rem;
  padding-inline: 1.6rem;
}
.sheet .table-wrap::-webkit-scrollbar-track {
  margin-inline: 1.6rem;
}

/* the first-puzzle tooltip: a callout beside the gear, its tail pointing back at it */
.callout.puzzle-tip {
  position: fixed;
  z-index: 60;
  transform: translate(0, -50%);
  pointer-events: auto;
  cursor: pointer;
  white-space: normal;
  max-width: min(24rem, calc(100vw - 10rem));
  text-align: left;
  font: 700 1.4rem/1.3 var(--text);
  border: 0;
  animation: pop 0.35s var(--spring) both;
}
.callout.puzzle-tip[hidden] {
  display: none;
}
.callout.puzzle-tip::after {
  content: "";
  position: absolute;
  top: 50%;
  left: auto;
  margin-left: 0;
  right: 100%;
  margin-top: -0.7rem;
  border: 0.7rem solid transparent;
  border-right-color: var(--c);
  border-left: 0;
}

/* "View X more" under the first ten friends: quiet, in the card's own green */
.friends-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.4rem 0;
  color: var(--ct);
  font: 700 1.5rem/1.2 var(--text);
  opacity: 0.8;
}
/* the friends not on now, under those who are, in the invite sheet */
.invite-head {
  margin: 1.6rem 0 0.2rem;
}
/* before the Daily Puzzle: today's puzzle as the sheet's own text */
.puzzle-intro-text {
  color: var(--c-ink, inherit);
  font: 500 1.8rem/1.35 var(--text);
}
.puzzle-intro-text p + p {
  margin-top: 0.8rem;
}
/* today's puzzle: its rules, one to a bullet */
.rules-in-play {
  margin: 0.4rem 0 0;
  padding-left: 2.4rem;
  list-style: disc;
}
.rules-in-play li + li {
  margin-top: 0.2rem;
}

/* a rule puzzle's result: the best three moves there were, each with the margin over
   PuzzleBot it gives on average, and yours marked among them (or on a line of its own
   under them), in the white card a game's points graph comes in */
.pz-review {
  padding-bottom: 0.8rem;
}
.pz-move {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.5rem 0.2rem;
  text-align: left;
}
/* (a plain gray line between two moves, whatever the panel's color) */
.pz-move + .pz-move {
  border-top: 0.2rem solid color-mix(in srgb, var(--gray) 40%, transparent);
}
.pz-move-mark {
  flex: none;
  display: grid;
  --fill: var(--p2);
  --stroke: var(--paper);
}
.pz-move.good .pz-move-mark {
  --fill: var(--bg-stroke, #6fd13f);
}
/* (your move, second or third best: neither right nor wrong, so a gray dash) */
.pz-move.near .pz-move-mark {
  --fill: var(--gray);
}
/* (a move that was not yours: its place where the tick or cross would be, as wide) */
.pz-move-place {
  width: 2.6rem;
  text-align: center;
  font: 700 2rem/1 var(--round);
  color: var(--gray);
}
.pz-move .grow {
  min-width: 0;
}
.pz-move small {
  display: block;
  font: 600 1.2rem/1.2 var(--text);
  opacity: 0.7;
}
.pz-move b {
  display: block;
  font: 700 1.5rem/1.3 var(--text);
  --edge: 0.12rem; /* the outline of the little hand, and of a suit beside it */
}
.pz-move-pts {
  flex: none;
  font: 700 1.7rem/1.1 var(--round);
  text-align: right;
  white-space: nowrap;
}
/* where a move lands, in its words: a little sticker of the hand in its owner's colors,
   a dot for each card and a solid card for the one meant. With its outline it is no
   taller than a line of the words, so lines of them never touch. */
.mini-hand {
  display: inline-grid;
  grid-template-columns: repeat(3, 0.4rem);
  grid-auto-rows: 0.53rem;
  gap: 0.1rem;
  padding: 0.2rem;
  border-radius: 0.35rem;
  background: var(--c2);
  box-shadow: 0 0 0 var(--edge, 0.12rem) var(--c);
  vertical-align: middle;
  /* (lifted with the suits: the middle of the capitals beside it, not of the small letters) */
  margin: -0.33rem 0.3rem -0.07rem 0.1rem;
}
/* (a little hand and the card it marks, named after it, never part at a line's end) */
.pz-spot {
  white-space: nowrap;
}
.mini-hand i {
  display: grid;
  place-items: center;
}
.mini-hand i::before {
  content: "";
  width: 0.2rem;
  height: 0.2rem;
  border-radius: 50%;
  background: var(--c);
}
.mini-hand i.on {
  border-radius: 0.1rem;
  background: var(--c);
}
.mini-hand i.on::before {
  content: none;
}
/* a card named in a move's words: its suit's symbol, the sticker that heads the suit on
   the Your Deck page (.deck-suit-head), small: its cards' colors (their edge, the suit's
   color, as the outline; their face's own light background inside) and a sticker's shadow,
   as short as the symbol is small */
.pz-card {
  white-space: nowrap;
  --suit: var(--ink);
  --stroke: var(--suit);
  --fill: #e7e7e7;
  --shx: 0.14rem;
  --shy: 0.14rem;
}
.pz-card .ico {
  vertical-align: middle;
  margin-inline: 0.15rem 0.05rem;
  /* (lifted to the middle of the capitals and numbers beside it, not of the small letters) */
  position: relative;
  top: -0.13rem;
}
:root:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) .pz-card {
  --fill: #1e211f;
}
.pz-card:is(.suit-H, .suit-D) {
  --suit: var(--red);
  --fill: #fce5e5;
}
:root:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) .pz-card:is(.suit-H, .suit-D) {
  --suit: #f08a86;
  --fill: #2e1c1c;
}
:root[data-theme="focus"] .pz-card:is(.suit-H, .suit-D) {
  --suit: #c25e59;
}
:root.contrast-cards .pz-card.suit-D {
  --suit: #e8782a;
  --fill: #fcede2;
}
:root.contrast-cards .pz-card.suit-C {
  --suit: #3f7fd6;
  --fill: #e5f0fc;
}
:root.contrast-cards:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) .pz-card.suit-D {
  --suit: #f2a061;
  --fill: #2e2219;
}
:root.contrast-cards:is([data-theme="poker"], [data-theme="night"], [data-theme="focus"]) .pz-card.suit-C {
  --suit: #7fb0f2;
  --fill: #1c242e;
}
/* how a move is judged: a note over the buttons, in the panel's green */
.rule-puzzle-result .ready-tiles {
  margin-bottom: 0;
}
.summary-panel .pz-note {
  /* (as far under the tiles' words as over the buttons) */
  margin: 0.4rem 0 0.8rem;
  font: 700 1.3rem/1.3 var(--text);
  text-align: center;
}
/* three tiles: this puzzle, the last 7 days, all time */
.rule-puzzle-result .ready-tiles {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.rule-puzzle-result .tile-points {
  font-size: 3rem;
}
.rule-puzzle-result .ready-tile .tile-tally {
  font: 600 1.2rem/1.2 var(--text);
  opacity: 0.7;
}
.rule-puzzle-result .summary-main {
  gap: 0.6rem;
  padding-inline: 1rem;
  font-size: 2rem;
}
.rules-in-play + p {
  margin-top: 0.8rem;
}
/* this puzzle: a check or a cross where the others have their percentage */
.pz-verdict .tile-points {
  min-height: 3rem;
  align-items: center;
  --fill: var(--c);
  --stroke: var(--paper);
}
/* (almost: one of the best three moves, so the gray dash its row has) */
.pz-verdict.near .tile-points {
  --fill: var(--gray);
}
/* (what is different at a puzzle's table, in the sheet's accent green) */
.puzzle-intro-text .puzzle-intro-note {
  margin-top: 1rem;
  color: var(--c);
}
/* a player in a match now: their binoculars are a button that opens it */
button.st-status.st-watch {
  /* (a finger's worth of room round the icon, taken back off so the row keeps its height) */
  margin: -0.8rem;
  padding: 0.8rem;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}
button.st-status.st-watch:active {
  transform: scale(0.9);
}
