:root {
  --bg: #080d16;
  --bg-elevated: #101827;
  --bg-card: #131d2f;
  --bg-card-hover: #18253c;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --emerald: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.14);
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.14);
  --crimson: #ef4444;
  --crimson-bg: rgba(239, 68, 68, 0.14);
  --sky: #38bdf8;
  --sky-bg: rgba(56, 189, 248, 0.14);
  --violet: #a78bfa;
  --radius: 14px;
  --radius-sm: 9px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Noto Sans KR', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at 12% 0%, rgba(16, 185, 129, 0.08), transparent 36%),
              radial-gradient(circle at 88% 4%, rgba(56, 189, 248, 0.08), transparent 32%),
              var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  font-variant-numeric: tabular-nums;
}

.app-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 24px 64px;
}

/* Top Bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--emerald);
  background: var(--emerald-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.25); }
}

.topbar h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 13.5px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.deadline-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  display: flex;
  flex-direction: column;
}

.deadline-box .label {
  font-size: 11px;
  color: var(--text-muted);
}

.countdown {
  font-size: 17px;
  font-weight: 800;
  color: var(--amber);
  letter-spacing: 0.02em;
}

.header-actions {
  display: flex;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.16s ease;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #03150e;
  font-weight: 700;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--sky);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.full-width { width: 100%; }

/* KPI Ribbon */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kpi-sub {
  font-size: 11.5px;
  color: var(--text-dim);
}

.text-emerald { color: var(--emerald); }
.text-amber { color: var(--amber); }
.text-crimson { color: var(--crimson); }
.text-sky { color: var(--sky); }

/* Control Deck */
.control-deck {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 18px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px 18px;
  align-items: center;
  margin-bottom: 18px;
}

.mode-group { grid-column: span 4; }
.budget-group { grid-column: span 2; }
.slider-group { grid-column: span 2; }

.control-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.accent-tag {
  color: var(--emerald);
  font-size: 12px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  background: rgba(8, 13, 22, 0.7);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.seg-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 7px;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.seg-btn:hover { color: var(--text); }

.seg-btn.active {
  background: var(--emerald);
  color: #041710;
  font-weight: 700;
}

#newsWeightSlider, #moraleWeightSlider, #h2hWeightSlider {
  width: 100%;
  accent-color: var(--emerald);
  cursor: pointer;
}

#moraleWeightSlider {
  accent-color: var(--sky);
}

#h2hWeightSlider {
  accent-color: var(--amber);
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 4px;
}

.budget-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill-btn {
  flex: 1;
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.pill-btn:hover { border-color: var(--sky); color: var(--text); }

.pill-btn.active {
  background: var(--sky-bg);
  color: var(--sky);
  border-color: var(--sky);
}

/* Tabs */
.tab-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  color: var(--emerald);
  border-bottom-color: var(--emerald);
}

.tab-num {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.6;
}

.badge-mini {
  background: rgba(148, 163, 184, 0.16);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Alert Banner */
.alert-banner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.11), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.32);
  border-radius: var(--radius);
  padding: 15px 18px;
  margin-bottom: 18px;
  font-size: 13.5px;
  color: #e2e8f0;
}

.alert-icon {
  font-size: 20px;
  line-height: 1.2;
}

/* Intel Grid */
.intel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.intel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top-width: 3px;
  border-radius: var(--radius);
  padding: 16px;
}

.border-crimson { border-top-color: var(--crimson); }
.border-emerald { border-top-color: var(--emerald); }
.border-sky { border-top-color: var(--sky); }

.intel-header h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.intel-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.intel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.intel-item {
  background: rgba(8, 13, 22, 0.55);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}

.intel-item .match-name { font-weight: 700; }
.intel-item .meta { font-size: 11.5px; color: var(--text-muted); }

/* Panels & Tables */
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.panel-header h2, .panel-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.panel-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 10px 10px;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-epl { background: rgba(167, 139, 250, 0.16); color: #c4b5fd; }
.badge-laliga { background: rgba(251, 146, 60, 0.16); color: #fdba74; }
.badge-emerald { background: var(--emerald-bg); color: var(--emerald); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-crimson { background: var(--crimson-bg); color: var(--crimson); }
.badge-sky { background: var(--sky-bg); color: var(--sky); }
.badge-muted { background: rgba(148, 163, 184, 0.14); color: var(--text-muted); }

/* Match Matrix */
.matrix-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar-title {
  font-size: 16px;
  font-weight: 700;
  margin-right: 10px;
}

.toolbar-hint {
  font-size: 12.5px;
  color: var(--text-muted);
}

.toolbar-right {
  display: flex;
  gap: 8px;
}

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

.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s;
}

.match-card.changed {
  border-color: rgba(245, 158, 11, 0.45);
}

.match-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.match-id-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}

.match-no {
  font-size: 11.5px;
  font-weight: 800;
  background: rgba(255,255,255,0.08);
  padding: 2px 7px;
  border-radius: 5px;
}

.kickoff {
  font-size: 11.5px;
  color: var(--text-dim);
}

.match-teams {
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.match-teams .vs {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

/* Pick Selector Buttons */
.pick-selector {
  display: flex;
  gap: 5px;
  align-items: center;
}

.pick-btn {
  width: 36px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(8, 13, 22, 0.7);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.14s;
  font-family: inherit;
}

.pick-btn:hover {
  border-color: var(--text);
  color: var(--text);
}

.pick-btn.selected {
  background: var(--emerald);
  color: #03150e;
  border-color: var(--emerald);
}

.pick-btn.locked {
  background: var(--sky);
  color: #04131d;
  border-color: var(--sky);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

/* Probability Comparison Grid */
.prob-table {
  display: grid;
  grid-template-columns: 78px repeat(3, minmax(0, 1fr));
  gap: 6px;
  background: rgba(8, 13, 22, 0.55);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
}

.prob-head {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

.prob-row-label {
  color: var(--text-muted);
  font-size: 11.5px;
  display: flex;
  align-items: center;
}

.prob-cell {
  text-align: center;
  font-weight: 700;
  padding: 3px 4px;
  border-radius: 6px;
}

.prob-cell .sub-odds {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-dim);
}

.shift-up { color: var(--emerald); font-size: 11px; }
.shift-down { color: var(--crimson); font-size: 11px; }
.shift-flat { color: var(--text-dim); font-size: 11px; }

.val-high { background: var(--emerald-bg); color: var(--emerald); }
.val-mid { background: var(--amber-bg); color: var(--amber); }
.val-trap { background: var(--crimson-bg); color: var(--crimson); }

.tactical-note {
  font-size: 12px;
  color: #cbd5e1;
  background: rgba(56, 189, 248, 0.06);
  border-left: 3px solid var(--sky);
  padding: 7px 10px;
  border-radius: 0 7px 7px 0;
}

/* News items inside Match Card */
.match-news-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.news-mini-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: rgba(8, 13, 22, 0.6);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 11px;
  transition: opacity 0.15s;
}

.news-mini-item.disabled {
  opacity: 0.42;
}

.news-mini-content {
  flex: 1;
}

.news-mini-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.news-mini-headline {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.news-mini-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider-toggle {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #334155;
  border-radius: 999px;
  transition: 0.2s;
}

.slider-toggle::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider-toggle {
  background: var(--emerald);
}

.switch input:checked + .slider-toggle::before {
  transform: translateX(16px);
}

.match-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.btn-tiny {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
}

.btn-tiny:hover {
  color: var(--text);
  border-color: var(--sky);
}

/* News Hub */
.news-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.news-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.search-input, .select-input, .num-input, .text-input {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  color: var(--text);
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
}

.search-input { min-width: 280px; flex: 1; }
.search-input:focus, .select-input:focus, .num-input:focus, .text-input:focus {
  outline: none;
  border-color: var(--emerald);
}

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

.news-hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-hub-card.disabled { opacity: 0.45; }

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

.rss-card {
  background: rgba(8, 13, 22, 0.65);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rss-card a {
  color: #e2e8f0;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
}

.rss-card a:hover { color: var(--sky); text-decoration: underline; }

/* Optimizer Layout */
.optimizer-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.filter-panel {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.filter-item label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.filter-item .num-input { width: 100%; }

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.portfolio-stats-box {
  background: rgba(8, 13, 22, 0.65);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.cov-cell {
  background: rgba(8, 13, 22, 0.6);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px;
  font-size: 11.5px;
}

.cov-cell .cov-title {
  font-weight: 700;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cov-bars {
  display: flex;
  gap: 3px;
  margin-top: 4px;
}

.cov-pill {
  flex: 1;
  text-align: center;
  padding: 2px 0;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-dim);
}

.cov-pill.active {
  background: var(--emerald-bg);
  color: var(--emerald);
}

.ticket-table th {
  padding: 9px 6px;
  font-size: 11px;
}

.ticket-table td {
  white-space: nowrap;
  padding: 8px 6px;
  font-size: 12px;
}

.ticket-code {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.code-h { color: var(--sky); }
.code-d { color: var(--amber); }
.code-a { color: var(--emerald); }

.export-actions {
  display: flex;
  gap: 8px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 16, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.hidden { display: none !important; }

.modal-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  width: 100%;
  max-width: 500px;
  padding: 20px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.icon-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.form-field .text-input { width: 100%; }

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

.impact-inputs span {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 3px;
}

.impact-inputs .num-input { width: 100%; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: var(--text);
  border: 1px solid var(--emerald);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 200;
}

/* Team Atmosphere & Player Status */
.player-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.p-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-out { background: var(--crimson); }
.dot-suspended { background: #f43f5e; box-shadow: 0 0 6px #f43f5e; }
.dot-doubt { background: var(--amber); }
.dot-return { background: var(--sky); }
.dot-hot { background: var(--emerald); box-shadow: 0 0 6px var(--emerald); }

.atmo-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.atmo-match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.atmo-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.atmo-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.team-atmo-box {
  background: rgba(8, 13, 22, 0.58);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-atmo-box.tier-crisis { border-left: 3px solid var(--crimson); }
.team-atmo-box.tier-anxious { border-left: 3px solid var(--amber); }
.team-atmo-box.tier-steady { border-left: 3px solid var(--sky); }
.team-atmo-box.tier-rising { border-left: 3px solid #34d399; }
.team-atmo-box.tier-hot { border-left: 3px solid var(--emerald); }

.team-atmo-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.team-atmo-name {
  font-size: 15.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 7px;
}

.side-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
}

.rank-tag {
  font-size: 11.5px;
  color: var(--sky);
  font-weight: 600;
  margin-top: 2px;
}

.form-strip {
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-pill {
  width: 21px;
  height: 21px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 800;
}

.form-W { background: var(--emerald-bg); color: var(--emerald); border: 1px solid rgba(16, 185, 129, 0.35); }
.form-D { background: var(--amber-bg); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.35); }
.form-L { background: var(--crimson-bg); color: var(--crimson); border: 1px solid rgba(239, 68, 68, 0.35); }

.morale-meter-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.morale-meter-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
}

.morale-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.morale-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.fill-hot { background: linear-gradient(90deg, #10b981, #34d399); }
.fill-rising { background: linear-gradient(90deg, #0ea5e9, #34d399); }
.fill-steady { background: linear-gradient(90deg, #38bdf8, #818cf8); }
.fill-anxious { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.fill-crisis { background: linear-gradient(90deg, #dc2626, #ef4444); }

.atmo-text {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.5;
}

.player-roster {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}

.player-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  line-height: 1.4;
}

.player-status-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ps-out { background: var(--crimson-bg); color: var(--crimson); }
.ps-suspended { background: rgba(244, 63, 94, 0.22); color: #fb7185; }
.ps-doubt { background: var(--amber-bg); color: var(--amber); }
.ps-return { background: var(--sky-bg); color: var(--sky); }
.ps-hot { background: var(--emerald-bg); color: var(--emerald); }

/* Compact Atmosphere Strip inside Match Matrix Card */
.matrix-atmo-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mini-team-pill {
  background: rgba(8, 13, 22, 0.55);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11.5px;
}

.mini-team-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.mini-players-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.mini-p-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.1);
  color: #e2e8f0;
}

/* Historical Analysis & H2H Tab */
.history-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.history-two-col {
  display: grid;
  grid-template-columns: 0.95fr 1.35fr;
  gap: 14px;
  margin-bottom: 16px;
}

.hist-bars-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.hist-bar-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
}

.hist-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dual-track {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.track-row {
  display: grid;
  grid-template-columns: 62px 1fr 48px;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
}

.track-bg {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
}

.track-fill {
  height: 100%;
  border-radius: 999px;
}

.draw-hist-box {
  background: rgba(8, 13, 22, 0.55);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.draw-hist-bars {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  align-items: end;
  height: 92px;
  margin-top: 10px;
}

.dh-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.dh-bar {
  width: 100%;
  max-width: 34px;
  border-radius: 5px 5px 0 0;
  background: rgba(148, 163, 184, 0.25);
  transition: height 0.25s;
}

.dh-bar.sweet {
  background: linear-gradient(180deg, #10b981, #059669);
}

.past-rounds-table td {
  white-space: nowrap;
  padding: 8px 8px;
  font-size: 12px;
}

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

.h2h-card {
  background: rgba(8, 13, 22, 0.58);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.h2h-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.h2h-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.score-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.22);
  color: #e2e8f0;
}

.hist-check-box {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 9px;
  padding: 10px 11px;
  cursor: pointer;
  font-size: 12px;
}

.hist-check-box input {
  margin-top: 3px;
  accent-color: var(--emerald);
}

.hist-check-box strong {
  display: block;
  color: var(--emerald);
  margin-bottom: 2px;
}

.hist-check-box span {
  font-size: 11px;
  color: var(--text-muted);
}

.h2h-mini-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 8px;
  padding: 6px 10px;
  color: #fde68a;
}

/* Upset Radar Predictions */
.upset-panel {
  border-color: rgba(245, 158, 11, 0.34);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.05), var(--bg-card) 35%);
}

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

.upset-card {
  background: rgba(8, 13, 22, 0.68);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.16s ease;
}

.upset-card.tier-S { border-left: 3px solid var(--crimson); }
.upset-card.tier-A { border-left: 3px solid var(--amber); }
.upset-card.tier-B { border-left: 3px solid var(--sky); }

.upset-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.upset-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}

.upset-card.tier-A .upset-rank {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
}

.upset-card.tier-B .upset-rank {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
}

.upset-pick-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(16, 24, 39, 0.9);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 9px 12px;
  flex-wrap: wrap;
}

.upset-pick-main {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
}

.upset-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.u-metric {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  text-align: center;
}

.u-metric span {
  display: block;
  font-size: 10.5px;
  color: var(--text-dim);
}

.u-metric strong {
  font-size: 13px;
  font-weight: 800;
}

.upset-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.reason-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
}

.upset-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}

.upset-btn-group {
  display: flex;
  gap: 6px;
}

.btn-pro {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #160a02;
  font-weight: 800;
}

.btn-pro:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.live-stats-pill {
  font-size: 12px;
  padding: 8px 12px;
  border-color: rgba(56, 189, 248, 0.32);
  color: #e2e8f0;
}

.live-stats-pill strong { color: var(--sky); }

/* PRO Gate & Blurred Preview */
.upset-card.is-locked {
  position: relative;
  overflow: hidden;
}

.upset-card.is-locked .upset-blur-body {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  opacity: 0.45;
}

.pro-lock-overlay {
  position: absolute;
  inset: 44px 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  text-align: center;
  background: linear-gradient(180deg, rgba(8, 13, 22, 0.35), rgba(8, 13, 22, 0.88) 45%);
}

.pro-gate-banner {
  margin-top: 12px;
  padding: 18px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(16, 185, 129, 0.1));
  border: 1px dashed rgba(245, 158, 11, 0.55);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.modal-wide {
  max-width: 640px;
}

.plan-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 12px;
}

.plan-card {
  background: rgba(8, 13, 22, 0.65);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 13px 14px;
  font-size: 12px;
}

.plan-card.plan-pro {
  border-color: rgba(245, 158, 11, 0.5);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.1), rgba(8, 13, 22, 0.75));
}

.plan-name { font-weight: 800; font-size: 13.5px; margin-bottom: 3px; }
.plan-price { font-size: 17px; font-weight: 800; color: var(--amber); margin-bottom: 8px; }
.plan-price span { font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.plan-card ul { list-style: none; display: flex; flex-direction: column; gap: 4px; color: #cbd5e1; }

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

.owner-kpi {
  background: rgba(8, 13, 22, 0.65);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
}

.owner-kpi span { display: block; font-size: 11px; color: var(--text-muted); }
.owner-kpi strong { font-size: 19px; font-weight: 800; }

/* Legal Footer */
.legal-footer {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.legal-badges, .legal-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-dim);
}

.link-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.link-btn:hover { color: var(--sky); text-decoration: underline; }

.legal-text {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 1200px) {
  .plan-compare-grid, .owner-kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .history-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-two-col { grid-template-columns: 1fr; }
  .h2h-grid, .upset-grid { grid-template-columns: 1fr; }
  .control-deck { grid-template-columns: 1fr; }
  .mode-group, .budget-group, .slider-group { grid-column: span 1; }
  .intel-grid { grid-template-columns: 1fr; }
  .match-grid { grid-template-columns: 1fr; }
  .atmo-sides { grid-template-columns: 1fr; }
  .coverage-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .optimizer-layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
}

@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segmented-control { grid-template-columns: repeat(2, 1fr); }
  .news-hub-grid, .rss-grid { grid-template-columns: 1fr; }
  .coverage-grid { grid-template-columns: repeat(2, 1fr); }
}
