:root {
  --bg: #0a0a1a;
  --text: #e9eefc;
  --accent: #00ffff;
  --danger: #ff3366;
  --portal: #9d4edd;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Courier New', monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#game {
  display: block;
  background: #000;
  width: 100%;
  height: 100%;
}

#ui {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 10;
}

.score, .highscore {
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 15px;
  border: 1px solid var(--accent);
  font-size: 18px;
  color: var(--accent);
}

.powerups {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px;
  border: 1px solid var(--portal);
  max-width: 200px;
}

.powerup-item {
  color: var(--portal);
}

.powerup-item-inactive {
  color: #666;
}

#start-screen, #game-over {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 20px;
  z-index: 100;
  overflow-y: auto;
  padding: 20px 0;
}

#menu-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.menu-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 1200px;
  width: 90%;
  padding: 20px 0;
}

.menu-header {
  text-align: center;
}

.menu-header h1 {
  font-size: 64px;
  color: var(--accent);
  text-shadow: 0 0 30px var(--accent);
  margin: 0 0 10px;
}

.highscore-display {
  font-size: 24px;
  color: var(--text);
  margin: 0;
}

.menu-sections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 1200px;
  justify-content: center;
}

@media (max-width: 1024px) {
  .menu-sections {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .menu-sections {
    grid-template-columns: 1fr;
  }
}

.menu-section {
  background: rgba(0, 0, 0, 0.7);
  padding: 20px;
  border: 2px solid var(--border);
  border-radius: 10px;
  min-width: 250px;
}

.menu-section h3 {
  margin: 0 0 15px;
  color: var(--accent);
  font-size: 20px;
}

.start-btn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 15px 50px;
  font-size: 24px;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  transition: all 0.3s;
  pointer-events: all;
  box-shadow: 0 0 30px rgba(122, 162, 255, 0.5);
  margin-top: 10px;
}

.start-btn:hover {
  background: var(--text);
  box-shadow: 0 0 40px var(--accent);
  transform: scale(1.05);
}

.reset-btn {
  background: rgba(255, 51, 102, 0.2);
  color: var(--danger);
  border: 2px solid var(--danger);
  padding: 10px 30px;
  font-size: 16px;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  transition: all 0.3s;
  pointer-events: all;
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.3);
  margin-top: 5px;
}

.reset-btn:hover {
  background: rgba(255, 51, 102, 0.4);
  box-shadow: 0 0 30px var(--danger);
  transform: scale(1.05);
}

.controls-hint {
  font-size: 13px;
  color: var(--muted);
  margin: 5px 0 0;
  text-align: center;
}

.ship-stats {
  font-size: 14px;
  color: var(--accent);
  margin: 5px 0 0;
  text-align: center;
  font-weight: bold;
}

button {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 15px 40px;
  font-size: 20px;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  transition: all 0.3s;
  pointer-events: all;
  border-radius: 5px;
}

button:hover {
  background: var(--text);
  box-shadow: 0 0 20px var(--accent);
  transform: scale(1.05);
}

#game-over h2 {
  font-size: 36px;
  color: var(--danger);
  margin: 0;
}

#game-over p {
  font-size: 18px;
  color: var(--text);
  margin: 5px 0;
}

.hidden {
  display: none !important;
}


#customization {
  margin: 20px 0;
  max-width: 500px;
  text-align: left;
}

#customization h3 {
  margin: 15px 0 10px;
  color: var(--accent);
  font-size: 16px;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.color-option {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.color-option:hover {
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.color-option.selected {
  border: 3px solid var(--accent);
  box-shadow: 0 0 20px var(--accent);
}

.upgrade-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upgrade-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 20px;
  font-size: 14px;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  transition: all 0.3s;
  text-align: left;
}

.upgrade-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(122, 162, 255, 0.3);
}

.upgrade-btn:active {
  transform: scale(0.98);
}


.ship-preview-container {
  margin: 10px 0;
}

#ship-preview {
  border: 2px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.7);
}

.ship-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ship-type-option {
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
}

.ship-type-name {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 5px;
}

.ship-type-stats {
  font-size: 12px;
  color: var(--accent);
  opacity: 0.8;
}

.ship-type-option:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(122, 162, 255, 0.3);
}

.ship-type-option.selected {
  border: 3px solid var(--accent);
  background: rgba(122, 162, 255, 0.2);
  box-shadow: 0 0 20px var(--accent);
}

.game-over-buttons {
  display: flex;
  gap: 20px;
}

#customization {
  display: none;
}


.ship-stats {
  font-size: 14px;
  color: var(--accent);
  margin: 10px 0 0;
  text-align: center;
  font-weight: bold;
}


.coins-display {
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 15px;
  border: 1px solid #ffd700;
  font-size: 18px;
  color: #ffd700;
  animation: coinShine 2s ease-in-out infinite;
}

@keyframes coinShine {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
  50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
}

.pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

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

.upgrade-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.upgrade-btn.disabled:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  box-shadow: none;
  transform: none;
}

.ship-type-option:hover,
.color-option:hover {
  transform: scale(1.05) translateY(-2px);
}

.menu-header h1 {
  animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
  0%, 100% { text-shadow: 0 0 30px var(--accent); }
  50% { text-shadow: 0 0 50px var(--accent), 0 0 70px var(--accent); }
}

#pause-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  z-index: 200;
}

#pause-overlay h2 {
  font-size: 72px;
  color: var(--accent);
  text-shadow: 0 0 40px var(--accent);
  margin: 0;
  animation: pausePulse 2s ease-in-out infinite;
}

#pause-overlay p {
  font-size: 24px;
  color: var(--text);
  margin: 0;
}

@keyframes pausePulse {
  0%, 100% { 
    transform: scale(1);
    text-shadow: 0 0 40px var(--accent);
  }
  50% { 
    transform: scale(1.05);
    text-shadow: 0 0 60px var(--accent), 0 0 80px var(--accent);
  }
}

#cheat-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10, 10, 26, 0.98);
  border: 3px solid var(--accent);
  border-radius: 15px;
  padding: 30px;
  z-index: 300;
  min-width: 500px;
  max-width: 600px;
  box-shadow: 0 0 50px rgba(0, 255, 255, 0.5);
}

#cheat-panel h2 {
  margin: 0 0 20px;
  color: var(--accent);
  font-size: 28px;
  text-align: center;
  text-shadow: 0 0 20px var(--accent);
}

.cheat-section {
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 255, 0.3);
}

.cheat-section h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cheat-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.cheat-btn {
  background: rgba(0, 255, 255, 0.2);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 10px 15px;
  font-size: 14px;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 5px;
}

.cheat-btn:hover {
  background: rgba(0, 255, 255, 0.4);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
  transform: scale(1.02);
}

.cheat-btn:active {
  transform: scale(0.98);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.cheat-close {
  width: 100%;
  margin-top: 15px;
  background: var(--danger);
  color: white;
  border: none;
  padding: 12px;
  font-size: 16px;
  font-family: 'Courier New', monospace;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.2s;
}

.cheat-close:hover {
  background: #ff5588;
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.5);
}
