/* ============================================================
   Kessler Cruiser - estilos personalizados
   (Tailwind se encarga del layout; aquí van las animaciones)
   ============================================================ */

body {
  background:
    radial-gradient(ellipse at 50% 120%, rgba(30, 64, 175, 0.35), transparent 60%),
    radial-gradient(ellipse at 50% -20%, rgba(88, 28, 135, 0.25), transparent 55%),
    #020617;
}

/* ---------- Fondo de estrellas parpadeantes ---------- */
/*
 * Rendimiento: las capas se mueven con `transform` y `opacity`, que el navegador
 * resuelve en la GPU sin repintar. Animar `background-position` obligaba a repintar
 * tres capas a pantalla completa en cada fotograma (el juego perdía ~80 % de fps).
 * La capa es más grande que la pantalla para que el desplazamiento nunca deje
 * bordes a la vista; --dx/--dy son múltiplos del mosaico, así el bucle es continuo.
 */
.stars {
  --dx: 1200px;
  --dy: 600px;
  position: fixed;
  top: calc(var(--dy) * -1);
  left: 0;
  width: calc(100% + var(--dx));
  height: calc(100% + var(--dy));
  z-index: 0;
  pointer-events: none;
  background-repeat: repeat;
  will-change: transform, opacity;
  animation: twinkle 4s ease-in-out infinite, drift 120s linear infinite;
}

/* Capa 1: estrellas pequeñas y numerosas */
.stars {
  background-image:
    radial-gradient(1px 1px at 12px 30px, #fff, transparent),
    radial-gradient(1px 1px at 80px 140px, #cbd5e1, transparent),
    radial-gradient(1.5px 1.5px at 150px 60px, #fff, transparent),
    radial-gradient(1px 1px at 210px 210px, #bae6fd, transparent),
    radial-gradient(1px 1px at 260px 100px, #fff, transparent),
    radial-gradient(1px 1px at 40px 250px, #e2e8f0, transparent);
  background-size: 300px 300px;
}

/* Capa 2: estrellas medianas, desfasadas */
.stars-2 {
  background-image:
    radial-gradient(2px 2px at 60px 90px, #fde68a, transparent),
    radial-gradient(1.5px 1.5px at 190px 170px, #fff, transparent),
    radial-gradient(2px 2px at 330px 40px, #bfdbfe, transparent),
    radial-gradient(1.5px 1.5px at 420px 260px, #fff, transparent);
  background-size: 480px 360px;
  --dx: 960px;
  --dy: 720px;
  animation-duration: 6s, 200s;
  animation-delay: -2s, 0s;
}

/* Capa 3: pocas estrellas grandes y brillantes */
.stars-3 {
  background-image:
    radial-gradient(2.5px 2.5px at 100px 120px, #fff, transparent),
    radial-gradient(2.5px 2.5px at 520px 330px, #fecaca, transparent),
    radial-gradient(3px 3px at 700px 60px, #a5f3fc, transparent);
  background-size: 800px 480px;
  --dx: 1600px;
  --dy: 960px;
  animation-duration: 3s, 320s;
  animation-delay: -1s, 0s;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(calc(var(--dx) * -1), var(--dy), 0); }
}

/* ---------- Textos con brillo ---------- */
.glow-text {
  text-shadow: 0 0 12px rgba(125, 211, 252, 0.7), 0 0 32px rgba(56, 189, 248, 0.35);
}

.glow-text-red {
  text-shadow: 0 0 12px rgba(251, 113, 133, 0.75), 0 0 32px rgba(244, 63, 94, 0.4);
}

/* ---------- Botones y teclas ---------- */
.btn-primary {
  padding: 0.7rem 2rem;
  border-radius: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #0f172a;
  background: linear-gradient(135deg, #67e8f9, #38bdf8);
  box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.6), 0 8px 24px rgba(14, 165, 233, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.03);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.btn-pulse {
  animation: btnPulse 2s ease-in-out infinite;
}

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.6), 0 8px 24px rgba(14, 165, 233, 0.35); }
  50%      { box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.9), 0 8px 40px rgba(56, 189, 248, 0.75); }
}

.key {
  display: inline-block;
  padding: 0 0.4rem;
  border-radius: 0.3rem;
  border: 1px solid #475569;
  background: #1e293b;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  line-height: 1.4rem;
}

/* ---------- Pantallas (inicio / pausa / game over) ---------- */
.overlay {
  animation: overlayIn 0.35s ease-out both;
}

.overlay.hidden {
  display: none;
}

@keyframes overlayIn {
  from { opacity: 0; transform: scale(1.02); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---------- HUD ---------- */
.heart-gain {
  animation: heartGain 0.8s ease-out;
}

@keyframes heartGain {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.5); filter: drop-shadow(0 0 8px #fb7185); }
  100% { transform: scale(1); }
}

.hud-hit {
  animation: hudHit 0.4s ease-out;
}

@keyframes hudHit {
  0%, 100% { border-color: rgba(51, 65, 85, 0.6); }
  30%      { border-color: #f43f5e; box-shadow: 0 0 20px rgba(244, 63, 94, 0.5); }
}

/* ---------- Accesibilidad ---------- */
@media (prefers-reduced-motion: reduce) {
  .stars, .btn-pulse, .overlay { animation: none; }
}

/* ---------- Selector de modo y botón secundario ---------- */
.mode-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-radius: 0.75rem;
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.mode-card:hover:not(:disabled),
.mode-card:focus-visible:not(:disabled) {
  transform: translateY(-2px);
  border-color: #38bdf8;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
  outline: none;
}

.mode-card:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-style: dashed;
}

.mode-card .mode-name {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mode-card .mode-desc {
  font-size: 0.72rem;
  line-height: 1.25;
  color: #94a3b8;
}

.mode-card .mode-meta {
  margin-top: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  color: #fbbf24;
}

.mode-card:disabled .mode-meta {
  color: #94a3b8;
}

.btn-secondary {
  padding: 0.7rem 1.6rem;
  border-radius: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid #475569;
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: #94a3b8;
  color: #fff;
}

.btn-secondary:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* ---------- Clasificación ---------- */
.text-input {
  width: 11rem;
  padding: 0.55rem 0.8rem;
  border-radius: 0.6rem;
  border: 1px solid #475569;
  background: rgba(2, 6, 23, 0.8);
  color: #f1f5f9;
  font-weight: 600;
}

.text-input:focus {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
}

#lb-form {
  display: flex;
  flex-wrap: wrap;
}

#lb-form.hidden {
  display: none;
}

.lb-tab {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.8);
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.lb-tab:hover { color: #e2e8f0; border-color: #64748b; }

.lb-tab-active {
  color: #0f172a;
  background: linear-gradient(135deg, #67e8f9, #38bdf8);
  border-color: transparent;
}

.lb-table {
  border-collapse: separate;
  border-spacing: 0 3px;
}

.lb-table th {
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  text-align: right;
}

.lb-table td {
  padding: 0.3rem 0.6rem;
  background: rgba(15, 23, 42, 0.75);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: right;
  color: #e2e8f0;
}

.lb-table td:first-child { border-radius: 0.4rem 0 0 0.4rem; color: #fbbf24; }
.lb-table td:last-child { border-radius: 0 0.4rem 0.4rem 0; color: #7dd3fc; }
.lb-table .lb-name { text-align: left; font-family: inherit; font-weight: 600; word-break: break-word; }

.lb-row-new td {
  background: rgba(8, 145, 178, 0.35);
  box-shadow: inset 0 0 0 1px rgba(103, 232, 249, 0.6);
}

/* ---------- Foco visible (teclado) ---------- */
.lb-tab:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.mode-card:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.btn-small {
  padding: 0.3rem 0.8rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  border-radius: 0.5rem;
}

/* ---------- Botones de sonido ---------- */
.audio-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid #475569;
  background: rgba(15, 23, 42, 0.78);
  color: #7dd3fc;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.audio-btn:hover { transform: scale(1.08); border-color: #94a3b8; }
.audio-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.audio-btn[aria-pressed="false"] {
  color: #64748b;
  border-color: #334155;
}

/* Raya diagonal cuando está silenciado */
.audio-btn[aria-pressed="false"]::after {
  content: "";
  position: absolute;
  width: 1.5rem;
  height: 2px;
  background: #f87171;
  transform: rotate(-45deg);
  border-radius: 2px;
}

/* ---------- Selector de idioma ---------- */
.lang-select {
  height: 2.25rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  border: 1px solid #475569;
  background: rgba(15, 23, 42, 0.78);
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.lang-select:hover { border-color: #94a3b8; }
.lang-select:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lang-select option { background: #0f172a; color: #e2e8f0; }

/* ============================================================
   Móvil / táctil
   ============================================================ */
html, body { overscroll-behavior: none; }

/* Líneas de ayuda según el dispositivo: teclado por defecto; táctil cuando se detecta pantalla táctil */
.touch-only { display: none; }
.touch-ui .touch-only { display: list-item; }
.touch-ui .kb-only { display: none; }

/* Interfaz táctil: el escenario ocupa toda la pantalla (apaisado) y se quitan los adornos */
.touch-ui body { overflow: hidden; -webkit-tap-highlight-color: transparent; }
.touch-ui main {
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  gap: 0;
}
.touch-ui #footer-hint { display: none; }

/*
 * Barra superior en móvil: el panel de la cabina se dibuja en el lienzo y, escalado a una pantalla de
 * teléfono, su texto queda en 6-8 px (ilegible). Esta barra compacta usa píxeles reales: vidas, puntos,
 * nivel, escudos, descenso a la Tierra y energía del rayo. Solo mientras se juega (en pausa y menús lo tapa el menú).
 */
.touch-ui #hud { display: none; }
html.touch-ui[data-state="playing"] #hud {
  display: flex;
  position: fixed;
  top: calc(3px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: max-content;
  max-width: calc(100vw - 120px);
  padding: 0.1rem 0.8rem;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid rgba(71, 85, 105, 0.7);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  pointer-events: none;
}
/* Los iconos de vidas, escudo y descenso se entienden solos; puntos y nivel conservan su etiqueta pequeña */
.touch-ui #hud-mode,
.touch-ui #hud [data-i18n="hud.lives"],
.touch-ui #hud [data-i18n="hud.shield"],
.touch-ui #hud [data-i18n="hud.earth"] { display: none; }
.touch-ui #hud [data-i18n="hud.score"],
.touch-ui #hud [data-i18n="hud.level"] { font-size: 0.6rem; }
.touch-ui #hud #hud-lives,
.touch-ui #hud #hud-score,
.touch-ui #hud #hud-level { font-size: 0.95rem; line-height: 1.15; }
.touch-ui #hud #hud-shield { font-size: 0.8rem; line-height: 1.15; }
.touch-ui #hud .hud-earth { flex: 0 0 60px; min-width: 60px; max-width: 60px; }
.hud-energy { display: none; width: 46px; height: 7px; overflow: hidden; border-radius: 999px; background: #1e293b; box-shadow: inset 0 0 0 1px #334155; }
.touch-ui .hud-energy { display: block; }

/* Durante la partida, idioma y sonido salen de en medio (siguen en la pausa y en los menús) */
html.touch-ui[data-state="playing"] #ui-corner { display: none; }
.touch-ui #stage {
  width: min(100vw, calc(100vh * 1.5));
  width: min(100vw, calc(100dvh * 1.5));
  border-width: 0;
  border-radius: 0;
  margin: 0 auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Joystick y botón de pausa: solo táctil y solo durante la partida */
.joystick,
.pause-btn {
  display: none;
  position: fixed;
  z-index: 40;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.joystick {
  left: calc(18px + env(safe-area-inset-left, 0px));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 124px;
  height: 124px;
  border-radius: 50%;
  border: 2px solid rgba(125, 211, 252, 0.45);
  background: radial-gradient(circle, rgba(56, 189, 248, 0.1) 0%, rgba(15, 23, 42, 0.5) 72%);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.18);
}

.joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #bae6fd, #0ea5e9 70%);
  box-shadow: 0 2px 12px rgba(14, 165, 233, 0.6);
  pointer-events: none;
}

.pause-btn {
  left: calc(14px + env(safe-area-inset-left, 0px));
  top: calc(12px + env(safe-area-inset-top, 0px));
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #475569;
  background: rgba(15, 23, 42, 0.7);
  color: #cbd5e1;
}

html.touch-ui[data-state="playing"] .joystick { display: block; }
html.touch-ui[data-state="playing"] .pause-btn { display: grid; }

/* Botones y controles cómodos para el dedo, sin zoom por doble toque */
.touch-ui button,
.touch-ui select { touch-action: manipulation; }

/* Aviso de "gira el dispositivo": solo móviles en vertical */
.rotate-hint {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  text-align: center;
  background: #020617;
  color: #7dd3fc;
}
.rotate-hint svg { animation: rotatePhone 2.6s ease-in-out infinite; }

@keyframes rotatePhone {
  0%, 20% { transform: rotate(0deg); }
  60%, 100% { transform: rotate(-90deg); }
}

@media (orientation: portrait) and (pointer: coarse) and (max-width: 800px) {
  .rotate-hint { display: flex; }
}

/* Pantallas bajas (móvil apaisado): menús más compactos; "cómo se juega" se despliega con un botón */
.howto-toggle { display: none; }

@media (max-height: 560px) {
  #howto { display: none; }
  #howto.open { display: flex; }
  .howto-toggle { display: inline-block; }

  /* Los botones de idioma y sonido (arriba a la derecha) son más compactos y los menús les dejan hueco */
  #ui-corner { top: 0.4rem; right: 0.5rem; gap: 0.4rem; }
  .audio-btn { width: 2.3rem; height: 2.3rem; }
  .lang-select { height: 2.3rem; font-size: 0.7rem; padding: 0 0.35rem; }

  #screen-start > div { gap: 0.45rem; padding: 3rem 0.75rem 0.6rem; }
  #screen-start h1 { font-size: 1.5rem; letter-spacing: 0.12em; }
  #screen-start .mode-card { padding: 0.4rem 0.55rem; gap: 0.1rem; }
  #screen-start .mode-card .mode-desc { font-size: 0.65rem; }

  #screen-pause { gap: 0.6rem; padding: 0.75rem; }
  #screen-gameover > div,
  #screen-leaderboard > div { gap: 0.4rem; padding: 3rem 0.75rem 0.6rem; }
  #go-title { font-size: 1.6rem; }
  #screen-leaderboard h2 { font-size: 1.4rem; }
  .lb-table td { padding: 0.15rem 0.5rem; }
  .text-input { padding: 0.4rem 0.6rem; }
  .btn-primary, .btn-secondary { padding: 0.5rem 1.1rem; }
}

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

/* ============================================================
   Ajustes táctiles: tamaño de los controles, modo zurdo, menú y ayuda
   ============================================================ */

/* Tamaño del joystick (ajuste Pequeños / Medios / Grandes); más pequeño en pantallas casi 16:9 (márgenes estrechos) */
html { --joy: 124px; }
html[data-joy="s"] { --joy: 100px; }
html[data-joy="l"] { --joy: 150px; }
@media (max-aspect-ratio: 2/1) {
  html { --joy: 104px; }
  html[data-joy="s"] { --joy: 86px; }
  html[data-joy="l"] { --joy: 126px; }
}
.joystick { width: var(--joy); height: var(--joy); }
.joystick-knob {
  width: calc(var(--joy) * 0.44);
  height: calc(var(--joy) * 0.44);
  margin: calc(var(--joy) * -0.22) 0 0 calc(var(--joy) * -0.22);
}

/* Zurdo: joystick y pausa pasan al lado derecho */
html.lefty .joystick { left: auto; right: calc(18px + env(safe-area-inset-right, 0px)); }
html.lefty .pause-btn { left: auto; right: calc(14px + env(safe-area-inset-right, 0px)); }

/* Botones que solo existen en pantallas táctiles (el menú de ajustes táctiles) */
.touch-block { display: none; }
.touch-ui .touch-block { display: inline-block; }

/* Menú de ajustes táctiles */
.touch-opts { display: flex; flex-direction: column; gap: 0.5rem; }
.touch-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 0.8rem; }
.touch-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #94a3b8; }
.touch-help { margin: -0.1rem 0 0.2rem; font-size: 0.75rem; line-height: 1.35; color: #94a3b8; }

.seg { display: inline-flex; overflow: hidden; border-radius: 0.6rem; border: 1px solid #475569; }
.seg-btn {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.8);
  cursor: pointer;
  touch-action: manipulation;
}
.seg-btn + .seg-btn { border-left: 1px solid #475569; }
.seg-btn[aria-pressed="true"] { color: #0f172a; background: linear-gradient(135deg, #67e8f9, #38bdf8); }
.seg-btn:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }

/* Ayuda de controles táctiles (la primera vez, al empezar) */
.touch-hint {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.78);
  cursor: pointer;
}
#touch-hint.hidden { display: none; }
.touch-hint-card {
  max-width: 28rem;
  padding: 1rem 1.3rem;
  text-align: center;
  border-radius: 1rem;
  border: 1px solid rgba(125, 211, 252, 0.5);
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.25);
}
.touch-hint-line { margin: 0 0 0.45rem; font-size: 0.95rem; color: #e2e8f0; }
.touch-hint-line.hidden { display: none; }
.touch-hint-go { margin: 0.7rem 0 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: #67e8f9; }

/* ============================================================
   Páginas del sitio (cómo jugar, mi clasificación, acerca de)
   y enlaces del juego hacia ellas
   ============================================================ */
.site-wrap { position: relative; z-index: 10; margin: 0 auto; display: flex; min-height: 100vh; max-width: 48rem; flex-direction: column; gap: 1.25rem; padding: 1rem 0.9rem 1.5rem; }
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; padding: 0.6rem 0.9rem; border: 1px solid rgba(51, 65, 85, 0.7); border-radius: 0.9rem; background: rgba(15, 23, 42, 0.75); backdrop-filter: blur(6px); }
.site-brand { font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #fff; text-decoration: none; text-shadow: 0 0 12px rgba(125, 211, 252, 0.5); }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; font-size: 0.875rem; }
.site-nav a, .site-links a { color: #94a3b8; text-decoration: none; }
.site-nav a:hover, .site-links a:hover { color: #e2e8f0; text-decoration: underline; }
.site-nav a[aria-current="page"] { color: #7dd3fc; font-weight: 700; }
.site-nav a:focus-visible, .site-links a:focus-visible, .site-footer a:focus-visible, .site-main a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 0.25rem; }
.site-main { flex: 1; display: flex; flex-direction: column; gap: 0.9rem; line-height: 1.6; color: #cbd5e1; }
.site-h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: 0.04em; color: #fff; text-shadow: 0 0 14px rgba(125, 211, 252, 0.4); }
.site-h2 { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: #94a3b8; margin-bottom: 0.4rem; }
.site-h3 { font-size: 1rem; font-weight: 700; color: #e2e8f0; margin: 0.9rem 0 0.2rem; }
.site-section { display: flex; flex-direction: column; gap: 0.5rem; padding: 1rem; border: 1px solid rgba(51, 65, 85, 0.6); border-radius: 0.9rem; background: rgba(15, 23, 42, 0.6); }
.site-list { display: flex; flex-direction: column; gap: 0.5rem; padding-left: 1.1rem; list-style: disc; }
.site-list li::marker { color: #38bdf8; }
.site-note { font-size: 0.85rem; color: #94a3b8; }
.site-main a { color: #7dd3fc; }
.site-main a.btn-primary { color: #0f172a; text-decoration: none; }
.site-dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; }
.site-dl dt { font-weight: 700; color: #e2e8f0; }
.site-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-top: 0.5rem; }
.share-note:empty { display: none; }
.share-note { font-size: 0.8rem; color: #67e8f9; word-break: break-word; }
.site-footer { display: flex; flex-direction: column; gap: 0.25rem; align-items: center; text-align: center; font-size: 0.8rem; color: #64748b; }
.site-footer a { color: #94a3b8; }
.site-noscript { padding: 1rem; text-align: center; color: #e2e8f0; }
.plays-callout { padding: 0.8rem 1rem; border: 1px solid rgba(251, 191, 36, 0.4); border-radius: 0.75rem; background: rgba(251, 191, 36, 0.08); color: #e2e8f0; font-weight: 600; }
.plays-callout.hidden { display: none; }

/* Trofeos y estadísticas */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.6rem; }
.badge-card { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.7rem 0.8rem; border: 1px solid #334155; border-radius: 0.75rem; background: rgba(15, 23, 42, 0.8); opacity: 0.65; }
.badge-card .badge-icon { font-size: 1.6rem; filter: grayscale(1); }
.badge-card strong { color: #e2e8f0; }
.badge-desc { font-size: 0.8rem; color: #94a3b8; }
.badge-state { margin-top: auto; padding-top: 0.3rem; font-size: 0.75rem; color: #64748b; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.badge-done { opacity: 1; border-color: rgba(251, 191, 36, 0.6); box-shadow: 0 0 14px rgba(251, 191, 36, 0.15); }
.badge-done .badge-icon { filter: none; }
.badge-done .badge-state { color: #fbbf24; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0.6rem; }
.stat-grid div { padding: 0.6rem 0.8rem; border: 1px solid #334155; border-radius: 0.75rem; background: rgba(15, 23, 42, 0.8); }
.stat-grid dt { font-size: 0.75rem; color: #94a3b8; }
.stat-grid dd { font-size: 1.4rem; font-weight: 700; color: #34d399; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.site-main .lb-table { width: 100%; }

/* Enlaces del juego a las páginas (pie en escritorio; en la pantalla de inicio en táctil) */
.site-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.2rem 1rem; font-size: 0.75rem; }
.touch-ui #site-links { display: none; }
.site-links.start-links { margin-top: 0.5rem; }
.touch-ui .site-links.start-links { display: flex; }
@media (prefers-reduced-motion: reduce) { .site-page .stars { animation: none; } }
