/* 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;
}
/* 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; }
.brand .mark { width: 28px; height: 28px; } .brand b { color: var(--accent); font-weight: 800; }
.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; } }

/* 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; }
.collage { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 150px; grid-auto-flow: dense; }
@media (min-width: 640px) { .collage { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 170px; } }
@media (min-width: 960px) { .collage { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 180px; gap: 12px; } }
@media (min-width: 1280px) { .collage { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.tile { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); isolation: isolate; }
.tile.r1 { grid-column: span 2; grid-row: span 2; } .tile.r2, .tile.r3 { grid-row: span 2; }
@media (max-width: 639px) { .tile.r2, .tile.r3 { grid-row: span 1; } }
.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 { font-size: 1.35rem; }
.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 { grid-row: span 2; 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; }
.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: 250px minmax(420px, 1fr) minmax(320px, 34%); grid-template-rows: minmax(0, 1fr); }
  .tabs, .strip { display: none; } .pane { display: flex; }
}
@media (pointer: coarse) { .rail summary, .ev, .btn.small { min-height: 44px; } }
.newer { position: sticky; bottom: 8px; align-self: center; z-index: 2; margin-top: -40px; 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; }
.chip.err[type=button] { cursor: pointer; }
@keyframes spin { to { transform: rotate(360deg); } }
.track { padding: 12px 14px; }
.track .h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.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; }
.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 summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; align-items: center; min-height: 36px; padding: 0 6px; border-radius: var(--radius-s); color: var(--ink-2); font-size: .85rem; }
.rail summary::-webkit-details-marker { display: none; }
.rail summary:hover { background: var(--surface-2); color: var(--ink); } .rail .rail-hint { color: var(--ink-3); font-size: .8rem; }
.rail .steps { display: grid; gap: 2px; padding-bottom: 4px; }
.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; }
.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; }
