:root {
  color-scheme: dark;
  --bg: #0b1220;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-strong: rgba(8, 20, 36, 0.72);
  --panel-soft: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.7);
  --accent: #2bb7ff;
  --accent-strong: #79dcff;
  --green: #50e38b;
  --warn: #f4c15d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(80, 120, 255, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 30%, rgba(0, 200, 255, 0.1), transparent 55%),
    linear-gradient(180deg, rgba(7, 18, 34, 0.18), rgba(7, 18, 34, 0.62)),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  margin-bottom: 18px;
}

.brand {
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}

.status {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 13px;
}

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

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid rgba(121, 220, 255, 0.24);
  border-radius: 999px;
  background: rgba(43, 183, 255, 0.08);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.inline-link {
  width: max-content;
  margin-top: 4px;
}

.mpp-hero {
  position: relative;
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.mpp-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(11, 18, 32, 0.2), transparent 44%),
    linear-gradient(0deg, rgba(11, 18, 32, 0.2), transparent 45%);
  pointer-events: none;
}

.mpp-hero img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 6;
  object-fit: cover;
  object-position: center top;
}

.prediction-refresh-note {
  margin: -4px 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.markets-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.market-card {
  padding: 18px;
}

.moubot-choice {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(121, 220, 255, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(43, 183, 255, 0.16), rgba(80, 227, 139, 0.08)),
    rgba(0, 0, 0, 0.16);
}

.market-toggle {
  color: var(--text);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}

.market-toggle.is-active {
  border-color: rgba(244, 193, 93, 0.58);
  box-shadow: 0 0 0 1px rgba(244, 193, 93, 0.16);
}

.choice-label {
  width: max-content;
  padding: 4px 8px;
  border: 1px solid rgba(121, 220, 255, 0.22);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.moubot-choice strong {
  font-size: 24px;
}

.choice-metrics {
  color: var(--muted);
  font-size: 13px;
}

.moubot-choice em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

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

.market-list-scroll {
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.market-scroll {
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.market-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.market-list li.is-choice {
  border-color: rgba(244, 193, 93, 0.55);
  background: rgba(244, 193, 93, 0.1);
}

.market-list strong {
  color: var(--accent-strong);
}

.market-list em {
  min-width: 76px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-align: right;
}

.market-list li.is-choice strong {
  color: var(--warn);
}

.market-comparison {
  margin-bottom: 18px;
  padding: 18px;
}

.market-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
}

.market-tab {
  min-height: 34px;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.market-tab.is-active {
  background: rgba(43, 183, 255, 0.18);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(121, 220, 255, 0.28);
}

.comparison-layout {
  display: grid;
  gap: 14px;
}

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

.comparison-card {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.comparison-card strong {
  color: var(--text);
}

.comparison-card span:not(.choice-label),
.comparison-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.runner-column {
  min-width: 0;
}

.runner-column h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.comparison-table {
  min-width: 920px;
}

.runner-method {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.live-insight {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 14px;
  align-items: baseline;
  padding: 16px;
  border: 1px solid rgba(121, 220, 255, 0.24);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(43, 183, 255, 0.18), rgba(80, 227, 139, 0.08)),
    rgba(0, 0, 0, 0.2);
}

.live-insight strong {
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.05;
}

.live-insight span:not(.choice-label) {
  grid-column: 2;
  color: var(--muted);
  line-height: 1.45;
}

.probability-matrix {
  min-width: 760px;
  border: 1px solid var(--border);
  border-radius: 14px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.probability-matrix th,
.probability-matrix td {
  background: rgba(255, 255, 255, 0.025);
}

.probability-matrix th {
  background: rgba(43, 183, 255, 0.08);
}

.probability-matrix td:first-child {
  font-weight: 850;
}

.probability-matrix td:last-child {
  color: var(--accent-strong);
  font-weight: 900;
}

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

.probability-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.probability-card-head {
  display: grid;
  gap: 4px;
}

.probability-card-head strong {
  font-size: 18px;
}

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

.probability-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(121, 220, 255, 0.2);
  border-radius: 12px;
  background: rgba(43, 183, 255, 0.08);
}

.probability-main span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.probability-main strong {
  color: var(--accent-strong);
  font-size: 24px;
}

.source-probs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.source-probs div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.16);
}

.source-probs dd {
  font-size: 16px;
}

.loading-line,
.empty-state {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  line-height: 1.45;
}

.loading-sequence {
  display: grid;
  gap: 7px;
}

.loading-sequence span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.loading-sequence span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(89, 200, 255, 0.7);
}

.empty-state {
  display: grid;
  gap: 6px;
}

.empty-state strong {
  color: var(--text);
}

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(10px);
}

.match-panel,
.recommendation,
.table-panel,
.explanation {
  padding: 18px;
}

.table-panel,
.explanation {
  grid-column: 2;
}

.section-head {
  margin-bottom: 16px;
}

.section-head.compact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

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

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 18px;
}

.match-list {
  display: grid;
  gap: 10px;
  max-height: 680px;
  overflow: auto;
  padding-right: 4px;
}

.match-button {
  display: grid;
  width: 100%;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-soft);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.match-button.is-active {
  border-color: color-mix(in srgb, var(--accent) 82%, white);
  background: rgba(43, 183, 255, 0.11);
  box-shadow: 0 0 0 1px rgba(43, 183, 255, 0.4);
}

.match-button.is-started {
  cursor: not-allowed;
  opacity: 0.5;
}

.teams {
  font-weight: 800;
}

.teams span,
.meta,
.venue,
.fixture-meta {
  color: var(--muted);
  font-weight: 500;
}

.venue,
.fixture-meta {
  font-size: 12px;
  line-height: 1.4;
}

.recommended-card {
  display: grid;
  gap: 18px;
  min-height: 128px;
  padding: 20px;
  border: 1px solid rgba(121, 220, 255, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(43, 183, 255, 0.18), rgba(80, 227, 139, 0.1) 45%, rgba(255, 255, 255, 0.04)),
    var(--panel-strong);
}

.recommendation-summary {
  display: flex;
  align-items: center;
  gap: 18px;
}

.recommendation-copy {
  min-width: 0;
}

.score {
  display: grid;
  place-items: center;
  min-width: 118px;
  min-height: 88px;
  border: 1px solid rgba(121, 220, 255, 0.55);
  border-radius: 14px;
  color: var(--accent-strong);
  font-size: 42px;
  font-weight: 900;
  background: rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 0 28px rgba(43, 183, 255, 0.12);
}

.fixture {
  margin-bottom: 12px;
  font-size: 24px;
  font-weight: 850;
}

.fixture-meta {
  margin: -6px 0 12px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font-size: 13px;
}

.recommendation-details {
  display: grid;
  gap: 12px;
}

.recommendation-formula {
  border: 1px solid rgba(121, 220, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
}

.recommendation-formula strong {
  color: var(--accent-strong);
  font-size: 18px;
}

.recommendation-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.recommendation-metrics dd {
  font-size: 18px;
}

.result-points-metrics {
  margin-top: 18px;
}

.result-points-metrics div {
  border-color: rgba(121, 220, 255, 0.22);
  background: rgba(43, 183, 255, 0.06);
}

.result-points-metrics dd {
  color: var(--accent-strong);
}

.recommendation-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

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

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

tr.is-selected {
  background: rgba(43, 183, 255, 0.1);
}

.score-button {
  min-width: 58px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
}

.is-selected .score-button {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.formula {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.formula strong {
  color: var(--warn);
  font-size: 24px;
}

.formula span {
  color: var(--muted);
  line-height: 1.5;
}

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

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

dt {
  color: var(--muted);
  font-size: 12px;
}

dd {
  margin: 5px 0 0;
  font-size: 20px;
  font-weight: 850;
}

.history-hero {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(43, 183, 255, 0.18), rgba(80, 227, 139, 0.08)),
    var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.history-hero h1 {
  font-size: clamp(32px, 6vw, 60px);
  line-height: 0.98;
}

.history-hero p:last-child {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

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

.summary-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
}

.summary-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.summary-card strong {
  color: var(--accent-strong);
  font-size: 34px;
  line-height: 1;
}

.history-layout {
  display: grid;
  gap: 18px;
}

.history-panel {
  padding: 18px;
}

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

.history-table td:nth-child(2),
.history-table td:nth-child(3),
.history-table td:last-child,
.history-table th:nth-child(2),
.history-table th:nth-child(3),
.history-table th:last-child {
  text-align: left;
  white-space: normal;
}

.history-table td {
  vertical-align: top;
}

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

.history-note {
  min-width: 220px;
  color: var(--muted);
  line-height: 1.45;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  text-transform: capitalize;
}

.status-pending {
  border-color: rgba(244, 193, 93, 0.46);
  color: var(--warn);
  background: rgba(244, 193, 93, 0.1);
}

.status-settled {
  border-color: rgba(80, 227, 139, 0.42);
  color: var(--green);
  background: rgba(80, 227, 139, 0.09);
}

.status-void {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 860px) {
  .markets-grid,
  .workspace {
    grid-template-columns: 1fr;
  }

  .table-panel,
  .explanation {
    grid-column: auto;
  }

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

  .live-insight {
    grid-template-columns: 1fr;
  }

  .live-insight span:not(.choice-label) {
    grid-column: auto;
  }

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

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

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

  .comparison-summary,
  .comparison-columns,
  .probability-board {
    grid-template-columns: 1fr;
  }
}

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

  .match-panel,
  .recommendation,
  .table-panel,
  .explanation {
    padding: 14px;
  }

  .score {
    min-width: 100%;
  }

  .fixture {
    font-size: 20px;
  }

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

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

  .topbar-actions {
    justify-content: flex-start;
  }

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

  .history-hero {
    padding: 20px;
  }
}
