:root {
  --bg: #030707;
  --panel: rgba(255, 255, 255, .073);
  --panel-strong: rgba(255, 255, 255, .11);
  --line: rgba(255, 255, 255, .13);
  --line-strong: rgba(216, 178, 110, .38);
  --text: #f6f1e8;
  --muted: #bcb6a8;
  --muted-2: #817b6e;
  --gold: #d8b26e;
  --green: #38d996;
  --green-soft: rgba(56, 217, 150, .14);
  --red: #f0726d;
  --red-soft: rgba(240, 114, 109, .14);
  --blue: #78b7ff;
  --blue-soft: rgba(120, 183, 255, .14);
  --shadow: 0 28px 90px rgba(0, 0, 0, .36);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 10%, rgba(216,178,110,.18), transparent 25%),
    radial-gradient(circle at 82% 9%, rgba(56,217,150,.14), transparent 24%),
    radial-gradient(circle at 55% 64%, rgba(120,183,255,.08), transparent 30%),
    linear-gradient(145deg, #030707 0%, #091514 52%, #11100c 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select { font: inherit; }

button {
  border: 0;
  cursor: pointer;
}

.shell {
  width: min(1520px, calc(100vw - 38px));
  margin: 0 auto;
  padding: 30px 0 54px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 520px;
  gap: 22px;
  min-height: 420px;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 38px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,255,255,.13), rgba(255,255,255,.035)),
    rgba(5, 13, 13, .86);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "WORLD CUP 26";
  position: absolute;
  right: -16px;
  bottom: -8px;
  font-family: "Playfair Display", serif;
  font-size: 104px;
  font-weight: 900;
  letter-spacing: -.06em;
  color: rgba(255, 255, 255, .035);
  pointer-events: none;
}

.hero-copy, .hero-dashboard { position: relative; z-index: 2; }

.brand-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.orb {
  width: 16px;
  height: 16px;
  display: inline-block;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--gold) 45%, #7e4b1d);
  box-shadow: 0 0 0 8px rgba(216,178,110,.1), 0 0 38px rgba(216,178,110,.5);
}

.eyebrow, .section-kicker {
  margin: 0 0 10px;
  color: var(--gold);
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 760px;
  margin: 28px 0 18px;
  font-family: "Playfair Display", serif;
  font-size: clamp(58px, 7vw, 112px);
  line-height: .84;
  letter-spacing: -.055em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 3vw, 46px);
  letter-spacing: -.04em;
}

h3 {
  margin-bottom: 0;
  font-size: 23px;
  letter-spacing: -.03em;
}

.lead {
  max-width: 690px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.72;
}

.hero-actions, .toolbar, .nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary, .secondary, .tiny {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  background: rgba(255,255,255,.08);
  font-weight: 900;
}

.primary {
  background: linear-gradient(135deg, #e2c17d, #9d6a2d);
  color: #11100c;
  border-color: rgba(255,255,255,.18);
}

.secondary:hover, .tiny:hover, .nav-btn:hover {
  background: rgba(255,255,255,.13);
}

.danger-soft {
  color: #ffdedd;
  border-color: rgba(240,114,109,.25);
}

.tiny {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
}

.hero-dashboard {
  display: grid;
  align-content: end;
  gap: 14px;
}

.mega-card, .mini-stat, .panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 58px rgba(0,0,0,.2);
}

.mega-card {
  padding: 24px;
  border-radius: 28px;
}

.next-card .versus {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0;
}

.next-card .flag-team {
  display: grid;
  gap: 4px;
}

.next-card .flag {
  font-size: 38px;
}

.next-card strong {
  font-size: 22px;
}

.next-card .vs {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(216,178,110,.12);
  color: var(--gold);
  font-weight: 900;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mini-stat {
  padding: 18px;
  border-radius: 22px;
}

.mini-stat small {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

.mini-stat strong {
  display: block;
  font-size: 26px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 18px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(3, 7, 7, .72);
  backdrop-filter: blur(20px);
}

.nav-btn {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.nav-btn.active {
  color: #11100c;
  background: var(--gold);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 170px 240px auto auto;
  margin-bottom: 18px;
}

.search-wrap, select {
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.075);
  color: var(--text);
  outline: none;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}

.search-wrap span { color: var(--gold); font-size: 20px; }

input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

input::placeholder { color: rgba(246,241,232,.45); }

select {
  padding: 0 14px;
  color-scheme: dark;
}

.view { display: none; }
.view.active { display: block; }

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin: 30px 0 18px;
}

.hint {
  max-width: 580px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  text-align: right;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.span-5 { grid-column: span 5; }
.span-7 { grid-column: span 7; }
.span-12 { grid-column: span 12; }

.panel {
  padding: 22px;
  border-radius: 28px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.matches-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.matches-list.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.matches-list.simulator {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.match-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(0,0,0,.18);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.match-card:hover {
  transform: translateY(-2px);
  border-color: rgba(216,178,110,.28);
  background: rgba(255,255,255,.08);
}

.match-card.brazil-match {
  border-color: rgba(56,217,150,.45);
  box-shadow: inset 0 0 0 1px rgba(56,217,150,.12);
}

.match-top, .status-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255,255,255,.08);
  font-weight: 900;
  white-space: nowrap;
}

.badge.final { color: #dcfff1; background: var(--green-soft); }
.badge.live { color: #ffe2e1; background: var(--red-soft); }
.badge.scheduled { color: #dcecff; background: var(--blue-soft); }
.badge.simulated { color: #fff1cf; background: rgba(216,178,110,.14); }

.teams {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.team-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 900;
}

.team-line span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score {
  min-width: 36px;
  text-align: right;
  color: var(--gold);
}

.sim-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.score-input {
  width: 100%;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255,255,255,.08);
  text-align: center;
  font-weight: 900;
}

.match-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.match-actions button {
  height: 36px;
  border-radius: 12px;
  font-size: 12px;
}

.apply { background: var(--green-soft); color: #dffff1; }
.clear { background: rgba(255,255,255,.07); color: var(--muted); }

.standings-grid, .mini-standings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.group-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(0,0,0,.18);
}

.group-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255,255,255,.055);
}

.group-title strong {
  color: var(--gold);
  white-space: nowrap;
}

.group-title span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 10px 9px;
  border-top: 1px solid rgba(255,255,255,.08);
  text-align: right;
  font-size: 13px;
}

th {
  color: rgba(246,241,232,.62);
  font-size: 11px;
  text-transform: uppercase;
}

td.team, th.team {
  min-width: 168px;
  text-align: left;
  font-weight: 900;
}

tr.qualifies td.team::before,
tr.best-third td.team::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  margin-right: 8px;
  border-radius: 99px;
  background: var(--green);
  vertical-align: middle;
}

tr.third td.team::before {
  background: var(--gold);
}

tr.brazil-row {
  background: rgba(56,217,150,.08);
}

.radar-card {
  display: grid;
  gap: 14px;
  place-items: center;
}

canvas {
  width: 100%;
  max-width: 520px;
  height: auto;
}

.radar-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}

.legend-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.teams-layout {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 16px;
}

.team-profile-card {
  display: grid;
  gap: 14px;
}

.team-hero {
  display: grid;
  gap: 8px;
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(216,178,110,.18), rgba(255,255,255,.045));
  border: 1px solid var(--line-strong);
}

.team-hero .flag {
  font-size: 54px;
}

.team-hero h3 {
  font-size: 34px;
}

.profile-list {
  display: grid;
  gap: 10px;
}

.profile-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: var(--muted);
}

.profile-item strong {
  color: var(--text);
  text-align: right;
}

.metric-bars {
  display: grid;
  gap: 9px;
}

.metric-line {
  display: grid;
  grid-template-columns: 95px 1fr 38px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--green));
}

.pitch {
  position: relative;
  min-height: 680px;
  border-radius: 28px;
  border: 1px solid rgba(56,217,150,.32);
  background:
    linear-gradient(90deg, rgba(255,255,255,.04) 49%, rgba(255,255,255,.11) 50%, rgba(255,255,255,.04) 51%),
    repeating-linear-gradient(0deg, rgba(56,217,150,.06), rgba(56,217,150,.06) 92px, rgba(56,217,150,.1) 92px, rgba(56,217,150,.1) 184px),
    rgba(1, 30, 18, .66);
  overflow: hidden;
  padding: 18px;
}

.pitch::before, .pitch::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid rgba(255,255,255,.22);
  pointer-events: none;
}

.pitch::before {
  top: 50%;
  width: 190px;
  height: 190px;
  margin-top: -95px;
  border-radius: 50%;
}

.pitch::after {
  top: 18px;
  bottom: 18px;
  width: 1px;
  border: 0;
  background: rgba(255,255,255,.14);
}

.lineup-row {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 22px 0;
}

.player-card {
  width: min(150px, 18vw);
  padding: 10px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 16px;
  background: rgba(0,0,0,.33);
  text-align: center;
}

.player-card label {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
}

.player-card input {
  height: 34px;
  padding: 0 8px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.07);
  text-align: center;
  font-size: 12px;
}

.knockout-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.bracket-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(0,0,0,.18);
}

.bracket-card small {
  color: var(--muted);
}

.bracket-card strong {
  display: block;
  margin-top: 8px;
  font-size: 16px;
}

.scenario {
  display: grid;
  gap: 14px;
}

.scenario-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(0,0,0,.18);
}

.scenario-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: 420px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(3,7,7,.86);
  color: var(--text);
  box-shadow: var(--shadow);
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: .22s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.empty {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

body.tv-mode .shell {
  width: min(1920px, calc(100vw - 24px));
}

body.tv-mode .hero {
  min-height: 520px;
}

body.tv-mode .nav, body.tv-mode .toolbar {
  display: none;
}

body.tv-mode .matches-list,
body.tv-mode .standings-grid,
body.tv-mode .mini-standings {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1220px) {
  .hero, .teams-layout, .toolbar {
    grid-template-columns: 1fr;
  }
  .standings-grid, .mini-standings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .matches-list, .matches-list.compact, .matches-list.simulator {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .span-5, .span-7, .span-12 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .shell { width: min(100% - 24px, 1520px); padding-top: 16px; }
  .hero { padding: 24px; border-radius: 28px; }
  h1 { font-size: 54px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .hint { text-align: left; }
  .standings-grid, .mini-standings, .matches-list, .matches-list.compact, .matches-list.simulator, .knockout-grid {
    grid-template-columns: 1fr;
  }
  .mini-grid { grid-template-columns: 1fr; }
  .pitch { min-height: auto; }
  .lineup-row { flex-wrap: wrap; margin: 14px 0; }
  .player-card { width: 46%; }
}
