/* Yard Collage: the game's own display face (tools/sigilfont). Every letter is cut from one of
   three drawn alphabets (bitmap, OCR, typewriter) under one gothic hand; its calt feature keeps
   neighbours from matching. Capitals and digits only: lowercase sets as capitals. */
@font-face {
  font-family: 'Yard Collage';
  src: url('/fonts/yard-collage.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Mad God × Neuromancer: soot, bone, rust and old blood, lit by sodium lamps and dying neon. */
  --bg: #050404;
  --panel: #0e0b0a;
  --panel-2: #161110;
  --line: #3b2622;
  --text: #d9cdb8;
  --dim: #8a7a68;
  --gold: #e8a33c;
  --red: #d0242e;
  --green: #a6c84b;
  --cyan: #3ef0e0;
  --magenta: #ff2bd6;
  --bone: #e6dcc4;
  --font-title: 'Yard Collage', 'VT323', ui-monospace, monospace;
  --font-ui: 'VT323', ui-monospace, monospace;
  --font-body: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font-body); }
body.game { overflow: hidden; }
a { color: var(--gold); }
[hidden] { display: none !important; }
.dim { color: var(--dim); }
.r { color: var(--red); }
.g { color: var(--green); }
.y { color: var(--gold); }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; padding: 0 4px; border-radius: 3px; background: #1d1712; }

#yard { position: fixed; inset: 0; outline: none; }

#hud { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 12px 16px; pointer-events: none; text-shadow: 0 1px 0 #000, 0 0 6px #000; }
#hud a { pointer-events: auto; }
.hud-left > div { margin-bottom: 2px; }
.hud-left .big { font-size: 26px; color: var(--gold); font-weight: bold; }
#hud-tier { color: var(--cyan); }
#hud-eye { color: var(--red); font-weight: bold; letter-spacing: 2px; animation: pulse 1s infinite alternate; margin-top: 8px; }
.hud-right { text-align: right; }
#minimap { background: rgba(0,0,0,.5); border: 1px solid var(--line); }
.hud-links { color: var(--dim); font-size: 12px; }
@keyframes pulse { from { opacity: .5 } to { opacity: 1 } }

.bubble { position: fixed; transform: translate(-30%, -100%); max-width: 230px; background: #f4f7d8; color: #2b3108; padding: 7px 10px; border-radius: 10px; font-size: 13px; box-shadow: 0 2px 0 #8a9a2a; pointer-events: none; z-index: 5; }
.bubble::after { content: ''; position: absolute; left: 22%; bottom: -7px; border: 7px solid transparent; border-top-color: #f4f7d8; border-bottom: 0; }
.bubble.static { position: relative; transform: none; }
.bubble.static::after { left: -7px; top: 10px; bottom: auto; border: 7px solid transparent; border-right-color: #f4f7d8; border-left: 0; }

#prompt { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.75); border: 1px solid var(--gold); color: var(--gold); padding: 8px 14px; border-radius: 4px; max-width: calc(100vw - 32px); text-align: center; }
#toasts { position: fixed; bottom: 80px; left: 16px; display: flex; flex-direction: column-reverse; gap: 6px; max-width: min(520px, calc(100vw - 32px)); pointer-events: none; }
#toasts div { background: rgba(23,18,14,.92); border-left: 3px solid var(--gold); padding: 6px 10px; transition: opacity .7s; }
#toasts div.fade { opacity: 0; }

#help { position: fixed; bottom: 80px; right: 16px; max-width: 430px; background: rgba(23,18,14,.92); border: 1px solid var(--line); padding: 10px 12px; font-size: 12.5px; line-height: 1.6; }

.overlay { position: fixed; inset: 0; background: rgba(5,4,3,.82); display: flex; align-items: center; justify-content: center; z-index: 10; padding: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 20px 24px; width: min(560px, 100%); max-height: 100%; overflow: auto; }
.panel h2 { margin: 0 0 6px; letter-spacing: 2px; }
.panel h2 small { color: var(--gold); margin-left: 8px; }
button, .btn { background: #2a211a; color: var(--text); border: 1px solid #5b4c3e; padding: 6px 14px; font: inherit; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover:not(:disabled), .btn:hover { border-color: var(--gold); color: var(--gold); }
button:disabled { opacity: .45; cursor: not-allowed; }

#shop-list { list-style: none; padding: 0; margin: 12px 0; }
#shop-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
#shop-list span { color: var(--dim); font-size: 12px; }
#shop-list button { min-width: 72px; }
.stats { padding-left: 18px; }
.stats b { color: var(--gold); }

#cabinet { flex-direction: column; }
.cab-shell { border: 3px solid #3d3227; background: #000; box-shadow: 0 0 0 6px #1b1510, 0 0 60px rgba(120,255,160,.08); }
.cab-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 10px; background: #1b1510; font-size: 12px; flex-wrap: wrap; }
.cab-title { color: var(--green); font-size: 14px; }
.cab-meta { color: var(--dim); }
.cab-timer { color: var(--dim); margin-right: 8px; }
.frame { display: block; margin: 0 auto; background: #000; }
.frame iframe { display: block; border: 0; background: #000; }
#cab-slug { position: fixed; left: 16px; bottom: 16px; display: flex; align-items: flex-start; gap: 6px; max-width: min(380px, calc(100vw - 32px)); opacity: .55; transition: opacity .3s; }
#cab-slug.talking { opacity: 1; }
#cab-slug svg { flex: none; margin-top: 4px; }

/* ---- portal ---- */
body.portal { padding: 24px 16px 60px; }
.portal main { max-width: 860px; margin: 0 auto; }
.portal h1 { letter-spacing: 3px; margin: 0; }
.portal h1 span { color: var(--red); }
.portal section { background: var(--panel); border: 1px solid var(--line); padding: 16px 18px; margin: 16px 0; }
.portal h2 { margin: 0 0 10px; font-size: 16px; letter-spacing: 1px; color: var(--gold); }
.portal label { display: block; margin: 8px 0 2px; color: var(--dim); font-size: 12px; }
.portal input, .portal textarea, .portal select { width: 100%; background: #0f0c0a; color: var(--text); border: 1px solid var(--line); padding: 7px 8px; font: inherit; }
.portal textarea { min-height: 220px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 160px; }
.row > button { flex: 0 0 auto; }
.msg { margin-top: 10px; white-space: pre-wrap; }
.msg.err { color: var(--red); }
.msg.ok { color: var(--green); }
.games { list-style: none; padding: 0; margin: 0; }
.games li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.tag { font-size: 11px; border: 1px solid var(--line); padding: 0 5px; margin-left: 4px; color: var(--dim); }
pre { background: #0f0c0a; border: 1px solid var(--line); padding: 10px; overflow: auto; font-size: 12px; }

/* ---- runs, levels, expansions ---- */
body.game { touch-action: none; -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
#expansion { position: fixed; inset: 0; z-index: 1; background: #000; }
#expansion iframe { width: 100%; height: 100%; border: 0; display: block; }
#hud { z-index: 2; }
#prompt, #toasts, #help, .bubble { z-index: 3; }
#level-card { position: fixed; top: 22%; left: 50%; transform: translateX(-50%); text-align: center; z-index: 4; pointer-events: none; text-shadow: 0 2px 0 #000, 0 0 12px #000; transition: opacity 1s; max-width: calc(100vw - 32px); }
#level-card.fade { opacity: 0; }
#level-card-num { font-size: 34px; letter-spacing: 6px; color: var(--gold); font-weight: bold; }
#level-card-name { font-size: 18px; margin-top: 4px; }
#level-card-tags { color: var(--dim); margin-top: 4px; font-size: 12px; }
.bubble.docked { left: 16px !important; top: auto !important; bottom: 120px; transform: none; }
.bubble.docked::before { content: attr(data-name) ': '; font-weight: bold; }
.bubble.docked::after { display: none; }
.title-panel h1 { margin: 0 0 4px; letter-spacing: 6px; }
.title-panel h3 { margin: 16px 0 4px; color: var(--gold); font-size: 13px; letter-spacing: 2px; }
.small { font-size: 12px; }
#help .touch { display: none; }
@media (pointer: coarse) {
  #help .kb { display: none; }
  #help .touch { display: inline; }
  #help { bottom: 210px; left: 16px; right: 16px; max-width: none; font-size: 12px; }
  #hud { padding: 8px 10px; font-size: 12px; }
  .hud-left .big { font-size: 20px; }
  #minimap { width: 84px; height: 84px; }
  #prompt { bottom: 180px; font-size: 13px; }
  #toasts { bottom: 220px; font-size: 12px; }
  .cab-head { font-size: 11px; padding: 4px 6px; }
  #cab-slug { bottom: auto; top: 8px; left: 8px; }
}

/* ---- on-screen gamepad ---- */
#gamepad { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
#gamepad > * { pointer-events: auto; touch-action: none; }
#gamepad.gp-hidden > *:not(.gp-toggle) { display: none; }
.gp-stick { position: fixed; left: max(18px, env(safe-area-inset-left)); bottom: max(22px, env(safe-area-inset-bottom)); width: 132px; height: 132px; border-radius: 50%; background: rgba(255,255,255,.07); border: 2px solid rgba(255,255,255,.18); }
.gp-knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(255,211,77,.35); border: 2px solid rgba(255,211,77,.6); }
.gp-buttons { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom)); width: 170px; height: 150px; }
.gp-btn { position: absolute; width: 66px; height: 66px; border-radius: 50%; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.25); color: rgba(255,255,255,.8); font: bold 20px ui-monospace, monospace; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gp-btn small { font-size: 9px; font-weight: normal; opacity: .7; }
.gp-btn.on { background: rgba(255,211,77,.4); }
.gp-a { right: 0; bottom: 30px; }
.gp-b { right: 78px; bottom: 0; }
.gp-wheel { right: 82px; bottom: 82px; width: 52px; height: 52px; font-size: 20px; }
.gp-ring { position: fixed; width: 0; height: 0; z-index: 21; pointer-events: none; }
.gp-ring::before { content: ''; position: absolute; left: -128px; top: -128px; width: 256px; height: 256px; border-radius: 50%; background: rgba(10,8,6,.72); border: 2px solid rgba(255,211,77,.4); }
.gp-ring span { position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.1); color: #fff; font: bold 15px ui-monospace, monospace; }
.gp-ring span.on { background: var(--gold); color: #000; transform-origin: center; }
.gp-ring em { position: absolute; left: -60px; width: 120px; top: -8px; text-align: center; font-size: 10px; color: var(--dim); font-style: normal; }
.gp-mode { position: fixed; left: max(18px, env(safe-area-inset-left)); bottom: 162px; font-size: 11px; padding: 3px 8px; background: rgba(0,0,0,.4); border-color: rgba(255,255,255,.2); opacity: .8; }
.gp-toggle { position: fixed; right: 10px; top: 50%; padding: 4px 6px; background: rgba(0,0,0,.4); border-color: rgba(255,255,255,.2); opacity: .6; font-size: 16px; }

/* ---- title screen ---- */
#gamepad.gp-off { display: none; }
.title-screen { align-items: flex-start; overflow-y: auto; background: radial-gradient(ellipse at 50% 0%, rgba(255,60,40,.12), transparent 60%), rgba(5,4,3,.9); }
.title-wrap { width: min(980px, 100%); margin: auto; padding: 24px 0 40px; display: flex; flex-direction: column; gap: 18px; }
.title-head { text-align: center; }
.title-logo { font-size: clamp(34px, 8vw, 72px); letter-spacing: .12em; margin: 0; line-height: 1; text-shadow: 0 4px 0 #000, 0 0 30px rgba(255,74,54,.25); }
.title-head p { margin: 10px 0 0; }
.title-cards { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 22px 24px; }
.card h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: .2em; }
.card-play { border-color: rgba(157,255,106,.45); box-shadow: 0 0 0 1px rgba(157,255,106,.12), 0 10px 40px rgba(157,255,106,.06); display: flex; flex-direction: column; gap: 10px; }
.card-play h2 { color: var(--green); }
.card-score { border-color: rgba(255,211,77,.4); }
.card-score h2 { color: var(--gold); }
.big-btn { font-size: 22px; padding: 16px 20px; letter-spacing: .12em; text-transform: uppercase; background: #1d3a14; border: 2px solid var(--green); color: var(--green); border-radius: 4px; }
.big-btn:hover:not(:disabled) { background: #275019; color: #d9ffc4; border-color: #d9ffc4; }
.big-btn.alt { background: #2a211a; border-color: var(--gold); color: var(--gold); font-size: 18px; padding: 12px 18px; }
.best { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 14px; }
.best b { font-size: 56px; line-height: 1; color: var(--gold); }
.best span { color: var(--dim); }
.board { list-style: none; padding: 0; margin: 0; }
.board li { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.board li span { color: var(--dim); width: 2.2em; }
.board li b { margin-left: auto; color: var(--gold); }
.board li.me { color: var(--green); }
.chute { padding: 0; }
.chute > summary { cursor: pointer; padding: 14px 20px; list-style: none; display: flex; align-items: center; gap: 6px; }
.chute > summary::-webkit-details-marker { display: none; }
.chute > summary::before { content: '▸'; color: var(--gold); transition: transform .15s; }
.chute[open] > summary::before { transform: rotate(90deg); }
.chute > summary b { letter-spacing: .15em; }
.chute-body { padding: 0 20px 16px; border-top: 1px dashed var(--line); }
.chute-links { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
@media (max-width: 720px) {
  .title-cards { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .best b { font-size: 44px; }
}

/* ---- feed the yard: drop boxes ---- */
.offer { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0 6px; }
.offer-col { background: #120e0b; border: 1px solid var(--line); border-radius: 6px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dropbox { border: 2px dashed #5b4c3e; border-radius: 6px; padding: 18px 12px; text-align: center; color: var(--dim); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: border-color .15s, background .15s, color .15s; }
.dropbox b { color: var(--text); font-size: 17px; letter-spacing: .12em; text-transform: uppercase; }
.dropbox svg { color: var(--gold); margin-bottom: 4px; }
.offer-col[data-kind="expansion"] .dropbox svg { color: var(--cyan); }
.dropbox small { color: var(--dim); }
.dropbox-hint { font-size: 11px; opacity: .8; margin-top: 4px; }
.dropbox:hover, .dropbox:focus-visible { border-color: var(--gold); color: var(--gold); outline: none; }
.dropbox.over { border-color: var(--green); background: #16210f; color: var(--green); }
.gh-row { display: flex; gap: 6px; }
.gh-row input { flex: 1; min-width: 0; background: #0f0c0a; color: var(--text); border: 1px solid var(--line); padding: 7px 8px; font: inherit; }
.offer-msg { font-size: 12.5px; min-height: 0; overflow-wrap: anywhere; }
.offer-msg:empty { display: none; }
.offer-msg.ok { color: var(--green); }
.offer-msg.err { color: var(--red); }
.offer-msg ul { margin: 4px 0 0; padding-left: 18px; }
.offer-steps { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.5; }
.offer-steps li { margin-bottom: 6px; }
.offer-steps li::marker { color: var(--gold); font-weight: bold; }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold); text-decoration: underline; font: inherit; cursor: pointer; }
.brief summary { cursor: pointer; color: var(--dim); font-size: 12px; margin-top: 4px; }
.brief pre { max-height: 220px; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.offer-more { margin: 0; }
@media (max-width: 720px) { .offer { grid-template-columns: 1fr; } }

/* start-in picker */
.start-in { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; }
.start-in select { flex: 1; min-width: 0; background: #0f0c0a; color: var(--text); border: 1px solid var(--line); padding: 8px; font: inherit; border-radius: 4px; }

/* The slug's voice box is see-through so it never hides an optimizer. */
#bubble.bubble { background: rgba(14, 18, 6, .38); color: #f1f7c8; border: 1px solid rgba(199, 217, 74, .55); box-shadow: none; text-shadow: 0 1px 2px #000, 0 0 4px #000; backdrop-filter: none; }
#bubble.bubble::after { border-top-color: rgba(199, 217, 74, .55); }


/* =====================================================================
   ROT PASS — everything gets dirtier.
   ===================================================================== */

/* film grain, vignette, scanlines and sodium flicker over the whole screen (grime.js) */
#grime { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; opacity: .05; mix-blend-mode: overlay; image-rendering: pixelated; }
body::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 49;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(0,0,0,.55) 85%, rgba(0,0,0,.85) 100%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.08) 0 1px, transparent 1px 3px);
  animation: sodium 14s ease-in-out infinite; }
body.cab-open::after { opacity: .5; }
body.cab-open #grime { opacity: .03; }
/* a slow breath, not a flicker: nothing in the screen's brightness ever jumps */
@keyframes sodium { 0%, 100% { opacity: 1 } 50% { opacity: .93 } }

/* type */
h1, h2, h3, .card h2, .title-logo, #level-card-num, #death-title { font-family: var(--font-title); font-weight: 400; }
#hud, #prompt, #toasts, button, .btn, .big-btn, kbd, .cab-head, #level-card-tags, .board, .best, .hud-links, .dropbox b { font-family: var(--font-ui); }
#hud { font-size: 18px; line-height: 1.05; }
.hud-left .big { font-size: 34px; color: var(--gold); text-shadow: 0 0 10px rgba(232,163,60,.5), 0 2px 0 #000; }
#hud-tier { color: var(--cyan); text-shadow: 0 0 8px rgba(62,240,224,.45); }
#hud-eye { font-family: var(--font-title); font-size: 26px; letter-spacing: .08em; color: var(--red); text-shadow: 0 0 14px rgba(208,36,46,.9); }
#prompt { font-size: 20px; background: rgba(5,3,3,.85); border-color: var(--gold); box-shadow: 0 0 18px rgba(232,163,60,.2), inset 0 0 12px rgba(0,0,0,.8); }
#toasts { font-size: 18px; }
#toasts div { background: rgba(10,6,6,.9); border-left-color: var(--red); box-shadow: inset 0 0 20px rgba(0,0,0,.7); }

/* rusted, stained panels */
.panel, .card, .cab-head, #help, #toasts div, .offer-col, .portal section {
  background-color: var(--panel);
  background-image:
    radial-gradient(ellipse at 12% 18%, rgba(110,30,20,.18), transparent 40%),
    radial-gradient(ellipse at 88% 90%, rgba(60,40,10,.22), transparent 45%),
    radial-gradient(circle at 70% 25%, rgba(0,0,0,.35), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,.015), rgba(0,0,0,.25));
}
.panel, .card { border: 1px solid var(--line); box-shadow: 0 0 0 1px #000, 0 18px 50px rgba(0,0,0,.7), inset 0 0 40px rgba(0,0,0,.65); border-radius: 3px; }
.card-play { border-color: rgba(166,200,75,.5); box-shadow: 0 0 0 1px #000, 0 0 30px rgba(166,200,75,.08), inset 0 0 40px rgba(0,0,0,.65); }
.card-score { border-color: rgba(232,163,60,.45); }
.card h2 { font-size: 40px; letter-spacing: .06em; text-shadow: 0 3px 0 #000; }
.card-play h2 { color: var(--green); text-shadow: 0 0 16px rgba(166,200,75,.35), 0 3px 0 #000; }
.card-score h2 { color: var(--gold); text-shadow: 0 0 16px rgba(232,163,60,.35), 0 3px 0 #000; }

button, .btn { background: #120c0b; border-color: #4a2b25; color: var(--text); font-size: 19px; padding: 4px 14px; letter-spacing: .04em; }
button:hover:not(:disabled), .btn:hover { color: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 12px rgba(62,240,224,.25); }
.big-btn { font-size: 34px; padding: 10px 20px; background: linear-gradient(#1a2a0c, #0d1606); border: 2px solid var(--green); color: var(--green); text-shadow: 0 0 10px rgba(166,200,75,.6); box-shadow: inset 0 0 22px rgba(0,0,0,.8), 0 0 18px rgba(166,200,75,.15); }
.big-btn:hover:not(:disabled) { color: #eaffb8; border-color: #eaffb8; background: linear-gradient(#24380f, #111d08); }
.big-btn.alt { font-size: 26px; background: linear-gradient(#2a1a0c, #160d06); border-color: var(--gold); color: var(--gold); }
.best b { font-family: var(--font-title); font-size: 72px; color: var(--gold); text-shadow: 0 0 22px rgba(232,163,60,.45), 0 4px 0 #000; }
.board { font-size: 20px; }
.board li { border-bottom-color: rgba(59,38,34,.7); }

/* the title: blackletter, chromatic split, glitches, dripping */
.title-screen { background:
  radial-gradient(ellipse at 50% 8%, rgba(208,36,46,.22), transparent 55%),
  radial-gradient(ellipse at 15% 100%, rgba(62,240,224,.08), transparent 50%),
  radial-gradient(ellipse at 90% 100%, rgba(255,43,214,.08), transparent 50%),
  rgba(3,2,2,.94); }
.title-logo { font-size: clamp(34px, 11.4vw, 120px); letter-spacing: .01em; white-space: nowrap; color: var(--bone); position: relative;
  text-shadow: -2px 0 rgba(62,240,224,.7), 2px 0 rgba(255,43,214,.7), 0 6px 0 #000, 0 0 40px rgba(208,36,46,.45);
  animation: glitch 6s infinite steps(1); }
.title-logo .r { color: var(--red); text-shadow: -2px 0 rgba(62,240,224,.6), 2px 0 rgba(255,43,214,.6), 0 0 30px rgba(208,36,46,.9), 0 6px 0 #000; }
@keyframes glitch {
  0%, 100% { transform: none; filter: none; }
  37% { transform: translate(3px, -1px) skewX(-6deg); filter: hue-rotate(40deg); }
  37.5% { transform: translate(-4px, 1px); }
  38% { transform: none; filter: none; }
  71% { clip-path: inset(30% 0 52% 0); transform: translateX(-8px); }
  71.6% { clip-path: none; transform: none; }
}
.title-head p { font-family: var(--font-ui); font-size: 22px; color: #9b8670; letter-spacing: .06em; }
.title-eye { position: absolute; left: 50%; top: -40px; width: min(720px, 120vw); height: 260px; transform: translateX(-50%); pointer-events: none; opacity: .32; z-index: -1;
  background: radial-gradient(ellipse at 50% 50%, #000 0 7%, #5b0b10 8% 15%, rgba(208,36,46,.5) 16% 22%, rgba(230,220,196,.12) 23% 48%, transparent 50%); filter: blur(1px);
  animation: stare 9s ease-in-out infinite; }
@keyframes stare { 0%, 100% { transform: translateX(-50%) scaleY(1); } 48% { transform: translateX(-50%) scaleY(1); } 50% { transform: translateX(-50%) scaleY(.06); } 52% { transform: translateX(-50%) scaleY(1); } }
.title-head { position: relative; isolation: isolate; }

#level-card-num { font-size: 64px; color: var(--bone); letter-spacing: .04em; text-shadow: -2px 0 rgba(62,240,224,.6), 2px 0 rgba(255,43,214,.6), 0 0 30px rgba(208,36,46,.6), 0 4px 0 #000; }
#level-card-name { font-family: var(--font-ui); font-size: 26px; }
#death-title { font-size: 72px; text-shadow: 0 0 30px rgba(208,36,46,.8), 0 4px 0 #000; letter-spacing: .04em; }

/* the slug still talks, in sickly phosphor */
#bubble.bubble { font-family: var(--font-ui); font-size: 19px; line-height: 1.05; color: #d8ff9a; border-color: rgba(166,200,75,.5); background: rgba(8,14,3,.42); }
.bubble.static { font-family: var(--font-ui); font-size: 19px; line-height: 1.05; background: #0f1606; color: #d8ff9a; box-shadow: 0 0 0 1px rgba(166,200,75,.4); }
.bubble.static::after { border-right-color: #0f1606; }

/* gamepad: corroded brass and phosphor */
.gp-stick { border-color: rgba(232,163,60,.28); background: radial-gradient(circle, rgba(232,163,60,.06), rgba(0,0,0,.25)); }
.gp-knob { background: rgba(208,36,46,.35); border-color: rgba(208,36,46,.75); box-shadow: 0 0 14px rgba(208,36,46,.35); }
.gp-btn { font-family: var(--font-ui); font-size: 26px; border-color: rgba(232,163,60,.35); color: rgba(230,220,196,.85); }
.gp-ring::before { background: rgba(6,3,3,.82); border-color: rgba(208,36,46,.45); }
.gp-ring span { font-family: var(--font-ui); font-size: 20px; }
.gp-ring span.on { background: var(--red); color: #fff; }

/* portal + chute */
.portal h1 { font-family: var(--font-title); font-size: clamp(22px, 4.2vw, 40px); letter-spacing: .01em; }
.portal h2 { font-family: var(--font-title); font-size: 28px; color: var(--gold); }
.dropbox { border-color: #4a2b25; background: radial-gradient(ellipse at 50% 120%, rgba(208,36,46,.12), transparent 60%); }
.dropbox b { font-size: 24px; letter-spacing: .1em; }
.dropbox.over { border-color: var(--cyan); background: rgba(62,240,224,.06); color: var(--cyan); }

/* twin-stick layout (first-person levels): look stick bottom-right, buttons above it */
.gp-look { display: none; left: auto; right: max(18px, env(safe-area-inset-right)); }
.gp-look small { position: absolute; left: 0; right: 0; bottom: -16px; text-align: center; font-size: 10px; color: rgba(230,220,196,.5); font-family: var(--font-ui); }
#gamepad.gp-twin .gp-look { display: block; }
#gamepad.gp-twin .gp-buttons { bottom: calc(max(22px, env(safe-area-inset-bottom)) + 150px); }
#gamepad.gp-hidden .gp-look { display: none; }
body.cab-open #gamepad.gp-twin .gp-look { display: none; }
body.cab-open #gamepad.gp-twin .gp-buttons { bottom: max(22px, env(safe-area-inset-bottom)); }

/* phones: the cabinet sits at the top, clear of the pad; header stays compact */
@media (pointer: coarse) {
  #cabinet { justify-content: flex-start; padding: 6px; }
  .cab-head .cab-meta { font-size: 10px; }
}

/* ---------------------------------------------------------------------------
   SUBTITLES. Nobody gets to stop the game to talk: one line at the bottom edge,
   no box, gone by itself. On phones it sits just above the pad. */
#subs { position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 40; pointer-events: none;
  max-width: min(760px, calc(100vw - 24px)); text-align: center; font-family: var(--font-body, ui-monospace, monospace); font-size: 14px; line-height: 1.3;
  color: #efe9da; text-shadow: 0 1px 0 #000, 0 0 6px #000, 0 0 2px #000; opacity: 0; transition: opacity .35s; text-wrap: balance; }
#subs.in { opacity: .94; }
#subs.out { opacity: 0; }
#subs-name { color: var(--who, #fff); font-family: var(--font-ui); font-weight: normal; font-size: 15px; letter-spacing: .06em; margin-right: .5em; }
#subs-name:not(:empty)::after { content: ' —'; opacity: .6; }
#subs[data-who="god"] #subs-text { color: #ffb4a8; letter-spacing: .04em; }
#subs[data-who="slug"] #subs-text { color: #e4ef9a; }
#subs[data-who="v09"] #subs-text { color: #bfe9e4; }
/* driftwood: handwriting, slightly crooked, unattributed */
#subs[data-who="drift"] { transform: translateX(-50%) rotate(-.6deg); }
#subs[data-who="drift"] #subs-text { font-family: 'Caveat', cursive; font-size: 24px; color: #fff8e6; line-height: 1.1; }
#subs[data-who="drift"] #subs-name { font-size: 12px; opacity: .8; }
#subs em { font-style: italic; }
#prompt { bottom: 46px; }
@media (max-width: 700px), (pointer: coarse) {
  /* phones: a thin band under the HUD, clear of both thumbs */
  #subs { top: 128px; bottom: auto; left: 10px; right: 10px; transform: none; font-size: 11.5px; line-height: 1.25; max-width: none; text-wrap: pretty; }
  #subs[data-who="drift"] { transform: rotate(-.6deg); }
  #subs-name { font-size: 12px; }
  #subs[data-who="god"] #subs-text { letter-spacing: 0; }
  #subs[data-who="drift"] #subs-text { font-size: 19px; }
  /* in a cabinet the top belongs to the game: sit between it and the pad */
  body.cab-open #subs { top: auto; bottom: 192px; }
  #prompt { bottom: 180px; }
  #toasts { bottom: 224px; }
}
@media (pointer: coarse) and (orientation: landscape) {
  #subs { top: auto; bottom: 6px; left: 170px; right: 170px; }
  body.cab-open #subs { bottom: 6px; }
  #prompt { bottom: 40px; }
  #toasts { bottom: 84px; }
}

/* the knife: a small line under the HUD that gets less polite with depth */
#hud-knife { color: #8a7a66; font-size: .85em; min-height: 1em; letter-spacing: .04em; }
body[data-knife="3"] #hud-knife, body[data-knife="4"] #hud-knife { color: #c2545a; }

/* the picture slips (grime.js sets body.corrupt for a few frames when deep) */
body.corrupt #yard, body.corrupt #expansion { transform: translateX(var(--slip, 2px)); filter: saturate(1.25) contrast(1.05); }
body.calm::after { animation: none; background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0,0,0,.5) 100%); }
body.calm #grime { display: none; }
body.calm .title-head h1, body.calm * { animation-duration: 0s !important; }

/* keeper strip: a portrait and one line, inside panels the player opened themselves */
.keeper { display: flex; gap: 12px; align-items: center; margin: 4px 0 12px; padding: 8px; background: rgba(0,0,0,.35); border-left: 3px solid var(--who, var(--gold)); }
.keeper canvas { width: 64px; height: 64px; flex: none; image-rendering: pixelated; border: 1px solid rgba(255,255,255,.12); }
.keeper p { margin: 0; font-size: 14px; line-height: 1.35; }
.keeper p b { display: block; font-family: var(--font-ui); font-weight: normal; color: var(--who, var(--gold)); letter-spacing: .06em; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
button.quiet { background: transparent; border-color: rgba(255,255,255,.2); color: var(--dim); }
#shop-list li button small { opacity: .6; margin-right: 6px; }
.settings { display: grid; gap: 6px; margin: 10px 0; }
.settings label { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }
.settings small { color: var(--dim); }

/* the regulars & the driftwood, on the title */
.regulars { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.regulars li { display: flex; gap: 12px; align-items: flex-start; }
.regulars canvas { width: 56px; height: 56px; flex: none; image-rendering: pixelated; border: 1px solid rgba(255,255,255,.12); }
.regulars b { font-family: var(--font-ui); font-weight: normal; letter-spacing: .06em; font-size: 18px; }
.regulars .pips { letter-spacing: 2px; margin-left: 8px; opacity: .8; }
.regulars p { margin: 2px 0 0; font-size: 13px; color: #cfc6b4; }
.regulars .unmet { opacity: .45; }
.margins { margin: 8px 0 0; padding-left: 1.4em; display: grid; gap: 8px; }
.margins li { font-family: 'Caveat', cursive; font-size: 22px; line-height: 1.15; color: #fff8e6; }
.margins li.missing { font-family: var(--font-body, monospace); font-size: 12px; color: var(--dim); }
.margins li:nth-child(odd) { transform: rotate(-.4deg); }
.margins li:nth-child(even) { transform: rotate(.3deg); }

/* phones: the level card fits on one line, and the guide is a short strip, not a wall */
@media (max-width: 700px) {
  #level-card { top: 20%; width: calc(100vw - 24px); }
  #level-card-num { font-size: clamp(24px, 9.6vw, 44px); white-space: nowrap; }
  #level-card-name { font-size: 20px; }
  #help { bottom: 196px; left: 10px; right: 10px; font-size: 11px; line-height: 1.45; padding: 8px 10px; max-height: 30vh; overflow: hidden; }
  #help .long { display: none; }
}
/* the guide never takes a tap away from the game */
#help { pointer-events: none; }

/* the collage is wide and already loud: headers set a little smaller and tighter than the old face */
h1, h2, h3, .card h2, #death-title { font-feature-settings: 'calt' 1; letter-spacing: .01em; }
.card h2 { font-size: clamp(26px, 5vw, 40px); }
#death-title { font-size: clamp(34px, 8vw, 60px); line-height: 1.05; }
.panel h2 { font-size: clamp(24px, 5vw, 36px); }

/* guests: the name form at the end of a run, and the board's guest tag */
.guest-name { margin: 10px 0; padding: 10px; border-left: 3px solid var(--gold); background: rgba(0,0,0,.35); }
.guest-name label { display: block; margin-bottom: 6px; color: var(--gold); font-family: var(--font-ui); letter-spacing: .04em; }
.guest-name input { flex: 1 1 180px; min-width: 0; background: #0b0807; color: var(--bone, #e6dcc4); border: 1px solid rgba(232,163,60,.45); padding: 7px 9px; font: inherit; font-size: 16px; }
.guest-name .err { color: var(--red); }
.board small.dim { font-size: .75em; margin-left: .3em; opacity: .7; }

/* panels the player opened (death, pause, kennel) own the screen: no pad or subtitles over them,
   and a tall panel scrolls instead of running off a phone */
body:has(#death:not([hidden])) #gamepad,
body:has(#pause:not([hidden])) #gamepad,
body:has(#shop:not([hidden])) #gamepad { display: none; }
body:has(#death:not([hidden])) #subs,
body:has(#pause:not([hidden])) #subs,
body:has(#shop:not([hidden])) #subs { z-index: 9; }
.overlay .panel { max-height: calc(100dvh - 24px); overflow-y: auto; }
.guest-name .row-btns { flex-wrap: nowrap; }
.guest-name .row-btns input { flex: 1 1 0; }
.guest-name .row-btns button { flex: none; padding-left: 10px; padding-right: 10px; }

/* ---------------------------------------------------------------------------
   Cabinet finish. Every cabinet wears its own colour and texture: a thin border
   around the game, thicker along the bottom where the controls and, sometimes,
   somebody's graffiti are. */
.cab-body { position: relative; padding: 8px 8px 0; width: fit-content; max-width: 100%;
  --cab-a: #8a2c2c; --cab-b: #3c1010; --grain: 92deg; --grain-a: .2;
  background:
    repeating-linear-gradient(var(--grain), rgba(0,0,0,var(--grain-a)) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 25% 15%, rgba(255,255,255,.10), transparent 50%),
    radial-gradient(circle at 85% 90%, rgba(0,0,0,.35), transparent 60%),
    linear-gradient(170deg, var(--cab-a), var(--cab-b));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), inset 0 2px 0 rgba(255,255,255,.12), inset 0 -3px 0 rgba(0,0,0,.5); }
.cab-body .frame { box-shadow: 0 0 0 2px #000, 0 0 0 3px rgba(255,255,255,.08); }
.cab-body.skin-0 { --cab-a: #a03030; --cab-b: #3c1010; }                                    /* oxblood lacquer */
.cab-body.skin-1 { --cab-a: #2f7a52; --cab-b: #0f2c1c; --grain-a: .12; }                     /* bottle-green enamel */
.cab-body.skin-2 { --cab-a: #b08a3a; --cab-b: #50380f; --grain: 4deg; --grain-a: .3; }       /* nicotine wood, grain across */
.cab-body.skin-3 { --cab-a: #6a46a0; --cab-b: #231640; --grain-a: .16; }                     /* bruised purple */
.cab-body.skin-4 { --cab-a: #b5551f; --cab-b: #3e1a08; --grain: 120deg; --grain-a: .34; }    /* rust */
.cab-body.skin-5 { --cab-a: #77838c; --cab-b: #20262a; --grain: 0deg; --grain-a: .26; }      /* gunmetal */
.cab-deck { position: relative; height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; }
.cab-coin { width: 18px; height: 22px; border-radius: 3px; background: #0a0706; box-shadow: inset 0 0 0 2px rgba(255,255,255,.12), inset 0 -4px 0 rgba(232,163,60,.5); color: rgba(232,163,60,.8); font: 11px/22px var(--font-ui); text-align: center; }
.cab-buttons { display: flex; gap: 7px; }
.cab-buttons i { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3, transparent 60%), #1a1210; box-shadow: 0 0 0 2px rgba(0,0,0,.6), 0 1px 0 rgba(255,255,255,.18); }
.cab-buttons i:nth-child(2) { background: radial-gradient(circle at 35% 30%, #fff4, transparent 60%), #7a1c1c; }
/* graffiti: sprayed on the bottom edge, in the cabinet's own tag colour, with drips */
.cab-graffiti { position: absolute; left: 50%; top: 2px; bottom: 2px; transform: translateX(-50%) rotate(-1.5deg); background: none; border: 0; padding: 0 10px; cursor: pointer; display: flex; align-items: center; color: var(--spray, #ff4fd8); }
.cab-graffiti .g-keys { display: flex; gap: 6px; align-items: flex-start; }
.cab-graffiti .g-keys span { position: relative; display: inline-block; font: 700 31px/1 'Caveat', 'Comic Sans MS', cursive; transform: translateY(var(--lift, 0)) rotate(var(--tilt, 0deg));
  color: color-mix(in srgb, var(--spray) 85%, #fff); text-shadow: 0 0 5px var(--spray), 0 0 12px color-mix(in srgb, var(--spray) 60%, transparent), 1px 2px 0 rgba(0,0,0,.55); filter: blur(.2px); }
.cab-graffiti .g-keys span::after { content: ''; position: absolute; left: 50%; top: 82%; width: 2px; height: var(--drip, 6px); margin-left: -1px; background: linear-gradient(var(--spray), transparent); border-radius: 0 0 2px 2px; }
.cab-graffiti:hover .g-keys span, .cab-graffiti:focus-visible .g-keys span { filter: none; }
/* the tap pad, for touch and for games that don't pass keys on */
.cab-codepad { position: absolute; left: 8px; right: 8px; bottom: 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 6px 8px; background: rgba(8,5,4,.92); border: 1px solid rgba(232,163,60,.4); z-index: 3; }
.cab-codepad .cp-dots { letter-spacing: .15em; color: var(--gold); font-family: var(--font-ui); }
.cab-codepad .cp-keys { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.cab-codepad button { min-width: 34px; padding: 6px 8px; font-size: 16px; }
/* the settings menu opens over the game */
.cab-settings { position: absolute; inset: 8px 8px 40px; z-index: 4; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: rgba(8,5,4,.96); border: 1px solid rgba(232,163,60,.45); overflow: hidden; }
.cab-settings header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cab-settings header b { font-family: var(--font-title); font-weight: 400; font-size: clamp(20px, 4vw, 28px); color: var(--gold); letter-spacing: .01em; }
.cab-settings-filter { background: #0b0807; color: inherit; border: 1px solid rgba(255,255,255,.2); padding: 6px 8px; font: inherit; font-size: 15px; }
.cab-settings-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: grid; gap: 6px; }
.cab-settings-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 8px; background: rgba(255,255,255,.04); border-left: 3px solid transparent; }
.cab-settings-list li.current { border-left-color: var(--gold); background: rgba(232,163,60,.1); }
.cab-settings-list li small { color: var(--dim); }
.cab-settings-list button { flex: none; }
@media (max-width: 700px), (pointer: coarse) {
  .cab-graffiti .g-keys span { font-size: 25px; }
  .cab-deck { height: 34px; }
  .cab-coin, .cab-buttons { transform: scale(.85); }
}

/* in a cabinet the subtitles go to the top edge, clear of its bottom border */
@media (min-width: 701px) and (pointer: fine) { body.cab-open #subs { top: 6px; bottom: auto; } }

/* ---- main menu on phones: everything fits the screen width ----
   A grid track sized `1fr` grows to its widest child's min-content, which pushed the cards past the edge. */
.title-wrap, .title-cards > *, .card, .chute { min-width: 0; }
.title-screen { overflow-x: hidden; }
.title-head { overflow: visible; }
@media (max-width: 720px) {
  .title-screen.overlay { padding: 10px; }
  .title-wrap { width: 100%; padding: 12px 0 28px; gap: 14px; }
  .title-cards { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .title-eye { width: 100%; left: 50%; max-width: 100%; overflow: hidden; }
  .title-head p { font-size: 15px; letter-spacing: .02em; line-height: 1.35; margin-top: 8px; }
  .card { padding: 16px; }
  .card h2 { font-size: clamp(24px, 8vw, 32px); }
  .card-play .big-btn, .card-play .big-btn.alt { width: 100%; font-size: 24px; letter-spacing: .06em; }
  .start-in { flex-wrap: wrap; }
  .start-in select { flex: 1 1 100%; width: 100%; }
  .best b { font-size: 52px; }
  .board { font-size: 16px; }
  .board li { flex-wrap: wrap; }
  #title-expansions, .card p { overflow-wrap: anywhere; }
  .chute > summary { padding: 12px 14px; display: block; }
  .chute > summary::before { margin-right: 8px; }
  .chute > summary .dim { display: block; margin-top: 4px; font-size: 13px; }
}

/* a graffiti letter lights up when its key has been entered */
.cab-graffiti .g-keys span { transition: color .12s, text-shadow .12s, transform .12s; }
.cab-graffiti .g-keys span.hit { color: #fff; text-shadow: 0 0 6px #fff, 0 0 14px var(--spray); transform: translateY(var(--lift, 0)) rotate(var(--tilt, 0deg)) scale(1.18); }

.portal pre.once { background: #0f0c0a; border: 1px solid var(--gold); padding: 10px; white-space: pre-wrap; word-break: break-all; color: var(--gold); }

/* ---- the arcade (title screen) ---- */
.card-arcade { display: flex; align-items: center; gap: 20px; width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--text);
  border-color: rgba(62,240,224,.4); box-shadow: 0 0 0 1px #000, 0 0 34px rgba(62,240,224,.07), inset 0 0 40px rgba(0,0,0,.65); transition: border-color .15s, box-shadow .15s; }
.card-arcade:hover, .card-arcade:focus-visible { border-color: var(--cyan); box-shadow: 0 0 0 1px #000, 0 0 40px rgba(62,240,224,.16), inset 0 0 40px rgba(0,0,0,.65); outline: none; }
.card-arcade .arc-h { display: block; font: 26px/1.1 var(--font-title); letter-spacing: .2em; color: var(--cyan); margin-bottom: 4px; }
.arcade-copy { flex: 1; min-width: 0; }
.arcade-n { white-space: nowrap; font-family: var(--font-ui); font-size: 18px; }
.mini-cab { flex: none; width: 54px; height: 84px; position: relative; display: block; background: linear-gradient(#2a1d17, #120c0a); border: 2px solid #4a332a; border-radius: 6px 6px 2px 2px; box-shadow: inset 0 0 8px #000; }
.mini-cab i { position: absolute; left: 6px; right: 6px; display: block; }
.mc-marquee { top: 5px; height: 9px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); border-radius: 1px; animation: mc-flick 4s infinite steps(1); }
.mc-screen { top: 19px; height: 30px; background: radial-gradient(circle at 40% 40%, #2c5a3a, #07120b); border: 1px solid #000; }
.mc-screen::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(transparent 0 2px, rgba(0,0,0,.35) 2px 3px); }
.mc-deck { top: 54px; height: 8px; background: #3b2622; border-top: 1px solid #5b4038; }
.mc-deck::before, .mc-deck::after { content: ''; position: absolute; top: 1px; width: 5px; height: 5px; border-radius: 50%; background: var(--red); left: 6px; }
.mc-deck::after { left: auto; right: 6px; background: var(--gold); }
@keyframes mc-flick { 0%, 100% { opacity: 1; } 47% { opacity: .35; } 49% { opacity: 1; } 83% { opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .mc-marquee { animation: none; } }

.arcade { z-index: 9; align-items: stretch; justify-content: center; padding: 14px; background: radial-gradient(ellipse at 50% 0%, rgba(62,240,224,.08), transparent 60%), rgba(5,4,3,.94); }
.arc-cab { width: min(1040px, 100%); display: flex; flex-direction: column; min-height: 0; max-height: 100%;
  background: linear-gradient(#1c1310, #0d0907); border: 3px solid #4a332a; border-bottom-width: 14px; border-radius: 10px 10px 4px 4px;
  box-shadow: 0 0 0 1px #000, 0 30px 80px rgba(0,0,0,.8), inset 0 0 0 1px rgba(255,255,255,.04); }
.arc-marquee { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-bottom: 3px solid #000;
  background: linear-gradient(180deg, rgba(62,240,224,.18), rgba(62,240,224,.04)); }
.arc-marquee b { font: 30px/1 var(--font-title); letter-spacing: .22em; color: var(--cyan); text-shadow: 0 0 14px rgba(62,240,224,.55), 0 2px 0 #000; }
.arc-marquee span { color: var(--dim); font-size: 12px; flex: 1; min-width: 0; }
.arc-screen { flex: 1; min-height: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr); margin: 14px; border: 2px solid #000; border-radius: 8px;
  background: #080706; box-shadow: inset 0 0 50px rgba(0,0,0,.9), 0 0 0 6px #241915; overflow: hidden; }
.arc-side { border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; padding: 12px; min-height: 0; }
.arc-side input { width: 100%; }
.arc-filter { display: flex; gap: 4px; }
.arc-filter button, .arc-how button, .arc-btabs button { flex: 1; padding: 4px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; background: transparent; border: 1px solid var(--line); color: var(--dim); }
.arc-filter button.on, .arc-how button.on, .arc-btabs button.on { border-color: var(--cyan); color: var(--cyan); background: rgba(62,240,224,.07); }
#arc-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
#arc-list button { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; background: transparent; border: 0; border-left: 3px solid transparent; color: var(--text); border-radius: 0; }
#arc-list button:hover { background: rgba(255,255,255,.03); }
#arc-list button.on { border-left-color: var(--cyan); background: rgba(62,240,224,.06); }
#arc-list b { font-weight: normal; font-family: var(--font-ui); font-size: 19px; letter-spacing: .04em; }
#arc-list small { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11px; }
.tag { font-style: normal; border: 1px solid; padding: 0 4px; border-radius: 2px; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.tag.s { color: var(--gold); }
.tag.w { color: var(--green); }
.arc-detail { padding: 16px 20px 20px; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.arc-detail h3 { margin: 0; font: 34px/1 var(--font-title); letter-spacing: .06em; color: var(--bone); }
.arc-detail > p { margin: 0; }
.arc-empty { margin: auto; text-align: center; max-width: 30ch; }
.arc-back { display: none; align-self: flex-start; }
.arc-how { display: flex; gap: 4px; margin-top: 6px; }
.arc-how button { font-size: 14px; padding: 6px; }
.arc-opts { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.arc-opts:empty { display: none; }
.arc-opts label { display: flex; gap: 6px; align-items: center; color: var(--dim); font-size: 13px; }
.arc-opts output { font-family: var(--font-ui); color: var(--text); width: 3em; }
.arc-go { align-self: flex-start; border-color: var(--cyan); color: var(--cyan); background: #0e2624; }
.arc-go:hover:not(:disabled) { background: #123532; color: #d4fffa; border-color: #d4fffa; }
.arc-out:empty { display: none; }
.arc-out { font-size: 15px; }
.arc-json { margin: 0; padding: 8px 10px; background: #120e0b; border: 1px solid var(--line); font-size: 11px; max-height: 180px; overflow: auto; white-space: pre-wrap; }
.arc-board { margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 10px; }
.arc-board h4 { margin: 0 0 6px; font: 20px/1 var(--font-ui); letter-spacing: .2em; color: var(--gold); }
.arc-btabs { display: flex; gap: 4px; margin-bottom: 6px; max-width: 280px; }
.arc-board .board li small { align-self: center; }
.arc-board .board li b small { color: var(--dim); font-weight: normal; }
.arc-name { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.arc-name input { width: 12em; }
.arc-deck { display: flex; align-items: center; gap: 14px; padding: 8px 22px 6px; border-top: 2px solid #000; background: linear-gradient(#2a1d17, #170f0c); }
.arc-deck i { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff7a6a, var(--red) 55%, #4a0a0e); box-shadow: 0 2px 0 #000; }
.arc-deck i:nth-child(2) { background: radial-gradient(circle at 35% 35%, #ffe2a0, var(--gold) 55%, #4a300a); }
.arc-deck i:nth-child(3) { background: radial-gradient(circle at 35% 35%, #dfffb0, var(--green) 55%, #23310a); }
.arc-deck span { margin-left: auto; font: 15px var(--font-ui); letter-spacing: .3em; color: var(--red); animation: mc-flick 3s infinite steps(1); }
@media (max-width: 720px) {
  .arcade { padding: 6px; }
  .arc-cab { border-bottom-width: 8px; }
  .arc-marquee { flex-wrap: wrap; gap: 4px 10px; padding: 8px 10px; }
  .arc-marquee b { font-size: 24px; }
  .arc-marquee span { order: 3; flex-basis: 100%; }
  .arc-marquee button { margin-left: auto; }
  .arc-screen { grid-template-columns: minmax(0, 1fr); margin: 8px; }
  .arc-side { border-right: 0; }
  .arc-screen .arc-detail { display: none; }
  .arc-screen.picked .arc-side { display: none; }
  .arc-screen.picked .arc-detail { display: flex; }
  .arc-back { display: inline-block; }
  .arc-detail { padding: 12px; }
  .arc-detail h3 { font-size: 28px; }
  .card-arcade { gap: 14px; }
  .arcade-n { display: none; }
  .arc-deck { display: none; }
}
