/* ============================================================
   TORNEIG DE SA LLUM — Estilos
   Tema: estadio nocturno (focos, césped, marcador)
   ============================================================ */

:root {
  --bg: #0a0f14;
  --bg-soft: #101820;
  --bg-card: #141e29;
  --bg-card-hover: #18242f;
  --line: #24313f;
  --text: #eef4f8;
  --text-soft: #9db0be;
  --red: #e6334d;
  --red-dark: #b81f36;
  --gold: #f2b441;
  --green: #3ecf6f;
  --green-dark: #1d7a43;
  --font-display: "Oswald", "Archivo", sans-serif;
  --font-body: "Archivo", system-ui, sans-serif;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

.container { max-width: 1160px; margin: 0 auto; padding: 0 22px; }
a { color: inherit; }

:where(a, button, [tabindex]):focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* ============ HEADER ============ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(10, 15, 20, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo {
  width: 40px; height: 50px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .5);
  border: 1px solid rgba(255, 255, 255, .15);
}
.brand-ball {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--red), var(--red-dark));
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 6px 18px rgba(230, 51, 77, .4);
  animation: ballPulse 3.2s ease-in-out infinite;
}
@keyframes ballPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-size: 1.02rem; letter-spacing: .04em; text-transform: uppercase; }
.brand-text small { color: var(--text-soft); font-size: .72rem; }

.main-nav { display: flex; gap: 26px; }
.main-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: .88rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-soft);
  position: relative;
  transition: color .2s;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--red);
  transition: width .25s;
}
.main-nav a:hover { color: var(--text); }
.main-nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 16px; }

.lang-switch {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
}
.lang-btn {
  background: none; border: 0; cursor: pointer;
  color: var(--text-soft);
  font-family: var(--font-display);
  font-size: .82rem; letter-spacing: .06em;
  padding: 2px 6px;
  border-radius: 999px;
  transition: color .2s, background .2s;
}
.lang-btn.active { color: #fff; background: var(--red); }
.lang-sep { color: var(--line); font-size: .8rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none; border: 0; cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px;
  background: var(--text);
  transition: transform .25s, opacity .25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 130px 22px 120px;
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(230, 51, 77, .22), transparent 60%),
    radial-gradient(ellipse 70% 45% at 50% 108%, rgba(20, 83, 45, .55), transparent 65%),
    var(--bg);
  overflow: hidden;
}

.hero-floodlights { position: absolute; inset: 0; pointer-events: none; }
.floodlight {
  position: absolute;
  top: -70px;
  width: 340px; height: 340px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .5;
  animation: flicker 6s ease-in-out infinite;
}
.fl-left  { left: -90px;  background: rgba(255, 244, 214, .55); }
.fl-right { right: -90px; background: rgba(255, 244, 214, .55); animation-delay: 3s; }
@keyframes flicker {
  0%, 100% { opacity: .45; }
  48% { opacity: .62; }
  52% { opacity: .5; }
  70% { opacity: .65; }
}

.hero-inner { position: relative; z-index: 2; width: min(100%, 1040px); }

.hero-lockup {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(0, 3fr);
  align-items: center;
  gap: clamp(28px, 5vw, 66px);
  width: 100%;
}
.hero-logo-column {
  display: grid;
  place-items: center;
  min-width: 0;
}
.hero-title-column { min-width: 0; text-align: left; }

.hero-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: .85rem;
  letter-spacing: .28em;
  color: var(--gold);
  border: 1px solid rgba(242, 180, 65, .45);
  border-radius: 999px;
  padding: 8px 22px;
  margin-bottom: 26px;
  animation: fadeUp .8s ease both;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 6rem);
  line-height: .98;
  letter-spacing: .02em;
  text-transform: uppercase;
  animation: fadeUp .8s .1s ease both;
  text-align: left;
}
.hero-title span { display: block; color: var(--text); }
.hero-title em {
  display: block;
  font-style: normal;
  background: linear-gradient(100deg, #ff5d76, var(--red) 40%, #ff8c5a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin: 24px auto 0;
  max-width: 620px;
  color: var(--text-soft);
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  animation: fadeUp .8s .2s ease both;
}

.hero-cta {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  margin-top: 36px;
  animation: fadeUp .8s .3s ease both;
}

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: .95rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 30px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s, color .2s, border-color .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  box-shadow: 0 10px 28px rgba(230, 51, 77, .35);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(230, 51, 77, .5); }
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, .03);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-3px); }

.hero-pitch { position: absolute; inset: auto 0 0 0; height: 190px; pointer-events: none; opacity: .5; }
.pitch-line {
  position: absolute; left: 0; right: 0; bottom: 90px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
}
.pitch-circle {
  position: absolute; left: 50%; bottom: -130px;
  width: 320px; height: 320px;
  border: 2px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  transform: translateX(-50%);
}

/* Cuenta atrás */
.countdown { margin-top: 54px; animation: fadeUp .8s .45s ease both; }
.countdown-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .8rem;
  color: var(--text-soft);
}
.countdown-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.cd-cell {
  min-width: 88px;
  background: linear-gradient(180deg, var(--bg-card), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 12px 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 12px 26px rgba(0,0,0,.35);
}
.cd-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.cd-label {
  display: block;
  margin-top: 6px;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--text-soft);
}
.cd-sep {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--red);
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: .2; } }
.countdown-match { margin-top: 16px; font-size: .9rem; color: var(--text-soft); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ STATS ============ */
.stats { position: relative; z-index: 3; margin-top: -70px; padding-bottom: 20px; }
.stats-grid {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 22px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat-card {
  background: linear-gradient(180deg, var(--bg-card), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .25s, border-color .25s;
}
.stat-card:hover { transform: translateY(-6px); border-color: var(--red); }
.stat-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--red);
  font-variant-numeric: tabular-nums;
}
.stat-num.gold { color: var(--gold); }
.stat-label {
  margin-top: 6px;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text-soft);
}

/* ============ SECCIONES GENERALES ============ */
.section { padding: 90px 0; }
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  text-transform: uppercase;
  letter-spacing: .03em;
  text-align: center;
}
.section-title::after {
  content: "";
  display: block;
  width: 70px; height: 4px;
  margin: 16px auto 0;
  background: linear-gradient(90deg, var(--red), var(--gold));
  border-radius: 2px;
}
.section-subtitle {
  max-width: 640px;
  margin: 18px auto 0;
  text-align: center;
  color: var(--text-soft);
}

/* ============ TABS DE CATEGORÍAS ============ */
.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 44px 0 34px;
}
.cat-tab {
  font-family: var(--font-display);
  font-size: .85rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-soft);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: all .22s;
}
.cat-tab:hover { color: var(--text); border-color: var(--red); transform: translateY(-2px); }
.cat-tab.active {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 22px rgba(230, 51, 77, .35);
}
.cat-tab .tab-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 8px;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}
.cat-tab .tab-dot.off { background: #5c6b7a; box-shadow: none; }

/* ============ PANEL DE CATEGORÍA ============ */
.cat-panel { animation: fadeUp .4s ease both; }
.cat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 18px;
  margin-bottom: 8px;
}
.cat-name { font-family: var(--font-display); font-size: 1.5rem; text-transform: uppercase; letter-spacing: .03em; }
.cat-system { color: var(--gold); font-size: .85rem; letter-spacing: .05em; text-transform: uppercase; }
.cat-hint { color: var(--text-soft); font-size: .85rem; margin-bottom: 26px; }

.cat-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 26px;
  align-items: start;
}

/* ---- Partidos ---- */
.matchday {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 18px;
  overflow: hidden;
}
.matchday-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, .03);
  border-bottom: 1px solid var(--line);
}
.matchday-round {
  font-family: var(--font-display);
  font-size: .8rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--red);
}
.matchday-date { font-size: .85rem; color: var(--text-soft); }

.match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
}
.match + .match { border-top: 1px dashed var(--line); }
.match-team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.match-team.home { justify-content: flex-end; text-align: right; }
.match-team-name { font-weight: 600; font-size: .95rem; line-height: 1.25; }
.match-team-name.winner { color: var(--gold); }
.team-badge {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  border: 2px solid rgba(255,255,255,.18);
}

.match-score { display: flex; align-items: center; gap: 6px; }
.score-input {
  width: 44px; height: 44px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  -moz-appearance: textfield;
  appearance: textfield;
}
.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.score-input:hover { border-color: var(--gold); }
.score-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 180, 65, .25);
  transform: scale(1.06);
}
.score-input.filled { border-color: var(--green); color: var(--green); }
.score-sep { font-family: var(--font-display); color: var(--text-soft); font-size: 1.1rem; }

.match-meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: .78rem;
  color: var(--text-soft);
}
.match-meta .match-time { color: var(--gold); font-weight: 600; }
.inaugural-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .68rem;
}
.inaugural-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }

.reset-row { text-align: center; margin-top: 6px; }
.reset-btn {
  background: none;
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: .8rem;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s;
}
.reset-btn:hover { border-color: var(--red); color: var(--red); }

/* ---- Clasificación ---- */
.standings-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: 96px;
}
.standings-head {
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--green-dark), #14532d);
  font-family: var(--font-display);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.standings-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .68rem;
  color: #d3f9d8;
}
.standings-live::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: blink 1.4s infinite;
}

.standings-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.standings-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--gold) var(--bg-soft);
}
.standings-scroll:focus-visible { outline-offset: -3px; }
.standings-table th {
  font-family: var(--font-display);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.standings-table th:first-child { text-align: left; padding-left: 16px; }
.standings-table td {
  padding: 11px 8px;
  border-bottom: 1px solid rgba(36, 49, 63, .5);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.standings-table td:first-child { text-align: left; padding-left: 16px; font-weight: 600; }
.standings-table tr:last-child td { border-bottom: 0; }
.standings-table tr.leader td { background: rgba(242, 180, 65, .07); }
.standings-table tr.leader td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.standings-table td.pts { font-family: var(--font-display); font-weight: 700; color: var(--gold); font-size: 1rem; }
.pos-num {
  display: inline-block;
  width: 22px;
  color: var(--text-soft);
  font-family: var(--font-display);
  font-size: .8rem;
}
tr.leader .pos-num { color: var(--gold); }
.standings-empty { padding: 28px 20px; text-align: center; color: var(--text-soft); font-size: .88rem; }
.row-flash { animation: rowFlash .8s ease; }
@keyframes rowFlash { 0% { background: rgba(62, 207, 111, .25); } 100% { background: transparent; } }

/* ---- Categoría pendiente ---- */
.pending-card {
  text-align: center;
  padding: 70px 26px;
  background: var(--bg-card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.pending-icon {
  width: 66px; height: 66px;
  margin: 0 auto 20px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(242, 180, 65, .1);
  border: 1px solid rgba(242, 180, 65, .35);
  color: var(--gold);
}
.pending-title { font-family: var(--font-display); font-size: 1.25rem; text-transform: uppercase; letter-spacing: .05em; }
.pending-desc { margin-top: 8px; color: var(--text-soft); font-size: .92rem; }

/* ============ HISTORIA ============ */
.section-history {
  background:
    radial-gradient(ellipse 60% 40% at 80% 10%, rgba(242, 180, 65, .06), transparent),
    var(--bg-soft);
}

.visits { margin: 50px 0 60px; text-align: center; }
.visits-title { font-family: var(--font-display); font-size: 1.3rem; text-transform: uppercase; letter-spacing: .05em; }
.visits-subtitle { color: var(--text-soft); font-size: .9rem; margin-top: 6px; }
.visits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 26px;
}
.visit-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 18px;
  transition: transform .25s, border-color .25s;
}
.visit-card:hover { transform: translateY(-5px); border-color: var(--gold); }
.visit-team { font-family: var(--font-display); font-size: 1.15rem; text-transform: uppercase; letter-spacing: .04em; }
.visit-times {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(242, 180, 65, .4);
  border-radius: 999px;
  padding: 3px 12px;
}
.visit-years { margin-top: 10px; color: var(--text-soft); font-size: .85rem; font-variant-numeric: tabular-nums; }

/* Archivo documental */
.history-records,
.history-archive { margin: 70px auto; text-align: center; }
.history-block-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.history-block-subtitle {
  max-width: 680px;
  margin: 8px auto 0;
  color: var(--text-soft);
  font-size: .92rem;
}
.history-records-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 30px;
  text-align: left;
}
.history-record-card {
  position: relative;
  min-height: 160px;
  padding: 22px;
  background: linear-gradient(145deg, rgba(242, 180, 65, .08), var(--bg-card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.history-record-years {
  display: block;
  color: var(--gold);
  font: 600 .72rem var(--font-display);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.history-record-value {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font: 700 2rem/1 var(--font-display);
}
.history-record-card p { margin-top: 10px; color: var(--text-soft); font-size: .85rem; line-height: 1.45; }

.history-archive { max-width: 920px; }
.archive-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}
.archive-toolbar label {
  color: var(--text-soft);
  font-size: .85rem;
  font-weight: 600;
}
.archive-toolbar select {
  min-width: 230px;
  padding: 10px 38px 10px 14px;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: 600 .88rem var(--font-body);
  cursor: pointer;
}
.archive-toolbar select:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.archive-edition {
  margin-top: 18px;
  padding: 26px;
  background: var(--bg-card);
  border: 1px solid rgba(242, 180, 65, .35);
  border-radius: var(--radius);
  text-align: left;
  box-shadow: var(--shadow);
}
.archive-edition-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.archive-edition-head > div { display: flex; align-items: baseline; gap: 12px; }
.archive-edition-head h4 { font: 700 2.1rem/1 var(--font-display); }
.archive-edition-roman {
  color: var(--red);
  font: 700 .78rem var(--font-display);
  letter-spacing: .14em;
  border: 1px solid rgba(230, 51, 77, .5);
  border-radius: 999px;
  padding: 4px 11px;
}
.archive-edition-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.archive-edition-head a { color: var(--gold); font-size: .82rem; text-decoration: none; }
.archive-edition-head a:hover { text-decoration: underline; }
.archive-edition-head .archive-edition-link-primary {
  padding: 9px 13px;
  color: var(--bg);
  background: var(--gold);
  border-radius: 999px;
  font-weight: 800;
}
.archive-edition-head .archive-edition-link-primary:hover {
  color: var(--bg);
  text-decoration: none;
  filter: brightness(1.08);
}
.archive-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.archive-facts span {
  color: var(--text-soft);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: .78rem;
}
.archive-facts strong { color: var(--gold); }
.archive-warning {
  margin-top: 16px;
  padding: 10px 12px;
  color: var(--gold);
  background: rgba(242, 180, 65, .08);
  border-left: 3px solid var(--gold);
  font-size: .82rem;
}
.archive-winners {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin-top: 18px;
}
.archive-winner-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(36, 49, 63, .7);
}
.archive-winner-row dt { color: var(--text-soft); font-size: .78rem; }
.archive-winner-row dd { margin: 0; color: var(--text); font-size: .84rem; font-weight: 700; text-align: right; }
.archive-navigation { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.archive-nav-btn {
  padding: 8px 14px;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 600 .76rem var(--font-body);
  cursor: pointer;
}
.archive-nav-btn:hover:not(:disabled) { color: var(--gold); border-color: var(--gold); }
.archive-nav-btn:disabled { opacity: .35; cursor: not-allowed; }

/* Timeline */
.timeline { position: relative; max-width: 760px; margin: 0 auto; padding-left: 34px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 8px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--red), var(--gold), var(--green));
  border-radius: 2px;
}
.tl-item {
  position: relative;
  padding: 0 0 30px 22px;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s ease, transform .6s ease;
}
.tl-item.visible { opacity: 1; transform: translateY(0); }
.tl-item::before {
  content: "";
  position: absolute;
  left: -32px; top: 7px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--red);
  transition: border-color .3s, box-shadow .3s;
}
.tl-item:hover::before { border-color: var(--gold); box-shadow: 0 0 14px rgba(242, 180, 65, .7); }
.tl-year {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--gold);
  line-height: 1.1;
}
.tl-edition {
  display: inline-block;
  margin-left: 10px;
  font-family: var(--font-display);
  font-size: .72rem;
  letter-spacing: .12em;
  color: var(--red);
  border: 1px solid rgba(230, 51, 77, .5);
  border-radius: 999px;
  padding: 2px 10px;
  vertical-align: middle;
}
.tl-text { margin-top: 6px; color: var(--text-soft); font-size: .94rem; }

/* ============ LEYENDAS ============ */
.legends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 16px;
  margin-top: 46px;
}
.legend-card {
  position: relative;
  background: linear-gradient(180deg, var(--bg-card), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px 20px;
  overflow: hidden;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.legend-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--red), var(--gold));
  opacity: 0;
  transition: opacity .25s;
}
.legend-card:hover {
  transform: translateY(-6px);
  border-color: rgba(242, 180, 65, .55);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}
.legend-card:hover::before { opacity: 1; }
.legend-year {
  font-family: var(--font-display);
  font-size: .72rem;
  letter-spacing: .14em;
  color: var(--gold);
  text-transform: uppercase;
}
.legend-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  margin-top: 4px;
}
.legend-text { margin-top: 8px; color: var(--text-soft); font-size: .87rem; line-height: 1.55; }

/* ============ FOOTER ============ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 54px 0 44px;
  text-align: center;
  background: radial-gradient(ellipse 60% 100% at 50% 120%, rgba(20, 83, 45, .35), transparent), var(--bg);
}
.footer-brand {
  font-family: var(--font-display);
  letter-spacing: .2em;
  font-size: .9rem;
  color: var(--red);
}
.footer-credit { margin-top: 14px; color: var(--text-soft); font-size: .88rem; }
.footer-source { margin-top: 6px; color: var(--text-soft); font-size: .82rem; }
.footer-source a { color: var(--gold); text-decoration: none; }
.footer-source a:hover { text-decoration: underline; }
.footer-made { margin-top: 14px; font-size: .78rem; color: #5c6b7a; letter-spacing: .06em; }

/* ============ RESPONSIVE ============ */
@media (max-width: 940px) {
  .cat-grid { grid-template-columns: 1fr; }
  .standings-card { position: static; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .visits-grid { grid-template-columns: 1fr; max-width: 420px; margin-left: auto; margin-right: auto; }
  .history-records-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .main-nav {
    position: fixed;
    inset: 73px 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: rgba(10, 15, 20, .97);
    border-bottom: 1px solid var(--line);
    padding: 10px 22px 18px;
    transform: translateY(-130%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .3s ease, visibility 0s linear .3s;
  }
  .main-nav.open {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }
  .main-nav a { padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .main-nav a:last-child { border-bottom: 0; }
  .nav-toggle { display: flex; }
  .cd-cell { min-width: 66px; padding: 12px 8px 10px; }
  .cd-sep { display: none; }
  .countdown-grid { gap: 8px; }
  .match { gap: 8px; padding: 14px 12px; }
  .match-team-name { font-size: .82rem; }
  .team-badge { width: 28px; height: 28px; font-size: .55rem; }
  .score-input { width: 38px; height: 38px; font-size: 1.1rem; }
  .standings-table { min-width: 410px; }
  .section { padding: 64px 0; }
  .brand-text small { display: none; }
  .archive-winners { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding: 112px 18px 88px; }
  .hero-lockup { grid-template-columns: minmax(72px, 1fr) minmax(0, 3fr); gap: 16px; }
  .hero-badge { margin-bottom: 12px; padding: 6px 11px; font-size: .6rem; letter-spacing: .16em; }
  .hero-title { font-size: clamp(2.15rem, 11vw, 3rem); }
  .hero-title-honor { margin-top: 8px; font-size: clamp(.72rem, 3.6vw, 1rem); letter-spacing: .08em; }
}

@media (max-width: 420px) {
  .header-inner { padding: 10px 12px; gap: 8px; }
  .brand { min-width: 0; gap: 8px; }
  .brand-logo { width: 34px; height: 42px; flex: 0 0 auto; }
  .brand-text { min-width: 0; }
  .brand-text strong { font-size: .82rem; line-height: 1.05; }
  .header-actions { flex: 0 0 auto; gap: 8px; }
  .lang-switch { gap: 2px; padding: 4px 6px; }
  .lang-btn { padding: 2px 4px; }
  .main-nav { inset-block-start: 63px; }
  .history-records-grid { grid-template-columns: 1fr; }
  .archive-toolbar { align-items: stretch; flex-direction: column; text-align: left; }
  .archive-toolbar select { width: 100%; min-width: 0; }
  .archive-edition { padding: 20px 16px; }
  .archive-edition-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .archive-edition-links { justify-content: flex-start; }
  .archive-navigation { flex-direction: column; }
  .archive-nav-btn { width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 18px 10px; }
  .match-team-name { font-size: .74rem; }
}

/* ============ MODO ADMIN ============ */
.score-input:disabled {
  cursor: not-allowed;
  opacity: .45;
  border-style: dashed;
}
.score-input:disabled:hover { border-color: var(--line); }

.admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: 6px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.admin-bar.active { border: 1px solid rgba(62, 207, 111, .45); background: rgba(62, 207, 111, .06); }
.admin-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: var(--text-soft);
}
.admin-bar.active .admin-status { color: var(--green); }
.admin-actions { display: inline-flex; gap: 8px; }
.admin-btn {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-display);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s;
}
.admin-btn:hover { border-color: var(--gold); color: var(--gold); }
.admin-bar.active .admin-btn:hover { border-color: var(--red); color: var(--red); }

/* ============ ORÍGENES ============ */
.origins { margin: 56px 0 10px; text-align: center; }
.origins-title { font-family: var(--font-display); font-size: 1.5rem; text-transform: uppercase; letter-spacing: .04em; }
.origins-subtitle { color: var(--text-soft); font-size: .92rem; margin-top: 8px; }
.origins-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 30px;
  text-align: left;
}
.origin-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px 22px;
  overflow: hidden;
  transition: transform .25s, border-color .25s;
}
.origin-card:hover { transform: translateY(-5px); border-color: rgba(242, 180, 65, .5); }
.origin-num {
  position: absolute;
  top: 8px; right: 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3.2rem;
  color: rgba(255, 255, 255, .05);
  line-height: 1;
}
.origin-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--gold);
  padding-right: 40px;
}
.origin-card-text { margin-top: 10px; color: var(--text-soft); font-size: .88rem; line-height: 1.6; }

/* ============ PALMARÉS ============ */
.honours { margin-top: 70px; text-align: center; }
.honours-title { font-family: var(--font-display); font-size: 1.5rem; text-transform: uppercase; letter-spacing: .04em; }
.honours-subtitle { color: var(--text-soft); font-size: .92rem; margin-top: 8px; }
.honours-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 30px;
  text-align: left;
}
.honour-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: transform .25s, border-color .25s;
}
.honour-card:hover { transform: translateY(-5px); border-color: var(--gold); }
.honour-head { display: flex; align-items: baseline; gap: 12px; }
.honour-year {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--red);
}
.honour-edition {
  font-family: var(--font-display);
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
}
.honour-note { margin-top: 8px; color: var(--text-soft); font-size: .84rem; line-height: 1.55; }
.honour-rows { margin-top: 16px; border-top: 1px solid var(--line); }
.honour-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(36, 49, 63, .7);
  font-size: .86rem;
}
.honour-row:last-child { border-bottom: 0; }
.honour-cat { color: var(--text-soft); flex: 0 0 42%; }
.honour-teams { text-align: right; }
.honour-teams strong { color: var(--gold); font-weight: 700; }
.honour-teams em { display: block; font-style: normal; color: var(--text-soft); font-size: .78rem; }
.honour-teams small { display: block; color: var(--green); font-size: .74rem; }

@media (max-width: 940px) {
  .origins-grid { grid-template-columns: 1fr; max-width: 520px; margin-left: auto; margin-right: auto; }
  .honours-grid { grid-template-columns: 1fr; max-width: 520px; margin-left: auto; margin-right: auto; }
}

/* ============ ESCUDOS ============ */
.team-crest {
  flex: 0 0 auto;
  width: 38px; height: 46px;
  display: grid;
  place-items: center;
}
.team-crest img {
  max-width: 100%;
  max-height: 100%;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .55));
  transition: transform .2s;
}
.match:hover .team-crest img { transform: scale(1.1); }

/* Fila de equipos participantes */
.cat-teams {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 26px 0 30px;
}
.cat-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.cat-team:hover {
  transform: translateY(-5px);
  border-color: rgba(242, 180, 65, .5);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .4);
}
.cat-team .team-crest { width: 64px; height: 78px; }
.cat-team-name { font-weight: 700; font-size: .92rem; line-height: 1.2; }
.cat-team-note {
  font-size: .7rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Escudo en clasificación */
.standings-table .team-crest { width: 22px; height: 27px; display: inline-grid; vertical-align: middle; margin-right: 8px; }
.standings-table td:first-child { white-space: nowrap; }
.standing-team-name { vertical-align: middle; }

@media (max-width: 720px) {
  .team-crest { width: 30px; height: 37px; }
  .cat-team .team-crest { width: 52px; height: 64px; }
  .standings-table .team-crest { display: none; }
}

/* Título honorífico del hero */
.hero-title-honor {
  display: block;
  margin-top: 14px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(1rem, 2.6vw, 1.5rem);
  letter-spacing: .12em;
  color: var(--gold);
  text-transform: none;
}

/* ============ ELIMINATORIAS (BRACKET) ============ */
.bracket {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 18px;
}
.bracket-col { display: flex; flex-direction: column; gap: 0; }
.matchday-final { border-color: rgba(242, 180, 65, .55); box-shadow: 0 0 30px rgba(242, 180, 65, .12); }
.matchday-final .matchday-head { background: rgba(242, 180, 65, .08); }
.matchday-final .matchday-round { color: var(--gold); }

.ko-placeholder { color: var(--text-soft); font-style: italic; font-weight: 500; font-size: .82rem; }
.team-badge.ko-tbd {
  background: var(--bg-soft);
  border: 2px dashed var(--line);
  color: var(--text-soft);
  font-size: .9rem;
}

.penalty-picker,
.penalty-result {
  grid-column: 1 / -1;
  margin-top: 2px;
  text-align: center;
  font-size: .78rem;
}
.penalty-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-soft);
}
.penalty-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  background: var(--bg-soft);
  color: var(--text);
  font: 600 .74rem var(--font-body);
  cursor: pointer;
}
.penalty-btn:hover { border-color: var(--gold); }
.penalty-btn[aria-pressed="true"] {
  border-color: var(--green);
  background: rgba(62, 207, 111, .14);
  color: var(--green);
}
.penalty-result { color: var(--green); font-weight: 600; }
.penalty-result.pending { color: var(--gold); }

/* Banner campeón */
.champion-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 4px auto 26px;
  max-width: 520px;
  padding: 18px 28px;
  background: linear-gradient(135deg, rgba(242, 180, 65, .16), rgba(242, 180, 65, .05));
  border: 1px solid rgba(242, 180, 65, .55);
  border-radius: var(--radius);
  color: var(--gold);
  box-shadow: 0 12px 36px rgba(242, 180, 65, .15);
  animation: champGlow 2.4s ease-in-out infinite;
}
@keyframes champGlow {
  0%, 100% { box-shadow: 0 12px 36px rgba(242, 180, 65, .12); }
  50% { box-shadow: 0 12px 44px rgba(242, 180, 65, .32); }
}
.champion-label {
  display: block;
  font-family: var(--font-display);
  font-size: .72rem;
  letter-spacing: .3em;
  text-transform: uppercase;
}
.champion-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.45rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #fff;
}

@media (max-width: 940px) {
  .bracket { grid-template-columns: 1fr; }
}

/* ============ LOGO DEL TORNEO ============ */
.hero-logo {
  width: min(100%, 210px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .12);
  animation: fadeUp .8s ease both;
}

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