/* =====================================================================
   css/tema.css — Base visual común de Road To Glory ("noche de estadio")
   ---------------------------------------------------------------------
   Todas las pantallas cargan este archivo ANTES que su CSS propio.
   Aquí viven: tipografías (en local), colores, botones, paneles,
   ventanas modales y el fondo de estadio. Cambiar algo aquí lo cambia
   en todo el juego.
   ===================================================================== */

/* ---------- Tipografías (en local, sin depender de Google Fonts) ------
   Anton (títulos, marcador) y Montserrat (todo lo demás).
   Licencia SIL Open Font License 1.1. Subconjuntos latino y latino
   extendido: cubren ñ, tildes, ç, ã y nombres como Modrić o Schick. */
@font-face { font-family: 'Anton'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../assets/fonts/anton-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Anton'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../assets/fonts/anton-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../assets/fonts/montserrat-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../assets/fonts/montserrat-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../assets/fonts/montserrat-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../assets/fonts/montserrat-latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../assets/fonts/montserrat-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../assets/fonts/montserrat-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('../assets/fonts/montserrat-latin-800-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('../assets/fonts/montserrat-latin-ext-800-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Colores y medidas ---------- */
:root {
  --rtg-blue: #0046A8;          /* el azul de siempre */
  --rtg-blue-hi: #0A52BE;
  --rtg-blue-lo: #00337D;
  --rtg-navy: #001A40;          /* texto sobre dorado, sombras */
  --rtg-ink: #001536;           /* fondos de paneles */
  --rtg-gold: #FFD42A;          /* acento */
  --rtg-gold-hi: #FFE066;
  --rtg-gold-lo: #C9A300;       /* "relieve" del botón dorado */
  --rtg-white: #FFFFFF;
  --rtg-text-2: #C3D1EC;        /* texto secundario (contraste AA sobre azul) */
  --rtg-green: #4ADE80;
  --rtg-red: #F87171;

  --rtg-surface: rgba(0, 20, 52, 0.72);
  --rtg-surface-2: rgba(255, 255, 255, 0.06);
  --rtg-line: rgba(255, 255, 255, 0.16);
  --rtg-line-gold: rgba(255, 212, 42, 0.65);

  --rtg-radius: 14px;
  --rtg-radius-sm: 10px;
  --rtg-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);

  --font-display: 'Anton', 'Arial Narrow', sans-serif;
  --font-body: 'Montserrat', system-ui, sans-serif;

  /* compatibilidad con el CSS antiguo */
  --bg-solid: var(--rtg-blue);
  --color-shadow: var(--rtg-navy);
  --color-gold: var(--rtg-gold);
  --color-white: var(--rtg-white);
}

/* ---------- Fondo de estadio (añadir class="rtg-stadium" al body) ---------- */
.rtg-stadium {
  background-color: var(--rtg-blue);
  background-image:
    radial-gradient(ellipse 42% 55% at 10% -8%, rgba(255,255,255,0.20), rgba(255,255,255,0) 70%),
    radial-gradient(ellipse 42% 55% at 90% -8%, rgba(255,255,255,0.20), rgba(255,255,255,0) 70%),
    linear-gradient(180deg, var(--rtg-blue-hi) 0%, var(--rtg-blue) 48%, var(--rtg-blue-lo) 100%);
  font-family: var(--font-body);
  color: var(--rtg-white);
}
/* Variante más oscura para pantallas con mucho contenido (partido, cuadro) */
.rtg-stadium--night {
  background-image:
    radial-gradient(ellipse 38% 45% at 8% -8%, rgba(255,255,255,0.15), rgba(255,255,255,0) 70%),
    radial-gradient(ellipse 38% 45% at 92% -8%, rgba(255,255,255,0.15), rgba(255,255,255,0) 70%),
    linear-gradient(180deg, #0846A0 0%, #01306F 55%, #001E4D 100%);
}
/* Líneas del campo, muy suaves, al fondo */
.rtg-pitch-lines {
  position: fixed; left: 0; right: 0; bottom: 0; height: 42%;
  pointer-events: none; z-index: 0; opacity: 0.09;
  background:
    linear-gradient(#fff, #fff) 0 18% / 100% 3px no-repeat,
    radial-gradient(circle at 50% 18%, transparent 0 calc(min(22vw, 22vh) - 2px), #fff calc(min(22vw, 22vh) - 2px) min(22vw, 22vh), transparent min(22vw, 22vh));
}
/* Franja de banderas (arriba y abajo) */
.rtg-flag-band {
  position: fixed; left: 0; right: 0; height: 7px; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(90deg, #C60B1E 0 40px, #FFD42A 40px 80px, #FFFFFF 80px 120px, #006847 120px 160px, #75AADB 160px 200px, #002395 200px 240px);
}
.rtg-flag-band--top { top: 0; }
.rtg-flag-band--bottom { bottom: 0; transform: scaleX(-1); }

/* ---------- Botones ---------- */
.rtg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 26px;
  border-radius: var(--rtg-radius);
  border: 1.5px solid transparent;
  font-family: var(--font-body); font-weight: 800; font-size: 15px; letter-spacing: 2.5px;
  text-transform: uppercase; text-decoration: none;
  cursor: pointer; user-select: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.rtg-btn svg { flex-shrink: 0; }
.rtg-btn:focus-visible { outline: 3px solid var(--rtg-gold-hi); outline-offset: 3px; }
.rtg-btn:disabled { cursor: default; }

/* Principal: dorado con relieve */
.rtg-btn--primary {
  background: var(--rtg-gold); color: var(--rtg-navy);
  box-shadow: 0 6px 0 var(--rtg-gold-lo), 0 14px 28px rgba(0,0,0,0.32);
}
.rtg-btn--primary:hover { background: var(--rtg-gold-hi); transform: translateY(-1px); box-shadow: 0 7px 0 var(--rtg-gold-lo), 0 16px 30px rgba(0,0,0,0.34); }
.rtg-btn--primary:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--rtg-gold-lo), 0 6px 14px rgba(0,0,0,0.3); }

/* Secundario: cristal con borde claro */
.rtg-btn--secondary {
  background: rgba(0, 26, 64, 0.5); color: var(--rtg-white); border-color: rgba(255,255,255,0.38);
}
.rtg-btn--secondary:hover { background: rgba(0, 26, 64, 0.8); border-color: rgba(255,255,255,0.7); }
.rtg-btn--secondary:active { transform: scale(0.98); }

/* Borde dorado */
.rtg-btn--gold {
  background: rgba(0, 26, 64, 0.5); color: var(--rtg-gold); border-color: var(--rtg-gold);
}
.rtg-btn--gold:hover { background: rgba(255, 212, 42, 0.14); }
.rtg-btn--gold:active { transform: scale(0.98); }

/* Discreto */
.rtg-btn--ghost {
  background: rgba(255,255,255,0.06); color: var(--rtg-white); border-color: rgba(255,255,255,0.28);
  font-weight: 700;
}
.rtg-btn--ghost:hover { background: rgba(255,255,255,0.12); }

/* Peligro (borrar progreso) */
.rtg-btn--danger { background: #C62828; color: #fff; border-color: #EF5350; }
.rtg-btn--danger:hover { background: #D32F2F; }

.rtg-btn--secondary:disabled, .rtg-btn--gold:disabled, .rtg-btn--ghost:disabled {
  background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.45); border-color: rgba(255,255,255,0.18);
  transform: none;
}

/* Botón redondo solo con icono */
.rtg-icon-btn {
  width: 44px; height: 44px; border-radius: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0, 26, 64, 0.5); color: var(--rtg-white);
  border: 1.5px solid rgba(255,255,255,0.38);
  cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.rtg-icon-btn:hover { background: rgba(0, 26, 64, 0.85); border-color: rgba(255,255,255,0.7); }
.rtg-icon-btn:active { transform: scale(0.94); }
.rtg-icon-btn:focus-visible { outline: 3px solid var(--rtg-gold-hi); outline-offset: 3px; }

/* ---------- Paneles y ventanas ---------- */
.rtg-panel {
  background: linear-gradient(165deg, rgba(0, 42, 107, 0.96), rgba(0, 21, 54, 0.98));
  border: 1.5px solid var(--rtg-line-gold);
  border-radius: 18px;
  box-shadow: var(--rtg-shadow);
  color: var(--rtg-white);
}
.rtg-panel-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(26px, 4vw, 36px); letter-spacing: 3px; text-transform: uppercase;
  color: var(--rtg-gold); text-align: center; margin: 0;
}
.rtg-backdrop {
  position: fixed; inset: 0; background: rgba(0, 8, 28, 0.78);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.rtg-label {
  font-weight: 800; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--rtg-gold);
}

/* ---------- Accesibilidad: menos movimiento si el sistema lo pide ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- Piezas comunes de juego ---------- */
/* Bandera con marco fino (las banderas se recortan a 3:2) */
.rtg-flag {
  display: block; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,0.22), 0 3px 8px rgba(0,0,0,0.35);
  background: rgba(255,255,255,0.06);
}
.rtg-flag--square { aspect-ratio: 1 / 1; object-fit: contain; }

/* Estrellas de nivel (1 a 5, admite medias) */
.rtg-stars { display: inline-flex; gap: 2px; color: var(--rtg-gold); line-height: 0; }
.rtg-stars svg { width: 1em; height: 1em; display: block; }
.rtg-stars .off { color: rgba(255,255,255,0.22); }

/* Chip de dificultad */
.rtg-diff {
  --c: #fff;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px; border-radius: 20px;
  background: color-mix(in srgb, var(--c) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  color: var(--c); font-weight: 800; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; white-space: nowrap;
}
.rtg-diff::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.rtg-diff--easy { --c: #4ADE80; }
.rtg-diff--normal { --c: #FACC15; }
.rtg-diff--hard { --c: #F87171; }
.rtg-diff--legend { --c: #C084FC; }

/* Pastilla de posición (POR/DEF/MED/DEL) */
.rtg-pos {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; padding: 2px 6px; border-radius: 6px;
  font-weight: 800; font-size: 10px; letter-spacing: 1px; color: #001A40;
}
.rtg-pos--POR, .rtg-pos--GK { background: #FBBF24; }
.rtg-pos--DEF { background: #60A5FA; }
.rtg-pos--MED, .rtg-pos--MID { background: #4ADE80; }
.rtg-pos--DEL, .rtg-pos--FW { background: #F87171; }

/* Barra de pie fija (botones al fondo de la pantalla) */
.rtg-footer {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(0,21,54,0) 0%, rgba(0,21,54,0.85) 30%, rgba(0,21,54,0.95) 100%);
}

/* Título de pantalla */
.rtg-screen-title {
  margin: 0; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(26px, 4.4cqh, 40px); letter-spacing: 2px; line-height: 1;
  text-transform: uppercase; color: #fff; transform: skewX(-6deg);
  text-shadow: 0 4px 0 rgba(0,20,60,0.55);
}
.rtg-screen-title span { color: var(--rtg-gold); }

/* Entrada suave de bloques */
@keyframes rtgRise { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
.rtg-rise { animation: rtgRise 0.5s ease-out both; }


/* Rendimiento: en móviles y tabletas el desenfoque de fondo es muy costoso.
   Los fondos ya son casi opacos, así que se quita sin cambio visible. */
@media (hover: none), (max-width: 900px) {
  *, *::before, *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
