/* ============================================
   INBOX ZERO — Styles
   ============================================ */

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

html, body {
  height: 100%;
  background: var(--bg, #06060c);
  color: var(--text, #f5f5f7);
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

body {
  display: flex;
  flex-direction: column;
  padding:
    env(safe-area-inset-top)
    env(safe-area-inset-right)
    env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

/* --- Header --- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-elevated, #0e0e18);
  border-bottom: 1px solid var(--border-subtle, #2a2a44);
  flex-shrink: 0;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.brand {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent, #00e5ff);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.back-link {
  color: var(--text-secondary, #9898a4);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s;
}

.back-link:hover {
  color: var(--accent, #00e5ff);
}

/* --- Game Container --- */
#game-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a14;
}

canvas {
  display: block;
  touch-action: none;
  -webkit-touch-callout: none;
}

/* --- HUD --- */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  pointer-events: none;
  z-index: 5;
  background: rgba(6, 6, 12, 0.6);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.hud-left {
  color: var(--accent-tertiary, #ff8a00);
}

.hud-center {
  color: var(--accent, #00e5ff);
  text-transform: uppercase;
}

.hud-right {
  font-size: 15px;
  letter-spacing: 2px;
}

#powerup-display {
  position: absolute;
  top: 32px;
  right: 12px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 5;
}

/* --- Overlays --- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  background: rgba(6, 6, 12, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 24px;
  text-align: center;
  gap: 12px;
}

.overlay.hidden {
  display: none !important;
}

.overlay-emojis {
  font-size: clamp(36px, 8vw, 52px);
  letter-spacing: 8px;
}

.overlay h1 {
  font-family: var(--font-display, 'Satoshi', sans-serif);
  font-size: clamp(28px, 7vw, 46px);
  font-weight: 900;
  color: var(--accent, #00e5ff);
  text-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
  line-height: 1.1;
}

.gameover-title {
  color: var(--accent-secondary, #ff2d95) !important;
  text-shadow: 0 0 20px rgba(255, 45, 149, 0.4) !important;
}

.subtitle {
  color: var(--text-secondary, #9898a4);
  font-size: 13px;
  line-height: 1.6;
  max-width: 300px;
}

.controls-info {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text-secondary, #9898a4);
  line-height: 2;
}

.key {
  color: var(--accent, #00e5ff);
  font-weight: 700;
}

.game-btn {
  background: var(--accent, #00e5ff);
  color: var(--bg, #06060c);
  border: none;
  padding: 12px 40px;
  font-size: 16px;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
  transition: transform 0.1s, opacity 0.1s;
}

.game-btn:active {
  transform: scale(0.96);
}

.game-btn--secondary {
  background: transparent;
  color: var(--text-secondary, #9898a4);
  border: 1px solid var(--text-muted, #5c5c68);
  padding: 10px 28px;
  font-size: 13px;
}

.final-score {
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 900;
  color: var(--accent-tertiary, #ff8a00);
}

.final-wave {
  font-size: 14px;
  color: var(--text-secondary, #9898a4);
}

.new-high {
  color: var(--accent-secondary, #ff2d95);
  font-size: 15px;
  font-weight: 700;
  animation: pulse-glow 0.6s ease-in-out infinite alternate;
}

.high-score-line {
  color: var(--accent-tertiary, #ff8a00);
  font-size: 13px;
  min-height: 18px;
}

/* --- Animations --- */
@keyframes pulse-glow {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

@keyframes score-float {
  0% { opacity: 1; transform: translateY(0) scale(0.8); }
  100% { opacity: 0; transform: translateY(-50px) scale(1.1); }
}

.score-popup {
  position: absolute;
  font-family: var(--font-mono, monospace);
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
  z-index: 15;
  animation: score-float 0.7s ease-out forwards;
}
