/* ===== Base compartida de TatanTatan ===== */

:root {
  --verde: #1b5e20;
  --cesped-1: #2e7d32;
  --cesped-2: #2a7330;
  --texto: #ffffff;
  --texto-suave: rgba(255, 255, 255, 0.75);
  --fondo: #0f1a12;
  --panel: rgba(12, 22, 15, 0.66);
  --borde-panel: rgba(255, 255, 255, 0.14);
  --equipo-a: #ffffff;
  --equipo-a-texto: #1b5e20;
  --equipo-b: #ffca28;
  --equipo-b-texto: #3e2723;
  --peligro: #e53935;
  --foco: #ffca28;
  --radio: 16px;
  --sombra: 0 6px 20px rgba(0, 0, 0, 0.35);
  --overlay: linear-gradient(180deg, rgba(10, 16, 12, 0.45), rgba(10, 16, 12, 0.8));
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--texto);
  background: var(--fondo);
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

/* Fondo fijo: un pseudo-elemento en vez de background-attachment: fixed,
   que no funciona en iOS y es lento en celulares. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--overlay), url("../img/fondo2.jpg") center top / cover no-repeat;
}

[hidden] {
  display: none !important;
}

h1,
h2 {
  line-height: 1.15;
}

/* ===== Botones ===== */
.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-height: 44px;
  padding: 10px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  background: #fff;
  color: var(--verde);
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--sombra);
}

.btn:active {
  transform: scale(0.97);
}

.btn-secundario {
  background: rgba(255, 255, 255, 0.12);
  color: var(--texto);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secundario:hover {
  background: rgba(255, 255, 255, 0.2);
}

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

/* ===== Campos ===== */
.campo {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  font: inherit;
  font-size: 16px; /* evita el zoom automático de iOS */
}

/* ===== Paneles ===== */
.panel {
  background: var(--panel);
  border: 1px solid var(--borde-panel);
  border-radius: var(--radio);
  padding: 16px;
  box-shadow: var(--sombra);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* ===== Barra superior de las subpáginas ===== */
.barra {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto 16px;
}

.barra h1 {
  margin: 0;
  font-size: clamp(20px, 5.5vw, 28px);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.volver {
  flex-shrink: 0;
  color: var(--texto);
  text-decoration: none;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.volver:hover {
  background: rgba(0, 0, 0, 0.6);
}

/* ===== Aviso flotante ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  box-shadow: var(--sombra);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.toast button {
  border: 0;
  background: none;
  color: var(--equipo-b);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
