/* Party mode - aplexotools.com/party (phones) and aplexotools.com/tv (the TV). One stylesheet for both: <html data-screen>
   says which. The look: a dark living room, goofy characters that bob and blink, a felt table on the TV with the players
   around it, and on a phone the hand as the hero along the bottom edge. Motion: every page opens with full effects
   (html.motion-full); Calm (html.motion-reduced) is the visitor's own choice (the switch at the bottom of the phone page, or
   the front page's setting): then nothing bobs, flies or pulses, and a stamp just appears. The game renderers
   (games/<id>.js) use the .vt-* / .lc-* / .pu-* parts at the bottom and the shared .board / .seat / .felt parts. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/inter-latin.woff2') format('woff2'); }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 600 700; font-display: swap; src: url('/fonts/sora-latin.woff2') format('woff2'); }

:root {
  color-scheme: dark;
  --bg: #0b0a12; --surface: #15131f; --surface-2: #1d1a2b; --line: rgba(255,255,255,.09); --line-2: rgba(255,255,255,.16);
  --text: #f3f1f9; --muted: #aaa6bb; --dim: #747086;
  --accent: #b23ef0; --accent-2: #e268a8; --gold: #f2d27a; --gold-2: #ffb347; --teal: #2dd4bf; --red: #f43f5e; --green: #34c46a; --sky: #7ee0ff;
  --card: #fbf8f1; --card-ink: #1a1620; --card-red: #d8243f;
  --display: Sora, Inter, system-ui, sans-serif; --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 16px; --gap: 12px;
  --ease: cubic-bezier(.2,.7,.2,1); --bounce: cubic-bezier(.34,1.56,.64,1);
  --play: running;
}
html.motion-reduced { --play: paused; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--text); font: 16px/1.5 var(--font); background: var(--bg); -webkit-tap-highlight-color: transparent; overflow-x: hidden; position: relative; }
/* the room: a warm glow top-left, a cool one bottom-right, and a few soft lights that drift (Full only) */
body::before { content: ''; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 600px at 12% -5%, rgba(178,62,240,.22), transparent 60%), radial-gradient(800px 500px at 100% 100%, rgba(45,212,191,.12), transparent 60%), radial-gradient(500px 400px at 70% 20%, rgba(242,210,122,.07), transparent 60%);
  animation: room-drift 26s ease-in-out infinite alternate var(--play); }
@keyframes room-drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-3%, 2%) scale(1.06); } }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .4em; }
a { color: var(--gold); }
.ic { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.15em; }

/* ---- buttons, fields ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 46px; padding: 10px 18px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; font-weight: 600; touch-action: manipulation; transition: transform .15s var(--bounce), border-color .15s, box-shadow .15s; }
.btn:hover { border-color: rgba(255,255,255,.3); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px -6px rgba(226,104,168,.6); }
.btn.gold { background: linear-gradient(135deg, #ffd978, #f0a93a); color: #241c05; border-color: transparent; }
.btn.danger { border-color: rgba(244,63,94,.5); color: #ffd0d8; }
.btn.small { min-height: 34px; padding: 4px 10px; font-size: .88em; border-radius: 10px; }
.btn.big { min-height: 56px; font-size: 1.1em; padding: 12px 24px; font-family: var(--display); }
.btn.wide { width: 100%; }
.field { display: grid; gap: 6px; margin: 0 0 14px; }
.field > span { color: var(--muted); font-size: .9em; }
input[type=text], select { width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: #0f0e17; }
input[type=text]:focus, select:focus, .btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.code-input { font-family: var(--display); font-size: 1.8em; letter-spacing: .3em; text-align: center; text-transform: uppercase; }
.err { color: #ff9fb0; min-height: 1.5em; margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: .88em; }

/* ---- page frame (the header is header.top: a bare .top would also catch the board's .seats.top) ---- */
header.top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: rgba(11,10,18,.7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
header.top .brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 700; }
header.top .brand img { width: 28px; height: 28px; }
header.top .crumb { color: var(--muted); }
header.top .chip { margin-left: auto; font-family: var(--display); letter-spacing: .12em; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--gold); }
header.top .lang-btn { margin-left: auto; flex: none; }
header.top .brand span, header.top .crumb { white-space: nowrap; }
@media (max-width: 430px) { header.top .crumb { display: none; } }
header.top .chip:not([hidden]) + .lang-btn { margin-left: 0; }
/* the phone's Sound button (between the code and the language) and its panel under the header: one tap away in a game */
header.top .snd-btn { margin-left: auto; flex: none; gap: 5px; padding: 4px 10px 4px 7px; }
header.top .chip:not([hidden]) + .snd-btn, header.top .snd-btn + .lang-btn { margin-left: 0; }
.snd-ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.snd-ico .spk { fill: currentColor; stroke-width: 1.2; }
.snd-ico .x, .snd-btn.off .snd-ico .w { display: none; }
.snd-btn.off .snd-ico .x { display: inline; }
.snd-btn.off { color: var(--muted); }
.snd-btn[aria-expanded=true] { border-color: var(--gold); color: var(--gold); background: rgba(242,210,122,.1); }
@media (max-width: 430px) { html[data-screen=phone] header.top .brand span { display: none; } }
@media (max-width: 330px) { header.top .snd-word { display: none; } }
.snd-panel { position: fixed; z-index: 45; top: 60px; right: max(12px, env(safe-area-inset-right, 0px)); width: min(380px, calc(100vw - 24px)); max-height: calc(100dvh - 76px); overflow: auto; overscroll-behavior: contain;
  display: grid; gap: 10px; padding: 12px 14px 14px; border-radius: 20px; background: linear-gradient(180deg, #221d33, #17141f); border: 1px solid var(--line-2); box-shadow: 0 1.4em 3.4em rgba(0,0,0,.65), 0 0 0 1px rgba(0,0,0,.4); transform-origin: calc(100% - 60px) 0; animation: snd-in .28s var(--bounce) both; }
@keyframes snd-in { from { opacity: 0; transform: translateY(-8px) scale(.96); } }
.snd-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.snd-head h2 { margin: 0; font-size: 1.05em; }
.snd-x { flex: none; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); cursor: pointer; touch-action: manipulation; }
.snd-panel .set-row { padding: 10px 12px; }
.snd-panel .set-row.is-off { cursor: default; }
.snd-panel .set-row.is-off .switch { opacity: .45; cursor: default; }
.snd-panel .set-row.is-off .set-cur { color: var(--muted); }
.snd-game { display: grid; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line); }
.snd-eyebrow { margin: 4px 2px 0; font-size: .72em; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.snd-panel .snd-voice { grid-template-columns: auto minmax(0, 1fr); }
.snd-pick { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.snd-pick select { min-height: 42px; padding: 6px 10px; }
.snd-pick .btn.small { min-height: 42px; }
.snd-note { margin: 0 2px; line-height: 1.35; }
html.motion-reduced .snd-panel { animation: none; }
.conn { position: fixed; left: 50%; top: 10px; transform: translateX(-50%); z-index: 50; background: #3a1622; border: 1px solid rgba(244,63,94,.5); padding: 6px 14px; border-radius: 999px; font-size: .9em; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: #241f33; border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 12px; max-width: min(92vw, 520px); text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: toast-in .35s var(--bounce) both; pointer-events: none; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px) scale(.94); } }
/* on a phone the toast sits under the header, clear of the Start bar and the hand along the bottom edge (and it never catches a tap) */
html[data-screen=phone] .toast { bottom: auto; top: calc(66px + env(safe-area-inset-top, 0px)); animation-name: toast-down; }
@keyframes toast-down { from { opacity: 0; transform: translate(-50%, -12px) scale(.94); } }
.notice.out, .tv-notice.out { opacity: 0; transition: opacity .6s; }
.tv-notice { transition: opacity .6s; }
main { padding: 16px; max-width: 760px; margin: 0 auto; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 14px; }
.panel h2 { font-size: 1.15em; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.notice { background: rgba(242,210,122,.09); border: 1px solid rgba(242,210,122,.3); padding: 8px 12px; border-radius: 10px; margin: 0 0 12px; animation: rise .4s var(--ease) both; transition: opacity .6s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(18px) scale(.92); } 60% { transform: translateY(-4px) scale(1.02); } to { opacity: 1; transform: none; } }
details > summary { cursor: pointer; list-style: none; font-weight: 600; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: '▸'; display: inline-block; width: 1.1em; color: var(--muted); transition: transform .2s; }
details[open] > summary::before { transform: rotate(90deg); }

/* ---- characters: the cast rig from Fill the Blank, bobbing and blinking in Full, with moods set on the element around them ---- */
.ch { width: 100%; height: 100%; display: block; overflow: visible; }
.avatar { display: inline-block; width: 52px; height: 54px; flex: none; vertical-align: middle; }
.avatar.mini { width: 34px; height: 36px; }
.ch .c-head { transform-box: fill-box; transform-origin: 50% 92%; animation: bob 3.4s ease-in-out infinite var(--play); animation-delay: calc(var(--i, 0) * -.7s); }
.ch .c-eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.8s linear infinite var(--play); animation-delay: calc(var(--i, 0) * -1.1s); }
.ch .c-arm { transform-box: fill-box; transform-origin: 50% 0; transition: transform .35s var(--bounce); }
.ch .c-brow { transform-box: fill-box; transform-origin: center; transition: transform .25s var(--ease); }
.ch .c-pupil { transition: transform .25s var(--ease); }
.ch .flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 1.3s ease-in-out infinite var(--play); }
.ch .c-shut, .ch .m-grin, .ch .m-open, .ch .m-tongue, .ch .m-flat, .ch .m-o, .ch .m-frown, .ch .c-fx > g { display: none; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-1.5px) rotate(1.2deg); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.08); } }
@keyframes flicker { 0%, 100% { transform: scaleY(1) scaleX(1); } 50% { transform: scaleY(1.07) scaleX(.96); } }
[data-mood=away] .ch { filter: grayscale(1) opacity(.55); } [data-mood=away] .c-eyes { display: none; } [data-mood=away] .c-shut, [data-mood=away] .fx-zzz { display: block; }
[data-mood=away] .c-head { animation: none; transform: rotate(6deg); }
[data-mood=away] .fx-zzz text { transform-box: fill-box; transform-origin: center; animation: float 2.2s ease-in-out infinite var(--play); } [data-mood=away] .fx-zzz text:nth-child(2) { animation-delay: -.7s; } [data-mood=away] .fx-zzz text:nth-child(3) { animation-delay: -1.4s; }
@keyframes float { 0%, 100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(-3px); opacity: .7; } }
[data-mood=turn] .m-smile { display: none; } [data-mood=turn] .m-grin { display: block; }
[data-mood=turn] .c-head { animation: cheer .7s ease-in-out infinite var(--play); }
[data-mood=turn] .c-arm.r { transform: translate(3px, -22px) rotate(25deg); }
[data-mood=win] .m-smile { display: none; } [data-mood=win] .m-open, [data-mood=win] .m-tongue, [data-mood=win] .fx-spark { display: block; }
[data-mood=win] .c-arm.l { transform: translate(-4px, -30px) rotate(-20deg); } [data-mood=win] .c-arm.r { transform: translate(4px, -30px) rotate(20deg); }
[data-mood=win] .c-head { animation: cheer .7s ease-in-out infinite var(--play); }
[data-mood=win] .fx-spark path { transform-box: fill-box; transform-origin: center; animation: twinkle 1.2s ease-in-out infinite var(--play); }
[data-mood=win] .fx-spark .s2 { animation-delay: -.4s; } [data-mood=win] .fx-spark .s3 { animation-delay: -.8s; }
@keyframes cheer { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes twinkle { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.4) rotate(40deg); opacity: .5; } }
[data-mood=sad] .m-smile { display: none; } [data-mood=sad] .m-frown, [data-mood=sad] .fx-sweat { display: block; }
[data-mood=sad] .c-brow.l { transform: rotate(14deg) translateY(1px); } [data-mood=sad] .c-brow.r { transform: rotate(-14deg) translateY(1px); }
[data-mood=sad] .c-head { animation: sulk 2.4s ease-in-out infinite var(--play); }
@keyframes sulk { 0%, 100% { transform: rotate(-4deg) translateY(1px); } 50% { transform: rotate(4deg) translateY(2px); } }
[data-mood=think] .m-smile { display: none; } [data-mood=think] .m-flat, [data-mood=think] .fx-dots { display: block; }
[data-mood=think] .c-brow.l { transform: translateY(-2px) rotate(-10deg); } [data-mood=think] .c-pupil { transform: translate(1.2px, -1.6px); }
[data-mood=think] .fx-dots { animation: float 2.4s ease-in-out infinite var(--play); transform-box: fill-box; transform-origin: center; }
[data-mood=shock] .m-smile { display: none; } [data-mood=shock] .m-o { display: block; } [data-mood=shock] .c-eyes { transform: scale(1.25); } [data-mood=shock] .c-brow { transform: translateY(-3px); }
.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.cast-grid label { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface-2); cursor: pointer; font-size: .82em; text-align: center; transition: transform .2s var(--bounce), border-color .2s; animation: pop-in .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.cast-grid label:nth-child(2) { --i: 1; } .cast-grid label:nth-child(3) { --i: 2; } .cast-grid label:nth-child(4) { --i: 3; } .cast-grid label:nth-child(5) { --i: 4; } .cast-grid label:nth-child(6) { --i: 5; } .cast-grid label:nth-child(7) { --i: 6; } .cast-grid label:nth-child(8) { --i: 7; } .cast-grid label:nth-child(9) { --i: 8; } .cast-grid label:nth-child(10) { --i: 9; } .cast-grid label:nth-child(11) { --i: 10; } .cast-grid label:nth-child(12) { --i: 11; } .cast-grid label:nth-child(13) { --i: 12; }
.cast-grid label .avatar { width: 60px; height: 62px; }
.cast-grid input { position: absolute; opacity: 0; pointer-events: none; }
.cast-grid input:checked + .avatar { filter: drop-shadow(0 0 6px var(--gold)); }
.cast-grid label:has(input:checked) { border-color: var(--gold); background: rgba(242,210,122,.08); transform: scale(1.04); }
.cast-grid label:has(input:checked) .c-head { animation: cheer .7s ease-in-out infinite var(--play); }
.cast-grid label.taken { opacity: .35; cursor: not-allowed; }

/* ---- the players ---- */
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.person { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.person.away { opacity: .5; }
.person .who { flex: 1; min-width: 0; }
.person .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .tags { color: var(--muted); font-size: .82em; }
.crown { color: var(--gold); }
.tag { display: inline-block; padding: 0 7px; border-radius: 999px; background: rgba(255,255,255,.08); font-size: .78em; margin-left: 4px; white-space: nowrap; }
.person .acts { display: flex; gap: 6px; }

/* ---- the door and the way in: a big way back for a phone that was at a party, the character picked beside the name,
        the Join button along the bottom edge while the characters scroll under it ---- */
#backBtn { margin: 0 0 14px; }
.join-you { display: flex; gap: 14px; align-items: center; margin: 0 0 12px; }
.join-pick { display: grid; justify-items: center; gap: 0; flex: none; min-width: 88px; text-align: center; }
.join-pick .avatar.big { width: 84px; height: 88px; filter: drop-shadow(0 0 8px rgba(242,210,122,.4)); }
.join-you .field { flex: 1; margin: 0; min-width: 0; }
.cast-field { border: 0; padding: 0; margin: 0 0 8px; }
.cast-field legend { margin-bottom: 6px; }
#joinView .cast-grid { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 6px; }
#joinView .cast-grid label { padding: 6px 2px; font-size: .76em; }
#joinView .cast-grid label .avatar { width: 50px; height: 52px; }
.join-go { position: sticky; bottom: 0; z-index: 3; padding: 12px 0 calc(6px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, rgba(21,19,31,0), var(--surface) 40%); }

/* ---- who is here: a row of characters with the crown; the leader adds a bot from its end ---- */
.people-panel { padding: 12px 14px 10px; }
.people-head { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.people-head h2 { margin: 0; font-size: 1.05em; }
.people-head .count { flex: 1; }
.people-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 4px; }
.pchip { position: relative; flex: 1 0 70px; max-width: 92px; display: grid; justify-items: center; gap: 1px; padding: 8px 4px 6px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); text-align: center; animation: pop-in .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
.pchip .avatar { width: 46px; height: 48px; }
.pchip b { font-size: .8em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.pchip .ptag { font-size: .7em; line-height: 1.2; min-height: 1.2em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip .crown { position: absolute; top: -7px; right: 3px; font-size: 1em; animation: crown-tilt 3s ease-in-out infinite var(--play); }
.pchip.me { border-color: rgba(242,210,122,.5); background: rgba(242,210,122,.06); }
.pchip.away { opacity: .5; }
.pchip.add { border-style: dashed; border-color: var(--line-2); background: transparent; color: var(--muted); cursor: pointer; font: inherit; transition: border-color .2s, transform .15s var(--bounce); }
.pchip.add:active { transform: scale(.95); }
.pchip.add .plus { display: grid; place-items: center; width: 46px; height: 48px; font-size: 1.9em; line-height: 1; color: var(--gold); }
.pchip.add b { font-size: .72em; white-space: normal; line-height: 1.15; }
.invite-line { margin: 4px 0 0; }
.manage { margin-top: 6px; }
.manage > summary { color: var(--muted); font-size: .9em; padding: 4px 0; }
.manage[open] > summary { margin-bottom: 8px; }

/* ---- the leader's game picker: a tile per game with its art, whether it fits the people here, and one line on how it plays ---- */
.lobby-h { font-size: 1.15em; margin: 6px 0 10px; }
.tiles { display: grid; gap: 10px; margin: 0 0 14px; }
.tile { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 0 12px; align-items: center; text-align: left; padding: 10px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); color: inherit; font: inherit; cursor: pointer; transition: transform .2s var(--bounce), border-color .2s, box-shadow .2s, background .2s; animation: pop-in .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.tile:active { transform: scale(.98); }
.tile.on { border-color: var(--gold); background: linear-gradient(180deg, rgba(242,210,122,.1), rgba(242,210,122,.03)); box-shadow: 0 0 0 .2em rgba(242,210,122,.16), 0 .6em 1.6em rgba(0,0,0,.35); }
.tile.on::after { content: '✓'; position: absolute; top: -.6em; right: .8em; width: 1.6em; height: 1.6em; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #241c05; font-weight: 700; font-size: .9em; box-shadow: 0 .2em .5em rgba(0,0,0,.4); }
.tiles .rules.under { margin: -4px 0 8px 12px; border-left: 3px solid rgba(242,210,122,.45); border-radius: 0 16px 16px 0; }
.tile-body { display: grid; gap: 2px; min-width: 0; }
.tile-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tile-name { font-family: var(--display); font-size: 1.12em; }
.tile-players { color: var(--muted); font-size: .82em; }
.tile-about { margin: 2px 0 0; color: var(--muted); font-size: .86em; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fit { display: inline-block; padding: .1em .6em; border-radius: 999px; font-size: .74em; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.fit.fits { background: rgba(52,196,106,.16); color: #8ff0b0; border: 1px solid rgba(52,196,106,.4); }
.fit.needs { background: rgba(242,210,122,.14); color: var(--gold); border: 1px solid rgba(242,210,122,.4); }
.fit.over { background: rgba(244,63,94,.14); color: #ffb1c0; border: 1px solid rgba(244,63,94,.4); }
/* a game's art: a small scene in its own colours, from its renderer; a game without one gets a fan of cards in its hue */
.g-art { position: relative; width: 96px; aspect-ratio: 3 / 2; border-radius: 12px; overflow: hidden; background: var(--tone, var(--surface-2)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 .3em .8em rgba(0,0,0,.35); flex: none; }
.g-art svg { display: block; width: 100%; height: 100%; }
.g-art.big { width: 132px; border-radius: 16px; }
.g-art.fallback { background: linear-gradient(135deg, var(--tone), color-mix(in srgb, var(--tone) 55%, #000)); }
.g-art.fallback i { position: absolute; left: 50%; top: 56%; width: 30%; height: 56%; border-radius: 8%; background: #fbf8f1; box-shadow: 0 2px 6px rgba(0,0,0,.4); transform-origin: 50% 110%; transform: translate(-50%, -50%) rotate(calc(-18deg + var(--k) * 18deg)); }
.g-art.fallback i:nth-child(1) { --k: 0; } .g-art.fallback i:nth-child(2) { --k: 1; } .g-art.fallback i:nth-child(3) { --k: 2; }
.g-art.fallback b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 1.5em; color: var(--tone); filter: brightness(.65) saturate(1.3); padding-top: 10%; }

/* ---- the picked game's rules: switches, segmented rows and selects; the rest under a fold ---- */
.rules h2 { font-size: 1.05em; margin-bottom: 8px; }
.settings { display: grid; gap: 6px; margin: 0; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.set-row:has(.seg) { grid-template-columns: minmax(0, 1fr); }
.set-words { display: grid; gap: 1px; min-width: 0; }
.set-words .small { line-height: 1.35; }
.set-cur { font-size: .86em; font-weight: 600; color: var(--muted); }
.set-cur.on { color: var(--gold); }
.switch-row { cursor: pointer; user-select: none; }
.switch { position: relative; width: 50px; height: 30px; border-radius: 999px; border: 0; padding: 0; background: #2a2740; box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; transition: background .2s; flex: none; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #d9d6e6; transition: transform .2s var(--bounce), background .2s; box-shadow: 0 2px 4px rgba(0,0,0,.4); }
.switch.on { background: linear-gradient(135deg, #ffd978, #f0a93a); box-shadow: 0 .2em .6em rgba(242,184,74,.35); }
.switch.on i { transform: translateX(20px); background: #241c05; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0,0,0,.3); border: 1px solid var(--line); }
.seg-btn { min-height: 40px; padding: 6px 8px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: .86em; line-height: 1.2; cursor: pointer; transition: background .2s, color .2s; }
.seg-btn.on { color: #241c05; background: linear-gradient(135deg, #ffe08a, #f2b84a); box-shadow: 0 .2em .6em rgba(242,184,74,.3); }
.seg.tight .seg-btn { font-size: .8em; padding: 6px 4px; }
.more-rules { margin-top: 8px; }
.more-rules > summary { color: var(--muted); font-size: .92em; padding: 6px 0; }
.more-rules[open] > summary { margin-bottom: 8px; }
.p-foot .set-row { margin-bottom: 10px; }
/* a multi-pick: its words, then a fold of chips to tick (or the game's own control in its place), across the whole row */
.set-row.many-row { grid-template-columns: minmax(0, 1fr); grid-column: 1 / -1; }
.many-fold > summary { color: var(--gold); font-weight: 600; font-size: .92em; padding: 4px 0; cursor: pointer; }
.many-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.many-chip { min-height: 38px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(0,0,0,.25); color: var(--muted); font-weight: 600; font-size: .86em; line-height: 1.2; cursor: pointer; touch-action: manipulation; transition: background .2s, color .2s; }
.many-chip.on { color: #241c05; background: linear-gradient(135deg, #ffe08a, #f2b84a); border-color: transparent; }

/* ---- the leader's Start bar: the hero of the lobby, along the bottom edge ---- */
.p-start { position: sticky; bottom: 0; z-index: 6; margin: auto -16px 0; padding: 14px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, rgba(11,10,18,0), rgba(11,10,18,.94) 35%); }
.start-bar { display: flex; gap: 10px; align-items: center; }
.start-btn { position: relative; flex-direction: column; gap: 0; min-height: 66px; padding: 10px 20px 10px 48px; border-radius: 18px; line-height: 1.15; box-shadow: 0 .8em 2em -0.6em rgba(242,184,74,.9), inset 0 0 0 1px rgba(255,255,255,.15); animation: start-glow 2.2s ease-in-out infinite var(--play); }
.start-btn .play { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 1.1em; }
.start-btn .start-n { font: 500 .72em/1.2 var(--font); opacity: .8; }
@keyframes start-glow { 50% { box-shadow: 0 .8em 2.6em -0.3em rgba(242,184,74,1), inset 0 0 0 1px rgba(255,255,255,.15); } }
.start-bar.cannot { padding: 10px 10px 10px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 .6em 1.6em rgba(0,0,0,.4); }
.start-why { flex: 1; min-width: 0; display: grid; gap: 1px; }
.start-why b { font-family: var(--display); }
.start-bar.cannot .btn { flex: none; }

/* ---- everyone else's lobby: what the leader picked, how it plays, and who is being waited on ---- */
.eyebrow { color: var(--muted); letter-spacing: .14em; text-transform: uppercase; font-size: .78em; margin: 0 0 6px; font-weight: 600; }
.next-up { position: relative; overflow: hidden; }
.next-up::before { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--tone, var(--accent)) 38%, transparent), transparent 60%); pointer-events: none; }
.next-up > * { position: relative; }
.next-head { display: flex; gap: 14px; align-items: center; margin: 0 0 10px; }
.next-words { display: grid; gap: 2px; min-width: 0; }
.next-words h2 { margin: 0; font-size: 1.5em; }
.how-h { margin: 8px 0 4px; font-weight: 600; font-size: .9em; color: var(--muted); }
.how { margin: 0; padding: 0 0 0 1.6em; display: grid; gap: 4px; counter-reset: how; list-style: none; }
.how li { position: relative; line-height: 1.4; }
.how li::before { counter-increment: how; content: counter(how); position: absolute; left: -1.6em; top: .15em; width: 1.2em; height: 1.2em; border-radius: 50%; display: grid; place-items: center; background: rgba(242,210,122,.16); color: var(--gold); font: 700 .78em/1 var(--display); border: 1px solid rgba(242,210,122,.4); }
.rules-line { margin: 10px 0 0; }
.waiting { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-weight: 600; }
.waiting .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 rgba(242,210,122,.6); animation: wait-pulse 1.6s ease-out infinite var(--play); flex: none; }
@keyframes wait-pulse { 70% { box-shadow: 0 0 0 9px rgba(242,210,122,0); } 100% { box-shadow: 0 0 0 0 rgba(242,210,122,0); } }
/* the last result, folded under one line with the first three; my own name and character, under one line with my character */
.last-result > summary, .p-mine > summary { display: flex; align-items: center; gap: 8px; }
.last-result > summary::before, .p-mine > summary::before { flex: none; }
.last-result[open] > summary, .p-mine[open] > summary { margin-bottom: 10px; }
.last-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; flex: 1; }
.last-strip .top3 { display: inline-flex; gap: 5px; margin-left: auto; }
.mini-who { display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px 1px 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; }
.mini-who.loser { border-color: rgba(244,63,94,.5); }
.mine-sum { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.mine-sum .avatar.mini { width: 30px; height: 31px; }
.cast-grid label.on { border-color: var(--gold); background: rgba(242,210,122,.08); }

/* ---- the result: a podium with the first three on their blocks, the rest in a list ---- */
.result h2 { font-size: 1.15em; }
.podium3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; margin: 8px 0 0; padding: 0 4px; }
.podium3.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 22em; margin-inline: auto; }
.podium3.n1 { grid-template-columns: minmax(0, 1fr); max-width: 12em; margin-inline: auto; }
.step { display: grid; justify-items: center; gap: 2px; text-align: center; min-width: 0; animation: pop-in .6s var(--bounce) both; animation-delay: calc(.1s + var(--i, 0) * .15s); }
.step .avatar { width: 56px; height: 58px; }
.step.p1 .avatar { width: 74px; height: 76px; }
.step .nm { font-size: .92em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step .lbl { font-size: .74em; min-height: 1.3em; line-height: 1.3; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step .block { width: 100%; display: grid; place-items: center; margin-top: 4px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, #2a2740, #1d1a2b); border: 1px solid var(--line-2); box-shadow: inset 0 3px 0 rgba(255,255,255,.06); height: 3.2em; }
.step.p1 .block { height: 5.2em; background: linear-gradient(180deg, #5a4716, #3a2d0c); border-color: rgba(242,210,122,.6); box-shadow: inset 0 3px 0 rgba(255,255,255,.12), 0 0 1.6em rgba(242,210,122,.25); }
.step.p3 .block { height: 2.4em; }
.step .place { font-family: var(--display); font-weight: 700; font-size: 1.3em; color: var(--gold); }
.step.p1 .place { font-size: 1.9em; }
.step.loser .block { border-color: rgba(244,63,94,.6); background: linear-gradient(180deg, #4a1a26, #2a1018); }
.step.loser .nm { color: #ffb1c0; }
.podium { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.podium li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); animation: pop-in .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 120ms); }
.podium li.loser { border-color: rgba(244,63,94,.6); background: rgba(244,63,94,.08); }
.podium .place { font-family: var(--display); font-weight: 700; min-width: 2.2em; text-align: center; color: var(--gold); }
.podium .who { display: grid; min-width: 0; line-height: 1.25; }
.podium .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium li.loser .who b { color: #ffb1c0; }
.over-panel { text-align: center; }
.over-h { font-size: 1.7em; margin: 2px 0 2px; }
.over-h.won { color: var(--gold); } .over-h.sad { color: #ffb1c0; }
.over-panel .result h2 { font-size: .95em; color: var(--muted); font-weight: 600; }
.over-panel .podium { text-align: left; }
.over-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
/* on a phone the leader's two ways on stay at the foot of the screen while the result is looked at */
html[data-screen=phone] .over-panel .over-acts { position: sticky; bottom: 0; z-index: 6; margin: 12px -16px -16px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); border-radius: 0 0 var(--radius) var(--radius); background: linear-gradient(180deg, rgba(21,19,31,0), var(--surface) 22%); }
@media (orientation: landscape) and (max-height: 520px) {   /* sideways: smaller blocks, the rest of the list beside them, nothing to scroll for */
  html[data-screen=phone] .over-panel { padding-top: 10px; }
  html[data-screen=phone] .over-h { font-size: 1.3em; }
  html[data-screen=phone] .over-panel .result { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); column-gap: 16px; align-items: end; }
  html[data-screen=phone] .over-panel .result > h2 { grid-column: 1 / -1; margin: 0; }
  html[data-screen=phone] .over-panel .result > .podium3 { grid-column: 1; margin-top: 4px; }
  html[data-screen=phone] .over-panel .result > .podium3:last-child { grid-column: 1 / -1; }
  html[data-screen=phone] .over-panel .result > .podium { grid-column: 2; grid-template-columns: minmax(0, 1fr); align-self: end; margin: 0; }
  html[data-screen=phone] .over-panel .podium li { padding: 4px 8px; }
  html[data-screen=phone] .over-panel .step .avatar { width: 42px; height: 44px; }
  html[data-screen=phone] .over-panel .step.p1 .avatar { width: 54px; height: 56px; }
  html[data-screen=phone] .over-panel .step .block { height: 2.1em; } html[data-screen=phone] .over-panel .step.p1 .block { height: 3.1em; } html[data-screen=phone] .over-panel .step.p3 .block { height: 1.6em; }
  html[data-screen=phone] .over-panel .step .place { font-size: 1.1em; } html[data-screen=phone] .over-panel .step.p1 .place { font-size: 1.5em; }
  html[data-screen=phone] .over-panel .over-acts { margin-top: 8px; padding-block: 8px calc(10px + env(safe-area-inset-bottom, 0px)); }
}

/* ═════════════ the phone at a party: a column, the hand last and glued to the bottom edge ═════════════ */
html[data-screen=phone] #partyView { display: flex; flex-direction: column; min-height: calc(100dvh - 58px); }
html[data-screen=phone] body[data-phase=playing] main, html[data-screen=phone] body[data-phase=paused] main { padding-bottom: 0; }
.p-notice:empty, .p-paused:empty, .p-status:empty, .p-over:empty, .p-lobby:empty, .p-leader:empty { display: none; }
.p-more { padding: 8px 12px; margin: 0 0 10px; }
.p-more > summary { color: var(--muted); font-size: .92em; }
.p-more[open] > summary { margin-bottom: 10px; }
.p-more .p-leader { margin-bottom: 10px; }
.p-qr { margin: 0 0 10px; }
.game-table { margin: 0 0 12px; }
.leader-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; }
.paused-banner { text-align: center; font-family: var(--display); font-size: 1.3em; padding: 10px; border-radius: 12px; background: rgba(242,210,122,.12); border: 1px solid rgba(242,210,122,.35); margin: 0 0 12px; }
/* the hero: the hand. Sticky at the bottom, big rounded top, the whole thing lights up on your turn (and bounces once on the change) */
.p-hand { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; margin-top: auto; position: sticky; bottom: 0; z-index: 5; margin-left: -16px; margin-right: -16px; padding: 0 0 env(safe-area-inset-bottom, 0px); border-radius: 26px 26px 0 0; transition: box-shadow .4s; }
/* the panel is as tall as its content (no empty room between the table strip and the cards) and leaves the fold above it in view */
.p-hand > .panel { flex: none; margin: 0; border-radius: 26px 26px 0 0; border: 2px solid var(--line-2); border-bottom: 0; background: linear-gradient(180deg, #1c1929, #121020 60%); box-shadow: 0 -14px 40px rgba(0,0,0,.55); padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px)); max-height: calc(100dvh - 112px); overflow: auto; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; }
.p-hand > .panel > .strip { margin-bottom: 0; }
[data-table=here] .p-hand { position: static; flex: none; margin-top: 0; }
[data-table=here] .p-hand > .panel { max-height: none; flex: none; border-radius: 22px; border-bottom: 2px solid var(--line-2); margin-bottom: 12px; }
[data-table=here][data-turn=me] .p-hand > .panel { border-color: var(--gold); }
[data-turn=me] .p-hand { animation: hand-bounce .7s var(--bounce); }
[data-turn=me] .p-hand > .panel { border-color: var(--gold); box-shadow: 0 -14px 48px rgba(242,210,122,.28), 0 0 0 1px rgba(242,210,122,.4) inset; }
@keyframes hand-bounce { 0% { transform: translateY(0); } 35% { transform: translateY(-14px); } 60% { transform: translateY(4px); } 100% { transform: translateY(0); } }
/* a compact table at the top of the hand when the TV shows the table: the top card, the words, the others */
.strip { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: radial-gradient(circle at 20% 20%, #205a3c, #10301f); border: 1px solid #2b6a4b; margin-bottom: auto; }
.strip.ct { --felt: #23804f; --felt-2: #0c3320; border: 0; background: linear-gradient(180deg, rgba(0,0,0,.34), transparent 12px), radial-gradient(ellipse 75% 60% at 38% 16%, rgba(255,234,190,.2), transparent 78%), url(/party/games/cards/felt.webp?v=1) 0 0 / 96px 96px, radial-gradient(ellipse 100% 110% at 50% 30%, var(--felt), var(--felt-2) 96%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.55), 0 0 0 3px #3b2414, 0 0 0 4px rgba(214,170,92,.55), 0 6px 16px rgba(0,0,0,.45); }   /* (no blurred shadow inside it: see .felt.ct) */
.strip.lc-strip { --felt: #40358f; --felt-2: #18123e; }
.strip.pu-strip { --felt: #1f6a80; --felt-2: #0b2a36; }
.strip .words { min-width: 0; display: grid; gap: 2px; flex: 1; }
.strip .words b { font-family: var(--display); font-size: 1.05em; }
.strip .others { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; margin-top: 6px; }
.strip .other { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; border-radius: 999px; background: rgba(0,0,0,.3); font-size: .82em; font-weight: 600; color: #d9f0e3; }
.strip .other .avatar { width: 26px; height: 27px; }
.strip .other.turn { background: var(--gold); color: #241c05; }
.strip .other.out { opacity: .5; }
.strip .stack { display: grid; justify-items: center; gap: 2px; flex: none; }
.strip .stack .lbl { font-size: .72em; color: #cfe9da; }
/* the say line: a ribbon on your turn */
.say { margin: 0; font-weight: 600; line-height: 1.3; }
.say.mine { font-family: var(--display); color: #241c05; background: linear-gradient(135deg, #ffe08a, #f2b84a); padding: 8px 14px; border-radius: 12px; box-shadow: 0 6px 18px -6px rgba(242,184,74,.8); animation: say-in .5s var(--bounce) both; }
@keyframes say-in { from { opacity: 0; transform: translateY(8px) scale(.94); } }
.say.loud { font-family: var(--display); font-size: 1.15em; }
/* a tray: a labelled row of cards, lit when it is the one you play from */
.tray { display: grid; gap: 6px; padding: 8px 10px 10px; border-radius: 14px; border: 1px dashed var(--line-2); background: rgba(255,255,255,.02); transition: opacity .3s, border-color .3s; }
.tray.active { border: 2px solid rgba(242,210,122,.5); background: rgba(242,210,122,.05); }
.tray.dim { opacity: .55; }
.tray .tray-lbl { display: flex; align-items: center; gap: 8px; font-size: .82em; color: var(--muted); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.tray .tray-lbl .n { padding: 0 7px; border-radius: 999px; background: rgba(255,255,255,.1); color: var(--text); }
.tray.active .tray-lbl { color: var(--gold); }
.tray .tray-lbl .hint { margin-left: auto; text-transform: none; font-weight: 400; letter-spacing: 0; }
.cards { display: flex; flex-wrap: wrap; gap: .4em; align-items: flex-end; }
.cards.many > * { margin-right: -.9em; }
.cards.many > *:last-child { margin-right: 0; }
.cards.many > .sel { z-index: 2; }
.bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bar .btn:only-child, .bar .btn.play, .bar .btn.full { grid-column: 1 / -1; }

/* sideways: the table summary to the left, the hand to the right along the bottom edge */
@media (orientation: landscape) and (max-height: 520px) {
  html[data-screen=phone] header.top { padding: 4px 12px; }
  html[data-screen=phone] header.top .brand span, html[data-screen=phone] header.top .crumb { display: none; }
  html[data-screen=phone] header.top .chip { padding: 2px 8px; font-size: .9em; }
  html[data-screen=phone] header.top .btn.small { min-height: 28px; }
  html[data-screen=phone] #partyView { min-height: calc(100dvh - 42px); }
  html[data-screen=phone] main { padding: 8px 12px 0; max-width: none; }
  .p-hand { margin-left: -12px; margin-right: -12px; }
  .p-hand > .panel { max-height: calc(100dvh - 42px); display: grid; grid-template-columns: minmax(0, 11em) repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; gap: 8px 12px; align-items: start; align-content: start; padding: 10px 14px; border-radius: 20px 20px 0 0; }
  .p-hand > .panel > .strip { grid-column: 1; grid-row: 1 / span 40; align-self: start; flex-direction: column; align-items: stretch; margin: 0; }
  .p-hand > .panel > :not(.strip) { grid-column: 2 / -1; }
  .p-hand > .panel > .tray.small { grid-column: auto; }
  .p-hand .tray .tray-lbl .hint { display: none; }
  .p-hand .lc-hand .lc-cards .lc-card, .p-hand .vt-hand .tray .vt-card, .p-hand .pu-hand .pu-cards .pu-card { font-size: 12px; }
  .p-hand .vt-hand .tray.small .vt-card { --w: 2.4em; }
  .p-hand > .pu-hand > .pu-mine { grid-column: 2; }
  .p-hand > .pu-hand > .tray[data-row=hand] { grid-column: 3; }
  .p-hand .pu-hand .felt .pu-build .pu-card { --w: 2.6em; }
  .p-hand .pu-hand .pu-discard .pu-card, .p-hand .pu-hand .pu-stock .pu-card { --w: 2.2em; }
  .say { font-size: .95em; }
  .p-more { padding: 6px 12px; margin-bottom: 6px; }
  /* the lobby sideways: two tiles across, the rules in two columns, the Start bar still along the bottom edge */
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-start { margin-left: -12px; margin-right: -12px; padding: 10px 12px 8px; }
  .start-btn { min-height: 56px; }
  .next-up { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; }
  .next-up::before, .next-up .eyebrow, .next-up .next-head, .next-up .waiting { grid-column: 1 / -1; }
  .next-up .how-h, .next-up .how { grid-column: 1; }
  .next-up .rules-line { grid-column: 2; grid-row: 3 / span 2; align-self: start; margin-top: 8px; }
  .over-panel .podium3 { max-width: 32em; margin-inline: auto; }
  .podium { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #joinView .cast-grid { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); }
}

/* ═════════════ the TV ═════════════ */
html[data-screen=tv] body { font-size: clamp(14px, 1.35vw, 30px); overflow: hidden; cursor: none; }
html[data-screen=tv] main { max-width: none; padding: 1.6vh 2.2vw; height: 100vh; display: flex; flex-direction: column; }
html[data-screen=tv] #partyView, .tv-game { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tv-lobby { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 3vw; align-items: start; min-height: 0; }
.tv-join { text-align: center; position: relative; padding-top: 1vh; }
.tv-lobby.enter .tv-join { animation: pop-in .7s var(--ease) both; }
.tv-lobby.enter .tv-game-pick { animation: rise .5s var(--ease) both; animation-delay: .2s; }
.tv-join .eyebrow { color: var(--muted); letter-spacing: .14em; text-transform: uppercase; font-size: .85em; margin: 0; }
.tv-code { font-family: var(--display); font-size: 6em; letter-spacing: .14em; line-height: 1; margin: .05em 0 .18em; color: var(--gold); text-shadow: 0 0 .25em rgba(242,210,122,.45), 0 .06em 0 #7a5a10; animation: code-glow 2.6s ease-in-out infinite var(--play); }
@keyframes code-glow { 50% { text-shadow: 0 0 .5em rgba(242,210,122,.8), 0 .06em 0 #7a5a10; } }
.tv-qr { width: min(36vh, 26vw); aspect-ratio: 1; border-radius: 18px; background: #fff; padding: 10px; display: block; margin: 0 auto; box-shadow: 0 0 0 .35em #fff, 0 0 0 .55em var(--gold), 0 1.2em 2.4em rgba(0,0,0,.5); transform: rotate(-2deg); animation: qr-sway 5s ease-in-out infinite var(--play); }
@keyframes qr-sway { 50% { transform: rotate(2deg) translateY(-.2em); } }
.tv-address { font-size: 1.25em; margin: 1em 0 0; }
.tv-address b { color: var(--text); }
.tv-side h2 { font-size: 1.5em; display: flex; align-items: center; gap: .4em; }
.tv-people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9em, 1fr)); gap: 1em; }
.tv-people li { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: .7em .4em .6em; position: relative; }
.tv-people li.new { animation: bob-in .8s var(--bounce) both; }
@keyframes bob-in { 0% { opacity: 0; transform: translateY(40%) scale(.6) rotate(-8deg); } 60% { opacity: 1; transform: translateY(-6%) scale(1.06) rotate(3deg); } 100% { transform: none; } }
.tv-people li.away { opacity: .45; }
.tv-people .avatar { display: block; width: 6em; height: 6.2em; margin: 0 auto; }
.tv-people b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: .2em; }
.tv-people .crown { position: absolute; top: .3em; right: .5em; font-size: 1.4em; animation: crown-tilt 3s ease-in-out infinite var(--play); }
@keyframes crown-tilt { 50% { transform: rotate(-14deg) translateY(-.1em); } }
.tv-empty { color: var(--muted); font-size: 1.2em; }
/* the TV lobby's right side: the people, then one game on show (the pick; the games in turn while nobody is in) */
.tv-side { display: flex; flex-direction: column; min-height: 0; gap: .5em; }
.tv-side-head { display: flex; align-items: baseline; gap: 1em; }
.tv-side-head h2 { margin: 0; }
.tv-people.many { grid-template-columns: repeat(auto-fill, minmax(7em, 1fr)); gap: .7em; }
.tv-people.many .avatar { width: 4.4em; height: 4.6em; }
.tv-people.many li { padding: .45em .3em .35em; }
.tv-show { display: grid; grid-template-columns: 15em minmax(0, 1fr); gap: 1.4em; align-items: center; margin-top: .5em; padding: 1em 1.2em; border-radius: 22px; background: linear-gradient(120deg, color-mix(in srgb, var(--tone, var(--accent)) 30%, var(--surface)), var(--surface) 65%); border: 1px solid var(--line-2); box-shadow: 0 1em 3em rgba(0,0,0,.35); }
.tv-show.enter { animation: show-in .7s var(--ease) both; }
.tv-show .g-art.big { width: 100%; border-radius: 18px; box-shadow: 0 .8em 2em rgba(0,0,0,.45); }
/* a shine sweeps over the art now and then */
.tv-show .g-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,.2) 46%, rgba(255,255,255,.05) 52%, transparent 62%); transform: translateX(-130%); animation: shine 7s ease-in-out infinite var(--play); pointer-events: none; }
@keyframes shine { 0%, 72% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
.tv-show-words { min-width: 0; display: grid; gap: .3em; }
.tv-show-words .eyebrow { margin: 0; }
.tv-show-words h3 { margin: 0; font-size: 1.9em; display: flex; align-items: baseline; gap: .6em; flex-wrap: wrap; }
.tv-players { font: 500 .5em var(--font); color: var(--muted); padding: .15em .7em; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); white-space: nowrap; }
.tv-show .how { font-size: 1.02em; gap: .3em; }
.tv-starts { margin: .4em 0 0; font-weight: 600; color: var(--gold); }
.tv-rules { margin: .2em 0 0; }
.tv-dots { display: flex; gap: .4em; margin: .4em 0 0; }
.tv-dots i { width: .55em; height: .55em; border-radius: 50%; background: var(--line-2); }
.tv-dots i.on { background: var(--gold); }
.tv-show.turning { animation: show-in .8s var(--ease) both; }
@keyframes show-in { from { opacity: 0; transform: translateX(1.5em); } }
.tv-last { padding: .5em 1em; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.tv-last .avatar.mini { width: 2.2em; height: 2.3em; }
.tv-over-next { margin: .8em 0 0; text-align: center; }
/* the carousel's bar while the room is empty: how long this game stays on show */
.tv-turn-bar { height: .3em; max-width: 22em; margin: .5em 0 0; border-radius: 999px; background: var(--line); overflow: hidden; }
.tv-turn-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transform-origin: left; animation: bar-fill var(--turn-ms, 8s) linear both; }
@keyframes bar-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ═════════════ the show round the games on the TV (shell.js's TV part): the lobby's life, the title moment, the podium, the curtain ═════════════ */
/* ---- the lobby: soft party lights drift behind everything (small blurred-looking dots drawn with gradients: no filters) ---- */
.tv-lights { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.tv-lobby { position: relative; z-index: 1; }
.tv-lights i { position: absolute; width: 16vmin; height: 16vmin; border-radius: 50%; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); background: radial-gradient(circle, var(--c) 0%, transparent 68%); opacity: .32; animation: light-drift 16s ease-in-out infinite alternate var(--play); animation-delay: calc(var(--i, 0) * -2.7s); }
.tv-lights i:nth-child(1) { --x: 6; --y: 10; --c: rgba(178,62,240,.9); } .tv-lights i:nth-child(2) { --x: 28; --y: 78; --c: rgba(45,212,191,.8); } .tv-lights i:nth-child(3) { --x: 52; --y: 6; --c: rgba(242,210,122,.8); }
.tv-lights i:nth-child(4) { --x: 78; --y: 22; --c: rgba(244,63,94,.7); } .tv-lights i:nth-child(5) { --x: 90; --y: 70; --c: rgba(178,62,240,.8); } .tv-lights i:nth-child(6) { --x: 64; --y: 84; --c: rgba(255,157,59,.7); }
.tv-lights i:nth-child(7) { --x: 14; --y: 48; --c: rgba(126,224,255,.7); } .tv-lights i:nth-child(8) { --x: 40; --y: 40; --c: rgba(242,210,122,.5); } .tv-lights i:nth-child(9) { --x: 84; --y: 46; --c: rgba(52,196,106,.6); }
@keyframes light-drift { 0% { transform: translate(0, 0) scale(1); opacity: .22; } 50% { opacity: .4; } 100% { transform: translate(6vmin, -5vmin) scale(1.25); opacity: .26; } }
.tv-lobby.enter .tv-side-head { animation: rise .5s var(--ease) both; animation-delay: .1s; }
.tv-lobby.enter .tv-people { animation: rise .5s var(--ease) both; animation-delay: .2s; }
/* the QR code: a slow ring of coloured light turns behind it, so the eye lands there first */
.tv-qr-wrap { position: relative; display: inline-block; margin: .3em auto 0; }
.tv-qr-wrap::before { content: ''; position: absolute; inset: -1.6em; border-radius: 50%; background: conic-gradient(from 0deg, var(--gold), transparent 28%, var(--accent) 40%, transparent 62%, var(--teal) 74%, transparent 92%, var(--gold)); opacity: .55; -webkit-mask: radial-gradient(circle, transparent 60%, #000 64%, #000 71%, transparent 76%); mask: radial-gradient(circle, transparent 60%, #000 64%, #000 71%, transparent 76%); animation: ring-turn 11s linear infinite var(--play); z-index: -1; }
@keyframes ring-turn { to { transform: rotate(360deg); } }
/* the people idle on their own clocks: a hop, a wave of the right arm, a look around; --t keeps the clocks across redraws */
.tv-people li .avatar { animation: idle-hop 9s ease-in-out infinite var(--play); animation-delay: calc(var(--i, 0) * -2.6s - var(--t, 0ms)); }
@keyframes idle-hop { 0%, 86%, 100% { transform: translateY(0) scale(1); } 90% { transform: translateY(-9%) scale(1.04); } 94% { transform: translateY(0) scale(.97, 1.02); } 97% { transform: translateY(-3%) scale(1); } }
.tv-people li .avatar:not([data-mood]) .c-arm.r { animation: idle-wave 11s ease-in-out infinite var(--play); animation-delay: calc(var(--i, 0) * -3.1s - var(--t, 0ms)); }
@keyframes idle-wave { 0%, 78%, 100% { transform: none; } 82%, 88%, 94% { transform: translate(3px, -22px) rotate(25deg); } 85%, 91% { transform: translate(5px, -24px) rotate(48deg); } }
.tv-people li .avatar:not([data-mood]) .c-pupil { animation: idle-look 13s ease-in-out infinite var(--play); animation-delay: calc(var(--i, 0) * -4.3s - var(--t, 0ms)); }
@keyframes idle-look { 0%, 58%, 100% { transform: none; } 62%, 70% { transform: translate(1.4px, 0); } 74%, 82% { transform: translate(-1.4px, .4px); } }
/* a newcomer: the others hop and throw an arm up for a moment, a ribbon with the name floats over the room */
.tv-people.cheer li:not(.new) { animation: cheer-hop .75s var(--bounce) both; animation-delay: calc(var(--i, 0) * 70ms - var(--ct, 0ms)); }
@keyframes cheer-hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-6%) rotate(-2deg); } 70% { transform: translateY(0) rotate(1deg); } }
.tv-side-head { position: relative; z-index: 2; }
.tv-people.cheer li:not(.new) .avatar:not([data-mood]) .c-arm.l { transform: translate(-4px, -30px) rotate(-20deg); }
.tv-people.cheer li:not(.new) .avatar:not([data-mood]) .m-smile { display: none; } .tv-people.cheer li:not(.new) .avatar:not([data-mood]) .m-grin { display: block; }
.tv-side { position: relative; }
.tv-welcome { position: absolute; right: 0; top: -.4em; margin: 0; z-index: 3; font-family: var(--display); font-weight: 700; font-size: 1.35em; color: #241c05; background: linear-gradient(135deg, #ffe08a, #f2b84a); padding: .25em 1em; border-radius: 999px; box-shadow: 0 .5em 1.4em rgba(242,184,74,.45); transform: rotate(-3deg); animation: welcome-in 3.6s var(--bounce) both; }
@keyframes welcome-in { 0% { opacity: 0; transform: rotate(-3deg) translateY(.8em) scale(.7); } 12% { opacity: 1; transform: rotate(-3deg) translateY(0) scale(1.08); } 20% { transform: rotate(-3deg) scale(1); } 86% { opacity: 1; transform: rotate(-3deg) translateY(0); } 100% { opacity: 0; transform: rotate(-3deg) translateY(-.6em); } }
/* while nobody is in: the cast strolls past along the bottom of the side (the cast's own bobbing is off: one transform per walker) */
.tv-parade { overflow: hidden; height: 6.6em; margin: .6em 0 0; -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.tv-parade-strip { display: flex; gap: 1.6em; width: max-content; animation: parade 70s linear infinite var(--play); }
@keyframes parade { to { transform: translateX(-50%); } }
.tv-walker { display: block; width: 5.4em; height: 5.6em; animation: walk .62s ease-in-out infinite alternate var(--play); animation-delay: calc(var(--i, 0) * -.15s); }
.tv-walker .avatar { width: 100%; height: 100%; }
.tv-walker .c-head, .tv-walker .c-eyes, .tv-walker [data-mood] .c-head { animation: none; }
@keyframes walk { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(-.35em) rotate(3deg); } }

/* ---- the title moment before a game: the game's colour floods the screen, rays turn behind its art, its name lands, the
        players bounce in, then 3, 2, 1 and it lifts off the game's own screen (drawn underneath all along) ---- */
.tv-intro { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; overflow: hidden; background: radial-gradient(70% 60% at 50% 42%, color-mix(in srgb, var(--tone, var(--accent)) 62%, #0b0a12), #0b0a12 100%); animation: fade-in .4s var(--ease) both; }
.tv-intro.out { animation: intro-out .6s var(--ease) both; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes intro-out { to { opacity: 0; transform: scale(1.06); } }
.tv-intro .rays { position: absolute; left: 50%; top: 42%; width: 80vmax; height: 80vmax; margin: -40vmax 0 0 -40vmax; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.085) 0 7deg, transparent 7deg 20deg); -webkit-mask: radial-gradient(circle, #000 10%, transparent 62%); mask: radial-gradient(circle, #000 10%, transparent 62%); animation: ring-turn 60s linear infinite var(--play); }
.intro-stage { position: relative; display: grid; justify-items: center; gap: .3em; text-align: center; width: min(90vw, 70em); }
.intro-eyebrow { font-size: 1.3em; color: rgba(255,255,255,.75); margin: 0; animation: fade-in .5s both; animation-delay: .5s; }
.g-art.huge { width: min(30em, 40vh); border-radius: 26px; box-shadow: 0 2em 5em rgba(0,0,0,.6), 0 0 0 .35em rgba(255,255,255,.1); animation: art-land .7s var(--bounce) both; animation-delay: .1s; }
@keyframes art-land { from { opacity: 0; transform: scale(1.7) rotate(-6deg); } }
.intro-name { font-size: 5em; margin: .05em 0 0; line-height: 1; color: #fff; text-shadow: 0 .05em 0 rgba(0,0,0,.4), 0 0 .5em color-mix(in srgb, var(--tone, var(--accent)) 60%, #fff); animation: name-in .6s var(--ease) both; animation-delay: .35s; }
@keyframes name-in { from { opacity: 0; transform: translateY(.5em) scale(.9); } }
.intro-rules { margin: 0; color: rgba(255,255,255,.7); font-size: 1.05em; animation: fade-in .6s both; animation-delay: .8s; }
.intro-cast { display: flex; justify-content: center; gap: 1.6em; margin-top: .8em; }
.intro-who { display: grid; justify-items: center; gap: .1em; animation: who-in .7s var(--bounce) both; animation-delay: calc(.7s + var(--i, 0) * .12s); }
.intro-who .avatar { width: 7em; height: 7.2em; }
.intro-who b { font-size: 1.2em; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.intro-cast.many .intro-who .avatar { width: 5.4em; height: 5.6em; } .intro-cast.many { gap: 1em; } .intro-cast.many .intro-who b { font-size: 1em; max-width: 7em; }
@keyframes who-in { from { opacity: 0; transform: translateY(120%) scale(.5); } 60% { opacity: 1; transform: translateY(-12%) scale(1.06); } }
.intro-count { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); pointer-events: none; }
.intro-count span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-family: var(--display); font-weight: 700; font-size: 12em; line-height: 1; color: #fff; text-shadow: 0 .04em 0 rgba(0,0,0,.5), 0 0 .3em rgba(0,0,0,.6); opacity: 0; animation: count-pop .55s var(--ease) both; animation-delay: calc(1.7s + var(--i, 0) * .5s); }
.intro-count span.go { color: var(--gold); font-size: 9em; animation: go-pop .6s var(--bounce) both; animation-delay: 3.05s; }
/* during the count the stage steps back, so the numerals have the screen */
.intro-stage { transition: transform .5s var(--ease); }
.intro-stage > :not(.intro-count) { transition: opacity .45s var(--ease); }
.tv-intro.counting .intro-stage { transform: scale(.94); }
.tv-intro.counting .intro-stage > :not(.intro-count) { opacity: .28; }
@keyframes count-pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2.6); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; transform: translate(-50%, -50%) scale(.96); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.9); } }
@keyframes go-pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(-8deg); } 60% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(2deg); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-3deg); } }
.tv-bar .tv-game-name { background: color-mix(in srgb, var(--tone, var(--surface-2)) 45%, var(--surface-2)); border-color: color-mix(in srgb, var(--tone, var(--line-2)) 50%, var(--line-2)); }

/* ---- the podium on the TV: the table dims, the blocks rise (third, second, then the winner's), each character jumps onto
        theirs, a spotlight swings onto the winner, the loser gets a rain cloud, and a bar runs down to the lobby ---- */
.tv-overlay.over::before { content: ''; position: fixed; inset: 0; z-index: 3; background: radial-gradient(ellipse at 50% 45%, rgba(8,7,14,.66), rgba(8,7,14,.92)); animation: fade-in .6s both; pointer-events: none; }
.tv-overlay.over ~ .tv-board { opacity: .55; transition: opacity .6s; }     /* the finished table (and a game's own fuss on it) steps back behind the podium */
.tv-overlay.over ~ .tv-board .fuss { opacity: 0; transition: opacity .4s; }   /* the game's own moment has had its 2.5 s: its words do not show round the podium */
.tv-standings .step { position: relative; animation: none; }
.tv-standings .step .who, .tv-standings .step .nm, .tv-standings .step .lbl, .tv-standings .step .block { position: relative; z-index: 1; }
.tv-standings .step .block { transform-origin: 50% 100%; animation: block-up .6s var(--bounce) both; animation-delay: calc(.25s + var(--k, 1) * .18s); }
@keyframes block-up { from { opacity: 0; transform: scaleY(0); } }
.tv-standings .step .who { animation: pod-land .8s var(--bounce) both; animation-delay: calc(.55s + var(--k, 1) * .18s); }
@keyframes pod-land { 0% { opacity: 0; transform: translateY(130%) scale(.5); } 55% { opacity: 1; transform: translateY(-22%) scale(1.08); } 100% { opacity: 1; transform: none; } }
.tv-standings .step .nm, .tv-standings .step .lbl { animation: rise .5s var(--ease) both; animation-delay: calc(1s + var(--k, 1) * .18s); }
.tv-standings .step.first .spot { position: absolute; left: 50%; bottom: 3em; width: 22em; height: 40em; transform: translateX(-50%); transform-origin: 50% 100%; background: linear-gradient(180deg, rgba(255,240,180,0) 0%, rgba(255,240,180,.16) 55%, rgba(255,240,180,.3) 100%); clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%); pointer-events: none; z-index: 0; opacity: 0; animation: spot-on .9s ease-out both, spot-sway 5s ease-in-out infinite alternate var(--play); animation-delay: 1.3s, 2.2s; }
@keyframes spot-on { to { opacity: 1; } }
@keyframes spot-sway { from { transform: translateX(-50%) rotate(-4deg); } to { transform: translateX(-50%) rotate(4deg); } }
.tv-standings .step.first .block { box-shadow: inset 0 3px 0 rgba(255,255,255,.12), 0 0 2.4em rgba(242,210,122,.45); }
.tv-standings .step.first .avatar { animation: pod-cheer 1.1s ease-in-out infinite var(--play); animation-delay: 1.6s; }
@keyframes pod-cheer { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8%) rotate(3deg); } }
.tv-standings .step.loser .avatar { animation: wobble 1.6s ease-in-out infinite var(--play); animation-delay: 2s; }
.fate { position: absolute; left: 50%; top: -1.3em; width: 3.4em; height: 2.4em; transform: translateX(-50%); z-index: 2; pointer-events: none; animation: fate-in .6s var(--bounce) both, cloud-bob 2.8s ease-in-out 2.5s infinite alternate var(--play); animation-delay: 1.9s, 2.5s; }
@keyframes fate-in { from { opacity: 0; transform: translateX(-50%) translateY(-1em) scale(.5); } }
@keyframes cloud-bob { from { transform: translateX(-54%); } to { transform: translateX(-46%) translateY(-.15em); } }
.fate .cloud { position: absolute; left: 0; right: 0; top: .5em; height: 1.1em; border-radius: 1em; background: #8f8ba6; box-shadow: 0 .15em .4em rgba(0,0,0,.35); }
.fate .cloud::before, .fate .cloud::after { content: ''; position: absolute; border-radius: 50%; background: inherit; }
.fate .cloud::before { left: .45em; top: -.5em; width: 1.2em; height: 1.2em; } .fate .cloud::after { left: 1.5em; top: -.75em; width: 1.5em; height: 1.5em; }
.fate .drop { position: absolute; top: 1.55em; left: calc(.7em + var(--d, 0) * .9em); width: .26em; height: .6em; border-radius: 50% 50% 60% 60% / 40% 40% 60% 60%; background: var(--sky); animation: drip 1.1s linear infinite var(--play); animation-delay: calc(var(--d, 0) * -.37s); }
@keyframes drip { from { transform: translateY(0); opacity: 1; } to { transform: translateY(1.6em); opacity: 0; } }
.podium li .who-mini { position: relative; display: inline-flex; flex: none; }
.tv-standings .podium li { position: relative; z-index: 2; }
.fate.small { font-size: .55em; top: -1.3em; left: 50%; animation-delay: 1.2s, 1.8s; }
.tv-over-bar { height: .3em; margin: .9em -1.6em -1.2em; background: rgba(255,255,255,.06); overflow: hidden; }
.tv-over-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transform-origin: left; animation: bar-drain var(--ms, 15s) linear both; }
@keyframes bar-drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---- the curtain: there at once in the last game's colour when the lobby comes back, and it lifts ---- */
.tv-curtain { position: fixed; inset: 0; z-index: 95; pointer-events: none; opacity: 0; background: radial-gradient(80% 80% at 50% 50%, color-mix(in srgb, var(--tone, var(--accent)) 55%, #0b0a12), #0b0a12); }
.tv-curtain.go { animation: curtain-lift .8s var(--ease) both; }
@keyframes curtain-lift { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.08); } }
.tv-bar { display: flex; align-items: center; gap: 1em; margin: 0 0 1vh; }
.tv-bar .tv-small-code { font-family: var(--display); letter-spacing: .14em; color: var(--gold); font-size: 1.5em; }
.tv-bar .tv-mini-qr { width: 3.6em; height: 3.6em; background: #fff; border-radius: 8px; padding: 3px; }
.tv-bar .grow { flex: 1; }
.tv-bar .tv-game-name { font-family: var(--display); font-size: 1.2em; padding: .15em .7em; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); }
.tv-table { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.tv-board { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tv-board > .board { flex: 1; min-height: 0; }
body:has(.tv-lobby.picking) .tv-hint { bottom: calc(1.6vh + 3.1em); }     /* (over a card's empty foot, not the line of rules) */
.tv-hint { position: fixed; right: 2vw; bottom: 2vh; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: .5em 1em; color: var(--muted); z-index: 30; }
.tv-paused { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8,7,14,.72); font-family: var(--display); font-size: 3em; z-index: 5; backdrop-filter: blur(4px); }
/* the result on the TV: the podium centre stage over the finished table */
.tv-standings { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(44em, 72vw); max-height: 92%; overflow: hidden; background: rgba(21,19,31,.97); border: 1px solid var(--line-2); border-radius: 24px; padding: 1em 1.6em 1.2em; z-index: 41; animation: result-in .7s var(--bounce) both; box-shadow: 0 1.5em 4em rgba(0,0,0,.6), 0 0 0 1px rgba(242,210,122,.15); text-align: center; }
@keyframes result-in { from { opacity: 0; transform: translate(-50%, -44%) scale(.92); } }
.tv-standings h2 { position: relative; z-index: 3; font-size: 1.3em; margin-bottom: .3em; }   /* over the winner's head as it jumps and cheers */
.tv-standings .podium3 { gap: 1.2em; margin-top: 1.4em; }
.tv-standings .step .avatar { width: 5em; height: 5.2em; }
.tv-standings .step.p1 .avatar { width: 7em; height: 7.3em; }
.tv-standings .step .block { height: 3.4em; } .tv-standings .step.p1 .block { height: 5.4em; } .tv-standings .step.p3 .block { height: 2.6em; }
.tv-standings .podium { grid-template-columns: repeat(auto-fit, minmax(14em, 1fr)); text-align: left; }
.tv-standings .podium li { font-size: .95em; }
.tv-standings .podium .avatar.mini { width: 2.4em; height: 2.5em; }

/* ═════════════ the board: shared by the games, on the TV and on a phone that shows the table ═════════════ */
.board { display: flex; flex-direction: column; gap: .6em; min-height: 0; position: relative; }
.board-head { text-align: center; display: grid; gap: .1em; justify-items: center; }
.status-line { font-family: var(--display); font-size: 1.35em; line-height: 1.2; }
.status-line.mine { color: var(--gold); }
.board-info { color: var(--muted); font-size: .9em; }
.timer { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; width: min(100%, 30em); }
.timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transform-origin: left; }
.seats { display: flex; flex-wrap: wrap; justify-content: center; gap: .7em; align-items: flex-start; }
.ticker { color: var(--muted); display: grid; gap: .1em; font-size: .92em; }
.ticker .new { color: var(--text); animation: rise .4s var(--ease) both; }
/* the felt: a table top with a wooden rim; the games tint it */
.felt { --felt: #237a4e; --felt-2: #123a26; --rim: #4a2a12; position: relative; border-radius: 22px; padding: .9em 1em; background: radial-gradient(ellipse at 50% 35%, var(--felt), var(--felt-2) 75%); box-shadow: 0 0 0 .4em var(--rim), 0 0 0 .55em #1a0e05, 0 1em 2.5em rgba(0,0,0,.55), inset 0 0 3em rgba(0,0,0,.35); transition: --felt .4s; }
.felt::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 2px, transparent 2px 6px); pointer-events: none; }
.felt-in { position: relative; display: flex; align-items: center; justify-content: center; gap: 2em; flex-wrap: wrap; }
.felt .stack { display: grid; justify-items: center; gap: .35em; position: relative; }
.felt .stack .lbl { color: rgba(255,255,255,.8); font-size: .85em; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.felt .banner { position: relative; margin-top: .6em; text-align: center; font-weight: 700; }
.lc-felt { --felt: #3a2f7a; --felt-2: #1a1540; --rim: #3b2a4a; }
.pu-felt { --felt: #1f6276; --felt-2: #0f2e3a; --rim: #2d3a4a; }
.felt.tint-o { --felt: #c7641a; --felt-2: #4a2408; } .felt.tint-g { --felt: #2f8a3c; --felt-2: #0f3a16; } .felt.tint-b { --felt: #2367b8; --felt-2: #0b2a52; } .felt.tint-p { --felt: #7840c4; --felt-2: #2a1250; }
/* a seat: the character, the name, their cards; the turn seat lights up and grows */
.seat { position: relative; min-width: 0; background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: .55em .7em .6em; display: grid; gap: .4em; transition: transform .35s var(--bounce), border-color .3s, box-shadow .3s, opacity .3s; }
.seat .who { display: flex; align-items: center; gap: .5em; min-width: 0; }
.seat .who .avatar { width: 2.9em; height: 3em; transition: transform .35s var(--bounce); }
.seat .nm { min-width: 0; display: grid; line-height: 1.2; }
.seat .nm b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .nm .sub { color: var(--muted); font-size: .82em; }
.seat.turn { border-color: var(--gold); box-shadow: 0 0 0 .18em rgba(242,210,122,.3), 0 0 1.6em rgba(242,210,122,.35); transform: scale(1.06); z-index: 2; background: linear-gradient(180deg, #2a2438, #1a1726); animation: seat-pulse 1.6s ease-in-out infinite var(--play); }
.seat.turn .who .avatar { transform: scale(1.12); }
@keyframes seat-pulse { 50% { box-shadow: 0 0 0 .3em rgba(242,210,122,.2), 0 0 2.4em rgba(242,210,122,.55); } }
.seat.out { opacity: .55; }
.seat.loser { border-color: var(--red); }
/* a seat whose phone is gone: dimmed, dashed, a badge that says so; its turn still shows, without the glow */
.seat.away { opacity: .72; border-style: dashed; }
.seat.away.turn { animation: none; box-shadow: 0 0 0 .18em rgba(242,210,122,.18); background: var(--surface); }
.away-tag { position: absolute; right: .6em; bottom: -.8em; padding: .05em .6em; border-radius: 999px; background: #34314a; color: var(--muted); border: 1px solid var(--line-2); font-size: .74em; font-weight: 700; white-space: nowrap; z-index: 3; }   /* the bottom corner: the turn tag has the top */
.strip .other:has(.avatar[data-mood=away]) { opacity: .6; }
.strip .other:has(.avatar[data-mood=away])::after { content: '💤'; font-size: .85em; margin-left: .1em; }
.seat.exposed { border-color: var(--red); box-shadow: 0 0 0 .18em rgba(244,63,94,.3); }
.turn-tag { position: absolute; left: 50%; top: -.9em; transform: translateX(-50%); padding: .05em .7em; border-radius: 999px; background: linear-gradient(135deg, #ffe08a, #f2b84a); color: #241c05; font-family: var(--display); font-weight: 700; font-size: .8em; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; box-shadow: 0 .3em .8em rgba(0,0,0,.4); animation: tag-bounce .9s ease-in-out infinite var(--play); z-index: 3; }
.turn-tag::after { content: ''; position: absolute; left: 50%; bottom: -.35em; transform: translateX(-50%); border: .4em solid transparent; border-bottom: 0; border-top-color: #f2b84a; }
@keyframes tag-bounce { 50% { transform: translateX(-50%) translateY(-.3em); } }
.count-badge { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 .4em; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); font-family: var(--display); font-weight: 700; font-size: .9em; line-height: 1; }
.count-badge.hot { background: var(--red); border-color: transparent; color: #fff; animation: seat-pulse 1s ease-in-out infinite var(--play); }
.badge { position: absolute; top: -.7em; right: .5em; padding: .05em .55em; border-radius: 999px; font-size: .8em; font-weight: 700; white-space: nowrap; animation: pop-in .4s var(--bounce) both; z-index: 3; }
.badge.call { background: var(--gold); color: #241c05; }
.badge.catch { background: var(--red); color: #fff; }
/* the stadium on the TV: seats above and below the felt, which is an oval and fills what is left */
html[data-screen=tv] .board { height: 100%; gap: .5em; }
html[data-screen=tv] .board-head { min-height: 2.2em; }
html[data-screen=tv] .status-line { font-size: 1.6em; }
html[data-screen=tv] .seats { flex-wrap: nowrap; gap: 1em; padding: .9em .5em .3em; }
html[data-screen=tv] .seats.bottom { align-items: flex-end; padding: .3em .5em .6em; }
html[data-screen=tv] .seat { flex: 0 1 auto; max-width: 24em; min-width: 11em; }
html[data-screen=tv] .seat .who .avatar { width: 3.4em; height: 3.5em; }
html[data-screen=tv] .felt { flex: 1; min-height: 0; margin: .6em 3vw; border-radius: 50% / 50%; display: grid; place-items: center; padding: 1em 4em; }
html[data-screen=tv] .felt::before { display: none; }
html[data-screen=tv] .felt-in { gap: 3em; flex-wrap: nowrap; }
html[data-screen=tv] .felt .banner { position: absolute; left: 50%; bottom: 1.2em; transform: translateX(-50%); white-space: nowrap; }
html[data-screen=tv] .ticker { position: absolute; left: 0; bottom: 0; max-width: 28vw; font-size: .85em; z-index: 1; }
html[data-screen=tv] .ticker div:nth-child(n+3) { display: none; }

/* ═════════════ the effects layer (look.js) ═════════════ */
/* over the page, under the result (a phone's .p-over, the TV's .tv-standings sit above it: confetti never covers a result's words) */
.fx-layer { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.p-over { position: relative; z-index: 41; }
.fx-canvas { position: absolute; inset: 0; }
.fx-fly { position: fixed; left: 0; top: 0; will-change: transform; filter: drop-shadow(0 .6em .8em rgba(0,0,0,.5)); }
.fx-stamp { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; z-index: 20; animation: fx-stamp 1.7s ease-out forwards; border-radius: 24px; background: radial-gradient(closest-side, rgba(8,7,14,.8), rgba(8,7,14,.5) 70%, transparent); }
.fx-layer > .fx-stamp { position: fixed; border-radius: 0; }
.fx-stamp-clip { position: absolute; inset: 0; z-index: 20; overflow: hidden; overflow: clip; pointer-events: none; border-radius: inherit; }   /* a stamp in a game's root: the slam never spills past it (look.js) */
.fx-stamp .big { font-family: var(--display); font-size: 4em; line-height: 1.05; color: #fff; text-shadow: 0 .04em 0 rgba(0,0,0,.6), 0 0 .3em rgba(0,0,0,.8); transform: rotate(-5deg); letter-spacing: .02em; }
.fx-stamp .small { font-size: 1.3em; color: #fff; text-shadow: 0 0 .3em #000, 0 0 .6em #000; margin-top: .3em; font-weight: 600; }
.fx-stamp.burn .big { color: var(--gold-2); text-shadow: 0 0 .25em #ff5a00, 0 0 .6em #ff2d00; }
.fx-stamp.call .big, .fx-stamp.clear .big, .fx-stamp.stock .big, .fx-stamp.win .big { color: var(--gold); }
.fx-stamp.caught .big, .fx-stamp.loser .big { color: #ff6b8a; }
.fx-stamp.challenge .big, .fx-stamp.gather .big { color: var(--gold-2); }
.fx-stamp.jump .big { color: var(--sky); }
.fx-stamp.skip .big, .fx-stamp.rev .big { font-size: 6em; }
.fx-stamp.color .big { color: var(--lc); -webkit-text-stroke: .03em #fff; }
.fx-stamp.swap .big { color: #c9b6ff; }
@keyframes fx-stamp { 0% { opacity: 0; transform: scale(2.2) rotate(6deg); } 14% { opacity: 1; transform: scale(1) rotate(0); } 20% { transform: scale(1.06); } 78% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.1); } }
.fx-float { position: absolute; transform: translate(-50%, 0); font-family: var(--display); font-weight: 700; font-size: 2em; color: #fff; text-shadow: 0 0 .3em #000, 0 .05em 0 rgba(0,0,0,.5); white-space: nowrap; }
.fx-float.bad { color: #ff6b8a; } .fx-float.good { color: var(--gold); } .fx-float.big { font-size: 3em; }
.fx-flames { position: fixed; pointer-events: none; mix-blend-mode: screen; transition: opacity .5s; }
.fx-flames.out { opacity: 0; }
.fx-flames i { position: absolute; bottom: 0; width: 26%; height: 80%; border-radius: 50% 50% 30% 30% / 70% 70% 30% 30%; background: radial-gradient(ellipse at 50% 100%, #fff6c0 0 14%, #ffc247 30%, #ff6a00 55%, rgba(255,40,0,.6) 70%, transparent 78%); filter: blur(1.5px); transform-origin: 50% 100%; animation: fx-flame .42s ease-in-out infinite alternate var(--play); }
@keyframes fx-flame { 0% { transform: scaleY(.7) scaleX(1) translateY(0); opacity: .85; } 100% { transform: scaleY(1.25) scaleX(.8) translateY(-12%); opacity: 1; } }
.fuss { display: grid; justify-items: center; gap: .3em; text-align: center; padding: 1em; position: relative; }
.fuss .avatar { width: 12em; height: 12.4em; animation: wobble 1.1s ease-in-out infinite var(--play); }
.fuss .stamp { margin: .1em 0 .5em; font-family: var(--display); font-size: 3.4em; line-height: 1; color: var(--gold); transform: rotate(-6deg); border: .12em solid currentColor; border-radius: .2em; padding: .05em .35em; animation: stamp-slam .7s var(--bounce) both; text-shadow: 0 0 .3em rgba(0,0,0,.5); }
.fuss.sad .stamp { color: #ff6b8a; }
.fuss .sub { color: var(--muted); font-size: 1.2em; animation: rise .6s var(--ease) both; animation-delay: .4s; }
@keyframes wobble { 0%, 100% { transform: rotate(-7deg) translateY(0); } 50% { transform: rotate(7deg) translateY(-6%); } }
@keyframes stamp-slam { from { transform: rotate(-6deg) scale(2.6); opacity: 0; } to { transform: rotate(-6deg) scale(1); opacity: 1; } }
html[data-screen=tv] .fuss .avatar { width: 16em; height: 16.5em; }
html[data-screen=tv] .fuss .stamp { font-size: 5em; }

/* ═════════════ Vändtia (games/vandtia.js): playing cards ═════════════ */
/* A card where it is big enough to read (the hand you play from, the pile, the draw pile, a card that flies) is its
   picture (--face: vandtia.js draws the 52 and the back) with its rank in two corners. A small card (the others' face-up
   cards, the rows you do not play from) is its rank and its suit in type, big, on the same ivory stock. */
.vt-card { --w: 3.4em; width: var(--w); height: calc(var(--w) * 1.4); border-radius: calc(var(--w) * .1); background: #f8f2e2 linear-gradient(150deg, #fffdf6, #f2ebd8) center / 100% 100% no-repeat; color: #1d1b2c; display: grid; place-items: center; position: relative; font-family: var(--display); font-weight: 700; flex: none; user-select: none; border: 0; overflow: hidden; padding: 0; line-height: 1;
  box-shadow: 0 calc(var(--w) * .012) 0 rgba(0,0,0,.4), 0 calc(var(--w) * .03) calc(var(--w) * .05) rgba(0,0,0,.3), 0 calc(var(--w) * .09) calc(var(--w) * .16) calc(var(--w) * -.05) rgba(0,0,0,.5); }
.vt-card.red { color: #d22c40; }
.vt-card .cn { display: none; position: absolute; width: 25%; text-align: center; line-height: 1; font-size: calc(var(--w) * .27); letter-spacing: -.05em; }
.vt-card .cn.tl { top: 3.2%; left: 0; }
.vt-card .cn.br { bottom: 3.2%; right: 0; transform: rotate(180deg); }
.vt-card .cn i { display: none; }                      /* (the suit under the rank is in the picture) */
.vt-card.ten .cn { font-size: calc(var(--w) * .21); letter-spacing: -.1em; padding-top: .14em; }
.vt-card .mid { display: grid; justify-items: center; line-height: 1; }
.vt-card .mid .r { font-size: calc(var(--w) * .5); }
.vt-card .mid .s { font-style: normal; font-size: calc(var(--w) * .34); margin-top: -.06em; }
.vt-card.face .mid .r { font-size: calc(var(--w) * .46); }
.vt-card.face .mid::before { content: '♛'; font-size: calc(var(--w) * .24); color: #c9a227; line-height: 1; }
.vt-card.ace .mid .r { display: none; } .vt-card.ace .mid .s { font-size: calc(var(--w) * .62); }
.vt-card.back { background-color: #6c1828; background-image: none; box-shadow: inset 0 0 0 calc(var(--w) * .05) #f3ecd9, inset 0 0 0 calc(var(--w) * .075) #6c1828, inset 0 0 0 calc(var(--w) * .095) rgba(242,210,122,.7), 0 calc(var(--w) * .03) calc(var(--w) * .06) rgba(0,0,0,.4); }
.vt-card.ghost { background: rgba(8,6,16,.18); border: 2px dashed rgba(255,255,255,.34); box-shadow: none; }
.vt-card .tag { position: absolute; left: 2.5%; top: 37%; bottom: 9%; width: 15.5%; display: grid; place-items: center; writing-mode: vertical-rl; transform: rotate(180deg); border-radius: .5em; background: linear-gradient(90deg, #ffe9a6, #f1c14e); color: #4a3303; font-size: calc(var(--w) * .12); line-height: 1; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; white-space: nowrap; overflow: hidden; box-shadow: 0 .1em .2em rgba(60,40,0,.4), inset 0 0 0 1px rgba(122,84,8,.5); }   /* (up the left edge: a fanned hand shows a card's left side) */
.tray.small .vt-card .tag, .strip .vt-card .tag, .vt-card.mini .tag, .vt-seat .vt-card .tag { display: none; }
/* where a card shows its picture */
.vt-pile .vt-card, .vt-hand .tray.active .vt-card, .vt-felt .stack.draw .vt-card, .vt-card.fx-fly, .fx-fly .vt-card, .vt-seat .vt-card.back, .vt-hand .tray .vt-card.back { background-image: var(--face); }
.vt-pile .vt-card .mid, .vt-hand .tray.active .vt-card .mid, .vt-card.fx-fly .mid, .fx-fly .vt-card .mid { display: none; }
.vt-pile .vt-card .cn, .vt-hand .tray.active .vt-card .cn, .vt-card.fx-fly .cn, .fx-fly .vt-card .cn { display: block; }
.vt-pile .vt-card.special, .vt-hand .tray.active .vt-card.special, .vt-seat .vt-card.special { box-shadow: inset 0 0 0 calc(var(--w) * .028) #d9b24c, 0 calc(var(--w) * .012) 0 rgba(0,0,0,.4), 0 calc(var(--w) * .03) calc(var(--w) * .05) rgba(0,0,0,.3), 0 calc(var(--w) * .09) calc(var(--w) * .16) calc(var(--w) * -.05) rgba(0,0,0,.5); }
.vt-felt .stack.draw .vt-card.back, .vt-card.back.fx-fly, .vt-seat .vt-card.back, .vt-hand .tray .vt-card.back { box-shadow: 0 calc(var(--w) * .012) 0 rgba(0,0,0,.4), 0 calc(var(--w) * .03) calc(var(--w) * .05) rgba(0,0,0,.3), 0 calc(var(--w) * .09) calc(var(--w) * .16) calc(var(--w) * -.05) rgba(0,0,0,.5); }
button.vt-card { cursor: pointer; transition: transform .18s var(--bounce), box-shadow .18s; }
button.vt-card.go { transform: translateY(-6%); box-shadow: 0 0 0 2px #fff8e2, 0 0 0 4px rgba(242,210,122,.8), 0 6px 14px rgba(0,0,0,.45), 0 0 .8em rgba(242,210,122,.5); }
button.vt-card.sel { transform: translateY(-18%) scale(1.06) rotate(-2deg); box-shadow: 0 0 0 4px var(--gold), 0 10px 20px rgba(0,0,0,.5); z-index: 2; }
button.vt-card.nogo::after { content: ''; position: absolute; inset: 3.2% 4.5%; border-radius: calc(var(--w) * .07); background: rgba(74,50,20,.2); }   /* a warm shade inside its rim (aged paper, not grey): no filter, nothing to blend */
button.vt-card:disabled { cursor: default; }
.vt-pile { --w: 3.4em; position: relative; height: calc(var(--w) * 1.4 + 6px); min-width: calc(var(--w) + 1em); }
.vt-pile .vt-card { position: absolute; top: 0; }
.vt-need { font-family: var(--display); font-size: 1.1em; text-align: center; padding: .1em .2em; color: rgba(255,248,224,.9); text-shadow: 0 1px 0 rgba(0,0,0,.35); max-width: 11em; line-height: 1.2; }   /* printed on the cloth */
.vt-need.cap { color: var(--gold); }
.vt-seat .cards { display: flex; gap: .35em; align-items: flex-end; min-height: calc(2.3em * 1.4 + .4em); }
.vt-seat .vt-card { --w: 2.3em; }
.vt-seat .col { position: relative; width: 2.3em; height: calc(2.3em * 1.4 + .4em); }
.vt-seat .col .vt-card { position: absolute; left: 0; }
.vt-seat .col .vt-card.back { top: 0; }
.vt-seat .col .vt-card.up { top: .4em; left: .15em; }
.vt-seat .hand-n { margin-left: auto; align-self: center; display: grid; justify-items: center; gap: .1em; font-size: .8em; color: var(--muted); }
.vt-seat .hand-n .count-badge { font-size: 1.1em; }
.vt-hand .tray .vt-card { --w: 4.6em; font-size: clamp(12px, 3.5vw, 18px); }
.vt-hand .tray.small .vt-card { --w: 2.7em; }
.vt-strip .vt-card { --w: 2.8em; }
html[data-screen=tv] .vt-felt .vt-card, html[data-screen=tv] .vt-pile { --w: min(7.2em, calc((100cqh - 5em) / 1.4)); }
html[data-screen=tv] .vt-seat .vt-card, html[data-screen=tv] .vt-seat .col { --w: 2.5em; width: 2.5em; }
html[data-screen=tv] .vt-need { font-size: 1.35em; max-width: none; white-space: nowrap; }

/* ═════════════ the card table (Last Card, Pile Up, Vändtia): wool felt in a walnut rail, under one lamp ═════════════ */
/* The rail and the felt's nap are two small pictures built by tools/party_cards/build_table.py (rail.webp is a frame cut in
   nine: its corners keep their shape on a table of any size; felt.webp tiles). The felt's colour stays here: each game
   has its own, and a wild card tints it. --R is the table's corner; the rail is drawn round it, half on, half off. */
.felt.ct { --R: 26px; border-radius: var(--R);
  background: linear-gradient(180deg, rgba(0,0,0,.36), transparent 14px), radial-gradient(ellipse 58% 78% at 46% 30%, rgba(255,234,190,.26), rgba(255,234,190,.07) 55%, transparent 80%), url(/party/games/cards/felt.webp?v=1) 0 0 / 96px 96px, radial-gradient(ellipse 72% 96% at 50% 40%, var(--felt), var(--felt-2) 100%);
  box-shadow: 0 1em 2.2em rgba(0,0,0,.55), inset 0 0 0 1px rgba(0,0,0,.5); }
/* No blurred shadow inside the cloth on a phone: whatever moves on it (a card that lands, a character that bobs) has the cloth under it painted
   again, and a blurred inner shadow is the dearest thing in that. The rail's shade is a gradient here; the TV has one soft inner shadow. */
.felt.ct::before, html[data-screen=tv] .felt.ct::before { content: ''; display: block; position: absolute; inset: calc(var(--R) * -.376); border-radius: 0; background: none; border: 1px solid transparent; border-image: url(/party/games/cards/rail.webp?v=1) 256 / calc(var(--R) * 1.376) stretch; pointer-events: none; z-index: 2; }
.lc-felt { --felt: #40358f; --felt-2: #18123e; }
.pu-felt { --felt: #1f6a80; --felt-2: #0b2a36; }
.vt-felt { --felt: #23804f; --felt-2: #0c3320; }
.felt.ct .stack.draw .lbl { margin-top: .35em; }
.felt.ct .stack .lbl { position: relative; z-index: 1; padding: .08em .7em; border-radius: 999px; background: rgba(8,6,16,.42); color: rgba(255,250,236,.92); font-weight: 600; text-shadow: none; }
html[data-screen=tv] .felt.ct { --R: 5em; border-radius: var(--R); margin: 1.5em 6vw 1.5em; padding: .5em 3em; background-size: auto, auto, 128px 128px, auto; background-image: none, radial-gradient(ellipse 58% 78% at 46% 30%, rgba(255,234,190,.26), rgba(255,234,190,.07) 55%, transparent 80%), url(/party/games/cards/felt.webp?v=1), radial-gradient(ellipse 72% 96% at 50% 40%, var(--felt), var(--felt-2) 100%); container-type: size; box-shadow: 0 1em 2.2em rgba(0,0,0,.55), inset 0 0 0 1px rgba(0,0,0,.5), inset 0 .3em 1.1em rgba(0,0,0,.5); }   /* a size container, as on a phone: its cards are as big as its height lets them be */
html[data-screen=tv] .board.ct::before { content: ''; position: absolute; inset: -4% -3%; z-index: -1; pointer-events: none; background: radial-gradient(ellipse 52% 46% at 50% 54%, rgba(255,190,110,.13), transparent 72%); }   /* the lamp's light on the room round the table */
html[data-screen=tv] .board.ct > .seats { position: relative; z-index: 3; }
html[data-screen=tv] .board.ct > .seats.top { margin-bottom: -1.05em; }
html[data-screen=tv] .board.ct > .seats.bottom { margin-top: -1.05em; }
html[data-screen=tv] .board.ct .seat { background: url(/party/games/cards/felt.webp?v=1) 0 0 / 128px 128px, linear-gradient(180deg, #2d2647, #19152a 72%); border: 1px solid rgba(255,255,255,.1); border-radius: 1.1em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 0 1.2em rgba(0,0,0,.35), 0 0 0 .15em #3b2414, 0 0 0 .21em rgba(214,170,92,.55), 0 .6em 1.4em rgba(0,0,0,.6); }
html[data-screen=tv] .board.ct .seat.turn { border-color: rgba(255,236,170,.5); background: url(/party/games/cards/felt.webp?v=1) 0 0 / 128px 128px, linear-gradient(180deg, #40355a, #241d36 72%); animation: ct-seat-pulse 1.6s ease-in-out infinite var(--play);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 0 1.2em rgba(242,210,122,.12), 0 0 0 .15em #6b4a1c, 0 0 0 .25em var(--gold), 0 0 1.6em rgba(242,210,122,.4), 0 .6em 1.4em rgba(0,0,0,.6); }
@keyframes ct-seat-pulse { 50% { box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 0 1.2em rgba(242,210,122,.2), 0 0 0 .15em #6b4a1c, 0 0 0 .25em var(--gold), 0 0 2.6em rgba(242,210,122,.62), 0 .6em 1.4em rgba(0,0,0,.6); } }
html[data-screen=tv] .board.ct .seat.away.turn, html.motion-reduced .board.ct .seat.turn { animation: none; }
html[data-screen=tv] .board.ct .seat::after { content: ''; position: absolute; inset: .3em; border-radius: .85em; border: 1px dashed rgba(255,232,170,.2); pointer-events: none; }   /* a seat is a leather pad: its seam */
html[data-screen=tv] .board.ct .seat.turn::after { border-color: rgba(255,232,170,.42); }
/* your side of the table on a phone: the row you play from lies on the game's felt (darker, the same nap) */
.lc-hand .tray.active, .pu-hand .tray.active, .vt-hand .tray.active { --felt: #1d6b43; --felt-2: #0b2a1a; background: url(/party/games/cards/felt.webp?v=1) 0 0 / 96px 96px, radial-gradient(ellipse 90% 120% at 50% 0%, var(--felt), var(--felt-2) 92%); }
.lc-hand .tray.active { --felt: #352b7c; --felt-2: #151034; }
.pu-hand .tray.active { --felt: #1a5a6d; --felt-2: #09232d; }
#partyView[data-fit] .lc-hand .tray.active.wait, #partyView[data-fit] .pu-hand .tray.active.wait, #partyView[data-fit] .vt-hand .tray.active.wait { background: url(/party/games/cards/felt.webp?v=1) 0 0 / 96px 96px, radial-gradient(ellipse 90% 120% at 50% 0%, color-mix(in srgb, var(--felt) 55%, #0b0a12), color-mix(in srgb, var(--felt-2) 70%, #0b0a12) 92%); }
/* the cloth is printed: a pinstripe inside the rail, and on the TV the game's name left and right of the piles */
.felt.ct::after { content: ''; position: absolute; inset: calc(var(--R) * .34); border-radius: calc(var(--R) * .66); border: 1.5px solid rgba(255,244,214,.13); pointer-events: none; }
.ct-print { display: none; }
html[data-screen=tv] .ct-print { display: block; position: absolute; top: 50%; width: 16%; transform: translateY(-50%); text-align: center; font-family: var(--display); font-weight: 700; font-size: 1.5em; line-height: 1.05; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,244,214,.1); pointer-events: none; }
html[data-screen=tv] .ct-print.l { left: 4%; }
html[data-screen=tv] .ct-print.r { right: 4%; }
/* the light on the felt by the seat whose turn it is (look.js turnLight puts it there) */
.ct-light { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.ct-light > i { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse 20% 66% at 50% 50%, rgba(255,228,160,.5), rgba(255,228,160,.15) 48%, transparent 74%); transition: transform .7s var(--ease), opacity .4s; }
html.motion-reduced .ct-light > i { transition: none; }
/* a deck lies thick: the edges of the cards under the top one (d1 a few, d3 a full pack) */
.deck.d1 { box-shadow: 0 calc(var(--w) * .02) 0 #e6dcc4, 0 calc(var(--w) * .04) 0 #8f8674, 0 calc(var(--w) * .1) calc(var(--w) * .14) rgba(0,0,0,.5); }
.deck.d2 { box-shadow: 0 calc(var(--w) * .02) 0 #e6dcc4, 0 calc(var(--w) * .04) 0 #a39a86, 0 calc(var(--w) * .06) 0 #e6dcc4, 0 calc(var(--w) * .08) 0 #8f8674, 0 calc(var(--w) * .14) calc(var(--w) * .16) rgba(0,0,0,.5); }
.deck.d3 { box-shadow: 0 calc(var(--w) * .02) 0 #e6dcc4, 0 calc(var(--w) * .04) 0 #a39a86, 0 calc(var(--w) * .06) 0 #e6dcc4, 0 calc(var(--w) * .08) 0 #a39a86, 0 calc(var(--w) * .1) 0 #e6dcc4, 0 calc(var(--w) * .12) 0 #8f8674, 0 calc(var(--w) * .18) calc(var(--w) * .18) rgba(0,0,0,.5); }

/* ═════════════ Last Card (games/lastcard.js): our own cards, four colours each with its shape ═════════════ */
/* A card is its picture (lastcard.js draws each kind once, as the background) and the type on it: the number in the seal,
   the number again in two corners, the second one turned as on a playing card. */
.lc-card { --w: 3.6em; --lc: #262040; width: var(--w); height: calc(var(--w) * 1.45); border-radius: calc(var(--w) * .1); position: relative; display: grid; place-items: center; flex: none; user-select: none; font-family: var(--display); font-weight: 700; color: #fbf5e6; background: var(--lc) center / 100% 100% no-repeat; border: 0; padding: 0; overflow: hidden; line-height: 1;
  box-shadow: 0 calc(var(--w) * .012) 0 rgba(0,0,0,.4), 0 calc(var(--w) * .03) calc(var(--w) * .05) rgba(0,0,0,.3), 0 calc(var(--w) * .09) calc(var(--w) * .16) calc(var(--w) * -.05) rgba(0,0,0,.5); }
.lc-card.c-o, .lc-swatch.c-o, .lc-colorbtn.c-o, .fx-stamp.c-o { --lc: #ef7d22; }
.lc-card.c-g, .lc-swatch.c-g, .lc-colorbtn.c-g, .fx-stamp.c-g { --lc: #3fa34d; }
.lc-card.c-b, .lc-swatch.c-b, .lc-colorbtn.c-b, .fx-stamp.c-b { --lc: #2f7fd8; }
.lc-card.c-p, .lc-swatch.c-p, .lc-colorbtn.c-p, .fx-stamp.c-p { --lc: #8a4fd8; }
.lc-card .mid { position: relative; font-size: calc(var(--w) * .58); letter-spacing: -.02em; text-shadow: .035em .05em 0 rgba(24,8,34,.5); }
.lc-card.c-g .mid { font-size: calc(var(--w) * .42); top: 4.4%; }                 /* the triangle holds less, and lower */
.lc-card.c-b .mid { font-size: calc(var(--w) * .5); }
.lc-card.c-p .mid { font-size: calc(var(--w) * .54); }
.lc-card .mid.sym { font-size: calc(var(--w) * .34); top: 6.9%; }
.lc-card.c-g .mid.sym { font-size: calc(var(--w) * .3); top: 9%; }
.lc-card.wild .mid.sym { font-size: calc(var(--w) * .27); top: 0; }
.lc-card .u { text-decoration: underline; text-underline-offset: .09em; text-decoration-thickness: .07em; }
.lc-card .cn { position: absolute; width: 22%; text-align: center; font-size: calc(var(--w) * .21); line-height: 1; text-shadow: 0 .06em 0 rgba(24,8,34,.4); }
.lc-card .tl { top: 6%; left: 4.5%; }
.lc-card .br { bottom: 6%; right: 4.5%; transform: rotate(180deg); }
.lc-card.v-d2 .cn, .lc-card.v-w4 .cn { font-size: calc(var(--w) * .165); letter-spacing: -.04em; }
.lc-card.v-d2 .tl, .lc-card.v-w4 .tl { top: 7.4%; }
.lc-card.v-d2 .br, .lc-card.v-w4 .br { bottom: 7.4%; }
.lc-card.ghost { background: transparent; border: 2px dashed rgba(255,255,255,.3); box-shadow: none; }
.lc-card.back.mini { --w: 1.15em; margin-left: -.55em; border-radius: 2px; background: #2a2150; box-shadow: inset 0 0 0 1.5px #efe6d0, inset 0 0 0 2.5px #2a2150, inset 0 0 0 3px rgba(242,210,122,.7), 0 1px 2px rgba(0,0,0,.5); transform: rotate(calc(var(--i, 0) * 1.5deg - 6deg)); }
button.lc-card { cursor: pointer; font-size: inherit; transition: transform .18s var(--bounce), box-shadow .18s; }
button.lc-card.go { transform: translateY(-7%); box-shadow: 0 0 0 2px #fff8e2, 0 0 0 4px rgba(242,210,122,.8), 0 8px 16px rgba(0,0,0,.5), 0 0 1em rgba(242,210,122,.5); }
button.lc-card.sel { transform: translateY(-18%) scale(1.06) rotate(-2deg); box-shadow: 0 0 0 4px var(--gold), 0 10px 20px rgba(0,0,0,.5); z-index: 2; }
button.lc-card.nogo::after { content: ''; position: absolute; inset: 3% 4.4%; border-radius: calc(var(--w) * .076); background: color-mix(in srgb, color-mix(in srgb, var(--lc) 34%, #140c22) 42%, transparent); }   /* a shade of its own colour over its field, the cream rim left bright: no filter, nothing to blend, and never grey */
.lc-heap { display: grid; place-items: center; }
/* a card played by somebody else turns over on its way to the pile: its back first (lastcard.js gives the picture), then its face */
.lc-flight { display: block; }
.fx-fly > .turning { animation: card-turn .46s linear both; }
.fx-fly > .turning::before { content: ''; position: absolute; inset: 0; z-index: 2; background: center / 100% 100% no-repeat; animation: card-back .46s step-end both; }
@keyframes card-turn { 0% { transform: scaleX(1); } 42% { transform: scaleX(.05); } 100% { transform: scaleX(1); } }
@keyframes card-back { 0% { opacity: 1; } 42%, 100% { opacity: 0; } }
.lc-heap > * { grid-area: 1 / 1; }
/* the colour that goes now: a chip on the felt (its picture is lastcard.js's), the direction of play turning round it */
.lc-token { --tk: 3em; position: relative; display: block; flex: none; width: var(--tk); height: var(--tk); margin: calc(var(--tk) * .26); border-radius: 50%; background: var(--lc, #2a2344) center / 100% 100% no-repeat; box-shadow: 0 calc(var(--tk) * .045) 0 rgba(0,0,0,.5), 0 calc(var(--tk) * .12) calc(var(--tk) * .2) rgba(0,0,0,.5); }
.lc-token .ring { position: absolute; inset: -26%; animation: lc-turn 10s linear infinite var(--play); }
.lc-token .ring.ccw { animation-direction: reverse; }
.lc-token .ring::before { content: ''; position: absolute; inset: 0; background: center / 100% 100% no-repeat; opacity: .9; }
.lc-token .ring.ccw::before { transform: scaleX(-1); }
html.motion-reduced .lc-token .ring { animation: none; }
.lc-swatch { display: inline-flex; align-items: center; gap: .4em; padding: .3em .7em; border-radius: 999px; background: var(--lc, #444); color: #fff; font-weight: 700; font-family: var(--display); white-space: nowrap; box-shadow: 0 .2em .6em rgba(0,0,0,.35), inset 0 0 0 2px rgba(255,255,255,.22), inset 0 -.5em .8em rgba(0,0,0,.14); }
.lc-swatch.any { background: conic-gradient(#ef7d22 0 25%, #3fa34d 0 50%, #2f7fd8 0 75%, #8a4fd8 0); text-shadow: 0 0 4px #000; }
.lc-swatch.big { font-size: 1.25em; padding: .4em .9em; }
.lc-felt .lc-card.top { --w: 4.6em; }
.lc-felt .stack.colour { gap: 0; }
.lc-felt .lc-swatch.big { font-size: 1em; padding: .25em .8em; }
.lc-pending { color: #ffd27a; background: rgba(20,14,36,.6); border: 1px solid rgba(242,210,122,.45); border-radius: 12px; padding: .4em .8em; }
.lc-catch { background: rgba(200,34,66,.5); border: 2px solid var(--red); border-radius: 12px; padding: .5em .8em; animation: pulse-sm 1s ease-in-out infinite var(--play); }
@keyframes pulse-sm { 50% { transform: scale(1.03); } }
.lc-seat .fan { display: flex; align-items: center; padding-left: .55em; min-height: 1.9em; }
.lc-seat .fan .count { margin-left: .5em; }
.lc-round { background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: .8em 1em; animation: pop-in .5s var(--ease) both; }
.lc-round h3 { margin: 0 0 .3em; }
.lc-scores { margin: .3em 0; padding-left: 1.3em; }
.lc-scores li span { margin-left: .6em; font-family: var(--display); }
.lc-hand .lc-cards .lc-card { --w: 4.4em; font-size: clamp(12px, 3.5vw, 18px); }
.lc-strip .lc-card { --w: 2.8em; }
.lc-callbtn { background: linear-gradient(135deg, #ffe08a, #f2b84a); color: #241c05; border-color: transparent; font-family: var(--display); font-size: 1.3em; animation: pulse-sm 1s ease-in-out infinite var(--play); box-shadow: 0 .4em 1.2em rgba(242,184,74,.5); }
.lc-catchbtn { background: linear-gradient(135deg, #ff6b8a, #e01e45); color: #fff; border-color: transparent; font-family: var(--display); animation: pulse-sm .8s ease-in-out infinite var(--play); box-shadow: 0 .4em 1.2em rgba(244,63,94,.5); }
.lc-pick { display: grid; gap: 8px; animation: rise .3s var(--ease) both; }
.lc-colors { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.lc-colorbtn { min-height: 56px; border-radius: 14px; border: 0; background: var(--lc); color: #fff; font-weight: 700; font-size: 1.05em; display: flex; align-items: center; justify-content: center; gap: .5em; cursor: pointer; box-shadow: 0 .3em .8em rgba(0,0,0,.35), inset 0 0 0 2px rgba(255,255,255,.25), inset 0 -.6em 1em rgba(0,0,0,.16); transition: transform .15s var(--bounce); }
.lc-colorbtn:active { transform: scale(.95); }
.lc-targets { display: grid; gap: 8px; }
.lc-targets .btn { justify-content: flex-start; }
.lc-targets .avatar.tiny { width: 30px; height: 31px; }
html[data-screen=tv] .lc-felt .lc-card { --w: min(6.4em, calc((100cqh - 4.2em) / 1.84)); }
html[data-screen=tv] .lc-felt .lc-card.top { --w: min(7.8em, calc((100cqh - 4.2em) / 1.5)); }
html[data-screen=tv] .lc-felt .stack.pile .lbl { margin-top: .5em; }      /* (a card that lies askew reaches lower than one that lies straight) */
html[data-screen=tv] .lc-felt .lc-token { --tk: min(5.8em, calc((100cqh - 3em) / 1.9)); }
html[data-screen=tv] .lc-felt .felt-in { gap: 3.4em; }

/* ═════════════ Pile Up (games/pileup.js): a storey of a tower of twelve, in three bands of colour; a star for the wild card ═════════════ */
/* A card is its picture (pileup.js draws each number once, as the background: the brick as high as the number counts) and
   the type on it: the number on the brick (--n sets how high) and in the upper corner. */
.pu-card { --w: 3.2em; --ink: #0a4f44; --pu: #1b9a83; width: var(--w); height: calc(var(--w) * 1.4); border-radius: calc(var(--w) * .1); position: relative; display: grid; place-items: center; flex: none; user-select: none; font-family: var(--display); font-weight: 700; background: var(--pu) center / 100% 100% no-repeat; color: var(--ink); border: 0; padding: 0; overflow: hidden; line-height: 1;
  box-shadow: 0 calc(var(--w) * .012) 0 rgba(0,0,0,.4), 0 calc(var(--w) * .03) calc(var(--w) * .05) rgba(0,0,0,.3), 0 calc(var(--w) * .09) calc(var(--w) * .16) calc(var(--w) * -.05) rgba(0,0,0,.5); }
.pu-card.r2 { --ink: #7a4200; --pu: #ee9a1f; }
.pu-card.r3 { --ink: #771233; --pu: #dc4873; }
.pu-card .n { position: relative; top: calc(28.5% - var(--n, 6) * 2.786%); font-size: calc(var(--w) * .44); letter-spacing: -.03em; }
.pu-card .u { text-decoration: underline; text-underline-offset: .09em; text-decoration-thickness: .07em; }
.pu-card .cn { position: absolute; font-size: calc(var(--w) * .27); line-height: 1; letter-spacing: -.03em; color: #fbf5e6; text-shadow: 0 .07em 0 rgba(0,0,0,.4); }
.pu-card .tl { top: 5%; left: 8%; }
.pu-card.wild { --pu: #2c2158; color: var(--gold); }
.pu-card .wl { position: absolute; bottom: 8%; left: 0; right: 0; text-align: center; font-size: calc(var(--w) * .17); color: #fbf5e6; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 .2em; }
.pu-card.ghost { background: linear-gradient(180deg, rgba(0,0,0,.4), rgba(0,0,0,.18) 45%, rgba(0,0,0,.24)); border: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.12); color: rgba(255,255,255,.55); font-size: 1.1em; }   /* an empty place: a well pressed into the cloth */
button.pu-card { cursor: pointer; font-size: inherit; transition: transform .18s var(--bounce), box-shadow .18s, opacity .2s; }
button.pu-card.go { transform: translateY(-6%); box-shadow: 0 0 0 2px #fff8e2, 0 0 0 4px rgba(242,210,122,.8), 0 6px 12px rgba(0,0,0,.45), 0 0 .8em rgba(242,210,122,.5); }
button.pu-card.sel, .pu-discard.sel .pu-card.top { transform: translateY(-14%) scale(1.06) rotate(-2deg); box-shadow: 0 0 0 4px var(--gold), 0 8px 16px rgba(0,0,0,.45); z-index: 2; }
/* a small card (the others' stock cards and discard tops on a phone): no picture, the number on the band's tint */
.pu-opp .pu-card, .pu-strip .other .pu-card.mini { background-image: none !important; color: #fbf5e6; }   /* (over the picture's own rule, which comes later in the page) */
.pu-opp .pu-card .n, .pu-strip .other .pu-card.mini .n { top: 0; text-shadow: none; }
.pu-opp .pu-card.wild, .pu-strip .other .pu-card.mini.wild { color: var(--gold); }
.pu-opp .pu-card.wild::after, .pu-strip .other .pu-card.mini.wild::after { content: '★'; font-size: calc(var(--w) * .62); line-height: 1; }
.pu-opp .pu-card.ghost, .pu-strip .other .pu-card.mini.ghost { background: rgba(0,0,0,.32); box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); }
.pu-build { display: grid; justify-items: center; gap: .3em; background: none; border: 0; color: inherit; padding: 4px; font: inherit; border-radius: 12px; position: relative; }
.pu-build .lbl { color: rgba(255,255,255,.85); font-size: .85em; white-space: nowrap; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.felt.ct .pu-build .lbl { padding: .08em .7em; border-radius: 999px; background: rgba(8,6,16,.42); color: rgba(255,250,236,.92); text-shadow: none; }
button.pu-build { cursor: pointer; transition: transform .15s var(--bounce); }
button.pu-build.go { box-shadow: 0 0 0 3px var(--gold); background: rgba(242,210,122,.15); animation: pulse-sm 1s ease-in-out infinite var(--play); }
button.pu-build.nogo { opacity: .45; }
.pu-seat .row-cards { display: flex; gap: .8em; align-items: flex-start; }
.pu-seat .pu-card { --w: 2.1em; }
.pu-stock { position: relative; flex: none; }
.pu-seat .pu-stock .pu-card { --w: 2.8em; }
.pu-stock .badge-n { position: absolute; right: -.5em; top: -.5em; background: var(--gold); color: #241c05; border-radius: 999px; padding: 0 .45em; font-weight: 700; font-size: .8em; z-index: 2; min-width: 1.7em; text-align: center; line-height: 1.6; box-shadow: 0 .2em .5em rgba(0,0,0,.4); }
.pu-stock .badge-n.hot { background: var(--red); color: #fff; animation: seat-pulse 1s ease-in-out infinite var(--play); }
.pu-discards { display: flex; gap: .35em; align-items: flex-start; }
.pu-discard { position: relative; display: flex; flex-direction: column; align-items: center; background: none; border: 0; padding: 3px; color: inherit; font: inherit; border-radius: 10px; }
.pu-discard .pu-card.under { margin-bottom: calc(var(--w) * -1.08); }
.pu-discard .more { font-size: .7em; color: var(--muted); line-height: 1.2; }
button.pu-discard { cursor: pointer; }
button.pu-discard.go { box-shadow: 0 0 0 3px rgba(242,210,122,.75); background: rgba(242,210,122,.12); }
.pu-hand .pu-cards .pu-card { --w: 3.6em; font-size: clamp(12px, 3.5vw, 17px); }
.pu-hand .felt { padding: .5em .4em; --R: 18px; }
.pu-hand .felt-in { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .3em; }
.pu-hand .felt .pu-build { padding: 2px; min-width: 0; }
.pu-hand .felt .pu-build .pu-card { --w: min(3.2em, 17vw); }
.pu-hand .felt .pu-build .lbl { font-size: .72em; white-space: normal; text-align: center; line-height: 1.15; }
.pu-hand .pu-discard .pu-card { --w: 2.6em; }
.pu-mine { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.pu-stockbox, .pu-discbox { display: grid; gap: 6px; align-content: start; }
.pu-strip .words b { font-family: var(--display); }
.pu-table .felt-in { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6em; justify-items: center; }
.pu-seat .row-cards { flex-wrap: wrap; }
html[data-screen=tv] .pu-felt .pu-card { --w: min(7em, calc((100cqh - 4em) / 1.4)); }
html[data-screen=tv] .pu-felt .felt-in { display: flex; gap: 2.4em; }

/* ═════════════ Calm: nothing bobs, pulses or flies; a stamp just shows ═════════════ */
html.motion-reduced body::before, html.motion-reduced .ch .c-head, html.motion-reduced .ch .c-eyes, html.motion-reduced .tv-code, html.motion-reduced .tv-qr, html.motion-reduced .tv-people .crown,
html.motion-reduced .seat.turn, html.motion-reduced .turn-tag, html.motion-reduced .count-badge.hot, html.motion-reduced .pu-stock .badge-n.hot, html.motion-reduced .lc-catch, html.motion-reduced .lc-callbtn, html.motion-reduced .lc-catchbtn,
html.motion-reduced button.pu-build.go, html.motion-reduced .fuss .avatar, html.motion-reduced .fx-flames i, html.motion-reduced [data-mood] .c-head, html.motion-reduced [data-mood] .fx-spark path, html.motion-reduced [data-mood] .fx-dots, html.motion-reduced [data-mood] .fx-zzz text { animation: none; }
html.motion-reduced .p-hand, html.motion-reduced .say.mine, html.motion-reduced .tv-people li.new, html.motion-reduced .cast-grid label, html.motion-reduced .podium li, html.motion-reduced .tv-join, html.motion-reduced .tv-game-pick, html.motion-reduced .tv-standings, html.motion-reduced .notice, html.motion-reduced .ticker .new, html.motion-reduced .badge, html.motion-reduced .lc-round, html.motion-reduced .lc-pick, html.motion-reduced .toast,
html.motion-reduced .pchip, html.motion-reduced .pchip .crown, html.motion-reduced .tile, html.motion-reduced .step, html.motion-reduced .tv-show, html.motion-reduced .start-btn, html.motion-reduced .waiting .dot { animation: none; }
html.motion-reduced .tile, html.motion-reduced .switch, html.motion-reduced .switch i, html.motion-reduced .seg-btn, html.motion-reduced .many-chip, html.motion-reduced .pchip.add { transition: none; }
html.motion-reduced .fx-stamp { animation: none; opacity: 1; }
html.motion-reduced .fuss .stamp, html.motion-reduced .fuss .sub { animation: none; opacity: 1; }
html.motion-reduced .seat, html.motion-reduced .seat .who .avatar, html.motion-reduced button.vt-card, html.motion-reduced button.lc-card, html.motion-reduced button.pu-card, html.motion-reduced .btn { transition: none; }
html.motion-reduced .tv-qr { transform: none; }
/* the show on the TV in Calm: nothing drifts, hops, waves, turns, jumps or drips; the title moment, the curtain and the welcome just fade */
html.motion-reduced .tv-lights i, html.motion-reduced .tv-qr-wrap::before, html.motion-reduced .tv-people li .avatar, html.motion-reduced .tv-people li .avatar:not([data-mood]) .c-arm.r, html.motion-reduced .tv-people li .avatar:not([data-mood]) .c-pupil,
html.motion-reduced .tv-people.cheer li:not(.new), html.motion-reduced .tv-parade-strip, html.motion-reduced .tv-walker, html.motion-reduced .tv-show .g-art::after, html.motion-reduced .tv-lobby.enter .tv-side-head, html.motion-reduced .tv-lobby.enter .tv-people,
html.motion-reduced .tv-intro .rays, html.motion-reduced .g-art.huge, html.motion-reduced .intro-name, html.motion-reduced .intro-who, html.motion-reduced .intro-eyebrow, html.motion-reduced .intro-rules,
html.motion-reduced .tv-standings .step .block, html.motion-reduced .tv-standings .step .who, html.motion-reduced .tv-standings .step .nm, html.motion-reduced .tv-standings .step .lbl, html.motion-reduced .tv-standings .step.first .avatar, html.motion-reduced .tv-standings .step.loser .avatar,
html.motion-reduced .tv-standings .step.first .spot, html.motion-reduced .fate, html.motion-reduced .fate .drop { animation: none; }
html.motion-reduced .tv-standings .step.first .spot, html.motion-reduced .fate { opacity: 1; }
html.motion-reduced .fate .drop { display: none; }
html.motion-reduced .tv-show.enter { animation: fade-in .5s both; }
html.motion-reduced .tv-intro.out { animation: fade-out .6s both; transform: none; }
html.motion-reduced .intro-count span { animation: count-fade .5s both; animation-delay: calc(1.7s + var(--i, 0) * .5s); }
html.motion-reduced .intro-count span.go { animation: fade-in .4s both; animation-delay: 3.05s; opacity: 1; transform: translate(-50%, -50%); }
html.motion-reduced .tv-intro.counting .intro-stage { transform: none; }
html.motion-reduced .tv-curtain.go { animation: fade-out .8s both; }
html.motion-reduced .tv-welcome { animation: welcome-fade 3.6s both; transform: none; }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes count-fade { 0% { opacity: 0; } 30%, 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes welcome-fade { 0% { opacity: 0; } 10%, 85% { opacity: 1; } 100% { opacity: 0; } }

/* ---- small phones ---- */
@media (max-width: 520px) {
  main { padding: 12px; }
  .p-hand { margin-left: -12px; margin-right: -12px; }
  .seats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seat .who .avatar { width: 2.4em; height: 2.5em; }
  .vt-seat .vt-card, .vt-seat .col { --w: 1.9em; width: 1.9em; }
  .felt-in { gap: 1em; }
  .fx-stamp .big { font-size: 2.6em; }
  .fx-stamp.skip .big, .fx-stamp.rev .big { font-size: 4em; }
  .pu-seat .pu-card { --w: 1.8em; } .pu-seat .pu-stock .pu-card { --w: 2.3em; }
  .pu-table .seats { grid-template-columns: minmax(0, 1fr); }
  .vt-seat .vt-card .tag { display: none; } .vt-seat .vt-card.special .cn.br { display: grid; }
  .p-start { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .tile { grid-template-columns: 84px minmax(0, 1fr); gap: 0 10px; padding: 8px; }
  .g-art { width: 84px; }
  .g-art.big { width: 112px; }
  .over-acts { grid-template-columns: 1fr; }
  .step .avatar { width: 48px; height: 50px; } .step.p1 .avatar { width: 64px; height: 66px; }
}

/* ═════════════ a card game on a phone: one screen, no scroll ═════════════
   shell.js sets [data-fit] on #partyView (and on body) while a game whose renderer says fit: true is played (Vändtia,
   Last Card, Pile Up). The page is then exactly the screen (100dvh: what the browser's bars leave), the header steps aside
   (its language switch moves into the menu), the menu is a round button in the corner that opens a sheet over the game.
   With no TV the table takes what the hand leaves and scales to it (a size container: its cards are sized by its height);
   with a TV the hand has the whole screen, the table in short at its top. Sideways: the table (or the short table) to the
   left, the hand to the right. Clear of the notch and the home bar (env(safe-area-inset-*)). The pause, a notice and the
   game's loading line lie over the game instead of pushing it about. */
html[data-screen=phone] body[data-fit] { overflow: hidden; overscroll-behavior: none; height: 100vh; height: 100dvh; min-height: 0; }
html[data-screen=phone] body[data-fit] header.top { display: none; }
html[data-screen=phone] body[data-fit] main { padding: 0; max-width: none; height: 100%; }
html[data-screen=phone] #partyView[data-fit] { position: relative; height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; overflow: clip; }
html[data-screen=phone] body[data-fit] .toast { top: calc(10px + env(safe-area-inset-top, 0px)); }
body[data-fit] .conn { top: calc(8px + env(safe-area-inset-top, 0px)); }
#partyView[data-fit] > .p-qr, #partyView[data-fit] > .p-mine, #partyView[data-fit] > .p-lobby, #partyView[data-fit] > .p-start, #partyView[data-fit] > .p-over { display: none !important; }
/* over the game: a notice, the loading line, the pause */
#partyView[data-fit] > .p-notice, #partyView[data-fit] > .p-status { position: absolute; z-index: 25; left: 50%; top: calc(58px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); width: min(92%, 30em); pointer-events: none; }
#partyView[data-fit] > .p-notice .notice, #partyView[data-fit] > .p-status p { margin: 0 0 6px; padding: 10px 14px; border-radius: 14px; text-align: center; background: rgba(36,31,51,.95); border: 1px solid rgba(242,210,122,.4); box-shadow: 0 12px 30px rgba(0,0,0,.5); }
#partyView[data-fit] > .p-paused:empty, #partyView[data-fit] > .p-notice:empty, #partyView[data-fit] > .p-status:empty { display: none; }
#partyView[data-fit] > .p-paused { position: absolute; inset: 0; z-index: 26; display: grid; place-items: center; padding: 24px; background: rgba(8,7,14,.62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.paused-banner { display: grid; gap: 10px; justify-items: center; }
#partyView[data-fit] .paused-banner { margin: 0; padding: 22px 24px; max-width: 22em; background: #241f33; border-width: 2px; box-shadow: 0 20px 50px rgba(0,0,0,.55); animation: pop-in .45s var(--bounce) both; }
#partyView[data-fit] .paused-banner::before { content: '⏸'; font-size: 1.6em; line-height: 1; }
/* the menu: a round button in the top corner; open, a sheet over the game (a tap beside it closes it) */
.p-more .menu-ic { display: none; }
#partyView[data-fit] > .p-more { position: absolute; z-index: 30; top: max(6px, env(safe-area-inset-top)); right: max(6px, env(safe-area-inset-right)); margin: 0; padding: 0; background: none; border: 0; }
#partyView[data-fit] > .p-more > summary { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(29,26,43,.9); border: 1px solid var(--line-2); box-shadow: 0 4px 14px rgba(0,0,0,.45); color: var(--text); font-size: 20px; }
#partyView[data-fit] > .p-more > summary::before { display: none; }
#partyView[data-fit] > .p-more .menu-ic { display: inline; line-height: 1; }
#partyView[data-fit] > .p-more > summary { position: relative; }
#partyView[data-fit] > .p-more .menu-crown { position: absolute; top: -3px; right: -4px; font-size: 16px; line-height: 1; transform: rotate(14deg); filter: drop-shadow(0 1px 2px rgba(0,0,0,.7)); pointer-events: none; }
#partyView[data-fit] > .p-more[open] .menu-crown { display: none; }
#partyView[data-fit] > .p-more .menu-words { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#partyView[data-fit] > .p-more[open] { left: max(6px, env(safe-area-inset-left)); max-height: calc(100% - 12px); overflow: auto; overscroll-behavior: contain; padding: 54px 14px 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 22px; box-shadow: 0 24px 70px rgba(0,0,0,.7); animation: pop-in .3s var(--ease) both; }
#partyView[data-fit] > .p-more[open] > summary { position: absolute; top: 6px; right: 6px; }
#partyView[data-fit] > .p-more[open] > summary .menu-ic { display: none; }
#partyView[data-fit] > .p-more[open] > summary::after { content: '✕'; }
#partyView[data-fit] > .p-more .row .btn.small { min-height: 44px; }

/* ---- the table on the phone (no TV): the others along the top, the felt in what is left, the last moves ---- */
#partyView[data-fit] > .p-table { flex: 1 1 0; min-height: 0; margin: 0; overflow: hidden; overflow: clip; container-type: size; padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 4px max(10px, env(safe-area-inset-left)); }
.ptable { height: 100%; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.ptable-head { display: grid; justify-items: center; gap: 4px; padding-right: 50px; }
.ptable-head .status-line { font-size: 1.15em; text-align: center; }
.opps { --cols: 2; flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding-right: 50px; }   /* the right end of the first row: the menu button */
.opps > .opp { flex: 1 1 calc(100% / min(var(--n, 2), var(--cols)) - 6px); }
.opps.many { --cols: 3; }
.opp { position: relative; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 6px; padding: 5px 8px 6px 4px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); transition: border-color .3s, box-shadow .3s, background .3s; }
.opp > .avatar { grid-row: 1 / span 3; width: 38px; height: 40px; }
.opp-nm { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 14px; line-height: 1.15; }
.opp-nm b { min-width: 0; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }   /* the whole width of the chip, two lines if need be */
.opp-nm .count-badge { position: absolute; z-index: 2; left: 25px; top: -5px; font-size: 13px; min-width: 1.6em; height: 1.6em; box-shadow: 0 2px 6px rgba(0,0,0,.5); }   /* how many cards: on the character's corner */
.opp-tag { grid-column: 2; font-size: 14px; line-height: 1.2; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-cards { grid-column: 2; display: flex; align-items: flex-end; gap: 3px; min-width: 0; margin-top: 2px; }
.opp.turn { border-color: var(--gold); background: linear-gradient(180deg, #2c2540, #1b1828); box-shadow: 0 0 0 3px rgba(242,210,122,.22), 0 0 18px rgba(242,210,122,.35); animation: seat-pulse 1.6s ease-in-out infinite var(--play); }
.opp .turn-tag { top: auto; bottom: -.75em; left: auto; right: 6px; transform: none; font-size: 14px; padding: 0 .55em; animation: opp-tag 0.9s ease-in-out infinite var(--play); }
.opp .turn-tag::after { display: none; }
@keyframes opp-tag { 50% { transform: translateY(-3px) rotate(-3deg); } }
.opp .away-tag { right: 6px; bottom: -.7em; font-size: 13px; }
.opp.away { opacity: .72; border-style: dashed; }
.opp.away.turn { animation: none; }
.opp.out { opacity: .55; }
.opp.loser { border-color: var(--red); }
.ptable > .felt { flex: 1 1 0; min-height: 0; display: grid; place-items: center; margin: 6px 4px 2px; padding: 6px 10px; border-radius: 22px; container-type: size; }   /* its cards are sized by the room it has (cqw, cqh) */
.ptable > .felt.ct { --R: 24px; border-radius: var(--R); }
.ptable > .felt .felt-in { width: 100%; height: 100%; flex-wrap: nowrap; gap: 4%; overflow: hidden; overflow: clip; }
.ptable > .felt .stack .lbl { font-size: 14px; white-space: nowrap; }
@container (max-height: 120px) { .ptable > .felt .stack .lbl, .ptable > .felt .pu-build .lbl { display: none; } }
.vt-opp .opp-cards { display: none; }
.opps > .vt-opp:nth-last-child(-n+3):first-child .opp-cards, .opps > .vt-opp:nth-last-child(-n+3):first-child ~ .opp .opp-cards { display: flex; }   /* Vändtia's face-up cards on the chips: for up to three others */
/* then (look.js, [data-crowd]) the others go small, in one row: the character with its count on the corner, the name under it */
.opps.many > .opp { grid-template-columns: auto auto; justify-content: center; align-items: center; column-gap: 5px; row-gap: 2px; padding: 6px 4px 4px; }
.opps.many > .opp > .avatar { grid-row: 1; grid-column: 1; width: 32px; height: 33px; }
.opps.many > .opp > .opp-cards { grid-row: 1; grid-column: 2; margin: 0; }
.opps.many > .opp > .opp-nm, .opps.many > .opp > .opp-tag { grid-column: 1 / -1; justify-content: center; max-width: 100%; font-size: 13px; text-align: center; }
.opps.many .opp-nm b { text-align: center; }
.opps.many .opp-nm .count-badge { left: -5px; top: -7px; }
.opps.many .pu-opp .pu-dtop { display: none; }   /* Pile Up in a tile: the stock card they are after beside the character, not their discards */
#partyView[data-crowd] .opps { flex-wrap: nowrap; gap: 4px; }
#partyView[data-crowd] .opps > .opp { flex: 1 1 0; grid-template-columns: minmax(0, 1fr); justify-items: center; row-gap: 1px; padding: 5px 3px 3px; border-radius: 12px; }
#partyView[data-crowd] .opp > .avatar { grid-row: auto; width: 30px; height: 31px; }
#partyView[data-crowd] .opp-nm { grid-column: 1; justify-content: center; max-width: 100%; font-size: 13px; }
#partyView[data-crowd] .opp-nm b { -webkit-line-clamp: 1; text-align: center; }
#partyView[data-crowd] .opp-nm .count-badge { left: calc(50% + 4px); top: -3px; }
#partyView[data-crowd] .opp-tag, #partyView[data-crowd] .opps .opp-cards, #partyView[data-crowd] .opp .turn-tag, #partyView[data-crowd] .opp .away-tag { display: none; }   /* a felt squeezed by a long hand: the cards, without their labels */
.ptable > .felt .banner { position: absolute; left: 0; right: 0; bottom: 6px; margin: 0 auto; width: max-content; max-width: 94%; font-size: 14px; }   /* centred without a transform: a banner that pulses (scale) stays put */
.ptable > .ticker { flex: none; display: grid; gap: 0; font-size: 14px; line-height: 1.35; min-height: 2.7em; padding: 0 4px; }
.ptable > .ticker > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@container (max-height: 300px) { .ptable > .ticker { display: none; } }   /* a table squeezed by a long hand: the last moves go first, the felt keeps the pile */
.ptable > .fuss { margin: auto; }
.ptable > .fuss .avatar { width: 8em; height: 8.3em; }
.ptable > .fuss .stamp { font-size: 2.4em; }

/* ---- the hand: along the bottom edge, its size set by the room it has (--hw: a card in the row you play from, --sw: a small one) ---- */
#partyView[data-fit] > .p-hand { flex: none; position: relative; max-height: 100%; margin: 0; padding: 0; border-radius: 24px 24px 0 0; }
#partyView[data-fit] > .p-hand > .panel { --hw0: clamp(52px, min(19vw, 10.5vh), 88px); --sw: clamp(30px, min(10vw, 5.6vh), 48px);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; align-content: normal; gap: 8px; max-height: 100%; overflow: auto; margin: 0; border-radius: 24px 24px 0 0; border: 2px solid var(--line-2); border-bottom: 0;
  padding: 10px max(12px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left)); background: linear-gradient(180deg, #1d1a2c, #121020 55%); }
@supports (height: 1dvh) { #partyView[data-fit] > .p-hand > .panel { --hw0: clamp(52px, min(19vw, 10.5dvh), 88px); --sw: clamp(30px, min(10vw, 5.6dvh), 48px); } }
#partyView[data-fit] > .p-hand > .panel { overflow-anchor: none; }     /* it may scroll only when a hand is longer than any screen: never by itself */
/* --hw0 is the size the room gives; a hand too long for the screen is made smaller still by look.js (fitHand: --fit), never under --hwmin */
#partyView[data-fit] > .p-hand > .panel { --hwmin: 40px; --hw: max(var(--hwmin), calc(var(--hw0) * var(--fit, 1))); }
/* and if even the smallest cards do not fit, their row scrolls on its own; the say line, the moves and the table in short stay */
#partyView[data-fit] > .p-hand > .panel[data-tight] .hand-main { flex: 0 1 auto; min-height: 0; }
#partyView[data-fit] > .p-hand > .panel[data-tight] .hand-main > .tray.active { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
#partyView[data-fit] .hand-panel .hand-main > .bar { position: sticky; bottom: 0; z-index: 4; }   /* a hand that scrolls (under the table): its moves stay at the foot */
#partyView[data-fit][data-turn=me] > .p-hand > .panel { border-color: var(--gold); background: linear-gradient(180deg, #2a2335, #141022 60%); box-shadow: 0 -14px 48px rgba(242,210,122,.3), 0 0 0 1px rgba(242,210,122,.4) inset; }
/* with a TV the hand has the screen: the table in short at the top grows into the room, the rest sits at the bottom */
#partyView[data-fit][data-table=tv] > .p-hand { flex: 1 1 0; min-height: 0; container-type: size; border-radius: 0; }
#partyView[data-fit][data-table=tv] > .p-hand > .panel { --hw0: clamp(56px, min(23cqw, 15cqh), 112px); --sw: clamp(34px, min(12cqw, 7.5cqh), 60px);
  height: 100%; justify-content: flex-start; border-radius: 0; border: 0; padding-top: max(10px, env(safe-area-inset-top)); overflow: hidden; overflow: clip; }
#partyView[data-fit][data-table=tv][data-turn=me] > .p-hand > .panel { box-shadow: inset 0 0 0 3px rgba(242,210,122,.55), inset 0 0 60px rgba(242,210,122,.18); }
.hand-main { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
#partyView[data-fit] .hand-main { flex: none; }   /* the hand never gives way: short of room, the table in short does */
#partyView[data-fit][data-table=tv] .hand-main { margin-top: auto; }
#partyView[data-fit][data-table=tv] .hand-panel > .strip { flex: 1 1 0; container-type: size; min-height: 112px; overflow: hidden; margin: 0 50px 0 0; padding: 14px 12px 10px; border-radius: 20px; align-items: flex-start; }   /* short of room, the table in short gives way first; its things keep to its top, so they stay put when the hand below grows */
#partyView[data-fit] .strip .words { align-content: center; align-content: safe center; }   /* squeezed: the top stays in sight */
@media (orientation: portrait), (min-height: 521px) {
  #partyView[data-fit][data-table=tv] .hand-panel > .strip { flex-wrap: wrap; align-content: flex-start; }
  @container (min-height: 290px) {
    #partyView[data-fit][data-table=tv] .hand-panel > .strip > .stack { flex: 1 1 100%; }
    #partyView[data-fit][data-table=tv] .hand-panel > .strip > .words { flex: 1 1 100%; justify-items: center; text-align: center; }
    #partyView[data-fit][data-table=tv] .hand-panel > .strip .others { justify-content: center; }
    #partyView[data-fit][data-table=tv] .vt-strip > .stack .vt-card, #partyView[data-fit][data-table=tv] .lc-strip > .stack .lc-card { --w: clamp(60px, min(50cqw, calc((100cqh - 210px) / 1.45)), 160px); }
    #partyView[data-fit][data-table=tv] .vt-strip > .stack .vt-card { background-image: var(--face); }                 /* big enough for its picture */
    #partyView[data-fit][data-table=tv] .vt-strip > .stack .vt-card .mid { display: none; }
    #partyView[data-fit][data-table=tv] .vt-strip > .stack .vt-card .cn { display: block; }
    #partyView[data-fit][data-table=tv] .vt-strip .other .ups { display: inline-flex; }   /* Vändtia: the others' face-up cards beside their characters */
    #partyView[data-fit][data-table=tv] .lc-strip .lc-token { --tk: 34px; margin: 7px 8px; }
  }
}
#partyView[data-fit] .strip .words b { font-size: 17px; line-height: 1.25; }
#partyView[data-fit][data-table=tv] .strip .words b { font-size: 19px; }
#partyView[data-fit] .strip .words .small { font-size: 14px; line-height: 1.3; }
#partyView[data-fit] .strip .words .last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.3em; }
#partyView[data-fit] .strip .stack .lbl { font-size: 14px; }
#partyView[data-fit] .strip .other { font-size: 14px; }
.strip .other .ups { display: none; gap: 2px; margin-left: 4px; }
#partyView .strip .other .ups .vt-card { --w: 22px; border-width: 1px; box-shadow: 0 1px 2px rgba(0,0,0,.35); }
.strip .other .ups .vt-card .cn, .strip .other .ups .vt-card.face .mid::before { display: none; }
.strip .other .ups .vt-card .mid .r { font-size: 11px; } .strip .other .ups .vt-card .mid .s { font-size: 9px; }
.strip .other .ups .vt-card.ace .mid .r { display: block; }
/* the say line: whose turn it is (with their character), or a gold ribbon when it is yours; the turn timer runs along its foot */
#partyView[data-fit] .say { position: relative; display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 6px 12px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); font-size: 15px; line-height: 1.25; overflow: hidden; }
#partyView[data-fit] .say .avatar.mini { width: 32px; height: 33px; flex: none; margin: -4px 0; }
#partyView[data-fit] .say.mine { font-size: 16px; color: #241c05; background: linear-gradient(135deg, #ffe08a, #f2b84a); border-color: transparent; box-shadow: 0 6px 18px -6px rgba(242,184,74,.8); }
#partyView[data-fit] .say.loud { font-size: 17px; }
#partyView[data-fit] .say.mine::before { content: '★'; font-size: 1.25em; line-height: 1; animation: say-star 1.6s ease-in-out infinite var(--play); }
@keyframes say-star { 50% { transform: rotate(18deg) scale(1.2); } }
.say-t { min-width: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
#partyView[data-fit] .say > .timer { position: absolute; left: 0; right: 0; bottom: 0; width: auto; height: 4px; border-radius: 0; background: rgba(0,0,0,.25); }
#partyView[data-fit] .say > .timer i { transition: transform .25s linear; }
/* the rows of cards: the one you play from big and lit (dashed while it is somebody else's turn), the others small, side by side */
#partyView[data-fit] .tray { gap: 4px; padding: 6px 8px 8px; border-radius: 16px; }
#partyView[data-fit] .tray .tray-lbl { font-size: 14px; letter-spacing: 0; text-transform: none; }
#partyView[data-fit] .tray .tray-lbl .n { font-size: 14px; }
#partyView[data-fit] .tray.active.wait { border-style: dashed; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.02); }
#partyView[data-fit] .tray.active.wait .tray-lbl { color: var(--muted); }
#partyView[data-fit] .tray.small .tray-lbl .hint, #partyView[data-fit] .tray.active.wait .tray-lbl .hint { display: none; }
#partyView[data-fit] .tray-row { display: flex; gap: 8px; }
#partyView[data-fit] .tray-row > .tray { flex: 1 1 0; min-width: 0; }
#partyView[data-fit] .tray-row.swap-row { flex-direction: column; }
#partyView[data-fit] .tray-row.swap-row > .tray { flex: none; }
#partyView[data-fit][data-table=here] .tray-row.swap-row { flex-direction: row; }        /* under the table: side by side, so the table keeps its room */
#partyView[data-fit][data-table=here] .tray-row.swap-row > .tray { flex: 1 1 0; }
#partyView[data-fit][data-table=here] .tray-row.swap-row .tray-lbl .hint { display: none; }
#partyView[data-fit] .vt-hand.swap .say-t { -webkit-line-clamp: 5; }                       /* the tip before the first turn, whole */
#partyView[data-fit] .tray.dim { opacity: .7; }
@container (max-height: 400px) {   /* a short hand panel (sideways, or a small phone with a TV): the small rows' labels beside their cards */
  #partyView[data-fit] .tray.small { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 8px; padding-block: 5px 6px; }
  #partyView[data-fit] .tray.small .tray-lbl { flex-direction: column; align-items: flex-start; gap: 2px; }
}
/* a row of cards: --per of them to a line (the renderer says how many), as far apart as 6 px or, when they do not fit,
   overlapping just enough to fit the line; a picked card comes to the front */
#partyView[data-fit] .cards[data-flip] { position: relative; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 8px 0; min-height: calc(var(--sw) * 1.4); }
#partyView[data-fit] .cards[data-flip] > * + * { margin-left: min(6px, calc((100% - 1px - var(--per, 1) * var(--w)) / max(1, var(--per, 1) - 1))); }
#partyView[data-fit] .cards[data-flip] > [data-l0] { margin-left: 0; }   /* the first card of each line (look.js): every line holds --per cards, none sticks out on the left */
#partyView[data-fit] .tray.active .cards[data-flip] { min-height: calc(var(--hw) * 1.42); padding-top: 4px; }
#partyView[data-fit] .cards[data-flip] > .sel { z-index: auto; transform: translateY(-9%) rotate(-1.5deg); }   /* lifted a little, under the card to its right: that card's corner stays in sight, and the tray's label */
/* the moves: one row along the foot, always there (greyed while it is not your turn) */
#partyView[data-fit] .hand-panel .bar { display: flex; gap: 8px; }
#partyView[data-fit] .hand-panel .bar > .btn { flex: 1 1 0; min-width: 0; min-height: 52px; padding: 8px 10px; font-size: 15px; line-height: 1.15; }
#partyView[data-fit] .hand-panel .bar > .btn.play { flex: 1.5 1 0; font-size: 17px; }
#partyView[data-fit] .hand-panel .bar > .btn:disabled { opacity: .4; box-shadow: none; }
#partyView[data-fit] .hand-panel .bar > .btn.armed { border-color: var(--gold); color: var(--gold); }
#partyView[data-fit] .hand-panel .bar > .btn.how:disabled { opacity: 1; background: rgba(242,210,122,.06); border: 2px dashed rgba(242,210,122,.5); color: var(--gold); font-family: inherit; font-size: 14px; font-weight: 700; }
/* a card that goes glows and breathes; one that does not sinks and greys */
#partyView[data-fit] button.vt-card.go:not(.sel), #partyView[data-fit] button.lc-card.go:not(.sel), #partyView[data-fit] button.pu-card.go:not(.sel) { animation: go-rise 1.8s ease-in-out 2 var(--play); }   /* twice as the turn comes, then it just glows. It rises and settles (a transform: painted once, then only moved); a glow that pulsed was painted on every frame, the card's picture and the cloth under it with it */
@keyframes go-rise { 50% { transform: translateY(-11%) scale(1.025); } }
#partyView[data-fit] button.vt-card.nogo, #partyView[data-fit] button.lc-card.nogo { transform: translateY(5%) scale(.95); }   /* (its shade is the card's own ::after: opaque, so a row of them that overlap still reads; no filter) */

/* ---- Vändtia on one screen ---- */
#partyView[data-fit] .vt-hand .tray.active .vt-card { --w: var(--hw); }
#partyView[data-fit] .vt-hand.swap .tray.active .vt-card { --w: calc(var(--hw) * .8); }   /* before the first turn two rows are lit: the hand and the face-up row */
#partyView[data-fit] .vt-hand.swap .tray.active .cards[data-flip] { min-height: calc(var(--hw) * .8 * 1.42); }
#partyView[data-fit] .vt-hand .tray:not(.active) .vt-card { --w: var(--sw); }
#partyView[data-fit] .vt-hand .tray:not(.active) .vt-card .tag, #partyView[data-fit] .vt-hand .tray:not(.active) .vt-card .cn { display: none; }
#partyView[data-fit] .vt-hand .tray:not(.active) .vt-card.ace .mid .r { display: block; }   /* no corners here: an ace says A, not just its suit */
#partyView[data-fit] .vt-hand .tray:not(.active) .vt-card.ace .mid .s { font-size: calc(var(--w) * .34); }
#partyView[data-fit] .vt-hand .tray .vt-card.back.go { box-shadow: 0 6px 14px rgba(0,0,0,.45), 0 0 0 3px rgba(242,210,122,.9); }
#partyView[data-fit] .vt-strip .vt-card { --w: clamp(36px, min(34cqw, calc((100cqh - 34px) / 1.45)), 118px); }   /* the table in short is a size container: its card fits it */
.vt-ptable .felt .vt-card, .vt-ptable .vt-pile { --w: clamp(30px, min(17cqw, calc((100cqh - 34px) / 1.45)), 86px); }
.vt-ptable .felt .stack.draw .vt-card { --w: clamp(26px, min(12cqw, calc((100cqh - 34px) / 2)), 58px); }
.vt-ptable .vt-need { font-size: 15px; max-width: 8.5em; padding: .3em .6em; }
.opp .vt-card { --w: 22px; border-width: 1px; box-shadow: 0 1px 2px rgba(0,0,0,.35); }
.opp .vt-card .cn, .opp .vt-card .tag, .opp .vt-card.face .mid::before { display: none; }
.opp .vt-card .mid .r { font-size: 11px; } .opp .vt-card .mid .s { font-size: 9px; }
.opp .vt-card.ace .mid .r { display: block; } .opp .vt-card.ace .mid .s { font-size: 9px; }   /* a small ace: its A over its suit, as the other cards */
.opp .col { position: relative; width: 22px; height: 35px; flex: none; }
.opp .col .vt-card { position: absolute; left: 0; }
.opp .col .vt-card.back { top: 0; }
.opp .col .vt-card.up { top: 4px; left: 2px; }
.opp .col .vt-card.back::after { inset: 18%; border-width: 1px; }

/* ---- Last Card on one screen: "Last card!" and "Caught!" float just above the hand (the hand never moves for them); a
        picked wild card puts the four colours in the moves' row ---- */
#partyView[data-fit] .lc-hand .lc-cards .lc-card { --w: var(--hw); }
#partyView[data-fit] .lc-strip .lc-card { --w: clamp(36px, min(34cqw, calc((100cqh - 34px) / 1.5)), 118px); }
#partyView[data-fit] .lc-strip .lc-now { gap: 8px; }
#partyView[data-fit] .lc-strip .lc-token { --tk: 28px; margin: 6px 7px; }   /* 40 px with its ring, as the turning arrow before it */
@keyframes lc-turn { to { transform: rotate(360deg); } }
#partyView[data-fit] .hand-main > .loud { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; animation: rise .3s var(--ease) both; }   /* at the top of the hand, in the flow: the hand stays where it is (it grows upward), nothing covers the table */
#partyView[data-fit] .hand-main > .loud > * { min-height: 52px; padding: 6px 10px; line-height: 1.15; }
#partyView[data-fit] .hand-main > .loud:empty { display: none; }
#partyView[data-fit] .hand-panel .lc-colors.bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; animation: rise .3s var(--ease) both; }
#partyView[data-fit] .lc-colorbtn { min-height: 52px; flex-direction: column; gap: 0; font-size: 14px; line-height: 1.15; }
#partyView[data-fit] .lc-colorbtn .shape { font-size: 18px; }
#partyView[data-fit] .hand-panel .lc-targets.bar { display: flex; flex-wrap: wrap; gap: 6px; animation: rise .3s var(--ease) both; }
#partyView[data-fit] .hand-panel .lc-targets.bar > .btn { flex: 1 1 40%; min-height: 48px; justify-content: flex-start; }
#partyView[data-fit] .lc-hint { margin: 0; font-size: 14px; line-height: 1.3; }
.lc-ptable .felt .lc-card { --w: clamp(28px, min(15cqw, calc((100cqh - 34px) / 2)), 70px); }
.lc-ptable .felt .lc-card.top { --w: clamp(36px, min(24cqw, calc((100cqh - 34px) / 1.5)), 112px); }
.lc-ptable .felt .lc-swatch.big { font-size: 15px; }
.lc-ptable .felt .lc-token { --tk: clamp(30px, min(15cqw, calc((100cqh - 70px) / 1.6)), 62px); }
.lc-ptable .felt .stack.colour { gap: 0; }
.lc-ptable .felt .lc-token .ring { animation: none; }   /* on a phone's table the direction is drawn, not turning (the arrow there never turned: a phone that shows the table has enough to move) */
.lc-ptable .felt .lc-round { position: absolute; inset: 6px; z-index: 3; overflow: auto; font-size: 14px; display: grid; align-content: center; gap: 4px; padding: 10px 14px; }
.lc-ptable .felt .lc-round h3 { font-size: 16px; }
.lc-ptable .felt .lc-round p { margin: 0; }
.opp.exposed { border-color: var(--red); box-shadow: 0 0 0 3px rgba(244,63,94,.25); }
.opp.called .opp-tag { color: var(--gold); font-weight: 700; }
.opp.exposed .opp-tag { color: #ff9fb3; font-weight: 700; }

/* ---- Pile Up on one screen: with no TV the four piles are on the table's felt, big, to tap; with a TV they sit in the hand ---- */
/* four rows of cards (the piles in the middle, your stock and discard piles, your hand): smaller ones than the other games' */
#partyView[data-fit][data-table=tv] > .p-hand > .panel.pu-hand { --hw0: clamp(46px, min(20cqw, 10cqh), 92px); --sw: clamp(28px, min(11cqw, 5.6cqh), 52px); }
#partyView[data-fit] .pu-hand .pu-cards .pu-card { --w: calc(var(--hw) * .86); }
#partyView[data-fit] .pu-hand .tray.active .pu-cards[data-flip] { min-height: calc(var(--hw) * .86 * 1.42); }
#partyView[data-fit] .pu-hand .pu-stock .pu-card { --w: calc(var(--hw) * .78); }
#partyView[data-fit] .pu-hand .pu-discard .pu-card { --w: var(--sw); }
#partyView[data-fit] .pu-hand .pu-mine { display: flex; gap: 8px; flex-wrap: nowrap; align-items: stretch; }
#partyView[data-fit] .pu-hand .pu-stockbox { flex: none; }
#partyView[data-fit] .pu-hand .pu-discbox { flex: 1 1 auto; min-width: 0; }
#partyView[data-fit] .pu-hand .pu-discards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); justify-items: center; gap: 4px; min-height: calc(var(--sw) * 1.4 + 3 * var(--sw) * .32); }
#partyView[data-fit] .pu-hand .pu-discard { min-width: 44px; min-height: 44px; align-self: flex-start; }
#partyView[data-fit] .pu-midtray .felt { padding: 6px 4px; --R: 18px; border-radius: var(--R); }
#partyView[data-fit] .pu-midtray .felt .pu-build .pu-card { --w: calc(var(--hw) * .76); }
#partyView[data-fit] .pu-midtray .felt .pu-build .lbl, .pu-ptable .pu-build .lbl { font-size: 14px; }
.pu-ptable .felt .felt-in { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3%; align-items: center; justify-items: center; }
.pu-ptable .felt .pu-build .pu-card { --w: clamp(32px, min(20cqw, calc((100cqh - 34px) / 1.45)), 92px); }
.pu-ptable .felt button.pu-build { min-width: 44px; min-height: 44px; }

/* sideways: the table (or the table in short) to the left, the hand to the right */
@media (orientation: landscape) and (max-height: 520px) {
  html[data-screen=phone] #partyView[data-fit] { flex-direction: row; }
  #partyView[data-fit] > .p-table { flex: 1 1 0; height: 100%; padding: max(6px, env(safe-area-inset-top)) 8px max(6px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  #partyView[data-fit] > .p-table .opps { padding-right: 0; }
  #partyView[data-fit] > .p-table .ptable-head { padding-right: 0; }
  #partyView[data-fit] > .p-hand { flex: 1.3 1 0; min-width: 0; height: 100%; max-height: none; container-type: size; border-radius: 22px 0 0 22px; }
  /* the cards' size: by the width, and by the height the hand's lines (--lines) leave after its words, labels and moves */
  #partyView[data-fit] > .p-hand > .panel { --hw0: clamp(36px, min(14cqw, calc((100cqh - 236px) / (1.42 * var(--lines, 1) + .8))), 84px); --sw: clamp(24px, calc(var(--hw) * .56), 46px);
    height: 100%; justify-content: flex-end; border-radius: 22px 0 0 22px; border: 2px solid var(--line-2); border-right: 0; overflow: hidden; overflow: clip;
    padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) 12px; }
  #partyView[data-fit] > .p-hand > .panel { --hwmin: 34px; }
  #partyView[data-fit] .hand-main > .say:first-child, #partyView[data-fit] .hand-main > .loud:empty + .say, #partyView[data-fit] .hand-main > .loud:not(:empty) { margin-right: 50px; }
  #partyView[data-fit] .tray-row.swap-row { flex-direction: row; }
  #partyView[data-fit] .tray-row.swap-row > .tray { flex: 1 1 0; }
  #partyView[data-fit] .say { min-height: 40px; padding-block: 4px; font-size: 14px; line-height: 1.22; }
  #partyView[data-fit] .say.mine { font-size: 15px; }
  #partyView[data-fit] .hand-panel .bar > .btn { min-height: 46px; }
  #partyView[data-fit] .hand-main > .loud > * { min-height: 44px; padding: 4px 8px; font-size: 15px; }
  #partyView[data-fit][data-table=tv] > .p-hand { flex: 1 1 0; border-radius: 0; }
  #partyView[data-fit][data-table=tv] > .p-hand > .panel { --hw0: clamp(36px, min(12cqw, calc((100cqh - 236px) / (1.42 * var(--lines, 1) + .8))), 84px); --sw: clamp(24px, calc(var(--hw) * .56), 46px);
    display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.5fr); grid-template-rows: minmax(0, 1fr); grid-auto-rows: minmax(0, 1fr); align-content: stretch; align-items: stretch; gap: 12px; border: 0; border-radius: 0; padding-left: max(10px, env(safe-area-inset-left)); }
  #partyView[data-fit][data-table=tv] .hand-panel > .strip { grid-column: 1; grid-row: 1; margin: 0; height: 100%; min-height: 0; overflow: hidden; flex-direction: column; align-items: stretch; justify-content: center; text-align: left; }
  #partyView[data-fit][data-table=tv] .hand-panel > .strip .stack { align-self: center; }
  #partyView[data-fit][data-table=tv] .hand-panel > .hand-main { grid-column: 2; height: 100%; justify-content: flex-end; }
  #partyView[data-fit][data-table=tv] .vt-strip .vt-card { --w: clamp(36px, min(60cqw, calc(42cqh / 1.45)), 96px); }
  #partyView[data-fit][data-table=tv] .lc-strip .lc-card { --w: clamp(36px, min(60cqw, calc(42cqh / 1.5)), 96px); }
  .opps { --cols: 2; }
  .opps.many { --cols: 2; }
  /* Pile Up sideways: the piles in the middle and your own piles side by side, the hand under them */
  #partyView[data-fit] > .p-hand > .panel.lc-hand, #partyView[data-fit][data-table=tv] > .p-hand > .panel.lc-hand { --hw0: clamp(36px, min(13cqw, calc((100cqh - 172px) / (1.45 * var(--lines, 1)))), 84px); }
  #partyView[data-fit] > .p-hand > .panel.pu-hand { --hw0: clamp(34px, min(13cqw, calc((100cqh - 228px) / (1.3 + 1.22 * var(--lines, 1)))), 78px); --sw: clamp(22px, calc(var(--hw) * .55), 46px); }
  #partyView[data-fit][data-table=tv] > .p-hand > .panel.pu-hand { --hw0: clamp(34px, min(9cqw, calc((100cqh - 190px) / (1.42 + 1.22 * var(--lines, 1)))), 66px); --sw: clamp(22px, calc(var(--hw) * .6), 42px);
    grid-template-columns: minmax(0, .62fr) minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; grid-template-areas: "strip mid mine" "strip hand hand" "say say bar"; gap: 8px 10px; }
  #partyView[data-fit] .pu-hand .say { min-height: 38px; }
  #partyView[data-fit] .pu-hand .hand-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-content: end; gap: 6px 8px; }
  #partyView[data-fit] .pu-hand .hand-main > * { grid-column: 1 / -1; }
  #partyView[data-fit] .pu-hand .hand-main > .pu-midtray { grid-column: 1; }
  #partyView[data-fit] .pu-hand .hand-main > .pu-midtray + .pu-mine { grid-column: 2; }
  #partyView[data-fit] .pu-hand .tray .tray-lbl .hint { display: none; }
  #partyView[data-fit][data-table=tv] .pu-hand > .hand-main { display: contents; }
  #partyView[data-fit][data-table=tv] .pu-hand > .strip { grid-area: strip; }
  #partyView[data-fit][data-table=tv] .pu-hand > .hand-main > .pu-midtray { grid-area: mid; align-self: end; }
  #partyView[data-fit][data-table=tv] .pu-hand > .hand-main > .pu-midtray + .pu-mine { grid-area: mine; align-self: end; }
  #partyView[data-fit][data-table=tv] .pu-hand > .hand-main > .tray[data-row=hand] { grid-area: hand; }
  #partyView[data-fit][data-table=tv] .pu-hand > .hand-main > .say { grid-area: say; margin-right: 0; }
  #partyView[data-fit][data-table=tv] .pu-hand > .hand-main > .bar { grid-area: bar; }
}
/* Calm: nothing breathes, bobs or bounces in a game either */
html.motion-reduced #partyView[data-fit] button.vt-card.go, html.motion-reduced #partyView[data-fit] button.lc-card.go, html.motion-reduced #partyView[data-fit] button.pu-card.go,
html.motion-reduced .opp.turn, html.motion-reduced .opp .turn-tag, html.motion-reduced #partyView[data-fit] .say.mine::before, html.motion-reduced #partyView[data-fit] .paused-banner, html.motion-reduced #partyView[data-fit] > .p-more[open] { animation: none; }
html.motion-reduced .opp { transition: none; }

/* The phone's Sound button (in the header) stays one tap away in a game on one screen: the header steps aside but its
   Sound button floats beside the menu button, round, and its panel opens under the two (shell.js puts the panel under the
   header, wherever the header is). The table's first row leaves room for both buttons. */
html[data-screen=phone] body[data-fit]:has(header.top .snd-btn) header.top { display: flex; position: fixed; z-index: 31; top: max(6px, env(safe-area-inset-top)); right: calc(max(6px, env(safe-area-inset-right)) + 52px); left: auto; gap: 0; padding: 0; margin: 0; border: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
html[data-screen=phone] body[data-fit] header.top > :not(.snd-btn) { display: none !important; }
html[data-screen=phone] body[data-fit] header.top .snd-btn { width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0; border-radius: 50%; justify-content: center; background: rgba(29,26,43,.9); box-shadow: 0 4px 14px rgba(0,0,0,.45); }
html[data-screen=phone] body[data-fit] header.top .snd-word { display: none; }
html[data-screen=phone] body[data-fit] .snd-panel { top: calc(56px + env(safe-area-inset-top, 0px)); }
html[data-screen=phone] body[data-fit]:has(header.top .snd-btn) .opps, html[data-screen=phone] body[data-fit]:has(header.top .snd-btn) .ptable-head { padding-right: 102px; }
html[data-screen=phone] body[data-fit]:has(header.top .snd-btn) #partyView[data-table=tv] .hand-panel > .strip { margin-right: 102px; }
@media (orientation: landscape) and (max-height: 520px) {
  html[data-screen=phone] body[data-fit]:has(header.top .snd-btn) .opps, html[data-screen=phone] body[data-fit]:has(header.top .snd-btn) .ptable-head { padding-right: 0; }
  html[data-screen=phone] body[data-fit]:has(header.top .snd-btn) #partyView[data-fit] .hand-main > .say:first-child,
  html[data-screen=phone] body[data-fit]:has(header.top .snd-btn) #partyView[data-fit] .hand-main > .loud:empty + .say,
  html[data-screen=phone] body[data-fit]:has(header.top .snd-btn) #partyView[data-fit] .hand-main > .loud:not(:empty) { margin-right: 102px; }
  html[data-screen=phone] body[data-fit]:has(header.top .snd-btn) #partyView[data-table=tv] .hand-panel > .strip { margin-right: 0; }
}

/* ═════════════ the phone's lobby and pages: compact, thumb-sized ═════════════
   The leader picks from the games two to a row (three sideways), each a small tile with its art, its name and whether it
   fits the people here; the picked game's line and rules sit right under its row. Everything a thumb presses is 44 px
   tall at least, no text is under 14 px, and nothing sits under the notch or the home bar. */
html[data-screen=phone] header.top { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); padding-top: max(10px, env(safe-area-inset-top)); }
html[data-screen=phone] header.top .brand { min-height: 44px; }
html[data-screen=phone] header.top .btn.small { min-height: 44px; }
html[data-screen=phone] body:not([data-fit]) main { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
html[data-screen=phone] .btn.small { min-height: 44px; padding: 6px 12px; font-size: 14px; }
html[data-screen=phone] #partyView details > summary { min-height: 44px; display: flex; align-items: center; }
html[data-screen=phone] .seg-btn, html[data-screen=phone] .seg.tight .seg-btn { min-height: 44px; font-size: 14px; }
html[data-screen=phone] .many-chip { min-height: 44px; font-size: 14px; }
html[data-screen=phone] .set-cur, html[data-screen=phone] .tile-players, html[data-screen=phone] .tile-about, html[data-screen=phone] .person .tags,
html[data-screen=phone] .start-n, html[data-screen=phone] .fit, html[data-screen=phone] .eyebrow, html[data-screen=phone] .how li::before,
html[data-screen=phone] .cast-grid label, html[data-screen=phone] #joinView .cast-grid label, html[data-screen=phone] .step .lbl, html[data-screen=phone] .small { font-size: 14px; }
html[data-screen=phone] .eyebrow { letter-spacing: .1em; }
html[data-screen=phone] .fx-stamp .small { font-size: 1.3em; }
/* who is here: the chips a little smaller, their words readable */
html[data-screen=phone] .pchip { flex: 1 0 62px; max-width: 88px; padding: 6px 3px 5px; }
html[data-screen=phone] .pchip .avatar, html[data-screen=phone] .pchip.add .plus { width: 40px; height: 42px; }
html[data-screen=phone] .pchip b, html[data-screen=phone] .pchip .ptag, html[data-screen=phone] .pchip.add b { font-size: 14px; }
html[data-screen=phone] .pchip .ptag { color: var(--muted); }
html[data-screen=phone] .people-row { padding: 6px 0 2px; }
/* the games, two to a row, small tiles; the picked one's line and rules right under its row (dense: no hole is left) */
.rules-about { display: none; }
@media (max-width: 520px), (orientation: landscape) and (max-height: 520px) {
  html[data-screen=phone] .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 8px; }
  html[data-screen=phone] .tile { grid-template-columns: 60px minmax(0, 1fr); gap: 0 8px; padding: 8px; min-height: 64px; border-radius: 16px; }
  html[data-screen=phone] .tile .g-art { width: 60px; border-radius: 9px; }
  html[data-screen=phone] .tile-head { flex-direction: column; align-items: flex-start; gap: 3px; }
  html[data-screen=phone] .tile-name { font-size: 15px; line-height: 1.15; }
  html[data-screen=phone] .tile .fit { padding: 0 .45em; letter-spacing: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  html[data-screen=phone] .tile-players, html[data-screen=phone] .tile-about { display: none; }
  html[data-screen=phone] .tile.on::after { top: -.5em; right: .4em; }
  html[data-screen=phone] .tiles .rules.under { grid-column: 1 / -1; margin: 0 0 4px; border-left: 0; border-top: 3px solid rgba(242,210,122,.45); border-radius: 16px; }
  html[data-screen=phone] .rules-about { display: block; margin: -2px 0 10px; color: var(--muted); font-size: 14px; line-height: 1.35; }
  html[data-screen=phone] .next-head .g-art.big { width: 96px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  html[data-screen=phone] .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  html[data-screen=phone] .p-start { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
}
html.motion-reduced .pchip, html.motion-reduced .tile { animation: none; }

/* ═════════════ the showcase: a game's main choice as big cards (shell.js showModel/showCard), and everyone's vote ═════════════
   The same card on the TV (big, filling the lobby), in the leader's rules (small, tap to set), in everyone else's "Next up"
   (small, the one that is set lit) and on every phone during a vote (on one screen, tap your favourite). Its picture is
   the renderer's (SVG, a painted canvas, a fan of named cards); its words: a title, a tag with pips (how hard, how hot),
   a line and a few facts. During a vote the faces of whoever picked it land on it; at the end the winner pops. */
@property --p { syntax: '<percentage>'; inherits: false; initial-value: 100%; }
.sc-card { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0; text-align: left; color: inherit; font: inherit; border-radius: 20px;
  background: linear-gradient(165deg, color-mix(in srgb, var(--tone) 20%, var(--surface-2)), var(--surface) 72%); border: 2px solid var(--line-2); box-shadow: 0 .5em 1.4em rgba(0,0,0,.35);
  animation: sc-in .55s var(--bounce) both; animation-delay: calc(var(--i, 0) * 70ms); transition: transform .3s var(--bounce), border-color .25s, box-shadow .25s, opacity .4s, filter .4s; }
button.sc-card { cursor: pointer; touch-action: manipulation; }
button.sc-card:active { transform: scale(.96); }
@keyframes sc-in { from { opacity: 0; transform: translateY(1.2em) scale(.85) rotate(calc(-3deg + var(--i, 0) * 1.7deg)); } }
.sc-pic { position: relative; flex: none; aspect-ratio: 16 / 10; margin: 6px 6px 0; border-radius: 14px; overflow: hidden; container-type: size; background: color-mix(in srgb, var(--tone) 40%, #0b0a12); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.sc-pic > svg, .sc-pic > canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.sc-pic.own { display: grid; place-items: center; }
.sc-pic.own .g-art { width: 74%; box-shadow: none; }
.sc-body { display: grid; align-content: start; gap: .25em; padding: .55em .8em .75em; min-width: 0; }
.sc-title { font-family: var(--display); font-size: 1.12em; line-height: 1.12; overflow-wrap: break-word; }
.sc-tag { justify-self: start; display: inline-flex; align-items: center; gap: .45em; padding: .12em .65em .12em .5em; border-radius: 999px; font-size: .8em; font-weight: 700; line-height: 1.5; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); color: var(--sky); }
.sc-tag.lv1 { color: #8ff0b0; } .sc-tag.lv2 { color: var(--gold); } .sc-tag.lv3 { color: #ff8f8f; }
.sc-pips { display: inline-flex; gap: 2px; }
.sc-pips i { width: .38em; height: .85em; border-radius: 2px; background: rgba(255,255,255,.18); transform: skewX(-12deg); }
.sc-pips i.on { background: currentColor; box-shadow: 0 0 .4em currentColor; }
.sc-line { color: var(--muted); font-size: .86em; line-height: 1.3; }
.sc-facts { color: var(--dim); font-size: .8em; font-weight: 600; }
/* the one that is set: lit gold, a little lifted, a ribbon in the corner */
.sc-card.on { border-color: var(--gold); box-shadow: 0 0 0 .22em rgba(242,210,122,.22), 0 .8em 2.2em rgba(242,184,74,.22); transform: translateY(-3px); }
.sc-on, .sc-mine { position: absolute; z-index: 3; top: -.55em; right: .7em; padding: .1em .7em; border-radius: 999px; font-size: .78em; font-weight: 800; letter-spacing: .02em; background: linear-gradient(135deg, #ffe08a, #f2b84a); color: #241c05; box-shadow: 0 .25em .7em rgba(0,0,0,.45); transform: rotate(4deg); animation: tag-in .45s var(--bounce) both; }
.sc-on::before, .sc-mine::before { content: '\2713\00a0'; }
@keyframes tag-in { from { opacity: 0; transform: rotate(14deg) scale(.4); } }
/* a fan of white cards with names on them (a renderer's art {cards: [...]}: Fill the Blank's packs) */
.sc-fan { --fh: min(74cqh, 54cqw); position: absolute; inset: 0; display: grid; place-items: center;
  background: radial-gradient(110% 90% at 50% 105%, color-mix(in srgb, var(--fan, var(--tone)) 90%, #fff), color-mix(in srgb, var(--fan, var(--tone)) 70%, #0b0a12) 75%); }
.sc-fan-card { grid-area: 1 / 1; height: var(--fh); aspect-ratio: 5 / 7; display: grid; align-content: start; padding: calc(var(--fh) * .08) calc(var(--fh) * .07); border-radius: calc(var(--fh) * .07); background: #fbf8f1; color: #1a1620;
  font: 700 clamp(7px, calc(var(--fh) * .105), 26px)/1.12 var(--display); overflow: hidden; overflow-wrap: break-word; box-shadow: 0 .35em .9em rgba(0,0,0,.45);
  transform-origin: 50% 130%; transform: translate(calc(var(--i) * var(--fh) * .46), calc(var(--fh) * .09)) rotate(calc(var(--i) * 12deg)); }
.sc-fan-card:nth-child(2) { background: #fff; }
.sc-fan-more { position: absolute; right: .5em; bottom: .4em; padding: .05em .55em; border-radius: 999px; background: rgba(11,10,18,.8); color: var(--gold); font-size: .78em; }
/* during a vote: the faces on each card, the count; the card the most picked glows */
.sc-ballot { display: flex; flex-wrap: wrap; align-items: center; gap: .2em; min-height: 2.3em; padding: 0 .6em .55em; margin-top: auto; }
.sc-voter { display: inline-grid; animation: voter-in .6s var(--bounce) both; }
.sc-voter .avatar.mini { width: 2em; height: 2.1em; }
@keyframes voter-in { 0% { opacity: 0; transform: translateY(-2.6em) scale(.4) rotate(-30deg); } 60% { opacity: 1; transform: translateY(.2em) scale(1.15) rotate(8deg); } 100% { transform: none; } }
.sc-count { margin-left: auto; min-width: 1.6em; padding: 0 .4em; border-radius: 999px; text-align: center; font: 800 1.1em/1.5 var(--display); background: var(--gold); color: #241c05; animation: count-in .5s var(--bounce) both; }
@keyframes count-in { from { transform: scale(2.2); opacity: 0; } }
.sc-card.lead { border-color: var(--teal); box-shadow: 0 0 0 .2em rgba(45,212,191,.25), 0 .8em 2.4em rgba(45,212,191,.25); animation: sc-in .55s var(--bounce) both, lead-glow 1.4s ease-in-out infinite var(--play); }
@keyframes lead-glow { 50% { box-shadow: 0 0 0 .35em rgba(45,212,191,.35), 0 .8em 2.8em rgba(45,212,191,.4); } }
.sc-card.mine { border-color: var(--gold); box-shadow: 0 0 0 .22em rgba(242,210,122,.3), 0 .6em 1.8em rgba(242,184,74,.3); }
.sc-mine { left: .7em; right: auto; transform: rotate(-4deg); }
/* the result: the winner pops (a crown lands on it), the rest sink; a tie first rolls round the tied ones */
.sc-card.win { z-index: 2; border-color: var(--gold); animation: win-pop .9s var(--bounce) both; box-shadow: 0 0 0 .3em rgba(242,210,122,.4), 0 0 3em rgba(242,184,74,.55); }
.sc-card.win::after { content: '\1F451'; position: absolute; z-index: 4; left: 50%; top: -.9em; font-size: 1.9em; line-height: 1; transform: translateX(-50%); animation: crown-drop .8s var(--bounce) both; animation-delay: .25s; filter: drop-shadow(0 .15em .3em rgba(0,0,0,.5)); }
@keyframes win-pop { 0% { transform: scale(1); } 45% { transform: scale(1.12) rotate(-2deg); } 100% { transform: scale(1.05); } }
@keyframes crown-drop { from { opacity: 0; transform: translate(-50%, -2.5em) rotate(-40deg) scale(.4); } }
.sc-card.lose { opacity: .42; filter: saturate(.45); transform: scale(.93) rotate(calc(-1.5deg + var(--i, 0) * .9deg)) translateY(.3em); }
.sc-card.tied.rolled { animation: tie-roll calc(var(--tn, 2) * .28s) linear calc(var(--t, 0) * .28s) var(--it, 3) both; }
.sc-card.win.rolled { animation: tie-roll calc(var(--tn, 2) * .28s) linear calc(var(--t, 0) * .28s) var(--it, 3), win-pop .9s var(--bounce) 1.9s both; }
.sc-card.win.rolled::after { animation-delay: 2.1s; }
.sc-card.lose.rolled { transition-delay: 1.9s; }
@keyframes tie-roll { 0%, 34% { border-color: #fff; box-shadow: 0 0 0 .3em rgba(255,255,255,.55), 0 0 2.4em rgba(255,255,255,.4); transform: scale(1.05); opacity: 1; filter: none; } 40%, 100% { opacity: .55; } }
html.motion-reduced .sc-card, html.motion-reduced .sc-voter, html.motion-reduced .sc-count, html.motion-reduced .sc-on, html.motion-reduced .sc-mine { animation: none !important; }
html.motion-reduced .sc-card.win::after { animation: none; }

/* ---- the phone's lobby: the leader's cards to tap under the picked game, everyone else's under "Next up" ---- */
.sc-mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px 10px; margin-top: 6px; }
.sc-mini-grid .sc-card { border-radius: 16px; }
.sc-mini-grid .sc-pic { margin: 5px 5px 0; border-radius: 11px; }
.sc-mini-grid .sc-body { padding: 6px 9px 9px; gap: 4px; }
.sc-mini-grid .sc-title { font-size: 15px; }
.sc-mini-grid .sc-tag { font-size: 14px; }
.sc-mini-grid .sc-on { font-size: 14px; }
.set-row.show-row { grid-template-columns: minmax(0, 1fr); grid-column: 1 / -1; }
.show-row .fb-presets { display: none; }          /* Fill the Blank's own preset buttons: the cards above are them */
.show-strip { margin: 4px 0 6px; grid-column: 1 / -1; }     /* (the full width of a sideways phone's two-column "Next up") */
.show-strip .how-h { margin-top: 2px; }
.show-strip > p.small { margin: 8px 0 0; }
.vote-go { width: 100%; min-height: 58px; margin-top: 4px; justify-content: flex-start; gap: 12px; padding: 8px 16px; border-radius: 16px; border: 0; color: #fff; text-align: left;
  background: linear-gradient(120deg, #2dd4bf, #7c5cff 55%, #e268a8); box-shadow: 0 .5em 1.4em -0.3em rgba(124,92,255,.7); }
.vote-go-ic { font-size: 28px; line-height: 1; animation: ballot-wiggle 2.6s ease-in-out infinite var(--play); }
@keyframes ballot-wiggle { 0%, 70%, 100% { transform: none; } 76% { transform: rotate(-14deg) translateY(-3px); } 84% { transform: rotate(10deg); } 92% { transform: rotate(-4deg); } }
.vote-go-w { display: grid; line-height: 1.2; }
.vote-go-w b { font-family: var(--display); font-size: 17px; }
.vote-go-w small { font-size: 14px; opacity: .85; font-weight: 500; }

/* ---- the phone during a vote: on one screen ([data-fit]), the cards fill what the clock and the foot leave ---- */
#partyView > .p-vote:empty { display: none; }
#partyView[data-fit] > .p-vote { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.vote-box { --tone: var(--accent); flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.vote-head { flex: none; padding-right: 54px; min-height: 44px; }        /* the round menu button keeps the top right corner */
.vote-head .eyebrow { margin: 2px 0 2px; }
.vote-ask { margin: 0; font-size: 22px; line-height: 1.15; }
.vote-ask.verdict { color: var(--gold); font-size: 26px; }
.vote-ask.verdict:not(.rolling) { animation: verdict-in .7s var(--bounce) both; }
.vote-box.done:has(.rolled) .vote-sub { animation-delay: 1.9s; }
/* a tie: "A tie!" while the cards roll, then the winner's name in its place */
.rolling { position: relative; }
.rolling .roll-say { position: absolute; left: 0; top: 0; white-space: nowrap; color: #fff; animation: roll-say 1.95s linear both; }
.rolling .roll-won { display: inline-block; animation: verdict-in .8s var(--bounce) 1.9s both; }
@keyframes roll-say { 0% { opacity: 0; transform: scale(.7); } 8% { opacity: 1; transform: scale(1.08) rotate(-2deg); } 14%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; transform: scale(.9); } }
html.motion-reduced .rolling .roll-say { display: none; }
html.motion-reduced .rolling .roll-won { animation: none; }
.vote-box.done .vote-grid { padding-top: 14px; }          /* the winner's crown sits on top of its card */
@keyframes verdict-in { from { opacity: 0; transform: scale(.6) rotate(-4deg); } }
.vote-sub { margin: 2px 0 0; color: var(--muted); font-size: 15px; animation: verdict-in .7s var(--bounce) both; }
.vote-clock { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-top: 6px; }
.vote-bar { position: relative; height: 12px; border-radius: 999px; background: rgba(255,255,255,.09); overflow: hidden; }
.vote-bar::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, #ff6b6b, var(--gold-2) 30%, var(--gold)); transform-origin: left; animation: vote-run var(--ms, 15s) linear var(--delay, 0s) both; }
@keyframes vote-run { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.vote-secs { min-width: 1.6em; text-align: center; font: 800 22px/1 var(--display); color: var(--gold); }
.vote-secs.tick { color: #ff8f8f; animation: secs-tick .5s var(--bounce); }
@keyframes secs-tick { from { transform: scale(1.7); } }
.vote-grid { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 2), minmax(0, 1fr)); gap: 10px; }
.vote-grid .sc-card { container-type: size; border-radius: 18px; }
.vote-grid .sc-pic { flex: 1 1 0; min-height: 0; aspect-ratio: auto; }
.vote-grid .sc-body { flex: none; padding: 5px 9px 4px; gap: 3px; }
.vote-grid .sc-title { font-size: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vote-grid .sc-tag { font-size: 14px; }
.vote-grid .sc-ballot { flex: none; min-height: 34px; padding: 0 8px 6px; margin: 0; flex-wrap: nowrap; overflow: hidden; }
.vote-grid .sc-voter .avatar.mini { width: 26px; height: 27px; }
.vote-grid .sc-count { font-size: 16px; }
.vote-grid .sc-on, .vote-grid .sc-mine { top: 8px; font-size: 14px; }
/* a wide, short card (one to a row): its picture to the left, the words to the right */
/* (shell.js says so by the grid's own size, the same for the vote and its result: .side) */
.vote-grid.side .sc-card > .sc-pic { position: absolute; left: 0; top: 0; bottom: 0; width: 44%; margin: 6px; }
.vote-grid.side .sc-card > .sc-body, .vote-grid.side .sc-card > .sc-ballot { margin-left: 46%; }
.vote-grid.side .sc-card > .sc-body { padding-top: 10px; }
.vote-foot { flex: none; display: grid; gap: 8px; }
.vote-wait { margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; color: var(--muted); font-size: 15px; text-align: center; }
.vote-wait b { color: var(--text); font-family: var(--display); font-size: 17px; animation: wait-bounce 1.8s ease-in-out infinite var(--play); }
@keyframes wait-bounce { 50% { transform: translateY(-3px); } }
.vote-who { display: inline-flex; }
.vote-who .avatar.mini { width: 28px; height: 29px; margin-left: -6px; }
.vote-acts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; }
.vote-acts .btn.small { min-height: 44px; font-size: 15px; }
.vote-acts .btn:only-child { grid-column: 1 / -1; }
.vote-foot .btn.wide { min-height: 50px; }
@media (orientation: landscape) and (max-height: 520px) {
  .vote-box { gap: 6px; }
  .vote-head { display: grid; grid-template-columns: minmax(0, auto) minmax(140px, 1fr); align-items: center; gap: 0 14px; min-height: 40px; padding-right: 108px; }
  .vote-head .eyebrow { grid-column: 1 / -1; margin: 0; }
  .vote-ask { font-size: 19px; }
  .vote-clock { margin: 0; }
  .vote-grid { gap: 8px; }
  .vote-foot { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .vote-wait { justify-content: flex-start; min-height: 32px; }
  .vote-acts { grid-template-columns: auto auto; }
}

/* ---- the TV when the picked game has a showcase: the way in along the top, the cards filling the rest ---- */
.tv-lobby.picking { display: flex; flex-direction: column; align-items: stretch; gap: 1.6vh; }
.tvp-top { flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2vw; align-items: center; }
.tvp-join { display: flex; align-items: center; gap: 1em; padding: .5em 1.4em .5em .5em; border-radius: 22px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 .8em 2em rgba(0,0,0,.35); animation: pop-in .6s var(--ease) both; }
.tvp-qr { width: 6.4em; aspect-ratio: 1; border-radius: 12px; background: #fff; padding: 6px; box-shadow: 0 0 0 .22em var(--gold); }
.tvp-jw { display: grid; gap: .1em; }
.tvp-jw .eyebrow { margin: 0; font-size: .7em; }
.tvp-code { font-family: var(--display); font-size: 3em; line-height: 1; letter-spacing: .14em; color: var(--gold); text-shadow: 0 0 .25em rgba(242,210,122,.45), 0 .06em 0 #7a5a10; animation: code-glow 2.6s ease-in-out infinite var(--play); }
.tvp-addr { margin: 0; font-size: .8em; }
.tvp-addr b { color: var(--text); }
.tvp-people { list-style: none; margin: 0; padding: 0; display: flex; justify-content: flex-end; gap: .7em; min-width: 0; }
.tvp-people li { position: relative; width: 6em; flex: none; text-align: center; padding: .4em .2em .3em; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); transition: border-color .3s, background .3s; }
.tvp-people li.new { animation: bob-in .8s var(--bounce) both; }
.tvp-people li.away { opacity: .45; }
.tvp-people .avatar { display: block; width: 4.2em; height: 4.4em; margin: 0 auto; }
.tvp-people li .avatar { animation: idle-hop 9s ease-in-out infinite var(--play); animation-delay: calc(var(--i, 0) * -2.6s); }
.tvp-people b { display: block; font-size: .85em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvp-people .crown { position: absolute; top: .1em; right: .3em; font-size: 1.15em; animation: crown-tilt 3s ease-in-out infinite var(--play); }
.tvp-people.many li { width: 4.9em; } .tvp-people.many .avatar { width: 3.4em; height: 3.6em; }
.tvp-mark { position: absolute; top: -.45em; left: -.3em; width: 1.6em; height: 1.6em; border-radius: 50%; display: grid; place-items: center; font: 800 .95em/1 var(--display); box-shadow: 0 .2em .5em rgba(0,0,0,.45); }
.tvp-people li.thinking .tvp-mark { background: var(--surface-2); color: var(--gold); border: 2px solid var(--gold); animation: think-bob 1.2s ease-in-out infinite var(--play); animation-delay: calc(var(--i, 0) * -.3s); }
.tvp-people li.voted { border-color: rgba(52,196,106,.6); background: linear-gradient(180deg, rgba(52,196,106,.16), var(--surface)); }
.tvp-people li.voted .tvp-mark { background: var(--green); color: #fff; animation: tag-in .45s var(--bounce) both; }
@keyframes think-bob { 50% { transform: translateY(-.25em) rotate(-10deg); } }
.tvp-stage { --tone: var(--accent); flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 1.4vh; padding: 1.6vh 1.6vw 1.2vh; border-radius: 28px; border: 1px solid var(--line-2);
  background: linear-gradient(135deg, color-mix(in srgb, var(--tone) 26%, var(--surface)), var(--surface) 55%); box-shadow: 0 1.2em 3em rgba(0,0,0,.4); animation: show-in .7s var(--ease) both; }
.tvp-head { flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.2em; align-items: center; }
.tvp-art.g-art { width: 6.6em; border-radius: 14px; }
.tvp-hw { min-width: 0; }
.tvp-hw .eyebrow { margin: 0 0 .1em; font-size: .78em; }
.tvp-ask { margin: 0; font-size: 2.3em; line-height: 1.05; }
.tvp-ask.now { color: var(--gold); animation: ask-wiggle 1.6s ease-in-out infinite var(--play); transform-origin: left center; }
@keyframes ask-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-1.2deg) scale(1.02); } 75% { transform: rotate(1deg); } }
.tvp-stage.is-result .tvp-ask { color: var(--gold); }
.tvp-stage.is-result .tvp-ask:not(.rolling) { animation: verdict-in .8s var(--bounce) both; }
.tvp-stage.is-result:has(.rolled) .tvp-sub { animation: verdict-in .8s var(--bounce) 1.9s both; }
.tvp-sub { margin: .2em 0 0; color: var(--muted); font-size: 1em; }
.tvp-clock { position: relative; width: 5.2em; height: 5.2em; display: grid; place-items: center; }
.tvp-clock .ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--gold) var(--p), rgba(255,255,255,.1) 0); -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%); mask: radial-gradient(circle, transparent 58%, #000 60%); animation: ring-run var(--ms, 15s) linear var(--delay, 0s) both; }
@keyframes ring-run { from { --p: 100%; } to { --p: 0%; } }
.tvp-clock .vote-secs { font-size: 2em; }
/* every card of a row alike: the picture the same height on each (what the words and the faces' row leave), so the names
   line up and nothing moves when a vote starts; the words take the rest, two lines of each at most */
.tvp-cards { --rest: 12.6em; flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 1), minmax(0, 1fr)); gap: 1.6vh 1.4vw; padding: 1.1em .2em .2em; }
.tvp-cards .sc-card { border-radius: 24px; }
.tvp-cards .sc-pic { flex: none; height: calc(100% - var(--rest)); min-height: 3em; aspect-ratio: auto; margin: 8px 8px 0; border-radius: 18px; }
.tvp-cards .sc-body { flex: 1 1 0; min-height: 0; overflow: hidden; padding: .55em .9em .2em; gap: .3em; }
.tvp-cards .sc-title { font-size: 1.45em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tvp-cards.n2, .tvp-cards.n3 { --rest: 11.4em; }     /* (wide cards: the line seldom takes two lines) */
.tvp-cards.n5, .tvp-cards.n6 { --rest: 13em; }
.tvp-cards .sc-card { container-type: inline-size; }
/* five or six across: the title shrinks with its card so a long Swedish word (Flipperstudsarna) fits on its line whole */
.tvp-cards.n5 .sc-title, .tvp-cards.n6 .sc-title { font-size: min(1.15em, 8.6cqw); overflow-wrap: normal; word-break: normal; hyphens: manual; }
.tvp-cards.n7, .tvp-cards.n8 { --rest: 8.4em; }
.tvp-cards.n7 .sc-line, .tvp-cards.n8 .sc-line, .tvp-cards.n7 .sc-facts, .tvp-cards.n8 .sc-facts { display: none; }
/* nine or ten cards, five a row (Mini Golf: eight courses and "your own"): a line of name, the tag, the facts (the line
   is left to the phones), the picture a little lower; no row is ever squeezed away (the grid's rows keep their height) */
.tvp-cards.n9, .tvp-cards.n10 { --rest: 7.6em; }
.tvp-cards.n9 .sc-pic, .tvp-cards.n10 .sc-pic { min-height: 2.4em; }
.tvp-cards.n9 .sc-body, .tvp-cards.n10 .sc-body { grid-auto-rows: min-content; gap: .2em; padding-top: .45em; }
.tvp-cards.n9 .sc-title, .tvp-cards.n10 .sc-title { font-size: 1.1em; -webkit-line-clamp: 1; }
.tvp-cards.n9 .sc-tag, .tvp-cards.n10 .sc-tag { font-size: .74em; }
.tvp-cards.n9 .sc-line, .tvp-cards.n10 .sc-line { display: none; }
.tvp-cards.n9 .sc-facts, .tvp-cards.n10 .sc-facts { font-size: .74em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvp-cards .sc-line { font-size: .9em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tvp-cards .sc-ballot { flex: none; min-height: 2.6em; padding: 0 .8em .6em; margin: 0; flex-wrap: nowrap; overflow: hidden; }
.tvp-cards .sc-voter .avatar.mini { width: 2.3em; height: 2.4em; }
.tvp-cards .sc-on { font-size: .85em; top: -.6em; }
.tvp-cards .sc-card.on { animation: sc-in .55s var(--bounce) both, on-bob 3.2s ease-in-out .8s infinite var(--play); }
@keyframes on-bob { 0%, 100% { transform: translateY(-3px) rotate(0); } 50% { transform: translateY(-9px) rotate(-.6deg); } }
.tvp-cards .sc-card.on .sc-pic > svg, .tvp-cards .sc-card.on .sc-pic > canvas { animation: pic-breathe 6s ease-in-out infinite var(--play); }
@keyframes pic-breathe { 50% { transform: scale(1.06); } }
.tvp-foot { flex: none; display: flex; align-items: baseline; justify-content: space-between; gap: 2em; }
.tvp-rules { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvp-foot .tv-starts { margin: 0; flex: none; }
html.motion-reduced .tvp-ask.now, html.motion-reduced .tvp-cards .sc-card.on, html.motion-reduced .tvp-mark { animation: none; }

/* ═════════════ the card games on a phone, second pass: pads, wells, labels and buttons of the table's own family ═════════════ */
/* (Last Card, Pile Up, Vändtia. Nothing here blurs inside a cloth or pulses a shadow: what is painted once stays painted.) */

/* ---- the others on a phone that shows the table: small leather pads with a seam, as the TV's seats (plain leather: a character
        bobs on each, and what is under it is painted again every frame); the count sits on the character's corner, clear of the
        name; the turn is the gold edge and the bouncing tag (no shadow that pulses) ---- */
.opp.lc-opp, .opp.pu-opp, .opp.vt-opp { background: linear-gradient(180deg, #2f2849, #19152a 75%); border-color: rgba(255,255,255,.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 0 0 2px #3b2414, 0 0 0 3px rgba(214,170,92,.5), 0 4px 10px rgba(0,0,0,.45); }
.opp.lc-opp::after, .opp.pu-opp::after, .opp.vt-opp::after { content: ''; position: absolute; inset: 3px; border-radius: 10px; border: 1px dashed rgba(255,232,170,.2); pointer-events: none; }
.opp.lc-opp.turn, .opp.pu-opp.turn, .opp.vt-opp.turn { animation: none; border-color: rgba(255,236,170,.5); background: linear-gradient(180deg, #45395f, #251e38 75%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 0 0 2px #6b4a1c, 0 0 0 3.5px var(--gold), 0 0 16px rgba(242,210,122,.45), 0 4px 10px rgba(0,0,0,.45); }
.opp.lc-opp.turn::after, .opp.pu-opp.turn::after, .opp.vt-opp.turn::after { border-color: rgba(255,232,170,.4); }
.opp.lc-opp.exposed { box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 0 0 2px #7a1c2c, 0 0 0 3.5px var(--red), 0 4px 10px rgba(0,0,0,.45); }
.opp.lc-opp .opp-nm .count-badge, .opp.pu-opp .opp-nm .count-badge, .opp.vt-opp .opp-nm .count-badge { left: -7px; top: -8px; }
.opps.many > .opp.lc-opp .opp-nm .count-badge, .opps.many > .opp.pu-opp .opp-nm .count-badge, .opps.many > .opp.vt-opp .opp-nm .count-badge { left: -7px; top: -8px; }
#partyView[data-crowd] .opp.lc-opp .opp-nm .count-badge, #partyView[data-crowd] .opp.pu-opp .opp-nm .count-badge, #partyView[data-crowd] .opp.vt-opp .opp-nm .count-badge { left: -5px; top: -6px; }
/* Pile Up's pad: the stock card and the four discard tops lie under the name, the whole width of the pad (they no longer push out of it) */
.opps:not(.many) > .opp.pu-opp > .avatar { grid-row: 1 / span 2; }
.opps:not(.many) > .opp.pu-opp > .opp-cards { grid-column: 1 / -1; margin: 3px 0 0 2px; min-width: 0; }

/* ---- an empty place on a cloth is a well pressed into it, never a dashed box ---- */
.lc-card.ghost, .vt-card.ghost { background: linear-gradient(180deg, rgba(0,0,0,.4), rgba(0,0,0,.18) 45%, rgba(0,0,0,.24)); border: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.12); }

/* ---- the row you play from: its label sits on the tray's upper edge, clear of a card that lifts; while you wait the edge is a thin line, not dashes ---- */
#partyView[data-fit] .lc-hand .tray.active, #partyView[data-fit] .vt-hand .tray.active, #partyView[data-fit] .pu-hand .tray.active[data-row=hand] { position: relative; margin-top: 10px; padding-top: 14px; }
#partyView[data-fit] .lc-hand .tray.active > .tray-lbl, #partyView[data-fit] .vt-hand .tray.active > .tray-lbl, #partyView[data-fit] .pu-hand .tray.active[data-row=hand] > .tray-lbl { position: absolute; left: 12px; top: -12px; z-index: 3; width: max-content; max-width: calc(100% - 24px);
  padding: 1px 6px 1px 11px; border-radius: 999px; background: #1d1830; color: var(--gold); box-shadow: 0 0 0 1.5px rgba(242,210,122,.55), 0 2px 6px rgba(0,0,0,.4); pointer-events: none; }
#partyView[data-fit] .lc-hand .tray.active > .tray-lbl .hint, #partyView[data-fit] .vt-hand .tray.active > .tray-lbl .hint, #partyView[data-fit] .pu-hand .tray.active[data-row=hand] > .tray-lbl .hint { margin-left: 4px; padding-right: 6px; color: #e9dfc6; }
#partyView[data-fit] .lc-hand .tray.active.wait, #partyView[data-fit] .vt-hand .tray.active.wait, #partyView[data-fit] .pu-hand .tray.active[data-row=hand].wait { border-style: solid; border-color: rgba(255,255,255,.14); }
#partyView[data-fit] .lc-hand .tray.active.wait > .tray-lbl, #partyView[data-fit] .vt-hand .tray.active.wait > .tray-lbl, #partyView[data-fit] .pu-hand .tray.active[data-row=hand].wait > .tray-lbl { color: #cfc7de; box-shadow: 0 0 0 1.5px rgba(255,255,255,.2), 0 2px 6px rgba(0,0,0,.4); }
#partyView[data-fit] > .p-hand > .panel[data-tight] .tray.active > .tray-lbl { position: static; box-shadow: none; background: none; padding: 0; }   /* (a hand so long that its row scrolls: the label in the row again) */
#partyView[data-fit] > .p-hand > .panel[data-tight] .tray.active { margin-top: 0; padding-top: 6px; }

/* ---- the moves: buttons of the table's family (a leather pad in the rail's walnut and brass; the one to press is brass) ---- */
#partyView[data-fit] .lc-hand .bar > .btn, #partyView[data-fit] .vt-hand .bar > .btn, #partyView[data-fit] .pu-hand .bar > .btn { border-color: transparent; background: linear-gradient(180deg, #332b4f, #1c182d); color: #f6efdc;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 0 0 1px rgba(0,0,0,.3), 0 0 0 2px #3b2414, 0 0 0 3px rgba(214,170,92,.5), 0 4px 10px rgba(0,0,0,.4); }
#partyView[data-fit] .lc-hand .bar > .btn.primary, #partyView[data-fit] .vt-hand .bar > .btn.primary, #partyView[data-fit] .pu-hand .bar > .btn.primary, #partyView[data-fit] .lc-hand .bar > .btn.gold { background: linear-gradient(180deg, #ffe9a8, #f2bd52 58%, #e2a034); color: #2a1c02;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65), inset 0 -3px 0 rgba(150,92,10,.32), 0 0 0 2px #6b4a1c, 0 4px 12px rgba(0,0,0,.45); }
#partyView[data-fit] .lc-hand .bar > .btn:disabled, #partyView[data-fit] .vt-hand .bar > .btn:disabled, #partyView[data-fit] .pu-hand .bar > .btn:disabled { opacity: .5; box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 0 0 2px #3b2414, 0 0 0 3px rgba(214,170,92,.3); }
#partyView[data-fit] .pu-hand .bar > .btn.how:disabled { opacity: 1; background: rgba(242,210,122,.1); border: 0; color: var(--gold); box-shadow: inset 0 0 0 1.5px rgba(242,210,122,.55); }   /* (how a turn ends: a note, not a button: a thin gold line, no dashes) */

/* ---- with a TV the table in short has the phone's whole width (the menu and Sound buttons lie over its corner); short, its words keep clear of them ---- */
#partyView[data-fit][data-table=tv] .hand-panel > .strip.ct { margin-right: 0; }
@media (orientation: portrait), (min-height: 521px) {
  @container (max-height: 289.9px) { #partyView[data-fit][data-table=tv] .hand-panel > .strip.ct > .words { padding-right: 52px; } }
  @container (min-height: 290px) { #partyView[data-fit][data-table=tv] .vt-strip > .stack .vt-card { --w: clamp(56px, min(50cqw, calc((100cqh - 272px) / 1.45)), 160px); } }   /* (Vändtia: room for every one of the others under the pile) */
}

/* ---- a banner over a phone's felt (cards to take, somebody to catch): the piles' labels step aside for it ---- */
.ptable > .felt:has(> .banner) .stack .lbl, .ptable > .felt:has(> .banner) .pu-build .lbl { visibility: hidden; }

/* ---- Pile Up on a phone: the stock and the four discard piles lie in one railed tray of the game's cloth, each in its well;
        the piles in the middle are the railed felt itself (no box round it) ---- */
#partyView[data-fit] .pu-hand .pu-mine { --felt: #1a5a6d; --felt-2: #09232d; gap: 10px; padding: 6px 10px 9px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(0,0,0,.3), transparent 12px), url(/party/games/cards/felt.webp?v=1) 0 0 / 96px 96px, radial-gradient(ellipse 100% 130% at 50% 0%, var(--felt), var(--felt-2) 94%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.55), 0 0 0 3px #3b2414, 0 0 0 4px rgba(214,170,92,.55), 0 5px 12px rgba(0,0,0,.4); }
#partyView[data-fit] .pu-hand .pu-mine > .tray { border: 0; background: none; padding: 0; gap: 5px; }
#partyView[data-fit] .pu-hand .pu-mine > .tray > .tray-lbl { color: rgba(255,248,224,.86); }
#partyView[data-fit] .pu-hand .pu-mine > .tray.active > .tray-lbl { color: var(--gold); }
#partyView[data-fit] .pu-hand .pu-stock, #partyView[data-fit] .pu-hand .pu-discard { border-radius: 10px; padding: 4px; background: linear-gradient(180deg, rgba(0,0,0,.44), rgba(0,0,0,.2) 45%, rgba(0,0,0,.26)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.14); }
#partyView[data-fit] .pu-hand .pu-stock .pu-card.ghost, #partyView[data-fit] .pu-hand .pu-discard .pu-card.ghost { background: none; box-shadow: none; }
#partyView[data-fit] .pu-hand button.pu-discard.go { background: linear-gradient(180deg, rgba(242,210,122,.34), rgba(242,210,122,.16)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.3), 0 0 0 3px rgba(242,210,122,.85); }
#partyView[data-fit] .pu-hand .tray.pu-midtray { border: 0; background: none; padding: 0 0 3px; }
#partyView[data-fit] .pu-hand .tray.pu-midtray > .tray-lbl { padding: 0 6px; }
#partyView[data-fit] .pu-hand .tray.pu-midtray.active > .felt { box-shadow: 0 0 0 2px var(--gold), 0 0 14px rgba(242,210,122,.4), inset 0 0 0 1px rgba(0,0,0,.5); }
.pu-seat .pu-card.ghost { background: rgba(0,0,0,.3); box-shadow: inset 0 0 0 1px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.08); }

/* ---- Vändtia on a phone: the rows you do not play from are real small cards (a printed line inside the rim), a little darker,
        in shallow wells; never grey tiles ---- */
#partyView[data-fit] .vt-hand .tray:not(.active) { opacity: 1; border: 0; background: rgba(0,0,0,.24); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), inset 0 1px 0 rgba(0,0,0,.4); }
.vt-hand .tray:not(.active) .vt-card:not(.back)::before, .vt-seat .vt-card:not(.back)::before { content: ''; position: absolute; inset: 5.5% 7%; border: 1px solid rgba(150,124,74,.5); border-radius: calc(var(--w) * .055); pointer-events: none; }
#partyView[data-fit] .vt-hand .tray:not(.active) .vt-card::after { content: ''; position: absolute; inset: 0; background: rgba(60,40,16,.2); pointer-events: none; }

/* ---- the TV: the hint about sound stands clear of the seats at a card table ---- */
body:has(.board.ct) .tv-hint { bottom: auto; top: 6.6em; right: 2.2vw; font-size: .82em; padding: .4em .9em; }
