/* ── Neon Beats — Game Styles ─────────────────────────────── */

#neon-beats-app {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: calc(100dvh - 63px);
  background: #0a0010;
  font-family: 'Segoe UI', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Canvas wrapper */
#nb-canvas-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 480px;
  overflow: hidden;
}

#nb-canvas {
  display: block;
  width: 100%;
  max-width: 480px;
  touch-action: none;
  border-radius: 12px;
  box-shadow:
    0 0 30px #ff00ff55,
    0 0 60px #ff00ff22,
    inset 0 0 60px #ff00ff11;
}

/* Scanline CRT overlay — adds depth */
#nb-canvas-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 5;
}

/* ── HUD overlay (score, combo, health) ── */
#nb-hud {
  display: none;
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 10px 14px;
  pointer-events: none;
  z-index: 10;
}
#nb-hud.visible { display: flex; justify-content: space-between; align-items: flex-start; }

.nb-hud-score {
  font-size: clamp(18px, 4vw, 26px);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff88;
  line-height: 1;
}
.nb-hud-label {
  font-size: 10px;
  color: #ffffffaa;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}
.nb-hud-combo {
  font-size: clamp(14px, 3.5vw, 20px);
  font-weight: 700;
  color: #00ffff;
  text-shadow: 0 0 8px #00ffff;
  text-align: center;
}
.nb-hud-health {
  text-align: right;
}
.nb-health-bar-wrap {
  width: 80px;
  height: 8px;
  background: #ffffff22;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}
.nb-health-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #ff00ff, #ff4fa3);
  box-shadow: 0 0 8px #ff00ff;
  transition: width 0.2s ease, background 0.3s ease;
}
.nb-health-bar.danger { background: linear-gradient(90deg, #ff2200, #ff6600); box-shadow: 0 0 8px #ff2200; }

/* ── Menu / screens ── */
.nb-screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #1a003088 0%, #0a0010dd 60%, #0a0010f0 100%);
  border-radius: 12px;
  padding: 24px 20px;
  z-index: 20;
  text-align: center;
  gap: 14px;
}
.nb-screen.active { display: flex; }

/* Logo — animated neon glow */
.nb-logo {
  font-size: clamp(34px, 8vw, 56px);
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #ff00ff, #ff66ff 40%, #00ffff 80%, #66ffff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 16px #ff00ff) drop-shadow(0 0 40px #ff00ff44);
  animation: nb-logo-shift 4s ease-in-out infinite alternate;
}
@keyframes nb-logo-shift {
  0%   { background-position: 0% 50%; filter: drop-shadow(0 0 16px #ff00ff) drop-shadow(0 0 40px #ff00ff44); }
  100% { background-position: 100% 50%; filter: drop-shadow(0 0 20px #00ffff) drop-shadow(0 0 50px #00ffff44); }
}

.nb-sub {
  font-size: clamp(13px, 2.8vw, 16px);
  color: #ffffffaa;
  margin-top: -4px;
  letter-spacing: 0.5px;
}

/* Buttons */
.nb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 36px;
  border: none;
  border-radius: 50px;
  font-size: clamp(15px, 3.5vw, 18px);
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}
.nb-btn:focus-visible, .nb-settings-btn:focus-visible {
  outline: 2px solid #00ffff;
  outline-offset: 3px;
}
.nb-btn:active { transform: scale(0.96); }

.nb-btn-primary {
  background: linear-gradient(135deg, #ff00ff, #cc00cc);
  color: #fff;
  box-shadow: 0 0 24px #ff00ff88, 0 4px 20px #00000066;
  animation: nb-btn-glow 2s ease-in-out infinite alternate;
}
@keyframes nb-btn-glow {
  0%   { box-shadow: 0 0 20px #ff00ff66, 0 4px 16px #00000066; }
  100% { box-shadow: 0 0 36px #ff00ffcc, 0 4px 24px #ff00ff44, 0 0 80px #ff00ff22; }
}
.nb-btn-primary:hover {
  box-shadow: 0 0 40px #ff00ffcc, 0 4px 24px #ff00ff44;
  animation: none;
}
/* Shimmer sweep across button */
.nb-btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #ffffff33, transparent);
  animation: nb-shimmer 3s ease-in-out infinite;
}
@keyframes nb-shimmer {
  0%   { left: -100%; }
  40%  { left: 150%; }
  100% { left: 150%; }
}

.nb-btn-secondary {
  background: #ffffff10;
  color: #fff;
  border: 1px solid #ffffff33;
  backdrop-filter: blur(4px);
}
.nb-btn-secondary:hover { background: #ffffff22; border-color: #ffffff55; }

/* Score pills — glassy neon border */
.nb-scores-row {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}
.nb-score-pill {
  background: linear-gradient(135deg, #ffffff08, #ffffff04);
  border: 1px solid #ff00ff33;
  border-radius: 14px;
  padding: 12px 22px;
  min-width: 110px;
  backdrop-filter: blur(4px);
  box-shadow: 0 0 12px #ff00ff11, inset 0 1px 0 #ffffff0d;
}
.nb-score-pill .val {
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 900;
  color: #ff00ff;
  text-shadow: 0 0 12px #ff00ff88;
  display: block;
  line-height: 1.1;
}
.nb-score-pill .lbl {
  font-size: 10px;
  color: #ffffffaa;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 4px;
}

/* countdown */
.nb-countdown-num {
  font-size: clamp(72px, 20vw, 120px);
  font-weight: 900;
  color: #ff00ff;
  text-shadow: 0 0 30px #ff00ff, 0 0 60px #ff00ff55, 0 0 100px #ff00ff22;
  animation: nb-pulse 0.9s ease-in-out;
}
@keyframes nb-pulse {
  0%   { transform: scale(1.5); opacity: 0; }
  50%  { transform: scale(1);   opacity: 1; }
  100% { transform: scale(0.85); opacity: 0.8; }
}

/* accuracy badge on game over — glowing ring */
.nb-accuracy-badge {
  font-size: clamp(28px, 7vw, 42px);
  font-weight: 900;
  color: #00ffff;
  text-shadow: 0 0 16px #00ffff, 0 0 40px #00ffff55;
  border: 2px solid #00ffff44;
  border-radius: 50%;
  width: clamp(80px, 20vw, 100px);
  height: clamp(80px, 20vw, 100px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow: 0 0 20px #00ffff33, inset 0 0 20px #00ffff11;
}

/* settings panel */
#nb-settings {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 30;
}
.nb-settings-btn {
  background: #ffffff12;
  border: 1px solid #ffffff22;
  color: #ffffffcc;
  border-radius: 50%;
  width: 44px; height: 44px;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.3s;
  backdrop-filter: blur(4px);
}
.nb-settings-btn:hover { background: #ffffff22; border-color: #ff00ff55; }

#nb-settings-panel {
  display: none;
  position: absolute;
  top: 50px; right: 0;
  background: linear-gradient(135deg, #1a0030, #0d0020);
  border: 1px solid #ff00ff44;
  border-radius: 14px;
  padding: 18px;
  min-width: 230px;
  z-index: 40;
  box-shadow: 0 8px 40px #00000088, 0 0 20px #ff00ff11;
  backdrop-filter: blur(8px);
}
#nb-settings-panel.open { display: block; }
#nb-settings-panel label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ffffffcc;
  font-size: 13px;
  margin-bottom: 12px;
}
#nb-settings-panel input[type=range] {
  width: 110px;
  accent-color: #ff00ff;
}
#nb-settings-panel input[type=number] {
  width: 64px;
  background: #ffffff12;
  border: 1px solid #ffffff33;
  color: #fff;
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 13px;
  text-align: center;
}

/* Hit feedback floaters — bigger, bolder */
.nb-floater {
  position: absolute;
  font-size: 15px;
  font-weight: 900;
  pointer-events: none;
  animation: nb-float 0.8s ease-out forwards;
  z-index: 50;
  letter-spacing: 0.5px;
}
@keyframes nb-float {
  0%   { opacity: 1; transform: translateY(0) scale(1.2); }
  30%  { opacity: 1; transform: translateY(-12px) scale(1); }
  100% { opacity: 0; transform: translateY(-50px) scale(0.8); }
}
.nb-floater.perfect { color: #ffd700; text-shadow: 0 0 10px #ffd700, 0 0 20px #ffd70066; }
.nb-floater.great   { color: #00ffff; text-shadow: 0 0 8px #00ffff, 0 0 16px #00ffff55; }
.nb-floater.good    { color: #aaffaa; text-shadow: 0 0 8px #00ff00; }
.nb-floater.miss    { color: #ff4444; text-shadow: 0 0 10px #ff0000, 0 0 20px #ff000044; }

/* Achievement toast */
#nb-achievement-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, #1a0030, #2d0050);
  border: 1px solid #ff00ff66;
  border-radius: 14px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 4px 30px #ff00ff44, 0 0 60px #ff00ff11;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
#nb-achievement-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#nb-achievement-toast .ach-icon { font-size: 22px; }
#nb-achievement-toast .ach-title { font-weight: 700; font-size: 15px; color: #ff00ff; }

/* ── Responsive ── */
@media (min-width: 600px) {
  #neon-beats-app { padding: 20px; }
  #nb-canvas-wrap { max-width: 420px; }
}
@media (max-width: 400px) {
  .nb-scores-row { gap: 12px; }
  .nb-score-pill { min-width: 90px; padding: 8px 14px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .nb-countdown-num { animation: none; opacity: 1; transform: none; }
  .nb-floater { animation: none; opacity: 1; transform: none; }
  .nb-health-bar { transition: none; }
  .nb-logo { animation: none; }
  .nb-btn-primary { animation: none; }
  .nb-btn-primary::after { animation: none; display: none; }
  #nb-canvas-wrap::after { display: none; }
}
