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

:root {
  --neon-blue: #33f5ff;
  --neon-pink: #ff3fd8;
  --neon-green: #39ff14;
  --arcade-bg: #03020a;
}

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

body {
  background-color: #000;
  color: #fff;
  font-family: 'Press Start 2P', cursive;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#game-container {
  position: relative;
  width: 500px; /* Arcade vertical ratio */
  height: 90vh;
  border: 4px solid #333;
  box-shadow: 0 0 20px rgba(51, 245, 255, 0.3), inset 0 0 50px rgba(0,0,0,1);
  background: var(--arcade-bg);
  display: flex;
  flex-direction: column;
}

.top-hud, .bottom-hud {
  height: 60px;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  font-size: 10px;
  border-bottom: 2px solid #222;
  color: var(--neon-blue);
  text-shadow: 0 0 5px var(--neon-blue);
}

.bottom-hud {
  border-top: 2px solid #222;
  border-bottom: none;
  font-size: 8px;
}

canvas {
  flex-grow: 1;
  width: 100%;
  image-rendering: pixelated;
}

#selection-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 50, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 15;
  border: 2px solid var(--neon-blue);
}

.selection-content {
  width: 90%;
  text-align: center;
}

#weapon-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin: 20px 0;
}

.weapon-item {
  border: 2px solid #444;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 10px;
  background: #111;
}

.weapon-item.selected {
  border-color: var(--neon-green);
  box-shadow: 0 0 10px var(--neon-green);
  background: rgba(57, 255, 20, 0.2);
}

#weapon-description {
  min-height: 80px;
  border-top: 1px solid #333;
  padding-top: 15px;
  font-size: 8px;
  line-height: 1.5;
}

.w-name {
  color: var(--neon-green);
  font-size: 14px;
  margin-bottom: 5px;
}

.selection-footer {
  margin-top: 20px;
  font-size: 10px;
  color: #888;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

#overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.hidden { display: none !important; }

.overlay-content {
  text-align: center;
  animation: flicker 0.15s infinite;
}

h1 {
  font-size: 40px;
  color: #ff0000;
  margin-bottom: 20px;
}

button {
  background: transparent;
  border: 2px solid var(--neon-blue);
  color: var(--neon-blue);
  padding: 15px 30px;
  font-family: inherit;
  cursor: pointer;
  margin-top: 20px;
  transition: all 0.2s;
}

button:hover {
  background: var(--neon-blue);
  color: #000;
  box-shadow: 0 0 15px var(--neon-blue);
}

.energy-bar {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 200px;
}

.bar-bg {
  width: 100%;
  height: 8px;
  background: #222;
  border: 1px solid #444;
}

#energy-fill {
  width: 100%;
  height: 100%;
  background: var(--neon-green);
  box-shadow: 0 0 10px var(--neon-green);
  transition: width 0.3s;
}

@keyframes flicker {
  0% { opacity: 0.9; }
  50% { opacity: 1; }
  100% { opacity: 0.95; }
}

/* Scanlines effect */
#game-container::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  z-index: 2;
  background-size: 100% 4px, 3px 100%;
  pointer-events: none;
}
