/* Studio: today's dark navy kept, the layout rebuilt as a calm streaming app with the picked game as the hero, and the
   same calm navy voice carried into every game through the shared tokens and data-part hooks. Every rule sits under
   html[data-theme="studio"] and every @keyframes name starts with studio-, so nothing here reaches another look.

   The TV home screen: the picked game's art fills the top of the screen, faded into the navy on its left and under it,
   with the game's name, blurb, players and Play laid over the dark side. The rest of the games sit in one row of art
   cards under it, the picked one lifted out of the row with a white ring. The join code and the players share a slim
   bar along the bottom, the players as round bubbles with their initials in their own color. theme.js hangs the art
   behind the page and crossfades it as the pick moves (mount), stamps initials on game lobby rosters, and plays the
   ident (splash).

   The phone: the shelf is a two-column grid of art tiles, players are avatar bubbles, Who's playing is a grid of big
   avatar buttons, and the host picking is a hero card in the host's color.

   One face (Sora), sentence case (--caps none), round corners (--radius, no chamfer), no bevels and no glow (--glow 0).
   Gold is the one accent; calm navy depth carries the hub and every game's lobby, headline, pause and end screen.
   Lite mode keeps the layout and drops fades, masks and lifts that cost a frame; reduced motion holds everything still. */

/* ---------- the palette and whole-page tokens ---------- */

html[data-theme="studio"] {
  --sd-void: #050A18;
  --sd-void-rgb: 5, 10, 24;
  --sd-navy: #0A1226;
  --sd-panel: #101A35;
  --sd-panel-2: #16244A;
  --sd-wash: #12204A;
  --sd-line: rgba(169, 188, 211, 0.16);
  --sd-ink: #EAFBFF;
  --sd-mist: #A9BCD3;
  --sd-dim: #8A9DB9;
  --sd-gold: #FFB800;
  --sd-gold-rgb: 255, 184, 0;
  --sd-on-gold: #1A1000;
  /* Team Cyan and "you" inside a game: a calm studio cyan, never the neon one. */
  --sd-cyan: #4DC4E0;
  --sd-cyan-rgb: 77, 196, 224;
  /* The picked game's own color (set per game below), for the glow, the kicker and the ring. Gold until one is picked. */
  --sd-accent-rgb: var(--sd-gold-rgb);
  --sd-face: 'Sora', 'Chakra Petch', system-ui, sans-serif;
  --sd-round: 999px;
  --sd-r: 0.9rem;

  /* Whole-page Studio tokens: apply to the hub and every game root on TV and phone. */
  --obsidian: var(--sd-void);
  --obsidian-rgb: var(--sd-void-rgb);
  --stage: var(--sd-navy);
  --stage-2: var(--sd-panel);
  --stage-light-rgb: 20, 38, 82;
  --stage-pool-rgb: 18, 32, 74;
  --stage-deep-rgb: 12, 22, 52;
  --surface-sunk: #070E20;
  --surface-0: #081024;
  --surface-1: #0A1226;
  --surface-2: #0D1730;
  --surface-3: #101A35;
  --surface-4: #16244A;
  --surface-glass-rgb: 16, 26, 53;
  --ink: var(--sd-ink);
  --ink-2: var(--sd-mist);
  --ink-3: var(--sd-dim);
  --line: var(--sd-line);
  --gold: var(--sd-gold);
  --gold-rgb: var(--sd-gold-rgb);
  --on-gold: var(--sd-on-gold);
  --gold-metal: linear-gradient(var(--sd-gold), var(--sd-gold));
  --gold-metal-tv: linear-gradient(var(--sd-gold), var(--sd-gold));
  --cyan-metal: linear-gradient(var(--sd-ink), var(--sd-ink));
  --display: var(--sd-face);
  --caps: none;
  --track: 0;
  --glow: 0;
  --bevel: 0px;
  --radius: var(--sd-r);
  --rim: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --rim-hi: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --shade: none;
  --plate-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 52%);
  --lift-1: none;
  --lift-2: none;
  --drop-1: 0 8px 22px rgba(0, 0, 0, 0.34);
  accent-color: var(--sd-gold);
  caret-color: var(--sd-gold);
}

/* ---------- the materials (tokens.css): dark glass and metal ---------- */

/* What the four dimensional games are built from. In the studio they are smoked glass over brushed steel: a cool sheen
   across the face, a shallow side and a deep soft shadow, and a stage that drifts very slowly. The scrim behind words
   that float over the stage is the night navy. */
html[data-theme="studio"] {
  --gc-scrim: rgba(var(--sd-void-rgb), 0.72);
  --gc-scrim-ink: var(--sd-ink);
  --sd-deep: #060C1C;
  --sd-steel: #3A4663;
  --sd-baize: #0F3340;
  --sd-sheet: #E6ECF4;
  --sd-tile: #1B2747;
  --gc-stage-1: var(--sd-wash);
  --gc-stage-2: var(--sd-void);
  --gc-stage-light: rgba(var(--sd-cyan-rgb), 0.16);
  --gc-stage-motion: 40s;
  --gc-prop-face: var(--sd-panel-2);
  --gc-prop-edge: var(--sd-deep);
  --gc-prop-rim: rgba(255, 255, 255, 0.22);
  --gc-prop-depth: 6px;
  --gc-prop-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 22px 48px rgba(0, 0, 0, 0.55);
  --gc-prop-sheen: linear-gradient(165deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03) 38%, transparent 60%, rgba(var(--sd-cyan-rgb), 0.06));
  --gc-ctl-face: var(--sd-steel);
  --gc-ctl-ink: var(--sd-ink);
  --gc-ctl-edge: var(--sd-deep);
  --gc-ctl-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  --gc-ctl-press: 0 3px;
  --gc-ctl-radius: var(--sd-r);
  --gc-outline-w: 1px;
  --gc-outline: rgba(255, 255, 255, 0.14);
  --gc-metal:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #5D6B85, #2C3650 48%, var(--sd-steel) 52%, #1A2238);
  --gc-felt:
    radial-gradient(ellipse 70% 60% at 50% 35%, rgba(var(--sd-cyan-rgb), 0.12), transparent 70%),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.06) 0 2px, transparent 2px 4px),
    linear-gradient(var(--sd-baize), #08202A);
  --gc-paper:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent 30%),
    linear-gradient(var(--sd-sheet), #CBD5E2);
  --gc-flap:
    linear-gradient(180deg, transparent calc(50% - 1px), rgba(0, 0, 0, 0.8) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(180deg, var(--sd-tile) 50%, #121C36 50%);
}

/* Each game brings its own accent, picked from its cover and calmed for the navy. The hero's game decides it, so
   stepping through the shelf turns the whole room that color, and the launch carries it into the game. A game not
   listed keeps gold. */
html[data-theme="studio"]:has(#hubFeature[data-id="bomb-squad"]) { --sd-accent-rgb: 255, 77, 94; }
html[data-theme="studio"]:has(#hubFeature[data-id="short-fuse"]) { --sd-accent-rgb: 255, 138, 31; }
html[data-theme="studio"]:has(#hubFeature[data-id="beat-shazam"]) { --sd-accent-rgb: 34, 211, 224; }
html[data-theme="studio"]:has(#hubFeature[data-id="the-floor"]) { --sd-accent-rgb: 61, 169, 255; }
html[data-theme="studio"]:has(#hubFeature[data-id="family-feud"]) { --sd-accent-rgb: 255, 184, 0; }
html[data-theme="studio"]:has(#hubFeature[data-id="wavelength"]) { --sd-accent-rgb: 182, 156, 255; }
html[data-theme="studio"]:has(#hubFeature[data-id="spy-blitz"]) { --sd-accent-rgb: 111, 140, 255; }
html[data-theme="studio"]:has(#hubFeature[data-id="one-percent"]) { --sd-accent-rgb: 245, 217, 10; }
html[data-theme="studio"]:has(#hubFeature[data-id="chameleon"]) { --sd-accent-rgb: 61, 224, 138; }
html[data-theme="studio"]:has(#hubFeature[data-id="fakin-it"]) { --sd-accent-rgb: 255, 61, 127; }
html[data-theme="studio"]:has(#hubFeature[data-id="higher-lower"]) { --sd-accent-rgb: 184, 240, 74; }
html[data-theme="studio"]:has(#hubFeature[data-id="vault-heist"]) { --sd-accent-rgb: 255, 154, 31; }
html[data-theme="studio"]:has(#hubFeature[data-id="bet-the-board"]) { --sd-accent-rgb: 46, 204, 113; }
html[data-theme="studio"]:has(#hubFeature[data-id="blank-match"]) { --sd-accent-rgb: 255, 214, 74; }
html[data-theme="studio"]:has(#hubFeature[data-id="bluff-dictionary"]) { --sd-accent-rgb: 201, 162, 102; }
html[data-theme="studio"]:has(#hubFeature[data-id="party-crasher"]) { --sd-accent-rgb: 255, 112, 132; }
html[data-theme="studio"]:has(#hubFeature[data-id="sketch-rush"]) { --sd-accent-rgb: 255, 176, 32; }
html[data-theme="studio"]:has(#hubFeature[data-id="act-up"]) { --sd-accent-rgb: 77, 196, 224; }
html[data-theme="studio"]:has(#hubFeature[data-id="console"]) { --sd-accent-rgb: 190, 206, 230; }

html[data-theme="studio"] * { scrollbar-color: rgba(169, 188, 211, 0.35) transparent; }
html[data-theme="studio"] ::-webkit-scrollbar-thumb { background: rgba(169, 188, 211, 0.35); border-radius: var(--sd-round); }
html[data-theme="studio"] ::selection { background: rgba(var(--sd-gold-rgb), 0.32); color: #FFFFFF; }
html[data-theme="studio"] :focus-visible { outline-color: var(--sd-gold); }

/* Buttons are flat, rounded and unlit everywhere: hub, drawer, how-to and inside every game. Gold is solid. */
html[data-theme="studio"] body :is(.btn, [data-part="button"]) {
  --edge: 0; --sheen: 0;
  clip-path: none; border-radius: var(--sd-r);
  background: var(--face);
  font-family: var(--sd-face); font-weight: 700; letter-spacing: 0; text-transform: none;
  box-shadow: inset 0 0 0 1px var(--sd-line);
}
html[data-theme="studio"] body :is(.btn, [data-part="button"]).gold {
  --face: linear-gradient(var(--sd-gold), var(--sd-gold)); --fg: var(--sd-on-gold);
  box-shadow: none;
}
html[data-theme="studio"] body :is(.btn, [data-part="button"]).ghost {
  --face: linear-gradient(rgba(234, 251, 255, 0.11), rgba(234, 251, 255, 0.11)); --fg: #FFFFFF;
  box-shadow: inset 0 0 0 1px rgba(234, 251, 255, 0.16);
}
html[data-theme="studio"] body :is(.btn, [data-part="button"]).danger {
  --face: linear-gradient(rgba(var(--red-rgb), 0.16), rgba(var(--red-rgb), 0.16)); --fg: var(--red-soft);
  box-shadow: inset 0 0 0 1px rgba(var(--red-rgb), 0.32);
}
html[data-theme="studio"] body :is(.btn, [data-part="button"]).small { border-radius: var(--sd-round); font-weight: 600; }
html[data-theme="studio"] body :is(.btn, [data-part="button"])::after { border-radius: inherit; }
html[data-theme="studio"] body :is(.btn, [data-part="button"]):focus-visible { outline-offset: 4px; }
html[data-theme="studio"] kbd {
  border-radius: 0.4em; font-family: var(--sd-face); font-weight: 600;
  background: rgba(234, 251, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(234, 251, 255, 0.18);
}
html[data-theme="studio"] :is(.btn, [data-part="button"]) kbd { background: rgba(0, 0, 0, 0.14); box-shadow: none; }
html[data-theme="studio"] :is(.btn, [data-part="button"]).gold kbd { color: var(--on-gold-2); box-shadow: inset 0 0 0 1px rgba(120, 70, 0, 0.35); }
html[data-theme="studio"] :is(.btn, [data-part="button"]).ghost kbd { color: var(--sd-mist); }

/* Fields everywhere (phone forms, The Floor editor, game inputs): rounded navy slots with a thin mist border. */
html[data-theme="studio"] .field {
  border-radius: 14px; background-color: var(--sd-void);
  box-shadow: inset 0 0 0 1px var(--sd-line);
  font-family: var(--sd-face);
}
html[data-theme="studio"] .field:focus-visible {
  outline: 3px solid var(--sd-gold); outline-offset: 2px;
  background-color: var(--sd-void);
  box-shadow: inset 0 0 0 1px var(--sd-line);
}
html[data-theme="studio"] select.field {
  background-image: linear-gradient(45deg, transparent 50%, var(--sd-mist) 50%), linear-gradient(135deg, var(--sd-mist) 50%, transparent 50%);
}

/* Segmented toggles everywhere (join card, drawer, game mode and round pickers): pill tracks with a crisp light thumb. */
html[data-theme="studio"] [data-part="seg"] {
  clip-path: none; border-radius: var(--sd-round); padding: 0.35vh;
  background: rgba(var(--sd-void-rgb), 0.85);
  box-shadow: inset 0 0 0 1px var(--sd-line);
}
html[data-theme="studio"] [data-part="seg"] button {
  min-height: 2.6rem; border-radius: var(--sd-round);
  font-family: var(--sd-face); font-weight: 600; font-size: var(--tv-xs);
  text-transform: none; letter-spacing: 0; color: var(--sd-mist);
}
html[data-theme="studio"] [data-part="seg"] button:hover { color: #FFFFFF; }
html[data-theme="studio"] [data-part="seg"] button[aria-checked='true'] { color: var(--sd-void); background: var(--sd-ink); box-shadow: none; }
html[data-theme="studio"] body.phone [data-part="seg"] { padding: 4px; background: var(--sd-void); }
html[data-theme="studio"] body.phone [data-part="seg"] button { min-height: 46px; font-size: var(--ph-base); }

/* ---------- TV: the top bar and sound hint ---------- */

/* Quiet chrome over the art and games: the name in plain type, the tools as round dark buttons. */
html[data-theme="studio"] .top { padding: var(--gc-safe-y) max(3.5vw, var(--gc-safe-x)) 0; min-height: 7.6vh; }
html[data-theme="studio"] body.tv[data-view="game"] .top {
  grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 1.4vw;
  padding: var(--gc-safe-y) max(3.5vw, var(--gc-safe-x)) 1.8vh;
  box-shadow: inset 0 -1px 0 var(--sd-line);
}
html[data-theme="studio"] .top .mark { font-family: var(--sd-face); font-weight: 600; font-size: var(--tv-base); text-transform: none; letter-spacing: -0.01em; gap: 0.7em; white-space: nowrap; }
html[data-theme="studio"] .mark-grid rect { stroke: var(--sd-ink); }
html[data-theme="studio"] .mark-grid rect.g { stroke: var(--sd-gold); fill: rgba(var(--sd-gold-rgb), 0.45); }
html[data-theme="studio"] .top .mark-game { color: var(--sd-mist); font-weight: 600; letter-spacing: 0; }
html[data-theme="studio"] .top .mark-game::before { color: var(--sd-dim); }
html[data-theme="studio"] .top .status {
  padding: 0.55vh 1.1vw; border-radius: var(--sd-round);
  font-family: var(--sd-face); font-size: var(--tv-xs); font-weight: 600; color: var(--sd-ink);
  background: rgba(16, 26, 53, 0.85); box-shadow: inset 0 0 0 1px var(--sd-line);
}
html[data-theme="studio"] .top .status.warn { color: var(--sd-on-gold); background: var(--sd-gold); box-shadow: none; }
html[data-theme="studio"] .top .tool {
  clip-path: none; border-radius: 50%;
  color: var(--sd-mist);
  background: rgba(var(--sd-void-rgb), 0.55);
  box-shadow: inset 0 0 0 1px var(--sd-line);
}
html[data-theme="studio"] .top .tool:hover { color: #FFFFFF; background: rgba(22, 36, 74, 0.9); }
html[data-theme="studio"] .top .tool.wide { border-radius: var(--sd-round); padding: 0 1.2rem; text-transform: none; letter-spacing: 0; font-weight: 600; font-size: var(--tv-xs); white-space: nowrap; }
html[data-theme="studio"] .top .tool.wide.armed { color: #FFFFFF; background: var(--red); box-shadow: none; }
/* The sound hint moves out of the top bar to a quiet pill along the bottom so it never crowds a game's name.
   Inside a game it tucks into the bottom-left clear of centered action buttons; in the hub it rests centered under
   the roster bar, which makes extra room for it while it is up. */
html[data-theme="studio"] [data-part="sound-hint"] {
  position: fixed; left: 50%; bottom: var(--gc-safe-y); transform: translateX(-50%); z-index: 25;
  clip-path: none; border-radius: var(--sd-round); padding: 0.6vh 1.2vw;
  font-family: var(--sd-face); font-size: 1.05rem; font-weight: 600; letter-spacing: 0;
  color: var(--sd-ink);
  background: rgba(16, 26, 53, 0.92);
  box-shadow: inset 0 0 0 1px var(--sd-line), 0 8px 24px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}
html[data-theme="studio"] body.tv[data-view="game"] [data-part="sound-hint"] { left: calc(var(--tv-stage-x) + max(3 * var(--tv-vw), var(--gc-safe-x))); transform: none; }
html[data-theme="studio"] body.tv[data-view="hub"]:has([data-part="sound-hint"]:not([hidden])) .rail { padding-bottom: calc(var(--gc-safe-y) + 3.8vh); }
html[data-theme="studio"] [data-part="sound-hint"][hidden] { display: none; }

/* ---------- TV: the home screen ---------- */

/* No pools of light on the home screen: a flat night navy, and the art brings the color. */
html[data-theme="studio"] body.tv[data-view="hub"] { background: transparent; }
/* The ground takes a breath of the picked game's color; a plain color, so it eases from one game to the next. */
html[data-theme="studio"] body.tv[data-view="hub"] .spotlights {
  background: color-mix(in srgb, rgb(var(--sd-accent-rgb)) 9%, var(--sd-void));
  transition: background-color 900ms var(--ease-out);
}
html[data-theme="studio"] body.tv[data-view="hub"] .spotlights::before { display: none; }

/* The art behind the page (theme.js): edge to edge across the top of the screen, drifting slowly so the room feels
   alive, and fading into the navy on the left (where the words sit) and under it (where the row of cards sits). The
   picked game's color glows up from the bottom left, between the art and the fade. */
html[data-theme="studio"] .studio-backdrop {
  position: fixed; z-index: -1; inset: 0;
  overflow: hidden; pointer-events: none;
}
html[data-theme="studio"] .studio-backdrop img {
  position: absolute; top: -4%; left: -4%; width: 108%; height: 90%; object-fit: cover; object-position: 50% 40%;
  opacity: 0; transform: scale(1.04); transform-origin: 50% 0;
  transition: opacity 700ms var(--ease-out), transform 1600ms var(--ease-out);
}
html[data-theme="studio"] .studio-backdrop img.on { opacity: 1; transform: none; animation: studio-drift 26s ease-in-out infinite alternate; }
html[data-theme="studio"] .studio-backdrop::before {
  content: ''; position: absolute; z-index: 1; inset: 0;
  background-color: rgba(var(--sd-accent-rgb), 0.3);
  -webkit-mask-image: radial-gradient(ellipse 70% 62% at 12% 74%, #000, transparent 70%);
  mask-image: radial-gradient(ellipse 70% 62% at 12% 74%, #000, transparent 70%);
  transition: background-color 900ms var(--ease-out);
}
html[data-theme="studio"] .studio-backdrop::after {
  content: ''; position: absolute; z-index: 2; inset: -1px;
  background:
    linear-gradient(90deg, rgba(var(--sd-void-rgb), 0.94) 0%, rgba(var(--sd-void-rgb), 0.8) 22%, rgba(var(--sd-void-rgb), 0.32) 48%, rgba(var(--sd-void-rgb), 0) 74%),
    linear-gradient(0deg, rgba(var(--sd-void-rgb), 0.96) 0%, rgba(var(--sd-void-rgb), 0.86) 30%, rgba(var(--sd-void-rgb), 0) 64%),
    linear-gradient(180deg, rgba(var(--sd-void-rgb), 0.6) 0%, rgba(var(--sd-void-rgb), 0) 16%);
}
html[data-theme="studio"] body[data-view="game"] .studio-backdrop { display: none; }
/* The slow living drift: a few percent of zoom and pan over half a minute, there and back. It moves translate and scale
   on their own, so the fade-in's transform is left alone. */
@keyframes studio-drift { from { scale: 1; translate: 0 0; } to { scale: 1.07; translate: -2% 1%; } }

/* Play grows the hero into the game. While the sting runs, the backdrop rises over the stage: the shelf and the bar
   sink into navy, the art swells to fill the screen with the game's name over it, and the whole of it fades away onto
   the game's lobby, which loaded underneath. One move instead of a cut. */
html[data-theme="studio"] body.tv:has(> .sting.on) .studio-backdrop {
  display: block; z-index: 34;
  animation: studio-grow 1600ms var(--ease-out) both;
}
html[data-theme="studio"] body.tv:has(> .sting.on) .studio-backdrop img.on { animation: studio-grow-art 1600ms var(--ease-out) both; }
html[data-theme="studio"] body.tv:has(> .sting.on) .studio-backdrop::after { animation: studio-grow-fade 1600ms var(--ease-out) both; }
/* The navy the stage sinks into is a layer under the art (theme.js) fading in, so the sting moves only opacity. */
html[data-theme="studio"] .studio-floor { position: absolute; inset: 0; background: var(--sd-void); opacity: 0; }
html[data-theme="studio"] body.tv:has(> .sting.on) .studio-floor { animation: studio-grow-floor 1600ms var(--ease-out) both; }
@keyframes studio-grow { 0%, 72% { opacity: 1; } 100% { opacity: 0; } }
@keyframes studio-grow-floor { 0% { opacity: 0; } 10%, 100% { opacity: 1; } }
@keyframes studio-grow-art { from { transform: none; } 62%, to { transform: scale(1.3); } }
@keyframes studio-grow-fade { from { opacity: 1; } 56%, to { opacity: 0.45; } }

/* The stage is one column: the home screen above, the bar with the code and the players under it. */
html[data-theme="studio"] body.tv[data-view="hub"] .stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
html[data-theme="studio"] body.tv[data-view="hub"] .hub-view {
  padding: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr) auto auto;
  grid-template-areas: 'hero hero' 'label keys' 'row row';
}

/* The hero: the picked game's name, blurb, players and Play, on the dark side of its art. */
html[data-theme="studio"] .hub-view .feature {
  grid-area: hero; min-height: 0; overflow: hidden; container-type: size;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0.6vh 3.5vw 1.6vh;
}
html[data-theme="studio"] .hub-view .feature:empty { display: none; }
html[data-theme="studio"] .hub-view .feature-art { display: none; }
html[data-theme="studio"] .hub-view .feature-text {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1.2vh; max-width: 54vw; max-height: 100%;
  animation: studio-rise 520ms var(--ease-out) both;
}
/* A short bar in the game's color over its name: the hero's one touch of the accent besides the glow. */
html[data-theme="studio"] .hub-view .feature-text::before {
  content: ''; width: 4.2vw; height: 0.55vh; margin-bottom: -0.2vh; border-radius: var(--sd-round);
  background-color: rgb(var(--sd-accent-rgb));
  transition: background-color 900ms var(--ease-out);
}
/* The hero's type follows the hero track's real height (cqh) as well as the screen height, so even the longest blurb
   plus Play stay clear of the top bar on short or DPI-scaled displays and the card shelf keeps its place. */
html[data-theme="studio"] .hub-view .feature-name {
  font-family: var(--sd-face); font-weight: 800; font-size: min(var(--tv-hero), 7vh); line-height: 0.98; letter-spacing: -0.04em;
  color: #FFFFFF; text-wrap: balance;
}
html[data-theme="studio"] .hub-view .feature .game-blurb { max-width: 50ch; font-size: min(var(--tv-base), 2.4vh); line-height: 1.32; color: var(--sd-ink); text-wrap: pretty; }
html[data-theme="studio"] .hub-view .feature .game-meta { gap: 0.6vh 1vw; font-size: var(--tv-sm); }
html[data-theme="studio"] .hub-view .game-meta .chip { border-radius: var(--sd-round); padding: 0.28em 0.85em; font-weight: 600; color: var(--sd-ink); background: rgba(234, 251, 255, 0.1); box-shadow: none; }
html[data-theme="studio"] .hub-view .feature .fit { font-weight: 600; }
html[data-theme="studio"] .hub-view .feature-go { display: flex; align-items: center; gap: 1vw; margin-top: 0.4vh; }
html[data-theme="studio"] .hub-view .feature-go .game-go { order: -1; }
html[data-theme="studio"] .hub-view .feature .btn { flex: none; white-space: nowrap; min-height: 5.4vh; padding: 0 2vw; font-size: var(--tv-base); pointer-events: auto; margin: 0; }
html[data-theme="studio"] .hub-view .feature .btn .ico { font-size: 1.05em; }
/* A short window (720-820 high) trims shelf and hero padding so the hero keeps generous height below the top bar. */
@media (max-height: 820px) {
  html[data-theme="studio"] .hub-view .shelf { --sd-card-w: 10.4vw; }
  html[data-theme="studio"] .hub-view .shelf .shelf-row { padding: 1.6vh 1vw 1.6vh; }
}
@media (max-height: 780px) {
  html[data-theme="studio"] .hub-view .feature { padding-bottom: 1.1vh; }
  html[data-theme="studio"] .hub-view .feature-text { gap: 0.85vh; }
  html[data-theme="studio"] .hub-view .feature-go { margin-top: 0; }
  html[data-theme="studio"] .hub-view .feature .game-meta { font-size: var(--tv-xs); }
}
@supports (height: 1cqh) {
  html[data-theme="studio"] .hub-view .feature-text { padding: 1.5cqh 0 1.5cqh; gap: min(1.2vh, 3.2cqh); }
  html[data-theme="studio"] .hub-view .feature-text::before { height: min(0.55vh, 1.6cqh); margin-bottom: calc(-1 * min(0.2vh, 0.6cqh)); }
  html[data-theme="studio"] .hub-view .feature-name { font-size: min(var(--tv-hero), 7vh, 18cqh); }
  html[data-theme="studio"] .hub-view .feature .game-blurb { font-size: min(var(--tv-base), 2.4vh, 6.5cqh); }
  html[data-theme="studio"] .hub-view .feature .game-meta { font-size: min(var(--tv-sm), 5.3cqh); }
  html[data-theme="studio"] .hub-view .feature-go { margin-top: min(0.4vh, 1.2cqh); }
  html[data-theme="studio"] .hub-view .feature .btn { min-height: min(5.4vh, 14.5cqh); font-size: min(var(--tv-base), 6.2cqh); }
}
/* A game still short of phones opens its lobby to wait for them: Play goes quiet, the line beside it says why. */
html[data-theme="studio"] .hub-view .feature[data-ready="false"] .btn.gold[data-play] {
  --face: linear-gradient(rgba(234, 251, 255, 0.1), rgba(234, 251, 255, 0.1)); --fg: #FFFFFF;
  box-shadow: inset 0 0 0 1px rgba(234, 251, 255, 0.28);
}
html[data-theme="studio"] .hub-view .feature[data-ready="false"] .btn.gold[data-play] kbd { color: var(--sd-mist); box-shadow: none; }
html[data-theme="studio"] .hub-view .feature .fit.warn { color: var(--sd-gold); }
@keyframes studio-rise { from { opacity: 0; transform: translateY(1.2vh); } }

/* The row label: what to do now on the left, the keys on the right. */
html[data-theme="studio"] .hub-view .banner {
  grid-area: label; height: auto; min-width: 0;
  flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 1.2vw;
  padding: 0 0 0 3.5vw; text-align: left;
}
html[data-theme="studio"] .hub-view .headline,
html[data-theme="studio"] .hub-view .headline.long {
  flex: none; font-family: var(--sd-face); font-weight: 700; font-size: var(--tv-md); line-height: 1.1;
  text-transform: none; letter-spacing: -0.02em; color: #FFFFFF;
}
html[data-theme="studio"] .hub-view .headline .who { text-shadow: none; }
html[data-theme="studio"] .hub-view .subline { min-width: 0; margin: 0; font-size: var(--tv-sm); color: var(--sd-mist); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-theme="studio"] .hub-view .actions { grid-area: keys; min-height: 0; justify-content: flex-end; padding: 0 3.5vw 0 2vw; }
html[data-theme="studio"] .hub-view .hub-keys { font-size: var(--tv-xs); color: var(--sd-dim); white-space: nowrap; }

/* The row of art cards. It scrolls sideways when the games outrun the screen (theme.js keeps the picked card in
   view), with room above for the picked card to lift and a fade on the right edge where the row runs on. The row
   stops at the safe area, so a half-shown card's name never sits where a set might crop it. */
html[data-theme="studio"] .hub-view .shelf { --sd-card-w: 11.4vw; grid-area: row; position: relative; display: block; min-height: 0; padding: 0; filter: none; }
html[data-theme="studio"] .hub-view .shelf-pick { display: none; }
html[data-theme="studio"] .hub-view .shelf .shelf-row {
  position: relative;
  display: flex; align-items: flex-start; justify-content: flex-start; gap: 1.1vw;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  margin: 0 var(--gc-safe-x); padding: 2.6vh 1vw 2.8vh;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 3vw), transparent);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 3vw), transparent);
}
html[data-theme="studio"] .hub-view .shelf-row::-webkit-scrollbar { display: none; }
html[data-theme="studio"] .hub-view .shelf .game-card {
  flex: none; width: var(--sd-card-w); max-width: none; height: auto;
  display: flex; flex-direction: column; align-items: stretch; gap: 1.2vh;
  padding: 0; overflow: visible; container-type: normal;
  text-align: left; background: none; box-shadow: none; clip-path: none;
  transform-origin: 50% 100%;
  transition: transform 420ms var(--ease-out);
}
html[data-theme="studio"] .hub-view .shelf .game-card .game-art {
  flex: none; width: 100%; height: auto; aspect-ratio: 642 / 342;
  display: block; overflow: hidden; border-radius: var(--sd-r);
  background: var(--sd-navy);
  box-shadow: 0 0 0 1px var(--sd-line);
  transition: box-shadow 320ms var(--ease-out);
}
html[data-theme="studio"] .hub-view .shelf .game-card .game-art::before { display: none; }
html[data-theme="studio"] .hub-view .shelf .game-card .game-art img { width: 100%; height: 100%; object-fit: cover; transform: none; filter: none; transition: opacity 320ms var(--ease-out); }
html[data-theme="studio"] .hub-view .shelf .game-card .art-mark { display: grid; place-items: center; height: 100%; font-size: 6vh; color: var(--sd-mist); }
html[data-theme="studio"] .hub-view .shelf .game-card .game-text { flex: none; align-items: flex-start; gap: 0; min-width: 0; }
/* The names read from the couch: big type, up to two lines and never cut, and every card keeps two lines of room so
   a short name and a long one leave the row the same height. */
html[data-theme="studio"] .hub-view .shelf .game-card .game-name {
  display: block; max-width: 100%; height: calc(2 * 1.18em); overflow: visible; white-space: normal; overflow-wrap: normal; text-wrap: balance;
  font-family: var(--sd-face); font-weight: 600; font-size: max(var(--tv-base), 2.6vh); line-height: 1.18; letter-spacing: -0.015em; text-transform: none;
  color: var(--sd-mist);
}
html[data-theme="studio"] .hub-view .shelf .game-card :is(.game-blurb, .game-meta, .game-go) { display: none; }
html[data-theme="studio"] .hub-view .shelf .game-card.on { z-index: 1; transform: translateY(-0.8vh) scale(1.07); }
html[data-theme="studio"] .hub-view .shelf .game-card.on .game-art { box-shadow: 0 0 0 0.32vh #FFFFFF, 0 1.8vh 3.4vh rgba(0, 0, 0, 0.6), 0 0 6vh rgba(var(--sd-accent-rgb), 0.35); }
html[data-theme="studio"] .hub-view .shelf .game-card.on .game-name { color: #FFFFFF; }
html[data-theme="studio"] .hub-view .shelf .game-card[aria-disabled="true"] .game-art { opacity: 1; filter: none; }
html[data-theme="studio"] .hub-view .shelf .game-card[aria-disabled="true"] .game-art img { opacity: 0.42; }
html[data-theme="studio"] .hub-view .shelf .game-card:focus-visible { outline: none; }
html[data-theme="studio"] .hub-view .shelf .game-card:focus-visible .game-art { outline: 3px solid var(--cyan); outline-offset: 0.6vh; }

/* "3 more": a pill at each end of the row while games sit out of sight that way (theme.js counts them). It rides over
   the edge of the art, clear of the names. */
html[data-theme="studio"] .hub-view .shelf .studio-more {
  position: absolute; z-index: 2; top: 2.6vh; height: calc(var(--sd-card-w) * 342 / 642 + 0.2vh);
  display: flex; align-items: center; gap: 0.5vw; padding: 0 1.4vw;
  font-family: var(--sd-face); font-weight: 700; font-size: var(--tv-sm); white-space: nowrap; color: #FFFFFF;
  pointer-events: none;
}
html[data-theme="studio"] .hub-view .shelf .studio-more[hidden] { display: none; }
html[data-theme="studio"] .hub-view .shelf .studio-more.right { right: 0; padding-left: 4vw; padding-right: var(--gc-safe-x); background: linear-gradient(90deg, rgba(var(--sd-void-rgb), 0), rgba(var(--sd-void-rgb), 0.92) 46%); }
html[data-theme="studio"] .hub-view .shelf .studio-more.left { left: 0; padding-right: 4vw; padding-left: var(--gc-safe-x); background: linear-gradient(270deg, rgba(var(--sd-void-rgb), 0), rgba(var(--sd-void-rgb), 0.92) 46%); }
html[data-theme="studio"] .hub-view .shelf .studio-more.right::after,
html[data-theme="studio"] .hub-view .shelf .studio-more.left::before {
  content: ''; width: 1.1vh; height: 1.1vh; border: solid #FFFFFF; border-width: 0.3vh 0.3vh 0 0;
}
html[data-theme="studio"] .hub-view .shelf .studio-more.right::after { transform: rotate(45deg); }
html[data-theme="studio"] .hub-view .shelf .studio-more.left::before { transform: rotate(-135deg); }

/* ---------- TV: the bar with the code and the players ---------- */

html[data-theme="studio"] body.tv[data-view="hub"] .rail {
  grid-area: 2 / 1;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'roster join';
  align-items: center; column-gap: 2.4vw;
  padding: 1.2vh max(3.5vw, var(--gc-safe-x)) var(--gc-safe-y);
  background: var(--sd-navy);
  box-shadow: inset 0 1px 0 var(--sd-line);
}

/* The code: the square beside the address, the switch, optional remote invite actions, and the line under it.
   The text column stays wide enough and compact enough that even a 58-char public tunnel URL stays to two lines
   and the remote chips hold one row, so the bottom bar never grows and pushes the hero into the top bar. */
html[data-theme="studio"] body.tv[data-view="hub"] .rail .join {
  --qr: clamp(88px, 12.5vh, 14.5vh);
  grid-area: join;
  display: grid; grid-template-columns: var(--qr) minmax(0, 31vw); grid-template-areas: 'qr url' 'qr seg' 'qr hint';
  align-content: center; align-items: center; gap: 0.45vh 1.2vw;
  padding: 0;
}
html[data-theme="studio"] body.tv[data-view="hub"] .rail .join:has(.join-remote:not([hidden])) {
  grid-template-areas: 'qr url' 'qr seg' 'qr remote' 'qr hint';
  gap: 0.4vh 1.2vw;
}
html[data-theme="studio"] body.tv[data-view="hub"] .rail .join .join-remote {
  grid-area: remote; grid-column: 2; flex-wrap: nowrap; justify-content: flex-start; gap: 0.35rem;
}
html[data-theme="studio"] body.tv[data-view="hub"] .rail .join .join-remote .btn.small {
  min-height: 1.85rem; padding: 0 0.65em; font-size: clamp(10px, 0.85vw, 1.05rem); white-space: nowrap;
}
html[data-theme="studio"] body.tv[data-view="hub"] .rail .join .join-remote .remote-pill {
  padding: 0.2em 0.55em; font-size: clamp(10px, 0.85vw, 1.05rem); white-space: nowrap;
}
html[data-theme="studio"] .rail .join::before { display: none; }
html[data-theme="studio"] .rail .join .qr-card { grid-area: qr; clip-path: none; border-radius: var(--sd-r); padding: 0.6vh; }
html[data-theme="studio"] .rail .join .qr-wait { border-radius: var(--sd-r); padding: 0.8vw; font-size: var(--tv-xs); }
html[data-theme="studio"] .rail .join .qr-card.waiting::after { border-radius: 0 0 var(--sd-r) var(--sd-r); background-image: linear-gradient(90deg, transparent, var(--sd-gold), transparent); }
html[data-theme="studio"] .rail .join .join-url { grid-area: url; text-align: left; font-size: clamp(11px, 0.95vw, 1.15rem); line-height: 1.18; letter-spacing: -0.02em; }
html[data-theme="studio"] .rail .join .seg {
  grid-area: seg; clip-path: none; border-radius: var(--sd-round); padding: 0.25vh;
  background: rgba(var(--sd-void-rgb), 0.8); box-shadow: inset 0 0 0 1px var(--sd-line);
}
html[data-theme="studio"] .rail .join .seg button { min-height: 2.05rem; border-radius: var(--sd-round); font-weight: 600; font-size: clamp(11px, 0.9vw, var(--tv-xs)); }
html[data-theme="studio"] .rail .join .seg button[aria-checked='true'] { color: var(--sd-void); background: var(--sd-ink); box-shadow: none; }
html[data-theme="studio"] .rail .join .join-hint { grid-area: hint; max-width: none; text-align: left; font-size: clamp(10px, 0.85vw, 1.05rem); line-height: 1.2; color: var(--sd-mist); }

/* The players: a title and the note on one line, and everyone as a round bubble with their initials in their color,
   their name under it. Away players are a ring. Remove shows on a pointer over a bubble, and asks once. */
html[data-theme="studio"] body.tv[data-view="hub"] .hub-roster {
  grid-area: roster; flex: none; min-width: 0;
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: 'title note' 'list list';
  align-items: baseline; gap: 1.6vh 1.2vw;
}
html[data-theme="studio"] .hub-roster .roster-title {
  grid-area: title; font-family: var(--sd-face); font-weight: 700; font-size: var(--tv-sm); line-height: 1.1;
  text-transform: none; letter-spacing: -0.01em; color: #FFFFFF;
}
html[data-theme="studio"] .hub-roster .roster-title .num { margin-left: 0.35em; font-size: 1em; color: var(--sd-mist); }
html[data-theme="studio"] .hub-roster .roster-note { grid-area: note; min-width: 0; font-size: var(--tv-xs); color: var(--sd-mist); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Names in couch-sized type, on one row: a second row would push the hero off the top of the screen, so a full room
   shares the row and a long name ends in an ellipsis rather than shrinking. */
html[data-theme="studio"] .hub-roster .roster-list {
  grid-area: list; display: flex; align-items: flex-start; gap: 0.8vw;
  padding: 0.4vh 0 0; overflow: visible;
}
html[data-theme="studio"] .hub-roster .roster-list li {
  position: relative; flex: 1 1 0; min-width: 0; max-width: 8.6vw;
  display: flex; flex-direction: column; align-items: center; gap: 0.9vh;
}
/* The player's doodle is their bubble: a round tile of their color over the name. Away, it goes hollow, a ring of
   their color around the drawing. */
html[data-theme="studio"] .hub-roster .roster-row .avatar {
  width: min(7.2vh, 100%); aspect-ratio: 1; height: auto; border-radius: 50%;
}
html[data-theme="studio"] .hub-roster .roster-row .avatar .av-initial { font-family: var(--sd-face); fill: var(--sd-void); }
html[data-theme="studio"] .hub-roster .roster-list li.away .roster-row .avatar { opacity: 1; box-shadow: inset 0 0 0 0.28vh rgb(var(--pc)); }
html[data-theme="studio"] .hub-roster .roster-list li.away .roster-row .av-tile { fill: transparent; }
html[data-theme="studio"] .hub-roster .roster-list li.away .roster-row .av-ink { stroke: rgb(var(--pc)); }
html[data-theme="studio"] .hub-roster .roster-list li.away .roster-row .av-initial { fill: rgb(var(--pc)); }
html[data-theme="studio"] .hub-roster .roster-row,
html[data-theme="studio"] .hub-roster .roster-row:hover,
html[data-theme="studio"] .hub-roster .roster-list li.away .roster-row {
  width: 100%; min-height: 0; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 0.9vh;
  background: none; box-shadow: none;
}
html[data-theme="studio"] .hub-roster .rr-name,
html[data-theme="studio"] .hub-roster .rr-name.long {
  max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-family: var(--sd-face); font-weight: 600; font-size: var(--tv-sm); line-height: 1.2; text-transform: none; text-align: center;
  color: var(--sd-ink);
}
html[data-theme="studio"] .hub-roster .roster-list li.away .rr-name { color: var(--sd-mist); }
/* The host's crown sits on the bubble's shoulder. */
html[data-theme="studio"] .hub-roster .rr-host {
  position: absolute; top: -0.3vh; left: calc(50% + 2vh);
  width: 2.8vh; height: 2.8vh; border-radius: 50%; place-items: center;
  font-size: 1.6vh; color: var(--sd-on-gold); background: var(--sd-gold);
  box-shadow: 0 0 0 0.3vh var(--sd-navy);
}
html[data-theme="studio"] .hub-roster .roster-x {
  position: absolute; top: -0.4vh; right: calc(50% + 2vh);
  min-width: 0; width: 2.9vh; height: 2.9vh; padding: 0; border-radius: var(--sd-round);
  font-size: 1.5vh; color: var(--sd-ink); background: var(--sd-panel-2);
  box-shadow: 0 0 0 0.3vh var(--sd-navy);
  opacity: 0; transition: opacity 160ms var(--ease-out);
}
html[data-theme="studio"] .hub-roster .roster-list li:is(:hover, :focus-within) .roster-x { opacity: 1; }
html[data-theme="studio"] .hub-roster .roster-x:hover:not(:disabled) { color: #FFFFFF; background: var(--red); box-shadow: 0 0 0 0.3vh var(--sd-navy); }
html[data-theme="studio"] .hub-roster .roster-x.armed {
  opacity: 1; right: auto; left: 50%; top: 1.6vh; transform: translateX(-50%);
  width: auto; height: auto; padding: 0.35em 0.8em; white-space: nowrap;
  font-size: var(--tv-xs); font-weight: 700; color: #FFFFFF; background: var(--red);
}
html[data-theme="studio"] .hub-roster .roster-x:disabled { opacity: 0; }

/* ---------- TV: the launch sting and the way back ---------- */

/* The sting: the game's name settling into place over its own art as the hero grows (the backdrop, above), a short
   line in the game's color drawn under it. Its own ground is only a soft dim, so the art carries the moment. */
html[data-theme="studio"] .sting { gap: 3.6vh; background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(var(--sd-void-rgb), 0.55), rgba(var(--sd-void-rgb), 0.2) 80%); }
html[data-theme="studio"] .sting.on { animation-name: studio-sting; }
html[data-theme="studio"] .sting-name {
  font-family: var(--sd-face); font-weight: 800; font-size: 13vh; line-height: 1; letter-spacing: -0.045em; text-transform: none;
  color: #FFFFFF; text-shadow: none;
}
html[data-theme="studio"] .sting.on .sting-name { animation-name: studio-sting-name; }
html[data-theme="studio"] .sting-line { width: 12vw; height: 0.5vh; border-radius: var(--sd-round); background: rgb(var(--sd-accent-rgb)); }
html[data-theme="studio"] .sting.on .sting-line { animation-name: studio-sting-line; }
@keyframes studio-sting { 0% { opacity: 0; } 10%, 74% { opacity: 1; } 100% { opacity: 0; } }
@keyframes studio-sting-name { 0% { opacity: 0; transform: translateY(2.6vh); } 32% { opacity: 1; } 64%, 100% { opacity: 1; transform: none; } }
@keyframes studio-sting-line { 0%, 24% { transform: scaleX(0); } 66%, 100% { transform: scaleX(1); } }

/* The way back: the screen dips to navy with the mark in the middle and comes up on the home screen. */
html[data-theme="studio"] .wipe {
  left: 0; width: 100vw; transform: none; opacity: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, var(--sd-wash), var(--sd-void) 76%);
}
html[data-theme="studio"] .wipe::before, html[data-theme="studio"] .wipe::after { display: none; }
html[data-theme="studio"] .wipe.on { animation: studio-wipe 1000ms linear both; }
html[data-theme="studio"] .wipe-mark { gap: 0.7em; font-family: var(--sd-face); font-weight: 600; font-size: 5.6vh; text-transform: none; letter-spacing: -0.02em; color: #FFFFFF; }
html[data-theme="studio"] .wipe.on .wipe-mark { animation: studio-wipe-mark 1000ms var(--ease-out) both; }
@keyframes studio-wipe {
  0% { opacity: 0; animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  36%, 54% { opacity: 1; animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
  100% { opacity: 0; }
}
@keyframes studio-wipe-mark { 0% { opacity: 0; transform: scale(0.96); } 30%, 60% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ---------- how to play, TV and phone ---------- */

html[data-theme="studio"] body.tv .howto { background: radial-gradient(ellipse 46% 60% at 24% 46%, rgba(26, 58, 122, 0.5), transparent 72%), var(--sd-void); }
html[data-theme="studio"] .howto-name, html[data-theme="studio"] .howto-title {
  font-family: var(--sd-face); font-weight: 800; text-transform: none; letter-spacing: -0.035em; line-height: 1.02; color: #FFFFFF;
}
html[data-theme="studio"] body.tv .howto-name { font-size: 7.2vh; }
html[data-theme="studio"] body.tv .howto-title { font-size: 6.4vh; }
html[data-theme="studio"] body.tv .howto-art img { transform: none; border-radius: 1.6vh; box-shadow: 0 0 0 1px var(--sd-line), 0 3vh 5vh rgba(0, 0, 0, 0.5); }
html[data-theme="studio"] .howto-kicker, html[data-theme="studio"] .howto-where { color: var(--sd-mist); font-weight: 600; }
html[data-theme="studio"] .howto-kicker .ico, html[data-theme="studio"] .howto-where .ico { color: var(--sd-gold); }
html[data-theme="studio"] .howto-goal { color: var(--sd-mist); }
html[data-theme="studio"] .howto-chip { border-radius: var(--sd-round); padding: 0.4em 1em; background: rgba(234, 251, 255, 0.1); box-shadow: none; }
/* The pages as dots: the one you are on is a gold bar, the ones read are mist, the rest faint. */
html[data-theme="studio"] .howto-tiles { align-items: center; }
html[data-theme="studio"] .howto-tiles i { border-radius: var(--sd-round); background: rgba(169, 188, 211, 0.24); box-shadow: none; transition: width 320ms var(--ease-out), background-color 320ms var(--ease-out); }
html[data-theme="studio"] .howto-tiles i.done { background: var(--sd-mist); box-shadow: none; }
html[data-theme="studio"] .howto-tiles i.on { background: var(--sd-gold); box-shadow: none; }
html[data-theme="studio"] body.tv .howto-tiles i { width: 1.3vh; height: 1.3vh; }
html[data-theme="studio"] body.tv .howto-tiles i.on { width: 4.2vh; }
html[data-theme="studio"] body.phone .howto-tiles i { width: 9px; height: 9px; }
html[data-theme="studio"] body.phone .howto-tiles i.on { width: 26px; }
html[data-theme="studio"] .howto-count { font-family: var(--sd-face); font-weight: 600; }
html[data-theme="studio"] .howto-item::before { top: 0.3em; bottom: auto; width: 0.6em; height: 0.6em; border-radius: 50%; box-shadow: none; }
html[data-theme="studio"] body.tv .howto-item { padding-left: 1.8vw; }
html[data-theme="studio"] .howto-item dt { text-transform: none; letter-spacing: -0.01em; }
html[data-theme="studio"] .howto .icon-btn, html[data-theme="studio"] .howto-x { border-radius: 50%; }
html[data-theme="studio"] body.phone .howto { background: radial-gradient(110% 30% at 50% 0%, rgba(26, 58, 122, 0.5), transparent 72%), var(--sd-void); }
html[data-theme="studio"] body.phone .howto-thumb { border-radius: 12px; overflow: hidden; clip-path: none; }
html[data-theme="studio"] body.phone .howto-page h1 { font-family: var(--sd-face); font-weight: 800; text-transform: none; letter-spacing: -0.03em; line-height: 1.05; }
html[data-theme="studio"] body.phone .howto-dock { background: linear-gradient(180deg, rgba(var(--sd-void-rgb), 0), rgba(var(--sd-void-rgb), 0.94) 34%, var(--sd-void)); }

/* ---------- TV: inside a game (stage, banner, lobby rail, paused, finale) ---------- */

/* Calm navy depth behind every game, without the classic cyan spotlight cone. */
html[data-theme="studio"] body.tv[data-view="game"] .spotlights {
  background:
    radial-gradient(ellipse 75% 60% at 42% 16%, rgba(22, 36, 74, 0.58), transparent 72%),
    linear-gradient(180deg, var(--sd-navy), var(--sd-void) 56%);
  transition: none;
}
html[data-theme="studio"] body.tv[data-view="game"] .spotlights::before { display: none; }

/* The game's headline and subline: Sora heavy sentence case, tight tracking, no neon text glow. */
html[data-theme="studio"] [data-part="game-banner"] { height: auto; min-height: 13.5vh; padding: 1.8vh 0 1vh; gap: 0.9vh; }
html[data-theme="studio"] [data-part="game-banner"] .headline {
  font-family: var(--sd-face); font-weight: 800; font-size: 5.8vh; line-height: 1.05;
  letter-spacing: -0.035em; text-transform: none; color: #FFFFFF;
}
html[data-theme="studio"] [data-part="game-banner"] .headline.long { font-size: 4.5vh; }
html[data-theme="studio"] [data-part="game-banner"] .headline .who { text-shadow: none; }
html[data-theme="studio"] [data-part="game-banner"] .subline {
  margin: 0 auto; max-width: 58ch; font-family: var(--sd-face); font-weight: 500; font-size: 2.25vh; line-height: 1.38;
  letter-spacing: 0; color: var(--sd-mist); text-wrap: balance;
}

/* The game lobby rail: a calm navy panel on the right, matching the hub's bottom bar. */
html[data-theme="studio"] body.tv[data-view="game"] .rail {
  padding: 2vh var(--gc-safe-x) max(2.6vh, var(--gc-safe-y)) 2.2vw; gap: 1.8vh;
  background: var(--sd-navy);
  box-shadow: inset 1px 0 0 var(--sd-line);
}
html[data-theme="studio"] [data-part="game-rail"] { gap: 1.6vh; }
html[data-theme="studio"] [data-part="game-rail"] > [data-part="button"].gold {
  width: 100%; min-height: 7vh; padding: 0 1.4vw; font-size: var(--tv-base);
}

/* The join card in a game lobby: QR beside the hint, full-width link under them so ports never orphan onto a second
   line, and the pill switch across the foot, leaving plenty of height under it for twelve avatar bubbles. */
html[data-theme="studio"] body.tv[data-view="game"] [data-part="join"] {
  --qr: min(7.6vw, 13vh);
  display: grid; grid-template-columns: var(--qr) minmax(0, 1fr);
  grid-template-areas: 'qr hint' 'url url' 'seg seg';
  align-items: center; align-content: start; gap: 1vh 1.1vw;
  padding: 1.4vh 1.2vw; border-radius: var(--sd-r);
  background: var(--sd-panel); box-shadow: inset 0 0 0 1px var(--sd-line);
}
html[data-theme="studio"] body.tv[data-view="game"] [data-part="join"] .qr-card { grid-area: qr; clip-path: none; border-radius: 0.7rem; padding: 0.6vh; }
html[data-theme="studio"] body.tv[data-view="game"] [data-part="join"] .join-url { grid-area: url; text-align: left; font-size: var(--tv-sm); letter-spacing: -0.02em; }
html[data-theme="studio"] body.tv[data-view="game"] [data-part="join"] .join-url:empty { display: none; }
html[data-theme="studio"] body.tv[data-view="game"] [data-part="join"] .join-hint {
  grid-area: hint; align-self: center; max-width: none; text-align: left; font-size: 1.05rem; line-height: 1.35; color: var(--sd-mist);
}
html[data-theme="studio"] body.tv[data-view="game"] [data-part="join"] .seg { grid-area: seg; }

/* The game lobby roster: players as round avatar bubbles with their initials (stamped by theme.js), four across so
   twelve fit in three calm rows. Away players are a ring. Clickable rows (The Floor) stretch their tap target over
   the whole bubble so clicking the avatar picks the player. */
html[data-theme="studio"] [data-part="game-roster"] { flex: 1; min-height: 0; gap: 1.4vh; }
html[data-theme="studio"] [data-part="game-roster"] .roster-title {
  font-family: var(--sd-face); font-weight: 700; font-size: var(--tv-sm); line-height: 1.1;
  text-transform: none; letter-spacing: -0.01em; color: #FFFFFF;
}
html[data-theme="studio"] [data-part="game-roster"] .roster-title .num { margin-left: 0.35em; font-size: 1em; color: var(--sd-mist); }
html[data-theme="studio"] [data-part="game-roster"] .roster-note { font-size: var(--tv-xs); line-height: 1.35; color: var(--sd-mist); }
html[data-theme="studio"] [data-part="game-roster"] .roster-list {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5vh 0.6vw; padding: 0.5vh 0.2vw 0.4vh;
  align-content: start; overflow-y: auto;
}
html[data-theme="studio"] [data-part="game-roster"] .roster-list[hidden] { display: none; }
html[data-theme="studio"] [data-part="game-roster"] .roster-list li {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.65vh; min-width: 0;
}
html[data-theme="studio"] [data-part="game-roster"] .roster-list li::before {
  content: attr(data-initials);
  width: 5.5vh; height: 5.5vh; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--sd-face); font-weight: 700; font-size: var(--tv-xs); letter-spacing: -0.02em; color: var(--sd-void);
  background: rgb(var(--pc));
  transition: box-shadow 160ms var(--ease-out);
}
html[data-theme="studio"] [data-part="game-roster"] .roster-list li.away::before {
  color: rgb(var(--pc)); background: transparent; box-shadow: inset 0 0 0 0.26vh rgb(var(--pc));
}
html[data-theme="studio"] [data-part="game-roster"] .roster-list li:has(.roster-row.on)::before {
  box-shadow: 0 0 0 0.26vh var(--sd-navy), 0 0 0 0.52vh var(--sd-gold);
}
html[data-theme="studio"] [data-part="game-roster"] .roster-row,
html[data-theme="studio"] [data-part="game-roster"] .roster-row:hover,
html[data-theme="studio"] [data-part="game-roster"] .roster-row.on,
html[data-theme="studio"] [data-part="game-roster"] .roster-list li.away .roster-row {
  width: 100%; min-height: 0; padding: 0;
  display: flex; justify-content: center;
  background: none; box-shadow: none;
}
html[data-theme="studio"] [data-part="game-roster"] button.roster-row::after { content: ''; position: absolute; inset: 0; }
html[data-theme="studio"] [data-part="game-roster"] .roster-row i { display: none; }
html[data-theme="studio"] [data-part="game-roster"] .rr-name {
  max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-family: var(--sd-face); font-weight: 600; font-size: var(--tv-xs); line-height: 1.2;
  text-transform: none; text-align: center; color: var(--sd-ink);
}
html[data-theme="studio"] [data-part="game-roster"] .roster-list li.away .rr-name { color: var(--sd-mist); }
html[data-theme="studio"] [data-part="game-roster"] .roster-x {
  position: absolute; z-index: 2; top: -0.35vh; right: calc(50% - 3.3vh);
  min-width: 0; width: 2.6vh; height: 2.6vh; padding: 0; border-radius: var(--sd-round);
  font-size: 1.35vh; color: var(--sd-ink); background: var(--sd-panel-2);
  box-shadow: 0 0 0 0.26vh var(--sd-navy);
  opacity: 0; transition: opacity 160ms var(--ease-out);
}
html[data-theme="studio"] [data-part="game-roster"] .roster-list li:is(:hover, :focus-within) .roster-x { opacity: 1; }
html[data-theme="studio"] [data-part="game-roster"] .roster-x:hover:not(:disabled) { color: #FFFFFF; background: var(--red); box-shadow: 0 0 0 0.26vh var(--sd-navy); }
html[data-theme="studio"] [data-part="game-roster"] .roster-x.armed {
  opacity: 1; right: auto; left: 50%; top: 1.2vh; transform: translateX(-50%);
  width: auto; height: auto; padding: 0.3em 0.7em; white-space: nowrap;
  font-size: var(--tv-xs); font-weight: 700; color: #FFFFFF; background: var(--red);
}
html[data-theme="studio"] [data-part="game-roster"] .roster-x:disabled { opacity: 0; }

/* Paused: a calm navy cover with soft blur, Sora heavy title and a short gold line under it echoing the Studio sting. */
html[data-theme="studio"] [data-part="paused"] {
  gap: 2.4vh;
  background: radial-gradient(ellipse 68% 58% at 50% 50%, rgba(18, 32, 74, 0.93), rgba(var(--sd-void-rgb), 0.97) 72%);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
html[data-theme="studio"] [data-part="paused"] .paused-word {
  display: flex; flex-direction: column; align-items: center; gap: 2.4vh;
  font-family: var(--sd-face); font-weight: 800; font-size: 11vh; line-height: 1;
  letter-spacing: -0.04em; text-transform: none; color: #FFFFFF;
}
html[data-theme="studio"] [data-part="paused"] .paused-word::after {
  content: ''; width: 8vw; height: 0.45vh; border-radius: var(--sd-round); background: var(--sd-gold);
}
html[data-theme="studio"] [data-part="paused"] .paused-hint {
  max-width: 44ch; text-align: center; font-family: var(--sd-face); font-size: var(--tv-md); font-weight: 500;
  line-height: 1.4; color: var(--sd-mist);
}

/* TV Finale: winner washed softly in their own color on deep navy, no spotlight cone, standings as rounded Studio rows. */
html[data-theme="studio"] body.tv [data-part="finale"] {
  background:
    radial-gradient(ellipse 50% 72% at 26% 48%, rgba(var(--pc, var(--sd-gold-rgb)), 0.24), transparent 72%),
    var(--sd-void);
}
html[data-theme="studio"] body.tv [data-part="finale"]::before { display: none; }
html[data-theme="studio"] body.tv [data-part="finale"] .finale-name {
  font-family: var(--sd-face); font-weight: 800; font-size: 11.5vh; line-height: 1;
  letter-spacing: -0.04em; text-transform: none; text-shadow: none;
}
html[data-theme="studio"] body.tv [data-part="finale"] .finale-line { font-family: var(--sd-face); font-size: var(--tv-md); color: var(--sd-mist); }
html[data-theme="studio"] body.tv [data-part="finale"] [data-part="button"] {
  font-size: var(--tv-base); min-height: 6.6vh; padding: 0 1.8vw; border-radius: var(--sd-r);
}
html[data-theme="studio"] body.tv [data-part="finale"] .stats { border-spacing: 0 0.8vh; font-size: 3vh; }
html[data-theme="studio"] body.tv [data-part="finale"] .stats th { font-family: var(--sd-face); font-weight: 600; font-size: var(--tv-xs); color: var(--sd-dim); }
html[data-theme="studio"] body.tv [data-part="finale"] .stats tbody tr {
  background: linear-gradient(90deg, rgba(var(--pc), 0.16), var(--sd-panel) 54%);
}
html[data-theme="studio"] body.tv [data-part="finale"] .stats td {
  padding: 1.3vh 1vw;
  box-shadow: inset 0 1px 0 var(--sd-line), inset 0 -1px 0 var(--sd-line);
}
html[data-theme="studio"] body.tv [data-part="finale"] .stats td:first-child {
  border-radius: var(--sd-r) 0 0 var(--sd-r); color: var(--sd-mist);
  box-shadow: inset 1px 0 0 var(--sd-line), inset 0 1px 0 var(--sd-line), inset 0 -1px 0 var(--sd-line);
}
html[data-theme="studio"] body.tv [data-part="finale"] .stats td:last-child {
  border-radius: 0 var(--sd-r) var(--sd-r) 0;
  box-shadow: inset -1px 0 0 var(--sd-line), inset 0 1px 0 var(--sd-line), inset 0 -1px 0 var(--sd-line);
}
html[data-theme="studio"] body.tv [data-part="finale"] .stats td.p { width: 48%; font-family: var(--sd-face); font-weight: 700; text-transform: none; }
html[data-theme="studio"] body.tv [data-part="finale"] .stats td.p i { border-radius: 50%; box-shadow: none; }
html[data-theme="studio"] body.tv [data-part="finale"] .stats tr.first {
  background: linear-gradient(90deg, rgba(var(--sd-gold-rgb), 0.24), rgba(var(--sd-gold-rgb), 0.08) 65%), var(--sd-panel);
}
html[data-theme="studio"] body.tv [data-part="finale"] .stats tr.first td {
  color: var(--gold-text);
  box-shadow: inset 0 1px 0 rgba(var(--sd-gold-rgb), 0.42), inset 0 -1px 0 rgba(var(--sd-gold-rgb), 0.32);
}
html[data-theme="studio"] body.tv [data-part="finale"] .stats tr.first td:first-child {
  box-shadow: inset 1px 0 0 rgba(var(--sd-gold-rgb), 0.42), inset 0 1px 0 rgba(var(--sd-gold-rgb), 0.42), inset 0 -1px 0 rgba(var(--sd-gold-rgb), 0.32);
}
html[data-theme="studio"] body.tv [data-part="finale"] .stats tr.first td:last-child {
  box-shadow: inset -1px 0 0 rgba(var(--sd-gold-rgb), 0.42), inset 0 1px 0 rgba(var(--sd-gold-rgb), 0.42), inset 0 -1px 0 rgba(var(--sd-gold-rgb), 0.32);
}

/* ---------- phone: the bar and whole-phone Studio surfaces ---------- */

html[data-theme="studio"] body.phone::before {
  background:
    radial-gradient(90% 28% at 50% -6%, rgba(var(--me), 0.2), transparent 72%),
    linear-gradient(180deg, var(--sd-navy), var(--sd-void) 55%);
}
html[data-theme="studio"] .bar .mark { font-family: var(--sd-face); font-weight: 600; font-size: var(--ph-sm); text-transform: none; letter-spacing: -0.01em; color: var(--sd-mist); }
html[data-theme="studio"] .bar .mark-grid rect { opacity: 1; }
html[data-theme="studio"] .bar .me {
  clip-path: none; border-radius: var(--sd-round);
  grid-template-columns: 26px minmax(0, 1fr); column-gap: 8px;
  padding: 5px 14px 5px 5px;
  font-family: var(--sd-face); font-weight: 700; font-size: var(--ph-sm); text-transform: none; letter-spacing: -0.01em;
  background: rgba(var(--me), 0.14); box-shadow: inset 0 0 0 1px rgba(var(--me), 0.35);
}
html[data-theme="studio"] .bar .me i { width: 26px; height: 26px; border-radius: 50%; box-shadow: none; }
html[data-theme="studio"] .bar .me em { border-radius: var(--sd-round); padding: 1px 8px; letter-spacing: 0; }
html[data-theme="studio"] .bar .host-btn {
  clip-path: none; border-radius: var(--sd-round); padding: 0 15px 0 12px;
  font-family: var(--sd-face); text-transform: none; letter-spacing: 0;
  color: var(--sd-on-gold); background: var(--sd-gold); box-shadow: none;
}
html[data-theme="studio"] .bar .host-btn.claim { color: var(--sd-gold); background: rgba(var(--sd-gold-rgb), 0.1); box-shadow: inset 0 0 0 1.5px rgba(var(--sd-gold-rgb), 0.55); }
html[data-theme="studio"] .bar .host-btn:focus-visible { outline-offset: 3px; }

/* ---------- phone: shared parts across the hub, drawer and every game ---------- */

html[data-theme="studio"] body.phone :is(h1, h2) { font-family: var(--sd-face); text-transform: none; letter-spacing: -0.025em; }
html[data-theme="studio"] body.phone h1 { font-weight: 800; line-height: 1.05; }
html[data-theme="studio"] body.phone h2 { font-weight: 700; letter-spacing: -0.015em; }
html[data-theme="studio"] .hub-app h2 { font-size: var(--ph-lg); font-weight: 700; letter-spacing: -0.02em; }
html[data-theme="studio"] body.phone .h2-count { font-family: var(--sd-face); font-weight: 600; color: var(--sd-mist); }
html[data-theme="studio"] body.phone .lede { color: var(--sd-mist); }
html[data-theme="studio"] body.phone .note { color: var(--sd-dim); }
html[data-theme="studio"] body.phone :is(.list, .lift, .ctl-grid) { filter: none; }
html[data-theme="studio"] body.phone :is(.btn, [data-part="button"]).big { min-height: 60px; font-size: var(--ph-md); text-transform: none; letter-spacing: -0.01em; border-radius: 18px; }
html[data-theme="studio"] body.phone .link { font-weight: 600; text-decoration-color: rgba(169, 188, 211, 0.5); }
html[data-theme="studio"] body.phone .setting-line { color: var(--sd-mist); }
html[data-theme="studio"] body.phone .rules-toggle {
  font-family: var(--sd-face); font-weight: 600; text-transform: none; letter-spacing: 0;
  color: var(--sd-mist); border-top-color: var(--sd-line);
}
html[data-theme="studio"] body.phone .rules-toggle .ico { color: var(--sd-gold); }
html[data-theme="studio"] body.phone .offline {
  clip-path: none; border-radius: var(--sd-round);
  background: var(--sd-gold); color: var(--sd-on-gold);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
html[data-theme="studio"] body.phone.stale [data-secret]::after {
  border-radius: 14px; text-transform: none; letter-spacing: 0;
  background: rgba(var(--sd-void-rgb), 0.92);
  box-shadow: inset 0 0 0 1px var(--sd-line);
}

/* The start dock and sticky bottom docks inside games: calm fade into deep navy and a flat panel when waiting. */
html[data-theme="studio"] body.phone .dock,
html[data-theme="studio"] [data-part="start-dock"] {
  background: linear-gradient(180deg, rgba(var(--sd-void-rgb), 0), rgba(var(--sd-void-rgb), 0.94) 38%, var(--sd-void));
}
html[data-theme="studio"] body.phone .dock:has(> p),
html[data-theme="studio"] [data-part="start-dock"]:has(> p) {
  background: linear-gradient(180deg, rgba(var(--sd-void-rgb), 0), var(--sd-void) 22px);
}
html[data-theme="studio"] [data-part="start-dock"] [data-part="button"]:disabled {
  --face: linear-gradient(var(--sd-panel), var(--sd-panel));
  --fg: var(--sd-mist);
  opacity: 1; filter: none;
  box-shadow: inset 0 0 0 1px var(--sd-line);
}

/* Phone Finale: a gold circle crest, clean Sora winner name, and soft rounded stat cards. */
html[data-theme="studio"] body.phone [data-part="finale"] .champ::before {
  background: radial-gradient(closest-side, rgba(var(--sd-gold-rgb), 0.18), transparent);
}
html[data-theme="studio"] body.phone [data-part="finale"] .crest {
  clip-path: none; border-radius: 50%;
  background: var(--sd-gold); color: var(--sd-on-gold);
  box-shadow: 0 0 0 10px rgba(var(--sd-gold-rgb), 0.14);
}
html[data-theme="studio"] body.phone [data-part="finale"] .champ-name {
  font-family: var(--sd-face); font-weight: 800; text-transform: none; letter-spacing: -0.035em; text-shadow: none;
}
html[data-theme="studio"] body.phone [data-part="finale"] .stat {
  clip-path: none; border-radius: 18px;
  background: var(--sd-panel); box-shadow: inset 0 0 0 1px var(--sd-line);
}
html[data-theme="studio"] body.phone [data-part="finale"] .stat span { color: var(--sd-mist); }

/* Sheets, forms and color chips across the hub, drawer and games. */
html[data-theme="studio"] body.phone .sheet {
  clip-path: none; border-radius: 22px; padding: 18px;
  background: var(--sd-panel); box-shadow: inset 0 0 0 1px var(--sd-line);
}
html[data-theme="studio"] body.phone .form label, html[data-theme="studio"] body.phone .form .label { color: var(--sd-mist); font-weight: 600; }
html[data-theme="studio"] body.phone .swatches { gap: 10px; }
html[data-theme="studio"] body.phone .swatch { clip-path: none; border-radius: 50%; background: rgb(var(--pc)); box-shadow: none; }
html[data-theme="studio"] body.phone .swatch[aria-checked="true"] { box-shadow: 0 0 0 3px var(--sd-panel), 0 0 0 5px #FFFFFF; }
html[data-theme="studio"] body.phone .swatch:disabled {
  background: linear-gradient(to top right, transparent calc(50% - 1.5px), var(--sd-panel) calc(50% - 1.5px), var(--sd-panel) calc(50% + 1.5px), transparent calc(50% + 1.5px)), rgb(var(--pc));
  opacity: 0.35;
}

/* Who's playing: a grid of big avatar buttons, three to a row. A seat someone else holds is dimmed. */
html[data-theme="studio"] .hub-app .list[data-part="players"] { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
html[data-theme="studio"] .hub-app .list[data-part="players"] .row {
  clip-path: none; border-radius: 22px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-height: 0; padding: 16px 6px 14px; text-align: center;
  background: rgba(234, 251, 255, 0.05); box-shadow: inset 0 0 0 1px var(--sd-line);
}
html[data-theme="studio"] .hub-app .list[data-part="players"] .row > .avatar { width: 68px; height: 68px; margin-bottom: 6px; border-radius: 50%; }
html[data-theme="studio"] .hub-app .list[data-part="players"] .row > .avatar .av-initial { font-family: var(--sd-face); fill: var(--sd-void); }
html[data-theme="studio"] .hub-app .list[data-part="players"] .row:disabled { opacity: 0.4; }
html[data-theme="studio"] .hub-app .list[data-part="players"] .row-main { align-items: center; width: 100%; }
html[data-theme="studio"] .hub-app .list[data-part="players"] .row-name { max-width: 100%; font-size: var(--ph-base); text-align: center; }
html[data-theme="studio"] .hub-app .list[data-part="players"] .row-tag { font-size: var(--ph-xs); }
html[data-theme="studio"] .hub-app .list[data-part="players"] .row:focus-visible { outline-offset: 3px; }

/* Rows everywhere on the phone (hub, drawer and every game's lists): rounded, no bevel, circular color dot, plain Sora names. */
html[data-theme="studio"] body.phone .row {
  clip-path: none; border-radius: 18px;
  background: radial-gradient(80% 150% at 0% 50%, rgba(var(--pc), 0.18), transparent 72%), var(--sd-panel);
  box-shadow: inset 0 0 0 1px var(--sd-line);
}
html[data-theme="studio"] body.phone .row.you {
  box-shadow: inset 0 0 0 1.5px rgba(var(--pc), 0.62);
}
html[data-theme="studio"] body.phone .row .sw { width: 14px; height: 14px; border-radius: 50%; box-shadow: none; }
html[data-theme="studio"] body.phone .row-name { font-family: var(--sd-face); font-weight: 700; text-transform: none; letter-spacing: -0.01em; }
html[data-theme="studio"] body.phone .row-tag { font-weight: 600; }
html[data-theme="studio"] body.phone .row-tag.on { color: var(--sd-mist); }
html[data-theme="studio"] body.phone .lobby-howto .ico { color: var(--sd-gold); }
html[data-theme="studio"] body.phone .rm-btn { border-radius: var(--sd-round); }
html[data-theme="studio"] .hub-app .list[data-part="players"] .row .sw { display: none; }

/* Tiles on the phone (The Floor's lobby card, plus the hub's own avatar card below). */
html[data-theme="studio"] body.phone .tile {
  clip-path: none; border-radius: 24px; padding: 20px 18px;
  background: radial-gradient(120% 150% at 0% 0%, rgba(var(--pc), 0.28), transparent 62%), var(--sd-panel);
  box-shadow: inset 0 0 0 1px var(--sd-line);
}
html[data-theme="studio"] body.phone .tile::after { display: none; }
html[data-theme="studio"] body.phone .tile-name {
  font-family: var(--sd-face); font-weight: 800; line-height: 1.04;
  letter-spacing: -0.035em; text-transform: none; text-shadow: none;
}
html[data-theme="studio"] body.phone .tile-cat { font-weight: 600; }

/* Your own card in the hub: your initials in a big bubble of your color, your name beside it. */
html[data-theme="studio"] .hub-app .tile {
  border-radius: 26px;
  display: grid; grid-template-columns: 72px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 16px; row-gap: 2px;
  padding: 18px 18px 18px 16px;
}
html[data-theme="studio"] .hub-app .tile::before {
  content: attr(data-initials); grid-row: 1 / span 2;
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--sd-face); font-weight: 700; font-size: 26px; letter-spacing: -0.02em; color: var(--sd-void);
  background: rgb(var(--pc));
}
html[data-theme="studio"] .hub-app .tile-name { align-self: end; font-size: clamp(26px, 8vw, 38px); }
html[data-theme="studio"] .hub-app .tile-sub { align-self: start; font-weight: 600; }
html[data-theme="studio"] .hub-app .tile-edit { clip-path: none; border-radius: 50%; top: 12px; right: 12px; background: rgba(var(--sd-void-rgb), 0.45); }
/* The host's card as one line: a smaller bubble, the name, the crown and the edit button. */
html[data-theme="studio"] .hub-app .tile.strip {
  display: flex; flex-direction: row; align-items: center; gap: 12px;
  min-height: 0; padding: 8px 8px 8px 8px; border-radius: var(--sd-round);
}
html[data-theme="studio"] .hub-app .tile.strip::before { width: 44px; height: 44px; flex: none; font-size: 16px; }
html[data-theme="studio"] .hub-app .tile.strip .sw { display: none; }
html[data-theme="studio"] .hub-app .tile.strip .tile-name { align-self: center; font-size: var(--ph-lg); font-weight: 700; letter-spacing: -0.02em; text-shadow: none; }
html[data-theme="studio"] .hub-app .tile.strip .tile-sub { align-self: center; padding: 4px 10px; border-radius: var(--sd-round); font-size: var(--ph-sm); text-transform: none; letter-spacing: 0; color: var(--sd-gold); background: rgba(var(--sd-gold-rgb), 0.12); }
html[data-theme="studio"] .hub-app .tile.strip .tile-edit { background: rgba(234, 251, 255, 0.08); }

/* The host's shelf: art tiles in two rows that swipe sideways, like a streaming app's rows, with the next column
   peeking in from the right. Ready games come first. Eleven games stay one swipe wide instead of six rows tall, so
   Everyone else sits right under them, on the first screen. The whole tile plays; the rules button sits on the art. */
html[data-theme="studio"] .hub-app .list[data-part="shelf"] {
  display: grid; grid-template-rows: repeat(2, auto); grid-auto-flow: column; grid-auto-columns: 43%;
  gap: 16px 12px;
  margin: 0 calc(-1 * var(--sp-4, 16px)); padding: 2px var(--sp-4, 16px) 6px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding: 0 var(--sp-4, 16px);
  scrollbar-width: none;
}
html[data-theme="studio"] .hub-app .list[data-part="shelf"]::-webkit-scrollbar { display: none; }
html[data-theme="studio"] .hub-app .list[data-part="shelf"] .game-plate { scroll-snap-align: start; }
html[data-theme="studio"] .hub-app .game-plate {
  clip-path: none; border-radius: 16px;
  display: flex; flex-direction: column; align-items: stretch; gap: 9px;
  min-height: 0; padding: 0 0 2px;
  background: none; box-shadow: none;
}
html[data-theme="studio"] .hub-app .game-thumb { clip-path: none; width: 100%; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--sd-line); background: var(--sd-navy); }
html[data-theme="studio"] .hub-app .game-thumb img { border-radius: inherit; }
html[data-theme="studio"] .hub-app .plate-go { gap: 3px; padding: 0 4px; }
html[data-theme="studio"] .hub-app .game-title { font-family: var(--sd-face); font-weight: 700; font-size: var(--ph-base); line-height: 1.2; letter-spacing: -0.015em; text-transform: none; }
html[data-theme="studio"] .hub-app .game-fit { font-size: var(--ph-xs); }
html[data-theme="studio"] .hub-app .game-fit.warn { color: var(--sd-mist); }
/* The action under each tile says what a tap does: a gold Play once the game has its phones, a quiet Open lobby
   while it still waits for some (the line above says how many), nothing on a game the room cannot start. */
html[data-theme="studio"] .hub-app .play-chip {
  align-self: flex-start; width: auto; height: 34px; margin: 2px 4px 0; padding: 0 14px 0 11px;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--sd-round); font-family: var(--sd-face); font-size: var(--ph-sm); font-weight: 700;
  color: var(--sd-on-gold); background: var(--sd-gold); box-shadow: none;
}
html[data-theme="studio"] .hub-app .play-chip::after { content: 'Play'; }
html[data-theme="studio"] .hub-app .game-plate[data-ready="false"] .play-chip {
  color: var(--sd-ink); background: rgba(234, 251, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(234, 251, 255, 0.24);
}
html[data-theme="studio"] .hub-app .game-plate[data-ready="false"] .play-chip .ico { display: none; }
html[data-theme="studio"] .hub-app .game-plate[data-ready="false"] .play-chip::after { content: 'Open lobby'; }
html[data-theme="studio"] .hub-app .game-plate.off .play-chip { display: none; }
html[data-theme="studio"] .hub-app .game-plate:not(.off):has(.plate-go:active) .play-chip { filter: brightness(0.88); }
html[data-theme="studio"] .hub-app .plate-rules {
  position: absolute; top: 4px; right: 4px;
  width: 44px; height: 44px; border-radius: 50%;
  color: #FFFFFF; background: rgba(var(--sd-void-rgb), 0.72);
}
html[data-theme="studio"] .hub-app .plate-rules .ico { font-size: 20px; }
html[data-theme="studio"] .hub-app .plate-rules:focus-visible { outline-offset: 2px; }
html[data-theme="studio"] .hub-app .game-plate.off .game-thumb img { opacity: 0.42; }
html[data-theme="studio"] .hub-app .game-plate:has(.plate-go:focus-visible) { outline-offset: 4px; }

/* The host picking: a hero card washed in the host's color, the crown in a gold bubble. */
html[data-theme="studio"] .hub-app .wait {
  clip-path: none; border-radius: 28px;
  gap: 10px; padding: 24px 22px 24px;
  background:
    radial-gradient(130% 120% at 100% 0%, rgba(var(--pc), 0.42), rgba(var(--pc), 0.08) 56%, transparent 78%),
    linear-gradient(180deg, var(--sd-panel-2), var(--sd-panel));
  box-shadow: inset 0 0 0 1px rgba(var(--pc), 0.3);
}
html[data-theme="studio"] .hub-app .wait > .ico { width: 56px; height: 56px; padding: 14px; margin-bottom: 8px; border-radius: 50%; color: var(--sd-gold); background: rgba(var(--sd-gold-rgb), 0.14); }
html[data-theme="studio"] .hub-app .wait-line { font-family: var(--sd-face); font-weight: 800; font-size: clamp(26px, 7.6vw, 34px); line-height: 1.08; letter-spacing: -0.03em; text-transform: none; }
html[data-theme="studio"] .hub-app .wait .note { color: var(--sd-mist); font-size: var(--ph-base); }

/* Everyone else: bubbles four to a row (each their doodle, or their initial), the name and whether they are here under each. Away is a ring. The host's
   remove sits on a bubble's corner and asks once. */
html[data-theme="studio"] .hub-app .list[data-part="roster"] { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 6px; }
html[data-theme="studio"] .hub-app .list[data-part="roster"] .row {
  position: relative; clip-path: none;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-height: 0; padding: 0; text-align: center;
  background: none; box-shadow: none;
}
html[data-theme="studio"] .hub-app .list[data-part="roster"] .row > .avatar { width: 56px; height: 56px; margin-bottom: 5px; border-radius: 50%; }
html[data-theme="studio"] .hub-app .list[data-part="roster"] .row > .avatar .av-initial { font-family: var(--sd-face); fill: var(--sd-void); }
html[data-theme="studio"] .hub-app .list[data-part="roster"] .row:not(:has(.row-tag.on, .row-tag.host)) > .avatar { box-shadow: inset 0 0 0 3px rgb(var(--pc)); }
html[data-theme="studio"] .hub-app .list[data-part="roster"] .row:not(:has(.row-tag.on, .row-tag.host)) > .avatar .av-tile { fill: transparent; }
html[data-theme="studio"] .hub-app .list[data-part="roster"] .row:not(:has(.row-tag.on, .row-tag.host)) > .avatar .av-ink { stroke: rgb(var(--pc)); }
html[data-theme="studio"] .hub-app .list[data-part="roster"] .row:not(:has(.row-tag.on, .row-tag.host)) > .avatar .av-initial { fill: rgb(var(--pc)); }
html[data-theme="studio"] .hub-app .list[data-part="roster"] .row .sw { display: none; }
html[data-theme="studio"] .hub-app .list[data-part="roster"] .row-main { align-items: center; width: 100%; }
html[data-theme="studio"] .hub-app .list[data-part="roster"] .row-name { max-width: 100%; font-size: var(--ph-sm); font-weight: 600; }
html[data-theme="studio"] .hub-app .list[data-part="roster"] .row-line { flex-direction: column; }
html[data-theme="studio"] .hub-app .list[data-part="roster"] .row-tag { font-size: var(--ph-xs); gap: 4px; }
html[data-theme="studio"] .hub-app .list[data-part="roster"] .rm-btn {
  position: absolute; top: -6px; right: calc(50% - 42px);
  min-width: 0; width: 34px; height: 34px; padding: 0; border-radius: var(--sd-round);
  font-size: 14px; color: var(--sd-ink); background: var(--sd-panel-2);
  box-shadow: 0 0 0 3px var(--sd-void);
}
html[data-theme="studio"] .hub-app .list[data-part="roster"] .rm-btn.armed {
  right: auto; left: 50%; top: 14px; transform: translateX(-50%);
  width: auto; padding: 0 12px; font-size: var(--ph-xs); text-transform: none; color: #FFFFFF; background: var(--red);
}

/* ---------- phone: the host drawer ---------- */

html[data-theme="studio"] .drawer-scrim { background: rgba(var(--sd-void-rgb), 0.78); }
html[data-theme="studio"] .drawer-sheet {
  clip-path: none; border-radius: 28px 28px 0 0;
  background: linear-gradient(180deg, var(--sd-panel-2), var(--sd-navy) 38%);
  box-shadow: inset 0 1px 0 rgba(234, 251, 255, 0.1);
}
html[data-theme="studio"] .drawer-head h2 { font-family: var(--sd-face); font-weight: 800; letter-spacing: -0.02em; text-transform: none; }
html[data-theme="studio"] .drawer h3 { font-family: var(--sd-face); font-size: var(--ph-sm); font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--sd-mist); }
html[data-theme="studio"] .drawer .now-name { font-family: var(--sd-face); font-weight: 800; letter-spacing: -0.03em; text-transform: none; }
html[data-theme="studio"] .drawer .now-status { font-weight: 600; color: var(--sd-mist); }
html[data-theme="studio"] .drawer .now-status.warn { color: var(--sd-gold); }
html[data-theme="studio"] .drawer .icon-btn { border-radius: 50%; }
html[data-theme="studio"] .drawer .ctl {
  --tone: 169, 188, 211;
  clip-path: none; border-radius: 20px;
  background: linear-gradient(180deg, rgba(var(--tone), 0.1), rgba(var(--tone), 0.02)), var(--sd-panel);
  box-shadow: inset 0 0 0 1px rgba(var(--tone), 0.22);
}
html[data-theme="studio"] .drawer .ctl.hold { --tone: var(--sd-gold-rgb); }
html[data-theme="studio"] .drawer .ctl b { font-family: var(--sd-face); text-transform: none; letter-spacing: -0.01em; }
html[data-theme="studio"] .drawer .ctl.armed { --tone: 255, 255, 255; background: var(--red); box-shadow: none; }
html[data-theme="studio"] .drawer .seg { clip-path: none; border-radius: var(--sd-round); padding: 4px; background: var(--sd-void); box-shadow: inset 0 0 0 1px var(--sd-line); }
html[data-theme="studio"] .drawer .seg button { border-radius: var(--sd-round); font-weight: 600; text-transform: none; letter-spacing: 0; }
html[data-theme="studio"] .drawer .seg button[aria-checked='true'] { color: var(--sd-void); background: var(--sd-ink); }

/* ---------- the ident (theme.js) ---------- */

/* The classic ident's pieces stay put away; the studio's own takes the cover. */
html[data-theme="studio"] .splash.run { background: var(--sd-void); }
html[data-theme="studio"] .splash > :not(.studio-show) { display: none; }
html[data-theme="studio"] .studio-show { position: absolute; inset: 0; overflow: hidden; display: grid; place-items: center; }
html[data-theme="studio"] .studio-veil { position: absolute; inset: 0; background: radial-gradient(ellipse 62% 58% at 50% 50%, var(--sd-wash) 0%, var(--sd-navy) 46%, var(--sd-void) 100%); }
html[data-theme="studio"] .studio-lockup { position: relative; display: flex; align-items: center; gap: 3.4vh; margin: 0 0 4vh; }
/* The mark: the bar's four squares, one gold, drawn in boxes rather than SVG strokes so the draw moves only by
   transform. --u is one unit of the bar mark's 20-unit grid. Each square is a ring (line) with, under it, its four
   sides, each a quarter of the ring (one straight run and the corner after it) behind a window. theme.js slides each
   window in while its side slides back by the same amount, so the side holds still and is uncovered in the order a
   pen goes round. As drawn here, without the ident's motion, every square stands finished. */
html[data-theme="studio"] .studio-mark { --u: 0.55vh; position: relative; flex: none; width: calc(20 * var(--u)); height: calc(20 * var(--u)); }
html[data-theme="studio"] body.phone .studio-mark { --u: 0.45vh; }
html[data-theme="studio"] .studio-sq {
  --c: var(--sd-ink); --s: calc(9.3 * var(--u)); --r: calc(2.15 * var(--u)); --t: calc(1.3 * var(--u)); --w: calc(var(--s) - var(--r));
  position: absolute; left: calc((var(--x) - 0.65) * var(--u)); top: calc((var(--y) - 0.65) * var(--u)); width: var(--s); height: var(--s);
}
html[data-theme="studio"] .studio-sq.g { --c: var(--sd-gold); }
html[data-theme="studio"] .studio-sq span { position: absolute; box-sizing: border-box; }
html[data-theme="studio"] .studio-sq .fill { inset: calc(0.65 * var(--u)); border-radius: calc(1.5 * var(--u)); background: rgba(var(--sd-gold-rgb), 0.45); }
html[data-theme="studio"] .studio-sq .line { inset: 0; border: var(--t) solid var(--c); border-radius: var(--r); }
html[data-theme="studio"] .studio-sq .side { overflow: hidden; }
html[data-theme="studio"] .studio-sq .side > span { inset: 0; border: 0 solid var(--c); }
html[data-theme="studio"] .studio-sq .t { left: var(--r); top: 0; width: var(--w); height: var(--r); }
html[data-theme="studio"] .studio-sq .t > span { border-top-width: var(--t); border-right-width: var(--t); border-top-right-radius: var(--r); }
html[data-theme="studio"] .studio-sq .r { left: var(--w); top: var(--r); width: var(--r); height: var(--w); }
html[data-theme="studio"] .studio-sq .r > span { border-right-width: var(--t); border-bottom-width: var(--t); border-bottom-right-radius: var(--r); }
html[data-theme="studio"] .studio-sq .b { left: 0; top: var(--w); width: var(--w); height: var(--r); }
html[data-theme="studio"] .studio-sq .b > span { border-bottom-width: var(--t); border-left-width: var(--t); border-bottom-left-radius: var(--r); }
html[data-theme="studio"] .studio-sq .l { left: 0; top: 0; width: var(--r); height: var(--w); }
html[data-theme="studio"] .studio-sq .l > span { border-left-width: var(--t); border-top-width: var(--t); border-top-left-radius: var(--r); }
html[data-theme="studio"] .studio-word { margin: 0; white-space: nowrap; font-family: var(--sd-face); font-weight: 700; font-size: 9vh; line-height: 1; letter-spacing: -0.04em; color: #FFFFFF; }
html[data-theme="studio"] body.phone .studio-lockup { flex-direction: column; gap: 2.6vh; }
html[data-theme="studio"] body.phone .studio-word { font-size: min(11vw, 6vh); }
/* The real mark in the bar is put back as the cover starts to lift, so the two cross rather than one popping in. */
html[data-theme="studio"].splashing.studio-lifting .top .mark,
html[data-theme="studio"].splashing.studio-lifting .bar .mark { opacity: 1; animation: none; }

/* ---------- lite mode ---------- */

/* The layout stays; the crossfade, the edge fade on the row, the lift's easing, shadows and gradients go. */
html[data-theme="studio"].lite .studio-backdrop img { transition: none; transform: none; }
/* Lite keeps the art still and cuts to the game: no drift, no grow, the colors swap at once, and the sting stands on
   plain navy. */
html[data-theme="studio"].lite .studio-backdrop img.on { animation: none; }
html[data-theme="studio"].lite .studio-backdrop::before, html[data-theme="studio"].lite body.tv[data-view="hub"] .spotlights { transition: none; }
html[data-theme="studio"].lite body.tv:has(> .sting.on) .studio-backdrop { z-index: -1; animation: none; }
html[data-theme="studio"].lite body.tv[data-view="game"]:has(> .sting.on) .studio-backdrop { display: none; }
html[data-theme="studio"].lite body.tv:has(> .sting.on) :is(.studio-backdrop img.on, .studio-floor), html[data-theme="studio"].lite body.tv:has(> .sting.on) .studio-backdrop::after { animation: none; }
html[data-theme="studio"].lite .sting { background: var(--sd-void); }
html[data-theme="studio"].lite .hub-view .shelf .shelf-row { -webkit-mask-image: none; mask-image: none; }
html[data-theme="studio"].lite .hub-view .shelf .game-card { transition: none; }
html[data-theme="studio"].lite .hub-view .shelf .game-card .game-art { transition: none; }
html[data-theme="studio"].lite .hub-view .shelf .game-card.on .game-art { box-shadow: 0 0 0 0.32vh #FFFFFF; }
html[data-theme="studio"].lite .hub-view .feature-text { animation: none; }
html[data-theme="studio"].lite body.tv .howto-art img { box-shadow: none; }
html[data-theme="studio"].lite body.tv[data-view="game"] .spotlights { background: var(--sd-void); }
html[data-theme="studio"].lite [data-part="sound-hint"] { background: var(--sd-panel); box-shadow: inset 0 0 0 1px var(--sd-line); }
html[data-theme="studio"].lite [data-part="game-roster"] .roster-list li::before { transition: none; }
html[data-theme="studio"].lite [data-part="game-roster"] .roster-x { transition: none; }
html[data-theme="studio"].lite [data-part="paused"] { background: rgba(var(--sd-void-rgb), 0.96); -webkit-backdrop-filter: none; backdrop-filter: none; }
html[data-theme="studio"].lite body.tv [data-part="finale"] { background: var(--sd-void); }

/* ---------- reduced motion ---------- */

/* base.css already runs every animation and transition to its end at once; the art swaps and the cards stay put. */
@media (prefers-reduced-motion: reduce) {
  html[data-theme="studio"] .studio-backdrop img, html[data-theme="studio"] .hub-view .shelf .game-card { transition: none !important; }
  html[data-theme="studio"] .hub-view .feature-text { animation: none !important; }
  html[data-theme="studio"] .studio-backdrop img.on, html[data-theme="studio"] body.tv:has(> .sting.on) .studio-backdrop img.on, html[data-theme="studio"] body.tv:has(> .sting.on) .studio-backdrop::after { animation: none !important; }
  html[data-theme="studio"] [data-part="game-roster"] .roster-list li::before, html[data-theme="studio"] [data-part="game-roster"] .roster-x { transition: none !important; }
}

/* The Night Cup card in the phone's lobby takes the Look's rounded card instead of the shell's cut corner. */
html[data-theme="studio"] .hub-app [data-part="cup"] { clip-path: none; border-radius: 24px; }

/* The Night Cup strip in the bottom bar: its own column between the players and the code, the top three as a short
   list, so the bar keeps its height and the hero above it keeps its room. */
html[data-theme="studio"] body.tv[data-view="hub"] .rail:has(.cup-strip:not([hidden])) { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: 'roster cup join'; }
html[data-theme="studio"] body.tv[data-view="hub"] .rail .cup-strip { grid-area: cup; width: 16vw; padding: 1.2vh 1vw; border-radius: var(--sd-r); background: rgba(var(--sd-void-rgb), 0.55); box-shadow: inset 0 0 0 1px var(--sd-line); }
html[data-theme="studio"] .cup-strip .cup-top { grid-template-columns: minmax(0, 1fr); gap: 0.7vh; }
html[data-theme="studio"] .cup-strip .cup-top li { grid-template-columns: 1.4em minmax(0, 1fr) auto; }
html[data-theme="studio"] .cup-strip .cup-place { grid-row: auto; font-size: var(--tv-xs); }
html[data-theme="studio"] .cup-strip .cup-name { grid-area: 1 / 2; }
html[data-theme="studio"] .cup-strip .cup-top .cup-pts { grid-area: 1 / 3; }
