/* ============================================================
   LLM Cage Match — Custom stylesheet
   © 2026 Andrew Webb. All rights reserved.
   ============================================================ */

:root {
  --bg: #050a0e;
  --bg-gradient: radial-gradient(circle at 50% 20%, #0c1824 0%, #050a0e 100%);
  --panel: rgba(10, 21, 32, 0.7);
  --panel-solid: #0a1520;
  --border: #0d2535;
  --border-focus: #00d4ff;
  
  /* Brand colors */
  --accent: #00d4ff;
  --accent-glow: rgba(0, 212, 255, 0.2);
  --accent-dim: #004d60;
  --pro-color: #c9a84c;
  --pro-glow: rgba(201, 168, 76, 0.2);
  --con-color: #a78bfa;
  --con-glow: rgba(167, 139, 250, 0.2);
  --mod-color: #00ff88;
  --mod-glow: rgba(0, 255, 136, 0.15);
  
  --text: #c8e8f0;
  --text-dim: #3a6070;
  --text-mid: #6a9ab0;
  --text-bright: #ffffff;
  --error: #ff4a4a;
  --success: #00ff88;
}

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

html, body {
  background-color: var(--bg);
  background-image: var(--bg-gradient);
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* scanline overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.1) 2px, rgba(0,0,0,0.1) 4px);
  pointer-events: none;
  z-index: 1000;
}

/* grid backdrop */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(0, 212, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* Header */
header {
  padding: 40px 0 30px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 30px;
}

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

.logo-eyebrow {
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.logo {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: 2px;
  line-height: 1;
}

.logo span {
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow);
}

.logo-sub {
  font-size: 0.7rem;
  color: var(--text-mid);
  letter-spacing: 3px;
  margin-top: 8px;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 12px;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

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

/* Grid Layout */
.arena-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: start;
}

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

/* Panel Styles */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.panel:hover {
  border-color: rgba(0, 212, 255, 0.15);
}

.panel-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title .icon {
  font-size: 1rem;
}

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

/* Setup Card styling */
.card-setup {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-mid);
}

.form-group select,
.form-group textarea,
.form-group input {
  background: rgba(5, 10, 14, 0.8);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82rem;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.form-group select:focus,
.form-group textarea:focus,
.form-group input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.15);
}

.inline-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Team Configurations */
.team-config {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  margin-top: 6px;
}

.team-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-header {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 2px;
  padding-bottom: 4px;
  border-bottom: 1px dotted var(--border);
}

.pro-team { color: var(--pro-color); }
.con-team { color: var(--con-color); }

.team-model-slot {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.team-model-slot label {
  font-size: 0.58rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Button styles */
.btn {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-mid);
  padding: 10px 18px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: bold;
}

.btn:hover:not(:disabled) {
  border-color: var(--border-focus);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.15);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-full {
  width: 100%;
}

.btn-green {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(0, 255, 136, 0.15));
  border-color: var(--success);
  color: var(--success);
  box-shadow: 0 4px 14px rgba(0, 255, 136, 0.1);
}

.btn-green:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(0, 255, 136, 0.25));
  border-color: var(--success);
  color: #fff;
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.2);
}

.btn-outline {
  border-color: var(--border);
  color: var(--text-mid);
}

.btn-danger {
  border-color: var(--error);
  color: var(--error);
}

.btn-danger:hover {
  background: rgba(255, 74, 74, 0.1);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.65rem;
}

.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

/* Opinion Poll Card */
.poll-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  background: rgba(5, 10, 14, 0.4);
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid rgba(13, 37, 53, 0.5);
}

.poll-meta-item {
  display: flex;
  flex-direction: column;
}

.poll-meta-item .lbl {
  font-size: 0.55rem;
  color: var(--text-dim);
  letter-spacing: 1.5px;
}

.poll-meta-item .val {
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--accent);
}

.poll-bar-container {
  display: flex;
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 14px;
  background: #000;
}

.poll-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: bold;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  white-space: nowrap;
}

.pro-bar {
  background: linear-gradient(90deg, #8a6e2a, var(--pro-color));
  color: #050a0e;
}

.undecided-bar {
  background: #112233;
  color: var(--text-mid);
}

.con-bar {
  background: linear-gradient(90deg, var(--con-color), #6d28d9);
  color: #fff;
}

.poll-bar .pct {
  padding: 0 4px;
  letter-spacing: 1.5px;
}

.poll-feed {
  max-height: 110px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.68rem;
  border-top: 1px dotted var(--border);
  padding-top: 12px;
}

.poll-feed::-webkit-scrollbar {
  width: 3px;
}

.poll-feed::-webkit-scrollbar-thumb {
  background: var(--border);
}

.feed-item {
  color: var(--text-mid);
  line-height: 1.3;
}

.feed-item.sys-msg {
  color: var(--text-dim);
}

.feed-item.pro-msg {
  color: var(--pro-color);
  border-left: 2px solid var(--pro-color);
  padding-left: 6px;
}

.feed-item.con-msg {
  color: var(--con-color);
  border-left: 2px solid var(--con-color);
  padding-left: 6px;
}

/* Stage Elements */
.stage {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Timeline */
.timeline-card {
  padding: 12px 20px;
}

.timeline-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.timeline-steps::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
  z-index: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
  background: var(--bg2);
  padding: 0 8px;
}

.step-icon {
  width: 24px;
  height: 24px;
  background: #050a0e;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  transition: all 0.3s;
}

.step-lbl {
  font-size: 0.58rem;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.step.active .step-icon {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
  transform: scale(1.1);
}

.step.active .step-lbl {
  color: var(--text);
  font-weight: bold;
}

.step.done .step-icon {
  border-color: var(--success);
  color: var(--success);
}

/* The Active Podium */
.podium-card {
  padding: 30px;
  border-color: var(--border);
  transition: border-color 0.5s, box-shadow 0.5s;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Dynamic glowing border */
.podium-card.glow-pro {
  border-color: var(--pro-color);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), inset 0 0 15px rgba(201,168,76,0.06), 0 0 20px rgba(201,168,76,0.12);
}

.podium-card.glow-con {
  border-color: var(--con-color);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), inset 0 0 15px rgba(167,139,250,0.06), 0 0 20px rgba(167,139,250,0.12);
}

.podium-card.glow-mod {
  border-color: var(--mod-color);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), inset 0 0 15px rgba(0,255,136,0.05), 0 0 20px rgba(0,255,136,0.1);
}

.podium-glow-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.3) 100%);
  z-index: 0;
}

.podium-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(13, 37, 53, 0.4);
  padding-bottom: 14px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.speaker-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.speaker-avatar {
  font-size: 2.2rem;
  line-height: 1;
}

.speaker-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
}

.speaker-team {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-mid);
  letter-spacing: 2px;
  margin-top: 2px;
}

.speaker-meta {
  display: flex;
  gap: 8px;
}

.speaker-tag {
  font-size: 0.58rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid var(--border);
  color: var(--text-mid);
  border-radius: 2px;
}

.accent-tag {
  border-color: var(--accent);
  color: var(--accent);
}

.podium-content {
  position: relative;
  z-index: 1;
  flex: 1;
}

.speech-bubble {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.speech-text {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.7;
  font-weight: 300;
}

.speech-text p {
  margin-bottom: 12px;
}

.speech-text p:last-child {
  margin-bottom: 0;
}

.speech-text code {
  font-family: 'Share Tech Mono', monospace;
  background: rgba(5, 10, 14, 0.6);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.85rem;
  color: var(--accent);
}

.speech-text pre {
  background: rgba(5, 10, 14, 0.8);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 10px 0;
}

.speech-text pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  color: var(--text-mid);
}

.speech-text ul, .speech-text ol {
  margin: 10px 0 10px 20px;
}

.speech-text li {
  margin-bottom: 4px;
}

/* Typing indicator */
.typing-indicator {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
}

.typing-indicator.show {
  display: flex;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.4;
  animation: typing 1s infinite alternate;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0% { transform: translateY(0); opacity: 0.4; }
  100% { transform: translateY(-5px); opacity: 1; }
}

/* ── Audience Q&A Panel ── */
.audience-qa-panel {
  border-top: 1px solid rgba(13, 37, 53, 0.4);
  padding: 12px 0;
  margin-top: 15px;
  position: relative;
  z-index: 1;
}
.qa-header {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.qa-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.qa-input-row textarea {
  flex: 1;
  background: var(--bg-card);
  color: var(--text-bright);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  resize: none;
}
.qa-input-row textarea:focus {
  border-color: var(--accent);
  outline: none;
}
.qa-input-row .btn {
  min-width: 60px;
  height: 44px;
}
#qaInput {
  width: 100%;
  background: var(--bg-card);
  color: var(--text-bright);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  resize: none;
  box-sizing: border-box;
}
#qaInput:focus {
  border-color: var(--accent);
  outline: none;
}
#btnAskQuestion {
  margin-top: 8px;
  min-width: 80px;
}
.qa-status {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 4px;
  letter-spacing: 1px;
  min-height: 14px;
}

/* ── Motion Example Chips ── */
.motion-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  align-items: center;
}
.motion-example-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: 'Orbitron', sans-serif;
}
.motion-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-mid);
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'JetBrains Mono', monospace;
}
.motion-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 245, 212, 0.06);
}

/* ── Voice Synthesis Toggle ── */
#btnVoice.voice-active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 245, 212, 0.1);
}

.podium-footer {
  border-top: 1px solid rgba(13, 37, 53, 0.4);
  padding-top: 12px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.podium-footer .lbl {
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 2px;
}

.podium-footer .val {
  font-size: 0.68rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.idle-glow {
  color: var(--text-dim);
}

.thinking-glow {
  color: var(--accent);
  text-shadow: 0 0 6px rgba(0, 212, 255, 0.5);
  animation: textPulse 1s infinite alternate;
}

.speaking-glow {
  color: var(--success);
  text-shadow: 0 0 6px rgba(0, 255, 136, 0.5);
  animation: textPulse 0.5s infinite alternate;
}

@keyframes textPulse {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* Transcript Feed */
.transcript-card {
  padding-bottom: 24px;
}

.transcript-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 6px;
}

.transcript-list::-webkit-scrollbar {
  width: 4px;
}

.transcript-list::-webkit-scrollbar-track {
  background: rgba(5, 10, 14, 0.2);
}

.transcript-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.empty-transcript {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 40px 0;
  letter-spacing: 1.5px;
}

/* Dialogue Speech Boxes */
.dialog-box {
  background: rgba(5, 10, 14, 0.4);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 18px;
  position: relative;
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Color theme mappings for previous turns */
.dialog-pro {
  border-left: 3px solid var(--pro-color);
}
.dialog-con {
  border-left: 3px solid var(--con-color);
}
.dialog-mod {
  border-left: 3px solid var(--mod-color);
  background: rgba(0, 255, 136, 0.02);
}

.dialog-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.dialog-meta .speaker {
  font-weight: bold;
}

.dialog-meta .speaker.pro { color: var(--pro-color); }
.dialog-meta .speaker.con { color: var(--con-color); }
.dialog-meta .speaker.mod { color: var(--mod-color); }

.dialog-text {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.88rem;
  line-height: 1.6;
  font-weight: 300;
}

.dialog-text p {
  margin-bottom: 10px;
}

.dialog-text p:last-child {
  margin-bottom: 0;
}

.dialog-text code {
  font-family: 'Share Tech Mono', monospace;
  background: rgba(5, 10, 14, 0.6);
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 0.8rem;
  color: var(--accent);
}

.dialog-text pre {
  background: rgba(5, 10, 14, 0.7);
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 8px 0;
}

.dialog-text pre code {
  background: none;
  font-size: 0.78rem;
  color: var(--text-mid);
}

.dialog-text ul, .dialog-text ol {
  margin: 8px 0 8px 18px;
}

.dialog-text li {
  margin-bottom: 3px;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 8, 0.85);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: #0a1520;
  border: 1px solid var(--border-focus);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.25);
  border-radius: 6px;
  padding: 28px;
  width: min(440px, 94vw);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal h3 {
  font-family: 'Orbitron', sans-serif;
  color: #fff;
  letter-spacing: 2px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-field label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-mid);
}

.modal-field input, .modal-field select {
  background: rgba(5, 10, 14, 0.8);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  padding: 10px 12px;
  outline: none;
  width: 100%;
}

.modal-field input:focus, .modal-field select:focus {
  border-color: var(--border-focus);
}

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

/* Footer styling */
footer {
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.58rem;
  color: var(--text-dim);
  letter-spacing: 2px;
  margin-top: 40px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@media (max-width: 600px) {
  header {
    padding: 30px 0 20px;
  }
  .header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .team-config {
    grid-template-columns: 1fr;
  }
}

/* --- TOOLTIP & HOW-TO STYLES --- */
[data-tooltip] {
  position: relative;
  cursor: help;
}

/* Tooltip popup is a real DOM element appended to <body> by JS — see initTooltipPositioning() */
.tooltip-popup {
  position: fixed;
  background: rgba(10, 21, 32, 0.97);
  border: 1px solid var(--border-focus);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-family: 'Share Tech Mono', monospace;
  white-space: normal;
  width: max-content;
  max-width: 260px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
  pointer-events: none;
  z-index: 9999;
  text-transform: none;
  letter-spacing: 0.5px;
  line-height: 1.4;
  text-align: left;
  font-weight: normal;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.tooltip-popup.visible {
  opacity: 1;
}

.help-indicator {
  display: inline-block;
  margin-left: 4px;
  color: var(--accent);
  opacity: 0.7;
  font-size: 0.75rem;
  transition: opacity 0.2s;
  cursor: help;
}

.help-indicator:hover {
  opacity: 1;
}

/* Large Scrollable Modal for Guide */
.modal-large {
  width: min(600px, 94vw) !important;
  max-height: 80vh;
}

.modal-scroll-content {
  overflow-y: auto;
  max-height: 50vh;
  padding-right: 8px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-scroll-content::-webkit-scrollbar {
  width: 4px;
}

.modal-scroll-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.guide-intro {
  font-size: 0.85rem;
  color: var(--text-mid);
  line-height: 1.5;
  border-left: 2px solid var(--accent);
  padding-left: 10px;
  font-style: italic;
}

.guide-section h4 {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  color: #fff;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.guide-section p {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-mid);
}

.guide-section strong {
  color: var(--accent);
}

.guide-section ol {
  margin-left: 16px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guide-section li {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.82rem;
  color: var(--text-mid);
}

/* Active Motion Display Card */
.motion-display-card {
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(10, 21, 32, 0.8), rgba(5, 10, 14, 0.9));
  border: 1px solid var(--border);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
  padding: 14px 20px;
  position: relative;
}

/* Corner decorations */
.motion-display-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
}

.motion-display-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-bottom: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
}

.motion-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 3px;
  color: var(--accent);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
  font-weight: 700;
  text-transform: uppercase;
}

.motion-text {
  font-family: 'Exo 2', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  letter-spacing: 0.5px;
}

/* Verdict Synthesis & Blueprint styling */
.verdict-summary {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.verdict-header {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 2px;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
}

.verdict-swing {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.95rem;
  color: #fff;
  border-left: 2px solid var(--accent);
  padding-left: 10px;
  margin-bottom: 8px;
}

.verdict-analysis h4, .verdict-blueprint h4 {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-top: 14px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.verdict-analysis p {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-mid);
}

.verdict-analysis ul {
  margin-left: 18px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.verdict-analysis li {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.85rem;
  color: var(--text-mid);
}

.blueprint-code-frame {
  background: rgba(5, 10, 14, 0.9);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 4px;
  max-height: 250px;
  overflow-y: auto;
}

.blueprint-code-frame pre code {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-mid);
  white-space: pre-wrap;
}

.verdict-votes {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-dim);
  border-top: 1px dotted var(--border);
  padding-top: 12px;
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* History list and items */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.history-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.1);
  transform: translateY(-1px);
}

.history-item-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.history-item-title {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.85rem;
  font-weight: bold;
  color: #fff;
}

.history-item-meta {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-dim);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.history-item-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.58rem;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.badge-debate {
  background: rgba(201, 168, 76, 0.15);
  color: var(--pro-color);
  border: 1px solid rgba(201, 168, 76, 0.3);
}

.badge-assembly {
  background: rgba(0, 212, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(0, 212, 255, 0.3);
}

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

/* --- TELEMETRY DASHBOARD STYLES --- */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  background: rgba(5, 10, 14, 0.7);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s;
}

.metric-card:hover {
  border-color: rgba(0, 212, 255, 0.2);
}

.metric-lbl {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--text-mid);
  letter-spacing: 1.5px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.metric-val {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.45rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  letter-spacing: 0.5px;
}

.metric-val.text-green {
  color: var(--success);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.15);
}

.metric-val.text-accent {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.15);
}

.metric-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

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

.chart-box {
  background: rgba(5, 10, 14, 0.4);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-box h4 {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  color: #fff;
  letter-spacing: 1px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 6px;
  margin: 0;
  text-transform: uppercase;
}

.chart-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 140px;
  justify-content: center;
}

/* Horizontal Stacked Bars */
.custom-bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bar-label-group {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
}

.bar-label-model {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  color: #fff;
}

.bar-label-val {
  font-family: 'Share Tech Mono', monospace;
  color: var(--text-mid);
}

.bar-outer {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.02);
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  display: flex;
}

.bar-inner {
  height: 100%;
  transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Vertical Latency Columns */
.chart-container.latency-chart {
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-around;
  padding-top: 15px;
}

.latency-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
  width: 50px;
}

.latency-bar-val {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.6rem;
  color: var(--text-mid);
}

.latency-bar-outer {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.02);
  width: 16px;
  height: 80px;
  border-radius: 3px 3px 0 0;
  display: flex;
  align-items: flex-end;
}

.latency-bar-inner {
  width: 100%;
  border-radius: 2px 2px 0 0;
  transition: height 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 0 8px rgba(255,255,255,0.05);
}

.latency-bar-lbl {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.55rem;
  color: var(--text-dim);
  text-align: center;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
  font-weight: 700;
  margin-top: 2px;
}

/* Telemetry Table styling */
.telemetry-table-wrapper {
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow-x: auto;
  background: rgba(5, 10, 14, 0.3);
  margin-top: 15px;
}

.telemetry-table-wrapper h4 {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  color: #fff;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 1px;
  margin: 0;
  text-transform: uppercase;
}

.telemetry-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.7rem;
}

.telemetry-table th {
  background: rgba(10, 21, 32, 0.8);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  color: var(--text-mid);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 1px;
  font-size: 0.6rem;
  text-transform: uppercase;
}

.telemetry-table td {
  padding: 8px 12px;
  border-bottom: 1px dotted var(--border);
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
}

.telemetry-table tr:last-child td {
  border-bottom: none;
}

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

/* Simple success toast for GitHub push (and future use) */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(15, 23, 42, 0.95);
  color: #e2e8f0;
  padding: 12px 18px;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-size: 0.85rem;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toast-in 0.2s ease-out;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.toast.success {
  border-left: 3px solid #22c55e;
}

.toast .toast-close {
  margin-left: 12px;
  cursor: pointer;
  opacity: 0.6;
}

.toast .toast-close:hover {
  opacity: 1;
}

/* ── DROP ZONE ──────────────────────────── */
.drop-zone {
  margin-top: 8px;
  border: 2px dashed var(--accent-dim, #444);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: rgba(255,255,255,0.02);
}

.drop-zone:hover, .drop-zone:focus {
  border-color: var(--accent, #00d4ff);
  background: rgba(0,212,255,0.04);
}

.drop-zone.drag-over {
  border-color: var(--accent, #00d4ff);
  background: rgba(0,212,255,0.08);
  border-style: solid;
}

.drop-zone-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.drop-icon {
  font-size: 1.4em;
}

.drop-text {
  font-size: 0.85em;
  color: var(--text-dim, #aaa);
}

.drop-text a {
  color: var(--accent, #00d4ff);
  text-decoration: underline;
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.78em;
  font-family: var(--font-mono, monospace);
}

.file-chip-loading {
  background: rgba(255,255,255,0.06);
  color: var(--text-dim, #aaa);
}

.file-chip-success {
  background: rgba(0,200,100,0.12);
  color: #6fdf8f;
}

.file-chip-error {
  background: rgba(255,60,60,0.12);
  color: #ff7777;
}

.file-chip-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip-detail {
  opacity: 0.7;
  font-size: 0.9em;
}

