/* ==========================================================================
   QUANTUM VAULT // POLISHED GAME DESIGN SYSTEM
   Event: Quriosity 2026 — ISAQC at IIIT Hyderabad
   Aesthetic: High-Tech Quantum Laboratory & Interactive Strategy Game
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg-core: #050811;
  --bg-surface: #0a1122;
  --bg-surface-elevated: #0f1933;
  --bg-glass: rgba(11, 19, 38, 0.78);
  --border-subtle: rgba(74, 108, 166, 0.25);
  --border-active: rgba(0, 240, 255, 0.6);
  --cyan-primary: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.35);
  --violet-primary: #8b5cf6;
  --violet-glow: rgba(139, 92, 246, 0.35);
  --emerald-success: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.45);
  --ruby-danger: #f43f5e;
  --ruby-glow: rgba(244, 63, 94, 0.45);
  --amber-warning: #f59e0b;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--bg-core);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 36px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

/* ==========================================================================
   TOPBAR HEADER
   ========================================================================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.brand {
  display: flex;
  flex-direction: column;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.lab-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--cyan-primary);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sub-badge {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.05;
}

.glow-word {
  color: var(--cyan-primary);
  text-shadow: 0 0 20px var(--cyan-glow);
}

.subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.hud-btn:hover {
  background: rgba(18, 30, 60, 0.85);
  border-color: rgba(0, 240, 255, 0.4);
  color: var(--text-main);
  transform: translateY(-1px);
}

.hud-btn.highlight {
  border-color: rgba(0, 240, 255, 0.5);
  color: var(--cyan-primary);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

.hud-btn.highlight:hover {
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.35);
}

.hud-btn.muted {
  color: var(--ruby-danger);
  border-color: rgba(244, 63, 94, 0.4);
}

kbd {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  background: #040813;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--cyan-primary);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
}

/* ==========================================================================
   MISSION HERO (IMMEDIATE 10-SECOND OBJECTIVE CLARITY)
   ========================================================================== */
.mission-hero {
  padding: 16px 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(14, 28, 56, 0.88), rgba(7, 14, 30, 0.95));
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.1);
  text-align: center;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 4px;
}

.hero-icon {
  font-size: 1.4rem;
}

.hero-top h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.28rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--cyan-primary);
}

.hero-flow {
  margin: 0 0 4px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #ffffff;
}

.hero-desc {
  margin: 0;
  color: #94a3b8;
  font-size: 0.88rem;
}

/* ==========================================================================
   COMPACT GAME HUD
   ========================================================================== */
.dashboard {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  backdrop-filter: blur(12px);
  min-height: 78px;
  transition: border-color 0.2s, transform 0.2s;
}

.metric-card:hover {
  border-color: rgba(0, 240, 255, 0.35);
  transform: translateY(-1px);
}

.metric-label {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.metric-val {
  margin: 2px 0;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
}

.metric-val.highlight-val {
  color: var(--cyan-primary);
  text-shadow: 0 0 10px var(--cyan-glow);
}

.metric-val.score-val {
  color: #60a5fa;
}

.metric-val.streak-val {
  color: var(--emerald-success);
}

.metric-val.efficiency-val {
  color: #38bdf8;
}

.metric-sub {
  color: var(--text-dim);
  font-size: 0.67rem;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Status & Contextual Coaching Banner */
.status-banner-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  margin-bottom: 18px;
  background: linear-gradient(90deg, rgba(14, 24, 48, 0.85), rgba(8, 14, 28, 0.85));
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  backdrop-filter: blur(8px);
}

.phase-indicator {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.phase-indicator.active {
  color: var(--cyan-primary);
  text-shadow: 0 0 10px var(--cyan-glow);
}

.system-message {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.9rem;
  text-align: right;
  font-weight: 600;
}

/* ==========================================================================
   MAIN EXPERIMENT STAGE: 4x4 GRID & TRAJECTORY CHART
   ========================================================================== */
.experiment-stage {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  margin-bottom: 20px;
}

.grid-panel, .analysis-panel {
  padding: 20px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  backdrop-filter: blur(14px);
}

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

.panel-tag {
  display: block;
  margin-bottom: 3px;
  color: var(--cyan-primary);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.panel-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.grid-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan-primary);
  box-shadow: 0 0 8px var(--cyan-glow);
}

/* 4x4 Quantum Grid */
.node-grid.grid-16 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.quantum-node {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 122px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(14, 23, 44, 0.8), rgba(9, 15, 30, 0.95));
  border: 1px solid rgba(59, 86, 128, 0.35);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  user-select: none;
}

.quantum-node:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 240, 255, 0.6);
}

.quantum-node:focus-visible {
  outline: 2px solid var(--cyan-primary);
  outline-offset: 2px;
}

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

.node-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.node-ket {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--cyan-primary);
}

.node-center-gauge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  margin: 3px 0;
}

.radial-ring {
  width: 40px;
  height: 40px;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 4;
}

.ring-fg {
  fill: none;
  stroke: var(--cyan-primary);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dasharray 0.35s ease;
}

.core-orb {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 10%, var(--cyan-primary) 60%, transparent 100%);
  box-shadow: 0 0 10px var(--cyan-glow);
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.node-probability {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
  color: var(--text-main);
  margin-bottom: 5px;
}

.node-bottom-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 99px;
  overflow: hidden;
}

.node-bottom-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--violet-primary), var(--cyan-primary));
  border-radius: 99px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Node States */
.quantum-node.node-dominant {
  border-color: rgba(0, 240, 255, 0.7) !important;
}

.quantum-node.node-win {
  border-color: var(--emerald-success) !important;
  box-shadow: 0 0 30px var(--emerald-glow) !important;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(9, 15, 30, 0.95));
}

.quantum-node.node-win .ring-fg {
  stroke: var(--emerald-success);
}

.quantum-node.node-win .core-orb {
  background: radial-gradient(circle, #ffffff 10%, var(--emerald-success) 70%, transparent 100%);
  box-shadow: 0 0 16px var(--emerald-glow);
}

.quantum-node.node-miss {
  border-color: var(--ruby-danger) !important;
  box-shadow: 0 0 25px var(--ruby-glow) !important;
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.15), rgba(9, 15, 30, 0.95));
}

.quantum-node.node-was-target {
  border-color: var(--violet-primary) !important;
  box-shadow: 0 0 25px var(--violet-glow) !important;
}

.quantum-node.node-scanning {
  border-color: var(--amber-warning) !important;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.6) !important;
  transform: scale(1.03);
}

.node-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-win {
  background: var(--emerald-success);
  color: #04100b;
}

.badge-miss {
  background: var(--ruby-danger);
  color: #ffffff;
}

.badge-target {
  background: var(--violet-primary);
  color: #ffffff;
}

.badge-strongest {
  background: rgba(0, 240, 255, 0.2);
  border: 1px solid var(--cyan-primary);
  color: var(--cyan-primary);
}

/* ==========================================================================
   TRAJECTORY PANEL & LIVE CHART
   ========================================================================== */
.analysis-panel {
  display: flex;
  flex-direction: column;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 220px;
  background: rgba(4, 9, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

#historyCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.info-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.indicator-line {
  display: inline-block;
  width: 24px;
  height: 3px;
  border-radius: 2px;
}

.indicator-line.theo {
  background: var(--violet-primary);
  opacity: 0.7;
}

.indicator-line.actual {
  background: var(--cyan-primary);
  box-shadow: 0 0 8px var(--cyan-glow);
}

.overshoot-callout {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  margin-top: auto;
}

.callout-icon {
  font-size: 1.1rem;
}

.overshoot-callout p {
  margin: 0;
  font-size: 0.76rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.overshoot-callout strong {
  color: var(--amber-warning);
}

/* ==========================================================================
   CONTROL DECK: DISTINCT LARGE BUTTONS
   ========================================================================== */
.control-deck {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 22px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  backdrop-filter: blur(14px);
}

.control-hint {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hint-label {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.hint-text {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.hint-text strong {
  color: var(--cyan-primary);
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  user-select: none;
}

.game-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.game-btn:active:not(:disabled) {
  transform: translateY(0);
}

.game-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.btn-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.btn-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.btn-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.btn-subtitle {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.85;
}

.game-btn.amplify-btn {
  background: linear-gradient(135deg, #0e7490, #0891b2);
  border-color: var(--cyan-primary);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.25);
}

.game-btn.amplify-btn:hover:not(:disabled) {
  box-shadow: 0 0 32px rgba(0, 240, 255, 0.5);
  background: linear-gradient(135deg, #0891b2, #06b6d4);
}

.game-btn.measure-btn {
  background: linear-gradient(135deg, #9f1239, #be123c);
  border-color: var(--ruby-danger);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.25);
}

.game-btn.measure-btn:hover:not(:disabled) {
  box-shadow: 0 0 32px rgba(244, 63, 94, 0.5);
  background: linear-gradient(135deg, #be123c, #e11d48);
}

.game-btn.quiet-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

.game-btn.quiet-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   RESULT MODALS (WIN / MISS)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-window {
  width: min(760px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: #0a1124;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: 0 0 50px rgba(0, 240, 255, 0.2);
  overflow: hidden;
  animation: cardIn 0.25s ease-out;
}

@keyframes cardIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.result-window {
  width: min(520px, 100%);
  text-align: center;
  padding: 26px;
}

.result-window.win-theme {
  border-color: var(--emerald-success);
  box-shadow: 0 0 45px var(--emerald-glow);
}

.result-window.miss-theme {
  border-color: var(--ruby-danger);
  box-shadow: 0 0 45px var(--ruby-glow);
}

.result-icon {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.6rem;
  margin: 0 auto 10px;
}

.win-theme .result-icon {
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid var(--emerald-success);
  color: var(--emerald-success);
}

.miss-theme .result-icon {
  background: rgba(244, 63, 94, 0.15);
  border: 2px solid var(--ruby-danger);
  color: var(--ruby-danger);
}

.result-header h2 {
  margin: 0 0 4px;
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.win-theme h2 { color: var(--emerald-success); }
.miss-theme h2 { color: var(--ruby-danger); }

.result-sub {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.result-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
  text-align: left;
}

.stat-box {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.stat-box span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.stat-box strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: #ffffff;
  margin-top: 2px;
}

.miss-explainer {
  margin: 12px 0 18px;
  color: #cbd5e1;
  font-size: 0.84rem;
  line-height: 1.45;
}

.result-footer {
  display: flex;
  justify-content: center;
}

/* Modal Headers & Tabs */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: #0d162e;
}

.modal-header h2 {
  margin: 4px 0 0;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
}

.modal-close-btn:hover {
  color: var(--cyan-primary);
}

.modal-tabs {
  display: flex;
  background: #070d1c;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.modal-tab-btn {
  flex: 1;
  min-height: 44px;
  padding: 0 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.modal-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.modal-tab-btn.active {
  color: var(--cyan-primary);
  border-bottom-color: var(--cyan-primary);
  background: rgba(0, 240, 255, 0.05);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-tab-pane {
  display: none;
}

.modal-tab-pane.active {
  display: block;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.guide-card {
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.guide-card h3 {
  margin: 0 0 6px;
  color: var(--cyan-primary);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.guide-card p {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.84rem;
  line-height: 1.45;
}

.math-explainer h3 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--cyan-primary);
}

.math-explainer p {
  color: #94a3b8;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.formula-box {
  padding: 16px;
  background: #060a16;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  margin-bottom: 16px;
}

.formula-box h4 {
  margin: 0 0 6px;
  color: #c4b5fd;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
}

.formula-box code {
  display: inline-block;
  padding: 4px 8px;
  background: #0f172a;
  border-radius: 4px;
  color: var(--cyan-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin: 4px 0;
}

.formula-box ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.formula-box li {
  margin-bottom: 4px;
}

.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
}

.shortcuts-table th, .shortcuts-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.88rem;
}

.shortcuts-table th {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
}

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */
@media (max-width: 1100px) {
  .dashboard {
    grid-template-columns: repeat(4, 1fr);
  }
  .experiment-stage {
    grid-template-columns: 1fr;
  }
  .analysis-panel {
    order: -1;
  }
}

@media (max-width: 768px) {
  .app-shell {
    width: calc(100% - 24px);
    padding-top: 16px;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .dashboard {
    grid-template-columns: repeat(2, 1fr);
  }
  .status-banner-box {
    flex-direction: column;
    align-items: flex-start;
  }
  .system-message {
    text-align: left;
  }
  .control-deck {
    flex-direction: column;
    align-items: stretch;
  }
  .action-buttons {
    width: 100%;
    flex-direction: column;
  }
  .action-buttons .game-btn {
    width: 100%;
    justify-content: flex-start;
  }
  .guide-grid, .result-stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .node-grid.grid-16 {
    grid-template-columns: repeat(2, 1fr);
  }
}
