:root {
  --bg: #0a0a0f;
  --glass: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.10);
  --green: #00ff88;
  --orange: #f97316;
  --red: #ff3b3b;
  --text: #e8edf5;
  --muted: #6b7280;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

/* ── TOPBAR ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.live-lamp {
  color: var(--green);
  animation: lamp-pulse 2s ease-in-out infinite;
}

@keyframes lamp-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ── GRID ── */
.grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  align-items: start;
}

@media (max-width: 768px) {
  .grid { grid-template-columns: 1fr; }
}

/* ── GLASS ── */
.glass {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── INPUT PANEL ── */
.input-panel {
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 24px;
}

.brand-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.1em;
  color: var(--green);
}

.brand-sub {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}

.player-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  color: var(--text);
  outline: none;
  caret-color: var(--green);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.player-input:focus {
  border-color: rgba(0, 255, 136, 0.5);
  box-shadow: 0 0 0 1px rgba(0, 255, 136, 0.2), 0 0 18px rgba(0, 255, 136, 0.06);
}

.player-input::placeholder { color: var(--muted); }

/* Sport tabs */
.sport-tabs {
  display: flex;
  gap: 8px;
}

.tab {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}

.tab.active {
  background: rgba(0, 255, 136, 0.10);
  border-color: rgba(0, 255, 136, 0.35);
  color: var(--green);
}

.tab:hover:not(.active) {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

/* Analyze button */
.analyze-btn {
  width: 100%;
  background: var(--green);
  color: #000;
  border: 0;
  border-radius: 8px;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: transform 0.12s;
}

.analyze-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(0, 255, 136, 0.35);
}

.analyze-btn:disabled { opacity: 0.7; cursor: wait; }

.analyze-btn.loading {
  animation: btn-pulse 0.8s ease-in-out infinite;
}

@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.6); }
  50%       { box-shadow: 0 0 0 10px rgba(0, 255, 136, 0); }
}

/* Recent searches */
.recent-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}

.recent-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.recent-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}

.recent-chip:hover {
  border-color: rgba(0, 255, 136, 0.3);
  color: var(--green);
}

/* ── OUTPUT PANEL ── */
.output-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.output-panel.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── STATS BAR ── */
.stats-bar {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  min-height: 72px;
}

.metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 60px;
  padding: 8px 10px;
  position: relative;
}

.metric + .metric::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; height: 60%;
  width: 1px;
  background: var(--border);
}

.metric-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.metric-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Skeleton shimmer */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.09) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
  display: block;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── ANALYST CARD ── */
.analyst-card {
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 14px;
}

.streaming-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--orange);
  display: none;
  animation: dot-pulse 0.8s ease-in-out infinite;
}

.streaming-dot.active { display: block; }

@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

.card-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 18px;
}

.card-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  min-height: 80px;
  white-space: pre-wrap;
}

/* Scanning line */
.scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  pointer-events: none;
  opacity: 0;
}

.analyst-card.streaming .scan-line {
  opacity: 0.5;
  animation: scan 1.6s linear infinite;
}

@keyframes scan {
  0%   { top: 60px; }
  100% { top: 100%; }
}

/* ── TAG STRIP ── */
.tag-strip { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  background: rgba(0, 255, 136, 0.07);
  border: 1px solid rgba(0, 255, 136, 0.22);
  border-radius: 999px;
  padding: 5px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--green);
  text-transform: uppercase;
  animation: tag-glow 2.5s ease-in-out infinite;
}

@keyframes tag-glow {
  0%, 100% { box-shadow: 0 0 6px rgba(0, 255, 136, 0.12); }
  50%       { box-shadow: 0 0 14px rgba(0, 255, 136, 0.28); }
}

/* ── Nav ── */
.nav-back {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.15s;
  white-space: nowrap;
}
.nav-back:hover { color: var(--text); }

/* Utility */
.error-text {
  color: var(--red);
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

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