/* ==========================================================================
   Select stage: the site menu.
   No nav bar. A pixel joystick (top right, qs.css) or a short dwell on the
   top edge spawns a green CRT "select stage" screen: five stage tiles with a
   pixel cursor, a preview box, an echo RADAR marquee with a comic burst, a
   joystick and button deck, and a coin door that books the call. The screen
   assembles out of an 8x8 Bayer dither when it spawns. Pixel art stays at integer scales with image-rendering: pixelated.
   Motion is stepped (steps()) so it moves like hardware, and all of it drops
   away under prefers-reduced-motion.
   ========================================================================== */

/* Hover strip on the very top edge (mouse only). */
.sel-edge { position: fixed; left: 0; right: 0; top: 0; z-index: 175; height: 10px; display: none; }
@media (hover: hover) and (pointer: fine) { .sel-edge { display: block; } }
.sel-open .sel-edge { display: none; }
.sel-lock, .sel-lock body { overflow: hidden; }

/* ---------- Panel ---------- */
.sel {
  --scr: color-mix(in srgb, var(--bg-0) 72%, #000);
  --ink: color-mix(in srgb, var(--bg-0) 30%, #000);
  --gut: clamp(16px, 2.4vw, 32px);
  position: fixed; left: 0; right: 0; top: 0; z-index: 185;
  visibility: hidden;
  color: var(--fg-0); background: var(--scr);
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 22%, transparent), 0 28px 90px rgba(0, 0, 0, .6);
}
.sel.is-open, .sel.is-closing { visibility: visible; }
[data-theme="paper"] .sel { --scr: var(--bg-0); box-shadow: 0 24px 70px rgba(0, 0, 0, .2); }
/* Closed, the panel's idle loops (blinks, marquee, cursor, deck) hold still
   so they cost nothing; they pick up again the moment it opens. */
.sel:not(.is-open):not(.is-closing) *, .sel:not(.is-open):not(.is-closing) *::before, .sel:not(.is-open):not(.is-closing) *::after { animation-play-state: paused !important; }

/* The CRT: faint 1px scanlines and a soft vignette over the whole width. */
.sel__screen { position: relative; overflow: hidden; }
.sel__screen::after {
  content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, .2) 0 1px, transparent 1px 3px),
    radial-gradient(120% 140% at 50% 40%, transparent 55%, rgba(0, 0, 0, .38) 100%);
}
[data-theme="paper"] .sel__screen::after { background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .05) 0 1px, transparent 1px 3px); }
.sel__in { max-width: calc(var(--wrap) + 64px); margin: 0 auto; padding: 0 var(--gut) 22px; }

/* ---------- Top row: sits exactly where the page HUD sits ---------- */
.sel__top { display: flex; align-items: center; height: 72px; }
.sel__title { display: flex; align-items: center; gap: 12px; font: 400 22px/1 var(--pixel); letter-spacing: .02em; text-transform: uppercase; color: var(--fg-0); }
.sel__title::before { content: ""; width: 11px; height: 11px; background: var(--accent); box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent); animation: sel-blink 1.2s steps(1) infinite; }
.sel__hud {
  position: absolute; top: 0; right: 96px; z-index: 2; height: 72px;
  display: flex; align-items: center; gap: 20px;
  font: 400 11px/1 var(--pixel); letter-spacing: .12em; text-transform: uppercase; color: var(--fg-2);
}
.sel__credit b { font-weight: 400; color: var(--warn); }
.sel__hud button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.sel__hud button:hover { color: var(--fg-0); }
.sel__hud .sel__close { padding: 6px 8px 5px; border: 1px solid var(--line-2); box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--bg-0) 50%, #000); color: var(--fg-1); }
.sel__hud .sel__close:hover { border-color: var(--fg-2); }
.sel__x { display: none; }

/* ---------- Body: preview | tiles ---------- */
.sel__body { display: grid; grid-template-columns: clamp(200px, 19vw, 256px) minmax(0, 1fr); gap: clamp(24px, 3vw, 40px); padding-top: 4px; }

/* Preview: the fighting-game portrait. A little night horizon to stand on. */
.sel__pv { display: grid; align-content: start; gap: 12px; min-width: 0; }
.sel__pv-art {
  --floor: 30px;
  position: relative; height: 184px; display: grid; place-items: end center; padding-bottom: calc(var(--floor) - 6px);
  border: 2px solid var(--line-2); overflow: hidden;
  background: linear-gradient(to top,
    color-mix(in srgb, var(--bg-1) 55%, var(--scr)) 0 var(--floor),
    color-mix(in srgb, var(--warn) 22%, var(--scr)) var(--floor) calc(var(--floor) + 8px),
    color-mix(in srgb, var(--bad) 18%, var(--scr)) calc(var(--floor) + 8px) calc(var(--floor) + 18px),
    color-mix(in srgb, var(--event) 17%, var(--scr)) calc(var(--floor) + 18px) calc(var(--floor) + 32px),
    color-mix(in srgb, var(--accent) 9%, var(--scr)) calc(var(--floor) + 32px) calc(var(--floor) + 56px),
    var(--scr) calc(var(--floor) + 56px));
}
.sel__pv-art::before { content: ""; position: absolute; left: 0; right: 0; bottom: var(--floor); height: 2px; background: repeating-linear-gradient(90deg, var(--line-2) 0 8px, transparent 8px 16px); }
/* two pixel stars */
.sel__pv-art::after { content: ""; position: absolute; left: 22px; top: 20px; width: 2px; height: 2px; background: var(--fg-1); box-shadow: 146px 14px 0 var(--warn), 60px 40px 0 color-mix(in srgb, var(--fg-0) 60%, transparent), 184px 58px 0 var(--fg-2); animation: sel-blink 2.6s steps(1) infinite; }
.sel__pv-sp { position: relative; display: block; width: 128px; height: 128px; background: var(--sp) 0 0 / 128px 128px no-repeat; image-rendering: pixelated; }
.sel__pv-sp.is-av { background-size: 512px 128px; animation: sel-av 3.2s steps(1) infinite; --av: 128px; }
.sel__pv-name { font: 400 33px/1 var(--pixel); color: var(--fg-0); margin-top: 4px; }
.sel__pv-desc { font: 400 11px/1.55 var(--pixel); letter-spacing: .02em; color: var(--fg-1); min-height: 3.1em; }

/* ---------- Tiles ---------- */
.sel__main { display: grid; align-content: start; min-width: 0; }
.sel__grid { --tg: clamp(10px, 1.3vw, 18px); --head: 74px; position: relative; padding-top: var(--head); }
.sel__tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--tg); }
.sel__tiles > li { position: relative; min-width: 0; }
.sel__tile {
  position: relative; display: grid; justify-items: center; align-content: end; gap: 12px;
  height: 128px; padding: 12px 6px 14px;
  text-decoration: none; color: var(--fg-1);
  background: color-mix(in srgb, var(--bg-1) 50%, var(--scr));
  border: 1px solid var(--line);
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--scr) 60%, #000);
  -webkit-tap-highlight-color: transparent;
}
.sel__tile:focus-visible { outline: 2px solid var(--fg-0); outline-offset: 2px; }
.sel__n { position: absolute; top: 8px; left: 9px; font: 400 11px/1 var(--pixel); color: var(--fg-2); opacity: .75; }
.sel__sp { display: block; width: 64px; height: 64px; background: var(--sp) 0 0 / 64px 64px no-repeat; image-rendering: pixelated; }
.sel__tile--av .sel__sp { background-size: 256px 64px; --av: 64px; }
.sel__name { font: 400 22px/1 var(--pixel); color: var(--fg-1); white-space: nowrap; }
.sel__here {
  display: none; position: absolute; top: 6px; right: 6px;
  padding: 3px 4px 2px; font: 400 11px/1 var(--pixel); letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
}
.sel__tile[aria-current="page"] .sel__here { display: block; }
.sel__tile.is-sel { background: color-mix(in srgb, var(--accent) 9%, var(--bg-1)); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.sel__tile.is-sel .sel__name { color: var(--fg-0); }
.sel__tile.is-sel .sel__n { color: var(--accent); opacity: 1; }

/* The cursor: four pixel corner brackets and a blinking 1P tag. */
.sel__cur {
  position: absolute; left: 0; top: 0; z-index: 3; width: 0; height: 0; pointer-events: none; opacity: 0;
  transition: transform .15s steps(3), width .15s steps(3), height .15s steps(3);
}
.sel.is-open .sel__cur { opacity: 1; }
.sel__cur::before {
  --c: var(--accent);
  content: ""; position: absolute; inset: -7px;
  background:
    linear-gradient(var(--c) 0 0) 0 0 / 18px 3px, linear-gradient(var(--c) 0 0) 0 0 / 3px 18px,
    linear-gradient(var(--c) 0 0) 100% 0 / 18px 3px, linear-gradient(var(--c) 0 0) 100% 0 / 3px 18px,
    linear-gradient(var(--c) 0 0) 0 100% / 18px 3px, linear-gradient(var(--c) 0 0) 0 100% / 3px 18px,
    linear-gradient(var(--c) 0 0) 100% 100% / 18px 3px, linear-gradient(var(--c) 0 0) 100% 100% / 3px 18px;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--accent) 55%, transparent));
  animation: sel-breathe .9s steps(1) infinite;
}
.sel__cur::after {
  content: "1P"; position: absolute; left: 16px; bottom: -15px;
  padding: 4px 5px 3px; font: 400 11px/1 var(--pixel); letter-spacing: .06em;
  color: var(--accent-ink); background: var(--accent);
  animation: sel-blink-long 1.2s steps(1) infinite;
}

/* ---------- RADAR marquee over Signals ----------
   Pixel letters with stacked copies stepping straight down a pixel at a
   time, like an 80s marquee popping out of the screen. The layer
   colours chase. */
.sel__marq {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 18px); z-index: 7; /* over the scanlines */
  font: 400 22px/1 var(--pixel); letter-spacing: .12em; text-indent: .1em; text-align: center; text-transform: uppercase; white-space: nowrap;
  color: var(--fg-0); pointer-events: none;
  text-shadow: 0 1px 0 var(--event), 0 2px 0 var(--warn), 0 3px 0 var(--accent), 0 4px 0 var(--info), 0 5px 0 var(--ink), 0 6px 0 var(--ink);
}

/* ---------- BANG: a pixel comic burst, only when Signals is selected ----------
   A stepped burst drawn on a 2px grid (inline SVG, crisp edges), with the
   long spike pointing back at Signals. It sits in the headroom above the
   next tiles and over the scanlines, like a sticker on the glass. */
.sel__bang {
  position: absolute; z-index: 8; top: calc(var(--head) - 102px);
  left: calc(2 * (100% - 4 * var(--tg)) / 5 + var(--tg) - 14px);
  left: round(down, calc(2 * (100% - 4 * var(--tg)) / 5 + var(--tg) - 14px), 2px);
  width: 188px; height: 96px; display: grid; place-items: center;
  pointer-events: none; visibility: hidden; transform-origin: 4% 62%;
}
.sel__bang svg { position: absolute; left: 0; top: 0; width: 188px; height: 96px; filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, .5)); }
.sel__bang .k { fill: var(--ink); }
.sel__bang .f { fill: var(--warn); }
.sel__bang .h { fill: color-mix(in srgb, var(--warn) 45%, #fff); }
.sel__bang-t { position: relative; display: grid; justify-items: center; margin: 2px 0 0 4px; font: 400 11px/14px var(--pixel); letter-spacing: 0; text-transform: uppercase; color: var(--ink); }
[data-theme="paper"] .sel__bang .f { fill: #dfc07f; }
[data-theme="paper"] .sel__bang .h { fill: #efdcaf; }
/* only while the panel is up: a visible child would otherwise show through the hidden panel */
.sel.is-open[data-cur="signals"] .sel__bang, .sel.is-closing[data-cur="signals"] .sel__bang { visibility: visible; }

/* ---------- Bottom row: joystick, coin door, the player ---------- */
.sel__bottom { display: flex; align-items: flex-end; gap: clamp(14px, 2vw, 28px); margin-top: 18px; min-height: 80px; }
.sel__stick { display: flex; align-items: center; gap: 12px; align-self: center; font: 400 11px/1.6 var(--pixel); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-2); }
.sel__joy { display: block; flex: none; width: 64px; height: 64px; background: url(/assets/px/joystick.png) -128px 0 / 320px 64px no-repeat; image-rendering: pixelated; }
.sel__joy[data-f="0"] { background-position: 0 0; }
.sel__joy[data-f="1"] { background-position: -64px 0; }
.sel__joy[data-f="3"] { background-position: -192px 0; }
.sel__joy[data-f="4"] { background-position: -256px 0; }
.sel__btn { display: block; flex: none; width: 48px; height: 48px; margin: 10px 4px 0 -10px; background: url(/assets/px/arcade-button.png) 0 0 / 96px 48px no-repeat; image-rendering: pixelated; }
.sel__btn.is-down { background-position: -48px 0; }
.sel__keys { display: grid; white-space: nowrap; }
/* the backtick is two pixels tall in the pixel face, so it borrows the mono one */
.sel__keys kbd { font: 700 13px/1 var(--mono); letter-spacing: 0; }
/* the footer "shortcuts off" switch (term.js) drops the one-key hints */
.keys-off .sel__keys > span:nth-child(n+3) { display: none; }
@media (min-width: 1240px) {
  .sel__keys { grid-template-rows: auto auto; grid-auto-flow: column; column-gap: 1.6em; }
}

.sel__coin { margin-left: auto; display: flex; align-items: flex-end; gap: 14px; padding: 0 6px 4px 0; text-decoration: none; color: var(--fg-0); -webkit-tap-highlight-color: transparent; }
.sel__coin:focus-visible { outline: 2px solid var(--fg-0); outline-offset: 6px; }
.sel__door { position: relative; flex: none; width: 64px; height: 80px; background: url(/assets/px/coin-slot.png) 0 0 / 64px 80px no-repeat; image-rendering: pixelated; }
/* the slot glow, lit when a coin goes in */
.sel__door::after { content: ""; position: absolute; left: 28px; top: 22px; width: 2px; height: 20px; background: var(--accent); box-shadow: 0 0 10px 4px color-mix(in srgb, var(--accent) 65%, transparent); opacity: 0; }
/* the flight window ends at the top of the slit, so the coin vanishes into it */
.sel__fly { position: absolute; left: 13px; top: -20px; width: 32px; height: 40px; overflow: hidden; pointer-events: none; }
.sel__fly i {
  position: absolute; left: 0; top: 6px; width: 32px; height: 32px;
  background: url(/assets/px/coin-spin.png) 0 0 / 192px 32px no-repeat; image-rendering: pixelated;
  visibility: hidden;
}
.sel.is-open .sel__coin:hover .sel__fly i, .sel.is-open .sel__coin:focus-visible .sel__fly i, .sel.is-open .sel__coin.is-drop .sel__fly i { visibility: visible; }
.sel__cointxt { display: grid; gap: 9px; padding-bottom: 8px; }
.sel__insert { font: 400 11px/1 var(--pixel); letter-spacing: .16em; text-transform: uppercase; color: var(--warn); animation: sel-blink-long 1.1s steps(1) infinite; }
.sel__book { font: 400 22px/1 var(--pixel); color: var(--fg-0); white-space: nowrap; }
.sel__coin:hover .sel__book { color: var(--accent); }
.sel__coin.is-drop .sel__book { color: var(--accent); }

/* the hidden one: player one at a cabinet, on his break */
.sel__egg { flex: none; width: 64px; height: 80px; background: url(/assets/px/player-at-cabinet.png) 0 0 / 256px 80px no-repeat; image-rendering: pixelated; opacity: .32; filter: saturate(.6); transition: opacity .4s, filter .4s; }
.sel__egg:hover { opacity: 1; filter: none; }

/* ---------- Motion (skipped entirely under reduced motion) ----------
   Spawn: the screen assembles in eight Bayer-dither steps of 4px cells
   (~320ms) while the tiles pop in one by one; the cursor and marquee land
   last. Despawn runs the dither backwards, faster. */
@media (prefers-reduced-motion: no-preference) {
  .sel.is-open, .sel.is-closing { -webkit-mask-size: 32px 32px; mask-size: 32px 32px; -webkit-mask-repeat: repeat; mask-repeat: repeat; }
  .sel.is-open { animation: sel-spawn .32s steps(1) backwards; }
  .sel.is-closing { animation: sel-despawn .18s steps(1) forwards; }
  .sel.is-open .sel__tile { animation: sel-pop .16s steps(4) backwards; animation-delay: calc(.12s + var(--i, 0) * 35ms); }
  .sel__marq { animation: sel-chase 1.4s steps(1) infinite; }
  .sel.is-open .sel__marq { animation: sel-in .01s .34s backwards, sel-chase 1.4s steps(1) .35s infinite; }
  .sel.is-open .sel__cur { animation: sel-in .01s .34s backwards; }
  .sel__tile.is-sel .sel__sp { animation: sel-bob .6s steps(1) infinite; }
  .sel__tile--av.is-sel .sel__sp { animation: sel-bob .6s steps(1) infinite, sel-av 3.2s steps(1) infinite; }
  .sel__pv-art.is-swap .sel__pv-sp { animation: sel-swap .18s steps(3); }
  .sel__pv-art.is-swap .sel__pv-sp.is-av { animation: sel-swap .18s steps(3), sel-av 3.2s steps(1) infinite; }
  .sel[data-cur="signals"] .sel__bang { animation: sel-bang .24s steps(3) backwards; }
  .sel.is-open[data-cur="signals"] .sel__bang { animation-delay: .38s; }
  .sel__joy:not([data-f]) { animation: sel-joy-idle 5.2s steps(1) infinite; }
  .sel__egg { animation: sel-egg 2.8s steps(4) infinite; }
  .sel__coin:hover .sel__fly i, .sel__coin:focus-visible .sel__fly i { animation: sel-spin .6s steps(6) infinite, sel-hover .8s steps(1) infinite; }
  .sel__coin.is-drop .sel__fly i { background-position: -96px 0; animation: sel-drop-coin .1s steps(5) forwards; }
  .sel__coin.is-fed .sel__door::after { animation: sel-glow .5s steps(2) forwards; }
  .sel__coin.is-fed .sel__door { animation: sel-door .3s steps(2); }
}
@media (prefers-reduced-motion: reduce) {
  .sel__insert, .sel__title::before, .sel__cur::after, .sel__marq, .sel__pv-art::after { animation: none; }
}

@keyframes sel-spawn {
  0% { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM4 0h1v1h-1zM2 2h1v1h-1zM6 2h1v1h-1zM0 4h1v1h-1zM4 4h1v1h-1zM2 6h1v1h-1zM6 6h1v1h-1z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM4 0h1v1h-1zM2 2h1v1h-1zM6 2h1v1h-1zM0 4h1v1h-1zM4 4h1v1h-1zM2 6h1v1h-1zM6 6h1v1h-1z'/%3E%3C/svg%3E"); }
  12.5% { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM2 0h1v1h-1zM4 0h1v1h-1zM6 0h1v1h-1zM0 2h1v1h-1zM2 2h1v1h-1zM4 2h1v1h-1zM6 2h1v1h-1zM0 4h1v1h-1zM2 4h1v1h-1zM4 4h1v1h-1zM6 4h1v1h-1zM0 6h1v1h-1zM2 6h1v1h-1zM4 6h1v1h-1zM6 6h1v1h-1z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM2 0h1v1h-1zM4 0h1v1h-1zM6 0h1v1h-1zM0 2h1v1h-1zM2 2h1v1h-1zM4 2h1v1h-1zM6 2h1v1h-1zM0 4h1v1h-1zM2 4h1v1h-1zM4 4h1v1h-1zM6 4h1v1h-1zM0 6h1v1h-1zM2 6h1v1h-1zM4 6h1v1h-1zM6 6h1v1h-1z'/%3E%3C/svg%3E"); }
  25% { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM2 0h1v1h-1zM4 0h1v1h-1zM6 0h1v1h-1zM1 1h1v1h-1zM5 1h1v1h-1zM0 2h1v1h-1zM2 2h1v1h-1zM4 2h1v1h-1zM6 2h1v1h-1zM3 3h1v1h-1zM7 3h1v1h-1zM0 4h1v1h-1zM2 4h1v1h-1zM4 4h1v1h-1zM6 4h1v1h-1zM1 5h1v1h-1zM5 5h1v1h-1zM0 6h1v1h-1zM2 6h1v1h-1zM4 6h1v1h-1zM6 6h1v1h-1zM3 7h1v1h-1zM7 7h1v1h-1z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM2 0h1v1h-1zM4 0h1v1h-1zM6 0h1v1h-1zM1 1h1v1h-1zM5 1h1v1h-1zM0 2h1v1h-1zM2 2h1v1h-1zM4 2h1v1h-1zM6 2h1v1h-1zM3 3h1v1h-1zM7 3h1v1h-1zM0 4h1v1h-1zM2 4h1v1h-1zM4 4h1v1h-1zM6 4h1v1h-1zM1 5h1v1h-1zM5 5h1v1h-1zM0 6h1v1h-1zM2 6h1v1h-1zM4 6h1v1h-1zM6 6h1v1h-1zM3 7h1v1h-1zM7 7h1v1h-1z'/%3E%3C/svg%3E"); }
  37.5% { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM2 0h1v1h-1zM4 0h1v1h-1zM6 0h1v1h-1zM1 1h1v1h-1zM3 1h1v1h-1zM5 1h1v1h-1zM7 1h1v1h-1zM0 2h1v1h-1zM2 2h1v1h-1zM4 2h1v1h-1zM6 2h1v1h-1zM1 3h1v1h-1zM3 3h1v1h-1zM5 3h1v1h-1zM7 3h1v1h-1zM0 4h1v1h-1zM2 4h1v1h-1zM4 4h1v1h-1zM6 4h1v1h-1zM1 5h1v1h-1zM3 5h1v1h-1zM5 5h1v1h-1zM7 5h1v1h-1zM0 6h1v1h-1zM2 6h1v1h-1zM4 6h1v1h-1zM6 6h1v1h-1zM1 7h1v1h-1zM3 7h1v1h-1zM5 7h1v1h-1zM7 7h1v1h-1z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM2 0h1v1h-1zM4 0h1v1h-1zM6 0h1v1h-1zM1 1h1v1h-1zM3 1h1v1h-1zM5 1h1v1h-1zM7 1h1v1h-1zM0 2h1v1h-1zM2 2h1v1h-1zM4 2h1v1h-1zM6 2h1v1h-1zM1 3h1v1h-1zM3 3h1v1h-1zM5 3h1v1h-1zM7 3h1v1h-1zM0 4h1v1h-1zM2 4h1v1h-1zM4 4h1v1h-1zM6 4h1v1h-1zM1 5h1v1h-1zM3 5h1v1h-1zM5 5h1v1h-1zM7 5h1v1h-1zM0 6h1v1h-1zM2 6h1v1h-1zM4 6h1v1h-1zM6 6h1v1h-1zM1 7h1v1h-1zM3 7h1v1h-1zM5 7h1v1h-1zM7 7h1v1h-1z'/%3E%3C/svg%3E"); }
  50% { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM1 0h1v1h-1zM2 0h1v1h-1zM4 0h1v1h-1zM5 0h1v1h-1zM6 0h1v1h-1zM1 1h1v1h-1zM3 1h1v1h-1zM5 1h1v1h-1zM7 1h1v1h-1zM0 2h1v1h-1zM2 2h1v1h-1zM3 2h1v1h-1zM4 2h1v1h-1zM6 2h1v1h-1zM7 2h1v1h-1zM1 3h1v1h-1zM3 3h1v1h-1zM5 3h1v1h-1zM7 3h1v1h-1zM0 4h1v1h-1zM1 4h1v1h-1zM2 4h1v1h-1zM4 4h1v1h-1zM5 4h1v1h-1zM6 4h1v1h-1zM1 5h1v1h-1zM3 5h1v1h-1zM5 5h1v1h-1zM7 5h1v1h-1zM0 6h1v1h-1zM2 6h1v1h-1zM3 6h1v1h-1zM4 6h1v1h-1zM6 6h1v1h-1zM7 6h1v1h-1zM1 7h1v1h-1zM3 7h1v1h-1zM5 7h1v1h-1zM7 7h1v1h-1z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM1 0h1v1h-1zM2 0h1v1h-1zM4 0h1v1h-1zM5 0h1v1h-1zM6 0h1v1h-1zM1 1h1v1h-1zM3 1h1v1h-1zM5 1h1v1h-1zM7 1h1v1h-1zM0 2h1v1h-1zM2 2h1v1h-1zM3 2h1v1h-1zM4 2h1v1h-1zM6 2h1v1h-1zM7 2h1v1h-1zM1 3h1v1h-1zM3 3h1v1h-1zM5 3h1v1h-1zM7 3h1v1h-1zM0 4h1v1h-1zM1 4h1v1h-1zM2 4h1v1h-1zM4 4h1v1h-1zM5 4h1v1h-1zM6 4h1v1h-1zM1 5h1v1h-1zM3 5h1v1h-1zM5 5h1v1h-1zM7 5h1v1h-1zM0 6h1v1h-1zM2 6h1v1h-1zM3 6h1v1h-1zM4 6h1v1h-1zM6 6h1v1h-1zM7 6h1v1h-1zM1 7h1v1h-1zM3 7h1v1h-1zM5 7h1v1h-1zM7 7h1v1h-1z'/%3E%3C/svg%3E"); }
  62.5% { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM1 0h1v1h-1zM2 0h1v1h-1zM3 0h1v1h-1zM4 0h1v1h-1zM5 0h1v1h-1zM6 0h1v1h-1zM7 0h1v1h-1zM1 1h1v1h-1zM3 1h1v1h-1zM5 1h1v1h-1zM7 1h1v1h-1zM0 2h1v1h-1zM1 2h1v1h-1zM2 2h1v1h-1zM3 2h1v1h-1zM4 2h1v1h-1zM5 2h1v1h-1zM6 2h1v1h-1zM7 2h1v1h-1z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{ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM1 0h1v1h-1zM2 0h1v1h-1zM3 0h1v1h-1zM4 0h1v1h-1zM5 0h1v1h-1zM6 0h1v1h-1zM7 0h1v1h-1zM0 1h1v1h-1zM1 1h1v1h-1zM3 1h1v1h-1zM4 1h1v1h-1zM5 1h1v1h-1zM7 1h1v1h-1zM0 2h1v1h-1zM1 2h1v1h-1zM2 2h1v1h-1zM3 2h1v1h-1zM4 2h1v1h-1zM5 2h1v1h-1zM6 2h1v1h-1zM7 2h1v1h-1zM1 3h1v1h-1zM2 3h1v1h-1zM3 3h1v1h-1zM5 3h1v1h-1zM6 3h1v1h-1zM7 3h1v1h-1zM0 4h1v1h-1zM1 4h1v1h-1zM2 4h1v1h-1zM3 4h1v1h-1zM4 4h1v1h-1zM5 4h1v1h-1zM6 4h1v1h-1zM7 4h1v1h-1zM0 5h1v1h-1zM1 5h1v1h-1zM3 5h1v1h-1zM4 5h1v1h-1zM5 5h1v1h-1zM7 5h1v1h-1zM0 6h1v1h-1zM1 6h1v1h-1zM2 6h1v1h-1zM3 6h1v1h-1zM4 6h1v1h-1zM5 6h1v1h-1zM6 6h1v1h-1zM7 6h1v1h-1zM1 7h1v1h-1zM2 7h1v1h-1zM3 7h1v1h-1zM5 7h1v1h-1zM6 7h1v1h-1zM7 7h1v1h-1z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM1 0h1v1h-1zM2 0h1v1h-1zM3 0h1v1h-1zM4 0h1v1h-1zM5 0h1v1h-1zM6 0h1v1h-1zM7 0h1v1h-1zM0 1h1v1h-1zM1 1h1v1h-1zM3 1h1v1h-1zM4 1h1v1h-1zM5 1h1v1h-1zM7 1h1v1h-1zM0 2h1v1h-1z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1v1h-1zM2 6h1v1h-1zM3 6h1v1h-1zM4 6h1v1h-1zM5 6h1v1h-1zM6 6h1v1h-1zM7 6h1v1h-1zM0 7h1v1h-1zM1 7h1v1h-1zM2 7h1v1h-1zM3 7h1v1h-1zM4 7h1v1h-1zM5 7h1v1h-1zM6 7h1v1h-1zM7 7h1v1h-1z'/%3E%3C/svg%3E"); }
}
@keyframes sel-despawn {
  0% { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM1 0h1v1h-1zM2 0h1v1h-1zM3 0h1v1h-1zM4 0h1v1h-1zM5 0h1v1h-1zM6 0h1v1h-1zM7 0h1v1h-1zM1 1h1v1h-1zM3 1h1v1h-1zM5 1h1v1h-1zM7 1h1v1h-1zM0 2h1v1h-1zM1 2h1v1h-1zM2 2h1v1h-1zM3 2h1v1h-1zM4 2h1v1h-1zM5 2h1v1h-1zM6 2h1v1h-1zM7 2h1v1h-1zM1 3h1v1h-1zM3 3h1v1h-1zM5 3h1v1h-1zM7 3h1v1h-1zM0 4h1v1h-1zM1 4h1v1h-1zM2 4h1v1h-1zM3 4h1v1h-1zM4 4h1v1h-1zM5 4h1v1h-1zM6 4h1v1h-1zM7 4h1v1h-1zM1 5h1v1h-1zM3 5h1v1h-1zM5 5h1v1h-1zM7 5h1v1h-1zM0 6h1v1h-1zM1 6h1v1h-1zM2 6h1v1h-1zM3 6h1v1h-1zM4 6h1v1h-1zM5 6h1v1h-1zM6 6h1v1h-1zM7 6h1v1h-1zM1 7h1v1h-1zM3 7h1v1h-1zM5 7h1v1h-1zM7 7h1v1h-1z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM1 0h1v1h-1zM2 0h1v1h-1zM3 0h1v1h-1zM4 0h1v1h-1zM5 0h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svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM2 0h1v1h-1zM4 0h1v1h-1zM6 0h1v1h-1zM1 1h1v1h-1zM3 1h1v1h-1zM5 1h1v1h-1zM7 1h1v1h-1zM0 2h1v1h-1zM2 2h1v1h-1zM4 2h1v1h-1zM6 2h1v1h-1zM1 3h1v1h-1zM3 3h1v1h-1zM5 3h1v1h-1zM7 3h1v1h-1zM0 4h1v1h-1zM2 4h1v1h-1zM4 4h1v1h-1zM6 4h1v1h-1zM1 5h1v1h-1zM3 5h1v1h-1zM5 5h1v1h-1zM7 5h1v1h-1zM0 6h1v1h-1zM2 6h1v1h-1zM4 6h1v1h-1zM6 6h1v1h-1zM1 7h1v1h-1zM3 7h1v1h-1zM5 7h1v1h-1zM7 7h1v1h-1z'/%3E%3C/svg%3E"); }
  40% { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM2 0h1v1h-1zM4 0h1v1h-1zM6 0h1v1h-1zM0 2h1v1h-1zM2 2h1v1h-1zM4 2h1v1h-1zM6 2h1v1h-1zM0 4h1v1h-1zM2 4h1v1h-1zM4 4h1v1h-1zM6 4h1v1h-1zM0 6h1v1h-1zM2 6h1v1h-1zM4 6h1v1h-1zM6 6h1v1h-1z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM2 0h1v1h-1zM4 0h1v1h-1zM6 0h1v1h-1zM0 2h1v1h-1zM2 2h1v1h-1zM4 2h1v1h-1zM6 2h1v1h-1zM0 4h1v1h-1zM2 4h1v1h-1zM4 4h1v1h-1zM6 4h1v1h-1zM0 6h1v1h-1zM2 6h1v1h-1zM4 6h1v1h-1zM6 6h1v1h-1z'/%3E%3C/svg%3E"); }
  60% { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM4 0h1v1h-1zM2 2h1v1h-1zM6 2h1v1h-1zM0 4h1v1h-1zM4 4h1v1h-1zM2 6h1v1h-1zM6 6h1v1h-1z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h-1zM4 0h1v1h-1zM2 2h1v1h-1zM6 2h1v1h-1zM0 4h1v1h-1zM4 4h1v1h-1zM2 6h1v1h-1zM6 6h1v1h-1z'/%3E%3C/svg%3E"); }
  80% { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d=''/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d=''/%3E%3C/svg%3E"); }
  100% { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d=''/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cpath d=''/%3E%3C/svg%3E"); }
}
@keyframes sel-pop { 0% { transform: scale(0); } 65% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes sel-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sel-bob { 50% { transform: translateY(-2px); } }
@keyframes sel-breathe { 50% { inset: -10px; } }
@keyframes sel-blink { 50% { opacity: 0; } }
@keyframes sel-blink-long { 72% { opacity: 0; } }
@keyframes sel-chase {
  0% { text-shadow: 0 1px 0 var(--event), 0 2px 0 var(--warn), 0 3px 0 var(--accent), 0 4px 0 var(--info), 0 5px 0 var(--ink), 0 6px 0 var(--ink); }
  25% { text-shadow: 0 1px 0 var(--info), 0 2px 0 var(--event), 0 3px 0 var(--warn), 0 4px 0 var(--accent), 0 5px 0 var(--ink), 0 6px 0 var(--ink); }
  50% { text-shadow: 0 1px 0 var(--accent), 0 2px 0 var(--info), 0 3px 0 var(--event), 0 4px 0 var(--warn), 0 5px 0 var(--ink), 0 6px 0 var(--ink); }
  75% { text-shadow: 0 1px 0 var(--warn), 0 2px 0 var(--accent), 0 3px 0 var(--info), 0 4px 0 var(--event), 0 5px 0 var(--ink), 0 6px 0 var(--ink); }
}
@keyframes sel-bang { 0% { transform: scale(0); } 60% { transform: scale(1.16); } 100% { transform: none; } }
@keyframes sel-swap { 0% { transform: translateY(6px); filter: brightness(2.2); } 100% { transform: none; filter: none; } }
/* the deck joystick fidgets now and then while nobody is steering */
@keyframes sel-joy-idle { 0%, 78% { background-position: -128px 0; } 80% { background-position: -192px 0; } 83% { background-position: -128px 0; } 86% { background-position: -64px 0; } 89%, 100% { background-position: -128px 0; } }
/* avatar idle: hold, blink, smile, wink. --av is one frame at the drawn scale */
@keyframes sel-av { 0%, 56% { background-position: 0 0; } 57%, 66% { background-position: calc(var(--av) * -1) 0; } 67%, 80% { background-position: calc(var(--av) * -2) 0; } 81%, 100% { background-position: calc(var(--av) * -3) 0; } }
@keyframes sel-egg { to { background-position: -256px 0; } }
@keyframes sel-spin { to { background-position: -192px 0; } }
@keyframes sel-hover { 50% { top: 4px; } }
@keyframes sel-drop-coin { 0% { top: 6px; } 100% { top: 42px; } }
@keyframes sel-glow { 0% { opacity: 1; } 50% { opacity: .5; } 100% { opacity: 1; } }
@keyframes sel-door { 50% { filter: brightness(1.35); } }

/* ---------- Coin drop on the Book buttons (anywhere on the site) ---------- */
.coinfx { position: fixed; z-index: 195; width: 32px; height: 46px; overflow: hidden; pointer-events: none; }
.coinfx i {
  position: absolute; left: 0; top: 0; width: 32px; height: 32px;
  background: url(/assets/px/coin-spin.png) 0 0 / 192px 32px no-repeat; image-rendering: pixelated;
  animation: sel-spin .3s steps(6) infinite, coinfx-drop .2s steps(5) forwards;
}
@keyframes coinfx-drop { 0% { top: -4px; } 20% { top: 2px; } 100% { top: 48px; } }
.btn--arcade.is-coin { animation: coinfx-flash .12s steps(2) .08s; }
@keyframes coinfx-flash {
  0% { background: color-mix(in srgb, var(--accent) 55%, #fff); box-shadow: 0 5px 0 var(--e), 0 0 0 3px color-mix(in srgb, var(--warn) 70%, transparent), 0 0 22px color-mix(in srgb, var(--accent) 60%, transparent); }
  100% { background: var(--accent); }
}

/* ---------- Narrower desktops ---------- */
@media (max-width: 1180px) {
  .sel__name { font-size: 16.5px; }
  .sel__book { font-size: 16.5px; }
}
@media (max-width: 899px) {
  .sel__body { grid-template-columns: minmax(0, 1fr); }
  .sel__pv { display: none; }
  .sel__tile { height: 124px; }
}

/* ---------- Phones: a full-screen select screen ---------- */
@media (max-width: 699px) {
  .sel { bottom: 0; overflow-y: auto; overscroll-behavior: contain; border-bottom: 0; }
  .sel__screen { min-height: 100%; }
  .sel__in { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .sel__top { flex: none; }
  .sel__title { font-size: 22px; }
  .sel__hud { position: static; height: auto; justify-content: space-between; gap: 12px; padding: 10px 0 12px; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
  .sel__hud .sel__close { padding: 8px 10px 7px; }
  .sel__hud button { min-height: 44px; }
  .sel__esc { display: none; }
  .sel__x { display: inline; }
  .sel__body { display: flex; flex-direction: column; flex: 1; padding-top: 0; }
  .sel__main { display: flex; flex-direction: column; flex: 1; }
  .sel__grid { --head: 50px; }
  .sel__marq { bottom: calc(100% + 18px); }
  .sel__tiles { grid-template-columns: 1fr 1fr; gap: 24px 12px; }
  .sel__tiles > li:last-child { grid-column: 1 / -1; }
  .sel__tile { height: auto; min-height: 118px; gap: 10px; padding: 14px 6px 14px; }
  .sel__name { font-size: 22px; }
  .sel__bang { display: none; }
  .sel__bottom { flex-direction: column; align-items: stretch; margin-top: auto; padding-top: 38px; min-height: 0; }
  .sel__stick, .sel__egg, .sel__door { display: none; }
  .sel__coin {
    --e: color-mix(in srgb, var(--accent) 55%, #000);
    position: relative; margin: 0 0 5px; justify-content: center; align-items: center; min-height: 64px; padding: 10px 16px;
    color: var(--accent-ink); background: var(--accent); box-shadow: 0 5px 0 var(--e);
  }
  .sel__coin:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--e); }
  .sel__cointxt { justify-items: center; gap: 8px; padding: 0; }
  .sel__insert { color: var(--accent-ink); }
  .sel__book, .sel__coin:hover .sel__book, .sel__coin.is-drop .sel__book { color: var(--accent-ink); font-size: 22px; }
  .sel__coin.is-coin { animation: coinfx-flash .12s steps(2) .08s; }
}
@media (max-width: 359px) {
  .sel__name, .sel__book { font-size: 16.5px; }
  .sel__hud { font-size: 11px; letter-spacing: .06em; }
}
@media (forced-colors: active) and (max-width: 699px) { .sel__coin { border: 2px solid ButtonText; } }
