:root {
  color-scheme: dark;
  --bg: #07131f;
  --panel: #102234;
  --panel-soft: #172d43;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f4f8fb;
  --muted: #9fb0c0;
  --accent: #25d0a2;
  --accent-2: #f7c65f;
  --danger: #ff6b6b;
  --blue: #56a6ff;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 10%, rgba(37, 208, 162, 0.2), transparent 26rem),
    linear-gradient(135deg, #07131f 0%, #0d2237 48%, #123047 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.app-header {
  padding: 22px clamp(18px, 5vw, 72px) 28px;
  position: relative;
}

.topbar,
.status-strip,
main {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  color: #04130f;
  font-weight: 900;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.nav-actions button {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  cursor: pointer;
}

.nav-actions button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #04130f;
  font-weight: 900;
}

.language-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.language-picker select {
  max-width: 132px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

[dir="rtl"] .team-side.away,
[dir="rtl"] .right-wing .bracket-round h3 {
  text-align: left;
}

.status-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  align-items: stretch;
  gap: clamp(18px, 4vw, 42px);
  padding-top: 24px;
}

.status-copy h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(30px, 4.2vw, 50px);
  line-height: 1;
  letter-spacing: 0;
}

.status-copy p:not(.eyebrow) {
  max-width: 680px;
  color: #cbd7e2;
  font-size: 16px;
  line-height: 1.5;
}

.eyebrow {
  color: var(--accent);
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 800;
}

.champion-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 21, 34, 0.72);
  backdrop-filter: blur(16px);
  padding: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.compact-champion-panel {
  align-self: start;
  padding: 14px;
  box-shadow: none;
}

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

.champion-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.champion-flag {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.champion h2 {
  margin: 0;
  font-size: 30px;
}

.compact-champion-panel .champion {
  gap: 10px;
}

.compact-champion-panel .champion-head {
  gap: 10px;
}

.compact-champion-panel .champion-flag {
  width: 58px;
  height: 40px;
}

.compact-champion-panel .champion h2 {
  font-size: 22px;
}

.compact-champion-panel .eyebrow {
  margin-bottom: 5px;
  font-size: 10px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metric {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.compact-champion-panel .metric {
  padding: 8px;
}

.compact-champion-panel .metric span {
  font-size: 10px;
}

.compact-champion-panel .metric strong {
  margin-top: 3px;
  font-size: 14px;
}

.favorite-panel {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.compact-favorite-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding-top: 10px;
}

.favorite-picker {
  display: grid;
  gap: 7px;
}

.favorite-picker span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.favorite-picker select {
  width: 100%;
  min-width: 0;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #071827;
  padding: 10px 12px;
  cursor: pointer;
}

.compact-favorite-picker {
  gap: 5px;
}

.compact-favorite-picker select {
  padding: 8px 10px;
}

.compact-favorite-stats {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.compact-favorite-stats strong {
  color: var(--accent-2);
}

.favorite-summary {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(247, 198, 95, 0.35);
  border-radius: var(--radius);
  background: rgba(247, 198, 95, 0.08);
}

.favorite-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.favorite-row img {
  width: 38px;
  height: 26px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.favorite-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.favorite-stats span {
  display: block;
  padding: 9px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 12px;
}

.favorite-stats strong {
  display: block;
  margin-top: 3px;
  color: var(--accent-2);
  font-size: 16px;
}

.favorite-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

main {
  padding: 0 clamp(18px, 5vw, 72px) 72px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px;
  margin-top: -20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(11, 28, 45, 0.94);
}

.muted {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.search input {
  width: min(340px, 48vw);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #071827;
  padding: 10px 14px;
}

.section {
  margin-top: 38px;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
}

.section-note {
  max-width: 620px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.section-action,
.primary-button,
.ghost-button,
.icon-button {
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 900;
}

.section-action,
.primary-button {
  border: 0;
  background: var(--accent);
  color: #04130f;
  padding: 11px 14px;
}

.ghost-section-action {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.ghost-button,
.icon-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 10px 12px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.compact-heading {
  align-items: center;
  margin-bottom: 12px;
}

.compact-heading h2 {
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.05;
}

.action-heading {
  gap: 14px;
}

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

.overview-route {
  margin-top: 38px;
}

.overview-bracket {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
}

.group-card,
.match-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 34, 52, 0.84);
}

.group-card {
  padding: 16px;
}

.clickable-group {
  cursor: pointer;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.clickable-group:hover,
.clickable-group:focus-visible {
  border-color: rgba(37, 208, 162, 0.62);
  background: rgba(20, 48, 71, 0.94);
  outline: 0;
  transform: translateY(-2px);
}

.group-card h3 {
  margin: 0 0 14px;
  font-size: 22px;
}

.group-card-action {
  display: inline-flex;
  margin-top: 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.tournament-map {
  --connector: rgba(255, 255, 255, 0.34);
  --connector-strong: rgba(255, 255, 255, 0.62);
  min-width: 1180px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05), transparent 24%, transparent 76%, rgba(255, 255, 255, 0.05)),
    rgba(16, 34, 52, 0.66);
}

.bracket-wing {
  display: grid;
  grid-template-columns: repeat(4, minmax(126px, 1fr));
  gap: 10px;
}

.bracket-round {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.bracket-round h3 {
  min-height: 34px;
  margin: 0;
  color: var(--blue);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.right-wing .bracket-round h3 {
  text-align: right;
}

.bracket-stack {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 10px;
  min-height: 720px;
  padding: 4px 0;
}

.bracket-match {
  position: relative;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 24, 39, 0.82);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
}

.bracket-match::before {
  content: "";
  position: absolute;
  top: 50%;
  right: -11px;
  width: 0;
  height: var(--connector-span, 0);
  border-right: 2px solid var(--connector);
  transform: translateY(0);
  display: none;
}

.bracket-match::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -11px;
  width: 10px;
  height: 2px;
  background: var(--connector-strong);
}

.right-wing .bracket-match::after {
  right: auto;
  left: -11px;
}

.right-wing .bracket-match::before {
  right: auto;
  left: -11px;
  border-right: 0;
  border-left: 2px solid var(--connector);
}

.final-match::after,
.third-match::after {
  display: none;
}

.bracket-round.r32 {
  --connector-span: 82px;
}

.bracket-round.r16 {
  --connector-span: 164px;
}

.bracket-round.qf {
  --connector-span: 328px;
}

.bracket-round:not(.sf) .bracket-match:nth-child(odd)::before {
  display: block;
}

.bracket-match-number {
  color: var(--muted);
  font-size: 11px;
}

.bracket-match-team {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.bracket-match-team span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bracket-match-team b {
  color: inherit;
}

.winner-team {
  color: var(--text);
  font-weight: 900;
}

.winner-team b {
  color: var(--text);
}

.bracket-center {
  display: grid;
  align-content: center;
  gap: 12px;
  min-width: 0;
}

.bracket-center .eyebrow {
  margin: 0;
  text-align: center;
}

.final-match {
  padding: 14px;
  border-color: var(--connector-strong);
  background: rgba(7, 24, 39, 0.92);
}

.final-match .bracket-match-team {
  font-size: 15px;
}

.third-place {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.third-place > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.third-match {
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 1420px) {
  .groups-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .groups-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .groups-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .groups-grid {
    grid-template-columns: 1fr;
  }
}

.team-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.team-row:first-of-type {
  border-top: 0;
}

.team-row img,
.team-flag {
  width: 38px;
  height: 26px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
}

.team-row span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.team-row b {
  color: var(--accent-2);
}

.standings-block {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.standings-block:first-of-type {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.standings-block h4 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.standings-block.expected h4 {
  color: var(--accent);
}

.team-row.compact {
  grid-template-columns: 24px 38px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 0;
}

.rank {
  color: var(--accent-2);
  font-weight: 900;
  text-align: center;
}

.matches {
  display: block;
  min-width: 0;
}

.schedule-table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 24, 39, 0.72);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.18);
}

.schedule-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.schedule-country-table {
  width: 100%;
  min-width: 860px;
}

.schedule-table th,
.schedule-table td {
  width: 178px;
  min-width: 178px;
  max-width: 178px;
  vertical-align: top;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.schedule-country-table th,
.schedule-country-table td {
  width: calc((100% - 132px) / 4);
  min-width: 190px;
  max-width: none;
}

.schedule-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 12px 10px;
  background: #0a1d30;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.schedule-table .schedule-time-head,
.schedule-table .schedule-time-cell {
  position: sticky;
  left: 0;
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  z-index: 5;
  background: #091827;
}

.schedule-country-table .schedule-time-head,
.schedule-country-table .schedule-time-cell {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
}

.schedule-time-cell {
  padding: 12px 10px;
  color: var(--text);
  text-align: left;
}

.schedule-time-cell strong,
.schedule-time-cell span {
  display: block;
}

.schedule-time-cell strong {
  font-size: 13px;
}

.schedule-time-cell span {
  margin-top: 3px;
  color: var(--accent-2);
  font-size: 18px;
  font-weight: 900;
}

.schedule-table td {
  height: 118px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.018);
}

.schedule-table td:empty {
  background:
    linear-gradient(135deg, transparent 48%, rgba(255, 255, 255, 0.035) 49%, rgba(255, 255, 255, 0.035) 51%, transparent 52%),
    rgba(255, 255, 255, 0.012);
}

.schedule-row-hidden {
  display: none;
}

.schedule-table .schedule-empty-period-cell {
  height: auto;
  min-height: 0;
  padding: 8px;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.012);
}

.schedule-empty-period {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.schedule-match {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 102px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(11, 35, 55, 0.92);
  cursor: pointer;
}

.schedule-match:hover,
.schedule-match:focus-visible {
  border-color: rgba(37, 208, 162, 0.62);
  outline: 0;
}

.schedule-match + .schedule-match {
  margin-top: 8px;
}

.schedule-match.final {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.92);
  color: #07131f;
}

.schedule-match.what-if {
  border-color: rgba(37, 208, 162, 0.58);
  background: rgba(37, 208, 162, 0.14);
}

.schedule-match.next-schedule-match {
  border-color: rgba(247, 198, 95, 0.76);
  box-shadow: 0 0 0 2px rgba(247, 198, 95, 0.16);
}

.schedule-match-top {
  color: var(--muted);
  font-size: 11px;
}

.schedule-match.final .schedule-match-top,
.schedule-match.final .schedule-visitor-time {
  color: #526070;
}

.schedule-teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.schedule-teams span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.schedule-teams span:last-child {
  justify-content: flex-end;
  text-align: right;
}

.schedule-teams .team-flag {
  width: 20px;
  height: 20px;
}

.schedule-teams strong {
  min-width: 42px;
  padding: 6px 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #071827;
  color: var(--text);
  font-size: 12px;
  text-align: center;
}

.schedule-match.final .schedule-teams strong {
  background: #ffffff;
  color: #07131f;
}

.schedule-teams .pending-score {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.schedule-visitor-time {
  color: var(--muted);
  font-size: 11px;
}

.schedule-probabilities {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.schedule-probabilities span {
  padding: 4px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.schedule-projected-score {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.schedule-projected-score span {
  color: var(--accent-2);
}

.prep-modal {
  width: min(1180px, calc(100vw - 20px));
  max-height: min(860px, calc(100vh - 20px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #081827;
  color: var(--text);
  padding: 0;
}

.prep-modal::backdrop {
  background: rgba(2, 8, 16, 0.74);
  backdrop-filter: blur(4px);
}

.prep-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: min(860px, calc(100vh - 20px));
}

.prep-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 24, 39, 0.98);
}

.prep-dialog-header h2 {
  margin: 0;
  font-size: 28px;
}

.prep-content {
  overflow: auto;
  padding: 16px;
}

.prep-ranking-grid,
.prep-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.prep-ranking-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.prep-ranking-card .team-flag {
  width: 52px;
  height: 52px;
}

.prep-ranking-card span,
.prep-ranking-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.prep-ranking-card strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.prep-ranking-card b {
  color: var(--accent-2);
  font-size: 28px;
}

.prep-ranking-card em {
  grid-column: 2 / -1;
}

.prep-section {
  margin-top: 16px;
  min-width: 0;
}

.prep-section h3 {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 15px;
}

.prep-history-wrap {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 24, 39, 0.74);
}

.prep-history-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.prep-history-table th,
.prep-history-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-align: left;
}

.prep-history-table th {
  position: sticky;
  top: 0;
  background: #0a1d30;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.prep-result {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 6px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
}

.prep-result.w {
  background: rgba(37, 208, 162, 0.18);
  color: var(--accent);
}

.prep-result.g {
  background: rgba(247, 198, 95, 0.18);
  color: var(--accent-2);
}

.prep-result.v {
  background: rgba(255, 255, 255, 0.12);
  color: var(--muted);
}

.prep-empty {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.match-card {
  padding: 16px;
  min-width: 0;
}

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

.match-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.team-side {
  display: grid;
  gap: 6px;
}

.team-side.away {
  text-align: right;
  justify-items: end;
}

.score {
  min-width: 74px;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius);
  background: #081827;
  border: 1px solid var(--line);
  font-size: 22px;
  font-weight: 900;
}

.prediction-note {
  color: var(--muted);
  font-size: 13px;
}

.probability-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.probability-pill {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
}

.probability-pill strong {
  display: block;
  margin-top: 3px;
  color: var(--accent-2);
  font-size: 16px;
}

.what-if-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(37, 208, 162, 0.45);
  border-radius: var(--radius);
  background: rgba(37, 208, 162, 0.1);
}

.what-if-banner button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #071827;
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
}

.result-form .ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.what-if-modal {
  width: calc(100vw - 16px);
  max-width: none;
  max-height: min(820px, calc(100vh - 24px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #081827;
  color: var(--text);
  padding: 0;
}

.what-if-modal::backdrop {
  background: rgba(2, 8, 16, 0.74);
  backdrop-filter: blur(4px);
}

.what-if-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(820px, calc(100vh - 24px));
}

.what-if-dialog-header,
.what-if-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 24, 39, 0.98);
}

.what-if-dialog-header h2 {
  margin: 0;
  font-size: 24px;
}

.what-if-dialog-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.what-if-workspace {
  display: grid;
  grid-template-columns: minmax(340px, 0.58fr) minmax(720px, 1.42fr);
  gap: 16px;
  overflow: auto;
  padding: 12px 16px 16px;
}

.what-if-table,
.what-if-preview {
  min-width: 0;
}

.what-if-preview {
  align-self: start;
  position: sticky;
  top: 12px;
  max-height: calc(min(820px, 100vh - 24px) - 126px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.preview-message {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.preview-champion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(247, 198, 95, 0.38);
  border-radius: var(--radius);
  background: rgba(247, 198, 95, 0.08);
}

.preview-champion span,
.what-if-tournament-map .bracket-match-number {
  color: var(--muted);
  font-size: 12px;
}

.preview-champion strong {
  color: var(--accent-2);
}

.what-if-tournament-map {
  min-width: 0;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.what-if-tournament-map .bracket-wing {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.what-if-tournament-map .bracket-stack {
  min-height: 560px;
  gap: 7px;
}

.what-if-tournament-map .bracket-match {
  padding: 6px;
}

.what-if-tournament-map .bracket-match-team {
  gap: 5px;
  font-size: 10px;
}

.what-if-tournament-map .final-match .bracket-match-team {
  font-size: 12px;
}

.what-if-tournament-map .bracket-round.r32 {
  --connector-span: 62px;
}

.what-if-tournament-map .bracket-round.r16 {
  --connector-span: 124px;
}

.what-if-tournament-map .bracket-round.qf {
  --connector-span: 248px;
}

.what-if-group {
  margin-top: 14px;
}

.what-if-group:first-child {
  margin-top: 0;
}

.what-if-group h3 {
  position: sticky;
  top: -12px;
  z-index: 1;
  margin: 0;
  padding: 10px 0;
  background: #081827;
  color: var(--accent);
  font-size: 14px;
}

.what-if-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 52px 12px 52px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.what-if-row.predicted {
  background: rgba(255, 255, 255, 0.035);
}

.what-if-row.simulated {
  background: rgba(37, 208, 162, 0.1);
}

.what-if-row.played {
  background: rgba(255, 255, 255, 0.92);
  color: #07131f;
}

.what-if-match-number,
.what-if-separator {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.what-if-row.played .what-if-match-number,
.what-if-row.played .what-if-separator {
  color: #526070;
}

.what-if-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.what-if-row input {
  width: 52px;
  min-width: 0;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #071827;
  padding: 9px 8px;
  text-align: center;
}

.what-if-row.predicted input {
  background: rgba(255, 255, 255, 0.14);
}

.what-if-row.simulated input {
  border-color: rgba(37, 208, 162, 0.55);
  background: rgba(37, 208, 162, 0.16);
}

.what-if-row.played input {
  border-color: rgba(7, 19, 31, 0.16);
  background: #ffffff;
  color: #07131f;
  font-weight: 900;
  opacity: 1;
}

.what-if-status {
  grid-column: 2 / -1;
  justify-self: start;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.what-if-row.simulated .what-if-status {
  color: var(--accent);
}

.what-if-row.played .what-if-status {
  color: #07131f;
}

.locked {
  color: var(--accent);
  font-weight: 800;
}

.chance-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 34, 52, 0.84);
}

.chance-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.chance-table th,
.chance-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.chance-table th:first-child,
.chance-table td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: #102234;
}

.chance-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.chance-team {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.history-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(150px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.history-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.history-filters input,
.history-filters select {
  width: 100%;
  min-width: 0;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #071827;
  padding: 10px 12px;
}

.history-summary {
  min-height: 20px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.history-table {
  min-width: 980px;
}

.history-table td:first-child,
.history-table th:first-child {
  position: static;
  background: transparent;
}

.history-table td {
  text-align: left;
}

.history-table td:nth-child(3) {
  text-align: center;
}

.history-table td strong,
.history-table td span {
  display: block;
}

.history-table td span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.history-score {
  color: var(--accent-2);
  font-weight: 900;
}

.history-actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.meeting-picker {
  display: grid;
  gap: 7px;
  min-width: min(100%, 260px);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.meeting-picker select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #071827;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  text-transform: none;
}

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

.meeting-round {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 34, 52, 0.84);
}

.meeting-round-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 24, 39, 0.72);
}

.meeting-round-head h3 {
  margin: 0;
  font-size: 16px;
}

.meeting-round-head span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.meeting-opponent-list {
  display: grid;
}

.meeting-opponent {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

.meeting-opponent:last-child {
  border-bottom: 0;
}

.meeting-opponent strong {
  color: var(--accent-2);
  font-size: 16px;
}

.meeting-opponent strong span,
.meeting-table td span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.meeting-empty {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

.meeting-detail-actions {
  margin: 18px 0 12px;
}

.meeting-details {
  margin-top: 12px;
}

.meeting-table {
  min-width: 1060px;
}

.meeting-total-chance {
  color: var(--accent);
  font-weight: 900;
}

.champion-chance {
  color: var(--accent-2);
  font-weight: 900;
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .what-if-workspace {
    grid-template-columns: 1fr;
  }

  .what-if-preview {
    position: static;
    max-height: none;
  }
}

@media (max-width: 820px) {
  .app-header,
  main {
    padding-left: 12px;
    padding-right: 12px;
  }

  .topbar,
  .toolbar,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-actions {
    width: calc(100vw - 24px);
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
  }

  .status-strip {
    grid-template-columns: 1fr;
    padding-top: 24px;
  }

  .toolbar {
    margin-top: 0;
  }

  .section {
    margin-top: 28px;
  }

  .compact-heading {
    gap: 10px;
    margin-bottom: 10px;
  }

  .search,
  .search input {
    width: 100%;
  }

  .history-filters {
    grid-template-columns: 1fr;
  }

  .meeting-picker {
    width: 100%;
  }

  .meeting-rounds {
    grid-template-columns: 1fr;
  }

  .matches {
    display: block;
  }

  .schedule-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .schedule-country-table,
  .schedule-country-table thead,
  .schedule-country-table tbody,
  .schedule-country-table tr,
  .schedule-country-table th,
  .schedule-country-table td {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .schedule-country-table {
    min-width: 0;
  }

  .schedule-country-table thead {
    display: none;
  }

  .schedule-country-table tr {
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(7, 24, 39, 0.72);
  }

  .schedule-country-table .schedule-time-cell {
    position: static;
    padding: 12px;
    border-right: 0;
    background: #091827;
  }

  .schedule-time-cell strong {
    font-size: 12px;
  }

  .schedule-time-cell span {
    font-size: 20px;
  }

  .schedule-country-table td {
    min-height: 0;
    height: auto;
    padding: 10px 12px 12px;
    border-right: 0;
    background: rgba(255, 255, 255, 0.018);
  }

  .schedule-country-table td:empty {
    display: none;
  }

  .schedule-country-table td:not(:empty)::before {
    display: block;
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .schedule-country-table .schedule-empty-period-cell::before {
    content: none;
  }

  .schedule-empty-period-row {
    display: block;
  }

  .schedule-empty-period {
    min-height: 40px;
  }

  .schedule-country-table td:nth-child(2)::before {
    content: "Mexico";
  }

  .schedule-country-table td:nth-child(3)::before {
    content: "Canada";
  }

  .schedule-country-table td:nth-child(4)::before {
    content: "USA";
  }

  .schedule-country-table td:nth-child(5)::before {
    content: "Nog te bepalen";
  }

  .schedule-match {
    min-height: 0;
    padding: 10px;
  }

  .schedule-teams {
    grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  }

  .schedule-teams span {
    font-size: 12px;
  }

  .prep-ranking-grid,
  .prep-results-grid {
    grid-template-columns: 1fr;
  }

  .prep-dialog-header {
    align-items: flex-start;
  }

  .prep-dialog-header h2 {
    font-size: 22px;
  }

  .what-if-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .what-if-dialog-header,
  .what-if-dialog-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .what-if-dialog-footer button,
  .section-action {
    width: 100%;
  }

  .section-actions {
    width: 100%;
  }

  .what-if-row {
    grid-template-columns: 38px minmax(0, 1fr) 52px 12px 52px minmax(0, 1fr);
    gap: 6px;
  }

  .what-if-status {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .favorite-stats {
    grid-template-columns: 1fr;
  }

  .champion-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
