/* GENOME EXPLORER: CSS STYLES */
:root {
  --bg-dark: #070b16;
  --bg-card: rgba(13, 22, 43, 0.85);
  --border-card: rgba(64, 116, 204, 0.35);
  --text-primary: #f1f5f9;
  --text-muted: #94a3b8;
  --text-bright: #ffffff;
  
  --base-a: #10b981; /* Emerald Green */
  --base-t: #ef4444; /* Coral Ruby */
  --base-c: #06b6d4; /* Cyan Blue */
  --base-g: #f59e0b; /* Amber Gold */
  
  --accent-cyan: #38bdf8;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-yellow: #fde047;
  
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", Menlo, Consolas, Monaco, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-main);
  color: var(--text-primary);
  touch-action: none;
}

#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#canvas-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* UI LAYER */
#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.interactive {
  pointer-events: auto;
}

/* TOP BAR */
#top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: linear-gradient(180deg, rgba(7, 11, 22, 0.95) 0%, rgba(7, 11, 22, 0.4) 80%, transparent 100%);
  gap: 16px;
  flex-wrap: wrap;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
}

.logo-icon svg {
  width: 24px;
  height: 24px;
  stroke: #ffffff;
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #38bdf8, #a855f7, #f43f5e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* MAIN MODE TOGGLE */
.mode-toggle-group {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-card);
  border-radius: 30px;
  padding: 3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 25px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.mode-btn.active {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.5);
}

/* TOP RIGHT CONTROLS */
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: var(--accent-cyan);
  transform: scale(1.05);
}

.icon-btn:active {
  transform: scale(0.95);
}

/* ORGANISM PICKER */
.organism-picker {
  display: flex;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 2px 6px;
  gap: 4px;
}

.organism-btn {
  background: transparent;
  border: none;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.organism-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.organism-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: var(--accent-cyan);
}

/* BOTTOM HUD: SCALE TIMELINE */
#scale-hud {
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: linear-gradient(0deg, rgba(7, 11, 22, 0.95) 0%, rgba(7, 11, 22, 0.5) 70%, transparent 100%);
}

.scale-track-container {
  width: 100%;
  max-width: 900px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.scale-track-line {
  position: absolute;
  top: 18px;
  left: 30px;
  right: 30px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  z-index: 1;
}

.scale-track-fill {
  position: absolute;
  top: 18px;
  left: 30px;
  height: 4px;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc);
  border-radius: 2px;
  z-index: 2;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  width: 0%;
}

.scale-nodes {
  width: 100%;
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 3;
}

.scale-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: transparent;
  border: none;
  outline: none;
  transition: transform 0.2s;
}

.scale-node:hover {
  transform: translateY(-2px);
}

.node-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-muted);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: all 0.3s;
}

.scale-node.active .node-dot {
  border-color: #38bdf8;
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.6);
  transform: scale(1.15);
}

.scale-node.visited .node-dot {
  border-color: #818cf8;
}

.node-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.node-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.scale-node.active .node-title {
  color: #38bdf8;
}

.node-size {
  font-size: 10px;
  color: rgba(148, 163, 184, 0.7);
  font-family: var(--font-mono);
}

/* SCALE FLIGHT CONTROLS */
.scale-flight-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.flight-btn {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.flight-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.flight-btn:active {
  transform: translateY(0);
}

.control-hint-badge {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.key-tag {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-bright);
}

/* PIP THE COMPANION / FLOATING CARD */
#companion-card {
  position: absolute;
  top: 80px;
  left: 20px;
  max-width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 15;
}

.companion-header {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mascot-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mascot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
  animation: floatMascot 3s ease-in-out infinite;
}

@keyframes floatMascot {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.mascot-name {
  font-size: 13px;
  font-weight: 800;
  color: #38bdf8;
}

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

.companion-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.companion-message {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-primary);
}

.companion-analogy-box {
  background: rgba(56, 189, 248, 0.08);
  border-left: 3px solid #38bdf8;
  padding: 10px 12px;
  border-radius: 0 10px 10px 0;
  font-size: 12px;
  line-height: 1.4;
  color: #bae6fd;
}

.companion-analogy-title {
  font-weight: 700;
  margin-bottom: 3px;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 5px;
}

.companion-prompt {
  background: rgba(245, 158, 11, 0.1);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 11.5px;
  color: #fde68a;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* FLOATING OBJECT INSPECTOR (WHEN USER HOVERS/CLICKS 3D OBJECTS) */
#object-inspector {
  position: absolute;
  top: 80px;
  right: 20px;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 15;
}

#object-inspector.open {
  transform: translateX(0);
}

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

.inspector-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-yellow);
}

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

.inspector-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
}

.inspector-funfact {
  background: rgba(168, 85, 247, 0.1);
  border-left: 3px solid var(--accent-purple);
  padding: 8px 10px;
  border-radius: 0 8px 8px 0;
  font-size: 11.5px;
  color: #e9d5ff;
}

/* BASE PAIRING MINI GAME OVERLAY */
#base-pairing-game {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(16px);
  border-radius: 20px;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  z-index: 20;
}

.base-tiles-row {
  display: flex;
  gap: 12px;
}

.base-tile {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  cursor: grab;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.base-tile:active {
  cursor: grabbing;
  transform: scale(1.1);
}

.base-tile.base-A { background: var(--base-a); }
.base-tile.base-T { background: var(--base-t); }
.base-tile.base-C { background: var(--base-c); }
.base-tile.base-G { background: var(--base-g); }

.base-letter {
  font-size: 20px;
  line-height: 1;
}

.base-name {
  font-size: 8px;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========================================================
   THE SEQUENCING LAB BENCH (MODE 2)
   ======================================================== */
#lab-workbench {
  position: absolute;
  top: 70px;
  left: 20px;
  right: 20px;
  bottom: 20px;
  background: rgba(11, 19, 38, 0.92);
  border: 1px solid var(--border-card);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 25;
}

.lab-header {
  padding: 16px 24px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.station-stepper {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 30px;
  padding: 4px;
  border: 1px solid var(--border-card);
  gap: 4px;
  overflow-x: auto;
  max-width: 100%;
}

.station-step-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s;
}

.station-step-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.station-step-btn.active {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.5);
}

.station-step-btn.completed {
  color: var(--accent-cyan);
}

.station-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.station-step-btn.active .station-badge {
  background: #ffffff;
  color: #0f172a;
}

/* LAB STATION CONTENT CONTAINER */
.lab-main-area {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

.station-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 24px;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  gap: 20px;
}

.station-panel.active {
  display: flex;
}

/* STATION 1: EXTRACTION */
.extraction-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  flex: 1;
}

.lab-apparatus-view {
  background: rgba(7, 11, 22, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  overflow: hidden;
}

.test-tube-canvas {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.apparatus-overlay {
  position: absolute;
  bottom: 20px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-card);
  padding: 10px 18px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 10px;
}

.lab-instruction-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
}

.lab-step-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.lab-step-card:hover {
  border-color: var(--accent-cyan);
  background: rgba(15, 23, 42, 0.9);
}

.lab-step-card.active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
  background: rgba(30, 41, 59, 0.7);
}

.lab-step-card.done {
  border-color: #10b981;
  opacity: 0.85;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.lab-step-card.done .step-num {
  background: #10b981;
  color: #ffffff;
}

.step-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-bright);
}

.step-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
  padding-left: 34px;
}

/* BIG INTERACTIVE ACTION BUTTONS */
.action-btn-large {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  border: none;
  color: #ffffff;
  padding: 14px 24px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.action-btn-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(14, 165, 233, 0.6);
}

.action-btn-large:active {
  transform: translateY(0);
}

/* STATION 2: FRAGMENTATION */
.chopper-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.dna-strand-visualizer {
  width: 100%;
  max-width: 800px;
  height: 120px;
  background: rgba(7, 11, 22, 0.7);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 10px;
}

.fragments-collection {
  width: 100%;
  max-width: 800px;
  min-height: 180px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
}

.read-fragment-chip {
  padding: 8px 14px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* STATION 3: SEQUENCER FLOWCELL */
.sequencer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  flex: 1;
}

.flowcell-chamber {
  background: rgba(7, 11, 22, 0.8);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.flowcell-surface {
  flex: 1;
  background: #020617;
  border: 2px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  position: relative;
  min-height: 240px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.laser-beam {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #ffffff;
  box-shadow: 0 0 20px 8px rgba(56, 189, 248, 0.8);
  transition: left 0.1s linear;
}

.readout-terminal {
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #38bdf8;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.terminal-stream {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
}

.fastq-line {
  line-height: 1.4;
  word-break: break-all;
}

.fastq-header { color: #f59e0b; }
.fastq-seq { color: #10b981; font-weight: 700; }
.fastq-qual { color: #64748b; }

/* STATION 4: JIGSAW PUZZLE ASSEMBLY */
.assembly-puzzle-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.assembly-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 16px;
  padding: 10px 16px;
  border: 1px solid var(--border-card);
}

.coverage-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.coverage-pill {
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: all 0.2s;
}

.coverage-pill.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* PUZZLE SLOTS AND PIECES */
.assembly-board {
  background: rgba(7, 11, 22, 0.8);
  border: 2px solid var(--border-card);
  border-radius: 20px;
  padding: 24px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
}

.assembly-target-rail {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 70px;
  background: rgba(15, 23, 42, 0.7);
  border: 2px dashed rgba(56, 189, 248, 0.4);
  border-radius: 16px;
  padding: 10px 16px;
  overflow-x: auto;
}

.assembly-drop-slot {
  min-width: 140px;
  height: 52px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 11px;
  transition: all 0.2s;
}

.assembly-drop-slot.drag-over {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  transform: scale(1.02);
}

.assembly-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 16px;
}

.puzzle-read-card {
  padding: 10px 16px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid rgba(56, 189, 248, 0.4);
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ffffff;
  cursor: grab;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.puzzle-read-card:active {
  cursor: grabbing;
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.4);
}

.puzzle-read-card.snapped {
  border-color: #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), #0f172a);
}

.puzzle-read-card.wrong-shake {
  animation: shakeError 0.4s ease-in-out;
  border-color: #ef4444;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.letter-span {
  display: inline-block;
  padding: 2px 4px;
  border-radius: 4px;
}

.letter-span.A { color: #10b981; }
.letter-span.T { color: #ef4444; }
.letter-span.C { color: #06b6d4; }
.letter-span.G { color: #f59e0b; }

.overlap-highlight {
  background: rgba(253, 224, 71, 0.25);
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(253, 224, 71, 0.5);
}

/* STATION 5: GENE FINDING & PROTEIN TRANSLATION */
.gene-protein-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  flex: 1;
}

.translation-visualizer {
  background: rgba(7, 11, 22, 0.8);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 300px;
}

.protein-fold-canvas {
  width: 100%;
  height: 240px;
}

.ribosome-badge {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid var(--accent-purple);
  padding: 6px 14px;
  border-radius: 20px;
  color: #d8b4fe;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.trait-reveal-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trait-header {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-yellow);
}

/* STATION 6: MUTATION WORKBENCH */
.mutation-workbench-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.sequence-mutation-strip {
  background: rgba(7, 11, 22, 0.9);
  border: 2px solid var(--border-card);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

.mutable-base-btn {
  width: 44px;
  height: 54px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 18px;
  transition: all 0.15s;
}

.mutable-base-btn:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
}

.mutable-base-btn.selected {
  border-color: var(--accent-yellow);
  background: rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.6);
}

.codon-bracket {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 2px;
}

.mutation-outcome-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* CELEBRATION MODAL */
#celebration-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 11, 22, 0.85);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#celebration-overlay.show {
  display: flex;
}

.celebration-box {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 58, 138, 0.95));
  border: 2px solid var(--accent-cyan);
  border-radius: 28px;
  padding: 36px 40px;
  text-align: center;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(56, 189, 248, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  animation: zoomCelebration 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomCelebration {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.celebration-icon {
  font-size: 56px;
  animation: bounceTrophy 1.5s infinite;
}

@keyframes bounceTrophy {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* HELP / KEYS MODAL */
#help-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 11, 22, 0.85);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 90;
}

#help-modal.show {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 24px;
  padding: 28px;
  max-width: 520px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
}

.keys-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.key-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
}

/* RESPONSIVE QUERIES */
@media (max-width: 768px) {
  #top-bar {
    padding: 8px 12px;
  }
  .brand-text h1 {
    font-size: 15px;
  }
  .mode-btn {
    padding: 6px 12px;
    font-size: 11.5px;
  }
  #companion-card {
    max-width: 90%;
    left: 5%;
    top: auto;
    bottom: 120px;
  }
  .extraction-grid, .sequencer-grid, .gene-protein-container, .mutation-outcome-card {
    grid-template-columns: 1fr;
  }
  .scale-nodes {
    overflow-x: auto;
    gap: 12px;
  }
}
