/* =========================================================
   PROPUESTAS · EARTH · WIND · WATER
   ========================================================= */

:root {
  --earth: #2E9E36;
  --wind: #055C8F;
  --water: #3A97EE;
  --naranja: #FF7420;
  --naranja-fuerte: #E85D0C;
  --naranja-texto: #B84A0A;

  --papel: #F5EFE3;
  --papel-2: #ECE3D1;
  --tarjeta: #FFFBF2;
  --tinta: #251F17;
  --tinta-2: #5E5343;
  --tinta-3: #8A7C66;
  --borde: #DED1B9;
  --sombra: 0 1px 0 rgba(77, 55, 25, .06), 0 10px 30px -14px rgba(77, 55, 25, .28);
  --grano-opacidad: .45;

  --earth-texto: #23802A;
  --wind-texto: #055C8F;
  --water-texto: #1F74C4;

  --radio: 18px;
  --display: 'Bricolage Grotesque', 'Arial Black', sans-serif;
  --texto: 'DM Sans', system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --papel: #16130F;
    --papel-2: #201B15;
    --tarjeta: #241F18;
    --tinta: #F4ECDD;
    --tinta-2: #C3B49C;
    --tinta-3: #8F8270;
    --borde: #3A3229;
    --sombra: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 34px -16px rgba(0, 0, 0, .8);
    --grano-opacidad: .3;
    --naranja-texto: #FF9452;
    --earth-texto: #5BCB63;
    --wind-texto: #6BB0E0;
    --water-texto: #72B8F7;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --papel: #16130F;
  --papel-2: #201B15;
  --tarjeta: #241F18;
  --tinta: #F4ECDD;
  --tinta-2: #C3B49C;
  --tinta-3: #8F8270;
  --borde: #3A3229;
  --sombra: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 34px -16px rgba(0, 0, 0, .8);
  --grano-opacidad: .3;
  --naranja-texto: #FF9452;
  --earth-texto: #5BCB63;
  --wind-texto: #6BB0E0;
  --water-texto: #72B8F7;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--texto);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--tinta);
  background: var(--papel);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* Textura de papel */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: var(--grano-opacidad);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .33 0 0 0 0 .18 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] body::before { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::before { mix-blend-mode: screen; } }

h1, h2, h3 { font-family: var(--display); line-height: 1.05; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--naranja); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.contenedor { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.contenedor-angosto { max-width: 680px; }
.visualmente-oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.saltar { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--tinta); color: var(--papel); padding: 10px 14px; border-radius: 10px; }
.saltar:focus { top: 12px; }

/* ---------- Escudos ---------- */
.escudo { display: block; height: auto; filter: drop-shadow(0 6px 10px rgba(60, 40, 15, .18)); }
.escudo--dibujar .escudo-linea { stroke-dasharray: 1; stroke-dashoffset: 1; animation: dibujar 1.1s .35s cubic-bezier(.65, 0, .35, 1) forwards; }
.escudo--dibujar .escudo-pajaro { opacity: 0; transform-box: fill-box; transform-origin: center; animation: volar .7s 1.1s ease-out forwards; }
@keyframes dibujar { to { stroke-dashoffset: 0; } }
@keyframes volar { from { opacity: 0; transform: translate(-6px, 6px) scale(.6); } to { opacity: 1; transform: none; } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 22px;
  border-radius: 999px; border: 2px solid transparent;
  font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em;
  text-decoration: none; transition: transform .15s ease, background-color .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn-primario { background: var(--naranja); color: #2A1405; box-shadow: 0 6px 0 -1px var(--naranja-fuerte), 0 14px 24px -12px rgba(232, 93, 12, .7); }
.btn-primario:hover { background: #FF8436; }
.btn-primario:active { box-shadow: 0 2px 0 -1px var(--naranja-fuerte); transform: translateY(3px); }
.btn-primario[disabled] { opacity: .6; cursor: progress; }
.btn-secundario { background: transparent; color: var(--tinta); border-color: var(--tinta); }
.btn-secundario:hover { background: var(--tinta); color: var(--papel); }
.btn-ancho { width: 100%; }
.btn-link { background: none; border: 0; padding: 4px 6px; text-decoration: underline; font-weight: 600; }

/* ---------- Barra superior ---------- */
.barra {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--papel) 86%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--borde) 70%, transparent);
}
.barra-interior { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.marca { display: flex; align-items: center; gap: 10px; color: var(--tinta); text-decoration: none; }
.marca-escudos { display: flex; gap: 4px; }
.marca-escudos .escudo { height: 26px; width: auto; filter: none; border-radius: 2px; }
.marca-texto { font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.btn-tema {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; border: 1.5px solid var(--borde); background: var(--tarjeta);
}
.btn-tema svg { width: 22px; height: 22px; fill: none; stroke: var(--tinta); stroke-width: 1.8; stroke-linecap: round; }
.btn-tema .ico-luna { fill: var(--tinta); stroke: none; }
.ico-luna { display: none; }
:root[data-theme="dark"] .ico-sol { display: none; }
:root[data-theme="dark"] .ico-luna { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ico-sol { display: none; }
  :root:not([data-theme="light"]) .ico-luna { display: block; }
}

.aviso-admin { background: var(--tinta); color: var(--papel); font-size: .95rem; }
.aviso-admin-interior { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 46px; }
.aviso-admin .btn-link { color: var(--naranja); }
.aviso-admin a { color: var(--naranja); font-weight: 700; }

/* ---------- Inicio ---------- */
.hero { position: relative; padding: 40px 0 0; overflow: hidden; }
.hero::after { /* sol naranja difuso */
  content: ''; position: absolute; z-index: -1;
  width: 520px; height: 520px; left: 50%; top: -220px; transform: translateX(-50%);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--naranja) 30%, transparent), transparent);
}
.hero-interior { text-align: center; position: relative; z-index: 1; padding-bottom: 28px; }
.hero-escudos { display: flex; justify-content: center; align-items: flex-end; gap: clamp(12px, 4vw, 26px); margin-bottom: 26px; }
.hero-escudos .escudo { height: clamp(84px, 24vw, 132px); width: auto; opacity: 0; animation: brotar .8s cubic-bezier(.2, .9, .3, 1.25) forwards; }
.hero-escudos .escudo:nth-child(1) { animation-delay: .05s; transform-origin: bottom; }
.hero-escudos .escudo:nth-child(2) { animation-delay: .2s; height: clamp(98px, 28vw, 152px); }
.hero-escudos .escudo:nth-child(3) { animation-delay: .35s; }
@keyframes brotar { from { opacity: 0; transform: translateY(24px) scale(.85); } to { opacity: 1; transform: none; } }

.hero-antetitulo {
  display: inline-block; font-family: var(--display); font-weight: 700; font-size: .85rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--tinta-2); margin-bottom: 12px;
}
.hero-titulo { font-size: clamp(2.4rem, 10.5vw, 4.6rem); font-weight: 800; max-width: 14ch; margin: 0 auto; }
.subrayado { position: relative; white-space: nowrap; }
.subrayado::after {
  content: ''; position: absolute; left: -2%; right: -2%; bottom: .02em; height: .2em; z-index: -1;
  background: var(--naranja); border-radius: 4px; transform: scaleX(0); transform-origin: left;
  animation: subrayar .7s 1s cubic-bezier(.65, 0, .35, 1) forwards;
}
@keyframes subrayar { to { transform: scaleX(1); } }
.hero-bajada { font-size: 1.12rem; color: var(--tinta-2); max-width: 34ch; margin: 16px auto 26px; }
.hero-acciones { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.hero-acciones .btn { flex: 1 1 200px; max-width: 260px; }

.horizonte { display: block; width: 100%; height: clamp(70px, 14vw, 130px); margin-top: 10px; }
.horizonte-relleno { opacity: .2; }
.horizonte-linea, .linea-deco {
  fill: none; stroke: var(--tinta); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round;
  vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1;
}
.horizonte-linea { animation: dibujar 2.2s .2s cubic-bezier(.65, 0, .35, 1) forwards; }

/* Divisor de secciones: la misma línea, más chica, se dibuja al aparecer */
.divisor, .pie-horizonte { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.divisor svg, .pie-horizonte svg { display: block; width: 100%; height: 44px; }
.linea-deco { stroke: var(--tinta-3); stroke-width: 2; }
.visible .linea-deco { animation: dibujar 1.8s cubic-bezier(.65, 0, .35, 1) forwards; }

/* ---------- Secciones ---------- */
.seccion { padding: 40px 0 44px; scroll-margin-top: 60px; }
.seccion-cabeza { margin-bottom: 22px; }
.seccion-cabeza h2 { font-size: clamp(1.9rem, 7.5vw, 2.8rem); font-weight: 800; }
.seccion-bajada { color: var(--tinta-2); margin-top: 8px; }
.totales { color: var(--tinta-2); margin-top: 8px; font-weight: 500; }
.totales strong { color: var(--tinta); font-family: var(--display); font-size: 1.1em; }

/* ---------- Marcador ---------- */
.marcador { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
@media (min-width: 760px) { .marcador { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.equipo {
  --c: var(--earth);
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 14px;
  padding: 16px; border-radius: var(--radio); background: var(--tarjeta); border: 1.5px solid var(--borde);
  box-shadow: var(--sombra); overflow: hidden;
}
.equipo--wind { --c: var(--wind); }
.equipo--water { --c: var(--water); }
.equipo .escudo { height: 48px; width: auto; grid-row: span 2; }
.equipo-nombre { font-family: var(--display); font-weight: 800; font-size: 1.35rem; line-height: 1; }
.equipo-detalle { color: var(--tinta-2); font-size: .92rem; grid-column: 2; }
.equipo-numero { grid-row: span 2; grid-column: 3; grid-row-start: 1; text-align: right; font-family: var(--display); font-weight: 800; font-size: 2rem; line-height: 1; }
.equipo-numero small { display: block; font-family: var(--texto); font-weight: 500; font-size: .75rem; color: var(--tinta-3); letter-spacing: .02em; }
.equipo-barra { grid-column: 1 / -1; height: 10px; border-radius: 99px; background: var(--papel-2); margin-top: 10px; overflow: hidden; }
.equipo-barra span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--c); transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.equipo-lider {
  position: absolute; top: 0; right: 16px; transform: translateY(-1px);
  background: var(--naranja); color: #2A1405; font-family: var(--display); font-weight: 700; font-size: .72rem;
  letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px 4px; border-radius: 0 0 10px 10px;
}
.equipo--lider { border-color: var(--naranja); }
.equipo--lider .equipo-numero { padding-top: 12px; }

/* ---------- Formulario ---------- */
.formulario {
  display: grid; gap: 20px; padding: 22px 18px;
  background: var(--tarjeta); border: 1.5px solid var(--borde); border-radius: 24px; box-shadow: var(--sombra);
}
@media (min-width: 560px) { .formulario { padding: 30px; } }
.campo { position: relative; display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.campo label, .campo legend { font-family: var(--display); font-weight: 700; font-size: 1.05rem; padding: 0; margin-bottom: 8px; }
.campo label { margin-bottom: 0; }
.opcional { font-family: var(--texto); font-weight: 400; color: var(--tinta-3); font-size: .9rem; }
.campo input, .campo textarea {
  width: 100%; padding: 13px 14px; font-size: 1rem; /* 16px evita el zoom en iPhone */
  background: var(--papel); border: 1.5px solid var(--borde); border-radius: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.campo textarea { resize: vertical; min-height: 110px; }
.campo input::placeholder, .campo textarea::placeholder { color: var(--tinta-3); }
.campo input:focus, .campo textarea:focus { outline: none; border-color: var(--naranja); box-shadow: 0 0 0 4px color-mix(in srgb, var(--naranja) 22%, transparent); }
.contador { justify-self: end; font-size: .82rem; color: var(--tinta-3); font-variant-numeric: tabular-nums; margin-top: -2px; }
.contador.cerca { color: var(--naranja-texto); font-weight: 600; }

.opciones-house { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.opcion-house { position: relative; }
.opcion-house input { position: absolute; opacity: 0; pointer-events: none; }
.opcion-house label {
  display: grid; justify-items: center; gap: 8px; padding: 14px 6px 12px; cursor: pointer;
  border: 2px solid var(--borde); border-radius: 16px; background: var(--papel);
  font-family: var(--display); font-weight: 700; font-size: 1rem; transition: border-color .2s, transform .15s, background-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.opcion-house .escudo { height: 46px; width: auto; filter: none; transition: transform .25s cubic-bezier(.2, .9, .3, 1.4); }
.opcion-house input:checked + label { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--tarjeta)); }
.opcion-house input:checked + label .escudo { transform: scale(1.1) rotate(-4deg); }
.opcion-house input:focus-visible + label { outline: 3px solid var(--naranja); outline-offset: 2px; }

.form-error { color: #C0350F; font-weight: 600; min-height: 0; }
:root[data-theme="dark"] .form-error { color: #FF8A6B; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .form-error { color: #FF8A6B; } }
.form-error:empty { display: none; }

/* ---------- Chips ---------- */
.chips { display: flex; gap: 8px; }
.chips-envolver { flex-wrap: wrap; }
.chips-desliza {
  overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px;
  scroll-snap-type: x proximity; scroll-padding-inline: 16px; -webkit-overflow-scrolling: touch;
}
.chips-desliza::-webkit-scrollbar { display: none; }
.chip { position: relative; flex: none; scroll-snap-align: start; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip label, button.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 7px 15px;
  border-radius: 999px; border: 1.5px solid var(--borde); background: var(--tarjeta);
  font-weight: 600; font-size: .95rem; white-space: nowrap; cursor: pointer; transition: all .18s;
  -webkit-tap-highlight-color: transparent;
}
.chip .escudo { height: 18px; width: auto; filter: none; }
.chip input:checked + label, button.chip[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: var(--papel); }
.chip input:focus-visible + label { outline: 3px solid var(--naranja); outline-offset: 2px; }

/* ---------- Herramientas de la lista ---------- */
.herramientas { display: grid; gap: 12px; margin-bottom: 14px; }
.segmentado { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: var(--papel-2); border-radius: 999px; max-width: 360px; }
.segmentado button { min-height: 42px; border: 0; background: transparent; border-radius: 999px; font-weight: 700; font-family: var(--display); font-size: 1rem; color: var(--tinta-2); transition: all .2s; }
.segmentado button[aria-pressed="true"] { background: var(--tarjeta); color: var(--tinta); box-shadow: 0 2px 8px -3px rgba(60, 40, 15, .35); }
.mostrando { color: var(--tinta-3); font-size: .9rem; margin-bottom: 12px; }

/* ---------- Tarjetas de propuestas ---------- */
.propuestas { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
@media (min-width: 760px) { .propuestas { grid-template-columns: repeat(2, 1fr); gap: 18px; } }
.propuesta {
  --c: var(--earth); --ct: var(--earth-texto);
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 18px 18px 16px 22px; border-radius: var(--radio);
  background: var(--tarjeta); border: 1.5px solid var(--borde); box-shadow: var(--sombra);
  animation: entrar .5s cubic-bezier(.2, .8, .2, 1) backwards;
  overflow: hidden;
}
.propuesta::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c); }
.propuesta--wind { --c: var(--wind); --ct: var(--wind-texto); }
.propuesta--water { --c: var(--water); --ct: var(--water-texto); }
@keyframes entrar { from { opacity: 0; transform: translateY(14px); } }

.propuesta-cabeza { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.propuesta-cabeza .escudo { height: 22px; width: auto; filter: none; }
.etiqueta-house { font-family: var(--display); font-weight: 800; color: var(--ct); font-size: .95rem; }
.etiqueta-cat {
  font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 99px;
  background: var(--papel-2); color: var(--tinta-2); margin-left: auto;
}
.propuesta-titulo { font-size: 1.3rem; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.propuesta-texto { color: var(--tinta-2); overflow-wrap: anywhere; white-space: pre-line; }
.propuesta-pie { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 6px; }
.propuesta-autor { font-size: .88rem; color: var(--tinta-3); min-width: 0; flex: 1; }
.propuesta-autor strong { color: var(--tinta-2); font-weight: 600; }

.btn-borrar {
  border: 1.5px solid #C0350F; color: #C0350F; background: transparent; border-radius: 999px;
  padding: 6px 12px; font-weight: 700; font-size: .85rem; min-height: 40px;
}
:root[data-theme="dark"] .btn-borrar { color: #FF8A6B; border-color: #FF8A6B; }

/* Agradecimiento al enviar: el ícono de la house "crece" */
.gracias {
  --c: var(--earth); --ct: var(--earth-texto);
  text-align: center; padding: 34px 20px 28px; display: grid; justify-items: center; gap: 10px;
  background: var(--tarjeta); border: 1.5px solid var(--borde); border-radius: 24px; box-shadow: var(--sombra);
  outline: none;
}
.gracias h3 { font-size: 1.6rem; font-weight: 800; }
.gracias p { color: var(--tinta-2); margin-bottom: 10px; }
.gracias p strong { color: var(--ct); }
.gracias-icono {
  position: relative; width: 96px; height: 96px; display: grid; place-items: center; border-radius: 50%;
  background: color-mix(in srgb, var(--c) 16%, var(--tarjeta)); margin-bottom: 6px;
}
.icono-house { width: 56px; height: 56px; overflow: visible; }
.icono-house path, .icono-house polygon { fill: var(--ct); stroke: none; }
.icono-house .i-tallo { fill: none; stroke: var(--ct); stroke-width: 2.2; stroke-linecap: round; }
.crece .gracias-icono { animation: brotar .6s cubic-bezier(.2, .9, .3, 1.3); }
.crece .i-tallo { stroke-dasharray: 10; stroke-dashoffset: 10; animation: tallo .45s .2s ease-out forwards; }
.crece .i-hoja { transform-box: fill-box; transform: scale(0); animation: hoja .5s .55s cubic-bezier(.2, .9, .3, 1.6) forwards; }
.crece .i-hoja-a { transform-origin: 100% 100%; }
.crece .i-hoja-b { transform-origin: 0% 100%; animation-delay: .7s; }
.crece .i-gota { transform-box: fill-box; transform-origin: 50% 100%; animation: gota .8s .2s cubic-bezier(.2, .9, .3, 1.5) backwards; }
.crece .i-pajaro { transform-box: fill-box; transform-origin: center; animation: pajaro .8s .2s cubic-bezier(.2, .9, .3, 1.4) backwards; }
@keyframes tallo { to { stroke-dashoffset: 0; } }
@keyframes hoja { to { transform: scale(1); } }
@keyframes gota { 0% { transform: translateY(-24px) scale(.4); opacity: 0; } 60% { transform: translateY(0) scale(1.15, .85); opacity: 1; } }
@keyframes pajaro { 0% { transform: translate(-22px, 14px) scale(.4) rotate(-15deg); opacity: 0; } }
.chispa {
  position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%;
  background: var(--naranja); pointer-events: none; animation: chispa .85s ease-out forwards;
}
.chispa:nth-child(even) { background: var(--c); }
@keyframes chispa { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

/* Estado vacío / cargando */
.vacio {
  grid-column: 1 / -1; text-align: center; padding: 36px 18px; border: 2px dashed var(--borde);
  border-radius: var(--radio); color: var(--tinta-2);
}
.vacio strong { display: block; font-family: var(--display); font-size: 1.3rem; color: var(--tinta); margin-bottom: 4px; }

/* ---------- Pie ---------- */
.pie { padding: 10px 0 calc(36px + env(safe-area-inset-bottom)); margin-top: 20px; }
.pie-interior { text-align: center; display: grid; justify-items: center; gap: 6px; padding-top: 24px; }
.pie-escudos { display: flex; gap: 10px; margin-bottom: 8px; }
.pie-escudos .escudo { height: 44px; width: auto; }
.pie-titulo { font-family: var(--display); font-weight: 800; font-size: 1.3rem; }
.pie-texto { color: var(--tinta-2); }
.pie-admin { margin-top: 18px; background: none; border: 0; color: var(--tinta-3); font-size: .8rem; text-decoration: underline; padding: 8px; }

/* ---------- Avisos ---------- */
.aviso-demo {
  padding: 9px 0; font-size: .85rem; line-height: 1.4;
  background: color-mix(in srgb, var(--naranja) 18%, var(--papel)); color: var(--tinta);
  border-bottom: 1px solid color-mix(in srgb, var(--naranja) 35%, transparent);
}
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 70;
  transform: translate(-50%, 140%); max-width: calc(100% - 32px); width: max-content;
  padding: 12px 18px; border-radius: 14px; background: var(--tinta); color: var(--papel);
  font-weight: 600; box-shadow: var(--sombra); visibility: hidden;
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.2), visibility 0s .35s;
}
.toast.visible { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }
.toast.error { background: #B8330E; color: #fff; }

.dialogo {
  width: min(420px, calc(100% - 32px)); border: 0; border-radius: 22px; padding: 24px;
  background: var(--tarjeta); color: var(--tinta); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5);
}
.dialogo::backdrop { background: rgba(22, 19, 15, .55); backdrop-filter: blur(3px); }
.dialogo h2 { font-size: 1.6rem; margin-bottom: 6px; }
.dialogo p { color: var(--tinta-2); margin-bottom: 14px; }
.dialogo input { width: 100%; padding: 13px 14px; border-radius: 14px; border: 1.5px solid var(--borde); background: var(--papel); font-size: 1rem; }
.dialogo .form-error { margin: 10px 0 0; }
.dialogo-acciones { display: flex; gap: 10px; margin-top: 18px; }
.dialogo-acciones .btn { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* =========================================================
   VERSIÓN SOLO EARTH: verde como color principal, marcador por año
   ========================================================= */
.solo-earth { --c: var(--earth); --ct: var(--earth-texto); }
.solo-earth .hero::after { background: radial-gradient(closest-side, color-mix(in srgb, var(--naranja) 26%, transparent), transparent); }
.solo-earth .hero::before { /* resplandor verde bajo el horizonte */
  content: ''; position: absolute; z-index: -1; left: 50%; bottom: -160px; width: 900px; height: 360px;
  transform: translateX(-50%); background: radial-gradient(closest-side, color-mix(in srgb, var(--earth) 22%, transparent), transparent);
}
.solo-earth .hero-antetitulo { color: var(--earth-texto); }
.solo-earth .seccion-cabeza h2 { color: var(--tinta); }
.solo-earth .seccion-cabeza h2::after {
  content: ''; display: block; width: 56px; height: 6px; margin-top: 12px; border-radius: 99px;
  background: linear-gradient(90deg, var(--earth) 60%, var(--naranja) 60%);
}

.hero-escudo { display: flex; justify-content: center; margin-bottom: 24px; }
.hero-escudo .escudo {
  height: clamp(130px, 38vw, 190px); width: auto; opacity: 0;
  animation: brotar .8s .05s cubic-bezier(.2, .9, .3, 1.25) forwards;
}
.horizonte-relleno--earth { fill: var(--earth); opacity: .22; }

/* Marcador por año */
.marcador-anios { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 760px) { .marcador-anios { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.anio {
  --c: var(--earth);
  position: relative; display: grid; gap: 2px; padding: 16px 14px 14px; min-width: 0;
  border-radius: var(--radio); background: var(--tarjeta); border: 1.5px solid var(--borde); box-shadow: var(--sombra); overflow: hidden;
}
.anio-nombre { font-family: var(--display); font-weight: 800; font-size: 1.1rem; color: var(--earth-texto); }
.anio-numero { font-family: var(--display); font-weight: 800; font-size: 2.5rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.anio-detalle { font-size: .82rem; color: var(--tinta-3); }
.anio .equipo-barra { margin-top: 8px; }
.anio--lider { border-color: var(--naranja); }
.anio--lider .equipo-barra span { background: var(--naranja); }
.anio .equipo-lider { right: 12px; }

/* Selector de año en el formulario */
.opciones-anio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 560px) { .opciones-anio { grid-template-columns: repeat(6, 1fr); } }
.opcion-anio { position: relative; }
.opcion-anio input { position: absolute; opacity: 0; pointer-events: none; }
.opcion-anio label {
  display: grid; justify-items: center; padding: 10px 4px 8px; cursor: pointer;
  border: 2px solid var(--borde); border-radius: 16px; background: var(--papel);
  transition: border-color .2s, background-color .2s, transform .15s; -webkit-tap-highlight-color: transparent;
}
.opcion-anio label:active { transform: scale(.96); }
.opcion-anio-num { font-family: var(--display); font-weight: 800; font-size: 1.6rem; line-height: 1.1; }
.opcion-anio-txt { font-size: .8rem; color: var(--tinta-3); }
.opcion-anio input:checked + label { border-color: var(--earth); background: var(--earth); color: #fff; }
.opcion-anio input:checked + label .opcion-anio-txt { color: rgba(255, 255, 255, .85); }
.opcion-anio input:focus-visible + label { outline: 3px solid var(--naranja); outline-offset: 2px; }

/* Etiqueta de año en las tarjetas del admin */
.etiqueta-anio { font-family: var(--display); font-weight: 800; color: var(--earth-texto); font-size: .95rem; }

/* Escudo único en barra y pie */
.solo-earth .marca-escudos .escudo { height: 30px; }
.solo-earth .pie-escudos .escudo { height: 56px; }
