/* Meta Ray-Ban Display — 600×600 viewport, dark theme */
:root {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0f;
  --bg-card: #1a1a2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #404050;
  --accent-primary: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --warning: #ffaa00;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);

  --color-up: #00d4ff;
  --color-down: #ff4466;
  --color-left: #4488ff;
  --color-right: #aa44ff;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 600px;
  height: 600px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
}

/* --- Screens --- */
.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
}
.screen.hidden { display: none; }

/* --- Focus (D-pad / EMG wristband) --- */
.focusable {
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.focusable:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
}

/* --- Primary button --- */
.btn-primary {
  padding: 18px 42px;
  background: var(--accent-primary);
  color: #000;
  font-size: 24px;
  font-weight: 700;
  border-radius: 12px;
  letter-spacing: 0.5px;
}
.btn-primary:focus { background: #33ddff; }

/* ===================== MENU ===================== */
#menu {
  justify-content: center;
  align-items: center;
  background: var(--bg-primary);
}

.menu-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.menu-arrows {
  font-size: 48px;
  letter-spacing: 14px;
  color: var(--accent-primary);
  text-shadow: 0 0 24px var(--accent-primary);
}

.menu-logo-img {
  width: 340px;
  height: 154px;
  -webkit-mask-image: url('images/logo.png');
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-image: url('images/logo.png');
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  background: linear-gradient(120deg, var(--color-up) 0%, var(--color-right) 100%);
}

.menu-subtitle {
  font-size: 19px;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

.menu-hint {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 10px;
}

.hint-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 19px;
  color: var(--text-secondary);
}

kbd {
  background: var(--bg-card);
  border: 1px solid #2a2a3e;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  color: var(--text-primary);
  font-family: monospace;
}

.menu-footer {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
}

.menu-made-by {
  font-size: 28px;
  color: var(--text-muted);
}

.menu-version {
  font-size: 14px;
  color: var(--text-muted);
}

/* ===================== COUNTDOWN ===================== */
#countdown {
  justify-content: center;
  align-items: center;
  background: var(--bg-primary);
}

.countdown-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.countdown-number {
  font-size: 195px;
  font-weight: 900;
  color: var(--accent-primary);
  text-shadow: 0 0 60px var(--accent-primary), 0 0 120px rgba(0, 212, 255, 0.3);
  line-height: 1;
}

.countdown-number.go {
  color: var(--accent-secondary);
  text-shadow: 0 0 60px var(--accent-secondary), 0 0 120px rgba(0, 255, 136, 0.3);
}

.countdown-pop {
  animation: countdownPop 0.85s ease-out forwards;
}

@keyframes countdownPop {
  0%   { transform: scale(1.5); opacity: 0.4; }
  40%  { transform: scale(0.95); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ===================== GAMEPLAY ===================== */
#gameplay {
  position: relative;
  background: #000;
}

#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 600px;
  height: 600px;
}

.hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 16px 10px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.hud-song {
  font-size: 18px;
  color: var(--text-secondary);
  font-style: italic;
  letter-spacing: 0.3px;
}

.hud-timer {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.hud-stats {
  display: flex;
  gap: 16px;
  padding: 6px 16px;
  background: rgba(0, 0, 0, 0.45);
}

.hud-stat {
  font-size: 21px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.hud-stat.hit  { color: var(--accent-secondary); }
.hud-stat.miss { color: var(--danger); }

.combo-display {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 78px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 30px var(--accent-primary), 0 0 60px rgba(0, 212, 255, 0.4);
  pointer-events: none;
  letter-spacing: -1px;
  z-index: 20;
}
.combo-display.hidden { display: none; }

/* ===================== GAME OVER ===================== */
#gameover {
  justify-content: center;
  align-items: center;
  background: var(--bg-primary);
}

.gameover-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  width: 100%;
  padding: 0 40px;
}

.gameover-title {
  font-size: 57px;
  font-weight: 900;
  letter-spacing: 1px;
}

.stars-display {
  display: flex;
  gap: 10px;
}

.star {
  font-size: 66px;
  line-height: 1;
  display: inline-block;
}
.star.filled {
  color: var(--warning);
  text-shadow: 0 0 16px var(--warning), 0 0 32px rgba(255, 170, 0, 0.4);
}
.star.empty {
  color: #252535;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.stat-item {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 14px 12px;
}

.stat-value {
  font-size: 45px;
  font-weight: 800;
  color: var(--accent-primary);
  font-variant-numeric: tabular-nums;
}
.stat-value.danger { color: var(--danger); }

.stat-label {
  font-size: 16px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 3px;
}
