@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

:root {
  --bg: #06020f;
  --text: #d8f5ff;
  --muted: #8a7fb0;
  --pink: #ff2bd1;
  --cyan: #16e0ff;
  --lime: #b6ff3a;
  --gold: #ffd23a;
  --purple: #9a4bff;

  /* dashboard compatibility aliases */
  --panel: #140826;
  --border: #3a2a5a;
  --accent: var(--cyan);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'VT323', monospace;
  font-size: 20px;
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ── Animated arcade background ─────────────────────────────── */
.arcade-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 50% 22%, rgba(255, 43, 209, 0.18), transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(22, 224, 255, 0.20), transparent 60%),
    var(--bg);
}

.grid-floor {
  position: fixed;
  left: -25%;
  right: -25%;
  bottom: 0;
  height: 48vh;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 43, 209, 0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 224, 255, 0.45) 1px, transparent 1px);
  background-size: 44px 44px;
  transform: perspective(320px) rotateX(62deg);
  transform-origin: bottom center;
  animation: floor 3.5s linear infinite;
  -webkit-mask-image: linear-gradient(transparent, #000 55%);
  mask-image: linear-gradient(transparent, #000 55%);
}

@keyframes floor {
  from { background-position: 0 0; }
  to   { background-position: 0 44px; }
}

/* ── CRT scanlines + flicker ───────────────────────────────── */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: repeating-linear-gradient(
    rgba(0, 0, 0, 0) 0 2px,
    rgba(0, 0, 0, 0.22) 2px 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.55;
}

/* ── Marquee header ────────────────────────────────────────── */
header {
  text-align: center;
  padding: 56px 20px 10px;
  position: relative;
}

.coin {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  color: var(--gold);
  letter-spacing: 2px;
  text-shadow: 0 0 10px var(--gold);
  animation: blink 1.1s steps(2, start) infinite;
}

@keyframes blink { 50% { opacity: 0.25; } }

.neon-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(2.2rem, 9vw, 5.2rem);
  margin: 18px 0 14px;
  color: #fff;
  letter-spacing: 4px;
  text-shadow:
    0 0 6px #fff,
    0 0 16px var(--pink),
    0 0 34px var(--pink),
    0 0 70px var(--pink);
  animation: flicker 5s infinite;
}

.neon-title .y { color: #fff; text-shadow: 0 0 6px #fff, 0 0 16px var(--cyan), 0 0 34px var(--cyan), 0 0 70px var(--cyan); }

@keyframes flicker {
  0%, 19%, 21%, 23%, 80%, 100% { opacity: 1; }
  20%, 22%, 82% { opacity: 0.72; }
}

.subtitle {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.62rem;
  color: var(--cyan);
  letter-spacing: 4px;
  text-shadow: 0 0 12px var(--cyan);
  margin: 0;
}

/* ── Cabinet grid ──────────────────────────────────────────── */
.wrap { max-width: 1040px; margin: 0 auto; padding: 30px 20px 10px; position: relative; z-index: 1; }

.cabinets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 26px;
  margin-top: 14px;
}

.cabinet {
  --neon: var(--pink);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 18px 22px;
  border: 2px solid var(--neon);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(20, 8, 38, 0.92), rgba(8, 3, 20, 0.95));
  box-shadow: 0 0 14px rgba(255, 43, 209, 0.25), inset 0 0 22px rgba(0, 0, 0, 0.6);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.cabinet:nth-child(4n+1) { --neon: var(--pink); }
.cabinet:nth-child(4n+2) { --neon: var(--cyan); }
.cabinet:nth-child(4n+3) { --neon: var(--lime); }
.cabinet:nth-child(4n+4) { --neon: var(--gold); }

.cabinet:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 0 26px var(--neon), 0 12px 30px rgba(0, 0, 0, 0.6), inset 0 0 26px rgba(0, 0, 0, 0.55);
}

/* the cabinet "screen" */
.screen {
  width: 100%;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.06), transparent 70%),
    #05020c;
  border: 1px solid color-mix(in srgb, var(--neon) 55%, transparent);
  box-shadow: inset 0 0 30px color-mix(in srgb, var(--neon) 30%, transparent);
  overflow: hidden;
  position: relative;
}

.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(rgba(0,0,0,0) 0 2px, rgba(0,0,0,0.25) 2px 3px);
  pointer-events: none;
  opacity: 0.5;
}

.screen .emoji {
  font-size: 60px;
  filter: drop-shadow(0 0 14px var(--neon));
  animation: bob 2.6s ease-in-out infinite;
}

@keyframes bob { 50% { transform: translateY(-7px); } }

.cab-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.74rem;
  color: #fff;
  margin: 16px 0 6px;
  text-align: center;
  text-shadow: 0 0 10px var(--neon);
  letter-spacing: 1px;
}

.cab-desc {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.2;
  text-align: center;
  margin: 0 0 16px;
  min-height: 2.4em;
}

.play-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  letter-spacing: 2px;
  color: var(--neon);
  border: 1.5px solid var(--neon);
  border-radius: 6px;
  padding: 9px 20px;
  text-shadow: 0 0 8px var(--neon);
  transition: all 0.16s ease;
}

.cabinet:hover .play-btn {
  background: var(--neon);
  color: #05020c;
  text-shadow: none;
  box-shadow: 0 0 18px var(--neon);
}

/* ── Footer ────────────────────────────────────────────────── */
footer {
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
  padding: 34px 20px 40px;
  position: relative;
  z-index: 1;
  letter-spacing: 1px;
}

footer a {
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan);
}

footer .hi { color: var(--lime); text-shadow: 0 0 8px var(--lime); }

/* ── Game pages (kept simple, neon accents) ────────────────── */
.game-shell { max-width: 520px; margin: 0 auto; padding: 16px; text-align: center; position: relative; z-index: 1; }

.game-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.game-top .back { color: var(--cyan); text-shadow: 0 0 8px var(--cyan); font-size: 1.1rem; }

.scorebox { font-size: 1.4rem; font-family: 'Press Start 2P', monospace; font-size: 0.8rem; }

.scorebox b { color: var(--gold); text-shadow: 0 0 10px var(--gold); }

canvas, #board {
  background: #05020c;
  border: 2px solid var(--purple);
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(154, 75, 255, 0.5);
  touch-action: none;
  max-width: 100%;
}
