@font-face {
  font-family: 'Orbitron';
  src: url('../assets/fonts/orbitron.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: 'Rajdhani';
  src: url('../assets/fonts/rajdhani-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Rajdhani';
  src: url('../assets/fonts/rajdhani-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Rajdhani';
  src: url('../assets/fonts/rajdhani-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #04060e;
  --bg2: #070b18;
  --text: #eaf8ff;
  --muted: #7c93b4;
  --dim: #4a5d7c;
  --cyan: #3df5ff;
  --blue: #3a9bff;
  --violet: #b44bff;
  --magenta: #ff3ec8;
  --lime: #b9ff3d;
  --gold: #ffcb45;
  --danger: #ff4f70;
  --line: rgba(125, 205, 255, 0.14);
  --line2: rgba(150, 220, 255, 0.26);
  --panel: rgba(9, 15, 30, 0.56);
  --panel-solid: rgba(9, 14, 28, 0.9);
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.55);
  --font-display: 'Orbitron', 'Avenir Next', 'Futura', sans-serif;
  --font-ui: 'Rajdhani', 'Avenir Next', 'Trebuchet MS', sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}
body {
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; color: inherit; touch-action: manipulation; }
::selection { background: rgba(61, 245, 255, 0.3); color: #fff; }

#app { position: fixed; inset: 0; isolation: isolate; }
#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  touch-action: none;
}
body.mode-playing #scene,
body.mode-dying #scene { cursor: none; }

.fx-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 65% at 50% 46%, transparent 40%, rgba(1, 3, 9, 0.34) 78%, rgba(1, 3, 9, 0.78) 100%),
    repeating-linear-gradient(0deg, rgba(160, 220, 255, 0.018) 0, rgba(160, 220, 255, 0.018) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: normal;
}
.fx-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 0%, transparent 62%, rgba(20, 60, 100, 0.06) 100%);
  opacity: 0.9;
}

/* ═══════════════ GLASS / CONTROLS ═══════════════ */
.glass {
  background:
    linear-gradient(150deg, rgba(30, 50, 85, 0.22), rgba(6, 10, 22, 0.44) 48%),
    var(--panel);
  border: 1px solid var(--line);
  box-shadow:
    inset 0 1px 0 rgba(210, 245, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 20px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(10, 18, 34, 0.56);
  color: #b9d7ee;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.icon-btn svg { width: 20px; height: 20px; display: block; }
.icon-btn:hover {
  color: #fff;
  border-color: var(--line2);
  background: rgba(18, 34, 58, 0.8);
  box-shadow: 0 0 22px rgba(61, 245, 255, 0.12);
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn .slash { opacity: 0; }
.icon-btn.is-muted .wave, .icon-btn.is-muted .slash { }
.icon-btn.is-muted .wave { opacity: 0; }
.icon-btn.is-muted .slash { opacity: 1; }
.icon-btn.is-muted { color: #5f7693; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 30px;
  border: 0;
  border-radius: 3px;
  clip-path: polygon(13px 0, 100% 0, 100% calc(100% - 13px), calc(100% - 13px) 100%, 0 100%, 0 13px);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s var(--ease-out), box-shadow 0.25s, filter 0.25s;
  isolation: isolate;
}
.btn > * { position: relative; z-index: 2; }
.btn.primary {
  color: #03121c;
  background: linear-gradient(112deg, #8dffff 0%, #3ee6ff 24%, #2f9bff 58%, #b958ff 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -2px 0 rgba(0, 20, 60, 0.2),
    0 16px 55px rgba(35, 190, 255, 0.28);
}
.btn.primary::before {
  content: '';
  position: absolute;
  inset: -50% -20%;
  z-index: 1;
  background: linear-gradient(100deg, transparent 38%, rgba(255, 255, 255, 0.62) 50%, transparent 62%);
  transform: translateX(-120%) skewX(-14deg);
  transition: transform 0.65s var(--ease-out);
}
.btn.primary:hover::before { transform: translateX(120%) skewX(-14deg); }
.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 20px 70px rgba(35, 210, 255, 0.42),
    0 0 0 1px rgba(140, 245, 255, 0.5);
}
.btn.ghost {
  color: #c7eeff;
  background: linear-gradient(150deg, rgba(30, 55, 90, 0.28), rgba(5, 10, 22, 0.4));
  border: 1px solid rgba(120, 210, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(220, 250, 255, 0.08), 0 12px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.btn.ghost:hover {
  color: #fff;
  border-color: rgba(120, 235, 255, 0.55);
  background: linear-gradient(150deg, rgba(35, 70, 110, 0.36), rgba(8, 15, 30, 0.5));
  transform: translateY(-2px);
  box-shadow: 0 16px 50px rgba(25, 150, 220, 0.16);
}
.btn:active { transform: translateY(1px) scale(0.992); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; filter: saturate(0.5); }
.btn-play { min-width: 236px; }
.play-ico { width: 20px; height: 20px; display: inline-flex; }
.play-ico svg { width: 100%; height: 100%; filter: drop-shadow(0 1px 0 rgba(255,255,255,.3)); }
.snake-ico { width: 21px; height: 21px; display: inline-flex; color: var(--cyan); }
.snake-ico svg { width: 100%; height: 100%; }
.magic-ico-sm { width: 21px; height: 21px; display: inline-flex; color: #d2b7ff; }
.magic-ico-sm svg { width: 100%; height: 100%; filter: drop-shadow(0 0 6px rgba(180, 110, 255, 0.55)); }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  background: none;
  color: #a6c7e4;
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: color 0.2s;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75);
}
.link-btn:hover { color: var(--cyan); }
.link-btn.small { font-size: 10px; }
:focus-visible {
  outline: 2px solid rgba(120, 245, 255, 0.8);
  outline-offset: 3px;
}
.qmark {
  width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(120, 200, 255, 0.34);
  border-radius: 50%;
  font-size: 10px;
  letter-spacing: 0;
  color: #9ec9e8;
}

.coin-icon {
  width: 15px;
  height: 16px;
  display: inline-block;
  flex: none;
  background: linear-gradient(145deg, #fffbd0 0%, #ffdf75 28%, #ffb521 62%, #ff7a00 100%);
  clip-path: polygon(50% 0, 100% 36%, 50% 100%, 0 36%);
  filter: drop-shadow(0 0 7px rgba(255, 190, 60, 0.8)) drop-shadow(0 1px 0 rgba(90, 40, 0, 0.4));
}
.coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 16px 0 14px;
  border-radius: 11px;
  border: 1px solid rgba(255, 200, 80, 0.22);
  background: linear-gradient(150deg, rgba(255, 190, 60, 0.09), rgba(10, 15, 28, 0.52));
  color: #ffe4a2;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: inset 0 1px 0 rgba(255, 240, 180, 0.12), 0 8px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: #6e8bab;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.42em;
  text-transform: uppercase;
}
.kicker.tiny { font-size: 8.5px; letter-spacing: 0.36em; gap: 9px; }
.kicker-line { width: 30px; height: 1px; background: linear-gradient(90deg, transparent, rgba(100, 200, 255, 0.55)); }
.kicker-line:last-child { background: linear-gradient(90deg, rgba(100, 200, 255, 0.55), transparent); }
.kicker.danger { color: #ff7088; }
.kicker.danger .kicker-line { background: linear-gradient(90deg, transparent, rgba(255, 80, 120, 0.6)); }
.kicker.danger .kicker-line:last-child { background: linear-gradient(90deg, rgba(255, 80, 120, 0.6), transparent); }

.mono-dim { font-size: 9.5px; color: var(--dim); letter-spacing: 0.2em; font-weight: 600; }

/* ═══════════════ SCREENS ═══════════════ */
.screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  touch-action: none;
  transition: opacity 0.38s ease, visibility 0.38s;
}
.screen.open { opacity: 1; visibility: visible; pointer-events: auto; }
.skins-screen,
.modal-screen,
.modal { touch-action: pan-y; }
.modal-screen {
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 50% 50%, rgba(4, 8, 18, 0.54), rgba(2, 4, 10, 0.84));
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

/* ═══════════════ MENÚ ═══════════════ */
.menu-screen {
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 3vw, 38px);
  padding-top: max(clamp(16px, 3vw, 38px), env(safe-area-inset-top));
  padding-bottom: max(clamp(16px, 3vw, 38px), env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 65% 60% at 50% 45%, rgba(4, 8, 18, 0.12) 0%, rgba(4, 7, 15, 0.48) 62%, rgba(3, 5, 12, 0.86) 100%),
    linear-gradient(180deg, rgba(3, 5, 12, 0.5) 0%, transparent 22%, transparent 72%, rgba(3, 5, 12, 0.7) 100%);
  backdrop-filter: blur(1.2px) brightness(0.9) saturate(0.95);
  -webkit-backdrop-filter: blur(1.2px) brightness(0.9) saturate(0.95);
}
.menu-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 54% 50% at 50% 46%, rgba(3, 6, 14, 0.38), rgba(3, 6, 14, 0.12) 60%, transparent 80%);
}
.menu-screen .menu-top,
.menu-screen .hero,
.menu-screen .menu-footer { position: relative; z-index: 1; }
.menu-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand-small {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #93b4ce;
}
.brand-mark {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(90, 230, 255, 0.5);
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 14px rgba(60, 230, 255, 0.25), inset 0 0 10px rgba(60, 230, 255, 0.12);
}
.brand-mark::after {
  content: '';
  position: absolute;
  inset: 5px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--cyan);
  animation: pulseDot 2.4s ease-in-out infinite;
}
.solo-tag {
  padding: 2px 5px;
  margin-left: 3px;
  font-size: 7.5px;
  color: #6f8ca6;
  border: 1px solid rgba(110, 160, 200, 0.22);
  border-radius: 3px;
  letter-spacing: 0.14em;
}
.menu-top-right { display: flex; align-items: center; gap: 9px; }
.hero {
  margin: auto;
  width: min(980px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: translateY(-1.5vh);
}
.kicker { opacity: 0.92; }
.logo {
  position: relative;
  margin: 13px 0 0;
  font-family: var(--font-display);
  font-size: clamp(48px, 10.2vw, 132px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: 0.075em;
  padding-left: 0.075em;
  color: transparent;
  background: linear-gradient(180deg, #f4feff 0%, #a6f8ff 22%, #45d9ff 48%, #369bff 64%, #b04fff 88%, #ff62d8 100%);
  background-size: 100% 160%;
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 3px 0 rgba(0, 40, 70, 0.35)) drop-shadow(0 0 34px rgba(60, 220, 255, 0.22));
  animation: logoShimmer 9s ease-in-out infinite alternate;
}
.logo::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  color: #1bcfff;
  filter: blur(32px);
  opacity: 0.42;
  pointer-events: none;
}
.logo::after {
  content: '';
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: -13px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(70, 225, 255, 0.6) 30%, rgba(210, 90, 255, 0.6) 70%, transparent);
  opacity: 0.75;
}
.tagline {
  margin: 23px 0 0;
  display: flex;
  align-items: center;
  gap: 17px;
  font-size: clamp(9px, 1.1vw, 11px);
  font-weight: 700;
  letter-spacing: 0.52em;
  color: #93b3ce;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
}
.tagline .dot { color: var(--magenta); font-size: 13px; text-shadow: 0 0 10px var(--magenta); }
.menu-buttons {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 37px;
}
.menu-meta {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 36px);
  margin-top: 30px;
  padding: 12px 28px;
  border-top: 1px solid rgba(110, 170, 220, 0.11);
  border-bottom: 1px solid rgba(110, 170, 220, 0.11);
  background: linear-gradient(90deg, transparent, rgba(4, 9, 18, 0.52) 18%, rgba(4, 9, 18, 0.52) 82%, transparent);
}
.meta-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 66px; }
.meta-cell span { font-size: 8px; font-weight: 700; letter-spacing: 0.28em; color: #6c8aab; text-shadow: 0 1px 7px rgba(0, 0, 0, 0.9); }
.meta-cell strong {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  color: #e8fbff;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 20px rgba(80, 220, 255, 0.28), 0 1px 6px rgba(0, 0, 0, 0.8);
}
.meta-div { width: 1px; height: 26px; background: rgba(110, 170, 220, 0.15); }
.hero .link-btn { margin-top: 19px; }
.menu-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.menu-tip {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: #4d6684;
  text-align: center;
}
.menu-screen .hero > * { opacity: 0; transform: translateY(16px); }
.menu-screen.open .hero > * { animation: riseIn 0.8s var(--ease-out) forwards; }
.menu-screen.open .hero > :nth-child(1) { animation-delay: 0.05s; }
.menu-screen.open .hero > :nth-child(2) { animation-delay: 0.12s; }
.menu-screen.open .hero > :nth-child(3) { animation-delay: 0.2s; }
.menu-screen.open .hero > :nth-child(4) { animation-delay: 0.3s; }
.menu-screen.open .hero > :nth-child(5) { animation-delay: 0.38s; }
.menu-screen.open .hero > :nth-child(6) { animation-delay: 0.46s; }
.menu-screen.open .hero > :nth-child(7) { animation-delay: 0.54s; }
.menu-screen .menu-top, .menu-screen .menu-footer { opacity: 0; transition: opacity 0.7s 0.15s; }
.menu-screen.open .menu-top, .menu-screen.open .menu-footer { opacity: 1; }

/* ═══════════════ HUD ═══════════════ */
.hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
  padding: max(15px, env(safe-area-inset-top)) max(15px, env(safe-area-inset-right)) max(15px, env(safe-area-inset-bottom)) max(15px, env(safe-area-inset-left));
}
.hud.active { opacity: 1; visibility: visible; }
.hud-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.score-panel {
  position: relative;
  min-width: 158px;
  padding: 13px 19px 14px;
  border-radius: 13px;
}
.hud-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.34em;
  color: #6e8aa8;
}
.score {
  margin-top: 1px;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 800;
  line-height: 1.05;
  color: #ecffff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-shadow: 0 0 24px rgba(61, 245, 255, 0.38), 0 0 60px rgba(61, 245, 255, 0.12);
}
.score-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 10px;
  color: #ff9ccf;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}
.score-sub em { font-family: var(--font-ui); font-style: normal; font-size: 8px; letter-spacing: 0.2em; color: #8b6b82; }
.score-sub.kill-pulse { animation: killPulse 0.55s var(--ease-out); }
@keyframes killPulse {
  0% { transform: scale(1); color: #ff9ccf; }
  35% { transform: scale(1.14); color: #ffffff; text-shadow: 0 0 18px rgba(255, 62, 200, 0.9); }
  100% { transform: scale(1); }
}
.kill-glyph {
  width: 6px;
  height: 6px;
  background: var(--magenta);
  transform: rotate(45deg);
  box-shadow: 0 0 9px var(--magenta);
}
.combo {
  position: absolute;
  left: 100%;
  top: 14px;
  margin-left: 10px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--lime);
  opacity: 0;
  transform: translateX(-8px) scale(0.9);
  transition: opacity 0.18s, transform 0.18s;
  text-shadow: 0 0 15px rgba(185, 255, 61, 0.65);
  white-space: nowrap;
}
.combo.show { opacity: 1; transform: translateX(0) scale(1); }
.hud-right { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; }
.hud-actions { display: flex; gap: 8px; pointer-events: auto; }
.leaderboard { width: 238px; padding: 10px 12px 11px; border-radius: 13px; }
.lb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 7px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(110, 190, 235, 0.12);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #6c89a7;
}
.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #5bff9a;
  box-shadow: 0 0 8px #5bff9a;
  animation: blink 1.8s ease-in-out infinite;
}
.lb-rows { display: flex; flex-direction: column; gap: 3px; }
.lb-row {
  display: grid;
  grid-template-columns: 15px 8px 1fr auto;
  align-items: center;
  gap: 6px;
  height: 18px;
  font-size: 11.5px;
  font-weight: 600;
  color: #93adc7;
  transition: color 0.3s;
}
.lb-row .lb-rank { font-family: var(--font-display); font-size: 8px; color: #526b88; text-align: center; font-variant-numeric: tabular-nums; }
.lb-row .lb-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.lb-row .lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0.04em; }
.lb-row .lb-score { font-family: var(--font-display); font-size: 9px; color: #7d9bb8; font-variant-numeric: tabular-nums; }
.lb-row.me { color: #e9feff; }
.lb-row.me .lb-score { color: var(--cyan); text-shadow: 0 0 10px rgba(61, 245, 255, 0.5); }
.lb-row.me .lb-rank { color: var(--cyan); }
.lb-row.me .lb-dot { box-shadow: 0 0 12px var(--c), 0 0 2px #fff; }

.hud-bottom {
  position: absolute;
  left: max(15px, env(safe-area-inset-left));
  right: max(15px, env(safe-area-inset-right));
  bottom: max(15px, env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

/* Aviso del monstruo */
.threat {
  --threat: #ff9a3d;
  position: absolute;
  left: 50%;
  top: max(15px, env(safe-area-inset-top));
  width: min(244px, 34vw);
  padding: 8px 14px 9px;
  border-radius: 12px;
  text-align: center;
  background: linear-gradient(160deg, rgba(30, 20, 40, 0.6), rgba(8, 8, 18, 0.8));
  border: 1px solid color-mix(in srgb, var(--threat) 42%, transparent);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 0 26px color-mix(in srgb, var(--threat) 12%, transparent);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -14px);
  transition: opacity 0.28s, transform 0.32s var(--ease-out), visibility 0.28s;
  pointer-events: none;
}
.threat.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.threat.warning { --threat: #ff9a3d; }
.threat.hunting { --threat: #ff4f70; animation: threatPulse 0.9s ease-in-out infinite; }
.threat.retreat { --threat: #6bff9a; animation: none; }
.threat-kicker {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: color-mix(in srgb, var(--threat) 80%, #ffffff);
}
.threat-timer {
  margin-top: 1px;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
  color: #fff3f6;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px color-mix(in srgb, var(--threat) 55%, transparent);
}
.threat-bar {
  height: 3px;
  margin: 6px 0 4px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
}
.threat-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--threat);
  box-shadow: 0 0 10px var(--threat);
  transition: width 0.12s linear;
}
.threat-text {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: color-mix(in srgb, var(--threat) 70%, #aabdd6);
}
@keyframes threatPulse {
  0%, 100% { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 0 18px rgba(255, 79, 112, 0.14); }
  50% { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 0 38px rgba(255, 79, 112, 0.34); }
}

/* Buffs activos y recarga de la estela */
.buffs {
  position: absolute;
  left: max(15px, env(safe-area-inset-left));
  top: calc(max(15px, env(safe-area-inset-top)) + 112px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  pointer-events: none;
}
.buff {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 118px;
  max-width: 210px;
  padding: 4px 10px 6px;
  overflow: hidden;
  border-radius: 7px;
  background: rgba(6, 12, 24, 0.72);
  border: 1px solid color-mix(in srgb, var(--c, #7df9ff) 34%, transparent);
  box-shadow: 0 5px 22px rgba(0, 0, 0, 0.3), inset 0 0 14px color-mix(in srgb, var(--c, #7df9ff) 7%, transparent);
}
.buff-name {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: color-mix(in srgb, var(--c, #7df9ff) 82%, #ffffff);
}
.buff-time {
  min-width: 24px;
  text-align: right;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  color: #eafaff;
  font-variant-numeric: tabular-nums;
}
.buff-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
}
.buff-bar b {
  display: block;
  height: 100%;
  width: var(--p, 100%);
  background: var(--c, #7df9ff);
  box-shadow: 0 0 9px var(--c, #7df9ff);
  transition: width 0.12s linear;
}
.buff.ready .buff-time { color: color-mix(in srgb, var(--c, #7df9ff) 90%, #ffffff); }
.buff.ready .buff-bar b { animation: buffReady 1.4s ease-in-out infinite; }
@keyframes buffReady {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
.minimap-wrap {
  width: 148px;
  height: 148px;
  padding: 6px;
  border-radius: 50%;
  margin-left: auto;
  box-shadow: inset 0 0 30px rgba(20, 100, 170, 0.16), 0 14px 50px rgba(0, 0, 0, 0.35);
}
#minimap { width: 100%; height: 100%; display: block; border-radius: 50%; }

/* Botón de poder mágico */
.power-btn {
  display: none;
  position: absolute;
  right: max(15px, env(safe-area-inset-right));
  bottom: calc(max(15px, env(safe-area-inset-bottom)) + 164px);
  width: 78px;
  height: 78px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(160, 190, 255, 0.28);
  background: radial-gradient(circle at 38% 30%, rgba(90, 80, 180, 0.32), rgba(6, 10, 24, 0.82) 68%);
  color: var(--power, #7df9ff);
  pointer-events: auto;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  touch-action: manipulation;
  box-shadow: 0 0 0 7px rgba(80, 50, 170, 0.08), 0 0 32px color-mix(in srgb, var(--power, #7df9ff) 22%, transparent), inset 0 0 25px rgba(130, 110, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.12s, filter 0.2s, box-shadow 0.2s;
  z-index: 2;
}
.power-btn.show { display: flex; }
.power-btn:hover { transform: translateY(-2px); }
.power-btn:active { transform: scale(0.94); }
.power-btn .power-ico {
  display: flex;
  width: 27px;
  height: 27px;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 9px color-mix(in srgb, var(--power, #7df9ff) 70%, transparent));
  transition: opacity 0.2s, transform 0.2s;
}
.power-btn .power-ico svg { width: 100%; height: 100%; }
.power-btn .power-name {
  max-width: 66px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--font-display);
  font-size: 6.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  color: #dcd7ff;
}
.power-btn .power-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(var(--power, #7df9ff) calc((1 - var(--cd, 0)) * 360deg), rgba(180, 200, 255, 0.08) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  opacity: 0.9;
  pointer-events: none;
}
.power-btn .power-cd {
  display: none;
  position: absolute;
  top: -7px;
  right: -5px;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: rgba(5, 9, 20, 0.9);
  border: 1px solid color-mix(in srgb, var(--power, #7df9ff) 35%, transparent);
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  line-height: 17px;
  color: #eafaff;
  font-variant-numeric: tabular-nums;
}
.power-btn.cooling .power-cd { display: block; }
.power-btn.cooling .power-ico { opacity: 0.36; transform: scale(0.9); }
.power-btn.running {
  box-shadow: 0 0 0 9px color-mix(in srgb, var(--power, #7df9ff) 12%, transparent), 0 0 50px color-mix(in srgb, var(--power, #7df9ff) 38%, transparent), inset 0 0 30px color-mix(in srgb, var(--power, #7df9ff) 16%, transparent);
  animation: powerPulse 1.2s ease-in-out infinite;
}
.power-btn .power-key {
  position: absolute;
  bottom: -7px;
  right: 7px;
  font-family: var(--font-display);
  font-size: 7px;
  font-weight: 700;
  color: #8fa9c4;
  border: 1px solid rgba(140, 190, 230, 0.24);
  border-radius: 3px;
  padding: 1px 3px;
  background: rgba(5, 9, 20, 0.7);
}
body.touch-mode .power-key { display: none; }
@keyframes powerPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.22); }
}
.hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 15px;
  border-radius: 9px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.17em;
  color: #9dbdd8;
  transition: opacity 0.6s, transform 0.6s;
}
.hint.fade { opacity: 0; transform: translateY(7px); }
.hint-ico {
  width: 14px;
  height: 18px;
  border: 1px solid rgba(140, 210, 245, 0.5);
  border-radius: 7px;
  position: relative;
}
.hint-ico::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 3px;
  width: 2px;
  height: 5px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--cyan);
}
.touch-only { display: none !important; }
body.touch-mode .touch-only { display: flex !important; }
body.touch-mode .desktop-only { display: none !important; }
body.touch-mode .hint-ico { border-radius: 50%; height: 14px; }
body.touch-mode .hint-ico::after { display: none; }
body.touch-mode .icon-btn { width: 46px; height: 46px; }
body.touch-mode .icon-btn svg { width: 21px; height: 21px; }
body.touch-mode .hint { font-size: 10px; letter-spacing: 0.14em; }
body.touch-mode #fsBtn { display: none; }
body.touch-mode .pause-tip { display: none; }

/* ═══════════════ SKINS ═══════════════ */
.skins-screen {
  z-index: 32;
  overflow-y: auto;
  overflow-x: hidden;
  padding: max(15px, env(safe-area-inset-top)) clamp(14px, 3vw, 36px) max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(30, 80, 140, 0.11), transparent 62%),
    linear-gradient(180deg, rgba(4, 6, 14, 0.94), rgba(4, 6, 14, 0.9) 50%, rgba(4, 6, 14, 0.95));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  scrollbar-width: thin;
  scrollbar-color: rgba(80, 160, 220, 0.3) transparent;
}
.skins-screen::-webkit-scrollbar { width: 8px; }
.skins-screen::-webkit-scrollbar-thumb { background: rgba(80, 160, 220, 0.25); border-radius: 5px; }
.sub-top {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.sub-heading { text-align: center; }
.skins-sub {
  width: min(1180px, 100%);
  margin: 6px auto 22px;
  padding: 0 2px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.25em;
  color: #536f8f;
  text-align: center;
}
.skin-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 15px;
  padding-bottom: 18px;
}
.skin-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: 15px;
  border: 1px solid rgba(120, 190, 240, 0.14);
  background: linear-gradient(155deg, rgba(22, 37, 65, 0.38), rgba(6, 10, 22, 0.7));
  box-shadow: inset 0 1px 0 rgba(210, 245, 255, 0.06), 0 15px 45px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: transform 0.25s var(--ease-out), border-color 0.25s, box-shadow 0.25s;
  isolation: isolate;
}
.skin-card::before {
  content: '';
  position: absolute;
  inset: -45% 20% 55%;
  background: radial-gradient(ellipse, var(--glow, #3df5ff), transparent 66%);
  opacity: 0.17;
  filter: blur(24px);
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.3s;
}
.skin-card:hover {
  transform: translateY(-5px);
  border-color: rgba(130, 225, 255, 0.34);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.38), 0 0 35px rgba(40, 170, 255, 0.08);
}
.skin-card:hover::before { opacity: 0.29; }
.skin-card:active { transform: translateY(-1px) scale(0.995); }
.skin-card.equipped {
  border-color: rgba(61, 245, 255, 0.48);
  box-shadow: 0 0 0 1px rgba(61, 245, 255, 0.13), 0 18px 55px rgba(0, 0, 0, 0.35), inset 0 0 35px rgba(30, 160, 220, 0.07);
}
.skin-card.locked .preview-wrap canvas { filter: saturate(0.85) brightness(0.86); }
.preview-wrap {
  position: relative;
  width: 100%;
  height: 116px;
  background:
    radial-gradient(ellipse 75% 65% at 50% 55%, rgba(30, 70, 110, 0.2), transparent 70%),
    linear-gradient(180deg, rgba(10, 18, 34, 0.34), rgba(3, 6, 14, 0.15));
  border-bottom: 1px solid rgba(110, 180, 230, 0.1);
  overflow: hidden;
}
.preview-wrap::after {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glow, #3df5ff), transparent);
  opacity: 0.28;
}
.preview-wrap canvas { width: 100%; height: 100%; display: block; }
.skin-body { padding: 12px 15px 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.skin-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #e4f8ff;
}
.skin-sub { margin-top: 3px; font-size: 9px; font-weight: 600; letter-spacing: 0.16em; color: #5d7796; }
.skin-state {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  color: #7895b2;
}
.skin-card.owned .skin-state { color: #b9e9ff; }
.skin-card.equipped .skin-state { color: var(--cyan); text-shadow: 0 0 12px rgba(61, 245, 255, 0.6); }
.skin-card.locked .skin-state { color: #ffd983; }
.skin-state .coin-icon { width: 12px; height: 13px; }
.state-check {
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
}
.state-check svg { width: 100%; height: 100%; }
.skin-card.unlock-flash { animation: unlockFlash 0.95s var(--ease-out); }
@keyframes unlockFlash {
  0% { box-shadow: 0 0 0 0 rgba(61, 245, 255, 0.8), 0 0 70px rgba(61, 245, 255, 0.5); }
  45% { box-shadow: 0 0 0 5px rgba(61, 245, 255, 0.22), 0 0 70px rgba(61, 245, 255, 0.35); }
  100% { box-shadow: 0 0 0 0 rgba(61, 245, 255, 0), 0 18px 55px rgba(0, 0, 0, 0.35); }
}
.lock-badge {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(5, 10, 20, 0.62);
  border: 1px solid rgba(150, 210, 240, 0.2);
  color: #9dc6e4;
  backdrop-filter: blur(6px);
}
.lock-badge svg { width: 11px; height: 11px; }
.skin-card.equipped .lock-badge, .skin-card.owned .lock-badge { display: none; }
.skin-card.equipped .lock-badge { display: flex; color: var(--cyan); border-color: rgba(61,245,255,.4); }
.skins-footer { width: min(1180px, 100%); margin: 8px auto 0; text-align: center; }
.screen.open .skin-card { animation: cardIn 0.55s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 26ms); }

/* ── Poderes y efectos ── */
.powers-screen {
  background:
    radial-gradient(ellipse 70% 48% at 50% 0%, rgba(100, 45, 180, 0.16), transparent 62%),
    linear-gradient(180deg, rgba(4, 6, 14, 0.95), rgba(6, 4, 16, 0.92) 55%, rgba(3, 5, 12, 0.97));
}
.loadout {
  width: min(1180px, 100%);
  margin: 0 auto 22px;
  display: flex;
  gap: 10px;
  padding: 9px;
  border-radius: 15px;
  border-color: rgba(160, 150, 255, 0.18);
}
.loadout-slot {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 34px 8px 11px;
  border-radius: 10px;
  border: 1px solid rgba(130, 150, 230, 0.13);
  background: linear-gradient(135deg, rgba(40, 35, 80, 0.25), rgba(8, 10, 24, 0.36));
  position: relative;
}
.loadout-label {
  flex: none;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: #7c90b5;
}
.slot-ico {
  flex: none;
  width: 27px;
  height: 27px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--slot, #7df9ff);
  background: color-mix(in srgb, var(--slot, #7df9ff) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--slot, #7df9ff) 26%, transparent);
}
.slot-ico svg { width: 16px; height: 16px; }
.loadout-slot strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #dceeff;
}
.slot-clear {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 21px;
  height: 21px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(170, 190, 240, 0.2);
  background: rgba(10, 14, 28, 0.7);
  color: #91a8c8;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.slot-clear:hover { color: #fff; border-color: rgba(190, 210, 255, 0.5); }
.slot-clear.show { display: flex; }
.shop-section { width: min(1180px, 100%); margin: 0 auto 6px; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 5px 3px 10px;
  margin-top: 11px;
  border-bottom: 1px solid rgba(130, 150, 220, 0.12);
}
.section-head span {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #e7e3ff;
}
.section-head em {
  font-style: normal;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: #6e7fa2;
}
.power-grid { padding-top: 12px; padding-bottom: 3px; }
.magic-card .preview-wrap { background: radial-gradient(ellipse 75% 65% at 50% 55%, rgba(55, 40, 110, 0.24), transparent 72%), linear-gradient(180deg, rgba(20, 15, 44, 0.34), rgba(3, 6, 14, 0.15)); }
.magic-card .preview-wrap::after { opacity: 0.4; }
.magic-card .preview-wrap canvas { position: absolute; inset: 0; }
.magic-ico {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--glow, #7df9ff);
  background: radial-gradient(circle, rgba(8, 12, 25, 0.68), rgba(10, 12, 28, 0.2));
  border: 1px solid color-mix(in srgb, var(--glow, #7df9ff) 32%, transparent);
  box-shadow: 0 0 26px color-mix(in srgb, var(--glow, #7df9ff) 20%, transparent), inset 0 0 20px color-mix(in srgb, var(--glow, #7df9ff) 10%, transparent);
  backdrop-filter: blur(3px);
  pointer-events: none;
}
.magic-ico svg { width: 28px; height: 28px; filter: drop-shadow(0 0 9px color-mix(in srgb, var(--glow, #7df9ff) 65%, transparent)); }
.magic-card { --accent-line: var(--glow); }
.magic-card .skin-state { color: #a9b9e6; }
.magic-card.equipped .skin-state { color: var(--glow, #7df9ff); text-shadow: 0 0 12px color-mix(in srgb, var(--glow, #7df9ff) 60%, transparent); }
.magic-card.locked .skin-state { color: #ffd983; }
.magic-card.equipped { border-color: color-mix(in srgb, var(--glow, #7df9ff) 50%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--glow, #7df9ff) 14%, transparent), 0 18px 55px rgba(0, 0, 0, 0.35), inset 0 0 35px color-mix(in srgb, var(--glow, #7df9ff) 7%, transparent); }

/* Icono de la compra */
.buy-icon {
  position: absolute;
  left: 50%;
  top: 44px;
  transform: translateX(-50%);
  width: 76px;
  height: 76px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--glow, #7df9ff);
  background: radial-gradient(circle, rgba(12, 14, 30, 0.72), rgba(8, 10, 22, 0.36));
  border: 1px solid color-mix(in srgb, var(--glow, #7df9ff) 38%, transparent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--glow, #7df9ff) 24%, transparent), inset 0 0 25px color-mix(in srgb, var(--glow, #7df9ff) 12%, transparent);
  backdrop-filter: blur(4px);
  pointer-events: none;
  z-index: 3;
}
.buy-icon.show { display: flex; }
.buy-icon svg { width: 38px; height: 38px; filter: drop-shadow(0 0 12px color-mix(in srgb, var(--glow, #7df9ff) 70%, transparent)); }

/* ═══════════════ MODALES ═══════════════ */
.modal {
  position: relative;
  width: min(570px, 100%);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  border-radius: 19px;
  padding: 25px 27px 26px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(220, 245, 255, 0.09);
  scrollbar-width: thin;
  scrollbar-color: rgba(80, 160, 220, 0.3) transparent;
  transform: translateY(14px) scale(0.975);
  opacity: 0;
  transition: transform 0.42s var(--ease-out), opacity 0.3s;
}
.screen.open .modal { transform: none; opacity: 1; }
.modal::-webkit-scrollbar { width: 7px; }
.modal::-webkit-scrollbar-thumb { background: rgba(80, 160, 220, 0.25); border-radius: 4px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.modal h2 {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #f0fdff;
  text-shadow: 0 0 34px rgba(61, 245, 255, 0.2);
}
.rules-list { display: flex; flex-direction: column; gap: 1px; margin: 5px 0 17px; }
.rule {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 7px;
  border-bottom: 1px solid rgba(110, 170, 220, 0.09);
}
.rule:last-child { border-bottom: 0; }
.rule-ico {
  width: 39px;
  height: 39px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--c, var(--cyan));
  background: rgba(20, 40, 68, 0.42);
  border: 1px solid rgba(90, 200, 255, 0.16);
  border: 1px solid color-mix(in srgb, var(--c, #3df5ff) 24%, transparent);
  box-shadow: inset 0 0 18px color-mix(in srgb, var(--c, #3df5ff) 8%, transparent);
}
.rule-ico svg { width: 21px; height: 21px; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--c, #3df5ff) 45%, transparent)); }
.rule strong {
  display: block;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #dff5ff;
}
.rule span { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 500; line-height: 1.3; color: #7f9bb7; }
.controls-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 17px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid rgba(110, 180, 230, 0.1);
  background: rgba(8, 16, 30, 0.38);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #6d89a5;
}
.controls-strip b { color: #c3e8ff; font-weight: 700; }
.controls-strip .sep { width: 1px; height: 10px; background: rgba(110, 170, 220, 0.2); }

.buy-modal { width: min(465px, 100%); padding: 0; overflow: hidden; }
#buyPreview { display: block; width: 100%; height: 174px; background: radial-gradient(ellipse at 50% 60%, rgba(30, 80, 130, 0.26), rgba(3, 6, 14, 0.6)); }
.buy-glow {
  position: absolute;
  top: -54px;
  left: 20%;
  right: 20%;
  height: 160px;
  border-radius: 50%;
  background: var(--glow, #3df5ff);
  opacity: 0.25;
  filter: blur(55px);
  pointer-events: none;
  transition: background 0.3s;
}
.buy-body { position: relative; padding: 6px 27px 27px; text-align: center; }
.buy-body h2 { margin-top: 7px; font-size: 30px; letter-spacing: 0.16em; }
.buy-price {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 9px;
  padding: 6px 15px;
  border-radius: 8px;
  border: 1px solid rgba(255, 200, 80, 0.18);
  background: rgba(255, 180, 50, 0.05);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: #ffdf94;
}
.buy-price em { font-family: var(--font-ui); font-style: normal; font-size: 8px; letter-spacing: 0.2em; color: #8f7b50; }
.buy-note { min-height: 17px; margin: 9px 0 20px; font-size: 11px; letter-spacing: 0.08em; color: #7a91aa; }
.buy-desc { min-height: 14px; margin: 8px 0 0; font-size: 10.5px; line-height: 1.35; letter-spacing: 0.06em; color: #8fa4c2; }
.buy-note.bad { color: #ff8fa4; }
.buy-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 9px; }
.buy-modal.shake { animation: modalShake 0.42s cubic-bezier(.36,.07,.19,.97); }
@keyframes modalShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

.pause-modal { width: min(430px, 100%); text-align: center; padding-top: 29px; }
.pause-modal h2 { font-size: 39px; letter-spacing: 0.18em; }
.pause-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 20px 0 23px;
  border: 1px solid rgba(110, 180, 230, 0.11);
  border-radius: 11px;
  overflow: hidden;
  background: rgba(8, 16, 30, 0.25);
}
.pause-stats > div { padding: 10px 6px; border-right: 1px solid rgba(110, 180, 230, 0.09); }
.pause-stats > div:last-child { border-right: 0; }
.pause-stats span { display: block; font-size: 8px; font-weight: 700; letter-spacing: 0.22em; color: #617c99; }
.pause-stats strong { display: block; margin-top: 2px; font-family: var(--font-display); font-size: 18px; color: #e4f8ff; font-variant-numeric: tabular-nums; }
.pause-actions { display: flex; flex-direction: column; gap: 9px; }
.pause-options { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 17px; padding-top: 13px; border-top: 1px solid rgba(110, 180, 230, 0.1); }
.pause-tip { font-size: 8.5px; letter-spacing: 0.16em; color: #4f6a86; }

/* ═══════════════ MUERTE ═══════════════ */
.death-screen {
  z-index: 36;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  overflow-y: auto;
  touch-action: pan-y;
  background:
    radial-gradient(ellipse 55% 60% at 50% 48%, rgba(80, 12, 45, 0.2), transparent 65%),
    radial-gradient(ellipse 80% 80% at 50% 50%, rgba(3, 5, 12, 0.32), rgba(2, 3, 8, 0.8));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.death-card {
  position: relative;
  width: min(470px, 100%);
  margin: auto;
  padding: 33px 32px 29px;
  text-align: center;
  border: 1px solid rgba(255, 100, 160, 0.2);
  border-radius: 21px;
  background: linear-gradient(160deg, rgba(45, 16, 45, 0.3), rgba(7, 8, 20, 0.82) 46%), rgba(8, 10, 24, 0.62);
  box-shadow: 0 35px 120px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 220, 240, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  transform: translateY(14px) scale(0.97);
  opacity: 0;
  transition: transform 0.5s var(--ease-out), opacity 0.35s;
}
.death-screen.open .death-card { transform: none; opacity: 1; }
.death-glow {
  position: absolute;
  top: -100px;
  left: 10%;
  right: 10%;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 55, 130, 0.22), transparent 66%);
  filter: blur(25px);
}
.death-card h2 {
  position: relative;
  margin: 12px 0 3px;
  font-family: var(--font-display);
  font-size: clamp(31px, 5vw, 43px);
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #ffeef6;
  text-shadow: 0 0 30px rgba(255, 60, 140, 0.42), 0 3px 0 rgba(70, 0, 30, 0.45);
}
.death-cause {
  margin-bottom: 19px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #9c7589;
  text-transform: uppercase;
}
.death-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 13px 0 11px;
  border-top: 1px solid rgba(255, 120, 170, 0.13);
  border-bottom: 1px solid rgba(255, 120, 170, 0.13);
}
.death-score span { font-size: 8px; font-weight: 700; letter-spacing: 0.3em; color: #8d7183; }
.death-score strong {
  font-family: var(--font-display);
  font-size: clamp(44px, 7vw, 62px);
  font-weight: 800;
  line-height: 1.1;
  color: #f1ffff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 40px rgba(61, 245, 255, 0.26);
}
.new-record {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 12px;
  border-radius: 5px;
  border: 1px solid rgba(255, 210, 80, 0.32);
  background: rgba(255, 190, 40, 0.09);
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #ffdc7e;
  box-shadow: 0 0 20px rgba(255, 180, 40, 0.12);
  animation: recordPulse 2s ease-in-out infinite;
}
.new-record.hidden { display: none; }
.death-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 14px 0 12px;
}
.death-stats > div { padding: 3px 5px; border-right: 1px solid rgba(255, 120, 170, 0.12); }
.death-stats > div:last-child { border-right: 0; }
.death-stats span { display: block; font-size: 8px; font-weight: 700; letter-spacing: 0.22em; color: #7d6979; }
.death-stats strong { display: block; margin-top: 2px; font-family: var(--font-display); font-size: 17px; color: #e2f4ff; font-variant-numeric: tabular-nums; }
.death-earn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 7px 17px;
  border-radius: 8px;
  border: 1px solid rgba(255, 200, 80, 0.22);
  background: linear-gradient(120deg, rgba(255, 180, 50, 0.12), rgba(255, 100, 40, 0.04));
  color: #ffe1a0;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.08em;
  box-shadow: 0 0 28px rgba(255, 160, 40, 0.1);
}
.death-earn b { font-weight: 800; color: #fff1bf; }
.death-actions { display: grid; grid-template-columns: 1.15fr 1fr; gap: 9px; }

/* ═══════════════ TOAST / FLASH ═══════════════ */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(36px, calc(env(safe-area-inset-bottom) + 26px));
  z-index: 60;
  transform: translate(-50%, 14px);
  padding: 9px 18px;
  border-radius: 9px;
  border: 1px solid rgba(110, 220, 255, 0.28);
  background: rgba(7, 15, 30, 0.82);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 24px rgba(30, 180, 255, 0.08);
  color: #d8f6ff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.35s var(--ease-out);
  backdrop-filter: blur(14px);
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.gold { border-color: rgba(255, 200, 80, 0.35); color: #ffdf94; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 24px rgba(255, 170, 40, 0.12); }
.flash {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at center, rgba(190, 255, 255, 0.5), rgba(40, 160, 255, 0.16) 45%, transparent 72%);
  mix-blend-mode: screen;
}
.flash.on { animation: flashOut 0.5s ease-out; }
.flash.danger {
  background: radial-gradient(ellipse at center, rgba(255, 210, 235, 0.3), rgba(255, 35, 90, 0.26) 40%, transparent 74%);
}
@keyframes flashOut { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ═══════════════ ANIMACIONES ═══════════════ */
@keyframes riseIn { to { opacity: 1; transform: none; } }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes logoShimmer {
  0% { background-position: 50% 0%; }
  100% { background-position: 50% 100%; }
}
@keyframes pulseDot { 0%, 100% { opacity: 0.55; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } }
@keyframes blink { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes flashOut { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes recordPulse { 0%, 100% { box-shadow: 0 0 20px rgba(255, 180, 40, 0.1); } 50% { box-shadow: 0 0 32px rgba(255, 180, 40, 0.24); } }

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 760px) {
  .menu-screen { padding: 14px; padding-top: max(14px, env(safe-area-inset-top)); }
  .brand-small .solo-tag { display: none; }
  .menu-top-right .icon-btn#fsBtn { display: none; }
  .coin-pill { height: 38px; padding: 0 12px; font-size: 11.5px; }
  .icon-btn { width: 38px; height: 38px; }
  .icon-btn svg { width: 18px; height: 18px; }
  .hero { transform: translateY(-0.5vh); }
  .logo { letter-spacing: 0.055em; padding-left: 0.055em; }
  .tagline { gap: 11px; letter-spacing: 0.36em; }
  .menu-buttons { flex-direction: column; width: 100%; max-width: 290px; gap: 9px; margin-top: 27px; }
  .menu-buttons .btn { width: 100%; min-height: 48px; }
  .menu-meta { gap: 10px; padding: 10px 16px; width: 100%; max-width: 330px; justify-content: space-between; }
  .meta-cell { min-width: 54px; }
  .meta-cell strong { font-size: 18px; }
  .meta-cell span { font-size: 7px; letter-spacing: 0.2em; }
  .menu-footer { justify-content: center; }
  .menu-footer .mono-dim { display: none; }
  .menu-tip { font-size: 8px; }
  .leaderboard { width: 176px; padding: 8px 9px; }
  .lb-row { font-size: 10px; height: 16px; grid-template-columns: 12px 6px 1fr auto; gap: 4px; }
  .lb-row .lb-score { font-size: 8px; }
  .lb-head { font-size: 7px; }
  .score-panel { min-width: 126px; padding: 10px 14px 11px; }
  .score-sub { font-size: 9px; }
  .minimap-wrap { width: 104px; height: 104px; padding: 4px; }
  .power-btn { width: 68px; height: 68px; bottom: calc(max(15px, env(safe-area-inset-bottom)) + 118px); }
  .power-btn .power-ico { width: 23px; height: 23px; }
  .power-btn .power-name { font-size: 6px; max-width: 56px; }
  .hint { max-width: 60%; padding: 7px 11px; font-size: 8px; }
  .hint span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .threat { top: calc(max(14px, env(safe-area-inset-top)) + 224px); width: min(200px, 56vw); padding: 6px 10px 7px; }
  .threat-timer { font-size: 20px; }
  .threat-text { font-size: 7px; letter-spacing: 0.1em; }
  .buffs { top: calc(max(14px, env(safe-area-inset-top)) + 96px); transform: scale(0.9); transform-origin: top left; }
  .buff { min-width: 98px; padding: 3px 8px 5px; }
  .buff-name { font-size: 7px; }
  .buff-time { font-size: 8px; }
  .death-stats { grid-template-columns: repeat(4, 1fr); }
  .death-stats span { font-size: 7px; letter-spacing: 0.14em; }
  .death-stats strong { font-size: 15px; }
  .skin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .preview-wrap { height: 88px; }
  .skin-body { padding: 9px 10px 11px; }
  .skin-name { font-size: 10.5px; }
  .skin-sub { display: none; }
  .skin-state { font-size: 8px; }
  .magic-ico { width: 46px; height: 46px; }
  .magic-ico svg { width: 22px; height: 22px; }
  .loadout { flex-direction: column; margin-bottom: 14px; }
  .loadout-slot { padding-right: 30px; }
  .section-head { margin-top: 6px; }
  .modal { padding: 20px 18px 21px; }
  .rules-modal { max-height: calc(100vh - 30px); max-height: calc(100dvh - 30px); }
  .controls-strip { display: none; }
  .rule { padding: 8px 3px; gap: 11px; }
  .rule span { font-size: 11.5px; }
  .death-card { padding: 26px 20px 22px; }
  .death-actions { grid-template-columns: 1fr; }
  .death-actions .btn { min-height: 48px; }
  .buy-actions { grid-template-columns: 1fr; }
  .buy-actions .btn { min-height: 48px; }
  .pause-tip { display: none; }
}
@media (max-height: 640px) {
  .menu-footer { display: none; }
  .menu-meta { margin-top: 18px; }
  .menu-buttons { margin-top: 24px; }
  .tagline { margin-top: 18px; }
  .hero .link-btn { margin-top: 12px; }
  .logo { font-size: clamp(38px, 8.8vw, 90px); }
}
@media (hover: none) and (pointer: coarse) {
  .menu-tip { opacity: 0.9; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
