:root {
  --ink: #10221c;
  --forest: #0a3c2f;
  --forest-deep: #05281f;
  --lime: #d9ff53;
  --paper: #f5f4ec;
  --paper-warm: #ebe9dc;
  --white: #fffef9;
  --muted: #66756f;
  --line: rgba(16, 34, 28, .14);
  --danger: #a53128;
  --success: #176b4e;
  --shadow: 0 18px 55px rgba(7, 35, 27, .12);
  --radius: 22px;
  --display: "Arial Narrow", "Avenir Next Condensed", "Roboto Condensed", sans-serif;
  --body: "Trebuchet MS", "Avenir Next", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 74px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(245, 244, 236, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--forest);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.02em;
  text-decoration: none;
  text-transform: uppercase;
}
.brand__mark {
  position: relative;
  width: 32px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--forest);
  border-radius: 50%;
}
.brand__mark::before,
.brand__mark::after,
.brand__mark i { content: ""; position: absolute; background: var(--lime); }
.brand__mark::before { width: 2px; height: 23px; transform: rotate(42deg); }
.brand__mark::after { width: 18px; height: 2px; transform: rotate(-20deg); }
.brand__mark i { width: 5px; height: 5px; border-radius: 50%; right: 4px; bottom: 6px; }
.main-nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 42px); }
.main-nav a {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-decoration: none;
  text-transform: uppercase;
}
.main-nav a:hover { color: var(--success); }
.nav-toggle { display: none; border: 0; background: transparent; color: var(--forest); font-weight: 800; }

.hero {
  position: relative;
  min-height: 590px;
  padding: clamp(72px, 10vw, 130px) clamp(20px, 6vw, 92px) clamp(50px, 7vw, 90px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(370px, .9fr);
  gap: clamp(42px, 7vw, 110px);
  align-items: center;
  overflow: hidden;
  color: var(--white);
  background: var(--forest);
}
.hero::before {
  content: "";
  position: absolute;
  width: 52vw;
  aspect-ratio: 1;
  right: -15vw;
  top: -28vw;
  border: 1px solid rgba(217, 255, 83, .22);
  border-radius: 50%;
  box-shadow: 0 0 0 10vw rgba(255,255,255,.025), 0 0 0 20vw rgba(255,255,255,.018);
}
.hero__lines { position: absolute; inset: 0; opacity: .14; pointer-events: none; }
.hero__lines::before { content: ""; position: absolute; left: 50%; height: 100%; border-left: 1px solid var(--white); }
.hero__lines::after { content: ""; position: absolute; width: 120px; height: 240px; left: calc(50% - 60px); top: calc(50% - 120px); border: 1px solid var(--white); border-radius: 0 120px 120px 0; border-left: 0; }
.hero__content, .hero__scorecard { position: relative; z-index: 1; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--success);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.hero .eyebrow { color: var(--lime); }
.hero h1 {
  max-width: 690px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(60px, 9.5vw, 142px);
  font-stretch: condensed;
  font-weight: 900;
  letter-spacing: -.075em;
  line-height: .78;
  text-transform: uppercase;
}
.hero__meta { margin: 38px 0 0; display: flex; flex-wrap: wrap; gap: 12px 28px; font-weight: 800; }
.hero__meta span { display: inline-flex; align-items: center; gap: 9px; }
.hero__meta span::before { content: ""; width: 8px; height: 8px; background: var(--lime); border-radius: 50%; }
.hero__scorecard {
  padding: clamp(22px, 4vw, 38px);
  color: var(--ink);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 18px 18px 0 rgba(217,255,83,.95);
}
.scorecard__topline { display: flex; justify-content: space-between; font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.scorecard__topline time { color: var(--success); }
.scorecard__date { margin: 7px 0 26px; color: var(--muted); font-size: 13px; }
.scorecard__teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.score-team { display: flex; flex-direction: column; align-items: center; gap: 11px; min-width: 0; text-align: center; }
.score-team strong { font-size: 13px; line-height: 1.15; }
.scorecard__result { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 28px; }
.scorecard__result b { font-size: 44px; line-height: 1; }
.scorecard__result .versus { padding: 10px 9px; color: var(--white); background: var(--forest); border-radius: 50%; font-size: 12px; font-weight: 900; }

.team-mark {
  width: 34px; height: 34px; flex: 0 0 auto;
  display: grid; place-items: center;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
}
.team-mark img { width: 78%; height: 78%; object-fit: contain; }
.team-mark--placeholder { color: var(--forest); background: var(--lime); border-color: transparent; }
.team-mark--large { width: 70px; height: 70px; font-size: 18px; }
.team-mark--hero { width: 100px; height: 100px; font-size: 25px; }

.section { padding: clamp(70px, 10vw, 140px) clamp(20px, 6vw, 92px); }
.section-heading { margin-bottom: 38px; display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.section-heading h2, .tournament-copy h2, .admin-title h1 {
  margin: 0;
  color: var(--forest);
  font-family: var(--display);
  font-size: clamp(42px, 6vw, 78px);
  font-weight: 900;
  letter-spacing: -.055em;
  line-height: .9;
  text-transform: uppercase;
}
.section-heading > p { max-width: 420px; margin: 0; color: var(--muted); }
.standings-section { background: var(--white); }
.table-shell { overflow-x: auto; border-top: 4px solid var(--forest); }
.standings-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.standings-table th, .standings-table td { padding: 17px 14px; text-align: center; border-bottom: 1px solid var(--line); }
.standings-table thead th { color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.standings-table thead th:nth-child(2), .standings-table tbody th { text-align: left; }
.standings-table tbody th { min-width: 210px; }
.standings-table tbody tr:first-child { background: rgba(217,255,83,.18); }
.team-cell { display: inline-flex; align-items: center; gap: 12px; }
.position { width: 28px; height: 28px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: 12px; font-weight: 900; }
.standings-table tbody tr:first-child .position { color: var(--lime); background: var(--forest); border-color: var(--forest); }
.points { color: var(--forest); font-size: 19px; font-weight: 900; }
.table-note { margin: 16px 0 0; color: var(--muted); font-size: 11px; }

.schedule-section { background: var(--paper); }
.schedule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.day-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.day-card__header { padding: 24px 26px; display: flex; justify-content: space-between; align-items: start; color: var(--white); background: var(--forest); }
.day-card__header p { margin: 0 0 3px; color: var(--lime); font-size: 11px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.day-card__header h3 { margin: 0; font-size: 17px; }
.day-card__header > span { color: rgba(255,255,255,.65); font-size: 11px; }
.match-row { min-height: 82px; padding: 16px 24px; display: grid; grid-template-columns: 48px minmax(0, 1fr) 34px; gap: 16px; align-items: center; border-bottom: 1px solid var(--line); }
.match-row:last-child { border-bottom: 0; }
.match-row > time { color: var(--success); font-weight: 900; }
.match-row__teams, .match-row__score { display: grid; gap: 5px; }
.match-row__teams span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; font-weight: 800; }
.match-row__score { justify-items: center; color: var(--muted); }
.match-row__score b { min-width: 26px; padding: 1px 7px; color: var(--white); background: var(--forest); border-radius: 6px; text-align: center; }

.teams-section { color: var(--white); background: var(--forest-deep); }
.teams-section .eyebrow { color: var(--lime); }
.teams-section .section-heading h2 { color: var(--white); }
.team-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid rgba(255,255,255,.2); border-bottom: 1px solid rgba(255,255,255,.2); }
.team-card { position: relative; min-height: 290px; padding: 40px 25px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; border-right: 1px solid rgba(255,255,255,.2); }
.team-card:last-child { border-right: 0; }
.team-card h3 { margin: 0; font-family: var(--display); font-size: clamp(22px, 3vw, 36px); text-transform: uppercase; }
.team-card__number { position: absolute; left: 20px; top: 18px; color: rgba(255,255,255,.35); font-size: 11px; font-weight: 900; }

.tournament-section { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(50px, 10vw, 150px); align-items: start; background: var(--lime); }
.tournament-copy h2 { max-width: 570px; }
.tournament-copy > p:last-child { max-width: 510px; margin: 28px 0 0; font-size: 18px; }
.facts { margin: 0; border-top: 3px solid var(--forest); }
.facts div { padding: 18px 0; display: grid; grid-template-columns: 130px 1fr; gap: 25px; border-bottom: 1px solid rgba(10,60,47,.28); }
.facts dt { font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.facts dd { margin: 0; font-weight: 800; }
.site-footer { padding: 30px clamp(20px, 6vw, 92px); display: flex; justify-content: space-between; gap: 20px; color: rgba(255,255,255,.7); background: #041b15; font-size: 12px; }
.site-footer a { color: var(--lime); }
.live-indicator { position: fixed; z-index: 50; right: 18px; bottom: 18px; padding: 11px 15px; color: var(--white); background: var(--forest); border-radius: 30px; box-shadow: var(--shadow); font-size: 12px; font-weight: 800; }

/* Admin */
.admin-body { min-height: 100vh; background: #f0efe7; }
.admin-header { position: sticky; z-index: 20; top: 0; min-height: 72px; padding: 0 30px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--forest-deep); color: var(--white); }
.brand--admin { color: var(--white); }
.brand--admin small { display: block; color: rgba(255,255,255,.55); font-family: var(--body); font-size: 9px; letter-spacing: .08em; }
.admin-header__actions { display: flex; align-items: center; gap: 16px; }
.admin-header__actions form { margin: 0; }
.admin-layout { min-height: calc(100vh - 72px); display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.admin-nav { padding: 28px 18px; display: flex; flex-direction: column; gap: 7px; background: var(--white); border-right: 1px solid var(--line); }
.admin-nav a { padding: 13px 15px; display: flex; align-items: center; gap: 12px; border-radius: 11px; color: var(--muted); font-size: 14px; font-weight: 800; text-decoration: none; }
.admin-nav a span { color: #a8b0ac; font-size: 9px; }
.admin-nav a.active { color: var(--forest); background: var(--lime); }
.admin-nav .admin-nav__live { color: var(--white); background: var(--forest); }
.admin-nav .admin-nav__live span { color: #ff6257; font-size: 12px; }
.admin-main { width: min(1050px, 100%); padding: clamp(30px, 5vw, 68px); }
.admin-title { margin-bottom: 22px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.admin-title h1 { font-size: clamp(39px, 6vw, 68px); }
.admin-intro { max-width: 640px; margin: -7px 0 35px; color: var(--muted); }
.progress-pill { padding: 8px 13px; color: var(--forest); background: var(--lime); border-radius: 30px; font-size: 11px; font-weight: 900; white-space: nowrap; }
.result-groups { display: grid; gap: 24px; }
.result-day { overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 18px; }
.result-day > header { padding: 17px 21px; color: var(--white); background: var(--forest); }
.result-day > header p { margin: 0; color: var(--lime); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.result-day > header h2 { margin: 2px 0 0; font-size: 16px; }
.result-form { position: relative; min-height: 80px; padding: 12px 18px; display: grid; grid-template-columns: 50px minmax(110px, 1fr) 54px 16px 54px minmax(110px, 1fr) 82px; gap: 9px; align-items: center; border-bottom: 1px solid var(--line); }
.result-form:last-child { border-bottom: 0; }
.result-form > time { color: var(--success); font-size: 13px; font-weight: 900; }
.result-form__team { display: flex; align-items: center; justify-content: flex-end; gap: 9px; min-width: 0; text-align: right; font-size: 13px; font-weight: 800; }
.result-form__team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-form__team--away { justify-content: flex-start; text-align: left; }
.score-input { width: 54px; height: 48px; padding: 4px; border: 1px solid #b6bfba; border-radius: 10px; background: #fafaf6; font-size: 21px; font-weight: 900; text-align: center; }
.score-input:focus { outline: 3px solid rgba(217,255,83,.7); border-color: var(--forest); }
.score-separator { text-align: center; }
.result-form--saved { background: rgba(217,255,83,.08); }
.save-state { position: absolute; right: 20px; bottom: 2px; color: var(--success); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.button { min-height: 43px; padding: 10px 17px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; font-weight: 900; text-decoration: none; cursor: pointer; }
.button:disabled { opacity: .55; cursor: wait; }
.button--primary { color: var(--lime); background: var(--forest); }
.button--primary:hover { background: var(--forest-deep); }
.button--ghost { color: var(--white); border: 1px solid rgba(255,255,255,.3); background: transparent; }
.button--live { gap: 8px; color: var(--forest-deep); background: var(--lime); }
.button--live span { width: 8px; height: 8px; display: inline-block; background: #ef3c2f; border-radius: 50%; animation: live-pulse 1.4s ease-out infinite; }
.button--small { min-height: 34px; padding: 7px 12px; font-size: 11px; }
.button--wide { width: 100%; }
.button--save { min-height: 40px; padding: 8px 12px; color: var(--white); background: var(--forest); font-size: 11px; }
.button--danger { color: var(--danger); background: #f5ddd8; }
.text-button { padding: 5px; border: 0; color: rgba(255,255,255,.7); background: transparent; font-weight: 800; cursor: pointer; }
.text-button--danger { color: var(--danger); font-size: 12px; }

.manage-list { display: grid; gap: 10px; }
.manage-card, .create-panel { background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.manage-card summary, .create-panel > summary { padding: 17px 20px; display: flex; justify-content: space-between; gap: 20px; cursor: pointer; font-weight: 800; list-style: none; }
.manage-card summary::-webkit-details-marker, .create-panel summary::-webkit-details-marker { display: none; }
.manage-card summary small { color: var(--muted); font-weight: 500; }
.manage-form { padding: 20px; border-top: 1px solid var(--line); }
.create-panel { margin-top: 22px; border: 2px dashed #a7b3ad; background: transparent; }
.create-panel > summary { color: var(--success); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 900; }
.field span, .field small { color: var(--muted); font-weight: 500; }
.field input, .field select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #bfc7c3; border-radius: 10px; color: var(--ink); background: var(--white); }
.field input:focus, .field select:focus { outline: 3px solid rgba(217,255,83,.8); border-color: var(--forest); }
.field--full, .form-divider { grid-column: 1 / -1; }
.form-divider { width: 100%; border: 0; border-top: 1px solid var(--line); }
.form-actions { display: flex; gap: 10px; justify-content: space-between; }
.team-admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.team-admin-card { padding: 25px; display: flex; flex-direction: column; align-items: center; gap: 15px; background: var(--white); border: 1px solid var(--line); border-radius: 18px; }
.team-admin-card .field { width: 100%; }
.team-admin-card--new { border-style: dashed; background: transparent; }
.upload-field { width: 100%; padding: 11px 13px; border: 1px dashed #9eaaa4; border-radius: 10px; color: var(--success); font-size: 12px; font-weight: 900; text-align: center; cursor: pointer; }
.upload-field input { display: none; }
.team-admin-card > small { color: var(--muted); font-size: 10px; }
.settings-card { padding: clamp(22px, 4vw, 38px); background: var(--white); border: 1px solid var(--line); border-radius: 18px; }
.points-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.points-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.field-label { color: var(--ink) !important; font-weight: 900 !important; }
.rule-note { padding: 15px; display: flex; flex-direction: column; gap: 4px; background: var(--paper); border-radius: 10px; font-size: 12px; }
.rule-note span { color: var(--muted); }

.notice { margin-bottom: 20px; padding: 13px 15px; border-radius: 10px; font-size: 13px; font-weight: 800; }
.notice--success { color: #0d573d; background: #d9f5e5; }
.notice--error { color: #81271f; background: #f7ddd9; }
.auth-shell { min-height: 100vh; padding: 30px 18px; display: grid; place-items: center; background: var(--forest); }
.auth-shell::before { content: ""; position: fixed; inset: 0; opacity: .08; background: linear-gradient(90deg, transparent 49.8%, white 50%, transparent 50.2%); pointer-events: none; }
.auth-card { position: relative; width: min(440px, 100%); padding: clamp(26px, 5vw, 44px); background: var(--white); border-radius: var(--radius); box-shadow: 14px 14px 0 var(--lime); }
.install-card { width: min(690px, 100%); }
.auth-card h1 { margin: 0; color: var(--forest); font-family: var(--display); font-size: 48px; line-height: .95; text-transform: uppercase; }
.auth-card .muted { margin: 14px 0 25px; }
.muted { color: var(--muted); }
.auth-back { display: inline-block; margin-bottom: 30px; color: var(--muted); font-size: 12px; font-weight: 800; text-decoration: none; }
.stack-form { display: grid; gap: 17px; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 22px; padding: 13px 18px; transform: translate(-50%, 18px); opacity: 0; color: var(--white); background: var(--forest); border-radius: 30px; box-shadow: var(--shadow); font-size: 13px; font-weight: 900; transition: .2s ease; }
.toast--error { background: var(--danger); }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

/* Partido en directo */
.hero__scorecard--live { border: 3px solid var(--lime); box-shadow: 18px 18px 0 rgba(217,255,83,.95), 0 0 70px rgba(217,255,83,.13); }
.public-live-badge { display: inline-flex; align-items: center; gap: 8px; color: #b42018; }
.public-live-badge i { width: 8px; height: 8px; display: inline-block; background: #ef3c2f; border-radius: 50%; animation: live-pulse 1.4s ease-out infinite; }
.public-live-clock { margin: 11px 0 1px; display: block; color: var(--forest); font-family: var(--display); font-size: clamp(58px, 7vw, 92px); font-weight: 900; letter-spacing: -.06em; line-height: .9; font-variant-numeric: tabular-nums; }
.public-live-clock.is-low { color: #b42018; }
.match-row--live { position: relative; background: rgba(217,255,83,.2); }
.match-row--live::before { content: "EN DIRECTO"; position: absolute; right: 13px; top: 5px; color: #b42018; font-size: 7px; font-weight: 900; letter-spacing: .12em; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(239,60,47,.36); } 75%, 100% { box-shadow: 0 0 0 9px rgba(239,60,47,0); } }

/* Control móvil de partido */
.live-control-body { min-height: 100vh; color: var(--white); background: var(--forest-deep); }
.live-control-body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .055; background-image: linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px); background-size: 44px 44px; }
.live-control-header { position: relative; z-index: 3; min-height: 60px; padding: 0 clamp(15px, 4vw, 36px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.7); font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.live-control-header a { text-decoration: none; }
.live-control-header a:last-child { justify-self: end; color: var(--lime); }
.live-control-main { position: relative; z-index: 1; width: min(1180px, 100%); margin: 0 auto; padding: clamp(24px, 5vw, 62px) clamp(14px, 4vw, 38px) 70px; }
.live-console { display: grid; gap: clamp(22px, 4vw, 42px); }
.live-console__meta { display: flex; align-items: center; justify-content: space-between; gap: 20px; color: rgba(255,255,255,.52); font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.live-status { display: inline-flex; align-items: center; gap: 9px; color: var(--white); }
.live-status::before { content: ""; width: 9px; height: 9px; background: #a1ada8; border-radius: 50%; }
.live-status--running::before { background: #ff4b3e; animation: live-pulse 1.3s ease-out infinite; }
.live-status--prepared::before, .live-status--paused::before { background: #f2b84b; }
.live-status--review::before { background: var(--lime); }
.live-scoreboard { min-height: 430px; padding: clamp(22px, 5vw, 55px); display: grid; grid-template-columns: minmax(0,1fr) minmax(240px,.85fr) minmax(0,1fr); gap: clamp(15px, 4vw, 60px); align-items: center; background: #07362b; border: 1px solid rgba(255,255,255,.13); border-radius: 32px; box-shadow: 0 28px 80px rgba(0,0,0,.2); }
.live-side { min-width: 0; display: grid; justify-items: center; gap: 16px; text-align: center; }
.live-side h1 { min-height: 2.1em; margin: 0; display: grid; place-items: center; font-family: var(--display); font-size: clamp(21px, 3.4vw, 43px); letter-spacing: -.04em; line-height: 1.02; text-transform: uppercase; }
.live-score-control { display: grid; grid-template-columns: 52px minmax(72px, 120px) 52px; align-items: center; gap: 8px; }
.live-score-control strong { font-family: var(--display); font-size: clamp(70px, 10vw, 132px); letter-spacing: -.07em; line-height: .8; }
.live-score-control button { width: 52px; height: 52px; border: 1px solid rgba(255,255,255,.25); color: var(--white); background: rgba(255,255,255,.07); border-radius: 50%; font-size: 27px; cursor: pointer; }
.live-score-control button:active { transform: scale(.92); background: var(--lime); color: var(--forest); }
.live-clock-wrap { align-self: stretch; padding: 24px 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-inline: 1px solid rgba(255,255,255,.12); text-align: center; }
.live-clock-wrap > span { color: var(--lime); font-size: 10px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.live-clock { display: block; margin: 12px 0 7px; font-family: var(--display); font-size: clamp(74px, 11vw, 145px); font-weight: 900; letter-spacing: -.075em; line-height: .8; font-variant-numeric: tabular-nums; }
.live-clock.is-low { color: #ff5c50; }
.live-clock.is-zero { color: var(--lime); }
.live-clock-wrap small { color: rgba(255,255,255,.5); }
.live-primary-controls { display: flex; justify-content: center; }
.live-main-button { min-width: min(430px, 100%); min-height: 72px; padding: 17px 28px; border: 0; border-radius: 18px; font-family: var(--display); font-size: 23px; font-weight: 900; cursor: pointer; text-transform: uppercase; }
.live-main-button--play { color: var(--forest-deep); background: var(--lime); box-shadow: 0 12px 35px rgba(217,255,83,.18); }
.live-main-button--pause { color: var(--forest); background: var(--white); }
.live-main-button--finish { color: var(--white); background: #cf392f; }
.live-corrections { border-top: 1px solid rgba(255,255,255,.14); }
.live-corrections > summary { padding: 20px 4px; color: rgba(255,255,255,.65); font-size: 12px; font-weight: 900; cursor: pointer; }
.live-correction-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.live-correction-grid form { padding: 22px; background: rgba(255,255,255,.06); border-radius: 18px; }
.live-correction-grid p { margin: 0 0 14px; font-weight: 900; }
.time-fields { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; }
.time-fields label { display: grid; gap: 4px; color: rgba(255,255,255,.55); font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.time-fields input { width: 100%; min-height: 54px; padding: 7px; border: 1px solid rgba(255,255,255,.2); border-radius: 11px; color: var(--white); background: rgba(0,0,0,.17); font-size: 24px; font-weight: 900; text-align: center; }
.live-correction-grid form > button, .prepare-form button { width: 100%; min-height: 48px; margin-top: 13px; border: 0; border-radius: 11px; color: var(--forest); background: var(--white); font-weight: 900; cursor: pointer; }
.live-cancel { justify-self: center; padding: 8px; border: 0; color: rgba(255,255,255,.42); background: transparent; font-size: 11px; text-decoration: underline; cursor: pointer; }
.live-empty { max-width: 760px; margin: 5vh auto 0; padding: clamp(28px, 6vw, 60px); background: var(--white); color: var(--ink); border-radius: 28px; box-shadow: 18px 18px 0 var(--lime); }
.live-empty__pulse { width: 13px; height: 13px; margin-bottom: 32px; display: block; background: #ff4b3e; border-radius: 50%; animation: live-pulse 1.4s ease-out infinite; }
.live-empty h1 { max-width: 650px; margin: 0; color: var(--forest); font-family: var(--display); font-size: clamp(43px, 7vw, 78px); letter-spacing: -.06em; line-height: .88; text-transform: uppercase; }
.live-empty > p:not(.eyebrow) { max-width: 560px; margin: 22px 0; color: var(--muted); }
.prepare-form label { display: grid; gap: 7px; font-size: 11px; font-weight: 900; }
.prepare-form select { width: 100%; min-height: 58px; padding: 10px 12px; border: 1px solid #b9c1bd; border-radius: 11px; background: var(--white); }
.prepare-form button { color: var(--lime); background: var(--forest); }
.reopen-panel { max-width: 760px; margin: 48px auto 0; }
.reopen-panel h2 { margin: 0; font-family: var(--display); font-size: 28px; text-transform: uppercase; }
.reopen-panel > p { color: rgba(255,255,255,.55); font-size: 12px; }
.reopen-list { margin-top: 18px; display: grid; gap: 8px; }
.reopen-list article { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 15px; background: rgba(255,255,255,.06); border-radius: 12px; }
.reopen-list span { display: grid; }
.reopen-list small { color: rgba(255,255,255,.45); }
.reopen-list button { border: 0; color: var(--lime); background: transparent; font-weight: 900; cursor: pointer; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero h1 { max-width: 760px; }
  .hero__scorecard { width: min(540px, calc(100% - 15px)); }
  .schedule-grid { grid-template-columns: 1fr; }
  .tournament-section { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { position: sticky; z-index: 15; top: 72px; padding: 8px 12px; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-nav a { flex: 0 0 auto; padding: 10px 12px; }
  .result-form { grid-template-columns: 42px minmax(90px, 1fr) 50px 12px 50px minmax(90px, 1fr) 70px; padding-inline: 12px; }
  .result-form .team-mark { display: none; }
  .live-scoreboard { grid-template-columns: 1fr 1fr; }
  .live-clock-wrap { grid-column: 1 / -1; grid-row: 1; min-height: 190px; border-inline: 0; border-bottom: 1px solid rgba(255,255,255,.12); }
  .live-side { grid-row: 2; }
}

@media (max-width: 680px) {
  .site-header { min-height: 64px; }
  .nav-toggle { display: block; }
  .main-nav { position: absolute; left: 12px; right: 12px; top: 70px; padding: 12px; display: none; flex-direction: column; align-items: stretch; gap: 0; background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 13px; }
  .hero { padding-top: 75px; gap: 50px; }
  .hero h1 { font-size: clamp(58px, 20vw, 90px); }
  .hero__meta { margin-top: 28px; }
  .hero__scorecard { padding: 20px 16px; box-shadow: 9px 9px 0 var(--lime); }
  .team-mark--large { width: 54px; height: 54px; }
  .scorecard__teams { gap: 8px; }
  .scorecard__result { gap: 5px; }
  .scorecard__result b { font-size: 34px; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-heading h2, .tournament-copy h2 { font-size: 46px; }
  .team-grid { grid-template-columns: 1fr; }
  .team-card { min-height: 235px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.2); }
  .team-card:last-child { border-bottom: 0; }
  .facts div { grid-template-columns: 95px 1fr; }
  .site-footer { flex-direction: column; }
  .admin-header { min-height: 64px; padding: 0 14px; }
  .brand--admin .brand__mark { display: none; }
  .admin-header__actions { gap: 9px; }
  .admin-layout { min-height: calc(100vh - 64px); }
  .admin-nav { top: 64px; }
  .admin-nav a span { display: none; }
  .admin-main { padding: 28px 14px 60px; }
  .admin-title { align-items: start; flex-direction: column; }
  .result-form { padding: 15px 12px 13px; grid-template-columns: 38px 1fr 48px 10px 48px 1fr; gap: 6px; }
  .result-form > time { grid-row: 1; grid-column: 1; }
  .result-form__team { grid-row: 1; grid-column: 2; font-size: 11px; }
  .result-form .score-input[name="home_score"] { grid-row: 1; grid-column: 3; }
  .score-separator { grid-row: 1; grid-column: 4; }
  .result-form .score-input[name="away_score"] { grid-row: 1; grid-column: 5; }
  .result-form__team--away { grid-row: 1; grid-column: 6; }
  .result-form .button--save { grid-row: 2; grid-column: 3 / 6; margin-top: 4px; }
  .save-state { right: 13px; bottom: 2px; }
  .form-grid, .team-admin-grid { grid-template-columns: 1fr; }
  .field--full, .form-divider { grid-column: auto; }
  .points-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .manage-card summary { align-items: start; flex-direction: column; gap: 4px; }
  .auth-card { box-shadow: 8px 8px 0 var(--lime); }
  .button--live { padding-inline: 10px; font-size: 0; }
  .button--live span { display: inline-block !important; }
  .button--live::after { content: "Directo"; font-size: 11px; }
  .live-control-header { grid-template-columns: 1fr 1fr; }
  .live-control-header > span { display: none; }
  .live-scoreboard { min-height: 0; padding: 20px 12px 28px; gap: 24px 8px; border-radius: 22px; }
  .live-clock-wrap { padding: 10px; min-height: 150px; }
  .live-clock { font-size: clamp(80px, 28vw, 118px); }
  .live-side .team-mark { width: 52px; height: 52px; }
  .live-side h1 { min-height: 2.2em; font-size: 19px; }
  .live-score-control { grid-template-columns: 43px minmax(56px, 82px) 43px; gap: 3px; }
  .live-score-control button { width: 43px; height: 43px; }
  .live-score-control strong { font-size: 68px; }
  .live-main-button { min-height: 66px; font-size: 20px; }
  .live-correction-grid { grid-template-columns: 1fr; }
  .live-empty { margin-top: 2vh; box-shadow: 9px 9px 0 var(--lime); }
  .reopen-list article { align-items: flex-start; flex-direction: column; }
}

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