:root {
  color-scheme: dark;
  --night: #080806;
  --ink: #14110d;
  --paper: #f5f1e8;
  --panel: rgba(255, 250, 239, 0.94);
  --glass: rgba(12, 11, 9, 0.78);
  --muted: #81786b;
  --soft: rgba(255, 250, 239, 0.68);
  --line: rgba(255, 250, 239, 0.14);
  --dark-line: rgba(20, 17, 13, 0.12);
  --red: #d71920;
  --gold: #f0bd3c;
  --green: #31c985;
  --down: #d05252;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--night);
  color: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border-radius: 0;
}

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

.hero-backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.96) 0%, rgba(0, 0, 0, 0.82) 42%, rgba(0, 0, 0, 0.28) 100%),
    url("/assets/germany-stadium-hero.png") center top / cover no-repeat;
}

.hero-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(8, 8, 6, 0.76) 58%, #0a0907 86%, #f5f1e8 99%);
}

.shell {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 48px;
  gap: 18px;
  align-items: center;
  margin: 14px 0 26px;
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(8, 8, 6, 0.76);
  backdrop-filter: blur(22px);
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.28);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--soft);
  font-size: 0.68rem;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 34px;
  place-items: center;
  background:
    linear-gradient(180deg, #050505 0 33%, var(--red) 33% 66%, var(--gold) 66%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.82rem;
  font-weight: 950;
}

.nav {
  display: inline-flex;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.nav a {
  padding: 12px 18px;
  border-right: 1px solid var(--line);
  color: var(--soft);
  font-size: 0.88rem;
  font-weight: 850;
}

.nav a:last-child {
  border-right: 0;
}

.nav a:hover,
.nav a:focus-visible,
.icon-button:hover,
.icon-button:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  outline: none;
}

.icon-button {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--paper);
  cursor: pointer;
}

.icon-button.is-spinning svg {
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.command-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 0.62fr);
  gap: 34px;
  min-height: clamp(660px, 86vh, 860px);
  align-items: end;
  padding: clamp(36px, 5vw, 76px) 0 56px;
}

.hero-copy {
  max-width: 980px;
  text-shadow: 0 20px 80px rgba(0, 0, 0, 0.85);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 6.5rem);
  line-height: 0.86;
  letter-spacing: 0;
  overflow-wrap: normal;
}

.lede {
  max-width: 760px;
  margin: 28px 0 0;
  color: rgba(245, 241, 232, 0.78);
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.live-pill,
.updated,
.confidence-pill {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.42);
  color: var(--paper);
  font-size: 0.82rem;
  font-weight: 850;
  backdrop-filter: blur(16px);
}

.live-pill span {
  width: 9px;
  height: 9px;
  background: var(--green);
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(49, 201, 133, 0.16);
}

.hero-console,
.model-brief,
.player-detail,
.table-panel,
.fixtures-panel {
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.hero-console {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--soft);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.metric-card {
  min-height: 142px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 239, 0.92);
  color: var(--ink);
}

.metric-card.primary {
  background: #080806;
  color: var(--paper);
}

.metric-card .label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.metric-card.primary .label,
.metric-card.primary .note {
  color: var(--soft);
}

.metric-card .value {
  margin-top: 12px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  font-weight: 950;
  line-height: 0.9;
}

.metric-card .note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.42;
}

.hero-brief {
  display: grid;
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.hero-brief div {
  display: grid;
  gap: 5px;
  padding: 13px;
  background: rgba(0, 0, 0, 0.24);
}

.hero-brief span,
.section-kicker,
.brief-pair span {
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-brief strong {
  color: var(--paper);
  font-size: 1rem;
}

.skeleton {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.12)),
    rgba(255, 250, 239, 0.8);
  background-size: 220% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  to {
    background-position-x: -220%;
  }
}

.section {
  margin: 0 calc(50% - 50vw);
  padding: clamp(44px, 5vw, 74px) max(16px, calc((100vw - 1500px) / 2 + 16px));
  background: var(--paper);
  color: var(--ink);
}

.section:nth-of-type(even) {
  background: #ebe5da;
}

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

h2 {
  margin: 0;
  font-size: clamp(2.35rem, 5vw, 5.2rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.live-layout {
  display: grid;
  grid-template-columns: minmax(520px, 0.92fr) minmax(280px, 0.48fr) minmax(320px, 0.52fr);
  gap: 14px;
  align-items: start;
}

.table-panel,
.fixtures-panel,
.model-brief {
  border-color: rgba(20, 17, 13, 0.12);
  background: rgba(255, 250, 239, 0.96);
  color: var(--ink);
  box-shadow: 0 18px 60px rgba(45, 35, 20, 0.12);
}

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

th,
td {
  padding: 15px;
  border-bottom: 1px solid var(--dark-line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 950;
  text-transform: uppercase;
}

td {
  font-size: 0.94rem;
  font-weight: 720;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.team-cell,
.player-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.rank,
.shirt-number,
.team-flag,
.score-badge {
  display: grid;
  place-items: center;
  background: #0d0c0a;
  color: var(--paper);
  font-weight: 950;
}

.rank {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  font-size: 0.74rem;
}

.team-flag {
  width: 38px;
  height: 26px;
  border: 1px solid rgba(20, 17, 13, 0.12);
  background: #fff;
  color: var(--ink);
  font-size: 0.68rem;
}

.team-name small,
.player-name small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
}

.prob-wrap {
  display: grid;
  gap: 7px;
  min-width: 108px;
}

.prob-track,
.analysis-track {
  height: 8px;
  overflow: hidden;
  background: rgba(20, 17, 13, 0.1);
}

.prob-fill,
.analysis-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold));
}

.fixtures-panel {
  display: grid;
  overflow: hidden;
}

.fixture {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--dark-line);
}

.fixture:last-child {
  border-bottom: 0;
}

.fixture-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.fixture-match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  font-size: 0.96rem;
  font-weight: 900;
}

.fixture-match span:last-child {
  text-align: right;
}

.scoreline {
  color: var(--red);
  font-weight: 950;
}

.fixture small {
  color: var(--muted);
  line-height: 1.38;
}

.model-brief {
  display: grid;
  gap: 15px;
  padding: 22px;
}

.model-brief h3 {
  margin: 0;
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
  line-height: 0.95;
}

.model-brief p,
.brief-pair small {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.brief-pair {
  display: grid;
  gap: 5px;
  padding-top: 14px;
  border-top: 1px solid var(--dark-line);
}

.brief-pair strong {
  font-size: 1.1rem;
}

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

.knockout-card,
.insight-card,
.unit-card,
.player-card,
.xi-player {
  border: 1px solid rgba(20, 17, 13, 0.12);
  background: rgba(255, 250, 239, 0.96);
  color: var(--ink);
  box-shadow: 0 18px 60px rgba(45, 35, 20, 0.11);
}

.knockout-card {
  display: grid;
  min-height: 258px;
  gap: 16px;
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.knockout-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #0d0c0a, var(--red), var(--gold));
}

.knockout-card h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.08;
}

.stage-date {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 950;
  text-transform: uppercase;
}

.stage-prob {
  font-size: 3.3rem;
  font-weight: 950;
  line-height: 0.9;
}

.stage-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.48;
}

.players-heading {
  align-items: center;
}

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

.search-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: min(300px, 100%);
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--dark-line);
  background: rgba(255, 250, 239, 0.88);
  color: var(--muted);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.segmented {
  display: inline-flex;
  height: 46px;
  border: 1px solid var(--dark-line);
  background: rgba(255, 250, 239, 0.82);
}

.segment {
  min-width: 48px;
  border: 0;
  border-right: 1px solid var(--dark-line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 950;
}

.segment:last-child {
  border-right: 0;
}

.segment.is-active {
  background: #0d0c0a;
  color: var(--paper);
}

.squad-insights {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.insight-card {
  display: grid;
  min-height: 140px;
  gap: 12px;
  padding: 20px;
}

.insight-card.primary {
  background: #0d0c0a;
  color: var(--paper);
}

.insight-card span,
.unit-card span,
.analysis-bar-top span,
.detail-score-row span,
.mini-metrics span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.insight-card.primary span,
.insight-card.primary small {
  color: var(--soft);
}

.insight-card strong {
  font-size: clamp(1.2rem, 1.7vw, 1.9rem);
  line-height: 1;
}

.insight-card small {
  color: var(--muted);
  line-height: 1.42;
}

.lab-layout {
  display: grid;
  grid-template-columns: minmax(380px, 0.52fr) minmax(560px, 0.92fr);
  gap: 14px;
  align-items: start;
}

.player-detail {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 16px;
  padding: 24px;
  border-color: rgba(20, 17, 13, 0.12);
  background: #0d0c0a;
  color: var(--paper);
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 15px;
}

.detail-header h3 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 0.9;
}

.detail-header small,
.detail-copy.muted,
.matchup-row small {
  color: var(--soft);
}

.shirt-number {
  width: 38px;
  height: 38px;
  font-size: 0.82rem;
}

.shirt-number.large {
  width: 66px;
  height: 66px;
  background: linear-gradient(180deg, #040403 0 33%, var(--red) 33% 66%, var(--gold) 66%);
  border: 1px solid var(--line);
  font-size: 1.1rem;
}

.shirt-number.table-number {
  width: 30px;
  height: 30px;
  font-size: 0.74rem;
}

.detail-score-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.detail-score-row div {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.detail-score-row strong {
  color: var(--paper);
  font-size: 1.65rem;
  line-height: 1;
}

.detail-bars,
.metric-stack {
  display: grid;
  gap: 10px;
}

.analysis-bar {
  display: grid;
  gap: 6px;
}

.analysis-bar-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.analysis-bar-top strong {
  color: inherit;
  font-size: 0.82rem;
}

.player-detail .analysis-track {
  background: rgba(255, 255, 255, 0.12);
}

.analysis-bar.risk .analysis-fill {
  background: linear-gradient(90deg, var(--green), var(--down));
}

.strength-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.strength-tags span {
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--paper);
  font-size: 0.78rem;
  font-weight: 860;
}

.detail-copy {
  margin: 0;
  line-height: 1.5;
}

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

.matchup-panel h4 {
  margin: 0 0 4px;
}

.matchup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.matchup-row:last-child {
  border-bottom: 0;
}

.matchup-row div {
  display: grid;
  gap: 3px;
}

.matchup-row span {
  color: var(--gold);
  font-weight: 950;
}

.player-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.player-card {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: start;
  min-height: 126px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.player-card.is-active,
.player-card:hover,
.player-card:focus-visible,
.xi-player:hover,
.xi-player:focus-visible,
.player-row.is-active {
  border-color: rgba(215, 25, 32, 0.44);
  background: rgba(240, 189, 60, 0.14);
  outline: none;
}

.player-card-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.player-card-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-card-main small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.player-card-score {
  color: var(--red);
  font-size: 1.5rem;
  font-weight: 950;
}

.mini-metrics {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.mini-metrics span {
  padding: 7px 6px;
  background: rgba(20, 17, 13, 0.06);
  text-align: center;
}

.tactical-board {
  display: grid;
  grid-template-columns: minmax(260px, 0.42fr) minmax(420px, 0.7fr) minmax(380px, 0.62fr);
  gap: 14px;
  margin-top: 14px;
}

.tactical-copy {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px 0;
}

.tactical-copy h3 {
  margin: 0;
  font-size: clamp(3rem, 5vw, 5rem);
  line-height: 0.82;
}

.tactical-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.confidence-pill {
  width: fit-content;
  background: #0d0c0a;
}

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

.unit-card {
  display: grid;
  gap: 13px;
  padding: 16px;
}

.unit-card strong {
  display: block;
  margin-top: 4px;
}

.xi-player {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 4px 10px;
  align-content: center;
  min-height: 74px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.xi-player span {
  grid-row: span 2;
  width: 32px;
  height: 32px;
}

.xi-player small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.player-panel {
  overflow-x: auto;
}

.player-table {
  min-width: 1180px;
}

.score-badge {
  min-width: 62px;
  height: 34px;
}

.delta {
  font-weight: 950;
}

.delta.up {
  color: var(--green);
}

.delta.down {
  color: var(--down);
}

.signal {
  max-width: 360px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.42;
}

.empty-state {
  padding: 22px;
  color: var(--muted);
  font-weight: 850;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 28px 0 36px;
  color: rgba(245, 241, 232, 0.62);
  font-size: 0.84rem;
  font-weight: 720;
}

@media (max-width: 1180px) {
  .command-hero,
  .live-layout,
  .lab-layout,
  .tactical-board {
    grid-template-columns: 1fr;
  }

  .hero-console {
    max-width: 760px;
  }

  .knockout-grid,
  .squad-insights,
  .player-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-detail {
    position: static;
  }
}

@media (max-width: 740px) {
  .shell {
    width: min(100% - 18px, 1500px);
  }

  .topbar {
    top: 8px;
    grid-template-columns: 1fr 46px;
    gap: 8px;
    margin-top: 8px;
  }

  .nav {
    display: none;
  }

  .brand {
    font-size: 0.82rem;
  }

  .brand small {
    display: none;
  }

  .command-hero {
    min-height: auto;
    padding-top: 80px;
  }

  h1 {
    font-size: clamp(2.55rem, 11vw, 3.9rem);
  }

  .metric-grid,
  .knockout-grid,
  .squad-insights,
  .player-card-grid,
  .unit-grid,
  .xi-grid,
  .detail-score-row {
    grid-template-columns: 1fr;
  }

  .section {
    padding-top: 42px;
    padding-bottom: 44px;
  }

  .section-heading,
  .players-heading {
    display: grid;
    align-items: start;
  }

  .group-table {
    min-width: 660px;
  }

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

  .toolbar {
    justify-content: stretch;
  }

  .search-box,
  .segmented {
    width: 100%;
  }

  .segment {
    flex: 1;
  }

  .mini-metrics {
    grid-template-columns: 1fr;
  }
}
