/**
 * PiAndPython 10-Game Learning Suite CSS
 * Cyberpunk EdTech aesthetic: Neon glows, responsive layout, glassmorphism
 */

:root {
  --bg-primary: #0a0e17;
  --bg-surface: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --border-color: rgba(255, 255, 255, 0.12);
  --cyan: #00ffff;
  --green: #39ff14;
  --purple: #ff00ff;
  --yellow: #ffcc00;
  --red: #ff3366;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

body.standalone-game-suite {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-display);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body.standalone-game-suite * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.teacher-arcade-embedded-suite {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-display);
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  position: relative;
  margin-bottom: 24px;
}

.teacher-arcade-embedded-suite * {
  box-sizing: border-box;
}

/* Nav Header */
.suite-header {
  background: #0a0e17;
  border-bottom: 1px solid #1a2337;
  padding: 12px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  font-size: 24px;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.suite-header .nav-link {
  color: #94a3b8;
  background: #121826;
  border: 1px solid #1f293d;
  padding: 7px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}

.suite-header .nav-link:hover {
  color: #fff;
  border-color: #38bdf8;
  background: #182030;
}

.sound-toggle-btn {
  background: #121826;
  border: 1px solid #1f293d;
  border-radius: 8px;
  color: var(--text-main);
  font-size: 16px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.sound-toggle-btn:hover {
  border-color: #38bdf8;
}

/* Main Hub View */
.hub-view {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px;
  width: 100%;
}

.hub-hero {
  text-align: center;
  margin-bottom: 32px;
}

.hub-hero h1 {
  font-size: 34px;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -0.6px;
  background: linear-gradient(135deg, #ffffff 40%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hub-hero p {
  color: #94a3b8;
  font-size: 15px;
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Tier Selector Toolbar */
.tier-toolbar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

.tier-btn {
  background: #121826;
  border: 1px solid #1f293d;
  border-radius: 20px;
  color: #8b9bb4;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.tier-btn:hover {
  border-color: #3b82f6;
  color: #fff;
  background: #172033;
}

.tier-btn.active {
  background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.4);
}

/* Hub Filters and Mode */
.hub-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid #1a2337;
}

.filter-tabs {
  display: flex;
  gap: 8px;
}

.filter-tab {
  background: #121826;
  border: 1px solid #1f293d;
  color: #8b9bb4;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 16px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.filter-tab:hover {
  border-color: #38bdf8;
  color: #fff;
}

.filter-tab.active {
  background: #1a2436;
  border-color: #06b6d4;
  color: #06b6d4;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.mode-badge-btn {
  background: rgba(57, 255, 20, 0.1);
  border: 1px solid var(--green);
  color: var(--green);
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-badge-btn.challenge {
  background: rgba(255, 51, 102, 0.12);
  border-color: #ff3366;
  color: #ff3366;
  box-shadow: 0 0 12px rgba(255, 51, 102, 0.25);
}

/* Game Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.game-card {
  background: #0f1422;
  border: 1px solid #1e283d;
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: #3b82f6;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(59, 130, 246, 0.25);
}

.game-card.category-coding:hover {
  border-color: #a855f7;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(168, 85, 247, 0.25);
}

.card-icon {
  font-size: 38px;
  margin-bottom: 12px;
}

.card-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: 20px;
  background: #182030;
  color: #8b9bb4;
}

.category-math .card-badge {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #06b6d4;
}

.category-coding .card-badge {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #a855f7;
}

.card-title {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 4px;
  color: #fff;
  letter-spacing: -0.3px;
}

.card-tier-title {
  font-size: 12px;
  font-weight: 700;
  color: #eab308;
  margin-bottom: 10px;
}

.card-desc {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 16px;
  flex-grow: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.concept-tag {
  background: #151c2b;
  border: 1px solid #202b40;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.play-card-btn {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: 1px solid #3b82f6;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 11px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.play-card-btn:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
}

/* Stage & In-Game View */
.game-view {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px;
  width: 100%;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.stage-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f131d;
  border: 1px solid #1f2738;
  border-radius: 12px;
  padding: 12px 20px;
  margin: 0 auto 16px auto;
  width: 100%;
  max-width: 840px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hud-back-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.hud-back-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.hud-game-title {
  font-size: 18px;
  font-weight: 700;
}

.hud-grade-badge {
  background: rgba(255, 204, 0, 0.15);
  border: 1px solid var(--yellow);
  color: var(--yellow);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.hud-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.hud-stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.hud-stat-val {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
}

.hud-mult {
  color: var(--yellow);
}

.mult-boost {
  color: var(--green);
  text-shadow: 0 0 10px var(--green);
}

.pulse-urgent {
  color: var(--red);
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(1.1); opacity: 0.8; }
}

.game-stage-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 24px;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Buttons */
.game-btn {
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.primary-btn {
  background: linear-gradient(135deg, var(--cyan), #00aaff);
  color: #000;
}

.primary-btn:hover {
  box-shadow: 0 0 14px rgba(0, 255, 255, 0.4);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.secondary-btn:hover {
  border-color: var(--cyan);
}

/* GAME SPECIFIC STYLES */

/* Game 1: Mental Math Arcade */
.mental-math-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.fuse-container {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  margin-bottom: 24px;
  overflow: hidden;
}

.fuse-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--red));
  width: 100%;
  transition: width 0.05s linear;
}

.flashcard-card {
  background: rgba(17, 24, 39, 0.9);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 36px 48px;
  text-align: center;
  margin-bottom: 24px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.equation-display {
  font-family: var(--font-mono);
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.answer-preview {
  font-family: var(--font-mono);
  font-size: 32px;
  min-height: 48px;
  color: var(--cyan);
  border-bottom: 2px solid var(--cyan);
  width: 180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tactile-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.key-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  padding: 16px 0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.1s;
}

.key-btn:active {
  background: var(--cyan);
  color: #000;
  transform: scale(0.96);
}

.key-clear {
  color: var(--red);
}

.key-enter {
  background: rgba(57, 255, 20, 0.2);
  color: var(--green);
  border-color: var(--green);
}

/* Game 2: Grid Sprint */
.grid-sprint-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.sprint-canvas {
  background: #050811;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.lane-controls {
  display: flex;
  gap: 20px;
  margin-top: 16px;
}

.lane-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.lane-btn:hover {
  border-color: var(--cyan);
}

/* Game 3: Neon Cipher */
.cipher-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.cipher-vault {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
}

.vault-clues {
  margin-bottom: 20px;
}

.clue-badge {
  background: rgba(255, 204, 0, 0.15);
  border-left: 4px solid var(--yellow);
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 14px;
}

.cipher-dials {
  display: flex;
  gap: 16px;
  margin: 20px 0;
  justify-content: center;
}

.cipher-dial {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dial-display {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 800;
  color: var(--cyan);
  background: rgba(0,0,0,0.5);
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--cyan);
}

.dial-step-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
}

.cipher-history {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  overflow-y: auto;
  max-height: 440px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-family: var(--font-mono);
}

/* Game 4: Polyomino Architect */
.poly-container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
}

.cad-canvas {
  background: #080d1a;
  border: 1px solid var(--cyan);
  border-radius: 10px;
  box-shadow: inset 0 0 20px rgba(0, 255, 255, 0.05);
}

.poly-tray {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.piece-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}

.piece-pill.selected {
  border-color: var(--green);
  background: rgba(57, 255, 20, 0.1);
}

/* Game 5: Paradox Valley */
.paradox-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.paradox-narrative {
  background: rgba(0,0,0,0.3);
  border-left: 4px solid var(--purple);
  padding: 18px 24px;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.6;
}

.action-matrix {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.action-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.action-card:hover {
  border-color: var(--cyan);
  background: rgba(0, 255, 255, 0.08);
}

/* Coding Games (Arena, Hacker, Robo, Cyber, ML) */
.coding-game {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  width: 100%;
}

/* Algorithm Arena */
.grid-board {
  display: grid;
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.grid-cell {
  background: rgba(255, 255, 255, 0.05);
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.cell-wall {
  background: #374151;
  box-shadow: inset 0 0 6px #000;
}

.cell-gem::after {
  content: '💎';
}

.cell-base {
  border: 2px dashed var(--green);
  background: rgba(57, 255, 20, 0.1);
}

.cell-crash {
  background: rgba(255, 51, 102, 0.4);
}

.command-toolbox {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.cmd-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.cmd-pill:hover {
  border-color: var(--cyan);
}

.program-slot-tray {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  min-height: 180px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tray-item {
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
}

.tray-item.active-step {
  border-left: 4px solid var(--green);
  background: rgba(57, 255, 20, 0.15);
}

.remove-cmd {
  background: transparent;
  border: none;
  color: var(--red);
  font-size: 16px;
  cursor: pointer;
}

.arena-controls {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* Syntax Hacker */
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1f2937;
  padding: 10px 16px;
  border-radius: 10px 10px 0 0;
  border: 1px solid var(--border-color);
  border-bottom: none;
}

.term-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.term-dot.red { background: #ef4444; }
.term-dot.yellow { background: #f59e0b; }
.term-dot.green { background: #10b981; }

.term-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
}

.code-editor {
  background: #0d1117;
  border: 1px solid var(--border-color);
  border-radius: 0 0 10px 10px;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  min-height: 280px;
}

.code-line {
  display: flex;
  gap: 16px;
  padding: 4px 0;
}

.code-line.buggy-line {
  background: rgba(255, 51, 102, 0.15);
  border-left: 3px solid var(--red);
  padding-left: 8px;
}

.line-num {
  color: #4b5563;
  width: 24px;
}

.patch-bay {
  margin-top: 20px;
}

.patch-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  color: #fff;
  cursor: pointer;
  width: 100%;
  margin-bottom: 10px;
  text-align: left;
  transition: all 0.2s;
}

.patch-btn:hover {
  border-color: var(--cyan);
}

.patch-success {
  border-color: var(--green) !important;
  background: rgba(57, 255, 20, 0.15) !important;
}

.patch-fail {
  border-color: var(--red) !important;
  background: rgba(255, 51, 102, 0.15) !important;
}

/* Cyber Quest */
.packet-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
}

.packet-table th {
  background: rgba(255,255,255,0.06);
  padding: 8px 12px;
  text-align: left;
  color: var(--text-muted);
}

.packet-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.row-threat {
  background: rgba(255, 51, 102, 0.1);
}

.proto-tag {
  background: rgba(0, 255, 255, 0.1);
  color: var(--cyan);
  padding: 2px 6px;
  border-radius: 4px;
}

.threat-meter.danger {
  color: var(--red);
  font-weight: 700;
}

.cyber-filter-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  margin-bottom: 10px;
  text-align: left;
  transition: all 0.2s;
}

.cyber-filter-pill:hover {
  border-color: var(--cyan);
}

.firewall-status {
  padding: 12px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  margin-top: 16px;
}

.firewall-status.intercepted {
  background: rgba(57, 255, 20, 0.15);
  color: var(--green);
}

.firewall-status.breach {
  background: rgba(255, 51, 102, 0.15);
  color: var(--red);
}

/* Machine Learning Academy */
.slider-group {
  margin-bottom: 14px;
}

.slider-group label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.slider-group input[type=range] {
  width: 100%;
}

.matrix-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0;
  font-family: var(--font-mono);
}

.matrix-cell {
  background: rgba(255,255,255,0.05);
  padding: 8px;
  border-radius: 6px;
  text-align: center;
}

/* ==========================================================================
   MODALS (Session Summary & Accessibility Settings)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: modalOverlayFadeIn 0.25s ease-out;
}

@keyframes modalOverlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-card {
  background: linear-gradient(180deg, #0f172a 0%, #090e1a 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 50px rgba(56, 189, 248, 0.18), 0 25px 50px -12px rgba(0, 0, 0, 0.85);
  border-radius: 20px;
  padding: 32px 28px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  color: #e2e8f0;
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Challenge Complete Summary Card */
.summary-card {
  position: relative;
  overflow: hidden;
}

.summary-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #f59e0b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 12px;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.2);
}

.modal-card h2 {
  font-size: 24px;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 6px 0;
  letter-spacing: -0.5px;
}

.summary-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 20px 0;
  line-height: 1.4;
}

.summary-stats-grid,
.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0 0 24px 0;
}

.sum-stat,
.modal-stat-box {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sum-stat:hover,
.modal-stat-box:hover {
  border-color: #38bdf8;
  background: #24324a;
  transform: translateY(-2px);
}

.sum-val,
.modal-stat-box .val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 26px;
  font-weight: 900;
  color: #38bdf8;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
  line-height: 1.1;
}

.sum-lbl,
.modal-stat-box .lbl {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  width: 100%;
}

.modal-btn {
  flex: 1;
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.modal-btn.primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
}

.modal-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.6);
}

.modal-btn.secondary {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
}

.modal-btn.secondary:hover {
  background: #334155;
  color: #ffffff;
  border-color: #64748b;
  transform: translateY(-2px);
}

/* Accessibility Settings Modal */
.a11y-modal-card {
  max-width: 460px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #1e293b;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
}

.modal-close-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  transition: all 0.15s;
}

.modal-close-btn:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.a11y-options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.a11y-option-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.a11y-option-row:hover {
  border-color: #38bdf8;
  background: #24324a;
}

.a11y-opt-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.a11y-opt-label strong {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.a11y-opt-label small {
  font-size: 11px;
  color: #94a3b8;
}

.a11y-checkbox {
  width: 20px;
  height: 20px;
  accent-color: #10b981;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

@media (max-width: 800px) {
  .coding-game, .cipher-container, .poly-container {
    grid-template-columns: 1fr;
  }
}

/* --- MATH ARCADE STYLING REFINEMENTS --- */

/* Hide inner duplicate HUD if main stage HUD exists */
.arcade-hud, .sprint-hud, .cipher-hud, .arch-hud, .paradox-hud {
  display: none !important;
}

/* Game 1: Mental Math Arcade */
.arcade-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.arcade-arena {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.billboard-frame {
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 28px 36px;
  text-align: center;
  width: 100%;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.billboard-concept-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--yellow);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.billboard-equation {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
}

.fuse-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.fuse-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--red));
  width: 100%;
  transition: width 0.05s linear;
}

.input-display-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 24px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 380px;
}

.input-prompt {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.input-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
  color: var(--cyan);
  min-width: 80px;
  text-align: center;
}

.arcade-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 380px;
}

.arc-key {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  padding: 14px 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.1s;
}

.arc-key:hover {
  background: rgba(0, 255, 255, 0.15);
  border-color: var(--cyan);
}

.arc-key.key-act { color: var(--yellow); }
.arc-key.key-clear { color: var(--red); }
.arc-key.key-enter {
  background: rgba(57, 255, 20, 0.2);
  color: var(--green);
  border-color: var(--green);
}

/* Game 2: Grid Sprint */
.sprint-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.sprint-canvas-frame {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--cyan);
  box-shadow: 0 0 24px rgba(0, 255, 255, 0.15);
  background: #050811;
  max-width: 100%;
}

#sprint-canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.sprint-controls-overlay {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.spr-lane-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.spr-lane-btn:hover {
  border-color: var(--cyan);
  background: rgba(0, 255, 255, 0.2);
}

/* Game 3: Neon Cipher */
.cipher-terminal-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
}

.cipher-log-panel, .cipher-rules-panel {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
}

.panel-header {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--cyan);
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.terminal-log-stream {
  min-height: 240px;
  max-height: 320px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.cipher-slots {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  justify-content: center;
}

.cip-slot {
  width: 44px;
  height: 52px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid var(--cyan);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 800;
  color: #fff;
}

.cipher-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 260px;
  margin: 0 auto;
}

.cip-k {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  padding: 10px 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
}

.cip-enter {
  background: rgba(57, 255, 20, 0.2);
  border-color: var(--green);
  color: var(--green);
  font-size: 13px;
}

/* Game 4: Polyomino Architect */
.arch-workspace {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  width: 100%;
}

.arch-palette, .arch-blueprint {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
}

.palette-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.tool-btn.danger { color: var(--red); }

.shape-token-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.blueprint-meters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.meter-chip {
  background: rgba(0, 255, 255, 0.1);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
}

.submit-blueprint-btn {
  background: linear-gradient(135deg, var(--green), #00ffaa);
  border: none;
  color: #000;
  font-weight: 800;
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}

.cad-grid-frame {
  display: flex;
  justify-content: center;
  background: #080d1a;
  border: 1px solid var(--cyan);
  border-radius: 10px;
  padding: 10px;
}

#cad-canvas {
  max-width: 100%;
  height: auto;
}

/* Game 5: Paradox Valley */
.paradox-card-stage {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.parchment-card {
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid var(--purple);
  box-shadow: 0 0 24px rgba(255, 0, 255, 0.15);
  border-radius: 14px;
  padding: 28px;
}

.parchment-header {
  margin-bottom: 18px;
}

.dossier-stamp {
  background: rgba(255, 0, 255, 0.15);
  color: var(--purple);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 6px;
}

.case-headline {
  font-size: 22px;
  font-weight: 800;
  margin-top: 10px;
  color: #fff;
}

.case-narrative {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-main);
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.25);
  padding: 16px;
  border-radius: 8px;
}

.variable-pills-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.var-pill {
  background: rgba(255, 204, 0, 0.12);
  border: 1px solid var(--yellow);
  color: var(--yellow);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: help;
}

.dialogue-choice-matrix {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.dialogue-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 14px 18px;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.dialogue-card:hover {
  border-color: var(--cyan);
  background: rgba(0, 255, 255, 0.1);
}

/* ==========================================================================
   PIXEL-ACCURATE CUSTOM GAME SHELLS (MATCHING USER SCREENSHOTS)
   ========================================================================== */

.custom-game-shell {
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: #0f131d;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  border: 1px solid #1f2738;
  border-radius: 14px;
  padding: 20px 24px;
  color: #f3f4f6;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* Shared Top HUD */
.cg-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #151b28;
  border: 1px solid #232d42;
  border-radius: 10px;
  padding: 12px 20px;
  margin-bottom: 20px;
}

.cg-hud-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cg-hud-lbl {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #8b9bb4;
}

.cg-hud-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.cg-hud-val.val-gold {
  color: #ffcc00;
}

.timer-col {
  min-width: 120px;
}

.cg-timer-track {
  width: 100%;
  height: 8px;
  background: #232d42;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.cg-timer-fill {
  height: 100%;
  width: 100%;
  background: #2563eb;
  transition: width 0.05s linear;
}

.cg-pause-btn {
  background: #232d42;
  border: 1px solid #334155;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}

.cg-pause-btn:hover {
  border-color: var(--cyan);
  background: #2d3b55;
}

/* Shared Main Question Card */
.cg-main-card {
  background: #0d111a;
  border: 2px solid #1e2638;
  border-radius: 14px;
  padding: 44px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.4);
}

.mma-question-text {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 800;
  color: #22c55e;
  letter-spacing: 3px;
}

/* Shared Mid Stats Row */
.cg-stats-row {
  display: flex;
  justify-content: space-around;
  border-top: 1px solid #1f2738;
  border-bottom: 1px solid #1f2738;
  padding: 16px 0;
  margin-bottom: 24px;
}

.cg-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.cg-stat-lbl {
  font-size: 13px;
  color: #8b9bb4;
  font-weight: 600;
}

.cg-stat-val {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 800;
  color: #fff;
}

/* Mental Math Input Deck */
.mma-input-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.mma-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #8b9bb4;
}

.mma-options-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.mma-opt-btn {
  background: #182030;
  border: 1px solid #28354d;
  color: #f3f4f6;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  padding: 16px 0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.mma-opt-btn:hover {
  background: #232f47;
  border-color: #3b82f6;
}

.mma-opt-btn.correct {
  background: rgba(34, 197, 94, 0.25) !important;
  border-color: #22c55e !important;
  color: #22c55e !important;
}

.mma-opt-btn.wrong {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  color: #ef4444 !important;
}

/* Shared Bottom Bar: Difficulty & Reset */
.cg-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
}

.cg-diff-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cg-diff-lbl {
  font-size: 13px;
  font-weight: 600;
  color: #8b9bb4;
}

.cg-diff-pills {
  display: flex;
  background: #151b28;
  border: 1px solid #232d42;
  border-radius: 24px;
  padding: 3px;
  gap: 4px;
}

.cg-pill {
  background: transparent;
  border: none;
  color: #8b9bb4;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
}

.cg-pill.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.cg-reset-btn {
  background: #182030;
  border: 1px solid #28354d;
  color: #f3f4f6;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.15s;
}

.cg-reset-btn:hover {
  background: #232f47;
  border-color: var(--cyan);
}

/* ==========================================================================
   GRID SPRINT (MATCHING IMAGE 3)
   ========================================================================== */

.gs-header-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 24px;
}

.gs-prompt-pill {
  background: #2563eb;
  color: #fff;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  padding: 8px 28px;
  border-radius: 20px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.gs-pause-btn {
  position: absolute;
  right: 0;
  top: 0;
}

.gs-track-container {
  display: flex;
  flex-direction: column;
  background: #111622;
  border: 1px solid #1f2738;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  min-height: 270px;
  margin-bottom: 20px;
}

.gs-lane {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
  border-bottom: 1px dashed #232d42;
  padding: 0 40px;
  cursor: pointer;
  transition: background 0.1s;
}

.gs-lane:last-child {
  border-bottom: none;
}

.gs-lane:hover {
  background: rgba(255, 255, 255, 0.02);
}

.gs-player-disc {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #60a5fa;
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 50px;
  z-index: 10;
  transform: translateY(-50%);
  transition: top 0.15s ease-out;
}

.gs-star {
  color: #fff;
  font-size: 20px;
}

.gs-gate-card {
  position: absolute;
  right: 10%;
  background: #1a2233;
  border: 1px solid #2d3b55;
  color: #fff;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  min-width: 64px;
  height: 52px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.gs-feedback-pill {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: 800;
  padding: 8px 24px;
  border-radius: 20px;
  display: none;
  z-index: 20;
}

.gs-feedback-pill.show {
  display: block;
}

.gs-feedback-pill.good {
  background: #22c55e;
  color: #000;
}

.gs-feedback-pill.bad {
  background: #ef4444;
  color: #fff;
}

.gs-player-disc.gs-pulse {
  transform: translateY(-50%) scale(1.22);
  box-shadow: 0 0 24px rgba(96, 165, 250, 0.95);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.gs-start-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  border-radius: 12px;
}

.gs-start-card {
  background: #151d30;
  border: 1px solid #2d3b55;
  border-radius: 14px;
  padding: 24px 32px;
  text-align: center;
  max-width: 380px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.gs-start-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.gs-start-sub {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 20px;
  line-height: 1.5;
}

.gs-start-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  padding: 10px 24px;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}

.gs-start-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.gs-metrics-bar {
  display: flex;
  justify-content: space-around;
  margin-bottom: 16px;
  padding: 0 20px;
}

.gs-metric-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.gs-metric-lbl {
  font-size: 13px;
  font-weight: 600;
  color: #8b9bb4;
}

.gs-metric-val {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: #fff;
}

.gs-metric-val.val-gold {
  color: #ffcc00;
}

.gs-instruction-text {
  text-align: center;
  font-size: 13px;
  color: #8b9bb4;
  margin-bottom: 20px;
}

.gs-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 4px;
}

/* ==========================================================================
   NEON CIPHER (MATCHING IMAGE 4)
   ========================================================================== */

.nc-top-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 20px;
}

.nc-active-badge {
  border: 2px solid #06b6d4;
  background: rgba(6, 182, 212, 0.1);
  color: #06b6d4;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  padding: 8px 24px;
  border-radius: 8px;
  letter-spacing: 1px;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.3);
}

.nc-pause-btn {
  position: absolute;
  right: 0;
  top: 0;
}

.nc-matrix-card {
  background: #111622;
  border: 1px solid #1f2738;
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 14px;
}

.nc-row {
  display: grid;
  grid-template-columns: 40px 140px 1fr 1fr 100px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #1a2233;
  font-family: var(--font-mono);
  font-size: 14px;
}

.nc-row:last-child {
  border-bottom: none;
}

.nc-row.row-active {
  background: rgba(6, 182, 212, 0.08);
  border-radius: 6px;
}

.nc-row-id {
  color: #06b6d4;
  font-weight: 800;
}

.nc-row-digits {
  color: #06b6d4;
  font-weight: 700;
  letter-spacing: 4px;
}

.nc-row-pos, .nc-row-num {
  color: #8b9bb4;
}

.nc-row-sum {
  color: #8b9bb4;
  text-align: right;
}

.nc-sys-prompt {
  background: #151b28;
  border: 1px solid #232d42;
  border-radius: 6px;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #8b9bb4;
  margin-bottom: 16px;
  display: inline-block;
}

.nc-metrics-bar {
  display: flex;
  justify-content: space-around;
  border-top: 1px solid #1f2738;
  border-bottom: 1px solid #1f2738;
  padding: 14px 0;
  margin-bottom: 20px;
}

.nc-metric-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.nc-met-lbl {
  font-size: 11px;
  font-weight: 700;
  color: #8b9bb4;
}

.nc-met-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.nc-blueprints-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.nc-bp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nc-bp-title {
  font-size: 13px;
  font-weight: 600;
  color: #8b9bb4;
}

.nc-gen-rand-btn {
  background: transparent;
  border: none;
  color: #3b82f6;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.nc-gen-rand-btn:hover {
  text-decoration: underline;
}

.nc-bp-pills {
  display: flex;
  gap: 12px;
}

.nc-bp-pill {
  background: #182030;
  border: 1px solid #28354d;
  color: #8b9bb4;
  padding: 8px 24px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.nc-bp-pill.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.nc-input-tray {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: #111622;
  border: 1px solid #1f2738;
  border-radius: 12px;
  padding: 16px;
}

.nc-current-digits {
  display: flex;
  gap: 12px;
}

.nc-digit-slot {
  width: 44px;
  height: 48px;
  background: #182030;
  border: 2px solid #06b6d4;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.nc-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 260px;
}

.nc-key {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  padding: 10px 0;
  background: #182030;
  border: 1px solid #28354d;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
}

.nc-key:hover {
  background: #232f47;
  border-color: #06b6d4;
}

.nc-key.key-clear { color: #ef4444; }
.nc-key.key-submit {
  background: rgba(34, 197, 94, 0.2);
  border-color: #22c55e;
  color: #22c55e;
  font-size: 13px;
}

/* ==========================================================================
   POLYOMINO ARCHITECT (MATCHING IMAGE 5)
   ========================================================================== */

.pa-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: #151b28;
  border: 1px solid #232d42;
  border-radius: 10px;
  padding: 14px 24px;
  margin-bottom: 20px;
  position: relative;
}

.pa-stat-pct {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

.pa-stat-count {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

.pa-stat-status {
  font-size: 16px;
  font-weight: 800;
}

.pa-stat-status.val-gold {
  color: #ffcc00;
}

.pa-stat-status.val-green {
  color: #22c55e;
}

.pa-pause-btn {
  position: absolute;
  right: 14px;
}

.pa-main-card {
  background: #0d111a;
  border: 2px solid #1e2638;
  border-radius: 16px;
  padding: 24px 20px 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.4);
  width: 100%;
  box-sizing: border-box;
}

.pa-blueprint-title-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 540px;
  margin-bottom: 22px;
  padding: 14px 22px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid #1e293b;
  border-radius: 12px;
  box-sizing: border-box;
  gap: 6px;
}

.pa-bp-header-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #38bdf8;
  font-size: 14px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.8px;
}

.pa-bp-icon {
  font-size: 16px;
}

.pa-bp-title {
  color: #f1f5f9;
}

.pa-bp-desc {
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  font-family: var(--font-display);
}

@media (max-width: 600px) {
  .pa-blueprint-title-bar {
    padding: 10px 14px;
  }
  .pa-bp-desc {
    font-size: 12px;
  }
}

.pa-grid-box {
  display: grid;
  grid-template-columns: repeat(4, 60px);
  grid-template-rows: repeat(4, 60px);
  gap: 8px;
  justify-content: center;
  align-content: center;
  margin: 0 auto;
}

.pa-grid-cell {
  width: 60px;
  height: 60px;
  background: #131926;
  border: 1.5px dashed #2563eb;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.pa-grid-cell:hover {
  background: rgba(37, 99, 235, 0.15);
}

.cell-dot {
  color: #3b82f6;
  font-size: 24px;
  line-height: 0;
}

.pa-grid-cell.cell-filled {
  border-style: solid;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

.pa-modules-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pa-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pa-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.pa-tools {
  display: flex;
  gap: 8px;
}

.pa-tool-btn {
  background: #182030;
  border: 1px solid #28354d;
  color: #f3f4f6;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.pa-tool-btn:hover {
  border-color: var(--cyan);
}

.pa-tool-btn.danger {
  color: #ef4444;
}

.pa-modules-dock {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.pa-mod-card {
  background: #182030;
  border: 1px solid #28354d;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.pa-mod-card:hover {
  border-color: #3b82f6;
  background: #202b40;
}

.pa-mod-card.active {
  border-color: #3b82f6;
  background: #232f47;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.3);
}

.pa-icon-preview {
  display: grid;
  gap: 3px;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
}

.icon-square {
  grid-template-columns: repeat(2, 8px);
}

.icon-beam {
  grid-template-columns: 8px;
}

.icon-lcol {
  grid-template-columns: repeat(2, 8px);
}

.icon-ttruss {
  grid-template-columns: repeat(3, 6px);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  display: inline-block;
}

.dot.y { background: #eab308; }
.dot.c { background: #14b8a6; }
.dot.o { background: #f97316; }
.dot.p { background: #a855f7; }

.pa-mod-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pa-mod-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.pa-mod-status {
  font-size: 11px;
  color: #8b9bb4;
}

/* ==========================================================================
   NEON CIPHER CRITERIA CHECKLIST
   ========================================================================== */
.nc-criteria-card {
  background: #111622;
  border: 1px solid #1f2738;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.nc-crit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.nc-crit-title {
  color: #06b6d4;
}

.nc-crit-status {
  font-family: var(--font-mono);
  color: #8b9bb4;
  font-size: 11px;
}

.nc-crit-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.nc-crit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #161d2b;
  border: 1px solid #232d42;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  transition: all 0.2s;
}

.nc-crit-bullet {
  font-family: var(--font-mono);
  color: #06b6d4;
  font-weight: 700;
  font-size: 11px;
}

.nc-crit-text {
  flex: 1;
  color: #e2e8f0;
}

.nc-crit-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.nc-crit-item.crit-pending .nc-crit-badge {
  background: rgba(139, 155, 180, 0.15);
  color: #8b9bb4;
}

.nc-crit-item.crit-pass {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.08);
}

.nc-crit-item.crit-pass .nc-crit-badge {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.nc-crit-item.crit-fail {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.08);
}

.nc-crit-item.crit-fail .nc-crit-badge {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* ==========================================================================
   GAME 5: PARADOX VALLEY (.pv-shell)
   ========================================================================== */
.pv-dossier-card {
  background: #0d111a;
  border: 2px solid #1e2638;
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.4);
}

.pv-dossier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.pv-stamp {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 4px 10px;
  border-radius: 4px;
}

.pv-concept-badge {
  font-size: 12px;
  font-weight: 700;
  color: #eab308;
  background: rgba(234, 179, 8, 0.12);
  padding: 3px 10px;
  border-radius: 12px;
}

.pv-case-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.pv-narrative-text {
  font-size: 15px;
  line-height: 1.65;
  color: #cbd5e1;
  margin-bottom: 20px;
  background: #131926;
  border: 1px solid #1f2738;
  border-radius: 8px;
  padding: 16px 18px;
}

.pv-narrative-text b {
  color: #38bdf8;
  font-weight: 700;
}

.pv-pills-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pv-pills-lbl {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #8b9bb4;
}

.pv-pills-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pv-var-pill {
  background: #182030;
  border: 1px solid #28354d;
  color: #f3f4f6;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pv-var-pill:hover {
  border-color: #3b82f6;
  background: #202b40;
}

.pv-choices-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.pv-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #8b9bb4;
}

.pv-choices-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.pv-choice-card {
  background: #151b28;
  border: 1px solid #232d42;
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.pv-choice-card:hover {
  border-color: #06b6d4;
  background: #1c2436;
  transform: translateY(-2px);
}

.pv-choice-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1f293d;
  color: #06b6d4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.pv-choice-text {
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
}

.pv-choice-card.choice-pass {
  border-color: #22c55e !important;
  background: rgba(34, 197, 94, 0.15) !important;
}

.pv-choice-card.choice-fail {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.15) !important;
}

.pv-rank-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pv-rank-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #ffcc00;
  background: rgba(255, 204, 0, 0.12);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 204, 0, 0.3);
}

/* ==========================================================================
   GAME 6: ALGORITHM ARENA (.aa-shell)
   ========================================================================== */
.aa-workspace {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.aa-grid-card, .aa-deck-card {
  background: #0d111a;
  border: 1px solid #1e2638;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.aa-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #1a2233;
}

.aa-card-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #fff;
}

.aa-grid-legend {
  font-size: 11px;
  color: #8b9bb4;
}

.aa-card-sub, .aa-deck-tip {
  font-size: 11px;
  color: #8b9bb4;
}

.aa-board-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  flex-grow: 1;
}

.aa-grid-board {
  display: grid;
  gap: 6px;
  background: #111622;
  border: 2px solid #1f2738;
  border-radius: 10px;
  padding: 10px;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1 / 1;
}

.aa-grid-cell {
  background: #161d2b;
  border: 1px solid #232d42;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 18px;
  transition: all 0.15s;
}

.aa-grid-cell.cell-wall {
  background: #27161b;
  border-color: #ef4444;
}

.aa-grid-cell.cell-gem {
  background: #11282c;
  border-color: #06b6d4;
}

.aa-grid-cell.cell-base {
  background: #12281e;
  border-color: #22c55e;
}

.aa-grid-cell.cell-crash {
  background: rgba(239, 68, 68, 0.4) !important;
  animation: shake 0.3s ease;
}

.aa-rover-token {
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.aa-dir-arrow {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 12px;
}

.aa-toolbox {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.aa-cmd-pill {
  background: #182030;
  border: 1px solid #28354d;
  color: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.aa-cmd-pill:hover {
  border-color: #3b82f6;
  background: #222d42;
}

.aa-program-tray-card {
  background: #111622;
  border: 1px solid #1f2738;
  border-radius: 8px;
  padding: 10px;
  flex-grow: 1;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
}

.aa-tray-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #8b9bb4;
  margin-bottom: 8px;
}

.aa-program-slot-tray {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.aa-empty-tray-tip {
  color: #64748b;
  font-size: 12px;
  text-align: center;
  margin: auto 0;
  padding: 20px 0;
}

.aa-tray-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #182030;
  border: 1px solid #28354d;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  transition: all 0.15s;
}

.aa-tray-item.active-step {
  border-color: #06b6d4;
  background: rgba(6, 182, 212, 0.2);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.aa-step-num {
  font-family: var(--font-mono);
  color: #06b6d4;
  font-weight: 700;
}

.aa-step-lbl {
  color: #f1f5f9;
  font-weight: 600;
  flex: 1;
  margin-left: 8px;
}

.aa-remove-cmd {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
}

.aa-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 8px;
}

.aa-action-btn {
  border-radius: 8px;
  padding: 10px 0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.aa-action-btn.secondary {
  background: #182030;
  border: 1px solid #28354d;
  color: #fff;
}

.aa-action-btn.secondary:hover {
  border-color: #3b82f6;
}

.aa-action-btn.danger:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.aa-action-btn.primary {
  background: linear-gradient(135deg, #10b981, #059669);
  border: 1px solid #34d399;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.aa-action-btn.primary:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
}

/* ==========================================================================
   GAME 7: SYNTAX HACKER (.sh-shell)
   ========================================================================== */
.sh-workspace {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.sh-editor-card {
  background: #0b0f19;
  border: 1px solid #1e2638;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sh-window-bar {
  background: #131926;
  border-bottom: 1px solid #1e2638;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sh-window-dots {
  display: flex;
  gap: 6px;
}

.sh-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.sh-dot.red { background: #ef4444; }
.sh-dot.yellow { background: #eab308; }
.sh-dot.green { background: #22c55e; }

.sh-window-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #8b9bb4;
  font-weight: 600;
}

.sh-code-content {
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.sh-code-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}

.sh-line-num {
  color: #475569;
  font-weight: 700;
  user-select: none;
  min-width: 24px;
}

.sh-line-text {
  color: #e2e8f0;
  flex: 1;
}

.sh-buggy-line {
  background: rgba(239, 68, 68, 0.12);
  border-left: 3px solid #ef4444;
}

.sh-bug-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.sh-bug-badge.pass {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.4);
}

.sh-patched-line {
  background: rgba(34, 197, 94, 0.12);
  border-left: 3px solid #22c55e;
}

.sh-diagnostics-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sh-trace-box {
  background: #141018;
  border: 1px solid #3b1d28;
  border-radius: 10px;
  padding: 12px 14px;
}

.sh-trace-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.sh-trace-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #f87171;
  letter-spacing: 0.5px;
}

.sh-trace-content {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #fca5a5;
  line-height: 1.5;
}

.sh-patch-bay {
  background: #0d111a;
  border: 1px solid #1e2638;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
}

.sh-patch-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #8b9bb4;
}

.sh-patch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sh-patch-btn {
  background: #151b28;
  border: 1px solid #232d42;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.sh-patch-btn:hover {
  border-color: #06b6d4;
  background: #1c2436;
}

.sh-patch-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}

.sh-patch-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #f1f5f9;
}

.sh-patch-btn.patch-pass {
  border-color: #22c55e !important;
  background: rgba(34, 197, 94, 0.15) !important;
}

.sh-patch-btn.patch-fail {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.15) !important;
}

/* ==========================================================================
   GAME 8: ROBO-ARCHITECT (.ra-shell)
   ========================================================================== */
.ra-workspace {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.ra-canvas-card, .ra-deck-card {
  background: #0d111a;
  border: 1px solid #1e2638;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.ra-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ra-card-title {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.6px;
}

.ra-match-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.ra-canvas-box {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #090c14;
  border: 1px solid #1a2233;
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 10px;
}

#roboCanvas {
  max-width: 100%;
  height: auto;
}

.ra-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 11px;
  color: #8b9bb4;
}

.ra-leg-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ra-leg-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.ra-leg-dot.ghost {
  border: 1.5px dashed #06b6d4;
  background: rgba(6, 182, 212, 0.2);
}

.ra-leg-dot.solid {
  background: #3b82f6;
}

.ra-deck-tip {
  font-size: 11px;
  color: #8b9bb4;
}

.ra-toolbox {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.ra-cmd-pill {
  background: #182030;
  border: 1px solid #28354d;
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.ra-cmd-pill:hover {
  border-color: #3b82f6;
  background: #202b40;
}

.ra-cmd-pill.danger:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.ra-code-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  margin-bottom: 14px;
}

.ra-code-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #8b9bb4;
}

.ra-code-editor {
  background: #090c14;
  border: 1px solid #1f2738;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: #38bdf8;
  resize: vertical;
  outline: none;
}

.ra-code-editor:focus {
  border-color: #06b6d4;
}

.ra-extrude-btn {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  border: 1px solid #38bdf8;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.4);
}

.ra-extrude-btn:hover {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
}

/* ==========================================================================
   GAME 9: CYBER QUEST (.cq-shell)
   ========================================================================== */
.cq-workspace {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.cq-table-card, .cq-query-card {
  background: #0d111a;
  border: 1px solid #1e2638;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.cq-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #1a2233;
}

.cq-card-title {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.6px;
}

.cq-card-meta, .cq-query-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #06b6d4;
}

.cq-table-box {
  overflow-x: auto;
  flex-grow: 1;
}

.cq-packet-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
}

.cq-packet-table th {
  text-align: left;
  padding: 8px 10px;
  color: #8b9bb4;
  font-size: 11px;
  font-weight: 700;
  border-bottom: 1px solid #1f2738;
}

.cq-packet-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #161e2e;
  color: #cbd5e1;
}

.cq-row-threat {
  background: rgba(239, 68, 68, 0.08);
}

.cq-pkt-id {
  color: #38bdf8;
  font-weight: 700;
}

.cq-proto-tag {
  background: #182030;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  color: #fff;
}

.cq-port-num {
  color: #94a3b8;
}

.cq-threat-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cq-threat-bar {
  width: 60px;
  height: 6px;
  background: #1f2738;
  border-radius: 3px;
  overflow: hidden;
}

.cq-threat-fill {
  height: 100%;
}

.cq-threat-num {
  font-weight: 800;
  font-size: 11px;
}

.cq-status-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-crit {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-susp {
  background: rgba(234, 179, 8, 0.2);
  color: #eab308;
}

.badge-norm {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.cq-directive-box {
  background: #131926;
  border: 1px solid #1f2738;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.cq-dir-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #06b6d4;
  margin-bottom: 4px;
}

.cq-dir-text {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.5;
}

.cq-filter-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cq-query-pill {
  background: #151b28;
  border: 1px solid #232d42;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.cq-query-pill:hover {
  border-color: #3b82f6;
  background: #1c2436;
}

.cq-query-num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}

.cq-query-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #f1f5f9;
}

.cq-query-pill.query-pass {
  border-color: #22c55e !important;
  background: rgba(34, 197, 94, 0.15) !important;
}

.cq-query-pill.query-fail {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.15) !important;
}

/* ==========================================================================
   GAME 10: MACHINE LEARNING ACADEMY (.ml-shell)
   ========================================================================== */
.ml-workspace {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.ml-plot-card, .ml-deck-card {
  background: #0d111a;
  border: 1px solid #1e2638;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.ml-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ml-card-title {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.6px;
}

.ml-epoch-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
}

.ml-deck-tip {
  font-size: 11px;
  color: #8b9bb4;
}

.ml-canvas-box {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #090c14;
  border: 1px solid #1a2233;
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 10px;
}

#mlCanvas {
  max-width: 100%;
  height: auto;
}

.ml-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 11px;
  color: #8b9bb4;
}

.ml-leg-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ml-leg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ml-leg-dot.safe { background: #22c55e; }
.ml-leg-dot.threat { background: #ef4444; }
.ml-leg-line.boundary {
  width: 14px;
  height: 3px;
  background: #00ffff;
  box-shadow: 0 0 6px #00ffff;
}

.ml-sliders-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.ml-slider-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ml-slider-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.ml-param-name {
  color: #8b9bb4;
  font-weight: 600;
}

.ml-param-val {
  font-family: var(--font-mono);
  font-weight: 800;
  color: #06b6d4;
}

.ml-range {
  width: 100%;
  accent-color: #06b6d4;
  cursor: pointer;
}

.ml-matrix-card {
  background: #111622;
  border: 1px solid #1f2738;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.ml-matrix-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #8b9bb4;
  margin-bottom: 8px;
}

.ml-matrix-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.ml-m-cell {
  background: #161d2b;
  border: 1px solid #232d42;
  border-radius: 6px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ml-m-cell.pass {
  border-left: 3px solid #22c55e;
}

.ml-m-cell.fail {
  border-left: 3px solid #ef4444;
}

.ml-m-lbl {
  font-size: 9px;
  font-weight: 700;
  color: #8b9bb4;
}

.ml-m-val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.ml-deploy-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  border: 1px solid #34d399;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.3);
}

.ml-deploy-btn:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
}

/* Supplemental Polishing Rules for Games Suite Upgrades */
.cell-obstacle {
  background: #1e293b !important;
  border: 1.5px solid #475569 !important;
  border-radius: 8px;
  cursor: not-allowed !important;
}

.ra-action-bar {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.ra-next-btn {
  background: linear-gradient(135deg, #06b6d4, #0891b2) !important;
  border: 1px solid #38bdf8 !important;
  color: #0f172a !important;
  font-weight: 800 !important;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ra-next-btn:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

.ml-action-btn {
  transition: all 0.15s ease;
}

.ml-action-btn:hover {
  filter: brightness(1.2);
  transform: translateY(-1px);
}

/* ==========================================================================
   STUDENT PROFILE PILL & ACCESSIBILITY CONTROLS
   ========================================================================== */
.student-profile-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 24, 38, 0.9);
  border: 1px solid #23304a;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: #cbd5e1;
}

.student-avatar { font-size: 14px; }
.student-name { font-weight: 700; color: #fff; }
.student-xp-tag {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.4);
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 800;
}

.a11y-toggle-btn {
  background: #121826;
  border: 1px solid #1f293d;
  border-radius: 8px;
  color: var(--text-main);
  font-size: 15px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.a11y-toggle-btn:hover { border-color: #38bdf8; }

/* A11y Modal */
.a11y-modal-card {
  max-width: 420px;
  background: #0f1422;
  border: 2px solid #23304a;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
}

.a11y-options-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.a11y-option-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #151b2a;
  border: 1px solid #232d42;
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.a11y-opt-label { display: flex; flex-direction: column; gap: 2px; }
.a11y-opt-label strong { font-size: 13px; color: #fff; }
.a11y-opt-label small { font-size: 11px; color: #8b9bb4; }
.a11y-checkbox { width: 18px; height: 18px; accent-color: #06b6d4; cursor: pointer; }

/* Focus Indicators */
:focus-visible {
  outline: 2px solid #06b6d4 !important;
  outline-offset: 2px !important;
}

/* Accessibility Modifiers */
body.high-contrast {
  --bg-primary: #000000;
  --bg-surface: #0a0a0a;
  --text-main: #ffffff;
  --border-color: #ffffff;
}
body.high-contrast .custom-game-shell,
body.high-contrast .game-card,
body.high-contrast .cg-hud {
  border: 2px solid #ffffff !important;
  background: #000000 !important;
}

body.reduced-motion * {
  animation: none !important;
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

body.large-text {
  font-size: 112%;
}

/* ==========================================================================
   DAILY CHALLENGE BANNER & GRANULAR GRADE SELECTOR
   ========================================================================== */
.daily-challenge-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(168, 85, 247, 0.12));
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.daily-star-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: #ffcc00;
  background: rgba(255, 204, 0, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 4px;
}

.daily-game-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.daily-game-desc { font-size: 13px; color: #94a3b8; }
.daily-banner-action { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

.daily-status-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
}

.daily-status-badge.ready {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.daily-status-badge.completed {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.play-daily-btn {
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  border: 1px solid #38bdf8;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.play-daily-btn:hover { filter: brightness(1.15); box-shadow: 0 0 12px rgba(6, 182, 212, 0.4); }

/* Grade Selector Section */
.grade-selector-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.stage-tabs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.stage-tab {
  background: #111624;
  border: 1px solid #1f2a40;
  color: #8b9bb4;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.stage-tab.active {
  background: #1e293b;
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.individual-grades-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.grade-pill-btn {
  background: #141b2b;
  border: 1px solid #232f48;
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.grade-pill-btn:hover {
  border-color: #06b6d4;
  background: #1b253b;
}

.grade-pill-btn.active {
  background: #2563eb;
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}

/* ==========================================================================
   MOBILE RESPONSIVENESS OVERHAUL (390px & SMALL VIEWPORTS)
   ========================================================================== */
@media (max-width: 768px) {
  .suite-header {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .header-controls {
    gap: 8px;
    flex-wrap: wrap;
  }
  .student-profile-pill {
    padding: 3px 8px;
    font-size: 11px;
  }
  .daily-challenge-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .daily-banner-action {
    align-items: flex-start;
    width: 100%;
  }
  .play-daily-btn {
    width: 100%;
    text-align: center;
  }
  .stage-hud {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .hud-left, .hud-right {
    justify-content: space-between;
  }
  .custom-game-shell {
    padding: 14px 10px !important;
    border-radius: 8px;
  }
  .aa-workspace,
  .ra-workspace,
  .cq-workspace,
  .ml-workspace,
  .sh-workspace {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .pa-grid-box {
    grid-template-columns: repeat(4, minmax(36px, 52px)) !important;
    grid-template-rows: repeat(4, minmax(36px, 52px)) !important;
    gap: 4px !important;
  }
  .pa-grid-cell {
    width: 100% !important;
    height: 100% !important;
  }
  .pa-modules-dock {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  #roboCanvas, #mlCanvas {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }
  .cq-table-box {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .cq-packet-table {
    min-width: 320px;
  }
  .pv-choices-grid {
    grid-template-columns: 1fr !important;
  }
  .cards-grid {
    grid-template-columns: 1fr !important;
  }
}



/* ==========================================================================
   GAME 11: SILICON FORGE (Tactile Electronic Breadboard & Digital Logic)
   ========================================================================== */
.sf-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px;
  box-sizing: border-box;
}

.sf-telemetry-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 12px 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.sf-hud-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sf-badge-icon {
  font-size: 26px;
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.6));
}

.sf-tier-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #38bdf8;
  font-weight: 700;
}

.sf-mission-name {
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
}

.sf-stats-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.sf-stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px 12px;
  min-width: 64px;
}

.sf-stat-lbl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #94a3b8;
}

.sf-stat-val {
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
}

.sf-bar-actions {
  display: flex;
  gap: 8px;
}

.sf-action-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sf-action-btn:hover {
  background: #334155;
  color: #fff;
  border-color: #38bdf8;
}

.sf-forge-workspace {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 16px;
  width: 100%;
}

/* Breadboard Main Panel */
.sf-breadboard-panel {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.sf-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sf-panel-title {
  font-size: 12px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.sf-board-status {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

/* SKEUOMORPHIC ELECTRONIC BREADBOARD WORKBENCH */
.sf-breadboard-workbench {
  position: relative;
  background-color: #0b111e;
  /* Perforated breadboard tie-points */
  background-image: radial-gradient(rgba(255, 255, 255, 0.1) 18%, transparent 19%);
  background-size: 16px 16px;
  border: 2px solid #1e293b;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

/* Power Rails (Top VCC +5V / Bottom GND) */
.sf-bus-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  border-radius: 6px;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 800;
}

.sf-bus-vcc {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.sf-bus-gnd {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

.sf-bus-holes {
  flex: 1;
  height: 6px;
  margin: 0 16px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.3) 30%, transparent 32%);
  background-size: 12px 6px;
}

.sf-bus-indicator {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
}

/* Three Stage Columns: Inputs -> IC Socket -> Appliance */
.sf-stage-columns {
  position: relative;
  display: grid;
  grid-template-columns: 130px 1fr 140px;
  gap: 16px;
  align-items: center;
  min-height: 270px;
  padding: 12px 6px;
}

/* SVG Jumper Wire Layer */
.sf-wire-svg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  overflow: visible;
}

@keyframes sfElectronFlow {
  from { stroke-dashoffset: 40; }
  to { stroke-dashoffset: 0; }
}

.sf-electron-stream {
  animation: sfElectronFlow 0.5s linear infinite;
}

/* 1. INPUT BAY & 3D ROCKER SWITCHES */
.sf-input-bay {
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 10;
}

.sf-switch-module {
  background: #131b2e;
  border: 1px solid #1e2b45;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
}

.sf-switch-module.active-on {
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
}

.sf-switch-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sf-switch-icon {
  font-size: 14px;
}

.sf-switch-label {
  font-size: 10px;
  font-weight: 700;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sf-rocker-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Skeuomorphic Rocker Switch */
.sf-rocker-btn {
  flex: 1;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 800;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.sf-rocker-btn.rocker-off {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
}

.sf-rocker-btn.rocker-on {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  color: #ffffff;
  border: 1px solid #38bdf8;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.sf-rocker-btn:hover {
  transform: translateY(-1px);
}

.sf-rocker-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.sf-rocker-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.sf-rocker-led.led-off {
  background: #475569;
}

.sf-rocker-led.led-on {
  background: #39ff14;
  box-shadow: 0 0 8px #39ff14;
}

/* Solder Wire Terminal Pad */
.sf-wire-terminal {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sf-term-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.sf-term-dot.term-cold {
  background: #475569;
}

.sf-term-dot.term-hot {
  background: #06b6d4;
  box-shadow: 0 0 8px #06b6d4;
}

/* 2. CENTER IC MICROCHIP SOCKET BAY */
.sf-socket-bay {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.sf-ic-socket-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  width: 100%;
  max-width: 200px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.sf-socket-hdr {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #64748b;
}

.sf-socket-label {
  color: #38bdf8;
  font-size: 9px;
  font-weight: 800;
}

/* Physical DIP IC Microchip */
.sf-dip-chip {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: space-between;
}

.sf-chip-pins-left, .sf-chip-pins-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sf-chip-leg {
  width: 12px;
  height: 5px;
  background: linear-gradient(180deg, #e2e8f0 0%, #94a3b8 100%);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.sf-chip-body {
  position: relative;
  flex: 1;
  background: #080c14;
  border: 2px solid #334155;
  border-radius: 6px;
  padding: 6px 8px;
  margin: 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.05), 0 4px 8px rgba(0, 0, 0, 0.6);
}

/* Pin 1 Orientation Notch */
.sf-chip-notch {
  width: 10px;
  height: 5px;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  background: #1e293b;
  border: 1px solid #475569;
  border-top: none;
  margin-top: -6px;
  margin-bottom: 4px;
}

.sf-chip-schematic {
  width: 100%;
  max-width: 70px;
  display: flex;
  justify-content: center;
  margin: 2px 0;
}

.sf-gate-svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.5));
}

.sf-chip-label-badge {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  font-weight: 800;
  color: #cbd5e1;
  margin-top: 4px;
}

.sf-chip-ic-id {
  color: #64748b;
  font-size: 8px;
}

.sf-socket-quicksel {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 2px;
}

.sf-gate-sel {
  width: 100%;
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #475569;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

/* 3. RIGHT REACTIVE APPLIANCE BAY */
.sf-appliance-bay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.sf-appliance-card {
  background: #131b2e;
  border: 1px solid #1e2b45;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 140px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.sf-appliance-hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.sf-appliance-title {
  font-size: 9px;
  font-weight: 800;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sf-appliance-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* GADGET 1: EDISON BULB */
.sf-bulb-gadget {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sf-bulb-glass {
  position: relative;
  width: 44px;
  height: 52px;
  border-radius: 50% 50% 40% 40%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.sf-bulb-filament {
  width: 14px;
  height: 18px;
  border-top: 2px solid #64748b;
  border-left: 2px solid #64748b;
  border-right: 2px solid #64748b;
  border-radius: 4px 4px 0 0;
  transition: all 0.3s;
}

.bulb-lit .sf-bulb-glass {
  background: radial-gradient(circle, rgba(254, 240, 138, 0.4) 0%, rgba(245, 158, 11, 0.15) 80%);
  border-color: #facc15;
  box-shadow: 0 0 25px rgba(250, 204, 21, 0.7), inset 0 0 12px rgba(254, 240, 138, 0.8);
}

.bulb-lit .sf-bulb-filament {
  border-color: #ffffff;
  box-shadow: 0 0 10px #facc15;
}

.sf-bulb-base {
  width: 22px;
  height: 10px;
  background: linear-gradient(180deg, #94a3b8 0%, #475569 100%);
  border-radius: 0 0 4px 4px;
  border: 1px solid #334155;
}

/* GADGET 2: ROBOT EXPLORER HEADLAMP */
.sf-robot-gadget {
  display: flex;
  justify-content: center;
}

.sf-robot-head {
  width: 52px;
  height: 48px;
  background: #1e293b;
  border: 2px solid #475569;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  padding: 4px;
  transition: all 0.3s;
}

.sf-robot-eyes {
  display: flex;
  gap: 10px;
}

.sf-eye {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #334155;
  transition: all 0.2s;
}

.eye-lit {
  background: #00ffff !important;
  box-shadow: 0 0 10px #00ffff !important;
}

.sf-robot-mouth {
  width: 22px;
  height: 3px;
  background: #475569;
  border-radius: 2px;
}

.robot-active .sf-robot-head {
  border-color: #38bdf8;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.5);
}

.robot-active .mouth-smile {
  height: 6px;
  border-bottom: 2px solid #38bdf8;
  border-radius: 0 0 10px 10px;
  background: transparent;
}

/* GADGET 3: SPACE AIRLOCK */
.sf-airlock-gadget {
  width: 60px;
  height: 52px;
  background: #0f172a;
  border: 2px solid #334155;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.sf-airlock-frame {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sf-airlock-portal {
  font-size: 20px;
}

.sf-airlock-door {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, #334155 0%, #1e293b 100%);
  border: 1px solid #475569;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.door-left { left: 0; }
.door-right { right: 0; }

.airlock-open .door-left {
  transform: translateX(-85%);
}

.airlock-open .door-right {
  transform: translateX(85%);
}

.airlock-open {
  border-color: #10b981;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.5);
}

/* GADGET 4: EMERGENCY SIREN */
.sf-siren-gadget {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sf-siren-dome {
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 10% 10%;
  background: #7f1d1d;
  border: 2px solid #991b1b;
  position: relative;
  transition: all 0.3s;
}

.sf-siren-base {
  width: 44px;
  height: 8px;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 2px;
}

@keyframes sirenSpin {
  0% { box-shadow: 0 0 10px #ef4444; }
  50% { box-shadow: 0 0 25px #ef4444, 0 0 40px #f87171; }
  100% { box-shadow: 0 0 10px #ef4444; }
}

.siren-flashing .sf-siren-dome {
  background: #ef4444;
  animation: sirenSpin 0.6s infinite ease-in-out;
}

/* GADGET 5: ALU & MEMORY DISPLAY */
.sf-alu-display {
  display: flex;
  gap: 12px;
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 6px 10px;
}

.sf-alu-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sf-alu-lbl {
  font-size: 8px;
  color: #64748b;
  font-weight: 800;
}

.sf-alu-val {
  font-family: var(--font-mono, monospace);
  font-size: 16px;
  font-weight: 800;
}

.sf-appliance-readout {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

/* MICROCHIP PARTS BIN & TOOLBOX DOCK */
.sf-toolbox-card {
  background: rgba(11, 15, 25, 0.8);
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sf-toolbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sf-toolbox-title {
  font-size: 10px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.sf-toolbox-tip {
  font-size: 9px;
  color: #64748b;
}

.sf-chip-tray {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
}

.sf-tray-chip-btn {
  background: #131b2e;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.sf-tray-chip-btn:hover {
  border-color: #38bdf8;
  background: #1e293b;
  transform: translateY(-2px);
}

.sf-tray-chip-btn.active-inserted {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.sf-mini-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sf-mini-schematic {
  width: 44px;
}

.sf-mini-name {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 800;
  color: #f1f5f9;
}

.sf-snap-badge {
  font-size: 8px;
  font-weight: 800;
  color: #38bdf8;
}

.active-inserted .sf-snap-badge {
  color: #34d399;
}

/* RIGHT CONTROL PANEL & TRUTH TABLE */
.sf-control-panel {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.sf-brief-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sf-brief-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sf-brief-tag {
  font-size: 10px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.sf-brief-level {
  font-size: 10px;
  color: #94a3b8;
}

.sf-brief-prompt {
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.4;
}

.sf-truth-card {
  background: rgba(11, 15, 25, 0.8);
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 8px 10px;
}

.sf-truth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.sf-truth-title {
  font-size: 10px;
  font-weight: 800;
  color: #a855f7;
  letter-spacing: 0.5px;
}

.sf-truth-active-lbl {
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  color: #38bdf8;
  font-weight: 800;
}

.sf-row-active {
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
  animation: sfRowPulse 1.2s infinite alternate;
}

@keyframes sfRowPulse {
  from { border-color: #38bdf8; }
  to { border-color: #0284c7; }
}

.sf-deploy-box {
  margin-top: 4px;
}

.sf-deploy-btn {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.sf-btn-locked {
  background: #1e293b;
  color: #64748b;
  cursor: not-allowed;
  border: 1px solid #334155;
}

.sf-btn-ready {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
  cursor: pointer;
}

.sf-btn-ready:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.6);
}

.sf-btn-pass {
  background: #38bdf8;
  color: #030712;
  font-weight: 900;
}

/* Responsive Overrides */
@media (max-width: 900px) {
  .sf-forge-workspace {
    grid-template-columns: 1fr !important;
  }
  .sf-stage-columns {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
}


/* ==========================================================================
   GAME 12: VECTOR VOYAGE (Cartesian Physics & Trajectory Engineering)
   ========================================================================== */
.vv-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px;
  box-sizing: border-box;
}

.vv-telemetry-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 12px 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.vv-hud-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vv-badge-icon {
  font-size: 26px;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.5));
}

.vv-tier-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #38bdf8;
  font-weight: 700;
}

.vv-mission-name {
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
}

.vv-stats-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.vv-stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px 12px;
  min-width: 64px;
}

.vv-stat-lbl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #94a3b8;
}

.vv-stat-val {
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
}

.vv-bar-actions {
  display: flex;
  gap: 8px;
}

.vv-action-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.vv-action-btn:hover {
  background: #334155;
  color: #fff;
  border-color: #38bdf8;
}

.vv-flight-deck {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  width: 100%;
}

.vv-radar-container {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vv-radar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.vv-coord-readout {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: #38bdf8;
  font-weight: 700;
}

.vv-trajectory-status {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
}

.vv-canvas-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 280px;
  background: #050811;
  border: 1px solid #1e293b;
  border-radius: 8px;
  overflow: hidden;
}

#vvRadarCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.vv-radar-legend {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: #94a3b8;
  justify-content: center;
  flex-wrap: wrap;
}

.vv-leg-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vv-leg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.vv-dot-ship { background: #38bdf8; }
.vv-dot-target { background: #10b981; }
.vv-dot-vector { background: #f59e0b; }
.vv-dot-drift { background: #ec4899; }

.vv-control-console {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vv-brief-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vv-brief-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vv-brief-tag {
  font-size: 10px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.vv-brief-level {
  font-size: 10px;
  color: #94a3b8;
}

.vv-brief-prompt {
  font-size: 13px;
  color: #e2e8f0;
  line-height: 1.4;
}

.vv-formula-card {
  background: rgba(11, 15, 25, 0.8);
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 6px 10px;
  margin-top: 4px;
}

.vv-formula-title {
  font-size: 9px;
  font-weight: 700;
  color: #a855f7;
  letter-spacing: 0.5px;
}

.vv-formula-expr {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: #38bdf8;
  margin-top: 2px;
}

.vv-inputs-deck {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vv-input-group {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px 10px;
}

.vv-input-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 6px;
}

.vv-input-val {
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
}

.vv-stepper-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vv-step-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.vv-step-btn:hover {
  background: #334155;
  border-color: #38bdf8;
}

.vv-slider {
  flex: 1;
  accent-color: #38bdf8;
  cursor: pointer;
}

.vv-reflect-box {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vv-reflect-title {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
}

.vv-reflect-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.vv-reflect-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.vv-reflect-btn.active {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.vv-drift-readout {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  font-family: var(--font-mono, monospace);
}

.vv-drift-chip {
  color: #f472b6;
}

.vv-resultant-chip {
  color: #38bdf8;
  font-weight: 700;
}

.vv-slope-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.vv-preset-lbl {
  font-size: 10px;
  color: #94a3b8;
}

.vv-preset-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
}

.vv-preset-btn:hover {
  border-color: #38bdf8;
  color: #fff;
}

.vv-trig-decomp {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  color: #38bdf8;
  background: rgba(11, 15, 25, 0.6);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #1e293b;
}

.vv-metrics-dock {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(11, 15, 25, 0.6);
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 8px 10px;
}

.vv-metric-item {
  display: flex;
  flex-direction: column;
}

.vv-m-lbl {
  font-size: 9px;
  color: #94a3b8;
  text-transform: uppercase;
}

.vv-m-val {
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
}

.vv-launch-box {
  margin-top: 4px;
}

.vv-launch-btn {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.vv-btn-locked {
  background: #1e293b;
  color: #64748b;
  cursor: not-allowed;
  border: 1px solid #334155;
}

.vv-btn-ready {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
  cursor: pointer;
}

.vv-btn-ready:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.6);
}

.vv-btn-pass {
  background: #38bdf8;
  color: #030712;
  font-weight: 900;
}

/* Responsive Overrides for Silicon Forge & Vector Voyage */
@media (max-width: 900px) {
  .sf-forge-workspace,
  .vv-flight-deck {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   GAME 13: STACK & QUEUE EXPRESS (Railroad Switchyard & Data Structures)
   ========================================================================== */

.sq-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  color: #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.sq-telemetry-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 12px 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.sq-hud-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sq-badge-icon {
  font-size: 28px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 6px 10px;
}

.sq-tier-title {
  font-size: 11px;
  font-weight: 700;
  color: #f59e0b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sq-mission-name {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.sq-stats-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.sq-stat-chip {
  display: flex;
  flex-direction: column;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 14px;
  min-width: 70px;
  text-align: center;
}

.sq-stat-lbl {
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.sq-stat-val {
  font-size: 15px;
  font-weight: 900;
}

.sq-bar-actions {
  display: flex;
  gap: 8px;
}

.sq-action-btn {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.sq-action-btn:hover {
  background: #334155;
  color: #ffffff;
}

.sq-switchyard-workspace {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
}

.sq-tracks-panel {
  display: flex;
  flex-direction: column;
  background: #0b0f19;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 16px;
  gap: 14px;
}

.sq-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid #1e293b;
}

.sq-panel-title {
  font-size: 13px;
  font-weight: 800;
  color: #cbd5e1;
  letter-spacing: 0.5px;
}

.sq-signal-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0f172a;
  border: 1px solid #334155;
  padding: 4px 10px;
  border-radius: 6px;
}

.sq-signal-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.sq-signal-light.signal-red {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

.sq-signal-light.signal-green {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.sq-signal-text {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.sq-track-bay {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sq-track-lane {
  background: #080c14;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lane-inbound {
  border-left: 4px solid #38bdf8;
}

.lane-siding {
  border-left: 4px solid #f59e0b;
}

.lane-outbound {
  border-left: 4px solid #10b981;
}

.sq-lane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sq-lane-name {
  font-size: 12px;
  font-weight: 800;
  color: #cbd5e1;
}

.sq-lane-badge {
  font-size: 11px;
  font-weight: 700;
  background: #1e293b;
  padding: 2px 8px;
  border-radius: 4px;
  color: #94a3b8;
}

.sq-rail-bed {
  position: relative;
  background: #050810;
  border-top: 2px solid #475569;
  border-bottom: 2px solid #475569;
  min-height: 72px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 4px;
  overflow-x: auto;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.sq-rail-ties {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent 18px,
    rgba(51, 65, 85, 0.35) 18px,
    rgba(51, 65, 85, 0.35) 24px
  );
  pointer-events: none;
}

.sq-buffer-stop {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 42px;
  background: repeating-linear-gradient(
    45deg,
    #b45309 0px,
    #b45309 8px,
    #000000 8px,
    #000000 16px
  );
  border-left: 2px solid #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  font-size: 8px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 1px;
}

.sq-cars-container {
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
}

.sq-train-car {
  display: flex;
  flex-direction: column;
  background: #1e293b;
  border: 1px solid #334155;
  border-top: 3px solid #38bdf8;
  border-radius: 6px;
  padding: 4px 8px;
  min-width: 90px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.sq-car-roof {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  color: #94a3b8;
  border-bottom: 1px solid #334155;
  padding-bottom: 2px;
  margin-bottom: 3px;
}

.sq-car-role {
  font-weight: 800;
  text-transform: uppercase;
}

.sq-coupler {
  font-size: 8px;
}

.sq-car-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 2px;
}

.sq-car-label {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
}

.sq-car-wheels {
  display: flex;
  justify-content: space-around;
  padding-top: 2px;
  font-size: 10px;
  opacity: 0.7;
}

.sq-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sq-manifest-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 14px 16px;
}

.sq-card-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.sq-card-title {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 6px 0;
}

.sq-mission-desc {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.4;
  margin-bottom: 10px;
}

.sq-target-box {
  background: #080c14;
  border: 1px dashed #334155;
  border-radius: 8px;
  padding: 8px 12px;
}

.sq-target-header {
  font-size: 11px;
  font-weight: 800;
  color: #10b981;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.sq-target-train-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.sq-target-pill {
  background: #1e293b;
  border: 1px solid #334155;
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.sq-levers-section {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sq-levers-header {
  font-size: 11px;
  font-weight: 800;
  color: #cbd5e1;
  letter-spacing: 0.5px;
}

.sq-levers-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sq-lever-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sq-lever-btn:hover:not(:disabled) {
  background: #273549;
  border-color: #38bdf8;
  color: #38bdf8;
}

.sq-lever-btn.btn-direct {
  border-color: #10b981;
}

.sq-lever-btn.btn-direct:hover:not(:disabled) {
  background: #064e3b;
  color: #10b981;
}

.sq-lever-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sq-log-panel {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sq-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}

.sq-algo-log {
  background: #080c14;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 8px;
  max-height: 90px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 11px;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sq-log-entry {
  line-height: 1.3;
}

.sq-action-zone {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.sq-deploy-btn {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.sq-btn-locked {
  background: #1e293b;
  color: #64748b;
  border: 1px solid #334155;
  cursor: not-allowed;
}

.sq-btn-ready {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
  cursor: pointer;
}

.sq-btn-ready:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.6);
}

.sq-btn-pass {
  background: #38bdf8;
  color: #030712;
  font-weight: 900;
}

.sq-hint-strip {
  font-size: 11px;
  color: #64748b;
  text-align: center;
}


/* ==========================================================================
   GAME 14: RATIO ALCHEMIST (Visual Fractions, Proportions & Dilution)
   ========================================================================== */

.ra-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  color: #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ra-telemetry-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 12px 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.ra-hud-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ra-badge-icon {
  font-size: 28px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  padding: 6px 10px;
}

.ra-tier-title {
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ra-mission-name {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.ra-stats-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ra-stat-chip {
  display: flex;
  flex-direction: column;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 14px;
  min-width: 70px;
  text-align: center;
}

.ra-stat-lbl {
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.ra-stat-val {
  font-size: 15px;
  font-weight: 900;
}

.ra-bar-actions {
  display: flex;
  gap: 8px;
}

.ra-action-btn {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.ra-action-btn:hover {
  background: #334155;
  color: #ffffff;
}

.ra-lab-workbench {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 16px;
}

.ra-stage-container {
  display: flex;
  flex-direction: column;
  background: #0b0f19;
  border: 1px solid #1e293b;
  border-radius: 12px;
  overflow: hidden;
}

.ra-stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  font-size: 12px;
  font-weight: 700;
}

.ra-status-readout {
  color: #10b981;
}

.ra-spectro-meter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ra-spectro-lbl {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
}

.ra-spectro-bar-bg {
  width: 90px;
  height: 8px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
}

.ra-spectro-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #10b981);
  transition: width 0.25s ease;
}

.ra-spectro-pct {
  font-size: 11px;
  font-weight: 800;
  color: #10b981;
  min-width: 32px;
}

.ra-canvas-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #080c14;
}

.ra-canvas-wrapper canvas {
  width: 100%;
  max-width: 620px;
  height: auto;
  display: block;
}

.ra-balance-ticker {
  background: #0f172a;
  border-top: 1px solid #1e293b;
  padding: 8px 16px;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  font-family: monospace;
}

.ra-control-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ra-recipe-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 14px 16px;
}

.ra-card-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 8px;
}

.ra-card-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
}

.ra-recipe-title {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
}

.ra-recipe-desc {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.4;
  margin-bottom: 10px;
}

.ra-target-box {
  background: #0b0f19;
  border: 1px dashed #334155;
  border-radius: 8px;
  padding: 8px 12px;
}

.ra-target-formula {
  font-size: 13px;
  font-weight: 700;
  color: #cbd5e1;
  text-align: center;
}

.ra-glow-target {
  color: #f59e0b;
  font-weight: 900;
  font-family: monospace;
  font-size: 14px;
}

.ra-pipettes-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ra-reagent-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 10px 14px;
}

.ra-reagent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ra-reagent-name {
  font-size: 13px;
  font-weight: 700;
}

.ra-reagent-vol {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  font-family: monospace;
}

.ra-stepper-row {
  display: flex;
  gap: 6px;
}

.ra-step-btn {
  flex: 1;
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.ra-step-btn:hover:not(:disabled) {
  background: #273549;
  border-color: #38bdf8;
  color: #38bdf8;
}

.ra-step-btn.ra-btn-add {
  border-color: #10b981;
}

.ra-step-btn.ra-btn-add:hover:not(:disabled) {
  background: #064e3b;
  color: #10b981;
}

.ra-step-btn.ra-btn-clear {
  border-color: #ef4444;
  color: #f87171;
}

.ra-step-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ra-sub-actions {
  display: flex;
  margin-top: 4px;
}

.ra-sub-actions .ra-step-btn {
  width: 100%;
}

.ra-action-zone {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.ra-transmute-btn {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.ra-btn-locked {
  background: #1e293b;
  color: #64748b;
  border: 1px solid #334155;
  cursor: not-allowed;
}

.ra-btn-ready {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
  cursor: pointer;
}

.ra-btn-ready:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.6);
}

.ra-btn-success {
  background: #10b981;
  color: #030712;
  font-weight: 900;
}

.ra-hint-strip {
  font-size: 11px;
  color: #64748b;
  text-align: center;
}

/* Responsive Overrides for Wave 2 Games */
@media (max-width: 900px) {
  .sq-yard-grid,
  .ra-lab-workbench {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   GAME 15: FRACTAL CANVAS (Computational Geometry, Loops & Recursion)
   ========================================================================== */

.fc-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  color: #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.fc-telemetry-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 12px 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.fc-hud-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fc-badge-icon {
  font-size: 28px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  padding: 6px 10px;
}

.fc-tier-title {
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fc-mission-name {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.fc-stats-group {
  display: flex;
  gap: 8px;
}

.fc-stat-pill {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 65px;
}

.fc-stat-lbl {
  font-size: 9px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.5px;
}

.fc-stat-val {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
}

.fc-controls-inline {
  display: flex;
  gap: 8px;
}

.fc-btn-sec {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.fc-btn-sec:hover {
  background: #334155;
  color: #ffffff;
}

.fc-workbench-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
}

.fc-canvas-panel {
  background: #0b0f19;
  border: 1px solid #1e293b;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.fc-panel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
}

.fc-monitor-status {
  font-size: 12px;
  font-weight: 800;
  color: #10b981;
  font-family: monospace;
}

.fc-coincidence-meter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fc-meter-label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
}

.fc-meter-bar-bg {
  width: 100px;
  height: 8px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
}

.fc-meter-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  transition: width 0.3s ease;
}

.fc-meter-pct {
  font-size: 11px;
  font-weight: 800;
  color: #10b981;
  font-family: monospace;
  min-width: 32px;
}

.fc-canvas-wrapper {
  position: relative;
  width: 100%;
  background: #080c16;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 420px;
}

.fc-canvas-wrapper canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.fc-code-ticker {
  background: #0f172a;
  border-top: 1px solid #1e293b;
  padding: 8px 16px;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  font-family: monospace;
}

.fc-control-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fc-blueprint-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 14px 16px;
}

.fc-card-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 8px;
}

.fc-card-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
}

.fc-blueprint-title {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
}

.fc-blueprint-desc {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.4;
  margin-bottom: 10px;
}

.fc-target-box {
  background: #0b0f19;
  border: 1px dashed #334155;
  border-radius: 8px;
  padding: 8px 12px;
}

.fc-target-formula {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  text-align: center;
}

.fc-glow-target {
  color: #10b981;
  font-weight: 900;
  font-family: monospace;
}

.fc-directives-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fc-param-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 10px 14px;
}

.fc-param-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.fc-param-title {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
}

.fc-param-val {
  font-size: 12px;
  font-weight: 800;
  color: #10b981;
  font-family: monospace;
}

.fc-btn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 6px;
}

.fc-choice-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  border-radius: 6px;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.fc-choice-btn:hover {
  background: #334155;
  color: #ffffff;
}

.fc-choice-btn.active {
  background: #059669;
  border-color: #10b981;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.fc-stepper-row {
  display: flex;
  gap: 6px;
}

.fc-step-btn {
  flex: 1;
  padding: 8px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.fc-step-btn:hover:not(:disabled) {
  background: #334155;
}

.fc-step-btn.fc-btn-add {
  border-color: #059669;
  color: #34d399;
}

.fc-step-btn.fc-btn-clear {
  border-color: #ef4444;
  color: #f87171;
}

.fc-step-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.fc-formula-note {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
  background: #0b0f19;
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 3px solid #06b6d4;
}

.fc-action-zone {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.fc-plot-btn {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.fc-btn-locked {
  background: #1e293b;
  color: #64748b;
  border: 1px solid #334155;
  cursor: not-allowed;
}

.fc-btn-ready {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
  cursor: pointer;
}

.fc-btn-ready:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.6);
}

.fc-hint-strip {
  font-size: 11px;
  color: #64748b;
  text-align: center;
}

/* ==========================================================================
   GAME 16: MONTE CARLO VAULT (Probability, Distributions & Stochastic Sim)
   ========================================================================== */

.mc-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  color: #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.mc-telemetry-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 12px 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.mc-hud-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mc-badge-icon {
  font-size: 28px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 10px;
  padding: 6px 10px;
}

.mc-tier-title {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mc-mission-name {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.mc-stats-group {
  display: flex;
  gap: 8px;
}

.mc-stat-pill {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 65px;
}

.mc-stat-lbl {
  font-size: 9px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.5px;
}

.mc-stat-val {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
}

.mc-controls-inline {
  display: flex;
  gap: 8px;
}

.mc-btn-sec {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.mc-btn-sec:hover {
  background: #334155;
  color: #ffffff;
}

.mc-workbench-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
}

.mc-canvas-panel {
  background: #0b0f19;
  border: 1px solid #1e293b;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mc-panel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
}

.mc-monitor-status {
  font-size: 12px;
  font-weight: 800;
  color: #38bdf8;
  font-family: monospace;
}

.mc-confidence-meter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mc-meter-label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
}

.mc-meter-bar-bg {
  width: 100px;
  height: 8px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
}

.mc-meter-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #a855f7);
  transition: width 0.3s ease;
}

.mc-meter-pct {
  font-size: 11px;
  font-weight: 800;
  color: #38bdf8;
  font-family: monospace;
  min-width: 32px;
}

.mc-canvas-wrapper {
  position: relative;
  width: 100%;
  background: #080c16;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 420px;
}

.mc-canvas-wrapper canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.mc-stoch-ticker {
  background: #0f172a;
  border-top: 1px solid #1e293b;
  padding: 8px 16px;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  font-family: monospace;
}

.mc-control-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mc-spec-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 14px 16px;
}

.mc-card-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 8px;
}

.mc-card-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
}

.mc-spec-title {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
}

.mc-spec-desc {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.4;
  margin-bottom: 10px;
}

.mc-target-box {
  background: #0b0f19;
  border: 1px dashed #334155;
  border-radius: 8px;
  padding: 8px 12px;
}

.mc-target-formula {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
  text-align: center;
}

.mc-glow-target {
  color: #38bdf8;
  font-weight: 900;
  font-family: monospace;
}

.mc-experiment-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mc-param-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 10px 14px;
}

.mc-param-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.mc-param-title {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
}

.mc-param-val {
  font-size: 12px;
  font-weight: 800;
  color: #38bdf8;
  font-family: monospace;
}

.mc-btn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(65px, 1fr));
  gap: 6px;
}

.mc-choice-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  border-radius: 6px;
  padding: 8px 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.mc-choice-btn:hover {
  background: #334155;
  color: #ffffff;
}

.mc-choice-btn.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.mc-stepper-row {
  display: flex;
  gap: 6px;
}

.mc-step-btn {
  flex: 1;
  padding: 8px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.mc-step-btn:hover:not(:disabled) {
  background: #334155;
}

.mc-step-btn.mc-btn-add {
  border-color: #0284c7;
  color: #38bdf8;
}

.mc-step-btn.mc-btn-clear {
  border-color: #ef4444;
  color: #f87171;
}

.mc-step-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.mc-formula-note {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
  background: #0b0f19;
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 3px solid #38bdf8;
}

.mc-action-zone {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.mc-unseal-btn {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.mc-btn-locked {
  background: #1e293b;
  color: #64748b;
  border: 1px solid #334155;
  cursor: not-allowed;
}

.mc-btn-ready {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
  cursor: pointer;
}

.mc-btn-ready:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.6);
}

.mc-hint-strip {
  font-size: 11px;
  color: #64748b;
  text-align: center;
}

/* Responsive Overrides for Wave 3 */
@media (max-width: 900px) {
  .fc-workbench-grid,
  .mc-workbench-grid {
    grid-template-columns: 1fr !important;
  }
}
