/* ============================================================
   COMETBOY — pocket cartridge console
   ============================================================ */

@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/press-start-2p-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/press-start-2p-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF, U+A722-A76F, U+A771-A787, U+A789-A78C;
}

:root {
  --pixel: 'Press Start 2P', monospace;
  --toy: "Trebuchet MS", "Segoe UI", Verdana, sans-serif;

  --coral: #ff5964;
  --coral-dark: #d63a4a;
  --cream: #fff3dc;
  --navy: #2b2d42;
  --teal: #2ec4b6;
  --yellow: #ffd23f;
  --purple: #7b5ea7;
  --pink: #ff9de2;

  --desk: #262033;
  --desk2: #171224;
}

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

html { min-height: 100%; }

body {
  font-family: var(--toy);
  color: var(--cream);
  min-height: 100vh;
  background:
    radial-gradient(ellipse 120% 70% at 50% -10%, #3d2f57 0%, transparent 60%),
    radial-gradient(ellipse 90% 60% at 85% 110%, #2a1e3f 0%, transparent 55%),
    repeating-linear-gradient(45deg, transparent 0 46px, rgba(255,255,255,.014) 46px 48px),
    linear-gradient(160deg, var(--desk) 0%, var(--desk2) 100%);
  background-attachment: fixed;
  padding: 18px 16px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- header / footer ---------- */
.site-header { text-align: center; margin-bottom: 22px; }
.site-title {
  font-family: var(--pixel);
  font-size: clamp(22px, 4.5vw, 40px);
  letter-spacing: 4px;
  color: var(--cream);
  text-shadow: 0 3px 0 var(--coral-dark), 0 6px 22px rgba(255,89,100,.45);
}
.site-title span { color: var(--yellow); }
.site-sub {
  margin-top: 10px;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #b7a8d8;
}

.site-footer {
  margin-top: 34px;
  font-size: 12px;
  color: #8d7fb0;
  text-align: center;
  letter-spacing: 1px;
}

/* ---------- desk layout ---------- */
.desk {
  display: flex;
  gap: 44px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1180px;
}

/* ============================================================
   CONSOLE HARDWARE
   ============================================================ */
.console-wrap { perspective: 1400px; }

.console {
  position: relative;
  width: 470px;
  max-width: 94vw;
  border-radius: 26px 26px 44px 44px;
  background:
    linear-gradient(175deg, #ff6b74 0%, var(--coral) 42%, var(--coral-dark) 100%);
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,.5),
    inset 0 -8px 14px rgba(120,10,25,.55),
    inset 3px 0 6px rgba(255,255,255,.18),
    0 22px 50px rgba(0,0,0,.55),
    0 4px 12px rgba(0,0,0,.4);
  padding: 64px 26px 22px;
  user-select: none;
}

/* screw heads */
.console::before, .console::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffb3b9, #a3273a 70%);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.5);
  top: 12px;
}
.console::before { left: 16px; }
.console::after { right: 16px; }

/* ---------- cartridge slot ---------- */
.slot-rail {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 6;
}
.slot {
  width: 190px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(180deg, #8f2130, #6e1623);
  box-shadow: inset 0 4px 8px rgba(0,0,0,.7), 0 1px 0 rgba(255,255,255,.25);
  position: relative;
}
.slot-mouth {
  position: absolute;
  left: 10px; right: 10px; top: 8px;
  height: 12px;
  border-radius: 4px;
  background: #1c0d12;
  box-shadow: inset 0 3px 6px #000;
}
.slot-label {
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  text-align: center;
  font-size: 7px;
  letter-spacing: 2px;
  color: rgba(255,235,235,.55);
  font-weight: bold;
}
.eject-btn {
  font-family: var(--toy);
  font-weight: bold;
  font-size: 10px;
  letter-spacing: 1px;
  color: #5c1220;
  background: linear-gradient(180deg, #ffd9dc, #f2a7ae);
  border: none;
  border-radius: 6px;
  padding: 7px 10px;
  cursor: pointer;
  box-shadow: 0 3px 0 #b3535d, 0 4px 6px rgba(0,0,0,.3);
  transition: transform .06s, box-shadow .06s;
}
.eject-btn:active { transform: translateY(3px); box-shadow: 0 0 0 #b3535d; }
.eject-btn:disabled { opacity: .35; cursor: default; transform: none; box-shadow: 0 3px 0 #b3535d; }

/* ---------- cartridge (shelf + seated) ---------- */
.cart {
  width: 96px;
  height: 108px;
  border-radius: 8px 8px 10px 10px;
  background: linear-gradient(165deg, #4b4f6e 0%, #353850 55%, #262940 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.22),
    inset 0 -4px 6px rgba(0,0,0,.5),
    0 8px 14px rgba(0,0,0,.45);
  position: relative;
  cursor: pointer;
  transition: transform .15s ease;
  flex-shrink: 0;
}
.cart::before { /* grip ridges */
  content: "";
  position: absolute;
  top: 8px; left: 12px; right: 12px;
  height: 14px;
  background: repeating-linear-gradient(90deg, rgba(0,0,0,.4) 0 4px, rgba(255,255,255,.08) 4px 8px);
  border-radius: 3px;
}
.cart::after { /* notch */
  content: "";
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 60px; height: 6px;
  background: #14161f;
  border-radius: 3px 3px 0 0;
}
.cart-label {
  position: absolute;
  top: 28px; left: 8px; right: 8px; bottom: 12px;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
  padding: 6px 4px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), inset 0 -6px 10px rgba(0,0,0,.18);
  overflow: hidden;
}
.cart-label .cl-title {
  font-family: var(--pixel);
  font-size: 8px;
  line-height: 1.7;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0,0,0,.55);
}
.cart-label .cl-art { width: 40px; height: 32px; image-rendering: pixelated; }
.cart-label .cl-sub {
  font-size: 7px;
  font-weight: bold;
  letter-spacing: 1px;
  color: rgba(255,255,255,.85);
  text-transform: uppercase;
}
.cart:hover { transform: translateY(-6px) rotate(-1.5deg); }
.cart:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.cart[data-cart="court"] .cart-label { background: linear-gradient(160deg, #3a4ea8, #7b2f8e 60%, #c9355f); }
.cart[data-cart="slide"] .cart-label { background: linear-gradient(160deg, #0e7c66, #2ec4b6 70%, #9bf6e3); }
.cart[data-cart="reflex"] .cart-label { background: linear-gradient(160deg, #d97706, #ffd23f 75%); }
.cart[data-cart="reflex"] .cl-title, .cart[data-cart="reflex"] .cl-sub { color: #4a2c00; text-shadow: none; }

/* flying / seated animation states */
.cart.flying {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  transition: top .45s cubic-bezier(.5,-0.2,.35,1.1), left .45s cubic-bezier(.5,-0.2,.35,1.1), transform .45s;
  margin: 0;
}
.seated-cart {
  position: absolute;
  top: -58px;
  left: 50%;
  transform: translateX(-50%) translateY(46px);
  z-index: 5;
  transition: transform .3s cubic-bezier(.6,-0.4,.4,1.3), opacity .25s;
  opacity: 0;
  pointer-events: none;
}
.seated-cart.in { opacity: 1; transform: translateX(-50%) translateY(46px); }
.seated-cart .cart { cursor: default; width: 84px; height: 96px; }
.seated-cart .cart:hover { transform: none; }
.seated-cart.snap { animation: cartSnap .28s ease; }
@keyframes cartSnap {
  0% { transform: translateX(-50%) translateY(30px); }
  60% { transform: translateX(-50%) translateY(50px); }
  100% { transform: translateX(-50%) translateY(46px); }
}

/* ---------- top shell ---------- */
.shell-top {
  background: linear-gradient(180deg, var(--cream) 0%, #f2e3c2 100%);
  border-radius: 18px 18px 30px 30px;
  padding: 14px 16px 14px;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.9),
    inset 0 -6px 10px rgba(150,120,60,.25),
    0 4px 8px rgba(0,0,0,.25);
  color: var(--navy);
}

.brand-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.brand-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--yellow), var(--coral));
  box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.brand-name {
  font-weight: 900;
  font-style: italic;
  letter-spacing: 2px;
  font-size: 17px;
  color: var(--coral-dark);
  text-shadow: 0 1px 0 #fff;
}
.brand-model {
  margin-left: auto;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #8d7a58;
}

/* ---------- bezel + screen ---------- */
.bezel {
  background: linear-gradient(180deg, #3a3d5c, var(--navy) 30%, #1d1f30);
  border-radius: 14px 14px 34px 14px;
  padding: 16px 18px 8px;
  box-shadow:
    inset 0 3px 8px rgba(0,0,0,.7),
    0 1px 0 rgba(255,255,255,.7);
}
.bezel-glass { position: relative; }

.screen {
  position: relative;
  width: 100%;
  aspect-ratio: 10 / 9;
  background: #0b0f0c;
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    inset 0 0 22px rgba(0,0,0,.85),
    inset 0 0 4px rgba(0,0,0,.9);
  font-family: var(--pixel);
  /* brightness applied via filter from JS */
  transition: filter .25s;
}
.screen.off { filter: brightness(0) !important; }
.screen.fading { transition: filter .6s ease; }

.screen-off {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 40%, #101710 0%, #060a06 75%);
  opacity: 0;
  pointer-events: none;
  z-index: 40;
}

/* CRT scanlines + vignette */
.crt {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 30;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.38) 100%);
  mix-blend-mode: multiply;
  opacity: 1;
  transition: opacity .3s;
}
.crt.hidden { opacity: 0; }

.glare {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 35;
  background: linear-gradient(115deg, rgba(255,255,255,.09) 0%, transparent 28%);
  border-radius: 6px;
}

.bezel-caption {
  text-align: center;
  font-size: 7px;
  letter-spacing: 3px;
  color: #8f93b8;
  padding: 7px 0 4px;
  font-weight: bold;
}

/* CRT boot flicker / power effects */
.screen.crt-on { animation: crtOn .55s steps(12) 1; }
@keyframes crtOn {
  0%   { filter: brightness(0) contrast(1); transform: scaleY(.005) scaleX(.7); }
  35%  { filter: brightness(4) contrast(1.4); transform: scaleY(.02) scaleX(1); }
  55%  { filter: brightness(.5); transform: scaleY(1.02); }
  75%  { filter: brightness(1.6); }
  100% { filter: brightness(1); transform: none; }
}
.screen.crt-off { animation: crtOff .45s ease-in 1 forwards; }
@keyframes crtOff {
  0%   { filter: brightness(1); }
  55%  { filter: brightness(2.2); transform: scaleY(.01) scaleX(1); }
  80%  { filter: brightness(3); transform: scaleY(.004) scaleX(.5); opacity: 1; }
  100% { filter: brightness(0); transform: scaleY(.002) scaleX(.1); }
}

/* ---------- controls ---------- */
.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding: 0 6px;
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 34px);
  grid-template-rows: repeat(3, 34px);
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.35));
}
.dbtn, .d-center {
  background: linear-gradient(180deg, #454867, var(--navy) 60%);
  border: none;
  color: #9ea2c8;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.d-up    { grid-area: 1/2; border-radius: 7px 7px 0 0; }
.d-left  { grid-area: 2/1; border-radius: 7px 0 0 7px; }
.d-center{ grid-area: 2/2; cursor: default;
  background: radial-gradient(circle at 50% 45%, #4d5173, #33355a 70%); }
.d-right { grid-area: 2/3; border-radius: 0 7px 7px 0; }
.d-down  { grid-area: 3/2; border-radius: 0 0 7px 7px; }
.dbtn:active, .dbtn.pressed { filter: brightness(1.5); transform: translateY(1px); }

.face-buttons {
  display: flex;
  gap: 14px;
  transform: rotate(-16deg);
  margin-right: 10px;
}
.fbtn {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-family: var(--toy);
  font-weight: 900;
  font-size: 15px;
  color: rgba(0,0,0,.55);
  -webkit-tap-highlight-color: transparent;
}
.fbtn span { display: inline-block; transform: rotate(16deg); }
.btn-a {
  background: radial-gradient(circle at 32% 28%, #ffe89a, var(--yellow) 55%, #d9a816);
  box-shadow: 0 4px 0 #a67c00, 0 6px 8px rgba(0,0,0,.35), inset 0 -3px 6px rgba(0,0,0,.15);
}
.btn-b {
  background: radial-gradient(circle at 32% 28%, #9df0e8, var(--teal) 55%, #1d9c90);
  box-shadow: 0 4px 0 #12716a, 0 6px 8px rgba(0,0,0,.35), inset 0 -3px 6px rgba(0,0,0,.15);
}
.fbtn:active, .fbtn.pressed { transform: translateY(4px); box-shadow: 0 0 0 rgba(0,0,0,.3); }

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding: 0 12px;
}
.pill-buttons { display: flex; gap: 12px; }
.pill {
  font-family: var(--toy);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #5d6079;
  background: linear-gradient(180deg, #b9bcd4, #878ba8);
  border: none;
  border-radius: 10px;
  padding: 6px 14px;
  transform: rotate(-8deg);
  cursor: pointer;
  box-shadow: 0 3px 0 #5a5e7c, 0 4px 5px rgba(0,0,0,.3);
  -webkit-tap-highlight-color: transparent;
}
.pill:active, .pill.pressed { transform: rotate(-8deg) translateY(3px); box-shadow: 0 0 0 #5a5e7c; }

.speaker {
  display: grid;
  grid-template-columns: repeat(3, 8px);
  gap: 7px;
  transform: rotate(-14deg);
  margin-right: 6px;
}
.speaker i {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #6b6486, #241f3a 75%);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.8), 0 1px 0 rgba(255,255,255,.5);
}

/* ---------- hardware row ---------- */
.hw-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 10px 12px 4px;
  border-top: 2px dashed rgba(43,45,66,.25);
  flex-wrap: wrap;
}
.hw-label {
  display: block;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #8d7a58;
  margin-bottom: 5px;
}
.power-box { display: flex; flex-direction: column; }
.power-switch {
  width: 52px; height: 24px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(180deg, #6e1623, #4c0e18);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.6), 0 1px 0 rgba(255,255,255,.6);
  cursor: pointer;
  position: relative;
  padding: 0;
}
.power-switch .knob {
  position: absolute;
  top: 2px; left: 3px;
  width: 22px; height: 20px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #cfc4ae);
  box-shadow: 0 2px 3px rgba(0,0,0,.45);
  transition: left .14s ease;
}
.power-switch[aria-checked="true"] .knob { left: 27px; }
.power-led {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  align-self: center;
  background: #571318;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.6);
  transition: background .2s, box-shadow .2s;
}
.power-led.on {
  background: #4dff88;
  box-shadow: 0 0 8px #4dff88, 0 0 2px #fff;
}

.vol-box input[type="range"], .bright-box input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 92px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(180deg, #b7a887, #8d7a58);
  box-shadow: inset 0 2px 3px rgba(0,0,0,.35);
  outline: none;
  cursor: pointer;
}
.vol-box input[type="range"]::-webkit-slider-thumb,
.bright-box input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #cfc4ae 70%);
  box-shadow: 0 2px 3px rgba(0,0,0,.4);
}
.vol-box input[type="range"]::-moz-range-thumb,
.bright-box input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 35% 30%, #fff, #cfc4ae 70%);
  box-shadow: 0 2px 3px rgba(0,0,0,.4);
}
.scan-toggle {
  margin-top: 4px;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 1px;
  font-family: var(--toy);
  color: #5d6079;
  background: linear-gradient(180deg, #e8e2d2, #bdb49c);
  border: none;
  border-radius: 5px;
  padding: 4px 8px;
  cursor: pointer;
  box-shadow: 0 2px 0 #8d7a58;
}
.scan-toggle[aria-pressed="false"] { opacity: .45; }

.hw-hints {
  margin-top: 12px;
  text-align: center;
  font-size: 9px;
  letter-spacing: 1px;
  color: #9c8b66;
}

/* ============================================================
   SHELF
   ============================================================ */
.shelf-wrap {
  width: 300px;
  max-width: 94vw;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 18px;
  padding: 20px 20px 24px;
  box-shadow: 0 14px 30px rgba(0,0,0,.35);
}
.shelf-title {
  font-family: var(--pixel);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--yellow);
  text-shadow: 0 2px 0 rgba(0,0,0,.5);
  text-align: center;
  margin-bottom: 16px;
}
.shelf {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: flex-end;
  min-height: 128px;
  padding: 12px 8px 0;
  border-bottom: 8px solid #4a3b68;
  border-radius: 4px;
  flex-wrap: wrap;
}
.shelf-slot-empty {
  width: 96px; height: 108px;
  border-radius: 8px;
  border: 2px dashed rgba(255,255,255,.14);
  flex-shrink: 0;
}
.shelf-note {
  text-align: center;
  font-size: 12px;
  color: #b7a8d8;
  margin-top: 12px;
  min-height: 16px;
}
.shelf-manual {
  margin-top: 18px;
  background: rgba(0,0,0,.25);
  border-radius: 10px;
  padding: 14px 16px;
}
.shelf-manual h3 {
  font-family: var(--pixel);
  font-size: 9px;
  color: var(--teal);
  letter-spacing: 2px;
  margin-bottom: 10px;
}
.shelf-manual ul { list-style: none; }
.shelf-manual li {
  font-size: 12px;
  line-height: 1.65;
  color: #cfc2ea;
  padding-left: 14px;
  position: relative;
  margin-bottom: 4px;
}
.shelf-manual li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--coral);
}
.shelf-manual b { color: var(--yellow); font-weight: bold; }

/* ============================================================
   ON-SCREEN GAME UI  (rendered inside .screen)
   ============================================================ */
.gb {
  position: absolute;
  inset: 0;
  color: #e8f5e9;
  font-family: var(--pixel);
  font-size: 9px;
  line-height: 1.9;
  overflow: hidden;
  z-index: 10;
  /* DMG-style deep green-black backdrop default */
  background: #0e1a12;
}
.gb * { box-sizing: border-box; }

/* ---- boot ---- */
.gb-boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #e8f5e9;
  color: #1d2b1f;
}
.boot-logo {
  font-size: 17px;
  letter-spacing: 3px;
  color: #14301c;
  position: relative;
  opacity: 0;
  animation: bootDrop .8s cubic-bezier(.3,1.4,.5,1) .35s forwards;
}
@keyframes bootDrop {
  0% { transform: translateY(-70px); opacity: 0; }
  60% { transform: translateY(4px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}
.boot-logo::after {
  content: "";
  position: absolute;
  left: -30px; top: 2px;
  width: 16px; height: 10px;
  background: linear-gradient(90deg, transparent, #2f7a44);
  border-radius: 3px;
  animation: cometSweep .8s ease-in .2s 1 forwards;
  opacity: 0;
}
@keyframes cometSweep {
  0% { left: -34px; opacity: 0; }
  20% { opacity: 1; }
  100% { left: calc(100% + 18px); opacity: 0; }
}
.boot-tm {
  font-size: 6px;
  letter-spacing: 1px;
  opacity: 0;
  animation: bootFade .4s 1.1s forwards;
}
.boot-reg {
  position: absolute;
  bottom: 14px;
  font-size: 6px;
  letter-spacing: 1px;
  color: #4c6b52;
  opacity: 0;
  animation: bootFade .4s 1.3s forwards;
}
@keyframes bootFade { to { opacity: 1; } }

/* ---- no cart ---- */
.gb-nocart {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  background: #101a24;
}
.gb-nocart .nc-title { font-size: 11px; color: #6fb7ff; animation: blink 1.2s steps(2) infinite; }
.gb-nocart .nc-sub { font-size: 7px; color: #4a6a8a; line-height: 2; }
@keyframes blink { 50% { opacity: .25; } }

/* ---- generic title screen ---- */
.gb-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}
.gt-logo { font-size: 15px; line-height: 2; }
.gt-sub { font-size: 7px; opacity: .8; line-height: 2; }
.gt-press { font-size: 8px; margin-top: 8px; animation: blink 1.1s steps(2) infinite; }
.gt-menu { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.gt-menu .mi { font-size: 9px; opacity: .55; }
.gt-menu .mi.sel { opacity: 1; }
.gt-menu .mi.sel::before { content: "▶ "; }

/* ============================================================
   STAR WITNESS (courtroom)
   ============================================================ */
.gb-court { background: #1a1428; }
.court-scene {
  position: absolute;
  inset: 0 0 84px 0;
  overflow: hidden;
}
.court-bg {
  position: absolute; inset: 0;
  image-rendering: pixelated;
  width: 100%; height: 100%;
}
.court-actor {
  position: absolute;
  bottom: 0;
  image-rendering: pixelated;
  transition: left .25s ease, opacity .25s, transform .1s;
}
.court-actor.talk { animation: talkBob .3s steps(2) infinite; }
@keyframes talkBob { 50% { transform: translateY(-2px); } }
.court-actor.shake { animation: actorShake .4s linear; }
@keyframes actorShake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.name-tag {
  position: absolute;
  top: 6px; left: 6px;
  background: rgba(10,8,20,.85);
  border: 2px solid #ffd23f;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 7px;
  color: #ffd23f;
  z-index: 6;
}
.dialogue-box {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 84px;
  background: linear-gradient(180deg, #241d3d, #17122a);
  border-top: 3px solid #4a3b78;
  padding: 10px 12px;
  z-index: 7;
}
.dialogue-text { font-size: 8px; line-height: 2; color: #f2ecff; min-height: 48px; }
.dialogue-text .who { color: #ffd23f; }
.dlg-next {
  position: absolute;
  right: 10px; bottom: 6px;
  font-size: 8px;
  color: #2ec4b6;
  animation: blink 1s steps(2) infinite;
}

/* text color cues inside dialogue */
.tw-pros { color: #ff9de2; }
.tw-think { color: #2ec4b6; }
.tw-sys { color: #ffd23f; }

/* objection / hold it burst */
.burst {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: none;
  animation: burstPop .7s cubic-bezier(.2,1.6,.4,1) forwards;
}
.burst span {
  font-size: 22px;
  color: #ff5964;
  -webkit-text-stroke: 2px #fff;
  text-shadow: 4px 4px 0 #2b2d42, 0 0 30px rgba(255,89,100,.8);
  transform: rotate(-6deg);
  background: rgba(255,243,220,.12);
  padding: 8px 14px;
  border-radius: 6px;
}
.burst.holdit span { color: #2ec4b6; }
@keyframes burstPop {
  0% { transform: scale(.2); opacity: 0; }
  30% { transform: scale(1.15); opacity: 1; }
  60% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.05); opacity: 0; }
}
.screen-shake { animation: screenShake .4s linear; }
@keyframes screenShake {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-4px,2px); }
  40% { transform: translate(4px,-2px); }
  60% { transform: translate(-3px,-2px); }
  80% { transform: translate(3px,2px); }
}
.flash-white { animation: flashWhite .3s ease; }
@keyframes flashWhite {
  0% { filter: brightness(1); } 30% { filter: brightness(2.6); } 100% { filter: brightness(1); }
}

/* testimony HUD */
.test-hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  background: rgba(10,8,20,.8);
  z-index: 8;
  font-size: 6px;
  color: #b7a8d8;
}
.strikes { display: flex; gap: 3px; }
.strike {
  width: 8px; height: 8px;
  background: #ffd23f;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.strike.lost { background: #3d3358; }

.test-controls {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  background: #17122a;
  border-top: 3px solid #4a3b78;
  z-index: 9;
  font-size: 6px;
  color: #8d7fb0;
}
.test-controls b { color: #ffd23f; }
.stmt-box {
  position: absolute;
  left: 0; right: 0; bottom: 30px;
  min-height: 62px;
  background: linear-gradient(180deg, #2b2148, #1d1636);
  border-top: 3px solid #4a3b78;
  padding: 10px 14px;
  z-index: 8;
}
.stmt-text { font-size: 8px; line-height: 2; color: #eaffea; }
.stmt-nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  font-size: 10px; color: #2ec4b6;
  animation: blink 1s steps(2) infinite;
}
.stmt-nav.l { left: 4px; } .stmt-nav.r { right: 4px; }

/* court record overlay */
.record {
  position: absolute;
  inset: 0;
  background: rgba(8,6,16,.96);
  z-index: 25;
  display: flex;
  flex-direction: column;
  padding: 10px;
}
.record h4 {
  font-size: 9px;
  color: #ffd23f;
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-align: center;
}
.record-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
}
.ev-item {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #241d3d;
  border: 2px solid #3d3358;
  border-radius: 5px;
  padding: 6px;
  cursor: pointer;
}
.ev-item.sel { border-color: #ffd23f; background: #322752; }
.ev-item .ev-icon { width: 28px; height: 28px; image-rendering: pixelated; flex-shrink: 0; }
.ev-item .ev-name { font-size: 7px; color: #fff; line-height: 1.8; }
.ev-item .ev-desc { font-size: 6px; color: #9d90c4; line-height: 1.7; }
.record-foot {
  padding-top: 8px;
  text-align: center;
  font-size: 6px;
  color: #8d7fb0;
}

/* choice menu */
.choice-menu {
  position: absolute;
  left: 14px; right: 14px; bottom: 90px;
  background: #241d3d;
  border: 3px solid #ffd23f;
  border-radius: 6px;
  padding: 8px;
  z-index: 22;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.choice-menu .ci { font-size: 8px; padding: 4px 6px; color: #cfc2ea; line-height: 1.8; }
.choice-menu .ci.sel { color: #fff; background: #4a3b78; border-radius: 4px; }
.choice-menu .ci.sel::before { content: "▶ "; color: #ffd23f; }

/* verdict / endings */
.verdict-banner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  z-index: 26;
  padding: 16px;
}
.verdict-banner .vb-big { font-size: 16px; line-height: 2; }
.verdict-banner .vb-sub { font-size: 7px; line-height: 2.2; opacity: .85; }
.vb-notguilty { background: radial-gradient(circle at 50% 40%, #14532d, #052e16); }
.vb-notguilty .vb-big { color: #4dff88; text-shadow: 0 0 18px rgba(77,255,136,.6); }
.vb-guilty { background: radial-gradient(circle at 50% 40%, #4c0519, #1f0210); }
.vb-guilty .vb-big { color: #ff5964; text-shadow: 0 0 18px rgba(255,89,100,.6); }

/* fade helpers */
.gb-fadeout { animation: gbFade .5s forwards; }
@keyframes gbFade { to { opacity: 0; } }

/* ============================================================
   PIXEL SLIDE
   ============================================================ */
.gb-slide { background: #08231f; display: flex; flex-direction: column; }
.slide-hud {
  display: flex;
  justify-content: space-between;
  padding: 7px 10px;
  font-size: 7px;
  color: #9bf6e3;
}
.slide-board-wrap { flex: 1; display: flex; align-items: center; justify-content: center; }
.slide-board {
  display: grid;
  gap: 2px;
  background: #031511;
  padding: 4px;
  border-radius: 4px;
  position: relative;
}
.tile {
  border-radius: 2px;
  cursor: pointer;
  image-rendering: pixelated;
  transition: transform .12s ease;
}
.tile.empty { background: transparent; cursor: default; }
.slide-msg {
  text-align: center;
  font-size: 8px;
  color: #ffd23f;
  padding: 8px;
  min-height: 26px;
}
.slide-win {
  position: absolute; inset: 0;
  background: rgba(4,30,24,.94);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; z-index: 20;
  text-align: center;
}
.slide-win .sw-big { color: #4dff88; font-size: 12px; line-height: 2; }
.slide-win .sw-sub { font-size: 7px; color: #9bf6e3; line-height: 2.2; }

/* ============================================================
   LIGHTSPEED (reflex)
   ============================================================ */
.gb-reflex {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  transition: background .08s;
}
.gb-reflex { background: #1a1030; }
.gb-reflex.armed { background: #3d0e1e; }
.gb-reflex.go { background: #0b3d20; }
.rx-light {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: #3a3350;
  box-shadow: inset 0 -4px 8px rgba(0,0,0,.5);
  transition: background .05s, box-shadow .05s;
}
.gb-reflex.armed .rx-light { background: #ff5964; box-shadow: 0 0 22px rgba(255,89,100,.8); }
.gb-reflex.go .rx-light { background: #4dff88; box-shadow: 0 0 30px rgba(77,255,136,.9); }
.rx-text { font-size: 9px; line-height: 2.2; color: #e8ddff; }
.rx-stats { font-size: 7px; color: #9d90c4; line-height: 2.2; }
.rx-best { color: #ffd23f; }

/* actor stage positions (percent-based over the courtroom bg) */
.court-actor { height: auto; }
.pos-stand   { left: 1%;  bottom: 34%; width: 26%; z-index: 2; }
.pos-judge   { left: 50%; transform: translateX(-50%); bottom: 56%; width: 21%; }
.pos-judge.talk { animation: none; } /* judge sits too high to bob nicely */
.pos-defense { left: 3%;  bottom: -3%; width: 30%; z-index: 3; }
.pos-pros    { right: 3%; bottom: -3%; width: 30%; left: auto; z-index: 3; }
.pos-stand.talk, .pos-defense.talk, .pos-pros.talk { animation: talkBob .3s steps(2) infinite; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .desk { gap: 26px; }
}
@media (max-width: 520px) {
  body { padding: 12px 8px 30px; }
  .console { padding: 58px 12px 16px; border-radius: 20px 20px 34px 34px; }
  .shell-top { padding: 10px 10px 12px; }
  .bezel { padding: 12px 12px 6px; }
  .dpad { grid-template-columns: repeat(3, 30px); grid-template-rows: repeat(3, 30px); }
  .fbtn { width: 40px; height: 40px; }
  .hw-hints { display: none; }
  .slot { width: 150px; }
  .site-header { margin-bottom: 14px; }
}
