/* ============================================================
   MYBC ARCADE — shared retro-pixel CRT theme
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

:root {
  --bg:        #0a0617;
  --bg-2:      #140a2e;
  --ink:       #f5f1ff;
  --dim:       #9b8fd1;

  --pink:      #ff2e88;
  --cyan:      #19e8ff;
  --lime:      #6dff5b;
  --gold:      #ffd23f;
  --violet:    #b06bff;
  --red:       #ff4d4d;

  --pixel:     'Press Start 2P', monospace;
  --term:      'VT323', monospace;

  --line:      rgba(176,107,255,0.28);
  --shadow-hard: 6px 6px 0 #000;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 50% -10%, #2a1259 0%, transparent 60%),
    radial-gradient(900px 600px at 110% 110%, #3a0f55 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--term);
  font-size: 20px;
  line-height: 1.4;
  min-height: 100vh;
  overflow-x: hidden;
  image-rendering: pixelated;
  text-rendering: optimizeSpeed;
}

/* ---- CRT overlays (scanlines + vignette + flicker) ---- */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.22) 3px,
    rgba(0,0,0,0.22) 4px);
  mix-blend-mode: multiply;
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background:
    radial-gradient(120% 120% at 50% 50%, transparent 58%, rgba(0,0,0,0.55) 100%);
  animation: flicker 6s infinite steps(60);
}
@keyframes flicker { 0%,100%{opacity:.92} 50%{opacity:1} 2%{opacity:.85} }

@media (prefers-reduced-motion: reduce){
  body::after{ animation: none; }
  *{ animation-duration: .001ms !important; }
}

/* ---- pixel font helpers ---- */
.pix { font-family: var(--pixel); line-height: 1.6; letter-spacing: .5px; }
.glow-pink  { color: var(--pink);  text-shadow: 0 0 8px rgba(255,46,136,.7); }
.glow-cyan  { color: var(--cyan);  text-shadow: 0 0 8px rgba(25,232,255,.7); }
.glow-lime  { color: var(--lime);  text-shadow: 0 0 8px rgba(109,255,91,.7); }
.glow-gold  { color: var(--gold);  text-shadow: 0 0 8px rgba(255,210,63,.7); }

a { color: var(--cyan); text-decoration: none; }

/* ---- pixel-bordered box (hard stepped frame) ---- */
.pixel-box {
  position: relative;
  background: var(--bg-2);
  border: 3px solid var(--ink);
  box-shadow:
    0 0 0 3px #000,
    var(--shadow-hard),
    0 0 22px rgba(176,107,255,.25);
}

/* ---- pixel button ---- */
.btn {
  font-family: var(--pixel);
  font-size: 12px;
  color: #0a0617;
  background: var(--gold);
  border: 3px solid #000;
  padding: 14px 18px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  box-shadow: 4px 4px 0 #000;
  transition: transform .08s steps(2), box-shadow .08s steps(2), background .15s;
  text-transform: uppercase;
}
.btn:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 #000; background: #fff05a; }
.btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 #000; }
.btn--cyan  { background: var(--cyan); }
.btn--cyan:hover { background: #6bf2ff; }
.btn--pink  { background: var(--pink); color: #fff; }
.btn--pink:hover { background: #ff5ba3; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); box-shadow: 4px 4px 0 rgba(0,0,0,.6); }
.btn--ghost:hover { background: rgba(255,255,255,.08); }

/* blink */
.blink { animation: blink 1s steps(2,start) infinite; }
@keyframes blink { to { visibility: hidden; } }

/* =======================  GAME SHELL  ======================= */
.game-page {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 16px 60px;
}
.game-top {
  width: 100%; max-width: 760px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}
.game-top h1 { font-family: var(--pixel); font-size: 18px; margin: 0; }
.cabinet {
  width: 100%; max-width: 760px;
  padding: 22px;
}
.cab-title { font-family: var(--pixel); font-size: 13px; color: var(--dim); margin: 0 0 14px; }
.hud {
  display: flex; gap: 22px; flex-wrap: wrap;
  font-family: var(--pixel); font-size: 12px; margin-bottom: 16px;
}
.hud b { color: var(--gold); }
.screen {
  position: relative;
  background: #050310;
  border: 3px solid #000;
  box-shadow: inset 0 0 60px rgba(176,107,255,.18);
  margin: 0 auto;
}
.screen canvas, .screen .grid-host { display: block; image-rendering: pixelated; }

.overlay {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; text-align: center;
  background: rgba(5,3,16,.82);
  font-family: var(--pixel);
}
.overlay.hidden { display: none; }
.overlay h2 { font-size: 20px; margin: 0; }
.overlay p  { font-size: 11px; color: var(--dim); margin: 0; max-width: 80%; line-height: 1.8; }

.hint {
  font-family: var(--pixel); font-size: 10px; color: var(--dim);
  margin-top: 16px; text-align: center; line-height: 1.9; max-width: 600px;
}
.dpad-note { margin-top: 14px; }

/* mobile control pad */
.touchpad { display: none; margin-top: 18px; }
@media (hover: none) and (pointer: coarse) { .touchpad { display: grid; } }
.touchpad {
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(3, 56px);
  gap: 8px; justify-content: center;
}
.touchpad button {
  font-family: var(--pixel); font-size: 16px;
  background: var(--bg-2); color: var(--cyan);
  border: 3px solid #000; box-shadow: 3px 3px 0 #000; cursor: pointer;
}
.touchpad button:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 #000; }
.tp-up{grid-area:1/2} .tp-left{grid-area:2/1} .tp-right{grid-area:2/3} .tp-down{grid-area:3/2}
