/* ============ WORLDLE CUP '26 ============ */
:root {
  --bg: #0a0e14;
  --bg2: #0d131c;
  --surface: #141b26;
  --surface2: #1b2433;
  --line: #26303f;
  --line2: #313d4f;
  --text: #eef2f7;
  --muted: #8c99ab;
  --muted2: #65718200;
  --green: #18d27f;
  --green-dim: #0f8f57;
  --yellow: #ffcf3a;
  --red: #ff4d6d;
  --pink: #ff2d7e;
  --orange: #ff8a3d;
  --cyan: #21d4fd;
  --accent: #ff8a3d;
  --grad: linear-gradient(90deg, #ff2d7e 0%, #ff8a3d 50%, #21d4fd 100%);
  --grad-soft: linear-gradient(120deg, rgba(255,45,126,.16), rgba(255,138,61,.12), rgba(33,212,253,.16));
  --shadow: 0 10px 34px rgba(0,0,0,.45);
  --radius: 16px;
  --maxw: 1080px;
  --tab-h: 50px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
/* Kill iOS double-tap-to-zoom on interactive elements (single taps register immediately). */
button, a, select, input, [role="button"] { touch-action: manipulation; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 12% -8%, rgba(255,45,126,.10), transparent 60%),
    radial-gradient(1100px 600px at 100% 0%, rgba(33,212,253,.10), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
h1, h2, h3, .display { font-family: 'Archivo', 'Inter', system-ui, sans-serif; }
a { color: inherit; }
button { font-family: inherit; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }

/* ---------- App bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(10,14,20,.82);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.appbar-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px clamp(12px, 4vw, 22px);
}
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; }
.brand-text {
  font-family: 'Archivo'; font-weight: 900; letter-spacing: .02em; font-size: 19px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-text sup { font-size: .55em; -webkit-text-fill-color: var(--orange); margin-left: 1px; }
.countdown {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line2); color: var(--text);
  border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: border-color .2s, transform .1s;
}
.countdown:hover { border-color: var(--accent); }
.countdown:active { transform: scale(.97); }
.cd-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(24,210,127,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(24,210,127,.55);} 70%{ box-shadow: 0 0 0 7px rgba(24,210,127,0);} 100%{box-shadow:0 0 0 0 rgba(24,210,127,0);} }

.tabs {
  max-width: var(--maxw); margin: 0 auto; display: flex; gap: 2px;
  padding: 0 clamp(8px, 3vw, 18px); overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  position: relative; text-decoration: none; color: var(--muted); font-weight: 600;
  font-size: 14.5px; padding: 12px 14px; white-space: nowrap; transition: color .15s;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); }
.tabs a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px;
  background: var(--grad); border-radius: 3px 3px 0 0;
}

/* ---------- Layout ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: clamp(16px, 4vw, 30px) clamp(12px, 4vw, 22px) 60px; }
.view { animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none; } }
.section-title { font-size: clamp(22px, 5vw, 30px); font-weight: 800; margin: 0 0 4px; letter-spacing: -.01em; }
.section-sub { color: var(--muted); margin: 0 0 18px; font-size: 14.5px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- PLAY ---------- */
.play-wrap { display: grid; gap: 18px; max-width: 560px; margin: 0 auto; }
.play-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.play-title { font-size: 15px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.mode-toggle { display: inline-flex; background: var(--surface); border: 1px solid var(--line2); border-radius: 999px; padding: 3px; }
.mode-toggle button { border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.mode-toggle button[aria-pressed="true"] { background: var(--grad); color: #0a0e14; }
.icon-btns { display: flex; gap: 8px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line2); border-radius: 10px; color: var(--text); cursor: pointer; transition: border-color .2s; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn.on { border-color: var(--accent); color: var(--accent); background: rgba(255,138,61,.12); }
.silhouette-card svg { transition: transform .4s cubic-bezier(.2,.8,.2,1); }

.silhouette-card {
  position: relative; background: linear-gradient(180deg, var(--surface2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  display: grid; place-items: center; box-shadow: var(--shadow); overflow: hidden;
}
.silhouette-card::before { content:""; position:absolute; inset:0; background: var(--grad-soft); opacity:.5; }
.silhouette-card svg { position: relative; width: min(78%, 320px); height: 210px; filter: drop-shadow(0 6px 18px rgba(0,0,0,.4)); }
.silhouette-card path { fill: #e9eef5; }
.puzzle-tag { position: absolute; top: 10px; left: 12px; font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); z-index: 2; }
.card-hint { position: relative; z-index: 2; text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 6px; max-width: 420px; }
.hint-chip { position: absolute; top: 10px; right: 12px; z-index: 2; font-size: 12px; font-weight: 700; color: var(--cyan); background: rgba(33,212,253,.1); border: 1px solid rgba(33,212,253,.3); padding: 4px 10px; border-radius: 999px; }

/* game-type switch (Nation / Host City) */
.gametype-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--surface); border: 1px solid var(--line2); border-radius: 13px; padding: 4px; margin-bottom: 12px; }
.gametype-switch button { border: 0; background: transparent; color: var(--muted); font-weight: 800; font-size: 14.5px; padding: 11px; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s; }
.gametype-switch button.on { background: var(--grad); color: #0a0e14; }
.gametype-switch button:not(.on):hover { color: var(--text); }

/* fixture card (Host City game prompt) */
.silhouette-card.fixture-card { display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 26px 16px; min-height: 234px; }
.fx-q { position: relative; z-index: 2; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; text-align: center; }
.fx-teams { position: relative; z-index: 2; display: flex; align-items: flex-start; justify-content: center; gap: 16px; }
.fx-team { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 122px; }
.fx-flag { width: 78px; height: 52px; border-radius: 6px; object-fit: cover; box-shadow: var(--shadow); }
.fx-name { font-weight: 800; font-size: 14.5px; text-align: center; line-height: 1.15; }
.fx-vs { font-family: 'Archivo'; font-weight: 900; font-size: 18px; color: var(--muted); align-self: center; }
.fx-meta { position: relative; z-index: 2; text-align: center; font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* guesses */
.guesses { display: grid; gap: 8px; }
.guess-row {
  display: grid; grid-template-columns: 30px 1fr auto auto 30px; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px;
  animation: pop .3s ease; min-height: 50px;
}
@keyframes pop { from { opacity: 0; transform: scale(.96);} to { opacity:1; transform: none; } }
.guess-row.correct { border-color: var(--green); background: linear-gradient(90deg, rgba(24,210,127,.16), var(--surface)); }
.guess-flag { width: 30px; height: 21px; border-radius: 3px; object-fit: cover; background: var(--surface2); box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
/* fallback chip shown if a flag image fails to load (offline / CDN blocked) */
.flag-fb { display: inline-grid !important; place-items: center; min-width: 26px; height: 18px; padding: 0 4px; border-radius: 3px; font-size: 9px; font-weight: 800; letter-spacing: .03em; color: var(--muted); background: var(--surface2) !important; box-shadow: 0 0 0 1px rgba(255,255,255,.08); overflow: hidden; }
.reveal-flag.flag-fb, .tc-flag.flag-fb, .mh-flag.flag-fb { font-size: 17px; }
.mm-team .flag-fb { width: 72px; height: 48px; font-size: 14px; border-radius: 6px; margin: 0 auto; }
.guess-name { font-weight: 700; font-size: 15px; min-width: 0; }
.guess-name small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.guess-dist { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; text-align: right; }
.guess-prox { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; text-align: right; }
.guess-arrow { font-size: 21px; text-align: center; line-height: 1; }
.prox-bar { grid-column: 1 / -1; height: 5px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 2px; }
.prox-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--yellow), var(--green)); border-radius: 4px; transition: width .5s ease; }

/* input */
.guess-input-wrap { position: relative; }
.guess-input-row { display: flex; gap: 8px; }
#guess-input {
  flex: 1; background: var(--surface); border: 1.5px solid var(--line2); color: var(--text);
  border-radius: 12px; padding: 13px 14px; font-size: 16px; font-weight: 600; outline: none;
}
#guess-input:focus { border-color: var(--accent); }
#guess-input::placeholder { color: var(--muted); font-weight: 500; }
.btn-guess { background: var(--grad); color: #0a0e14; border: 0; border-radius: 12px; font-weight: 800; font-size: 15px; padding: 0 20px; cursor: pointer; transition: transform .1s, filter .2s; }
.btn-guess:hover { filter: brightness(1.07); }
.btn-guess:active { transform: scale(.97); }
.btn-guess:disabled { opacity: .4; cursor: not-allowed; }
.suggestions {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 20;
  background: var(--surface2); border: 1px solid var(--line2); border-radius: 12px; overflow: hidden;
  max-height: 264px; overflow-y: auto; box-shadow: var(--shadow);
}
.suggestions[hidden] { display: none; }
.sug {
  display: flex; align-items: center; gap: 10px; padding: 10px 13px; cursor: pointer; border: 0; width: 100%;
  background: transparent; color: var(--text); text-align: left; font-size: 14.5px; font-weight: 600;
}
.sug:hover, .sug.active { background: rgba(255,138,61,.14); }
.sug img { width: 26px; height: 18px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.sug .conf { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 600; }
.tries-left { text-align: center; color: var(--muted); font-size: 13px; }

/* result panel */
.result {
  text-align: center; padding: 20px; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface2), var(--surface)); animation: pop .35s ease;
}
.result.win { border-color: var(--green); }
.result.lose { border-color: var(--red); }
.result h3 { margin: 0 0 4px; font-size: 22px; }
.result .reveal-flag { width: 84px; height: 56px; border-radius: 6px; object-fit: cover; box-shadow: var(--shadow); margin: 6px 0; }
.result .reveal-name { font-size: 26px; font-weight: 900; font-family: 'Archivo'; }
.result .reveal-meta { color: var(--muted); font-size: 14px; margin: 2px 0 10px; }
.result .fact { font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; margin: 12px 0; }
.result .next-fixture { font-size: 13.5px; color: var(--muted); }
.result-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.btn { border: 0; border-radius: 11px; font-weight: 700; font-size: 14.5px; padding: 11px 18px; cursor: pointer; transition: transform .1s, filter .2s, border-color .2s; }
.btn-primary { background: var(--grad); color: #0a0e14; }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line2); }
.btn-ghost:hover { border-color: var(--accent); }
.btn:active { transform: scale(.97); }

/* stats */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-top: 16px; }
.stat { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; }
.stat b { display: block; font-size: 22px; font-family: 'Archivo'; font-weight: 800; }
.stat span { font-size: 11px; color: var(--muted); }
.dist-chart { margin-top: 12px; display: grid; gap: 5px; }
.dist-bar { display: grid; grid-template-columns: 16px 1fr; gap: 8px; align-items: center; font-size: 12.5px; }
.dist-bar i { display: block; height: 20px; background: var(--line2); border-radius: 4px; min-width: 26px; text-align: right; padding-right: 7px; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 20px; }
.dist-bar i.cur { background: var(--green); color: #06120c; }
.global-row { background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; font-size: 13.5px; font-weight: 600; }

.howto { font-size: 13.5px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; }
.howto b { color: var(--text); }
.howto ul { margin: 8px 0 0; padding-left: 18px; }
.howto li { margin: 3px 0; }

/* ---------- SCHEDULE ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; align-items: center; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  background: var(--surface); border: 1px solid var(--line2); color: var(--muted); border-radius: 999px;
  padding: 7px 13px; font-size: 13px; font-weight: 700; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--line2); }
.chip[aria-pressed="true"] { background: var(--text); color: #0a0e14; border-color: var(--text); }
select.filter, input.filter {
  background: var(--surface); border: 1px solid var(--line2); color: var(--text); border-radius: 10px;
  padding: 9px 12px; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.tz-toggle { margin-left: auto; display: inline-flex; background: var(--surface); border: 1px solid var(--line2); border-radius: 10px; padding: 3px; }
.tz-toggle button { border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 12.5px; padding: 6px 11px; border-radius: 8px; cursor: pointer; }
.tz-toggle button[aria-pressed="true"] { background: var(--surface2); color: var(--text); }

.day-group { margin-bottom: 22px; }
.day-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 9px; position: sticky; top: calc(var(--tab-h) + 52px); }
.day-head .dh-date { font-size: 16px; font-weight: 800; font-family: 'Archivo'; }
.day-head .dh-count { font-size: 12px; color: var(--muted); }
.day-head .dh-stage { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-left: auto; }

.match {
  display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 11px 14px;
  margin-bottom: 8px; cursor: pointer; transition: border-color .15s, transform .08s;
}
.match:hover { border-color: var(--line2); }
.match:active { transform: scale(.995); }
.match .m-time { text-align: left; }
.match .m-time b { display: block; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.match .m-time span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.match .m-teams { display: grid; gap: 5px; min-width: 0; }
.m-team { display: flex; align-items: center; gap: 9px; min-width: 0; }
.m-team img { width: 26px; height: 18px; border-radius: 2px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.07); }
.m-team .tn { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-team.placeholder .tn { color: var(--muted); font-weight: 600; font-style: italic; }
.ph-badge { width: 26px; height: 18px; border-radius: 2px; background: var(--surface2); display: grid; place-items: center; font-size: 9px; color: var(--muted); flex: none; }
.match .m-meta { text-align: right; }
.match .m-venue { font-size: 12px; color: var(--muted); white-space: nowrap; }
.match .m-no { font-size: 10px; color: var(--muted2); }
.gbadge { display: inline-block; min-width: 17px; text-align: center; font-size: 10.5px; font-weight: 800; padding: 1px 5px; border-radius: 5px; background: var(--surface2); color: var(--accent); border: 1px solid var(--line2); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- GROUPS ---------- */
.groups-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.group-card { padding: 14px; }
.group-card h3 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.group-card h3 .gl { background: var(--grad); color: #0a0e14; font-family:'Archivo'; font-weight: 900; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; }
.g-team { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 9px; cursor: pointer; transition: background .12s; }
.g-team:hover { background: var(--surface2); }
.g-team img { width: 28px; height: 20px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.07); }
.g-team .gt-name { font-weight: 700; font-size: 14px; }
.g-team .gt-rank { margin-left: auto; font-size: 11px; color: var(--muted); }
.g-team .debut { font-size: 9px; font-weight: 800; color: var(--cyan); background: rgba(33,212,253,.12); border:1px solid rgba(33,212,253,.3); padding: 1px 6px; border-radius: 999px; letter-spacing:.05em; }

/* ---------- BRACKET ---------- */
.bracket-scroll { overflow-x: auto; padding-bottom: 16px; -webkit-overflow-scrolling: touch; }
.bracket { display: flex; gap: 26px; min-width: max-content; padding: 4px; }
.br-col { display: flex; flex-direction: column; justify-content: space-around; gap: 12px; min-width: 200px; }
.br-col-title { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; text-align: center; }
.br-match { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 9px 11px; font-size: 12.5px; }
.br-match.final { border-color: var(--accent); background: linear-gradient(180deg, rgba(255,138,61,.12), var(--surface)); }
.br-slot { display: flex; align-items: center; gap: 7px; padding: 3px 0; color: var(--muted); font-weight: 600; }
.br-slot .ph-badge { width: 22px; height: 15px; }
.br-vs { font-size: 9px; color: var(--muted2); text-align: center; letter-spacing: .2em; margin: 1px 0; }
.br-meta { font-size: 10.5px; color: var(--muted); margin-top: 6px; display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 5px; }
.br-hint { color: var(--muted); font-size: 13px; margin-bottom: 14px; }

/* ---------- TEAMS ---------- */
.teams-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.team-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  cursor: pointer; transition: border-color .15s, transform .1s; position: relative; overflow: hidden;
}
.team-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.team-card .tc-flag { width: 56px; height: 38px; border-radius: 5px; object-fit: cover; box-shadow: var(--shadow); }
.team-card .tc-name { font-weight: 800; font-size: 15px; margin-top: 9px; }
.team-card .tc-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.team-card .tc-grp { font-weight: 800; color: var(--accent); }
.team-card .debut { font-size: 9px; font-weight: 800; color: var(--cyan); background: rgba(33,212,253,.12); border:1px solid rgba(33,212,253,.3); padding: 1px 6px; border-radius: 999px; }
.team-card .host { font-size: 9px; font-weight: 800; color: var(--green); background: rgba(24,210,127,.12); border:1px solid rgba(24,210,127,.3); padding: 1px 6px; border-radius: 999px; }

/* ---------- MODAL ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(4,7,11,.7); backdrop-filter: blur(4px); z-index: 80; display: grid; place-items: center; padding: 16px; animation: fade .2s ease; }
.modal {
  background: var(--surface); border: 1px solid var(--line2); border-radius: 18px; box-shadow: var(--shadow);
  max-width: 460px; width: 100%; max-height: 88dvh; overflow-y: auto; animation: pop .25s ease;
}
.modal-hero { position: relative; padding: 22px 22px 16px; background: var(--grad-soft); border-bottom: 1px solid var(--line); }
.modal-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line2); background: var(--surface); color: var(--text); cursor: pointer; font-size: 17px; display:grid; place-items:center; }
.modal-close:hover { border-color: var(--accent); }
.modal-hero .mh-top { display: flex; align-items: center; gap: 14px; }
.modal-hero .mh-flag { width: 74px; height: 50px; border-radius: 6px; object-fit: cover; box-shadow: var(--shadow); flex: none; }
.modal-hero h3 { margin: 0; font-size: 23px; font-weight: 900; }
.modal-hero .mh-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.modal-sil { width: 90px; height: 70px; display: grid; place-items: center; margin-left: auto; }
.modal-sil svg { width: 100%; height: 100%; }
.modal-sil path { fill: rgba(255,255,255,.6); }
.modal-body { padding: 18px 22px 22px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin-bottom: 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; }
.modal-fact { font-size: 14px; background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.modal-fixtures h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.mf { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 13px; padding: 7px 0; border-top: 1px solid var(--line); }
.mf .mf-date { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.mf .mf-opp { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.mf .mf-opp img { width: 22px; height: 15px; border-radius: 2px; object-fit: cover; }
.mf .mf-venue { font-size: 11px; color: var(--muted); text-align: right; }

/* match modal */
.mm-head { text-align: center; }
.mm-head .mm-no { font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.mm-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin: 14px 0; }
.mm-team { text-align: center; }
.mm-team img { width: 72px; height: 48px; border-radius: 6px; object-fit: cover; box-shadow: var(--shadow); }
.mm-team .ph-badge { width: 72px; height: 48px; font-size: 13px; }
.mm-team .nm { font-weight: 800; margin-top: 8px; font-size: 15px; }
.mm-vs { font-family:'Archivo'; font-weight: 900; color: var(--muted); font-size: 15px; }
.mm-info { display: grid; gap: 9px; font-size: 14px; }
.mm-info .row { display: flex; align-items: center; gap: 10px; }
.mm-info .row svg { flex: none; color: var(--accent); }

/* ---------- toast + confetti ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: #0a0e14; font-weight: 700; font-size: 14px; padding: 11px 18px;
  border-radius: 12px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all .25s; z-index: 90;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; display: none; }

/* ---------- PREDICT ---------- */
.predict-banner { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--grad-soft); margin-bottom: 22px; flex-wrap: wrap; }
.predict-banner.has-champ { border-color: var(--accent); }
.predict-banner .pb-flag { width: 64px; height: 44px; border-radius: 6px; object-fit: cover; box-shadow: var(--shadow); }
.predict-banner .pb-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.predict-banner .pb-name { font-size: 26px; font-weight: 900; font-family: 'Archivo'; line-height: 1.1; }
.predict-banner .pb-actions { margin-left: auto; display: flex; gap: 8px; }
.predict-step { font-size: 16px; font-weight: 800; margin: 26px 0 12px; display: flex; align-items: center; gap: 10px; }
.predict-step .step-no { width: 24px; height: 24px; border-radius: 7px; background: var(--grad); color: #0a0e14; font-family: 'Archivo'; font-weight: 900; font-size: 14px; display: grid; place-items: center; flex: none; }
.predict-step .step-hint { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--line2); padding: 4px 10px; border-radius: 999px; }
.predict-note { color: var(--muted); font-size: 14px; background: var(--surface); border: 1px dashed var(--line2); border-radius: 12px; padding: 14px 16px; }
.grp-done { margin-left: auto; color: var(--green); font-weight: 900; }
.p-team { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; cursor: pointer; border-left: 3px solid transparent; transition: background .12s; user-select: none; }
.p-team:hover { background: var(--surface2); }
.p-team .p-rank { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--surface2); color: var(--muted); flex: none; border: 1px solid var(--line2); }
.p-team .p-flag { width: 26px; height: 18px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.07); }
.p-team .p-name { font-weight: 700; font-size: 14px; }
.p-team .p-tag { margin-left: auto; font-size: 9px; font-weight: 800; padding: 2px 7px; border-radius: 999px; letter-spacing: .05em; }
.p-team .p-tag.green { color: var(--green); background: rgba(24,210,127,.13); }
.p-team .p-tag.amber { color: var(--yellow); background: rgba(255,207,58,.13); }
.p-team.r1 { border-left-color: var(--green); } .p-team.r1 .p-rank { background: var(--green); color: #06120c; border-color: transparent; }
.p-team.r2 { border-left-color: var(--cyan); } .p-team.r2 .p-rank { background: var(--cyan); color: #06181c; border-color: transparent; }
.p-team.r3 { border-left-color: var(--yellow); } .p-team.r3 .p-rank { background: var(--yellow); color: #211a00; border-color: transparent; }
.p-team.r4 { opacity: .55; }
.thirds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.third-chip { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line2); border-radius: 11px; padding: 8px 11px; cursor: pointer; color: var(--text); text-align: left; font-weight: 700; font-size: 13px; transition: all .15s; }
.third-chip img { width: 24px; height: 16px; border-radius: 2px; object-fit: cover; }
.third-chip .tc3-g { margin-left: auto; font-size: 10px; color: var(--muted); }
.third-chip.on { border-color: var(--green); background: rgba(24,210,127,.12); }
.third-chip.on .tc3-g { color: var(--green); }
.predict-bracket .predict-match { padding: 6px; }
.p-slot { display: flex; align-items: center; gap: 7px; padding: 6px 7px; border-radius: 8px; border: 1px solid transparent; }
.p-slot.live { cursor: pointer; }
.p-slot.live:hover { background: var(--surface2); }
.p-slot.picked { background: rgba(24,210,127,.15); border-color: var(--green); }
.p-slot .ps-flag { width: 22px; height: 15px; border-radius: 2px; object-fit: cover; flex: none; }
.p-slot .ps-flag.ph-badge { display: grid; place-items: center; background: var(--surface2); font-size: 9px; color: var(--muted); }
.p-slot .ps-name { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-slot .ps-name.muted { font-weight: 600; }

/* ---------- live results / scores ---------- */
.st-badge { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .04em; padding: 1px 6px; border-radius: 5px; background: var(--surface2); color: var(--muted); border: 1px solid var(--line2); white-space: nowrap; }
.st-badge.live { color: #fff; background: rgba(255,77,109,.18); border-color: var(--red); animation: livepulse 2s infinite; }
@keyframes livepulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,77,109,.35); } 50% { box-shadow: 0 0 0 4px rgba(255,77,109,0); } }
.m-score { margin-left: auto; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--muted); padding-left: 8px; }
.m-team.mw .tn, .m-team.mw .m-score { color: var(--green); }
.mm-vs.score { display: grid; justify-items: center; gap: 3px; }
.mm-vs.score b { font-size: 24px; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mm-vs.score small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.br-slot.real { color: var(--text); }
.br-slot .br-flag { width: 22px; height: 15px; border-radius: 2px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.07); }
.br-slot .br-score { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.br-slot.won { color: var(--green); }
.br-slot.won .br-score { color: var(--green); }

/* group standings table */
.tbl-head { display: grid; grid-template-columns: 18px 28px 1fr 26px 32px 30px; gap: 8px; padding: 0 6px 4px; font-size: 10px; font-weight: 800; letter-spacing: .05em; color: var(--muted); text-transform: uppercase; }
.tbl-head span:nth-child(n+3) { text-align: right; }
.g-team.tbl { display: grid; grid-template-columns: 18px 28px 1fr 26px 32px 30px; gap: 8px; align-items: center; }
.g-team.tbl .gt-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tbl-pos { font-size: 11px; font-weight: 800; color: var(--muted); text-align: center; }
.tbl-n { font-size: 12.5px; font-variant-numeric: tabular-nums; text-align: right; color: var(--muted); font-weight: 600; }
.tbl-n.tbl-pts { font-weight: 800; color: var(--text); }
.g-team.adv { border-left: 3px solid var(--green); background: rgba(24,210,127,.05); border-radius: 6px; }
.g-team.adv3 { border-left: 3px solid var(--yellow); background: rgba(255,207,58,.04); border-radius: 6px; }

/* today on the schedule */
.day-group { scroll-margin-top: 112px; }
.day-group.today .day-head .dh-date { color: var(--green); }
.dh-today { font-size: 9px; font-weight: 900; letter-spacing: .08em; color: #06120c; background: var(--green); padding: 2px 7px; border-radius: 999px; }
.chip.chip-today { color: var(--green); border-color: rgba(24,210,127,.4); }
.chip.chip-today:hover { border-color: var(--green); }

/* Today at the Cup strip (play view) */
.today-strip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; }
.ts-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ts-head b { font-size: 13.5px; font-weight: 800; }
.ts-head a { font-size: 12px; color: var(--cyan); text-decoration: none; font-weight: 700; }
.ts-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 7px 4px; border-top: 1px solid var(--line); cursor: pointer; border-radius: 7px; }
.ts-row:hover { background: var(--surface2); }
.ts-time { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.ts-teams { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; min-width: 0; }
.ts-team { display: inline-flex; align-items: center; gap: 5px; }
.ts-team.muted { color: var(--muted); font-weight: 600; font-size: 12px; }
.ts-flag { width: 22px; height: 15px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.07); }
.ts-mid { color: var(--muted); font-size: 11.5px; }
.ts-score { color: var(--text); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ts-meta { font-size: 11.5px; color: var(--muted); text-align: right; white-space: nowrap; }
.ts-badge { font-size: 10.5px; font-weight: 800; color: var(--muted); }
.ts-badge.live { color: var(--red); }

/* archive */
.archive-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: rgba(33,212,253,.07); border: 1px solid rgba(33,212,253,.25); border-radius: 11px; padding: 9px 13px; font-size: 13px; font-weight: 700; }
.archive-banner a { color: var(--cyan); font-weight: 800; text-decoration: none; white-space: nowrap; }
.archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.archive-cell { position: relative; display: grid; gap: 1px; justify-items: center; background: var(--surface2); border: 1px solid var(--line2); border-radius: 10px; padding: 9px 6px 8px; cursor: pointer; color: var(--text); transition: border-color .15s; }
.archive-cell:hover { border-color: var(--accent); }
.archive-cell b { font-family: 'Archivo'; font-size: 14px; }
.archive-cell span { font-size: 10.5px; color: var(--muted); }
.archive-cell i { position: absolute; top: 5px; right: 7px; font-style: normal; font-size: 10px; font-weight: 900; }
.archive-cell.won { border-color: rgba(24,210,127,.45); } .archive-cell.won i { color: var(--green); }
.archive-cell.lost { border-color: rgba(255,77,109,.4); } .archive-cell.lost i { color: var(--red); }
.archive-cell.part i { color: var(--yellow); }

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  .brand-text { font-size: 16px; }
  .stats-row { grid-template-columns: repeat(4,1fr); }
  .match { grid-template-columns: 58px 1fr auto; gap: 9px; padding: 10px 11px; }
  .match .m-venue { display: none; }
  .day-head { top: calc(var(--tab-h) + 50px); }
  .guess-row { grid-template-columns: 28px 1fr auto 26px; }
  .guess-prox { display: none; }
}
@media (min-width: 720px) {
  .play-wrap { max-width: 600px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto; }
}
