:root {
  --bg-color: #0d0e15;
  --panel-bg: rgba(20, 22, 37, 0.7);
  --border-color: rgba(0, 255, 102, 0.2);
  --primary-glow: #00ff66;
  --secondary-glow: #ff0055;
  --accent-color: #00e5ff;
  --text-primary: #ffffff;
  --text-secondary: #8f9cae;
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Outfit', sans-serif;
  --shadow-glow: 0 0 15px rgba(0, 255, 102, 0.4);
  --shadow-glow-pink: 0 0 15px rgba(ff, 0, 85, 0.4);
}

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

body {
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(at 0% 0%, rgba(0, 255, 102, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(255, 0, 85, 0.05) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(13, 14, 21, 1) 0px, rgba(5, 5, 8, 1) 100%);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 20px;
}

.game-container {
  width: 100%;
  max-width: 480px;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-top: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--primary-glow), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(0, 255, 102, 0.3);
}

.score-board {
  display: flex;
  gap: 12px;
}

.score-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 80px;
}

.score-card .label {
  font-size: 9px;
  font-family: var(--font-display);
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.score-card .value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-glow);
  text-shadow: 0 0 8px rgba(0, 255, 102, 0.5);
}

.score-card:last-child .value {
  color: var(--accent-color);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
  background: #06070d;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(13, 14, 21, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease;
  z-index: 10;
}

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

.overlay-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.overlay h2 {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 2px;
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.overlay p {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 250px;
  line-height: 1.5;
}

.glow-button {
  background: linear-gradient(135deg, var(--primary-glow), #00d455);
  border: none;
  border-radius: 30px;
  color: #000;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  padding: 14px 32px;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: all 0.2s ease;
  letter-spacing: 1px;
}

.glow-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(0, 255, 102, 0.7);
}

.glow-button:active {
  transform: translateY(1px);
}

.controls-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.desktop-controls {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.key {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--text-primary);
  margin: 0 2px;
}

.mobile-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}

.dir-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  color: var(--text-primary);
  font-size: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.1s ease;
  touch-action: manipulation;
}

.dir-btn:active {
  background: var(--primary-glow);
  color: #000;
  box-shadow: var(--shadow-glow);
  transform: scale(0.95);
}

.horizontal-btns {
  display: flex;
  gap: 40px;
}

@media (min-width: 768px) {
  .mobile-controls {
    display: none;
  }
}

@media (max-width: 480px) {
  .game-container {
    padding: 16px;
    gap: 16px;
    border-radius: 0;
    height: 100vh;
    justify-content: space-between;
  }
  
  body {
    padding: 0;
  }
  
  .canvas-wrapper {
    border-radius: 12px;
  }

  .desktop-controls {
    display: none;
  }
}
