/* Tobeads — PIXEL ARCADE design system
   Palette: violet #7F00FF · navy #000080 · black #000 · white #FFF (only).
   Homepage sections use soft “retro handheld” radii (--hh-r-*). */

:root {
  /* retro handheld corner radii (Game Gear / GBA shell feel) */
  --hh-r-xs:  5px;
  --hh-r-sm:  8px;
  --hh-r-md:  12px;
  --hh-r-lg:  18px;
  --hh-r-xl:  24px;
  --hh-r-shell: 28px;
  --hh-r-pill: 999px;
  --v:  #7F00FF;   /* violet */
  --v2: #9B3DFF;   /* lighter violet for hover/glow */
  --v3: #B775FF;   /* highlight violet */
  --vd: #4D0099;   /* darker violet shadow */
  --vd2:#2E005C;   /* deepest violet */
  --n:  #000080;   /* navy */
  --n2: #1A1AB0;   /* lighter navy */
  --n3: #2E2ED8;   /* bright navy */
  --nd: #00004A;   /* deep navy */
  --bk: #000000;
  --wh: #FFFFFF;
  --gray: #B8B8D0;     /* muted text = desaturated violet-white */
  --gray2: #6E6E9A;
  --line: #2A2A55;     /* faint navy grid line */
  --glow: rgba(127,0,255,0.55);

  /* controlled arcade accents (used sparingly) */
  --ylw: #FFD23D;      /* arcade yellow — key CTAs/highlights */
  --cyn: #2DE1FF;      /* cyan glow — game UI accents */
  --pnk: #FF4FC3;      /* magenta/pink — bead dots / active states */

  /* light surfaces (premium negative space) */
  --lt:  #EEF0FB;      /* soft light blue-gray section bg */
  --lt2: #FFFFFF;      /* pure white */
  --lt3: #E2E5F6;      /* slightly deeper light for borders/fills */
  --ink: #14143A;      /* near-navy ink for text on light */
  --ink2:#4A4A78;      /* muted ink on light */
  --lline-lt: #D5D8EE; /* light grid line */

  /* classic arcade hardware colors (controls) */
  --red:  #E83B3B;     /* arcade red — ball top / start */
  --red2: #FF5A5A;     /* red highlight */
  --redd: #9E1B1B;     /* red shadow */
  --blu:  #2D6FE0;     /* arcade blue button */
  --joybk:#15151C;     /* joystick base black */

  /* classic arcade CABINET body (charcoal + metallic gray, cyan screen) */
  --cab-body:  #17171C;   /* charcoal cabinet body */
  --cab-body2: #202028;   /* lighter charcoal */
  --cab-frame: #3A3A44;   /* metallic gray frame */
  --cab-frame2:#56565F;   /* metallic highlight */
  --cab-frameD:#0D0D11;   /* frame deep shadow */
  --cab-edge:  #060608;   /* near-black edge */
  --scr-cyan:  #2DE1FF;   /* CRT cyan screen glow */
  --scr-blue:  #2D6FE0;   /* electric blue screen lines */
  --scr-cyanG: rgba(45,225,255,0.55);

  /* VIOLET 3D cabinet body (matches product-render look) */
  --cv-lit:   #A24DFF;   /* top-lit violet highlight */
  --cv-body:  #7C1FE8;   /* main violet body */
  --cv-mid:   #6614C9;   /* body mid */
  --cv-dark:  #4C0C9C;   /* shaded side / lower */
  --cv-edge:  #33067A;   /* deepest violet edge */
  --cv-line:  #2A0566;   /* seam line */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body.arcade {
  background-color: var(--lt);
  color: var(--ink);
  background-image:
    linear-gradient(var(--lline-lt) 1px, transparent 1px),
    linear-gradient(90deg, var(--lline-lt) 1px, transparent 1px);
  background-size: 28px 28px;
  background-attachment: fixed;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  /* guard against sideways scroll from pixel shadows / 3D side panels on mobile.
     `clip` (not hidden) avoids turning <body> into a scroll container. */
  overflow-x: clip;
}
/* Scroll lock while intro / boot / mobile menu — overflow alone fails on iOS Safari */
html.no-scroll,
body.arcade.no-scroll {
  overflow: hidden !important;
  height: 100%;
  overscroll-behavior: none;
  touch-action: none;
}
body.arcade.no-scroll {
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
}
.aw-stage-entry {
  position: fixed;
  inset: 0;
  z-index: 9998;
  overflow: hidden;
}
.arcade ::selection { background: var(--v); color: var(--wh); }

/* ---- Fonts ---- */
.px      { font-family: 'Press Start 2P', monospace; line-height: 1.5; }
.aw-disp { font-family: 'Space Grotesk', sans-serif; font-weight: 700; letter-spacing: -0.03em; }
.aw-mono { font-family: 'Press Start 2P', monospace; }
.aw-pixel{ font-family: 'Press Start 2P', monospace; }

button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1,h2,h3,h4 { margin: 0; }
p { margin: 0; }

/* ===== Pixel grid backdrop ===== */
.aw-stage { position: relative; background: transparent; }
.aw-grid-bg {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: center top;
}
.aw-grid-bg-fade {
  position: relative;
}
.aw-grid-bg-fade::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 75%);
  opacity: 0.7;
}

/* scanline overlay — scoped to dark arcade screens only (not whole page) */
.aw-screen::after, .cart-scan::after { /* defined per-component below */ }
body.arcade.no-scan .aw-screen::after { display: none; }
body.arcade.reduce-motion .aw-screen::after { display: none; }

/* ============ PIXEL PRIMITIVES ============ */

/* Hard pixel border using layered box-shadow (true blocky corners) */
.pxl {
  position: relative;
  background: var(--bk);
  border: 3px solid var(--v);
  box-shadow:
    0 0 0 3px var(--bk),
    0 0 0 6px var(--n);
}
.pxl-flat {
  background: var(--bk);
  border: 3px solid var(--v);
}
.pxl-navy { background: var(--n); border: 3px solid var(--v); }

/* corner ticks — tiny pixel squares at the four corners */
.pxl-corners::before, .pxl-corners::after,
.pxl-corners > .cnr-tl, .pxl-corners > .cnr-tr {
  content: ""; position: absolute; width: 6px; height: 6px; background: var(--wh); z-index: 2;
}
.pxl-corners::before { top: -3px; left: -3px; }
.pxl-corners::after  { top: -3px; right: -3px; }
.pxl-corners > .cnr-bl { content:""; position:absolute; width:6px; height:6px; background: var(--wh); bottom: -3px; left: -3px; }
.pxl-corners > .cnr-br { content:""; position:absolute; width:6px; height:6px; background: var(--wh); bottom: -3px; right: -3px; }

/* ===== Pixel buttons ===== */
.pbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  padding: 16px 22px;
  color: var(--wh);
  background: var(--bk);
  border: 3px solid var(--v);
  box-shadow: 4px 4px 0 0 var(--n);
  border-radius: var(--hh-r-md);
  transition: none;
  text-transform: uppercase;
}
.pbtn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 0 var(--n); background: var(--v); }
.pbtn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 0 var(--n); }
.pbtn-v { background: var(--v); border-color: var(--wh); box-shadow: 4px 4px 0 0 var(--n); }
.pbtn-v:hover { background: var(--v2); }
.pbtn-lg { font-size: 14px; padding: 20px 28px; }
.pbtn-sm { font-size: 10px; padding: 11px 14px; box-shadow: 3px 3px 0 0 var(--n); }
.pbtn-sm:hover { transform: translate(2px,2px); box-shadow: 1px 1px 0 0 var(--n); }
.pbtn-ghost { background: var(--bk); border-color: var(--n2); box-shadow: 4px 4px 0 0 var(--n); }
.pbtn-ghost:hover { background: var(--n); border-color: var(--v); }

/* blink */
.blink { animation: aw-blink 1s steps(1) infinite; }
@keyframes aw-blink { 50% { opacity: 0; } }
.arcade.reduce-motion .blink { animation: none; }

/* arcade eyebrow / HUD label */
.aw-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gray);
}
.aw-eyebrow .blk { width: 8px; height: 8px; background: var(--v); box-shadow: 0 0 8px var(--v); border-radius: var(--hh-r-xs); }

/* small label chips (BEADS, timers, tags on light sections) */
.hh-badge {
  border-radius: var(--hh-r-sm);
}

/* small pixel bead dot */
.beaddot { width: 10px; height: 10px; border-radius: 999px; background: var(--v); }

/* ============ BOOT LOADER ============ */
.boot {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--bk);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 26px; overflow: hidden;
}
.boot::before { /* scanlines */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(0,0,0,0) 50%, rgba(0,0,0,0.35) 50%);
  background-size: 100% 3px; opacity: 0.5;
}
.boot.flicker { animation: boot-flicker 2.4s steps(1) both; }
@keyframes boot-flicker {
  0% { opacity: 0; }
  2% { opacity: 1; }
  4% { opacity: 0.2; }
  6% { opacity: 1; }
  9% { opacity: 0.6; }
  11% { opacity: 1; }
  100% { opacity: 1; }
}
/* CRT power-on horizontal line */
.boot-crt {
  position: absolute; left: 0; right: 0; top: 50%; height: 3px; background: var(--wh);
  box-shadow: 0 0 20px 4px var(--wh);
  animation: crt-open 0.5s cubic-bezier(.5,0,.5,1) forwards;
}
@keyframes crt-open {
  0% { transform: scaleX(0.02); opacity: 1; }
  60% { transform: scaleX(1); height: 3px; opacity: 1; }
  100% { transform: scaleY(140); opacity: 0; height: 3px; }
}
.boot-glow {
  position: absolute; width: 70vmax; height: 70vmax; border-radius: 999px;
  background: radial-gradient(circle, rgba(127,0,255,0.18), rgba(0,0,128,0.12) 45%, transparent 70%);
  animation: boot-pulse 1.2s ease-in-out infinite;
}
@keyframes boot-pulse { 0%,100% { opacity: 0.5; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.05); } }
.boot-noise {
  position: absolute; inset: 0; width: 100%; height: 100%;
  image-rendering: pixelated; opacity: 0.5; pointer-events: none; z-index: 1; mix-blend-mode: screen;
}
.arcade.reduce-motion .boot-noise { display: none; }
.boot-lines { position: relative; z-index: 2; text-align: center; display: flex; flex-direction: column; gap: 14px; }
.boot-line { font-family: 'Press Start 2P', monospace; font-size: 12px; color: var(--gray); }
.boot-line.on { color: var(--wh); text-shadow: 0 0 10px var(--v); }
.boot-bar {
  position: relative; z-index: 2;
  width: 280px; max-width: 70vw; height: 16px;
  border: 3px solid var(--v); background: var(--bk);
}
.boot-bar > i { display: block; height: 100%; background: var(--v); box-shadow: 0 0 12px var(--v); width: 0; }
.boot-pct { font-family:'Press Start 2P', monospace; font-size: 10px; color: var(--gray2); z-index: 2; }

/* wordmark assemble blocks */
.boot-mark { position: relative; z-index: 2; }

/* autoplay-safe sound prompt */
.boot-sound {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 3; cursor: pointer;
  font-size: 9px; color: var(--wh);
  background: var(--v); border: 3px solid var(--wh);
  padding: 10px 16px; box-shadow: 4px 4px 0 var(--n), 0 0 18px var(--glow);
  display: flex; align-items: center; gap: 8px;
  animation: bs-pulse 1.1s steps(2) infinite;
}
.boot-sound .bs-spk { color: var(--ylw); }
@keyframes bs-pulse { 0%,100% { box-shadow: 4px 4px 0 var(--n), 0 0 18px var(--glow); } 50% { box-shadow: 4px 4px 0 var(--n), 0 0 30px var(--v3); } }

/* ============ TOBEADS WORDMARK (pixel SVG art — assets/TobeadsWordlogo.svg) ====
   The SVG is injected inline; its white glyphs are recolored to currentColor so
   the wordmark adapts to the background (white on dark, ink on light) while the
   red accent stays fixed. */
.tobeads-logo { display: inline-flex; align-items: center; line-height: 0; color: var(--wh); }
.tobeads-logo svg { height: 100%; width: auto; display: block; }
.tobeads-logo svg path[fill="white"] { fill: currentColor; }
.tobeads-logo.on-light { color: var(--ink); }
@keyframes logo-in { 0% { opacity: 0; transform: translateY(-16px) scale(1.18); } 100% { opacity: 1; transform: none; } }
.tobeads-logo.boot-wordmark { animation: logo-in .5s steps(6) both; }
.arcade.reduce-motion .tobeads-logo.boot-wordmark { animation: none; }

/* legacy text wordmark classes retained for any external references */
.tobeads-mark { font-family: 'Press Start 2P', monospace; display: inline-flex; align-items: center; line-height: 1; letter-spacing: 0.02em; white-space: nowrap; }
.tb-nav { font-family:'Press Start 2P', monospace; font-size: 14px; }

/* ============ HIDDEN TOP NAV (pixel HUD) ============ */
.aw-navzone { position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 70; }
.aw-hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 71;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 18px;
  background: var(--bk);
  border-bottom: 3px solid var(--v);
  box-shadow: 0 3px 0 0 var(--n);
  transform: translateY(-110%);
  transition: transform .18s steps(3);
}
.aw-hud.show { transform: translateY(0); }
.aw-hud-links { display: flex; align-items: center; gap: 2px; }
.aw-hud-link {
  font-family:'Press Start 2P', monospace; font-size: 9px; color: var(--gray);
  padding: 10px 12px; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px;
}
.aw-hud-link:hover { color: var(--wh); background: var(--v); }
.aw-hud-link.on { color: var(--v); }
.aw-hud-link.on::before { content: "▸"; color: var(--v); }

.aw-navpeek {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  z-index: 69; display: flex; gap: 4px; align-items: center;
  padding: 7px 12px 8px; background: var(--bk);
  border: 3px solid var(--v); border-top: none;
  transition: opacity .2s ease;
}
.aw-navpeek .dot { width: 6px; height: 6px; background: var(--v); }
.aw-navpeek .dot:nth-child(2){ background: var(--n2); }
.aw-navpeek .dot:nth-child(3){ background: var(--wh); }

.aw-mob-btn {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
  z-index: 72;
  width: 46px; height: 46px;
  background: var(--bk); border: 3px solid var(--v); color: var(--wh);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 3px 3px 0 var(--n);
}
.aw-mob-overlay {
  position: fixed; inset: 0; z-index: 90; background: var(--bk);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.aw-mob-link { font-family:'Press Start 2P', monospace; font-size: 18px; color: var(--wh); padding: 14px 0; }
.aw-mob-link .n { color: var(--v); margin-right: 16px; }
.aw-mob-link:active { color: var(--v); }

/* ============ ARCADE CABINET — coherent charcoal 3D machine ============ */
/* the cabinet is a real 3D object turned slightly (perspective comes from parent) */
/* The whole machine: one connected upright object, turned a few degrees so the
   right side panel reads as real thickness. All sub-sections are flush so the
   silhouette stays a single continuous body (no floating slabs / seams). */
.cab3d {
  position: relative; width: 100%; margin: 0 auto;
  transform: rotateY(-5deg);
  transform-style: preserve-3d;
}

/* ONE continuous right-hand side panel = honest cabinet depth, flush to the body
   from the marquee cap down to the base, skewed so it recedes into the scene. */
.cab-side {
  position: absolute; z-index: 1; pointer-events: none;
  top: 14px; bottom: 16px;
  right: clamp(-30px, -3.2vw, -16px);
  width: clamp(18px, 3.2vw, 32px);
  background: linear-gradient(180deg, #17171D 0%, #0C0C11 55%, #050507 100%);
  transform: skewY(7deg);
  border-radius: 0 12px 14px 0;
  box-shadow:
    inset 12px 0 24px rgba(0,0,0,0.9),
    8px 12px 26px rgba(0,0,0,0.45);
}
/* brand seam line where the side wraps to the front face */
.cab-side::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, var(--v) 0%, transparent 65%);
  opacity: 0.55;
}

/* the cabinet front face: tall, matte-black, rounded shoulders */
.cab {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  transform-style: preserve-3d;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 13%, rgba(255,255,255,0.045) 50%, rgba(0,0,0,0) 80%, rgba(0,0,0,0.5) 100%),
    linear-gradient(180deg, #24242B 0%, #181820 50%, #0E0E13 100%);
  border-radius: 26px 26px 10px 10px;
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,0.10),
    inset 2px 0 0 rgba(255,255,255,0.05),
    inset -3px 0 0 rgba(0,0,0,0.5),
    0 30px 54px rgba(0,0,0,0.5);
}
/* front-left edge bevel highlight → roundness on the near corner */
.cab::after {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; z-index: 3;
  background: linear-gradient(180deg, rgba(255,255,255,0.16), transparent 72%);
  border-radius: 26px 0 0 8px; pointer-events: none;
}

/* ===== MARQUEE — a real head-box with a forward-tilted top cap (thickness) ===== */
.cab-marquee {
  position: relative; z-index: 4;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(9px, 1.5vh, 15px) 18px;
  background:
    radial-gradient(130% 180% at 50% 125%, rgba(127,0,255,0.22), transparent 70%),
    linear-gradient(180deg, #232330 0%, #15151D 60%, #0C0C11 100%);
  border-radius: 26px 26px 4px 4px;
  border-bottom: 3px solid #050507;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.14),
    inset 0 -12px 18px rgba(0,0,0,0.5),
    0 6px 14px rgba(0,0,0,0.5);
}
/* forward-facing top surface = marquee depth */
.cab-marquee::before {
  content: ""; position: absolute; left: 8px; right: 8px; top: clamp(-15px, -1.7vh, -9px);
  height: clamp(9px, 1.5vh, 16px);
  background: linear-gradient(180deg, #34343F 0%, #20202A 70%, #15151C 100%);
  border-radius: 16px 16px 2px 2px;
  transform: perspective(300px) rotateX(34deg);
  transform-origin: bottom center;
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.2), 0 8px 12px rgba(0,0,0,0.45);
}
.cab-marquee .px { font-size: 9px; color: var(--wh); text-shadow: 0 0 8px var(--v); }
.cab-bulbs { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); display: flex; gap: 6px; }
.cab-bulb { width: 7px; height: 7px; border-radius: 999px; background: var(--scr-cyan); box-shadow: 0 0 8px var(--scr-cyan); }
.cab-bulb:nth-child(2){ animation: bulb 1.2s steps(1) .2s infinite; }
.cab-bulb:nth-child(3){ animation: bulb 1.2s steps(1) .4s infinite; }
.cab-bulb:nth-child(1){ animation: bulb 1.2s steps(1) 0s infinite; }
@keyframes bulb { 50% { background: var(--v); box-shadow: none; } }
.arcade.reduce-motion .cab-bulb { animation: none; }

/* lit nameplate / wordmark inside the marquee */
.cab-nameplate {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(8px, 1.1vw, 11px);
  color: var(--wh);
  letter-spacing: 0.16em;
  text-shadow: 0 0 6px var(--scr-cyan), 0 0 16px var(--v);
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

/* ===== upper body that carries the recessed monitor ===== */
.cab-head {
  position: relative; z-index: 2;
  padding: clamp(12px, 1.8vh, 18px) clamp(14px, 2.4vw, 22px) clamp(10px, 1.4vh, 14px);
}

/* recessed monitor housing — thick frame the CRT visibly sinks into */
.cab-bezel {
  position: relative; z-index: 2;
  padding: clamp(12px, 1.8vh, 20px);
  background: linear-gradient(180deg, #1A1A20 0%, #0C0C11 100%);
  border-radius: 16px;
  border: 3px solid #050507;
  box-shadow:
    inset 0 8px 18px rgba(0,0,0,0.98),
    inset 0 -4px 10px rgba(255,255,255,0.05),
    inset 0 0 0 2px #1E1E26,
    0 12px 26px rgba(0,0,0,0.72);
}

/* CRT screen — sunk inside the bezel, glass + cyan glow */
.aw-screen {
  position: relative; z-index: 2; overflow: hidden;
  background: radial-gradient(120% 120% at 50% 35%, #02121C, #000 78%);
  border: 4px solid #07070A;
  box-shadow:
    inset 0 0 0 2px var(--scr-blue),
    inset 0 0 44px rgba(0,0,0,0.92),
    inset 0 8px 22px rgba(0,0,0,0.95),
    0 0 22px var(--scr-cyanG);
  border-radius: 16px / 22px;   /* gentle CRT bow */
  filter: drop-shadow(0 0 8px rgba(45, 225, 255, 0.25));
}
.aw-screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 4;
  background: linear-gradient(rgba(0,0,0,0) 50%, rgba(0,0,0,0.22) 50%);
  background-size: 100% 3px; opacity: 0.5;
}
.aw-screen::before { /* glass vignette + cyan glare */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(45,225,255,0.12), transparent 50%),
    linear-gradient(120deg, rgba(255,255,255,0.07), transparent 28%);
  box-shadow: inset 0 0 50px rgba(0,0,0,0.7);
}
body.no-scan .aw-screen::after, .arcade.reduce-motion .aw-screen::after { display: none; }
.aw-screen-hud {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6;
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; font-family:'Press Start 2P', monospace; font-size: 9px;
  pointer-events: none;
}

/* CRT inner safe zone container to isolate flex boundaries & padding */
.screen-padding {
  position: absolute;
  inset: 0;
  padding: clamp(28px, 4.4vh, 40px) clamp(14px, 2.2vw, 24px) clamp(14px, 2.4vh, 24px);
  box-sizing: border-box;
  z-index: 2;
}

/* Viewport inside screen-padding that ensures the maze fits perfectly and is not cropped */
.maze-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.maze-viewport canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
}
.maze-viewport canvas.maze-canvas--full { aspect-ratio: 13 / 15; }
.maze-viewport canvas.maze-canvas--fit { aspect-ratio: unset !important; object-fit: unset !important; }
.maze-viewport canvas.maze-canvas--compact { aspect-ratio: 1 / 1; }

/* structural lip where the screen body meets the control deck — spans full width
   so the two halves read as one molded body, never a gap. */
.deck-joint {
  position: relative; z-index: 5;
  height: clamp(10px, 1.4vh, 16px);
  background:
    linear-gradient(90deg, rgba(0,0,0,0.6), transparent 15%, transparent 85%, rgba(0,0,0,0.6)),
    linear-gradient(180deg, #43434F 0%, #20202A 46%, #07070A 100%);
  border-top: 2px solid #54545F;
  box-shadow: 0 8px 14px rgba(0,0,0,0.6), inset 0 -3px 6px rgba(0,0,0,0.82);
}

/* ============ CONTROL DECK — slanted panel that juts out of the body ============ */
.deck-3d {
  position: relative; z-index: 6;
  transform-style: preserve-3d;
  transform: perspective(1100px) rotateX(22deg);
  transform-origin: top center;
}
.deck-top {
  position: relative; z-index: 2;
  padding: clamp(12px, 1.9vh, 20px) clamp(16px, 3.2vw, 26px) clamp(10px, 1.6vh, 16px);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(8px, 1.8vw, 18px);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0) 22%, rgba(0,0,0,0.34) 100%),
    repeating-linear-gradient(135deg, #20202A 0 6px, #15151B 6px 12px);
  border-top: 3px solid #3A3A46;
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,0.10),
    inset 0 12px 20px rgba(0,0,0,0.6);
}
/* vertical front face of the deck (drops toward the lower body) */
.deck-front {
  position: absolute;
  left: 0; right: 0; bottom: calc(-1 * clamp(20px, 3vh, 32px));
  height: clamp(20px, 3vh, 32px);
  background: linear-gradient(180deg, #18181F 0%, #08080C 100%);
  border-top: 2px solid #2C2C36;
  transform-origin: top center;
  transform: rotateX(-90deg);
  box-shadow: 0 16px 30px rgba(0,0,0,0.85), inset 0 2px 0 rgba(255,255,255,0.06);
  z-index: 1;
}
/* side faces connecting the deck to the cabinet sides */
.deck-side-l, .deck-side-r {
  position: absolute; top: 0; bottom: calc(-1 * clamp(20px, 3vh, 32px));
  width: clamp(16px, 2.4vw, 26px);
  background: linear-gradient(180deg, #1A1A22, #0A0A0E);
  z-index: 1;
}
.deck-side-l { left: 0; transform-origin: left center; transform: rotateY(-90deg); }
.deck-side-r { right: 0; transform-origin: right center; transform: rotateY(90deg); }
.deck-top > * { transform: translateZ(2px); }
.deck-label { font-family:'Press Start 2P', monospace; font-size: 7px; color: var(--gray2); text-align: center; margin-top: 9px; letter-spacing: 0.06em; }

/* deep circular sockets to mount the control components */
.joy-socket {
  position: relative;
  width: clamp(96px, 15vw, 114px);
  height: clamp(100px, 16vh, 120px);
  border-radius: 12px;
  background: radial-gradient(circle at 50% 30%, #060608 0%, #0F0F14 60%, #1F1F2A 100%);
  border: 3px solid #030304;
  box-shadow:
    inset 0 6px 12px rgba(0,0,0,0.98),
    0 3px 6px rgba(0,0,0,0.4),
    0 1px 0 rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.start-btn-socket {
  position: relative;
  display: inline-flex;
  padding: clamp(6px, 1.2vw, 10px);
  background: radial-gradient(circle at 50% 30%, #030304 0%, #121218 65%, #22222E 100%);
  border: 4px solid #000;
  border-radius: 999px;
  box-shadow:
    inset 0 4px 8px rgba(0,0,0,0.9),
    0 3px 5px rgba(0,0,0,0.4),
    0 1px 0 rgba(255,255,255,0.05);
}

/* ball-top joystick — classic black base, red ball, deep mounting socket */
.joy { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.joy::before { display: none; } /* Socket handles depth now */
.joy-base {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 76px; height: 30px;
  background: radial-gradient(circle at 50% 28%, #34343C, #0A0A0E 75%);
  border: 3px solid #000;
  border-radius: 50%;
  box-shadow: 0 8px 12px rgba(0,0,0,0.8), 0 4px 0 #000, inset 0 -5px 8px rgba(0,0,0,0.95), inset 0 3px 5px rgba(255,255,255,0.22);
  touch-action: none; z-index: 1;
}
.joy-shaft {
  position: absolute; bottom: 22px; left: 50%;
  width: 13px; height: 46px; margin-left: -6.5px;
  background: linear-gradient(90deg, #1A1A1E, #C8C8D2 42%, #6A6A74 60%, #141418);
  box-shadow: inset 0 0 2px rgba(255,255,255,0.4);
  transform-origin: bottom center;
  transition: transform .08s steps(2);
  z-index: 2;
}
.joy-ball {
  position: absolute; top: 6px; left: 50%;
  width: 48px; height: 48px; margin-left: -24px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 36% 28%, #FFA0A0 0 12%, var(--red2) 30%, var(--red) 55%, var(--redd) 100%);
  border: 3px solid #1A0606;
  box-shadow:
    0 8px 12px rgba(0,0,0,0.55),
    0 0 18px rgba(232,59,59,0.5),
    inset -5px -6px 10px rgba(0,0,0,0.55),
    inset 4px 4px 8px rgba(255,255,255,0.5);
  transform-origin: center bottom;
  transition: transform .08s steps(2);
  cursor: grab; touch-action: none;
  z-index: 3;
}
.joy-ball:active { cursor: grabbing; }
.joy-ball::after { /* pixel glint */
  content: ""; position: absolute; top: 9px; left: 11px; width: 8px; height: 8px; background: var(--wh); opacity: 0.95;
}

/* big tactile START button — classic arcade red, deep socket */
.start-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.start-btn {
  position: relative;
  width: 90px; height: 90px;
  border-radius: 999px;
  border: 4px solid var(--wh);
  background:
    radial-gradient(circle at 50% 30%, #FF8F8F 0 30%, var(--red2) 50%, var(--red) 70%, var(--redd) 100%);
  color: var(--wh);
  font-family:'Press Start 2P', monospace; font-size: 12px;
  box-shadow:
    0 0 0 5px #0C0C10,
    0 12px 14px rgba(0,0,0,0.55),
    0 9px 0 var(--redd),
    inset 0 -4px 8px rgba(0,0,0,0.45),
    inset 4px 4px 9px rgba(255,255,255,0.5),
    0 0 22px rgba(232,59,59,0.5);
  transition: transform .06s steps(1), box-shadow .06s steps(1);
  text-shadow: 0 2px 0 var(--redd);
}
.start-btn:hover {
  background: radial-gradient(circle at 50% 30%, #FFB0B0 0 30%, #FF7A7A 50%, var(--red2) 70%, var(--red) 100%);
  box-shadow: 0 0 0 5px #0C0C10, 0 12px 14px rgba(0,0,0,0.55), 0 9px 0 var(--redd), inset 4px 4px 9px rgba(255,255,255,0.5), 0 0 36px var(--red2);
}
.start-btn.press, .start-btn:active {
  transform: translateY(8px) scale(0.95);
  box-shadow:
    0 0 0 5px #050508,
    0 2px 4px rgba(0,0,0,0.7),
    0 1px 0 var(--redd),
    inset 0 6px 10px rgba(0,0,0,0.8),
    0 0 24px rgba(255,90,90,0.4);
}
.start-ring { position: absolute; inset: -10px; border: 3px dashed var(--ylw); border-radius: 999px; opacity: 0.6; animation: ring-spin 8s linear infinite; }
@keyframes ring-spin { to { transform: rotate(360deg); } }
.arcade.reduce-motion .start-ring { animation: none; }
.start-label { font-family:'Press Start 2P', monospace; font-size: 7px; color: var(--red); }

/* entry START — larger, pulsing, blinking ring, clear call to action */
.cab-xl .start-btn { width: 104px; height: 104px; font-size: 13px; animation: start-pulse 1.3s ease-in-out infinite; }
.cab-xl .start-btn:hover, .cab-xl .start-btn.press { animation: none; }
.cab-xl .start-ring {
  inset: -12px;
  border-width: 4px;
  border-style: dashed;
  border-color: var(--ylw);
  animation: ring-spin 12s linear infinite, ring-pulse-blink 2.2s ease-in-out infinite;
}
.cab-xl .start-label { font-size: 8px; }
@keyframes start-pulse {
  0%, 100% { box-shadow: 0 0 0 5px #0C0C10, 0 12px 14px rgba(0,0,0,0.55), 0 9px 0 var(--redd), inset 0 -4px 8px rgba(0,0,0,0.45), inset 4px 4px 9px rgba(255,255,255,0.5), 0 0 22px rgba(232,59,59,0.5); }
  50% { box-shadow: 0 0 0 5px #0C0C10, 0 12px 14px rgba(0,0,0,0.55), 0 9px 0 var(--redd), inset 0 -4px 8px rgba(0,0,0,0.45), inset 4px 4px 9px rgba(255,255,255,0.5), 0 0 40px rgba(255,90,90,0.9); }
}
@keyframes ring-pulse-blink {
  0%, 100% { opacity: 0.95; transform: scale(1); filter: drop-shadow(0 0 8px var(--ylw)); }
  50% { opacity: 0.2; transform: scale(1.05); filter: drop-shadow(0 0 2px var(--ylw)); }
}
.arcade.reduce-motion .cab-xl .start-btn { animation: none; }
.arcade.reduce-motion .cab-xl .start-ring { animation: ring-spin 8s linear infinite; }

/* secondary arcade buttons cluster — recessed sockets + glossy raised tops */
.btn-cluster { display: grid; grid-template-columns: repeat(2, 30px); grid-template-rows: repeat(2, 30px); gap: 12px; }
.arc-btn {
  position: relative;
  width: 30px; height: 30px; border-radius: 999px;
  border: 2px solid #0A0A0A;
  /* outer ring = socket rim sunk into the panel; inner = glossy dome */
  box-shadow:
    0 0 0 4px #08080C,
    0 2px 0 4px #1A1A22,
    0 8px 10px rgba(0,0,0,0.8),
    0 6px 0 #000,
    inset 0 -4px 6px rgba(0,0,0,0.65),
    inset 3px 3px 5px rgba(255,255,255,0.6);
  transition: transform .06s steps(1), box-shadow .06s steps(1);
}
.arc-btn::after { /* pixel gloss highlight */
  content: ""; position: absolute; top: 5px; left: 6px; width: 7px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.7);
}
.arc-btn.red    { background: radial-gradient(circle at 38% 28%, #FF8585, var(--red) 55%, var(--redd)); }
.arc-btn.blue   { background: radial-gradient(circle at 38% 28%, #7FB4FF, #2D6FE0 55%, #143F9E); }
.arc-btn.yellow { background: radial-gradient(circle at 38% 28%, #FFEFA0, #FFD23D 55%, #C99500); }
.arc-btn.white  { background: radial-gradient(circle at 38% 28%, #FFFFFF, #D0D0D8 55%, #8C8C98); }
.arc-btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.arc-btn:active {
  transform: translateY(3px) scale(0.96);
  box-shadow:
    0 0 0 4px #08080C,
    0 1px 0 4px #0C0C10,
    0 2px 4px rgba(0,0,0,0.95),
    inset 0 4px 8px rgba(0,0,0,0.85);
}

/* coin slot */
.coin-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.coin-slot .slot { width: 34px; height: 8px; background: var(--bk); border: 2px solid var(--ylw); box-shadow: inset 0 0 4px rgba(255,210,61,0.5); }
.coin-slot .px { font-size: 6px; color: var(--gray2); }

/* dpad (mobile controls) */
.aw-dpad { display: grid; grid-template-columns: repeat(3, 32px); grid-template-rows: repeat(3, 32px); gap: 3px; }
.aw-dpad button { border: 3px solid var(--v); background: var(--bk); color: var(--wh); display: flex; align-items: center; justify-content: center; }
.aw-dpad button:active { background: var(--v); }

/* audio toggle */
.aw-audio-toggle {
  position: fixed;
  left: calc(14px + env(safe-area-inset-left));
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 75;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 12px; background: var(--bk);
  border: 3px solid var(--v); color: var(--wh);
  box-shadow: 3px 3px 0 var(--nd);
}
.aw-audio-toggle:hover { background: var(--v); }
.aw-audio-toggle:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--nd); }
.aw-audio-ico { display: inline-flex; color: var(--v3); }
.aw-audio-toggle:hover .aw-audio-ico { color: var(--wh); }
.aw-audio-label { font-size: 7px; color: var(--gray); }
.aw-audio-toggle:hover .aw-audio-label { color: var(--wh); }
/* phones: icon-only audio toggle so it stays compact and out of content's way */
@media (max-width: 560px) {
  .aw-audio-label { display: none; }
  .aw-audio-toggle { padding: 9px; gap: 0; }
}

/* ============ FULLSCREEN ARCADE ENTRY ============ */
.entry {
  /* fixed fullscreen gate — must press START (homepage is not mounted until then).
     iOS CRT uses html.ios-webkit rules to flatten 3D so the maze still paints. */
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: clamp(8px, 1.5vh, 20px);
  overflow: hidden; /* Lock scroll on intro */
  height: 100dvh;
  min-height: 100vh;
  width: 100vw;
  background:
    radial-gradient(120% 90% at 50% 12%, #16162A 0%, #0A0A14 45%, #050507 100%);
}
.entry-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(46% 44% at 50% 44%, rgba(45,225,255,0.16), transparent 70%),
    radial-gradient(60% 50% at 50% 40%, rgba(127,0,255,0.12), transparent 72%);
}
/* perspective floor grid for arcade-room depth */
.entry-floor {
  position: absolute; left: -20%; right: -20%; bottom: -10%; height: 52%; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(45,111,224,0.34) 2px, transparent 2px),
    linear-gradient(90deg, rgba(45,111,224,0.20) 2px, transparent 2px);
  background-size: 46px 46px;
  transform: perspective(340px) rotateX(66deg);
  mask-image: linear-gradient(transparent, #000 55%);
  -webkit-mask-image: linear-gradient(transparent, #000 55%);
  opacity: 0.75;
}
/* Subtle cyan glow reflection on the floor */
.entry-floor::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(50% 50% at 50% 60%, rgba(45,225,255,0.25), transparent 75%);
  pointer-events: none;
}
/* hide loose sticker decals in the entry — they read as floating debris */
.entry .gtag, .entry .gdot { display: none; }
.entry-cab-wrap {
  position: relative; z-index: 3;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  /* upright proportions: width tracks available height so the whole machine
     stays taller-than-wide and never needs scrolling */
  max-width: min(86vw, calc((100dvh - 44px) * 0.56), 440px);
  margin: auto;
  perspective: 1700px;
  perspective-origin: 50% 40%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transform-origin: center center;
  will-change: transform;
}

/* tall lower cabinet body below the control deck → upright stance + coin door.
   Connected directly to the deck-front via the overhang shadow, no gap. */
.cab-lower {
  position: relative; z-index: 4;
  margin-top: clamp(18px, 2.6vh, 32px); /* room for the deck-front depth */
  padding: clamp(16px, 3vh, 40px) clamp(16px, 2.4vw, 22px) clamp(12px, 1.6vh, 18px);
  background:
    linear-gradient(90deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 13%, rgba(255,255,255,0.03) 50%, rgba(0,0,0,0) 80%, rgba(0,0,0,0.55) 100%),
    linear-gradient(180deg, #1A1A20 0%, #111116 60%, #0A0A0D 100%);
  box-shadow: inset 0 16px 24px rgba(0,0,0,0.85); /* cast from the deck overhang */
  display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 1.6vh, 16px);
}
.coin-module {
  position: relative;
  width: clamp(96px, 13vw, 124px); height: clamp(40px, 6vh, 60px);
  background: linear-gradient(180deg, #0A0A0E, #050507);
  border: 3px solid #000;
  border-radius: 6px;
  box-shadow: inset 0 0 16px rgba(0,0,0,0.9), 0 2px 0 rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
}
.coin-led { position: absolute; top: 8px; left: 10px; width: 8px; height: 8px; border-radius: 999px; background: var(--scr-cyan); box-shadow: 0 0 8px var(--scr-cyan); }
.coin-slit { width: 7px; height: clamp(18px, 3vh, 28px); background: #000; border: 2px solid var(--ylw); border-radius: 3px; box-shadow: inset 0 0 6px rgba(255,210,61,0.5); margin-right: 14px; }
.coin-return { position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%); width: 44px; height: 10px; background: #000; border: 2px solid #2A2A30; border-radius: 3px; }
.cab-base-tag { font-size: 7px; color: var(--gray2); letter-spacing: 0.16em; }

/* base plinth — slightly proud of the body, sits the cabinet on the floor */
.cab-base {
  position: relative; z-index: 4;
  margin: 0 clamp(-14px, -1.6vw, -8px);
  padding: clamp(8px, 1.2vh, 14px) 20px clamp(9px, 1.3vh, 15px);
  background: linear-gradient(180deg, #0C0C10 0%, #050507 100%);
  border-top: 4px solid #050507;
  border-radius: 0 0 14px 14px;
  box-shadow: 0 22px 30px rgba(0,0,0,0.55), inset 0 -4px 10px rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
}

/* floor cast-shadow ellipse under the cabinet */
.cab-floor-shadow {
  position: absolute; left: 4%; right: 4%; bottom: clamp(-34px, -4vh, -22px); height: clamp(40px, 6vh, 64px); z-index: 0;
  background: radial-gradient(50% 50% at 50% 50%, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.6) 48%, transparent 75%);
  filter: blur(8px);
  opacity: 0.92;
}

/* ===== large INTRO cabinet sizing — height-aware so it fits one viewport ===== */
.cab-xl .cab-head { padding: clamp(14px, 2vh, 20px) clamp(16px, 3vw, 26px) clamp(10px, 1.4vh, 14px); }
.cab-xl .aw-screen { height: clamp(170px, 28vh, 320px); min-height: auto; }
.cab-xl .cab-side { width: clamp(22px, 3.4vw, 34px); }

/* ============ iOS Safari — CRT canvas renders black inside 3D cabinets ============
   WebKit fails to composite <canvas> under preserve-3d / perspective / filter.
   Flatten BOTH intro (.entry) and homepage hero (.cab-mini) to 2D on iOS. */
html.ios-webkit .entry .entry-cab-wrap,
html.ios-webkit .aw-hero-stage .hero-cab-col {
  perspective: none !important;
}
html.ios-webkit .entry .cab3d,
html.ios-webkit .entry .deck-3d,
html.ios-webkit .aw-hero-stage .cab3d.cab-mini,
html.ios-webkit .aw-hero-stage .cab-mini .deck-3d {
  transform: none !important;
  transform-style: flat !important;
}
html.ios-webkit .entry .cab,
html.ios-webkit .aw-hero-stage .cab-mini .cab {
  transform-style: flat !important;
}
html.ios-webkit .entry .cab-side,
html.ios-webkit .aw-hero-stage .cab-mini .cab-side {
  transform: none !important;
}
html.ios-webkit .entry .cab-marquee::before {
  transform: none !important;
  top: -6px;
}
html.ios-webkit .aw-hero-stage .cab-mini .cab-marquee::before {
  display: none !important;
}
html.ios-webkit .entry .deck-side-l,
html.ios-webkit .entry .deck-side-r {
  display: none;
}
html.ios-webkit .entry .deck-top > *,
html.ios-webkit .aw-hero-stage .cab-mini .deck-top > * {
  transform: none !important;
}
html.ios-webkit .entry .entry-floor {
  transform: none !important;
  opacity: 0.4;
}
html.ios-webkit .entry .aw-screen,
html.ios-webkit .aw-hero-stage .cab-mini .aw-screen {
  filter: none !important;
  box-shadow:
    inset 0 0 0 2px var(--scr-blue),
    inset 0 0 44px rgba(0,0,0,0.92),
    inset 0 8px 22px rgba(0,0,0,0.95),
    0 0 22px var(--scr-cyanG);
}
html.ios-webkit .aw-hero-stage .cab-mini .mini-joy-wrapper,
html.ios-webkit .aw-hero-stage .cab-mini .btn-cluster,
html.ios-webkit .aw-hero-stage .cab-mini .mini-start-btn {
  filter: none !important;
}
html.ios-webkit .entry .maze-viewport,
html.ios-webkit .aw-hero-stage .maze-viewport {
  isolation: isolate;
  transform: none !important;
  -webkit-transform: none !important;
}
html.ios-webkit .entry .maze-viewport canvas,
html.ios-webkit .aw-hero-stage .maze-viewport canvas {
  transform: none !important;
  -webkit-transform: none !important;
  -webkit-backface-visibility: visible;
  backface-visibility: visible;
}

/* ===== MINI cabinet (Homepage hero preview) — a PURPOSE-BUILT compact module,
   not a shrunk intro clone. It shares the intro's material + recessed-CRT +
   slanted-deck language, but skips the full lower body / coin door so the
   screen and control deck dominate and read clearly beside the Tobeads logo. */
.cab3d.cab-mini {
  transform: rotateY(-6deg);
  max-width: clamp(264px, 30vw, 384px);
  margin: 0 auto;
}
/* Single shell — no 3D marquee cap (it stacked as a double bar on the hero). */
.cab-mini .cab {
  border-radius: var(--hh-r-lg) var(--hh-r-lg) var(--hh-r-md) var(--hh-r-md);
  overflow: hidden;
}
.cab-mini .cab-marquee {
  padding: 10px 14px 9px;
  border-radius: 0;
  border-bottom: 2px solid rgba(0,0,0,0.45);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 -8px 14px rgba(0,0,0,0.35);
}
.cab-mini .cab-marquee::before { display: none; }
.cab-mini .cab-nameplate { font-size: 9px; letter-spacing: 0.14em; }
.cab-mini .cab-head { padding: 11px 12px 8px; }
.cab-mini .cab-bezel {
  padding: 11px; border-radius: 14px;
  box-shadow:
    inset 0 8px 15px rgba(0,0,0,0.96),
    inset 0 0 0 2px #1E1E26,
    inset 0 -2px 6px rgba(0,0,0,0.7),
    0 12px 22px rgba(0,0,0,0.62);
}
/* near-square screen to fit the compact 9x9 maze without letterboxing */
.cab-mini .aw-screen { height: clamp(196px, 23vw, 308px); min-height: auto; border-radius: 14px / 18px; }
.cab-mini .deck-joint { height: 9px; }
/* shallow tabletop tilt — a small console resting on a surface, not a steep ramp.
   ~half the intro's slant, with a gentle perspective so controls don't distort. */
.cab-mini .deck-3d { transform: perspective(1150px) rotateX(11deg); transform-origin: top center; }
.cab-mini .deck-top {
  padding: 13px 16px 12px; gap: 11px;
  border-radius: 0 0 4px 4px;
}
/* simplified deck depth: ONE clean full-width front face. The rotated side slabs
   are dropped here — they were the source of the bottom-left seam/white gap. */
.cab-mini .deck-front {
  bottom: -13px; height: 13px;
  box-shadow: 0 10px 18px rgba(0,0,0,0.7), inset 0 2px 0 rgba(255,255,255,0.05);
}
.cab-mini .deck-side-l, .cab-mini .deck-side-r { display: none; }
/* thin contact base, flush under the deck (no proud overhang → corners stay aligned) */
.cab-mini .cab-base { margin: 0; margin-top: 12px; padding: 5px 16px 7px; border-radius: 0 0 14px 14px; }
.cab-mini .cab-base:empty { display: none; }
.cab-mini .cab-side { top: 20px; bottom: 10px; width: clamp(12px, 1.8vw, 18px); right: clamp(-16px, -1.8vw, -10px); }
.cab-mini .btn-cluster { grid-template-columns: repeat(2, 22px); grid-template-rows: repeat(2, 22px); gap: 9px; }
.cab-mini .arc-btn { width: 22px; height: 22px; cursor: pointer; }
.cab-mini .arc-btn::after { top: 4px; left: 4px; width: 5px; height: 4px; }
.cab3d .arc-btn.active {
  outline: 2px solid var(--wh);
  outline-offset: 2px;
  transform: translateY(-1px);
}

/* Hero + intro cabinet color themes — four buttons recolor the whole machine */
.cab3d .cab,
.cab3d .cab-marquee,
.cab3d .cab-bezel,
.cab3d .aw-screen,
.cab3d .deck-joint,
.cab3d .deck-top,
.cab3d .deck-front,
.cab3d .cab-side,
.cab3d .cab-lower,
.cab3d .cab-base {
  transition: background 0.35s ease, box-shadow 0.35s ease, filter 0.35s ease, border-color 0.35s ease;
}
.cab3d.cab-theme-red {
  --cab-shell-hi: #3A1818; --cab-shell-mid: #241010; --cab-shell-lo: #120808;
  --cab-accent: #E83B3B; --cab-accent2: #FF8585; --cab-accent-glow: rgba(232, 59, 59, 0.55);
  --cab-accent-soft: rgba(232, 59, 59, 0.22); --cab-deck-a: #2A1414; --cab-deck-b: #180A0A;
  --cab-joint-mid: #3A2020;
}
.cab3d.cab-theme-blue {
  --cab-shell-hi: #182038; --cab-shell-mid: #101828; --cab-shell-lo: #080C14;
  --cab-accent: #2D6FE0; --cab-accent2: #7FB4FF; --cab-accent-glow: rgba(45, 111, 224, 0.55);
  --cab-accent-soft: rgba(45, 111, 224, 0.22); --cab-deck-a: #141E2A; --cab-deck-b: #0A1018;
  --cab-joint-mid: #202838;
}
.cab3d.cab-theme-yellow {
  --cab-shell-hi: #3A3018; --cab-shell-mid: #282010; --cab-shell-lo: #141008;
  --cab-accent: #FFD23D; --cab-accent2: #FFEFA0; --cab-accent-glow: rgba(255, 210, 61, 0.5);
  --cab-accent-soft: rgba(255, 210, 61, 0.2); --cab-deck-a: #2A2414; --cab-deck-b: #181408;
  --cab-joint-mid: #3A3420;
}
.cab3d.cab-theme-white {
  --cab-shell-hi: #34343E; --cab-shell-mid: #22222C; --cab-shell-lo: #121218;
  --cab-accent: #E8E8F0; --cab-accent2: #FFFFFF; --cab-accent-glow: rgba(255, 255, 255, 0.35);
  --cab-accent-soft: rgba(255, 255, 255, 0.14); --cab-deck-a: #282830; --cab-deck-b: #181820;
  --cab-joint-mid: #3A3A44;
}
.cab3d[class*="cab-theme-"] .cab {
  background:
    linear-gradient(90deg, var(--cab-accent-soft) 0%, rgba(0,0,0,0) 14%, rgba(255,255,255,0.04) 50%, rgba(0,0,0,0) 86%, var(--cab-accent-soft) 100%),
    linear-gradient(180deg, var(--cab-shell-hi) 0%, var(--cab-shell-mid) 50%, var(--cab-shell-lo) 100%);
  box-shadow:
    inset 0 3px 0 color-mix(in srgb, var(--cab-accent2) 28%, transparent),
    inset 2px 0 0 rgba(255,255,255,0.05),
    inset -3px 0 0 rgba(0,0,0,0.5),
    0 30px 54px color-mix(in srgb, var(--cab-accent) 28%, transparent);
}
.cab3d[class*="cab-theme-"] .cab-marquee {
  background:
    radial-gradient(130% 180% at 50% 125%, var(--cab-accent-soft), transparent 70%),
    linear-gradient(180deg, var(--cab-shell-hi) 0%, var(--cab-shell-mid) 60%, var(--cab-shell-lo) 100%);
  border-bottom-color: color-mix(in srgb, var(--cab-accent) 35%, #050507);
}
.cab3d[class*="cab-theme-"] .cab-nameplate {
  text-shadow: 0 0 6px var(--cab-accent), 0 0 16px var(--cab-accent-glow);
}
.cab3d[class*="cab-theme-"] .cab-bulb {
  background: var(--cab-accent);
  box-shadow: 0 0 8px var(--cab-accent-glow);
}
.cab3d[class*="cab-theme-"] .cab-bezel {
  box-shadow:
    inset 0 8px 15px rgba(0,0,0,0.96),
    inset 0 0 0 2px color-mix(in srgb, var(--cab-accent) 40%, #1E1E26),
    inset 0 -2px 6px rgba(0,0,0,0.7),
    0 12px 22px color-mix(in srgb, var(--cab-accent) 22%, rgba(0,0,0,0.62));
}
.cab3d[class*="cab-theme-"] .aw-screen {
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--cab-accent) 55%, var(--scr-blue)),
    inset 0 0 44px rgba(0,0,0,0.92),
    inset 0 8px 22px rgba(0,0,0,0.95),
    0 0 22px var(--cab-accent-glow);
  filter: drop-shadow(0 0 8px var(--cab-accent-glow));
}
.cab3d[class*="cab-theme-"] .aw-screen::before {
  background:
    radial-gradient(120% 90% at 50% 0%, var(--cab-accent-soft), transparent 50%),
    linear-gradient(120deg, rgba(255,255,255,0.07), transparent 28%);
}
.cab3d[class*="cab-theme-"] .deck-joint {
  background:
    linear-gradient(90deg, rgba(0,0,0,0.6), transparent 15%, transparent 85%, rgba(0,0,0,0.6)),
    linear-gradient(180deg, color-mix(in srgb, var(--cab-joint-mid) 80%, #43434F) 0%, var(--cab-shell-mid) 46%, var(--cab-shell-lo) 100%);
  border-top-color: color-mix(in srgb, var(--cab-accent) 30%, #54545F);
}
.cab3d[class*="cab-theme-"] .deck-top {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--cab-accent2) 18%, transparent) 0%, rgba(255,255,255,0) 22%, rgba(0,0,0,0.34) 100%),
    repeating-linear-gradient(135deg, var(--cab-deck-a) 0 6px, var(--cab-deck-b) 6px 12px);
  border-top-color: color-mix(in srgb, var(--cab-accent) 35%, #3A3A46);
}
.cab3d[class*="cab-theme-"] .deck-front {
  background: linear-gradient(180deg, var(--cab-shell-mid) 0%, var(--cab-shell-lo) 100%);
  border-top-color: color-mix(in srgb, var(--cab-accent) 25%, #2C2C36);
}
.cab3d[class*="cab-theme-"] .cab-side {
  background: linear-gradient(180deg, var(--cab-shell-hi) 0%, var(--cab-shell-mid) 55%, var(--cab-shell-lo) 100%);
  box-shadow:
    inset 12px 0 24px rgba(0,0,0,0.9),
    8px 12px 26px color-mix(in srgb, var(--cab-accent) 18%, rgba(0,0,0,0.45));
}
.cab3d[class*="cab-theme-"] .cab-side::before {
  background: linear-gradient(180deg, var(--cab-accent) 0%, transparent 65%);
  opacity: 0.65;
}
.cab3d[class*="cab-theme-"] .cab-floor-shadow {
  background: radial-gradient(50% 50% at 50% 50%, color-mix(in srgb, var(--cab-accent) 55%, rgba(0,0,0,0.92)) 0%, transparent 75%);
}
.cab3d[class*="cab-theme-"] .cab-lower {
  background:
    linear-gradient(90deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 13%, rgba(255,255,255,0.03) 50%, rgba(0,0,0,0) 80%, rgba(0,0,0,0.55) 100%),
    linear-gradient(180deg, var(--cab-shell-mid) 0%, var(--cab-shell-lo) 60%, #0A0A0D 100%);
  box-shadow: inset 0 16px 24px rgba(0,0,0,0.85);
}
.cab3d[class*="cab-theme-"] .cab-base {
  background: linear-gradient(180deg, var(--cab-shell-lo) 0%, #050507 100%);
  border-top-color: color-mix(in srgb, var(--cab-accent) 30%, #050507);
  box-shadow: 0 22px 30px color-mix(in srgb, var(--cab-accent) 20%, rgba(0,0,0,0.55)), inset 0 -4px 10px rgba(0,0,0,0.7);
}
.cab3d[class*="cab-theme-"] .coin-led {
  background: var(--cab-accent);
  box-shadow: 0 0 8px var(--cab-accent-glow);
}
/* contact shadows so the controls read as mounted into the shallow deck plane */
.cab-mini .mini-joy-wrapper { width: 50px; height: 54px; margin-left: 2px; filter: drop-shadow(0 4px 4px rgba(0,0,0,0.5)); }
.cab-mini .btn-cluster { filter: drop-shadow(0 3px 4px rgba(0,0,0,0.45)); }
.cab-mini .mini-start-btn { filter: drop-shadow(0 3px 3px rgba(0,0,0,0.4)); }
.cab-mini .cab-floor-shadow { bottom: -16px; height: 28px; filter: blur(7px); opacity: 0.9; }
/* Mini Joystick visual */
.mini-joy-wrapper {
  position: relative;
  width: 54px; height: 58px;
  display: flex; flex-direction: column; align-items: center;
}
.mini-joy-base {
  position: absolute; bottom: 2px;
  width: 40px; height: 15px;
  background: radial-gradient(circle at 50% 28%, #202026, #050507);
  border: 1.5px solid #000;
  border-radius: 50%;
  box-shadow: 0 4px 7px rgba(0,0,0,0.6), inset 0 1px 2px rgba(255,255,255,0.07);
  z-index: 1;
}
.mini-joy-shaft {
  position: absolute; bottom: 10px;
  width: 6px; height: 22px;
  background: linear-gradient(90deg, #8A8A94, #4A4A50);
  z-index: 2;
}
.mini-joy-ball {
  position: absolute; top: 2px;
  width: 23px; height: 23px;
  border-radius: 999px;
  background: radial-gradient(circle at 36% 28%, #FFA0A0, var(--red) 65%, var(--redd));
  border: 1.5px solid #1A0606;
  box-shadow: 0 4px 8px rgba(0,0,0,0.65);
  z-index: 3;
}
.mini-joy-ball::after {
  content: ""; position: absolute; top: 4px; left: 5px; width: 4px; height: 4px; background: var(--wh); opacity: 0.9;
}
/* Mini Start Button */
.mini-start-btn {
  position: relative;
  padding: 7px 16px;
  border-radius: 4px;
  border: 2px solid var(--wh);
  background: radial-gradient(circle at 50% 30%, #FF6B6B, var(--red) 80%);
  color: var(--wh);
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  box-shadow: 0 4px 0 var(--redd), 0 5px 8px rgba(0,0,0,0.6);
  text-shadow: 0 1px 0 var(--redd);
  transition: transform .06s steps(1), box-shadow .06s steps(1);
}
.mini-start-btn:hover {
  background: var(--red2);
}
.mini-start-btn:active, .mini-start-btn.press {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--redd), 0 1px 2px rgba(0,0,0,0.7);
}
/* perspective context for the homepage hero mini cabinet */
.cab-persp { perspective: 1500px; perspective-origin: 50% 42%; }

/* attract-mode title overlay on the CRT */
.entry .cab-xl .cab-head { padding: 8px 10px 6px; }
.entry .cab-xl .cab-bezel { padding: 8px; }
/* Screen height from dvh — not vw — so landscape desktop H5 still fits the full cab */
.entry .cab-xl .aw-screen {
  width: 100%;
  height: clamp(160px, min(34dvh, calc(100dvh - 300px)), 360px) !important;
  min-height: unset !important;
}
.entry .screen-padding {
  padding: 22px 4px 4px;
}
.entry .maze-viewport {
  width: 100%;
  height: 100%;
}
.entry-screen-ovl {
  position: absolute; inset: 0; z-index: 6; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 0 12px clamp(10px, 2.2vh, 18px);
}
.attract-panel {
  background: rgba(2, 8, 22, 0.55);
  border: 1px solid rgba(255,210,61,0.78);
  border-radius: var(--hh-r-sm);
  padding: clamp(6px, 1.1vh, 10px) clamp(10px, 1.8vw, 16px);
  box-shadow: 0 0 14px rgba(255,210,61,0.28), inset 0 0 12px rgba(0,0,0,0.65);
  display: flex; flex-direction: column; align-items: center; gap: 0;
  text-align: center;
  max-width: 88%;
  transform: none;
}
.entry-title { text-align: center; }
.entry-title .tobeads-mark { justify-content: center; filter: drop-shadow(0 0 14px var(--scr-cyanG)); }
.entry-sub { font-size: 9px; color: var(--scr-cyan); margin-top: 10px; letter-spacing: 0.35em; text-shadow: 0 0 8px var(--scr-cyan); }
.entry-bottom { text-align: center; display: flex; flex-direction: column; gap: 8px; }
.entry-press { font-size: clamp(9px, 1.35vw, 13px); color: var(--ylw); text-shadow: 0 0 10px rgba(255,210,61,0.7); white-space: nowrap; }
.entry-credit { font-size: 7px; color: var(--scr-cyan); letter-spacing: 0.12em; }

.entry-hint {
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  color: var(--wh);
  margin-top: 22px;
  letter-spacing: 0.2em;
  text-shadow: 0 0 10px var(--scr-cyan), 0 0 2px var(--bk);
}

/* very subtle floating pixel dust in the background */
.pixel-dust {
  position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden;
}
.dust-dot {
  position: absolute;
  width: 6px; height: 6px;
  background: var(--v3);
  opacity: 0.15;
  box-shadow: 0 0 6px var(--v3);
}
.dust-dot-1 { top: 15%; left: 10%; animation: float-slow-1 12s ease-in-out infinite; }
.dust-dot-2 { top: 25%; right: 12%; background: var(--scr-cyan); box-shadow: 0 0 6px var(--scr-cyan); animation: float-slow-2 15s ease-in-out infinite; opacity: 0.12; }
.dust-dot-3 { top: 60%; left: 8%; background: var(--ylw); box-shadow: 0 0 6px var(--ylw); animation: float-slow-3 18s ease-in-out infinite; opacity: 0.08; }
.dust-dot-4 { top: 75%; right: 15%; animation: float-slow-1 14s ease-in-out infinite; opacity: 0.1; }
.dust-dot-5 { top: 40%; left: 85%; width: 8px; height: 8px; background: var(--pnk); box-shadow: 0 0 8px var(--pnk); animation: float-slow-2 20s ease-in-out infinite; opacity: 0.06; }

@keyframes float-slow-1 {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-15px) translateX(8px); }
}
@keyframes float-slow-2 {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(20px) translateX(-10px); }
}
@keyframes float-slow-3 {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-10px) translateX(-12px); }
}

/* graffiti / sticker tags */
.gtag {
  position: absolute; z-index: 2; font-family:'Press Start 2P', monospace; font-size: 13px;
  padding: 4px 7px; border: 2px solid currentColor; pointer-events: none;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.6); opacity: 0.85;
}
.gtag-1 { top: 4%;  left: -6%;  color: var(--scr-cyan); transform: rotate(-12deg); }
.gtag-2 { top: 12%; right: -7%; color: var(--ylw);      transform: rotate(9deg); }
.gtag-3 { top: 46%; left: -11%; color: var(--pnk);      transform: rotate(-6deg); }
.gtag-4 { bottom: 16%; right: -10%; color: var(--scr-blue); transform: rotate(7deg); }
.gtag-5 { bottom: 6%; left: -5%;  color: var(--red2);     transform: rotate(-9deg); }
.gdot { position: absolute; z-index: 2; width: 12px; height: 12px; pointer-events: none; }
.gdot-1 { top: 30%; right: -4%; background: var(--pnk); box-shadow: 0 0 10px var(--pnk); }
.gdot-2 { bottom: 30%; left: -3%; background: var(--ylw); box-shadow: 0 0 10px var(--ylw); }
.gdot-3 { top: 70%; right: -7%; background: var(--scr-cyan); box-shadow: 0 0 10px var(--scr-cyan); }

/* screen power-flash on press */
.screen-flash::before {
  animation: scr-flash 0.24s steps(2) 1;
}
@keyframes scr-flash {
  0% { background: rgba(255,255,255,0.9); }
  100% { background: transparent; }
}
/* exit: zoom into the screen + fade */
.entry-exit {
  animation: entry-zoom 0.86s cubic-bezier(.6,0,.2,1) forwards;
}
@keyframes entry-zoom {
  0%   { transform: scale(1); opacity: 1; filter: brightness(1); }
  35%  { transform: scale(1.04); filter: brightness(1.5); }
  100% { transform: scale(3.4); opacity: 0; filter: brightness(2.2); }
}
.arcade.reduce-motion .entry-exit { animation: none; opacity: 0; }

@media (max-width: 520px) {
  .gtag { font-size: 10px; }
  .gtag-1, .gtag-3 { left: -2%; }
  .gtag-2, .gtag-4 { right: -2%; }
}

/* desktop / landscape H5: short viewports need a smaller CRT */
@media (min-width: 681px) and (max-height: 820px) {
  .entry .cab-xl .aw-screen {
    height: clamp(150px, min(28dvh, calc(100dvh - 310px)), 300px) !important;
  }
}

/* tablet: scale intro screen down */
@media (max-width: 920px) {
  .cab-xl .aw-screen { height: clamp(170px, 30vh, 320px); }
  .entry .cab-xl .aw-screen {
    height: clamp(180px, min(32dvh, calc(100dvh - 290px)), 320px) !important;
  }
}
/* mobile: simplify the side depth but keep the full cabinet visible */
@media (max-width: 680px) {
  .entry-cab-wrap { max-width: min(92vw, calc((100dvh - 40px) * 0.6)); }
  .cab-xl .aw-screen { height: clamp(150px, 26vh, 240px); }
  .entry .cab-xl .aw-screen {
    height: clamp(170px, min(30dvh, calc(100dvh - 280px)), 260px) !important;
  }
  .entry .screen-padding { padding: 20px 3px 3px; }
  .cab-xl .cab-side { width: 18px; right: -12px; }
  .cab-floor-shadow { bottom: -18px; }
  .cab3d.cab-mini { max-width: min(82vw, 344px); }
}

/* Game Select wrap — ~3/4 of the viewport on desktop, adaptive on smaller */
.ms-wrap { width: min(1320px, 76vw); }
@media (max-width: 1100px) { .ms-wrap { width: 86vw; } }
@media (max-width: 760px)  { .ms-wrap { width: 92vw; } }

/* ============ MODE SELECTOR — unified arcade selection SCREEN ============ */
/* Handheld shell (desktop + mobile): rounded plastic body, inset glass screen */
.ms-handheld.ms-bezel {
  position: relative;
  padding: 14px 14px 16px;
  border-radius: var(--hh-r-shell);
  border: 4px solid #1A1A22;
  background: linear-gradient(180deg, #34343F 0%, #1E1E28 38%, #101016 100%);
  box-shadow:
    inset 0 4px 0 rgba(255,255,255,0.14),
    inset 0 -8px 16px rgba(0,0,0,0.75),
    0 24px 40px rgba(0,0,0,0.28),
    8px 8px 0 var(--cab-edge);
}
.ms-handheld .ms-br { display: none; }
/* legacy sharp bezel (unused on homepage — kept for reference layouts) */
.ms-bezel {
  position: relative;
  padding: 16px;
  background: linear-gradient(180deg, #16161C 0%, #0C0C10 60%, #060608 100%);
  border: 4px solid var(--cab-frame);
  box-shadow:
    inset 0 2px 0 var(--cab-frame2),
    inset 0 0 0 2px var(--cab-frameD),
    0 24px 40px rgba(0,0,0,0.35),
    10px 10px 0 0 var(--cab-edge);
}
/* 8-bit corner brackets */
.ms-br { position: absolute; width: 20px; height: 20px; z-index: 5; pointer-events: none; }
.ms-br::before, .ms-br::after { content: ""; position: absolute; background: var(--scr-cyan); box-shadow: 0 0 8px var(--scr-cyanG); }
.ms-br::before { width: 20px; height: 4px; }
.ms-br::after  { width: 4px; height: 20px; }
.ms-br.tl { top: 6px; left: 6px; }   .ms-br.tl::before { top: 0; left: 0; } .ms-br.tl::after { top: 0; left: 0; }
.ms-br.tr { top: 6px; right: 6px; }  .ms-br.tr::before { top: 0; right: 0; } .ms-br.tr::after { top: 0; right: 0; }
.ms-br.bl { bottom: 6px; left: 6px; }.ms-br.bl::before { bottom: 0; left: 0; } .ms-br.bl::after { bottom: 0; left: 0; }
.ms-br.br { bottom: 6px; right: 6px; }.ms-br.br::before { bottom: 0; right: 0; } .ms-br.br::after { bottom: 0; right: 0; }
.ms-handheld .ms-screen {
  position: relative; overflow: hidden;
  padding: 0 0 22px;
  background: radial-gradient(120% 120% at 50% 30%, #06121F 0%, #020810 70%, #01060C 100%);
  border: 4px solid #0A0A0E;
  border-radius: var(--hh-r-lg);
  box-shadow:
    inset 0 0 0 2px var(--scr-blue),
    inset 0 0 60px rgba(0,0,0,0.9),
    0 0 18px var(--scr-cyanG);
}
.ms-screen {
  position: relative; overflow: hidden;
  padding: 0 0 22px;
  background: radial-gradient(120% 120% at 50% 30%, #06121F 0%, #020810 70%, #01060C 100%);
  border: 5px solid #0A0A0E;
  box-shadow:
    inset 0 0 0 2px var(--scr-blue),
    inset 0 0 60px rgba(0,0,0,0.9),
    0 0 0 4px var(--cab-frameD),
    8px 8px 0 0 var(--cab-edge),
    0 0 26px var(--scr-cyanG);
  border-radius: 10px / 14px;
}
/* inner grid texture so the screen never feels empty */
.ms-screen::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(45,111,224,0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45,111,224,0.10) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(120% 100% at 50% 40%, #000 55%, transparent 92%);
  -webkit-mask-image: radial-gradient(120% 100% at 50% 40%, #000 55%, transparent 92%);
}
.ms-hud {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; font-family:'Press Start 2P', monospace; font-size: 9px;
  border-bottom: 2px solid rgba(45,111,224,0.45);
  background: linear-gradient(180deg, rgba(45,111,224,0.12), rgba(0,0,0,0.4));
  color: var(--wh);
}
.ms-handheld .ms-hud { border-radius: var(--hh-r-lg) var(--hh-r-lg) 0 0; }
.ms-hud-l { display: inline-flex; align-items: center; gap: 9px; color: var(--scr-cyan); text-shadow: 0 0 8px var(--scr-cyan); }
.ms-led { width: 9px; height: 9px; background: var(--scr-cyan); box-shadow: 0 0 8px var(--scr-cyan); animation: bulb 1.1s steps(1) infinite; }
.arcade.reduce-motion .ms-led { animation: none; }
.ms-hud-c { display: inline-flex; align-items: center; gap: 8px; }
.ms-slots {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
}
.ms-slot {
  position: relative; cursor: pointer;
  padding: 38px 30px 30px; text-align: center;
  display: flex; flex-direction: column; align-items: center;
  min-height: 460px;
  border-right: 2px dashed rgba(45,111,224,0.25);
  transition: background .08s steps(1);
}
.ms-slot:last-child { border-right: none; }
.ms-slot.on { background: linear-gradient(180deg, rgba(45,225,255,0.07), rgba(0,0,0,0)); }
.ms-slot.on::after { /* selector frame */
  content: ""; position: absolute; inset: 8px; pointer-events: none;
  border: 2px solid var(--mc); border-radius: var(--hh-r-md);
  box-shadow: 0 0 16px -2px var(--mc), inset 0 0 16px -6px var(--mc);
  animation: ms-blink 0.9s steps(1) infinite;
}
@keyframes ms-blink { 50% { border-color: var(--wh); } }
.arcade.reduce-motion .ms-slot.on::after { animation: none; }
.ms-cursor {
  position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
  font-family:'Press Start 2P', monospace; font-size: 11px; opacity: 0;
}
.ms-slot.on .ms-cursor { opacity: 1; animation: ms-bob 0.7s steps(2) infinite; }
@keyframes ms-bob { 50% { transform: translate(-50%, 4px); } }
.arcade.reduce-motion .ms-slot.on .ms-cursor { animation: none; }
/* number + status chip row */
.ms-slot-top {
  width: 100%; display: flex; align-items: center; justify-content: space-between; margin: 6px 0 14px;
}
.ms-stat {
  font-size: 7px; padding: 3px 6px; border: 1.5px solid; letter-spacing: 0.08em;
  border-radius: var(--hh-r-sm);
}
.ms-sprite {
  width: 88px; height: 88px;
  border: 3px solid; border-radius: var(--hh-r-md);
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(rgba(45,111,224,0.12) 1px, transparent 1px) 0 0 / 8px 8px,
    rgba(0,0,0,0.55);
  image-rendering: pixelated;
  position: relative;
}
.ms-sprite::before, .ms-sprite::after { display: none; }
.ms-num { font-family:'Press Start 2P', monospace; font-size: 24px; }
.ms-title { font-size: 15px; color: var(--wh); margin-top: 20px; line-height: 1.4; }
.ms-sub { font-family: 'Space Grotesk', sans-serif; font-size: 15px; color: var(--gray); margin-top: 12px; }
.ms-tag { font-size: 7px; margin-top: 14px; letter-spacing: 0.1em; opacity: 0.9; }
/* difficulty bars */
.ms-bars { display: flex; gap: 5px; margin-top: 14px; }
.ms-bars span { width: 22px; height: 7px; border-radius: var(--hh-r-xs); }
/* mini stage-preview bead row */
.ms-dots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; width: 108px; margin: 18px auto 0; }
.ms-dots span { width: 100%; aspect-ratio: 1; border-radius: var(--hh-r-xs); }
.ms-play { font-size: 9px; margin-top: auto; padding-top: 20px; letter-spacing: 0.12em; transition: opacity .1s; }
.ms-foot {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 30px; flex-wrap: wrap;
  margin: 16px 16px 0; padding-top: 15px;
  border-top: 2px solid rgba(45,111,224,0.45);
  font-family:'Press Start 2P', monospace; font-size: 8px; color: var(--gray);
}
.ms-scan {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(rgba(0,0,0,0) 50%, rgba(0,0,0,0.20) 50%);
  background-size: 100% 3px; opacity: 0.5;
}
body.no-scan .ms-scan, .arcade.reduce-motion .ms-scan { display: none; }
/* mobile swipe hint + pager (hidden on desktop via .aw-only-mob) */
.ms-swipe-hint {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 6px 12px 8px;
}
.ms-swipe-arrow { font-family: 'Press Start 2P', monospace; font-size: 10px; color: var(--scr-cyan); opacity: 0.85; }
.ms-swipe-label { font-size: 7px; color: var(--scr-cyan); letter-spacing: 0.14em; text-shadow: 0 0 8px var(--scr-cyan); }
.ms-slots-wrap { position: relative; z-index: 2; }
.ms-pager {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 10px 0 6px;
}
.ms-pager-dot {
  width: 11px; height: 11px; padding: 0; cursor: pointer;
  border: 2px solid rgba(45,225,255,0.55);
  background: transparent;
  border-radius: var(--hh-r-pill);
  box-shadow: none;
  transition: transform 0.12s ease, background 0.12s ease;
}
.ms-pager-dot.on { transform: scale(1.15); }
.ms-pager-dot:active { transform: scale(0.92); }

@media (max-width: 760px) {
  /* Game Select: horizontal carousel inside handheld shell */
  .home-modes {
    min-height: auto !important;
    padding: 36px 16px 44px !important;
    justify-content: flex-start !important;
  }
  .ms-wrap { width: 100% !important; max-width: 100%; }
  .ms-handheld.ms-bezel {
    padding: 12px 10px 14px;
    border-radius: var(--hh-r-xl);
    box-shadow:
      inset 0 4px 0 rgba(255,255,255,0.14),
      inset 0 -8px 16px rgba(0,0,0,0.75),
      0 18px 36px rgba(0,0,0,0.22),
      7px 7px 0 var(--cab-edge);
  }
  .ms-handheld .ms-screen {
    padding-bottom: 12px;
    border-radius: var(--hh-r-md);
  }
  .ms-hud { padding: 10px 12px; font-size: 7px; flex-wrap: wrap; gap: 6px; }
  .ms-slots-wrap::before,
  .ms-slots-wrap::after {
    content: "";
    position: absolute; top: 0; bottom: 0; width: 32px; z-index: 4; pointer-events: none;
  }
  .ms-slots-wrap::before {
    left: 0;
    background: linear-gradient(90deg, #020810 35%, transparent);
  }
  .ms-slots-wrap::after {
    right: 0;
    background: linear-gradient(270deg, #020810 35%, transparent);
  }
  .ms-slots {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 6px;
  }
  .ms-slots::-webkit-scrollbar { display: none; }
  .ms-slot {
    /* ~72vw so the next card peeks in — signals horizontal scroll */
    flex: 0 0 min(72vw, 280px);
    scroll-snap-align: center;
    min-height: unset;
    padding: 16px 14px 14px;
    border-right: 2px dashed rgba(45,111,224,0.25);
    border-bottom: none;
    border-radius: var(--hh-r-md);
  }
  .ms-slot:last-child { border-right: none; }
  .ms-num { font-size: 18px; }
  .ms-sprite { width: 64px; height: 64px; }
  .ms-title { font-size: 11px; margin-top: 12px; }
  .ms-sub { font-size: 13px; margin-top: 8px; }
  .ms-slot .ms-dots { display: none; }
  .ms-bars { margin-top: 10px; }
  .ms-play { margin-top: 12px; padding-top: 10px; }
  .ms-foot { flex-direction: column; gap: 8px; margin: 10px 10px 0; padding-top: 10px; font-size: 7px; text-align: center; }
}

.hero-logo-wrap { margin-top: 18px; }
.hero-tagline { margin-top: 22px; }
.hero-lines { margin-top: 18px; }
.hero-cta-row { margin-top: 30px; }

/* ============ Homepage hero — mobile: top-left, full cabinet visible ============ */
@media (max-width: 980px) {
  .aw-hero-stage {
    min-height: auto !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    padding: 52px 16px 40px !important;
  }
  .aw-hero-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    max-width: 100% !important;
    margin: 0 !important;
    justify-items: start !important;
    text-align: left;
  }
  .hero-text-col { order: 1 !important; max-width: 100% !important; }
  .hero-cab-col { order: 2 !important; justify-content: flex-start !important; width: 100%; }
  .hero-eyebrow { justify-content: flex-start; }
  .hero-logo-wrap { margin-top: 10px; }
  .hero-tagline { margin-top: 12px; text-align: left; font-size: clamp(9px, 2.8vw, 14px) !important; }
  .hero-lines { margin-top: 10px; text-align: left; line-height: 1.6 !important; }
  .hero-cta-row { margin-top: 18px; gap: 10px !important; }
  .aw-hero-stage .cab3d.cab-mini {
    max-width: min(78vw, 280px);
    margin: 0;
    transform: rotateY(-4deg);
  }
}

/* Pick a Build — match Gallery: 2-up grid, shorter cards on phones */
@media (max-width: 900px) {
  .home-pick-build { padding: 8px 16px 64px !important; }
  .home-pick-build .aw-prod-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .home-pick-build .lt-card > div:first-child { aspect-ratio: 1 / 1 !important; }
  .home-pick-build .lt-card > div:last-child { padding: 12px 14px !important; }
  .home-pick-build .aw-disp { font-size: 12px !important; margin-top: 6px !important; }
  .home-pick-build .lt-card h3.px { font-size: 9px !important; }
  .home-pick-build .lt-card > div:last-child > div:last-child { margin-top: 12px !important; gap: 6px !important; }
  .home-pick-build .pbtn-sm { font-size: 8px; padding: 8px 6px; }
}
@media (max-width: 520px) {
  .home-pick-build .lt-card > div:last-child > div:last-child {
    flex-direction: column;
  }
  .home-pick-build .lt-card .pbtn-sm { width: 100%; }
}

/* subpage headers (Quick Start / Presets / Gallery): tighten on phones so the
   title isn't pushed far down by the fixed top menu clearance */
@media (max-width: 600px) {
  .page-head { padding-top: 84px !important; }
  .page-head-sub { font-size: 15px !important; margin-top: 14px !important; }
}

/* ============ PIXEL PANEL (cards/sections) ============ */
.aw-panel {
  background: var(--bk); border: 3px solid var(--v); box-shadow: 6px 6px 0 0 var(--n);
}
.aw-panel-navy { background: var(--n); border: 3px solid var(--v); }

.aw-prod {
  background: var(--bk); border: 3px solid var(--n2); transition: none;
}
.aw-prod:hover { border-color: var(--v); box-shadow: 5px 5px 0 0 var(--n); transform: translate(-1px,-1px); }

/* step number block */
.aw-step-num {
  font-family:'Press Start 2P', monospace; font-size: 14px;
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: var(--v); color: var(--wh); border: 3px solid var(--wh);
  border-radius: var(--hh-r-md);
}

/* creator flow */
.aw-flow { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.aw-flow-step { display: flex; align-items: center; gap: 12px; font-family:'Press Start 2P', monospace; font-size: 11px; color: var(--wh); }
.aw-flow-bead { width: 14px; height: 14px; background: var(--v); box-shadow: 0 0 10px var(--v); }
.aw-flow-track { flex: 1; min-width: 24px; height: 3px; background: repeating-linear-gradient(90deg, var(--v) 0 6px, transparent 6px 12px); }

/* gallery */
.aw-gal { border: 3px solid var(--n2); background: var(--bk); position: relative; }
.aw-gal:hover { border-color: var(--v); }

/* pixel progress fill */
.pbar { height: 16px; border: 3px solid var(--v); background: var(--bk); position: relative; overflow: hidden; }
.pbar > i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--v) 0 8px, var(--v2) 8px 16px); }

/* entrance: transform-only so content is never hidden if anim stalls */
.aw-rise { animation: aw-rise .5s steps(6) both; }
@keyframes aw-rise { from { transform: translateY(14px); } to { transform: none; } }
.arcade.reduce-motion .aw-rise { animation: none; }

/* container */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* responsive helpers */
@media (max-width: 920px) { .aw-hide-mob { display: none !important; } }
@media (min-width: 921px) { .aw-only-mob { display: none !important; } }

/* ============ LIGHT SECTIONS (premium negative space) ============ */
/* Transparent so the body's single fixed pixel-grid shows through every
   section continuously — no per-section grid that could misalign/seam. */
.sec-light {
  position: relative;
  background: transparent;
  color: var(--ink);
}
.sec-light-grid {
  background-image: none;
}
/* zig-zag pixel edge between dark and light */
.pixel-edge {
  height: 14px; width: 100%;
  background:
    repeating-linear-gradient(90deg, var(--lt) 0 14px, transparent 14px 28px) 0 0 / 28px 14px,
    var(--bk);
  -webkit-mask: none;
}
.pixel-edge-up { /* light sits below: teeth point down into dark */
  background:
    repeating-linear-gradient(90deg, var(--lt) 0 14px, var(--bk) 14px 28px);
}

/* card / panel on light — handheld-molded corners */
.lt-panel { background: var(--lt2); border: 3px solid var(--ink); box-shadow: 6px 6px 0 0 var(--v); border-radius: var(--hh-r-lg); overflow: hidden; }
.lt-card  {
  background: var(--lt2); border: 3px solid var(--ink); box-shadow: 5px 5px 0 0 var(--v);
  border-radius: var(--hh-r-lg); overflow: hidden; transition: none;
}
.lt-card:hover { transform: translate(-1px,-1px); box-shadow: 7px 7px 0 0 var(--v); }
.lt-step  {
  background: var(--lt2); border: 3px solid var(--lt3);
  border-radius: var(--hh-r-lg); overflow: hidden;
}

/* yellow CTA button */
.pbtn-ylw { background: var(--ylw); border-color: var(--ink); color: var(--ink); box-shadow: 4px 4px 0 0 var(--ink); }
.pbtn-ylw:hover { background: #FFDD6B; transform: translate(2px,2px); box-shadow: 2px 2px 0 0 var(--ink); }
/* dark-friendly yellow CTA */
.pbtn-ylw-d { background: var(--ylw); border-color: var(--wh); color: var(--ink); box-shadow: 4px 4px 0 0 var(--vd2); }
.pbtn-ylw-d:hover { background: #FFDD6B; transform: translate(2px,2px); box-shadow: 2px 2px 0 0 var(--vd2); }

/* ============ SWITCH-STYLE VIDEO CAROUSEL ============ */
.tvtv { position: relative; overflow-x: clip; }
.carousel-stage {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  gap: 16px;
  min-height: 360px;
  perspective: 1000px;
  max-width: 100%;
  overflow-x: clip;
}
.cart-card {
  position: relative; flex-shrink: 0;
  border: 3px solid var(--ink);
  background: var(--bk);
  overflow: hidden;
  border-radius: var(--hh-r-lg);
  transition: transform .28s cubic-bezier(.2,.7,.2,1), opacity .28s, box-shadow .28s, width .28s, height .28s;
  cursor: pointer;
}
.cart-card.center {
  width: min(560px, 70vw); height: 320px;
  box-shadow: 10px 10px 0 0 var(--v), 0 0 0 3px var(--ink);
  border-radius: var(--hh-r-xl);
  z-index: 3;
}
.cart-card.side {
  width: 130px; height: 230px; opacity: 0.55;
  filter: saturate(0.7) brightness(0.85);
  z-index: 1;
}
.cart-card.side:hover { opacity: 0.85; }
.cart-card.hidden-card { display: none; }

/* cartridge screen content */
.cart-screen { position: absolute; inset: 0; }
.cart-scan::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(0,0,0,0) 50%, rgba(0,0,0,0.18) 50%);
  background-size: 100% 3px; opacity: 0.5;
}
body.no-scan .cart-scan::after { display: none; }

.play-btn {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 64px; height: 64px;
  background: var(--ylw); border: 3px solid var(--ink);
  border-radius: var(--hh-r-md);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 6px rgba(255,210,61,0.18), 4px 4px 0 var(--ink);
  z-index: 2; color: var(--ink);
}
.cart-card.center:hover .play-btn { background: #FFDD6B; box-shadow: 0 0 0 10px rgba(255,210,61,0.22), 4px 4px 0 var(--ink); }

.cart-tag {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  font-family:'Press Start 2P', monospace; font-size: 8px;
  padding: 6px 9px; background: var(--ink); color: var(--wh); border: 2px solid var(--wh);
  border-radius: var(--hh-r-sm);
}
.cart-foot .hh-badge { border-radius: var(--hh-r-sm); }
.cart-foot {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.85));
}

.car-ctrl {
  width: 52px; height: 52px; flex-shrink: 0;
  background: var(--bk); border: 3px solid var(--v); color: var(--wh);
  border-radius: var(--hh-r-md);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 4px 4px 0 var(--nd); z-index: 5;
}
.car-ctrl:hover { background: var(--v); }
.car-ctrl:active { transform: translate(2px,2px); box-shadow: 2px 2px 0 var(--nd); }

.car-dots { display: flex; gap: 8px; justify-content: center; margin-top: 22px; }
.car-dot { width: 12px; height: 12px; background: var(--lt3); border: 2px solid var(--ink); border-radius: var(--hh-r-pill); cursor: pointer; }
.car-dot.on { background: var(--v); box-shadow: 0 0 8px var(--glow); }
.sec-light .car-ctrl { border-color: var(--ink); color: var(--ink); box-shadow: 4px 4px 0 var(--v); background: var(--lt2); }
.sec-light .car-ctrl:hover { background: var(--v); color: var(--wh); }

@media (max-width: 760px) {
  .carousel-stage { min-height: 280px; gap: 10px; }
  .cart-card.center {
    width: min(92vw, 340px);
    height: 220px;
    border-radius: var(--hh-r-lg);
    box-shadow: 8px 8px 0 0 var(--v), 0 0 0 3px var(--ink);
  }
  .cart-card.side { width: 72px; height: 160px; border-radius: var(--hh-r-md); }
  .play-btn { width: 52px; height: 52px; border-radius: var(--hh-r-sm); }
  .car-ctrl { width: 44px; height: 44px; border-radius: var(--hh-r-sm); }
  .lt-step { border-radius: var(--hh-r-md); }
  .lt-card { border-radius: var(--hh-r-md); }
}

/* ============ EXPORT MODAL (factory production sheet) ============ */
.exp-overlay {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(10,10,24,0.62);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.exp-modal {
  width: min(1180px, 100%); height: min(840px, 94vh);
  background: var(--lt2); color: var(--ink);
  border: 3px solid var(--ink); box-shadow: 12px 12px 0 0 var(--v);
  display: flex; flex-direction: column; overflow: hidden;
}
.exp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 2px solid var(--ink); background: var(--lt2); flex-shrink: 0;
}
.exp-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px;
}
.exp-body {
  flex: 1; display: grid; grid-template-columns: 1fr 340px 280px; min-height: 0;
}
.exp-preview { padding: 18px; overflow: hidden; display: flex; flex-direction: column; border-right: 1px solid var(--line); min-width: 0; }
.exp-tables { padding: 18px; overflow: hidden; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.exp-settings { padding: 18px; overflow-y: auto; background: rgba(17,17,17,0.02); }

.exp-grid-scroll { flex: 1; overflow: auto; background: rgba(17,17,17,0.03); border: 1px solid var(--line); padding: 12px; }
.exp-axis { display: flex; align-items: center; justify-content: center; font-family: monospace; color: var(--muted); flex-shrink: 0; }

.exp-table-scroll { flex: 1; overflow-y: auto; border: 1px solid var(--line); }
.exp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.exp-table th { position: sticky; top: 0; background: var(--ink); color: #fff; font: 700 9px monospace; text-transform: uppercase; letter-spacing: 0.06em; text-align: left; padding: 7px 8px; z-index: 1; }
.exp-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.exp-table tr:nth-child(even) td { background: rgba(17,17,17,0.025); }
.exp-table .mono { font-family: monospace; }

.exp-actions { margin-top: 8px; padding-top: 16px; border-top: 2px solid var(--ink); }

/* stacked layout: preview on top, tables+settings below */
.exp-body.stacked { grid-template-columns: 1fr 280px; grid-template-rows: 1fr auto; }
.exp-body.stacked .exp-preview { grid-column: 1 / -1; border-right: none; border-bottom: 1px solid var(--line); max-height: 46%; }

@media (max-width: 920px) {
  .exp-body, .exp-body.stacked { grid-template-columns: 1fr; grid-template-rows: none; overflow-y: auto; }
  .exp-preview, .exp-tables { border-right: none; border-bottom: 1px solid var(--line); }
  .exp-grid-scroll { max-height: 320px; }
  .exp-table-scroll { max-height: 280px; }
}
