:root {
  color-scheme: dark;
  --bg: #080b12;
  --surface: #10151f;
  --panel: #151b27;
  --panel-2: #1d2533;
  --line: rgba(255, 255, 255, 0.11);
  --text: #f7f9fd;
  --muted: #9ca8ba;
  --pink: #ff4fb8;
  --cyan: #38c7ff;
  --green: #34d399;
  --gold: #f6c75a;
  --red: #ff6b6b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #080b12, #120b16 42%, #09131b);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(9, 13, 20, 0.94);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.brand strong, .brand span { display: block; }
.brand span, .muted { color: var(--muted); }

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 0 14px;
  font-weight: 800;
  white-space: normal;
}

.nav button.active {
  color: var(--text);
  border-color: rgba(255, 79, 184, 0.28);
  background: rgba(255, 79, 184, 0.13);
}

.nav button.nav-center {
  color: #fff;
  border-color: rgba(255, 79, 184, .42);
  background: linear-gradient(135deg, var(--pink), #7c3aed);
}

.main {
  width: min(1180px, 100%);
  padding: 24px;
  margin: 0 auto;
}

.topbar, .section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar { margin-bottom: 20px; }

.top-actions, .filters, .sim-actions, .hero-actions, .play-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(22px, 3vw, 34px); }
h2 { margin-bottom: 8px; font-size: clamp(24px, 3vw, 36px); }
h3 { margin-bottom: 10px; }
p { line-height: 1.55; }

.page { display: none; }
.page.active { display: block; }

.subtabs {
  display: flex;
  gap: 8px;
  margin: 12px 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.subtabs::-webkit-scrollbar { display: none; }

.subtabs button {
  min-height: 38px;
  flex: 0 0 auto;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 900;
}

.subtabs button.active {
  color: var(--text);
  border-color: rgba(56, 199, 255, .35);
  background: rgba(56, 199, 255, .13);
}

.subpage { display: none; }
.subpage.active { display: block; }

.compact-title {
  margin-top: 12px;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.profile-detail {
  min-width: 0;
}

.settings-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.settings-list button {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
}

.settings-list button::after {
  content: "›";
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.settings-list button.active {
  border-color: rgba(56, 199, 255, .38);
  background: rgba(56, 199, 255, .10);
}

.settings-list span {
  font-weight: 900;
  overflow-wrap: anywhere;
}

.settings-list small {
  color: var(--muted);
  white-space: nowrap;
}

.hero {
  min-height: 310px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
  align-items: center;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 79, 184, 0.24), transparent 40%),
    linear-gradient(150deg, var(--surface), #0a121b);
}

.hero p {
  max-width: 720px;
  color: var(--muted);
}

.hero-card {
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
  color: var(--muted);
}

.hero-card img {
  width: 132px;
  height: 132px;
  border-radius: 50%;
}

.hero-card strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.panel, .metric, .match-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.panel {
  margin-top: 16px;
  padding: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.metric {
  min-height: 112px;
  padding: 18px;
  color: var(--text);
  text-align: left;
}

.metric span, .compare-grid span, .detail-grid span, .report-grid span, .stat-grid span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 30px;
}

.primary-button, .secondary-button, .ghost-button, .text-button {
  min-height: 40px;
  border-radius: 10px;
  padding: 0 14px;
  color: var(--text);
  font-weight: 900;
}

.primary-button { border: 0; background: linear-gradient(135deg, var(--pink), #7c3aed); }
.secondary-button { border: 1px solid rgba(56, 199, 255, 0.35); background: rgba(56, 199, 255, 0.12); }
.ghost-button { border: 1px solid var(--line); background: var(--panel-2); }
.text-button { min-height: 34px; border: 0; background: transparent; color: var(--cyan); padding: 0; }

.status-chip {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.12);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-chip.neutral { background: rgba(156, 168, 186, 0.12); color: var(--muted); }
.status-chip.danger { background: rgba(255, 107, 107, 0.12); color: var(--red); }
.status-chip.pro { background: rgba(246, 199, 90, 0.14); color: var(--gold); }

input, select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 12px;
  min-width: 0;
}

select { width: 100%; }
input[type="checkbox"] { width: 22px; min-height: 22px; accent-color: var(--pink); }

.state-line {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.loading-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(56, 199, 255, .7);
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(56, 199, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 199, 255, 0); }
}

.competition-grid, .match-list, .history-list {
  display: grid;
  gap: 10px;
}

.competition-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.feature-grid,
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.feature-grid > *,
.pricing-grid .panel {
  min-height: 116px;
}

.feature-grid article,
.feature-grid button {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
}

.feature-grid span {
  color: var(--muted);
  line-height: 1.45;
}

.price {
  margin: 8px 0 14px;
  color: var(--gold);
  font-size: 28px;
  font-weight: 900;
}

.plan-highlight {
  border-color: rgba(255, 79, 184, .38);
  background:
    linear-gradient(135deg, rgba(255, 79, 184, .12), transparent 42%),
    var(--panel);
}

.competition-grid button, .history-list button {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  padding: 12px;
  text-align: left;
}

.competition-grid button.selected {
  border-color: rgba(255, 79, 184, .5);
  background: rgba(255, 79, 184, .12);
}

.competition-grid span, .history-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.history-list .history-meta {
  color: var(--gold);
}

.team-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.favorite-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(246, 199, 90, .28);
  border-radius: 999px;
  background: rgba(246, 199, 90, .1);
  color: var(--gold);
  padding: 0 12px;
  font-weight: 900;
}

.favorite-pill span {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-card {
  width: 100%;
  display: grid;
  grid-template-columns: 36px 1fr 104px 1fr 36px;
  align-items: center;
  gap: 10px;
  min-height: 92px;
  padding: 14px;
  color: var(--text);
  text-align: center;
}

.match-card button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}

.star {
  width: 34px;
  height: 34px;
  border-radius: 50% !important;
  color: var(--muted) !important;
  background: rgba(255,255,255,.05) !important;
  font-size: 18px;
}

.star.active {
  color: var(--gold) !important;
  background: rgba(246, 199, 90, .14) !important;
}

.match-card .team {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.team strong {
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.team span, .match-meta {
  color: var(--muted);
  font-size: 12px;
}

.score-box strong {
  display: block;
  color: var(--gold);
  font-size: 24px;
}

.score-box span {
  color: var(--muted);
  font-size: 12px;
}

.match-meta {
  grid-column: 2 / 5;
  width: 100%;
  margin-top: -2px;
  text-align: center;
  overflow-wrap: anywhere;
}

.detail-panel.hidden, .hidden { display: none !important; }

.detail-grid, .compare-grid, .auth-grid, .stat-grid, .report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.detail-grid div, .compare-grid div, .stat-grid div, .report-grid div {
  padding: 12px;
  border-radius: 12px;
  background: var(--panel-2);
  min-width: 0;
}

.detail-grid strong, .report-grid strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.report-grid .wide { grid-column: span 2; }

.detail-subtitle { margin-top: 16px; }

.detail-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.event-backtest-table {
  margin-top: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
}

th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}

th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-size: 12px; }

.sim-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.versus {
  display: grid;
  grid-template-columns: 1fr 54px 1fr;
  align-items: end;
  gap: 12px;
}

.versus label, .slider-grid label, .fantasy-toolbar label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.versus strong {
  display: grid;
  place-items: center;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 79, 184, 0.16);
  color: var(--pink);
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.preset-row button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
}

.slider-grid { display: grid; gap: 12px; margin-top: 16px; }
input[type="range"] { accent-color: var(--pink); padding: 0; }
.compare-grid { margin-top: 16px; }
.compare-grid strong { display: block; margin-top: 6px; font-size: 20px; }

.scoreline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  text-align: center;
}

.scoreline strong {
  font-size: clamp(32px, 5vw, 58px);
  color: var(--gold);
}

.scoreline span {
  font-weight: 900;
  overflow-wrap: anywhere;
}

.clock-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  color: var(--cyan);
  font-weight: 900;
}

progress { width: 100%; height: 12px; accent-color: var(--pink); }

.prob-bars {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.prob-bars div {
  display: grid;
  grid-template-columns: 42px 1fr 46px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

meter { width: 100%; height: 12px; }

.score-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.score-chip-row span {
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(246, 199, 90, 0.13);
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.event-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.event-summary span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
}

.event-summary strong {
  color: var(--text);
}

.lineup-builder {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.lineup-side {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
}

.lineup-side .row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lineup-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.lineup-side select {
  max-width: 120px;
}

.selected-lineup,
.lineup-pool {
  display: grid;
  gap: 6px;
}

.selected-lineup {
  min-height: 34px;
}

.lineup-player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
}

.lineup-player strong {
  display: block;
  color: var(--text);
  overflow-wrap: anywhere;
}

.lineup-player button {
  min-height: 28px;
  padding: 0 8px;
  border-radius: 8px;
}

.fixture-comparison {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 61, 142, 0.10);
  border: 1px solid rgba(255, 61, 142, 0.24);
}

.fixture-comparison span {
  color: var(--muted);
  font-size: 12px;
}

.fixture-comparison strong {
  overflow-wrap: anywhere;
}

.comparison-events {
  grid-column: 1 / -1;
  overflow-x: auto;
  margin-top: 4px;
}

.comparison-events table {
  min-width: 420px;
  background: transparent;
}

.comparison-events th,
.comparison-events td {
  padding: 8px 10px;
}

.compact-filter {
  grid-template-columns: minmax(150px, 1fr) auto;
  align-items: center;
}

.model-line, .commentary {
  margin: 14px 0 0;
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--muted);
  min-width: 0;
}

.timeline strong { color: var(--gold); }
.timeline span { overflow-wrap: anywhere; }

.event-pill {
  display: inline-grid;
  place-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(56, 199, 255, 0.12);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.period-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.period-grid div {
  padding: 12px;
  border-radius: 12px;
  background: var(--panel-2);
  text-align: center;
}

.period-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--gold);
  font-size: 22px;
}

.auth-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: end;
}

.fantasy-toolbar {
  display: grid;
  grid-template-columns: 120px 1fr 120px auto auto;
  gap: 10px;
  align-items: end;
}

.compact-state {
  margin-top: 12px;
  text-align: left;
}

.compact-state ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.player-pool {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.pool-player {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.04);
}

.pool-player span {
  color: var(--muted);
  font-size: 12px;
}

.pitch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  min-height: 220px;
  padding: 14px;
  border: 1px solid rgba(52, 211, 153, .18);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(52, 211, 153, .08) 1px, transparent 1px),
    linear-gradient(rgba(52, 211, 153, .08) 1px, transparent 1px),
    rgba(8, 30, 24, .55);
  background-size: 36px 36px;
}

.player-card {
  min-height: 94px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(16, 21, 31, .86);
}

.player-card strong, .player-card span {
  overflow-wrap: anywhere;
}

.player-card span {
  color: var(--muted);
  font-size: 12px;
}

.player-card button {
  justify-self: start;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  color: var(--muted);
}

.mini-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mini-actions button.active-mini {
  border-color: var(--pink);
  color: var(--pink);
  background: rgba(255, 47, 122, .14);
}

.empty-state {
  color: var(--muted);
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  width: min(520px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #10151f;
  box-shadow: 0 30px 90px rgba(0,0,0,.45);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--text);
  font-size: 22px;
}

.splash-ad {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 5, 12, .86);
  backdrop-filter: blur(12px);
}

.splash-ad-card {
  position: relative;
  width: min(440px, 100%);
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  padding: 24px;
  border: 1px solid rgba(255, 45, 122, .32);
  border-radius: 20px;
  background: #080A12;
  box-shadow: 0 30px 100px rgba(0,0,0,.55);
  overflow: hidden;
}

.splash-ad-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(48, 213, 255, .12), transparent 34%),
    linear-gradient(0deg, rgba(255, 45, 122, .18), transparent 48%);
  pointer-events: none;
}

.splash-ad-card > * {
  position: relative;
  z-index: 1;
}

.splash-ad-image {
  position: absolute;
  inset: 56px 24px auto;
  height: 250px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 45, 122, .18), rgba(48, 213, 255, .12)), var(--panel);
  color: rgba(255,255,255,.9);
  font-size: 60px;
  font-weight: 900;
}

.splash-ad-image.has-image {
  background-position: center;
  background-size: cover;
  color: transparent;
}

.splash-ad-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.benefit-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.benefit-list span {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--muted);
}

.plan-current {
  border-color: rgba(52, 211, 153, .34);
  background:
    linear-gradient(135deg, rgba(52, 211, 153, .10), transparent 48%),
    var(--panel);
}

.locked-feature {
  border-color: rgba(246, 199, 90, .28);
  background: rgba(246, 199, 90, .07);
}

.locked-feature button {
  width: fit-content;
  margin-top: 8px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #10151f;
  box-shadow: 0 16px 50px rgba(0,0,0,.35);
}

.legal-link {
  text-decoration: none;
}

.legal-page {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

.legal-doc {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.legal-doc h1 {
  margin: 28px 0 8px;
}

.legal-doc h2 {
  margin: 24px 0 8px;
}

.legal-doc p {
  color: var(--muted);
  line-height: 1.75;
}

.legal-doc select {
  float: right;
  margin-left: 12px;
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: auto 10px 10px;
    z-index: 20;
    width: auto;
    height: auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 18px;
  }
  .brand { display: none; }
  .nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    max-width: calc(100vw - 36px);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav button {
    min-width: 0;
    min-height: 42px;
    padding: 0 8px;
    text-align: center;
    font-size: 12px;
  }
  .nav button.nav-center {
    transform: translateY(-8px);
    min-height: 52px;
    box-shadow: 0 12px 30px rgba(255, 79, 184, .28);
  }
  .main { padding: 18px 14px 92px; }
  .topbar, .section-title { align-items: flex-start; flex-direction: column; }
  .hero, .sim-layout, .lineup-builder { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .fantasy-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-layout { grid-template-columns: 1fr; }
  .settings-list { margin-top: 8px; }
}

@media (max-width: 560px) {
  .hero { padding: 18px; }
  .hero-card { min-height: 150px; }
  .metric-grid, .versus, .preset-row, .fantasy-toolbar, .lineup-builder { grid-template-columns: 1fr; }
  .match-card {
    grid-template-columns: 36px 1fr 36px;
    text-align: left;
  }
  .match-card .team,
  .match-card .score-box {
    grid-column: 1 / 4;
    text-align: left;
  }
  .match-card .star:nth-of-type(1) { grid-column: 1; grid-row: 1; }
  .match-card .star:nth-of-type(5) { grid-column: 3; grid-row: 1; }
  .match-meta {
    grid-column: 1 / 4;
    text-align: left;
  }
  .scoreline { grid-template-columns: 1fr; }
  .prob-bars div { grid-template-columns: 42px 1fr 42px; }
  .report-grid .wide { grid-column: auto; }
  .top-actions, .filters, .sim-actions, .hero-actions, .play-controls { width: 100%; }
  .top-actions > *, .filters > *, .sim-actions > * { flex: 1 1 150px; }
}
