:root {
  color-scheme: dark;
  --bg: #080b0d;
  --surface: #101719;
  --surface-strong: #151e20;
  --surface-soft: #0d1214;
  --line: #273235;
  --line-soft: #1b2528;
  --text: #f1f7f4;
  --muted: #8ea09e;
  --muted-strong: #b5c5c1;
  --team-a: #ef5b4c;
  --team-a-soft: rgba(239, 91, 76, 0.18);
  --team-b: #43bd74;
  --team-b-soft: rgba(67, 189, 116, 0.18);
  --draw: #9c91ff;
  --draw-soft: rgba(156, 145, 255, 0.18);
  --amber: #d8a84a;
  --radius: 8px;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(180deg, #080b0d 0%, #0d1214 56%, #080b0d 100%);
}

.compliance-banner {
  width: 100%;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(216, 168, 74, 0.42);
  color: #f7ead0;
  background: rgba(83, 57, 17, 0.92);
  text-align: center;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.5;
}

button,
a {
  font: inherit;
}

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

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 22px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--amber);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.05;
  letter-spacing: 0;
}

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

.file-link,
.match-tab,
.view-tab,
.checkout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted-strong);
  text-decoration: none;
  background: rgba(16, 23, 25, 0.92);
}

.file-link {
  min-width: 70px;
  padding: 0 14px;
}

.file-link:hover,
.match-tab:hover,
.view-tab:hover,
.checkout-button:hover:not(:disabled) {
  border-color: #46575b;
  color: var(--text);
}

.file-link:focus-visible,
.match-tab:focus-visible,
.view-tab:focus-visible,
.checkout-button:focus-visible,
.recover-link:focus-visible {
  outline: 3px solid rgba(216, 168, 74, 0.3);
  outline-offset: 3px;
}

.checkout-button {
  min-height: 44px;
  padding: 0 16px;
  color: #08100c;
  border-color: rgba(216, 168, 74, 0.75);
  background: var(--amber);
  cursor: pointer;
  font-weight: 800;
}

.checkout-button:disabled {
  cursor: default;
  opacity: 0.72;
}

.view-tabs {
  display: inline-flex;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 23, 25, 0.86);
}

.view-tab {
  min-width: 108px;
  border-color: transparent;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
}

.view-tab[aria-selected="true"] {
  color: var(--text);
  border-color: rgba(216, 168, 74, 0.6);
  background: #171d1a;
}

.match-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 0 16px;
  scrollbar-color: #46575b transparent;
}

.match-tab {
  flex: 0 0 auto;
  gap: 10px;
  padding: 0 14px;
  cursor: pointer;
}

.match-tab[aria-selected="true"] {
  color: var(--text);
  border-color: rgba(216, 168, 74, 0.72);
  background: #171d1a;
}

.tab-teams {
  white-space: nowrap;
}

.tab-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  color: #f3f6f4;
  background: #686f6c;
  font-size: 11px;
  font-weight: 800;
}

.dashboard {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 18, 20, 0.94);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.match-panel {
  display: grid;
  gap: 0;
}

.match-hero {
  padding: 28px;
  border-left: 5px solid var(--team-a);
  background:
    linear-gradient(90deg, rgba(239, 91, 76, 0.08), transparent 30%),
    linear-gradient(180deg, #11191b, #0c1113);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.03);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

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

.team {
  min-width: 0;
}

.team.right {
  text-align: right;
}

.team-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: clamp(24px, 4vw, 44px);
  font-weight: 780;
  line-height: 1;
}

.team.right .team-name {
  justify-content: flex-end;
}

.team-code {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
}

.flag {
  display: inline-grid;
  grid-template-columns: repeat(var(--flag-count), 1fr);
  width: 28px;
  height: 18px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 3px;
}

.flag span {
  display: block;
}

.team-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.team.right .team-stats {
  justify-content: flex-end;
}

.versus {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.headline-line {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 16px;
  align-items: end;
  padding: 24px 28px 16px;
  border-top: 1px solid var(--line-soft);
}

.headline-line h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.model-call {
  color: var(--team-b);
  font-weight: 750;
}

.model-call .model-favorite {
  margin: 0;
}

.model-favorite {
  margin: 0 0 14px;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.55;
}

.model-favorite strong {
  color: var(--text);
}

.archive-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 20px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.035);
  line-height: 1.5;
}

.archive-note strong {
  color: var(--text);
}

.archive-note span {
  color: var(--muted);
}

.advance-block {
  padding: 0 28px 28px;
}

.stacked-bar {
  display: flex;
  height: 44px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0a0f11;
}

.bar-segment {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 12px;
  color: #08100c;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 850;
}

.bar-segment.right-label {
  justify-content: flex-end;
}

.bar-a {
  background: var(--team-a);
}

.bar-b {
  background: var(--team-b);
}

.bar-draw {
  background: var(--draw);
  color: #11102a;
}

.bar-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.bar-labels span:last-child {
  text-align: right;
}

.details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  border-top: 1px solid var(--line);
}

.section {
  min-width: 0;
  padding: 24px 28px;
}

.section + .section {
  border-left: 1px solid var(--line);
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 750;
}

.wdl-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.legend-item {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.legend-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 17px;
}

.xg-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.xg-value {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.xg-value:last-child {
  text-align: right;
}

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

.xg-value strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 30px;
  line-height: 1;
}

.xg-divider {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

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

.score-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 12px;
  color: var(--muted-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.score-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #0a0f11;
}

.score-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--score-color);
}

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

.distribution-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 58px;
  gap: 10px;
  align-items: center;
  color: var(--muted-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.distribution-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #0a0f11;
}

.distribution-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--amber);
}

.distribution-row strong {
  color: var(--text);
  text-align: right;
}

.audit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-top: 1px solid var(--line);
}

.matrix {
  display: grid;
  grid-template-columns: 42px repeat(6, minmax(28px, 1fr));
  gap: 6px;
}

.matrix-cell,
.matrix-head {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.matrix-head {
  color: var(--muted);
}

.matrix-cell {
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.04);
}

.matrix-cell.a {
  background: rgba(239, 91, 76, var(--alpha));
}

.matrix-cell.b {
  background: rgba(67, 189, 116, var(--alpha));
}

.matrix-cell.draw {
  background: rgba(156, 145, 255, var(--alpha));
}

.matrix-caption {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.audit-list {
  display: grid;
  gap: 12px;
}

.audit-item {
  display: grid;
  grid-template-columns: minmax(118px, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.audit-item strong {
  color: var(--text);
}

.source-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.source-list a {
  color: var(--muted-strong);
  overflow-wrap: anywhere;
}

.source-list a:hover {
  color: var(--text);
}

.market-hero {
  padding: 24px 28px;
  border-left: 5px solid var(--amber);
  background:
    linear-gradient(90deg, rgba(216, 168, 74, 0.09), transparent 34%),
    linear-gradient(180deg, #11191b, #0c1113);
}

.market-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.metric-tile {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

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

.metric-tile strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 22px;
  line-height: 1;
}

.comparison-list {
  display: grid;
  gap: 12px;
}

.comparison-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.8fr) minmax(0, 2fr) 64px;
  gap: 12px;
  align-items: center;
  color: var(--muted-strong);
  font-size: 13px;
}

.comparison-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.comparison-bars {
  display: grid;
  gap: 5px;
}

.mini-track {
  position: relative;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #0a0f11;
}

.mini-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--fill-color);
}

.mini-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.gap-pill {
  display: inline-flex;
  justify-content: flex-end;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.gap-pill.positive {
  color: var(--team-b);
}

.gap-pill.negative {
  color: var(--team-a);
}

.positive {
  color: var(--team-b) !important;
}

.negative {
  color: var(--team-a) !important;
}

.market-table-wrap {
  overflow-x: auto;
  scrollbar-color: #46575b transparent;
}

.market-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  color: var(--muted-strong);
  font-size: 11px;
}

.market-table th,
.market-table td {
  padding: 9px 6px;
  border-bottom: 1px solid var(--line-soft);
  text-align: right;
  white-space: nowrap;
}

.market-table th:first-child,
.market-table td:first-child,
.market-table th:nth-child(2),
.market-table td:nth-child(2) {
  text-align: left;
}

.market-table th {
  color: var(--muted);
  font-weight: 700;
}

.market-table td strong {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

.heat-cell {
  min-height: 74px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  background: rgba(216, 168, 74, var(--alpha));
}

.heat-cell strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.heat-cell span {
  display: block;
  margin-top: 5px;
  color: var(--muted-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.market-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.champion-section {
  margin-top: 18px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 18, 20, 0.94);
}

.champion-title {
  margin-bottom: 8px;
}

.champion-method {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.champion-list {
  display: grid;
  gap: 12px;
}

.champion-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.3fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.champion-team {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
  color: var(--text);
  font-weight: 780;
}

.champion-team span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.champion-bars {
  display: grid;
  gap: 8px;
}

.champion-bar-line {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 58px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.champion-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #0a0f11;
}

.champion-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.champion-fill--title {
  background: var(--amber);
}

.champion-fill--final {
  background: var(--team-b);
}

.champion-bar-line strong {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  text-align: right;
}

@media (min-width: 821px) {
  .market-table {
    min-width: 0;
  }

  .market-table th,
  .market-table td {
    white-space: normal;
  }
}

.loading-block {
  padding: 28px;
}

.loading-line {
  height: 16px;
  width: 52%;
  margin-bottom: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #151e20, #253033, #151e20);
}

.loading-line.wide {
  width: 78%;
}

.loading-line.short {
  width: 34%;
}

.error-block {
  padding: 28px;
  color: var(--team-a);
}

.pro-gate {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  padding: 28px;
}

.gate-preview {
  display: grid;
  gap: 18px;
  min-height: 464px;
  filter: blur(3px);
  opacity: 0.56;
  pointer-events: none;
  user-select: none;
}

.preview-hero,
.preview-grid span,
.preview-table span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(90deg, #11191b, #1b2629, #101719);
}

.preview-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 14px;
  min-height: 140px;
  padding: 20px;
}

.preview-hero span,
.preview-hero strong,
.preview-hero i {
  display: block;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.preview-hero span {
  width: 42%;
  height: 18px;
}

.preview-hero strong {
  grid-column: 1 / -1;
  width: 78%;
  height: 34px;
}

.preview-hero i {
  width: 100%;
  height: 72px;
}

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

.preview-grid span {
  min-height: 78px;
}

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

.preview-table span {
  min-height: 62px;
}

.gate-copy {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  width: min(440px, calc(100% - 40px));
  gap: 12px;
  padding: 22px;
  border: 1px solid rgba(216, 168, 74, 0.45);
  border-radius: var(--radius);
  background: rgba(13, 18, 20, 0.94);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%);
}

.gate-copy h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.gate-copy p {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.65;
}

.gate-price s {
  color: var(--muted);
}

.gate-price strong {
  color: var(--amber);
}

.recover-link {
  width: fit-content;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 760;
}

.recover-link:hover {
  color: var(--text);
}

.checkout-status {
  min-height: 1.4em;
  color: var(--amber);
  font-size: 13px;
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

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

	  .team-grid,
	  .details-grid,
	  .audit-grid,
	  .headline-line,
	  .market-summary,
	  .champion-row,
	  .preview-grid,
	  .preview-table {
	    grid-template-columns: 1fr;
	  }

  .team.right,
  .team.right .team-stats {
    text-align: left;
    justify-content: flex-start;
  }

  .team.right .team-name {
    justify-content: flex-start;
  }

  .versus {
    display: none;
  }

  .section + .section {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .wdl-legend {
    grid-template-columns: 1fr;
  }

  .audit-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .comparison-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .gap-pill {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .match-hero,
  .market-hero,
  .headline-line,
  .advance-block,
	  .section {
	    padding-left: 16px;
	    padding-right: 16px;
	  }

	  .pro-gate {
	    min-height: 560px;
	    padding: 16px;
	  }

	  .gate-copy {
	    width: calc(100% - 28px);
	    padding: 18px;
	  }

  .team-name {
    font-size: 27px;
  }

  .bar-segment {
    padding: 0 8px;
    font-size: 12px;
  }

  .score-row {
    grid-template-columns: 42px minmax(0, 1fr) 46px;
    gap: 8px;
  }

  .matrix {
    gap: 4px;
  }

  .view-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .view-tab {
    min-width: 0;
  }

  .heat-grid {
    grid-template-columns: 1fr;
  }

  .champion-section {
    padding: 18px 16px;
  }
}
