:root {
  --sky: #75aadb;
  --sky-deep: #3d8dcc;
  --white: #fffaf1;
  --sun: #f6c445;
  --sun-dark: #c68b12;
  --ink: #10213d;
  --ink-soft: #30415f;
  --grass: #0b7a53;
  --grass-light: #35bd7c;
  --card: rgba(255, 250, 241, 0.92);
  --card-strong: #fffdf7;
  --line: rgba(16, 33, 61, 0.16);
  --shadow: 0 24px 80px rgba(16, 33, 61, 0.22);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --space: clamp(1rem, 2vw, 1.5rem);
  --max: 1180px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Nunito", sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(246, 196, 69, 0.45), transparent 24rem),
    linear-gradient(90deg, rgba(117, 170, 219, 0.18) 0 33%, rgba(255,255,255,0.7) 33% 66%, rgba(117, 170, 219, 0.2) 66% 100%),
    #eaf6ff;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(16, 33, 61, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 33, 61, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
  z-index: -1;
}

.sky-ribbons {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    repeating-linear-gradient(115deg, rgba(117,170,219,0.24) 0 18px, transparent 18px 44px),
    radial-gradient(circle at 85% 10%, rgba(255,255,255,0.9), transparent 18rem);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: white;
  border-radius: 999px;
  z-index: 100;
}
.skip-link:focus { top: 1rem; }

a { color: inherit; }
img { max-width: 100%; }

h1, h2, h3 {
  margin: 0;
  line-height: 0.95;
  letter-spacing: -0.03em;
}
h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(4.4rem, 16vw, 11rem);
  text-transform: uppercase;
  text-shadow: 0 5px 0 rgba(255,255,255,0.85), 0 18px 40px rgba(16,33,61,0.2);
}
h2 {
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 5vw, 4.2rem);
}
h3 {
  font-family: "Fraunces", serif;
  font-size: clamp(1.2rem, 2.4vw, 1.8rem);
}

.eyebrow {
  margin: 0 0 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--sky-deep);
}

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) var(--space) 0;
}
.hero__badge {
  width: max-content;
  max-width: 100%;
  margin: 0 auto 1.1rem;
}
.flag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border: 2px solid rgba(255,255,255,0.8);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sky), white, var(--sky));
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(61,141,204,0.25);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: clamp(1rem, 4vw, 3rem);
  align-items: stretch;
}
.hero__copy {
  padding: clamp(1.1rem, 4vw, 3rem);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(255,250,241,0.72), rgba(255,255,255,0.35));
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.hero__lead {
  max-width: 66ch;
  margin: 1rem 0 1.4rem;
  font-size: clamp(1.03rem, 1.8vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-soft);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.button {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  background: var(--card-strong);
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(16,33,61,0.14);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 18px 30px rgba(16,33,61,0.2); }
.button--primary { background: var(--ink); color: white; }
.button--ghost { background: rgba(255,255,255,0.45); border: 1px solid rgba(255,255,255,0.9); }
.button--small { min-height: 40px; padding: 0.65rem 0.9rem; font-size: 0.94rem; }

.hero__poster {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  color: white;
  background:
    linear-gradient(180deg, rgba(16,33,61,0.12), rgba(16,33,61,0.72)),
    repeating-linear-gradient(90deg, #5ba9df 0 48px, #fff 48px 92px, #5ba9df 92px 140px);
  box-shadow: var(--shadow);
  isolation: isolate;
}
.hero__poster::after {
  content: "🇦🇷 🇦🇷 🇦🇷 🇦🇷 🇦🇷 🇦🇷 🇦🇷";
  position: absolute;
  left: -1rem;
  right: -1rem;
  bottom: 1rem;
  font-size: 2rem;
  letter-spacing: 0.15rem;
  transform: rotate(-4deg);
  opacity: 0.9;
  animation: flagWave 4s ease-in-out infinite;
}
.poster-title {
  position: absolute;
  left: 1.4rem;
  right: 1.4rem;
  bottom: 5.2rem;
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2.5rem, 7vw, 5.4rem);
  line-height: 0.85;
  text-shadow: 0 8px 20px rgba(0,0,0,0.35);
}
.poster-subtitle {
  position: absolute;
  left: 1.5rem;
  bottom: 3.4rem;
  margin: 0;
  font-weight: 900;
}
.sun-seal {
  position: absolute;
  top: 1.3rem;
  right: 1.4rem;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, var(--sun), var(--sun-dark));
  box-shadow: 0 0 0 10px rgba(255,255,255,0.22), 0 18px 32px rgba(0,0,0,0.18);
  font-size: 2.2rem;
}
.obelisco {
  position: absolute;
  left: 50%;
  bottom: 4.8rem;
  width: 74px;
  height: 250px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #e7eef5, #fff, #c9d9e6);
  clip-path: polygon(50% 0, 67% 18%, 72% 100%, 28% 100%, 33% 18%);
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  opacity: 0.92;
}
.ball {
  position: absolute;
  left: 16%;
  top: 24%;
  font-size: 3.4rem;
  filter: drop-shadow(0 18px 22px rgba(0,0,0,0.3));
  animation: ballBounce 2.4s cubic-bezier(.36,.07,.19,.97) infinite;
}
.ticker {
  margin: 1rem 0 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  box-shadow: 0 12px 40px rgba(16,33,61,0.22);
}
.ticker span {
  display: inline-block;
  min-width: 100%;
  white-space: nowrap;
  padding: 0.68rem 1rem;
  font-weight: 900;
  animation: ticker 28s linear infinite;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 0.45rem;
  max-width: var(--max);
  margin: 1rem auto 0;
  padding: 0.7rem var(--space);
  overflow-x: auto;
  background: rgba(234, 246, 255, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.7);
}
.nav a {
  flex: 0 0 auto;
  padding: 0.65rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 900;
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(255,255,255,0.9);
}
.nav a:hover, .nav a:focus-visible { background: var(--ink); color: white; outline: none; }

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2.2rem, 6vw, 5rem) var(--space) 0;
}
.section--first { padding-top: clamp(1.5rem, 4vw, 3rem); }
.section__heading {
  margin-bottom: 1.2rem;
}
.section__heading--split {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}
.section-note {
  max-width: 28ch;
  margin: 0;
  color: var(--ink-soft);
  font-weight: 800;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.9);
  font-weight: 900;
}
.status-bar::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--grass-light);
  box-shadow: 0 0 0 6px rgba(53,189,124,0.16);
}
.status-bar[data-state="error"]::before { background: #e34b4b; box-shadow: 0 0 0 6px rgba(227,75,75,0.14); }

.summary-grid,
.family-grid,
.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.card,
.summary-card,
.family-card,
.game-card,
.group-card,
.match-card,
.draw-card {
  border: 1px solid rgba(255,255,255,0.85);
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 50px rgba(16,33,61,0.13);
  backdrop-filter: blur(10px);
}
.summary-card {
  min-height: 150px;
  padding: 1.1rem;
  position: relative;
  overflow: hidden;
}
.summary-card::after {
  content: "🇦🇷";
  position: absolute;
  right: 0.7rem;
  bottom: 0.3rem;
  font-size: 2.8rem;
  opacity: 0.16;
}
.summary-card strong {
  display: block;
  margin-top: 0.35rem;
  font-family: "Bebas Neue", sans-serif;
  font-size: 3rem;
  line-height: 0.95;
}
.summary-card span { color: var(--ink-soft); font-weight: 800; }

.family-card {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.family-card__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--sky), white);
  font-size: 1.6rem;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.8);
}
.family-card h3 { font-size: 1.28rem; }
.family-card__teams { display: grid; gap: 0.55rem; }
.team-chip,
.team-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.team-chip {
  padding: 0.6rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.68);
  border: 1px solid rgba(16,33,61,0.08);
}
.flag {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: white;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.9), 0 5px 14px rgba(16,33,61,0.18);
  flex: 0 0 auto;
}
.team-chip strong,
.team-row strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-chip small,
.team-row small { display: block; color: var(--ink-soft); font-weight: 800; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: max-content;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(117,170,219,0.18);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}
.badge--sun { background: rgba(246,196,69,0.32); }
.badge--grass { background: rgba(53,189,124,0.18); }
.badge--ink { background: var(--ink); color: white; }

.filters {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr 1fr;
  gap: 0.8rem;
  margin: 1rem 0;
  padding: 0.9rem;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.62);
  border: 1px solid rgba(255,255,255,0.9);
}
.filters label {
  display: grid;
  gap: 0.35rem;
  font-weight: 900;
  color: var(--ink-soft);
}
input, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(16,33,61,0.14);
  border-radius: 14px;
  background: white;
  color: var(--ink);
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-weight: 800;
}
input:focus, select:focus, button:focus-visible { outline: 3px solid rgba(246,196,69,0.7); outline-offset: 2px; }

.fixture-list {
  display: grid;
  gap: 0.85rem;
}
.match-card {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) minmax(180px, 0.45fr);
  gap: 1rem;
  align-items: center;
  padding: 0.85rem;
}
.match-meta {
  display: grid;
  gap: 0.35rem;
  font-weight: 900;
  color: var(--ink-soft);
}
.match-number {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2rem;
  color: var(--sky-deep);
}
.teams-versus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
}
.versus {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.8rem;
  color: var(--sun-dark);
}
.score {
  min-width: 72px;
  text-align: center;
  padding: 0.35rem 0.5rem;
  border-radius: 12px;
  background: var(--ink);
  color: white;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.7rem;
}
.match-place {
  color: var(--ink-soft);
  font-weight: 800;
}
.owner-line {
  margin-top: 0.25rem;
  color: var(--sky-deep);
  font-size: 0.86rem;
  font-weight: 900;
}

.standings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.group-card { overflow: hidden; }
.group-card__title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1rem;
  background: linear-gradient(90deg, rgba(117,170,219,0.28), rgba(255,255,255,0.6));
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
th, td {
  padding: 0.62rem 0.55rem;
  border-top: 1px solid rgba(16,33,61,0.08);
  text-align: right;
}
th:first-child, td:first-child { text-align: left; }
th { color: var(--ink-soft); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
tr:nth-child(even) td { background: rgba(255,255,255,0.38); }

.bracket-grid {
  display: grid;
  gap: 1rem;
}
.bracket-stage {
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.58);
  border: 1px solid rgba(255,255,255,0.85);
}
.bracket-stage h3 { margin-bottom: 0.8rem; }
.bracket-matches {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}
.bracket-match {
  padding: 0.75rem;
  border-radius: 16px;
  background: var(--card-strong);
  border: 1px solid rgba(16,33,61,0.08);
}
.bracket-match small { color: var(--ink-soft); font-weight: 900; }

.game-card {
  min-height: 230px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}
.game-card::before {
  content: attr(data-icon);
  position: absolute;
  right: 0.7rem;
  top: 0.35rem;
  font-size: 4rem;
  opacity: 0.13;
}
.game-card p { margin: 0; color: var(--ink-soft); font-weight: 800; line-height: 1.45; }
.leaderboard { display: grid; gap: 0.45rem; margin-top: auto; }
.leader-row {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.52rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.68);
  font-weight: 900;
}
.leader-row small { color: var(--ink-soft); font-weight: 800; }
.empty-state {
  padding: 0.8rem;
  border-radius: 14px;
  background: rgba(117,170,219,0.13);
  color: var(--ink-soft);
  font-weight: 900;
}

.seed-table-wrap {
  overflow: auto;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.85);
  box-shadow: 0 18px 50px rgba(16,33,61,0.13);
}
.seed-table-wrap table { min-width: 820px; }
.seed-table-wrap td, .seed-table-wrap th { padding: 0.72rem 0.75rem; }

.section--draw { padding-bottom: clamp(2.5rem, 7vw, 5rem); }
.draw-card {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1rem;
  align-items: center;
  padding: clamp(1rem, 3vw, 2rem);
  background:
    linear-gradient(135deg, rgba(255,250,241,0.92), rgba(117,170,219,0.28)),
    repeating-linear-gradient(90deg, rgba(117,170,219,0.28) 0 28px, transparent 28px 56px);
}
.draw-card p { max-width: 72ch; color: var(--ink-soft); font-weight: 800; line-height: 1.55; }
.draw-machine {
  min-height: 190px;
  border-radius: 50%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  place-items: center;
  background: radial-gradient(circle, white 0 45%, rgba(117,170,219,0.72) 46% 100%);
  border: 8px solid rgba(255,255,255,0.78);
  box-shadow: inset 0 0 30px rgba(16,33,61,0.1), 0 18px 38px rgba(16,33,61,0.18);
  animation: gentleSpin 8s linear infinite;
}
.draw-machine span { font-size: 2.5rem; animation: ballBounce 2.8s ease-in-out infinite; }
.draw-machine span:nth-child(2) { animation-delay: 0.25s; }
.draw-machine span:nth-child(3) { animation-delay: 0.5s; }
.draw-machine span:nth-child(4) { animation-delay: 0.75s; }

.footer {
  padding: 2rem var(--space) 3rem;
  text-align: center;
  color: var(--ink-soft);
  font-weight: 800;
}
.footer p { margin: 0.35rem; }

.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  overflow: hidden;
}
.confetti span {
  position: absolute;
  top: -4rem;
  font-size: 1.4rem;
  animation: confetti 12s linear infinite;
  opacity: 0.75;
}
.confetti span:nth-child(1) { left: 8%; animation-delay: 0s; }
.confetti span:nth-child(2) { left: 24%; animation-delay: 2s; }
.confetti span:nth-child(3) { left: 48%; animation-delay: 4s; }
.confetti span:nth-child(4) { left: 67%; animation-delay: 1s; }
.confetti span:nth-child(5) { left: 82%; animation-delay: 5s; }
.confetti span:nth-child(6) { left: 93%; animation-delay: 3s; }

@keyframes ballBounce {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-24px) rotate(12deg); }
}
@keyframes ticker {
  from { transform: translateX(20%); }
  to { transform: translateX(-100%); }
}
@keyframes flagWave {
  0%, 100% { transform: rotate(-4deg) translateX(0); }
  50% { transform: rotate(-2deg) translateX(10px); }
}
@keyframes gentleSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes confetti {
  0% { transform: translateY(-10vh) rotate(0); }
  100% { transform: translateY(112vh) rotate(720deg); }
}

@media (max-width: 980px) {
  .hero__grid, .draw-card { grid-template-columns: 1fr; }
  .hero__poster { min-height: 360px; }
  .summary-grid, .family-grid, .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .standings-grid { grid-template-columns: 1fr; }
  .bracket-matches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .match-card { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --space: 0.85rem; }
  h1 { font-size: clamp(4rem, 23vw, 6.8rem); }
  .hero__copy { padding: 1rem; }
  .hero__poster { min-height: 310px; }
  .poster-title { bottom: 4.6rem; }
  .summary-grid, .family-grid, .mini-grid, .bracket-matches { grid-template-columns: 1fr; }
  .section__heading--split { align-items: start; flex-direction: column; }
  .filters { grid-template-columns: 1fr; }
  .teams-versus { grid-template-columns: 1fr; }
  .versus { display: none; }
  .team-row { justify-content: space-between; }
  .score { width: 100%; }
  .nav { margin-top: 0.4rem; }
  th, td { padding: 0.5rem 0.35rem; font-size: 0.84rem; }
}

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