:root {
  color-scheme: dark;
  --bg: #05090c;
  --surface: #0b1519;
  --surface-2: #101f26;
  --line: #224652;
  --text: #edf7f9;
  --muted: #a9bec5;
  --primary: #2bd4d9;
  --blue: #4c8dff;
  --violet: #a06cff;
  --green: #65d26e;
  --amber: #f4bd4f;
  --danger: #ff6b6b;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-width: 320px;
  /* Blindaje eje X (REGRESIONES.md #12): ningún elemento ancho puede desplazar
     ni deformar la página en móvil; `clip` además impide el desplazamiento
     lateral programático (scrollIntoView). `hidden` = fallback para navegadores
     sin soporte de `clip`. */
  overflow-x: hidden;
  overflow-x: clip;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(rgba(43, 212, 217, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 212, 217, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(7, 16, 19, 0.98), rgba(5, 9, 12, 1) 420px),
    var(--bg);
  background-size: 32px 32px, 32px 32px, auto, auto;
  color: var(--text);
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(237, 247, 249, 0.035) 0,
    rgba(237, 247, 249, 0.035) 1px,
    transparent 1px,
    transparent 5px
  );
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #041013;
}

.skip-link:focus {
  top: 12px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 10px clamp(12px, 3vw, 40px);
  background: rgba(3, 7, 9, 0.97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(43, 212, 217, 0.22), 0 18px 60px rgba(0, 0, 0, 0.32);
}

/* Desktop nav: overlay fijo ANCLADO EN EL HUECO entre la marca (izq) y las acciones
   (der). Antes se centraba respecto a la PANTALLA (left:50% + max-width:100vw-380px),
   y como las acciones (perfil+idioma+instalar ~410px) son más anchas que la marca,
   el borde derecho del nav se metía sobre ellas (títulos "encima del admin"). Con
   left/right fijos el nav NUNCA cruza a la zona de acciones, aparezca o no el botón
   Instalar. Umbral 1340px: por debajo, los 10 ítems no caben junto a marca+acciones
   → se usa el menú hamburguesa (más limpio que recortarlos). Ver REGRESIONES. */
@media (min-width: 1340px) {
  .nav {
    position: fixed;
    top: 0;
    left: 246px;               /* después de la marca (logo + ARKEMU) */
    right: 468px;              /* antes de las acciones (perfil logueado ~170px + idioma + instalar) → nunca las tapa */
    transform: none;
    z-index: 31; /* above topbar:30, below dropdowns:45 */
    width: auto;
    max-width: none;
    height: 68px;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: safe center; /* centra; si desborda, no recorta el inicio */
    gap: 2px;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;      /* Firefox: sin barra visible */
    padding: 0;
    pointer-events: none; /* pass clicks through to topbar where no link hits */
    visibility: visible;
    transition: none;
  }

  .nav::-webkit-scrollbar { display: none; }  /* Chrome/Safari: sin barra */

  .nav > * {
    pointer-events: auto;
  }

  /* Ítems compactos para que los 10 quepan sin desplazar en laptops ~1340-1400px. */
  .nav a { font-size: 0.75rem; padding: 5px 7px; }
  .nav-group { gap: 1px; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-mark {
  display: block;
  width: auto;
  height: 50px;
  filter: drop-shadow(0 2px 9px rgba(43, 212, 217, 0.4));
}

.brand-name {
  font-family: "Orbitron", ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: 1px;
  color: #edf7f9;
  text-shadow: 0 0 14px rgba(43, 212, 217, 0.35);
}

.nav {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.nav-head,
.nav-group-label {
  display: none;
}

.nav-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px;
  min-width: 0;
  flex-shrink: 1;
}

.nav-extra {
  display: none;
}

/* El locale en el drawer solo visible en móvil */
.nav-locale-drawer {
  display: none;
}

.nav-sep {
  width: 1px;
  height: 22px;
  background: var(--line);
  flex-shrink: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

.more-menu {
  position: relative;
}

.profile-menu {
  position: relative;
  display: inline-flex;
}

.more-toggle {
  border-color: rgba(43, 212, 217, 0.45);
  background: rgba(43, 212, 217, 0.08);
}

.more-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 45;
  width: min(260px, calc(100vw - 32px));
  display: none;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(43, 212, 217, 0.4);
  border-radius: var(--radius);
  background: rgba(5, 14, 17, 0.98);
  box-shadow: var(--shadow);
}

.more-menu.open .more-panel {
  display: grid;
}

.more-panel a {
  min-height: 42px;
  display: flex;
  align-items: center;
  border-radius: var(--radius);
  padding: 9px 12px;
  text-decoration: none;
  color: var(--text);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  text-transform: uppercase;
  font-size: 0.86rem;
}

.more-panel a:hover,
.more-panel a.active {
  background: rgba(43, 212, 217, 0.12);
}

.login-cta {
  border-color: rgba(244, 189, 79, 0.72);
  background: linear-gradient(135deg, rgba(244, 189, 79, 0.95), rgba(43, 212, 217, 0.92));
  color: #031316;
  font-weight: 900;
  box-shadow: 0 0 24px rgba(244, 189, 79, 0.18);
}

.login-cta:hover,
.login-cta.active {
  background: linear-gradient(135deg, #ffd36b, #42f0ec);
  color: #031316;
}

.profile-toggle {
  min-width: 0;
  border-color: rgba(244, 189, 79, 0.64);
  background: rgba(244, 189, 79, 0.1);
  color: var(--text);
  padding: 6px 10px 6px 7px;
  text-transform: none;
}

.profile-toggle:hover,
.profile-toggle.active {
  border-color: rgba(244, 189, 79, 0.9);
  background: rgba(244, 189, 79, 0.16);
}

.profile-avatar {
  width: 32px;
  aspect-ratio: 1;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(244, 189, 79, 0.7);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber), var(--primary));
  color: #031316;
  font-weight: 900;
  font-size: 0.78rem;
  line-height: 1;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  text-transform: uppercase;
  font-size: 0.82rem;
  line-height: 1;
}

.profile-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 45;
  width: min(260px, calc(100vw - 32px));
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(244, 189, 79, 0.5);
  border-radius: var(--radius);
  background: rgba(5, 14, 17, 0.98);
  box-shadow: var(--shadow);
}

.profile-panel[hidden] {
  display: none;
}

.profile-panel a,
.profile-panel button {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  border-color: rgba(34, 70, 82, 0.72);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.profile-panel a:hover,
.profile-panel a.active,
.profile-panel button:hover {
  background: rgba(244, 189, 79, 0.12);
  box-shadow: inset 0 -2px 0 var(--amber);
}

.nav a,
.footer a,
.button,
button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 9px 13px;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  text-transform: uppercase;
  font-size: 0.86rem;
  line-height: 1.15;
  white-space: nowrap;
}

.nav a {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  padding: 7px 10px;
}

.nav a:hover,
.nav a.active,
.footer a:hover {
  border-color: var(--line);
  background: rgba(43, 212, 217, 0.12);
  box-shadow: inset 0 -2px 0 var(--primary);
}
.nav a.nav-support {
  color: var(--warning, #f4bd4f);
  font-weight: 700;
}
.nav a.nav-support:hover,
.nav a.nav-support.active {
  background: rgba(244, 189, 79, 0.12);
  box-shadow: inset 0 -2px 0 var(--warning, #f4bd4f);
}

.nav-toggle {
  display: none;
}

.nav-close {
  display: none;
}

.nav-backdrop {
  display: none;
}

.nav-toggle-icon {
  width: 18px;
  height: 12px;
  position: relative;
  display: inline-block;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.nav-toggle-icon::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 3px;
  border-top: 2px solid currentColor;
}

.locale-select {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  white-space: nowrap;
}

/* ≤1339px: topbar móvil + menú hamburguesa (el nav horizontal solo cabe ≥1340px). */
@media (max-width: 1339px) {
  body.nav-open {
    overflow: hidden;
  }

  .topbar {
    gap: 8px;
    padding-inline: 14px;
  }

  .nav-toggle {
    display: inline-flex;
    border-color: rgba(43, 212, 217, 0.45);
    background: rgba(43, 212, 217, 0.08);
    padding: 8px 12px;
  }

  .more-menu {
    display: none;
  }

  .login-cta,
  .profile-menu {
    display: none;
  }

  /* Ocultar locale del topbar en móvil — aparece dentro del drawer */
  .topbar-actions .locale-select {
    display: none;
  }

  /* Backdrop semitransparente que cubre el área fuera del drawer */
  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 38;
    display: block;
    border: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.62);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    cursor: pointer;
  }

  body.nav-open .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* Drawer lateral desde la derecha */
  .nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    z-index: 40;
    width: min(340px, 85vw);
    height: 100dvh;
    display: grid;
    align-content: start;
    justify-content: stretch;
    gap: 10px;
    padding: max(16px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) 14px;
    overflow-y: auto;
    overflow-x: hidden;
    background:
      linear-gradient(rgba(43, 212, 217, 0.03) 1px, transparent 1px),
      linear-gradient(90deg, rgba(43, 212, 217, 0.03) 1px, transparent 1px),
      radial-gradient(circle at 85% 0%, rgba(244, 189, 79, 0.14), transparent 38%),
      linear-gradient(180deg, rgba(8, 19, 24, 0.99), rgba(4, 9, 12, 0.99));
    background-size: 28px 28px, 28px 28px, auto, auto;
    border-left: 1px solid rgba(43, 212, 217, 0.28);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.52);
    transform: translateX(105%);
    transition: transform 0.22s ease, visibility 0s linear 0.22s;
    flex-wrap: wrap;
    visibility: hidden;
  }

  .nav.open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.22s ease, visibility 0s;
  }

  .nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }

  .nav-close {
    display: inline-flex;
    min-height: 36px;
    padding: 7px 10px;
    border-color: rgba(43, 212, 217, 0.42);
    background: rgba(43, 212, 217, 0.06);
  }

  .nav-group {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid rgba(43, 212, 217, 0.2);
    border-radius: var(--radius);
    background: rgba(8, 20, 25, 0.65);
    width: 100%;
  }

  .nav-group-label {
    display: block;
    color: var(--primary);
    font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
  }

  .nav a {
    width: 100%;
    justify-content: flex-start;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 0.9rem;
    border-color: rgba(34, 70, 82, 0.72);
    background: rgba(255, 255, 255, 0.03);
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
  }

  .nav-extra {
    display: grid;
  }

  .nav-locale-drawer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
  }

  .nav-locale-drawer select {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #081419;
    color: var(--text);
    font-size: .9rem;
  }

  .nav-sep {
    display: none;
  }
}

.cookie-banner {
  position: fixed;
  left: clamp(12px, 3vw, 28px);
  right: clamp(12px, 3vw, 28px);
  bottom: clamp(12px, 3vw, 28px);
  z-index: 80;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(43, 212, 217, 0.34);
  border-radius: var(--radius);
  background: rgba(5, 14, 17, 0.98);
  box-shadow: var(--shadow);
}

.cookie-banner p {
  margin: 0;
  color: var(--muted);
  word-break: break-word;
  overflow-wrap: break-word;
}

.cookie-banner .actions {
  margin: 0;
}

.player-format-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.player-warning {
  margin: 0;
  border-color: rgba(244, 189, 79, 0.55);
  background: rgba(244, 189, 79, 0.08);
}

@media (max-width: 860px) {
  .cookie-banner {
    left: 8px;
    right: 8px;
    bottom: 8px;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
    font-size: .87rem;
    max-width: calc(100vw - 16px);
    box-sizing: border-box;
  }

  .cookie-banner .actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .cookie-banner .button,
  .cookie-banner button {
    flex: 1 1 140px;
    text-align: center;
    justify-content: center;
  }
}

.locale-select select,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #081419;
  color: var(--text);
  padding: 11px 12px;
}

.app-shell {
  min-height: calc(100vh - 190px);
}

/* ── Navegación TV (D-pad): recuadro de foco bien visible, estilo Netflix ──
   Solo aplica cuando el JS detecta una TV (body.tv-nav). Aditivo: no toca el
   foco normal de escritorio/móvil. */
body.tv-nav a:focus,
body.tv-nav button:focus,
body.tv-nav input:focus,
body.tv-nav select:focus,
body.tv-nav [tabindex]:focus {
  outline: 3px solid var(--primary, #2bd4d9);
  outline-offset: 3px;
  border-radius: 10px;
  box-shadow: 0 0 0 6px rgba(43, 212, 217, 0.22), 0 0 22px rgba(43, 212, 217, 0.45);
}

/* Pantalla de carga inicial ("Cargando…") — el CSS crítico va INLINE en index.html
   para verse al instante; esto lo replica en la hoja para coherencia. */
.app-boot { min-height: 56vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; color: #bfe9ec; }
.app-boot-logo { width: 88px; height: auto; filter: drop-shadow(0 0 18px rgba(43, 212, 217, 0.45)); animation: ark-boot-pulse 1.6s ease-in-out infinite; }
.app-boot-bar { width: 180px; max-width: 58vw; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.10); overflow: hidden; }
.app-boot-bar > span { display: block; width: 42%; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #2bd4d9, #7a5cff); animation: ark-boot-bar 1.15s ease-in-out infinite; }
.app-boot-text { margin: 0; font-size: .82rem; letter-spacing: .18em; text-transform: uppercase; opacity: .82; font-weight: 700; }
@keyframes ark-boot-pulse { 0%, 100% { transform: scale(.93); opacity: .72; } 50% { transform: scale(1.05); opacity: 1; } }
@keyframes ark-boot-bar { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }

/* Aparición suave del contenido al navegar (fade de opacidad — SIN transform, para no
   crear bloque contenedor que afecte a modales/emulador en fullscreen). Se reproduce en
   cada render porque las <section> se recrean al cambiar de ruta. Sutil y rápido. */
@keyframes app-content-in { from { opacity: 0; } to { opacity: 1; } }
.app-shell > .section { animation: app-content-in .28s ease both; }

@media (prefers-reduced-motion: reduce) {
  .app-boot-logo, .app-boot-bar > span, .app-shell > .section { animation: none; }
}

.section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) 0;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
  min-height: calc(100vh - 160px);
  padding-top: 24px;
}

.hero::before {
  content: "ARKEMU";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  color: rgba(237, 247, 249, 0.04);
  font-size: clamp(3rem, 10vw, 9rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
}

.eyebrow {
  color: var(--primary);
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  max-width: 12ch;
  font-size: clamp(3rem, 8vw, 6.6rem);
}

h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  color: var(--muted);
  line-height: 1.65;
}

.lead {
  max-width: 64ch;
  font-size: clamp(1.05rem, 2vw, 1.26rem);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.button,
button.primary {
  border-color: rgba(43, 212, 217, 0.4);
  background: var(--primary);
  color: #031316;
  font-weight: 800;
}

.button.secondary,
button.secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
  color: var(--text);
}

.button.warning {
  background: rgba(244, 189, 79, 0.16);
  border-color: rgba(244, 189, 79, 0.55);
  color: #ffe2a0;
}

.orbital-stage {
  min-height: 460px;
  position: relative;
  display: grid;
  place-items: center;
  border-left: 1px solid var(--line);
}

.orbit-mark {
  position: relative;
  width: min(430px, 78vw);
  aspect-ratio: 1;
  border: 2px solid rgba(43, 212, 217, 0.54);
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 42px rgba(76, 141, 255, 0.18), 0 0 70px rgba(43, 212, 217, 0.12);
}

.orbit-mark::before {
  content: "";
  position: absolute;
  width: 136%;
  height: 46%;
  border: 2px solid rgba(160, 108, 255, 0.6);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.orbit-mark::after {
  content: "";
  position: absolute;
  right: 14%;
  top: 21%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 24px rgba(244, 189, 79, 0.65);
}

.orbit-core {
  width: 48%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(43, 212, 217, 0.95), rgba(76, 141, 255, 0.88));
  color: #041114;
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 900;
}

/* ── Logo del hero (home) ─────────────────────────────────────────────────── */
.orbital-stage { border-left: 0; }
.hero-logo {
  position: relative;
  z-index: 1;
  width: min(500px, 92%);
  height: auto;
  filter: drop-shadow(0 0 46px rgba(43, 212, 217, 0.45)) drop-shadow(0 16px 38px rgba(0, 0, 0, 0.55));
  animation: hero-float 6.5s ease-in-out infinite;
}
.hero-logo-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, 94%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(43, 212, 217, 0.22), rgba(76, 141, 255, 0.12) 45%, transparent 68%);
  filter: blur(26px);
  z-index: 0;
}
@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

/* ── Fondo galaxia con parallax (solo en el home) ─────────────────────────── */
.space-bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.8s ease;
  /* Base de espacio profundo: cubre la cuadrícula del sitio en el home para que
     la galaxia domine el fondo. */
  background:
    radial-gradient(140% 120% at 72% 16%, #102046 0%, #0a1430 26%, #060b1c 52%, #03060f 78%, #020308 100%);
}
body.home-active .space-bg { opacity: 1; }
/* En el home atenuamos las scanlines del sitio para que no ensucien la galaxia */
body.home-active::before { opacity: 0.25; }
.space-nebula,
.space-stars,
.space-vignette {
  position: absolute;
  inset: -16%;
}
.space-nebula { will-change: transform; }
/* Estrellas: parallax por transform (compositor, sin repintado — mover
   background-position repintaba la capa entera en cada frame de scroll y el
   contenido "desaparecía" al scrollear rápido). Holgura fija -360px > tile del
   patrón (320px) + parallax de puntero (±30px): el traslado con módulo nunca
   descubre el borde de la capa. */
.space-stars { will-change: transform; inset: -360px; }
/* Nubes de nebulosa (más brillantes y con núcleo). El desenfoque va HORNEADO en
   los gradientes (caídas más suaves + colores pre-saturados) — el antiguo
   `filter: blur(34px) saturate(1.15)` era un filtro EN TIEMPO REAL sobre una capa
   mayor que la pantalla que la GPU re-aplicaba al componer el parallax del scroll
   → scroll "relentizado". Sin filter, la capa es una textura plana y barata. */
.space-nebula {
  background:
    radial-gradient(42% 38% at 74% 20%, rgba(87, 152, 255, 0.6) 12%, rgba(87, 152, 255, 0.28) 42%, transparent 70%),
    radial-gradient(46% 44% at 16% 74%, rgba(163, 106, 255, 0.55) 12%, rgba(163, 106, 255, 0.24) 44%, transparent 72%),
    radial-gradient(38% 36% at 58% 96%, rgba(49, 227, 232, 0.45) 10%, rgba(49, 227, 232, 0.2) 42%, transparent 70%),
    radial-gradient(30% 28% at 46% 38%, rgba(131, 190, 255, 0.36) 10%, rgba(131, 190, 255, 0.16) 40%, transparent 68%),
    radial-gradient(64% 54% at 84% 64%, rgba(172, 120, 255, 0.25) 14%, rgba(172, 120, 255, 0.12) 46%, transparent 74%);
  opacity: 0.95;
}
.space-stars { background-repeat: repeat; }
.space-stars--far {
  background-image:
    radial-gradient(1.2px 1.2px at 20px 30px, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1px 1px at 120px 80px, rgba(200, 230, 255, 0.8), transparent),
    radial-gradient(1.2px 1.2px at 70px 160px, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1px 1px at 180px 120px, rgba(180, 210, 255, 0.8), transparent),
    radial-gradient(1px 1px at 30px 200px, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 210px 190px, rgba(220, 235, 255, 0.7), transparent);
  background-size: 200px 200px;
  opacity: 0.85;
  animation: star-twinkle 5.5s ease-in-out infinite;
}
.space-stars--near {
  background-image:
    radial-gradient(2.2px 2.2px at 40px 60px, #ffffff, transparent),
    radial-gradient(2px 2px at 160px 28px, rgba(190, 230, 255, 0.98), transparent),
    radial-gradient(1.8px 1.8px at 100px 150px, #ffffff, transparent),
    radial-gradient(2px 2px at 250px 90px, rgba(244, 189, 79, 0.85), transparent),
    radial-gradient(2.4px 2.4px at 300px 210px, rgba(120, 220, 255, 0.9), transparent);
  background-size: 320px 320px;
  opacity: 0.95;
  animation: star-twinkle 4s ease-in-out infinite alternate;
}
@keyframes star-twinkle {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
.space-vignette {
  inset: 0;
  background:
    radial-gradient(115% 80% at 50% 32%, transparent 38%, rgba(2, 5, 11, 0.6) 100%),
    linear-gradient(180deg, rgba(3, 7, 14, 0.12), rgba(3, 6, 12, 0.62));
}
/* En el home, el título usa la tipografía espacial y resalta sobre la galaxia */
.hero h1 {
  font-family: "Orbitron", Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -1px;
}
body.home-active .hero h1 {
  text-shadow: 0 0 34px rgba(43, 212, 217, 0.45), 0 0 70px rgba(76, 141, 255, 0.3), 0 3px 20px rgba(0, 0, 0, 0.6);
}
body.home-active .hero .lead { text-shadow: 0 1px 14px rgba(0, 0, 0, 0.55); }

@media (prefers-reduced-motion: reduce) {
  .hero-logo { animation: none; }
  .space-bg { transition: none; }
}

.notice {
  border-left: 4px solid var(--primary);
  background: rgba(43, 212, 217, 0.08);
  padding: 14px 16px;
  border-radius: var(--radius);
  color: var(--text);
}

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

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel,
.source-card,
.stat,
.table-shell,
.captcha-box {
  margin: 4px 0 2px;
  min-height: 66px;
}
.captcha-box:empty { min-height: 0; }

.panel,
.source-card,
.stat,
.table-shell,
.captcha-box,
.auth-box {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(43, 212, 217, 0.08), transparent 34px) top left / 100% 2px no-repeat,
    linear-gradient(180deg, rgba(16, 31, 38, 0.94), rgba(9, 18, 22, 0.94));
  box-shadow: var(--shadow);
}

/* Un captcha vacio no debe dibujar una tarjeta */
.captcha-box:empty {
  border: 0;
  background: none;
  box-shadow: none;
}

.panel::after,
.source-card::after,
.stat::after,
.table-shell::after,
.auth-box::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px rgba(101, 210, 110, 0.55);
}

.panel {
  padding: clamp(16px, 3vw, 24px);
}

/* ─── Glow-up visual (tarjetas, iconos, chips, botones) ───────────────────── */
.panel,
.source-card,
.stat,
.stat-chip {
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.panel:hover,
.source-card:hover,
.stat:hover {
  transform: translateY(-3px);
  border-color: rgba(43, 212, 217, 0.5);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.34), 0 0 30px rgba(43, 212, 217, 0.12);
}

/* Tarjetas de features con icono tech */
.feature-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  font-size: 1.45rem;
  line-height: 1;
  border-radius: 13px;
  border: 1px solid rgba(43, 212, 217, 0.35);
  background: radial-gradient(120% 120% at 30% 20%, rgba(43, 212, 217, 0.22), rgba(43, 212, 217, 0.04));
  box-shadow: 0 0 22px rgba(43, 212, 217, 0.18), inset 0 0 14px rgba(43, 212, 217, 0.1);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.feature-card:hover .feature-icon {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 0 32px rgba(43, 212, 217, 0.34), inset 0 0 16px rgba(43, 212, 217, 0.14);
}

/* Chips de estadísticas: números neón + hover */
.stat-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(43, 212, 217, 0.5);
  box-shadow: 0 0 26px rgba(43, 212, 217, 0.18);
}
.stat-chip .stat-val {
  text-shadow: 0 0 16px rgba(43, 212, 217, 0.4);
}

/* Eyebrow con guion tech */
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 2px;
  margin-right: 9px;
  vertical-align: middle;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

/* Botones con glow al pasar el cursor */
.button,
button {
  transition: transform 0.18s ease, box-shadow 0.22s ease, filter 0.2s ease, border-color 0.2s ease;
}
.button:hover,
button:hover {
  transform: translateY(-1px);
}
.button:hover,
button.primary:hover {
  box-shadow: 0 0 22px rgba(43, 212, 217, 0.42);
  filter: brightness(1.05);
}
.button.secondary:hover,
button.secondary:hover {
  border-color: rgba(43, 212, 217, 0.45);
  box-shadow: 0 0 18px rgba(43, 212, 217, 0.12);
}
.button.warning:hover {
  box-shadow: 0 0 20px rgba(244, 189, 79, 0.32);
}
@media (prefers-reduced-motion: reduce) {
  .panel, .source-card, .stat, .stat-chip, .feature-icon, .button, button { transition: none; }
  .panel:hover, .source-card:hover, .stat:hover, .stat-chip:hover, .button:hover, button:hover { transform: none; }
}

.stat {
  padding: 18px;
}

.stat strong {
  display: block;
  font-size: 1.8rem;
  color: var(--primary);
}

.source-card {
  min-height: 238px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.source-finder {
  margin: 22px 0;
}

.source-searchbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 16px;
}

.source-filterbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.source-search-field input {
  min-height: 52px;
  font-size: 1rem;
}

.source-disclaimer {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}

.source-disclaimer strong {
  color: var(--text);
}

.source-hint {
  margin: 0;
  color: var(--muted);
  padding: 14px 0;
}

/* Selector compuesto para ganar al display:grid de .catalog-toolbar y que el
   input + boton llenen el recuadro centrado (sin 3a columna vacia). */
.catalog-toolbar.sources-search-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin: 20px auto 0;
  max-width: 720px;
}

.sources-search-bar .field {
  flex: 1 1 260px;
  min-width: 0;
}

.sources-search-bar .sources-search-btn {
  flex: 0 0 auto;
}

.sources-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.sources-results-shell {
  margin-top: 18px;
  min-height: 40px;
  width: 100%;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.source-hint {
  text-align: center;
  padding: 20px 0;
  color: var(--muted);
}

/* PSE: usar ancho completo y centrar contenido */
.sources-results-shell .gsc-control-cse,
.sources-results-shell .gcse-searchresults-only {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

.sources-results-shell .gsc-results-wrapper-overlay,
.sources-results-shell .gsc-results-wrapper-nooverlay {
  position: static !important;
  box-shadow: none !important;
  background: transparent !important;
  width: 100% !important;
  max-width: 100% !important;
}

.sources-results-shell .gsc-results {
  width: 100% !important;
  padding: 0 !important;
}

.sources-results-shell .gs-result .gs-title a {
  color: var(--primary) !important;
}

.sources-results-shell .gsc-cursor-box {
  text-align: center !important;
  margin: 16px 0 !important;
}

.sources-results-shell .gsc-results .gsc-cursor-box .gsc-cursor-page {
  color: var(--primary) !important;
}

.permission-checklist ul {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.6;
}

.permission-checklist strong {
  color: var(--text);
}

.source-card p {
  margin: 0;
}

.source-result-card {
  min-height: 270px;
}

.source-result-head {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: start;
}

.source-thumb {
  width: 58px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(43, 212, 217, 0.42);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(43, 212, 217, 0.18), rgba(160, 108, 255, 0.16)),
    #071013;
  color: var(--primary);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-weight: 900;
}

.source-domain {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
}

.source-empty-state {
  grid-column: 1 / -1;
  min-height: 150px;
}

.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.6fr) auto;
  gap: 10px;
  align-items: end;
  margin: 22px 0;
}

.catalog-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 14px;
  margin: 22px 0;
}

.catalog-system-group {
  margin-bottom: 32px;
}

.catalog-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.catalog-group-title {
  margin: 0;
  font-size: 1rem;
  color: var(--primary);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.catalog-group-search {
  white-space: nowrap;
  font-size: .8rem;
  padding: 5px 10px;
}

.game-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 14px;
}

.game-card {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
  min-height: 230px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background:
    linear-gradient(90deg, rgba(43, 212, 217, 0.08), transparent 34px) top left / 100% 2px no-repeat,
    rgba(10, 22, 27, 0.92);
  box-shadow: var(--shadow);
}

.game-cover {
  min-height: 150px;
  display: grid;
  place-items: center;
  align-self: stretch;
  border: 1px solid rgba(43, 212, 217, 0.42);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, rgba(43, 212, 217, 0.18), rgba(160, 108, 255, 0.18)),
    #071013;
  background-size: 12px 12px, auto, auto;
  color: var(--primary);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 1.5rem;
  font-weight: 900;
}

.game-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
}

.igdb-credit {
  margin: 0 0 14px;
  font-size: .82rem;
  color: var(--muted);
}

.igdb-credit a {
  color: var(--primary);
}

.game-card-body {
  display: grid;
  align-content: start;
  gap: 10px;
}

.game-card-body p {
  margin: 0;
}

/* /catalog: tarjetas compactas (≈mitad de alto) — SOLO en esta sección
   (.catalog-page). El resto de .game-card conserva su caja. */
.catalog-page .game-card {
  min-height: 0;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}
.catalog-page .game-cover {
  min-height: 112px;
  font-size: 1.05rem;
}
.catalog-page .game-card-body {
  gap: 6px;
}
.catalog-page .game-card-body h3 {
  font-size: .98rem;
  line-height: 1.25;
}
.catalog-page .game-card-body p {
  font-size: .82rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.catalog-page .game-card .actions {
  margin-top: 4px;
  gap: 8px;
}
.catalog-page .game-card .actions .button {
  padding: .28rem .55rem;
  font-size: .76rem;
}
/* Botón de borrar (admin) en la esquina de la tarjeta */
.catalog-page .game-card { position: relative; }
.cat-del-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid rgba(255, 90, 90, .5);
  background: rgba(30, 10, 12, .82);
  color: #ff8a8a;
  border-radius: 6px;
  width: 26px;
  height: 26px;
  line-height: 1;
  cursor: pointer;
  font-size: .95rem;
  padding: 0;
  z-index: 2;
}
.cat-del-btn:hover { background: rgba(80, 20, 24, .95); color: #fff; }

.download-card,
.support-card,
.community-post {
  min-height: 210px;
}

.local-emulation-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 99px;
  background: rgba(43, 212, 217, 0.08);
  border: 1px solid rgba(43, 212, 217, 0.25);
  color: var(--primary);
  font-size: .82rem;
  margin-bottom: 12px;
  width: fit-content;
}

.led-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--primary);
  animation: led-pulse 2s ease-in-out infinite;
}

@keyframes led-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.player-form,
.community-form,
.contact-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.community-post-area {
  margin-top: 24px;
}

.community-post-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--primary);
}

.community-form--full {
  max-width: 100%;
}

.community-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 12px;
}

.community-login-notice {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.support-donate-cta {
  margin: 20px 0 32px;
}

/* ── Página de donaciones (PayPal in-page + Binance/cripto) ── */
.support-page { max-width: 960px; margin: 0 auto; }
.support-hero { text-align: center; margin-bottom: 30px; }
.support-hero-badge {
  width: 66px; height: 66px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.9rem;
  background: radial-gradient(circle at 50% 35%, rgba(244, 105, 120, 0.35), rgba(43, 212, 217, 0.12));
  border: 1px solid rgba(244, 105, 120, 0.4);
  box-shadow: 0 0 30px rgba(244, 105, 120, 0.25);
}
.support-hero h2 { margin: 0 0 10px; }
.support-hero .lead { max-width: 620px; margin: 0 auto; }
.support-methods {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 20px; margin-top: 8px; align-items: start;
}
.support-method { display: grid; gap: 12px; }
.support-method-head { display: flex; align-items: center; gap: 10px; }
.support-method-head h3 { margin: 0; }
.support-method-icon { font-size: 1.5rem; }
.support-amounts { display: flex; flex-wrap: wrap; gap: 8px; }
.support-amount {
  min-width: 56px; padding: 8px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04);
  color: var(--text); font-weight: 700; font-size: .9rem;
}
.support-amount:hover { border-color: var(--primary); }
.support-amount.is-active { border-color: var(--primary); background: rgba(43, 212, 217, 0.16); box-shadow: inset 0 -2px 0 var(--primary); }
.support-paypal-slot { min-height: 46px; display: flex; align-items: center; justify-content: center; }
.support-method--paypal { text-align: center; }
.support-method--paypal .support-method-head { justify-content: center; }
.support-method--paypal .support-amounts { justify-content: center; }
.support-secure { margin: 4px 0 0; font-size: .74rem; color: var(--muted); line-height: 1.4; }
/* Tarjeta de patrocinio (apoyo sin dinero): acento verde para distinguirla. */
.support-method--sponsor { border-color: rgba(57, 217, 138, 0.4); background: linear-gradient(180deg, rgba(57, 217, 138, 0.06), transparent 60%); }
.support-sponsor-btn { align-self: flex-start; margin-top: 2px; }
.support-copy-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
}
.support-copy-label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.support-copy-row code { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-size: .85rem; color: var(--primary); }
.support-qr { text-align: center; }
.support-qr img { width: 190px; max-width: 60%; height: auto; border-radius: 12px; background: #fff; padding: 8px; }
.support-wallets { display: grid; gap: 8px; }
.support-thanks { text-align: center; margin-top: 26px; color: var(--muted); }

/* ── Botones de login social ── */
.social-login { display: grid; gap: 10px; margin: 8px 0 4px; }
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 10px; cursor: pointer;
  font-weight: 700; font-size: .9rem; border: 1px solid var(--line);
}
.social-btn img, .social-btn svg { width: 18px; height: 18px; }
.social-btn--google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.social-btn--google:hover { background: #f7f8f8; }
.social-btn--facebook { background: #1877f2; color: #fff; border-color: #1877f2; }
.social-btn--facebook:hover { background: #166fe0; }
.social-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .78rem; margin: 6px 0; }
.social-sep::before, .social-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ── Interruptor (toggle) reutilizable ── */
.switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  position: relative; flex: 0 0 auto; width: 44px; height: 24px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12); border: 1px solid var(--line);
  transition: background .18s ease, border-color .18s ease;
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); transition: transform .18s ease;
}
.switch-input:checked + .switch-track { background: var(--primary); border-color: var(--primary); }
.switch-input:checked + .switch-track .switch-thumb { transform: translateX(20px); }
.switch-input:focus-visible + .switch-track { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ── Medidor de consumo (admin → Noticias) ── */
.usage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; align-items: stretch; }
.usage-tile {
  display: flex; flex-direction: column; gap: 7px; padding: 14px 16px;
  border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line);
}
.usage-label { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.usage-big { font-size: 1.9rem; font-weight: 800; line-height: 1.1; color: var(--text); }
.usage-small { font-size: .95rem; font-weight: 600; color: var(--muted); }
.usage-sub { font-size: .82rem; }
.usage-note { font-size: .74rem; color: var(--muted); line-height: 1.4; }
.usage-bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.usage-bar > div { height: 100%; border-radius: 4px; transition: width .4s ease; }
.usage-tile--posts { align-items: center; justify-content: center; text-align: center; }
.usage-ring {
  width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.45rem; font-weight: 800; color: var(--text);
  border: 4px solid var(--ring, var(--primary)); box-shadow: 0 0 16px rgba(43, 212, 217, 0.18);
}

.player-shell {
  margin-top: 18px;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #050c0f;
  overflow: hidden;
}

.player-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

.player-shell:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

/* Pseudo-fullscreen: fallback para navegadores sin Fullscreen API en divs
   (iOS Safari). Activado por JS con .player-shell--pseudo-fs. */
.player-shell--pseudo-fs {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  border-radius: 0;
}

.player-shell--pseudo-fs .player-frame {
  height: calc(100vh - 56px);
  height: calc(100dvh - 56px);
  min-height: 0;
}

body.player-pseudo-fs {
  overflow: hidden;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 9, 12, 0.94);
}

.player-placeholder {
  min-height: 520px;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

/* Spinner "cargando" dentro del cuadro de emulación (antes del anuncio/emulación)
   para que el cuadro no parezca inactivo mientras el juego descarga/procesa. */
.player-loading {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
}
.player-loading-spinner {
  width: 54px;
  height: 54px;
  border: 5px solid rgba(43, 212, 217, 0.2);
  border-top-color: #2bd4d9;
  border-radius: 50%;
  animation: arkemu-spin 0.8s linear infinite;
  flex-shrink: 0;
}
.player-loading-label {
  margin: 0;
  color: var(--text, #e7eef2);
  font-size: 0.95rem;
  max-width: 440px;
  line-height: 1.4;
}

/* ===== Zonas de anuncios (slots estilo plugin WordPress) ===== */
.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ad-slot[hidden] { display: none; }

.ad-slot--global {
  width: min(1180px, calc(100% - 32px));
  margin: 12px auto 0;
}

.ad-zone-item {
  width: 100%;
  display: flex;
  justify-content: center;
}

.ad-zone-media {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
}

/* ===== Pre-roll publicitario (VAST + fallback) ===== */
.preroll {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 520px;
  background: #04090c;
}

.preroll-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(5, 9, 12, 0.96);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.preroll-tag {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--warning, #f4bd4f);
}

.preroll-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.preroll-mute,
.preroll-skip,
.preroll-link {
  min-height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  background: rgba(43, 212, 217, 0.08);
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.preroll-skip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.preroll-skip:not(:disabled) {
  border-color: var(--primary);
  background: rgba(43, 212, 217, 0.18);
}

.preroll-stage {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  background: #000;
  overflow: hidden;
  min-height: 0;
}

/* Botón "Saltar publicidad" estilo YouTube: esquina inferior derecha del video,
   con cuenta atrás y luego clicable. Coexiste con el de la barra superior. */
.preroll-skip-overlay {
  position: absolute;
  right: 0;
  bottom: 28px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-right: none;
  border-radius: 4px 0 0 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: default;
}

.preroll-skip-overlay.ready {
  cursor: pointer;
  background: rgba(0, 0, 0, 0.82);
  border-color: #fff;
}

.preroll-skip-overlay.ready:hover {
  background: #fff;
  color: #000;
}

.preroll-skip-overlay:disabled {
  opacity: 0.92;
}

.preroll-media {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 70vh;
  object-fit: contain;
  border: 0;
}

img.preroll-media {
  object-fit: contain;
}

.preroll-fallback-text {
  color: var(--muted);
  padding: 40px;
  text-align: center;
}

@media (max-width: 1080px) {
  .preroll,
  .preroll-stage { min-height: 320px; }
  .preroll-media { max-height: 56vh; }
}

.player-frame {
  display: block;
  width: 100%;
  min-height: 520px;
  border: 0;
  background: #050c0f;
}

.player-shell:fullscreen .player-frame {
  height: calc(100vh - 56px);
  height: calc(100dvh - 56px);
  min-height: 0;
}

.player-shell:-webkit-full-screen .player-frame {
  height: calc(100vh - 56px);
  height: calc(100dvh - 56px);
  min-height: 0;
}

/* Controles compactos en pantallas táctiles cuando el juego está a pantalla
   completa: cada pixel de alto cuenta en móvil/tablet. */
@media (max-width: 1080px) {
  .player-shell:fullscreen .player-controls,
  .player-shell:-webkit-full-screen .player-controls,
  .player-shell--pseudo-fs .player-controls {
    min-height: 42px;
    padding: 4px 10px;
    gap: 8px;
  }

  .player-shell:fullscreen .player-controls strong,
  .player-shell:-webkit-full-screen .player-controls strong,
  .player-shell--pseudo-fs .player-controls strong {
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .player-shell:fullscreen .player-frame,
  .player-shell:-webkit-full-screen .player-frame,
  .player-shell--pseudo-fs .player-frame {
    height: calc(100vh - 42px);
    height: calc(100dvh - 42px);
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
}

.modal {
  width: min(540px, 100%);
  border: 1px solid rgba(43, 212, 217, 0.5);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #10222a, #081116);
  padding: 24px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.55);
}

.system-wall {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.system-tile {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 140px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(14, 27, 32, 0.86);
}

.system-art {
  width: 92px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #041114;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--blue));
}

.system-art.warn {
  background: linear-gradient(135deg, var(--amber), var(--violet));
}

/* Logo real de la plataforma (IGDB) dentro del tile de "Historia por consola". */
.system-art .system-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  box-sizing: border-box;
}

/* Icono real del aparato (recorte del póster, PNG transparente). El tile pasa a
   un fondo oscuro sutil para que el aparato (incluidos los negros) resalte. */
.system-art.has-icon {
  background: radial-gradient(circle at 50% 38%, rgba(70, 92, 108, 0.55), rgba(9, 18, 24, 0.94));
  color: transparent;
}
.system-art .system-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  box-sizing: border-box;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.5));
}

.community-shell {
  width: min(1280px, calc(100% - 32px));
}

.community-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
  gap: 18px;
  align-items: stretch;
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(43, 212, 217, 0.08), transparent 55%),
    linear-gradient(180deg, rgba(12, 28, 34, 0.94), rgba(5, 12, 15, 0.96));
  box-shadow: var(--shadow);
}

.community-rules {
  display: grid;
  align-content: center;
  gap: 10px;
}

.community-rules span {
  border-left: 3px solid var(--primary);
  padding: 10px 12px;
  background: rgba(43, 212, 217, 0.075);
  color: var(--muted);
}

.community-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.36fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.community-side {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 96px;
}

.community-board {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(5, 12, 15, 0.7);
  margin-top: 4px;
}

.community-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.community-post {
  min-height: 0;
}

.community-empty {
  min-height: 220px;
  display: grid;
  align-content: center;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.tag.good {
  color: #b8f5bd;
  border-color: rgba(101, 210, 110, 0.55);
  background: rgba(101, 210, 110, 0.08);
}

.tag.warn {
  color: #ffe2a0;
  border-color: rgba(244, 189, 79, 0.55);
  background: rgba(244, 189, 79, 0.08);
}

.help-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 14px;
  margin: 24px 0;
}

.manual-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.manual-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 24px;
  color: var(--muted);
  line-height: 1.65;
}

.manual-steps li::marker {
  color: var(--primary);
  font-weight: 800;
}

.faq-grid {
  margin-top: 18px;
}

/* Guías detalladas (acordeones) en /help */
.help-guides {
  display: grid;
  gap: 10px;
  margin-bottom: 8px;
}
.help-guide {
  border: 1px solid var(--line, rgba(255, 255, 255, 0.09));
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}
.help-guide > summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  transition: background 0.15s ease;
}
.help-guide > summary::-webkit-details-marker { display: none; }
.help-guide > summary::after {
  content: "▸";
  margin-left: auto;
  color: var(--primary, #2bd4d9);
  transition: transform 0.2s ease;
}
.help-guide[open] > summary::after { transform: rotate(90deg); }
.help-guide > summary:hover { background: rgba(43, 212, 217, 0.06); }
.help-guide[open] > summary {
  background: rgba(43, 212, 217, 0.08);
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.09));
}
.help-guide-body {
  padding: 4px 18px 16px;
  color: var(--muted);
  line-height: 1.7;
}
.help-guide-body ol,
.help-guide-body ul { padding-left: 20px; display: grid; gap: 6px; margin: 8px 0; }
.help-guide-body li::marker { color: var(--primary, #2bd4d9); }
.help-guide-body p { margin: 8px 0; }
.help-guide-body strong { color: var(--text, #e8eef2); }
.help-guide-body h4 { margin: 16px 0 6px; color: var(--primary, #2bd4d9); font-size: 0.98rem; }
/* Comandos (curl …) bien diferenciados del texto: bloque monoespaciado oscuro */
.help-guide-body code {
  display: inline-block; max-width: 100%; overflow-x: auto; vertical-align: middle;
  background: #061015; border: 1px solid rgba(43, 212, 217, 0.35); border-radius: 6px;
  padding: 3px 8px; margin: 2px 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.84rem; color: #2bd4d9; white-space: pre; user-select: all;
}
.help-guide-body li code, .help-guide-body p code { line-height: 2; }

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 18px 0 22px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.label {
  color: var(--muted);
  font-size: 0.9rem;
}

.table-shell {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--primary);
  font-size: 0.9rem;
}

.auth-box {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--line);
  background: #030709;
}

.footer p {
  margin: 6px 0 0;
}

.footer .copyright {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

[dir="rtl"] .hero,
[dir="rtl"] .grid {
  direction: rtl;
}

@media (max-width: 920px) {
  .topbar {
    gap: 10px;
    padding-inline: 16px;
  }

  .hero,
  .grid,
  .grid.two,
  .system-wall,
  .help-layout,
  .community-hero,
  .community-layout {
    grid-template-columns: 1fr;
  }

  .community-side {
    position: static;
  }

  .orbital-stage {
    min-height: 320px;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 24px;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .catalog-toolbar,
  .source-filterbar {
    grid-template-columns: 1fr;
  }

  .catalog-summary {
    grid-template-columns: 1fr 1fr;
  }

  .footer {
    flex-direction: column;
  }

  .footer nav {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .brand-mark {
    width: auto;
    height: 40px;
  }
  .brand-name {
    font-size: 18px;
    letter-spacing: 0.5px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .locale-select {
    gap: 4px;
  }

  .locale-label {
    display: none;
  }

  .locale-select select {
    min-height: 38px;
    padding-inline: 8px;
    font-size: 0.84rem;
  }

  .nav-toggle {
    padding: 8px 10px;
  }

  .nav {
    width: min(300px, 90vw);
    padding: 12px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .source-searchbar {
    grid-template-columns: 1fr;
  }

  .catalog-summary,
  .game-card {
    grid-template-columns: 1fr;
  }

  .game-cover {
    min-height: 120px;
  }

  .system-tile {
    grid-template-columns: 72px 1fr;
  }

  .system-art {
    width: 72px;
  }

  .actions .button,
  .actions button {
    width: 100%;
  }

  .player-shell,
  .player-placeholder,
  .player-frame {
    min-height: 360px;
  }
}

/* ===== Google Programmable Search Engine (PSE) ===== */
.gcse-wrapper {
  margin: 22px 0;
}

.gcse-disclaimer {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-left: 4px solid var(--amber);
  background: rgba(244, 189, 79, 0.07);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.gcse-disclaimer strong {
  color: var(--amber);
}

.gsc-control-cse,
.gsc-control-cse * {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace !important;
}

.gsc-control-cse {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.gsc-search-box {
  background: transparent !important;
}

.gsc-input-box {
  background: #081419 !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  overflow: hidden;
}

.gsib_a {
  background: #081419 !important;
}

input.gsc-input {
  background: #081419 !important;
  color: var(--text) !important;
  padding: 12px !important;
}

input.gsc-input::placeholder {
  color: var(--muted) !important;
}

.gsc-search-button .gsc-search-button-v2 {
  background: var(--primary) !important;
  border: none !important;
  border-radius: 0 var(--radius) var(--radius) 0 !important;
  padding: 10px 16px !important;
  cursor: pointer;
}

.gsc-search-button .gsc-search-button-v2 svg path {
  fill: #031316 !important;
}

/* resultados inline — sin overlay flotante */
.gsc-results-wrapper-overlay {
  position: static !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text) !important;
  padding: 0 !important;
  margin: 0 !important;
}

.gsc-results-wrapper-nooverlay {
  background: transparent !important;
  border: none !important;
}

/* eliminar el dimmer/blur que borra la página */
.gsc-modal-background-image,
.gsc-modal-background-image-visible {
  display: none !important;
  opacity: 0 !important;
  backdrop-filter: none !important;
}

/* eliminar el botón de cerrar overlay (no aplica en modo inline) */
.gsc-results-close-btn {
  display: none !important;
}

/* header de resultados */
.gsc-above-wrapper-area {
  background: transparent !important;
  border-bottom: 1px solid var(--line) !important;
  padding: 8px 0 !important;
}

.gsc-above-wrapper-area-container {
  background: transparent !important;
}

/* stats de resultados ("Aprox. X resultados") */
.gsc-result-info,
.gsc-result-info-container {
  color: var(--muted) !important;
  background: transparent !important;
}

/* tabs */
.gsc-tabsArea,
.gsc-tabHeader,
.gsc-tabsAreaInner {
  background: transparent !important;
  border-color: var(--line) !important;
}

.gsc-tabHeader.gsc-tabhActive {
  border-top: 2px solid var(--primary) !important;
  color: var(--primary) !important;
  background: rgba(43, 212, 217, 0.07) !important;
}

/* área de resultados */
.gsc-webResult,
.gsc-results {
  background: transparent !important;
}

.gsc-thumbnail-inside,
.gsc-url-top {
  background: transparent !important;
}

/* miniatura */
.gsc-table-result {
  background: transparent !important;
}

/* barra de ordenamiento */
.gsc-orderby-container,
.gsc-orderby-label {
  color: var(--muted) !important;
  background: transparent !important;
}

.gsc-orderby {
  background: #0b1519 !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
}

/* publicidad — ocultar */
.gsc-adBlock,
.gcse-adsBanner,
.gsc-adBlock * {
  display: none !important;
}

.gs-result {
  border-bottom: 1px solid var(--line) !important;
  padding: 14px 0 !important;
}

.gs-title,
.gs-title * {
  color: var(--primary) !important;
  font-size: 1rem !important;
  text-decoration: none !important;
}

.gs-title:hover {
  text-decoration: underline !important;
}

.gsc-url-top {
  color: var(--muted) !important;
  font-size: 0.84rem !important;
}

.gs-snippet {
  color: var(--muted) !important;
  font-size: 0.9rem !important;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif !important;
  line-height: 1.6 !important;
}

.gsc-cursor-box {
  padding: 16px 0 !important;
}

.gsc-cursor-page {
  color: var(--text) !important;
  background: rgba(43, 212, 217, 0.08) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  padding: 6px 12px !important;
  margin: 0 4px !important;
}

.gsc-cursor-current-page {
  color: #031316 !important;
  background: var(--primary) !important;
}

.gcsc-find-more-on-google {
  color: var(--muted) !important;
}

.gcsc-find-more-on-google-root a {
  color: var(--primary) !important;
}

/* ===== PWA install platform tabs ===== */
.platform-tabs {
  display: grid;
  gap: 8px;
}

.platform-detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.platform-detail-label {
  padding: 13px 18px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.platform-detail-label::-webkit-details-marker { display: none; }

.platform-detail[open] > .platform-detail-label {
  color: var(--primary);
  border-bottom: 1px solid var(--line);
}

.platform-detail-label::before {
  content: "▶";
  font-size: 0.72rem;
  color: var(--muted);
  transition: transform 0.15s;
}

.platform-detail[open] > .platform-detail-label::before {
  transform: rotate(90deg);
  color: var(--primary);
}

.install-steps {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 16px 18px;
}

.install-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--muted);
  line-height: 1.6;
}

.step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--bg);
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 3px;
}

.step-text strong { color: var(--text); }
.step-text em { color: var(--muted); font-style: italic; }

/* permissions list */
.perm-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  line-height: 1.6;
}

.perm-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.perm-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

/* ===== Topbar install button ===== */
.btn-install-topbar {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1.5px solid rgba(43, 212, 217, 0.6);
  background: rgba(43, 212, 217, 0.1);
  color: var(--primary);
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s;
}
.btn-install-topbar:hover {
  background: rgba(43, 212, 217, 0.2);
}
.btn-install-topbar[hidden] { display: none !important; }

/* ===== Install modes grid (/app page) ===== */
.install-modes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}
.install-mode {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.install-mode .actions { margin-top: auto; padding-top: 4px; }
@media (max-width: 640px) {
  .install-modes-grid { grid-template-columns: 1fr; }
}

/* installed panel */
.installed-panel { display: grid; gap: 4px; }

.installed-badge {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.05rem;
}

/* ===== Format guide (ayuda page) ===== */
.format-category {
  margin-bottom: 28px;
}

.format-cat-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fmt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  min-width: 480px;
}

.fmt-table th {
  text-align: left;
  padding: 8px 10px;
  background: rgba(43, 212, 217, 0.08);
  color: var(--primary);
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  white-space: nowrap;
}

.fmt-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(34, 70, 82, 0.5);
  color: var(--muted);
  vertical-align: top;
  line-height: 1.5;
}

.fmt-table tr:last-child td { border-bottom: none; }

.fmt-table td:first-child {
  color: var(--text);
  font-weight: 600;
}

.fmt-ext {
  font-family: monospace;
  font-size: 0.82rem;
  color: var(--violet) !important;
}

.fmt-bios { font-size: 0.82rem; }
.fmt-note { font-size: 0.8rem; }

/* ===== Sistema reqs table ===== */
.sysreq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 520px;
}

.sysreq-table th {
  background: rgba(43, 212, 217, 0.08);
}

.sysreq-table td:first-child {
  color: var(--text);
  font-weight: 700;
}

/* ===== Player below-form fullscreen controls ===== */
.player-below-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(5, 9, 12, 0.85);
}

.player-below-controls strong {
  flex: 1;
  font-size: 0.9rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* ===== Community improved layout ===== */
.community-section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(43, 212, 217, 0.28);
}

.community-section-label h3 {
  font-size: 0.88rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-family: ui-monospace, monospace;
}

/* ===== Knowledge catalog consola view ===== */
.console-history-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(14px, 2.5vw, 22px);
  background: rgba(10, 22, 28, 0.9);
  display: grid;
  gap: 12px;
}

.console-history-card h3 {
  color: var(--primary);
}

.console-history-card p {
  margin: 0;
}

/* ===== Inline player exit/enter buttons ===== */
.player-frame-wrap {
  position: relative;
}

.player-floating-exit {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  opacity: 0.82;
}

.player-floating-exit:hover {
  opacity: 1;
}

/* ===== Console home: stats bar + prompt ===== */
.console-prompt {
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  opacity: 0.85;
  animation: blink-cursor 1.2s step-end infinite;
}

.console-prompt::after {
  content: "▮";
  margin-left: 3px;
  animation: blink-cursor 1.2s step-end infinite;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.console-stats-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 18px;
  border: 1px solid rgba(43, 212, 217, 0.25);
  border-radius: var(--radius);
  background: rgba(43, 212, 217, 0.05);
  min-width: 90px;
}

.stat-chip .stat-val {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--primary);
  font-family: ui-monospace, monospace;
  line-height: 1;
}

.stat-chip .stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* community section on home */
.section.community-section-label {
  display: block;
  border-top: 1px solid var(--line);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) 0;
  text-align: center;
}

.section.community-section-label .actions {
  justify-content: center;
}

.section.community-section-label h3 {
  font-size: clamp(1.2rem, 3vw, 2rem);
  color: var(--text);
  font-family: inherit;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 12px;
}

.section.community-section-label p {
  max-width: 60ch;
  margin: 0 auto 24px;
}

/* ─── Archive Module ──────────────────────────────────────────────────────── */
.source-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.source-card {
  display: flex;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border, var(--line));
  border-radius: 8px;
  padding: 0.875rem;
  /* min-width:0 anula el "automatic minimum size" del grid item: sin esto, el
     ancho INTRÍNSECO de la portada (escaneos de 500-1000px) infla la tarjeta
     en móvil (thumb width:100%) y desborda/deforma la página (2026-07-03). */
  min-width: 0;
}
.source-card-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  background: var(--surface-alt, #0d2028);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.source-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.source-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}
.source-card-name {
  font-size: 0.9rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.source-card-desc {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.actions--compact {
  margin-top: 0.5rem;
  gap: 0.5rem;
}
.actions--compact .button,
.actions--compact button {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}
.archive-status {
  min-height: 1.5rem;
  margin-top: 0.5rem;
}
.archive-results {
  margin-top: 1rem;
}

/* ─── Download Progress Bar ─────────────────────────────────────────────── */
.download-progress {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.download-bar {
  height: 6px;
  background: var(--surface-alt, #0d2028);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border, var(--line));
}
.download-bar-fill {
  height: 100%;
  background: var(--primary, #2bd4d9);
  border-radius: 3px;
  transition: width 0.15s ease;
  min-width: 4px;
}
.download-bar--indeterminate {
  width: 38% !important;
  transition: none;
  animation: progress-indeterminate 1.4s ease-in-out infinite;
}
@keyframes progress-indeterminate {
  0%   { transform: translateX(-160%); }
  100% { transform: translateX(380%); }
}

/* Esqueleto de los chips de peso (Vimm carga el tamaño por tarjeta): pastillas
   pulsando con la misma caja que los chips finales, para que no "salten" al llegar. */
.size-chip-skel {
  display: inline-block;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  animation: chip-pulse 1.2s ease-in-out infinite;
}
@keyframes chip-pulse {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

/* ─── Archive Picker Modal ────────────────────────────────────────────────── */
.modal--wide {
  max-width: 560px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}
.archive-picker-search {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border, var(--line));
  border-radius: 6px;
  background: var(--surface-alt, #0d2028);
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  box-sizing: border-box;
}
.archive-picker-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.archive-picker-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.25rem;
  border-bottom: 1px solid var(--border, var(--line));
}
.archive-picker-list li[hidden] { display: none; }
.archive-picker-name {
  font-size: 0.82rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Archive Pack Notice ─────────────────────────────────────────────────── */
.archive-pack-notice {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  background: var(--surface);
  border: 1px solid var(--border, var(--line));
  border-left: 4px solid var(--primary, #2bd4d9);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  max-width: 420px;
  width: calc(100vw - 2rem);
  animation: slideUp 0.3s ease;
}
.archive-pack-notice-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.archive-pack-notice-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.archive-pack-game {
  font-size: 0.85rem;
  font-weight: 600;
}
.archive-pack-extra {
  font-size: 0.78rem;
  color: var(--muted);
}
.archive-pack-link {
  font-size: 0.78rem;
  color: var(--primary, #2bd4d9);
}
.archive-pack-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@media (max-width: 480px) {
  .source-cards { grid-template-columns: 1fr; }
  .source-card { flex-direction: column; }
  .source-card-thumb { width: 100%; height: 120px; }
}

/* ── Archive source tabs ──────────────────────────────────────────── */
.archive-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border, #1e3040);
  flex-wrap: wrap;
}
.archive-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 0.55rem 1.1rem;
  color: var(--muted, #7eafc8);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.archive-tab:hover { color: var(--text, #edf7f9); }
.archive-tab.active {
  color: var(--accent, #2bd4d9);
  border-bottom-color: var(--accent, #2bd4d9);
}
.archive-tab--closed {
  opacity: 0.45;
  text-decoration: line-through;
  cursor: default;
}
.archive-tab--closed:hover { color: var(--muted, #7eafc8); }
.ext-sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.ext-source-card {
  border: 1px solid var(--border, #1e3040);
  border-radius: 8px;
  padding: 1rem;
  background: var(--card, #0d1f2d);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.ext-source-card h4 { margin: 0; font-size: 0.95rem; color: var(--text, #edf7f9); }
.ext-source-card p { margin: 0; font-size: 0.8rem; color: var(--muted, #7eafc8); }
.ext-source-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 3px;
  padding: 1px 5px;
  background: rgba(43, 212, 217, 0.15);
  color: var(--accent, #2bd4d9);
  display: inline-block;
  margin-bottom: 0.2rem;
}
.ext-source-badge--warn {
  background: rgba(244, 189, 79, 0.15);
  color: var(--warning, #f4bd4f);
}
.ext-source-badge--es {
  background: rgba(244, 79, 79, 0.15);
  color: #f47070;
}
.archive-rar-notice {
  color: var(--muted, #7eafc8);
  font-size: 0.75rem;
  font-style: italic;
}
.source-card-ext {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
  margin: 0;
}
@media (max-width: 480px) {
  .archive-tab { padding: 0.5rem 0.75rem; font-size: 0.8rem; }
}

/* ─── Admin panel ──────────────────────────────────────────────────────────── */
.admin-shell { padding-top: 1.5rem; }
.admin-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.25rem; flex-wrap: wrap; gap: .75rem; }
.admin-tabs { margin-bottom: 1.5rem; flex-wrap: wrap; }
.admin-panel { animation: fadeIn .15s ease; }
.admin-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 1.5rem; }
.admin-charts { margin-bottom: 1.5rem; }
.admin-toolbar { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.admin-search { flex: 1; min-width: 200px; padding: .5rem .75rem; background: var(--surface, #0d2330); border: 1px solid var(--border, #1e4060); border-radius: 6px; color: var(--text, #edf7f9); font-size: .9rem; }
.admin-search:focus { outline: none; border-color: var(--accent, #38bcd8); }
.admin-dialog { border: 1px solid var(--border, #1e4060); border-radius: 10px; background: var(--surface, #0d2330); color: var(--text, #edf7f9); padding: 1.5rem; max-width: 480px; width: 90%; }
.admin-dialog::backdrop { background: rgba(0,0,0,.7); }
.admin-dialog-form h3 { margin: 0 0 1rem; }
.admin-dialog-form .actions { margin-top: 1rem; }
.row-banned td { opacity: .6; }
.row-banned td:nth-child(7) { opacity: 1; }
.tag.bad { background: rgba(220,38,38,.15); color: #f87171; border-color: rgba(220,38,38,.3); }
.tag.warn { background: rgba(234,179,8,.15); color: #fbbf24; border-color: rgba(234,179,8,.3); }
.mono { font-family: monospace; font-size: .82rem; }
.ua { font-size: .78rem; color: var(--muted, #7eafc8); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.button.warn, .warn.small { background: rgba(234,179,8,.15); color: #fbbf24; border: 1px solid rgba(234,179,8,.3); cursor: pointer; }
.button.danger, .danger.small { background: rgba(220,38,38,.15); color: #f87171; border: 1px solid rgba(220,38,38,.3); cursor: pointer; }
.small { padding: .3rem .65rem; font-size: .82rem; border-radius: 5px; }
.dash-welcome { margin-bottom: 1.25rem; }
.dash-welcome h3 { margin: 0 0 .25rem; font-size: 1.25rem; }
.muted { color: var(--muted, #7eafc8); font-size: .9rem; margin: 0; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ─── Blog / Noticias ─────────────────────────────────────────────────────── */

.blog-lang-filter { display: flex; gap: 8px; margin: 0 0 20px; flex-wrap: wrap; }

.blog-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 20px;
}

.blog-card-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: border-color .2s; }
.blog-card-item:hover { border-color: var(--primary); }
.blog-card-link { text-decoration: none; color: inherit; display: block; }
.blog-card-cover { height: 160px; overflow: hidden; background: var(--bg); }
.blog-card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-card-img-placeholder { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, rgba(43,212,217,.18), rgba(160,108,255,.18)); color: var(--primary); font-size: 2.5rem; font-weight: 900; }
.blog-card-body { padding: 14px 16px 16px; }
.blog-card-title { margin: 6px 0 4px; font-size: 1rem; line-height: 1.35; }
.blog-card-sub { margin: 0; font-size: .85rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.blog-pagination { display: flex; gap: 8px; margin-top: 24px; flex-wrap: wrap; }

/* Article view */
.blog-article { max-width: 780px; margin: 0 auto; }
.blog-article-header { margin-bottom: 24px; }
/* max-width:none anula el h1{max-width:12ch} global (que partía el título del
   artículo en una palabra por línea); aquí el título usa el ancho completo. */
.blog-article-title { font-size: clamp(1.5rem, 4vw, 2.2rem); line-height: 1.25; margin: 8px 0 6px; max-width: none; }
.blog-article-sub { font-size: 1.05rem; color: var(--muted); margin: 0 0 8px; }
.blog-featured-figure { margin: 0 0 28px; border-radius: var(--radius); overflow: hidden; }
/* aspect-ratio = la imagen SIEMPRE conserva la proporción 16:9 generada
   (object-fit recorta, nunca estira) en cualquier ancho de pantalla. */
.blog-featured-img { width: 100%; aspect-ratio: 1200 / 630; max-height: 480px; object-fit: cover; display: block; }

.blog-content { line-height: 1.75; font-size: 1rem; }
.blog-content h2 { margin: 32px 0 12px; font-size: 1.35rem; color: var(--primary); }
.blog-content h3 { margin: 24px 0 8px; font-size: 1.1rem; }
.blog-content p { margin: 0 0 16px; }
.blog-content ul, .blog-content ol { margin: 0 0 16px; padding-left: 1.4em; }
.blog-content li { margin-bottom: 6px; }

.blog-body-figure { margin: 28px 0; border-radius: var(--radius); overflow: hidden; }
.blog-body-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }

.blog-yt-block { margin: 28px 0; }

.blog-article-footer { margin-top: 36px; display: flex; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 20px; }

/* Admin blog form */
.admin-blog-gen { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.blog-gen-form { display: grid; gap: 14px; max-width: 640px; }

/* Admin settings panel */
/* auto-FIT (no auto-fill): las columnas vacías colapsan y las secciones se
   expanden a todo el ancho — con auto-fill quedaban huecos fantasma a la
   derecha y Ajustes se veía "cargado a la izquierda". */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 28px; }
.settings-section-title { margin: 0 0 6px; font-size: 1.05rem; color: var(--primary); }
.settings-section-lead { margin: 0 0 16px; font-size: .85rem; color: var(--muted); }
.settings-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; display: grid; gap: 12px; }
.settings-card h4 { margin: 0 0 2px; font-size: .95rem; display: flex; align-items: center; gap: 10px; }
.settings-hint { margin: 0; font-size: .82rem; color: var(--muted); }
.settings-link { font-size: .82rem; color: var(--primary); text-decoration: none; }
.settings-save-bar { margin-top: 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--border); }

/* Spinner para extracción server-side */
@keyframes arkemu-spin {
  to { transform: rotate(360deg); }
}
.srv-wait-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(43, 212, 217, 0.25);
  border-top-color: #2bd4d9;
  border-radius: 50%;
  animation: arkemu-spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* "NO COVER" placeholder: muestra la imagen completa (no recortada) */
.source-card-thumb img[src$="no-cover.svg"] {
  object-fit: contain;
  background: #f3f4f6;
}

/* Botón de eliminar publicación (staff/autor) en la comunidad */
.community-delete {
  border: none;
  cursor: pointer;
  font: inherit;
}

/* ── Badges de logros / metas / puntos ────────────────────────────────── */
.points-summary { margin: 0 0 4px; }
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 7px;
  padding: 14px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.badge-card--earned {
  background: linear-gradient(160deg, rgba(244, 189, 79, 0.16), rgba(43, 212, 217, 0.06));
  border-color: rgba(244, 189, 79, 0.42);
  box-shadow: 0 4px 18px rgba(244, 189, 79, 0.12);
}
.badge-card--earned:hover { transform: translateY(-3px); box-shadow: 0 8px 26px rgba(244, 189, 79, 0.24); }
.badge-card--locked { opacity: 0.62; filter: grayscale(0.45); }
.badge-medal {
  position: relative;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.5), transparent 60%),
    conic-gradient(from 210deg, #f4bd4f, #e2942b, #ffd97a, #e2942b, #f4bd4f);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.3), inset 0 -3px 6px rgba(120, 70, 10, 0.35), 0 3px 11px rgba(0, 0, 0, 0.38);
}
.badge-medal-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  filter: drop-shadow(0 1px 1px rgba(120, 70, 10, 0.55));
}
.badge-medal-icon svg { width: 100%; height: 100%; }
/* Cinta inferior: pequeño check (logrado) o candado (bloqueado) */
.badge-medal-check,
.badge-medal-lock {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 21px;
  height: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
}
.badge-medal-check {
  background: #1f9e57;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 0 0 2px rgba(5, 12, 15, 0.9);
}
.badge-medal-lock { background: rgba(5, 12, 15, 0.9); }
.badge-card--locked .badge-medal {
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.22), transparent 60%),
    conic-gradient(from 210deg, #5b6472, #3b4250, #6b7484, #3b4250, #5b6472);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.12), 0 2px 6px rgba(0, 0, 0, 0.3);
}
.badge-card--locked .badge-medal-icon { color: #c3ccd6; opacity: 0.85; filter: none; }

/* Medalla ilustrada (imagen recortada de badges.png): la imagen ES la medalla,
   así que se quita el disco dorado y sus sombras internas. */
.badge-medal--img {
  background: none;
  box-shadow: none;
}
.badge-medal--img .badge-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.45));
}
.badge-card--earned .badge-medal--img { animation: badge-pop 0.45s ease; }
.badge-card--locked .badge-medal--img .badge-img { filter: grayscale(0.9) brightness(0.7); opacity: 0.7; }

/* ── Mensaje de fallo de emulación ───────────────────────────────────────── */
.emu-failure {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: clamp(20px, 5vw, 44px) 18px;
  height: 100%;
  box-sizing: border-box;
  justify-content: center;
}
.emu-failure-icon {
  font-size: 46px;
  line-height: 1;
  filter: drop-shadow(0 0 16px rgba(43, 212, 217, 0.4));
}
.emu-failure h3 { font-size: 1.3rem; color: var(--text, #e8eef2); }
.emu-failure p { margin: 0; max-width: 52ch; }
.emu-failure-reasons {
  text-align: left;
  margin: 4px auto;
  padding-left: 20px;
  max-width: 52ch;
  color: var(--muted);
  line-height: 1.7;
}
.emu-failure-reasons li::marker { color: var(--primary, #2bd4d9); }
.emu-failure-rea { color: var(--text, #e8eef2); font-weight: 600; }
.emu-failure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 6px;
}
.emu-donate-cta {
  margin: 4px auto 2px;
  max-width: 52ch;
  padding: 14px 16px;
  border: 1px solid rgba(244, 189, 79, 0.45);
  border-radius: var(--radius);
  background: radial-gradient(120% 120% at 30% 0%, rgba(244, 189, 79, 0.12), rgba(244, 189, 79, 0.03));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.emu-donate-cta p { margin: 0; color: var(--text, #e8eef2); }

/* Sección /emuladores */
.emu-group-title { margin: 18px 0 4px; color: var(--primary); font-size: 1.05rem; }
.emu-os-row { margin: 6px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.emu-os-badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  border: 1px solid rgba(43, 212, 217, 0.3); background: rgba(43, 212, 217, 0.07);
  font-size: 0.74rem; color: var(--muted);
}
.emu-rec { font-size: 0.74rem; color: #f4bd4f; font-weight: 700; white-space: nowrap; }
.emu-desc { margin: 6px 0 2px; color: var(--muted); font-size: 0.86rem; line-height: 1.4; }

/* Selector de modo de juego (Jugar aquí / Jugar en mi PC) */
.playmode { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 34px 18px; text-align: center; }
.playmode-game { font-size: 1.15rem; font-weight: 800; margin: 0; color: #edf7f9; }
.playmode-sys { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.playmode-q { margin: 0 0 2px; color: var(--muted); }
.playmode-notice {
  width: 100%; max-width: 640px; box-sizing: border-box; text-align: left;
  background: rgba(244, 189, 79, 0.08); border: 1px solid rgba(244, 189, 79, 0.35);
  border-radius: 12px; padding: 14px 16px; font-size: 0.92rem; color: #edf7f9;
}
.playmode-notice .actions { margin: 0; }

/* "Conectando con tu PC…": icono 🖥 con ondas que se expanden (señal hacia el PC) */
.pm-connecting { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 22px 14px; }
.pm-connecting-ico { position: relative; width: 92px; height: 92px; display: flex; align-items: center; justify-content: center; }
.pm-connecting-pc { font-size: 2.6rem; position: relative; z-index: 2; animation: pmBob 1.7s ease-in-out infinite; }
.pm-connecting-wave {
  position: absolute; inset: 0; margin: auto; width: 100%; height: 100%;
  border: 2px solid var(--accent, #3ce0d0); border-radius: 50%; opacity: 0;
  animation: pmWave 1.8s ease-out infinite;
}
.pm-connecting-wave:nth-child(2) { animation-delay: 0.6s; }
.pm-connecting-wave:nth-child(3) { animation-delay: 1.2s; }
.pm-connecting-label { margin: 0; font-weight: 700; color: #edf7f9; }
.pm-connecting-dots::after { content: ""; animation: pmDots 1.4s steps(4, end) infinite; }
@keyframes pmWave { 0% { transform: scale(0.35); opacity: 0.65; } 100% { transform: scale(1); opacity: 0; } }
@keyframes pmBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes pmDots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%, 100% { content: "..."; } }
@media (prefers-reduced-motion: reduce) {
  .pm-connecting-wave, .pm-connecting-pc, .pm-connecting-dots::after { animation: none; }
  .pm-connecting-pc { opacity: 1; }
}
.playmode-options { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; align-items: stretch; width: 100%; max-width: 700px; }
.playmode-btn {
  display: flex; align-items: center; gap: 14px; min-width: 250px; max-width: 320px; flex: 1 1 250px;
  padding: 18px 20px; border-radius: 16px; cursor: pointer; text-align: left; color: #edf7f9;
  border: 1px solid rgba(43, 212, 217, 0.30);
  background: linear-gradient(145deg, rgba(43, 212, 217, 0.10), rgba(43, 212, 217, 0.02));
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background 0.14s ease;
  /* El 2º botón es un <a> (descargar emulador) y el 1º un <button>: igualamos
     tipografía, caja y sin subrayado para que se vean idénticos y alineados. */
  font: inherit; box-sizing: border-box; text-decoration: none; -webkit-appearance: none; appearance: none;
}
.playmode-btn:hover, .playmode-btn:focus { text-decoration: none; }
.playmode-btn:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: 0 10px 26px rgba(43, 212, 217, 0.22); }
.playmode-btn:active { transform: translateY(-1px); }
.playmode-btn--primary {
  border-color: rgba(43, 212, 217, 0.6);
  background: linear-gradient(145deg, rgba(43, 212, 217, 0.22), rgba(43, 212, 217, 0.07));
  box-shadow: 0 6px 20px rgba(43, 212, 217, 0.18);
}
.playmode-ico {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.4rem; background: rgba(43, 212, 217, 0.14); border: 1px solid rgba(43, 212, 217, 0.35);
}
.playmode-btn--primary .playmode-ico { background: rgba(43, 212, 217, 0.26); }
.playmode-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.playmode-txt strong { font-size: 1.05rem; }
.playmode-txt small { color: var(--muted); font-size: 0.8rem; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }
.playmode-hint { margin: 2px 0 0; color: var(--muted); font-size: 0.88rem; max-width: 560px; line-height: 1.45; }
.playmode-hint a { color: var(--primary); }
.playmode-support {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; padding: 11px 24px; border-radius: 999px;
  background: linear-gradient(145deg, #f4bd4f, #e0992c); color: #2a1c00; font-weight: 800; font-size: 0.92rem;
  text-decoration: none; box-shadow: 0 4px 14px rgba(244, 189, 79, 0.28); transition: transform 0.12s, box-shadow 0.12s;
}
.playmode-support:hover { transform: translateY(-2px); box-shadow: 0 7px 20px rgba(244, 189, 79, 0.40); text-decoration: none; }
@media (max-width: 560px) { .playmode-btn { min-width: 100%; max-width: 100%; } }

/* Instalador del Agente (cuando "Jugar en mi PC" no detecta el Agente) */
.pm-install { max-width: 600px; margin: 4px auto 0; text-align: center; }
.pm-install p { margin: 8px 0; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.pm-install p:first-child { color: #d7e6ea; }
.pm-cmd {
  display: block; margin: 6px auto; padding: 11px 14px; max-width: 100%; overflow-x: auto;
  background: #061015; border: 1px solid var(--primary); border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.84rem;
  color: var(--primary); white-space: nowrap; user-select: all; cursor: text;
}
.pm-or { font-size: 0.84rem; }
.pm-or a { color: var(--primary); }
.pm-dl { display: inline-flex; align-items: center; justify-content: center; }
.pm-unins { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 12px; font-size: 0.78rem; color: var(--muted); opacity: 0.85; }
.pm-unins a { color: var(--primary); }
.pm-unins-q { opacity: 0.9; }
.pm-cmd--sm { display: block; padding: 5px 10px; font-size: 0.76rem; white-space: pre; max-width: 100%; overflow-x: auto; }

/* Tarjeta de instalación del Agente (centrada, con iconos y pasos numerados). */
.pm-install--card { max-width: 560px; margin: 0 auto; padding: 10px 6px; text-align: center; }
.pm-install-ico { font-size: 2.7rem; line-height: 1; margin-bottom: 4px; }
.pm-install-title { margin: 0 0 8px; font-size: 1.12rem; color: #eef7f9; }
.pm-install-lead { margin: 0 auto 18px !important; color: var(--muted); max-width: 470px; line-height: 1.5; }
.pm-install-steps { list-style: none; margin: 0 auto; padding: 0; max-width: 490px; text-align: left; display: flex; flex-direction: column; gap: 16px; }
.pm-install-steps > li { display: flex; gap: 11px; align-items: flex-start; }
.pm-step-n { flex: 0 0 auto; width: 25px; height: 25px; border-radius: 50%; background: var(--primary); color: #04181b; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem; margin-top: 1px; }
.pm-cmd-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.pm-cmd-row .pm-cmd { flex: 1 1 200px; margin: 0; min-width: 0; }
.pm-copy { white-space: nowrap; padding: 8px 12px; }
.pm-install-foot { margin: 16px 0 0 !important; font-size: 0.8rem; opacity: 0.8; }

/* Cuadro de estado nativo ("Jugar en mi PC"): descarga/lanzamiento con ruedita,
   % y botón Apoyar. Estados: connecting/downloading/launching/launched/error. */
.native-stage {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center; padding: 36px 20px; max-width: 580px; margin: 0 auto;
}
.native-stage h3 { margin: 0; color: #edf7f9; font-size: 1.25rem; }
.native-stage p { margin: 0; color: var(--muted); line-height: 1.5; max-width: 480px; }
.native-stage .download-bar { width: min(420px, 100%); margin: 2px 0; }
.native-stage-ico { font-size: 2.4rem; line-height: 1; }
.native-stage-label { color: #d7e6ea !important; font-weight: 600; font-size: 1.02rem; }
.native-stage-note { font-size: 0.84rem; opacity: 0.78; }
.native-stage-unins { margin-top: 2px; }
.native-stage--ok h3 { color: #65d26e; }
.native-stage--err h3 { color: #f4bd4f; }

/* Explicación "Jugar Local" en el gate de descarga fallida (toggle). */
.local-explain {
  margin: 14px auto 0; padding: 14px 16px; max-width: 520px; text-align: left;
  background: rgba(43, 212, 217, 0.06); border: 1px solid rgba(43, 212, 217, 0.25);
  border-radius: 8px; font-size: 0.9rem; color: var(--muted);
}
.local-explain p { margin: 0; }
.local-explain ol { padding-left: 20px; display: grid; gap: 7px; margin: 8px 0 0; }
.local-explain a { color: var(--primary); }
.local-explain-dl { font-weight: 700; }

/* Toggle que unifica Buscar / Subir en una sola página de Jugar */
.playtabs { display: flex; gap: 10px; margin: 16px 0 8px; flex-wrap: wrap; }
.playtab {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px;
  border: 1px solid rgba(43, 212, 217, 0.30); background: rgba(43, 212, 217, 0.05); color: var(--muted);
  font-weight: 700; text-decoration: none; transition: background 0.14s, border-color 0.14s, color 0.14s, transform 0.1s;
}
.playtab:hover { transform: translateY(-1px); border-color: var(--primary); color: #edf7f9; text-decoration: none; }
.playtab--active { background: var(--primary); border-color: var(--primary); color: #04181b; }
.playtabs-hint { margin: 0 0 12px; color: var(--muted); font-size: 0.9rem; max-width: 720px; line-height: 1.45; }
.playtabs-hint strong { color: #edf7f9; }

/* Nav: "Jugar" se ve IGUAL que los demás botones del menú (sin relleno cian; hereda el
   hover/activo de `.nav a`), pero conserva su 🎮 y, cuando estás en la página, un punto
   VERDE pulsante "estás aquí" que lo distingue. */
.nav .nav-primary-cta { font-weight: 700; }
.nav .nav-primary-cta::before { content: "🎮 "; }
/* Indicador "encendido/apagado" SIEMPRE visible: punto gris tenue (OFF) que se pone
   VERDE pulsante cuando estás en la página de Jugar (ON, "estás aquí"). */
.nav .nav-primary-cta::after {
  content: "";
  display: inline-block; width: 8px; height: 8px; margin-left: 7px;
  border-radius: 50%; background: #58696c; vertical-align: middle;
  transition: background 0.2s, box-shadow 0.2s;
}
.nav .nav-primary-cta.active::after {
  background: #3ce06b;
  box-shadow: 0 0 8px #3ce06b;
  animation: navLiveDot 1.4s ease-in-out infinite;
}
@keyframes navLiveDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.7); }
}
@media (prefers-reduced-motion: reduce) { .nav .nav-primary-cta.active::after { animation: none; } }

/* Banner de mensajes/notificaciones del admin al usuario */
.msg-host { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; flex-direction: column; gap: 8px; padding: 10px; pointer-events: none; }
.msg-banner {
  pointer-events: auto; max-width: 820px; margin: 0 auto; width: 100%;
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  border: 1px solid rgba(43, 212, 217, 0.4); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(16, 31, 38, 0.98), rgba(9, 18, 22, 0.98));
  box-shadow: var(--shadow);
}
.msg-banner-body { flex: 1; }
.msg-banner-body strong { color: var(--primary); }
.msg-banner-body p { margin: 4px 0 8px; color: var(--text, #e8eef2); }
.msg-close { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 1.1rem; }

/* Hero: botón principal "Jugar web" resaltado por encima del resto */
.hero-actions .hero-cta-main {
  font-size: 1rem;
  padding: 13px 26px;
  min-height: 48px;
  background: var(--primary);
  color: #031316;
  font-weight: 900;
  box-shadow: 0 0 26px rgba(43, 212, 217, 0.45);
  animation: hero-cta-pulse 2.6s ease-in-out infinite;
}
.hero-actions .hero-cta-main:hover { transform: translateY(-2px); box-shadow: 0 0 34px rgba(43, 212, 217, 0.6); }
@keyframes hero-cta-pulse {
  0%, 100% { box-shadow: 0 0 22px rgba(43, 212, 217, 0.4); }
  50% { box-shadow: 0 0 34px rgba(43, 212, 217, 0.6); }
}
@media (prefers-reduced-motion: reduce) { .hero-actions .hero-cta-main { animation: none; } }
.badge-card--earned .badge-medal { animation: badge-pop 0.45s ease; }
@keyframes badge-pop {
  0% { transform: scale(0.6) rotate(-12deg); }
  60% { transform: scale(1.12) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}

/* Medallas de ranking del top-3 (oro / plata / bronce) */
.rank-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.82rem;
  color: #1a1205;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35), 0 2px 5px rgba(0, 0, 0, 0.35);
}
.rank-gold { background: radial-gradient(circle at 35% 28%, #fff2c4, #f4bd4f 55%, #d4901f); }
.rank-silver { background: radial-gradient(circle at 35% 28%, #ffffff, #cdd6df 55%, #9aa6b2); }
.rank-bronze { background: radial-gradient(circle at 35% 28%, #ffd9b0, #cd8b4f 55%, #9a5f2c); color: #2a1605; }
.rank-row--1 td { background: rgba(244, 189, 79, 0.08); }
.badge-name { font-size: 0.82rem; line-height: 1.2; }
.badge-bar {
  width: 100%;
  height: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.badge-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #2bd4d9, #f4bd4f);
  transition: width 0.4s ease;
}
.badge-count { font-size: 0.72rem; color: var(--muted, #8a98a6); }
.badge-card--earned .badge-count { color: #f4bd4f; font-weight: 600; }
