/* ============================================================
   NEBULA STRIKE — Premium UI
   ============================================================ */
:root {
  --cyan: #00f0ff;
  --magenta: #ff2e7e;
  --violet: #8b5cf6;
  --gold: #ffc94d;
  --ink: #030309;
  --glass: rgba(10, 14, 34, 0.55);
  --glass-border: rgba(0, 240, 255, 0.22);
  --text: #dfe7ff;
  --text-dim: #7c89b8;
  --font-display: 'Orbitron', 'Courier New', monospace;
  --font-ui: 'Rajdhani', 'Segoe UI', sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  background: var(--ink);
  overflow: hidden;
  font-family: var(--font-ui);
  color: var(--text);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ===== Aurora de fondo (fuera del canvas) ===== */
#bg-aurora {
  position: fixed;
  inset: -30%;
  z-index: 0;
  background:
    radial-gradient(ellipse 42% 34% at 22% 28%, rgba(139, 92, 246, 0.22), transparent 65%),
    radial-gradient(ellipse 40% 32% at 78% 70%, rgba(0, 240, 255, 0.13), transparent 65%),
    radial-gradient(ellipse 34% 30% at 62% 18%, rgba(255, 46, 126, 0.12), transparent 65%);
  filter: blur(40px);
  animation: aurora-drift 26s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes aurora-drift {
  0%   { transform: translate(0, 0) rotate(0deg) scale(1); }
  50%  { transform: translate(4%, -3%) rotate(3deg) scale(1.08); }
  100% { transform: translate(-4%, 3%) rotate(-3deg) scale(1.04); }
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* ===== Marco del canvas ===== */
#canvas-frame {
  position: relative;
  max-width: 100vw;
  max-height: 100vh;
  aspect-ratio: 2 / 3;
  height: min(100vh, calc(100vw * 3 / 2));
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 240, 255, 0.18),
    0 0 45px rgba(0, 240, 255, 0.12),
    0 0 120px rgba(139, 92, 246, 0.18),
    inset 0 0 60px rgba(0, 0, 0, 0.5);
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--ink);
}

/* CRT scanlines sutiles */
#scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.10) 3px,
    transparent 4px
  );
  mix-blend-mode: overlay;
  opacity: 0.55;
}

#vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(ellipse 85% 80% at 50% 46%, transparent 62%, rgba(0, 0, 6, 0.55) 100%);
}

/* ===== Marcos de esquina estilo HUD militar ===== */
.corner {
  position: absolute;
  width: 26px;
  height: 26px;
  z-index: 4;
  pointer-events: none;
  border: 2px solid rgba(0, 240, 255, 0.55);
  filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.5));
  animation: corner-pulse 3s ease-in-out infinite;
}
.corner-tl { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.corner-tr { top: 8px; right: 8px; border-left: none; border-bottom: none; }
.corner-bl { bottom: 8px; left: 8px; border-right: none; border-top: none; }
.corner-br { bottom: 8px; right: 8px; border-left: none; border-top: none; }
@keyframes corner-pulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.4; }
}

.hidden { display: none !important; }

/* ============================================================
   HUD — glassmorphism
   ============================================================ */
#hud {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100vw, calc(100vh * 2 / 3));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 14px;
  pointer-events: none;
  z-index: 5;
}

.glass-chip {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 6px 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.hud-left { display: flex; flex-direction: column; min-width: 108px; }
.hud-label {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-dim);
  font-weight: 600;
}
#hud-score {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.75);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

#hud-wave {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255, 201, 77, 0.6);
}

.hud-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#hud-lives { font-size: 15px; letter-spacing: 3px; filter: drop-shadow(0 0 6px rgba(255, 46, 126, 0.8)); }

#hud-shield-bar {
  width: 92px;
  height: 9px;
  border: 1px solid rgba(0, 240, 255, 0.45);
  border-radius: 5px;
  overflow: hidden;
  background: rgba(6, 12, 30, 0.8);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.6);
}
#hud-shield-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #0057ff, var(--cyan) 70%, #b6feff);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
  transition: width 0.2s ease-out;
  position: relative;
}
#hud-shield-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: shield-sheen 2.4s linear infinite;
}
@keyframes shield-sheen {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

/* ===== Medidor de combo ===== */
#hud-combo {
  position: absolute;
  top: 64px;
  left: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 6px 12px;
  min-width: 96px;
  animation: combo-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-color: rgba(255, 209, 102, 0.4);
}
@keyframes combo-in {
  from { opacity: 0; transform: translateX(-16px) scale(0.85); }
  to { opacity: 1; transform: none; }
}
#combo-mult {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(255, 201, 77, 0.8);
  line-height: 1;
}
#combo-count {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
  font-weight: 700;
}
#combo-bar {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(6, 12, 30, 0.85);
  overflow: hidden;
  margin-top: 2px;
}
#combo-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff9500, var(--gold));
  box-shadow: 0 0 8px rgba(255, 201, 77, 0.8);
}
#hud-combo.combo-hot {
  border-color: rgba(255, 46, 126, 0.6);
  animation: combo-hot-pulse 0.5s ease-in-out infinite;
}
#hud-combo.combo-hot #combo-mult {
  color: var(--magenta);
  text-shadow: 0 0 16px rgba(255, 46, 126, 0.9);
}
#hud-combo.combo-hot #combo-fill {
  background: linear-gradient(90deg, #ff2e7e, #ff8ab5);
  box-shadow: 0 0 10px rgba(255, 46, 126, 0.9);
}
@keyframes combo-hot-pulse {
  0%, 100% { box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45), 0 0 14px rgba(255, 46, 126, 0.35); }
  50% { box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45), 0 0 26px rgba(255, 46, 126, 0.65); }
}

/* ===== Botones táctiles del HUD ===== */
#hud-buttons {
  position: absolute;
  top: 64px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}
.hud-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.hud-btn:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
}
.hud-btn:active { transform: scale(0.9); }

/* ============================================================
   Pantallas (menú / game over / pausa)
   ============================================================ */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 90% 70% at 50% 30%, rgba(20, 16, 60, 0.35), transparent 70%),
    rgba(2, 3, 12, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10;
  text-align: center;
  padding: 20px;
  overflow: hidden;
  animation: screen-in 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== Suelo de rejilla 3D retro-futurista (menú) ===== */
.grid-floor {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: -12%;
  height: 46%;
  pointer-events: none;
  background:
    repeating-linear-gradient(to right, rgba(0, 240, 255, 0.16) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(to bottom, rgba(139, 92, 246, 0.20) 0 1px, transparent 1px 38px);
  transform: perspective(340px) rotateX(62deg);
  transform-origin: center top;
  mask-image: linear-gradient(to bottom, transparent, black 26%, black 80%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 26%, black 80%, transparent);
  animation: grid-scroll 2.6s linear infinite;
  opacity: 0.75;
}
@keyframes grid-scroll {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 0, 0 38px; }
}
@keyframes screen-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.screen-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: 420px;
  width: 100%;
  animation: rise-in 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.kicker {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 5px;
  color: var(--cyan);
  opacity: 0.85;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
  animation: kicker-blink 3s ease-in-out infinite;
}
.kicker.danger { color: var(--magenta); text-shadow: 0 0 10px rgba(255, 46, 126, 0.6); }
@keyframes kicker-blink {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 0.45; }
}

/* ===== Título con glitch cromático ===== */
.game-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(44px, 11vw, 76px);
  line-height: 0.98;
  letter-spacing: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.game-title span {
  position: relative;
  display: block;
}
.game-title .t1 {
  color: #eaffff;
  text-shadow:
    0 0 8px rgba(0, 240, 255, 0.9),
    0 0 30px rgba(0, 240, 255, 0.55),
    0 0 70px rgba(0, 120, 255, 0.4);
}
.game-title .t2 {
  color: #ffe9f1;
  text-shadow:
    0 0 8px rgba(255, 46, 126, 0.9),
    0 0 30px rgba(255, 46, 126, 0.55),
    0 0 70px rgba(255, 0, 90, 0.4);
}
.game-title span::before,
.game-title span::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.game-title span::before { color: var(--cyan); animation: glitch-a 4s steps(1) infinite; }
.game-title span::after  { color: var(--magenta); animation: glitch-b 4s steps(1) infinite; }
@keyframes glitch-a {
  0%, 91%, 100% { opacity: 0; transform: none; clip-path: none; }
  92% { opacity: 0.85; transform: translate(-3px, 1px); clip-path: inset(10% 0 55% 0); }
  94% { opacity: 0.85; transform: translate(3px, -1px); clip-path: inset(60% 0 15% 0); }
  96% { opacity: 0; }
}
@keyframes glitch-b {
  0%, 91%, 100% { opacity: 0; transform: none; clip-path: none; }
  93% { opacity: 0.85; transform: translate(3px, -1px); clip-path: inset(45% 0 30% 0); }
  95% { opacity: 0.85; transform: translate(-3px, 1px); clip-path: inset(5% 0 75% 0); }
  97% { opacity: 0; }
}

.subtitle {
  font-family: var(--font-ui);
  color: var(--text-dim);
  letter-spacing: 6px;
  font-size: 14px;
  font-weight: 600;
}

/* ===== Botones ===== */
.btn-main, .btn-secondary {
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 3px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.btn-main {
  font-size: 17px;
  padding: 16px 52px;
  color: #04121a;
  background: linear-gradient(135deg, #37f7ff 0%, #00c2ff 55%, #7a5cff 130%);
  border: none;
  border-radius: 10px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  box-shadow:
    0 0 26px rgba(0, 220, 255, 0.45),
    0 6px 28px rgba(0, 0, 0, 0.5);
}
.btn-main:hover, .btn-main:focus-visible {
  transform: translateY(-2px) scale(1.03);
  box-shadow:
    0 0 46px rgba(0, 230, 255, 0.75),
    0 10px 34px rgba(0, 0, 0, 0.55);
}
.btn-main:active { transform: translateY(0) scale(0.98); }

.btn-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: btn-sheen 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes btn-sheen {
  0%, 55% { transform: translateX(-120%); }
  85%, 100% { transform: translateX(120%); }
}

.btn-secondary {
  font-size: 12px;
  padding: 11px 32px;
  border: 1px solid rgba(124, 137, 184, 0.6);
  border-radius: 8px;
  background: rgba(16, 22, 48, 0.4);
  color: var(--text-dim);
  backdrop-filter: blur(6px);
}
.btn-secondary:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.25);
}

/* ===== Paneles de cristal ===== */
.glass-panel {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  padding: 12px 22px;
}

.highscore {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
}
.hs-label {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-dim);
  font-weight: 600;
}
.hs-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(255, 201, 77, 0.6);
  font-variant-numeric: tabular-nums;
}

/* ===== Leyenda de power-ups ===== */
.powerup-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 340px;
}
.legend-title {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-dim);
  font-weight: 600;
}
.legend-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.legend-grid span { display: inline-flex; align-items: center; gap: 6px; }
.pu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-family: var(--font-display);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  border-radius: 5px;
  border: 1px solid currentColor;
}
.pu-s { color: var(--cyan);    box-shadow: 0 0 8px rgba(0, 240, 255, 0.5); }
.pu-d { color: var(--gold);    box-shadow: 0 0 8px rgba(255, 201, 77, 0.5); }
.pu-w { color: var(--magenta); box-shadow: 0 0 8px rgba(255, 46, 126, 0.5); }
.pu-r { color: #4ecdc4;        box-shadow: 0 0 8px rgba(78, 205, 196, 0.5); }
.pu-l { color: #ff4d6d;        box-shadow: 0 0 8px rgba(255, 77, 109, 0.5); }
.pu-m { color: #ffb066;        box-shadow: 0 0 8px rgba(255, 176, 102, 0.5); }
.pu-o { color: #9b8cff;        box-shadow: 0 0 8px rgba(155, 140, 255, 0.5); }

/* ===== Bombas NOVA en el HUD ===== */
#hud-bombs-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
#hud-bombs {
  font-size: 13px;
  letter-spacing: 2px;
  color: #dffaff;
  text-shadow: 0 0 10px rgba(125, 249, 255, 0.9);
  line-height: 1;
}
#bomb-charge-bar {
  width: 92px;
  height: 4px;
  border-radius: 2px;
  background: rgba(6, 12, 30, 0.85);
  overflow: hidden;
  border: 1px solid rgba(155, 140, 255, 0.35);
}
#bomb-charge-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6f5cff, #b8a6ff);
  box-shadow: 0 0 8px rgba(155, 140, 255, 0.8);
  transition: width 0.2s ease-out;
}

.hud-btn-bomb {
  color: #eafcff;
  border-color: rgba(155, 140, 255, 0.5);
  text-shadow: 0 0 8px rgba(155, 140, 255, 0.9);
}
.hud-btn-bomb:hover {
  border-color: #b8a6ff;
  box-shadow: 0 0 16px rgba(155, 140, 255, 0.45);
}

/* ===== Insignia de rango (game over) ===== */
#rank-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 220px;
  padding: 14px 26px;
}
.rank-label {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--text-dim);
  font-weight: 600;
}
.rank-letter {
  font-family: var(--font-display);
  font-size: 54px;
  font-weight: 900;
  line-height: 1;
  animation: rank-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes rank-pop {
  from { transform: scale(0.2) rotate(-14deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}
.rank-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
}
.stat-small { font-size: 17px !important; }

.controls-info {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.9;
  letter-spacing: 0.4px;
}
.combo-tip {
  color: var(--gold);
  opacity: 0.8;
  font-size: 12px;
}
.combo-gold {
  color: var(--gold) !important;
  text-shadow: 0 0 14px rgba(255, 201, 77, 0.6) !important;
}

/* ===== Game Over ===== */
.gameover-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(38px, 9.5vw, 62px);
  letter-spacing: 6px;
  color: #ffe9f1;
  position: relative;
  text-shadow:
    0 0 10px rgba(255, 46, 126, 0.95),
    0 0 36px rgba(255, 46, 126, 0.55),
    0 0 80px rgba(255, 0, 90, 0.4);
  animation: go-flicker 2.4s linear infinite;
}
@keyframes go-flicker {
  0%, 100% { opacity: 1; }
  41% { opacity: 1; }
  42% { opacity: 0.65; }
  43% { opacity: 1; }
  78% { opacity: 1; }
  79% { opacity: 0.75; }
  80% { opacity: 1; }
}

.final-stats {
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
}
.stat-label {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--text-dim);
  font-weight: 600;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.6);
  font-variant-numeric: tabular-nums;
}
#new-record {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 0 16px rgba(255, 201, 77, 0.7);
  animation: record-pulse 0.9s ease-in-out infinite;
}
@keyframes record-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.07); opacity: 0.85; }
}

/* ===== Pausa ===== */
.pause-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 8vw, 48px);
  font-weight: 900;
  letter-spacing: 10px;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(255, 201, 77, 0.65), 0 0 60px rgba(200, 140, 0, 0.4);
}

/* ===== Leaderboard global ===== */
.leaderboard {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.lb-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--font-body, 'Rajdhani', sans-serif);
}
.lb-item.lb-me {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.25);
}
.lb-pos { font-size: 16px; text-align: center; }
.lb-rank {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 700;
}
.lb-name {
  font-weight: 600;
  letter-spacing: 1px;
  color: #e6f7ff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-score {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(255, 201, 77, 0.4);
}
.lb-loading, .lb-empty {
  list-style: none;
  padding: 8px 4px;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}

/* ===== Envío de puntuación ===== */
.submit-score {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.submit-row {
  display: flex;
  gap: 8px;
}
#player-name {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  color: #eafcff;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
#player-name::placeholder { color: rgba(255,255,255,0.3); letter-spacing: 1px; }
#player-name:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.35);
}
#player-name:disabled { opacity: .6; }
#btn-submit-score { white-space: nowrap; }
#btn-submit-score:disabled { opacity: .7; cursor: default; }
.submit-status {
  margin: 0;
  font-size: 13px;
  color: var(--cyan);
  text-align: center;
  letter-spacing: 1px;
}

/* ===== Móvil ===== */
@media (max-width: 520px) {
  .screen-inner { gap: 14px; }
  .btn-main { font-size: 15px; padding: 14px 40px; }
  .controls-info { font-size: 12px; }
  #canvas-frame { border-radius: 0; }
  .leaderboard, .submit-score { max-width: 100%; }
  .lb-item { padding: 4px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  #bg-aurora, .btn-glow, .game-title span::before, .game-title span::after,
  .grid-floor, .corner { animation: none !important; }
}
