:root {
  --cream: #efeee9; --ink: #111111; --acid: #d8f24a; --red: #e5352b; --grey: #6f6f6a; --paper: #f7f6f1; --rule: 2px;
  --display: "Archivo Black", "Arial Black", Impact, sans-serif;
  --pixel: "Press Start 2P", monospace;
  --mono: "Space Mono", "Courier New", monospace;
}
* { box-sizing: border-box; }
html { background: var(--ink); }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--mono); font-size: 16px; line-height: 1.45; font-synthesis: none; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
@media (pointer: fine) { body { cursor: url("/art/web/cursor.png") 16 4, auto; } a, button, [role="button"], label, input, select { cursor: url("/art/web/cursor.png") 16 4, pointer; } }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.pix { image-rendering: pixelated; image-rendering: crisp-edges; }

/* the sheet: black rules from the grid background, cream cells on it */
.sheet { max-width: 1440px; margin: 0 auto; border: var(--rule) solid var(--ink); background: var(--ink); display: grid; gap: var(--rule); }
.cell { background: var(--cream); padding: 24px; min-width: 0; }
.grid { display: grid; gap: var(--rule); background: var(--ink); }

/* first screen */
.top { grid-template-columns: 1.15fr 1fr; }
.cell-title { display: grid; grid-template-rows: auto 1fr auto; gap: 18px; }
.cell-title h1 { font-family: var(--display); font-weight: 400; font-size: clamp(48px, 6.6vw, 118px); line-height: 0.88; letter-spacing: -0.01em; margin: 0; text-transform: uppercase; }
.lede { font-size: clamp(16px, 1.35vw, 20px); max-width: 32em; margin: 0; align-self: end; }
.counters { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--rule); background: var(--ink); border: var(--rule) solid var(--ink); }
.counters > div { background: var(--cream); padding: 12px 14px; display: grid; gap: 2px; }
.counters b { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 3vw, 44px); line-height: 1; }
.counters span { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--grey); }
.cell-hero { background: var(--acid); position: relative; padding: 24px 24px 24px; display: grid; grid-template-rows: 1fr auto; gap: 16px; min-height: 420px; }
.hero-scene { position: relative; align-self: center; }
.hero-scene .hall { width: 100%; height: auto; border: var(--rule) solid var(--ink); }
.coin { position: absolute; left: 50%; bottom: 3%; width: 13%; max-width: 110px; aspect-ratio: 239 / 250; transform: translateX(-50%); }
.coin img { position: absolute; left: 50%; bottom: 0; height: 100%; width: auto; transform: translateX(-50%); opacity: 0; animation: spin 4.2s steps(1, end) infinite; filter: drop-shadow(0 6px 0 rgba(0,0,0,0.35)); }
.coin img:nth-child(1) { opacity: 1; animation-name: spin-a; }
.coin img:nth-child(2) { animation-name: spin-b; }
.coin img:nth-child(3) { animation-name: spin-c; }
@keyframes spin-a { 0%, 70% { opacity: 1; } 70.01%, 99.99% { opacity: 0; } 100% { opacity: 1; } }
@keyframes spin-b { 0%, 70% { opacity: 0; } 70.01%, 77% { opacity: 1; } 77.01%, 85% { opacity: 0; } 85.01%, 92% { opacity: 1; } 92.01%, 100% { opacity: 0; } }
@keyframes spin-c { 0%, 77% { opacity: 0; } 77.01%, 85% { opacity: 1; } 85.01%, 100% { opacity: 0; } }
.notice { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; background: var(--paper); border: var(--rule) solid var(--ink); padding: 12px 16px; text-decoration: none; color: inherit; min-height: 56px; box-shadow: 6px 6px 0 var(--ink); position: relative; }
.notice .pin { position: absolute; left: 50%; top: -14px; width: 26px; transform: translateX(-50%); }
.notice img.mark { width: 22px; height: 22px; }
.notice span { font-size: 15px; }
.notice b { font-family: var(--display); font-weight: 400; font-size: 15px; text-transform: uppercase; letter-spacing: 0.04em; }
.notice[aria-disabled="true"] { color: var(--grey); box-shadow: none; }
.notice[aria-disabled="true"] img.mark { opacity: 0.35; }
.notice:not([aria-disabled="true"]):active { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--ink); }

/* doors */
.doors { grid-template-columns: repeat(3, 1fr); }
.door { text-align: left; border: 0; background: var(--cream); padding: 22px 24px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 12px; min-height: 120px; }
.door b { grid-column: 1; font-family: var(--display); font-weight: 400; font-size: clamp(22px, 2.2vw, 32px); text-transform: uppercase; line-height: 1; }
.door i { grid-column: 2; font-style: normal; font-family: var(--display); font-size: 40px; line-height: 1; grid-row: 1 / 3; }
.door small { grid-column: 1; font-size: 14px; color: var(--grey); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 8px; }
.door:hover, .door:focus-visible { background: var(--acid); }
.door:active { background: var(--ink); color: var(--cream); }

/* the hall */
.hall-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 16px; padding: 14px 24px; }
.hall-head h2 { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 2.4vw, 34px); text-transform: uppercase; margin: 0; line-height: 1; }
.hall-head .hint { font-size: 13px; color: var(--grey); text-transform: uppercase; letter-spacing: 0.05em; text-align: right; }
.hall { --cols: 4; grid-template-columns: repeat(var(--cols), 1fr); grid-auto-rows: 1fr; }
.cab.free .marq .name { color: var(--grey); }
.cab.free .cabinet { opacity: 0.85; }
.cab { display: grid; grid-template-rows: auto auto auto 1fr; gap: 10px; align-content: start; }
.cab .acts { align-self: end; }
.cab .status { align-content: start; }
.marq { position: relative; width: 100%; max-width: 313px; margin: 0 auto; aspect-ratio: 313 / 152; }
.marq img { position: absolute; inset: 0; width: 100%; height: 100%; }
.marq .name { position: absolute; left: 15%; right: 15%; top: 18%; bottom: 24%; display: flex; align-items: center; justify-content: center; text-align: center; font-family: var(--pixel); font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; color: var(--ink); }
.marq .name.long { font-size: 16px; line-height: 1.35; }
.cabinet { position: relative; width: 100%; max-width: 270px; margin: 0 auto; aspect-ratio: 270 / 342; }
.cabinet > img.body { position: absolute; inset: 0; width: 100%; height: 100%; }
.cabinet .screen { position: absolute; left: 28%; top: 33%; width: 57%; height: 36%; overflow: hidden; background: #efeee9; }
.cabinet .screen img { width: 100%; height: 100%; object-fit: contain; background: #efeee9; }
.cabinet .glow { position: absolute; left: 31%; top: 5.9%; width: 52%; height: 12%; background: var(--acid); box-shadow: 0 0 14px 4px rgba(216, 242, 74, 0.8); animation: buzz 3s steps(2, end) infinite; }
.cabinet .badge { position: absolute; right: 2%; bottom: 4%; width: 32%; }
@keyframes buzz { 0%, 100% { opacity: 1; } 50% { opacity: 0.86; } }
.cab .status { display: grid; gap: 4px; font-size: 14px; }
.cab .status .st { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 16px; letter-spacing: 0.02em; }
.cab .status .st.live { color: #2d7a00; }
.cab .status .st.fail { color: var(--red); }
.cab .status .n { color: var(--grey); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 10px 18px; border: var(--rule) solid var(--ink); background: var(--ink); color: var(--cream); font-family: var(--display); font-weight: 400; font-size: 16px; text-transform: uppercase; letter-spacing: 0.04em; text-decoration: none; box-shadow: 4px 4px 0 var(--ink); transition: transform 60ms; }
.btn i { font-style: normal; font-size: 22px; line-height: 1; }
.btn.yellow { background: var(--acid); color: var(--ink); }
.btn.ghost { background: var(--cream); color: var(--ink); }
.btn img.mark { width: 22px; height: 22px; }
.btn:active:not([disabled]) { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--cream); color: var(--grey); border-color: var(--grey); box-shadow: none; }
.btn[disabled] img.mark, .btn[aria-disabled="true"] img.mark { opacity: 0.35; }
.btn.wide { width: 100%; }
.cab .acts { display: grid; gap: 10px; }

/* the change machine ($PLAY) */
.changer { grid-column: span 2; display: grid; grid-template-columns: minmax(180px, 240px) 1fr; gap: 24px; align-items: start; }
.changer-pic { position: relative; width: 100%; aspect-ratio: 214 / 321; }
.changer-pic img.body { position: absolute; inset: 0; width: 100%; height: 100%; }
.changer-pic .coin-in { position: absolute; left: 50%; top: 22%; width: 30%; transform: translateX(-50%); animation: drop 5s steps(1, end) infinite; }
@keyframes drop { 0%, 60% { transform: translate(-50%, 0); } 60.01%, 70% { transform: translate(-50%, 10%); } 70.01%, 100% { transform: translate(-50%, 0); } }
.plate { display: grid; gap: 12px; }
.plate h2 { font-family: var(--display); font-weight: 400; font-size: clamp(24px, 2.5vw, 36px); margin: 0; line-height: 1; text-transform: uppercase; }
.plate .sub { font-size: 14px; color: var(--grey); text-transform: uppercase; letter-spacing: 0.05em; }
.contract { border: var(--rule) solid var(--ink); background: var(--paper); padding: 12px 14px; display: grid; gap: 8px; }
.contract .lab { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--grey); }
.contract code { font-family: var(--mono); font-size: 15px; overflow-wrap: anywhere; user-select: all; line-height: 1.5; }
.contract code.none { color: var(--grey); user-select: none; }
.contract .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.contract .fb { font-size: 13px; color: var(--grey); }
.plate .links { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.burned { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--rule); background: var(--ink); border: var(--rule) solid var(--ink); }
.burned > div { background: var(--cream); padding: 10px 12px; display: grid; gap: 2px; }
.burned b { font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1; }
.burned span { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--grey); }

.empty-cab { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.empty-cab .cabinet { width: 180px; }
.empty-cab p { margin: 0; font-size: 18px; max-width: 26em; }

/* dialogs: a cabinet's service panel */
dialog { border: var(--rule) solid var(--ink); background: var(--cream); color: var(--ink); padding: 0; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 32px); margin: auto; box-shadow: 10px 10px 0 var(--ink); }
dialog::backdrop { background: rgba(17, 17, 17, 0.72); }
.panel-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 14px 18px; background: var(--ink); color: var(--cream); }
.panel-head img { width: 34px; height: auto; }
.panel-head h2 { font-family: var(--display); font-weight: 400; font-size: 20px; text-transform: uppercase; margin: 0; line-height: 1.1; }
.panel-head .close { background: var(--acid); color: var(--ink); border: 0; min-width: 48px; min-height: 48px; font-family: var(--display); font-size: 16px; text-transform: uppercase; }
.panel-body { padding: 18px; display: grid; gap: 14px; overflow: auto; max-height: calc(100vh - 32px - 76px); }
.panel-body p { margin: 0; }
.rules { border: var(--rule) solid var(--ink); background: var(--paper); padding: 12px 14px; display: grid; gap: 6px; font-size: 15px; }
.rules b { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 14px; letter-spacing: 0.04em; }
.field { display: grid; gap: 6px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; }
.field input, .field select, .field textarea { font: 16px var(--mono); padding: 12px; border: var(--rule) solid var(--ink); background: var(--paper); color: var(--ink); min-height: 48px; text-transform: none; letter-spacing: 0; width: 100%; }
.field input[type="file"] { padding: 10px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.log li { padding: 6px 10px; background: var(--paper); border-left: 4px solid var(--ink); }
.log li.err { border-left-color: var(--red); color: var(--red); }
.log li.ok { border-left-color: #2d7a00; }
.wlist { display: flex; flex-wrap: wrap; gap: 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--rule); background: var(--ink); border: var(--rule) solid var(--ink); }
.stats > div { background: var(--paper); padding: 10px 12px; display: grid; gap: 2px; }
.stats b { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1; }
.stats span { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--grey); }
.bar { height: 14px; border: var(--rule) solid var(--ink); background: var(--paper); position: relative; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--acid); }
.bar i.full { background: #2d7a00; }
.qrow { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: var(--rule) solid var(--ink); background: var(--paper); }
.qrow b { font-family: var(--pixel); font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.qrow small { display: block; font-size: 13px; color: var(--grey); margin-top: 4px; }
.qrow .n { font-family: var(--display); font-size: 22px; }
.snippet { background: var(--ink); color: var(--acid); padding: 12px; font-size: 13px; overflow: auto; white-space: pre; margin: 0; }
.top10 { display: grid; gap: 4px; font-size: 14px; }
.top10 div { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; padding: 4px 8px; background: var(--paper); }
.dev-only { border: var(--rule) dashed var(--ink); padding: 12px 14px; display: grid; gap: 10px; }

/* the player: full screen */
dialog.player { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; border: 0; box-shadow: none; background: var(--ink); display: none; grid-template-rows: auto 1fr; }
dialog.player[open] { display: grid; }
.strip { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; padding: 8px 12px; background: var(--ink); color: var(--cream); min-height: 56px; }
.strip .nm { font-family: var(--pixel); font-size: 16px; line-height: 1.3; color: var(--acid); overflow-wrap: anywhere; }
.strip .t { font-size: 14px; white-space: nowrap; }
.strip .close { background: var(--acid); color: var(--ink); border: 0; min-height: 44px; padding: 0 14px; font-family: var(--display); font-size: 14px; text-transform: uppercase; }
.stage { position: relative; background: #000; min-height: 0; }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.gate { position: absolute; inset: 0; display: grid; place-content: center; gap: 14px; background: var(--cream); color: var(--ink); padding: 24px; text-align: center; overflow: auto; }
.gate h3 { font-family: var(--display); font-weight: 400; font-size: 24px; margin: 0; text-transform: uppercase; }
.gate p { margin: 0; max-width: 36em; }
.gate .wlist { justify-content: center; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--acid); padding: 12px 18px; font-size: 14px; border: var(--rule) solid var(--acid); z-index: 50; max-width: calc(100vw - 32px); }

@media (prefers-reduced-motion: reduce) { .coin img, .cabinet .glow, .changer-pic .coin-in { animation: none !important; } .coin img:nth-child(1) { opacity: 1; } .coin img:nth-child(n+2) { opacity: 0; } }

@media (max-width: 1300px) { .hall { --cols: 3; } }
@media (max-width: 1100px) { .changer { grid-column: span 2; } }
@media (max-width: 900px) {
  .top { grid-template-columns: 1fr; }
  .cell-hero { min-height: 0; }
  .doors { grid-template-columns: 1fr; }
  .door { min-height: 88px; }
  .hall { --cols: 2; }
  .changer { grid-column: 1 / -1; grid-template-columns: 1fr; }
  .changer-pic { max-width: 200px; margin: 0 auto; }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .cell { padding: 16px; }
  .cell-title h1 { font-size: clamp(44px, 16vw, 84px); }
  .counters { grid-template-columns: 1fr; }
  .counters > div { grid-template-columns: auto 1fr; align-items: baseline; gap: 10px; }
  .hall { --cols: 1; }
  .plate .links { grid-template-columns: 1fr; }
  .burned { grid-template-columns: 1fr; }
  .empty-cab { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .hall-head { grid-template-columns: 1fr; }
  .hall-head .hint { text-align: left; }
  .strip { grid-template-columns: 1fr auto; }
  .strip .t.who { display: none; }
  .notice { grid-template-columns: auto 1fr; }
  .notice b { grid-column: 2; }
}

/* the display face needs 1.2 line-height to hold its glyphs; the title is tightened optically with margins */
.counters b, .door b, .door i, .btn i, .btn, .plate h2, .burned b, .hall-head h2, .panel-head h2, .stats b, .qrow .n, .gate h3, .notice b, .cab .status .st, .rules b, .strip .close, .panel-head .close { line-height: 1.3; }
.cell-title h1 { line-height: 1.36; margin: -0.22em 0 -0.16em; }
dialog { overflow: hidden; }
.panel-body a { color: var(--ink); font-weight: 700; }
