/* Player One — one stylesheet, tokens first. Dark by default (the collage is video), light when asked. */
:root {
  --bg: #0b0d12; --bg-2: #11141b; --surface: #171a22; --surface-2: #1f2330; --line: #2a2f3d;
  --ink: #eef0f5; --ink-2: #b3b8c6; --ink-3: #7e8494;
  --accent: #7cf29a; --accent-ink: #0b0d12; --accent-soft: #163a25;
  --up: #7cf29a; --down: #ff7b72; --warn: #f4c35b; --error: #ff7b72; --error-soft: #3a1c1a;
  --focus: #9ad4ff; --radius: 12px; --radius-s: 8px;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 12px 32px rgb(0 0 0 / 35%);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --header-h: 56px; color-scheme: dark;
  /* the logos' own colours */
  --tube: #e9fff0; --red: #ff4057; --red-core: #ffe6e9; --sky: #8ccfff; --gold: #ffd23f;
  --logo-game: "Audiowide", "Arial Black", system-ui, sans-serif;
  --logo-space: "Exo 2", "Trebuchet MS", system-ui, sans-serif;
  --logo-pixel: "Silkscreen", ui-monospace, Menlo, monospace;
  --logo-bungee: "Bungee", Impact, "Arial Black", sans-serif;
  --logo-chakra: "Chakra Petch", "Arial Narrow", system-ui, sans-serif;
  --logo-marker: "Permanent Marker", "Comic Sans MS", cursive;
  --logo-mono: "Martian Mono", ui-monospace, Menlo, monospace;
  --logo-russo: "Russo One", "Arial Black", system-ui, sans-serif;
  --gold-deep: #c98a12; --purple: #b98cff; --purple-body: #4b2f8a; --purple-groove: #34205f;
}
@font-face { font-family: "Audiowide"; src: url("fonts/audiowide.fa3af39df234.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Exo 2"; src: url("fonts/exo2.12eddf021312.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Bungee"; src: url("fonts/bungee.57cee48e3265.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Chakra Petch"; src: url("fonts/chakra-petch.56706b63a0f0.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Permanent Marker"; src: url("fonts/permanent-marker.1b66ccb16415.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Martian Mono"; src: url("fonts/martian-mono.64092ca6bf63.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Russo One"; src: url("fonts/russo-one.07eb45e69b3a.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url("fonts/silkscreen-700.658004a4448e.woff2") format("woff2"); font-weight: 700; font-display: swap; }
/* dark only: the site is a wall of video */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); } h2 { font-size: 1.35rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; } .muted { color: var(--ink-2); } .small { font-size: .9rem; } .tiny { font-size: .8rem; }
code { font: .9em var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: 16px; top: -100px; z-index: 50; background: var(--surface); padding: 10px 14px; border-radius: var(--radius-s); }
.skip:focus { top: 10px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 20px 16px 40px; }
@media (min-width: 720px) { .wrap { padding: 28px 24px 56px; } }

/* header: thin, the logo and three links */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--header-h); padding: 0 16px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; min-height: 44px; }
.top { overflow: clip; }                 /* the Moon arrives from outside the logo */

/* the logo: sixteen, one per page load (html[data-logo], set in base.html's head; neon green without
   script); logo.js starts the intro (.go). Sizes come from --s, the mark's edge. */
.brand .logo { --s: 28px; display: none; align-items: center; gap: calc(var(--s) * .36); position: relative; line-height: 1; }
html:not([data-logo]) .brand .v-green, [data-logo="earth"] .brand .v-earth, [data-logo="green"] .brand .v-green,
[data-logo="red"] .brand .v-red, [data-logo="blocks"] .brand .v-blocks, [data-logo="coin"] .brand .v-coin,
[data-logo="konami"] .brand .v-konami, [data-logo="sketch"] .brand .v-sketch,
[data-logo="terminal"] .brand .v-terminal, [data-logo="cartridge"] .brand .v-cartridge { display: inline-flex; }
.brand .logo > svg { width: var(--s); height: var(--s); flex: none; overflow: visible; }
.brand .word { white-space: nowrap; }
@keyframes logo-flicker { 0% { opacity: .08; } 8% { opacity: 1; } 12% { opacity: .1; } 30% { opacity: .1; } 34% { opacity: 1; } 40% { opacity: .35; } 46% { opacity: 1; } 70% { opacity: .85; } 100% { opacity: 1; } }
/* Earth and Moon */
.v-earth .word { font: 600 calc(var(--s) * .66)/1 var(--logo-space); letter-spacing: .01em; color: var(--ink); }
.v-earth .word b { font-weight: 800; color: var(--sky); }
.globe { position: relative; width: var(--s); height: var(--s); flex: none; }
.globe .earth { position: absolute; left: -6%; top: -6%; width: 92%; height: 92%; z-index: 1; display: block; }
.globe .moon { position: absolute; right: -6%; bottom: -6%; width: 36%; height: 36%; display: block; z-index: 2; will-change: transform; }
.globe .moon canvas { display: block; width: 100%; height: 100%; }
/* neon signs, green and red */
.v-green .word, .v-red .word { font: 400 calc(var(--s) * .6)/1 var(--logo-game); letter-spacing: .02em; }
.v-green .word { color: var(--tube); text-shadow: 0 0 2px #fff, 0 0 calc(var(--s) * .18) rgb(124 242 154 / .55), 0 0 calc(var(--s) * .45) rgb(124 242 154 / .35); }
.v-green .word b { font-weight: 400; color: var(--accent); }
.v-green > svg { filter: drop-shadow(0 0 calc(var(--s) * .08) var(--accent)) drop-shadow(0 0 calc(var(--s) * .25) rgb(124 242 154 / .5)); }
.v-red .word { color: var(--red-core); text-shadow: 0 0 2px #fff, 0 0 calc(var(--s) * .18) rgb(255 64 87 / .65), 0 0 calc(var(--s) * .45) rgb(255 64 87 / .4); }
.v-red .word b { font-weight: 400; color: var(--red); }
.v-red > svg { filter: drop-shadow(0 0 calc(var(--s) * .08) var(--red)) drop-shadow(0 0 calc(var(--s) * .25) rgb(255 64 87 / .55)); }
.v-green.go > svg, .v-red.go > svg { animation: logo-flicker 1.1s linear both; }
.v-green.go .word span, .v-red.go .word span { animation: logo-flicker 1.2s linear .5s both; }
.v-green.go .word b, .v-red.go .word b { animation: logo-flicker 1.3s linear .8s both; }
/* falling blocks */
.v-blocks > svg.blocks { width: calc(var(--s) * 1.17); }
.v-blocks svg.name { height: calc(var(--s) * .78); width: auto; aspect-ratio: 98 / 10; color: var(--ink); flex: 0 1 auto; }
.v-blocks .cell { transform-box: view-box; }
.v-blocks.go .cell { animation: logo-drop .42s cubic-bezier(.55, 0, .9, .5) both; animation-delay: calc(var(--i) * 55ms); }
@keyframes logo-drop { from { transform: translateY(calc(var(--h) * -1px)); } 85% { transform: translateY(.6px); } to { transform: none; } }
.v-blocks .line { opacity: 0; fill: var(--ink); }
.v-blocks.go .line { animation: logo-clear .75s steps(1) both; animation-delay: var(--t); }
@keyframes logo-clear { 0% { opacity: 1; fill: var(--ink); } 25% { opacity: 1; fill: #fff; } 50% { opacity: 1; fill: var(--ink); } 75% { opacity: 1; fill: #fff; } 100% { opacity: 0; } }
.v-blocks.go .name { animation: logo-slide .45s cubic-bezier(.2, 1.2, .4, 1) both; animation-delay: var(--w); }
@keyframes logo-slide { from { transform: translateX(-10%); opacity: 0; } to { transform: none; opacity: 1; } }
.v-blocks .score { position: absolute; left: calc(var(--s) * .2); top: 0; font: 700 11px/1 var(--logo-pixel); color: var(--gold); opacity: 0; pointer-events: none; }
.v-blocks.go .score { animation: logo-score .9s ease-out both; animation-delay: var(--t); }
@keyframes logo-score { 0% { opacity: 0; transform: translateY(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
/* insert coin (Bungee): a gold 1 spins down into the slot, the marquee lights */
.brand .v-coin .coinbox { position: relative; width: var(--s); height: var(--s); flex: none; }
.brand .v-coin .coinbox svg { width: 100%; height: 100%; display: block; }
.brand .v-coin .drop { position: absolute; inset: 0; }
.brand .v-coin.go .drop { animation: logo-coin-drop .9s cubic-bezier(.5, 0, .75, 0) both; }
.brand .v-coin.go .drop svg { animation: logo-coin-spin .3s linear 3; }
.brand .v-coin.go .slot { animation: logo-slot-glow .5s ease-out .85s; }
@keyframes logo-coin-drop { from { transform: translateY(-160%); } 80% { transform: translateY(6%); } to { transform: none; } }
@keyframes logo-coin-spin { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.08); } }
@keyframes logo-slot-glow { 0% { filter: drop-shadow(0 0 0 var(--gold)); } 40% { filter: drop-shadow(0 0 calc(var(--s) * .2) var(--gold)); } }
.brand .v-coin .word { font: 400 calc(var(--s) * .56)/1 var(--logo-bungee); color: var(--ink); }
.brand .v-coin .word b { color: var(--gold); font-weight: 400; }
.brand .v-coin.go .bulb { animation: logo-bulb .32s steps(1) both; animation-delay: calc(.95s + var(--i) * 55ms); }
@keyframes logo-bulb { 0% { opacity: .15; } 50% { opacity: 1; text-shadow: 0 0 calc(var(--s) * .25) var(--gold); } 100% { opacity: 1; } }

/* konami pad (Chakra Petch): the pad plays up up down down left right left right B A */
.brand .v-konami svg { width: calc(var(--s) * 1.15); }
.brand .v-konami .k { transition: fill .06s; }
.brand .v-konami .k.hit { fill: #fff; }
.brand .v-konami .word { font: 700 calc(var(--s) * .66)/1 var(--logo-chakra); letter-spacing: .02em; text-transform: uppercase; }
.brand .v-konami .word b { font-weight: 700; color: var(--accent); }
.brand .v-konami .combo { font: 700 calc(var(--s) * .3)/1 var(--logo-chakra); color: var(--accent); letter-spacing: .1em; opacity: 0; position: absolute; left: 0; top: calc(var(--s) * -.05); }
.brand .v-konami.go .word { animation: logo-tighten .5s cubic-bezier(.2, 1.2, .4, 1) 1.25s both; }
.brand .v-konami.go svg { animation: logo-press .3s ease-out 1.15s; }
@keyframes logo-tighten { from { letter-spacing: .5em; opacity: 0; } to { letter-spacing: .02em; opacity: 1; } }
@keyframes logo-press { 50% { transform: scale(.9); } }

/* sketchbook (Permanent Marker): drawn line by line, then coloured in */
.brand .v-sketch .ln { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.brand .v-sketch .fillin { opacity: 1; }
.brand .v-sketch.go .ln { animation: logo-draw .55s ease-in-out both; animation-delay: var(--d); }
.brand .v-sketch.go .fillin { animation: logo-fillin .4s ease-out 1.25s both; }
.brand .v-sketch.go .pdot { animation: logo-pop .35s cubic-bezier(.3, 1.8, .5, 1) 1.15s both; }
.brand .v-sketch .pdot { transform-box: fill-box; transform-origin: center; }
@keyframes logo-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes logo-fillin { from { opacity: 0; } to { opacity: 1; } }
.brand .v-sketch .word { font: 400 calc(var(--s) * .72)/1 var(--logo-marker); letter-spacing: .01em; padding-top: calc(var(--s) * .08); }
.brand .v-sketch .word b { font-weight: 400; color: var(--red); }
.brand .v-sketch.go .word { animation: logo-write 1s steps(12) .3s both; }
@keyframes logo-write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* agent terminal (Martian Mono): the name decodes from noise, then the cursor rests */
.brand .v-terminal svg { width: var(--s); }
.brand .v-terminal .word { font: 500 calc(var(--s) * .56)/1 var(--logo-mono); letter-spacing: -.02em; }
.brand .v-terminal .word b { font-weight: 700; color: var(--accent); }
.brand .v-terminal.decoding .word { text-shadow: calc(var(--s) * -.04) 0 rgb(255 64 87 / .7), calc(var(--s) * .04) 0 rgb(77 214 255 / .7); }
.brand .v-terminal .caret { animation: logo-caret 1s steps(1) 6; }
@keyframes logo-caret { 50% { opacity: 0; } }

/* cartridge (Russo One): it slots in with a click, the screen switches on */
.brand .v-cartridge svg { width: calc(var(--s) * .9); }
.brand .v-cartridge .cart { transform-box: view-box; }
.brand .v-cartridge.go .cart { animation: logo-insert .7s cubic-bezier(.5, 0, .3, 1.4) both; }
@keyframes logo-insert { from { transform: translateY(-120%); } 70% { transform: translateY(4%) scaleY(.96); } to { transform: none; } }
.brand .v-cartridge .word { font: 400 calc(var(--s) * .62)/1 var(--logo-russo); letter-spacing: .01em; }
.brand .v-cartridge .word b { font-weight: 400; color: var(--purple); }
.brand .v-cartridge.go .word { animation: logo-crt .6s ease-out .75s both; }
@keyframes logo-crt { 0% { transform: scale(.4, .02); filter: brightness(4); opacity: 0; } 30% { transform: scale(1, .02); filter: brightness(4); opacity: 1; } 65% { transform: scale(1, 1.08); filter: brightness(1.6); } 100% { transform: none; filter: none; } }
@keyframes logo-pop { from { transform: scale(0); } to { transform: scale(1); } }
@media (max-width: 480px) { .brand .logo { --s: 24px; } .v-blocks svg.name { height: calc(var(--s) * .6); } }
@media (max-width: 360px) { .brand .logo .word, .brand .logo .name { display: none; } }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 0 12px; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; border-radius: var(--radius-s); font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--surface); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); border-radius: var(--radius-s) var(--radius-s) 0 0; }
.nav .btn { margin-left: 6px; color: var(--accent-ink); }
.nav .btn:hover { color: var(--accent-ink); background: var(--accent); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-grid; place-items: center; font-weight: 700; font-size: .9rem; }
@media (max-width: 640px) { .wide { display: none !important; } .nav a { padding: 0 8px; white-space: nowrap; } .nav .home-link { display: none; } .brand { font-size: 1rem; } }
@media (max-width: 639px) { .tile .vote .n { display: none; } .tile .thumb { width: 36px; height: 36px; } .your { padding: 14px; } .your .btn { white-space: normal; text-align: left; } }

/* badges: medals beside a name, and the wall on the account page */
.badges { display: inline-flex; gap: 2px; margin-left: 5px; vertical-align: -3px; }
.badge { display: inline-block; flex: none; }
.badge-wall { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.badge-wall li { display: flex; gap: 12px; align-items: flex-start; }
.badge-wall li > div { min-width: 0; } .badge-wall p { margin: 2px 0 0; }
.badge-wall .not .badge { filter: grayscale(1); opacity: .35; }

/* sign-up: the invite welcome and nickname ideas */
.invited { display: flex; gap: 12px; align-items: center; padding: 10px 12px; margin: 0 0 14px; border: 1px solid #5b47a8; border-radius: var(--radius-s); background: color-mix(in srgb, #8b5cf6 14%, var(--surface)); }
.invited p { margin: 0; }
.name-ideas { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.name-ideas .pick { cursor: pointer; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: 500 .85rem/1 var(--mono); padding: 7px 10px; min-height: 32px; }
.name-ideas .pick:hover { border-color: var(--accent); }
.name-ideas .linkbtn { min-height: 32px; padding: 4px 6px; }

/* sign-up: the invite welcome and nickname ideas */
.invited { display: flex; gap: 12px; align-items: center; padding: 10px 12px; margin: 0 0 14px; border: 1px solid #5b47a8; border-radius: var(--radius-s); background: color-mix(in srgb, #8b5cf6 14%, var(--surface)); }
.invited p { margin: 0; }
.name-ideas { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.name-ideas .pick { cursor: pointer; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: 500 .85rem/1 var(--mono); padding: 7px 10px; min-height: 32px; }
.name-ideas .pick:hover { border-color: var(--accent); }
.name-ideas .linkbtn { min-height: 32px; padding: 4px 6px; }

/* a game in testing: the maker's checklist, the share link, testers' feedback */
.testing-note { border-color: var(--warn); }
.maturity .checks { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.maturity .checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: start; }
.maturity .checks li > div { display: grid; gap: 1px; min-width: 0; }
.maturity .tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: .75rem; font-weight: 800; color: var(--accent-ink); margin-top: 1px; }
.maturity .ok .tick { background: var(--accent); border-color: var(--accent); }
.maturity .share .row { display: flex; gap: 6px; } .maturity .share input { flex: 1; min-width: 0; font-size: .85rem; }
.feedback fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.feedback legend { font-weight: 600; margin-bottom: 6px; width: 100%; }
.stars-pick label { cursor: pointer; } .stars-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars-pick span { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface-2); font-weight: 700; }
.stars-pick input:checked + span { background: var(--warn); color: var(--accent-ink); border-color: var(--warn); }
.stars-pick input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.works-pick label { display: inline-flex; gap: 6px; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-s); cursor: pointer; }
.works-pick label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* staff: invites on the account page */
.invite-form { display: grid; gap: 0 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.invite-form > div:last-child { grid-column: 1 / -1; }
.share-new { padding: 10px 12px; border: 1px solid var(--accent); border-radius: var(--radius-s); background: var(--accent-soft); margin: 0; }
.share-new .row { display: flex; gap: 6px; } .share-new input { flex: 1; min-width: 0; }
.invites { width: 100%; border-collapse: collapse; font-size: .9rem; }
.invites th, .invites td { text-align: left; padding: 6px 4px; border-top: 1px solid var(--line); vertical-align: middle; }
.invites th { color: var(--ink-3); font-weight: 600; font-size: .8rem; border-top: 0; }
.invites .acts { display: flex; gap: 4px; justify-content: flex-end; } .invites .acts form { margin: 0; }
.invites .linkbtn { min-height: 32px; padding: 4px 6px; }

/* reports: the testers' form, the staff list and the proposed change */
.report-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.report-form legend { font-weight: 600; margin-bottom: 6px; width: 100%; }
.kind-pick label { display: inline-flex; gap: 6px; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-s); cursor: pointer; }
.kind-pick label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.report-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.reports { width: 100%; border-collapse: collapse; } .reports th, .reports td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.reports th { color: var(--ink-3); font-size: .8rem; border-top: 0; }
.chip.sev-critical { color: var(--error); border-color: var(--error); } .chip.sev-normal { color: var(--warn); border-color: var(--warn); } .chip.sev-nice { color: var(--ink-2); }
.diff { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--bg); }
.diff pre { margin: 0; padding: 10px 12px; font: .82rem/1.45 var(--mono); }
.diff pre span { display: block; white-space: pre; }
.diff .add { color: #8ff0a4; background: rgb(124 242 154 / .08); } .diff .del { color: #ff9b94; background: rgb(255 123 114 / .08); }
.diff .hunk { color: var(--focus); } .diff .file { color: var(--ink); font-weight: 700; } .diff .ctx { color: var(--ink-2); }
.report-shot { max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius-s); margin-top: 8px; }
pre.log { white-space: pre-wrap; font: .82rem/1.45 var(--mono); color: var(--ink-2); margin: 0; }

/* private repositories: the deploy key and its steps */
.steps-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
#private .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } #private input[readonly] { flex: 1; min-width: 0; font: .82rem var(--mono); }
.key-row { display: inline-flex; gap: 4px; align-items: center; margin-right: 10px; }

/* the person's own model keys */
.key-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.key-list li { display: grid; gap: 6px; } .key-list .row { display: flex; gap: 6px; flex-wrap: wrap; }
.key-list input { flex: 1; min-width: 0; font: .85rem var(--mono); }

/* staff: people and their limits */
.people .give { display: flex; gap: 6px; flex-wrap: wrap; } .people .give input[type=number] { width: 78px; }
.people .give input[name=note] { flex: 1; min-width: 120px; } .people .over { color: var(--error); }

/* the studio's speed switch */
.speed { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; margin: 0; gap: 2px; }
.speed label { cursor: pointer; } .speed input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.speed span { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 999px; font-size: .85rem; color: var(--ink-2); }
.speed input:checked + span { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.speed input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }

/* the publish pop-up: the same ticks as the game page's checklist */
.pub-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pub-checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; }
.pub-checks li > div { display: grid; gap: 1px; min-width: 0; }
.pub-checks .tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: .75rem; font-weight: 800; color: var(--accent-ink); margin-top: 1px; }
.pub-checks .ok .tick { background: var(--accent); border-color: var(--accent); } .pub-checks .ok .tick::before { content: "✓"; }
.pub-checks .todo .tick { border-color: var(--warn); } .pub-checks .todo .tick::before { content: "!"; color: var(--warn); }
.pub-checks .wait .tick { border-style: dashed; }
.dlg-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* buttons, fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-s); font: 600 1rem/1 var(--font); text-decoration: none; cursor: pointer; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink); white-space: nowrap; }
.btn:hover { filter: brightness(1.06); } .btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; filter: none; }
.btn.quiet { background: var(--surface); color: var(--ink); border-color: var(--line); } .btn.quiet:hover { background: var(--surface-2); filter: none; }
.btn.danger { background: transparent; color: var(--error); border-color: var(--error); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: .9rem; } .btn.block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 8px 10px; min-height: 44px; font: inherit; color: var(--ink-2); cursor: pointer; border-radius: var(--radius-s); text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--ink); }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
input:not([type=checkbox]):not([type=radio]), select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--bg-2); color: var(--ink); font: inherit; }
textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: transparent; }
.field { margin-bottom: 16px; } .hint { color: var(--ink-3); font-size: .85rem; margin-top: 5px; }
.err { color: var(--error); font-size: .88rem; margin-top: 5px; } .bad { border-color: var(--error) !important; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; } .check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card.pad { padding: 24px; } .narrow { max-width: 460px; margin: 0 auto; }
.flashes { display: grid; gap: 8px; margin-bottom: 16px; }
.flash { padding: 12px 14px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); }
.flash.success { border-color: var(--accent); } .flash.error { border-color: var(--error); background: var(--error-soft); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.chip.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.chip.warn { color: var(--warn); border-color: var(--warn); } .chip.err { color: var(--error); border-color: var(--error); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .between { justify-content: space-between; }
.stack { display: grid; gap: 12px; }
.studio-page + .foot { display: none; }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--ink-3); font-size: .9rem; border-top: 1px solid var(--line); margin-top: auto; padding-top: 20px; padding-bottom: 20px; }
.foot nav { display: flex; gap: 4px 18px; flex-wrap: wrap; } .foot a { display: inline-flex; align-items: center; min-height: 44px; }
table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; } th { color: var(--ink-2); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 0; max-width: min(520px, calc(100vw - 32px)); width: 100%; box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(0 0 0 / 55%); backdrop-filter: blur(2px); }
dialog .dlg { padding: 22px; } dialog h2 { margin-bottom: 4px; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

/* the collage */
.board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.board-head h1 { margin: 0; } .board-head .muted { margin: 0; }
/* every tile landscape (16:9, as the clips are); the top row (#1–#3) larger, three a row */
.collage { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); grid-auto-flow: dense; }
.tile { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); isolation: isolate; aspect-ratio: 16 / 9; }
@media (min-width: 640px) {
  .collage { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tile { grid-column: span 3; }
}
@media (min-width: 960px) {
  .collage { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
  .tile { grid-column: span 3; }
  .collage > .tile:nth-child(-n+3) { grid-column: span 4; }   /* the first row, whatever is in it */
}
.tile video, .tile img.poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.tile .nomedia { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); background: linear-gradient(135deg, var(--surface), var(--surface-2)); font-size: .9rem; }
.tile .cover { position: absolute; inset: 0; z-index: 1; text-decoration: none; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 12px; background: linear-gradient(to top, rgb(0 0 0 / 78%) 0%, rgb(0 0 0 / 20%) 45%, transparent 70%); }
.tile .cover:focus-visible { outline: 3px solid var(--focus); outline-offset: -4px; }
.tile .title { font-weight: 700; font-size: 1rem; line-height: 1.2; text-shadow: 0 1px 2px rgb(0 0 0 / 60%); } .tile.r1 .title, .tile.r2 .title, .tile.r3 .title { font-size: 1.2rem; }
.tile .by { font-size: .82rem; opacity: .85; }
.tile .rank { position: absolute; top: 10px; left: 10px; z-index: 2; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; display: inline-grid; place-items: center; background: rgb(0 0 0 / 65%); color: #fff; font-weight: 800; font-size: .85rem; backdrop-filter: blur(6px); }
.tile.r1 .rank, .tile.r2 .rank, .tile.r3 .rank { background: var(--accent); color: var(--accent-ink); }
.tile .votes { position: absolute; top: 8px; right: 8px; z-index: 2; }
.tile .score { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; margin-top: 4px; opacity: .95; }
.tile .score b { font-weight: 700; }
.your { border: 2px dashed var(--accent); background: radial-gradient(120% 120% at 20% 10%, var(--accent-soft), var(--surface) 70%); display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 18px; text-decoration: none; }
.your:hover { background: radial-gradient(120% 120% at 20% 10%, var(--accent-soft), var(--surface-2) 70%); }
.your .big { font-size: clamp(1.05rem, 2vw, 1.3rem); font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; } .your .big b { color: var(--accent); }
.your p { margin: 0; color: var(--ink-2); font-size: .88rem; line-height: 1.4; } .your .btn { align-self: flex-start; margin-top: 4px; }
.empty { text-align: center; padding: 48px 20px; }
.board { max-width: none; padding: 12px; }
@media (min-width: 720px) { .board { padding: 14px 16px; } }

/* votes */
.vote { display: inline-flex; align-items: center; gap: 4px; background: rgb(0 0 0 / 55%); border-radius: 999px; padding: 3px; backdrop-filter: blur(6px); }
.vote.plain { background: var(--surface-2); }
.thumb { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: #fff; cursor: pointer; display: inline-grid; place-items: center; font: inherit; }
.vote.plain .thumb { color: var(--ink-2); } .thumb svg { width: 20px; height: 20px; }
.thumb:hover { background: rgb(255 255 255 / 15%); } .vote.plain .thumb:hover { background: var(--line); }
.thumb.on.up { background: var(--up); color: var(--accent-ink); } .thumb.on.down { background: var(--down); color: #fff; }
.thumb:focus-visible { outline: 3px solid var(--focus); }
.vote .n { font-size: .82rem; font-weight: 700; padding: 0 6px; color: #fff; } .vote.plain .n { color: var(--ink); }
.stars { display: flex; gap: 4px; } .stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { width: 44px; height: 44px; margin: 0; display: grid; place-items: center; cursor: pointer; border-radius: var(--radius-s); color: var(--ink-3); font-size: 1.6rem; }
.stars label:hover, .stars input:focus-visible + label { color: var(--warn); background: var(--surface-2); }
.stars input:checked + label, .stars label.lit { color: var(--warn); }
.stars input:focus-visible + label { outline: 3px solid var(--focus); }

/* game page */
.play-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .play-grid { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; } }
.frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.frame .fs { position: absolute; right: 10px; bottom: 10px; }
.meta { display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: center; color: var(--ink-2); font-size: .92rem; }
.comment { padding: 12px 0; border-bottom: 1px solid var(--line); } .comment:last-child { border: 0; }
.comment .who { font-weight: 600; font-size: .9rem; } .comment .when { color: var(--ink-3); font-size: .82rem; }
.offer { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); } .offer:last-child { border: 0; }

/* plans */
.plans { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.plan { display: flex; flex-direction: column; gap: 10px; } .plan.current { border-color: var(--accent); }
.plan .price { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; } .plan .price small { font-size: .9rem; font-weight: 500; color: var(--ink-3); }
.plan ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: .92rem; display: grid; gap: 4px; }
.plan .btn { margin-top: auto; }

/* studio */
.studio-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.draft-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; min-height: 120px; }
.draft-card:hover { border-color: var(--accent); }
.draft-card .t { font-weight: 700; font-size: 1.05rem; }
.studio-page { max-width: none; padding: 12px 12px 0; height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h)); display: flex; flex-direction: column; }
.studio { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); flex: 1; min-height: 0; }
/* Graphics and Music open over the chat and the preview (over the panes on a narrow screen) */
.studio > .strip { grid-row: 1; grid-column: 1; } .studio > .tabs { grid-row: 2; grid-column: 1; }
.studio > .pane { grid-row: 3; grid-column: 1; }
.workspace { grid-row: 3; grid-column: 1 / -1; z-index: 20; min-height: 0; display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.workspace[hidden] { display: none; }
.music-ws .music-grid { padding: 16px; overflow: auto; flex: 1; }
.strip { display: flex; gap: 8px 14px; align-items: center; flex-wrap: wrap; font-size: .88rem; color: var(--ink-2); padding: 0 4px; }
.strip b { color: var(--ink); }
.tabs [role=tab] { position: relative; } .tabs [role=tab][data-dot]::after { content: ""; position: absolute; top: 8px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); } .tabs [role=tab][data-dot="blocked"]::after { background: var(--error); }
.tabs { display: flex; gap: 4px; }
.tabs [role=tab] { flex: 1; min-height: 44px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: var(--radius-s); font: 600 .95rem var(--font); cursor: pointer; }
.tabs [role=tab].on { color: var(--ink); border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
.pane { display: none; min-height: 0; } .pane.on { display: flex; }
.side { flex-direction: column; gap: 10px; overflow: auto; }
.side .head h1 { font-size: 1.1rem; margin: 0; } .side .head { padding: 12px 14px; }
@media (min-width: 1100px) {
  .studio-page { padding: 12px 16px 0; }
  .studio { grid-template-columns: 270px minmax(420px, 1fr) minmax(320px, 34%); grid-template-rows: minmax(0, 1fr); }
  .workspace { grid-row: 1; grid-column: 2 / -1; }
  #pane-tracks { grid-row: 1; grid-column: 1; } #pane-chat { grid-row: 1; grid-column: 2; } #pane-preview { grid-row: 1; grid-column: 3; }
  .tabs, .strip { display: none; } .pane { display: flex; }
}
@media (pointer: coarse) { .rail-head, .ev, .btn.small { min-height: 44px; } }
.log-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.newer { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); z-index: 3; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; min-height: 36px; padding: 0 14px; font: 600 .85rem var(--font); cursor: pointer; box-shadow: var(--shadow); }
.msg.system.blocked { border-color: var(--error); display: grid; gap: 8px; }
.preview .frame .fs { position: absolute; right: 10px; bottom: 10px; z-index: 2; }
.preview .frame:fullscreen .fs, .preview .frame.filled .fs { top: max(10px, env(safe-area-inset-top)); bottom: auto; right: max(10px, env(safe-area-inset-right)); opacity: .85; }
.preview .frame.filled { position: fixed; inset: 0; z-index: 1000; width: 100vw; height: 100dvh; aspect-ratio: auto; border-radius: 0; border: 0; }
.pf-filled, .pf-filled body { overflow: hidden; }
.chip.err[type=button] { cursor: pointer; }
@keyframes spin { to { transform: rotate(360deg); } }
.track { padding: 4px 14px; }
.track .h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
/* the left panes: a tab each; opened, a panel beside the column (in the column on narrow screens) */
.pane-tab { width: 100%; min-height: 44px; background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pane-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.pane-caret { margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(-45deg); transition: transform .15s; flex: none; }
.track.open .pane-caret { transform: rotate(45deg); }
.side > .card { flex: none; }
.track.open { border-color: var(--accent); }
.track-body { display: grid; gap: 8px; padding: 4px 0 12px; }
.track-body[hidden] { display: none; }
.pane-close { display: none; }
@media (min-width: 1100px) {
  .track .pane-caret { transform: rotate(-45deg); }
  .track.open .pane-caret { transform: rotate(-45deg) translate(2px, 2px); }
  .track-body { position: fixed; z-index: 40; width: 400px; overflow: auto; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
  .track-body.broad { width: min(760px, calc(100vw - 320px)); }
  .pane-close { display: block; position: sticky; top: -8px; justify-self: end; margin: -8px -8px -28px 0; min-height: 36px; min-width: 36px; z-index: 1; }
}
@media (prefers-reduced-motion: reduce) { .pane-caret { transition: none; } }
.track .h b { font-size: .95rem; } .track p { margin: 0; font-size: .9rem; color: var(--ink-2); min-height: 1.3em; }
.track img { margin-top: 10px; border-radius: var(--radius-s); border: 1px solid var(--line); aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.track .help { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; font-size: .85rem; }
.track .help a { color: var(--ink-3); display: inline-flex; align-items: center; min-height: 44px; }
.track .help .linkbtn { font-size: .85rem; padding: 0 8px; }
.statline { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; font-size: .85rem; color: var(--ink-2); margin-top: 6px; }
.low-turns { margin: 6px 0 0; font-size: .85rem; color: var(--warn); }
.low-turns[hidden] { display: none; }
.scenes h3 { margin: 0; }
.scenes > p { margin: 6px 0 0; }
.rec-how { display: grid; gap: 8px; margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--bg-2); }
.rec-how[hidden], #rec-auto[hidden], #rec-manual[hidden] { display: none; }
.rec-how .seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; justify-self: start; }
.rec-how .seg label { min-height: 34px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; cursor: pointer; font-size: .9rem; color: var(--ink-2); }
.rec-how .seg input { position: absolute; opacity: 0; pointer-events: none; }
.rec-how .seg label:has(:checked) { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.rec-how .seg label:has(:focus-visible) { outline: 2px solid var(--focus); }
.rec-how textarea { width: 100%; box-sizing: border-box; font: inherit; }
.scene-list:empty { display: none; }
.btn .cost { font: 500 .75rem var(--font); opacity: .75; margin-left: 4px; white-space: nowrap; }
.track [data-turn] { margin-top: 8px; white-space: normal; text-align: left; line-height: 1.25; padding-block: 8px; height: auto; }
.health-list { list-style: none; padding: 0; margin: 4px 0 8px; display: grid; gap: 6px; }
.health-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 6px; align-items: start; font-size: .88rem; }
.health-list li > div { display: grid; gap: 1px; min-width: 0; }
.health-list li .small { overflow-wrap: anywhere; }
.health-list .tick { width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; border: 2px solid var(--warn); }
.health-list .ok .tick { background: var(--accent); border-color: var(--accent); }
.track p[data-summary]:empty { display: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); display: inline-block; flex: none; }
.dot.working { background: var(--warn); animation: pulse 1.2s ease-in-out infinite; } .dot.done { background: var(--accent); } .dot.blocked { background: var(--error); }
@keyframes pulse { 50% { opacity: .35; } }
.chat { flex-direction: column; min-height: 0; overflow: hidden; padding: 0; }
.chat .log { flex: 1; min-height: 0; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.msg p { margin: 0 0 .6em; } .msg p:last-child, .msg ul:last-child { margin-bottom: 0; } .msg ul { margin: 0 0 .6em; padding-left: 20px; }
.msg.user { align-self: flex-end; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-bottom-right-radius: 4px; }
.msg.agent { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.msg.system { align-self: center; color: var(--ink-2); font-size: .9rem; background: transparent; border: 1px dashed var(--line); }
.msg.system.error { border-color: var(--error); color: var(--ink); display: grid; gap: 8px; }
.msg.agent::before { content: "Studio"; display: block; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }
.frame .fs.on { display: none; }
.rail { align-self: stretch; margin: 0 0 0 6px; border-left: 2px solid var(--line); padding-left: 10px; }
.rail[data-status="running"], .rail[data-status="queued"] { border-left-color: var(--warn); }
.rail[data-status="failed"] { border-left-color: var(--error); }
.rail-head { cursor: pointer; display: flex; justify-content: space-between; gap: 10px; align-items: center; width: 100%; min-height: 36px; padding: 0 6px; border: 0; border-radius: var(--radius-s); background: transparent; color: var(--ink-2); font: inherit; font-size: .85rem; text-align: left; }
.rail-head:hover { background: var(--surface-2); color: var(--ink); } .rail .rail-hint { color: var(--ink-3); font-size: .8rem; white-space: nowrap; }
.rail-head:hover .rail-hint { color: var(--accent); }
.rail .steps { display: grid; gap: 2px; padding-bottom: 4px; }
.rail:not([data-all="1"]) .steps .ev:not(:last-child) { display: none; }   /* the latest step only */
.rail:not([data-all="1"]) .steps:has(.ev:nth-child(2)) .ev:last-child { animation: step-in .25s ease-out; }
@keyframes step-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .rail .steps .ev { animation: none !important; } }
.ev { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 36px; padding: 2px 6px; border-radius: var(--radius-s); background: transparent; border: 0; color: var(--ink-2); font: inherit; font-size: .9rem; text-align: left; cursor: pointer; width: 100%; }
.ev:hover { background: var(--surface-2); color: var(--ink); } .ev .t { color: var(--ink-3); font-size: .78rem; font-variant-numeric: tabular-nums; }
.ev .ico { width: 18px; height: 18px; color: var(--ink-3); }
.ev.status .ico, .ev.track .ico { color: var(--accent); } .ev.error .ico { color: var(--error); } .ev.image .ico, .ev.video .ico { color: var(--warn); } .ev.done .ico { color: var(--accent); }
.ev.status { color: var(--ink); font-weight: 500; }
.ev .thumb-img { width: 56px; height: 32px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.ev .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: .9rem; color: var(--ink-2); min-height: 48px; }
.runbar .run-text { color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runbar .light { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); flex: none; }
.runbar[data-connection="live"] .light { background: var(--accent); } .runbar[data-connection="connecting"] .light { background: var(--warn); animation: pulse 1s ease-in-out infinite; } .runbar[data-connection="lost"] .light { background: var(--error); }
.runbar.busy .run-text::before { content: ""; display: inline-block; width: 12px; height: 12px; margin: 0 8px -2px 0; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.runbar.failed .run-text { color: var(--error); }
.composer { border-top: 1px solid var(--line); padding: 10px 12px 12px; display: grid; gap: 8px; background: var(--surface); }
.composer textarea { min-height: 52px; max-height: 200px; }
.composer .bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.composer.dropping { outline: 2px dashed var(--accent); outline-offset: -6px; background: var(--accent-soft); }
.composer .attach { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.composer .attach .ico { width: 1em; height: 1em; flex: none; }   /* text-sized; width/height in the markup too */
.attach-list { display: flex; flex-wrap: wrap; gap: 6px; }
.att { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 36px; padding: 3px 4px 3px 8px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface-2); font-size: .85rem; }
.att img { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; margin-left: -4px; }
.att .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; min-width: 0; }
.att .sz { color: var(--ink-3); font-size: .78rem; font-variant-numeric: tabular-nums; }
.att .x { border: 0; background: transparent; color: var(--ink-2); font-size: 1.1rem; line-height: 1; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; }
.att .x:hover { background: var(--surface); color: var(--ink); }
.preview { flex-direction: column; gap: 10px; overflow: auto; }
.preview .frame { aspect-ratio: 16 / 10; flex: none; }
.preview .frame .idle { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); text-align: center; padding: 20px; font-size: .95rem; }
.preview details.card summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.drawer { max-width: min(760px, calc(100vw - 32px)); }
.drawer img { border-radius: var(--radius-s); border: 1px solid var(--line); margin: 12px 0; }
.drawer pre { background: var(--bg-2); border: 1px solid var(--line); padding: 12px; border-radius: var(--radius-s); overflow: auto; max-height: 50vh; font: .85rem/1.45 var(--mono); white-space: pre-wrap; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 12px 16px; border-radius: var(--radius-s); z-index: 40; max-width: calc(100vw - 32px); display: flex; gap: 12px; align-items: center; }
.toast.error { border-color: var(--error); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.repo { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.repo:last-child { border: 0; } .repo .n { font-weight: 600; } .repo .d { color: var(--ink-3); font-size: .85rem; }
.kbd { font: .8rem var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; color: var(--ink-2); }
.prose { max-width: 70ch; } .prose h2 { margin-top: 1.6em; } .prose li { margin-bottom: .3em; }
@media (prefers-reduced-motion: reduce) { .dot.working, .runbar.busy .run-text::before, .runbar[data-connection="connecting"] .light { animation: none; } html { scroll-behavior: auto; } }

/* one-click play: the game in a full-screen layer with the keyboard */
.tile .info { position: absolute; right: 10px; bottom: 10px; z-index: 2; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgb(0 0 0 / 55%); color: #fff; font: 700 .9rem/1 var(--font); text-decoration: none; backdrop-filter: blur(6px); }
.tile .info:hover { background: rgb(0 0 0 / 80%); }
.tile .cover { cursor: pointer; }
.tile:hover .cover::after, .tile .cover:focus-visible::after { content: "▶ Play"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--accent); color: var(--accent-ink); font-weight: 800; padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow); }
.player { position: fixed; inset: 0; z-index: 100; background: #000; display: grid; }
.player iframe { width: 100%; height: 100%; border: 0; background: #000; }
.player .close { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 2; opacity: .3; transition: opacity .2s; }
.player .close:hover, .player .close:focus-visible { opacity: 1; }
.frame .start { position: absolute; inset: 0; border: 0; padding: 0; background: #000; cursor: pointer; display: grid; place-items: center; color: #fff; }
.frame .start img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.frame .start .go { position: relative; display: inline-flex; align-items: center; gap: 10px; background: var(--accent); color: var(--accent-ink); font: 800 1.2rem/1 var(--font); padding: 16px 28px; border-radius: 999px; box-shadow: var(--shadow); }
.frame .start .go svg { width: 22px; height: 22px; }
.frame .start:hover .go { filter: brightness(1.08); }

/* key scenes */
.scene-list { display: grid; gap: 6px; margin-bottom: 10px; }
.scene { display: grid; grid-template-columns: 24px 96px 1fr auto; gap: 10px; align-items: center; margin: 0; font-weight: 500; min-height: 44px; }
.scene input { width: 20px; height: 20px; accent-color: var(--accent); }
.scene img { width: 96px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.player .rec { position: absolute; top: 8px; left: 12px; z-index: 2; display: flex; gap: 10px; align-items: center; background: rgb(0 0 0 / 60%); color: #fff; padding: 6px 10px; border-radius: 999px; font: 600 .9rem var(--font); }
.player .rec .dot { width: 10px; height: 10px; border-radius: 50%; background: #ff4d4d; animation: pulse 1s ease-in-out infinite; }
.player .rec button { min-height: 32px; }

/* the loader over a game's frame, from the click until the game is on screen */
.loader { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 14px; background: radial-gradient(120% 90% at 50% 40%, #121722, #07090d 70%); color: var(--ink); transition: opacity .3s ease; }
.loader.gone { opacity: 0; pointer-events: none; }
.loader-title { font: 800 clamp(1.4rem, 3vw, 2.2rem)/1.1 var(--font); letter-spacing: -0.02em; }
.loader-track { width: min(420px, 70vw); height: 8px; border-radius: 999px; background: rgb(255 255 255 / 10%); overflow: hidden; }
.loader-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #b6ffc7); transition: width .25s ease; }
.loader-note { color: var(--ink-3); font: .85rem var(--mono); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .loader, .loader-fill { transition: none; } }

/* help: the ? in the header, its drag and its panel */
.help-btn { width: 32px; height: 32px; margin: 0 6px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 800; font-size: 1rem; cursor: grab; touch-action: none; }
.help-btn:hover { border-color: var(--accent); color: var(--accent); }
.help-dragging, .help-dragging * { cursor: grabbing !important; user-select: none; }
.help-ghost { position: fixed; left: 0; top: 0; z-index: 100; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; pointer-events: none; box-shadow: var(--shadow); }
.help-lit { outline: 2px solid var(--accent) !important; outline-offset: 2px; }
.help-panel { position: fixed; inset: auto 16px 16px auto; margin: 0; z-index: 90; max-width: min(420px, calc(100vw - 32px)); }
.help-answer { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; }
.help-panel form input { flex: 1; min-width: 0; }

/* the gameplay track: tuning sliders and the design doc */
.tuning h4 { margin: 10px 0 6px; font-size: .9rem; }
.tune { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr 44px; align-items: center; gap: 8px; margin: 4px 0; font-size: .85rem; }
.tune input { width: 100%; accent-color: var(--accent); }
.tune output { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.design { margin-top: 10px; }
.design-view { white-space: pre-wrap; font-size: .85rem; max-height: 260px; overflow: auto; margin: 8px 0; color: var(--ink-2); }
.design textarea { width: 100%; margin: 8px 0; font: inherit; font-size: .85rem; }

/* graphics studio */
.art-studio { max-width: min(1440px, calc(100vw - 24px)); width: 100%; height: min(920px, calc(100vh - 24px)); }
.art-studio[open] { display: flex; }
.art-studio.workspace { max-width: none; width: auto; height: auto; }
.art-shell { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.art-top { display: flex; align-items: center; gap: 16px; padding: 10px 14px 10px 20px; border-bottom: 1px solid var(--line); flex: none; }
.art-top h2 { margin: 0; font-size: 1.1rem; }
.art-tabs { display: flex; gap: 2px; padding: 3px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; }
.art-tabs button { min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font: 600 .92rem var(--font); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.art-tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.art-tabs .count { font: .78rem var(--mono); color: var(--ink-3); }
.art-status { margin-left: auto; color: var(--ink-2); font-size: .9rem; }
.art-status.err { color: var(--error); font-weight: 600; }
.art-studio h3 { font-size: .95rem; margin: 0; }
.art-studio h3 .muted, .art-studio summary .muted { font-weight: 400; margin-left: 4px; }
.art-studio .hint { margin: 0; }
.art-studio .tool { display: grid; gap: 8px; }
.art-studio .tool + .tool { border-top: 1px solid var(--line); padding-top: 14px; }
.art-studio textarea { width: 100%; font: inherit; box-sizing: border-box; }
.art-studio .note:empty { display: none; }
.art-studio .note { margin: 0; font-size: .9rem; padding: 8px 10px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--bg-2); }
.art-studio .note.ok { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.art-studio .note.err { border-color: var(--error); background: var(--error-soft); color: var(--ink); }
.art-studio .note.err::before { content: "⚠ "; color: var(--error); }
.art-studio .note .linkbtn { min-height: 0; padding: 0 4px; }
.art-studio .chip.err { border-color: var(--error); color: var(--error); }

/* the frame: the result, dimmed with a bar and the seconds while a job runs */
.art-frame { position: relative; aspect-ratio: 16 / 9; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); display: grid; place-items: center; overflow: hidden; }
.art-frame > img { width: 100%; height: 100%; object-fit: contain; }
.art-frame > p { padding: 0 24px; text-align: center; }
.art-frame.checker { background: repeating-conic-gradient(#2a2f3d 0 25%, #1f2330 0 50%) 0 0 / 20px 20px; }
.art-frame img.pixel { image-rendering: pixelated; }
.art-busy { position: absolute; inset: 0; background: rgb(0 0 0 / 55%); display: grid; place-content: center; gap: 10px; color: #fff; font-weight: 600; text-align: center; }
.art-busy .bar { width: 220px; height: 4px; border-radius: 2px; background: rgb(255 255 255 / 20%); overflow: hidden; position: relative; }
.art-busy .bar::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--accent); animation: art-slide 1.2s ease-in-out infinite; }
@keyframes art-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .art-busy .bar::after { animation: none; width: 100%; opacity: .6; } }
.art-strip { display: grid; gap: 4px; }
.art-strip:empty { display: none; }
.art-strip > div { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.art-strip button { padding: 0; border: 2px solid transparent; border-radius: 6px; background: none; cursor: pointer; flex: none; position: relative; }
.art-strip button[aria-pressed="true"], .art-strip button:hover { border-color: var(--accent); }
.art-strip img { width: 96px; height: 54px; object-fit: contain; border-radius: 4px; display: block; background: var(--bg); }
.art-strip button span:not(:empty) { position: absolute; left: 4px; bottom: 3px; font: 600 .7rem var(--font); background: rgb(0 0 0 / 70%); color: #fff; padding: 1px 5px; border-radius: 4px; }

/* game images: the list, the picture, the tools */
.img-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; padding: 16px 18px; flex: 1; min-height: 0; overflow: auto; }
.img-side { display: grid; grid-template-rows: auto 1fr; gap: 10px; min-height: 0; }
.img-side input { width: 100%; box-sizing: border-box; }
.img-list { overflow: auto; min-height: 0; padding-right: 4px; }
.img-list h4 { font: 600 .78rem var(--font); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin: 10px 0 6px; }
.img-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; }
.img-tiles button { position: relative; display: grid; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--bg); color: var(--ink-2); cursor: pointer; font-size: .7rem; text-align: center; min-height: 44px; }
.img-tiles button:hover { border-color: var(--ink-3); }
.img-tiles button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); color: var(--ink); }
.img-tiles img { width: 100%; aspect-ratio: 1; object-fit: contain; background: repeating-conic-gradient(#2a2f3d 0 25%, #1f2330 0 50%) 0 0 / 10px 10px; border-radius: 4px; }
.img-tiles span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-tiles em { position: absolute; top: 6px; right: 6px; font: 600 .62rem var(--font); font-style: normal; background: var(--accent); color: var(--accent-ink); padding: 0 4px; border-radius: 3px; }
.img-view { display: grid; gap: 10px; align-content: start; }
.img-view .art-frame { aspect-ratio: auto; height: min(50vh, 520px); }
.img-view .art-frame > img { transition: filter .08s; }
.img-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.img-bar p { margin: 0; }
.img-tools { display: grid; gap: 14px; align-content: start; overflow: auto; }
.img-tools label { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: .9rem; }
.img-tools label input[type=range] { grid-column: 1 / -1; width: 100%; }
.img-tools label.check { display: flex; gap: 6px; align-items: center; }
.img-tools output { font: .8rem var(--mono); color: var(--ink-2); }
.img-tools h3 label { display: inline; font-size: inherit; }

/* scenes: the list, the plan, the picture */
.art-grid { display: grid; grid-template-columns: 210px minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; padding: 16px 18px; flex: 1; min-height: 0; overflow: auto; }
.art-side { display: grid; gap: 14px; align-content: start; }
.art-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.art-list button { width: 100%; display: flex; gap: 8px; align-items: center; text-align: left; padding: 6px 8px; min-height: 44px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; font: inherit; }
.art-list button img, .art-list button i { width: 48px; height: 27px; object-fit: cover; border-radius: 3px; flex: none; background: var(--surface-2); }
.art-list button span { overflow: hidden; text-overflow: ellipsis; }
.art-list button[aria-current="true"] { border-color: var(--accent); background: var(--surface-2); font-weight: 600; }
.art-side input { min-width: 0; flex: 1; }
.art-plan { display: grid; gap: 10px; align-content: start; }
.plan-head { display: flex; align-items: center; gap: 10px; }
.plan-head h3 { font-size: 1.05rem; margin-right: auto; }
.art-palette { display: grid; gap: 6px; }
.art-palette > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.art-palette > div > span { font: 600 .74rem var(--font); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); width: 76px; }
.art-palette .chip { cursor: pointer; font-size: .85rem; min-height: 34px; padding: 0 12px; background: var(--surface); color: var(--ink); }
.art-palette .chip:hover { border-color: var(--accent); }
.art-palette .chip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.plan-box { position: relative; }
#art-svg { display: block; width: 100%; aspect-ratio: 4 / 3; max-height: 44vh; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); touch-action: none; user-select: none; }
#art-svg:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
#art-svg .grid { stroke: rgb(0 0 0 / 12%); stroke-width: .01; }
#art-svg .wall { stroke: var(--ink); stroke-width: .12; stroke-linecap: square; }
#art-svg .cam { font-size: .28px; fill: var(--ink-2); text-anchor: middle; }
#art-svg .thing { cursor: grab; }
#art-svg .thing:active { cursor: grabbing; }
#art-svg .thing .hit { fill: transparent; }
#art-svg .thing .body { stroke: rgb(0 0 0 / 45%); stroke-width: .02; }
#art-svg .thing.on .body { stroke: var(--accent); stroke-width: .07; }
#art-svg .thing .front { stroke: #fff; stroke-width: .04; opacity: .8; }
#art-svg .label { font-size: .2px; fill: #fff; text-anchor: middle; paint-order: stroke; stroke: rgb(0 0 0 / 55%); stroke-width: .03px; pointer-events: none; }
.plan-empty { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; text-align: center; background: color-mix(in srgb, var(--bg) 88%, transparent); border-radius: var(--radius-s); }
.plan-empty[hidden] { display: none; }
.art-sel { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-s); margin: 0; padding: 8px 12px; font-size: .9rem; }
.art-sel:disabled { opacity: .6; }
.art-sel legend { padding: 0 4px; }
.art-sel label { display: inline-flex; gap: 6px; align-items: center; }
.art-sel output { font: .8rem var(--mono); color: var(--ink-2); min-width: 3.5em; }
.art-room summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; font-weight: 600; font-size: .92rem; }
.art-room { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0 12px; }
.art-room[open] { padding-bottom: 12px; }
.art-room label { display: grid; gap: 2px; font-size: .88rem; }
.art-room label.check { display: inline-flex; gap: 6px; align-items: center; }
.art-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.art-row input[type=number] { width: 72px; }
.art-studio input[type=color] { width: 44px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); cursor: pointer; }
.art-out { display: grid; gap: 10px; align-content: start; }
.art-look { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.art-look label { display: grid; gap: 2px; font-size: .88rem; }
.art-look select { width: 100%; min-height: 38px; }
.art-out details.tool { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0 12px; }
.art-out details.tool + details.tool { border-top: 1px solid var(--line); padding-top: 0; }
.art-out details.tool[open] { padding-bottom: 12px; }
.art-out details summary { cursor: pointer; min-height: 44px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 600; font-size: .95rem; }
.art-out .art-row label { font-size: .88rem; display: inline-flex; gap: 6px; align-items: center; }
.art-out .art-row label:has(:disabled) { opacity: .55; }
.art-out form { display: grid; gap: 8px; }
.art-out form > .btn { justify-self: start; }

@media (max-width: 1280px) {
  .art-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .art-side { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); align-items: start; }
  .art-list { display: flex; flex-wrap: wrap; }
  .art-list button { width: auto; }
  .img-grid { grid-template-columns: 220px minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  .art-studio { height: calc(100vh - 16px); }
  .art-top { flex-wrap: wrap; gap: 8px 12px; }
  .art-status { order: 5; flex-basis: 100%; margin: 0; }
  .art-grid, .img-grid { grid-template-columns: minmax(0, 1fr); }
  .art-side { grid-template-columns: minmax(0, 1fr); }
  .art-out { order: -1; }            /* the picture and its button first, the plan after */
  .art-side { order: -2; }
  .img-side { grid-template-rows: auto auto; }
  .img-list { max-height: 210px; }
  .img-view .art-frame { height: 46vh; }
}
@media (pointer: coarse) { .art-palette .chip, .art-studio .btn.small, .art-tabs button { min-height: 44px; } }
.art-studio [inert] { opacity: .5; }
.art-studio [inert] .art-busy { display: none; }
.frame-empty { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 0 24px; }
.frame-empty[hidden] { display: none; }
.frame-empty p { margin: 0; color: var(--ink-2); }
#img-new-open { width: 100%; }
#img-new-open[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--focus); }
.img-tools .kinds { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.img-tools .kinds label { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 0 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); cursor: pointer; }
.img-tools .kinds label:has(:checked) { border-color: var(--accent); background: var(--surface-2); }
.img-tools .kinds input { grid-row: 1 / 3; }
.img-tools .kinds span { grid-column: 2; font-size: .8rem; color: var(--ink-3); }
.img-tools input[name=name] { width: 100%; box-sizing: border-box; }
.art-strip button span:not(:empty) { max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-view { max-width: 1100px; }
.img-tiles.wide { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.img-tiles.wide img { aspect-ratio: 16 / 9; object-fit: cover; }
/* Adjust: a compact panel that slides in from the right over the picture */
.adjust-drawer { position: absolute; top: 8px; right: 8px; max-height: calc(100% - 16px); width: 250px; z-index: 2; display: grid; align-content: start; gap: 8px; padding: 12px; background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--line); border-radius: var(--radius-s); box-shadow: var(--shadow); transform: translateX(calc(100% + 16px)); visibility: hidden; transition: transform .18s ease, visibility 0s .18s; overflow: auto; }
.adjust-drawer.open { transform: none; visibility: visible; transition: transform .18s ease; }
@media (prefers-reduced-motion: reduce) { .adjust-drawer { transition: none; } }
.art-studio .adjust-drawer[inert] { opacity: 1; }
.adjust-drawer label { display: grid; grid-template-columns: 78px minmax(0, 1fr) 38px; gap: 8px; align-items: center; font-size: .8rem; font-weight: 500; }
.adjust-drawer label.check { display: flex; gap: 6px; }
.adjust-drawer input[type=range] { width: 100%; min-height: 0; height: 22px; padding: 0; margin: 0; }
.adjust-drawer .row { margin-top: 4px; }
.adjust-drawer output { font: .75rem var(--mono); color: var(--ink-2); text-align: right; }
.adjust-drawer .linkbtn { min-height: 32px; padding: 0 8px; text-decoration: none; }
#img-adjust-open[aria-expanded="true"] { border-color: var(--accent); }
/* one chat about the picked image */
.img-chat { display: grid; gap: 8px; }
.img-chat[hidden] { display: none; }
.chat-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 180px; overflow: auto; }
.chat-log:empty { display: none; }
.chat-log li { max-width: 80%; padding: 6px 10px; border-radius: 12px; font-size: .9rem; display: grid; gap: 2px; }
.chat-log li small { font-size: .7rem; color: var(--ink-3); }
.chat-log li.you { justify-self: end; background: var(--accent-soft); }
.chat-log li.them { justify-self: start; background: var(--surface-2); }
.chat-log li.err { justify-self: start; background: var(--error-soft); }
#img-say { display: grid; gap: 6px; }
#img-say textarea { width: 100%; box-sizing: border-box; font: inherit; }
#img-say .hint .linkbtn { min-height: 0; padding: 0; }
#img-new { max-width: 560px; }
/* the Music tab */
.music-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; min-height: 0; }
.music-grid h3 { margin: 0 0 4px; font-size: 1rem; }
.music-own, .music-gen { display: grid; gap: 12px; align-content: start; }
.genre-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.genre { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; min-height: 44px; }
.genre input { position: absolute; opacity: 0; pointer-events: none; }
.genre span { font-weight: 400; }
.genre.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.genre:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.mu-listen { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mu-mood { display: flex; align-items: center; gap: 8px; }
.mu-mood input { width: 160px; }
.mu-use { display: grid; gap: 8px; }
.mu-tracks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mu-tracks li { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.mu-tracks audio { width: 100%; height: 36px; }
.mu-use-for { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.mu-use-for input { width: 160px; }
@media (max-width: 1099px) { .music-grid { grid-template-columns: 1fr; } }
/* end graphics studio */
/* sharing and history (the owner's), and the play-test page */
.owner-tools { gap: 8px; margin-top: 8px; }
.share-list, .history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.share-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.share-list li b { flex: 1; }
.history-dialog { max-width: min(720px, calc(100vw - 32px)); }
.history-list { max-height: 55vh; overflow: auto; }
.history-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.history-list li > div { display: grid; gap: 2px; min-width: 0; }
.history-list li b { overflow-wrap: anywhere; font-weight: 600; }
.history-list li .row { gap: 6px; flex: none; }
.play-test { display: grid; gap: 10px; }
.play-test .frame { aspect-ratio: 16 / 9; }
@media (max-width: 640px) { .history-list li { flex-direction: column; align-items: stretch; } }
.music-ws .art-top h2 { margin-right: auto; }
/* added 2026-10-31: glitch, joystick, paper plane */
[data-logo="glitch"] .brand .v-glitch, [data-logo="joystick"] .brand .v-joystick, [data-logo="plane"] .brand .v-plane { display: inline-flex; }
/* glitch: the screen and the name shudder in split colour, then settle */
.v-glitch .word { position: relative; font: 700 calc(var(--s) * .66)/1 var(--logo-chakra); letter-spacing: .04em; color: var(--ink); text-transform: uppercase; }
.v-glitch .word::before, .v-glitch .word::after { content: attr(data-t); position: absolute; inset: 0; opacity: 0; mix-blend-mode: screen; }
.v-glitch .word::before { color: #ff2e63; } .v-glitch .word::after { color: #08f7fe; }
.v-glitch.go .word::before { animation: logo-split-a 1.2s steps(1) both; }
.v-glitch.go .word::after { animation: logo-split-b 1.2s steps(1) both; }
.v-glitch.go > svg { animation: logo-shudder 1.2s steps(1) both; }
@keyframes logo-split-a { 0%, 70% { opacity: .9; } 0% { transform: translate(-3px, 1px); clip-path: inset(0 0 55% 0); } 15% { transform: translate(2px, -1px); clip-path: inset(40% 0 0 0); } 30% { transform: translate(-2px, 0); clip-path: inset(20% 0 30% 0); } 50% { transform: translate(1px, 1px); clip-path: inset(0 0 70% 0); } 71%, 100% { opacity: 0; transform: none; } }
@keyframes logo-split-b { 0%, 70% { opacity: .9; } 0% { transform: translate(3px, -1px); clip-path: inset(50% 0 0 0); } 20% { transform: translate(-2px, 1px); clip-path: inset(0 0 45% 0); } 40% { transform: translate(2px, 0); clip-path: inset(30% 0 20% 0); } 60% { transform: translate(-1px, -1px); clip-path: inset(60% 0 0 0); } 71%, 100% { opacity: 0; transform: none; } }
@keyframes logo-shudder { 0% { transform: translateX(-2px) skewX(8deg); filter: hue-rotate(90deg); } 12% { transform: translateX(2px); filter: none; } 25% { transform: translateX(-1px) skewX(-6deg); } 40% { transform: none; opacity: .4; } 45% { opacity: 1; } 60% { transform: translateX(1px); } 72%, 100% { transform: none; } }
/* joystick: a waggle, the buttons light, the name drops in */
.v-joystick > svg { width: calc(var(--s) * 1.06); }
.v-joystick .word { font: 400 calc(var(--s) * .62)/1 var(--logo-russo); color: var(--ink); letter-spacing: .02em; }
.v-joystick .word b { font-weight: 400; color: #ff9f43; }
.v-joystick .stick { transform-box: view-box; transform-origin: 12.5px 22px; }
.v-joystick.go .stick { animation: logo-waggle .9s ease-in-out both; }
.v-joystick .b1, .v-joystick .b2 { transform-box: fill-box; transform-origin: center; }
.v-joystick.go .b1 { animation: logo-press .25s ease-out .85s both; }
.v-joystick.go .b2 { animation: logo-press .25s ease-out 1.05s both; }
.v-joystick.go .word { animation: logo-drop-in .5s cubic-bezier(.3, 1.6, .5, 1) 1.2s both; }
@keyframes logo-waggle { 0%, 100% { transform: none; } 15% { transform: rotate(-22deg); } 35% { transform: rotate(20deg); } 55% { transform: rotate(-14deg); } 75% { transform: rotate(10deg); } }
@keyframes logo-press { 0%, 100% { transform: none; filter: none; } 40% { transform: scale(.75); filter: brightness(1.8) drop-shadow(0 0 3px #fff); } }
@keyframes logo-drop-in { from { opacity: 0; transform: translateY(-60%); } to { opacity: 1; transform: none; } }
/* paper plane: it loops in on a dotted trail that fades, and parks as the mark */
.v-plane .sky { position: relative; width: var(--s); height: var(--s); flex: none; }
.v-plane .plane { position: absolute; inset: 0; width: 100%; height: 100%; }
.v-plane .trail { position: absolute; left: -40%; top: 0; width: 125%; height: 100%; overflow: visible; opacity: 0; }
.v-plane.go .plane { offset-path: path("M-40 34C-14 32 2 30 10 20 16 12 8 2 2 8-3 14 6 24 14 16"); offset-rotate: auto 20deg; animation: logo-fly 1.4s cubic-bezier(.4, 0, .25, 1) both; }
.v-plane.go .trail { animation: logo-trail 2s ease-out both; }
.v-plane .word { font: italic 700 calc(var(--s) * .66)/1 var(--logo-space); color: var(--ink); letter-spacing: .01em; }
.v-plane .word b { color: var(--sky); font-weight: 800; }
.v-plane.go .word { animation: logo-chrome .7s ease-out 1.1s both; }
@keyframes logo-fly { from { offset-distance: 0%; } 99% { offset-distance: 100%; } to { offset-path: none; offset-distance: 100%; } }
@keyframes logo-trail { 0% { opacity: 0; } 20% { opacity: .9; } 70% { opacity: .6; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .v-glitch.go *, .v-glitch.go .word::before, .v-glitch.go .word::after, .v-joystick.go *, .v-plane.go * { animation: none !important; } }
@keyframes logo-chrome { from { opacity: 0; letter-spacing: .4em; } to { opacity: 1; letter-spacing: .01em; } }
/* added 2026-10-31 (round two): rocket, dice, pinball, race flag */
[data-logo="rocket"] .brand .v-rocket, [data-logo="dice"] .brand .v-dice, [data-logo="pinball"] .brand .v-pinball,
[data-logo="flag"] .brand .v-flag { display: inline-flex; }
/* rocket: it rumbles, lifts off on its flame from a puff of smoke, and settles in the header */
.v-rocket .pad { position: relative; width: var(--s); height: var(--s); flex: none; }
.v-rocket .ship { width: 100%; height: 100%; overflow: visible; }
.v-rocket .flame { transform-box: fill-box; transform-origin: top center; animation: logo-flame .12s ease-in-out infinite alternate; }
.v-rocket .smoke circle { opacity: 0; transform-box: fill-box; transform-origin: center; }
.v-rocket.go .body { animation: logo-liftoff 1.4s cubic-bezier(.55, 0, .3, 1) both; }
.v-rocket.go .smoke circle { animation: logo-puff 1.1s ease-out both; }
.v-rocket.go .smoke circle:nth-child(2) { animation-delay: .1s; } .v-rocket.go .smoke circle:nth-child(3) { animation-delay: .2s; }
.v-rocket .word { font: 400 calc(var(--s) * .6)/1 var(--logo-game); color: var(--ink); letter-spacing: .02em; }
.v-rocket .word b { font-weight: 400; color: #ff7a3c; }
.v-rocket.go .word { animation: logo-chrome .7s ease-out 1s both; }
@keyframes logo-flame { from { transform: scaleY(.8); } to { transform: scaleY(1.15); } }
@keyframes logo-liftoff { 0% { transform: translateY(14px); } 20% { transform: translate(-.6px, 14px); } 25% { transform: translate(.6px, 13px); } 30% { transform: translate(0, 12px); } 100% { transform: none; } }
@keyframes logo-puff { 0% { opacity: 0; transform: scale(.4); } 25% { opacity: .9; } 100% { opacity: 0; transform: scale(2.2) translateY(3px); } }
/* dice: a real cube that tumbles in 3D, bounces, and settles with the one on top */
.v-dice .stage { position: relative; width: var(--s); height: var(--s); flex: none; perspective: 160px; }
.v-dice .cube3d { --d: calc(var(--s) * .72); position: absolute; left: 50%; top: 50%; width: var(--d); height: var(--d); margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2); transform-style: preserve-3d; transform: rotateX(-28deg) rotateY(-36deg); }
.v-dice .face { position: absolute; inset: 0; border-radius: 22%; background: linear-gradient(145deg, #ffffff, #dfe4ee); box-shadow: inset 0 0 0 1px #c3cad8; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 14%; backface-visibility: hidden; }
.v-dice .face i { width: 72%; height: 72%; margin: auto; border-radius: 50%; background: #10131c; }
.v-dice .f1 { transform: rotateX(90deg) translateZ(calc(var(--d) / 2)); } .v-dice .f1 i { grid-area: 2 / 2; background: var(--red); width: 95%; height: 95%; }
.v-dice .f6 { transform: rotateX(-90deg) translateZ(calc(var(--d) / 2)); }
.v-dice .f2 { transform: translateZ(calc(var(--d) / 2)); filter: brightness(.93); }
.v-dice .f5 { transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); }
.v-dice .f3 { transform: rotateY(90deg) translateZ(calc(var(--d) / 2)); filter: brightness(.82); }
.v-dice .f4 { transform: rotateY(-90deg) translateZ(calc(var(--d) / 2)); }
.v-dice .f2 i:nth-child(1) { grid-area: 1 / 1; } .v-dice .f2 i:nth-child(2) { grid-area: 3 / 3; }
.v-dice .f3 i:nth-child(1) { grid-area: 1 / 3; } .v-dice .f3 i:nth-child(2) { grid-area: 2 / 2; } .v-dice .f3 i:nth-child(3) { grid-area: 3 / 1; }
.v-dice .f4 i:nth-child(1) { grid-area: 1 / 1; } .v-dice .f4 i:nth-child(2) { grid-area: 1 / 3; } .v-dice .f4 i:nth-child(3) { grid-area: 3 / 1; } .v-dice .f4 i:nth-child(4) { grid-area: 3 / 3; }
.v-dice .f5 i:nth-child(1) { grid-area: 1 / 1; } .v-dice .f5 i:nth-child(2) { grid-area: 1 / 3; } .v-dice .f5 i:nth-child(3) { grid-area: 2 / 2; } .v-dice .f5 i:nth-child(4) { grid-area: 3 / 1; } .v-dice .f5 i:nth-child(5) { grid-area: 3 / 3; }
.v-dice .f6 { grid-template: repeat(3, 1fr) / repeat(2, 1fr); } .v-dice .f6 i { width: 62%; height: 62%; }
.v-dice .shadow { position: absolute; left: 18%; right: 18%; bottom: -6%; height: 16%; border-radius: 50%; background: rgb(0 0 0 / .55); filter: blur(2px); }
.v-dice.go .cube3d { animation: logo-tumble 1.5s cubic-bezier(.25, .6, .3, 1) both; }
.v-dice.go .shadow { animation: logo-shadow 1.5s cubic-bezier(.25, .6, .3, 1) both; }
.v-dice .word { font: 600 calc(var(--s) * .56)/1 var(--logo-mono); color: var(--ink); letter-spacing: .02em; }
.v-dice .word b { color: var(--red); font-weight: 800; }
.v-dice.go .word { animation: logo-chrome .6s ease-out 1.2s both; }
@keyframes logo-tumble {
  0% { transform: translate3d(-40px, -26px, 0) rotateX(400deg) rotateY(-300deg) rotateZ(90deg); }
  35% { transform: translate3d(-14px, 0, 0) rotateX(160deg) rotateY(-120deg) rotateZ(30deg); }
  50% { transform: translate3d(-8px, -9px, 0) rotateX(60deg) rotateY(-80deg) rotateZ(10deg); }
  68% { transform: translate3d(-2px, 0, 0) rotateX(-10deg) rotateY(-46deg) rotateZ(0deg); }
  80% { transform: translate3d(0, -3px, 0) rotateX(-34deg) rotateY(-34deg); }
  100% { transform: rotateX(-28deg) rotateY(-36deg); } }
@keyframes logo-shadow { 0% { opacity: 0; transform: translateX(-40px) scale(.5); } 35% { opacity: 1; transform: translateX(-14px); } 50% { transform: translateX(-8px) scale(.75); opacity: .6; } 68%, 100% { opacity: 1; transform: none; } }
/* pinball: the ball ricochets between bumpers that flash, then the name lights up letter by letter */
.v-pinball .ball { transform-box: view-box; }
.v-pinball .bump { transform-box: fill-box; transform-origin: center; }
.v-pinball.go .ball { animation: logo-ricochet 1.1s linear both; }
.v-pinball.go .b3 { animation: logo-bump .25s ease-out .22s; } .v-pinball.go .b1 { animation: logo-bump .25s ease-out .5s; } .v-pinball.go .b2 { animation: logo-bump .25s ease-out .8s; }
.v-pinball .word { font: 400 calc(var(--s) * .58)/1 var(--logo-bungee); color: #ffe6f4; letter-spacing: .02em; text-shadow: 0 0 6px rgb(255 63 164 / .6); }
.v-pinball .word b { font-weight: 400; color: var(--gold); text-shadow: 0 0 6px rgb(255 210 63 / .6); }
.v-pinball .word i { font-style: normal; }
.v-pinball.go .word i { animation: logo-light .35s steps(2) both; animation-delay: calc(1s + var(--i) * 60ms); }
@keyframes logo-ricochet { 0% { transform: none; } 20% { transform: translate(-11px, -5px); } 45% { transform: translate(-14px, -15px); } 72% { transform: translate(-3px, -13px); } 100% { transform: translate(-1px, -1px); } }
@keyframes logo-bump { 50% { transform: scale(1.35); filter: brightness(1.8) drop-shadow(0 0 3px #fff); } }
@keyframes logo-light { from { opacity: .15; text-shadow: none; } to { opacity: 1; } }
/* racing flag: the starter waves it in a full figure eight (pole and cloth swung from the hand,
   the cloth rippling); the name whooshes in on speed lines */
.v-flag > svg { overflow: visible; }
.v-flag .waver { transform-box: view-box; transform-origin: 6px 30px; }
.v-flag .cloth { transform-box: view-box; transform-origin: 7px 10px; }
.v-flag.go .waver { animation: logo-eight 1.2s linear 2 both; }
.v-flag.go .cloth { animation: logo-wave .2s ease-in-out 12 alternate; }
@keyframes logo-eight {
  /* the tip draws a figure eight: the swing at one beat, the lift at two (a 1:2 Lissajous) */
  0% { transform: translateY(0) rotate(0); } 12.5% { transform: translateY(-3px) rotate(-24deg); }
  25% { transform: translateY(0) rotate(-34deg); } 37.5% { transform: translateY(3px) rotate(-24deg); }
  50% { transform: translateY(0) rotate(0); } 62.5% { transform: translateY(-3px) rotate(24deg); }
  75% { transform: translateY(0) rotate(34deg); } 87.5% { transform: translateY(3px) rotate(24deg); }
  100% { transform: none; } }
.v-flag .word { position: relative; font: italic 800 calc(var(--s) * .64)/1 var(--logo-space); color: var(--ink); letter-spacing: .01em; }
.v-flag .word b { font-weight: 800; color: var(--accent); }
.v-flag .lines { position: absolute; left: -26px; top: 22%; width: 22px; height: 56%; background: repeating-linear-gradient(180deg, var(--ink-3) 0 2px, transparent 2px 6px); opacity: 0; }
.v-flag.go .word { animation: logo-whoosh .55s cubic-bezier(.2, .9, .3, 1) .35s both; }
.v-flag.go .lines { animation: logo-lines .8s ease-out .4s both; }
@keyframes logo-wave { from { transform: skewY(-4deg) scaleX(.94); } to { transform: skewY(5deg) scaleX(1.02); } }
@keyframes logo-whoosh { from { opacity: 0; transform: translateX(60px) skewX(-18deg); } 70% { transform: translateX(-3px) skewX(6deg); } to { opacity: 1; transform: none; } }
@keyframes logo-lines { 0% { opacity: 0; } 30% { opacity: .9; } 100% { opacity: 0; transform: translateX(-10px); } }
@media (prefers-reduced-motion: reduce) { .v-rocket .flame, .v-rocket.go *, .v-dice.go *, .v-pinball.go *, .v-flag.go * { animation: none !important; } }
