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

:root {
  --neon-cyan: #00e5ff;
  --neon-magenta: #ff2e88;
  --neon-yellow: #ffe600;
  --neon-green: #39ff14;
  --neon-purple: #bf5fff;
  --bg-deep: #07071a;
  --cabinet: #0f0f2e;
  --cabinet-edge: #1a1a4e;
}

html, body {
  height: 100%;
}

body {
  background:
    radial-gradient(ellipse at top, #1a0a3a 0%, var(--bg-deep) 60%, #000 100%);
  font-family: 'Press Start 2P', monospace;
  color: #fff;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* CRT wrapper with scanlines + subtle flicker */
#crt {
  width: 100%;
  max-width: 960px;
  position: relative;
}

#crt::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.12) 3px,
    rgba(0, 0, 0, 0) 4px
  );
}

#crt::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 998;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.7) 100%);
}

/* Arcade container */
#arcade {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* Marquee */
#marquee {
  width: 100%;
  background: linear-gradient(180deg, #2a0a4a 0%, #0a0a2a 100%);
  border: 3px solid var(--neon-magenta);
  border-radius: 8px;
  padding: 18px 12px 14px;
  box-shadow:
    0 0 16px rgba(255, 46, 136, 0.7),
    inset 0 0 24px rgba(255, 46, 136, 0.15);
  text-align: center;
  position: relative;
}

#marquee-inner {
  position: relative;
}

.title-glow {
  font-size: 42px;
  letter-spacing: 6px;
  text-shadow:
    0 0 10px var(--neon-cyan),
    0 0 22px var(--neon-cyan),
    0 0 40px var(--neon-magenta);
  animation: hum 2.6s ease-in-out infinite;
}

.chroma-r { color: #ff5c7a; }
.chroma-g { color: var(--neon-cyan); }
.chroma-b { color: var(--neon-yellow); }

.subtitle-glow {
  font-size: 20px;
  margin-top: 10px;
  letter-spacing: 14px;
  color: var(--neon-yellow);
  text-shadow: 0 0 8px var(--neon-yellow), 0 0 20px #ffae00;
}

@keyframes hum {
  0%, 100% { opacity: 1; filter: brightness(1); }
  48%      { opacity: 0.96; filter: brightness(0.92); }
  50%      { opacity: 0.82; filter: brightness(0.7); }
  52%      { opacity: 0.96; filter: brightness(0.92); }
}

/* Marquee bulb border */
.marquee-bulbs {
  position: absolute;
  inset: -6px;
  pointer-events: none;
  background:
    radial-gradient(circle at 10px 50%, var(--neon-yellow) 2px, transparent 3px) repeat-x top left / 22px 6px,
    radial-gradient(circle at 10px 50%, var(--neon-yellow) 2px, transparent 3px) repeat-x bottom left / 22px 6px;
  opacity: 0.7;
  animation: bulbs 1.2s steps(2) infinite;
}

@keyframes bulbs {
  0%, 49%   { filter: hue-rotate(0deg) brightness(1); }
  50%, 100% { filter: hue-rotate(40deg) brightness(0.6); }
}

/* Insert coin blink */
#insert-coin {
  color: var(--neon-yellow);
  text-shadow: 0 0 8px var(--neon-yellow);
  font-size: 12px;
  letter-spacing: 3px;
}

.blink {
  animation: blink 1.1s steps(2) infinite;
}

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

/* Cabinet */
#cabinet {
  width: 100%;
  background: linear-gradient(180deg, #120a2e 0%, #050513 100%);
  border: 4px solid var(--cabinet-edge);
  border-radius: 18px 18px 32px 32px;
  padding: 18px;
  box-shadow:
    0 0 28px rgba(0, 229, 255, 0.3),
    inset 0 0 40px rgba(0, 0, 0, 0.6);
}

#screen-bezel {
  position: relative;
  background: #020210;
  border: 3px solid #000;
  box-shadow:
    inset 0 0 32px rgba(0, 229, 255, 0.18),
    inset 0 0 4px rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 24px 20px 18px;
  overflow: hidden;
}

#scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 229, 255, 0.06) 0,
    rgba(0, 229, 255, 0.06) 1px,
    transparent 2px,
    transparent 3px
  );
  mix-blend-mode: screen;
}

#game-list-wrap {
  position: relative;
  z-index: 1;
}

#select-header {
  text-align: center;
  color: var(--neon-cyan);
  font-size: 14px;
  margin-bottom: 18px;
  text-shadow: 0 0 10px var(--neon-cyan);
  letter-spacing: 3px;
}

#game-list {
  list-style: none;
  padding: 0 24px;
  margin-bottom: 18px;
}

#game-list .game-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  margin: 6px 0;
  font-size: 14px;
  color: #aaa;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  user-select: none;
}

#game-list .game-item .num {
  color: var(--neon-magenta);
  font-size: 12px;
  min-width: 36px;
}

#game-list .game-item .name {
  flex: 1;
}

#game-list .game-item .caret {
  color: var(--neon-yellow);
  visibility: hidden;
  animation: caret-blink 0.6s steps(2) infinite;
}

#game-list .game-item:hover {
  color: #fff;
}

#game-list .game-item.selected {
  color: #fff;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.12), rgba(255, 46, 136, 0.12));
  border-color: var(--neon-cyan);
  box-shadow:
    0 0 12px rgba(0, 229, 255, 0.45),
    inset 0 0 18px rgba(0, 229, 255, 0.12);
  text-shadow: 0 0 8px var(--neon-cyan);
}

#game-list .game-item.selected .caret {
  visibility: visible;
}

@keyframes caret-blink {
  50% { opacity: 0; }
}

#game-info {
  border-top: 1px dashed rgba(0, 229, 255, 0.35);
  padding-top: 14px;
  margin: 0 24px;
  min-height: 40px;
}

#game-desc {
  color: #dcdcff;
  font-size: 9px;
  line-height: 1.7;
  text-align: center;
  letter-spacing: 1px;
}

/* Controls hint strip under the screen */
#controls-hint {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 14px;
  font-size: 8px;
  color: var(--neon-green);
  text-shadow: 0 0 6px var(--neon-green);
  background: rgba(57, 255, 20, 0.05);
  border: 1px solid rgba(57, 255, 20, 0.3);
  border-radius: 4px;
}

#arcade-footer {
  font-size: 8px;
  color: #666;
  letter-spacing: 2px;
  text-align: center;
}

/* Small screens */
@media (max-width: 720px) {
  .title-glow { font-size: 28px; letter-spacing: 3px; }
  .subtitle-glow { font-size: 14px; letter-spacing: 8px; }
  #game-list .game-item { font-size: 11px; }
  #select-header { font-size: 11px; }
  #controls-hint { font-size: 7px; }
}
