/* ==========================================================================
   GANITHALOKA - Arcade & Game System CSS
   HUDs, Combat Gauges, Canvases, Sliders, Animations
   ========================================================================== */

/* Game Container Wrapper */
.game-stage-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin: 1.5rem 0 2.5rem;
}

/* Game Top HUD */
.arcade-hud {
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-color);
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Difficulty Selector Component */
.difficulty-selector {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.35rem;
  border-radius: var(--radius-full);
}

.difficulty-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 0.4rem;
  letter-spacing: 0.5px;
}

.difficulty-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.difficulty-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.difficulty-btn.active.diff-easy {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  color: #34d399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

.difficulty-btn.active.diff-med {
  background: rgba(245, 158, 11, 0.22);
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

.difficulty-btn.active.diff-hard {
  background: rgba(239, 68, 68, 0.22);
  border-color: #ef4444;
  color: #f87171;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}

/* Difficulty Indicator Dots */
.diff-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.diff-easy .diff-dot {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
}
.diff-med .diff-dot {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.7);
}
.diff-hard .diff-dot {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.7);
}
.difficulty-btn:hover .diff-dot {
  transform: scale(1.25);
}

/* SVG Icon Utilities */
.svg-icon-inline {
  display: inline-block;
  vertical-align: middle;
  width: 1rem;
  height: 1rem;
  fill: currentColor;
  stroke: currentColor;
}
.combo-flame-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
  fill: currentColor;
}

.hud-stat {
  display: flex;
  flex-direction: column;
}

.hud-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 800;
  letter-spacing: 0.5px;
}

.hud-stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
}

/* Combo Streak Indicator */
.combo-badge {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 900;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
  animation: pulseCombo 1.2s infinite ease-in-out;
}

@keyframes pulseCombo {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* Health / Progress Bar System */
.gauge-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 160px;
}

.gauge-track {
  height: 10px;
  background: var(--bg-dark);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-color);
  position: relative;
}

.gauge-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-hp {
  background: linear-gradient(90deg, #ef4444, #f97316);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.gauge-timer {
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
}

.gauge-xp {
  background: linear-gradient(90deg, #10b981, #34d399);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

/* Game Viewport / Canvas */
.game-viewport {
  position: relative;
  min-height: 420px;
  background: #060911;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  user-select: none;
}

/* Universal Responsive Canvas & Simulation Viewports */
canvas,
.game-canvas {
  display: block;
  max-width: 100% !important;
  height: auto !important;
  box-sizing: border-box;
}

.game-canvas {
  background: #080c18;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}

/* Monster / Boss Combat arena */
.boss-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  width: 100%;
  max-width: 500px;
}

.boss-avatar {
  font-size: 4.5rem;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 0 18px rgba(239, 68, 68, 0.3));
  transition: transform 0.2s ease;
}

.boss-avatar.hit {
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px) rotate(-5deg); }
  75% { transform: translateX(10px) rotate(5deg); }
}

.boss-name {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

/* Math Question Box */
.question-box {
  background: var(--bg-surface-elevated);
  border: 2px solid var(--border-glow);
  padding: 1.5rem 2.5rem;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-glow);
  margin-bottom: 1.5rem;
}

.question-text {
  font-size: 2.4rem;
  font-weight: 900;
  font-family: var(--font-mono);
  letter-spacing: 2px;
  color: #fff;
}

/* Multiple Choice or Numeric Grid */
.answers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  width: 100%;
  max-width: 480px;
}

.answer-btn {
  background: var(--bg-surface-elevated);
  border: 2px solid var(--border-color);
  color: var(--text-main);
  padding: 1.1rem;
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-mono);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.answer-btn:hover {
  border-color: var(--primary);
  background: var(--bg-surface-hover);
  transform: translateY(-2px);
}

.answer-btn.correct {
  background: #065f46;
  border-color: #34d399;
  color: #fff;
}

.answer-btn.wrong {
  background: #7f1d1d;
  border-color: #f87171;
  color: #fff;
}

/* Control Panel for Physics / Sliders */
.controls-panel {
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 180px;
  flex: 1;
}

.control-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.control-value {
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

/* Range input custom gamer slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-dark);
  outline: none;
  border: 1px solid var(--border-color);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 10px var(--primary-glow);
  transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Overlay Game Over / Win Screens */
.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 13, 22, 0.94);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.75rem 1rem;
  text-align: center;
  z-index: 50;
  box-sizing: border-box;
}

.overlay-title {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.overlay-xp-reward {
  display: none !important;
}

/* ==========================================================================
   CONCEPT DEBRIEF CARD (POST-LEVEL LEARNING REINFORCEMENT)
   ========================================================================== */
.concept-debrief-card {
  background: rgba(18, 24, 38, 0.96);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  margin: 0.5rem 0 1.25rem;
  text-align: left;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.16);
  animation: fadeInDebrief 0.35s ease-out;
}

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

.concept-debrief-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.65rem;
}

.concept-debrief-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0;
  margin: 0 0 1rem 0;
  font-size: 0.92rem;
  color: #cbd5e1;
  line-height: 1.55;
}

.concept-debrief-list li {
  position: relative;
  padding-left: 1.35rem;
}

.concept-debrief-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--accent-gold);
  font-size: 0.85rem;
  top: 1px;
}

.concept-debrief-list strong {
  color: #ffffff;
  font-weight: 700;
}

/* Reflection / Next Steps in Debrief */
.debrief-reflection {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.debrief-reflection-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.35rem 0;
}

.debrief-reflection-prompt {
  font-size: 0.9rem;
  font-weight: 600;
  color: #38bdf8;
  margin: 0 0 0.45rem 0;
  line-height: 1.45;
}

.debrief-reflection-subtext {
  font-size: 0.84rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

/* Actions in Debrief Overlay */
.overlay-action-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin-top: 0.5rem;
  width: 100%;
  max-width: 560px;
}

.overlay-action-buttons .btn {
  padding: 0.75rem 1.4rem;
  font-size: 0.98rem;
  font-weight: 700;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.overlay-action-buttons .btn-outline {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(15, 23, 42, 0.6);
  color: #f1f5f9;
}

.overlay-action-buttons .btn-outline:hover {
  border-color: #38bdf8;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

/* Fraction Flask Container */
.flask-arena {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3rem;
  min-height: 280px;
  margin-bottom: 1.5rem;
}

.alchemy-flask {
  width: 120px;
  height: 240px;
  border: 3px solid #38bdf8;
  border-top: none;
  border-radius: 0 0 24px 24px;
  position: relative;
  background: rgba(56, 189, 248, 0.05);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.target-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gold);
  box-shadow: 0 0 10px var(--accent-gold);
  z-index: 10;
}

.target-label {
  position: absolute;
  right: 5px;
  top: -18px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-gold);
  font-family: var(--font-mono);
}

.liquid-fill {
  width: 100%;
  background: linear-gradient(180deg, #818cf8, #4f46e5);
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.6);
}

/* ==========================================================================
   ALCHEMICAL VIAL & REAGENT BUTTONS (FRACTION POTION BREWER)
   ========================================================================== */
.vials-grid {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 620px;
  margin: 1.5rem auto;
}

.vial-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: var(--bg-surface-elevated);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.vial-btn:hover {
  border-color: var(--primary);
  background: var(--bg-surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--primary-glow);
}

.vial-btn:active {
  transform: translateY(1px) scale(0.98);
}

.vial-icon {
  font-size: 1.3rem;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.5));
}

.vial-fraction {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.vial-fraction-num {
  font-size: 0.95rem;
}

.vial-fraction-bar {
  width: 100%;
  height: 1.5px;
  background: currentColor;
  margin: 1px 0;
}

.vial-fraction-den {
  font-size: 0.95rem;
}

/* Reagent Color Accents by Denominator */
.vial-btn[data-den="2"] { 
  border-color: #38bdf8; 
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(14, 165, 233, 0.08)); 
  color: #e0f2fe; 
}
.vial-btn[data-den="2"]:hover { 
  border-color: #7dd3fc; 
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.38), rgba(14, 165, 233, 0.22)); 
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.5); 
}

.vial-btn[data-den="3"] { 
  border-color: #c084fc; 
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.22), rgba(168, 85, 247, 0.08)); 
  color: #f3e8ff; 
}
.vial-btn[data-den="3"]:hover { 
  border-color: #d8b4fe; 
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.38), rgba(168, 85, 247, 0.22)); 
  box-shadow: 0 0 18px rgba(192, 132, 252, 0.5); 
}

.vial-btn[data-den="4"] { 
  border-color: #34d399; 
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.22), rgba(16, 185, 129, 0.08)); 
  color: #ecfdf5; 
}
.vial-btn[data-den="4"]:hover { 
  border-color: #6ee7b7; 
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.38), rgba(16, 185, 129, 0.22)); 
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.5); 
}

.vial-btn[data-den="6"] { 
  border-color: #fbbf24; 
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(245, 158, 11, 0.08)); 
  color: #fffbeb; 
}
.vial-btn[data-den="6"]:hover { 
  border-color: #fcd34d; 
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.38), rgba(245, 158, 11, 0.22)); 
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.5); 
}

.vial-btn[data-den="12"] { 
  border-color: #f87171; 
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.22), rgba(239, 68, 68, 0.08)); 
  color: #fef2f2; 
}
.vial-btn[data-den="12"]:hover { 
  border-color: #fca5a5; 
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.38), rgba(239, 68, 68, 0.22)); 
  box-shadow: 0 0 18px rgba(248, 113, 113, 0.5); 
}

.practice-choice-btn, .arcade-btn-choice {
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  color: #fff;
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1.4rem;
  transition: all 0.2s ease;
  text-align: center;
  width: 100%;
}

.practice-choice-btn:hover, .arcade-btn-choice:hover {
  border-color: var(--primary);
  background: var(--bg-surface-elevated);
  transform: translateY(-2px);
}

.practice-choice-btn:active, .arcade-btn-choice:active {
  transform: translateY(0);
}

.practice-choice-btn.correct, .arcade-btn-choice.correct {
  background: #065f46;
  border-color: #34d399;
  color: #fff;
}

.practice-choice-btn.wrong, .arcade-btn-choice.wrong {
  background: #7f1d1d;
  border-color: #f87171;
  color: #fff;
}

/* Responsive arcade */
@media (max-width: 600px) {
  .answers-grid {
    grid-template-columns: 1fr;
  }
  .controls-panel {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ==========================================================================
   DIFFICULTY TIER SELECTOR (3 DIFFICULTY LEVELS PER GAME)
   ========================================================================== */
.difficulty-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-md);
  margin: 0.75rem auto 1.25rem;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.difficulty-label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-right: 0.25rem;
}

.difficulty-btn {
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  user-select: none;
}

.difficulty-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.difficulty-btn.active.diff-easy {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10b981;
  color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

.difficulty-btn.active.diff-med {
  background: rgba(245, 158, 11, 0.18);
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}

.difficulty-btn.active.diff-hard {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #f87171;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

/* ==========================================================================
   ARCADE RESPONSIVE CENTERING (MOBILE <= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  /* 1. Stage Wrapper & Viewport */
  .game-stage-wrapper {
    margin: 1rem 0 1.75rem !important;
    border-radius: var(--radius-md) !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .game-viewport {
    min-height: auto !important;
    padding: 0.85rem 0.5rem !important;
    overflow: hidden !important;
  }

  /* 2. Top HUD & Gauges */
  .arcade-hud {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 0.75rem 0.85rem !important;
    gap: 0.65rem !important;
  }

  .hud-group {
    justify-content: center !important;
    text-align: center !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }

  .hud-stat {
    align-items: center !important;
    text-align: center !important;
  }

  .hud-stat-label {
    text-align: center !important;
    font-size: 0.68rem !important;
  }

  .hud-stat-value {
    text-align: center !important;
    font-size: 1.1rem !important;
  }

  .difficulty-selector {
    justify-content: center !important;
    margin: 0.5rem auto 1rem !important;
  }

  .difficulty-label {
    text-align: center !important;
    width: 100% !important;
    display: block !important;
    margin: 0 auto 0.25rem !important;
  }

  .combo-badge {
    margin: 0 auto !important;
    text-align: center !important;
    display: inline-flex !important;
    justify-content: center !important;
  }

  .gauge-container {
    margin: 0 auto !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 130px !important;
  }

  /* 3. Boss Arena & Combat */
  .boss-arena {
    margin-bottom: 1rem !important;
  }

  .boss-avatar {
    font-size: 3.5rem !important;
    margin-bottom: 0.35rem !important;
  }

  /* 4. Question & Text Sizing */
  .question-box {
    padding: 1rem 1.25rem !important;
    margin-bottom: 1rem !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .question-text {
    font-size: clamp(1.4rem, 5vw, 2rem) !important;
    letter-spacing: 1px !important;
    word-break: break-word !important;
  }

  /* 5. Multiple Choice Grids & Buttons */
  .answers-grid {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 0.25rem !important;
    box-sizing: border-box !important;
  }

  .answer-btn {
    padding: 0.85rem 1rem !important;
    font-size: 1.15rem !important;
    min-height: 48px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }

  /* 6. Controls Panel & Sliders */
  .controls-panel {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 1rem 0.85rem !important;
    gap: 0.85rem !important;
  }

  .control-item {
    width: 100% !important;
    min-width: 0 !important;
  }

  .control-label {
    text-align: center !important;
    justify-content: center !important;
    display: flex !important;
    width: 100% !important;
  }

  .controls-panel > div:last-child {
    width: 100% !important;
  }

  .controls-panel .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .target-label {
    text-align: center !important;
  }

  /* 7. Game Over & Victory Overlay */
  .game-overlay {
    padding: 1rem 0.75rem !important;
    justify-content: flex-start !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .overlay-title {
    font-size: clamp(1.3rem, 5vw, 1.9rem) !important;
    margin-bottom: 0.35rem !important;
    text-align: center !important;
  }

  .overlay-xp-reward {
    font-size: 1.1rem !important;
    margin-bottom: 0.5rem !important;
    text-align: center !important;
  }

  .concept-debrief-badge {
    margin: 0 auto 0.5rem !important;
    display: inline-flex !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .concept-debrief-card {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0.75rem 0.85rem !important;
    margin: 0.35rem auto 0.85rem auto !important;
    font-size: 0.82rem !important;
  }

  .concept-debrief-list {
    text-align: center !important;
    align-items: center !important;
    font-size: 0.82rem !important;
  }

  .concept-debrief-list li {
    text-align: left !important;
  }

  /* 8. Laboratory Benches & Interactive Toys */
  .shape-toy-layout,
  .pizza-toy-layout,
  .gear-toy-layout,
  .numberline-toy-layout,
  .chart-toy-layout,
  .seq-toy-layout,
  .slope-toy-layout,
  .scale-toy-layout,
  .gacha-toy-layout {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1.25rem !important;
  }

  .shape-canvas-box,
  .gear-canvas-box,
  .numberline-canvas-box,
  .chart-canvas-box,
  .seq-canvas-box,
  .slope-canvas-box,
  .scale-canvas-box,
  .gacha-canvas-box,
  .scale-controls-panel,
  .seq-readout-card,
  .slope-readout-card,
  .decimal-readout-card,
  .gear-readout-card,
  .shape-readout-card,
  .toy-readout,
  .practice-box {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .pizza-board {
    width: min(280px, 80vw) !important;
    height: min(280px, 80vw) !important;
    max-width: 100% !important;
  }

  .pizza-board svg {
    width: 100% !important;
    height: 100% !important;
  }

  .flask-arena {
    gap: 1.5rem !important;
    min-height: auto !important;
    justify-content: center !important;
  }

  .alchemy-flask {
    width: min(130px, 38vw) !important;
    height: 220px !important;
  }

  .vials-container {
    gap: 0.5rem !important;
    width: 100% !important;
    justify-content: center !important;
  }

  .vial-btn {
    min-width: 75px !important;
    padding: 0.6rem 0.85rem !important;
    font-size: 1rem !important;
  }

  .thruster-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.35rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .thruster-btn {
    padding: 0.5rem 0.2rem !important;
    font-size: 0.72rem !important;
    text-align: center !important;
    word-break: break-word !important;
  }

  .slider-bank {
    gap: 0.5rem !important;
    width: 100% !important;
    justify-content: center !important;
  }

  .slider-unit {
    flex: 1 1 55px !important;
  }

  .slider-unit input[type="range"] {
    width: 100% !important;
  }

  .chart-readout-grid,
  .gacha-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }

  .gacha-controls-bar {
    width: 100% !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  .gacha-controls-bar .btn {
    width: 100% !important;
  }

  .practice-options-grid {
    grid-template-columns: 1fr !important;
    gap: 0.6rem !important;
    width: 100% !important;
  }

  .practice-choice-btn,
  .shape-choice-btn,
  .fortress-choice-btn,
  .chart-choice-btn,
  .seq-choice-btn,
  .calc-choice-btn,
  .algebra-choice-btn,
  .prob-choice-btn {
    width: 100% !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }
}


