: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);
}
.hero-title {
  display: block;
  max-width: none;
  margin-top: clamp(1.2rem, 3vw, 2.4rem);
  font-size: clamp(4.2rem, 11vw, 8rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
}
.hero-title span { display: inline; }
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__grid--single { grid-template-columns: 1fr; }
.hero__copy {
  padding: clamp(2.4rem, 6vw, 5rem) clamp(1.1rem, 4vw, 3rem) 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--wide { min-height: clamp(360px, 48vw, 560px); }
.hero__poster::after { content: none; }
.poster-kicker {
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 10.2rem;
  margin: 0;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-align: center;
  color: white;
  text-shadow: 0 5px 18px rgba(0,0,0,0.35);
}
.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-align: center;
  text-wrap: balance;
  text-shadow: 0 8px 20px rgba(0,0,0,0.35);
}
.hero__poster--wide .poster-kicker {
  left: clamp(1.3rem, 4vw, 3.1rem);
  bottom: clamp(13.8rem, 24vw, 21rem);
  font-size: clamp(0.95rem, 2vw, 1.4rem);
  z-index: 3;
}
.hero__poster--wide .poster-title {
  left: clamp(1.2rem, 4vw, 3rem);
  right: clamp(1.2rem, 4vw, 3rem);
  bottom: clamp(3.8rem, 7vw, 6rem);
  font-size: clamp(4.1rem, 12vw, 9.6rem);
  z-index: 2;
}
.poster-copy {
  position: absolute;
  left: clamp(1rem, 4vw, 3rem);
  right: clamp(1rem, 4vw, 3rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 4;
  display: grid;
  justify-items: center;
  gap: clamp(0.3rem, 1vw, 0.7rem);
  text-align: center;
}
.poster-copy .poster-kicker,
.hero__poster--wide .poster-copy .poster-kicker {
  position: static;
  margin: 0;
  font-size: clamp(0.86rem, 1.8vw, 1.25rem);
  line-height: 1.2;
}
.poster-copy .poster-title,
.hero__poster--wide .poster-copy .poster-title {
  position: static;
  margin: 0;
  max-width: 10ch;
  font-size: clamp(4rem, 12vw, 9.6rem);
  line-height: 0.82;
}
.poster-subtitle {
  position: absolute;
  left: 1.5rem;
  bottom: 3.4rem;
  margin: 0;
  font-weight: 900;
}
.hero__poster--wide .poster-subtitle {
  left: clamp(1.3rem, 4vw, 3.1rem);
  bottom: clamp(2.4rem, 5vw, 4.2rem);
  font-size: clamp(1.05rem, 2.2vw, 1.55rem);
}
.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, white, #dfeaf4);
  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;
  animation: ballBounce 2.4s cubic-bezier(.36,.07,.19,.97) infinite;
}
.hero__poster--wide .sun-seal {
  width: clamp(78px, 10vw, 120px);
  height: clamp(78px, 10vw, 120px);
  font-size: clamp(2.2rem, 4vw, 3.7rem);
}
.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;
}
.hero__poster--wide .obelisco {
  height: clamp(220px, 34vw, 380px);
  width: clamp(70px, 9vw, 120px);
}
.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--in-flow { margin-top: 1.25rem; }
.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;
}
.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.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;
}
.mini-grid--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mini-grid { align-items: stretch; }
.game-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(0.9rem, 3vw, 1.4rem);
  align-items: center;
  margin-bottom: 1rem;
  padding: clamp(1rem, 2.6vw, 1.45rem);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,250,241,0.78)),
    repeating-linear-gradient(90deg, rgba(117,170,219,0.18) 0 28px, transparent 28px 56px);
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: 0 18px 50px rgba(16,33,61,0.11);
}
.game-overview__copy { display: grid; gap: 0.35rem; }
.game-overview h3 { margin: 0; font-size: clamp(1.2rem, 2.4vw, 1.55rem); }
.game-overview p {
  max-width: 74ch;
  margin: 0;
  color: var(--ink-soft);
  font-weight: 850;
  line-height: 1.5;
}

.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,
.unknown-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;
}
.unknown-flag {
  background: linear-gradient(135deg, var(--sun), #fff3b6);
  color: var(--ink);
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.45rem;
}
.team-chip--pending { border-style: dashed; }
.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; }
select:disabled { opacity: 0.72; cursor: not-allowed; }

.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 {
  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; }
.game-card .button { margin-top: auto; align-self: flex-start; }
.ranking-top {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.ranking-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  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);
  backdrop-filter: blur(10px);
}
.ranking-card__rank {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2.8rem, 7vw, 4.5rem);
  line-height: 0.9;
  color: var(--sky-deep);
}
.ranking-card__team {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}
.ranking-card__team h3 { font-size: 1.25rem; }
.ranking-card__team p {
  margin: 0.15rem 0 0;
  color: var(--ink-soft);
  font-weight: 850;
}
.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: 0; }
.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; }

.hero--draw .hero__copy { width: 100%; max-width: none; margin: 0; }
.draw-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
  align-items: stretch;
}
.admin-panel {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: 0 14px 36px rgba(16,33,61,0.1);
}
.admin-panel[hidden] { display: none; }
.admin-login,
.admin-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.65rem;
}
.admin-login label {
  display: grid;
  gap: 0.35rem;
  min-width: min(100%, 280px);
  color: var(--ink-soft);
  font-weight: 900;
}
.admin-login input {
  min-height: 40px;
  padding: 0.65rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(16,33,61,0.14);
  font: inherit;
}
.admin-controls strong {
  align-self: center;
  color: var(--grass);
  margin-right: 0.2rem;
}
.admin-message {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 850;
}
.draw-stage,
.draw-rules,
.draw-person-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);
}
.draw-stage {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  padding: 1rem;
  background:
    radial-gradient(circle at 50% 32%, rgba(246,196,69,0.32), transparent 18rem),
    linear-gradient(145deg, rgba(16,33,61,0.94), rgba(32,68,111,0.88));
  color: white;
}
.draw-rules {
  padding: 1rem;
  color: var(--ink-soft);
  font-weight: 800;
  line-height: 1.45;
}
.draw-rules h3 { color: var(--ink); margin-bottom: 0.7rem; }
.draw-rules ol { padding-left: 1.2rem; }
.pot-track {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}
.pot-card {
  padding: 0.75rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.24);
  color: white;
}
.pot-card span,
.pot-card small { display: block; opacity: 0.82; font-weight: 900; }
.pot-card strong { display: block; font-family: "Bebas Neue", sans-serif; font-size: 2.1rem; line-height: 1; }
.pot-card.is-active { background: rgba(246,196,69,0.28); border-color: rgba(246,196,69,0.85); box-shadow: 0 0 0 4px rgba(246,196,69,0.12); }
.pot-card.is-complete { background: rgba(53,189,124,0.22); border-color: rgba(53,189,124,0.85); }
.hat-scene {
  position: relative;
  min-height: 330px;
  display: grid;
  place-items: center;
  margin-top: 1rem;
}
.spotlight {
  position: absolute;
  z-index: 1;
  width: min(86%, 520px);
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.34), transparent 68%);
  filter: blur(4px);
}
.top-hat {
  position: relative;
  z-index: 7;
  width: 260px;
  height: 210px;
  transform: translateY(30px);
}
.hat-top {
  position: absolute;
  left: 44px;
  bottom: 72px;
  width: 172px;
  height: 145px;
  border-radius: 28px 28px 14px 14px;
  background: linear-gradient(90deg, #101827, #27344f 48%, #070b13);
  box-shadow: inset 24px 0 28px rgba(255,255,255,0.08), 0 24px 40px rgba(0,0,0,0.35);
}
.hat-band {
  position: absolute;
  left: 34px;
  bottom: 78px;
  width: 192px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--sky), white, var(--sky));
  box-shadow: 0 6px 16px rgba(0,0,0,0.22);
}
.hat-brim {
  position: absolute;
  left: 0;
  bottom: 45px;
  width: 260px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(180deg, #35435f, #080d17);
  box-shadow: 0 25px 40px rgba(0,0,0,0.42);
}
.draw-paper {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 6;
  width: min(76%, 310px);
  min-height: 112px;
  display: grid;
  place-items: center;
  gap: 0.15rem;
  padding: 1rem;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.98), rgba(255,250,241,0.94));
  color: var(--ink);
  border: 1px solid rgba(16,33,61,0.08);
  box-shadow: 0 22px 42px rgba(0,0,0,0.28);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 54px) scale(0.2) rotate(-8deg);
  transform-origin: center 88%;
  pointer-events: none;
}
.draw-paper::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 48%;
  border-radius: 18px 18px 8px 8px;
  background: linear-gradient(180deg, rgba(117,170,219,0.18), transparent);
  border-bottom: 1px dashed rgba(16,33,61,0.16);
}
.draw-paper span,
.draw-paper strong,
.draw-paper small { position: relative; z-index: 1; opacity: 0; }
.draw-paper span {
  color: var(--sky-deep);
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
}
.draw-paper strong { font-family: "Fraunces", serif; font-size: clamp(1rem, 2.4vw, 1.35rem); }
.draw-paper small { color: var(--ink-soft); font-weight: 900; }
.hat-scene.is-drawing .draw-paper { animation: paperDraw 3.8s cubic-bezier(.2,.8,.2,1) both; }
.hat-scene.is-drawing .draw-paper span,
.hat-scene.is-drawing .draw-paper strong,
.hat-scene.is-drawing .draw-paper small { animation: paperText 3.8s ease both; }
.draw-reveal {
  position: relative;
  z-index: 4;
  padding: 1rem;
  border-radius: 20px;
  background: rgba(255,255,255,0.92);
  color: var(--ink);
  box-shadow: 0 18px 44px rgba(0,0,0,0.26);
}
.draw-reveal.is-revealed { animation: revealGlow 900ms ease both; }
.draw-reveal h3 { margin-top: 0.5rem; }
.draw-reveal p { color: var(--ink-soft); font-weight: 900; }
.reveal-matchup {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.8rem;
}
.reveal-person,
.reveal-team {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: 0.85rem;
  border-radius: 16px;
  background: rgba(117,170,219,0.14);
  text-align: center;
}
.reveal-person strong,
.reveal-team strong { font-family: "Fraunces", serif; font-size: 1.25rem; }
.reveal-arrow { font-family: "Bebas Neue", sans-serif; font-size: 2.6rem; color: var(--sun-dark); }
.draw-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.draw-person-card { padding: 1rem; }
.draw-person-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.85rem; }
.draw-person-head h3 { font-size: 1.25rem; }
.draw-slots { display: grid; gap: 0.5rem; }
.draw-slot {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 54px;
  padding: 0.55rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(16,33,61,0.08);
  font-weight: 900;
}
.draw-slot small { display: block; color: var(--ink-soft); }
.draw-slot--empty { border-style: dashed; color: var(--ink-soft); }
.draw-slot--filled { animation: slotPop 420ms ease; }

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}
.detail-card {
  padding: 1rem;
  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);
}
.detail-card h3 + #rankingCard { margin-top: 0.85rem; }
.detail-card ul {
  margin: 0.85rem 0 0;
  padding-left: 1.25rem;
  color: var(--ink-soft);
  font-weight: 850;
  line-height: 1.55;
}
.ranking-note {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  padding: 0.78rem 0.85rem;
  border-radius: 16px;
  background: rgba(117,170,219,0.13);
  border: 1px solid rgba(117,170,219,0.24);
}
.ranking-note p {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 850;
  line-height: 1.45;
}
.ranking-note .badge { justify-self: start; }
.detail-ranking-list { display: grid; gap: 0.65rem; }
.detail-ranking-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.7rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(16,33,61,0.08);
}
.rank-number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.25rem;
}
.detail-ranking-row small {
  display: block;
  color: var(--ink-soft);
  font-weight: 800;
}

.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); }
}
@keyframes paperDraw {
  0% {
    opacity: 0;
    clip-path: inset(0 0 82% 0 round 18px);
    transform: translate(-50%, 54px) scale(0.18) rotate(-8deg);
  }
  18% {
    opacity: 1;
    clip-path: inset(0 0 66% 0 round 18px);
    transform: translate(-50%, -36px) scale(0.48) rotate(6deg);
  }
  52% {
    opacity: 1;
    clip-path: inset(0 0 42% 0 round 18px);
    transform: translate(-50%, -78px) scale(0.72) rotate(-4deg);
  }
  78% {
    opacity: 1;
    clip-path: inset(0 0 0 0 round 18px);
    transform: translate(-50%, 150px) scale(1) rotate(0);
  }
  92% {
    opacity: 1;
    clip-path: inset(0 0 0 0 round 18px);
    transform: translate(-50%, 176px) scale(1) rotate(0);
  }
  100% {
    opacity: 0;
    clip-path: inset(0 0 0 0 round 18px);
    transform: translate(-50%, 196px) scale(0.98) rotate(0);
  }
}
@keyframes paperText {
  0%, 52% { opacity: 0; transform: translateY(8px); }
  68%, 92% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(0); }
}
@keyframes revealGlow {
  0% { box-shadow: 0 18px 44px rgba(0,0,0,0.26); transform: translateY(0); }
  45% { box-shadow: 0 0 0 6px rgba(246,196,69,0.26), 0 24px 54px rgba(0,0,0,0.3); transform: translateY(-2px); }
  100% { box-shadow: 0 18px 44px rgba(0,0,0,0.26); transform: translateY(0); }
}
@keyframes slotPop {
  0% { transform: scale(0.94); background: rgba(246,196,69,0.35); }
  100% { transform: scale(1); }
}

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

@media (max-width: 640px) {
  :root { --space: 0.85rem; }
  h1 { font-size: clamp(4rem, 23vw, 6.8rem); }
  .hero-title { font-size: clamp(4rem, 18vw, 6.4rem); max-width: none; }
  .hero__copy { padding: 2.2rem 1rem 1rem; }
  .hero__poster { min-height: 310px; }
  .hero__poster--wide { min-height: 300px; }
  .hero__poster--wide .sun-seal {
    width: 62px;
    height: 62px;
    font-size: 1.9rem;
    top: 0.9rem;
    right: 0.9rem;
  }
  .poster-kicker { bottom: 11.6rem; }
  .poster-title { bottom: 4.2rem; }
  .poster-copy {
    bottom: 1.35rem;
    gap: 0.35rem;
  }
  .poster-copy .poster-title,
  .hero__poster--wide .poster-copy .poster-title { font-size: clamp(3.35rem, 17vw, 5.7rem); }
  .poster-copy .poster-kicker,
  .hero__poster--wide .poster-copy .poster-kicker { font-size: clamp(0.78rem, 3.5vw, 1rem); }
  .summary-grid, .family-grid, .mini-grid, .ranking-top, .bracket-matches, .draw-board, .pot-track { grid-template-columns: 1fr; }
  .section__heading--split { align-items: start; flex-direction: column; }
  .section-actions { justify-content: flex-start; width: 100%; }
  .filters { grid-template-columns: 1fr; }
  .teams-versus, .reveal-matchup, .detail-ranking-row { grid-template-columns: 1fr; }
  .reveal-arrow { transform: rotate(90deg); }
  .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;
  }
}
