:root {
  --purple: #5d00ff;
  --purple-dark: #230040;
  --red: #e80000;
  --lime: #b8ff19;
  --mint: #14e6a4;
  --green: #00b84f;
  --ink: #050505;
  --card: #0b0b0f;
  --white: #ffffff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--white);
  background:
    radial-gradient(ellipse 75% 58% at 92% -10%, var(--red) 0 43%, transparent 43.4%),
    radial-gradient(ellipse 52% 42% at 106% 25%, var(--lime) 0 31%, transparent 31.4%),
    radial-gradient(ellipse 62% 48% at -8% 82%, #ff8e73 0 34%, transparent 34.4%),
    linear-gradient(135deg, var(--purple) 0 42%, #009c64 42% 65%, var(--lime) 65% 100%);
  background-attachment: fixed;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.10), transparent 26%), linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: auto, 38px 38px, 38px 38px;
  mix-blend-mode: soft-light;
}

main { position: relative; z-index: 1; }

.kicker {
  margin: 0;
  color: var(--lime);
  font-size: .78rem;
  font-weight: 1000;
  letter-spacing: .34em;
  text-transform: uppercase;
}
.kicker.purple { color: #7b2cff; }

.top-poster {
  position: relative;
  overflow: hidden;
  border-radius: 2.2rem;
  background: var(--ink);
  border: 5px solid var(--ink);
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  min-height: 330px;
  isolation: isolate;
}
.poster-blob { position: absolute; border-radius: 999rem; }
.poster-blob.red { right: -9%; top: -48%; width: 62%; height: 126%; background: var(--red); }
.poster-blob.lime { right: -12%; bottom: -32%; width: 43%; height: 64%; background: var(--lime); }
.poster-blob.green { left: -14%; bottom: -48%; width: 55%; height: 82%; background: #00c777; }
.poster-content {
  position: relative;
  z-index: 2;
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: 2rem;
  align-items: center;
  padding: 2rem;
}
.top-poster h1 {
  margin: .4rem 0 0;
  font-size: clamp(4rem, 10vw, 9.5rem);
  line-height: .82;
  letter-spacing: -.08em;
  font-weight: 1000;
  color: #fff;
}
.top-poster h1 span { color: var(--lime); }
.poster-sub {
  max-width: 690px;
  margin: 1.1rem 0 0;
  color: rgba(255,255,255,.88);
  font-size: 1.2rem;
  font-weight: 900;
}
.family-strip {
  display: inline-flex;
  margin-top: 1rem;
  border: 3px solid rgba(255,255,255,.28);
  border-radius: 999rem;
  background: rgba(255,255,255,.12);
  padding: .65rem 1rem;
  color: white;
  font-weight: 1000;
  backdrop-filter: blur(8px);
}
.mini-flag-wall {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .6rem;
  padding: 1rem;
  border-radius: 1.6rem;
  background: rgba(0,0,0,.70);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.18), 0 18px 45px rgba(0,0,0,.35);
}
.mini-flag-wall img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border: 2px solid white;
  border-radius: .35rem;
  background: white;
}

.today-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.6rem 0;
  padding: 1.4rem;
  border-radius: 1.8rem;
  background: rgba(5,5,5,.88);
  border: 4px solid rgba(255,255,255,.24);
  box-shadow: 0 22px 55px rgba(0,0,0,.28);
}
.today-header h2 { margin: .15rem 0 0; font-size: clamp(2rem, 4vw, 3.6rem); line-height: .95; font-weight: 1000; color: white; }
.date-pill { border-radius: 1.3rem; background: white; color: var(--ink); padding: .95rem 1.2rem; min-width: 250px; box-shadow: 0 14px 30px rgba(0,0,0,.25); }
.date-pill span { display: block; color: #6d00ff; font-size: .78rem; font-weight: 1000; letter-spacing: .24em; text-transform: uppercase; }
.date-pill b { display: block; font-size: 1.35rem; line-height: 1.05; }

.alert { margin-bottom: 1rem; border-radius: 1rem; padding: 1rem; font-weight: 1000; border: 3px solid var(--ink); }
.alert.ok { background: var(--lime); color: var(--ink); }
.alert.error { background: #ffdddd; color: #991b1b; }

.layout-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 1.4rem; align-items: start; }
.main-column { display: grid; gap: 1.4rem; }
.side-column { position: sticky; top: 1rem; display: grid; gap: 1.4rem; }

.match-card,
.dark-panel,
.groups-panel,
.leaderboard-card,
.rules-card {
  border-radius: 2rem;
  background: rgba(5,5,5,.92);
  border: 4px solid rgba(255,255,255,.22);
  box-shadow: 0 28px 70px rgba(0,0,0,.32);
  overflow: hidden;
}
.match-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.3rem;
  background: linear-gradient(95deg, var(--ink), #3a007b 52%, var(--red));
}
.match-top h2 { margin: .2rem 0 0; color: white; font-size: 1.45rem; font-weight: 1000; }
.kickoff-pill { border-radius: 999rem; background: var(--lime); color: var(--ink); padding: .65rem 1.1rem; font-weight: 1000; }

.match-stage {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.3rem;
  align-items: center;
  padding: 2rem 1.6rem 1rem;
}
.team-side {
  display: grid;
  justify-items: center;
  gap: .85rem;
  border-radius: 1.6rem;
  padding: 1.3rem .8rem;
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.10);
}
.team-side h3 { margin: 0; font-size: clamp(2rem, 5vw, 4rem); line-height: .94; text-align: center; color: white; font-weight: 1000; letter-spacing: -.04em; }
.versus { display: grid; place-items: center; width: 78px; height: 78px; border-radius: 999rem; background: white; color: var(--ink); border: 8px solid var(--lime); font-weight: 1000; font-size: 1.3rem; box-shadow: 0 18px 30px rgba(0,0,0,.35); }

.flag-tile { display: grid; justify-items: center; gap: .28rem; }
.flag-tile img,
.flag-tbd {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: white;
  border: 4px solid white;
  border-radius: .55rem;
  box-shadow: 0 12px 24px rgba(0,0,0,.34);
}
.flag-xl { width: min(82%, 230px); }
.flag-xl img,
.flag-xl .flag-tbd { aspect-ratio: 4/3; }
.flag-md { width: 86px; }
.flag-md img,
.flag-md .flag-tbd { aspect-ratio: 4/3; }
.flag-sm { width: 54px; min-width: 54px; }
.flag-sm img,
.flag-sm .flag-tbd { aspect-ratio: 4/3; border-width: 2px; border-radius: .35rem; }
.flag-tbd { display: grid; place-items: center; color: white; background: #333; font-size: .72rem; font-weight: 1000; }

.countdown-box { margin: 1rem 1.6rem 0; border-radius: 1.3rem; background: var(--lime); color: var(--ink); padding: 1rem; text-align: center; border: 3px solid white; }
.countdown-box span { display: block; font-size: .82rem; font-weight: 1000; letter-spacing: .22em; text-transform: uppercase; }
.countdown-box b { display: block; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1; font-weight: 1000; }
.countdown.is-locked { color: var(--red); }
.result-box,
.live-box,
.locked-note { margin: 1rem 1.6rem 0; border-radius: 1.2rem; padding: 1rem; font-size: 1.6rem; font-weight: 1000; text-align: center; }
.result-box { background: var(--lime); color: var(--ink); }
.live-box { background: var(--red); color: white; }
.locked-note { background: rgba(255,255,255,.10); color: white; }

.predict-form {
  display: grid;
  grid-template-columns: 1.2fr .7fr .7fr auto;
  gap: .8rem;
  align-items: end;
  margin: 1rem 1.6rem 0;
  padding: 1rem;
  border-radius: 1.3rem;
  background: white;
  color: var(--ink);
}
.predict-form label span { display: block; margin-bottom: .3rem; font-size: .72rem; font-weight: 1000; letter-spacing: .13em; text-transform: uppercase; color: #5d00ff; }
.predict-form select,
.predict-form input { width: 100%; border: 3px solid var(--ink); border-radius: .8rem; padding: .75rem .85rem; font-weight: 1000; font-size: 1rem; background: white; color: var(--ink); }
.predict-form input { text-align: center; font-size: 1.35rem; }
.predict-form button { border: 3px solid var(--ink); border-radius: .8rem; background: var(--red); color: white; padding: .85rem 1.2rem; font-weight: 1000; text-transform: uppercase; }

.predictions-box { padding: 1rem 1.6rem 1.6rem; }
.section-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.section-row h2,
.section-row h3 { margin: 0; color: white; font-weight: 1000; }
.section-row small { border-radius: 999rem; background: var(--lime); color: var(--ink); padding: .45rem .75rem; font-size: .7rem; font-weight: 1000; letter-spacing: .18em; text-transform: uppercase; }
.empty-state { margin: 0; border-radius: 1rem; background: rgba(255,255,255,.10); padding: 1rem; color: white; font-weight: 900; }
.prediction-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; }
.prediction-chip { display: flex; align-items: center; justify-content: space-between; gap: .5rem; border-radius: 1rem; background: white; color: var(--ink); padding: .75rem; font-weight: 1000; }
.prediction-chip b { border-radius: 999rem; background: var(--ink); color: white; padding: .28rem .7rem; }
.prediction-chip em { color: #058142; font-style: normal; }

.dark-panel,
.groups-panel { padding: 1.3rem; }
.mini-match { display: grid; grid-template-columns: 1fr auto 1fr; gap: .8rem; align-items: center; padding: .85rem; border-radius: 1rem; background: rgba(255,255,255,.08); margin-bottom: .8rem; }
.mini-match > div { display: flex; align-items: center; gap: .6rem; color: white; }
.mini-match > div:last-child { justify-content: end; }
.mini-match > span { border-radius: 999rem; background: var(--lime); color: var(--ink); padding: .45rem .7rem; font-weight: 1000; }

.groups-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.group-card { overflow: hidden; border-radius: 1.3rem; background: #111118; border: 2px solid rgba(255,255,255,.15); }
.group-card header { background: linear-gradient(90deg, var(--red), #6500d8); color: white; text-align: center; padding: .65rem; font-weight: 1000; }
.group-card > div { display: grid; gap: .55rem; padding: .8rem; }
.team-row { display: flex; align-items: center; gap: .65rem; border-radius: .8rem; background: rgba(255,255,255,.08); padding: .55rem; color: white; font-weight: 900; }

.leaderboard-card,
.rules-card { padding: 1.3rem; }
.leaderboard-card h2,
.rules-card h2 { margin: .2rem 0 1rem; color: white; font-size: 1.7rem; font-weight: 1000; }
.leader-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; border-radius: 1rem; background: rgba(255,255,255,.08); padding: .75rem; margin-top: .65rem; }
.leader-row > div { display: flex; align-items: center; gap: .55rem; }
.leader-row strong { color: var(--lime); font-size: 1.35rem; }
.rank { display: inline-grid; place-items: center; min-width: 2rem; height: 2rem; border-radius: 999rem; background: var(--lime); color: var(--ink); font-weight: 1000; }
.avatar { font-size: 1.3rem; }
.rules-card p { margin: .6rem 0; color: white; font-weight: 900; }
.rules-card b { color: var(--lime); }

.confetti { position: fixed; top: -10px; z-index: 9999; pointer-events: none; animation: fall 1.8s linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: .2; } }

@media (max-width: 980px) {
  .poster-content { grid-template-columns: 1fr; }
  .mini-flag-wall { grid-template-columns: repeat(9, 1fr); }
  .layout-grid { grid-template-columns: 1fr; }
  .side-column { position: static; }
}
@media (max-width: 720px) {
  main { padding-inline: .75rem !important; }
  .today-header { flex-direction: column; align-items: stretch; }
  .match-stage { grid-template-columns: 1fr; }
  .versus { width: 62px; height: 62px; }
  .predict-form { grid-template-columns: 1fr; }
  .mini-flag-wall { grid-template-columns: repeat(6, 1fr); }
  .top-poster h1 { font-size: 4rem; }
}
