/* --- RESET Y BASE --- */
body,
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #111; /* Fondo oscuro detrás del marco del celular */
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100svh;
  max-width: 450px; /* Forzamos el ancho máximo típico de un móvil grande */
  max-height: 900px; /* Limitamos la altura en PC para que no sea infinito */
  background-color: #000;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 255, 200, 0.2); /* Un resplandor temático 3DX */
}

/* En PC, le damos un poco de borde redondeado para simular un dispositivo */
@media (min-width: 451px) {
  #game-container {
    height: 90vh;
    border-radius: 20px;
    border: 2px solid #333;
  }
}

#survival-background-video {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  background: #000;
}

#survival-background-video[hidden] {
  display: none;
}

canvas {
  position: relative;
  z-index: 1;
  display: block;
  image-rendering: auto;
}

.audio-autoplay-hint {
  align-self: center;
  margin: 2px 0 6px;
  color: #8feeff;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.85px;
  animation: audioHintPulse 1.8s ease-in-out infinite;
}

.audio-autoplay-hint[hidden],
html:not([lang="es"]) .audio-autoplay-hint-es,
html[lang="es"] .audio-autoplay-hint-en {
  display: none;
}

@keyframes audioHintPulse {
  50% { opacity: 0.58; }
}

@media (prefers-reduced-motion: reduce) {
  .audio-autoplay-hint { animation: none; }
}

/* --- FASE 12: SYSTEM RECORDS --- */
.system-records-screen {
  width: min(calc(100% - 16px), 760px);
  max-width: calc(100% - 16px);
  max-height: calc(100% - 16px);
  min-height: 0;
  padding: 16px;
  gap: 12px;
  justify-content: flex-start;
  overflow: hidden;
  border: 1px solid rgba(0, 210, 255, 0.72);
  background:
    linear-gradient(rgba(0, 210, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 210, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 50% 0, rgba(0, 210, 255, 0.14), transparent 38%),
    rgba(1, 6, 13, 0.985);
  background-size: 24px 24px, 24px 24px, auto, auto;
  box-shadow: 0 18px 48px rgba(0, 5, 18, 0.84), 0 0 28px rgba(0, 210, 255, 0.13);
}

.system-records-header {
  flex: 0 0 auto;
  width: 100%;
  text-align: left;
}

#system-records-kicker {
  color: #00d2ff;
  font-size: 0.5rem;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.system-records-header h2 {
  margin: 4px 0 2px;
  color: #fff;
  font-size: clamp(1.3rem, 4vw, 1.85rem);
  letter-spacing: 3px;
}

.system-records-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.72rem;
}

.system-records-categories {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: 0 0 auto;
  width: 100%;
  gap: 6px;
}

.system-records-categories button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: 38px;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.52rem;
  font-weight: 850;
  letter-spacing: 0.6px;
}

.system-records-categories button span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.system-records-categories button strong {
  flex: 0 0 auto;
  color: #00d2ff;
}

.system-records-categories button[aria-selected="true"],
.system-records-categories button:hover,
.system-records-categories button:focus-visible {
  border-color: rgba(0, 210, 255, 0.72);
  background: rgba(0, 210, 255, 0.1);
  color: #fff;
  outline: none;
}

.system-records-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  width: 100%;
  min-height: 0;
  gap: 8px;
  overflow: hidden auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 210, 255, 0.55) transparent;
}

.system-record-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(3, 12, 22, 0.78);
  text-align: left;
}

.system-record-card.is-complete {
  border-color: rgba(0, 210, 255, 0.58);
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.11), rgba(3, 12, 22, 0.84));
}

.system-record-card header,
.system-record-card footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.system-record-card header span {
  color: #00d2ff;
  font-size: 0.45rem;
  font-weight: 900;
  letter-spacing: 1px;
}

.system-record-card h3 {
  margin: 3px 0 0;
  color: #fff;
  font-size: 0.78rem;
  letter-spacing: 0.8px;
  overflow-wrap: anywhere;
}

.system-record-card header > strong {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.48rem;
  letter-spacing: 0.8px;
}

.system-record-card.is-complete header > strong { color: #00d2ff; }

.system-record-card p {
  min-height: 2.5em;
  margin: 8px 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.65rem;
  line-height: 1.4;
}

.system-record-progress {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.system-record-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #006d91, #00d2ff);
}

.system-record-card footer {
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.55rem;
}

.system-record-card footer b { color: rgba(255, 255, 255, 0.82); }
.system-record-series-list {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 7px;
}

.system-record-series {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(0, 210, 255, 0.18);
  border-radius: 8px;
  background: rgba(0, 210, 255, 0.04);
}

.system-record-series > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.52rem;
}

.system-record-series strong { color: #c9f7ff; }
.system-record-archive-state,
.system-record-reward-hint {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.53);
  font-size: 0.5rem;
  line-height: 1.35;
  letter-spacing: 0.55px;
}
.system-record-archive-state.is-recovered { color: #00d2ff; }
.system-record-reward-hint { color: #9ba9b2; }
.system-records-close { flex: 0 0 auto; width: 100%; margin: 0; }
.archive-records-open { width: 100%; margin: 10px 0 0; }

.system-record-notification {
  position: fixed;
  z-index: 12000;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  display: grid;
  width: min(calc(100% - 28px), 330px);
  padding: 10px 14px;
  border: 1px solid rgba(0, 210, 255, 0.72);
  border-radius: 9px;
  background: rgba(1, 8, 17, 0.94);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.72), 0 0 20px rgba(0, 210, 255, 0.16);
  color: #fff;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -14px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.system-record-notification.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.system-record-notification span,
.system-record-notification b {
  color: #00d2ff;
  font-size: 0.48rem;
  letter-spacing: 1.2px;
}

.system-record-notification strong {
  margin: 2px 0;
  font-size: 0.78rem;
  letter-spacing: 0.8px;
}

@media (max-width: 520px) {
  .system-records-screen { padding: 11px; gap: 8px; }
  .system-records-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .system-records-list { grid-template-columns: 1fr; }
  .system-record-card p { min-height: 0; }
}

@media (max-height: 430px) and (orientation: landscape) {
  .system-records-screen {
    width: min(calc(100% - 18px), 820px);
    max-height: calc(100svh - 10px);
    padding: 8px 12px;
    gap: 6px;
  }
  .system-records-header p { display: none; }
  .system-records-header h2 { margin: 1px 0; font-size: 1.05rem; }
  .system-records-categories { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
  .system-records-categories button { min-height: 30px; padding: 4px 6px; }
  .system-records-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .system-record-card { padding: 8px; }
  .system-record-card p { min-height: 0; margin: 4px 0; }
  .system-records-close { min-height: 30px; padding: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .system-record-notification { transition-duration: 0.01ms; }
}

/* --- CAPA DE INTERFAZ --- */
#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* --- VENTANAS (OVERLAYS) --- */
.overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  max-width: 320px;
  max-height: 90vh;
  overflow-y: auto;

  /* Fondo oscuro puro */
  background: rgba(0, 0, 0, 0.95);
  /* Bordes y líneas en blanco puro */
  border: 2px solid #ffffff;
  border-radius: 15px;
  padding: 20px 15px;

  /* Textos en blanco */
  color: #ffffff;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  pointer-events: auto;
  box-sizing: border-box;

  /* Layout */
  display: flex; /* El JS lo alterna con display: none */
  flex-direction: column;
  justify-content: space-between;
  min-height: 400px;

  /* --- LA SOLUCIÓN AQUÍ --- */
  z-index: 1000; /* Obliga a la tarjeta a mostrarse SIEMPRE por encima del juego */

  scrollbar-width: none; /* Oculta en Firefox */
  -ms-overflow-style: none; /* Oculta en IE/Edge */

}

.overlay::-webkit-scrollbar {
  display: none;
}

/* Ajuste de imágenes dentro de menús */
.overlay img {
  max-width: 100%;
  height: auto;
  max-height: 120px; /* Limita el tamaño del banner para dejar espacio a botones */
  margin-bottom: 10px;
  object-fit: contain;
}

h1 {
  font-size: 1.4rem;
  margin: 5px 0;
  color: #00ffc8;
  text-transform: uppercase;
}
h2 {
  font-size: 1.2rem;
  margin: 5px 0;
  color: #fff;
}
p {
  font-size: 0.9rem;
  margin: 5px 0 15px;
  color: #ccc;
  line-height: 1.3;
}

button {
  width: 100%;
  padding: 12px;

  /* CAMBIO 1: Empujamos el botón 35px hacia abajo */
  /* Orden: Arriba | Derecha | Abajo | Izquierda */
  margin: 35px 0 5px 0;

  font-size: 1rem;
  font-weight: bold;
  color: #000;
  background-color: #00ffc8;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-transform: uppercase;

  /* CAMBIO 2: Lo mandamos a la capa inferior para que no tape el texto */
  position: relative;
  z-index: 1;
}

input[type="text"] {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 6px;
  border: none;
  background: #222;
  color: #fff;
  text-align: center;
  box-sizing: border-box;
}

.status-msg {
  min-height: 18px;
  margin: 4px 0 8px;
  color: #00ff66;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-msg.is-error {
  color: #ff4d8d;
}

/* Variantes */
#victory-screen {
  border-color: #00d2ff;
}
#victory-screen h2 {
  color: #00d2ff;
}
#victory-screen button {
  background-color: #00d2ff;
}

.language-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  width: auto;
  min-width: 46px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(0, 210, 255, 0.75);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  font-size: 0.75rem;
  line-height: 1;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.35);
  z-index: 30;
}

#secret-ending {
  border-color: #00ffff;
}
#secret-ending h2 {
  color: #00ffff;
}

.main-banner {
  width: 100%;
  max-height: 80px !important;
  margin-bottom: 10px;
}

#top-score-display {
  margin: 0 0 6px;
  color: #00ff66;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.25;
  white-space: pre-line;
  text-shadow: 0 0 8px rgba(0, 255, 102, 0.45);
}

/* Título en blanco brillante */
.light-title {
  font-size: 1.6rem;
  letter-spacing: 2px;
  margin: 0;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* --- GLOSARIO (Caja sutil para separar jerarquía) --- */
.powerup-glossary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 15px 10px;
  margin: 15px 0 10px 0; /* Margen estándar */

  /* ESTO ES LO CRÍTICO */
  position: relative;
  z-index: 20; /* Fuerza a que el texto siempre esté POR ENCIMA del neón */
}

.section-title {
  font-size: 0.7rem;
  color: #ffffff;
  margin-bottom: 15px !important;
  font-weight: bold;
  letter-spacing: 1px;
  opacity: 0.9;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.glossary-grid .item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.glossary-grid img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  margin-bottom: 8px !important;
  position: relative;
  z-index: 2; /* Mantiene la imagen sobre las partículas */
}

.glossary-grid span {
  font-size: 0.6rem;
  font-weight: bold;
  color: #ffffff; /* Texto de los poderes en blanco */
}

/* Contenedor del efecto visual */
.orb-visual {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

.orb-visual img {
  width: 40px; /* Tamaño idéntico al 'size' del juego */
  height: 40px;
  z-index: 3;
}

/* Capa 1: Resplandor Pulsante (Simula el globalAlpha y shadowBlur) */
.orb-visual .glow {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  z-index: 1;
  animation: cssOrbPulse 2s ease-in-out infinite;
}

/* Capa 2: Anillo Giratorio (Simula el arc de Math.PI * 1.5 y ctx.rotate) */
.orb-visual .ring {
  position: absolute;
  width: 52px; /* Radio de 26px como en el juego */
  height: 52px;
  border: 3px solid transparent;
  border-radius: 50%;
  z-index: 2;
  /* Creamos el anillo incompleto (270 grados) */
  border-top-color: inherit;
  border-left-color: inherit;
  border-right-color: inherit;
  animation: cssOrbRotate 4s linear infinite;
}

/* Colores específicos según el poder */
.escudo-fx {
  --orb-color: #00d2ff;
  border-color: #00d2ff;
  color: #00d2ff;
}
.pulso-fx {
  --orb-color: #ff00ff;
  border-color: #ff00ff;
  color: #ff00ff;
}
.turbo-fx {
  --orb-color: #00ff66;
  border-color: #00ff66;
  color: #00ff66;
}

.item .glow {
  background: var(--orb-color);
  box-shadow: 0 0 20px var(--orb-color);
}

/* ANIMACIONES: Espejo matemático del código JS */

@keyframes cssOrbPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.25; /* globalAlpha 0.4 - 0.15 */
  }
  50% {
    transform: scale(1.15); /* Crecimiento proporcional al pulse * 3 */
    opacity: 0.55; /* globalAlpha 0.4 + 0.15 */
  }
}

@keyframes cssOrbRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* --- BOTÓN PRINCIPAL VERSIÓN "POWER-ENGINE" --- */
.btn-main {
  position: relative;
  background-color: #ffffff; /* Botón Blanco Sólido */
  color: #000000;
  border: none;
  padding: 18px 30px;
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
  overflow: visible; /* Permitimos que el brillo salga del botón */
  transition: transform 0.1s;
  z-index: 10;
}

/* El texto del botón para que resalte */
.btn-main-text {
  position: relative;
  z-index: 5;
  letter-spacing: 1px;
}

/* EFECTO DE AURA TRIPLE (Azul, Magenta, Verde) */
/* Usamos sombras dinámicas para crear la energía de los poderes */
.btn-main::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 12px;
  z-index: -1;
  /* Tres capas de sombras que rotan y pulsan */
  box-shadow:
    0 0 15px #00d2ff,
    /* Escudo */ 0 0 30px #ff00ff,
    /* Pulso */ 0 0 45px #00ff66; /* Turbo */
  animation: engineGlow 3s ease-in-out infinite;
  opacity: 0.8;
}

/* EFECTO DE PARTÍCULAS ORBITALES ALREDEDOR DEL BOTÓN */
/* Simula la energía de los orbes pero en el botón */
.btn-main::after {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 16px;
  z-index: -2;
  background: linear-gradient(45deg, #00d2ff, #ff00ff, #00ff66, #00d2ff);
  background-size: 400%;
  filter: blur(8px);
  animation: rainbowFlow 6s linear infinite;
  opacity: 0.5;
}

/* ANIMACIONES */

/* Animación de pulsación de energía */
@keyframes engineGlow {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 0 10px #ff00ff,
      0 0 20px #00ff66,
      0 0 30px #00d2ff;
  }
  50% {
    transform: scale(1.02, 1.05);
    box-shadow:
      0 0 20px #ff00ff,
      0 0 40px #00ff66,
      0 0 60px #00d2ff;
    opacity: 1;
  }
}

/* Movimiento circular de los colores de los poderes */
@keyframes rainbowFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Feedback al tocarlo */
.btn-main:active {
  transform: scale(0.95);
}

/* --- FOOTER BLANCO --- */
.menu-footer {
  margin-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.3); /* Línea divisoria en blanco tenue */
  padding-top: 10px;
}

.menu-footer p {
  font-size: 0.75rem;
  margin-bottom: 5px;
  color: #cccccc;
}

.contact-link {
  color: #ffffff; /* Link en blanco para máxima limpieza visual */
  font-size: 0.8rem;
  text-decoration: none;
  font-weight: bold;
}

.contact-link:hover {
  text-decoration: underline;
  color: #00ffc8; /* Brilla en cyan al tocarlo */
}

#menu button.contact-link {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.monthly-preview-row.is-open {
  opacity: 0.58;
  border-style: dashed;
}

.leaderboard-periods {
  display: flex;
  width: 100%;
  gap: 6px;
  overflow-x: auto;
}

.leaderboard-periods button {
  flex: 0 0 auto;
  margin: 0;
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.035);
  color: #999;
  font-size: .54rem;
}

.leaderboard-periods button.is-active { border-color: #00d2ff; color: #fff; }

.contact-screen {
  width: min(calc(100% - 20px), 440px);
  max-height: calc(100svh - 20px);
  overflow-y: auto;
  gap: 10px;
}

.contact-screen h2 { margin: 0; color: #00d2ff; }
.contact-language-toggle { align-self: flex-end; width: auto; margin: 0; }
.contact-screen > p { margin: 0; font-size: .7rem; }
.contact-form { display: grid; width: 100%; gap: 6px; text-align: left; }
#contact-fields { display: grid; gap: 6px; }
.contact-field { display: grid; gap: 6px; }
.contact-form label { color: #9edfff; font-size: .57rem; font-weight: 800; }
.contact-form input, .contact-form select, .contact-form textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 9px;
  border: 1px solid rgba(0,210,255,.28);
  border-radius: 6px;
  background: rgba(0,8,18,.84);
  color: #fff;
}
.contact-actions { display: grid; width: 100%; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.contact-actions button { margin: 0; padding: 8px 5px; font-size: .56rem; }
.contact-status { min-height: 1.2em; color: #00ff66; }
.contact-status.is-error { color: #ff668f; }
.contact-consent { display: flex; align-items: flex-start; gap: 8px; padding: 7px 0; }
.contact-consent input { width: auto; margin-top: 2px; }
.contact-ticket-summary { padding: 9px; border: 1px solid rgba(0,210,255,.2); border-radius: 7px; background: rgba(0,210,255,.045); }
.contact-ticket-summary > strong { color: #00d2ff; font-size: .58rem; }
.contact-ticket-summary dl { margin: 7px 0 0; }
.contact-ticket-summary dl div { display: grid; grid-template-columns: minmax(80px,.7fr) 1fr; gap: 8px; padding: 3px 0; }
.contact-ticket-summary dt { color: #8193a4; font-size: .53rem; }
.contact-ticket-summary dd { overflow-wrap: anywhere; margin: 0; color: #fff; font-size: .56rem; }

@media (max-width: 430px), (max-height: 480px) {
  .contact-screen { padding: 12px; }
  .contact-actions { grid-template-columns: 1fr; }
}

/* --- DISEÑO DEL BANNER PUBLICITARIO B2B --- */
.b2b-banner {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 255, 200, 0.3);
  border-radius: 10px;
  padding: 15px;
  margin: 15px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 90%;
  max-width: 320px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.b2b-banner img {
  width: 100%;
  max-height: 80px;
  object-fit: contain;
  border-radius: 5px;
}

.b2b-link {
  color: #00ffc8;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(0, 255, 200, 0.5);
  transition: all 0.3s ease;
}

.b2b-link:hover {
  color: #fff;
  text-shadow: 0 0 15px #00ffc8;
}

/* --- BOTONES DE GAME OVER MEJORADOS --- */
.buttons-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin-top: 10px;
}

/* Botón Principal (Blanco Premium) */
.btn-primary {
  background-color: #ffffff !important;
  color: #000000 !important;
  border: none;
  box-shadow: 0 0 15px rgba(0, 255, 200, 0.4); /* Un toque de brillo cian sutil */
  font-weight: 900;
  transition: transform 0.2s;
}

/* Botón Secundario (Estilo Fantasma Blanco) */
.btn-secondary {
  background-color: transparent !important;
  border: 2px solid #ffffff !important;
  color: #ffffff !important;
  opacity: 0.8;
}

.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.95);
}


/* --- FASE 1: ACABADO Y ESTABILIDAD VISUAL --- */
button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #00d2ff;
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  filter: grayscale(0.45);
}

.overlay {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: overlayEnter 220ms ease-out;
}

@keyframes overlayEnter {
  from { opacity: 0; transform: translate(-50%, -47%) scale(0.97); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (max-height: 680px) {
  .overlay {
    min-height: 0;
    max-height: 94svh;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .powerup-glossary {
    margin: 8px 0;
    padding: 9px 7px;
  }

  .orb-visual {
    transform: scale(0.82);
    margin-bottom: 2px;
  }

  .btn-main {
    margin-top: 18px;
    padding: 14px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* --- FASE 7.2: PULSO UNIFICADO Y ESTADO GLOBAL DEL MENU --- */
:root {
  --menu-system-pulse: 8.5s;
}

.menu-ambient {
  opacity: 0;
  visibility: hidden;
  transition: opacity 320ms ease, visibility 0s linear 320ms;
}

body.menu-active .menu-ambient {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

body.game-active .menu-ambient {
  opacity: 0;
  visibility: hidden;
  transition-delay: 0s, 320ms;
}

.menu-ambient-particles {
  animation: none;
}

.menu-ambient-particles-a {
  --particle-rest-opacity: 0.28;
  --particle-peak-opacity: 0.52;
}

.menu-ambient-particles-b {
  --particle-rest-opacity: 0.18;
  --particle-peak-opacity: 0.34;
}

.menu-ambient-particles-c {
  --particle-rest-opacity: 0.2;
  --particle-peak-opacity: 0.38;
}

body.menu-active .menu-ambient-particles-a {
  animation:
    ambientParticleDriftA 24s linear infinite,
    systemParticlePulse var(--menu-system-pulse) ease-in-out infinite;
}

body.menu-active .menu-ambient-particles-b {
  animation:
    ambientParticleDriftB 33s linear infinite,
    systemParticlePulse var(--menu-system-pulse) ease-in-out infinite;
}

body.menu-active .menu-ambient-particles-c {
  animation:
    ambientParticleDriftC 28s linear infinite reverse,
    systemParticlePulse var(--menu-system-pulse) ease-in-out infinite;
}

@keyframes systemParticlePulse {
  0%, 100% { opacity: var(--particle-rest-opacity); }
  50% { opacity: var(--particle-peak-opacity); }
}

body.menu-active #menu {
  animation: systemPanelPulse var(--menu-system-pulse) ease-in-out infinite;
}

body:not(.menu-active) #menu {
  animation: none;
}

@keyframes systemPanelPulse {
  0%, 100% {
    border-color: rgba(165, 225, 240, 0.62);
    box-shadow:
      0 13px 32px rgba(0, 18, 36, 0.72),
      0 0 13px rgba(0, 210, 255, 0.09),
      0 0 28px rgba(0, 105, 125, 0.06);
  }
  50% {
    border-color: rgba(214, 251, 255, 0.92);
    box-shadow:
      0 15px 38px rgba(0, 22, 42, 0.66),
      0 0 27px rgba(0, 210, 255, 0.25),
      0 0 52px rgba(0, 150, 154, 0.14);
  }
}

body.menu-active #menu::before {
  animation: none;
  opacity: 0;
}

#menu > .menu-energy-trace {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  width: 42px;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(150, 248, 255, 0.95), #00d2ff, transparent);
  box-shadow: 0 0 7px rgba(0, 210, 255, 0.72);
  opacity: 0;
  offset-path: inset(2px round 13px);
  offset-rotate: auto;
  pointer-events: none;
}

body.menu-active #menu > .menu-energy-trace {
  animation: menuEnergyDiagnostic 18s linear infinite;
}

body.game-active #menu > .menu-energy-trace {
  animation-play-state: paused;
  opacity: 0;
}

@keyframes menuEnergyDiagnostic {
  0%, 68% { offset-distance: 0%; opacity: 0; }
  72% { offset-distance: 0%; opacity: 0.68; }
  94% { offset-distance: 100%; opacity: 0.68; }
  98%, 100% { offset-distance: 100%; opacity: 0; }
}

body.menu-active #menu .helix-hero-stage {
  animation: systemBannerPulse var(--menu-system-pulse) ease-in-out infinite;
}

@keyframes systemBannerPulse {
  0%, 100% {
    border-color: rgba(0, 210, 255, 0.27);
    box-shadow: inset 0 0 13px rgba(0, 60, 78, 0.07), 0 0 8px rgba(0, 210, 255, 0.035);
    background-color: rgba(255, 255, 255, 0.018);
  }
  50% {
    border-color: rgba(74, 225, 255, 0.48);
    box-shadow: inset 0 0 20px rgba(0, 125, 150, 0.13), 0 0 16px rgba(0, 210, 255, 0.11);
    background-color: rgba(0, 210, 255, 0.038);
  }
}

body.menu-active #menu .helix-hero-glow {
  animation: systemHelixGlow var(--menu-system-pulse) ease-in-out infinite;
}

@keyframes systemHelixGlow {
  0%, 100% { opacity: 0.42; }
  50% { opacity: 0.78; }
}

body.menu-active #menu .helix-hero-image {
  animation: systemHelixFloat var(--menu-system-pulse) ease-in-out infinite;
}

@keyframes systemHelixFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

body.menu-active #menu .menu-primary-modes .menu-mode-button::before {
  animation: systemPrimaryButtonPulse var(--menu-system-pulse) ease-in-out infinite;
}

@keyframes systemPrimaryButtonPulse {
  0%, 100% {
    opacity: 0.42;
    box-shadow:
      0 0 10px rgba(0, 210, 255, 0.72),
      0 0 18px rgba(255, 0, 255, 0.34),
      0 0 25px rgba(0, 255, 102, 0.3);
  }
  50% {
    opacity: 0.68;
    box-shadow:
      0 0 17px rgba(0, 210, 255, 0.9),
      0 0 28px rgba(255, 0, 255, 0.5),
      0 0 39px rgba(0, 255, 102, 0.44);
  }
}

#menu .menu-primary-modes .menu-mode-button {
  transform: none;
}

#menu .menu-primary-modes .btn-main-text {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  line-height: 1.05;
}

#menu .menu-primary-modes .btn-main-text.is-long-label {
  font-size: clamp(0.68rem, 3.25vw, 0.92rem);
  letter-spacing: clamp(0.01em, 0.12vw, 0.055em);
}

.helix-status-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 8px;
  transition: opacity 160ms ease, transform 160ms ease;
}
.helix-status-panel .helix-message-label { grid-column: 1; }
.helix-status-indicator { grid-column: 2; grid-row: 1; display: inline-flex; align-items: center; gap: 4px; color: #00ff66; font-size: .48rem; letter-spacing: .08em; }
.helix-status-panel > strong { grid-column: 1 / -1; margin-top: 4px; color: #fff; font-size: .62rem; letter-spacing: .07em; }
.helix-status-panel p { grid-column: 1 / -1; }
.helix-status-panel[data-state="NOTICE"] .helix-status-indicator { color: #00d2ff; }
.helix-status-panel[data-state="WARNING"] .helix-status-indicator,
.helix-status-panel[data-state="ALERT"] .helix-status-indicator { color: #ffcc66; }
.helix-status-panel[data-state="OFFLINE"] .helix-status-indicator { color: #ff668f; }
.helix-status-panel.is-updating { animation: helixStatusIn 180ms ease-out; }
@keyframes helixStatusIn { from { opacity: .55; transform: translateY(2px); } to { opacity: 1; transform: none; } }

@media (max-width: 360px) {
  #menu .menu-primary-modes .btn-main-text.is-long-label { font-size: clamp(0.62rem, 3.1vw, 0.76rem); letter-spacing: .01em; }
}

@media (prefers-reduced-motion: reduce) {
  .helix-status-panel, .helix-status-panel.is-updating { animation: none !important; transform: none !important; transition: opacity .01ms !important; }
}

#menu .menu-primary-modes .menu-mode-button:hover,
#menu .menu-primary-modes .menu-mode-button:focus-visible {
  transform: translateY(-2px);
}

#menu .menu-brand-copy #top-score-display {
  color: #55d99a;
  text-shadow: 0 0 5px rgba(0, 210, 130, 0.18);
}

body.game-active #menu,
body.game-active #menu .helix-hero-stage,
body.game-active #menu .helix-hero-glow,
body.game-active #menu .helix-hero-image,
body.game-active #menu .menu-mode-button::before,
body.game-active .menu-ambient-particles {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  body.menu-active #menu,
  body.menu-active #menu::before,
  body.menu-active .menu-energy-trace,
  body.menu-active #menu .helix-hero-stage,
  body.menu-active #menu .helix-hero-glow,
  body.menu-active #menu .helix-hero-image,
  body.menu-active #menu .menu-mode-button::before,
  body.menu-active .menu-ambient-particles {
    animation: none !important;
  }

  .menu-ambient {
    transition-duration: 100ms, 0s;
  }
}

/* Fase 7.2: recorrido seguro por lados, sin mascaras sobre el contenido. */
body.menu-active #menu::before {
  inset: 1px;
  z-index: 2;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 13px;
  background: none;
  box-shadow: none;
  -webkit-mask: none;
  mask: none;
  opacity: 0;
  animation: menuEdgeDiagnostic 18s linear infinite;
}

body.game-active #menu::before {
  animation: none;
  opacity: 0;
}

@keyframes menuEdgeDiagnostic {
  0%, 68% {
    border-color: transparent;
    box-shadow: none;
    opacity: 0;
  }
  72%, 77% {
    border-color: rgba(140, 246, 255, 0.9) transparent transparent;
    box-shadow: inset 0 4px 8px -7px rgba(0, 210, 255, 0.9);
    opacity: 0.72;
  }
  78%, 83% {
    border-color: transparent rgba(140, 246, 255, 0.9) transparent transparent;
    box-shadow: inset -4px 0 8px -7px rgba(0, 210, 255, 0.9);
    opacity: 0.72;
  }
  84%, 89% {
    border-color: transparent transparent rgba(140, 246, 255, 0.9);
    box-shadow: inset 0 -4px 8px -7px rgba(0, 210, 255, 0.9);
    opacity: 0.72;
  }
  90%, 95% {
    border-color: transparent transparent transparent rgba(140, 246, 255, 0.9);
    box-shadow: inset 4px 0 8px -7px rgba(0, 210, 255, 0.9);
    opacity: 0.72;
  }
  98%, 100% {
    border-color: transparent;
    box-shadow: none;
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.menu-active #menu::before {
    animation: none !important;
    opacity: 0;
  }
}


/* --- FASE 3: PROGRESIÓN --- */
.profile-trigger {
  width: auto;
  min-width: 130px;
  margin: 8px auto 0;
  padding: 8px 14px;
  border: 1px solid rgba(0, 210, 255, 0.7);
  background: rgba(0, 10, 18, 0.92);
  color: #fff;
  box-shadow: 0 0 14px rgba(0, 210, 255, 0.25);
  font-size: 0.72rem;
  letter-spacing: 1px;
}

.progression-screen {
  justify-content: flex-start;
  gap: 12px;
  max-height: 88vh;
  padding-bottom: 18px;
}

.progression-screen h2 {
  margin-bottom: 0;
  color: #00d2ff;
  letter-spacing: 2px;
}

.profile-level {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 900;
}

.profile-xp {
  margin-top: 3px;
  color: #00d2ff;
  font-size: 0.78rem;
  font-weight: 800;
}

.profile-bar {
  display: block;
  width: 100%;
  height: 7px;
  margin: 8px 0 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.profile-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #00d2ff, #ff00ff);
  box-shadow: 0 0 12px #00d2ff;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.profile-stats span {
  display: flex;
  flex-direction: column;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: #aaa;
  font-size: 0.58rem;
  font-weight: 700;
}

.profile-stats strong {
  margin-top: 3px;
  color: #fff;
  font-size: 0.88rem;
}

.progress-section {
  width: 100%;
}

.progress-section h3 {
  margin: 4px 0 6px;
  color: #fff;
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-align: left;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: #c8c8c8;
  font-size: 0.65rem;
  text-align: left;
}

.progress-row strong {
  flex: 0 0 auto;
  color: #777;
}

.progress-row.is-complete {
  border-color: rgba(0, 255, 102, 0.38);
  color: #fff;
}

.progress-row.is-complete strong {
  color: #00ff66;
}

.progression-close {
  margin-top: 4px;
}

.run-reward {
  width: 100%;
  min-height: 0;
  margin: 4px 0 10px;
  padding: 0;
}

.run-reward:empty {
  display: none;
}

.run-reward:not(:empty) {
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid rgba(0, 210, 255, 0.45);
  border-radius: 9px;
  background: rgba(0, 210, 255, 0.08);
}

.reward-title {
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 1px;
}

.reward-values {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 6px;
  color: #00d2ff;
  font-size: 1rem;
  font-weight: 900;
}

.reward-extra {
  margin-top: 5px;
  color: #00ff66;
  font-size: 0.66rem;
  line-height: 1.35;
}


/* --- FASE 3.1: UX MÓVIL, PERFIL Y ECONOMÍA --- */
.profile-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 9px 0 0;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 0.66rem;
  text-align: left;
}

.profile-trigger span {
  letter-spacing: 0.8px;
}

.profile-trigger strong {
  flex: 0 0 auto;
  color: #00d2ff;
  font-size: 0.72rem;
}

#game-over {
  width: min(92%, 340px);
  min-height: 0;
  max-height: min(96svh, 820px);
  padding: 14px;
  justify-content: flex-start;
  gap: 8px;
}

#game-over h2 {
  margin: 0;
  font-size: 1.15rem;
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  width: 100%;
}

.result-summary > span {
  display: flex;
  flex-direction: column;
  padding: 7px 8px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
}

.result-summary small {
  color: #aaa;
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
}

.result-summary strong {
  color: #fff;
  font-size: 0.95rem;
}

#game-over .run-reward {
  margin: 0;
}

#game-over .run-reward:not(:empty) {
  padding: 8px;
}

#game-over .b2b-banner {
  width: 100%;
  margin: 0;
  padding: 8px;
  gap: 6px;
  box-sizing: border-box;
}

#game-over .b2b-banner img {
  max-height: 54px;
}

#game-over .b2b-link {
  font-size: 0.78rem;
  line-height: 1.2;
}

.player-identity {
  position: relative;
  width: 100%;
}

.player-identity-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.player-identity-fields input {
  margin: 0;
  padding: 9px;
}

.player-identity-summary,
.identity-edit {
  display: none;
}

.player-identity.has-saved-identity {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  border-radius: 8px;
  background: #202020;
}

.player-identity.has-saved-identity .player-identity-fields {
  display: none;
}

.player-identity.has-saved-identity .player-identity-summary {
  display: flex;
  min-width: 0;
  flex-direction: column;
  text-align: left;
}

.player-identity-summary strong,
.player-identity-summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-identity-summary strong {
  color: #fff;
  font-size: 0.72rem;
}

.player-identity-summary span {
  color: #aaa;
  font-size: 0.62rem;
}

.player-identity.has-saved-identity .identity-edit {
  display: block;
  width: auto;
  min-width: 54px;
  margin: 0;
  padding: 7px 8px;
  border: 1px solid rgba(0,210,255,0.55);
  background: transparent;
  color: #00d2ff;
  font-size: 0.58rem;
}

#game-over .status-msg {
  min-height: 0;
  margin: 0;
}

#game-over .buttons-row {
  margin: 0;
  gap: 7px;
}

#game-over .buttons-row > .btn-primary {
  margin: 0;
  padding: 11px;
}

.secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.secondary-actions .btn-secondary {
  margin: 0;
  padding: 10px 6px;
  font-size: 0.72rem;
}

.reward-values {
  gap: 12px;
  margin-top: 3px;
  font-size: 0.9rem;
}

.reward-summary {
  margin-top: 3px;
  color: #00ff66;
  font-size: 0.58rem;
  line-height: 1.25;
}

.progression-screen {
  width: min(92%, 360px);
  min-height: 0;
  max-height: 92svh;
  padding: 14px;
  gap: 10px;
  overflow: hidden;
}

.progression-header h2 {
  margin: 0;
}

.local-save-note {
  margin: 4px 0 0;
  color: #aaa;
  font-size: 0.62rem;
  line-height: 1.3;
}

.progress-tabs {
  display: flex;
  width: 100%;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: none;
}

.progress-tabs::-webkit-scrollbar {
  display: none;
}

.progress-tabs button {
  flex: 0 0 auto;
  width: auto;
  min-width: 64px;
  margin: 0;
  padding: 8px 9px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: #aaa;
  font-size: 0.57rem;
  border-radius: 8px;
}

.progress-tabs button.is-active {
  border-color: #00d2ff;
  background: rgba(0,210,255,0.12);
  color: #fff;
  box-shadow: 0 0 12px rgba(0,210,255,0.25);
}

.progress-panels {
  width: 100%;
  min-height: 260px;
  max-height: 56svh;
  overflow-y: auto;
  padding-right: 2px;
}

.progress-panel {
  display: none;
  width: 100%;
}

.progress-panel.is-active {
  display: block;
}

.progress-panel h3 {
  margin: 2px 0 8px;
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-align: left;
}

.progression-close {
  position: sticky;
  bottom: 0;
  margin: 0;
  padding: 10px;
}

@media (max-height: 700px) {
  #game-over {
    max-height: 98svh;
    padding: 10px 12px;
    gap: 6px;
  }

  #game-over .b2b-banner img {
    max-height: 42px;
  }

  #game-over .b2b-link {
    font-size: 0.7rem;
  }

  #game-over .run-reward:not(:empty) {
    padding: 6px 8px;
  }

  .reward-title {
    font-size: 0.6rem;
  }

  .reward-values {
    font-size: 0.8rem;
  }

  .progression-screen {
    max-height: 96svh;
  }
}

@media (max-width: 360px) {
  .secondary-actions {
    grid-template-columns: 1fr;
  }

  .profile-trigger {
    font-size: 0.6rem;
  }
}


/* --- FASE 3.2: TRANSMISIONES DINÁMICAS --- */
.progress-panel h3 {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.progress-panel h3 span {
  color: #fff;
}

.progress-panel h3 small {
  color: #00d2ff;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.transmission-card {
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid rgba(0, 210, 255, 0.28);
  border-radius: 9px;
  background:
    linear-gradient(135deg, rgba(0, 210, 255, 0.08), transparent 55%),
    rgba(255, 255, 255, 0.025);
  text-align: left;
}

.transmission-card.is-complete {
  border-color: rgba(0, 255, 102, 0.55);
  background:
    linear-gradient(135deg, rgba(0, 255, 102, 0.11), transparent 55%),
    rgba(255, 255, 255, 0.025);
}

.transmission-head,
.transmission-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.transmission-head strong {
  color: #00d2ff;
  font-size: 0.7rem;
  letter-spacing: 1px;
}

.transmission-card.is-complete .transmission-head strong {
  color: #00ff66;
}

.transmission-head span {
  color: #fff;
  font-size: 0.64rem;
  font-weight: 900;
}

.transmission-card p {
  margin: 7px 0;
  color: #e6e6e6;
  font-size: 0.68rem;
  line-height: 1.3;
}

.transmission-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.transmission-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00d2ff, #ff00ff);
  box-shadow: 0 0 8px rgba(0, 210, 255, 0.65);
}

.transmission-card.is-complete .transmission-progress span {
  background: #00ff66;
}

.transmission-value {
  margin-top: 6px;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
}

.transmission-value small {
  color: #999;
  font-size: 0.52rem;
}

@media (max-width: 360px) {
  .progress-panel h3 {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}


/* --- FASE 4: IMMERSION / AUDIO --- */
.audio-quick-controls {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 7px;
  z-index: 31;
}

.audio-icon-btn {
  width: 36px;
  min-width: 36px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(0, 210, 255, 0.62);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.76);
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.24);
  font-size: 0.9rem;
  line-height: 34px;
}

.audio-settings-screen {
  width: min(90%, 340px);
  min-height: 0;
  justify-content: flex-start;
  gap: 12px;
}

.audio-settings-screen h2 {
  color: #00d2ff;
  letter-spacing: 1.5px;
}

.audio-settings-note {
  margin: 0 0 4px;
  color: #aaa;
  font-size: 0.68rem;
}

.audio-setting-row,
.audio-toggle-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}

.audio-setting-row input[type="range"] {
  width: 100%;
  accent-color: #00d2ff;
}

.audio-toggle-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: #00d2ff;
}

.audio-settings-screen .btn-secondary {
  margin: 4px 0 0;
}

.audio-test-btn {
  border-color: rgba(0, 210, 255, 0.6) !important;
  color: #00d2ff !important;
}

@media (max-width: 360px) {
  .audio-quick-controls {
    top: 9px;
    left: 9px;
  }

  .audio-icon-btn {
    width: 32px;
    min-width: 32px;
    height: 30px;
    line-height: 30px;
  }
}


/* --- FASE 4.1: música desactivada, foco en efectos --- */
.audio-settings-screen {
  gap: 14px;
}


/* --- FASE 5: SIMULACIÓN COMPETITIVA --- */
.leaderboard-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(0, 210, 255, 0.58);
  background: rgba(0, 12, 20, 0.9);
  color: #fff;
  box-shadow: 0 0 14px rgba(0, 210, 255, 0.2);
  font-size: 0.67rem;
}

.leaderboard-trigger strong {
  color: #00d2ff;
  font-size: 0.58rem;
}

.leaderboard-screen {
  width: min(92%, 360px);
  min-height: 0;
  max-height: 92svh;
  justify-content: flex-start;
  gap: 10px;
  overflow: hidden;
}

.leaderboard-header h2 {
  margin: 0;
  color: #00d2ff;
  letter-spacing: 1.5px;
}

.leaderboard-header p {
  margin: 4px 0 0;
  font-size: 0.65rem;
}

.leaderboard-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  width: 100%;
}

.leaderboard-tabs button {
  margin: 0;
  padding: 9px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: #999;
  font-size: 0.63rem;
}

.leaderboard-tabs button.is-active {
  border-color: #00d2ff;
  color: #fff;
  background: rgba(0,210,255,0.12);
}

.leaderboard-status {
  min-height: 18px;
  color: #aaa;
  font-size: 0.64rem;
}

.leaderboard-list {
  width: 100%;
  max-height: 56svh;
  overflow-y: auto;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
  padding: 9px;
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
  text-align: left;
}

.leaderboard-row:nth-child(-n+3) {
  border-color: rgba(0,210,255,0.42);
  background: rgba(0,210,255,0.065);
}

.leaderboard-rank {
  color: #00d2ff;
  font-weight: 900;
  text-align: center;
}

.leaderboard-player {
  min-width: 0;
}

.leaderboard-player strong,
.leaderboard-player span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-player strong {
  color: #fff;
  font-size: 0.72rem;
}

.leaderboard-player span {
  color: #888;
  font-size: 0.56rem;
}

.leaderboard-score {
  color: #fff;
  font-size: 0.66rem;
  font-weight: 900;
  text-align: right;
}

.leaderboard-score span {
  display: block;
  color: #00ff66;
  font-size: 0.58rem;
}

.simulation-result {
  width: 100%;
  box-sizing: border-box;
  padding: 9px;
  border: 1px solid rgba(0,210,255,0.42);
  border-radius: 8px;
  background: rgba(0,210,255,0.075);
}

.simulation-result-title {
  color: #00d2ff;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 1px;
}

.simulation-result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-top: 7px;
}

.simulation-result-grid span {
  display: flex;
  flex-direction: column;
  color: #888;
  font-size: 0.55rem;
}

.simulation-result-grid strong {
  margin-top: 2px;
  color: #fff;
  font-size: 0.75rem;
}

.simulation-result-badge {
  margin-top: 7px;
  color: #00ff66;
  font-size: 0.64rem;
  font-weight: 900;
}

body.simulation-mode #game-container {
  box-shadow: 0 0 36px rgba(0, 210, 255, 0.28);
}


/* --- FASE 5.1: ranking competitivo completo --- */
.monthly-preview {
  width: 100%;
  box-sizing: border-box;
  margin: 10px 0 0;
  padding: 10px;
  border: 1px solid rgba(0, 210, 255, 0.42);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(0, 210, 255, 0.09), transparent 55%),
    rgba(0, 8, 15, 0.92);
}

.monthly-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.monthly-preview-head > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  text-align: left;
}

.monthly-preview-head strong {
  color: #fff;
  font-size: 0.68rem;
  letter-spacing: 0.9px;
}

.monthly-preview-head span {
  color: #00d2ff;
  font-size: 0.52rem;
}

.monthly-preview-open {
  width: auto;
  min-width: 86px;
  margin: 0;
  padding: 8px 9px;
  border: 1px solid rgba(0, 210, 255, 0.62);
  background: rgba(0, 210, 255, 0.1);
  color: #fff;
  font-size: 0.55rem;
}

.monthly-preview-list {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.monthly-preview-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 6px 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
}

.monthly-preview-rank {
  color: #00d2ff;
  font-size: 0.62rem;
  text-align: center;
}

.monthly-preview-name {
  overflow: hidden;
  color: #fff !important;
  font-size: 0.62rem !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monthly-preview-score {
  color: #00ff66 !important;
  font-size: 0.58rem !important;
  font-weight: 900;
}

.monthly-preview-empty {
  padding: 7px;
  color: #888;
  font-size: 0.58rem;
}

.leaderboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.leaderboard-header > div {
  flex: 1;
}

.leaderboard-refresh-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(0, 210, 255, 0.55);
  background: rgba(0, 210, 255, 0.08);
  color: #00d2ff;
  font-size: 1rem;
  line-height: 34px;
}

.leaderboard-refresh-btn.is-loading {
  animation: leaderboardSpin 0.8s linear infinite;
}

@keyframes leaderboardSpin {
  to {
    transform: rotate(360deg);
  }
}

.leaderboard-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  width: 100%;
}

.leaderboard-summary span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 7px;
  color: #888;
  font-size: 0.52rem;
  text-align: left;
}

.leaderboard-summary strong {
  overflow: hidden;
  margin-top: 2px;
  color: #fff;
  font-size: 0.61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-summary small {
  grid-column: 1 / -1;
  color: #ffcc66;
  font-size: 0.52rem;
}

.leaderboard-empty {
  padding: 24px 10px;
  color: #888;
  font-size: 0.68rem;
  line-height: 1.4;
}

.leaderboard-row.is-podium {
  border-color: rgba(0, 210, 255, 0.52);
}

.leaderboard-row.is-podium .leaderboard-rank {
  font-size: 1rem;
}

.simulation-ranking-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 77, 141, 0.34);
  border-radius: 7px;
  background: rgba(255, 77, 141, 0.055);
}

.simulation-ranking-check strong {
  color: #fff;
  font-size: 0.57rem;
  text-align: left;
}

.simulation-ranking-check span {
  flex: 0 0 auto;
  color: #ff4d8d;
  font-size: 0.62rem;
  font-weight: 900;
}

.simulation-ranking-check.is-qualified {
  border-color: rgba(0, 255, 102, 0.4);
  background: rgba(0, 255, 102, 0.06);
}

.simulation-ranking-check.is-qualified span {
  color: #00ff66;
}

.result-leaderboard-btn {
  width: 100%;
  margin: 0;
  padding: 9px;
  border: 1px solid rgba(0, 210, 255, 0.48);
  background: rgba(0, 210, 255, 0.08);
  color: #00d2ff;
  font-size: 0.62rem;
}

@media (max-height: 760px) {
  .monthly-preview {
    padding: 7px 8px;
  }

  .monthly-preview-list {
    gap: 3px;
    margin-top: 5px;
  }

  .monthly-preview-row {
    padding: 4px 6px;
  }
}


/* --- FASE 6: UX E IDENTIDAD HELIX --- */
#menu {
  width: min(88%, 330px);
  min-height: 0;
  max-height: 96svh;
  padding: 14px 14px 16px;
  justify-content: flex-start;
  gap: 9px;
}

.menu-hero {
  width: 100%;
}

.menu-brand-row {
  display: grid;
  grid-template-columns: 105px 1fr;
  align-items: center;
  gap: 9px;
}

.menu-brand-row .main-banner {
  width: 105px;
  max-height: 54px !important;
  margin: 0;
}

.menu-brand-copy {
  min-width: 0;
  text-align: left;
}

.menu-brand-copy .light-title {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.05;
  letter-spacing: 1.3px;
}

.menu-brand-copy #top-score-display {
  margin: 5px 0 0;
  color: #00ff66;
  font-size: 0.57rem;
  line-height: 1.2;
  text-align: left;
}

.helix-hero-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 42%) 1fr;
  align-items: center;
  gap: 7px;
  min-height: 108px;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid rgba(0, 210, 255, 0.32);
  border-radius: 11px;
  background:
    radial-gradient(circle at 18% 50%, rgba(0, 210, 255, 0.14), transparent 35%),
    linear-gradient(135deg, rgba(0, 210, 255, 0.06), rgba(255, 0, 255, 0.035)),
    rgba(255, 255, 255, 0.025);
}

.helix-hero-glow {
  position: absolute;
  left: 12px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(0, 210, 255, 0.16);
  filter: blur(18px);
  animation: helixHeroGlow 3.2s ease-in-out infinite;
}

@keyframes helixHeroGlow {
  0%, 100% { transform: scale(0.92); opacity: 0.55; }
  50% { transform: scale(1.08); opacity: 0.9; }
}

.helix-hero-image {
  position: relative;
  z-index: 2;
  width: 128%;
  max-width: none !important;
  max-height: 112px !important;
  margin: 0 0 0 -18%;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(0, 210, 255, 0.38));
}

.helix-message-panel {
  position: relative;
  z-index: 2;
  padding: 10px 10px 10px 0;
  text-align: left;
}

.helix-message-label {
  color: #00d2ff;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 1.4px;
}

.helix-message-panel p {
  margin: 5px 0 0;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35;
}

#menu .profile-trigger {
  margin-top: 7px;
}

#menu .btn-main {
  margin: 13px 0 0;
  padding: 15px 24px;
  font-size: 1.05rem;
}

#menu .monthly-preview {
  margin-top: 8px;
}

#menu .menu-footer {
  width: 100%;
  margin-top: 6px;
  padding-top: 7px;
}

#menu .menu-footer p {
  margin: 0 0 3px;
  font-size: 0.63rem;
}

#menu .contact-link {
  font-size: 0.67rem;
}

.about-helix-link {
  width: auto;
  margin: 6px auto 0;
  padding: 4px 8px;
  border: none;
  background: transparent;
  color: #00d2ff;
  font-size: 0.55rem;
  letter-spacing: 1px;
}

.result-actions {
  width: 100%;
  box-sizing: border-box;
  padding: 9px;
  border: 1px solid rgba(0, 210, 255, 0.28);
  border-radius: 9px;
  background: rgba(0, 210, 255, 0.045);
}

.result-actions-title {
  margin-bottom: 7px;
  color: #00d2ff;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-align: left;
}

.result-action-link {
  display: grid;
  grid-template-columns: 27px 1fr;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  color: #fff;
  text-decoration: none;
  text-align: left;
}

.result-action-link:first-of-type {
  border-top: none;
}

.result-action-link:hover,
.result-action-link:focus-visible {
  background: rgba(0, 210, 255, 0.08);
}

.result-action-icon {
  color: #00d2ff;
  font-size: 0.85rem;
  font-weight: 900;
  text-align: center;
}

.result-action-link strong,
.result-action-link small {
  display: block;
}

.result-action-link strong {
  color: #fff;
  font-size: 0.65rem;
}

.result-action-link small {
  margin-top: 1px;
  color: #888;
  font-size: 0.54rem;
}

.about-helix-screen {
  width: min(88%, 330px);
  min-height: 0;
  gap: 10px;
}

.about-helix-image {
  max-height: 145px !important;
  margin: 0 !important;
  filter: drop-shadow(0 0 16px rgba(0, 210, 255, 0.38));
}

.about-helix-screen h2 {
  color: #00d2ff;
  letter-spacing: 1.3px;
}

.about-helix-screen p {
  margin: 0 0 8px;
  font-size: 0.72rem;
}

@media (max-height: 720px) {
  #menu {
    max-height: 98svh;
    gap: 6px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .helix-hero-stage {
    min-height: 86px;
  }

  .helix-hero-image {
    max-height: 92px !important;
  }

  #menu .btn-main {
    margin-top: 9px;
    padding: 12px 20px;
  }

  #menu .monthly-preview {
    padding: 6px 7px;
  }

  #menu .monthly-preview-list {
    margin-top: 4px;
  }
}

@media (max-width: 360px) {
  .menu-brand-row {
    grid-template-columns: 92px 1fr;
  }

  .menu-brand-row .main-banner {
    width: 92px;
  }

  .menu-brand-copy .light-title {
    font-size: 0.96rem;
  }

  .helix-message-panel p {
    font-size: 0.62rem;
  }
}


/* --- HOTFIX FASE 6: RESTAURACIÓN DE LAYOUT RESPONSIVE --- */
#menu,
#game-over,
#leaderboard-screen,
#about-helix-screen,
#audio-settings-screen,
#progression-screen {
  box-sizing: border-box;
  overflow-x: hidden;
}

#menu {
  top: 50%;
  left: 50%;
  width: min(calc(100% - 24px), 330px);
  max-width: calc(100% - 24px);
  max-height: calc(100% - 20px);
  transform: translate(-50%, -50%);
  overflow-y: auto;
}

#menu > * {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

#menu button,
#game-over button,
#leaderboard-screen button,
#about-helix-screen button,
#audio-settings-screen button,
#progression-screen button {
  margin-left: 0;
  margin-right: 0;
}

#menu .btn-main {
  display: block;
  width: 100%;
  margin: 10px 0 0;
}

#menu .monthly-preview {
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

#menu .monthly-preview-head,
#menu .monthly-preview-row,
#menu .menu-footer,
#menu .menu-hero {
  min-width: 0;
  max-width: 100%;
}

#menu .monthly-preview-open {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

#game-over {
  width: min(calc(100% - 24px), 340px);
  max-width: calc(100% - 24px);
  max-height: calc(100% - 20px);
  overflow-y: auto;
}

#game-over > * {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.result-actions,
.result-action-link,
.player-identity,
.buttons-row,
.secondary-actions {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.result-action-link strong,
.result-action-link small {
  overflow-wrap: anywhere;
}

@media (max-width: 450px) {
  #game-container {
    width: 100vw;
    height: 100svh;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  #menu {
    width: calc(100% - 20px);
    max-width: 340px;
    padding: 12px;
  }

  .menu-brand-row {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .helix-hero-stage {
    grid-template-columns: minmax(100px, 42%) minmax(0, 1fr);
  }

  #game-over {
    width: calc(100% - 20px);
  }
}

@media (max-height: 700px) {
  #menu {
    max-height: calc(100% - 10px);
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .helix-hero-stage {
    min-height: 82px;
  }

  .helix-hero-image {
    max-height: 86px !important;
  }

  #menu .btn-main {
    padding-top: 11px;
    padding-bottom: 11px;
  }
}


/* --- FASE 6.1: AJUSTE DE COMPOSICIÓN Y HELIX BASE --- */
#menu {
  width: min(calc(100% - 22px), 370px);
  max-width: calc(100% - 22px);
  padding: 14px 16px 16px;
}

.menu-utility-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 38px;
  margin-bottom: 7px;
  gap: 7px;
}

.site-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(0, 210, 255, 0.42);
  border-radius: 999px;
  color: rgba(210, 245, 255, 0.92);
  background: rgba(0, 0, 0, 0.34);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-back-link:hover,
.site-back-link:focus-visible {
  border-color: rgba(0, 255, 204, 0.75);
  color: #ffffff;
  outline: none;
}

.menu-utility-bar .audio-quick-controls {
  position: static;
  display: flex;
  gap: 7px;
  z-index: auto;
}

.menu-utility-bar .language-toggle {
  position: static;
  width: auto;
  min-width: 46px;
  margin: 0;
  flex: 0 0 auto;
}

.menu-brand-row {
  grid-template-columns: 112px minmax(0, 1fr);
  padding: 0 2px;
}

.menu-brand-row .main-banner {
  width: 112px;
  max-height: 58px !important;
}

.helix-hero-stage {
  grid-template-columns: minmax(115px, 43%) minmax(0, 1fr);
  min-height: 122px;
}

.helix-hero-image {
  width: 108%;
  max-height: 132px !important;
  margin: 7px 0 -9px -6%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 0 14px rgba(0, 210, 255, 0.32));
}

.helix-hero-glow {
  left: 22px;
  width: 104px;
  height: 104px;
}

.helix-message-panel {
  padding-right: 12px;
}

.about-helix-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto !important;
  min-height: 30px;
  margin: 7px auto 0 !important;
  padding: 3px 9px 3px 4px;
  border: 1px solid rgba(0, 210, 255, 0.24);
  border-radius: 999px;
  background: rgba(0, 210, 255, 0.045);
}

.about-helix-link img {
  width: 26px;
  height: 26px;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 50%;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.05);
}

.about-helix-link span {
  color: #00d2ff;
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.8px;
}

.about-helix-image {
  max-height: 210px !important;
  margin: -8px 0 0 !important;
  object-fit: contain;
  object-position: center bottom;
}

@media (max-width: 450px) {
  #menu {
    width: calc(100% - 16px);
    max-width: 370px;
  }

  .menu-brand-row {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .helix-hero-stage {
    grid-template-columns: minmax(108px, 43%) minmax(0, 1fr);
  }
}

@media (max-height: 740px) {
  #menu {
    padding-top: 9px;
    padding-bottom: 10px;
  }

  .menu-utility-bar {
    min-height: 32px;
    margin-bottom: 4px;
  }

  .helix-hero-stage {
    min-height: 96px;
  }

  .helix-hero-image {
    max-height: 106px !important;
  }

  .about-helix-link {
    margin-top: 4px !important;
  }
}


/* Fase 6.2 tiny tweak */
.about-helix-link{
  padding:4px 12px !important;
}
.about-helix-link img{
  display:none !important;
}

/* --- FASE 7: IDENTIDAD Y NAVEGACION DEL MENU PRINCIPAL --- */
#menu {
  gap: 10px;
  border-color: rgba(255, 255, 255, 0.82);
  background:
    radial-gradient(circle at 50% -10%, rgba(0, 210, 255, 0.1), transparent 38%),
    rgba(0, 0, 0, 0.96);
}

#menu > * {
  animation: menuElementIn 420ms ease both;
}

#menu > :nth-child(2) { animation-delay: 45ms; }
#menu > :nth-child(3) { animation-delay: 90ms; }
#menu > :nth-child(4) { animation-delay: 135ms; }
#menu > :nth-child(5) { animation-delay: 180ms; }
#menu > :nth-child(6) { animation-delay: 225ms; }
#menu > :nth-child(7) { animation-delay: 270ms; }

@keyframes menuElementIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.helix-hero-stage::after {
  content: "";
  position: absolute;
  inset: -35% -20%;
  background:
    radial-gradient(circle at 22% 38%, rgba(255, 255, 255, 0.22) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 64%, rgba(0, 210, 255, 0.28) 0 1px, transparent 2px),
    radial-gradient(circle at 48% 18%, rgba(0, 255, 102, 0.18) 0 1px, transparent 2px);
  background-size: 72px 68px, 96px 88px, 120px 104px;
  opacity: 0.55;
  pointer-events: none;
  animation: menuParticleDrift 14s linear infinite;
}

@keyframes menuParticleDrift {
  to { transform: translate3d(18px, -20px, 0); }
}

#menu .helix-hero-image {
  animation: helixMenuFloat 4.8s ease-in-out infinite;
  transform-origin: 50% 70%;
}

@keyframes helixMenuFloat {
  0%, 100% { transform: translateY(0) rotate(-0.4deg); }
  50% { transform: translateY(-4px) rotate(0.5deg); }
}

.menu-primary-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  width: 100%;
  padding: 4px 0 2px;
}

#menu .menu-primary-modes .menu-mode-button {
  width: 100%;
  min-height: 64px;
  margin: 0;
  padding: 15px 9px;
  font-size: clamp(0.88rem, 4vw, 1.08rem);
  letter-spacing: 0.8px;
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

#menu .menu-primary-modes .menu-mode-button:hover,
#menu .menu-primary-modes .menu-mode-button:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 8px 24px rgba(0, 210, 255, 0.2);
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.menu-secondary-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

#menu .menu-secondary-action[hidden] {
  display: none !important;
}

#menu .menu-secondary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  margin: 0;
  padding: 8px 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.65px;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

#menu .menu-secondary-action:hover:not(:disabled),
#menu .menu-secondary-action:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(0, 210, 255, 0.7);
  background: rgba(0, 210, 255, 0.1);
  color: #00d2ff;
  outline: none;
}

#menu .menu-secondary-action.is-coming-soon {
  flex-wrap: wrap;
  color: rgba(255, 255, 255, 0.48);
  cursor: not-allowed;
}

#menu .menu-secondary-action small {
  color: #00d2ff;
  font-size: 0.43rem;
  letter-spacing: 0.45px;
}

#menu .menu-profile-trigger {
  margin: 0;
  min-height: 34px;
  opacity: 0.82;
  transition: opacity 180ms ease, border-color 180ms ease;
}

#menu .menu-profile-trigger:hover,
#menu .menu-profile-trigger:focus-visible {
  opacity: 1;
  border-color: rgba(0, 210, 255, 0.68);
}

#menu .monthly-preview {
  margin-top: 0;
  opacity: 0.88;
}

#menu .menu-footer {
  margin-top: 0;
}

@media (max-height: 760px) {
  #menu { gap: 7px; }
  .helix-hero-stage { min-height: 82px; margin-top: 5px; }
  #menu .helix-hero-image { max-height: 92px !important; }
  #menu .menu-primary-modes .menu-mode-button { min-height: 52px; padding: 11px 7px; }
  #menu .menu-secondary-action { min-height: 31px; padding: 6px; }
  #menu .monthly-preview-list { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #menu > *,
  #menu .helix-hero-image,
  .helix-hero-stage::after,
  .helix-hero-glow,
  #menu .btn-main::before,
  #menu .btn-main::after {
    animation: none !important;
  }
}


/* --- FASE 6.8: REWARD ENGINE --- */
.reward-pending-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 8px 0 0 !important;
  padding: 9px 12px;
  border: 1px solid rgba(255, 213, 74, 0.64);
  border-radius: 9px;
  background:
    linear-gradient(90deg, rgba(255, 213, 74, 0.12), rgba(255, 138, 0, 0.08)),
    rgba(0, 0, 0, 0.72);
  color: #fff;
  box-shadow: 0 0 14px rgba(255, 190, 40, 0.18);
}

.reward-pending-btn > span {
  color: #ffd54a;
  font-size: 1rem;
}

.reward-pending-btn strong {
  color: #fff;
  font-size: 0.58rem;
  letter-spacing: 0.8px;
}

.reward-claim-screen {
  width: min(calc(100% - 22px), 350px);
  min-height: 0;
  max-height: calc(100% - 20px);
  justify-content: flex-start;
  gap: 10px;
  overflow-y: auto;
  border-color: #ffd54a;
  box-shadow:
    0 0 28px rgba(255, 213, 74, 0.2),
    0 14px 34px rgba(0, 0, 0, 0.8);
}

.reward-core-emblem {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin: 0 auto;
  border: 1px solid rgba(255, 213, 74, 0.7);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 213, 74, 0.28), rgba(255, 138, 0, 0.04) 68%);
  box-shadow: 0 0 24px rgba(255, 213, 74, 0.32);
}

.reward-core-emblem span {
  color: #ffd54a;
  font-size: 2.1rem;
  text-shadow: 0 0 14px #ff9800;
}

.reward-kicker {
  color: #ffd54a;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 1.4px;
}

.reward-claim-screen h2 {
  margin: 0;
  color: #fff7ba;
  font-size: 1.05rem;
  letter-spacing: 0.8px;
}

.reward-claim-screen > p {
  margin: 0;
  font-size: 0.72rem;
}

.reward-rules {
  padding: 9px 10px;
  border: 1px solid rgba(255, 213, 74, 0.24);
  border-radius: 8px;
  background: rgba(255, 213, 74, 0.045);
  color: #ccc;
  font-size: 0.59rem;
  line-height: 1.4;
  text-align: left;
}

.reward-form {
  width: 100%;
  display: grid;
  gap: 5px;
  text-align: left;
}

.reward-form input,
.reward-form textarea {
  width: 100%;
  box-sizing: border-box;
}

.reward-form label {
  color: #a9bec7;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.45px;
}

.reward-form textarea {
  min-height: 58px;
  resize: vertical;
}

.reward-terms-accept {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  line-height: 1.35;
}

.reward-terms-accept input {
  width: auto;
  margin-top: 2px;
}

.reward-ticket-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  margin: 0;
  gap: 5px;
}

.reward-ticket-summary div {
  min-width: 0;
  padding: 6px;
  border: 1px solid rgba(255, 213, 74, 0.18);
  border-radius: 6px;
}

.reward-ticket-summary dt {
  color: #8b9da5;
  font-size: 0.45rem;
  font-weight: 900;
}

.reward-ticket-summary dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  color: #fff7ba;
  font-size: 0.56rem;
  font-weight: 800;
}

.reward-submit-btn,
.reward-later-btn,
#reward-copy-code-btn,
#reward-copy-request-btn {
  width: 100%;
  margin: 0 !important;
}

.reward-submit-btn {
  background: linear-gradient(90deg, #fff7ba, #ffd54a);
}

.reward-submit-btn:disabled {
  cursor: wait;
  opacity: 0.55;
}

@media (max-height: 700px) {
  .reward-claim-screen {
    gap: 7px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .reward-core-emblem {
    width: 56px;
    height: 56px;
  }

  .reward-core-emblem span {
    font-size: 1.65rem;
  }
}

@media (max-width: 420px) {
  .reward-ticket-summary { grid-template-columns: 1fr; }
}

@media (max-height: 430px) and (orientation: landscape) {
  .reward-claim-screen { width: min(calc(100% - 24px), 720px); }
  .reward-core-emblem { display: none; }
  .reward-ticket-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* --- FASE 10.5: ARCHIVE FILE VIEWER --- */
.archive-file-viewer {
  z-index: 1100;
  width: min(calc(100% - 18px), 650px);
  max-width: calc(100% - 18px);
  max-height: calc(100% - 18px);
  min-height: 0;
  padding: 15px;
  gap: 10px;
  justify-content: flex-start;
  overflow: hidden;
  border-color: rgba(110, 231, 255, 0.82);
  background:
    linear-gradient(rgba(0, 210, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 210, 255, 0.024) 1px, transparent 1px),
    radial-gradient(circle at 50% 0, rgba(0, 210, 255, 0.11), transparent 38%),
    rgba(1, 6, 12, 0.985);
  background-size: 20px 20px, 20px 20px, auto, auto;
  box-shadow: 0 20px 55px rgba(0, 5, 15, 0.88), 0 0 24px rgba(0, 210, 255, 0.15);
}

.archive-document {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(14px, 4vw, 24px);
  border: 1px solid rgba(0, 210, 255, 0.28);
  border-radius: 12px;
  background: rgba(0, 13, 22, 0.76);
  text-align: left;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 210, 255, 0.45) transparent;
}

.archive-document-header {
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(0, 210, 255, 0.24);
}

.archive-document-number {
  color: #00d2ff;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 1.8px;
}

.archive-document-header h2 {
  margin: 5px 0 0;
  color: #fff;
  font-size: clamp(1.05rem, 4vw, 1.5rem);
  letter-spacing: 1.6px;
  line-height: 1.2;
}

.archive-document-metadata {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 13px 0;
}

.archive-document-metadata div {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.archive-document-metadata dt {
  color: #71828c;
  font-size: 0.46rem;
  font-weight: 800;
  letter-spacing: 0.65px;
}

.archive-document-metadata dd {
  margin: 5px 0 0;
  color: #63e5b2;
  font-size: 0.58rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.archive-document-body {
  display: grid;
  gap: 10px;
  padding: 3px 0 15px;
}

.archive-document-body p {
  margin: 0;
  color: #d5dce0;
  font-size: clamp(0.66rem, 2.5vw, 0.78rem);
  line-height: 1.65;
}

.archive-document-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px;
  border-left: 2px solid #00d2ff;
  background: rgba(0, 210, 255, 0.06);
}

.archive-document-status strong {
  color: #fff;
  font-size: 0.62rem;
  letter-spacing: 1.1px;
}

.archive-document-status span {
  color: #00d2ff;
  font-size: 0.52rem;
  letter-spacing: 0.75px;
}

.archive-file-viewer-actions {
  display: flex;
  flex: 0 0 auto;
  width: 100%;
  gap: 8px;
}

.archive-file-viewer-actions button {
  flex: 1 1 0;
  min-height: 38px;
  margin: 0;
  padding: 8px;
  font-size: 0.54rem;
}

.archive-file-card button[data-open-archive-file] {
  min-height: 34px;
  margin: 0;
  padding: 7px 9px;
  font-size: 0.5rem;
}

.archive-file-card.is-new,
.vault-item-card.is-new {
  border-color: rgba(0, 255, 157, 0.52);
  box-shadow: inset 0 0 18px rgba(0, 255, 157, 0.045);
}

.vault-reward-group {
  width: 100%;
  margin-bottom: 14px;
}

.vault-reward-group > h4 {
  margin: 0 0 7px;
  color: #8feeff;
  font-size: 0.62rem;
  letter-spacing: 1px;
  text-align: left;
}

.vault-coupon code {
  display: block;
  overflow-wrap: anywhere;
  color: #fff7ba;
  font-size: 0.58rem;
}

.vault-coupon.is-claimed { border-style: dashed; }
.vault-coupon.is-redeemed { opacity: 0.78; }
.vault-coupon.is-expired,
.vault-coupon.is-revoked { opacity: 0.62; }

#archive-file-debug {
  position: fixed;
  z-index: 10020;
  right: 10px;
  top: 10px;
  width: min(310px, calc(100vw - 20px));
  padding: 11px;
  border: 1px solid rgba(0, 210, 255, 0.55);
  border-radius: 9px;
  background: rgba(1, 6, 12, 0.94);
  color: #dffaff;
  font: 11px/1.4 monospace;
}

#archive-file-debug pre {
  margin: 7px 0;
  white-space: pre-wrap;
}

#archive-file-debug div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

#archive-file-debug button {
  min-height: 27px;
  margin: 0;
  padding: 5px 7px;
  font-size: 0.44rem;
}

@media (max-width: 520px) {
  .archive-file-viewer { padding: 10px; gap: 7px; }
  .archive-document { padding: 13px; }
  .archive-document-metadata { grid-template-columns: 1fr; }
  .archive-document-metadata div { display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: center; }
  .archive-document-metadata dd { margin: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .archive-file-viewer[style*="display: flex"] .archive-document-header {
    animation: archiveFileReveal 180ms ease-out both;
  }
  .archive-file-viewer[style*="display: flex"] .archive-document-metadata {
    animation: archiveFileReveal 220ms 35ms ease-out both;
  }
  .archive-file-viewer[style*="display: flex"] .archive-document-body,
  .archive-file-viewer[style*="display: flex"] .archive-document-status {
    animation: archiveFileReveal 250ms 65ms ease-out both;
  }
}

@keyframes archiveFileReveal {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .archive-file-viewer * { animation: none !important; }
}

/* Fase 10: capa única de presentación y detalle de recompensas. */
.reward-presentation-screen {
  z-index: 1150;
  overflow: auto;
  border-color: rgba(0, 255, 174, 0.66);
  background:
    radial-gradient(circle at 50% 28%, rgba(0, 210, 255, 0.13), transparent 45%),
    rgba(0, 6, 12, 0.985);
}

.reward-presentation-screen > *:not(.reward-presentation-glow) {
  position: relative;
  z-index: 1;
}

.reward-presentation-glow {
  position: absolute;
  top: 18%;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(0, 255, 174, 0.22);
  border-radius: 50%;
  pointer-events: none;
  animation: rewardSystemPulse 650ms ease-out both;
}

.reward-presentation-kicker {
  margin: 0;
  color: #55d99a;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.reward-presentation-status {
  margin: -2px 0 2px;
  color: #8feeff;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.reward-presentation-screen img {
  width: min(54%, 176px);
  max-height: 160px;
  margin: 4px auto;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(0, 210, 255, 0.3));
  animation: rewardSystemReveal 240ms ease-out both;
}

.reward-presentation-screen h2 {
  margin: 2px 0;
  color: #fff;
  font-size: clamp(1.05rem, 4vw, 1.42rem);
}

.reward-presentation-description {
  max-width: 360px;
  margin: 0;
  color: #c8d9df;
  font-size: 0.7rem;
  line-height: 1.55;
}

.reward-presentation-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  margin: 4px 0;
  gap: 6px;
}

.reward-presentation-meta div {
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(0, 210, 255, 0.15);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
}

.reward-presentation-meta dt {
  color: #718994;
  font-size: 0.45rem;
  font-weight: 900;
  letter-spacing: 0.7px;
}

.reward-presentation-meta dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: #7ef0bc;
  font-size: 0.57rem;
  font-weight: 800;
}

.reward-presentation-terms {
  width: 100%;
  max-height: 150px;
  overflow: auto;
  padding: 9px;
  border-left: 2px solid #00d2ff;
  background: rgba(0, 210, 255, 0.055);
  color: #cbdce2;
  font-size: 0.58rem;
  line-height: 1.45;
  text-align: left;
}

.reward-presentation-terms ul { margin: 4px 0 8px; padding-left: 18px; }
.reward-presentation-terms p { margin: 6px 0; }

.reward-presentation-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  gap: 7px;
}

.reward-presentation-actions button {
  min-height: 38px;
  margin: 0;
  padding: 8px;
  font-size: 0.53rem;
}

.reward-presentation-actions button:last-child { grid-column: 1 / -1; }
.vault-category-count em {
  display: inline-block;
  margin-left: 4px;
  color: #6df1ba;
  font-size: 0.46rem;
  font-style: normal;
  letter-spacing: 0.55px;
}

.vault-item-card.is-new {
  border-color: rgba(0, 255, 174, 0.62);
  box-shadow: inset 0 0 14px rgba(0, 255, 174, 0.055);
}

#reward-debug {
  position: fixed;
  z-index: 10030;
  top: 10px;
  right: 10px;
  width: min(330px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  overflow: auto;
  padding: 11px;
  border: 1px solid rgba(0, 210, 255, 0.52);
  border-radius: 9px;
  background: rgba(0, 8, 14, 0.97);
  color: #dffaff;
  font: 10px/1.45 monospace;
}

#reward-debug pre { white-space: pre-wrap; }
#reward-debug button { margin: 2px; padding: 5px; font-size: 0.48rem; }

@keyframes rewardSystemPulse {
  from { opacity: 0; transform: scale(0.78); }
  to { opacity: 0.38; transform: scale(1.08); }
}

@keyframes rewardSystemReveal {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 420px) {
  .reward-presentation-screen {
    width: min(calc(100% - 18px), 360px);
    max-height: calc(100svh - 18px);
    min-height: 0;
    padding: 12px;
    gap: 7px;
    justify-content: flex-start;
  }
  .reward-presentation-screen img { width: min(46%, 148px); max-height: 132px; }
  .reward-presentation-meta { grid-template-columns: 1fr; }
  .reward-presentation-terms { max-height: 124px; }
}

@media (max-height: 430px) and (orientation: landscape) {
  .reward-presentation-screen {
    width: min(calc(100% - 24px), 620px);
    max-width: 620px;
    max-height: calc(100svh - 14px);
    min-height: 0;
    padding: 9px 12px;
    gap: 4px;
    justify-content: flex-start;
  }
  .reward-presentation-screen img { width: 92px; max-height: 72px; margin: 0 auto; }
  .reward-presentation-description { line-height: 1.3; }
  .reward-presentation-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .reward-presentation-meta div { padding: 5px; }
  .reward-presentation-actions button { min-height: 32px; padding: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .reward-presentation-glow,
  .reward-presentation-screen img { animation: none !important; }
}

/* --- FASE 9: VAULT PROGRESSION HUB --- */
.vault-screen {
  position: relative;
  width: min(calc(100% - 16px), 720px);
  max-width: calc(100% - 16px);
  max-height: calc(100% - 16px);
  min-height: 0;
  padding: 16px;
  gap: 12px;
  justify-content: flex-start;
  overflow: hidden;
  border: 1px solid rgba(0, 210, 255, 0.7);
  background:
    linear-gradient(rgba(0, 210, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 210, 255, 0.028) 1px, transparent 1px),
    radial-gradient(circle at 50% 0, rgba(0, 210, 255, 0.13), transparent 38%),
    rgba(1, 7, 14, 0.98);
  background-size: 22px 22px, 22px 22px, auto, auto;
  box-shadow: 0 18px 46px rgba(0, 8, 22, 0.82), 0 0 26px rgba(0, 210, 255, 0.13);
}

.vault-header {
  flex: 0 0 auto;
  width: 100%;
  text-align: left;
}

.vault-kicker {
  color: #00d2ff;
  font-size: 0.5rem;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.vault-header h2 {
  margin: 4px 0 0;
  color: #fff;
  font-size: clamp(1.35rem, 4vw, 1.8rem);
  letter-spacing: 3px;
}

.vault-header p,
.vault-detail-header p {
  margin: 4px 0 0;
  color: #93a3af;
  font-size: 0.62rem;
  line-height: 1.45;
}

.vault-content {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 210, 255, 0.45) transparent;
}

.vault-view {
  width: 100%;
  box-sizing: border-box;
}

.vault-view.is-active {
  animation: vaultViewIn 170ms ease-out both;
}

@keyframes vaultViewIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.vault-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.vault-category-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 86px;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(126, 228, 255, 0.2);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.075), rgba(255, 255, 255, 0.018));
  color: #fff;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.vault-category-card:hover:not(:disabled),
.vault-category-card:focus-visible:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(0, 210, 255, 0.76);
  background: rgba(0, 210, 255, 0.11);
  box-shadow: 0 8px 22px rgba(0, 210, 255, 0.1);
  outline: none;
}

.vault-category-card.is-disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.vault-category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(0, 210, 255, 0.45);
  border-radius: 10px;
  color: #79ebff;
  background: rgba(0, 210, 255, 0.075);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.7px;
}

.vault-category-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.vault-category-main strong {
  font-size: 0.72rem;
  letter-spacing: 0.9px;
}

.vault-category-main small {
  color: #8f9da6;
  font-size: 0.53rem;
  line-height: 1.35;
}

.vault-category-count {
  color: #00ff9d;
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.vault-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.vault-detail-header h3,
.vault-item-card h4 {
  margin: 0;
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 0.75px;
}

.vault-item-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.vault-item-card {
  display: flex;
  min-width: 0;
  min-height: 168px;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
}

.vault-item-card.is-unlocked {
  border-color: rgba(0, 210, 255, 0.25);
}

.vault-item-card.is-locked {
  align-items: center;
  justify-content: center;
  opacity: 0.52;
  text-align: center;
}

.vault-item-card p {
  margin: 0;
  color: #8f9da6;
  font-size: 0.55rem;
  line-height: 1.4;
}

.vault-item-preview,
.vault-wallpaper-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 88px;
  overflow: hidden;
  border-radius: 8px;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.13), rgba(0, 0, 0, 0.35));
}

.vault-screen .vault-item-preview img,
.vault-screen .vault-wallpaper-preview img {
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
  object-fit: contain;
}

.vault-state {
  align-self: flex-start;
  padding: 3px 7px;
  border: 1px solid rgba(0, 255, 157, 0.3);
  border-radius: 999px;
  color: #58dca5;
  font-size: 0.46rem;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.vault-item-card button,
.vault-footer button {
  min-height: 34px;
  margin: auto 0 0;
  padding: 7px 9px;
  font-size: 0.52rem;
}

.vault-item-card button:focus-visible,
.vault-footer button:focus-visible,
.vault-wallpaper-lightbox button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.vault-lock,
.vault-badge-icon {
  color: #00d2ff;
  font-size: 1.5rem;
  text-shadow: 0 0 12px rgba(0, 210, 255, 0.38);
}

.vault-file-code,
.vault-coupon-value {
  color: #00d2ff;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 1px;
}

.vault-coupon-value {
  font-size: 1rem;
}

.vault-empty {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px dashed rgba(0, 210, 255, 0.2);
  border-radius: 11px;
  color: #83939e;
  text-align: center;
}

.vault-empty span {
  color: #00d2ff;
  font-size: 1.6rem;
}

.vault-empty p {
  margin: 0;
  font-size: 0.62rem;
}

.vault-footer {
  display: flex;
  flex: 0 0 auto;
  width: 100%;
  justify-content: flex-end;
  gap: 8px;
}

.vault-footer #vault-back-btn {
  margin-right: auto;
}

.vault-wallpaper-lightbox {
  position: absolute;
  z-index: 3;
  inset: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  border-radius: 12px;
  background: rgba(0, 4, 10, 0.96);
}

.vault-wallpaper-lightbox[hidden] {
  display: none;
}

.vault-wallpaper-lightbox img {
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
  object-fit: contain;
}

.vault-wallpaper-lightbox button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  min-height: 34px;
  margin: 0;
  padding: 0;
}

@media (max-width: 620px) {
  .vault-screen { padding: 12px; gap: 9px; }
  .vault-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .vault-category-card {
    grid-template-columns: 34px minmax(0, 1fr);
    min-width: 0;
    min-height: 96px;
    gap: 7px;
    padding: 8px;
  }
  .vault-category-icon { width: 32px; height: 32px; }
  .vault-category-main strong,
  .vault-category-main small { overflow-wrap: anywhere; }
  .vault-category-count { grid-column: 2; white-space: normal; }
  .vault-item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
}

@media (max-width: 300px) {
  .vault-category-grid,
  .archive-tabs { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .vault-item-grid { grid-template-columns: 1fr; }
  .vault-item-card { min-height: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  .vault-view.is-active { animation: none; }
  .vault-category-card { transition: none; }
}

/* --- FASE 8A: ARCHIVE MODULAR --- */
.archive-screen {
  width: min(calc(100% - 16px), 680px);
  max-width: calc(100% - 16px);
  min-height: 0;
  max-height: calc(100% - 16px);
  padding: 14px;
  gap: 10px;
  justify-content: flex-start;
  overflow: hidden;
  border-color: rgba(122, 235, 255, 0.76);
  background:
    radial-gradient(circle at 50% 0, rgba(0, 210, 255, 0.1), transparent 34%),
    rgba(0, 4, 8, 0.97);
  box-shadow: 0 15px 38px rgba(0, 14, 30, 0.78), 0 0 24px rgba(0, 210, 255, 0.12);
}

.archive-header {
  flex: 0 0 auto;
  width: 100%;
  text-align: left;
}

.archive-kicker,
.archive-eyebrow,
.archive-code {
  color: #00d2ff;
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 1.35px;
}

.archive-header h2 {
  margin: 3px 0 0;
  color: #fff;
  font-size: 1.32rem;
  letter-spacing: 2.4px;
}

.archive-header p,
.archive-module-heading p {
  margin: 4px 0 0;
  color: #9faab2;
  font-size: 0.62rem;
  line-height: 1.4;
}

.archive-tabs {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  padding: 2px 0 7px;
  overflow: hidden;
}

.archive-tabs button {
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: #aab2b8;
  font-size: 0.54rem;
  font-weight: 900;
  letter-spacing: 0.6px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.archive-tabs button.is-active {
  border-color: rgba(0, 210, 255, 0.78);
  background: rgba(0, 210, 255, 0.11);
  color: #fff;
  box-shadow: inset 0 -2px 0 #00d2ff;
}

.archive-tabs button:focus-visible,
.archive-close:focus-visible,
.archive-skin-card button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.archive-content {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 210, 255, 0.42) transparent;
}

.archive-panel {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.archive-panel.is-active {
  animation: archivePanelIn 180ms ease-out both;
}

@keyframes archivePanelIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.archive-module {
  width: 100%;
  box-sizing: border-box;
  padding: 11px;
  border: 1px solid rgba(0, 210, 255, 0.2);
  border-radius: 11px;
  background: rgba(0, 210, 255, 0.035);
  text-align: left;
}

.archive-module-heading {
  margin-bottom: 10px;
}

.archive-module-heading h3,
.archive-file-card h4,
.archive-skin-card h4,
.archive-wallpaper-card h4,
.archive-category-card h4 {
  margin: 0;
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 0.7px;
}

.archive-identity-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.archive-screen .archive-avatar {
  width: 74px;
  height: 74px;
  max-height: none;
  margin: 0;
  border-radius: 50%;
  object-fit: contain;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.17), rgba(0, 0, 0, 0.2));
  filter: drop-shadow(0 0 8px rgba(0, 210, 255, 0.28));
}

.archive-identity-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.archive-identity-main strong {
  overflow: hidden;
  color: #fff;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-identity-main > span:last-child {
  color: #55d99a;
  font-size: 0.65rem;
  font-weight: 800;
}

.archive-xp-row {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: #aaa;
  font-size: 0.58rem;
}

.archive-xp-row strong {
  color: #fff;
}

.archive-progress {
  width: 100%;
  height: 5px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.archive-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00d2ff, #00ff66);
}

.archive-detail-grid,
.archive-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 10px 0 0;
}

.archive-detail-grid div,
.archive-stat-grid div {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.archive-detail-grid dt,
.archive-stat-grid dt {
  color: #8d979e;
  font-size: 0.52rem;
  line-height: 1.3;
}

.archive-detail-grid dd,
.archive-stat-grid dd {
  overflow-wrap: anywhere;
  margin: 4px 0 0;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
}

.archive-card-list,
.archive-category-list {
  display: grid;
  gap: 7px;
}

.archive-file-card,
.archive-category-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
}

.archive-file-card.is-locked {
  opacity: 0.57;
}

.archive-file-card p,
.archive-skin-card p,
.archive-wallpaper-card p,
.archive-category-card span {
  margin: 4px 0 0;
  color: #929ca3;
  font-size: 0.56rem;
  line-height: 1.35;
}

.archive-file-card time {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.5rem;
}

.archive-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: #aaa;
  font-size: 0.45rem;
  font-weight: 900;
  letter-spacing: 0.55px;
  white-space: nowrap;
}

.archive-state.is-recovered,
.archive-state.is-equipped {
  border-color: rgba(0, 255, 102, 0.38);
  color: #55d99a;
}

.archive-skin-grid,
.archive-wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.archive-skin-card,
.archive-wallpaper-card {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
}

.archive-skin-card.is-locked {
  opacity: 0.58;
}

.archive-skin-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 82px;
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: 7px;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.13), rgba(0, 0, 0, 0.3));
}

.archive-screen .archive-skin-preview img {
  max-height: 78px;
  margin: 0;
  object-fit: contain;
}

.archive-skin-card .archive-state {
  margin-top: 8px;
}

.archive-skin-card button {
  width: 100%;
  min-height: 34px;
  margin: 8px 0 0;
  padding: 7px;
  border: 1px solid rgba(0, 210, 255, 0.25);
  background: rgba(0, 210, 255, 0.055);
  color: #9faab2;
  font-size: 0.52rem;
}

.archive-skin-card button:not(:disabled) {
  border-color: rgba(0, 255, 102, 0.55);
  color: #fff;
  cursor: pointer;
}

.archive-skin-rarity {
  display: block;
  margin-bottom: 5px;
  color: #8d979e;
  font-size: 0.48rem;
  font-weight: 900;
  letter-spacing: 0.65px;
  text-transform: uppercase;
}

.archive-skin-rarity.is-permanent { color: #55d99a; }
.archive-skin-rarity.is-legendary { color: #d4a9ff; }

/* Fase 8B: recompensa permanente, aislada del flujo de gameplay. */
.skin-reward-screen {
  overflow: hidden;
  border-color: rgba(0, 255, 174, 0.7);
  background: radial-gradient(circle at 50% 38%, rgba(0, 210, 255, 0.14), transparent 50%), rgba(0, 4, 8, 0.98);
}

.skin-reward-screen > *:not(.skin-reward-glow) { position: relative; z-index: 1; }

.skin-reward-glow {
  position: absolute;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(0, 255, 174, 0.25);
  border-radius: 50%;
  animation: skinRewardPulse 3s ease-out both;
}

.skin-reward-message {
  color: #55d99a;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.skin-reward-screen img {
  width: min(58%, 190px);
  max-height: 190px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(0, 210, 255, 0.35));
  animation: skinRewardReveal 650ms ease-out both;
}

.skin-reward-screen h2 { margin: 2px 0 10px; color: #fff; }

@keyframes skinRewardPulse {
  from { opacity: 0; transform: scale(0.62); }
  35% { opacity: 1; }
  to { opacity: 0.15; transform: scale(1.35); }
}

@keyframes skinRewardReveal {
  from { opacity: 0; transform: translateY(8px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.archive-wallpaper-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 82px;
  margin-bottom: 8px;
  overflow: hidden;
  border: 1px dashed rgba(0, 210, 255, 0.25);
  border-radius: 7px;
  background:
    linear-gradient(135deg, transparent 40%, rgba(0, 210, 255, 0.06) 41% 59%, transparent 60%),
    rgba(0, 210, 255, 0.025);
}

.archive-wallpaper-placeholder.is-mobile {
  width: 58%;
  margin-right: auto;
  margin-left: auto;
}

.archive-wallpaper-placeholder span {
  color: rgba(0, 210, 255, 0.55);
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.archive-wallpaper-card .archive-state {
  margin-top: 7px;
}

.archive-category-card {
  grid-template-columns: 1fr;
}

.archive-category-card .archive-progress {
  margin-top: 0;
}

.archive-close {
  flex: 0 0 auto;
  width: 100%;
  min-height: 42px;
  margin: 0;
}

@media (min-width: 600px) {
  .archive-screen {
    padding: 18px;
  }

  .archive-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
  }

  .archive-tabs button {
    min-width: 0;
  }

  .archive-detail-grid,
  .archive-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 340px) {
  .archive-screen {
    width: calc(100% - 10px);
    max-width: calc(100% - 10px);
    padding: 10px;
  }

  .archive-tabs button {
    min-height: 44px;
    padding-inline: 6px;
  }

  .archive-module {
    padding: 9px;
  }

  .archive-identity-card {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .archive-screen .archive-avatar {
    width: 62px;
    height: 62px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .archive-panel.is-active {
    animation: none !important;
  }

  .archive-tabs button,
  .archive-close {
    transition-duration: 0.01ms !important;
  }

  .skin-reward-glow,
  .skin-reward-screen img {
    animation: none !important;
  }
}

/* --- FASE 7.1: PULIDO SISTEMICO DEL MENU --- */
.menu-ambient {
  position: absolute;
  inset: 0;
  z-index: 900;
  overflow: hidden;
  pointer-events: none;
}

.menu-ambient::before {
  content: "";
  position: absolute;
  inset: 14% 7%;
  border-radius: 30%;
  background: radial-gradient(ellipse, rgba(0, 210, 255, 0.075), transparent 68%);
  filter: blur(20px);
}

.menu-ambient-particles {
  position: absolute;
  inset: -20%;
  background-repeat: repeat;
  opacity: 0.45;
  will-change: transform;
}

.menu-ambient-particles-a {
  background-image: radial-gradient(circle, rgba(0, 210, 255, 0.65) 0 1px, transparent 1.8px);
  background-size: 79px 83px;
  animation: ambientParticleDriftA 22s linear infinite;
}

.menu-ambient-particles-b {
  background-image: radial-gradient(circle, rgba(0, 255, 102, 0.38) 0 1.4px, transparent 2.2px);
  background-size: 131px 117px;
  opacity: 0.28;
  animation: ambientParticleDriftB 31s linear infinite;
}

.menu-ambient-particles-c {
  background-image: radial-gradient(circle, rgba(80, 145, 255, 0.42) 0 0.7px, transparent 1.6px);
  background-size: 57px 63px;
  opacity: 0.32;
  animation: ambientParticleDriftC 27s linear infinite;
}

@keyframes ambientParticleDriftA {
  to { transform: translate3d(24px, -32px, 0); }
}

@keyframes ambientParticleDriftB {
  to { transform: translate3d(-28px, -18px, 0); }
}

@keyframes ambientParticleDriftC {
  to { transform: translate3d(14px, -26px, 0); }
}

#menu {
  isolation: isolate;
  border-color: rgba(190, 242, 255, 0.76);
  box-shadow:
    0 13px 34px rgba(0, 18, 36, 0.72),
    0 0 18px rgba(0, 210, 255, 0.12),
    0 0 34px rgba(0, 120, 128, 0.08);
  animation: menuPanelBreath 8s ease-in-out infinite;
}

#menu::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 2px;
  border-radius: 16px;
  background: conic-gradient(from 0deg, transparent 0 76%, rgba(0, 210, 255, 0.78) 83%, rgba(0, 255, 102, 0.38) 87%, transparent 93% 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  animation: menuEnergyCircuit 14s linear infinite;
}

@keyframes menuPanelBreath {
  0%, 100% {
    border-color: rgba(190, 242, 255, 0.7);
    box-shadow: 0 13px 34px rgba(0, 18, 36, 0.72), 0 0 16px rgba(0, 210, 255, 0.1), 0 0 30px rgba(0, 120, 128, 0.07);
  }
  50% {
    border-color: rgba(205, 248, 255, 0.83);
    box-shadow: 0 14px 36px rgba(0, 22, 42, 0.68), 0 0 21px rgba(0, 210, 255, 0.16), 0 0 38px rgba(0, 128, 132, 0.1);
  }
}

@keyframes menuEnergyCircuit {
  0%, 62% { transform: rotate(0deg); opacity: 0; }
  66% { opacity: 0.34; }
  86% { transform: rotate(360deg); opacity: 0.34; }
  90%, 100% { transform: rotate(360deg); opacity: 0; }
}

#menu .helix-hero-glow {
  animation: helixAmbientGlow 7s ease-in-out infinite;
  transform: none;
}

@keyframes helixAmbientGlow {
  0%, 100% { opacity: 0.48; }
  50% { opacity: 0.7; }
}

#menu .helix-hero-image {
  animation: helixMenuFloatPolished 6.5s ease-in-out infinite;
}

@keyframes helixMenuFloatPolished {
  0%, 100% { transform: translateY(1px) rotate(-0.25deg); }
  50% { transform: translateY(-3px) rotate(0.3deg); }
}

#menu .helix-hero-stage::after {
  opacity: 0.22;
}

#menu .menu-primary-modes .menu-mode-button::before,
#menu .menu-primary-modes .menu-mode-button::after {
  animation: none;
}

#menu .menu-primary-modes .menu-mode-button::before {
  opacity: 0.58;
  box-shadow: 0 0 13px #00d2ff, 0 0 24px rgba(255, 0, 255, 0.58), 0 0 34px rgba(0, 255, 102, 0.48);
}

#menu .menu-primary-modes .menu-mode-button::after {
  background-position: 48% 50%;
  opacity: 0.32;
}

#menu .menu-profile-trigger {
  opacity: 0.72;
}

#menu .monthly-preview {
  opacity: 0.76;
}

#menu .menu-secondary-action {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.025);
}

#menu .menu-footer {
  opacity: 0.66;
}

@media (max-width: 340px) {
  #menu {
    width: calc(100% - 12px);
    padding-right: 10px;
    padding-left: 10px;
  }

  #menu .menu-primary-modes .menu-mode-button {
    min-height: 50px;
    padding-right: 5px;
    padding-left: 5px;
    font-size: 0.82rem;
  }

  #menu .menu-secondary-action {
    font-size: 0.53rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #menu,
  #menu::before,
  #menu .helix-hero-image,
  #menu .helix-hero-glow,
  #menu .helix-hero-stage::after,
  .menu-ambient-particles {
    animation: none !important;
  }

  #menu button,
  #menu a {
    transition-duration: 0.01ms !important;
  }
}
/* Local-only Adventure balance inspector; never instantiated in production. */
#adventure-balance-debug {
  position: fixed;
  z-index: 10000;
  right: 12px;
  bottom: 12px;
  width: min(340px, calc(100vw - 24px));
  max-height: min(70vh, 620px);
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(0, 210, 255, 0.45);
  border-radius: 12px;
  background: rgba(2, 7, 19, 0.94);
  color: #dff9ff;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.42);
  font: 12px/1.45 monospace;
}

#adventure-balance-debug pre {
  white-space: pre-wrap;
}

#adventure-balance-debug button {
  margin-right: 8px;
  padding: 6px 10px;
}

/* Keep the records workspace above the legacy generic overlay dimensions. */
#system-records-screen.system-records-screen {
  width: min(calc(100% - 16px), 760px);
  max-width: calc(100% - 16px);
  max-height: calc(100% - 16px);
  padding: 16px;
  overflow: hidden;
}

@media (max-width: 520px) {
  #system-records-screen.system-records-screen {
    width: calc(100% - 12px);
    max-width: calc(100% - 12px);
    padding: 11px;
  }
}

@media (max-height: 430px) and (orientation: landscape) {
  #system-records-screen.system-records-screen {
    width: min(calc(100% - 18px), 820px);
    max-width: calc(100% - 18px);
    max-height: calc(100svh - 10px);
    padding: 8px 12px;
  }
}
