:root {
  --primary: #10b981;
  --primary-dark: #059669;
  --accent: #ef4444;
  --bg: #0a0f1f;
  --surface: #1a2332;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.game-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, var(--bg) 0%, #1a1f35 100%);
}

/* Header */
.header {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.score-display {
  display: flex;
  gap: 32px;
  justify-content: center;
}

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

.score-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.score-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

/* Canvas Wrapper */
.canvas-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0f1f;
  overflow: hidden;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  background: #0a0f1f;
}

/* Game Over Overlay */
.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.game-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.overlay-box {
  text-align: center;
  background: rgba(26, 35, 50, 0.95);
  padding: 32px 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.overlay-box h2 {
  font-size: 32px;
  margin-bottom: 12px;
  color: var(--accent);
}

.overlay-box p {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Footer */
.footer {
  padding: 16px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

#gameStatus {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Buttons */
.btn {
  padding: 12px 32px;
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn:active {
  transform: scale(0.95);
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-primary:active {
  background: var(--primary-dark);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Responsive */
@media (max-width: 480px) {
  .score-display {
    gap: 24px;
  }

  .score-value {
    font-size: 20px;
  }

  .btn {
    padding: 10px 24px;
    font-size: 13px;
  }

  .overlay-box {
    padding: 24px 20px;
  }

  .overlay-box h2 {
    font-size: 28px;
  }
}
