:root {
  --bg: #0a1c14;
  --bg2: #0d2419;
  --panel: #102b1f;
  --panel2: #143527;
  --line: rgba(255, 255, 255, 0.09);
  --text: #e9f6ef;
  --muted: #88ab9c;
  --accent: #34d399;   /* grass / emerald */
  --accent-d: #0f9c74;
  --live: #ff4d5e;      /* live red */
  --gold: #f5c451;      /* 3rd-place playoff */
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(52, 211, 153, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg2), var(--bg));
  background-attachment: fixed;
  min-height: 100vh;
}
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 18px; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
.accent { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .82rem; }

/* header */
.site-head { border-bottom: 1px solid var(--line); background: rgba(8, 22, 16, 0.6); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.head-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); font-weight: 800; }
.brand-mark { font-size: 1.4rem; }
.brand-name { letter-spacing: -.02em; font-size: 1.18rem; }
.tz-badge {
  font-size: .76rem; color: var(--accent); background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.28); padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}

/* hero */
.hero { padding: 34px 0 14px; }
.hero h1 { font-size: clamp(1.7rem, 4.2vw, 2.7rem); font-weight: 850; letter-spacing: -.03em; }
.hero .sub { color: var(--muted); max-width: 60ch; margin: 12px 0 0; font-size: 1.02rem; }

/* section heads */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }

/* live now */
.live-wrap { margin-top: 22px; }
.live-wrap > .section-head h2 { color: #fff; }

/* day nav */
.day-nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 6px; flex-wrap: wrap; }
.day-nav { display: flex; align-items: center; gap: 10px; }
.nav-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font-size: 1.3rem; line-height: 1; cursor: pointer; transition: .15s;
}
.nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.day-label { font-weight: 750; font-size: 1.12rem; min-width: 7.5em; text-align: center; }
.today-btn {
  border: 1px solid rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.12); color: var(--accent);
  border-radius: 999px; padding: 6px 14px; font-size: .82rem; font-weight: 650; cursor: pointer;
}

/* match grid + cards */
.match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.match {
  background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 15px; box-shadow: var(--shadow);
}
.match.is-live { border-color: rgba(255, 77, 94, 0.5); box-shadow: 0 0 0 1px rgba(255, 77, 94, 0.25), var(--shadow); }
.m-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; min-height: 20px; }
.round { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.badge.pre { background: rgba(52, 211, 153, 0.12); color: var(--accent); }
.badge.done { background: rgba(255, 255, 255, 0.07); color: var(--muted); }
.badge.live { background: rgba(255, 77, 94, 0.16); color: #ff8a95; }

.t-row { display: flex; align-items: center; gap: 11px; padding: 6px 0; }
.t-row + .t-row { border-top: 1px solid var(--line); }
.crest { width: 24px; height: 24px; object-fit: contain; flex: none; border-radius: 4px; background: rgba(255, 255, 255, 0.06); }
.crest.sm { width: 18px; height: 18px; }
.crest-x { display: inline-flex; align-items: center; justify-content: center; font-size: .6rem; font-weight: 800; color: var(--muted); }
.t-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-row.is-win .t-name { color: #fff; }
.t-score { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.15rem; min-width: 1.1em; text-align: right; }
.t-score.is-win { color: var(--accent); }

.m-foot { margin-top: 9px; min-height: 16px; display: flex; align-items: center; justify-content: space-between; }
.venue { font-size: .74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-btn { font-size: .76rem; color: var(--accent); background: transparent; border: 1px solid rgba(52, 211, 153, 0.32); border-radius: 8px; padding: 4px 10px; cursor: pointer; transition: .15s; }
.cal-btn:hover { background: rgba(52, 211, 153, 0.12); }

/* live dot + flash */
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); display: inline-block; box-shadow: 0 0 0 0 rgba(255, 77, 94, 0.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 77, 94, 0.55); } 70% { box-shadow: 0 0 0 7px rgba(255, 77, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 77, 94, 0); } }
.match.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { background: rgba(52, 211, 153, 0.28); } 100% { background: linear-gradient(180deg, var(--panel2), var(--panel)); } }

/* standings */
.standings-section { margin-top: 30px; }
.groups-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.grp { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 13px; }
.grp h3 { font-size: .95rem; margin-bottom: 8px; color: #fff; }
.st-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.st-table th { color: var(--muted); font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; padding: 3px 4px; text-align: center; }
.st-table td { padding: 5px 4px; text-align: center; font-variant-numeric: tabular-nums; border-top: 1px solid var(--line); }
.st-table th.st-team, .st-table td.st-team { text-align: left; }
.st-team { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.pos { color: var(--muted); width: 1.4em; }
.pts { font-weight: 800; color: var(--text); }
tr.q1 .pos { color: var(--accent); font-weight: 800; box-shadow: inset 2px 0 0 var(--accent); }
tr.q3 .pos { color: var(--gold); box-shadow: inset 2px 0 0 var(--gold); }

/* about */
.about { margin: 40px 0 10px; }
.about h2 { font-size: 1.2rem; margin-bottom: 12px; }
.why { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.why li { color: var(--muted); padding-left: 22px; position: relative; }
.why li::before { content: "⚽"; position: absolute; left: 0; }
.why strong { color: var(--text); }
.disclaimer { color: var(--muted); font-size: .8rem; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }

/* states */
.loading, .empty { color: var(--muted); padding: 22px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); grid-column: 1 / -1; }

/* footer */
.site-foot { border-top: 1px solid var(--line); margin-top: 44px; padding: 22px 0; color: var(--muted); font-size: .85rem; }

/* hide manual ad slots during the auto-ads phase */
.ad-slot { display: none !important; }

@media (max-width: 540px) {
  .hero { padding-top: 24px; }
  .match-grid, .groups-grid { grid-template-columns: 1fr; }
}

/* ===== bracket predictor ===== */
.home-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin: 22px 0 4px; padding: 16px 20px; border-radius: var(--radius);
  background: linear-gradient(110deg, rgba(52, 211, 153, 0.16), rgba(52, 211, 153, 0.04));
  border: 1px solid rgba(52, 211, 153, 0.32);
}
.home-cta .cta-txt strong { display: block; font-size: 1.1rem; }
.home-cta .cta-txt span { color: var(--muted); font-size: .9rem; }

.btn { font: inherit; font-weight: 700; border-radius: 10px; padding: 10px 18px; cursor: pointer; border: 1px solid transparent; transition: .15s; }
.btn.sm { padding: 7px 13px; font-size: .85rem; }
.btn.primary { background: var(--accent); color: #06251a; border-color: var(--accent); }
.btn.primary:hover { background: #4ee3b0; }
.btn.primary:disabled { opacity: .42; cursor: not-allowed; }
.btn.ghost { background: rgba(255, 255, 255, 0.05); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }

.prog { margin: 18px 0 22px; }
.prog-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.prog-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-d), var(--accent)); transition: width .35s ease; }
.prog-steps { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: .76rem; color: var(--muted); }
.prog-steps .on { color: var(--accent); font-weight: 750; }
.prog-steps .done { color: var(--text); }

.step-intro { margin-bottom: 16px; }
.step-intro h2 { font-size: 1.3rem; }
.step-intro p { margin: 6px 0 12px; }

/* team chip */
.tm { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; }
.tm img { object-fit: contain; border-radius: 3px; background: rgba(255, 255, 255, 0.06); flex: none; }
.tm-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm.tbd { color: var(--muted); font-weight: 500; }
.tm.big { font-size: 1.1rem; }
.tm.big img { width: 30px; height: 30px; }
.tm.xs { font-size: .78rem; gap: 5px; }
.tm.xs img { width: 16px; height: 16px; }

/* groups step */
.grp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.grp-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.grp-card h3 { font-size: .95rem; margin-bottom: 8px; color: #fff; }
.pick-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: transparent; border: 1px solid transparent; border-top: 1px solid var(--line); padding: 8px 6px; cursor: pointer; color: var(--text); transition: .12s; border-radius: 8px; }
.pick-row:first-of-type { border-top: 0; }
.pick-row:hover { background: rgba(255, 255, 255, 0.04); }
.rk { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 800; flex: none; background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.rk-x { background: transparent; border: 1px dashed var(--line); }
.pick-row.p1 .rk { background: var(--accent); color: #06251a; }
.pick-row.p2 .rk { background: #9fe7cf; color: #06251a; }
.pick-row.p1, .pick-row.p2 { background: rgba(52, 211, 153, 0.07); }
.pick-row.p3 .rk { background: var(--gold); color: #3a2c00; }
.pick-row.p4 { opacity: .5; }

/* wildcards step */
.wc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.wc { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; color: var(--text); transition: .12s; }
.wc:hover { border-color: rgba(52, 211, 153, 0.4); }
.wc.on { background: rgba(52, 211, 153, 0.14); border-color: var(--accent); }
.wc-grp { font-size: .72rem; color: var(--muted); }

/* knockout step */
.ko-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.ko-match { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ko-side { display: flex; align-items: center; width: 100%; text-align: left; padding: 12px 14px; background: transparent; border: 0; color: var(--text); cursor: pointer; transition: .12s; }
.ko-side + .ko-side { border-top: 1px solid var(--line); }
.ko-side:hover:not([disabled]) { background: rgba(255, 255, 255, 0.04); }
.ko-side.sel { background: rgba(52, 211, 153, 0.16); box-shadow: inset 3px 0 0 var(--accent); }
.ko-side[disabled] { opacity: .45; cursor: default; }

/* step nav */
.step-nav { display: flex; justify-content: space-between; gap: 12px; margin: 24px 0 8px; position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(180deg, transparent, var(--bg) 40%); }
.step-nav .btn { min-width: 110px; }

/* done / champion */
.done-card { text-align: center; background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid rgba(52, 211, 153, 0.35); border-radius: 18px; padding: 30px 20px; box-shadow: var(--shadow); }
.trophy { font-size: 3rem; }
.champ-label { color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: .8rem; margin-top: 4px; }
.champ-name { margin: 8px 0 6px; font-size: 1.5rem; display: flex; justify-content: center; }
.finalists { color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.finalists .vs { opacity: .6; }
.share-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 20px; }
.share-note { margin-top: 12px; color: var(--accent); font-size: .85rem; min-height: 18px; }

.vs-reality { margin-top: 16px; }
.vsr-card { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.vsr-big { font-size: 1.8rem; font-weight: 850; color: var(--accent); font-variant-numeric: tabular-nums; flex: none; }
.vsr-txt { color: var(--muted); font-size: .9rem; text-align: left; }

.path-summary { margin-top: 22px; }
.path-summary h3 { font-size: 1rem; margin-bottom: 10px; }
.path-round { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); }
.pr-name { font-size: .78rem; color: var(--muted); min-width: 110px; flex: none; }
.pr-teams { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.redo-row { display: flex; gap: 10px; justify-content: center; margin: 22px 0; }
