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

:root {
  --bg-dark: #070810;
  --panel-bg: #0f1224;
  --neon-green: #39ff14;
  --neon-cyan: #00f3ff;
  --neon-pink: #ff007f;
  --neon-yellow: #ffe600;
  --text-light: #e2e8f0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background: radial-gradient(circle at center, #141830 0%, #05050a 100%);
  color: var(--text-light);
  font-family: 'Press Start 2P', 'Courier New', monospace;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  overflow: hidden;
}

.arcade-cabinet {
  width: 100%;
  max-width: 840px;
  background: var(--panel-bg);
  border: 3px solid #28325a;
  border-radius: 16px;
  padding: 16px;
  box-shadow:
    0 0 30px rgba(0, 243, 255, 0.15),
    inset 0 0 20px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #060812;
  border: 2px solid #1e2646;
  border-radius: 8px;
  padding: 12px 20px;
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.hud-label {
  font-size: 11px;
  color: var(--neon-cyan);
  letter-spacing: 1px;
}

.hud-value {
  font-size: 16px;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.lives-container {
  display: flex;
  gap: 8px;
  min-height: 18px;
  align-items: center;
}

.life-icon {
  width: 22px;
  height: 14px;
  background: var(--neon-green);
  clip-path: polygon(
    45% 0%, 55% 0%,
    55% 30%, 85% 30%,
    85% 55%, 100% 55%,
    100% 100%, 0% 100%,
    0% 55%, 15% 55%,
    15% 30%, 45% 30%
  );
  box-shadow: 0 0 6px var(--neon-green);
}

.screen-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #04050c;
  border: 3px solid #222b52;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9);
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}

.crt-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      rgba(18, 16, 16, 0) 50%,
      rgba(0, 0, 0, 0.25) 50%
    );
  background-size: 100% 4px;
  z-index: 2;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 15, 0.88);
  backdrop-filter: blur(3px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 22px;
  z-index: 3;
  padding: 20px;
  text-align: center;
  transition: opacity 0.25s ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.neon-title {
  font-size: clamp(22px, 4vw, 38px);
  color: var(--neon-green);
  text-shadow:
    0 0 10px rgba(57, 255, 20, 0.8),
    0 0 24px rgba(57, 255, 20, 0.4);
  letter-spacing: 3px;
}

.subtitle {
  font-size: clamp(10px, 1.8vw, 13px);
  color: var(--neon-cyan);
  line-height: 1.6;
}

.score-table {
  background: rgba(15, 20, 40, 0.85);
  border: 1px solid #2e3b6e;
  border-radius: 8px;
  padding: 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
}

.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.alien-icon {
  font-size: 18px;
}

.arcade-btn {
  font-family: inherit;
  font-size: clamp(12px, 2vw, 15px);
  color: #05070f;
  background: var(--neon-green);
  border: none;
  border-radius: 6px;
  padding: 14px 26px;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(57, 255, 20, 0.7);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  animation: pulse 1.6s infinite;
}

.arcade-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 24px rgba(57, 255, 20, 1);
}

.arcade-btn:active {
  transform: scale(0.97);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

.controls-hint {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.5;
}

.controls-hint span {
  color: var(--neon-yellow);
}

/* Touch Controls */
.touch-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.d-pad, .action-pad {
  display: flex;
  gap: 10px;
  align-items: center;
}

.touch-btn {
  font-family: inherit;
  font-size: 16px;
  color: var(--text-light);
  background: #182040;
  border: 2px solid #303f78;
  border-radius: 8px;
  padding: 12px 22px;
  cursor: pointer;
  touch-action: manipulation;
}

.touch-btn:active {
  background: #283668;
  border-color: var(--neon-cyan);
}

.fire-btn {
  background: rgba(255, 0, 127, 0.2);
  border-color: var(--neon-pink);
  color: var(--neon-pink);
  font-size: 13px;
  padding: 14px 26px;
}

.fire-btn:active {
  background: var(--neon-pink);
  color: #fff;
}

.small-btn {
  padding: 10px 14px;
  font-size: 14px;
}

@media (max-width: 640px) {
  .hud {
    padding: 8px 10px;
  }
  .hud-label {
    font-size: 9px;
  }
  .hud-value {
    font-size: 12px;
  }
}
