:root {
  --bg: #020812;
  --navy: #071426;
  --navy-2: #0d1b2d;
  --card: rgba(15, 30, 49, 0.82);
  --line: rgba(226, 190, 91, 0.36);
  --gold: #f3d36b;
  --gold-2: #b89236;
  --text: #f7f8fb;
  --muted: #9ba5b7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(57, 85, 118, .65), transparent 34%),
    radial-gradient(circle at 5% 45%, rgba(13, 76, 100, .35), transparent 25%),
    linear-gradient(180deg, #09182b 0%, #020812 55%, #01050c 100%);
}

.page-shell {
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 22px 14px 40px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: clamp(22px, 5vw, 44px);
  border: 1px solid var(--line);
  border-radius: 36px;
  background:
    linear-gradient(145deg, rgba(6, 18, 35, .96), rgba(2, 9, 18, .98)),
    var(--navy);
  box-shadow: 0 30px 90px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(120deg, transparent 0 45%, rgba(255,255,255,.04) 45% 46%, transparent 46% 100%),
    radial-gradient(circle at 15% 18%, transparent 0 115px, rgba(243,211,107,.08) 116px 130px, transparent 131px),
    radial-gradient(circle at 10% 76%, transparent 0 130px, rgba(243,211,107,.05) 131px 134px, transparent 135px);
  pointer-events: none;
}

.shine {
  position: absolute;
  width: 90px;
  height: 620px;
  left: -45px;
  top: 38%;
  transform: rotate(22deg);
  background: linear-gradient(180deg, transparent, rgba(243,211,107,.18), transparent);
  filter: blur(8px);
}
.orb { position: absolute; border-radius: 999px; pointer-events: none; }
.orb-one { width: 230px; height: 230px; right: -110px; top: -80px; background: rgba(29, 70, 110, .28); }
.orb-two { width: 170px; height: 170px; left: -90px; bottom: 10%; border: 1px solid rgba(243,211,107,.12); }

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  direction: ltr;
}
.brand-copy { text-align: center; flex: 1; }
.brand-copy h1 {
  margin: 0;
  font-size: clamp(2.2rem, 8vw, 4.4rem);
  letter-spacing: 3px;
  font-weight: 900;
}
.brand-copy p {
  margin: 2px 0 0;
  color: var(--gold);
  font-weight: 800;
  font-size: clamp(.85rem, 3vw, 1.35rem);
}
.logo {
  width: clamp(72px, 18vw, 112px);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 26px;
  background: transparent;
  box-shadow: 0 12px 28px rgba(0,0,0,.28);
}

.pill {
  position: relative;
  z-index: 1;
  width: fit-content;
  margin: 32px auto 52px;
  padding: 11px 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold);
  font-size: clamp(1rem, 4vw, 1.55rem);
  font-weight: 900;
  background: rgba(25, 27, 23, .55);
}

.headline { position: relative; z-index: 1; text-align: center; }
.headline .eyebrow, .headline h2 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 4.4rem);
  font-weight: 900;
  line-height: 1.02;
}
.headline h2 { color: var(--gold); }
.headline .sub {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 700;
  font-size: clamp(1rem, 3.5vw, 1.35rem);
}

.match-focus {
  position: relative;
  z-index: 1;
  margin: 40px auto 34px;
  padding: 26px 18px;
  width: min(100%, 560px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 32px;
  background: var(--card);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.team {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: clamp(1.45rem, 6vw, 2.35rem);
  font-weight: 900;
}
.flag {
  width: 34px;
  height: 24px;
  object-fit: cover;
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.2);
}
.versus {
  width: 74px;
  height: 74px;
  margin: 22px auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--gold);
  font-size: 1.3rem;
  font-weight: 900;
  background: rgba(20,20,18,.72);
}

.countdown-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0 auto 30px;
  width: min(100%, 560px);
}
.time-box {
  min-height: 136px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(47,47,39,.78), rgba(13,20,31,.88));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 14px 26px rgba(0,0,0,.18);
}
.time-box strong {
  color: var(--gold);
  font-size: clamp(2.5rem, 10vw, 4rem);
  line-height: .9;
  font-weight: 900;
  direction: ltr;
}
.time-box span { color: #d8dbe4; font-size: 1.1rem; font-weight: 700; }

.host-chips {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px auto 36px;
}
.chip-flag {
  width: 26px;
  height: 18px;
  object-fit: cover;
  border-radius: 4px;
  margin-inline-end: 6px;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18);
}

.host-chips span {
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.08);
  color: #dfe3ee;
  font-weight: 800;
}
.divider {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  height: 1px;
  margin: 0 auto 28px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.schedule-section { position: relative; z-index: 1; }
.section-title { text-align: center; margin-bottom: 18px; }
.section-title h3 { margin: 0; font-size: 1.8rem; color: var(--gold); }
.section-title p { margin: 6px 0 0; color: var(--muted); font-weight: 700; }

.match-list {
  display: grid;
  gap: 14px;
}
.match-card {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  padding: 14px;
  background: rgba(12, 27, 45, .72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.match-meta {
  display: flex;
  direction: rtl;
  justify-content: space-between;
  gap: 12px;
  color: var(--gold);
  font-weight: 900;
  margin-bottom: 12px;
}
.match-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  direction: ltr;
}
.match-row .side {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 800;
  direction: rtl;
}
.match-row .side:last-child { justify-content: flex-end; }
.small-vs {
  color: var(--gold);
  border: 1px solid var(--line);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
}
.card-countdown {
  margin-top: 12px;
  color: var(--muted);
  font-weight: 800;
  direction: rtl;
  unicode-bidi: plaintext;
  text-align: center;
}

.card-countdown.is-live {
  color: #ffffff;
  background: rgba(194, 44, 44, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 14px;
}
.card-countdown.is-finished {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 8px 14px;
}

footer {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-top: 34px;
}
footer p { color: var(--muted); font-size: 1.2rem; font-weight: 800; }
footer h3 { margin: 0; font-size: clamp(1.45rem, 6vw, 2.35rem); }
footer span { color: var(--gold); }

@media (max-width: 460px) {
  .page-shell { padding: 0; }
  .hero-card { border-radius: 0; border-left: 0; border-right: 0; }
  .topbar { align-items: flex-start; }
  .countdown-grid { gap: 14px; }
  .time-box { min-height: 116px; border-radius: 22px; }
  .match-row { grid-template-columns: 1fr 38px 1fr; gap: 6px; }
  .match-row .side { font-size: .9rem; }
}

.match-filter {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 18px auto 20px;
}
.filter-select,
.filter-clear,
.filter-close,
.team-option {
  font: inherit;
}
.filter-select {
  min-width: min(100%, 290px);
  padding: 13px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(47,47,39,.72), rgba(13,20,31,.9));
  color: var(--gold);
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 12px 24px rgba(0,0,0,.16);
}
.filter-clear {
  padding: 9px 16px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: #dfe3ee;
  font-weight: 800;
  cursor: pointer;
}
.filter-summary {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}
.filter-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.filter-modal.is-open { display: flex; }
.filter-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(6px);
}
.filter-dialog {
  position: relative;
  width: min(100%, 520px);
  max-height: min(76vh, 690px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(6,18,35,.98), rgba(2,9,18,.98));
  box-shadow: 0 26px 80px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.06);
}
.filter-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.filter-dialog-head h4 {
  margin: 0;
  color: var(--gold);
  font-size: 1.35rem;
}
.filter-close {
  padding: 8px 13px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: #dfe3ee;
  font-weight: 800;
  cursor: pointer;
}
.filter-search {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  outline: none;
}
.filter-search::placeholder { color: rgba(223,227,238,.62); }
.filter-search:focus { border-color: var(--line); }
.team-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  overflow: auto;
  padding-inline-end: 4px;
}
.team-option {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 17px;
  background: rgba(255,255,255,.055);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}
.team-option:hover,
.team-option.is-active {
  border-color: var(--line);
  background: rgba(243,211,107,.12);
  color: var(--gold);
}
.option-flag {
  width: 28px;
  height: 20px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18);
}
.empty-state {
  padding: 26px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 22px;
  background: rgba(12, 27, 45, .72);
  color: var(--muted);
  text-align: center;
  font-weight: 900;
}

@media (max-width: 460px) {
  .filter-dialog { padding: 16px; border-radius: 24px; }
  .team-options { grid-template-columns: 1fr; }
  .filter-select { width: 100%; }
}


/* Mobile app-style tabs */
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.bottom-tabs {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 80;
  width: min(calc(100% - 22px), 560px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(226, 190, 91, .28);
  border-radius: 24px;
  background: rgba(4, 14, 27, .88);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(14px);
}
.bottom-tab {
  min-height: 58px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 7px 6px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  color: #dfe3ee;
  font: inherit;
  font-size: .82rem;
  font-weight: 900;
  cursor: pointer;
}
.bottom-tab.is-active {
  color: var(--gold);
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(243, 211, 107, .14), rgba(255, 255, 255, .04));
}
.tab-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
}
.tab-icon svg { width: 22px; height: 22px; fill: currentColor; }
body { padding-bottom: 94px; }

/* Groups tab */
.groups-section, .bracket-section {
  position: relative;
  z-index: 1;
  padding-top: 18px;
}
.group-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 18px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.group-tab {
  flex: 0 0 auto;
  min-width: 82px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: #dfe3ee;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  scroll-snap-align: center;
}
.group-tab.is-active {
  color: var(--gold);
  border-color: var(--line);
  background: rgba(243, 211, 107, .12);
}
.group-content {
  display: grid;
  gap: 18px;
}
.group-card {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 26px;
  padding: 18px;
  background: rgba(12, 27, 45, .72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.group-card h4, .group-matches-title {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 1.3rem;
  font-weight: 900;
  text-align: center;
}
.group-teams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.group-team {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  background: rgba(255,255,255,.055);
  color: var(--text);
  font-weight: 900;
}
.group-team img {
  width: 30px;
  height: 21px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18);
}
.group-match-list {
  display: grid;
  gap: 12px;
}
.group-match {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  background: rgba(255,255,255,.04);
}
.group-match-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--gold);
  font-weight: 900;
  font-size: .92rem;
}
.group-match-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  direction: ltr;
}
.group-match-side {
  display: flex;
  align-items: center;
  gap: 7px;
  direction: rtl;
  font-weight: 900;
}
.group-match-side:last-child { justify-content: flex-end; }
.group-match-side img {
  width: 26px;
  height: 18px;
  object-fit: cover;
  border-radius: 4px;
}

/* Bracket tab */
.bracket-scroll {
  width: 100%;
  overflow-x: hidden;
  padding: 10px 0 96px;
}

.bracket-map {
  position: relative;
  z-index: 1;
  width: min(100%, 640px);
  margin: 0 auto;
  direction: rtl;
}

/* Top tree: flipped so leaves (R32) are at top, root (SF) near center */
.bracket-top-tree {
  width: 100%;
  transform: scaleY(-1);
}
.bracket-top-tree .tree-match,
.bracket-top-tree .tree-tier-label {
  transform: scaleY(-1);
}

/* Bottom tree: normal orientation, root (SF) near center, leaves (R32) at bottom */
.bracket-bottom-tree {
  width: 100%;
}

/* Final tier in center */
.bracket-final-tier {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
}
.bracket-final-connector {
  width: 2px;
  height: 22px;
  background: linear-gradient(180deg, rgba(226,190,91,.55), rgba(226,190,91,.2));
}
.bracket-final-tier .tree-match-final {
  margin: 10px 0;
}

/* Tree node */
.tree-node {
  position: relative;
  width: 100%;
}
.tree-node > .tree-match {
  margin-inline: auto;
}

/* Tier label (round name above each level) */
.tree-tier-label {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--gold);
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.2;
  padding: 8px 0 4px;
}

/* Match card base */
.tree-match {
  position: relative;
  width: min(100%, 260px);
  min-height: 108px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(15,30,49,.98), rgba(8,20,35,.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055), 0 12px 24px rgba(0,0,0,.17);
  text-align: center;
  font-weight: 900;
}

/* Round of 32 matches */
.tree-match-r32 {
  width: min(100%, 220px);
  min-height: 100px;
  padding: 10px 10px;
}

/* Semi-final match */
.tree-match-sf {
  width: min(100%, 280px);
  min-height: 120px;
  border-color: rgba(226,190,91,.35);
  background: linear-gradient(180deg, rgba(47,47,39,.88), rgba(8,20,35,.96));
}

/* Final match */
.tree-match-final {
  width: min(100%, 300px);
  min-height: 144px;
  border: 1px solid rgba(226,190,91,.45);
  background: linear-gradient(180deg, rgba(47,47,39,.92), rgba(8,20,35,.96));
}

/* Trophy icon */
.tree-trophy {
  color: var(--gold);
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2px 0;
}

.tree-match-round {
  color: var(--gold);
  font-size: .92rem;
  line-height: 1.2;
}
.tree-match-title {
  color: #f7f8fb;
  font-size: .96rem;
  line-height: 1.25;
  margin-bottom: 2px;
}
.tree-team {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.25;
}
.tree-vs {
  color: var(--gold);
  font-size: .72rem;
  font-weight: 900;
  line-height: 1;
}
.tree-separator {
  width: 100%;
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 2px 0;
}

/* Tree children grid and connectors */
.tree-children {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding-top: 34px;
  margin-top: 0;
}
.tree-children::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 24px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(226,190,91,.58), rgba(226,190,91,.2));
}
.tree-children::after {
  content: "";
  position: absolute;
  top: 23px;
  left: 25%;
  right: 25%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(226,190,91,.54), transparent);
}
.tree-children > .tree-node::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  width: 2px;
  height: 11px;
  transform: translateX(-50%);
  background: rgba(226,190,91,.4);
}

/* Deeper levels slightly tighter */
.tree-depth-2 .tree-children,
.tree-depth-3 .tree-children {
  gap: 12px;
  padding-top: 28px;
}
.tree-depth-2 .tree-children::before,
.tree-depth-3 .tree-children::before {
  height: 20px;
}
.tree-depth-2 .tree-children::after,
.tree-depth-3 .tree-children::after {
  top: 19px;
}
.tree-depth-3 .tree-match {
  min-height: 98px;
  padding: 10px 8px;
  border-radius: 14px;
}
.tree-depth-3 .tree-match-title {
  font-size: .88rem;
}
.tree-depth-3 .tree-team {
  font-size: .76rem;
}

/* Bracket note */
.bracket-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

@media (max-width: 520px) {
  .bracket-map { width: 100%; padding-inline: 6px; }
  .tree-children {
    gap: 10px;
    padding-top: 30px;
  }
  .tree-children::after {
    left: 20%;
    right: 20%;
  }
  .tree-match {
    width: 100%;
    min-height: 96px;
    padding: 10px 7px;
    border-radius: 14px;
  }
  .tree-match-sf,
  .tree-match-final {
    width: min(100%, 260px);
  }
  .tree-match-round { font-size: .82rem; }
  .tree-match-title { font-size: .84rem; }
  .tree-team { font-size: .72rem; }
  .tree-vs { font-size: .68rem; }
  .tree-tier-label { font-size: .92rem; }
}
@media (max-width: 370px) {
  .tree-children { gap: 7px; }
  .tree-match { padding-inline: 5px; min-height: 88px; }
  .tree-match-title { font-size: .78rem; }
  .tree-team { font-size: .68rem; }
  .tree-vs { font-size: .64rem; }
}
@media (max-width: 460px) {
  body { padding-bottom: 86px; }
  .bottom-tabs { bottom: 10px; border-radius: 22px; }
  .bottom-tab { min-height: 54px; font-size: .76rem; }
  .group-teams { grid-template-columns: 1fr; }
  .group-match-meta { display: grid; justify-items: center; }
  .group-match-teams { grid-template-columns: 1fr 36px 1fr; }
  .group-match-side { font-size: .86rem; }
}
