/* ==========================================================================
   Commando Learn Striker: Tactical Code Combat System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Fira+Code:wght@500;700&family=Inter:wght@400;600;700&display=swap');

:root {
  --bg-dark: #050811;
  --bg-panel: rgba(13, 20, 36, 0.88);
  --border-neon-blue: #00f0ff;
  --border-neon-pink: #ff0077;
  --border-neon-gold: #fbbf24;
  --border-neon-purple: #a855f7;
  --accent-camo: #15803d;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-heading: 'Fredoka', cursive, sans-serif;
  --font-code: 'Fira Code', monospace;
  --font-body: 'Inter', sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* App Header */
.app-header {
  background: rgba(10, 16, 28, 0.95);
  border-bottom: 2px solid var(--border-neon-blue);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 25px rgba(0, 240, 255, 0.25);
  z-index: 100;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 32px;
  animation: pulseGlow 2s infinite alternate;
}

.logo-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(135deg, #00f0ff, #fbbf24, #ff0077);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.control-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.control-btn:hover {
  background: var(--border-neon-blue);
  color: #000;
  box-shadow: 0 0 12px var(--border-neon-blue);
}

.control-btn.active {
  background: var(--border-neon-pink);
  border-color: #fff;
  box-shadow: 0 0 12px var(--border-neon-pink);
}

/* App Main Layout - Full Page Arena */
.app-container {
  display: flex;
  flex-direction: column;
  padding: 12px;
  flex: 1;
  max-width: 1920px;
  margin: 0 auto;
  width: 100%;
  height: calc(100vh - 65px);
}

/* Glassmorphism Panels & Modals */
.game-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 6, 13, 0.88);
  backdrop-filter: blur(14px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.25s ease;
}

.game-modal-content {
  background: rgba(10, 16, 28, 0.96);
  border: 2px solid var(--border-neon-blue);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.35);
  border-radius: 20px;
  width: 100%;
  max-width: 820px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.game-modal-header {
  background: rgba(20, 30, 48, 0.8);
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-modal-title {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--border-neon-gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.game-modal-close:hover {
  background: var(--border-neon-pink);
  color: #fff;
}

.game-modal-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Floating Weapon Switcher FAB */
.weapon-fab-container {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  pointer-events: auto;
}

.weapon-quick-select {
  background: #090e1a;
  border: 2px solid var(--border-neon-gold);
  border-radius: 14px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.5);
  animation: fadeIn 0.2s ease;
  min-width: 160px;
}

.weapon-chip {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  text-align: left;
}

.weapon-chip:hover, .weapon-chip.active {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.35), rgba(0, 240, 255, 0.35));
  border-color: var(--border-neon-gold);
  color: #fff;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}

.weapon-fab-btn {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
  border: 2px solid var(--border-neon-gold);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 26px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  pointer-events: auto;
  user-select: none;
}

.weapon-fab-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px var(--border-neon-gold);
}

.weapon-ammo-badge {
  background: rgba(251, 191, 36, 0.25);
  border: 1px solid var(--border-neon-gold);
  color: var(--border-neon-gold);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
}

.panel {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.panel-header {
  background: rgba(26, 36, 56, 0.6);
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 18px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-body {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Subject Tracks Grid */
.subject-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.subject-chip {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px;
  color: #cbd5e1;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.subject-chip:hover, .subject-chip.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(251, 191, 36, 0.25));
  border-color: var(--border-neon-blue);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

/* Level Cards List - 10 Questions Visible at a time */
.level-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 490px;
  overflow-y: auto;
  padding-right: 4px;
}

.level-list::-webkit-scrollbar {
  width: 6px;
}
.level-list::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
}
.level-list::-webkit-scrollbar-thumb {
  background: var(--border-neon-gold);
  border-radius: 4px;
  box-shadow: 0 0 8px var(--border-neon-gold);
}

/* Full Play Mode & Collapsible Side Panels */
body.full-page-mode .app-header {
  display: none !important;
}

body.full-page-mode .app-container,
.app-container.full-play-mode {
  height: 100vh !important;
  max-height: 100vh !important;
  padding: 0 !important;
  margin: 0 !important;
  grid-template-columns: 1fr !important;
}

body.full-page-mode .arena-panel,
.app-container.full-play-mode .arena-panel {
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
  border: none !important;
}

.collapse-toggle-btn {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--border-neon-blue);
  color: #fff;
  padding: 5px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
  pointer-events: auto;
}

.collapse-toggle-btn:hover {
  background: var(--border-neon-blue);
  color: #000;
  box-shadow: 0 0 15px var(--border-neon-blue);
}

.level-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.level-card:hover, .level-card.active {
  background: rgba(30, 41, 59, 0.9);
  border-color: var(--border-neon-gold);
  transform: translateX(4px);
}

.level-card-info h4 {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
}

.level-card-info p {
  font-size: 11px;
  color: var(--text-muted);
}

.badge {
  background: rgba(251, 191, 36, 0.15);
  color: var(--border-neon-gold);
  border: 1px solid var(--border-neon-gold);
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
}

/* Tactical Arsenal Weapon Selector Bar */
.weapon-arsenal-bar {
  background: rgba(10, 16, 28, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 8px 12px;
  margin: 0 14px 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  z-index: 10;
}

.weapon-slot {
  flex: 1;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.2s ease;
}

.weapon-slot:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: var(--border-neon-blue);
}

.weapon-slot.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(255, 0, 119, 0.25));
  border-color: var(--border-neon-gold);
  box-shadow: 0 0 12px var(--border-neon-gold);
  transform: scale(1.05);
}

.weapon-key {
  font-size: 9px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.2);
  padding: 1px 4px;
  border-radius: 4px;
  color: #fff;
}

.weapon-icon {
  font-size: 18px;
}

.weapon-name {
  font-size: 10px;
  font-weight: 700;
  color: #f1f5f9;
}

.weapon-ammo {
  font-size: 10px;
  font-weight: 700;
  color: var(--border-neon-gold);
}

/* Talking Narrator Box */
.narrator-box {
  background: linear-gradient(135deg, rgba(21, 128, 61, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid var(--accent-camo);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.narrator-avatar {
  font-size: 28px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  padding: 6px;
  animation: bounceSlow 3s infinite ease-in-out;
}

.narrator-content h4 {
  font-family: var(--font-heading);
  color: var(--border-neon-gold);
  font-size: 14px;
  margin-bottom: 2px;
}

.narrator-content p {
  font-size: 12px;
  line-height: 1.4;
  color: #e2e8f0;
}

/* Center Arena Panel */
.arena-panel {
  position: relative;
  background: #04060d;
  border: 2px solid rgba(0, 240, 255, 0.3);
  box-shadow: inset 0 0 30px rgba(0, 240, 255, 0.1);
}

/* HUD Overlay */
.arena-hud {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
}

.hud-stat {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.4);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.hud-stat.score-stat {
  color: var(--border-neon-gold);
  border-color: var(--border-neon-gold);
}

/* Target Sequence Blueprint Bar */
/* Target Sequence Blueprint Bar */
.target-blueprint-bar {
  background: rgba(10, 16, 28, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 12px 14px 4px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 130px;
  overflow-y: auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

.target-blueprint-bar::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.target-blueprint-bar::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
}
.target-blueprint-bar::-webkit-scrollbar-thumb {
  background: var(--border-neon-blue);
  border-radius: 4px;
  box-shadow: 0 0 6px var(--border-neon-blue);
}

.blueprint-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--border-neon-blue);
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-height: 75px;
  overflow-y: auto;
}

.blueprint-header::-webkit-scrollbar {
  width: 4px;
}
.blueprint-header::-webkit-scrollbar-thumb {
  background: var(--border-neon-gold);
  border-radius: 4px;
}

.question-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.question-badge {
  background: linear-gradient(135deg, #00f0ff, #fbbf24);
  color: #000;
  font-weight: 800;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.question-text {
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.4;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
  flex: 1;
  word-break: break-word;
}

.token-sequence-flow {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
}

.token-chip {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
  font-family: var(--font-code);
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.token-chip.collected {
  background: rgba(16, 185, 129, 0.25);
  border-color: #34d399;
  color: #34d399;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.token-chip.current-target {
  background: rgba(0, 240, 255, 0.25);
  border-color: var(--border-neon-blue);
  color: #fff;
  box-shadow: 0 0 12px var(--border-neon-blue);
  animation: pulseGlow 1.5s infinite alternate;
}

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

/* Victory Auto-Advance Overlay */
.victory-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 6, 13, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.3s ease;
}

.victory-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(6, 182, 212, 0.25));
  border: 2px solid var(--border-neon-blue);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.4);
  border-radius: 20px;
  padding: 24px 32px;
  text-align: center;
  max-width: 420px;
  width: 90%;
}

.victory-icon {
  font-size: 48px;
  margin-bottom: 8px;
  animation: bounceSlow 1.5s infinite ease-in-out;
}

.victory-card h3 {
  font-family: var(--font-heading);
  font-size: 22px;
  color: var(--border-neon-gold);
  margin-bottom: 6px;
}

.victory-card p {
  font-size: 13px;
  color: #e2e8f0;
  margin-bottom: 16px;
}

.victory-progress-bar {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  height: 6px;
  overflow: hidden;
}

#victoryProgressFill {
  background: linear-gradient(90deg, var(--border-neon-blue), var(--border-neon-gold));
  height: 100%;
  width: 0%;
  transition: width 1.5s linear;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Right Output Preview Panel */
.preview-tabs {
  display: flex;
  gap: 4px;
  background: rgba(15, 23, 42, 0.8);
  padding: 4px;
  border-radius: 8px;
}

.preview-tab {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
}

.preview-tab.active {
  background: var(--border-neon-blue);
  color: #000;
}

.code-editor-box {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px;
  font-family: var(--font-code);
  font-size: 12px;
  color: #38bdf8;
  min-height: 150px;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-y: auto;
}

.output-render-box {
  background: #ffffff;
  border-radius: 12px;
  height: 210px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

iframe#htmlPreviewFrame {
  width: 100%;
  height: 100%;
  border: none;
}

.terminal-box {
  background: #070a12;
  border: 1px solid var(--accent-camo);
  border-radius: 12px;
  padding: 12px;
  font-family: var(--font-code);
  font-size: 12px;
  color: #4ade80;
  height: 210px;
  overflow-y: auto;
}

.sql-table-box {
  background: #0b1120;
  border-radius: 12px;
  overflow: auto;
  max-height: 210px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.sql-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.sql-table th {
  background: #1e293b;
  color: var(--border-neon-gold);
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sql-table td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

.aws-cloud-view {
  background: #090e1a;
  border: 1px solid var(--border-neon-blue);
  border-radius: 12px;
  padding: 14px;
  height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.aws-node-card {
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid #34d399;
  border-radius: 12px;
  padding: 10px 16px;
  text-align: center;
  color: #fff;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
  animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.03); filter: brightness(1.2); }
}

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

/* Movable Floating Action Button (FAB) Hamburger Quick Menu */
.fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  touch-action: none;
}

.fab-main-btn {
  background: linear-gradient(135deg, #00f0ff, #3b82f6);
  border: 2px solid #ffffff;
  color: #000000;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.8);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  touch-action: none;
}

.fab-drag-handle {
  cursor: grab;
  padding: 2px 7px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 2px;
  transition: all 0.2s ease;
  color: #ffffff;
}

.fab-drag-handle:hover {
  background: rgba(0, 0, 0, 0.6);
  border-color: #ffffff;
  transform: scale(1.08);
}

.fab-drag-handle:active {
  cursor: grabbing;
}

.fab-icon-symbol {
  font-size: 18px;
  font-weight: 900;
}

.fab-popup-menu {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  background: #090e1a;
  border: 2px solid var(--border-neon-blue);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 10px 45px rgba(0, 240, 255, 0.7);
  min-width: 260px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  animation: fadeIn 0.2s ease;
  z-index: 10001;
  pointer-events: auto;
}

.fab-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  color: var(--border-neon-gold);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 6px;
  margin-bottom: 4px;
}

.fab-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
}

.fab-close-btn:hover {
  color: #fff;
}

.fab-item-btn {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.fab-item-btn:hover {
  background: var(--border-neon-blue);
  color: #000;
}

.fab-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 4px 0;
}

.fab-subject-selector {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fab-subject-selector label {
  font-size: 10px;
  font-weight: 700;
  color: var(--border-neon-blue);
}

.fab-select {
  background: #0f172a;
  border: 1px solid var(--border-neon-blue);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  outline: none;
}

/* ==========================================================================
   Responsive Mobile & Tablet Layout Adaptations
   ========================================================================== */
@media (max-width: 1200px) {
  .app-container {
    grid-template-columns: 280px 1fr 340px;
    gap: 12px;
  }
}

@media (max-width: 992px) {
  body {
    overflow-y: auto;
  }

  .app-container {
    display: flex;
    flex-direction: column;
    height: auto;
    gap: 16px;
    padding: 12px;
  }

  /* Make Center Play Arena visible first at top of screen on mobile */
  .arena-panel {
    order: 1;
    min-height: 520px;
  }

  aside.panel:first-of-type {
    order: 2;
  }

  aside.panel:last-of-type {
    order: 3;
  }

  .app-header {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }

  .logo-area {
    justify-content: center;
  }

  .logo-title {
    font-size: 20px;
    text-align: center;
  }

  .header-controls {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    gap: 8px;
  }

  .panel {
    max-height: none;
    height: auto;
  }

  .subject-selector {
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  }

  .level-list {
    max-height: 280px;
    overflow-y: auto;
  }

  canvas#gameCanvas {
    min-height: 400px;
  }

  .weapon-arsenal-bar {
    flex-wrap: wrap;
    gap: 6px;
  }

  .weapon-slot {
    min-width: 70px;
  }

  .target-blueprint-bar {
    max-height: 160px;
  }
}

@media (max-width: 576px) {
  .app-header {
    padding: 10px;
  }

  .logo-title {
    font-size: 16px;
  }

  .control-btn {
    padding: 6px 10px;
    font-size: 11px;
  }

  .target-blueprint-bar {
    margin: 6px 8px;
    padding: 8px 10px;
  }

  .question-text {
    font-size: 12px;
  }

  .arena-panel {
    min-height: 440px;
  }

  .hud-stat {
    padding: 4px 8px;
    font-size: 12px;
  }

  .weapon-slot {
    padding: 4px;
  }

  .weapon-icon {
    font-size: 16px;
  }

  .weapon-name {
    font-size: 9px;
  }
}
