/* ==========================================================================
   RETRO SHELL // JLP ARCADE DESIGN SYSTEM v2.0
   Shared by arcade-station and every pixel-*-arcade cabinet.
   Synthwave room + neon marquee + CRT monitor + playable control deck +
   90s web-dev status bar (88x31 buttons, hit counter, blinking cursor).
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

:root {
  --accent: #00f5d4;
  --accent-2: #ff2e88;
  --amber: #fda415;
  --hot: #ff334b;
  --ink: #fff5ea;
  --muted: #b39ebd;
  --night-0: #07020f;
  --night-1: #140726;
  --night-2: #2a0b45;
  --cab-0: #1a0c20;
  --cab-1: #28162e;
  --cab-2: #3c2049;
  --screen: #351d3d;
  --font-pixel: 'Press Start 2P', monospace;
  --font-term: 'VT323', 'Courier New', monospace;
}

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

html { background: var(--night-0); }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--night-0);
  color: var(--ink);
  font-family: var(--font-pixel);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 10px 18px;
  overflow-x: hidden;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--amber); }

/* --------------------------------------------------------------------------
   1. SYNTHWAVE ROOM (sky, stars, sun, moving neon grid floor)
   -------------------------------------------------------------------------- */
.sw-room {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% 62%, rgba(255, 46, 136, 0.28), transparent 70%),
    linear-gradient(180deg, var(--night-0) 0%, var(--night-1) 38%, var(--night-2) 62%, #12031f 62.2%, #05010a 100%);
}

.sw-stars { position: absolute; inset: 0; width: 100%; height: 62%; }

.sw-sun {
  position: absolute;
  left: 50%;
  top: 62%;
  width: min(46vw, 420px);
  aspect-ratio: 1;
  transform: translate(-50%, -78%);
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe66d 0%, #ffb347 30%, #ff5e7e 62%, #c724b1 100%);
  -webkit-mask: repeating-linear-gradient(180deg, #000 0 14px, transparent 14px 18px),
                linear-gradient(#000 0 52%, transparent 52%);
  -webkit-mask-composite: source-over;
  mask: linear-gradient(180deg, #000 0 52%, transparent 52%) ,
        repeating-linear-gradient(180deg, #000 0 10px, transparent 10px 14px);
  mask-composite: add;
  filter: drop-shadow(0 0 40px rgba(255, 94, 126, 0.65));
  opacity: 0.85;
  animation: sun-pulse 6s ease-in-out infinite;
}

@keyframes sun-pulse {
  0%, 100% { filter: drop-shadow(0 0 30px rgba(255, 94, 126, 0.55)); }
  50% { filter: drop-shadow(0 0 60px rgba(255, 94, 126, 0.85)); }
}

.sw-floor {
  position: absolute;
  left: -50%;
  right: -50%;
  top: 62%;
  height: 80%;
  transform-origin: top center;
  transform: perspective(320px) rotateX(62deg);
  background-image:
    linear-gradient(to right, rgba(255, 46, 136, 0.75) 2px, transparent 2px),
    linear-gradient(to bottom, rgba(0, 245, 212, 0.65) 2px, transparent 2px);
  background-size: 60px 60px;
  animation: grid-run 1.6s linear infinite;
  -webkit-mask: linear-gradient(to bottom, transparent 0%, #000 18%, #000 100%);
  mask: linear-gradient(to bottom, transparent 0%, #000 18%, #000 100%);
}

.sw-horizon {
  position: absolute;
  left: 0; right: 0;
  top: 62%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-2), var(--accent), var(--accent-2), transparent);
  box-shadow: 0 0 18px var(--accent-2), 0 0 40px var(--accent);
}

@keyframes grid-run { to { background-position: 0 60px; } }

/* --------------------------------------------------------------------------
   2. PAGE FRAME
   -------------------------------------------------------------------------- */
.arcade-viewport {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --------------------------------------------------------------------------
   3. NEON MARQUEE
   -------------------------------------------------------------------------- */
.marquee {
  width: 100%;
  max-width: 640px;
  margin-bottom: 10px;
  padding: 12px 18px 10px;
  border-radius: 22px 22px 8px 8px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.12), transparent 60%),
    linear-gradient(180deg, #2b0f3a, #160620);
  border: 3px solid #3c2049;
  box-shadow:
    0 0 0 2px #0b0410,
    0 0 26px color-mix(in srgb, var(--accent) 45%, transparent),
    inset 0 0 22px rgba(0, 0, 0, 0.75);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.marquee-tag {
  font-family: var(--font-term);
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--muted);
  opacity: 0.85;
}
.marquee-tag .tk { color: var(--accent-2); }
.marquee-tag .at { color: var(--amber); }
.marquee-tag .vl { color: var(--accent); }

.marquee-title {
  font-size: clamp(18px, 4.6vw, 30px);
  line-height: 1.25;
  margin: 4px 0 2px;
  color: #fff;
  letter-spacing: 2px;
  text-shadow:
    0 0 4px #fff,
    0 0 10px var(--accent),
    0 0 22px var(--accent),
    0 0 42px var(--accent-2),
    3px 3px 0 #2a0b45;
  animation: neon-flicker 7s infinite;
}

.marquee-title .flick { animation: letter-dropout 4.3s infinite; }

@keyframes neon-flicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: 0.55; }
}
@keyframes letter-dropout {
  0%, 62%, 66%, 70%, 100% { opacity: 1; text-shadow: inherit; }
  64%, 68% { opacity: 0.2; text-shadow: none; }
}

/* HTML <marquee>-style ticker (a nod to the 90s web) */
.ticker {
  margin-top: 6px;
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  padding-top: 6px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track {
  display: inline-block;
  font-family: var(--font-term);
  font-size: 17px;
  color: var(--amber);
  animation: ticker 26s linear infinite;
}
.ticker-track span { margin-right: 46px; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* --------------------------------------------------------------------------
   4. CABINET + CRT MONITOR
   -------------------------------------------------------------------------- */
.arcade-cabinet {
  position: relative;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 30%),
    var(--cab-1);
  border: 8px solid #1f1025;
  border-radius: 40px;
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.9),
    inset 0 3px 8px rgba(255, 255, 255, 0.1),
    0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent),
    0 0 36px color-mix(in srgb, var(--accent) 35%, transparent),
    0 0 90px color-mix(in srgb, var(--accent-2) 25%, transparent);
  animation: cab-breathe 5s ease-in-out infinite;
}

@keyframes cab-breathe {
  0%, 100% { box-shadow: 0 30px 70px rgba(0,0,0,.9), inset 0 3px 8px rgba(255,255,255,.1), 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent), 0 0 30px color-mix(in srgb, var(--accent) 30%, transparent), 0 0 80px color-mix(in srgb, var(--accent-2) 20%, transparent); }
  50% { box-shadow: 0 30px 70px rgba(0,0,0,.9), inset 0 3px 8px rgba(255,255,255,.1), 0 0 0 2px color-mix(in srgb, var(--accent) 75%, transparent), 0 0 46px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 110px color-mix(in srgb, var(--accent-2) 32%, transparent); }
}

/* Bezel: dark glass frame so no game pixels are lost to rounded corners */
.screen-bezel {
  padding: 12px;
  border-radius: 30px;
  background: linear-gradient(145deg, #0d0611, #1b0d21 60%, #0a040d);
  box-shadow: inset 0 0 0 2px #2a1532, inset 0 6px 18px rgba(0, 0, 0, 0.9);
  max-width: 100%;
}

.screen-wrapper {
  position: relative;
  width: 560px;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  background: var(--screen);
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.8), 0 0 0 2px #050206;
  transform-origin: center;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: saturate(1.12) contrast(1.06);
}

/* CRT layers: scanlines, rolling refresh band, vignette, phosphor flicker */
.lcd-dotmatrix-overlay,
.crt-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  background:
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.18) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.035), rgba(0, 255, 0, 0.015), rgba(0, 0, 255, 0.035));
  background-size: 100% 3px, 3px 100%;
}
.crt-overlay::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 22%;
  top: -25%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.045), transparent);
  animation: refresh-roll 7s linear infinite;
}
.crt-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, 0.55) 100%);
  animation: phosphor 0.14s steps(2) infinite;
}
@keyframes refresh-roll { to { top: 110%; } }
@keyframes phosphor { 50% { opacity: 0.93; } }

/* Glass glare */
.crt-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 11;
  background:
    radial-gradient(ellipse 60% 35% at 22% 10%, rgba(255, 255, 255, 0.10), transparent 70%),
    linear-gradient(115deg, transparent 60%, rgba(255, 255, 255, 0.035) 62%, transparent 70%);
}

/* Power transitions */
.screen-wrapper.crt-off { animation: crt-off 0.42s cubic-bezier(.7,0,.84,0) forwards; }
.screen-wrapper.crt-on  { animation: crt-on 0.6s cubic-bezier(.16,1,.3,1) forwards; }

@keyframes crt-off {
  0%   { transform: scale(1, 1); filter: brightness(1); }
  45%  { transform: scale(1, 0.006); filter: brightness(3); }
  80%  { transform: scale(0.15, 0.006); filter: brightness(5); }
  100% { transform: scale(0, 0); filter: brightness(0); }
}
@keyframes crt-on {
  0%   { transform: scale(0, 0.006); filter: brightness(5); }
  35%  { transform: scale(1, 0.006); filter: brightness(4); }
  70%  { transform: scale(1, 1.03); filter: brightness(1.6); }
  100% { transform: scale(1, 1); filter: brightness(1); }
}

/* --------------------------------------------------------------------------
   5. CONTROL PANEL — real arcade hardware look
      (3/4 ball-top joystick, Sanwa-style concave buttons with LED rings,
       illuminated START/SELECT, 80s racing stripes). Reacts to the keyboard
       and doubles as a touch gamepad on phones.
   -------------------------------------------------------------------------- */
.arcade-control-deck {
  position: relative;
  width: calc(100% + 32px);
  margin: 16px -16px -18px;
  padding: 18px 30px 20px;
  border-radius: 6px 6px 32px 32px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  touch-action: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10) 0, rgba(255,255,255,0) 6px),
    radial-gradient(ellipse 70% 120% at 50% -20%, rgba(255,255,255,0.07), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #23232c 0%, #15151b 55%, #0d0d12 100%);
  border-top: 3px solid #3a3a46;
  box-shadow:
    inset 0 -10px 18px rgba(0,0,0,0.6),
    inset 0 2px 0 rgba(255,255,255,0.08),
    0 -2px 0 #0a0a0d;
  overflow: hidden;
}

/* 80s racing stripes printed on the panel artwork */
.deck-stripes {
  position: absolute;
  left: 0; right: 0;
  bottom: 14px;
  height: 14px;
  pointer-events: none;
  background: linear-gradient(180deg,
    var(--amber) 0 3px, transparent 3px 5px,
    var(--accent-2) 5px 8px, transparent 8px 10px,
    var(--accent) 10px 13px, transparent 13px);
  opacity: 0.55;
  -webkit-mask: linear-gradient(90deg, transparent 0, #000 22%, #000 78%, transparent 100%);
  mask: linear-gradient(90deg, transparent 0, #000 22%, #000 78%, transparent 100%);
}
.deck-player-tag {
  position: absolute;
  top: 8px;
  left: 14px;
  font-size: 7px;
  color: #6f6f80;
  letter-spacing: 2px;
}

/* --- Joystick (SVG) --- */
.joystick-assembly {
  position: relative;
  width: 104px;
  height: 104px;
  cursor: grab;
  z-index: 1;
}
.joystick-assembly svg { width: 100%; height: 100%; overflow: visible; display: block; }
.js-stick {
  transform-box: view-box;
  transform-origin: 60px 90px;
  transition: transform 0.07s ease-out;
}
.joystick-assembly[data-dir="left"]  .js-stick { transform: rotate(-17deg); }
.joystick-assembly[data-dir="right"] .js-stick { transform: rotate(17deg); }
.joystick-assembly[data-dir="up"]    .js-stick { transform: translateY(-3px) scaleY(1.05); }
.joystick-assembly[data-dir="down"]  .js-stick { transform: translateY(4px) scaleY(0.86); }
.js-shadow { transition: transform 0.07s ease-out; transform-box: view-box; transform-origin: 60px 90px; }
.joystick-assembly[data-dir="left"]  .js-shadow { transform: translateX(-9px); }
.joystick-assembly[data-dir="right"] .js-shadow { transform: translateX(9px); }

/* --- Center: illuminated START / SELECT + label --- */
.deck-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
  z-index: 1;
}
.deck-label {
  font-size: 7px;
  color: #8d8d9e;
  letter-spacing: 3px;
  text-align: center;
  text-shadow: 0 1px 0 #000;
}
.deck-meta { display: flex; gap: 14px; }
.deck-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-pixel);
  font-size: 6px;
  letter-spacing: 1px;
  color: #8d8d9e;
}
.deck-mini .cap {
  display: block;
  width: 46px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(180deg, #fff 0%, var(--c, var(--accent)) 40%, color-mix(in srgb, var(--c, var(--accent)) 60%, #000) 100%);
  box-shadow:
    0 0 0 3px #08080b,
    0 0 0 4px #33333d,
    0 3px 0 4px #050507,
    0 0 14px color-mix(in srgb, var(--c, var(--accent)) 55%, transparent);
  opacity: 0.9;
  transition: transform 0.05s, box-shadow 0.1s, filter 0.1s;
  animation: led-breathe 2.4s ease-in-out infinite;
}
.deck-mini.start .cap { --c: var(--amber); }
.deck-mini.select .cap { --c: #9aa3ff; animation-delay: 1.2s; }
.deck-mini.is-pressed .cap {
  transform: translateY(2px);
  filter: brightness(1.5);
  box-shadow: 0 0 0 3px #08080b, 0 0 0 4px #33333d, 0 1px 0 4px #050507, 0 0 26px var(--c, var(--accent));
}
@keyframes led-breathe { 0%,100% { filter: brightness(0.85); } 50% { filter: brightness(1.2); } }

/* --- Sanwa-style action buttons --- */
.buttons-assembly {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  z-index: 1;
}
.arcade-btn-socket {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}
.arcade-btn-socket:nth-child(2) { transform: translateY(-14px); }
.abtn {
  --c: var(--amber);
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  /* chrome/black bezel ring */
  background:
    radial-gradient(circle at 50% 50%, #0b0b0f 0 56%, transparent 57%),
    conic-gradient(from 210deg, #5d5d6b, #15151b 25%, #3f3f4b 45%, #0e0e12 65%, #6a6a78 85%, #5d5d6b);
  box-shadow:
    0 0 0 2px #050507,
    0 7px 0 #050507,
    0 12px 18px rgba(0, 0, 0, 0.65);
}
/* LED ring */
.abtn::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 35%, #000), inset 0 0 6px color-mix(in srgb, var(--c) 30%, transparent);
  transition: box-shadow 0.08s;
}
/* concave plunger */
.abtn .plunger {
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse 60% 40% at 50% 78%, rgba(255,255,255,0.35), transparent 70%),
    radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--c) 70%, #000) 0%, var(--c) 55%, color-mix(in srgb, var(--c) 75%, #fff) 100%);
  box-shadow:
    inset 0 5px 8px rgba(0, 0, 0, 0.45),
    inset 0 -2px 3px rgba(255, 255, 255, 0.45),
    0 5px 0 color-mix(in srgb, var(--c) 45%, #000),
    0 6px 4px rgba(0, 0, 0, 0.5);
  transform: translateY(-4px);
  transition: transform 0.05s, box-shadow 0.05s, filter 0.05s;
}
.abtn .plunger::after {
  content: '';
  position: absolute;
  left: 22%; top: 10%;
  width: 34%; height: 16%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  filter: blur(1px);
}
.abtn.btn-b { --c: var(--hot); }
.abtn.btn-c { --c: #00bbf9; }
.arcade-btn-socket.is-pressed .abtn .plunger {
  transform: translateY(0);
  filter: brightness(1.25);
  box-shadow:
    inset 0 5px 8px rgba(0, 0, 0, 0.5),
    inset 0 -2px 3px rgba(255, 255, 255, 0.45),
    0 1px 0 color-mix(in srgb, var(--c) 45%, #000);
}
.arcade-btn-socket.is-pressed .abtn::before {
  box-shadow: 0 0 0 2px var(--c), 0 0 16px 3px var(--c), inset 0 0 10px var(--c);
}
.btn-tag {
  font-size: 7px;
  color: #8d8d9e;
  letter-spacing: 1px;
  text-shadow: 0 1px 0 #000;
  white-space: nowrap;
}
.btn-tag em { font-style: normal; color: #5f5f70; display: block; text-align: center; margin-top: 3px; font-size: 5px; }

/* --------------------------------------------------------------------------
   6. HUB CARTRIDGE TABS + EXIT BUTTON
   -------------------------------------------------------------------------- */
.station-top-bar {
  position: relative;
  z-index: 5;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.cartridge-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.cartridge-tab-btn {
  --c: var(--accent);
  position: relative;
  background: linear-gradient(180deg, #2b1636, #170a1d);
  color: var(--ink);
  border: 2px solid #4a2a5c;
  border-bottom: 4px solid #0d0611;
  border-radius: 8px 8px 4px 4px;
  padding: 8px 10px 6px;
  font-family: var(--font-pixel);
  font-size: 8px;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s, background 0.12s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.55);
}
.cartridge-tab-btn::before {
  content: '';
  position: absolute;
  left: 8px; right: 8px; top: 3px;
  height: 2px;
  background: var(--c);
  border-radius: 2px;
  opacity: 0.8;
}
.cartridge-tab-btn:hover,
.cartridge-tab-btn.is-active {
  transform: translateY(-3px);
  border-color: var(--c);
  box-shadow: 0 0 14px color-mix(in srgb, var(--c) 60%, transparent), 0 6px 12px rgba(0, 0, 0, 0.6);
  background: linear-gradient(180deg, #3a1d48, #1d0c25);
}
.cartridge-tab-btn:focus-visible { outline: 2px dashed var(--c); outline-offset: 3px; }

.hub-pill-btn {
  background: var(--hot);
  color: #fff;
  border: 2px solid #ff758f;
  border-radius: 8px;
  padding: 7px 14px;
  font-family: var(--font-pixel);
  font-size: 8px;
  cursor: pointer;
  animation: pulse-exit 1.6s infinite ease-in-out;
  box-shadow: 0 4px 12px rgba(255, 51, 75, 0.6);
}
.hub-pill-btn:hover { background: #fff; color: var(--hot); }
@keyframes pulse-exit { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* --------------------------------------------------------------------------
   7. 90s WEB-DEV STATUS BAR (terminal prompt + 88x31 buttons)
   -------------------------------------------------------------------------- */
.status-bar {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 640px;
  margin-top: 14px;
  border-radius: 8px;
  background: rgba(8, 3, 14, 0.82);
  border: 2px solid #2d1838;
  box-shadow: 0 0 0 1px #000, 0 10px 30px rgba(0, 0, 0, 0.6);
  font-family: var(--font-term);
  font-size: 18px;
  color: #c5ffd8;
  overflow: hidden;
  backdrop-filter: blur(3px);
}
.status-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff;
  font-size: 16px;
}
.status-titlebar .dots { margin-left: auto; display: flex; gap: 4px; }
.status-titlebar .dots i {
  display: block;
  width: 14px; height: 12px;
  background: #c0c0c0;
  border: 1px solid #fff;
  border-right-color: #404040;
  border-bottom-color: #404040;
}
.status-body { padding: 8px 12px 10px; }
.status-line { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.status-line .prompt { color: var(--accent); }
.status-line .path { color: #7aa2ff; }
.status-line .cmd { color: #fff; }
.cursor {
  display: inline-block;
  width: 9px;
  height: 16px;
  background: #c5ffd8;
  vertical-align: -2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.status-stats {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  color: var(--muted);
}
.status-stats b { color: var(--amber); font-weight: normal; }
.hit-counter {
  display: inline-flex;
  gap: 1px;
  vertical-align: middle;
}
.hit-counter i {
  font-style: normal;
  background: #000;
  color: #39ff14;
  border: 1px solid #333;
  padding: 0 3px;
  line-height: 18px;
}

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge-88 {
  width: 88px;
  height: 31px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  font-family: var(--font-pixel);
  font-size: 6px;
  line-height: 1.5;
  letter-spacing: 0.5px;
  color: #fff;
  border: 2px outset #d4d0c8;
  image-rendering: pixelated;
  transition: transform 0.1s;
}
.badge-88:hover { transform: translateY(-2px) rotate(-1deg); }
.badge-88 strong { font-size: 8px; font-weight: normal; }
.b-js   { background: linear-gradient(180deg, #f7df1e 0 50%, #222 50%); color: #000; }
.b-js strong { color: #000; } .b-js span { color: #f7df1e; }
.b-audio { background: linear-gradient(90deg, #ff2e88, #7b2ff7); }
.b-nofw  { background: repeating-linear-gradient(45deg, #111 0 6px, #2b2b2b 6px 12px); color: #39ff14; }
.b-src   { background: #000080; }
.b-nets  { background: linear-gradient(180deg, #008080, #004c4c); }

.arcade-footer {
  position: relative;
  z-index: 2;
  margin-top: 10px;
  font-size: 7px;
  color: #c0b9d6;
  text-align: center;
  line-height: 1.8;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}
.arcade-footer a { color: var(--amber); text-decoration: none; }
.arcade-footer a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   8. BOOT SEQUENCE OVERLAY (BIOS POST -> npm run arcade)
   -------------------------------------------------------------------------- */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  color: #c5ffd8;
  font-family: var(--font-term);
  font-size: clamp(16px, 2.6vw, 22px);
  line-height: 1.35;
  padding: clamp(16px, 5vw, 48px);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-shadow: 0 0 6px rgba(57, 255, 20, 0.55);
}
.boot-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(rgba(0,0,0,0) 50%, rgba(0,0,0,0.25) 50%);
  background-size: 100% 3px;
}
.boot-logo {
  font-family: var(--font-pixel);
  font-size: clamp(22px, 6vw, 48px);
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 18px;
  text-shadow: 0 0 6px var(--accent), 0 0 22px var(--accent), 4px 4px 0 #0b3b34;
  animation: neon-flicker 5s infinite;
}
.boot-logo span { color: var(--accent-2); text-shadow: 0 0 10px var(--accent-2); }
.boot-logo small {
  display: block;
  margin-top: 10px;
  font-size: clamp(8px, 1.6vw, 11px);
  color: var(--amber);
  text-shadow: none;
  letter-spacing: 3px;
}
.boot-lines { flex: 1; overflow: hidden; }
.boot-lines .ok { color: #39ff14; }
.boot-lines .warn { color: var(--amber); }
.boot-lines .dim { color: #6b8f7a; }
.boot-lines .acc { color: var(--accent); }
.boot-bar {
  display: inline-block;
  width: min(320px, 60vw);
  height: 14px;
  border: 1px solid #39ff14;
  vertical-align: middle;
  position: relative;
}
.boot-bar > i {
  position: absolute;
  inset: 1px auto 1px 1px;
  width: 0;
  background: repeating-linear-gradient(90deg, #39ff14 0 8px, transparent 8px 10px);
  animation: boot-fill 0.9s steps(16) forwards;
}
@keyframes boot-fill { to { width: calc(100% - 2px); } }
.boot-press {
  font-family: var(--font-pixel);
  font-size: clamp(9px, 1.8vw, 12px);
  color: var(--amber);
  text-align: center;
  animation: blink 0.9s steps(1) infinite;
  margin-top: 12px;
}
.boot-skip {
  position: absolute;
  top: 14px; right: 18px;
  font-size: 15px;
  color: #4b6b58;
}
.boot-screen.is-leaving { animation: boot-out 0.45s ease-in forwards; }
@keyframes boot-out {
  0% { opacity: 1; transform: scale(1); filter: brightness(1); }
  60% { opacity: 1; transform: scale(1, 0.004); filter: brightness(4); }
  100% { opacity: 0; transform: scale(0, 0.004); }
}

/* --------------------------------------------------------------------------
   9. RESPONSIVE + ACCESSIBILITY
   -------------------------------------------------------------------------- */
@media (max-width: 620px) {
  body { padding: 10px 8px 14px; justify-content: flex-start; }
  .arcade-cabinet { border-radius: 28px; padding: 8px; border-width: 5px; }
  .screen-bezel { padding: 6px; border-radius: 20px; }
  .screen-wrapper { border-radius: 12px; }
  .arcade-control-deck { width: calc(100% + 16px); margin: 10px -8px -8px; padding: 16px 10px 18px; gap: 6px; border-radius: 4px 4px 22px 22px; }
  .marquee { padding: 8px 10px 8px; }
  .marquee-tag { font-size: 15px; }
  .ticker-track { font-size: 15px; }
  .cartridge-tab-btn { font-size: 6px; padding: 7px 7px 5px; }
  .deck-label { font-size: 6px; letter-spacing: 1px; }
  .status-bar { font-size: 15px; }
  /* Bigger touch targets on phones: the deck becomes the gamepad */
  .joystick-assembly { width: 96px; height: 96px; }
  .abtn { width: 58px; height: 58px; }
  .buttons-assembly { gap: 10px; }
  .deck-mini .cap { width: 38px; }
  .deck-meta { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .sw-floor { animation: none; }
  .ticker-track { animation: none; }
}

/* ==========================================================================
   10. SCREEN-ONLY MODE (no cabinet box): just the floating CRT.
       The control panel is only shown on touch devices as a compact gamepad.
   ========================================================================== */
.arcade-cabinet {
  background: none;
  border: 0;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  animation: none;
}
.screen-bezel {
  padding: 0;
  background: none;
  box-shadow: none;
  border-radius: 18px;
  animation: screen-glow 5s ease-in-out infinite;
}
.screen-wrapper {
  border-radius: 14px;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent),
    0 0 28px color-mix(in srgb, var(--accent) 45%, transparent),
    0 0 80px color-mix(in srgb, var(--accent-2) 30%, transparent),
    0 30px 60px rgba(0, 0, 0, 0.85);
}
@keyframes screen-glow {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50% { filter: drop-shadow(0 0 14px color-mix(in srgb, var(--accent) 35%, transparent)); }
}
/* reflection of the screen on the synthwave floor */
.arcade-cabinet::after {
  content: '';
  display: block;
  width: 80%;
  height: 26px;
  margin-top: 6px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--accent) 40%, transparent), transparent 70%);
  filter: blur(6px);
  pointer-events: none;
}

/* Marquee becomes a floating neon headline instead of a box */
.marquee {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 4px 8px 6px;
}
.ticker { border-top: 0; }

.arcade-control-deck { display: none; }
@media (pointer: coarse), (max-width: 620px) {
  .arcade-cabinet::after { display: none; }
  .arcade-control-deck {
    display: grid;
    width: 100%;
    margin: 12px 0 0;
    padding: 8px 6px;
    border: 0;
    border-radius: 16px;
    background: rgba(10, 4, 16, 0.55);
    box-shadow: none;
    backdrop-filter: blur(4px);
  }
  .deck-stripes, .deck-player-tag, .deck-label { display: none; }
}
