/* 足球竞猜 Command Center HUD — Phase 1 v20260725hud */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --hud-gold: #f59e0b;
  --hud-green: #10b981;
  --hud-red: #ef4444;
  --hud-mono: 'JetBrains Mono', 'IBM Plex Mono', 'SF Mono', ui-monospace, monospace;
}

/* ── Grid scan background (replaces particles on football page) ── */
.fb-hud-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    linear-gradient(rgba(245, 158, 11, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 158, 11, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
}
.fb-hud-bg::after {
  content: '';
  position: absolute;
  inset: -50% 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(245, 158, 11, 0.06) 45%,
    rgba(245, 158, 11, 0.12) 50%,
    rgba(245, 158, 11, 0.06) 55%,
    transparent 100%
  );
  animation: hudScan 14s linear infinite;
}
@keyframes hudScan {
  0% { transform: translateY(-30%); }
  100% { transform: translateY(30%); }
}

body.fb-hud-page .container {
  position: relative;
  z-index: 1;
}

/* ── Ops Strip ── */
.fb-ops-strip {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(200px, 2fr) minmax(160px, 1fr);
  gap: 12px 16px;
  align-items: stretch;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(17, 19, 30, 0.88));
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.06) inset;
  min-height: 132px;
}
.fb-ops-left { min-width: 0; }
.fb-ops-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hud-gold);
}
.fb-ops-sub {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text3, #94a3b8);
}
.fb-ops-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fb-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.16);
  background: rgba(15, 23, 42, 0.45);
  min-width: 64px;
}
.fb-kpi-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3, #94a3b8);
}
.fb-kpi-val {
  font-family: var(--hud-mono);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--hud-gold);
  line-height: 1.1;
}
.fb-ops-center {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fb-ops-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 36px;
  max-height: 72px;
  overflow-y: auto;
}
.fb-ops-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 0;
  text-align: right;
}
.fb-ops-freshness,
.fb-ops-clock {
  font-family: var(--hud-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary, #cbd5e1);
}
.fb-ops-freshness b,
.fb-ops-clock b {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--hud-gold);
}
.fb-ops-status {
  font-size: 10px;
  line-height: 1.4;
  color: var(--text3, #94a3b8);
  max-width: 100%;
}

/* ── Coverage Matrix (5 cells) ── */
.fb-coverage-matrix {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
  min-height: 72px;
}
.fb-coverage-matrix:not(.is-visible) {
  visibility: hidden;
  pointer-events: none;
}
.fb-cov-cell {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(245, 158, 11, 0.14);
  background: rgba(15, 23, 42, 0.5);
  text-align: center;
}
.fb-cov-cell.ok {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.06);
}
.fb-cov-cell.warn {
  border-color: rgba(245, 158, 11, 0.35);
}
.fb-cov-cell.miss {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.04);
}
.fb-cov-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text3, #94a3b8);
  margin-bottom: 4px;
}
.fb-cov-val {
  font-family: var(--hud-mono);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #f8fafc;
}
.fb-cov-cell.ok .fb-cov-val { color: var(--hud-green); }
.fb-cov-cell.warn .fb-cov-val { color: var(--hud-gold); }
.fb-cov-cell.miss .fb-cov-val { color: var(--hud-red); }
.fb-cov-pct {
  display: block;
  margin-top: 2px;
  font-family: var(--hud-mono);
  font-size: 10px;
  color: var(--text3, #94a3b8);
}
.fb-signal-line.gap-reason {
  color: var(--hud-gold, #f59e0b);
  font-size: 11px;
}

/* ── Board zones ── */
.fb-board-live {
  border-color: rgba(245, 158, 11, 0.32) !important;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.05), rgba(17, 19, 30, 0.55)) !important;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.06);
}
.fb-board-live .fb-board-title::before {
  content: '● ';
  color: var(--hud-gold);
  animation: hudBlink 2s ease-in-out infinite;
}
.fb-board-settled {
  border-color: rgba(16, 185, 129, 0.35) !important;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.07), rgba(16, 185, 129, 0.02)) !important;
}
.fb-board-settled .fb-board-title {
  color: var(--hud-green) !important;
}
.fb-board-settled .fb-board-title::before {
  content: '▣ ';
  color: var(--hud-green);
}
.fb-board-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  vertical-align: middle;
}
.fb-board-live .fb-board-tag {
  color: var(--hud-gold);
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
}
.fb-board-settled .fb-board-tag {
  color: var(--hud-green);
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.1);
}
@keyframes hudBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ── Match card lanes ── */
.fb-match.fb-settled-card {
  border-color: rgba(16, 185, 129, 0.28);
  background: linear-gradient(160deg, rgba(16, 185, 129, 0.05), rgba(17, 19, 30, 0.65));
}
.fb-match.fb-settled-card .fb-lane-label { color: var(--hud-green); }
.fb-lane {
  padding: 12px 14px;
  min-width: 0;
  border-right: 1px solid rgba(245, 158, 11, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.fb-lane:last-child { border-right: none; }
.fb-lane-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hud-gold);
  margin-bottom: 8px;
}
.fb-lane-a .score-num,
.fb-lane-b .odds-chip-val,
.fb-lane-b .handicap-value,
.fb-signal-metric b {
  font-family: var(--hud-mono);
  font-variant-numeric: tabular-nums;
}

/* Signal summary lane */
.fb-signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}
.fb-signal-metric {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.12);
  background: rgba(15, 23, 42, 0.4);
  font-size: 10px;
  color: var(--text3, #94a3b8);
}
.fb-signal-metric b {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
}
.fb-signal-metric.ok b { color: var(--hud-green); }
.fb-signal-metric.miss b { color: var(--hud-red); }
.fb-signal-line {
  font-size: 10px;
  line-height: 1.45;
  color: var(--text-secondary, #cbd5e1);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.fb-signal-line.injury b { color: var(--hud-red); }
.fb-open-intel {
  margin-top: auto;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.1);
  color: var(--hud-gold);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.fb-open-intel:hover { background: rgba(245, 158, 11, 0.18); }

.fb-intel-store { display: none !important; }

/* Region patch pulse */
@keyframes regionPulse {
  0% { box-shadow: inset 0 0 0 0 rgba(245, 158, 11, 0); }
  40% { box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.45); }
  100% { box-shadow: inset 0 0 0 0 rgba(245, 158, 11, 0); }
}
[data-region].fb-region-pulse {
  animation: regionPulse 0.55s ease-out;
  border-radius: 8px;
}

/* ── PC Drawer ── */
.fb-intel-drawer {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  visibility: hidden;
}
.fb-intel-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}
.fb-intel-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.fb-intel-drawer.is-open .fb-intel-drawer-backdrop { opacity: 1; }
.fb-intel-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  height: 100%;
  background: var(--surface-4, #1f2336);
  border-left: 1px solid rgba(245, 158, 11, 0.2);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.35);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.fb-intel-drawer.is-open .fb-intel-drawer-panel { transform: translateX(0); }
.fb-intel-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.12);
}
.fb-intel-drawer-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
}
.fb-intel-drawer-close {
  background: none;
  border: none;
  color: var(--text3, #94a3b8);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.fb-intel-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
}

/* Mobile sheet (enhanced) */
.fb-intel-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 199;
}

/* Combo odds bar */
.fb-combo-odds {
  font-family: var(--hud-mono);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--hud-gold);
}
.fb-combo-odds .profit-hint { color: var(--hud-green); margin-left: 6px; }

/* Light theme */
body.light-theme .fb-ops-strip {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(255, 255, 255, 0.95));
  border-color: rgba(0, 0, 0, 0.08);
}
body.light-theme .fb-kpi { background: rgba(241, 245, 249, 0.9); }
body.light-theme .fb-cov-cell { background: rgba(241, 245, 249, 0.85); }
body.light-theme .fb-cov-val { color: #1e293b; }
body.light-theme .fb-intel-drawer-panel { background: #fff; }

/* Responsive */
@media (max-width: 1100px) {
  .fb-ops-strip {
    grid-template-columns: 1fr 1fr;
  }
  .fb-ops-center { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .fb-ops-strip { grid-template-columns: 1fr; }
  .fb-ops-right { align-items: flex-start; text-align: left; }
  .fb-coverage-matrix { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fb-intel-drawer { display: none; }
  .fb-open-intel:not(.mobile-only) { display: none; }
  .fb-open-intel.mobile-only { display: block; }
}
@media (min-width: 769px) {
  .fb-show-intel, .fb-open-intel.mobile-only { display: none !important; }
  .fb-open-intel:not(.mobile-only) { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .fb-hud-bg::after { animation: none; opacity: 0.04; }
  .fb-board-live .fb-board-title::before { animation: none; }
  [data-region].fb-region-pulse { animation: none; }
  .fb-intel-drawer-panel { transition: none; }
  .fb-intel-drawer-backdrop { transition: none; }
}
