/* The phone table. Everything is laid out on a 328 x 640 frame: 1u is 1px of that frame, scaled to fit the screen (width or height, whichever is tighter). */
body.tbl-page { margin: 0; min-height: var(--app-h, 100dvh); box-sizing: border-box; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); overscroll-behavior: none; background: linear-gradient(#444446, #3c3c3e 50%, #2b2b2d); overflow: hidden; }
.tbl {
  --u: min(calc(100vw / 328), calc((var(--app-h, 100dvh) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) / 640), var(--u-max, 100px));
  --yellow: #ffd23f;
  position: relative; width: calc(var(--u) * 328); height: calc(var(--u) * 640); margin: 0 auto; color: #fff; user-select: none; -webkit-user-select: none;
  /* The background is zoomed in (1.166x, so the table reaches the frame's edges) and moved up, so every seat and card sits on the table */

  font-family: ui-rounded, "Trebuchet MS", system-ui, -apple-system, sans-serif;
}
.tbl *, .tbl *::before, .tbl *::after { box-sizing: border-box; }

/* Cards on the table */
.tbl .card { --w: calc(var(--u) * 32.8); width: var(--w); height: calc(var(--u) * 50); aspect-ratio: auto; margin: 0; padding: 0; border-radius: var(--r); }
.tbl .card img { width: 100%; height: 100%; display: block; }

/* A seat: the four hidden cards, and the player's panel: a glass pill, 100 x 38, with the avatar (30) and the name over a small line of status */
.tseat { position: absolute; }
.thead { position: relative; z-index: 20; display: flex; align-items: center; gap: calc(var(--u) * 4); width: calc(var(--u) * 100); height: calc(var(--u) * 38); padding: calc(var(--u) * 4); line-height: 1; white-space: nowrap;
  border: 0; border-radius: 999px; background: rgba(46, 8, 8, .58); -webkit-backdrop-filter: blur(4px) saturate(1.5); backdrop-filter: blur(4px) saturate(1.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(0, 0, 0, .3), 0 calc(var(--u) * 4) calc(var(--u) * 10) rgba(0, 0, 0, .28); }
.ttext { display: flex; flex-direction: column; justify-content: center; gap: calc(var(--u) * 1); min-width: 0; flex: 1; }
.tname { font-size: calc(var(--u) * 12); font-weight: 400; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tsub { font-size: calc(var(--u) * 9); line-height: 1.1; color: rgba(255, 255, 255, .72); overflow: hidden; text-overflow: ellipsis; }
.tseat.active .tname, .thead.active .tname { color: var(--yellow); }
.tavatar { width: calc(var(--u) * 30); height: calc(var(--u) * 30); border-radius: 50%; display: grid; place-items: center; font-size: calc(var(--u) * 30); line-height: 1; flex: none; border: 1px solid #292923; overflow: visible; }
/* The countdown replaces the avatar while a timer runs */
.tring { width: calc(var(--u) * 30); height: calc(var(--u) * 30); border-radius: 50%; flex: none; display: grid; place-items: center; position: relative; --c: #5fd35f; box-shadow: 0 0 calc(var(--u) * 12) 0 #FD0; }
.tring.prompt, .tring.low { --c: #e23a3a; }
/* The ring is only a ring: the middle is clear, so the glass shows through */
.tring::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--c) var(--p), rgba(255, 255, 255, .78) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--u) * 3.5), #000 calc(100% - var(--u) * 3.5 + .6px)); mask: radial-gradient(farthest-side, transparent calc(100% - var(--u) * 3.5), #000 calc(100% - var(--u) * 3.5 + .6px)); }
.tring b { position: relative; font-size: calc(var(--u) * 12); font-weight: 700; }
.tseat.out .thead { opacity: .45; filter: grayscale(1); }

/* Top: a row of cards, the panel centred under it and over its bottom edge by 14 */
.tseat.top { left: 0; right: 0; top: calc(var(--u) * 30); display: flex; flex-direction: column; align-items: center; }
.tseat.top .tcards { position: relative; display: flex; gap: calc(var(--u) * 4); }
.tseat.top .thead { margin-top: calc(var(--u) * -14); }
/* Left: a column of cards on their sides, the panel under it. Right: the panel on top, then the column. */
.tseat.left, .tseat.right { width: calc(var(--u) * 100); display: flex; flex-direction: column; gap: calc(var(--u) * 4); }
.tseat.left { left: calc(var(--u) * 8); top: calc(var(--u) * 174); align-items: flex-start; }
.tseat.right { right: calc(var(--u) * 8); top: calc(var(--u) * 132.5); align-items: flex-end; }
.tseat.right .thead { flex-direction: row-reverse; padding-left: calc(var(--u) * 8); text-align: right; }
.tseat.left .tcards, .tseat.right .tcards { position: relative; display: flex; flex-direction: column; gap: calc(var(--u) * 4); }
.tseat.left .card, .tseat.right .card { width: calc(var(--u) * 50); height: calc(var(--u) * 32.8); position: relative; }
/* Sideways: the card picture is turned a quarter inside its landscape box */
.tseat.left .card img, .tseat.right .card img { position: absolute; left: 50%; top: 50%; width: calc(var(--u) * 32.8); height: calc(var(--u) * 50); }
.tseat.left .card img { transform: translate(-50%, -50%) rotate(90deg); }
.tseat.right .card img { transform: translate(-50%, -50%) rotate(-90deg); }

/* Empty seats */
.tempty { position: absolute; top: calc(var(--u) * 174); width: calc(var(--u) * 50); display: flex; flex-direction: column; gap: calc(var(--u) * 4); }
.tempty.left { left: calc(var(--u) * 8); } .tempty.right { right: calc(var(--u) * 8); }
.tempty i { display: block; height: calc(var(--u) * 32.8); border-radius: calc(var(--u) * 32.8 * .21); background: rgba(0, 0, 0, .2); }

/* The middle of the table */
.tcentre { position: absolute; left: 0; right: 0; top: calc(var(--u) * 197); height: calc(var(--u) * 120); }
.tcentre .card.deck { --w: calc(var(--u) * 59); position: absolute; left: calc(var(--u) * 97); top: calc(var(--u) * 3); width: calc(var(--u) * 59); height: calc(var(--u) * 90); }
.tdiscard { position: absolute; left: calc(var(--u) * 174); top: calc(var(--u) * 7); width: calc(var(--u) * 59); height: calc(var(--u) * 90); }
.tdiscard .fan { position: absolute; inset: 0; margin: 0; }
.tdiscard .card { --w: calc(var(--u) * 59); width: calc(var(--u) * 59); height: calc(var(--u) * 90); position: absolute; left: 0; top: 0; }
/* Each card of the pile has its own small offset (see PILE_POSES in fx.ts), whichever place it has in the pile */
.tdiscard .fan > .card { left: calc(var(--u) * var(--dx, 0)); top: calc(var(--u) * var(--dy, 0)); }
.tdiscard:empty::before { content: ""; position: absolute; inset: 0; border-radius: 21% / 13.8%; background: #fff; }
.tbl .tseepile { position: absolute; left: calc(var(--u) * 203.5); top: calc(var(--u) * 106); transform: translateX(-50%); width: auto; height: auto; padding: calc(var(--u) * 4) calc(var(--u) * 8); margin: 0; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .22); color: #fff; font: inherit; font-size: calc(var(--u) * 9); font-weight: 700; line-height: 1.2; letter-spacing: 0; white-space: nowrap; box-shadow: none; min-height: 0; cursor: pointer; }
.tstatus { position: absolute; left: calc(var(--u) * 14); right: calc(var(--u) * 14); top: calc(var(--u) * 362); text-align: center; font-size: calc(var(--u) * 12); line-height: 1.25; font-weight: 600; }

/* Me: my hidden set and my name row, my hand, my buttons */
.tme { position: absolute; left: 0; right: 0; top: calc(var(--u) * 392); display: flex; flex-direction: column; align-items: center; }
.tme .thead { margin-top: calc(var(--u) * -14); }
.tcards.mine { position: relative; display: flex; gap: calc(var(--u) * 4); }
.tcards.mine .card { --w: calc(var(--u) * 39.4); width: calc(var(--u) * 39.4); height: calc(var(--u) * 60); }
.thand { position: absolute; left: 0; right: 0; top: calc(var(--u) * 497); height: calc(var(--u) * 80); display: flex; justify-content: center; }
.thand .card { --w: calc(var(--u) * 46); width: calc(var(--u) * 46); height: calc(var(--u) * 70); margin: 0 calc(var(--u) * -4.5); position: relative; }
.tactions { position: absolute; left: 0; right: 0; top: calc(var(--u) * 587); display: flex; justify-content: center; gap: calc(var(--u) * 10); }
.tbl .tactions button { min-height: calc(var(--u) * 40); height: calc(var(--u) * 40); padding: 0 calc(var(--u) * 16); margin: 0; border-radius: calc(var(--u) * 16); border-width: calc(var(--u) * 2); font-size: calc(var(--u) * 14); font-weight: 800; box-shadow: 0 calc(var(--u) * 3) 0 var(--ink); white-space: nowrap; }
.tbl .tactions button:hover { transform: none; }
.tbl .tactions button:disabled { --btn: #a1612c; --btn-ink: #e9c9a1; opacity: 1; filter: none; box-shadow: 0 calc(var(--u) * 3) 0 var(--ink); }

/* Cards that can be clicked right now */
.tbl .card.pick { outline: calc(var(--u) * 1.5) dotted var(--yellow); outline-offset: calc(var(--u) * 1.5); cursor: pointer; }

/* The open discard pile: four columns of small cards in the middle, scrolled to the newest (bottom); the top row is cut off by the edge */
.tbl .tpile { overflow-anchor: none; position: absolute; left: calc(var(--u) * 71); top: calc(var(--u) * 175); width: calc(var(--u) * 187); height: calc(var(--u) * 175); padding: calc(var(--u) * 6); box-sizing: border-box; overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
  display: grid; grid-template-columns: repeat(4, calc(var(--u) * 40)); justify-content: center; grid-auto-rows: calc(var(--u) * 61); gap: calc(var(--u) * 5); align-content: start; }
.tbl .tpile.short { align-content: end; }
.tbl .tpile::-webkit-scrollbar { display: none; }
.tbl .tpile .card { --w: calc(var(--u) * 40); width: calc(var(--u) * 40); height: calc(var(--u) * 61); margin: 0; }
.tbl .tpile .tgap { display: block; visibility: hidden; }
/* Fewer than four cards: one column for each, as wide as a card (the card is 40 wide on the phone, 52 on a wide screen), so they never overlap */
.tbl .tpile[style*="--n"] { grid-template-columns: repeat(var(--n), calc(var(--u) * 40)); justify-content: center; }
/* Close: a small pill 8px under the open pile */
.tbl .tclose { position: absolute; left: calc(var(--u) * 164); top: calc(var(--u) * 358); transform: translateX(-50%); width: auto; height: auto; padding: calc(var(--u) * 4) calc(var(--u) * 8); margin: 0; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .22); color: #fff; font: inherit; font-size: calc(var(--u) * 9); font-weight: 700; line-height: 1.2; letter-spacing: 0; box-shadow: none; min-height: 0; cursor: pointer; }

/* The avatar and ring carry the class the animations look for ("avatar"), so undo the page's own avatar styling here */
#app .tbl .tavatar, #app .tbl .tring { width: calc(var(--u) * 30); height: calc(var(--u) * 30); border-radius: 50%; margin: 0; padding: 0; box-shadow: none; }
#app .tbl .tring { border: 0; outline: 0; }
#app .tbl .tavatar { font-size: calc(var(--u) * 30); border: 1px solid #292923; display: grid; place-items: center; line-height: 1; }
/* The hand: the game's hand slots, fanned */
.thand { position: absolute; left: 0; right: 0; top: calc(var(--u) * 497); height: calc(var(--u) * 80); display: flex; justify-content: center; }
.thand .handslot { display: block; width: calc(var(--u) * 46); height: calc(var(--u) * 70); margin: 0 calc(var(--u) * -4.5); position: relative; }
/* The four cards sit on one circular arch (radius 400u): their angles and heights follow the circle, so the fan is even */
.thand .handslot:nth-child(1) { rotate: -9deg; translate: 0 calc(var(--u) * 4.9); }
.thand .handslot:nth-child(2) { rotate: -3deg; translate: 0 calc(var(--u) * .55); }
.thand .handslot:nth-child(3) { rotate: 3deg; translate: 0 calc(var(--u) * .55); }
.thand .handslot:nth-child(4) { rotate: 9deg; translate: 0 calc(var(--u) * 4.9); }
.thand .card { --w: calc(var(--u) * 46); width: calc(var(--u) * 46); height: calc(var(--u) * 70); margin: 0; rotate: none; translate: none; }
.thand .handslot .slotempty { visibility: hidden; }

.tcards.over-flyers { z-index: 6; }

/* In the game, the table takes the whole screen: no logo bar, no page padding, no sound switch for now */
body.tbl-page .topbar, body.tbl-page #top { display: none; }
body.tbl-page .shell { max-width: none; padding: 0; margin: 0; }
body.tbl-page #app { display: block; margin: 0; padding: 0; width: 100%; }
body.online.tbl-page { background: linear-gradient(#444446, #3c3c3e 50%, #2b2b2d); overflow: hidden; }

/* The winner: their set and name are lit */
/* --cr: the corner of the cards in this set (21% of their width, as in the card SVGs), so the frames drawn around a set (winner, Seen, Plot Twist) stay concentric with its cards */
.tbl .tcards { --cr: calc(var(--u) * 32.8 * .21); }
.tbl .tcards.mine, .tbl.duel .tseat.top .tcards { --cr: calc(var(--u) * 39.4 * .21); }
@media (max-width: 700px) { .tbl .tcards.mine, .tbl .tseat.top .tcards, .tbl.duel .tseat.top .tcards { --cr: calc(var(--u) * 52.5 * .21); } }
@media (min-width: 701px) { .tbl :is(.tseat.top, .tseat.left, .tseat.right) .tcards { --cr: calc(var(--u) * 48 * .21); } .tbl .tcards.mine, .tbl.duel .tseat.top .tcards { --cr: calc(var(--u) * 66 * .21); } }
.tseat.winner .tcards, .tme.winner .tcards { outline: calc(var(--u) * 2) solid var(--yellow); outline-offset: calc(var(--u) * 3); border-radius: calc(var(--cr) + var(--u) * 3); box-shadow: 0 0 calc(var(--u) * 10) rgba(255, 210, 63, .8); }
.tseat.winner .tname, .tme.winner .tname { color: var(--yellow); }

/* The middle of the table and its line are wider than the piles; let taps through to the seats' cards beside them */
.tcentre, .tstatus { pointer-events: none; }
.tcentre > * { pointer-events: auto; }

/* The table is never cut off by a frame: the background reaches past the 328 x 640 design frame on every side, so the whole round table shows however the window is shaped, and the seats and cards stay where they are in the frame. */
.tbl { overflow: visible; background: none; --ex: 0; }
.tbl::before, .tbl::after { content: ""; position: absolute; z-index: -1; pointer-events: none; top: calc(var(--u) * -73); height: calc(var(--u) * 829.2); }
/* plain red, as wide as the window */
.tbl::before { left: -100vw; right: -100vw; background: none; }
/* the picture (the table with room around it), its left and right edges faded into the red so no edge shows */
.tbl::after { left: calc(var(--u) * (164 - 326 * (1 + var(--ex) / 198.6))); width: calc(var(--u) * 652 * (1 + var(--ex) / 198.6)); background: url(/assets/img/bg/table-desktop.webp) center / 100% 100% no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
/* The side seats sit the same distance from the table's edge however wide the table is */
.tseat.left, .tempty.left { left: calc(var(--u) * (8 - var(--ex))); }
.tseat.right, .tempty.right { right: calc(var(--u) * (8 - var(--ex))); }
body.tbl-page { background: linear-gradient(#444446, #2b2b2d); }
body.tbl-page .shell { position: relative; z-index: 0; }
/* On a wide screen the table is wider: its picture is stretched sideways by --ex on each side, and the side seats move out by the same amount */
/* (the table is 30% wider than before: 1.352 x 1.3 = 1.757 times the phone table, so --ex is 150 on each side) */
@media (min-width: 701px) { .tbl { --ex: 150; --u: min(calc(100vw / 328), calc((var(--app-h, 100dvh) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) / 640), calc(100vw / (2 * (198.6 + var(--ex)) + 24)), var(--u-max, 100px)); } }

.tbl .tcards .card { transition: transform .45s var(--spring, cubic-bezier(.34, 1.5, .64, 1)), translate .6s var(--spring, cubic-bezier(.34, 1.5, .64, 1)), rotate .6s var(--spring, cubic-bezier(.34, 1.5, .64, 1)), scale .6s var(--spring, cubic-bezier(.34, 1.5, .64, 1)), box-shadow .45s ease, filter .45s ease, outline-color .15s; }
/* the one looking gets a small eye */
/* the eyes that stand in for the avatar of someone who is looking at cards: they glance from side to side */
.tbl .tbadge.eyes .tem { font-size: .8em; animation: tlook 1.2s ease-in-out infinite; }
@keyframes tlook { 0%, 100% { translate: calc(-50% - var(--u) * 2) -50%; } 50% { translate: calc(-50% + var(--u) * 2) -50%; } }
@media (prefers-reduced-motion: reduce) { .tbl .tcards .card { transition: none; } }
/* The background layers reach past the window; they must never make the page scroll sideways */
html:has(.tbl), body.tbl-page { overflow-x: clip; max-width: 100vw; }

/* ===== The look of the 1v1 table, carried over. (Those rules are scoped to the old page, so they are repeated here for the table.) ===== */
/* Cards are plain pictures with one soft shadow; the old outline-and-drop-shadow on the pictures is switched off, as it is on the old table */
.tbl .card img, .tbl .card.deck::before, .tbl .card.deck::after { filter: none; }
.tbl .card:where(:not(.slotempty):not(.empty):not(.deck)) { box-shadow: var(--card-shadow); border-radius: var(--r); }
.tbl .card { --r: calc(var(--w) * .21); }
/* Cards that can be picked: a thin dashed gold outline, bright on hover */
.tbl .card.slot.target { outline: 1px dashed var(--card-gold-canceled, #E8AA2C); outline-offset: 2px; border-radius: var(--r); }
.tbl .card.slot.target:hover:not(:disabled) { outline-color: #FCFF2F; }
/* A picked card: a solid gold outline, no shadow, nothing else moves; the others keep a faint outline */
.tbl .card.slot.selected, .tbl .card.selected { outline: 1.5px solid #E8AA2C; outline-offset: 2px; border-radius: var(--r); box-shadow: none; }
.tbl .tcards:has(.slot.selected) .card.slot.target:not(.selected) { outline-color: rgba(232, 170, 44, .5); }
/* The hand: a selected card stays above its neighbours; its lift and the neighbours' parting are set on the slots by poseHand (fx.ts) */
.tbl .thand .handslot:has(.selected, .throwglow) { z-index: 50; }
.tbl .thand button.card.selected, .tbl .thand button.card.selected:hover:not(:disabled) { transform: none; transition: none; }
/* Seen: the whole set is outlined, and hovering lifts the set together */
.tbl .card.slot:is(.seenpick, .plotpick), .tbl button.card.slot:is(.seenpick, .plotpick):hover:not(:disabled) { outline: none; transform: none; }
.tbl .tcards:has(.plotpick) { cursor: pointer; }
.tbl .tcards:has(.seenpick) { cursor: pointer; }
/* Hidden set: each card lifts and grows a little on hover with a deeper shadow, and settles back with a soft spring */
.tbl .tcards button.card.slot:hover:not(:disabled) { transform: none; }
@media (hover: hover) {
  .tbl .tcards:not(:has(.seenpick, .plotpick)):not(.peeked):not(.seensel) .card.slot:hover:not(.selected) { translate: 0 -5px; scale: 1.02; box-shadow: 0 3px 6px rgba(0, 0, 0, .1), var(--card-shadow); transition-duration: .45s; transition-timing-function: var(--ease, cubic-bezier(.2, .8, .2, 1)); }
  .tbl .card.pick:hover { translate: 0 -3px; }
}
/* Picking a card of the open pile (Throwback): it dips a little under the finger, so the tap is felt before the pile gathers back */
.card.pick[data-act="takeThrow"]:active { scale: .96; }
/* An empty place where a player's cards were */
.tbl .tcards .ph { display: block; border-radius: calc(var(--w, calc(var(--u) * 32.8)) * .21); background: rgba(0, 0, 0, .2); width: calc(var(--u) * 32.8); height: calc(var(--u) * 50); }
.tbl .tseat.left .tcards .ph, .tbl .tseat.right .tcards .ph { width: calc(var(--u) * 50); height: calc(var(--u) * 32.8); }
.tbl .tcards.mine .ph { width: calc(var(--u) * 39.4); height: calc(var(--u) * 60); }
.tbl .tseat.top .tcards:has(.ph) { display: flex; gap: calc(var(--u) * 4); }
/* ===== Ghosted: the player's cards, panel, chat and options go cold and blurred. Their cards leave two stretched shadows behind them (copies of the seat, see ghostTrails in table.ts), fog and grain drift over them and a cold wash covers the table.
   Every number is a token of the "ghosted" group (game/online/tokens.ts), written to :root by applyMotion; the values here are the designed ones. ===== */
:root {
  --g-t1l: 1.05; --g-t1o: .91; --g-t1b: 4px; --g-t2l: 1.2; --g-t2o: .29; --g-t2b: 6px; --g-tb: 1.4;
  --g-hue: 185deg; --g-sat: 1.2; --g-dark: .84; --g-lb: 1.25px; --g-pb: .6px;
  --g-fog: 1; --g-gr: .2; --g-wash: .35; --g-bob: 5px;
  --g-fade: 700ms; --g-pulse: 550ms; --g-settle: 1300ms; --g-bobms: 3600ms; --g-breath: 3800ms;
}
/* The look of the ghost itself: grey, cold, a little dark and out of focus */
.tbl :is(.tseat, .tme).ghosted :is(.thead, .tcards), .tbl .thand.ghosted { filter: grayscale(1) sepia(.55) hue-rotate(var(--g-hue)) saturate(var(--g-sat)) brightness(var(--g-dark)) contrast(1.15) blur(var(--g-lb)); }
.tbl :is(.tbar, .gdock).ghosted, .gsheet.ghosted { filter: grayscale(1) sepia(.55) hue-rotate(var(--g-hue)) saturate(var(--g-sat)) brightness(var(--g-dark)) contrast(1.15) blur(var(--g-pb)); }
.tbl :is(.tseat, .tme).ghosted .tname { color: #fff; text-shadow: 0 0 calc(var(--u) * 10) rgba(170, 215, 255, .95), 0 0 calc(var(--u) * 22) rgba(120, 180, 255, .6); }
/* The ghost on the corner of the avatar */
.tbl .gbadge { position: absolute; right: calc(var(--u) * -4); bottom: calc(var(--u) * -4); width: calc(var(--u) * 14); height: calc(var(--u) * 14); border-radius: 50%; background: #fff6df; display: grid; place-items: center; z-index: 2; animation: gbadgein .5s cubic-bezier(.3, 1.6, .5, 1) .6s backwards; }
.tbl .gbadge svg { width: 70%; height: 70%; display: block; }
@keyframes gbadgein { from { opacity: 0; scale: .4; } }
/* The player's own set, hand and panel, alive: a hit when the ghosting lands, then a slow float */
/* The ghost's cards and panel are animated one by one, not the seat as a whole: an animated seat would be one layer, and the line between two picks could then only pass over all of it or under all of it (it must pass over the cards and under the panel, as on every other seat) */
.tbl :is(.tseat, .tme).ghosted > :is(.tcards, .thead), .tbl .thand.ghosted { animation: gpulse var(--g-pulse) cubic-bezier(.3, 1.2, .5, 1), gbob var(--g-bobms) ease-in-out var(--g-settle) infinite; }
@keyframes gpulse { 0% { scale: 1; } 30% { scale: 1.06; } 65% { scale: .985; } 100% { scale: 1; } }
@keyframes gbob { 0%, 100% { translate: 0 0; } 50% { translate: 0 calc(var(--g-bob) * -1); } }
/* The two shadows: a copy of the whole element stretched away from the player, tinted and blurred. The copy has no mask of its own (a mask on the copy is cut at the copy's box, which the cards can overflow, and shows hard corners):
   instead the parts of it whose box is their own content (the row of cards, the hand) feather their own edges, so no edge of the shadow is ever sharp. */
.tbl .gcopy { pointer-events: none; user-select: none; --o: var(--g-t1o); --s: var(--g-t1l); --dl: 0s; --sx: 1; --sy: var(--s); --bl: var(--g-t1b); transform-origin: 50% 0;
  opacity: var(--o); scale: var(--sx) var(--sy);
  filter: grayscale(1) sepia(.8) hue-rotate(var(--g-hue)) saturate(var(--g-sat)) brightness(var(--g-tb)) contrast(1.1) blur(var(--bl));
  animation: gin var(--g-fade) cubic-bezier(.2, .8, .2, 1) var(--dl) backwards, gfade calc(var(--g-fade) * .8) ease var(--dl) backwards, gbreathe var(--g-breath) ease-in-out var(--g-settle) infinite, gbob var(--g-bobms) ease-in-out var(--g-settle) infinite; }
.tbl .gcopy.gt2 { --bl: var(--g-t2b); --o: var(--g-t2o); --s: var(--g-t2l); --dl: .05s; }
/* Only the look of the cards is copied: no frames, pick outlines, marks, glows or animations, and nothing that blurs what is behind it */
.tbl .gcopy * { animation: none !important; transition: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.tbl .gcopy :is(.selfx, .seenfx, .swapfx, .exfx, .tsnd, .gbadge) { display: none !important; }
.tbl .gcopy .card { outline: none !important; box-shadow: none !important; translate: none !important; scale: none !important; }
/* On every seat, whichever side of the table and whatever the screen, the shadows stretch down (the origin is the top edge, the stretch is vertical) */
/* Feathered edges on every side of the row of cards, and a soft top and bottom on the hand */
.tbl .gcopy .tcards { -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent), linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent); -webkit-mask-composite: source-in; mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent), linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent); mask-composite: intersect; }
.tbl .thand.gcopy { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent); }
/* While ghosted nothing answers a hover: the cards and buttons under the effect stay as they are */
:is(.tseat, .tme, .thand).ghosted .card:not(.selected):hover { translate: none !important; scale: none !important; transform: none !important; box-shadow: var(--card-shadow) !important; }
:is(.tbar, .gdock, .gsheet).ghosted button:not(.card):hover { transform: none !important; filter: none !important; box-shadow: none !important; }
.tbl .tbar.ghosted .tactions button:hover { box-shadow: 0 calc(var(--u) * 3) 0 var(--ink) !important; }
:is(.gdock, .gsheet).ghosted :is(.gsmile, .gsend):hover { background: rgba(255, 255, 255, .3); }
:is(.gdock, .gsheet).ghosted .gsounds:not(.on):hover { background: rgba(255, 255, 255, .3); }
:is(.gdock, .gsheet).ghosted .gemoji button:hover { background: none; }
/* The look comes in and goes out the same way: first the tint, blur and darkness, then the grey. (Easing the filter straight to "none" would turn the hue through the greens, so the hue is only changed while everything is grey.) The one that leaves is the same, played backwards. */
@keyframes ghostoff {
  0% { filter: grayscale(1) sepia(.55) hue-rotate(var(--g-hue)) saturate(var(--g-sat)) brightness(var(--g-dark)) contrast(1.15) blur(var(--g-lb)); }
  50% { filter: grayscale(1) sepia(0) hue-rotate(var(--g-hue)) saturate(1) brightness(1) contrast(1) blur(0px); }
  50.1% { filter: grayscale(1) sepia(0) hue-rotate(0deg) saturate(1) brightness(1) contrast(1) blur(0px); }
  100% { filter: grayscale(0) sepia(0) hue-rotate(0deg) saturate(1) brightness(1) contrast(1) blur(0px); }
}
.tbl :is(.tseat, .tme).ungh > :is(.thead, .tcards), .tbl .thand.ungh, .tbl :is(.tbar, .gdock).ungh, .gsheet.ungh { animation: ghostoff var(--g-fade) ease both; }
/* On the way in: the same, backwards (added to the animations the ghosted parts already have) */
.tbl :is(.tseat, .tme).ghosted > :is(.thead, .tcards), .tbl .thand.ghosted { animation: gpulse var(--g-pulse) cubic-bezier(.3, 1.2, .5, 1), gbob var(--g-bobms) ease-in-out var(--g-settle) infinite, ghostoff var(--g-fade) ease reverse backwards; }
.tbl :is(.tbar, .gdock).ghosted, .gsheet.ghosted { animation: ghostoff var(--g-fade) ease reverse backwards; }
/* The shadows, fog and wash that were there are kept for a moment and fade out */
@keyframes gout { to { opacity: 0; } }
.tbl .gout { animation: gout var(--g-fade) ease forwards !important; pointer-events: none; }
@keyframes gin { from { scale: 1 1; } }
@keyframes gfade { from { opacity: 0; } }
@keyframes gbreathe { 0%, 100% { scale: var(--sx) var(--sy); } 50% { scale: var(--sx) calc(var(--sy) * 1.1); } }
/* Fog and film grain on top, in a soft oval */
.gfog { position: absolute; left: 50%; top: -10%; bottom: -10%; width: var(--gw, calc(var(--u) * 190)); translate: -50% 0; z-index: 25; pointer-events: none; opacity: var(--g-fog);
  animation: gfogin calc(var(--g-fade) * 1.7) ease backwards; }
@keyframes gfogin { from { opacity: 0; } }
:is(.tbar, .gdock, .gsheet) > .gfog { left: 0; right: 0; top: 0; bottom: 0; width: auto; translate: none; overflow: hidden; border-radius: inherit; }
@media (max-width: 700px) { .tbl :is(.tseat.left, .tseat.right) > .gfog { --gw: calc(var(--u) * 136); } .tbl .thand > .gfog { --gw: calc(var(--u) * 170); } }
.gb { position: absolute; border-radius: 50%; background: radial-gradient(closest-side, rgba(190, 225, 255, .5), rgba(120, 170, 220, .18) 60%, transparent 100%); }
.gb.b1 { width: 70%; height: 70%; left: -10%; top: 10%; animation: gdrift1 9s ease-in-out infinite; }
.gb.b2 { width: 75%; height: 60%; right: -12%; top: 30%; animation: gdrift2 11s ease-in-out infinite; }
.gb.b3 { width: 60%; height: 55%; left: 20%; bottom: -8%; animation: gdrift1 13s ease-in-out infinite reverse; }
@keyframes gdrift1 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(18%, -8%) scale(1.15); } }
@keyframes gdrift2 { 0%, 100% { transform: translate(0, 0) scale(1.1); } 50% { transform: translate(-20%, 6%) scale(.9); } }
/* The grain: a still wrapper holds the oval fade (a fade on a box that holds moving layers shows hard corners in some browsers); inside it a bigger layer of the film grain jumps by transform alone, which needs no repainting */
.ggrain { position: absolute; inset: 0; overflow: hidden; opacity: var(--g-gr); -webkit-mask-image: radial-gradient(closest-side, #000 40%, transparent 100%); mask-image: radial-gradient(closest-side, #000 40%, transparent 100%); }
.ggrain b { position: absolute; inset: -64px; background-image: var(--grain); background-size: 128px 128px; animation: ggr .8s steps(1) infinite; }
@keyframes ggr { 0% { translate: 0 0; } 25% { translate: -37px 21px; } 50% { translate: 19px -44px; } 75% { translate: -23px -13px; } }
/* The cold wash over the whole table, centred on the ghosted player */
.tbl .gchill { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: var(--g-wash); background: radial-gradient(90% 60% at var(--gc, 50% 15%), rgba(40, 80, 120, .5), rgba(8, 20, 40, 0) 70%); animation: gwashin calc(var(--g-fade) * 1.4) ease backwards; }
@keyframes gwashin { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tbl :is(.tseat, .tme).ghosted > :is(.tcards, .thead), .tbl .thand.ghosted, .tbl :is(.tbar, .gdock).ghosted, .gsheet.ghosted, .tbl :is(.tseat, .tme).ungh > :is(.thead, .tcards), .tbl .thand.ungh, .tbl :is(.tbar, .gdock).ungh, .gsheet.ungh, .tbl .gcopy, .gb, .ggrain b, .gfog, .tbl .gchill, .tbl .gbadge { animation: none; } .tbl .gout { display: none; } }
.tbl .tseat.out .thead, .tbl .tme.out .thead { opacity: .45; filter: grayscale(1); }
/* (no transition on the filter: when the ghost look ends, easing its filter back to none runs the hue-rotate through the greens, a green tint just before the cold look goes) */
.tbl :is(.thead, .tcards, .thand) { transition: opacity .5s ease, outline-color .15s, box-shadow .15s; }

/* ===== Above 700px: every player is the same: their four cards upright in a row, with their panel centred under it, overlapping its bottom edge by 14 ===== */
@media (min-width: 701px) {
  .tbl .tseat.left, .tbl .tseat.right { top: calc(var(--u) * 214); width: auto; flex-direction: column; align-items: center; gap: 0; }
  .tbl .tseat.left { left: calc(var(--u) * (-4 - var(--ex))); }
  .tbl .tseat.right { right: calc(var(--u) * (-4 - var(--ex))); }
  .tbl .tseat.left .thead, .tbl .tseat.right .thead { order: 2; margin-top: calc(var(--u) * -14); flex-direction: row; padding: calc(var(--u) * 4); text-align: left; }
  .tbl .tseat.left .tcards, .tbl .tseat.right .tcards { order: 1; flex-direction: row; gap: calc(var(--u) * 4); }
  .tbl .tseat.left .card, .tbl .tseat.right .card { width: calc(var(--u) * 32.8); height: calc(var(--u) * 50); }
  .tbl .tseat.left .card img, .tbl .tseat.right .card img { position: static; width: 100%; height: 100%; transform: none; }
  .tbl .tseat.left .tcards .ph, .tbl .tseat.right .tcards .ph { width: calc(var(--u) * 32.8); height: calc(var(--u) * 50); }
  /* empty seats: four upright places in the same spot */
  .tbl .tempty.left, .tbl .tempty.right { top: calc(var(--u) * 214); width: auto; flex-direction: row; gap: calc(var(--u) * 4); }
  .tbl .tempty.left { left: calc(var(--u) * (-4 - var(--ex))); }
  .tbl .tempty.right { right: calc(var(--u) * (-4 - var(--ex))); }
  .tbl .tempty i { width: calc(var(--u) * 32.8); height: calc(var(--u) * 50); }
}

/* Up to 600px wide: the two side players always sit 8u from the edges of the screen, so as the screen gets wider the space between them and the piles grows (the frame stays centred; these seats are moved out to the screen's edges) */
@media (max-width: 600px) {
  .tseat.left, .tempty.left { left: calc(var(--u) * 8 - (100vw - var(--u) * 328) / 2); }
  .tseat.right, .tempty.right { right: calc(var(--u) * 8 - (100vw - var(--u) * 328) / 2); }
}
/* The countdown has no outline around it, in every state (the page's own avatar border is switched off here) */
.tbl .tring.avatar, #app .tbl .tring.avatar { border: 0; outline: 0; background: none; }

/* From 601px to 700px the side players stay exactly where they were at 600px (the gap to the piles stops growing); they move again at 701px, where the wider table starts */
@media (min-width: 601px) and (max-width: 700px) {
  .tseat.left, .tempty.left { left: calc(var(--u) * 8 - (600px - var(--u) * 328) / 2); }
  .tseat.right, .tempty.right { right: calc(var(--u) * 8 - (600px - var(--u) * 328) / 2); }
}

/* The avatar and the countdown share one 30 x 30 place. A timer starting fades the avatar out (turning and shrinking a little) and the ring in, and it all runs back when the timer ends. */
.tbl .tbadge.avatar, #app .tbl .tbadge.avatar { position: relative; display: block; flex: none; width: calc(var(--u) * 30); height: calc(var(--u) * 30); margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; box-shadow: none; font-size: 0; overflow: visible; }
.tbl .tbadge .tavatar, .tbl .tbadge .tring { position: absolute; inset: 0; }
.tbl .tbadge .tavatar { transition: opacity .35s ease, transform .45s cubic-bezier(.34, 1.4, .64, 1); }
.tbl .tbadge .tring { opacity: 0; transform: scale(.55) rotate(-60deg); box-shadow: 0 0 0 0 rgba(255, 221, 0, 0); transition: opacity .3s ease, transform .5s cubic-bezier(.34, 1.4, .64, 1), box-shadow .45s ease; pointer-events: none; }
.tbl .tbadge.counting .tavatar { opacity: 0; transform: scale(.55) rotate(60deg); }
.tbl .tbadge.counting .tring, #app .tbl .tbadge.counting .tring { opacity: 1; transform: none; box-shadow: 0 0 calc(var(--u) * 12) 0 #FD0; }
@media (prefers-reduced-motion: reduce) { .tbl .tbadge .tavatar, .tbl .tbadge .tring { transition: none; } }

/* The emoji is a box of its own, moved by a measured shift so its picture sits in the exact middle of the circle */
/* the emoji is a picture centred by its own pixels, laid over the middle of the circle (it is 4/3 the circle's size, as the emoji itself is) */
.tbl .tavatar { position: absolute; }
.tbl .tavatar .tem { position: absolute; left: 50%; top: 50%; width: 1.3333em; height: 1.3333em; max-width: none; translate: -50% -50%; pointer-events: none; user-select: none; }
.tbl .tavatar .tem.plain { font-style: normal; line-height: 1; width: 1em; height: 1em; text-align: center; }
/* The "Swapped" label sits on the top of the cards of the top player and of mine (the bottom is under their panels) */

/* The cards of the open pile show no outline when they are there to pick from */
.tbl .tpile .card.pick { outline: none; }

/* "Swapped" always sits at the top of the card, whichever seat it is */

/* A picked hidden card (the first card of a Swap, or the two cards of a Swap while they are being answered) stays lifted a little, like the hover */
.tbl .tcards .card.slot.selected { translate: 0 calc(var(--u) * -5); scale: 1.02; box-shadow: 0 3px 6px rgba(0, 0, 0, .1), var(--card-shadow); }

/* On the phone layout the left and right players' cards lie on their sides: they lift toward the middle of the table (the left ones to the right, the right ones to the left), not up */
@media (max-width: 700px) {
  .tbl .tseat.left .tcards .card.slot.selected { translate: calc(var(--u) * 5) 0; }
  .tbl .tseat.right .tcards .card.slot.selected { translate: calc(var(--u) * -5) 0; }
}
@media (max-width: 700px) and (hover: hover) {
  .tbl .tseat.left .tcards:not(:has(.seenpick, .plotpick)):not(.seensel) .card.slot:hover:not(.selected) { translate: calc(var(--u) * 5) 0; }
  .tbl .tseat.right .tcards:not(:has(.seenpick, .plotpick)):not(.seensel) .card.slot:hover:not(.selected) { translate: calc(var(--u) * -5) 0; }
}

/* Open and Close: no hover or press look at all (the page's button style would lift them and drop a dark edge under them); they stay exactly where they are */
.tbl .tseepile, .tbl .tseepile:hover, .tbl .tseepile:active, .tbl .tseepile:focus-visible { transform: translateX(-50%); box-shadow: none; filter: none; outline: none; background: rgba(255, 255, 255, .22); }
.tbl .tclose, .tbl .tclose:hover, .tbl .tclose:active, .tbl .tclose:focus-visible { transform: translateX(-50%); box-shadow: none; filter: none; outline: none; background: rgba(255, 255, 255, .22); }
/* The card count on the draw pile is a circle */
.tbl .card.deck small.count { position: absolute; left: 50%; bottom: calc(var(--u) * 6); transform: translateX(-50%); width: calc(var(--u) * 18); height: calc(var(--u) * 18); padding: 0; display: grid; place-items: center; border-radius: 50%; font-size: calc(var(--u) * 10); line-height: 1; font-weight: 800; background: var(--ink); color: #fff; letter-spacing: 0; }

/* A pause (asked for, taken back, running, counting down): the table behind the pause sheet is blurred and cannot be used; only the sheet, the
   chat and its button are left. Nothing is darkened, so Safari's bars keep the page's colour */
body.paused .tbl { outline: 0; }
.tbl > * { transition: filter .3s ease; }
body.pblur .tbl > :not(.ttools, .gdock, .tlogo) { filter: blur(4px); pointer-events: none; user-select: none; }
body.pblur .tbl .gdock .greact { display: none; }
/* The veil is a part of the page itself (not of the table's markup, which is redrawn all the time), so nothing a redraw does can make it blink */
/* Safari tints its bars from the colour of a layer that covers the whole screen, whatever its opacity, and keeps that tint after the layer is
   gone. So the veil fades by its colour (from and to transparent), and is not there at all when it is off */
.shell::after { content: ""; position: fixed; inset: 0; z-index: 55; display: none; background-color: transparent; pointer-events: none; transition: background-color .3s ease, display .3s allow-discrete; }
.shell:has(.modal)::after { display: block; background-color: rgba(8, 0, 2, .6); pointer-events: auto; }
@starting-style { .shell:has(.modal)::after { background-color: transparent; } }
/* Every dialog sits on the veil: it has no backdrop of its own */
#app > .modal { background: transparent !important; z-index: 100000 !important; }
/* The flying cards live on the page itself, outside the shell: while a dialog is open the shell stops being a layer of its own, so the veil and the dialog are above every card, always */
body.tbl-page .shell:has(.modal) { z-index: auto; }
/* The phone's chat is above everything while it is open (the cards dealt or flying, the caution tape, a throw): the shell stops being a layer of its own, so the chat is compared with them directly */
body.tbl-page .shell:has(.gchat:not(.out)) { z-index: auto; }
/* (the same for the pause and Settings sheet: it is above the cards being dealt or flying) */
body.tbl-page .shell:has(.gpause:not(.out)) { z-index: auto; }
.shell:has(.modal)::after { z-index: 99999; }
.pauseicon { display: inline-block; width: .5em; height: .6em; vertical-align: middle; fill: currentColor; }
@media (prefers-reduced-motion: reduce) { .shell::after { transition: none; } }

/* Above 700px the whole table sits in the middle of the screen, across and down (the page is as tall as the window and the table is centred in it) */
@media (min-width: 701px) {
  body.tbl-page .shell { min-height: var(--app-h, 100dvh); display: flex; flex-direction: column; justify-content: center; align-items: center; }
  body.tbl-page #app { flex: 0 0 auto; width: 100%; }
  body.tbl-page .tbl { margin: 0 auto; }
}
/* The preview page has no page shell: its table is centred the same way */
@media (min-width: 701px) { body.tbl-page > #root { min-height: var(--app-h, 100dvh); display: flex; align-items: center; justify-content: center; width: 100%; } }

/* Testing: the table picture hidden (the seats, piles and cards stay where they are) */
body.notable .tbl::after { display: none; }

/* Someone looking at cards (Seen) while their clock runs: the eyes sit in the middle of the ring, glancing side to side, with no seconds */
.tbl .tring.eyesring b { position: absolute; inset: 0; display: block; }
.tbl .tring.eyesring .tem { position: absolute; left: 50%; top: 50%; width: calc(var(--u) * 19); height: calc(var(--u) * 19); max-width: none; translate: -50% -50%; pointer-events: none; user-select: none; }
.tbl .tring.eyesring .tem.plain { font-style: normal; font-size: calc(var(--u) * 14); line-height: 1; width: auto; height: auto; }
.tbl .tbadge.eyes .tring.eyesring .tem { font-size: calc(var(--u) * 14); animation: tlook 1.2s ease-in-out infinite; }

/* The menu: a round button in the top right corner of the screen opens a small list (Table on/off, Leave). Nothing else sits outside the playing area. */
.tmenu { position: fixed; right: calc(12px + env(safe-area-inset-right, 0px)); top: calc(12px + env(safe-area-inset-top, 0px)); z-index: 60; }
.tbl .tburger { display: grid; place-items: center; width: 40px; height: 40px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .3); color: #fff; box-shadow: none; filter: none; cursor: pointer; transition: background-color .15s; }
.tbl .tburger:hover, .tbl .tburger:active, .tbl .tburger:focus-visible, .tmenu.open .tburger { transform: none; box-shadow: none; filter: none; background: rgba(0, 0, 0, .5); }
.tbl .tburger:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tburger svg { display: block; overflow: visible; }
.tburger svg path { fill: currentColor; stroke: none; transform-origin: 12px 12px; transition: transform .4s cubic-bezier(.34, 1.4, .64, 1); }
.tmenu.open .tburger svg path { transform: rotate(60deg); }
.tmenulist { position: absolute; right: 0; top: 48px; display: none; flex-direction: column; gap: 2px; min-width: 190px; padding: 6px; border-radius: 16px; background: rgba(46, 8, 8, .85); -webkit-backdrop-filter: blur(8px) saturate(1.5); backdrop-filter: blur(8px) saturate(1.5); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 8px 24px rgba(0, 0, 0, .4); }
.tmenu.open .tmenulist { display: flex; animation: tmenuin .16s ease-out; }
@keyframes tmenuin { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
.tbl .tmenulist button, .tbl .tmenulist button:hover, .tbl .tmenulist button:active { display: block; width: 100%; height: 40px; min-height: 0; margin: 0; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: #fff; font: inherit; font-size: 14px; font-weight: 700; letter-spacing: 0; text-align: left; box-shadow: none; filter: none; transform: none; cursor: pointer; transition: background-color .12s; }
.tbl .tmenulist button:hover, .tbl .tmenulist button:focus-visible { background: rgba(255, 255, 255, .13); outline: none; }
.tbl .tmenulist button[data-act="leave"] { color: #ffb3b3; }
@media (prefers-reduced-motion: reduce) { .tmenu.open .tmenulist { animation: none; } .tburger svg path { transition: none; } }

html:has(body.tbl-page) { overscroll-behavior: none; }

/* The table picture is hidden for now (the markup and its toggle stay): the game is played on the lobby's red background, drawn on the page itself like the lobby's */
.tbl::after { display: none; }
.tmenulist [data-act="toggleTable"] { display: none; }
body.tbl-page, body.online.tbl-page { background: none; }
/* The table's background: a soft light on the two piles only, and a darker red everywhere else */
html:has(body.tbl-page) { min-height: 100%; background-color: #34060d; background-image: radial-gradient(circle 76vmin at 50% 45%, #d92432 0, #a81a26 22%, #6e0f19 48%, #4f0a13 72%, #3f0710 88%, #34060d 100%); background-repeat: no-repeat; background-size: 100% 100%; overscroll-behavior-y: none; }
body.tbl-page:not([data-result]) { --bg0: #d92432; --bg1: #a81a26; --bg2: #6e0f19; --bg3: #4f0a13; --bg4: #3f0710; --bg5: #34060d; }
body.tbl-page { background: var(--bg5) radial-gradient(ellipse 58% 44% at 50% 45%, var(--bg0) 0, var(--bg1) 22%, var(--bg2) 48%, var(--bg3) 72%, var(--bg4) 88%, var(--bg5) 100%) fixed; }

/* ===== The phone table (up to 700px), redesigned: a 328 x 712 frame ===== */
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/nunito-500-latin.woff2) format("woff2"); }

/* The three buttons at the top of the screen, on every screen size: the chat and the sounds at the left, the menu at the right, each 34 x 34 */
.ttools { position: fixed; left: calc(8px + env(safe-area-inset-left, 0px)); top: calc(8px + env(safe-area-inset-top, 0px)); z-index: 60; display: flex; gap: 6px; }
.tbl .tbtn, .tbl .tburger { display: grid; place-items: center; width: 34px; height: 34px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 999px; background: rgba(0, 0, 0, .5); color: #e5e5e5; box-shadow: none; filter: none; cursor: pointer; transition: background-color .15s; }
.tbl .tbtn:hover, .tbl .tbtn:active, .tbl .tbtn:focus-visible, .tbl .tburger:hover, .tbl .tburger:active, .tbl .tburger:focus-visible, .tmenu.open .tburger { transform: none; box-shadow: none; filter: none; background: rgba(0, 0, 0, .65); }
.tbl .tbtn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tbtn svg, .tburger svg { display: block; }
.tmenu { right: calc(8px + env(safe-area-inset-right, 0px)); top: calc(8px + env(safe-area-inset-top, 0px)); }
.tmenulist { top: 40px; }
.tburger svg { width: 14px; height: 14px; }

/* The bottom bar belongs to the phone: on a wide screen its line is hidden and its buttons stay where they were */
.tstatus { margin: 0; }
@media (min-width: 701px) { .tbl .tline, .tbl .tstatus, .tbl .tactions button[data-idle] { display: none; } }
@media (max-width: 700px) { .tbl .thdr, .tbl .tbody, .tbl .gdock { display: none; } }

@media (max-width: 700px) {
  .tbl { --u: min(calc(100vw / 328), calc((var(--app-h, 100dvh) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) / 712), var(--u-max, 100px)); height: calc(var(--u) * 712); }

  /* Panels: black glass, 100 x 38 */
  .tbl .thead { background: rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(4px) saturate(1.5); backdrop-filter: blur(4px) saturate(1.5); box-shadow: none; }

  /* The top player's cards start 50 down, with the panel over their lower edge */
  .tbl .tseat.top { top: calc(var(--u) * 14); }
  /* The two side players sit level with the piles, 24 below the top player; panel first, then the column of cards, and each panel the mirror of the other */
  .tbl .tseat.left, .tbl .tseat.right { top: calc(var(--u) * 151.5); }
  .tbl .tseat.left .thead { order: -1; }
  .tbl .tempty { top: calc(var(--u) * 193.5); }

  /* The piles: 62 x 94, level with the side players' cards */
  .tbl .tcentre { top: calc(var(--u) * 203); }
  .tbl .tcentre .card.deck { --w: calc(var(--u) * 62); left: calc(var(--u) * 95); top: calc(var(--u) * 3); width: calc(var(--u) * 62); height: calc(var(--u) * 94); }
  .tbl .tdiscard { left: calc(var(--u) * 173); top: calc(var(--u) * 8); width: calc(var(--u) * 62); height: calc(var(--u) * 94); }
  .tbl .tdiscard .card { --w: calc(var(--u) * 62); width: calc(var(--u) * 62); height: calc(var(--u) * 94); }
  .tbl .tseepile { left: calc(var(--u) * 204); top: calc(var(--u) * 110); }
  .tbl .tstatus { left: calc(var(--u) * 92); right: calc(var(--u) * 92); top: calc(var(--u) * 172); font: 500 calc(var(--u) * 12) / 1.3 Nunito, ui-rounded, system-ui, sans-serif; }

  /* My hidden set, the top player's and my hand: all 52.5 x 80 (the two sets 7 apart), the pile exactly halfway between the top panel and my cards. The two side players' cards stay small. */
  .tbl .tme { top: calc(var(--u) * 402); }
  .tbl .tcards.mine { gap: calc(var(--u) * 7); }
  .tbl .tcards.mine .card, .tbl .tcards.mine .ph { --w: calc(var(--u) * 52.5); width: calc(var(--u) * 52.5); height: calc(var(--u) * 80); }
  .tbl .tseat.top .tcards, .tbl.duel .tseat.top .tcards { gap: calc(var(--u) * 7); }
  .tbl .tseat.top .card, .tbl .tseat.top .tcards .ph, .tbl.duel .tseat.top .card, .tbl.duel .tseat.top .tcards .ph { --w: calc(var(--u) * 52.5); width: calc(var(--u) * 52.5); height: calc(var(--u) * 80); }
  /* The panels of the top player and of me are the same: 130 x 38, over the lower edge of the cards by 23 */
  .tbl .tseat.top .thead, .tbl .tme .thead { width: calc(var(--u) * 130); margin-top: calc(var(--u) * -23); }
  .tbl .thand { top: calc(var(--u) * 512); }
  .tbl .thand .handslot, .tbl .thand .card { --w: calc(var(--u) * 52.5); width: calc(var(--u) * 52.5); height: calc(var(--u) * 80); }
  .tbl .thand .handslot { margin: 0 calc(var(--u) * -4.75); }
  .tbl .thand .card { margin: 0; }

  /* The bottom bar: a line over the buttons, across the whole screen */
  .tbl .tbar { position: absolute; left: calc((var(--u) * 328 - 100vw) / 2); width: 100vw; bottom: 0; min-height: calc(var(--u) * 100); padding: calc(var(--u) * 8) calc(var(--u) * 24) calc(var(--u) * 24); display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 8); background: rgba(0, 0, 0, .5); border-radius: calc(var(--u) * 16) calc(var(--u) * 16) 0 0; z-index: 10; }
  .tbl .tline { margin: 0; max-width: 100%; font: 500 calc(var(--u) * 12) / calc(var(--u) * 16) Nunito, ui-rounded, system-ui, sans-serif; text-align: center; color: #fff; }
  .tbl .tline em { font-style: normal; color: #e8aa2c; }
  .tbl .tactions { position: static; display: flex; justify-content: center; gap: calc(var(--u) * 8); }
  .tbl .tactions button { height: calc(var(--u) * 44); min-height: 0; padding: 0 calc(var(--u) * 14); border-width: calc(var(--u) * 1.5); border-radius: calc(var(--u) * 16); font: 700 calc(var(--u) * 13) / 1.2 "Trebuchet MS", system-ui, sans-serif; letter-spacing: 0; box-shadow: 0 calc(var(--u) * 3) 0 var(--ink); }
  /* Longer labels (two buttons that would not fit side by side) are set smaller */
  .tbl .tactions.tight button { padding: 0 calc(var(--u) * 8); }
  .tbl .tactions button:disabled { --btn: var(--cyan); --btn-ink: #fff; opacity: .42; }
}

/* ===== The table chat: a sheet over the table, down to the keyboard (--vvh and --vvt are the part of the screen the keyboard leaves, set from the visual viewport), the rest of the table dimmed ===== */
.tbl .tbtn.unread { position: relative; }
.tbl .tbtn.unread::after { content: ""; position: absolute; right: 5px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: #ffcf21; box-shadow: 0 0 0 2px rgba(0, 0, 0, .55); }
.gchat { --u: 1px; position: fixed; left: 0; right: 0; top: var(--vvt, 0px); height: var(--vvh, 100dvh); z-index: 10000; display: flex; align-items: flex-end; justify-content: center; padding: 69px max(8px, env(safe-area-inset-right, 0px)) 0 max(8px, env(safe-area-inset-left, 0px)); box-sizing: border-box; pointer-events: none; font-family: "Trebuchet MS", system-ui, sans-serif; }
.gscrim { position: absolute; inset: 0; background: transparent; pointer-events: auto; }
:is(.gchat, .gdock) button { all: unset; box-sizing: border-box; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:is(.gchat, .gdock) button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.gsheet { position: relative; pointer-events: auto; width: 100%; max-width: 420px; height: 420px; max-height: 100%; display: flex; flex-direction: column; gap: 8px; padding: 8px 16px calc(24px + env(safe-area-inset-bottom, 0px)); border-radius: 16px 16px 0 0; background: rgba(0, 0, 0, .9); color: #fff; box-sizing: border-box; text-align: left; }
.gsheet *, .gsheet *::before, .gsheet *::after { box-sizing: border-box; }
.ghead { position: relative; flex: none; height: 24px; display: flex; align-items: center; justify-content: center; }
.ghead b { font: 700 16px/20px "Trebuchet MS", system-ui, sans-serif; }
.gchat .gx { position: absolute; right: -8px; top: 0; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 99px; background: none; color: #fff; }
.gx svg { width: 9px; height: 9px; }
.gturn { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: 16px; background: #e8aa2c; color: #292923; }
.gturnt { flex: 1; font: 400 16px/18px "Trebuchet MS", system-ui, sans-serif; }
.gturn .tring { --c: #292923; box-shadow: none; flex: none; }
.gturn .tring b { color: #292923; }
.gchat .gtag {  flex: none; padding: 8px 10px; border-radius: 7px; background: rgba(0, 0, 0, .3); color: #292923; font: 700 calc(var(--k) * 12)/calc(var(--k) * 14) "Trebuchet MS", system-ui, sans-serif; }
.gbody { flex: 1 1 auto; height: auto; min-height: 0; padding: 0; }
.gform { flex: none; display: flex; align-items: center; gap: 8px; }
:is(.gchat, .gdock) .gsmile, :is(.gchat, .gdock) .gsend { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 99px; background: rgba(255, 255, 255, .3); color: #fff; transition: background-color .15s, transform .15s; }
:is(.gchat, .gdock) .gsmile:hover, :is(.gchat, .gdock) .gsend:hover { background: rgba(255, 255, 255, .5); }
:is(.gchat, .gdock) .gsend:active, :is(.gchat, .gdock) .gsmile:active { transform: scale(.92); }
:is(.gchat, .gdock) button:disabled { opacity: .45; cursor: default; }
.gsend svg, .gsmile svg { width: 16px; height: 16px; }
:is(.gchat, .gdock) input.gin { all: unset; box-sizing: border-box; flex: 1; min-width: 0; height: 32px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 99px; background: rgba(255, 255, 255, .5); color: #fff; font: 400 calc(var(--k) * 16)/calc(var(--k) * 18) "Trebuchet MS", system-ui, sans-serif; -webkit-user-select: text; user-select: text; }
:is(.gchat, .gdock) input.gin::placeholder { color: rgba(255, 255, 255, .72); }
:is(.gchat, .gdock) input.gin:focus { border-color: #fff; background: rgba(255, 255, 255, .6); }
:is(.gchat, .gdock) input.gin:disabled { opacity: .55; }
.gemoji { flex: none; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 6px; border-radius: 12px; background: rgba(255, 255, 255, .1); }
:is(.gchat, .gdock) .gemoji button { display: grid; place-items: center; height: 30px; border-radius: 8px; font-size: 19px; line-height: 1; }
:is(.gchat, .gdock) .gemoji button:hover { background: rgba(255, 255, 255, .18); }
@media (hover: none) and (pointer: coarse) { .gchat input.gin { font-size: max(16px, calc(var(--k) * 16)); } }
#app .gchat .gsheet { margin: 0; border: 0; text-align: left; }

/* The chat and sounds buttons turn white (dark icon) while their panel is open */
.tbl .tbtn.on, .tbl .tbtn.on:hover, .tbl .tbtn.on:active, .tbl .tbtn.on:focus-visible { background: #fff; color: #292923; }

/* ===== Voice reactions: a white panel under the sounds button, with a little point up at it ===== */
.greact { --u: 1px; position: fixed; inset: 0; z-index: 10000; pointer-events: none; font-family: "Trebuchet MS", system-ui, sans-serif; }
.gscrim.clear { background: transparent; }
.gpanel { position: absolute; left: calc(8px + env(safe-area-inset-left, 0px)); top: calc(59px + env(safe-area-inset-top, 0px)); width: min(312px, calc(100vw - 16px)); display: flex; flex-direction: column; gap: 16px; padding: 8px; border-radius: 16px; background: #fff; color: #292923; box-sizing: border-box; pointer-events: auto; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.gpanel *, .gpanel *::before, .gpanel *::after { box-sizing: border-box; }
#app .greact .gpanel { border: 0; }
.gcaret { position: absolute; left: 45px; top: -12px; width: 25px; height: 13px; background: #fff; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.gphead { position: relative; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.gphead b { font: 700 16px/24px "Trebuchet MS", system-ui, sans-serif; }
.gphead small { font: 500 12px/16px Nunito, "Trebuchet MS", system-ui, sans-serif; }
.greact button { all: unset; box-sizing: border-box; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.greact button:focus-visible, .gtile:focus-visible { outline: 2px solid #292923; outline-offset: 2px; }

.ggrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gtile { min-height: 72px; padding: 8px; border-radius: 10px; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; text-align: left; cursor: pointer; transition: transform .12s, opacity .15s; -webkit-user-select: none; user-select: none; }
.gtile:active { transform: scale(.97); }
.gtile b { font: 400 12px/14px "Trebuchet MS", system-ui, sans-serif; }
.gtile.used { opacity: .45; cursor: default; }
.gtile.used:active { transform: none; }
.gtimes { display: flex; align-items: flex-end; justify-content: space-between; }
.gtimes small { font: 400 10px/12px "Trebuchet MS", system-ui, sans-serif; color: #696662; }
.greact .gplay { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #1f1f1d; color: #fff; transition: transform .12s; }
.greact .gplay:active { transform: scale(.88); }
.gplay svg { width: 10px; height: 10px; margin-left: 1px; }

/* The page's own button look (a dark edge that drops on press) must not touch these buttons */
.greact button:hover, .greact button:active, .greact button:focus, :is(.gchat, .gdock) button:hover, :is(.gchat, .gdock) button:active { box-shadow: none; filter: none; }
.greact button.gplay:hover, .greact button.gplay:active { background: #1f1f1d; transform: none; }
.greact button.gplay:active { transform: scale(.88); }
.greact button.gpx:hover, .greact button.gpx:active { background: #b5b2ae; }
.greact button:hover, :is(.gchat, .gdock) button:hover { transform: none; }

/* One against one: the opponent's hidden set is the same size as mine */
.tbl.duel .tseat.top .tcards { gap: calc(var(--u) * 4); }
.tbl.duel .tseat.top .card, .tbl.duel .tseat.top .tcards .ph { --w: calc(var(--u) * 39.4); width: calc(var(--u) * 39.4); height: calc(var(--u) * 60); }

/* The game page never scrolls: it is pinned to the window, whose height is measured by the script (--app-h = the height of the visible page, which changes when Safari's toolbars come and go). Without this the page could scroll a little, and the table slid up with a gap under the bottom bar. */
body.tbl-page { position: fixed; left: 0; right: 0; top: 0; height: var(--app-h, 100dvh); min-height: 0; overflow: hidden; }

/* ===== The wide screen (701px and up), redesigned: a 1046 x 712 frame. The cards of my hidden set and of my hand are 66 x 100; the other players' sets 48 x 70. ===== */
@media (min-width: 701px) {
  .tbl { --ex: 0; --u: min(calc(100vw / 1046), calc((var(--app-h, 100dvh) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) / 712), 2.5px); width: calc(var(--u) * 1046); /* as tall as the window when it is taller than the design: the top players stay at the top, my side stays at the bottom, and the piles keep the middle */ height: max(calc(var(--u) * 712), calc(var(--app-h, 100dvh) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))); }
  .tbl::before, .tbl::after { display: none; }

  /* The two buttons in the corners of the screen: 40 x 40, 16 from the edges. The chat has a panel of its own here. */
  .ttools { left: calc(16px + env(safe-area-inset-left, 0px)); top: calc(16px + env(safe-area-inset-top, 0px)); }
  .tmenu { right: calc(16px + env(safe-area-inset-right, 0px)); top: calc(16px + env(safe-area-inset-top, 0px)); }
  .tbl .tbtn, .tbl .tburger { width: 40px; height: 40px; }
  .tbl .tbtn[data-act="chat"] { display: none; }
  .tmenulist { top: 48px; }
  .gpanel { left: calc(16px + env(safe-area-inset-left, 0px)); top: calc(66px + env(safe-area-inset-top, 0px)); }
  .gpanel { border-top-left-radius: 7px; }
  .gcaret { left: 7.5px; }

  /* The panels: 160 x 56, the avatar 40, the name 16 over the state 12 */
  .tbl .thead { width: calc(var(--u) * 160); height: calc(var(--u) * 56); padding: calc(var(--u) * 8); gap: calc(var(--u) * 10); background: rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(calc(var(--u) * 2.7)) saturate(1.5); backdrop-filter: blur(calc(var(--u) * 2.7)) saturate(1.5); box-shadow: none; }
  .tbl .tname { font-size: calc(var(--u) * 16); line-height: 1.15; }
  .tbl .tsub { font-size: calc(var(--u) * 12); line-height: 1.15; color: #dedede; }
  .tbl .tbadge.avatar, #app .tbl .tbadge.avatar { width: calc(var(--u) * 40) !important; height: calc(var(--u) * 40) !important; }
  #app .tbl .tavatar, #app .tbl .tring { width: calc(var(--u) * 40) !important; height: calc(var(--u) * 40) !important; }
  #app .tbl .tavatar { font-size: calc(var(--u) * 40) !important; }
  .tbl .tring b { font-size: calc(var(--u) * 16); }
  .tbl .tring.eyesring .tem { width: calc(var(--u) * 25); height: calc(var(--u) * 25); }
  .tbl .tbadge.eyes .tring.eyesring .tem, .tbl .tring.eyesring .tem.plain { font-size: calc(var(--u) * 18); }

  /* The other players: four cards 48 x 70 in a row with the panel centred under them (over their lower edge by 17); the top player at the middle with its cards 60 from the top of the screen, the other two 50 lower at the sides */
  .tbl .tseat.top { left: calc(var(--u) * 418); right: auto; width: calc(var(--u) * 210); top: 60px; }
  .tbl .tseat.left { left: calc(var(--u) * 49); right: auto; width: calc(var(--u) * 210); top: calc(60px + var(--u) * 50); }
  .tbl .tseat.right { left: calc(var(--u) * 787); right: auto; width: calc(var(--u) * 210); top: calc(60px + var(--u) * 50); }
  .tbl .tseat .tcards { gap: calc(var(--u) * 5.88); }
  .tbl .tseat.top .card, .tbl .tseat.left .card, .tbl .tseat.right .card, .tbl .tseat.top .tcards .ph, .tbl .tseat.left .tcards .ph, .tbl .tseat.right .tcards .ph { --w: calc(var(--u) * 48); width: calc(var(--u) * 48); height: calc(var(--u) * 70); }
  .tbl .tseat .thead { margin-top: calc(var(--u) * -17); }
  .tbl .tempty.left { left: calc(var(--u) * 49); top: calc(60px + var(--u) * 50); width: calc(var(--u) * 210); gap: calc(var(--u) * 5.88); }
  .tbl .tempty.right { left: calc(var(--u) * 787); right: auto; top: calc(60px + var(--u) * 50); width: calc(var(--u) * 210); gap: calc(var(--u) * 5.88); }
  .tbl .tempty i { width: calc(var(--u) * 48); height: calc(var(--u) * 70); }
  /* One against one: the other player's set is the size of mine */
  .tbl.duel .tseat.top .tcards { gap: calc(var(--u) * 7.5); }
  .tbl.duel .tseat.top .card, .tbl.duel .tseat.top .tcards .ph { --w: calc(var(--u) * 66); width: calc(var(--u) * 66); height: calc(var(--u) * 100); }
  .tbl.duel .tseat.top .thead { margin-top: calc(var(--u) * -32); }

  /* The piles in the middle */
  .tbl .tcentre { top: calc(43.5% - var(--u) * 65); height: calc(var(--u) * 150); }
  .tbl .tcentre .card.deck { --w: calc(var(--u) * 82); left: calc(var(--u) * 432); top: 0; width: calc(var(--u) * 82); height: calc(var(--u) * 125); }
  .tbl .tdiscard { left: calc(var(--u) * 534); top: calc(var(--u) * 7); width: calc(var(--u) * 80); height: calc(var(--u) * 122); }
  .tbl .tdiscard .card { --w: calc(var(--u) * 80); width: calc(var(--u) * 80); height: calc(var(--u) * 122); }
  .tbl .tseepile { left: calc(var(--u) * 574); top: calc(var(--u) * 138); font-size: calc(var(--u) * 12); }
  .tbl .tpile { left: calc(var(--u) * 388); top: calc(43.5% - var(--u) * 101); width: calc(var(--u) * 270); height: calc(var(--u) * 220); grid-template-columns: repeat(4, calc(var(--u) * 52)); grid-auto-rows: calc(var(--u) * 80); gap: calc(var(--u) * 6); }
  .tbl .tpile .card { --w: calc(var(--u) * 52); width: calc(var(--u) * 52); height: calc(var(--u) * 80); }
  .tbl .tpile[style*="--n"] { grid-template-columns: repeat(var(--n), calc(var(--u) * 52)); }
  /* The Close button stands to the right of the open pile, level with its bottom edge: that space is always free */
  .tbl .tclose, .tbl .tclose:hover, .tbl .tclose:active, .tbl .tclose:focus-visible { left: calc(var(--u) * (388 + 270 + 10)); top: calc(43.5% - var(--u) * 101 + var(--u) * 220 - var(--u) * 6); bottom: auto; transform: translateY(-100%); font-size: calc(var(--u) * 12); }

  /* Me: my set 66 x 100 with my panel over its lower edge by 32, and my hand 66 x 100 under it, fanned */
  .tbl .tme { left: calc(var(--u) * 373); right: auto; width: calc(var(--u) * 300); top: auto; bottom: calc(var(--u) * 144); }
  .tbl .tcards.mine { gap: calc(var(--u) * 7.5); }
  .tbl .tcards.mine .card, .tbl .tcards.mine .ph { --w: calc(var(--u) * 66); width: calc(var(--u) * 66); height: calc(var(--u) * 100); }
  .tbl .tme .thead { margin-top: calc(var(--u) * -32); }
  .tbl .thand { top: auto; bottom: calc(var(--u) * 16); height: calc(var(--u) * 114); }
  .tbl .thand .handslot, .tbl .thand .card { --w: calc(var(--u) * 66); width: calc(var(--u) * 66); height: calc(var(--u) * 100); }
  .tbl .thand .handslot { margin: 0 calc(var(--u) * -3.15); }
  .tbl .thand .card { margin: 0; }
  .tbl .thand .handslot:nth-child(1) { translate: 0 calc(var(--u) * 6.1); }
  .tbl .thand .handslot:nth-child(2) { translate: 0 calc(var(--u) * .7); }
  .tbl .thand .handslot:nth-child(3) { translate: 0 calc(var(--u) * .7); }
  .tbl .thand .handslot:nth-child(4) { translate: 0 calc(var(--u) * 6.1); }

  /* The options panel, bottom right: who is to play, two lines of help, and the buttons. On my turn its edge glows. */
  .tbl .tbar { position: absolute; left: calc(var(--u) * 697); right: auto; top: auto; bottom: calc(var(--u) * 16); width: calc(var(--u) * 300); height: auto; min-height: calc(var(--u) * 186); display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; border: calc(var(--u) * 2) solid transparent; border-radius: calc(var(--u) * 16); background: rgba(0, 0, 0, .6); z-index: 10; }
  .tbl .tbar.myturn { border-color: #8dc641; box-shadow: 0 0 calc(var(--u) * 16) #ffdd00; }
  .tbl .thdr { display: flex; align-items: center; gap: calc(var(--u) * 12); min-height: calc(var(--u) * 52); padding: calc(var(--u) * 12); border-bottom: 1px solid rgba(255, 255, 255, .12); }
  .tbl .htitle { font: 700 calc(var(--u) * 18) / 1 Nunito, "Trebuchet MS", system-ui, sans-serif; color: #fff; }
  .tbl .thdr .tring { --c: #8dc641; flex: none; }
  .tbl .tletter { flex: none; display: grid; place-items: center; width: calc(var(--u) * 40); height: calc(var(--u) * 40); border-radius: 50%; background: #e8aa2c; border: 1px solid #292923; color: #292923; font: 400 calc(var(--u) * 22) / 1 "Trebuchet MS", system-ui, sans-serif; }
  .tbl .tbody { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: calc(var(--u) * 2); padding: calc(var(--u) * 12) calc(var(--u) * 12) 0; text-align: left; }
  .tbl .tlead, .tbl .tdesc { margin: 0; font: 400 calc(var(--u) * 14) / 1.3 "Trebuchet MS", system-ui, sans-serif; }
  .tbl .tlead { color: #e8aa2c; }
  .tbl .tdesc { color: #fff; }
  .tbl .tactions { position: static; display: flex; flex-wrap: wrap; justify-content: center; gap: calc(var(--u) * 8); padding: calc(var(--u) * 12); }
  .tbl .tactions:empty { display: none; }
  .tbl .tactions button { height: calc(var(--u) * 44); min-height: 0; padding: 0 calc(var(--u) * 14); border-width: calc(var(--u) * 1.5); border-radius: calc(var(--u) * 16); font: 700 calc(var(--u) * 14) / 1.2 "Trebuchet MS", system-ui, sans-serif; letter-spacing: 0; box-shadow: 0 calc(var(--u) * 3) 0 var(--ink); }
  .tbl .tactions.tight button { padding: 0 calc(var(--u) * 10); }
  .tbl .tactions button:disabled { --btn: var(--cyan); --btn-ink: #fff; opacity: .42; }
  .tbl .tactions button[data-idle] { display: inline-block; }

  /* The chat, bottom left: 300 x 220 */
  .tbl .gdock { position: absolute; left: calc(var(--u) * 49); bottom: calc(var(--u) * 16); width: calc(var(--u) * 300); height: calc(var(--u) * 220); display: flex; flex-direction: column; border-radius: calc(var(--u) * 16); background: rgba(0, 0, 0, .6); color: #fff; overflow: hidden; z-index: 10; text-align: left; --k: min(calc(var(--u) * .8), .875px); font-family: "Trebuchet MS", system-ui, sans-serif; }
  .tbl .gdh { flex: none; display: flex; align-items: center; height: calc(var(--u) * 41); padding: 0 calc(var(--u) * 12); border-bottom: 1px solid rgba(255, 255, 255, .12); }
  .tbl .gdh b { font: 700 16px / 1 "Trebuchet MS", system-ui, sans-serif; }
  .tbl .gdock .gbody { padding: calc(var(--u) * 8) calc(var(--u) * 12) 0; }
  .tbl .gdock .gform { padding: calc(var(--u) * 8); }
  .tbl .gdock .lvm { padding-right: calc(var(--u) * 28); }
  .tbl .gdock .lvm.mine { padding-left: calc(var(--u) * 28); padding-right: 0; }
}
#app .tbl section.gdock { margin: 0; padding: 0; border: 0; box-shadow: none; }
@media (min-width: 701px) { .tbl .tbar:not(:has(.thdr, .tactions button)) { display: none; } }

/* The chat's messages take what the sheet or the dock has left, so the field and the emoji list under them always fit (the lobby chat's own fixed height must not apply here) */
.gsheet .gbody, .tbl .gdock .gbody { flex: 1 1 0; height: auto; min-height: 0; overscroll-behavior: contain; }
.gsheet .gform, .tbl .gdock .gform { flex: none; }
.tbl .gdock .gemoji { margin: 0 calc(var(--u) * 8); overflow: hidden; }
.tbl .gdock .gemoji button { min-width: 0; }
/* Wide screen: my own panel always shows my avatar; my clock is in the options panel */
@media (min-width: 701px) {
  .tbl .tme .tbadge.counting .tavatar { opacity: 1; transform: none; }
  .tbl .tme .tbadge .tring { display: none; }
}

/* The message fields: the placeholder starts at the left and goes away when the field is clicked */
:is(.gchat, .gdock) input.gin, .lv input.lvcin { text-align: left; }
:is(.gchat, .gdock) input.gin:focus::placeholder, .lv input.lvcin:focus::placeholder { color: transparent; }

/* After a game: Play Again is the green main button */
.tbl .tactions button[data-act="next"] { --btn: var(--green); --btn-ink: var(--ink); }

/* ===== A voice reaction playing: the sender's panel turns white with a purple edge, their avatar gives way to a speaker, and their name and state give way to the sound's name over moving bars. Every part fades, both ways, so it never snaps. ===== */
.tbl .tbadge .tsnd { position: absolute; inset: 0; border-radius: 50%; background: #ae72b0; border: 1px solid #ae72b0; opacity: 0; transform: scale(.55) rotate(-60deg); transition: opacity .3s ease, transform .45s cubic-bezier(.34, 1.4, .64, 1); pointer-events: none; }
.tbl .tbadge.playing .tsnd { opacity: 1; transform: none; }
.tbl .tbadge.playing .tavatar { opacity: 0; transform: scale(.55) rotate(60deg); }
.tbl .tbadge.playing .tring, #app .tbl .tbadge.playing .tring { opacity: 0; transform: scale(.55) rotate(-60deg); box-shadow: none; }
.tbl .tsnd .tem { position: absolute; left: 50%; top: 50%; width: calc(var(--u) * 15); height: calc(var(--u) * 15); max-width: none; translate: -50% -50%; pointer-events: none; }
.tbl .tsnd .tem.plain { font-style: normal; font-size: calc(var(--u) * 15); line-height: 1; width: auto; height: auto; }
/* the speaker moves, like the eyes do but pulsing: it swells and sways */
.tbl .tbadge.playing .tsnd .tem { animation: tspeak .75s ease-in-out infinite; }
@keyframes tspeak { 0%, 100% { scale: 1; rotate: 0deg; } 25% { scale: 1.2; rotate: -7deg; } 55% { scale: .94; rotate: 6deg; } 80% { scale: 1.1; rotate: -3deg; } }

.tbl .thead { transition: opacity .5s ease, background-color .35s ease, box-shadow .35s ease; }
.tbl .thead.snd { background: rgba(255, 255, 255, .8); box-shadow: inset 0 0 0 calc(var(--u) * 2) #ae72b0; }
.tbl .ttext { position: relative; }
.tbl .tname, .tbl .tsub { transition: opacity .3s ease; }
.tbl .thead.snd .tname, .tbl .thead.snd .tsub { opacity: 0; }
.tbl .tsname, .tbl .twave { position: absolute; left: 0; opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.tbl .thead.snd .tsname, .tbl .thead.snd .twave { opacity: 1; transition-delay: .08s; }
.tbl .tsname { top: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 calc(var(--u) * 12) / 1.1 ui-rounded, "Trebuchet MS", system-ui, sans-serif; color: #292923; }
.tbl .twave { top: calc(var(--u) * 14); display: flex; align-items: center; gap: calc(var(--u) * 1.6); height: calc(var(--u) * 10); }
.tbl .twave i { display: block; width: calc(var(--u) * 1.6); height: 100%; border-radius: 99px; background: #ae72b0; transform: scaleY(.3); }
.tbl .twave i:nth-child(n+11) { display: none; }
.tbl .thead.snd .twave i { animation: twave calc(.7s + var(--s) * .12s) ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.11s); }
@keyframes twave { from { transform: scaleY(.22); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .tbl .tbadge.playing .tsnd .tem, .tbl .thead.snd .twave i { animation: none; } .tbl .thead.snd .twave i { transform: scaleY(calc(.3 + var(--s) * .15)); } }
@media (min-width: 701px) {
  .tbl .tsnd .tem { width: calc(var(--u) * 20); height: calc(var(--u) * 20); }
  .tbl .tsnd .tem.plain { font-size: calc(var(--u) * 20); }
  .tbl .tsname { font-size: calc(var(--u) * 16); line-height: 1.15; }
  .tbl .twave { top: calc(var(--u) * 19); gap: calc(var(--u) * 2); height: calc(var(--u) * 12); }
  .tbl .twave i { width: calc(var(--u) * 2); }
  .tbl .twave i:nth-child(n+11) { display: block; }
}
/* My own panel on a wide screen keeps its avatar during my turn; while my voice reaction plays, the avatar still gives way to the speaker */
@media (min-width: 701px) {
  .tbl .tme .tbadge.playing .tavatar, .tbl .tme .tbadge.counting.playing .tavatar { opacity: 0; transform: scale(.55) rotate(60deg); }
}

/* ===== Wide screen, the top and the reactions ===== */
.tlogo { display: none; }
.gdock .gsounds { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 99px; background: rgba(255, 255, 255, .3); color: #fff; transition: background-color .15s, transform .15s, color .15s; }
.gdock .gsounds:hover { background: rgba(255, 255, 255, .5); }
.gdock .gsounds:active { transform: scale(.92); }
.gdock .gsounds.on, .gdock .gsounds.on:hover { background: #fff; border-color: #fff; color: #292923; }
.gsounds svg { width: 16px; height: 16px; }
@media (min-width: 701px) {
  /* On the left of the top, the logo instead of the two buttons (as tall as the menu button); the sounds button lives in the chat now */
  .tbl .ttools { display: none; }
  .tbl .tlogo { display: block; position: fixed; left: calc(16px + env(safe-area-inset-left, 0px)); top: calc(16px + env(safe-area-inset-top, 0px)); height: 40px; width: auto; z-index: 60; pointer-events: none; user-select: none; }
  /* The reactions open upwards from the chat's first button: a panel over the chat, with its point down at the button */
  .greact { --u: min(calc(100vw / 1046), calc((var(--app-h, 100dvh) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) / 712), 2.5px); }
  .greact .gpanel { top: auto; bottom: calc(var(--u) * 24 + 48px + env(safe-area-inset-bottom, 0px)); left: calc((100vw - var(--u) * 1046) / 2 + var(--u) * 25); width: 312px; border-top-left-radius: 16px; }
  .greact .gcaret { top: auto; bottom: -12px; left: calc(var(--u) * 32 + 3.5px); clip-path: polygon(0 0, 100% 0, 50% 100%); }
}
/* The menu button's cross: a bit larger and heavier. The two outer lines are moved to the middle first and then turned about it, so they cross exactly at the centre. */
.tburger svg { width: 18px; height: 18px; }

/* ===== Smooth openings and closings: the reactions panel rises in and sinks out (the emoji list is further down) ===== */
.greact { --dy: -8px; }
.greact .gpanel { transform-origin: 14% 0; animation: panelin .2s cubic-bezier(.2, .8, .2, 1) both; }
.greact.out { pointer-events: none; }
.greact.out .gpanel { animation: panelout .16s ease both; }
.greact .gscrim { animation: scrimin .2s ease both; }
.greact.out .gscrim { animation: scrimout .16s ease both; }
@keyframes panelin { from { opacity: 0; transform: translateY(var(--dy)) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes panelout { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(var(--dy)) scale(.96); } }
@keyframes scrimin { from { opacity: 0; } to { opacity: 1; } }
@keyframes scrimout { from { opacity: 1; } to { opacity: 0; } }
@media (min-width: 701px) { .greact { --dy: 8px; } .greact .gpanel { transform-origin: 14% 100%; } }
@media (prefers-reduced-motion: reduce) { .greact .gpanel, .greact.out .gpanel, .greact .gscrim, .greact.out .gscrim { animation: none; } .greact.out { display: none; } }

/* The options panel: the text always starts at the top of its box, whatever else is in it */
@media (min-width: 701px) {
  .tbl .tbody { justify-content: flex-start; padding-top: calc(var(--u) * 12); }
}
/* Take & discard is the blue button (as in the design) */
.tbl .tactions button[data-act="takeDiscard"] { --btn: var(--cyan); --btn-ink: #fff; }

/* The button that plays the action card I have selected is always green */
.tbl .tactions button:is([data-act="playSeen"], [data-act="modeSwap"], [data-act="playPlotTwist"], [data-act="modeThrowback"], [data-act="playGhosted"]) { --btn: var(--green); --btn-ink: var(--ink); }

/* ===== Throwing: the four things (a balloon, a cupcake, a tomato, an egg) ===== */
/* On a phone the sounds button and the three things sit in the middle of the top, 34 x 34 like the others */
.tgroup { position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 60; display: flex; gap: 4px; }
.tbl .tbtn.tthrow { font-size: 21.25px; line-height: 1; font-family: ui-rounded, "Apple Color Emoji", "Segoe UI Emoji", sans-serif; }
.tbl .tbtn.tthrow.on, .tbl .tbtn.tthrow.on:hover { background: rgba(232, 170, 44, .2); box-shadow: inset 0 0 0 1.4px #e8aa2c; color: inherit; }
@media (max-width: 700px) { .greact .gcaret { left: calc(50vw - 77.5px); } }
/* On a wide screen they are in the chat's header instead */
@media (min-width: 701px) {
  .tbl .tgroup { display: none; }
  .tbl .gdh { height: calc(var(--u) * 41); padding: 0 12px; justify-content: space-between; }
  .gthrow { display: flex; gap: 4px; }
  .gdock .gthrowbtn { all: unset; box-sizing: border-box; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 99px; background: rgba(0, 0, 0, .5); font-size: 15px; line-height: 1; cursor: pointer; transition: background-color .15s, box-shadow .15s, transform .15s; -webkit-tap-highlight-color: transparent; }
  .gdock .gthrowbtn:hover { background: rgba(232, 170, 44, .4); transform: none; box-shadow: none; filter: none; }
  .gdock .gthrowbtn:active { transform: scale(.92); }
  .gdock .gthrowbtn.on, .gdock .gthrowbtn.on:hover { background: rgba(232, 170, 44, .2); box-shadow: inset 0 0 0 1px #e8aa2c; }
  .gdock .gthrowbtn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
  /* the chat's footer: 4 between the buttons, a lighter field, the emoji button shows an emoji */
  .tbl .gdock .gform { gap: 4px; }
  .tbl .gdock input.gin { background: rgba(255, 255, 255, .3); }
  .tbl .gdock input.gin:focus { background: rgba(255, 255, 255, .4); }
  .tbl .gdock .gem { font-size: 20px; line-height: 1; }
}

/* The table chat's footer has no borders (as in the design): lighter fills only */
.gsheet .gsmile, .gsheet .gsend, .gsheet input.gin, .gdock .gsounds, .gdock .gsmile, .gdock .gsend, .gdock input.gin { border: 0; }
.gdock .gsounds.on, .gdock .gsounds.on:hover { border: 0; }
.tbl .tbtn:disabled, .gdock .gsounds:disabled { opacity: .45; cursor: default; }

/* ===== Throwing ===== */
/* the picked thing: while aiming, the other players' panels glow and the cursor is a scope (a touch screen has no cursor: the glow says it) */
body.aiming .tbl, body.aiming .tbl .tseat, body.aiming .tbl .tseat .thead, body.aiming .tbl .tseat * { cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48' fill='none' stroke-linecap='round'><g stroke='%23000' stroke-opacity='.55' stroke-width='3'><circle cx='24' cy='24' r='14'/><path d='M24 2v16M24 30v16M2 24h16M30 24h16'/></g><g stroke='%23FFF8EC' stroke-width='1.4'><circle cx='24' cy='24' r='14'/><path d='M24 2v16M24 30v16M2 24h16M30 24h16'/></g><circle cx='24' cy='24' r='1.2' fill='%23F2B544' stroke='none'/></svg>") 24 24, crosshair; }
body.aiming .tbl .gdock, body.aiming .tbl .gdock *, body.aiming .tbl .ttools *, body.aiming .tbl .tgroup *, body.aiming .tbl .tmenu *, body.aiming .tbl .gtip *, body.aiming .tbl .taimbtn * { cursor: pointer; }
body.aiming .tbl .gdock input { cursor: text; }
body.aiming .tbl .tseat .thead { box-shadow: 0 0 0 calc(var(--u) * 3) #e8aa2c, 0 0 calc(var(--u) * 18) rgba(242, 181, 68, .55); animation: aim 1.1s ease-in-out infinite; }
@keyframes aim { 50% { box-shadow: 0 0 0 calc(var(--u) * 5) #e8aa2c, 0 0 calc(var(--u) * 28) rgba(242, 181, 68, .8); } }
@media (prefers-reduced-motion: reduce) { body.aiming .tbl .tseat .thead { animation: none; } }
.tbl .thead.hit .tsub { color: #ffb3a8; }
/* throwing waits (20 seconds after a throw, while ghosted): the buttons are faded */
.tbl .tthrow:disabled, .gdock .gthrowbtn:disabled { opacity: .4; cursor: default; }
/* a button that is off does not react to the pointer: no darker disc, no shadow */
.tbl .tbtn:disabled, .tbl .tbtn:disabled:hover, .tbl .tbtn:disabled:active { background: rgba(0, 0, 0, .5); box-shadow: none; filter: none; transform: none; }
.gdock .gthrowbtn:disabled:hover { background: rgba(0, 0, 0, .5); }

/* the phone's bottom bar while aiming: a gold line and a green Throw at random button (replacing the usual line and buttons) */
.tbl .tbar > .taimline, .tbl .tbar > .taimbtn { display: none; }
@media (max-width: 700px) {
  .tbl .tbar.aiming > .tline:not(.taimline), .tbl .tbar.aiming > .tactions:not(.taimbtn) { display: none; }
  .tbl .tbar.aiming > .taimline { display: block; }
  .tbl .tbar.aiming > .taimbtn { display: flex; }
  .tbl .tactions button[data-act="throwRandom"] { --btn: var(--green); --btn-ink: var(--ink); }
}

/* the desktop line over the chat: always in the same place (its right edge on the chat's right edge, 4 above it), whichever thing is picked */
@media (min-width: 701px) {
  .tbl .gtip { position: absolute; z-index: 12; right: calc(var(--u) * 697); bottom: calc(var(--u) * 236 + 4px); width: max-content; height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 8px 8px 16px; border-radius: 99px; background: #fff; color: #292923; font: 500 12px/16px Nunito, "Trebuchet MS", system-ui, sans-serif; text-align: left; box-shadow: 0 4px 14px rgba(0, 0, 0, .22); animation: panelin .2s cubic-bezier(.2, .8, .2, 1) both; }
  .tbl .gtip button { all: unset; box-sizing: border-box; flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 99px; background: #747670; color: #fff; cursor: pointer; }
  .tbl .gtip button:hover { background: #666863; }
  .tbl .gtip button:focus-visible { outline: 2px solid #292923; outline-offset: 2px; }
  .tbl .gtip svg { width: 9px; height: 9px; }
}

/* ===== A card just swapped, for everyone, for 10 seconds: a light cyan tint (20%), or gold for a swap made while an earlier swap's highlight is still on, and two glints that ripple clockwise round the card, drawn on
   a canvas by swapfx.ts (it reaches past the card, so the wisps outside the edge are not cut off). --sd is how long ago it started, as a negative
   delay, so a redraw picks the fade up where it was. It fades in over 250ms and out over the last 600ms. ===== */
.tbl .card.slot { overflow: visible; }
.tbl .card.slot .swapfx { position: absolute; inset: 0; pointer-events: none; z-index: 3; border-radius: var(--r); opacity: 0; animation: swapin 10s linear var(--sd, 0ms) forwards; }
.tbl .card.slot .swapfx .sw { position: absolute; inset: 0; display: block; border-radius: inherit; background: linear-gradient(180deg, rgb(110, 226, 250) 0%, rgb(45, 200, 238) 100%); opacity: .2; }
.tbl .card.slot .swapfx.gold .sw { background: linear-gradient(180deg, rgb(255, 222, 120) 0%, rgb(240, 175, 40) 100%); }
.tbl .card.slot .swapfx canvas.sp { position: absolute; display: block; } /* (its size and place come from swapfx.ts) */
@keyframes swapin { 0% { opacity: 0; } 2.5% { opacity: 1; } 94% { opacity: 1; } 100% { opacity: 0; } }
/* The options panel's header is as tall with the name alone (another player's turn) as with my clock beside "Your turn" */
@media (min-width: 701px) { .tbl .thdr { min-height: calc(var(--u) * 64); } }

/* ===== A card landing in my hand from a pile: glow and particles, inside the card's slot so the card to its right stays on top (landfx.ts) ===== */
.lfx { position: absolute; inset: 0; pointer-events: none; }
.lfx i { position: absolute; display: block; opacity: 0; will-change: transform, opacity; backface-visibility: hidden; }
/* The card keeps its shape and its white frame: the colour wash covers only the art inside the frame (the card art's own corners, from the SVGs),
   and the glows are drawn outside the card's edge only. */
.lfx .fh { inset: 0; border-radius: calc(var(--cw) * .2105); box-shadow: 0 0 calc(var(--cw) * .28) calc(var(--cw) * .04) var(--fh2); }
.lfx .fw { inset: calc(var(--cw) * .0526); border-radius: calc(var(--cw) * .1755); background: linear-gradient(180deg, var(--fw1) 0%, var(--fw2) 52%, var(--fw3) 100%); }
/* An action card's art is the smaller picture above its name */
.lfx.num i { will-change: opacity; } /* (the number pulse only fades) */
.lfx.num .fw { inset: 0; border-radius: calc(var(--cw) * .2105); }
.lfx.act .fw { top: calc(var(--cw) * .0704); left: calc(var(--cw) * .0703); right: calc(var(--cw) * .0703); bottom: calc(var(--ch) - var(--cw) * 1.1421); border-radius: calc(var(--cw) * .1404); }
.lfx .fm { inset: 0; border-radius: calc(var(--cw) * .2105); box-shadow: 0 0 calc(var(--cw) * .1) calc(var(--cw) * .015) var(--fr1), 0 0 calc(var(--cw) * .3) calc(var(--cw) * .06) var(--fr2); }

/* ===== A selected card in my hand: it lifts (hand pose, in fx.ts), a steady glow holds around it and two rings pulse slowly outward.
   The colours are the number 4 card's palette, for every card. ===== */
:is(.thand, .tdiscard, .tcards) .selfx { display: none; position: absolute; inset: 0; pointer-events: none; --frc: rgba(255, 248, 222, .95); --frg: rgba(255, 205, 90, .75); --fri: rgba(255, 205, 90, .4); --frb: rgba(255, 214, 120, .95); --fr2: rgba(255, 90, 20, .4); }
:is(.thand, .tdiscard) .card.selected .selfx, .tcards .card.slot.selected > .selfx { display: block; }
:is(.thand, .tdiscard, .tcards) .selfx i { position: absolute; inset: 0; display: block; border-radius: var(--r); opacity: 0; will-change: opacity, transform; backface-visibility: hidden; }
:is(.thand, .tdiscard, .tcards) .selfx .sbase { border: max(2px, calc(var(--w) * .018)) solid var(--frc); box-shadow: 0 0 calc(var(--w) * .1) var(--frg), 0 0 calc(var(--w) * .28) calc(var(--w) * .03) var(--fr2), inset 0 0 calc(var(--w) * .06) var(--fri); animation: selbase 2.6s ease-in-out infinite; }
:is(.thand, .tdiscard, .tcards) .selfx .spulse { border: max(1.5px, calc(var(--w) * .014)) solid var(--frb); animation: selgrow 2.6s cubic-bezier(.2, .55, .35, 1) infinite, selfade 2.6s linear infinite; }
:is(.thand, .tdiscard, .tcards) .selfx .spulse + .spulse { animation-delay: 1.3s; }
@keyframes selbase { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
/* A ring grows with one easing over the whole cycle (an easing on keyframes would start over at each of them, and the ring would seem to stop
   part of the way), 14% of the card's width on every side at the widest, while its opacity rises quickly and then fades away on its own clock. */
@keyframes selgrow { from { transform: scale(1, 1); } to { transform: scale(1.28, 1.184); } }
@keyframes selfade { 0% { opacity: 0; } 10% { opacity: .85; } 35% { opacity: .5; } 65% { opacity: .15; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { :is(.thand, .tdiscard, .tcards) .selfx .sbase { animation: none; opacity: .85; } :is(.thand, .tdiscard, .tcards) .selfx .spulse { display: none; } }
/* The new look replaces the outline, and the Throwback glow it came with */
.tbl .thand .card.selected, .tbl .thand button.card.selected:hover:not(:disabled) { outline: none; box-shadow: var(--card-shadow); }
.tbl .thand .card.throwglow { filter: none; }

/* ===== The same selected look on a picked card of a set (Swap) and, for Plot Twist, as one frame around the whole set instead of on each card.
   They use the hand's rules above, exactly: a ring grows by a transform, which the browser does without redrawing anything. A ring has to grow by
   the same gap on every side, so how much it scales on each axis depends on the shape it goes around. Those shapes only come in a few kinds (in the
   table's own units): a card is 1 : 1.5 upright, or 1.5 : 1 on its side on the phone layout's left and right players; a set is a wide row (every
   set, except those two players' sets on the phone layout), or a tall stack. ===== */
@keyframes selgrow-side { from { transform: scale(1, 1); } to { transform: scale(1.184, 1.28); } }
@keyframes selgrow-set { from { transform: scale(1, 1); } to { transform: scale(1.062, 1.168); } }
@keyframes selgrow-stack { from { transform: scale(1, 1); } to { transform: scale(1.158, 1.061); } }
.tbl .tcards > .setfx .spulse { animation-name: selgrow-set, selfade; }
@media (max-width: 700px) {
  .tbl :is(.tseat.left, .tseat.right) .tcards .card .selfx .spulse { animation-name: selgrow-side, selfade; }
  .tbl :is(.tseat.left, .tseat.right) .tcards > .setfx .spulse { animation-name: selgrow-stack, selfade; }
}
/* The frame of a whole set stands a little off the cards */
.tbl .tcards .setfx { --w: calc(var(--u) * 48); --r: calc(var(--cr) + var(--u) * 8); inset: calc(var(--u) * -8); }
/* (the gap between the frame and the cards is the gap between the cards: 7 on the wide table, 5 on the phone) */
@media (max-width: 700px) { .tbl .tcards .setfx { inset: calc(var(--u) * -6); --r: calc(var(--cr) + var(--u) * 6); } }
.tbl .tcards:has(> .card.slot.selected):not(:has(> .card.slot:not(.selected))) > .setfx { display: block; }
/* Plot Twist: every set that can be chosen wears the same frame as a chosen one, around the whole set: faint, full on hover */
.tbl .tcards:has(.plotpick) > .setfx { display: block; opacity: .45; }
@media (hover: hover) { .tbl .tcards:has(.plotpick):hover > .setfx { opacity: 1; } }
.tbl .tcards:has(> .card.slot.selected):not(:has(> .card.slot:not(.selected))) > .card.slot > .selfx { display: none; }
/* The new look replaces the outline */
.tbl .card.slot.selected, .tbl .tdiscard .card.selected { outline: none; }
.tbl .tdiscard .card.selected { box-shadow: var(--card-shadow); }
/* The frame of a whole set lifts with its cards (the same lift as one card, see above), so it stays centred on them */
.tbl .tcards:has(> .card.slot.selected):not(:has(> .card.slot:not(.selected))) > .setfx { translate: 0 calc(var(--u) * -5); transform: translateY(-2px); }
@media (max-width: 700px) {
  .tbl .tseat.left .tcards:has(> .card.slot.selected):not(:has(> .card.slot:not(.selected))) > .setfx { translate: calc(var(--u) * 5) 0; }
  .tbl .tseat.right .tcards:has(> .card.slot.selected):not(:has(> .card.slot:not(.selected))) > .setfx { translate: calc(var(--u) * -5) 0; }
}

/* The top card of the discard pile, when it is picked, moves like a picked card in the hand (fx.ts, handPose): it comes up with a small overshoot,
   settles 11 units of a 72-unit-wide card up and 4% bigger, and goes back down with a soft spring when it is put down. */
/* The pile's tilt (transform) never animates: the card elements are reused when a card is added, and a transition there would turn the whole pile. The hover lift uses translate and rotate instead, which do. */
.tbl .tdiscard .card { transition: translate .44s cubic-bezier(.34, 1.56, .64, 1), scale .44s cubic-bezier(.34, 1.56, .64, 1), rotate .2s; }
/* The top card lifts exactly like the top card of the draw pile (style.css, .card.deck:hover .decktop): 12% of its height, a little bigger, a little turned */
@media (hover: hover) {
  .tbl .tdiscard .fan > button.card:hover:not(:disabled) { transform: rotate(var(--tilt, 0deg)); translate: 0 -12%; scale: 1.05; rotate: -2deg; transition: translate .45s var(--ease), scale .45s var(--ease), rotate .45s var(--ease); }
  /* A picked top card has no hover look: it stays exactly as it is */
  .tbl .tdiscard .fan > button.card.selected:hover:not(:disabled) { transform: translateY(-2px); translate: 0 calc(var(--w) * -.1528); scale: 1.04; rotate: 0deg; transition: none; }
}
.tbl .tdiscard .card.selected { translate: 0 calc(var(--w) * -.1528); scale: 1.04; animation: discardsel .44s forwards; }
@keyframes discardsel {
  0% { translate: 0 0; scale: 1; animation-timing-function: cubic-bezier(.2, .8, .3, 1); }
  35% { translate: 0 calc(var(--w) * -.0556); scale: 1; animation-timing-function: cubic-bezier(.34, 1.56, .64, 1); }
  100% { translate: 0 calc(var(--w) * -.1528); scale: 1.04; }
}
@media (prefers-reduced-motion: reduce) { .tbl .tdiscard .card, .tbl .tdiscard .card.selected { transition: none; animation: none; } }

/* ===== The options panel while the game is paused: only its header stays ("Game paused" and the clock). The text and the buttons shrink and fade away, and come back the same way. ===== */
@media (min-width: 701px) {
  .tbl .tbar { transition: min-height .32s cubic-bezier(.2, .8, .2, 1); }
  .tbl .tbar :is(.tbody, .tactions) { max-height: calc(var(--u) * 160); transition: max-height .32s cubic-bezier(.2, .8, .2, 1), opacity .22s ease, padding .32s cubic-bezier(.2, .8, .2, 1); }
  .tbl .tbar .thdr { transition: border-color .32s ease; }
  .tbl .tbar.tpaused:not(.tresume) { min-height: 0; }
  .tbl .tbar.tpaused:not(.tresume) :is(.tbody, .tactions) { overflow: hidden; max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; pointer-events: none; }
  .tbl .tbar.tpaused:not(.tresume) .thdr { border-bottom-color: transparent; }
}
/* The phone's bottom bar has no header: it goes altogether (it comes back for picking who to throw at) */
@media (max-width: 700px) {
  .tbl .tbar { transition: opacity .3s ease, transform .32s cubic-bezier(.2, .8, .2, 1); }
  .tbl .tbar.tpaused:not(.aiming):not(.tresume) { opacity: 0; transform: translateY(calc(var(--u) * 12)); pointer-events: none; }
}

/* ===== The emoji list: always on the page, it opens and shuts by animating its height (from nothing to its own height, so no guessing), the messages above it giving way ===== */
.gtray { flex: none; display: grid; grid-template-rows: 0fr; transition: grid-template-rows .26s cubic-bezier(.2, .8, .2, 1); }
.gtray.open { grid-template-rows: 1fr; }
.gtrayin { min-height: 0; overflow: hidden; }
.gtray .gemoji { opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .26s cubic-bezier(.2, .8, .2, 1); }
.gtray.open .gemoji { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .gtray, .gtray .gemoji { transition: none; } }

/* The page's dotted background is never seen through a panel: everything translucent that sits on it blurs what is behind it */
.tbl .tbar, .tbl .gdock, .gsheet, .tmenulist, .tbl .tbtn, .tbl .tburger { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* The cards flying out of or into the discard pile are many on one spot: each with its own shadow they would add up to a dark patch under the pile, so they have none */
.tbl .card.flying.pilefly, .card.flying.pilefly { box-shadow: none; }

/* Paused: the options panel has one button, Resume game, green; it stays above the veil and is the only thing there that can be pressed */
.tbl .tactions button[data-act="togglePause"] { --btn: var(--green); --btn-ink: var(--ink); }
body.paused .tbl .tbar.tresume { z-index: 60; }

/* The pause icon sits exactly in the middle of a clock */
.tring b:has(.pauseicon) { display: grid; place-items: center; line-height: 0; }
.tring b .pauseicon { display: block; vertical-align: baseline; }
/* The keyboard is up: the chat sheet takes all the height there is */
.gsheet { transition: height .25s ease; }
html.kb .gsheet { height: 100%; }

/* The dashed frame of cards that can be dragged fades in */
/* Cards that can be dragged (Seen on my own set): a thin dashed blue line round each card, exactly concentric with the card's rounded corners (the line is 3 off the card, so its corners are the card's radius plus 3) */
.tbl .tcards .card.slot.draggable { outline: none; }
.tbl .tcards .card.slot.draggable::before { content: ""; position: absolute; inset: calc(var(--u) * -3); border: 1px dashed var(--card-gold-canceled, #E8AA2C); border-radius: calc(var(--r) + var(--u) * 3); pointer-events: none; animation: dragin .35s ease both; }
@keyframes dragin { from { opacity: 0; } }
@media (min-width: 701px) { .tbl .tbar.tresume .tbody { display: none; } }
@media (min-width: 701px) { .tbl .tbar.tpaused.tresume { min-height: 0; } }
@media (min-width: 701px) { .tbl .tbar.tresume .tactions:not(.taimbtn) { padding: calc(var(--u) * 20) calc(var(--u) * 12); } }

/* ===== DEV tools (a local server only, see game/online/devtools.ts): a small button, and a panel in the style of a browser's developer tools ===== */
#devdock { --dt-bg: #1e1e1e; --dt-bar: #252526; --dt-line: #3c3c3c; --dt-text: #cccccc; --dt-dim: #9a9a9a; --dt-accent: #3794ff; position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); top: 25px; font: 12px/1.4 ui-monospace, Menlo, Consolas, monospace; color: var(--dt-text); }
#devdock .dt-open { all: unset; box-sizing: border-box; cursor: pointer; padding: 3px 9px; border-radius: 4px; background: rgba(30, 30, 30, .85); color: var(--dt-dim); font: inherit; text-transform: uppercase; }
#devdock .dt-open:hover { color: #fff; }
#devdock .dt-panel { width: min(460px, calc(100vw - 16px)); max-height: min(70vh, 560px); display: flex; flex-direction: column; background: var(--dt-bg); border: 1px solid var(--dt-line); border-radius: 6px; box-shadow: 0 8px 28px rgba(0, 0, 0, .5); overflow: hidden; }
#devdock .dt-bar { flex: none; display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 6px 0 12px; background: var(--dt-bar); border-bottom: 1px solid var(--dt-line); }
#devdock .dt-name { color: var(--dt-dim); font-size: 11px; text-transform: uppercase; }
#devdock .dt-tabs { display: flex; align-self: stretch; flex: 1; overflow-x: auto; scrollbar-width: none; }
#devdock button { all: unset; box-sizing: border-box; cursor: pointer; font: inherit; color: var(--dt-text); }
#devdock .dt-tab { display: flex; align-items: center; padding: 0 12px; color: var(--dt-dim); border-bottom: 2px solid transparent; }
#devdock .dt-tab:hover { color: var(--dt-text); background: #2a2d2e; }
#devdock .dt-tab.on { color: #fff; border-bottom-color: var(--dt-accent); }
#devdock .dt-toggle { padding: 2px 8px; border-radius: 3px; color: var(--dt-dim); font-size: 16px; }
#devdock .dt-toggle:hover { background: #3a3d3e; color: #fff; }
#devdock .dt-body { overflow-y: auto; padding: 12px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 14px 24px; }
#devdock .dt-group { min-width: 0; }
#devdock .dt-wide { flex: 1 1 100%; }
#devdock .dt-title { margin-bottom: 6px; color: var(--dt-dim); font-size: 11px; text-transform: uppercase; }
#devdock .dt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#devdock button.dt { padding: 4px 10px; border: 1px solid var(--dt-line); border-radius: 3px; background: #2d2d2d; white-space: nowrap; }
#devdock button.dt:hover { background: #37373d; border-color: #555; }
#devdock button.dt:active { background: #0e639c; border-color: #0e639c; color: #fff; }
#devdock button.dt.on { background: #0e639c; border-color: #1177bb; color: #fff; }
#devdock select { max-width: 100%; padding: 4px 6px; border: 1px solid var(--dt-line); border-radius: 3px; background: #3c3c3c; color: var(--dt-text); font: inherit; }
#devdock .dt-matrix { display: grid; grid-template-columns: auto auto auto; gap: 6px 10px; align-items: center; }
#devdock .dt-colhead { color: var(--dt-dim); font-size: 11px; }
#devdock .dt-rowhead { color: var(--dt-text); }

/* The "who did what" line above the piles is not shown at all */
.tbl .tstatus { display: none; }

/* ===== Seen: the sets to choose from, and the set that was chosen =====
   Choosing: the screen is dark except the sets that can be picked (see game/online/seenscan.ts), each in a lit window with no frame; pointing at one shows its frame
   (a thin line and bold corners). Chosen: the frame stays and its corners snap inward until the look is over. The cards are never tinted.
   Every number is a token of the "seenScan" group (tokens.ts); the values in :root are the designed ones. */
:root { --ss-bk: 4px; --ss-bs: .67; --ss-snap: 10px; --ss-fade: 450ms; --ss-lh: 4px; --ss-glow: 1.05; --ss-wa: .5; }
/* The frame: a thin line all around the set and bold corners. It is not there while the sets wait (only the lit windows are); pointing at a set shows it,
   and the chosen set keeps it, its corners snapping in. */
.tbl .tcards > .seenfx { --w: var(--ss-bk); --t: max(1px, calc(var(--ss-bk) * .25)); --R: calc(var(--cr) + var(--u) * 8); --S: calc(var(--u) * 33 * var(--ss-bs)); --line: rgba(255, 255, 255, .95); --sc: #fff; display: none; position: absolute; inset: calc(var(--u) * -8); pointer-events: none; border-radius: var(--R); opacity: 0; transition: opacity .25s ease; }
.tbl .tcards:has(.seenpick) > .seenfx, .tbl .tcards.seensel > .seenfx { display: block; }
.tbl .seenfx .sdots { position: absolute; inset: 0; border-radius: inherit; border: var(--t) solid var(--line); }
.tbl .seenfx .scor { position: absolute; box-sizing: border-box; width: var(--S); height: var(--S); --o: calc((var(--t) - var(--w)) / 2); --rc: calc(var(--R) + (var(--w) - var(--t)) / 2); }
.tbl .seenfx .scor::before, .tbl .seenfx .scor::after { content: ""; position: absolute; width: var(--w); height: var(--w); border-radius: 50%; background: var(--sc); }
.tbl .seenfx .scor.tl { left: var(--o); top: var(--o); border-top: var(--w) solid var(--sc); border-left: var(--w) solid var(--sc); border-top-left-radius: var(--rc); }
.tbl .seenfx .scor.tl::before { left: calc(var(--S) - var(--w) * 1.5); top: calc(var(--w) * -1); }
.tbl .seenfx .scor.tl::after { left: calc(var(--w) * -1); top: calc(var(--S) - var(--w) * 1.5); }
.tbl .seenfx .scor.tr { right: var(--o); top: var(--o); border-top: var(--w) solid var(--sc); border-right: var(--w) solid var(--sc); border-top-right-radius: var(--rc); }
.tbl .seenfx .scor.tr::before { left: calc(var(--w) * -.5); top: calc(var(--w) * -1); }
.tbl .seenfx .scor.tr::after { left: calc(var(--S) - var(--w)); top: calc(var(--S) - var(--w) * 1.5); }
.tbl .seenfx .scor.bl { left: var(--o); bottom: var(--o); border-bottom: var(--w) solid var(--sc); border-left: var(--w) solid var(--sc); border-bottom-left-radius: var(--rc); }
.tbl .seenfx .scor.bl::before { left: calc(var(--S) - var(--w) * 1.5); top: calc(var(--S) - var(--w)); }
.tbl .seenfx .scor.bl::after { left: calc(var(--w) * -1); top: calc(var(--w) * -.5); }
.tbl .seenfx .scor.br { right: var(--o); bottom: var(--o); border-bottom: var(--w) solid var(--sc); border-right: var(--w) solid var(--sc); border-bottom-right-radius: var(--rc); }
.tbl .seenfx .scor.br::before { left: calc(var(--w) * -.5); top: calc(var(--S) - var(--w)); }
.tbl .seenfx .scor.br::after { left: calc(var(--S) - var(--w)); top: calc(var(--w) * -.5); }
@media (hover: hover) { .tbl .tcards:has(.seenpick):not(.seensel):hover > .seenfx { opacity: 1; } }
.tbl .tcards.seensel > .seenfx { opacity: 1; }
/* Chosen: the corners snap in from outside and stay */
.tbl .tcards.seensel > .seenfx .scor.tl { animation: seensnap-tl .4s cubic-bezier(.3, 1.4, .5, 1); }
.tbl .tcards.seensel > .seenfx .scor.tr { animation: seensnap-tr .4s cubic-bezier(.3, 1.4, .5, 1); }
.tbl .tcards.seensel > .seenfx .scor.bl { animation: seensnap-bl .4s cubic-bezier(.3, 1.4, .5, 1); }
.tbl .tcards.seensel > .seenfx .scor.br { animation: seensnap-br .4s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes seensnap-tl { from { transform: translate(calc(var(--ss-snap) * -1), calc(var(--ss-snap) * -1)); } to { transform: none; } }
@keyframes seensnap-tr { from { transform: translate(var(--ss-snap), calc(var(--ss-snap) * -1)); } to { transform: none; } }
@keyframes seensnap-bl { from { transform: translate(calc(var(--ss-snap) * -1), var(--ss-snap)); } to { transform: none; } }
@keyframes seensnap-br { from { transform: translate(var(--ss-snap), var(--ss-snap)); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .tbl .seenfx .scor { animation: none !important; } }

/* The dark over the whole screen, with a lit window over each set that can be picked (the windows are cut out of it by an SVG mask) */
.ssroot { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.ssdim { position: absolute; inset: 0; opacity: 0; transition: opacity var(--ss-fade) ease; }
.ssdim.on { opacity: 1; }
.ssdim svg { display: block; width: 100%; height: 100%; }
.sshole { transition: opacity .18s ease; }
/* The light bar that sweeps down the chosen set, the wash behind it and the flash at the end */
.sscan { position: absolute; overflow: hidden; opacity: 0; pointer-events: none; }
.sscan .wash { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 246, 223, 0), rgba(255, 246, 223, var(--ss-wa))); transform-origin: 50% 100%; }
.sscan .line { position: absolute; left: 0; right: 0; top: 0; height: var(--ss-lh); margin-top: -1px; background: #fff; box-shadow: 0 0 calc(14px * var(--ss-glow)) calc(5px * var(--ss-glow)) rgba(255, 255, 255, .75), 0 0 calc(40px * var(--ss-glow)) calc(12px * var(--ss-glow)) rgba(255, 236, 190, .4); }
.sscan .flash { position: absolute; inset: 0; border-radius: inherit; background: #fff; opacity: 0; }
@media (prefers-reduced-motion: reduce) { .ssdim, .sshole { transition: none; } }

/* ===== A hidden set that is selected (Plot Twist): a jagged yellow line that crackles like electricity (the filter is in the page, see fx.ts) ===== */
.tbl .tcards > .setfx .spulse { display: none; }
.tbl .tcards > .setfx .sbase { border: max(2px, calc(var(--u) * 2.2)) solid #ffd23f; border-radius: var(--r); opacity: 1; animation: none; box-shadow: 0 0 calc(var(--u) * 9) rgba(255, 205, 60, .6), inset 0 0 calc(var(--u) * 8) rgba(255, 205, 60, .22); filter: url(#fxElectric) drop-shadow(0 0 calc(var(--u) * 4) rgba(255, 215, 80, .7)); will-change: auto; backface-visibility: visible; }
/* (the frames of Swap and Plot Twist never animate, so they stay off a layer of their own: a layer of its own that also carries the crackle filter could be dropped by Chrome and stay blank until the page was reloaded, while the line between the picks kept drawing) */

/* The Open button waits while the cards of the open pile fly back */
body.pileclosing .tbl .tseepile { visibility: hidden; }


/* Swap: each picked card has the same crackling yellow frame as a picked set (Plot Twist), a little off the card */
.tbl .tcards .card.slot > .selfx { inset: calc(var(--u) * -5); }
.tbl .tcards .card.slot > .selfx .spulse { display: none; }
.tbl .tcards .card.slot > .selfx .sbase { border: max(2px, calc(var(--u) * 2.2)) solid #ffd23f; border-radius: calc(var(--r) + var(--u) * 5); opacity: 1; animation: none; box-shadow: 0 0 calc(var(--u) * 8) rgba(255, 205, 60, .6), inset 0 0 calc(var(--u) * 6) rgba(255, 205, 60, .22); filter: url(#fxElectric) drop-shadow(0 0 calc(var(--u) * 4) rgba(255, 215, 80, .7)); will-change: auto; backface-visibility: visible; }


/* The line between what a Swap or Plot Twist is on: over the cards and piles, under the players' panels (z-index 20) */
.tbl > .tlink { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 15; filter: url(#fxElectric) drop-shadow(0 0 calc(var(--u) * 4) rgba(255, 215, 80, .7)); }
.tbl .tlinkp { fill: none; stroke: url(#tlgrad); stroke-width: max(2px, calc(var(--u) * 2.2)); stroke-linecap: round; }
/* On a touch screen the live filter is too heavy (its noise is worked out again on the processor several times a second). The crackle there is a few jagged drawings of the frames and
   the line, each drawn once on a layer of its own, shown in turn by opacity alone, which needs no drawing at all (see paintCrackle). The frames here only keep their soft glow. */
@media not all and (hover: hover) and (pointer: fine) {
  .tbl .tcards > .setfx .sbase, .tbl .tcards .card.slot > .selfx .sbase { filter: none; border-color: transparent; }
}
.tbl > .tcrk { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 15; }
.tcrk svg { position: absolute; overflow: visible; opacity: 0; will-change: opacity; animation: tcrk .6s step-end infinite; }
.tcrk svg:nth-child(2) { animation-delay: -.45s; }
.tcrk svg:nth-child(3) { animation-delay: -.3s; }
.tcrk svg:nth-child(4) { animation-delay: -.15s; }
.tcrk path { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: max(2px, calc(var(--u) * 2.2)); }
.tcrk path.glow { stroke-width: max(6px, calc(var(--u) * 7)); opacity: .28; }
@keyframes tcrk { 0% { opacity: 1; } 25%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tcrk svg { animation: none; } .tcrk svg:first-child { opacity: 1; } }

/* On a wide screen every player's panel is the same: the side players' panels had the phone layout's smaller padding and lift */
@media (min-width: 701px) {
  .tbl .tseat.left .thead, .tbl .tseat.right .thead { padding: calc(var(--u) * 8); gap: calc(var(--u) * 10); margin-top: calc(var(--u) * -17); }
}

/* ===== Meme reactions: six pink tiles, each with its name, a little sound wave, how long it is and a play button ===== */
.gpanel { gap: 12px; padding: 12px; border-radius: 16px; }
.gphead { gap: 2px; padding: 4px 28px 0; }
.gphead b { font: 700 16px/24px "Trebuchet MS", system-ui, sans-serif; }
.gphead small { font: 500 12px/16px Nunito, "Trebuchet MS", system-ui, sans-serif; color: #696662; }
.gps { display: inline-block; vertical-align: -1px; } .gps svg { width: 9px; height: 9px; }

.ggrid { gap: 8px; }
.gtile { min-height: 0; height: 70px; padding: 10px; gap: 6px; border-radius: 12px; background: #fff; border: 1.5px solid transparent; transition: background-color .15s, border-color .15s, transform .12s, opacity .15s; }
.gtile b { font: 400 13px/16px "Trebuchet MS", system-ui, sans-serif; color: #292923; }
.gtile:hover { background: #fbeeee; border-color: #e0605c; }
.gtimes small { font: 400 11px/14px "Trebuchet MS", system-ui, sans-serif; color: #6f6a65; }
.greact .gplay, .greact button.gplay:hover, .greact button.gplay:active { background: #ecb3b1; color: #1f1f1d; }
.greact button.gplay:hover { background: #e8605d; color: #fff; }
.greact .gplay { width: 28px; height: 28px; }
.gplay svg { width: 11px; height: 11px; }
.gphead { padding: 4px 0 0; }
.gphead small { font-size: 11px; white-space: nowrap; }
.ggrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gtile { min-width: 0; }

/* ===== Meme reactions: dark, like the chat ===== */
.gpanel { background: #1e1b1b; color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.gcaret { background: #1e1b1b; }
.gphead b { color: #fff; }
.gphead small { color: #8f8a86; }
.gphead .gps { color: #fff; }
/* On a wide screen the panel is a tray in the chat: it opens like the emoji list, and the chat grows upward by its height with it */
.gdock .gtrayr { margin: 0 calc(var(--u) * 8) 0; }
.gdock .greactpanel { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 0; padding: 12px; border-radius: 16px; background: #1e1b1b; color: #fff; text-align: center; box-sizing: border-box; }
.gdock .greactpanel .gphead { padding: 0; }
.gtray.gtrayr .greactpanel { opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .26s cubic-bezier(.2, .8, .2, 1); }
.gtray.gtrayr.open .greactpanel { opacity: 1; transform: none; }
@media (min-width: 701px) {
  .tbl .gdock { transition: height .26s cubic-bezier(.2, .8, .2, 1); max-height: calc(100vh - 32px); }
  .tbl .gdock:has(.gtrayr.open) { height: calc(var(--u) * 220 + 292px); }
}
@media (prefers-reduced-motion: reduce) { .gtray.gtrayr .greactpanel, .tbl .gdock { transition: none; } }
/* The play button and the tiles inside the chat */
.gdock .gplay { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #ecb3b1; color: #1f1f1d; transition: background-color .15s, color .15s, transform .12s; }
.gdock .gplay:hover { background: #e8605d; color: #fff; }
.gdock .gplay:active { transform: scale(.9); }
.gdock .gplay svg { width: 11px; height: 11px; margin-left: 1px; }
.gdock .gtile { cursor: pointer; }
.gdock .gtile:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* The buttons that open the two trays are lit when theirs is open: the same yellow as a picked thing to throw, on a slightly different background */
.gdock .gsounds.on, .gdock .gsounds.on:hover, .gdock .gsmile.on, .gdock .gsmile.on:hover { background: rgba(232, 170, 44, .2); box-shadow: inset 0 0 0 1.4px #e8aa2c; color: #fff; border: 0; }
.tbl .tbtn[data-act="sounds"].on, .tbl .tbtn[data-act="sounds"].on:hover { background: rgba(232, 170, 44, .2); box-shadow: inset 0 0 0 1.4px #e8aa2c; color: #e5e5e5; }

/* On a phone the panel is centred on the screen, and its arrow stays under the sounds button (the button's centre is 57px left of the screen's centre) */
@media (max-width: 700px) {
  .greact .gpanel { left: 0; right: 0; margin: 0 auto; }
  .greact .gcaret { left: calc(min(312px, 100vw - 16px) / 2 - 69.5px); }
}

/* ===== The phone's buttons sit at the bottom, over the bottom bar: the thing to throw above the settings on the left, the voice reactions above the chat on the right ===== */
@media (max-width: 700px) {
  .tbl { --edge: calc((var(--u) * 328 - 100vw) / 2 + 8px); --b1: calc(var(--u) * 112); --b2: calc(var(--u) * 112 + 46px); }
  .tbl .tbtn, .tbl .tburger { width: 40px; height: 40px; }
  .tbl .ttools, .tbl .tmenu, .tbl .tgroup .tbtn { position: absolute; top: auto; z-index: 60; }
  .tbl .tgroup { display: contents; }
  .tbl .tmenu { left: var(--edge); right: auto; bottom: var(--b1); }
  .tbl .ttools { right: var(--edge); left: auto; bottom: var(--b1); }
  .tbl .tgroup .tbtn[data-act="sounds"] { right: var(--edge); bottom: var(--b2); }
  .tbl .tgroup .tbtn.tthrow { left: var(--edge); bottom: var(--b2); }
  /* The top player's cards in a duel: the same size, whatever the player count (the base rules for a duel come later in the file, so they are set again here) */
  .tbl.duel .tseat.top .tcards, .tbl .tseat.top .tcards:has(.ph) { gap: calc(var(--u) * 7); }
  .tbl.duel .tseat.top .card, .tbl.duel .tseat.top .tcards .ph { --w: calc(var(--u) * 52.5); width: calc(var(--u) * 52.5); height: calc(var(--u) * 80); }
  /* The settings list opens upwards */
  .tbl .tmenulist { top: auto; bottom: 48px; left: 0; right: auto; transform-origin: 0 100%; }
  .tmenu.open .tmenulist { animation-name: tmenuup; }
}
@keyframes tmenuup { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }

/* ===== The game chat and the voice reactions ===== */
/* The phone's two sheets come up from the bottom edge of the screen and go back down; both have round top corners of 20 */
.gsheet { border-radius: 16px 16px 0 0; }
@keyframes sheetup { from { transform: translateY(100%); } }
@keyframes sheetdown { to { transform: translateY(100%); } }
.gchat .gsheet { animation: sheetup .34s cubic-bezier(.2, .8, .2, 1) both; }
.gchat .gscrim { animation: scrimin .25s ease both; }
.gchat.out { pointer-events: none; }
.gchat.out .gsheet { animation: sheetdown .26s cubic-bezier(.4, 0, 1, 1) both; }
.gchat.out .gscrim { animation: scrimout .26s ease both; pointer-events: none; }
@media (max-width: 700px) {
  /* Both sheets take the whole width of the screen */
  .gchat { padding-left: 0; padding-right: 0; }
  .gsheet { max-width: none; }
  /* The voice reactions are a sheet like the chat, as wide as it is, with no point */
  .greact .gpanel { top: auto; bottom: 0; left: 0; right: 0; width: 100%; max-width: none; margin: 0 auto; border-radius: 16px 16px 0 0; padding: 12px 12px calc(24px + env(safe-area-inset-bottom, 0px)); transform-origin: 50% 100%; animation: sheetup .34s cubic-bezier(.2, .8, .2, 1) both; }
  .greact.out .gpanel { animation: sheetdown .26s cubic-bezier(.4, 0, 1, 1) both; }
  .greact .gcaret { display: none; }
  .greact.out .gscrim { animation: scrimout .26s ease both; }
}
@media (prefers-reduced-motion: reduce) { .gchat .gsheet, .gchat .gscrim, .gchat.out .gsheet, .gchat.out .gscrim { animation: none; } .gchat.out { display: none; } .greact .gpanel, .greact.out .gpanel { animation: none; } }
/* The emoji are always there above the field: one row that scrolls sideways (8 inside, 8 between) */
.tbl .gdock .gemoji, .gchat .gemoji { flex: none; display: flex; gap: 8px; padding: 8px; margin: 0; border-radius: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; touch-action: pan-x; }
.tbl .gdock .gemoji { margin: 0 calc(var(--u) * 8); }
.gchat .gemoji::-webkit-scrollbar, .tbl .gdock .gemoji::-webkit-scrollbar { display: none; }
:is(.gchat, .gdock) .gemoji button { flex: none; width: 24px; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* My cards in the banner "It's your turn", so the chat does not hide them */
.gturncards { flex: none; display: flex; gap: 4px; }
.gtc { width: 21px; height: 32px; border-radius: 3px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px #fff; }
.gtc img { display: block; width: 100%; height: 100%; }

/* ===== The phone's chat and reactions sheets: the round buttons and fields are 40 high ===== */
.gchat .ghead { height: 34px; }
.gchat .gx, .greact .gpclose { position: absolute; top: 0; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 99px; background: none; color: #fff; }
.gchat .gx { right: 0; }
.gchat .gx svg, .greact .gpclose svg { width: 20px; height: 20px; }
.greact .gpclose { top: 8px; right: 8px; z-index: 1; }
.greact .gphead { min-height: 40px; justify-content: center; }
.gchat .gsend { width: 40px; height: 40px; }
.gchat .gsend svg { width: 20px; height: 20px; }
.gchat input.gin { height: 40px; }
.gchat .gemoji { height: 40px; }
.gchat .gemoji button { height: 24px; align-self: center; }
.gchat .gemoji { border-radius: 99px; padding: 8px 12px; }
/* (a tap leaves no frame behind the emoji: the hover look would stay on a touch screen) */
.gchat .gemoji button:hover, .gchat .gemoji button:active, .gchat .gemoji button:focus { background: none; box-shadow: none; transform: none; }

/* ===== The phone: nothing touches the edges of the screen. The options panel, the chat and the voice reactions float 8 from the bottom and the sides, with round corners (the chat also stays 8 above the keyboard and, with it up, fills the height that is left) ===== */
@media (max-width: 700px) {
  .tbl { --b1: calc(var(--u) * 104 + 8px); --b2: calc(var(--u) * 104 + 54px); }
  .tbl .tbar { left: calc((var(--u) * 328 - 100vw) / 2 + 8px); width: calc(100vw - 16px); bottom: 8px; min-height: calc(var(--u) * 92); padding: calc(var(--u) * 8) calc(var(--u) * 24) calc(var(--u) * 16); border-radius: 16px; }
  .gchat { padding: 69px 8px max(8px, env(safe-area-inset-bottom, 0px)); }
  html.kb .gchat { padding-top: 8px; }
  .gsheet { padding: 8px; border-radius: 16px; }
  .greact .gpanel { left: 8px; right: 8px; width: auto; bottom: max(8px, env(safe-area-inset-bottom, 0px)); padding: 8px; border-radius: 16px; }
  .greact .gpclose { top: 8px; right: 8px; }
}

/* The phone's three floating panels (the options, the chat, the voice reactions) are one thing: black at 90%, blurred behind, 20 round corners */
@media (max-width: 700px) {
  .tbl .tbar, .gsheet, .greact .gpanel { background: rgba(0, 0, 0, .9); border-radius: 16px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
  .greact .gpanel { box-shadow: none; }
}

/* ===== The wide screen's chat: three looks. The default has the mic, the emoji, the field and send in one row. The emoji button opens a row of emoji above the field (the field's height and colour, 8 above it, it scrolls sideways). The mic button swaps the messages for the six voice reactions and the chat is as tall as they need. 8 of padding all around. ===== */
@media (min-width: 701px) {
  .tbl .gdock .gbody { padding: calc(var(--u) * 8) calc(var(--u) * 8) calc(var(--u) * 8); }
  /* anchored at the bottom: when the chat changes height (to and from the voice reactions) the newest message stays put, with no scrolling to keep it there */
  .tbl .gdock .gbody { flex-direction: column-reverse; }
  .tbl .gdock .gform { gap: calc(var(--u) * 8); padding: calc(var(--u) * 8); }
  .tbl .gdock .gtray { margin: 0 calc(var(--u) * 8); }
  .tbl .gdock .gtray .gemoji { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; margin: 0; border-radius: 99px; background: rgba(255, 255, 255, .3); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; }
  .tbl .gdock .gtray .gemoji::-webkit-scrollbar { display: none; }
  .tbl .gdock .gtray .gemoji button { flex: none; width: 24px; height: 24px; }
  .tbl .gdock .gtray .gemoji button:hover { background: rgba(255, 255, 255, .18); }
  .tbl .gdock .gtray { padding-bottom: 0; }
  .tbl .gdock .gtray .gtrayin { padding-top: 0; }
  .tbl .gdock .gvoice { display: none; }
  .tbl .gdock.vmode { height: auto; }
  .tbl .gdock.vmode .gbody, .tbl .gdock.vmode .gtray { display: none; }
  .tbl .gdock.vmode .gvoice { display: flex; flex-direction: column; gap: calc(var(--u) * 8); padding: calc(var(--u) * 8) calc(var(--u) * 8) 0; }
  .tbl .gdock .gvoice .gphead { padding: 0; }
  .tbl .gdock .gvoice .gphead b { display: none; }
  .tbl .gdock .gvoice .gphead small { color: #fff; font-size: 12px; line-height: 16px; }
  .tbl .gdock:has(.gtrayr.open) { height: calc(var(--u) * 220); }
}

/* ===== Voice reactions: white tiles, no wave (the play button turns red while the clip plays) ===== */
.greact .gplay.on, .gdock .gplay.on, .greact button.gplay.on:hover { background: #e32121; color: #fff; }
/* ===== Desktop chat: the gap between the mic, the emoji, the field and send is 4 units; the voice reactions open smoothly (the chat grows to their height, they fade in) ===== */
@media (min-width: 701px) {
  .tbl .gdock .gform { gap: calc(var(--u) * 4); }
  /* exactly what is in it: the header 41u, the padding 8u, the gap 8u, the field row's 16u of padding; and 1px line, 16px text, two tiles of 66px with 8px between, the 32px field */
  .tbl .gdock.vmode { height: calc(var(--u) * 73 + 189px); }
  /* signed out: two rows of tiles (66px each, 8px between; the second row is locked), then 8px, the 1px line, the sign-up (8px, the 44px button, 8px, 16px text, 4px) */
  .tbl .gdock.vmode:has(.psignup) { height: calc(var(--u) * 73 + 277px); }
  .tbl .gdock.vmode .gvoice { animation: gvoicein .3s cubic-bezier(.2, .8, .2, 1) both; }
  @keyframes gvoicein { from { opacity: 0; transform: translateY(8px); } }
}
@media (prefers-reduced-motion: reduce) { .tbl .gdock.vmode .gvoice { animation: none; } }

/* The emoji row is dragged sideways with a mouse (see the pointer handlers in client.ts) */
.gemoji { cursor: grab; user-select: none; -webkit-user-select: none; }
.gemoji:active { cursor: grabbing; }
.gemoji button { cursor: pointer; }

/* ===== DEV button on a wide screen: a round 40 x 40 button like the Settings button, left of it (on a phone it stays the small "dev" chip) ===== */
.dt-ico { display: none; }
@media (min-width: 701px) {
  /* The dock is just the button's place (left of the Settings button); the panel opens to its left */
  #devdock { left: auto; transform: none; width: 40px; height: 40px; top: calc(16px + env(safe-area-inset-top, 0px)); right: calc(16px + 40px + 8px + env(safe-area-inset-right, 0px)); }
  #devdock .dt-panel { position: absolute; right: calc(100% + 8px); top: 0; width: min(460px, calc(100vw - 232px)); }
  #devdock .dt-open.on, #devdock .dt-open.on:hover { background: rgba(0, 0, 0, .8); color: #fff; }
  #devdock .dt-open { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 999px; background: rgba(0, 0, 0, .5); color: #e5e5e5; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: background-color .15s; }
  #devdock .dt-open:hover { background: rgba(0, 0, 0, .65); color: #e5e5e5; }
  #devdock .dt-open:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
  #devdock .dt-open .dt-txt { display: none; }
  #devdock .dt-open .dt-ico { display: block; }
}

/* On a phone the open panel replaces the chip, centred as before */
@media (max-width: 700px) { #devdock.open .dt-open { display: none; } }

/* ===== The pause sheet (Settings and every state of a pause), from the Figma "Settings and pause options UI" frames. It comes up from the
   bottom of a phone, 8 from the edges, and sits in the middle of a wide screen. Its content changes in place and its height glides. ===== */
.gpause { position: fixed; inset: 0; z-index: 9500; display: flex; align-items: flex-end; justify-content: center; padding: 8px 8px max(8px, env(safe-area-inset-bottom, 0px)); box-sizing: border-box; pointer-events: none; font-family: "Trebuchet MS", system-ui, sans-serif; }
@media (min-width: 701px) { .gpause { align-items: center; } }
.gpause .gscrim { pointer-events: none; }
.gpause.settings .gscrim { pointer-events: auto; }
.gpause button { all: unset; box-sizing: border-box; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gpause button:focus-visible, .gpause a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.psheet { --panel-bg: linear-gradient(135deg, #191210 0%, #190e0e 50%, #301e1e 100%); position: relative; pointer-events: auto; width: 100%; max-width: 360px; overflow: hidden; border-radius: 16px; background: var(--panel-bg); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); color: #fffbf5; text-align: center; box-sizing: border-box; animation: sheetup .34s cubic-bezier(.2, .8, .2, 1) both; }
@media (min-width: 701px) { .psheet { animation-name: pfadein; } .gpause.out .psheet { animation-name: pfadeout; } }
@keyframes pfadein { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes pfadeout { to { opacity: 0; transform: translateY(16px) scale(.98); } }
.gpause.out .psheet { animation: sheetdown .26s cubic-bezier(.4, 0, 1, 1) both; }
.gpause.out, .gpause.out * { pointer-events: none !important; }
.pinner { display: flex; flex-direction: column; align-items: stretch; gap: 20px; padding: 24px; }
.pinner > * { margin: 0; }
.ptitle { font: 700 16px/20px "Trebuchet MS", system-ui, sans-serif; color: #e8aa2c; text-transform: uppercase; text-shadow: 0 0 3px rgba(255, 208, 0, .4); }
.ptitle + .ptext { margin-top: -12px; }
.ptext { font: 500 14px/19px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: #eee6dc; }
.ptext b { font-weight: 700; }
.ptime { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pclock { font: 700 20px/23px "Trebuchet MS", system-ui, sans-serif; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pcount { margin: 0; font: 700 14px/16px "Trebuchet MS", system-ui, sans-serif; letter-spacing: -.02em; color: #fff; }
.ptime .pcount { opacity: .7; }
.pring { --p: 100%; position: relative; align-self: center; width: 62px; height: 62px; border-radius: 50%; background: conic-gradient(#e32026 var(--p), rgba(230, 242, 213, .6) 0); display: grid; place-items: center; }
.pring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #1b0f0f; }
.pring b { position: relative; font: 700 20px/23px "Trebuchet MS", system-ui, sans-serif; letter-spacing: -.05em; color: #fff; font-variant-numeric: tabular-nums; }
.gpause .pbtn { display: flex; align-items: center; justify-content: center; height: 44px; padding: 0 14px; border-radius: 16px; font: 700 16px/19px "Trebuchet MS", system-ui, sans-serif; text-align: center; transition: opacity .2s ease, transform .12s ease, background-color .2s ease; }
.gpause .pbtn + .pbtn { margin-top: -6px; }
.gpause .pbtn.go { background: #8dc641; color: #292923; border: 1.5px solid #292923; box-shadow: none; }
.gpause .pbtn.go:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.gpause .pbtn.go:disabled { opacity: .42; box-shadow: none; cursor: default; }
.gpause .pbtn.line { color: #fffbf5; border: 1.5px solid #e8e1d7; }
.gpause .pbtn.line:disabled { opacity: .5; cursor: default; }
.gpause .pbtn.plain { color: #fffbf5; }
@media (hover: hover) { .gpause .pbtn.line:hover:not(:disabled), .gpause .pbtn.plain:hover { background: rgba(255, 255, 255, .06); } .gpause .pbtn.go:hover:not(:disabled) { filter: brightness(1.05); } }
.prows { display: flex; flex-direction: column; margin-top: -6px; }
.gpause .prow { display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 8px 0; font: 400 12px/14px "Trebuchet MS", system-ui, sans-serif; color: #fffbf5; }
.ptoggle { position: relative; width: 56px; height: 28px; border-radius: 64px; background: #adb8bc; border: 1px solid #292923; box-sizing: border-box; transition: background-color .2s ease; }
.ptoggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #f2eee7; border: 1px solid #292923; box-sizing: border-box; transition: transform .2s ease, background-color .2s ease; }
.ptoggle.on { background: #8dc641; }
.ptoggle.on::after { transform: translateX(28px); background: #fff; }
.psocial { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.psocial a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6.4px; color: #adb8bc; transition: color .15s ease, background-color .15s ease; }
@media (hover: hover) and (pointer: fine) { .psocial a:hover { color: #fff; background: rgba(255, 255, 255, .08); } }
@media (prefers-reduced-motion: reduce) { .psheet, .gpause.out .psheet { animation: none; transition: none; } .gpause.out { display: none; } }
/* The chat's gold banner while a pause is on: "Game paused" and its clock */
/* It's my turn: the whole banner is a way back to the table */
.gturn.gturngo { cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.gturn.gpaused { justify-content: space-between; min-height: 40px; padding: 8px 16px; }
.gturn.gpaused .gturnt { font: 700 14px/14px "Nunito", "Trebuchet MS", system-ui, sans-serif; }
.gturn.gpaused .pclock { color: #292923; }
/* While a pause is on, the phone's chat takes the whole screen (8 from the top) */
@media (max-width: 700px) { body.pblur .gchat { padding-top: 8px; } body.pblur .gchat .gsheet { height: 100%; } }
/* (the page's own hover lift and shadow for buttons does not apply in the sheet) */
.gpause button:hover, .gpause button:active { transform: none; filter: none; box-shadow: none; }
.gpause .pbtn.go:hover:not(:disabled) { box-shadow: none; }
.gpause .pbtn.go:disabled:hover { box-shadow: none; }

/* ===== One look for every panel at the table, taken from the pause sheet: the dark gradient and a soft inner light, blurred behind, 20 round
   corners, no edge line. Only the surface and the corners: what is inside each panel, and its own padding and margins, stay as they are. The
   options panel looks the same in and out of my turn (on a wide screen my turn only adds its green edge and glow) ===== */
.tbl .tbar, .tbl .tbar.myturn, #app .tbl section.gdock, .tbl .gdock .greactpanel, .greact .gpanel, .gchat .gsheet, .psheet {
  background: linear-gradient(135deg, #191210 0%, #190e0e 50%, #301e1e 100%);
  border-radius: 16px;
  /* (no blur behind: the surface is opaque, and with a blur Chrome draws a square box around the panel over the Seen dark and the turn glow) */
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.tbl .tbar, #app .tbl section.gdock, .greact .gpanel, .gchat .gsheet, .psheet { border: 0; box-shadow: inset 0 1px 10px 1px rgba(177, 177, 177, .1); }
/* (the chat panel's inner light is warmer, as in the Figma chat frames) */
.gchat .gsheet, #app .tbl section.gdock { box-shadow: inset 0 1px 10px 1px rgba(255, 197, 197, .1); }
@media (max-width: 700px) { .tbl .tbar.myturn { border: 0; box-shadow: inset 0 1px 10px 1px rgba(177, 177, 177, .1); } }
/* (the glow is a layer of its own: drawn on the panel itself, under its background blur, Chrome squares off its corners) */
@media (min-width: 701px) {
  .tbl .tbar.myturn { border: 1px solid #8dc641; box-shadow: inset 0 1px 10px 1px rgba(177, 177, 177, .1); }
  .tbl .tbar.myturn::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; box-shadow: 0 0 16px #ffdd00; pointer-events: none; z-index: -1; }
}
.greact .gcaret { background: #1a1110; }

/* A wide screen: the sheet appears in the middle and fades away (only a phone's sheet slides down); the chat is always open there, so the
   pause has no Open chat button */
@media (min-width: 701px) {
  .gpause .psheet { animation: pfadein .22s ease both; }
  .gpause.out .psheet { animation: pfadeout .18s ease both; }
  .gpause .pbtn[data-act="chat"] { display: none; }
}
/* Settings closes with its X (or a tap beside it) */
.psheet .px { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 99px; background: none; color: #e5e5e5; transition: color .15s ease; }
.psheet .px svg { width: 20px; height: 20px; }
@media (hover: hover) { .psheet .px:hover { color: #e8aa2c; } }
/* Settings, from the Figma "Settings - no blur" frame: 8 around (24 at the bottom); a header row with the title in the middle and the X at the
   right; under it a column 24 in from the sides, 20 between its parts (Pause game, the switches and Quit session 14 apart, the social links) */
.psheet[data-kind="settings"] .pinner { padding: 8px 8px 24px; gap: 20px; }
.psheet[data-kind="settings"] .phead { display: flex; align-items: center; justify-content: space-between; height: 34px; }
.psheet[data-kind="settings"] .phead > i { width: 34px; flex: none; }
.psheet[data-kind="settings"] .px { position: static; flex: none; }
.psheet[data-kind="settings"] .pcol { display: flex; flex-direction: column; align-items: stretch; gap: 20px; padding: 0 8px; }
.psheet[data-kind="settings"] .prows { margin-top: 0; }
.psheet[data-kind="settings"] .prows + .pbtn { margin-top: -6px; }
.psheet[data-kind="settings"] .psocial { margin-top: 0; }
.psheet[data-kind="settings"] .phead .ptitle { margin: 0; }
/* (the page gives every section 10 of padding and a margin; the sheet has none of its own: its inside sets the spacing) */
#app .gpause section.psheet { padding: 0; margin: 0; }

/* ===== Accounts: Google's sign-in button (invisible, over ours), the sign-up prompt, and the first sign-in's Registration ===== */
/* "Continue with Google": white, with Google's G, our corners and font */
#app .pgoogle { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 44px; padding: 0 14px; border-radius: 16px; background: #fff; color: #292923; font: 400 17px/20px "Trebuchet MS", system-ui, sans-serif; cursor: pointer; transition: background-color .15s, transform .12s; }
#app .pgoogle svg { flex: none; }
#app .pgoogle:active { transform: translateY(1px); }
#app .pgoogle:focus-visible { outline: 3px solid #e8aa2c; outline-offset: 2px; }
@media (hover: hover) { #app .pgoogle:hover { background: #f4f1ec; } }
.psignup { display: flex; flex-direction: column; gap: 8px; }
.psignup p { margin: 0; font: 400 12px/16px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: #fffbf5; text-align: center; }
.psignup p b { color: inherit; font-weight: inherit; }
.paccount { display: flex; flex-direction: column; gap: 12px; }
.perr { margin: 0; font: 400 12px/16px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: #ff6b5a; text-align: center; }
/* in the chat (phone sheet and wide-screen dock) and under the voice reactions */
.gsheet .psignup { padding: 0; }
/* The voice reactions' sign-up: 8px, a line, 8px (the margin takes back what the column's own gap adds) */
.gpanel .psignup, .gvoice .psignup { padding: 8px 0 4px; margin-top: -4px; border-top: 1px solid rgba(255, 255, 255, .1); }
.gvoice .psignup { margin-top: calc(8px - var(--u) * 8); }

[data-kind="register"] .ptitle { margin: 0; text-align: center; color: #fffbf5; font: 700 16px/19px "Trebuchet MS", system-ui, sans-serif; text-transform: none; letter-spacing: 0; text-shadow: none; }
.preg { display: flex; flex-direction: column; gap: 16px; padding: 0 8px; text-align: left; }
.preg .pbtn { margin-top: 8px; }
.preg .pavatar { all: unset; align-self: center; width: 60px; height: 60px; display: grid; place-items: center; cursor: pointer; }
.preg .phint { margin: -12px 0 0; font: 400 12px/16px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: #e8aa2c; text-align: center; }
.pavatars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 136px; overflow-y: auto; overscroll-behavior: contain; padding: 6px; border-radius: 12px; background: rgba(255, 255, 255, .05); scrollbar-width: none; animation: pavatarsin .28s cubic-bezier(.2, .8, .2, 1); }
.pavatars::-webkit-scrollbar { display: none; }
/* (the list opens by growing, so the panel around it grows smoothly too) */
@keyframes pavatarsin { from { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; } to { max-height: 136px; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pavatars { animation: none; } }
.pavatars button { all: unset; display: grid; place-items: center; height: 32px; font-size: 22px; border-radius: 8px; cursor: pointer; }
.pavatars button.on { background: rgba(232, 170, 44, .3); }
.pinput { display: flex; flex-direction: column; gap: 6px; }
.pinput > span { font: 400 12px/16px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: rgba(255, 255, 255, .7); }
.pinput > small, .preg .pcount2 { font: 300 11px/14px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: rgba(255, 255, 255, .6); }
.preg .pcount2 { margin-top: -10px; }
#app .pfield { box-sizing: border-box; width: 100%; height: 44px; margin: 0; padding: 0 14px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .05); color: #fffbf5; font: 400 16px/20px "Trebuchet MS", system-ui, sans-serif; box-shadow: none; outline: none; }
#app textarea.pfield { height: 80px; padding: 12px 14px; resize: none; }
#app .pfield:focus { border-color: rgba(255, 255, 255, .5); }
.pinput.bad .pfield { border-color: #ff6b5a !important; }
.pinput.bad > small { color: #ff6b5a; }

/* Settings' Pause game: gold */
.gpause .pbtn.gold { background: #e8aa2c; color: #292923; border: 1.5px solid #292923; box-shadow: none; }
.gpause .pbtn.gold:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.gpause .pbtn.gold:disabled { opacity: .42; cursor: default; }
@media (hover: hover) { .gpause .pbtn.gold:hover:not(:disabled) { filter: brightness(1.05); background: #e8aa2c; } }

/* ===== My profile (from Settings): @username, the avatar and the numbers, the name and the bio, Edit profile, when I joined ===== */
.psheet[data-kind="profile"] .pinner { padding: 8px 8px 24px; gap: 16px; }
[data-kind="profile"] .phead { display: flex; align-items: center; justify-content: space-between; height: 34px; }
.puser { margin: 0; font: 700 16px/19px "Trebuchet MS", system-ui, sans-serif; color: #fffbf5; text-align: center; text-transform: none; letter-spacing: 0; }
.pprof { display: flex; flex-direction: column; gap: 8px; padding: 0 8px; text-align: left; }
.pmerow { display: flex; align-items: center; gap: 20px; }
.pface { flex: none; width: 60px; height: 60px; display: grid; place-items: center; }
.pstats { flex: 1; display: flex; justify-content: flex-start; gap: 20px; }
.pstat { display: flex; flex-direction: column; gap: 3px; }
.pstat b { font: 500 14px/16px "Roboto", "Trebuchet MS", system-ui, sans-serif; color: #fffbf5; }
.pstat small { font: 400 11px/11px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: #fffbf5; }
.pstat.gold b, .pstat.gold small { color: #e8aa2c; }
.pwho { display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px; }
.pwho b { font: 400 14px/16px "Trebuchet MS", system-ui, sans-serif; color: #fffbf5; }
.pbio { margin: 0; font: 300 12px/17px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: #fff; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pbio.none { opacity: .6; }
.pbio[data-act] { cursor: pointer; }
.pbio.open { display: block; }
.pjoined { display: block; margin-top: 4px; font: 300 11px/11px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: #77736b; text-align: center; }
/* Edit profile: its title in one row with the X, like Settings */
[data-kind="register"] .phead { display: flex; align-items: center; justify-content: space-between; height: 34px; }
[data-kind="register"] .phead > i { width: 34px; }
[data-kind="register"] .phead .px { position: static; flex: none; }
.preg .pbtn.plain { margin-top: -8px; }

/* The newsletter checkbox (under the main button), Delete account (red, small), and the question before deleting */
#app .pcheck { all: unset; display: flex; align-items: flex-start; gap: 10px; text-align: left; cursor: pointer; }
.pcheck i { flex: none; width: 20px; height: 20px; box-sizing: border-box; display: grid; place-items: center; border-radius: 6px; border: 1.5px solid rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .05); color: #292923; font: 700 13px/1 "Trebuchet MS", system-ui, sans-serif; font-style: normal; transition: background-color .15s, border-color .15s; }
.pcheck.on i { background: #8dc641; border-color: #292923; }
.pcheck span { font: 400 12px/16px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: rgba(255, 251, 245, .85); }
#app .pdelete { all: unset; align-self: center; padding: 4px 8px; font: 400 12px/16px "Trebuchet MS", system-ui, sans-serif; color: #cc393c; cursor: pointer; }
@media (hover: hover) { #app .pdelete:hover { text-decoration: underline; } }
.gpause .pbtn.danger, .lv .lvreg .pbtn.danger { background: #cc393c; color: #fff; border: 1.5px solid #292923; box-shadow: none; }
.gpause .pbtn.danger:disabled, .lv .lvreg .pbtn.danger:disabled { opacity: .42; cursor: default; }
.pinput > span b { color: #fffbf5; }
.preg .ptext { margin: 0; text-align: left; }

/* My profile: the back arrow on the left of its title; a tap beside the sheet closes it too (the pause sheet's own scrim takes no taps) */
#app .pback { all: unset; flex: none; width: 34px; height: 34px; display: grid; place-items: center; color: #fffbf5; cursor: pointer; }
#app .pback svg { width: 12px; height: 20px; }
@media (hover: hover) { #app .pback:hover { color: #e8aa2c; } }
[data-kind="profile"] .phead > i { width: 34px; flex: none; }
.gpause .gscrim[data-act="profileClose"] { pointer-events: auto; }

/* A bot's profile: its badge at the bottom, where a player's profile has its buttons */
.pbadge { flex: none; display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 2px 8px; border-radius: 99px; background: rgba(54, 226, 108, .25); color: #00bb3a; font: 500 10px/14px "Nunito", "Trebuchet MS", system-ui, sans-serif; }

/* A name panel that opens a profile: the pointer says it can be tapped (not while aiming a throw, which has its own look) */
.tbl .thead.canopen, .tbl .thead.canopen * { cursor: pointer; }

/* Another player's profile: a pointer over names and avatars that open one (in the chat too); the numbers wait for the server */
.lvmn.canopen, .lvmav.canopen, .lvmav.canopen * { cursor: pointer; }
.pprof.loading .pstat b { opacity: .4; }
.pinvite { margin: -2px 0 0; font: 400 12px/16px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: #fffbf5; text-align: center; }
.pinvite b { color: inherit; font-weight: inherit; }

/* A profile's name, then the flag 4 to its right, then the blue check (the admin's) */
.pname { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0; }
.pname > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pname > .pflag, .pname > svg { flex: none; }
.pflag { font-size: 14px; line-height: 1; }
.pcheckmark { flex: none; display: block; }
/* Country: a list, with its arrow */
.pselect { position: relative; display: block; }
.pselect::after { content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; margin-top: -6px; border: solid #fffbf5; border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); pointer-events: none; }
#app select.pfield { -webkit-appearance: none; appearance: none; padding-right: 40px; cursor: pointer; }
#app select.pfield option { color: #292923; }

/* The sheet (Settings, a pause, my profile, Edit profile, Registration) never goes past the screen: taller than it, it scrolls inside, from the top */
.gpause { padding-top: max(8px, env(safe-area-inset-top, 0px)); }
.gpause .psheet { max-height: 100%; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.gpause .psheet::-webkit-scrollbar { display: none; }

/* The margins of every panel: 8 at the sides and the top, so the 34-square buttons in the title row sit 8 from the edge; the title row is 34 high and 16 above the content,
   and the content has 8 more at its sides, so it is 16 from the edge (the game's chat has only the 8) */
.psheet:not([data-kind="settings"]):not([data-kind="profile"]):not([data-kind="register"]) .pinner { padding: 8px 16px 24px; }
.psheet:not([data-kind="settings"]):not([data-kind="profile"]):not([data-kind="register"]) .ptitle { min-height: 34px; display: flex; align-items: center; justify-content: center; }
.psheet[data-kind="register"] .pinner { padding: 8px 8px 16px; gap: 16px; }
[data-kind="register"] > .ptitle, .pinner > .ptitle { min-height: 34px; display: flex; align-items: center; justify-content: center; }
.psheet[data-kind="profile"] .pwho { padding-bottom: 8px; }
/* The end of a game: Play Again on the left takes all the room it can, Leave hugs its text */
.tbl .tactions:has(> button[data-act="next"]) { align-self: stretch; width: auto; box-sizing: border-box; }
.tbl .tactions button[data-act="next"] { flex: 1 1 auto; min-width: 0; }
.tbl .tactions button[data-act="leaveLobby"] { flex: 0 0 auto; }
/* The game's chat on a phone: only the sheet's 8, nothing more inside */
.gsheet .gbody { padding-left: 0; padding-right: 0; }

/* Someone's profile: the ⋮ button (34 square, 8 from the edge), its menu, and Friends or Add to friends */
#app .pmore { all: unset; flex: none; width: 34px; height: 34px; display: grid; place-items: center; color: #fffbf5; cursor: pointer; }
@media (hover: hover) { #app .pmore:hover { color: #e8aa2c; } }
.phead { position: relative; }
.pmenu { position: absolute; right: 0; top: 38px; z-index: 5; width: 190px; display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 16px; background: rgba(34, 29, 29, .96); box-shadow: inset 0 1px 10px 1px rgba(177, 177, 177, .1), 0 8px 24px rgba(0, 0, 0, .4); animation: tmenuin .16s ease-out; }
#app .pmenu button { all: unset; box-sizing: border-box; height: 40px; padding: 0 14px; display: flex; align-items: center; border-radius: 10px; color: #fff; font: 700 14px/18px "Trebuchet MS", system-ui, sans-serif; cursor: pointer; }
@media (hover: hover) { #app .pmenu button:not(:disabled):hover { background: rgba(255, 255, 255, .1); } }
#app .pmenu button.off { color: rgba(255, 255, 255, .35); cursor: default; }
.pinvite.plain { font-weight: 300; }

/* The friends count opens the list: the number and the word are one button */
#app .pstat.plink { all: unset; display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
@media (hover: hover) { #app .pstat.plink:hover b, #app .pstat.plink:hover small { color: #e8aa2c; } }
#app .pstat.plink:focus-visible { outline: 2px solid #e8aa2c; outline-offset: 2px; border-radius: 4px; }
/* A friends list: the search, then rows of 40 avatars; its content is 16 from the edge like every panel */
.plist { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 16px; padding: 0 8px; text-align: left; }
.pfriends { display: flex; flex-direction: column; gap: 2px; }
#app .pfriend { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
@media (hover: hover) { #app .pfriend:hover .pname { color: #e8aa2c; } }
.pfwho { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pfwho .pname { font: 700 14px/18px "Trebuchet MS", system-ui, sans-serif; color: #fffbf5; }
.pfwho small { font: 300 11px/14px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: rgba(255, 255, 255, .8); }
.pfhint { font: 300 11px/14px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: #fff; text-align: center; }
.pnone { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0; text-align: center; }
.pnone span { font-size: 40px; line-height: 1; }
.pnone b { font: 700 16px/20px "Trebuchet MS", system-ui, sans-serif; color: #fffbf5; }
.pnone p { margin: 0; font: 400 12px/16px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: rgba(255, 255, 255, .85); }
.psheet[data-kind="profile"]:has(.plist) .pinner { padding-bottom: 16px; }
.lvreg[data-kind="profile"]:has(.plist) { padding-bottom: 16px; }

/* The friends list: the panel is always wholly on the screen, its title and search stay, and the friends scroll inside it. In the game it reaches no higher than under the top seat */
.gpause .psheet:has(.plist) { display: flex; flex-direction: column; max-height: min(100%, calc(var(--app-h, 100dvh) - 125px)); overflow: hidden; }
.psheet:has(.plist) .pinner { flex: 1 1 auto; min-height: 0; }
.pfscroll { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.pfscroll::-webkit-scrollbar { display: none; }
.pfhint.pfnote { color: rgba(255, 255, 255, .6); }
.pfriends, .pfhint, .psearch { flex: none; }
.psearch { position: relative; }
#app .psearch .pfield { padding-right: 44px; }
#app .pclear { all: unset; position: absolute; right: 4px; top: 50%; width: 36px; height: 36px; margin-top: -18px; display: grid; place-items: center; color: rgba(255, 251, 245, .8); cursor: pointer; }
[data-kind="profile"] .phead .px { position: static; flex: none; }

/* Part of a friend's row: where they are now */
.pfstat { flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font: 400 11px/14px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: rgba(255, 255, 255, .75); white-space: nowrap; }
.pfstat i { order: 2; width: 7px; height: 7px; border-radius: 50%; background: #8c8c8c; }
.pfstat.online i { background: #8dc641; }
.pfstat.game i { background: #e8aa2c; }
.pfwho { flex: 1 1 auto; }
.pfwho .pfstat { margin-left: 0; }
.pfwho .pfstat i { order: 0; }
#app .pfriend.inv { cursor: default; }
.pfriend.inv.off { opacity: .5; }
/* Fill this seat */
.puser.strong { font-weight: 700; }
#app .gpause .pbtn.bot { background: #8dc641; color: #292923; border: 1.5px solid #292923; box-shadow: none; }
#app .gpause .pbtn.botall { background: none; color: #fffbf5; border: 1.5px solid #fff; box-shadow: none; }
@media (hover: hover) { #app .gpause .pbtn.botall:hover { background: rgba(255, 255, 255, .06); } }
.por { margin: 0; font: 400 12px/16px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: rgba(255, 255, 255, .6); text-align: center; }
.pdiv { align-self: center; width: 80px; height: 1px; background: rgba(255, 255, 255, .15); }
#app .pinvbtn { all: unset; flex: none; box-sizing: border-box; padding: 7px 12px; border-radius: 16px; background: #8dc641; border: 1px solid #292923; color: #292923; font: 700 12px/14px "Trebuchet MS", system-ui, sans-serif; cursor: pointer; }
#app span.pinvbtn.sent { background: none; border: 1px solid #e8e1d7; color: #fffbf5; cursor: default; }
#app .pseeall { all: unset; align-self: center; padding: 4px 8px; color: #e8aa2c; font: 700 13px/16px "Trebuchet MS", system-ui, sans-serif; cursor: pointer; }
.gpause:has([data-kind="fill"]) { background: rgba(0, 0, 0, .45); }
.gpause:has([data-kind="fill"]) .gscrim { pointer-events: auto; }
[data-kind="fill"] .phead { display: flex; align-items: center; justify-content: space-between; height: 34px; }
[data-kind="fill"] .phead > i { width: 34px; flex: none; }
[data-kind="fill"] .phead .px { position: static; flex: none; }
.psheet[data-kind="fill"] .pinner { padding: 8px 8px 16px; gap: 16px; }
/* A seat's Blocked badge */
.pbadge.blocked { background: rgba(226, 54, 54, .25); color: #cc393c; }
.pbadge.bot { background: rgba(232, 170, 44, .25); color: #e8aa2c; }
.pbadge.blocked svg { width: 11px; height: 11px; }
#app .pmenu button.red { color: #ffb3b3; }
/* The invite banner: at the top of every /play screen, above everything */
#invitebanner { position: fixed; z-index: 9900; left: 8px; right: 8px; top: max(8px, env(safe-area-inset-top, 0px)); max-width: 360px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, #191210 0%, #190e0e 50%, #301e1e 100%); box-shadow: inset 0 1px 10px 1px rgba(177, 177, 177, .1), 0 8px 24px rgba(0, 0, 0, .45); color: #fffbf5; font-family: "Trebuchet MS", system-ui, sans-serif; animation: tmenuin .2s ease-out; }
#invitebanner .itop { display: flex; align-items: center; gap: 12px; }
#invitebanner .iwho { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 18px; text-align: left; }
#invitebanner small { font: 400 11px/14px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: rgba(255, 255, 255, .7); }
#invitebanner small.warn { color: #e8aa2c; }
#invitebanner .iring { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-size: 13px; font-weight: 700; background: radial-gradient(closest-side, #1c1412 76%, transparent 78%), conic-gradient(#8dc641 var(--p, 100%), rgba(255, 255, 255, .15) 0); }
#invitebanner .ibtns { display: flex; gap: 10px; }
#invitebanner .ibtn { all: unset; box-sizing: border-box; flex: 1 1 0; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 16px; font: 700 15px/18px "Trebuchet MS", system-ui, sans-serif; cursor: pointer; text-align: center; }
#invitebanner .ibtn.go { background: #8dc641; color: #292923; border: 1.5px solid #292923; box-shadow: none; }
#invitebanner .ibtn.line { color: #fffbf5; border: 1.5px solid #e8e1d7; }

/* Settings and the pause: Pause, My profile and Quit session are one group (8 apart), the sound switch under it */
.pgroup { display: flex; flex-direction: column; gap: 8px; }
.gpause .pgroup .pbtn + .pbtn { margin-top: 0; }
.pgroup + .prows { margin-top: -6px; }
.gpause .pbtn.teal { background: #23a9bf; color: #fff; border: 1.5px solid #292923; box-shadow: none; }
.gpause .pbtn.teal:active { transform: translateY(2px); box-shadow: none; }
@media (hover: hover) { .gpause .pbtn.teal:hover { background: #23a9bf; filter: brightness(1.05); } }
#app .pmore svg { width: 4px; height: 16px; }
.gchat .gtag { border-radius: 16px; }

/* A profile: @username and the joined date in the top bar; the name row is always 18 high, with or without a badge */
.ptop { flex: 1; min-width: 0; text-align: center; }
.ptop .puser { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pnamerow { height: 18px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pnamerow .pname { min-width: 0; margin-right: auto; }
.pnamerow .pbadge + .pbadge { margin-left: -4px; }

/* Last 5 sessions */
.psess { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
/* (its title looks like Win song's: Nunito 13, white at 70%, on the left, 4 above the rows) */
.psess .psesst { margin: 0 0 -6px; text-align: left; font: 400 13px/18px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: rgba(255, 255, 255, .7); }
.psrow { display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); align-items: center; min-height: 30px; }
#app .psp { all: unset; box-sizing: border-box; min-width: 0; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
#app .psp.still { cursor: default; }
@media (hover: hover) { #app button.psp:hover b { color: #e8aa2c; } }
.pswho { min-width: 0; display: flex; flex-direction: column; text-align: left; }
.pswho b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 12px/14px "Trebuchet MS", system-ui, sans-serif; color: #fff; }
.pswho small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 300 9px/11px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: #77736b; }
.psothers .pswho { text-align: right; }
.psothers { min-width: 0; display: flex; justify-content: flex-end; gap: 4px; }
.psscore { display: grid; grid-template-columns: 14px auto 14px; justify-content: center; align-items: center; gap: 2px; font: 400 11px/14px "Trebuchet MS", system-ui, sans-serif; color: #77736b; }
.psscore i { display: grid; place-items: center; color: #8dc641; }

/* Settings, signed out: a short rule under Continue with Google, as in the design */
.gpause .paccount::after { content: ""; align-self: center; width: 96px; height: 1px; background: rgba(255, 255, 255, .1); }
/* Signed out: the Google sign-up, 16px, the rule, 16px, then the button group (the column's own gap is 20px) */
.gpause .paccount { gap: 16px; }
.gpause .paccount + .pgroup { margin-top: -4px; }

/* Settings: the Background row (the title is the same as "Sound effects"; a swatch is 40 by 40, the chosen one has a 2px gold border) */
.pbg { display: flex; flex-direction: column; gap: 8px; }
.gpause .pbgtitle { text-align: left; font: 400 12px/14px "Trebuchet MS", system-ui, sans-serif; color: #fffbf5; }
.pbgrow { display: flex; justify-content: flex-start; gap: 8px; }
.gpause button.bgsw { all: unset; box-sizing: border-box; flex: none; width: 40px; height: 40px; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; cursor: pointer; transition: transform .12s cubic-bezier(.23, 1, .32, 1); -webkit-tap-highlight-color: transparent; }
.gpause button.bgsw.on { border-color: #e8aa2c; }
.gpause button.bgsw:active { transform: scale(.95); }
.gpause button.bgsw:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.psheet[data-kind="settings"] .pbg { margin-top: 0; }
/* The swatches are small copies of the backgrounds, so they can be told apart */
.gpause button.bgsw[data-bg="midnight"] { background-color: #05060f; background-image: radial-gradient(circle farthest-corner at 50% 50%, #2a3390 0, #232b7a 18%, #121749 48%, #0a0d2b 72%, #05060f 100%); }
.gpause button.bgsw[data-bg="slate"] { background-color: #0e141a; background-image: radial-gradient(circle farthest-corner at 50% 50%, #2c3d4c 0, #24323f 18%, #1d2833 48%, #161f28 72%, #0e141a 100%); }
.gpause button.bgsw[data-bg=""] { background-color: #660914; background-image: radial-gradient(circle farthest-corner at 50% 50%, #eb2836 0, #d22230 18%, #93131f 48%, #87111d 72%, #660914 100%); }

/* "Copy link" in the in-app browser notice: blue, like a link */
.lv .perr button.plinkcopy, .perr button.plinkcopy { all: unset; display: inline; color: #6ab0ff; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* Stage projectors of Swap and Plot Twist (spotlightfx.ts): the light is the whole effect, so the frames and the line between the picks stay away */
.ptl { position: fixed; inset: 0; z-index: 80; overflow: hidden; contain: strict; pointer-events: none; }
.ptl-dark { position: absolute; inset: 0; width: 100%; height: 100%; }
.ptl-rig { position: absolute; inset: 0; }
.ptl-truss { position: absolute; left: 0; right: 0; top: 0; height: 12px; background: repeating-linear-gradient(115deg, #2b2230 0 2px, transparent 2px 14px), linear-gradient(#17121b, #17121b 3px, transparent 3px, transparent 9px, #17121b 9px); }
.ptl-truss.corners { -webkit-mask-image: linear-gradient(90deg, #000 0 110px, transparent 170px, transparent calc(100% - 170px), #000 calc(100% - 110px)); mask-image: linear-gradient(90deg, #000 0 110px, transparent 170px, transparent calc(100% - 170px), #000 calc(100% - 110px)); }
.ptl-arm { position: absolute; width: 0; height: 0; transform-origin: 0 0; will-change: transform; }
.ptl-clip { position: absolute; left: -1500px; top: 4px; width: 3000px; height: 3000px; overflow: hidden; }
.ptl-wrap { position: absolute; left: 1500px; top: -4px; width: 0; height: 0; transform-origin: 0 0; will-change: transform, opacity; }
.ptl-cone { position: absolute; -webkit-mask-image: linear-gradient(#000 0%, rgba(0, 0, 0, .75) 55%, rgba(0, 0, 0, .4) 82%, transparent 100%); mask-image: linear-gradient(#000 0%, rgba(0, 0, 0, .75) 55%, rgba(0, 0, 0, .4) 82%, transparent 100%); }
.ptl-cone.hot { opacity: .28; transition: opacity .14s cubic-bezier(0.23, 1, 0.32, 1); }
.ptl-lamp { position: absolute; left: -14px; top: -14px; width: 28px; height: 20px; border-radius: 6px 6px 3px 3px; background: linear-gradient(90deg, #120d15, #30273a 45%, #120d15); }
.ptl-lamp b { position: absolute; left: 1px; right: 1px; bottom: -3px; height: 8px; border-radius: 50%; background: #fff8f2; box-shadow: 0 0 10px 3px rgba(255, 215, 235, .9), 0 0 26px 8px rgba(236, 130, 200, .55); transition: opacity .12s linear; }
.ptl-lamp b.off { opacity: .08; }
body.spotlit .tbl .tcards .selfx { display: none !important; }
body.spotlit .tbl .tcards:has(.plotpick) { outline: 1px dashed var(--card-gold-canceled, #E8AA2C); outline-offset: calc(var(--u) * 4); border-radius: calc(var(--cr) + var(--u) * 4); }
body.spotlit .tbl .tcards:has(.plotpick):has(.slot.selected) { outline: none; }
@media (hover: hover) { body.spotlit .tbl .tcards:has(.plotpick):hover { outline-color: #FCFF2F; } }
/* While picking cards, a tap on a player's panel goes through to the cards under it */
body.cardpick .tbl .thead { pointer-events: none; }

/* My profile: the pencil in the top right corner opens Edit profile */
#app .pedit { all: unset; flex: none; width: 34px; height: 34px; display: grid; place-items: center; color: #fffbf5; cursor: pointer; transition: color .15s ease; }
@media (hover: hover) { #app .pedit:hover { color: #e8aa2c; } }
#app .pedit:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 8px; }

/* ===== The avatar picker (Edit profile, Registration): a tap on the avatar opens it and it stays open. The emoji box shows 3½ rows of 9 and scrolls;
   12 under it, the backgrounds: 24 squares 8 apart, the picked one ringed in #47fff3 ===== */
.ppick { display: flex; flex-direction: column; gap: 12px; margin-top: -8px; }
.ppick .pavatars { display: grid; grid-template-columns: repeat(9, 20px); justify-content: space-between; gap: 8px; height: 104px; max-height: none; padding: 11px 8px; border-radius: 16px; background: #2f2222; overflow-y: auto; animation: none; }
.ppick .pavatars button, .lv .lvreg .ppick .pavatars button { width: 20px; height: 20px; font-size: 18px; line-height: 20px; border-radius: 4px; }
.ppick .pavatars button.on, .lv .lvreg .ppick .pavatars button.on { background: rgba(232, 170, 44, .35); box-shadow: 0 0 0 2px rgba(232, 170, 44, .35); }
.pcolors { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.pcolors > span { font: 400 13px/18px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: rgba(255, 255, 255, .7); }
.pcolrow { display: flex; gap: 8px; }
#app .pcolrow button { all: unset; box-sizing: border-box; flex: none; width: 24px; height: 24px; border-radius: 4px; cursor: pointer; transition: transform .12s cubic-bezier(.23, 1, .32, 1); -webkit-tap-highlight-color: transparent; }
#app .pcolrow button.on { outline: 2px solid #47fff3; outline-offset: 0; }
#app .pcolrow button:active { transform: scale(.92); }
#app .pcolrow button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#app .pcolrow button.on:focus-visible { outline-color: #47fff3; }
/* The paused panels end like Settings: background, sound and social links 20px apart (the column's gap) */
.gpause .pinner > .prows, .gpause .pinner > .psocial { margin-top: 0; }

/* ===== Win song (Apple Music previews): the row on my profile, and "Pick a custom win song" ===== */
.wsong { display: flex; flex-direction: column; gap: 4px; }
.wsongt { margin: 0; font: 400 13px/18px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: rgba(255, 255, 255, .7); }
.wsrow, .wsitem { display: flex; align-items: center; gap: 6px; min-width: 0; }
.wsart { flex: none; width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: rgba(255, 255, 255, .1); }
.wsart.none { display: block; }
/* A profile's song: the song, then (6 below) Play and Change on the left, Apple's badge on the right */
.wsprof { display: flex; flex-direction: column; gap: 6px; }
.wsprof .wsart { border-radius: 6px; }
#app .wstag.wsplaylbl { gap: 4px; }
#app .wstag.wsplaylbl.on { background: #e8aa2c; }
.wswho { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.wswho b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 14px/16px "Trebuchet MS", system-ui, sans-serif; color: #fffbf5; }
.wswho small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 300 12px/16px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: #b1b1b1; }
/* The small dark tags: Change, Add track, Pick, and the 28-square play button (gold while its preview plays) */
#app .wstag { all: unset; box-sizing: border-box; flex: none; height: 28px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; background: #393939; color: #fff; font: 700 10px/12px "Trebuchet MS", system-ui, sans-serif; cursor: pointer; }
#app .wstag.wsplay { width: 28px; padding: 0; }
#app .wstag.wsplay.on { background: #e8aa2c; }
#app .wstag:disabled { opacity: .5; cursor: default; }
@media (hover: hover) { #app .wstag:not(:disabled):not(.on):hover { background: #4a4a4a; } }
.wsbtns { flex: none; display: flex; gap: 4px; }

/* The picker: the line, the search and Hide explicit songs, then the songs (2 apart), which scroll */
.wspick { gap: 16px; }
.wsintro { margin: 0; padding: 0 12px; text-align: center; font: 400 12px/16px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: rgba(255, 255, 255, .7); }
.wsfind { flex: none; display: flex; flex-direction: column; gap: 6px; }
#app .wsexplicit { all: unset; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.wsexplicit i { flex: none; width: 16px; height: 16px; box-sizing: border-box; display: grid; place-items: center; border-radius: 4px; border: .8px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .05); color: #292923; font: 700 10px/1 "Trebuchet MS", system-ui, sans-serif; font-style: normal; }
.wsexplicit.on i { background: #8dc641; border-color: #292923; }
.wsexplicit span { font: 300 11px/15px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: rgba(255, 255, 255, .6); }
.wslist { gap: 2px; }
.wslist .wsitem { flex: none; box-sizing: border-box; min-height: 46px; padding: 2px 4px 2px 2px; border-radius: 8px; outline: 1px solid transparent; outline-offset: -1px; }
.wslist .wsitem .wsart { border-radius: 6px; }
.wslist .wsitem.playing { outline-color: #e8aa2c; }
/* My song, on top: outlined, with play, Change and Apple's badge under it */
.wspicked { flex: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 2px; padding: 4px; border-radius: 8px; outline: 1px solid #47fff3; outline-offset: -1px; }
.wspicked .wsitem { padding: 0; min-height: 0; outline: none; }
.wspbar { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.wsbadge { flex: none; display: block; height: 28px; border-radius: 6px; overflow: hidden; }
.wsbadge img { display: block; width: 107px; height: 28px; }
.wsnote { margin: 8px 0 0; text-align: center; font: 300 12px/16px "Nunito", "Trebuchet MS", system-ui, sans-serif; color: rgba(255, 255, 255, .7); }
.wsnote.err { margin: 0; color: #ff8a8c; }

/* ---- Win screen after a correct FOMO call (winfx.ts; Figma "Winner – FOMO called"). Placed in the 328 x 661 design's units around the screen's middle. ---- */
.winfx { position: fixed; left: 0; top: 0; width: 100vw; z-index: 9000; overflow: hidden; font-family: "Trebuchet MS", system-ui, sans-serif; color: #fff;
  --x: calc(var(--ox) + var(--u) * 164); }
.winfx .wdim { position: absolute; inset: 0; background: rgba(20, 0, 5, .72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.winfx .wstage { position: absolute; left: 0; top: 0; width: 100vw; height: 100vh; }
.winfx .wstage > * { position: absolute; }
.winfx .wglow, .winfx .wrays, .winfx .wshafts, .winfx .wsparks, .winfx .wlabel, .winfx .wwinner, .winfx .wsongp, .winfx .wclose { opacity: 0; }
.winfx .on { opacity: 1; }
.winfx .wclose { left: calc(var(--ox) + var(--u) * 284); top: calc(var(--oy) + var(--u) * 10); width: calc(var(--u) * 34); height: calc(var(--u) * 34); padding: 0; margin: 0; min-width: 0; min-height: 0; border: 0; border-radius: 0; background: none !important; box-shadow: none !important; color: #fff; display: grid; place-items: center; cursor: pointer; z-index: 5; }
.winfx .wclose svg { width: calc(var(--u) * 20); height: calc(var(--u) * 20); }
@media (hover: hover) and (pointer: fine) { .winfx .wclose:hover { color: #ffd43b; } }
.winfx .wclose:active { scale: .92; transition: scale .12s ease-out; }
.winfx .wlabel { left: 0; right: 0; top: calc(var(--oy) + var(--u) * 58); margin: 0; text-align: center; font-weight: 700; font-size: calc(var(--u) * 11); letter-spacing: calc(var(--u) * 2); }
.winfx .wwinner { z-index: 2; left: calc(var(--x) - var(--u) * 56); top: calc(var(--oy) + var(--u) * 114); width: calc(var(--u) * 112); height: calc(var(--u) * 141); }
.winfx .wring { position: absolute; left: 0; top: 0; width: calc(var(--u) * 112); height: calc(var(--u) * 112); border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(#ffe666, #f28c1a); box-shadow: 0 0 calc(var(--u) * 24) calc(var(--u) * 2) rgba(255, 191, 51, .7); }
.winfx .wav { background: #FFF0CF; width: calc(var(--u) * 100); height: calc(var(--u) * 100); border-radius: 50%; display: grid; place-items: center; overflow: hidden; font-size: calc(var(--u) * 74); line-height: 1; }
.winfx .wav img { width: 92%; height: 92%; object-fit: contain; }
.winfx .wcrown { position: absolute; left: calc(var(--u) * 34); top: calc(var(--u) * -30); width: calc(var(--u) * 44); height: calc(var(--u) * 44); rotate: -8deg; transform-origin: 50% 90%; display: grid; place-items: center; font-size: calc(var(--u) * 38); line-height: 1; z-index: 1; filter: drop-shadow(0 calc(var(--u) * 2) calc(var(--u) * 2) rgba(80, 30, 0, .45)); }
.winfx .wcrown img { width: 100%; height: 100%; }
.winfx .wname { position: absolute; left: -100%; width: 300%; top: calc(var(--u) * 99); display: flex; justify-content: center; }
.winfx .wpill { box-sizing: border-box; padding: calc(var(--u) * 8) calc(var(--u) * 16); gap: calc(var(--u) * 2); border-radius: 99px; background: rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(4px) saturate(1.5); backdrop-filter: blur(4px) saturate(1.5);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; white-space: nowrap; }
.winfx .wname b { font-weight: 400; font-size: calc(var(--u) * 14); line-height: 1; }
.winfx .wname small { font-size: calc(var(--u) * 9); line-height: 1; color: #dedede; }
.winfx .wcard { will-change: transform; }
/* A soft warm light behind the winning set (cards 285–376 in the design, so centred at 330) */
.winfx .wsetglow { left: calc(var(--x) - var(--u) * 150); top: calc(var(--oy) + var(--u) * 268); width: calc(var(--u) * 300); height: calc(var(--u) * 125); z-index: 2; opacity: 0; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 226, 120, .7), rgba(255, 190, 70, .3) 60%, rgba(255, 150, 50, 0)); }
/* The light behind the winner: a slowly turning sunburst of wide wedges, a finer one turning the other way, a bright warm core, shafts of light shooting
   out and sparkles. Everything is centred on the avatar and added with "screen", so the layers brighten each other like real light. */
.winfx .wrays, .winfx .wglow, .winfx .wflash, .winfx .wshafts, .winfx .wsparks { left: var(--x); top: calc(var(--oy) + var(--u) * 170); width: 0; height: 0; z-index: 0; }
/* (no blend modes: the fans turn for as long as the screen is up, over a blurred table, so they stay plain composited layers) */
.winfx .wfan, .winfx .wfan2 { position: absolute; border-radius: 50%; will-change: transform; }
/* The finer counter-turning fan is softly out of focus, so it reads as depth behind the wide rays */
.winfx .wfan2 { filter: blur(calc(var(--u) * 2)); }
.winfx .wflash { opacity: 0; }
.winfx .wflash::before { content: ""; position: absolute; left: calc(var(--u) * -120); top: calc(var(--u) * -120); width: calc(var(--u) * 240); height: calc(var(--u) * 240); border-radius: 50%; background: radial-gradient(closest-side, #fff 0, rgba(255, 250, 225, .7) 40%, rgba(255, 240, 190, 0) 100%); }
.winfx .wfan { left: calc(var(--u) * -240); top: calc(var(--u) * -240); width: calc(var(--u) * 480); height: calc(var(--u) * 480);
  -webkit-mask: radial-gradient(closest-side, #000 0, rgba(0, 0, 0, .9) 30%, rgba(0, 0, 0, .4) 65%, transparent 100%); mask: radial-gradient(closest-side, #000 0, rgba(0, 0, 0, .9) 30%, rgba(0, 0, 0, .4) 65%, transparent 100%); }
.winfx .wfan2 { left: calc(var(--u) * -240); top: calc(var(--u) * -240); width: calc(var(--u) * 480); height: calc(var(--u) * 480);
  background: repeating-conic-gradient(from 7deg, rgba(255, 244, 205, .15) 0 3deg, transparent 3deg 14deg);
  -webkit-mask: radial-gradient(closest-side, #000 10%, transparent 100%); mask: radial-gradient(closest-side, #000 10%, transparent 100%); }
.winfx .wglow::before { content: ""; position: absolute; left: calc(var(--u) * -190); top: calc(var(--u) * -190); width: calc(var(--u) * 380); height: calc(var(--u) * 380); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 253, 238, 1) 0, rgba(255, 240, 170, .92) 20%, rgba(255, 200, 90, .55) 42%, rgba(255, 150, 55, .22) 68%, rgba(255, 120, 40, 0) 100%); }
.winfx .wshaft { position: absolute; left: 0; top: 0; width: 0; height: 0; rotate: var(--a); }
/* A streak of light, its bright head leading and its tail fading behind it */
.winfx .wshaft i { position: absolute; left: calc(var(--u) * -1.25); top: 0; width: calc(var(--u) * 2.5); height: calc(var(--u) * var(--l)); border-radius: 99px; opacity: 0;
  background: linear-gradient(rgba(255, 236, 170, 0), rgba(255, 244, 205, .7) 60%, #fffdf2); box-shadow: 0 0 calc(var(--u) * 5) rgba(255, 236, 170, .6); }
.winfx .wspark { position: absolute; left: calc(var(--u) * (var(--sx) - var(--sz) / 2)); top: calc(var(--u) * (var(--sy) - var(--sz) / 2)); width: calc(var(--u) * var(--sz)); height: calc(var(--u) * var(--sz));
  background: #fff; clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); filter: drop-shadow(0 0 calc(var(--u) * 3) #fff6c8); }
/* The win song: centred, with Apple's badge and Mute side by side under it */
.winfx .wsongp { left: calc(var(--ox) + var(--u) * 16); top: calc(var(--oy) + var(--u) * 388); width: calc(var(--u) * 296); display: flex; flex-direction: column; align-items: center; text-align: center; }
.winfx .wsongp p { margin: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.winfx .wnow { font-weight: 700; font-size: calc(var(--u) * 10); line-height: calc(var(--u) * 12); color: #ffd43b; margin-bottom: calc(var(--u) * 5) !important; }
.winfx .wtitle { font-size: calc(var(--u) * 14); line-height: calc(var(--u) * 16); color: #fffbf5; }
.winfx .wartist { font-family: Nunito, "Trebuchet MS", sans-serif; font-weight: 300; font-size: calc(var(--u) * 12); line-height: calc(var(--u) * 16); color: #b1b1b1; }
.winfx .wsbtnrow { display: flex; gap: calc(var(--u) * 8); margin-top: calc(var(--u) * 8); }
.winfx .wbadge img { display: block; width: calc(var(--u) * 107); height: calc(var(--u) * 28); }
.winfx .wmute { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: calc(var(--u) * 72); flex: none; gap: calc(var(--u) * 4); height: calc(var(--u) * 28); min-height: 0; margin: 0; padding: 0 calc(var(--u) * 10); border: 0; border-radius: calc(var(--u) * 6); background: #383838; box-shadow: none; color: #fff; font: 700 calc(var(--u) * 10) "Trebuchet MS", system-ui, sans-serif; cursor: pointer; }
.winfx .wmute svg { width: calc(var(--u) * 11); height: calc(var(--u) * 11); flex: none; }
.winfx .wmute .wx, .winfx .wmute[aria-pressed="true"] .wwave { display: none; }
.winfx .wmute[aria-pressed="true"] .wx { display: inline; }
/* (buttons drop 2px when pressed elsewhere in the game; these stay where they are and only press in a touch) */
.winfx .wmute, .winfx .wmute:hover, .winfx .wmute:active, .winfx .wclose, .winfx .wclose:hover, .winfx .wclose:active { transform: none; box-shadow: none; }
.winfx .wmute:active { scale: .96; transition: scale .12s ease-out; }
.winfx .wconfetti { left: 0; top: 0; width: 100vw; height: 100vh; pointer-events: none; }
.winfx .wconfetti.back { z-index: 1; }
.winfx .wconfetti.front { z-index: 4; }

/* The win screen covers the whole window; the bottom bar (and on a wide screen the chat and the options panel) sit above it */
body.winfx-on.tbl-page .shell { z-index: auto; }
body.winfx-on .tbl .tbar, body.winfx-on .tbl .gdock { z-index: 9001; }

/* In game on a phone, the song picker stays pinned to the top of the screen (the keyboard comes up under it) and only its list of songs scrolls,
   in the part of the screen the keyboard leaves */
@media (max-width: 700px) {
  .gpause:not(.lvinline):has(.wspick) { align-items: flex-start; height: var(--vvh, 100%); padding-bottom: 8px; }
  .gpause:not(.lvinline) .psheet:has(.wspick) { display: flex; flex-direction: column; max-height: 100%; overflow: hidden; }
  .gpause:not(.lvinline) .psheet:has(.wspick) .pinner { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
}

/* ===== Desktop text sizes (701px and up) =====
   The table is drawn on a 1046 x 712 frame that scales with the window (--u), and that is right for cards and panels but wrong for text: it made the chat and the options panel tiny in a short or narrow window and huge on a big screen. Now the text in the panels has a fixed size per role (messages, field and help 14, system lines 12, buttons 14, titles 16 and 18). The panels scale like the table but stop growing at 125% (--pu), so they do not become huge on a big screen. They never get wider than their slot beside my hand (that would cover the cards), so in a narrow window they only get taller where the fixed text needs it. */
@media (min-width: 701px) {
  .tbl { --pu: min(var(--u), 1.25px); }
  .tbl .tbar, .tbl .gdock { --u: var(--pu); }
  .tbl .tbar { left: auto; right: calc(var(--u) * 49); }

  .tbl .gdock.gdock { --k: .875px; }
  .tbl .gdock :is(.lvsys span, .lvmn, .lvprev b, .lvprev span, .lvtyp, .lvr, .lvshow) { font-size: 12px; line-height: 16px; }
  .tbl .gdock .lvb { line-height: 20px; letter-spacing: 0; }
  .tbl .gdock input.gin { font-size: 14px; line-height: 18px; }
  .tbl .gdock .gvoice .gphead small { font-size: 12px; line-height: 16px; }

  .tbl .htitle { font-size: 18px; }
  .tbl .tlead, .tbl .tdesc { font-size: 14px; line-height: 1.4; }
  .tbl .tactions button { font-size: 14px; line-height: 1.2; height: max(calc(var(--u) * 44), 36px); }
  .tbl .gdock { height: max(calc(var(--u) * 220), 190px); }
}

/* ===== The reactions panel as in Figma (section 3951-63685): 8 of padding, the title 14 in a 34 row with its line under it; the tiles 66 high with
   8 of padding and 10 between the name and the play button's row (24), the name 14 bold, the length 10, the play button 24 ===== */
.greact .gpanel { padding: 8px; gap: 12px; }
.greact .gphead, .gdock .gvoice .gphead { gap: 0; padding: 0; min-height: 0; }
.gphead b { font: 700 14px/34px "Trebuchet MS", system-ui, sans-serif; }
.gphead small { font: 500 12px/16px Nunito, "Trebuchet MS", system-ui, sans-serif; color: #e9e8e8; }
.greact .gpclose { top: 8px; right: 8px; }
.gtile { height: 66px; padding: 8px; gap: 10px; border: 0; border-radius: 10px; box-sizing: border-box; justify-content: flex-start; }
.gtile:hover { box-shadow: inset 0 0 0 1.5px #e0605c; }
.gtile b { font: 700 14px/16px "Trebuchet MS", system-ui, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* A locked tile (signed out: the last three sounds): it is seen, but nothing on it can be pressed */
.gtile.locked, .gdock .gtile.locked { opacity: .3; cursor: default; pointer-events: none; }
.gtimes { height: 24px; align-items: flex-end; }
.gtimes small { font: 400 10px/12px "Trebuchet MS", system-ui, sans-serif; color: #77736b; }
.greact .gplay, .gdock .gplay { width: 24px; height: 24px; background: rgba(253, 105, 105, .3); color: #292923; }
.greact .gplay svg, .gdock .gplay svg { width: 10px; height: 10px; }
.greact .gplay.on, .gdock .gplay.on, .greact button.gplay.on:hover { background: #e32026; color: #fff; }

/* ===== Every dialog is the dark panel (Figma 3938-57398): the gradient and the soft inner light, 16 round corners; a gold title in capitals with the X
   beside it, the text at 70% white, then the buttons side by side, 44 high ===== */
.shell:has(.modal)::after { background-color: rgba(0, 0, 0, .44); }
#app > .modal { padding: 8px; box-sizing: border-box; }
#app .modalbox { box-sizing: border-box; width: 100%; max-width: 312px; display: flex; flex-direction: column; gap: 20px; padding: 8px 12px 24px; border: 0; border-radius: 16px; background: linear-gradient(135deg, #191210 0%, #190e0e 50%, #301e1e 100%); box-shadow: inset 0 1px 10px 1px rgba(177, 177, 177, .1); color: #fff; text-align: left; animation: modalin .22s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes modalin { from { opacity: 0; transform: translateY(8px) scale(.98); } }
#app .modalbox.still { animation: none; }
@media (prefers-reduced-motion: reduce) { #app .modalbox { animation: none; } }
#app .modalbox .mhead { display: flex; align-items: center; height: 34px; padding-left: 34px; }
#app .modalbox h2 { flex: 1; margin: 0; font: 700 16px/19px "Trebuchet MS", system-ui, sans-serif; letter-spacing: 0; text-align: center; text-transform: uppercase; color: #e8aa2c; text-shadow: 0 0 3px rgba(255, 207, 0, .4); }
#app .modalbox .mx { all: unset; box-sizing: border-box; flex: none; width: 34px; height: 34px; display: grid; place-items: center; color: #e5e5e5; cursor: pointer; transition: color .15s ease; }
#app .modalbox .mx svg { width: 20px; height: 20px; }
@media (hover: hover) { #app .modalbox .mx:hover { color: #e8aa2c; } }
#app .modalbox .mx:focus-visible, #app .modalbox .mbtn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#app .modalbox p { margin: 0; font: 400 14px/19px Nunito, "Trebuchet MS", system-ui, sans-serif; color: rgba(255, 255, 255, .7); }
#app .modalbox .mbtns { display: flex; gap: 8px; }
#app .modalbox .mbtn { all: unset; box-sizing: border-box; flex: 1; min-width: 0; height: 44px; display: flex; align-items: center; justify-content: center; padding: 0 14px; border-radius: 16px; font: 700 16px/19px "Trebuchet MS", system-ui, sans-serif; letter-spacing: .045em; white-space: nowrap; cursor: pointer; transition: transform .12s ease; }
#app .modalbox .mbtn:active { transform: translateY(1px); }
#app .modalbox .mbtn.danger { background: #cc393c; color: #fff; border: 1.5px solid #292923; box-shadow: none; }
#app .modalbox .mbtn.line { color: #fffbf5; border: 1.5px solid #e8e1d7; }
