/* =========================================================
   Fanzine Runner · estilos
   Capas: video(z1) < canvas(z2) < toast(z9) < overlay(z10)
   ========================================================= */
:root {
  --bg: #0b0d14;
  --unlam: #299F80;
  --unlam-light: #42bfa0;
  --unlam-glow: #5cd4b6;
  --unlam-dark: #1b6d58;
  --accent: #299F80;
  --accent-2: #42bfa0;
  --ink: #f6f3ea;
  --font-ui: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  width: 100dvw;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 20%, #1c2236 0%, var(--bg) 70%);
  color: var(--ink);
  font-family: var(--font-ui);

  /* Bloqueo de gestos / rebotes / zoom / menús contextuales */
  position: fixed;
  inset: 0;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

img { -webkit-user-drag: none; user-select: none; pointer-events: none; }

/* ---------- Canvas del juego ---------- */
#game {
  position: fixed;
  top: 0; left: 0;
  z-index: 2;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  display: block;
  background: #10141e;
  touch-action: none;
  transition: filter 0.25s ease-out;
}

/* Modo Extremo a partir de los 20.000 puntos: colores cambiados a noche neón / inversión arcade */
#game.is-extreme {
  filter: invert(0.92) hue-rotate(190deg) contrast(1.22) saturate(1.3);
  transition: filter 1.6s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  transition: background 0.25s ease-out;
}

body.is-extreme {
  background: radial-gradient(120% 90% at 50% 20%, #2e0d1d 0%, #080309 70%);
  transition: background 1.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@supports (height: 100dvh) {
  #game { height: 100dvh; }
}

/* ---------- Auxiliares ---------- */
#safe-probe {
  position: fixed;
  top: 0; left: 0;
  width: 0; height: 0;
  visibility: hidden;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  pointer-events: none;
}

#toast {
  position: fixed;
  z-index: 9;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 64px);
  transform: translate(-50%, -8px);
  max-width: min(90vw, 420px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(10, 12, 20, .78);
  border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 13px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
#toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Capa de Inicio (Overlay) ---------- */
#overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  align-items: center;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: radial-gradient(circle at 50% 25%, rgba(18, 26, 44, 0.88) 0%, rgba(8, 10, 18, 0.94) 80%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: opacity .32s ease, visibility .32s ease;
}
#overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 840px;
  margin: auto 0;
  gap: 8px;
  text-align: center;
  animation: rise .45s cubic-bezier(.2, .8, .2, 1) both;
}

/* Logo "¡No te rindas!" */
.start__logo {
  margin: 0 auto 8px;
  padding: 0;
  line-height: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}
.start__logo img {
  width: auto;
  max-width: min(88vw, 480px);
  max-height: clamp(68px, 16vh, 135px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 20px rgba(255, 180, 50, 0.35));
  animation: floatLogo 3s ease-in-out infinite alternate;
}

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

/* Contenedor de las dos cabinas arcade gemelas */
.start__cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 20px;
  row-gap: 12px;
  width: 100%;
  align-items: stretch;
}

/* Cabina arcade base (compartida por selector de personaje y ranking) */
.start__card {
  background: linear-gradient(180deg, #10323e 0%, #09212b 60%, #061820 100%);
  padding: 10px 14px 10px;
  border-radius: 14px;
  border: 3px solid #36a49a;
  outline: 2px solid #d4a74b;
  outline-offset: -1px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.75),
              0 0 20px rgba(60, 164, 154, 0.25),
              inset 0 2px 4px rgba(255, 255, 255, 0.2),
              inset 0 -2px 4px rgba(0, 0, 0, 0.5);
  position: relative;
  display: flex;
  flex-direction: column;
}

.start__card--play {
  justify-content: space-between;
}

.start__card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 7px;
  text-align: center;
  min-height: 20px;
}

.start__card-title {
  margin: 0;
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #ffd752;
  text-shadow: 0 2px 0 #583d06, 0 0 12px rgba(255, 215, 82, 0.45);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Selector de personaje */
.start__pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.start__label {
  margin: 0 0 8px;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #8ef8d9;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 0 12px rgba(80, 227, 194, 0.45);
}

.picker {
  display: flex;
  gap: 16px;
  justify-content: center;
}
.picker__btn {
  appearance: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 86px;
  height: 86px;
  padding: 6px;
  border-radius: 18px;
  border: 2.5px solid #235863;
  background: linear-gradient(180deg, #102e3b 0%, #091b24 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65),
              inset 0 1px 0 rgba(255, 255, 255, 0.15),
              inset 0 -3px 0 rgba(0, 0, 0, 0.6);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color .18s ease,
              box-shadow .18s ease,
              background .18s ease;
}

/* Base de escenario / pedestal para el personaje */
.picker__btn::before {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 58px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(80, 227, 194, 0.25) 0%, rgba(80, 227, 194, 0) 75%);
  pointer-events: none;
  transition: background .18s ease, transform .18s ease;
}

.picker__btn img {
  height: 66px;
  width: auto;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.75));
  transition: transform .18s cubic-bezier(0.2, 0.8, 0.2, 1), filter .18s ease;
}

/* Hover: invita a elegir */
.picker__btn:hover {
  border-color: #4edbb7;
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.75),
              0 0 18px rgba(78, 219, 183, 0.35),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.picker__btn:hover img {
  transform: translateY(-2px) scale(1.04);
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.85)) brightness(1.08);
}

.picker__btn:hover::before {
  background: radial-gradient(ellipse at center, rgba(80, 227, 194, 0.45) 0%, rgba(80, 227, 194, 0) 75%);
}

/* Estado Seleccionado: Activo como P1 en arcade */
.picker__btn[aria-pressed="true"] {
  border: 2.5px solid #50e3c2;
  outline: 2px solid #ffd752;
  outline-offset: -1px;
  background: linear-gradient(180deg, #134250 0%, #0b242e 100%);
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.8),
              0 0 24px rgba(80, 227, 194, 0.5),
              inset 0 0 14px rgba(80, 227, 194, 0.35),
              inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.picker__btn[aria-pressed="true"]::before {
  background: radial-gradient(ellipse at center, rgba(80, 227, 194, 0.75) 0%, rgba(255, 215, 82, 0.25) 45%, rgba(80, 227, 194, 0) 75%);
  width: 64px;
  height: 16px;
}

.picker__btn[aria-pressed="true"] img {
  transform: translateY(-3px) scale(1.08);
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.9)) brightness(1.1);
}

/* Indicador estrella dorada en esquina superior del personaje elegido */
.picker__btn[aria-pressed="true"]::after {
  content: '★';
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 11px;
  font-weight: 900;
  color: #ffd752;
  text-shadow: 0 0 8px rgba(255, 215, 82, 0.85), 0 1px 2px rgba(0, 0, 0, 0.9);
  animation: starTwinkle 1.6s ease-in-out infinite;
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.25); }
}

.picker__btn:focus-visible {
  outline: 3px solid #ffd752;
  outline-offset: 3px;
}

/* Botón Comenzar - Arcade tactile push button */
.start__btn {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  margin: 6px auto 4px;
  padding: 12px 42px;
  border-radius: 999px;
  border: 2.5px solid #8ef8d9;
  border-bottom: 5px solid #0b4537;
  font-family: inherit;
  font-size: clamp(16px, 4.5vw, 20px);
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #ffffff;
  background: linear-gradient(180deg, #4edbb7 0%, #20997e 45%, #15735e 100%);
  box-shadow: 0 5px 0 #072a22,
              0 10px 24px rgba(0, 0, 0, 0.65),
              0 0 22px rgba(78, 219, 183, 0.4),
              inset 0 2px 2px rgba(255, 255, 255, 0.75),
              inset 0 -2px 4px rgba(0, 0, 0, 0.35);
  text-shadow: 0 2px 3px rgba(3, 26, 20, 0.9), 0 0 6px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  animation: arcadeStartGlow 1.8s ease-in-out infinite;
  transition: transform .12s cubic-bezier(0.2, 0.8, 0.2, 1),
              filter .15s ease,
              box-shadow .15s ease,
              border-bottom-width .12s ease;
}

/* Icono ▶ dorado brillante en el botón */
.start__btn-icon {
  font-size: 1.05em;
  color: #ffd752;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 8px rgba(255, 215, 82, 0.75);
  display: inline-block;
  transform: translateY(-0.5px);
  transition: transform .15s ease;
}

.start__btn:hover {
  filter: brightness(1.12);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 7px 0 #072a22,
              0 14px 30px rgba(0, 0, 0, 0.75),
              0 0 32px rgba(78, 219, 183, 0.65),
              inset 0 2px 2px rgba(255, 255, 255, 0.9);
}

.start__btn:hover .start__btn-icon {
  transform: translateY(-0.5px) scale(1.18);
}

/* Efecto pulsador arcade al hacer clic / tap */
.start__btn:active {
  transform: translateY(3px) scale(0.99);
  border-bottom-width: 2px;
  box-shadow: 0 2px 0 #072a22,
              0 4px 12px rgba(0, 0, 0, 0.6),
              inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

@keyframes arcadeStartGlow {
  0%, 100% {
    box-shadow: 0 5px 0 #072a22,
                0 10px 24px rgba(0, 0, 0, 0.65),
                0 0 20px rgba(78, 219, 183, 0.35),
                inset 0 2px 2px rgba(255, 255, 255, 0.75);
  }
  50% {
    box-shadow: 0 5px 0 #072a22,
                0 12px 28px rgba(0, 0, 0, 0.75),
                0 0 32px rgba(78, 219, 183, 0.65),
                inset 0 2px 3px rgba(255, 255, 255, 0.95);
  }
}

#overlay.is-loading .start__btn {
  animation: none;
  color: #aab3c5;
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .2);
  border-bottom-width: 2.5px;
  box-shadow: none;
  cursor: wait;
}

/* Hint del tero (estilo arcade refinado - integrado en la cabina izquierda) */
.start__hint-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(13, 33, 44, 0.88);
  border: 1.5px solid rgba(45, 184, 170, 0.65);
  border-radius: 999px;
  padding: 5px 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 6px auto 0;
}
.start__hint-arrow {
  color: #4ee3cf;
  font-weight: 900;
  font-size: 15px;
  line-height: 1;
}
.start__hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(246, 243, 234, .95);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .85);
  letter-spacing: .02em;
}
.start__hint b {
  color: #ffffff;
  font-weight: 700;
}
.start__hint b.highlight-tero {
  color: #4ee3cf;
  font-weight: 800;
}

/* Ranking Global - Estilo Arcade Steampunk (Cabina derecha) */
.scores {
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

/* Tornillos / Remaches dorados en las 4 esquinas */
.scores__bolt {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0%, #ffd34d 40%, #c4962c 70%, #4a340b 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.8);
  z-index: 2;
}
.scores__bolt::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.5px;
  height: 2.5px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #2a1c06;
}
.scores__bolt--tl { top: 4px; left: 4px; }
.scores__bolt--tr { top: 4px; right: 4px; }
.scores__bolt--bl { bottom: 4px; left: 4px; }
.scores__bolt--br { bottom: 4px; right: 4px; }

.scores__header-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 7px;
  text-align: center;
}

.scores__title {
  margin: 0;
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #ffd752;
  text-shadow: 0 2px 0 #583d06, 0 0 12px rgba(255, 215, 82, 0.45);
  display: flex;
  align-items: center;
  gap: 5px;
}
.scores__title-star {
  color: #4ef0d5;
  filter: drop-shadow(0 0 6px rgba(78, 240, 213, 0.7));
  font-size: 12px;
}

/* Indicador de sincronización en tiempo real */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: ui-monospace, 'Cascadia Mono', 'Consolas', monospace;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(0, 230, 118, 0.14);
  border: 1px solid rgba(0, 230, 118, 0.55);
  color: #5ef7ad;
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.25);
}
.live-pill[data-state="live"],
.live-pill[data-state="ok"] {
  animation: livePulse 2.2s ease-in-out infinite;
}
.live-pill[data-state="loading"] {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.4);
  color: #cbd5e1;
}
.live-pill[data-state="offline"] {
  background: rgba(255, 170, 85, 0.16);
  border-color: rgba(255, 170, 85, 0.5);
  color: #ffba70;
}

@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 6px rgba(0, 230, 118, 0.2); }
  50% { box-shadow: 0 0 14px rgba(0, 230, 118, 0.55); }
}

.scores__personal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(14, 45, 56, 0.92) 0%, rgba(7, 26, 33, 0.92) 100%);
  border: 1.5px solid #e5b342;
  border-radius: 10px;
  padding: 5px 12px;
  margin: 0 0 6px;
  box-shadow: inset 0 0 10px rgba(229, 179, 66, 0.25), 0 2px 8px rgba(0, 0, 0, 0.5);
}
.scores__personal-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  gap: 5px;
}
.scores__personal-label .star {
  color: #ffd752;
  font-size: 11px;
}
.scores__personal-pts {
  font-family: ui-monospace, 'Cascadia Mono', 'Consolas', monospace;
  font-size: 15.5px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
  color: #ffd752;
  text-shadow: 0 0 10px rgba(255, 215, 82, 0.55), 0 1px 2px rgba(0, 0, 0, 0.8);
}

.scores__cols-head {
  display: grid;
  grid-template-columns: 3.1em 1fr auto;
  padding: 2px 6px 3px;
  font-family: ui-monospace, 'Cascadia Mono', 'Consolas', monospace;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .14em;
  color: #64f0d6;
  border-bottom: 1px solid rgba(75, 180, 175, 0.28);
  text-align: left;
}
.scores__cols-head span:last-child {
  text-align: right;
}

.scores__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 148px;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-family: ui-monospace, 'Cascadia Mono', 'Consolas', monospace;
  font-size: 13px;
  font-weight: 800;
}
.scores__list::-webkit-scrollbar {
  width: 4px;
}
.scores__list::-webkit-scrollbar-thumb {
  background: rgba(80, 227, 194, 0.45);
  border-radius: 999px;
}

.scores__row {
  display: flex;
  align-items: center;
  padding: 4px 6px;
  position: relative;
  border-bottom: 1px solid rgba(75, 180, 175, 0.22);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  border-radius: 5px;
}
.scores__row:last-child {
  border-bottom: none;
}
.scores__row .col-rank {
  width: 2.3em;
  text-align: left;
  opacity: 0.9;
  font-variant-numeric: tabular-nums;
}
.scores__row .col-badge {
  margin-right: 5px;
  font-size: 13px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}
.scores__row .col-name {
  letter-spacing: .16em;
  font-weight: 900;
}
.scores__row .col-live-tag {
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: .06em;
  background: #00e676;
  color: #032215;
  text-shadow: none;
}
.scores__row .col-dots {
  flex: 1;
  border-bottom: 2px dotted rgba(80, 227, 194, 0.3);
  margin: 0 8px;
  height: 1px;
  transform: translateY(-2px);
}
.scores__row .col-pts {
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
  font-weight: 900;
}

.scores__row--rank-1 {
  color: #ffd752;
  text-shadow: 0 0 8px rgba(255, 215, 82, 0.45);
}
.scores__row--rank-2 {
  color: #e2e8f0;
  text-shadow: 0 0 6px rgba(226, 232, 240, 0.35);
}
.scores__row--rank-3 {
  color: #e59a68;
  text-shadow: 0 0 6px rgba(229, 154, 104, 0.35);
}
.scores__row--rank-4,
.scores__row--rank-5 {
  color: #ccebf5;
}

/* Destello neón al entrar una puntuación nueva en tiempo real */
.scores__row.is-live-arrival,
.full-scores-row.is-live-arrival {
  animation: arcadeLiveFlash 1.2s ease-in-out 4;
  background: linear-gradient(90deg, rgba(0, 230, 118, 0.28) 0%, rgba(255, 215, 82, 0.22) 100%) !important;
  border: 1px solid #00e676 !important;
  color: #ffffff !important;
}

@keyframes arcadeLiveFlash {
  0%, 100% { box-shadow: 0 0 6px rgba(0, 230, 118, 0.3); }
  50% { box-shadow: 0 0 18px rgba(0, 230, 118, 0.85), inset 0 0 10px rgba(255, 215, 82, 0.35); }
}

.scores__list li.empty {
  display: block;
  text-align: center;
  color: #9fb0c7;
  font-family: system-ui, -apple-system, sans-serif;
  font-weight: 600;
  padding: 14px 6px;
  font-size: 11.5px;
  line-height: 1.4;
}

.scores__status {
  margin: 4px 0 0;
  font-size: 9.5px;
  color: #8c96ab;
  letter-spacing: .04em;
  min-height: 11px;
}
.scores__status[data-state="offline"] { color: #ffaa55; }
.scores__status[data-state="loading"] { color: #8c96ab; }

/* Botón "Menú" (visible únicamente en Game Over) */
.menu-btn {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 8;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2px solid #36a49a;
  border-bottom: 3.5px solid #0d3830;
  background: linear-gradient(180deg, #123744 0%, #081d26 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 8px 20px;
  border-radius: 999px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, filter .15s ease, border-color .2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.menu-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.menu-btn:hover {
  filter: brightness(1.15);
  border-color: #50e3c2;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7), 0 0 14px rgba(80, 227, 194, 0.35);
  transform: translateX(-50%) scale(1.04);
}
.menu-btn:active {
  transform: translateX(-50%) translateY(2px) scale(0.98);
  border-bottom-width: 1.5px;
}

/* Botón para saltar el tutorial (a la izquierda de la tuerca ⚙) */
.skip-tutorial-btn {
  position: fixed;
  top: calc(max(14px, env(safe-area-inset-top)) + 4px);
  right: calc(max(16px, env(safe-area-inset-right)) + 54px);
  z-index: 50;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2px solid #36a49a;
  border-bottom: 3.5px solid #0d3830;
  background: linear-gradient(180deg, #123744 0%, #081d26 100%);
  color: #8ef8d9;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity .25s ease, transform .25s ease, filter .15s ease, border-color .2s ease, box-shadow .2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.skip-tutorial-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.skip-tutorial-btn:hover {
  filter: brightness(1.15);
  color: #ffffff;
  border-color: #50e3c2;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7), 0 0 14px rgba(80, 227, 194, 0.4);
  transform: translateY(-1px) scale(1.02);
}
.skip-tutorial-btn:active {
  transform: translateY(2px) scale(0.98);
  border-bottom-width: 1.5px;
}

/* Botón de Pantalla Completa */
.fullscreen-btn {
  position: fixed;
  bottom: max(14px, env(safe-area-inset-bottom));
  right: max(14px, env(safe-area-inset-right));
  z-index: 55;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid rgba(66, 191, 160, 0.55);
  background: rgba(11, 13, 20, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.25s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.fullscreen-btn:hover {
  background: rgba(41, 159, 128, 0.35);
  border-color: var(--unlam-light);
  transform: scale(1.08);
}
.fullscreen-btn:active {
  transform: scale(0.92);
}
.fullscreen-btn.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.75);
}
.fullscreen-btn .fs-icon--compress {
  display: none;
}
:fullscreen .fullscreen-btn .fs-icon--expand,
:-webkit-full-screen .fullscreen-btn .fs-icon--expand,
.fullscreen-btn.is-fullscreen .fs-icon--expand {
  display: none !important;
}
:fullscreen .fullscreen-btn .fs-icon--compress,
:-webkit-full-screen .fullscreen-btn .fs-icon--compress,
.fullscreen-btn.is-fullscreen .fs-icon--compress {
  display: block !important;
}

/* ---------- Configuración: tuerca ⚙ + menú desplegable (arriba a la derecha) ---------- */
.settings {
  --gear-size: 44px;
  --gear-top: max(14px, env(safe-area-inset-top));
  --gear-right: max(16px, env(safe-area-inset-right));
  position: fixed;
  top: var(--gear-top);
  right: var(--gear-right);
  z-index: 60;
  font-family: var(--font-ui);
}
.settings__btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--gear-size);
  height: var(--gear-size);
  padding: 0;
  border: 1.5px solid rgba(66, 191, 160, 0.55);
  background: rgba(11, 13, 20, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.settings__btn:hover {
  background: rgba(41, 159, 128, 0.35);
  border-color: var(--unlam-light);
}
.settings__btn:active { transform: scale(0.92); }
.settings__btn:focus-visible {
  outline: 2px solid var(--unlam-glow);
  outline-offset: 3px;
}
.settings__gear { transition: transform 0.45s cubic-bezier(.3, 1.4, .5, 1); }
.settings__btn:hover .settings__gear { transform: rotate(45deg); }
.settings.is-open .settings__btn {
  background: rgba(41, 159, 128, 0.45);
  border-color: var(--unlam-glow);
}
.settings.is-open .settings__gear { transform: rotate(90deg); }

.settings__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(272px, calc(100vw - 32px));
  max-height: calc(100vh - var(--gear-size) - 40px);
  max-height: calc(100dvh - var(--gear-size) - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px 12px;
  border: 1.5px solid rgba(66, 191, 160, 0.55);
  border-radius: 16px;
  background: rgba(11, 13, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.3);
  transform-origin: top right;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px) scale(0.96);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}
.settings.is-open .settings__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
}
.settings__title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--unlam-light);
}
.settings__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}
.settings__label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
}
.settings__value {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: rgba(246, 243, 234, 0.75);
}
.settings__volume {
  display: flex;
  align-items: center;
  gap: 10px;
}
.settings__mute {
  appearance: none;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(66, 191, 160, 0.4);
  border-radius: 10px;
  background: rgba(41, 159, 128, 0.12);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.settings__mute:hover { background: rgba(41, 159, 128, 0.3); border-color: var(--unlam-light); }
.settings__mute:focus-visible { outline: 2px solid var(--unlam-glow); outline-offset: 2px; }
.settings__mute .settings__cross { display: none; }
.settings__mute.is-muted { color: #ff8a8a; border-color: rgba(255, 107, 107, 0.5); background: rgba(255, 107, 107, 0.12); }
.settings__mute.is-muted .settings__waves { display: none; }
.settings__mute.is-muted .settings__cross { display: inline; }

/* Control deslizante de volumen */
.settings__range {
  --fill: 60%;
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 32px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}
.settings__range:focus { outline: none; }
.settings__range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--unlam-light) 0 var(--fill), rgba(255, 255, 255, 0.18) var(--fill) 100%);
}
.settings__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--unlam);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.15s ease;
}
.settings__range:focus-visible::-webkit-slider-thumb,
.settings__range:active::-webkit-slider-thumb {
  box-shadow: 0 0 0 6px rgba(66, 191, 160, 0.3), 0 2px 6px rgba(0, 0, 0, 0.5);
}
.settings__range::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}
.settings__range::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--unlam-light);
}
.settings__range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--unlam);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.settings__row--lang {
  margin-top: 10px;
}
.settings__lang-toggle {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}
.settings__lang-btn {
  flex: 1;
  appearance: none;
  cursor: pointer;
  background: rgba(13, 33, 44, 0.85);
  border: 1.5px solid #235863;
  color: #8ef8d9;
  border-radius: 8px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: all .15s ease;
}
.settings__lang-btn:hover {
  border-color: #50e3c2;
  color: #ffffff;
}
.settings__lang-btn.is-active {
  background: linear-gradient(180deg, #4edbb7 0%, #20997e 100%);
  border-color: #8ef8d9;
  color: #062b20;
  box-shadow: 0 0 10px rgba(78, 219, 183, 0.45);
}

.settings__sep {
  margin: 12px 0 10px;
  border: 0;
  border-top: 1px solid rgba(66, 191, 160, 0.25);
}
.settings__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(135deg, rgba(131, 58, 180, 0.22), rgba(253, 29, 29, 0.16) 55%, rgba(252, 176, 69, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.settings__link:hover {
  border-color: rgba(252, 176, 69, 0.6);
  transform: translateY(-1px);
}
.settings__link:active { transform: scale(0.98); }
.settings__link:focus-visible { outline: 2px solid var(--unlam-glow); outline-offset: 2px; }
.settings__link svg { flex: none; color: #ffb3c7; }
.settings__link-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.settings__link-label {
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(246, 243, 234, 0.7);
}
.settings__link-handle {
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
}
.settings__link-arrow {
  margin-left: auto;
  font-size: 16px;
  opacity: 0.75;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* Monitores de escritorio y tablets en horizontal (alto >= 541px):
   Diseño Gabinete Arcade: Logo arriba destacado y centrado, 2 cabinas arcade gemelas perfectamente balanceadas */
@media (min-width: 580px) and (min-height: 541px) {
  .start {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 820px;
    margin: auto 0;
    gap: 10px;
    padding: 8px 16px;
  }
  .start__logo {
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .start__logo img {
    max-height: clamp(80px, 16vh, 145px);
    max-width: min(88vw, 500px);
    width: auto;
    height: auto;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 24px rgba(255, 180, 50, 0.35));
  }
  .start__cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 22px;
    row-gap: 14px;
    width: 100%;
    max-width: 820px;
    align-items: stretch;
  }
  .start__card {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px 12px;
  }
  .start__card--play {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .scores {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
  }
}

@media (min-width: 600px) and (min-height: 680px) {
  .start__logo img {
    max-height: clamp(100px, 19vh, 175px);
    max-width: min(90vw, 560px);
  }
}

/* Pantallas bajas (celular en horizontal <= 540px de alto):
   Logo arriba y 2 cabinas compactas para que botones y score sean 100% visibles sin scroll */
@media (max-height: 540px) and (min-width: 541px) {
  #overlay {
    padding: max(4px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    display: flex;
    align-items: center;
    justify-content: safe center;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .start {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 700px;
    margin: auto 0;
    gap: 4px;
    padding: 2px 6px;
  }
  .start__logo {
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .start__logo img {
    max-height: min(11vh, 46px);
    max-width: min(75vw, 220px);
    height: auto;
  }
  .start__cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 12px;
    row-gap: 6px;
    width: 100%;
    max-width: 700px;
    align-items: stretch;
  }
  .start__card {
    padding: 6px 10px;
    border-radius: 12px;
    justify-content: space-between;
  }
  .start__card-header {
    margin: 0 0 3px;
  }
  .start__card-title {
    font-size: 10px;
  }
  .start__pick {
    margin: 0;
  }
  .picker {
    gap: 10px;
  }
  .picker__btn {
    width: clamp(42px, 9.5vh, 50px);
    height: clamp(42px, 9.5vh, 50px);
    padding: 2px;
    border-radius: 10px;
  }
  .picker__btn::before {
    width: 30px;
    height: 7px;
    bottom: 3px;
  }
  .picker__btn img {
    height: clamp(32px, 7.5vh, 38px);
  }
  .picker__btn[aria-pressed="true"]::after {
    top: 2px;
    right: 2px;
    font-size: 8px;
  }
  .start__btn {
    padding: 5px 18px;
    font-size: clamp(11.5px, 2.5vh, 13px);
    margin: 3px auto 2px;
    border-bottom-width: 2.5px;
  }
  .start__hint-box {
    padding: 2px 8px;
    margin: 2px auto 0;
  }
  .start__hint {
    font-size: 8.5px;
  }
  .start__hint-arrow {
    font-size: 11px;
  }
  .scores {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 6px 10px;
    border-radius: 12px;
    justify-content: space-between;
  }
  .scores__header-bar {
    margin: 0 0 3px;
  }
  .scores__title {
    font-size: 10px;
    letter-spacing: .09em;
  }
  .live-pill {
    font-size: 7.5px;
    padding: 1px 4px;
  }
  .scores__personal {
    padding: 2px 6px;
    margin: 0 0 3px;
  }
  .scores__personal-label {
    font-size: 8.5px;
  }
  .scores__personal-pts {
    font-size: 11px;
  }
  .scores__cols-head {
    font-size: 8px;
    padding: 1px 4px 2px;
  }
  .scores__list {
    font-size: 10px;
    max-height: 80px;
  }
  .scores__row {
    padding: 2px 4px;
  }
  .scores__row .col-badge {
    font-size: 10px;
    margin-right: 3px;
  }
  .scores__row .col-dots {
    margin: 0 4px;
  }
  .scores__more-btn {
    margin: 3px 0 1px;
    padding: 4px 6px;
    font-size: 9px;
  }
  .scores__status {
    margin-top: 1px;
    font-size: 8px;
  }
  .skip-tutorial-btn {
    font-size: 11px;
    padding: 6px 14px;
    top: calc(max(8px, env(safe-area-inset-top)) + 3px);
    right: calc(max(10px, env(safe-area-inset-right)) + 46px);
  }
  .settings {
    --gear-size: 36px;
    --gear-top: max(8px, env(safe-area-inset-top));
    --gear-right: max(10px, env(safe-area-inset-right));
  }
  .settings__btn svg { width: 19px; height: 19px; }
  .settings__panel {
    top: calc(100% + 6px);
    padding: 10px 14px 10px;
  }
  .settings__title { margin-bottom: 8px; }
  .settings__sep { margin: 8px 0 8px; }
  .fullscreen-btn {
    width: 40px;
    height: 40px;
    bottom: max(8px, env(safe-area-inset-bottom));
    right: max(8px, env(safe-area-inset-right));
  }
}

@media (max-width: 540px) {
  .start {
    display: flex;
    flex-direction: column;
    max-width: 360px;
    margin: auto 0;
    gap: 8px;
  }
  .start__cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  .scores {
    width: 100%;
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .start, .start__logo img, .start__btn { animation: none; }
}

/* ---------- Modal de rotación para celulares (Portrait) ---------- */
.rotate-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 35%, rgba(18, 28, 48, 0.98) 0%, rgba(8, 10, 18, 0.99) 85%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ink);
  text-align: center;
  pointer-events: auto;
  user-select: none;
}

/* Se activa automáticamente en dispositivos táctiles / móviles en vertical */
@media (orientation: portrait) and (max-width: 1024px) {
  .rotate-modal {
    display: flex;
  }
}

.rotate-modal.is-active {
  display: flex !important;
}

.rotate-modal__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 320px;
  gap: 16px;
  animation: rotateModalPop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.rotate-modal__logo {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 240px;
  margin-bottom: 2px;
}

.rotate-modal__logo-img {
  width: 100%;
  max-width: 220px;
  height: auto;
  max-height: 82px;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 16px rgba(41, 159, 128, 0.55));
  animation: rotateLogoPulse 3s ease-in-out infinite alternate;
}

@keyframes rotateLogoPulse {
  0%   { transform: scale(1); filter: drop-shadow(0 4px 14px rgba(0,0,0,0.85)) drop-shadow(0 0 12px rgba(41, 159, 128, 0.4)); }
  100% { transform: scale(1.03); filter: drop-shadow(0 6px 18px rgba(0,0,0,0.95)) drop-shadow(0 0 20px rgba(41, 159, 128, 0.75)); }
}

.rotate-modal__icon {
  width: 104px;
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--unlam-light);
  filter: drop-shadow(0 0 18px rgba(41, 159, 128, 0.55));
}

.rotate-phone-svg {
  animation: phoneRotateAnim 2.6s ease-in-out infinite;
  transform-origin: 50% 50%;
}

.rotate-phone-svg .phone-body {
  fill: rgba(41, 159, 128, 0.18);
  stroke: var(--unlam-light);
  stroke-width: 3.5;
}

.rotate-phone-svg .phone-home,
.rotate-phone-svg .phone-speaker {
  fill: var(--unlam-light);
  stroke: var(--unlam-light);
  stroke-width: 1.5;
}

.rotate-phone-svg .rotate-arrow {
  stroke: #ffffff;
  animation: arrowPulseAnim 2.6s ease-in-out infinite;
}

@keyframes phoneRotateAnim {
  0%, 15%   { transform: rotate(0deg); }
  45%, 72%  { transform: rotate(90deg); }
  92%, 100% { transform: rotate(0deg); }
}

@keyframes arrowPulseAnim {
  0%, 15%   { opacity: 0.35; transform: scale(0.95); }
  45%, 72%  { opacity: 1; transform: scale(1.06); }
  92%, 100% { opacity: 0.35; transform: scale(0.95); }
}

@keyframes rotateModalPop {
  from { opacity: 0; transform: scale(0.9) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.rotate-modal__title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-shadow: 0 0 20px rgba(41, 159, 128, 0.7);
}

.rotate-modal__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #d2dbe0;
}

.rotate-modal__text b {
  color: var(--unlam-light);
}

.rotate-modal__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(41, 159, 128, 0.22);
  border: 1px solid var(--unlam-light);
  color: var(--unlam-light);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(41, 159, 128, 0.25);
}





/* Botón "Ver ranking completo" en la tarjeta de inicio (Referencia Image 3) */
.scores__more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 10px 0 2px;
  padding: 8px 16px;
  background: linear-gradient(180deg, #4edbb7 0%, #20997e 50%, #15735e 100%);
  border: 2px solid #8ef8d9;
  border-bottom: 3.5px solid #0d4a3c;
  border-radius: 12px;
  color: #062b20;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: .10em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .1s ease, filter .15s ease, box-shadow .15s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.scores__more-btn:hover {
  filter: brightness(1.12);
  box-shadow: 0 4px 18px rgba(78, 219, 183, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transform: translateY(-1px);
}
.scores__more-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.scores__more-btn .btn-trophy {
  font-size: 15px;
}

.scores__cabinet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 6px 0 2px;
  width: 100%;
}
.scores__cabinet-actions .scores__more-btn {
  margin: 0;
  padding: 6.5px 6px;
  font-size: 11px;
  white-space: nowrap;
}
.scores__share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  margin: 0;
  padding: 6.5px 6px;
  background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  border: 2px solid #ff85a1;
  border-bottom: 3.5px solid #661033;
  border-radius: 12px;
  color: #ffffff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), 0 0 14px rgba(220, 39, 67, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform .1s ease, filter .15s ease, box-shadow .15s ease;
}
.scores__share-btn:hover {
  filter: brightness(1.15);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7), 0 0 20px rgba(220, 39, 67, 0.55);
  transform: translateY(-1px);
}
.scores__share-btn:active {
  transform: translateY(2px);
  border-bottom-width: 1.5px;
}

.full-scores-modal__personal-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-share-btn {
  padding: 4px 9px;
  background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  border: 1.5px solid #ff85a1;
  border-radius: 8px;
  color: #ffffff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  box-shadow: 0 2px 8px rgba(220, 39, 67, 0.4);
  transition: transform .1s ease, filter .15s ease;
}
.modal-share-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

/* Grupo de botones en Game Over */
.gameover-actions {
  position: fixed;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 8;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  max-width: calc(100vw - 20px);
}
.gameover-actions.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.gameover-actions .menu-btn {
  position: static;
  transform: none !important;
  opacity: 1;
  pointer-events: auto;
}

.menu-btn--restart {
  border: 2px solid #8ef8d9;
  border-bottom: 3.5px solid #093b2f;
  background: linear-gradient(180deg, #4edbb7 0%, #20997e 50%, #15735e 100%);
  color: #05251c;
  font-weight: 900;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65), 0 0 16px rgba(78, 219, 183, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.menu-btn--restart:hover {
  filter: brightness(1.12);
  border-color: #b8ffea;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.75), 0 0 22px rgba(78, 219, 183, 0.65);
}

.menu-btn--share {
  border: 2px solid #ff85a1;
  border-bottom: 3.5px solid #661033;
  background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #ffffff;
  font-weight: 900;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65), 0 0 16px rgba(220, 39, 67, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.menu-btn--share:hover {
  filter: brightness(1.15);
  border-color: #ffaec0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.75), 0 0 22px rgba(220, 39, 67, 0.65);
}

.menu-btn--scores {
  border: 2px solid #ffd752;
  border-bottom: 3.5px solid #583d06;
  background: linear-gradient(180deg, #302611 0%, #171206 100%);
  color: #ffd752;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), 0 0 12px rgba(255, 215, 82, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.menu-btn--scores:hover {
  filter: brightness(1.18);
  border-color: #ffe685;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7), 0 0 18px rgba(255, 215, 82, 0.55);
}

/* Modal Ranking Global Completo (Arcade Retro & Responsive 100% Mobile) */
.full-scores-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.full-scores-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.full-scores-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 14, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.full-scores-modal__content {
  position: relative;
  z-index: 1;
  width: min(94vw, 420px);
  max-height: min(88dvh, calc(100vh - 24px));
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: linear-gradient(180deg, #10323e 0%, #09212b 60%, #061820 100%);
  border: 2.5px solid #36a49a;
  outline: 2px solid #d4a74b;
  outline-offset: -1px;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85), 0 0 24px rgba(54, 164, 154, 0.3);
  overflow: hidden;
  transform: scale(0.96);
  transition: transform .22s cubic-bezier(0.16, 1, 0.3, 1);
}
.full-scores-modal.is-open .full-scores-modal__content {
  transform: scale(1);
}

.full-scores-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 8px;
  border-bottom: 1px solid rgba(75, 180, 175, 0.25);
  background: rgba(14, 45, 56, 0.4);
}
.full-scores-modal__title-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.full-scores-modal__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.full-scores-modal__title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: .14em;
  color: #ffd752;
  text-shadow: 0 1px 0 #583d06, 0 0 10px rgba(255, 215, 82, 0.4);
}
.full-scores-modal__subtitle {
  font-size: 10px;
  color: #8ef8d9;
  font-weight: 700;
  letter-spacing: .04em;
}
.full-scores-modal__close {
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: background .18s, transform .15s, border-color .18s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.full-scores-modal__close:hover {
  background: rgba(255, 85, 85, 0.4);
  border-color: #ff6b6b;
  transform: scale(1.08);
}
.full-scores-modal__close:active {
  transform: scale(0.92);
}

.full-scores-modal__personal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 14px 6px;
  padding: 5px 12px;
  background: linear-gradient(180deg, rgba(14, 45, 56, 0.92) 0%, rgba(7, 26, 33, 0.92) 100%);
  border: 1.5px solid #e5b342;
  border-radius: 9px;
  box-shadow: inset 0 0 8px rgba(229, 179, 66, 0.2);
}
.full-scores-modal__personal-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.full-scores-modal__personal-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #ffffff;
}
.full-scores-modal__personal-rank {
  font-size: 10px;
  color: #ffd752;
  font-weight: 800;
}
.full-scores-modal__personal-pts {
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
  color: #ffd752;
  text-shadow: 0 0 8px rgba(255, 215, 82, 0.5);
}

.full-scores-modal__table-header {
  display: grid;
  grid-template-columns: 4.3em 1fr auto;
  gap: 8px;
  padding: 5px 18px;
  font-family: ui-monospace, 'Cascadia Mono', 'Consolas', monospace;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
  color: #64f0d6;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(75, 180, 175, 0.25);
}
.full-scores-modal__table-header .col-pts {
  text-align: right;
}

.full-scores-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(45vh, 260px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
  padding: 4px 12px 6px;
}
.full-scores-modal__body::-webkit-scrollbar {
  width: 5px;
}
.full-scores-modal__body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
.full-scores-modal__body::-webkit-scrollbar-thumb {
  background: rgba(66, 191, 160, 0.5);
  border-radius: 999px;
}

.full-scores-modal__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.full-scores-row {
  display: grid;
  grid-template-columns: 4.3em 1fr auto;
  gap: 8px;
  padding: 4px 7px;
  font-family: ui-monospace, 'Cascadia Mono', 'Consolas', monospace;
  font-size: 12.5px;
  font-weight: 800;
  border-radius: 6px;
  border-bottom: 1px solid rgba(75, 180, 175, 0.15);
  align-items: center;
  color: #ccebf5;
}
.full-scores-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}
.full-scores-row .col-rank {
  font-size: 11px;
  opacity: 0.92;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.full-scores-row .col-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: .16em;
  font-weight: 900;
}
.full-scores-row .col-live-tag {
  letter-spacing: .06em;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 8.5px;
  font-weight: 900;
  background: #00e676;
  color: #032215;
  text-shadow: none;
}
.full-scores-row .col-time {
  letter-spacing: .02em;
  font-size: 9px;
  font-weight: 700;
  color: rgba(148, 163, 184, 0.8);
}
.full-scores-row .col-pts {
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
  font-weight: 900;
  text-align: right;
}

.full-scores-row.is-rank-1 {
  color: #ffd752;
  background: rgba(255, 215, 82, 0.14);
  border-color: rgba(255, 215, 82, 0.4);
  text-shadow: 0 0 8px rgba(255, 215, 82, 0.4);
}
.full-scores-row.is-rank-2 {
  color: #e2e8f0;
  background: rgba(226, 232, 240, 0.10);
  border-color: rgba(226, 232, 240, 0.3);
}
.full-scores-row.is-rank-3 {
  color: #e59a68;
  background: rgba(229, 154, 104, 0.10);
  border-color: rgba(229, 154, 104, 0.3);
}
.full-scores-row.is-top5 {
  color: #8ef8d9;
}
.full-scores-row.is-new {
  border: 1.5px solid #50e3c2;
  background: rgba(80, 227, 194, 0.25);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(80, 227, 194, 0.35);
}
.full-scores-row.is-empty {
  display: block;
  text-align: center;
  color: #8c96ab;
  padding: 14px 0;
  font-size: 11.5px;
}

.full-scores-modal__footer {
  display: flex;
  justify-content: center;
  padding: 6px 14px 8px;
  border-top: 1px solid rgba(75, 180, 175, 0.2);
  background: rgba(14, 45, 56, 0.3);
}
.full-scores-modal__btn {
  appearance: none;
  background: linear-gradient(180deg, #4edbb7 0%, #20997e 50%, #15735e 100%);
  border: 1.5px solid #8ef8d9;
  border-bottom: 2.5px solid #0d4a3c;
  color: #062b20;
  padding: 5px 24px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: filter .15s, transform .12s;
}
.full-scores-modal__btn:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}
.full-scores-modal__btn:active {
  transform: translateY(1px);
  border-bottom-width: 1px;
}

/* Pantallas de celular bajas / horizontales (Landscape y pantallas < 540px de alto) */
@media (max-height: 540px) {
  .full-scores-modal {
    padding: max(4px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }
  .full-scores-modal__content {
    width: min(94vw, 540px);
    max-height: min(94dvh, calc(100vh - 10px));
    border-radius: 12px;
  }
  .full-scores-modal__header {
    padding: 5px 12px 4px;
  }
  .full-scores-modal__title {
    font-size: 12px;
  }
  .full-scores-modal__subtitle {
    font-size: 9px;
  }
  .full-scores-modal__close {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    font-size: 12px;
  }
  .full-scores-modal__personal {
    margin: 3px 10px 2px;
    padding: 3px 8px;
  }
  .full-scores-modal__personal-label {
    font-size: 9px;
  }
  .full-scores-modal__personal-rank {
    font-size: 9.5px;
  }
  .full-scores-modal__personal-pts {
    font-size: 12px;
  }
  .full-scores-modal__table-header {
    display: none !important;
  }
  .full-scores-modal__body {
    max-height: none;
    min-height: 0;
    padding: 3px 10px 5px;
  }
  .full-scores-modal__list {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 3px 8px !important;
  }
  .full-scores-row {
    padding: 2px 5px;
    font-size: 10px;
    border-radius: 5px;
  }
  .full-scores-row.is-empty {
    grid-column: 1 / -1 !important;
  }
  .full-scores-modal__footer {
    display: none !important;
  }

  /* Game Over: botones inferiores compactos en mobile horizontal */
  .gameover-actions {
    bottom: max(6px, env(safe-area-inset-bottom));
    gap: 6px;
    width: auto;
    max-width: calc(100vw - 16px);
  }
  .gameover-actions .menu-btn {
    padding: 5px 10px;
    font-size: 10.5px;
    white-space: nowrap;
  }

  /* Botones en cabina de ranking pantalla de inicio */
  .scores__cabinet-actions {
    gap: 5px;
    margin: 3px 0 1px;
  }
  .scores__cabinet-actions .scores__more-btn,
  .scores__share-btn {
    padding: 4px 6px;
    font-size: 9.5px;
  }
}

/* Pantallas de celular angostas / verticales (Portrait < 540px) */
@media (max-width: 540px) and (min-height: 541px) {
  .full-scores-modal__content {
    width: min(92vw, 340px);
    max-height: min(84dvh, calc(100vh - 28px));
  }
  .full-scores-modal__header {
    padding: 8px 12px 6px;
  }
  .full-scores-modal__title {
    font-size: 12.5px;
  }
  .full-scores-modal__personal {
    margin: 5px 8px 4px;
    padding: 4px 8px;
  }
  .full-scores-modal__table-header {
    padding: 3px 10px;
    font-size: 9px;
  }
  .full-scores-modal__body {
    padding: 3px 8px 4px;
    max-height: calc(84dvh - 130px);
  }
  .full-scores-row {
    padding: 3px 4px;
    font-size: 11px;
  }
}

/* ============================================================================
 * NOTIFICACIÓN DE NUEVO RÉCORD (DESHABILITADA POR PREFERENCIA DEL USUARIO)
 * ============================================================================ */
.live-score-banner {
  display: none !important;
}

/* ============================================================================
 * MODAL ARCADE INTERACTIVO DE INGRESO DE 3 INICIALES (A-Z, 0-9)
 * ============================================================================ */
.arcade-entry-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.arcade-entry-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.arcade-entry-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 14, 0.85);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.arcade-entry-modal__cabinet {
  position: relative;
  z-index: 1;
  width: min(94vw, 430px);
  max-height: min(94dvh, calc(100vh - 16px));
  overflow-y: auto;
  background: linear-gradient(180deg, #10323e 0%, #09212b 58%, #061820 100%);
  border: 3px solid #36a49a;
  outline: 2px solid #d4a74b;
  outline-offset: -1px;
  border-radius: 16px;
  padding: 18px 20px 16px;
  text-align: center;
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.88),
              0 0 28px rgba(54, 164, 154, 0.35),
              inset 0 2px 4px rgba(255, 255, 255, 0.2);
  transform: scale(0.95) translateY(8px);
  transition: transform .22s cubic-bezier(0.16, 1, 0.3, 1);
}
.arcade-entry-modal.is-open .arcade-entry-modal__cabinet {
  transform: scale(1) translateY(0);
}

.arcade-entry-modal__badge {
  margin: 0 0 10px;
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: #64f0d6;
  text-shadow: 0 2px 0 #072822, 0 0 12px rgba(100, 240, 214, 0.55);
}
.arcade-entry-modal__badge.is-gold {
  color: #ffd752;
  text-shadow: 0 2px 0 #583d06, 0 0 14px rgba(255, 215, 82, 0.65);
}

.arcade-entry-modal__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 10px;
}
.arcade-stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(5, 16, 22, 0.78);
  border: 1.5px solid rgba(80, 227, 194, 0.35);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.55);
}
.arcade-stat-pill--rank {
  border-color: rgba(255, 215, 82, 0.55);
  background: rgba(28, 22, 8, 0.55);
}
.arcade-stat-pill__label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .12em;
  color: #9fb4c7;
  text-transform: uppercase;
}
.arcade-stat-pill__val {
  font-family: ui-monospace, 'Cascadia Mono', 'Consolas', monospace;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.35);
}
.arcade-stat-pill--rank .arcade-stat-pill__val {
  color: #ffd752;
  text-shadow: 0 0 10px rgba(255, 215, 82, 0.55);
}

.arcade-entry-modal__inst {
  margin: 0 0 10px;
  font-size: 11.5px;
  color: #d1e6ee;
  line-height: 1.35;
}
.arcade-entry-modal__inst b {
  color: #ffd752;
}

.arcade-slots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 0 10px;
}
.arcade-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.arcade-slot__arrow {
  appearance: none;
  width: 64px;
  height: 34px;
  border-radius: 9px;
  border: 1.5px solid rgba(100, 240, 214, 0.45);
  border-bottom: 3px solid #072822;
  background: linear-gradient(180deg, #174656 0%, #0d2c37 100%);
  color: #8ef8d9;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform .08s ease, filter .12s ease, border-color .15s ease;
}
.arcade-slot__arrow:hover {
  filter: brightness(1.18);
  border-color: #64f0d6;
}
.arcade-slot__arrow:active {
  transform: translateY(2px);
  border-bottom-width: 1.5px;
}

.arcade-slot__char {
  appearance: none;
  width: 68px;
  height: 72px;
  border-radius: 12px;
  border: 2.5px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(180deg, #071922 0%, #040e14 100%);
  color: #e2f1f8;
  font-family: ui-monospace, 'Cascadia Mono', 'Consolas', monospace;
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.85), 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: border-color .15s ease, box-shadow .15s ease, color .15s ease, transform .12s ease;
}
.arcade-slot.is-active .arcade-slot__char {
  border-color: #00e676;
  color: #ffd752;
  text-shadow: 0 0 14px rgba(255, 215, 82, 0.7);
  box-shadow: inset 0 0 14px rgba(0, 230, 118, 0.28), 0 0 18px rgba(0, 230, 118, 0.55);
  animation: arcadeSlotBlink 0.95s ease-in-out infinite;
}
.arcade-slot.is-active .arcade-slot__arrow {
  border-color: #ffd752;
  color: #ffd752;
}

@keyframes arcadeSlotBlink {
  0%, 100% { border-color: #00e676; }
  50% { border-color: #ffd752; }
}

/* Input invisible pero accesible para activar teclado virtual móvil sin zoom iOS */
.arcade-hidden-input {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 1px;
  opacity: 0.01;
  border: 0;
  padding: 0;
  margin: 0;
  font-size: 16px;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  z-index: -1;
}

.arcade-entry-modal__error {
  margin: 0 0 6px;
  min-height: 14px;
  font-size: 11px;
  font-weight: 800;
  color: #ff7b7b;
}

.arcade-entry-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.arcade-entry-modal__submit {
  appearance: none;
  width: 100%;
  padding: 11px 18px;
  border-radius: 12px;
  border: 2px solid #8ef8d9;
  border-bottom: 4px solid #083b2f;
  background: linear-gradient(180deg, #4edbb7 0%, #20997e 48%, #15735e 100%);
  color: #04241b;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .10em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65), 0 0 18px rgba(78, 219, 183, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: transform .1s ease, filter .15s ease;
}
.arcade-entry-modal__submit:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-1px);
}
.arcade-entry-modal__submit:active:not(:disabled) {
  transform: translateY(2px);
  border-bottom-width: 2px;
}
.arcade-entry-modal__submit:disabled {
  opacity: 0.72;
  cursor: wait;
}

.arcade-entry-modal__subactions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}
.arcade-entry-modal__kbd,
.arcade-entry-modal__skip {
  appearance: none;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 28, 38, 0.7);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.arcade-entry-modal__kbd {
  border-color: rgba(100, 240, 214, 0.45);
  color: #8ef8d9;
}
.arcade-entry-modal__kbd:hover,
.arcade-entry-modal__skip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* Adaptación compacta 100% visible en móviles horizontales (Landscape <= 540px alto) */
@media (max-height: 540px) {
  .live-score-banner {
    top: max(6px, env(safe-area-inset-top));
    padding: 4px 12px;
    font-size: 10.5px;
  }
  .arcade-entry-modal {
    padding: 4px 10px;
  }
  .arcade-entry-modal__cabinet {
    width: min(94vw, 490px);
    max-height: calc(100dvh - 8px);
    padding: 8px 14px 8px;
    border-radius: 12px;
  }
  .arcade-entry-modal__badge {
    font-size: 11.5px;
    margin-bottom: 5px;
  }
  .arcade-entry-modal__stats {
    gap: 8px;
    margin-bottom: 5px;
  }
  .arcade-stat-pill {
    flex-direction: row;
    justify-content: space-between;
    padding: 3px 10px;
    border-radius: 8px;
  }
  .arcade-stat-pill__label {
    font-size: 8.5px;
  }
  .arcade-stat-pill__val {
    font-size: 14px;
  }
  .arcade-entry-modal__inst {
    font-size: 10px;
    margin-bottom: 5px;
  }
  .arcade-slots {
    gap: 12px;
    margin-bottom: 5px;
  }
  .arcade-slot {
    gap: 3px;
  }
  .arcade-slot__arrow {
    width: 56px;
    height: 25px;
    font-size: 12px;
    border-radius: 7px;
  }
  .arcade-slot__char {
    width: 58px;
    height: 46px;
    font-size: 26px;
    border-radius: 9px;
  }
  .arcade-entry-modal__error {
    min-height: 0;
    font-size: 9.5px;
    margin-bottom: 3px;
  }
  .arcade-entry-modal__actions {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .arcade-entry-modal__submit {
    flex: 1 1 auto;
    padding: 7px 12px;
    font-size: 11.5px;
    border-radius: 9px;
  }
  .arcade-entry-modal__subactions {
    width: auto;
    gap: 6px;
  }
  .arcade-entry-modal__kbd,
  .arcade-entry-modal__skip {
    padding: 6px 9px;
    font-size: 10px;
    white-space: nowrap;
  }
}

/* =========================================================
 * Modal Historia de Instagram (Story 9:16 Preview & Share)
 * ========================================================= */
.story-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.story-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.story-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 14, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.story-modal__content {
  position: relative;
  z-index: 1;
  width: min(92vw, 400px);
  max-height: min(92dvh, calc(100vh - 16px));
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: linear-gradient(180deg, #101c2c 0%, #08121e 60%, #050b12 100%);
  border: 2.5px solid #00e5ff;
  outline: 2px solid #ffd752;
  outline-offset: -1px;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.9), 0 0 28px rgba(0, 229, 255, 0.35);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform .22s cubic-bezier(0.16, 1, 0.3, 1);
}
.story-modal.is-open .story-modal__content {
  transform: scale(1);
}
.story-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  border-bottom: 1.5px solid rgba(0, 229, 255, 0.3);
  background: rgba(14, 30, 48, 0.6);
}
.story-modal__title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.story-modal__title {
  margin: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #ffd752;
  text-shadow: 0 0 10px rgba(255, 215, 82, 0.5);
}
.story-modal__subtitle {
  margin: 0;
  font-size: 10px;
  color: #8ef8d9;
  letter-spacing: 0.02em;
}
.story-modal__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #ffffff;
  font-size: 15px;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.story-modal__close:hover {
  background: rgba(255, 60, 60, 0.35);
  border-color: #ff5252;
  transform: scale(1.06);
}
.story-modal__body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  min-height: 0;
}
.story-modal__preview-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 200px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 18px rgba(0, 230, 118, 0.25);
  border: 2px solid rgba(255, 215, 82, 0.6);
  background: #040810;
  aspect-ratio: 9 / 16;
}
.story-modal__preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity .2s ease;
}
.story-modal__loading {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 18, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #ffd752;
  font-size: 11px;
  font-weight: 700;
}
.story-modal__spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 215, 82, 0.2);
  border-top-color: #ffd752;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.story-modal__footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px 10px;
  background: rgba(10, 20, 32, 0.7);
  border-top: 1px solid rgba(0, 229, 255, 0.25);
}
.story-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}
.story-btn:active {
  transform: scale(0.97);
}
.story-btn--share {
  background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #ffffff;
  border: 1.5px solid #ff85a1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  box-shadow: 0 4px 14px rgba(220, 39, 67, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.story-btn--share:hover {
  filter: brightness(1.12);
}
.story-btn--download {
  background: linear-gradient(180deg, #1b4958 0%, #0d2833 100%);
  color: #8ef8d9;
  border: 1.5px solid #00e5ff;
}
.story-btn--download:hover {
  filter: brightness(1.15);
}
.story-btn--copy {
  background: rgba(255, 255, 255, 0.06);
  color: #ffd752;
  border: 1px solid rgba(255, 215, 82, 0.35);
  padding: 6px 12px;
  font-size: 11px;
}
.story-btn--copy:hover {
  background: rgba(255, 215, 82, 0.15);
}

@media (max-height: 540px) and (min-width: 541px) {
  .story-modal__content {
    width: min(94vw, 480px);
    max-height: 94vh;
  }
  .story-modal__body {
    flex-direction: row;
    gap: 14px;
    padding: 6px 10px;
  }
  .story-modal__preview-wrap {
    max-width: 120px;
  }
  .story-modal__footer {
    padding: 6px 10px 8px;
    gap: 4px;
  }
  .story-btn {
    padding: 5px 10px;
    font-size: 11px;
  }
}

