/* ==========================================================================
   WonderLearn: Master Design System
   Multi-Subject Kids Educational Platform
   Adaptive Theming across 3 Age Tiers (3-5, 6-8, 9-12)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Outfit:wght@400;600;700;800&family=Plus+Jakarta+Sans:wght@500;700&display=swap');

:root {
  /* Default Tier 1 Theme: Playful Pastel & Sunshine */
  --font-display: 'Fredoka', cursive, sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  --bg-main: #F0F7FF;
  --bg-card: #FFFFFF;
  --bg-nav: #FFFFFF;
  --text-primary: #1E293B;
  --text-secondary: #64748B;

  --color-primary: #3B82F6;
  --color-accent: #FFD166;
  --color-pink: #FF70A6;
  --color-cyan: #06D6A0;
  --color-purple: #8B5CF6;
  --color-danger: #EF4444;

  --border-subtle: #E2E8F0;
  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  --border-radius-sm: 10px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(59, 130, 246, 0.12), 0 8px 10px -6px rgba(59, 130, 246, 0.1);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.25);
  --btn-scale-tap: scale(0.96);
}

/* Tier 2: Adventurer Theme (Ages 6–8) */
body[data-tier="tier2"] {
  --bg-main: #F0FDF4;
  --color-primary: #10B981;
  --color-accent: #F59E0B;
  --shadow-md: 0 10px 25px -5px rgba(16, 185, 129, 0.15);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.3);
}

/* Tier 3: Master / Arcade Theme (Ages 9–12) */
body[data-tier="tier3"] {
  --font-display: 'Outfit', sans-serif;
  --bg-main: #0B0F19;
  --bg-card: #151C2C;
  --bg-nav: #101624;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;

  --color-primary: #8B5CF6;
  --color-accent: #06B6D4;
  --border-subtle: rgba(255, 255, 255, 0.08);

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 30px rgba(139, 92, 246, 0.2);
  --shadow-glow: 0 0 25px rgba(139, 92, 246, 0.4);
}

/* Base Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Container with safe area support for mobile & tablet notches */
.app-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Top Navigation Bar */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-nav);
  padding: 12px 24px;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 12px;
}

.profile-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: var(--border-radius-md);
  background: rgba(59, 130, 246, 0.08);
  transition: transform 0.2s ease, background 0.2s ease;
}

.profile-pill:hover {
  transform: translateY(-2px);
  background: rgba(59, 130, 246, 0.15);
}

.avatar-bubble {
  font-size: 28px;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

.player-details {
  display: flex;
  flex-direction: column;
}

.player-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}

.level-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
}

.xp-bar-wrap {
  width: 90px;
  height: 6px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  margin-top: 3px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3B82F6, #10B981);
  width: 20%;
  transition: width 0.4s ease;
}

.nav-stats-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  background: var(--bg-card);
  padding: 6px 14px;
  border-radius: 30px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.star-icon {
  font-size: 18px;
  animation: spinSlow 8s linear infinite;
}

.streak-chip {
  color: #F59E0B;
}

.nav-controls-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
}

.nav-btn.muted-btn {
  opacity: 0.6;
}

.nav-btn.install-btn {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  font-weight: 800;
  cursor: pointer;
  animation: pulseGlow 2.5s infinite;
}

.nav-btn.install-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.55);
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  }
  50% {
    box-shadow: 0 4px 22px rgba(16, 185, 129, 0.7);
  }
}

/* Subject Carousel */
.subject-nav-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.subject-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: var(--border-radius-md);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.subject-chip:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.subject-chip.active-subject {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, var(--bg-card), rgba(59, 130, 246, 0.08));
  box-shadow: var(--shadow-glow);
}

.coming-soon-badge {
  font-size: 10px;
  background: #E2E8F0;
  color: #475569;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 700;
}

/* Age Tier Pill Selector */
.tier-selector-banner {
  background: var(--bg-card);
  padding: 16px 24px;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.tier-title-wrap h2 {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text-primary);
}

.tier-title-wrap p {
  font-size: 13px;
  color: var(--text-secondary);
}

.tier-pills-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tier-pill-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-main);
  border: 2px solid var(--border-subtle);
  border-radius: 30px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.25s ease;
}

.tier-pill-btn:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
}

.tier-pill-btn.active-tier {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
}

/* Game Catalog Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.game-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow);
}

.game-card-icon-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-card-icon {
  font-size: 48px;
  display: inline-block;
  animation: wobble 4s ease-in-out infinite;
}

.game-skill-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-primary);
}

.game-card-title {
  font-family: var(--font-display);
  font-size: 22px;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.game-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.game-card-meta {
  margin-top: 10px;
}

.high-score-tag {
  font-size: 13px;
  font-weight: 700;
  color: #F59E0B;
}

.play-game-btn {
  background: linear-gradient(135deg, var(--color-primary), #2563EB);
  color: #FFFFFF;
  border: none;
  border-radius: var(--border-radius-md);
  padding: 14px 20px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: all 0.2s ease;
}

.play-game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.play-game-btn:active {
  transform: var(--btn-scale-tap);
}

/* ==========================================================================
   Game Stage & Gameplay Layouts
   ========================================================================== */
.game-stage {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  min-height: 480px;
  box-shadow: var(--shadow-md);
  position: relative;
}

.game-top-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.back-btn {
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.back-btn:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
}

.game-progress-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.1);
  padding: 6px 16px;
  border-radius: 20px;
  color: var(--color-primary);
}

.audio-prompt-btn {
  background: #FFD166;
  color: #854D0E;
  border: none;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25);
  transition: transform 0.2s ease;
}

.audio-prompt-btn:hover {
  transform: scale(1.05);
}

/* Tier 1: Number Safari Styles */
.safari-banner {
  text-align: center;
}

.safari-question {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.safari-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.safari-meadow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  background: rgba(6, 214, 160, 0.08);
  border: 2px dashed #06D6A0;
  border-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 600px;
  min-height: 140px;
  align-items: center;
}

.safari-animal-card {
  width: 80px;
  height: 80px;
  background: #FFFFFF;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  position: relative;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.safari-animal-card:hover {
  transform: scale(1.15);
}

.animal-tapped {
  animation: bounceSquish 0.3s ease;
}

.highlight-count {
  animation: bounceSquish 0.5s ease;
  border: 3px solid #F59E0B;
}

.animal-emoji {
  font-size: 42px;
}

.animal-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 26px;
  height: 26px;
  background: #FF70A6;
  color: #FFFFFF;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.safari-choices {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.safari-num-btn {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 3px solid #FFD166;
  background: #FFFBEB;
  color: #B45309;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.safari-num-btn:hover {
  transform: scale(1.12);
  background: #FEF3C7;
}

.correct-choice {
  background: #10B981 !important;
  color: #FFFFFF !important;
  border-color: #059669 !important;
  transform: scale(1.15) !important;
}

.shake-choice {
  animation: shake 0.5s ease-in-out;
}

/* Tier 1: Shape Matcher Styles */
.shape-banner {
  text-align: center;
}

.shape-question {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.shape-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.shape-center-stage {
  padding: 20px;
}

.shape-silhouette {
  width: 150px;
  height: 150px;
  border: 4px dashed #CBD5E1;
  border-radius: var(--border-radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.02);
  transition: all 0.3s ease;
}

.silhouette-icon {
  font-size: 64px;
  opacity: 0.8;
}

.silhouette-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  margin-top: 6px;
  color: var(--text-secondary);
}

.matched-silhouette {
  animation: celebrateRotate 0.6s ease;
  background: rgba(16, 185, 129, 0.15) !important;
  border-style: solid !important;
}

.shape-options {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.shape-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 3px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.shape-choice-btn:hover {
  transform: translateY(-4px);
  border-color: var(--shape-color, #3B82F6);
}

.shape-symbol {
  font-size: 40px;
}

.shape-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.correct-shape {
  border-color: #10B981 !important;
  background: rgba(16, 185, 129, 0.1) !important;
  transform: scale(1.1) !important;
}

/* Tier 1: Memory Twin Match Styles */
.memory-banner {
  text-align: center;
}

.memory-question {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--text-primary);
}

.memory-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(3, 110px);
  gap: 18px;
  perspective: 800px;
}

.memory-card {
  width: 110px;
  height: 120px;
  cursor: pointer;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: var(--border-radius-md);
}

.memory-card.flipped .card-inner,
.memory-card.matched .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  width: 100%;
  height: 100%;
  position: absolute;
  backface-visibility: hidden;
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.card-front {
  background: linear-gradient(135deg, #3B82F6, #60A5FA);
  border: 3px solid #93C5FD;
}

.front-sparkle {
  font-size: 36px;
}

.card-back {
  background: #FFFFFF;
  border: 3px solid #10B981;
  transform: rotateY(180deg);
}

.card-emoji {
  font-size: 40px;
}

.card-label {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #1E293B;
  margin-top: 4px;
}

.memory-card.matched {
  animation: pulseGlow 1s ease infinite alternate;
}

/* Tier 2: Bubble Pop Styles */
.bubble-mission-banner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.target-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, #10B981, #059669);
  padding: 10px 28px;
  border-radius: 40px;
  color: #FFFFFF;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.target-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.target-number {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 800;
}

.bubble-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.bubble-pond {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 600px;
  padding: 30px;
  min-height: 180px;
}

.math-bubble {
  width: 76px;
  height: 76px;
  background: radial-gradient(circle at 30% 30%, #BAE6FD, #38BDF8);
  border: 3px solid #E0F2FE;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.8);
  transition: transform 0.2s ease;
}

.bubble-text {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: #0369A1;
}

.math-bubble:hover {
  transform: scale(1.12);
}

.bubble-selected {
  border-color: #F59E0B !important;
  background: radial-gradient(circle at 30% 30%, #FEF08A, #F59E0B) !important;
  transform: scale(1.15) !important;
}

.bubble-popped {
  animation: popDisappear 0.4s forwards;
}

.streak-pill {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #F59E0B;
  background: rgba(245, 158, 11, 0.12);
  padding: 6px 14px;
  border-radius: 20px;
}

/* Tier 2: Number Bridge Styles */
.bridge-title {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--text-primary);
  text-align: center;
}

.bridge-subtext {
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
}

.bridge-scene {
  width: 100%;
  max-width: 600px;
  height: 90px;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.2));
  border-radius: var(--border-radius-md);
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 10px 20px;
}

.cliff {
  position: absolute;
  bottom: 0;
  font-size: 32px;
}

.cliff-left {
  left: 20px;
}

.cliff-right {
  right: 20px;
}

.bridge-walker {
  display: inline-block;
  font-size: 36px;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.walker-hop {
  animation: hopForward 0.6s ease;
}

.bridge-equation-card {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  color: var(--text-primary);
  padding: 16px 32px;
  background: var(--bg-main);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-subtle);
}

.eq-blank {
  width: 64px;
  height: 64px;
  border: 3px dashed #F59E0B;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #F59E0B;
}

.blank-filled {
  border-style: solid !important;
  border-color: #10B981 !important;
  background: rgba(16, 185, 129, 0.1);
  color: #10B981 !important;
}

.bridge-plank-choices {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.wood-plank-btn {
  background: #D97706;
  border: 3px solid #B45309;
  border-radius: 12px;
  padding: 14px 28px;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(180, 83, 9, 0.35);
  transition: all 0.2s ease;
}

.wood-plank-btn:hover {
  transform: translateY(-4px);
  background: #B45309;
}

.correct-plank {
  background: #10B981 !important;
  border-color: #059669 !important;
  transform: scale(1.1) !important;
}

/* Tier 2: Pattern Detective Styles */
.pattern-title {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--text-primary);
  text-align: center;
}

.pattern-subtext {
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
}

.pattern-sequence-track {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 20px;
}

.stepping-stone {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--bg-main);
  border: 3px solid var(--border-subtle);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.missing-stone {
  border-color: #8B5CF6 !important;
  color: #8B5CF6 !important;
}

.stone-solved {
  border-color: #10B981 !important;
  background: rgba(16, 185, 129, 0.15) !important;
  color: #10B981 !important;
}

.pattern-clue-choices {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.clue-card-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--bg-main);
  border: 3px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.clue-card-btn:hover {
  transform: translateY(-3px);
  border-color: #8B5CF6;
}

/* Tier 3: Times-Table Blitz Styles */
.blitz-stage {
  border-color: rgba(139, 92, 246, 0.3);
}

.blitz-combo-badge {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: #06B6D4;
  background: rgba(6, 182, 212, 0.15);
  padding: 6px 14px;
  border-radius: 20px;
}

.score-display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: #8B5CF6;
}

.blitz-timer-track {
  width: 100%;
  max-width: 600px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.blitz-timer-fill {
  height: 100%;
  background: #06D6A0;
  width: 100%;
  transition: width 0.1s linear, background-color 0.3s ease;
}

.blitz-equation-card {
  padding: 24px 48px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius-lg);
  border: 2px solid rgba(139, 92, 246, 0.3);
}

.blitz-equation {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 2px;
}

.blitz-options {
  display: grid;
  grid-template-columns: repeat(2, 140px);
  gap: 18px;
}

.blitz-choice-btn {
  background: rgba(139, 92, 246, 0.15);
  border: 2px solid rgba(139, 92, 246, 0.4);
  color: var(--text-primary);
  border-radius: var(--border-radius-md);
  padding: 16px;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.blitz-choice-btn:hover {
  background: rgba(139, 92, 246, 0.3);
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}

/* Tier 3: Fraction Feast Styles */
.fraction-title {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--text-primary);
  text-align: center;
}

.fraction-subtext {
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
}

.fraction-pizza-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.fraction-svg {
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.15));
}

.pizza-slice {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.slice-active {
  animation: pulseSlice 2s ease infinite alternate;
}

.fraction-choices {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.fraction-card-btn {
  background: var(--bg-main);
  border: 2px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 12px 24px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fraction-card-btn:hover {
  transform: translateY(-3px);
  border-color: #F59E0B;
}

.frac-symbol {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

.frac-bar {
  width: 28px;
  height: 3px;
  background: var(--text-primary);
  margin: 2px 0;
}

/* Tier 3: Math Ninja Styles */
.ninja-title {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--text-primary);
  text-align: center;
}

.ninja-subtext {
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
}

.pemdas-reminder {
  font-size: 13px;
  font-weight: 700;
  color: #EC4899;
  background: rgba(236, 72, 153, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
}

.ninja-scroll {
  padding: 20px 40px;
  background: rgba(236, 72, 153, 0.05);
  border: 2px solid rgba(236, 72, 153, 0.3);
  border-radius: var(--border-radius-lg);
}

.ninja-eq-text {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
}

.ninja-slash-targets {
  display: grid;
  grid-template-columns: repeat(2, 130px);
  gap: 16px;
}

.ninja-slash-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(236, 72, 153, 0.1);
  border: 2px solid rgba(236, 72, 153, 0.3);
  color: var(--text-primary);
  border-radius: var(--border-radius-md);
  padding: 14px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ninja-slash-btn:hover {
  background: rgba(236, 72, 153, 0.25);
  transform: scale(1.05);
}

.correct-slash {
  background: #10B981 !important;
  border-color: #059669 !important;
  color: #FFFFFF !important;
}

/* =========================================================
   Tier 1 Game: Jungle Scale (Balance & Comparison)
   ========================================================= */
.scale-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.scale-banner {
  text-align: center;
}

.scale-question {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.highlight-target {
  color: #F59E0B;
  text-decoration: underline;
}

.scale-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.scale-playground {
  width: 100%;
  max-width: 440px;
  min-height: 220px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 20px 10px;
}

.seesaw-pivot {
  position: relative;
  width: 100%;
  height: 180px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.seesaw-base {
  width: 0;
  height: 0;
  border-left: 36px solid transparent;
  border-right: 36px solid transparent;
  border-bottom: 50px solid #78350F;
  position: relative;
  z-index: 1;
}

.seesaw-beam {
  position: absolute;
  top: 75px;
  left: 5%;
  width: 90%;
  height: 16px;
  background: linear-gradient(90deg, #B45309, #D97706, #B45309);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transform-origin: center center;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}

.seesaw-fulcrum-cap {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 24px;
}

.seesaw-pan {
  position: absolute;
  top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.2s ease;
}

.seesaw-pan:hover {
  transform: scale(1.05);
}

.left-pan {
  left: 10px;
}

.right-pan {
  right: 10px;
}

.pan-chain {
  width: 2px;
  height: 28px;
  background: #94A3B8;
  border-left: 2px dashed #64748B;
}

.pan-basket {
  min-width: 110px;
  min-height: 64px;
  max-width: 140px;
  background: rgba(180, 83, 9, 0.2);
  border: 3px solid #D97706;
  border-radius: 0 0 24px 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 6px;
  backdrop-filter: blur(4px);
}

.pan-badge {
  margin-top: 4px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  padding: 2px 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  color: var(--text-primary);
}

.jungle-fruit {
  font-size: 28px;
  user-select: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.fruit-bounce {
  transform: scale(1.35) translateY(-6px);
}

.pan-celebrate {
  animation: bounceSquish 0.5s ease;
  filter: drop-shadow(0 0 10px #F59E0B);
}

.scale-choices {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 440px;
  justify-content: center;
}

.scale-choice-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 14px 12px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s ease;
}

.scale-choice-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.choice-tag {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
}

.choice-summary {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}

/* =========================================================
   Tier 1 Game: Pattern Caterpillar (Sequencing & Logic)
   ========================================================= */
.caterpillar-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
}

.caterpillar-banner {
  text-align: center;
}

.caterpillar-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.caterpillar-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.caterpillar-track {
  width: 100%;
  max-width: 620px;
  padding: 24px 16px;
  background: rgba(16, 185, 129, 0.08);
  border: 2px dashed rgba(16, 185, 129, 0.4);
  border-radius: var(--border-radius-xl);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: auto;
}

.caterpillar-body {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
}

.caterpillar-head {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #059669);
  border: 3px solid #34D399;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.caterpillar-antennas {
  position: absolute;
  top: -12px;
  display: flex;
  gap: 16px;
}

.antenna {
  width: 4px;
  height: 12px;
  background: #34D399;
  border-radius: 2px;
  position: relative;
}

.antenna::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -2px;
  width: 8px;
  height: 8px;
  background: #F59E0B;
  border-radius: 50%;
}

.caterpillar-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.caterpillar-eye {
  font-size: 18px;
}

.caterpillar-smile {
  font-size: 16px;
  color: #FFFFFF;
  font-weight: bold;
}

.caterpillar-segment {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid #3B82F6;
  background: rgba(59, 130, 246, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.caterpillar-segment:hover {
  transform: scale(1.1);
}

.caterpillar-fruit {
  font-size: 30px;
  user-select: none;
}

.missing-segment {
  border: 3px dashed #F59E0B !important;
  background: rgba(245, 158, 11, 0.15) !important;
}

.missing-qm {
  font-size: 26px;
}

.caterpillar-tail {
  font-size: 28px;
}

.caterpillar-wiggle {
  animation: caterpillarWave 0.6s ease;
}

@keyframes caterpillarWave {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-8px) rotate(-2deg); }
  75% { transform: translateY(8px) rotate(2deg); }
}

.caterpillar-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.caterpillar-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 14px 22px;
  cursor: pointer;
  touch-action: manipulation;
  min-width: 95px;
  transition: all 0.2s ease;
}

.caterpillar-choice-btn:hover {
  transform: scale(1.08);
}

.choice-fruit-icon {
  font-size: 36px;
}

.choice-fruit-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

/* =========================================================
   Tier 2 Game: Time Explorer (Analog Clock Face)
   ========================================================= */
.clock-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.clock-banner {
  text-align: center;
}

.clock-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.clock-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.clock-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
}

.clock-svg {
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

.clock-choices {
  display: grid;
  grid-template-columns: repeat(2, 140px);
  gap: 14px;
  justify-content: center;
}

.clock-choice-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 14px 16px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s ease;
}

.clock-choice-card:hover {
  border-color: #38BDF8;
  transform: scale(1.05);
}

.clock-digital-icon {
  font-size: 18px;
}

.clock-digital-text {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

/* =========================================================
   Tier 2 Game: Treasure Coins (Currency & Addition)
   ========================================================= */
.treasure-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.treasure-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.gold-badge {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.3));
  border: 2px solid #F59E0B;
  border-radius: 20px;
  padding: 8px 24px;
}

.treasure-subtext {
  font-size: 15px;
  color: var(--text-secondary);
}

.treasure-vault {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 400px;
}

.treasure-chest {
  background: linear-gradient(135deg, #78350F, #451A03);
  border: 3px solid #FBBF24;
  border-radius: 24px;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-shadow: 0 8px 28px rgba(245, 158, 11, 0.25);
  transition: transform 0.2s ease;
}

.chest-lid {
  font-size: 52px;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chest-open .chest-lid {
  transform: scale(1.2) translateY(-8px);
}

.chest-meter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.meter-label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #E2E8F0;
}

.meter-val {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  color: #FBBF24;
}

.chest-coins-pile {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  min-height: 28px;
  max-width: 280px;
}

.chest-coin-token {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid #FBBF24;
  color: #FBBF24;
}

.chest-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.chest-reset-btn, .chest-unlock-btn {
  flex: 1;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: var(--border-radius-md);
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s ease;
}

.chest-reset-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 2px solid rgba(239, 68, 68, 0.4);
  color: #F87171;
}

.chest-unlock-btn {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.chest-reset-btn:hover, .chest-unlock-btn:hover {
  transform: scale(1.04);
}

.coin-tray {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.treasure-coin-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}

.treasure-coin-btn:hover {
  transform: scale(1.12);
}

.coin-denomination {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  color: #FFFFFF;
  line-height: 1;
}

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

/* =========================================================
   Tier 3 Game: Laser Angle Hunter (Geometry & Optics)
   ========================================================= */
.angle-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.angle-banner {
  text-align: center;
}

.angle-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.angle-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.angle-radar-terminal {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
}

.radar-svg {
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid rgba(56, 189, 248, 0.3);
  border-radius: 20px;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.18);
}

.angle-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 380px;
}

.angle-choice-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 12px 18px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s ease;
}

.angle-choice-card:hover {
  transform: translateX(4px);
}

.angle-card-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
}

.angle-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

/* =========================================================
   Tier 3 Game: Cyber Vault Prime Detective
   ========================================================= */
.prime-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.prime-banner {
  text-align: center;
}

.prime-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.prime-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.prime-vault-terminal {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 6px 0;
}

.vault-dial {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, #1E293B 40%, #0F172A 100%);
  border: 4px dashed #38BDF8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.22);
}

.vault-icon {
  font-size: 24px;
}

.vault-number-badge {
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 900;
  color: #38BDF8;
  line-height: 1.1;
}

.vault-factor-hint {
  font-size: 12px;
  font-weight: 700;
  color: #A855F7;
  margin-top: 4px;
}

.prime-choices {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  max-width: 440px;
}

.prime-choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 14px 18px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s ease;
}

.prime-choice-card:hover {
  transform: translateY(-3px);
}

.prime-type-btn {
  flex: 1;
  min-width: 160px;
  border-color: #38BDF8;
}

.composite-type-btn {
  flex: 1;
  min-width: 160px;
  border-color: #F59E0B;
}

.prime-btn-icon {
  font-size: 28px;
}

.prime-btn-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
}

.prime-btn-desc {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.code-pill-btn {
  min-width: 78px;
  min-height: 78px;
  border-radius: 20px;
  border-color: #38BDF8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.code-lock-icon {
  font-size: 18px;
}

.code-number-text {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  color: #38BDF8;
}

/* =========================================================
   English Language Games Styling
   ========================================================= */

/* Game 1: Alphabet Phonics Safari */
.alphabet-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.alphabet-banner {
  text-align: center;
}

.alphabet-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.alphabet-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.alphabet-target-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.alphabet-picture-card {
  width: 180px;
  height: 180px;
  border-radius: var(--border-radius-xl);
  background: var(--bg-card);
  border: 3px solid #10B981;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s ease;
}

.alphabet-emoji {
  font-size: 64px;
}

.alphabet-word-hint {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 2px;
}

.alphabet-choices {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.alphabet-letter-btn {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.alphabet-letter-btn:hover {
  transform: scale(1.12);
  border-color: #10B981;
}

.letter-char {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  color: #10B981;
}

/* Game 2: Sight Word Pop */
.sight-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.sight-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.word-badge {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.3));
  border: 2px solid #10B981;
  border-radius: 20px;
  padding: 8px 24px;
}

.sight-subtext {
  font-size: 15px;
  color: var(--text-secondary);
}

.balloon-sky {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 18px;
  min-height: 220px;
  padding: 20px 10px;
  width: 100%;
  max-width: 500px;
}

.sight-balloon {
  width: 95px;
  height: 120px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  border: 2px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  position: relative;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  animation: floatBalloon 3s ease-in-out infinite alternate;
  transition: transform 0.2s ease;
}

.sight-balloon:hover {
  transform: scale(1.1);
}

@keyframes floatBalloon {
  0% { transform: translateY(0px) rotate(-2deg); }
  100% { transform: translateY(-12px) rotate(2deg); }
}

.balloon-word {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: #FFFFFF;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.balloon-string {
  position: absolute;
  bottom: -16px;
  width: 2px;
  height: 16px;
  background: #94A3B8;
}

.balloon-popped {
  animation: popScale 0.3s forwards;
}

@keyframes popScale {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
  100% { transform: scale(0); opacity: 0; }
}

/* Game 3: Spelling Bee Adventure */
.spelling-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.spelling-banner {
  text-align: center;
}

.spelling-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.spelling-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.spelling-clue-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 2px solid #F59E0B;
  border-radius: var(--border-radius-lg);
  padding: 16px 24px;
}

.spelling-emoji {
  font-size: 52px;
}

.spelling-hint-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

.spelling-slots-container {
  display: flex;
  gap: 10px;
  justify-content: center;
  min-height: 60px;
  padding: 6px;
}

.spelling-slot-box {
  width: 54px;
  height: 58px;
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.1);
  border: 2px dashed #F59E0B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  color: #F59E0B;
  cursor: pointer;
  transition: all 0.2s ease;
}

.slot-filled {
  border-style: solid;
  background: var(--bg-card);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.spelling-actions {
  display: flex;
  justify-content: center;
}

.spelling-reset-btn {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 2px solid rgba(239, 68, 68, 0.4);
  color: #F87171;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s ease;
}

.spelling-reset-btn:hover {
  transform: scale(1.05);
}

.spelling-tiles-rack {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.spelling-tile-btn {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: all 0.15s ease;
}

.spelling-tile-btn:hover:not(:disabled) {
  transform: scale(1.12);
  border-color: #F59E0B;
}

.tile-used {
  opacity: 0.3;
  cursor: not-allowed;
  transform: scale(0.9);
}

/* Game 4: Rhyme Express */
.rhyme-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.rhyme-banner {
  text-align: center;
}

.rhyme-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.rhyme-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.rhyme-train-track {
  width: 100%;
  max-width: 480px;
  background: rgba(56, 189, 248, 0.08);
  border: 2px dashed rgba(56, 189, 248, 0.4);
  border-radius: var(--border-radius-xl);
  padding: 20px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.train-engine {
  display: flex;
  align-items: center;
  gap: 12px;
}

.train-locomotive {
  font-size: 50px;
}

.train-smokestack {
  font-size: 26px;
  animation: puffSmoke 1.5s infinite alternate;
}

@keyframes puffSmoke {
  0% { transform: translateY(0) scale(0.8); opacity: 0.4; }
  100% { transform: translateY(-8px) scale(1.2); opacity: 0.9; }
}

.lead-cargo {
  background: var(--bg-card);
  border: 2px solid #38BDF8;
  border-radius: var(--border-radius-lg);
  padding: 10px 20px;
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.25);
}

.target-word-badge {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  color: #38BDF8;
}

.rhyme-choices {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.rhyme-cargo-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 14px 22px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s ease;
}

.rhyme-cargo-btn:hover {
  transform: scale(1.08);
  border-color: #38BDF8;
}

.cargo-icon {
  font-size: 24px;
}

.cargo-word {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}

/* Game 5: Vocabulary & Synonyms Master */
.vocab-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: 100%;
}

.vocab-banner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.vocab-type-badge {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  padding: 4px 16px;
  border-radius: 20px;
  letter-spacing: 1px;
}

.badge-synonym {
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
  border: 1px solid #10B981;
}

.badge-antonym {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
  border: 1px solid #F87171;
}

.vocab-target-word {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 900;
  color: var(--text-primary);
}

.vocab-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.vocab-choices {
  display: grid;
  grid-template-columns: repeat(2, 160px);
  gap: 14px;
  justify-content: center;
}

.vocab-choice-card {
  padding: 16px;
  border-radius: var(--border-radius-lg);
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vocab-choice-card:hover {
  transform: scale(1.06);
  border-color: #3B82F6;
}

.vocab-choice-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

/* Game 6: Grammar Detective */
.grammar-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.grammar-banner {
  text-align: center;
}

.grammar-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.grammar-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.grammar-case-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 2px solid #A855F7;
  border-radius: var(--border-radius-lg);
  padding: 20px;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.18);
}

.sentence-bubble {
  font-size: 20px;
  line-height: 1.5;
  color: var(--text-primary);
  text-align: center;
}

.highlight-word {
  background: rgba(168, 85, 247, 0.25);
  border-bottom: 3px solid #A855F7;
  color: #C084FC;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.grammar-choices {
  display: grid;
  grid-template-columns: repeat(2, 160px);
  gap: 12px;
  justify-content: center;
}

.grammar-choice-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s ease;
}

.grammar-choice-card:hover {
  transform: translateX(4px);
}

.pos-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
}

.pos-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

/* =========================================================
   Hindi Language Games Styling (Devanagari Typography)
   ========================================================= */
.hindi-stage {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Devanagari", sans-serif;
}

.devanagari-char {
  font-size: 34px;
  font-weight: 900;
  color: #EA580C;
}

.devanagari-char-big {
  font-size: 42px;
  font-weight: 900;
  color: #38BDF8;
}

/* Akshar Vatika */
.akshar-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.akshar-banner {
  text-align: center;
}

.akshar-title {
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.akshar-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.akshar-target-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
}

.akshar-picture-card {
  width: 180px;
  height: 180px;
  border-radius: var(--border-radius-xl);
  background: var(--bg-card);
  border: 3px solid #EA580C;
  box-shadow: 0 10px 25px rgba(234, 88, 12, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.akshar-emoji {
  font-size: 64px;
}

.akshar-word-hint {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 2px;
}

.akshar-choices {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.akshar-choice-btn {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s ease;
}

.akshar-choice-btn:hover {
  transform: scale(1.12);
  border-color: #EA580C;
}

/* Suno Aur Chuno */
.suno-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.suno-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.audio-listen-badge {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(3, 105, 161, 0.3));
  border: 2px solid #38BDF8;
  border-radius: 20px;
  padding: 8px 24px;
}

.suno-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.suno-choices {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.suno-letter-card {
  width: 86px;
  height: 86px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.suno-letter-card:hover {
  transform: scale(1.12);
  border-color: #38BDF8;
}

/* Matra Magic */
.matra-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.matra-banner {
  text-align: center;
}

.matra-title {
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.matra-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.matra-clue-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 2px solid #F59E0B;
  border-radius: var(--border-radius-lg);
  padding: 16px 28px;
}

.matra-emoji {
  font-size: 52px;
}

.matra-hint-text {
  font-size: 15px;
  color: var(--text-secondary);
}

.matra-equation-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 12px 24px;
}

.word-part {
  font-size: 34px;
  font-weight: 800;
  color: var(--text-primary);
}

.matra-slot-box {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.15);
  border: 2px dashed #F59E0B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  color: #F59E0B;
}

.matra-choices {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.matra-choice-btn {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s ease;
}

.matra-choice-btn:hover {
  transform: scale(1.12);
  border-color: #F59E0B;
}

.matra-symbol {
  font-size: 36px;
  font-weight: 900;
  color: #F59E0B;
}

/* Shabd Nirman */
.shabd-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.shabd-banner {
  text-align: center;
}

.shabd-title {
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.shabd-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.shabd-clue-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 2px solid #10B981;
  border-radius: var(--border-radius-lg);
  padding: 14px 24px;
}

.shabd-emoji {
  font-size: 52px;
}

.shabd-hint-text {
  font-size: 15px;
  color: var(--text-secondary);
}

.shabd-slots-container {
  display: flex;
  gap: 10px;
  justify-content: center;
  min-height: 58px;
}

.shabd-slot-box {
  width: 56px;
  height: 58px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.12);
  border: 2px dashed #10B981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 900;
  color: #10B981;
  cursor: pointer;
}

.shabd-actions {
  display: flex;
  justify-content: center;
}

.shabd-reset-btn {
  font-size: 14px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 2px solid rgba(239, 68, 68, 0.4);
  color: #F87171;
  cursor: pointer;
  touch-action: manipulation;
}

.shabd-tiles-rack {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.shabd-tile-btn {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  font-size: 30px;
  font-weight: 900;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s ease;
}

.shabd-tile-btn:hover:not(:disabled) {
  transform: scale(1.12);
  border-color: #10B981;
}

/* Vilom Shabd */
.vilom-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: 100%;
}

.vilom-banner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.badge-vilom {
  background: rgba(234, 88, 12, 0.2);
  color: #EA580C;
  border: 1px solid #EA580C;
}

.badge-samanarthi {
  background: rgba(56, 189, 248, 0.2);
  color: #38BDF8;
  border: 1px solid #38BDF8;
}

.vilom-target-word {
  font-size: 42px;
  font-weight: 900;
  color: var(--text-primary);
}

.vilom-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.vilom-choices {
  display: grid;
  grid-template-columns: repeat(2, 160px);
  gap: 14px;
  justify-content: center;
}

.vilom-choice-card {
  padding: 16px;
  border-radius: var(--border-radius-lg);
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vilom-choice-card:hover {
  transform: scale(1.06);
  border-color: #EA580C;
}

.vilom-choice-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}

/* Vyakaran Yoddha */
.vyakaran-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.vyakaran-banner {
  text-align: center;
}

.vyakaran-title {
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.vyakaran-subtext {
  font-size: 16px;
  color: var(--text-secondary);
}

.vyakaran-sentence-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 2px solid #EA580C;
  border-radius: var(--border-radius-lg);
  padding: 20px;
  box-shadow: 0 8px 24px rgba(234, 88, 12, 0.18);
}

.sentence-bubble-hindi {
  font-size: 22px;
  line-height: 1.5;
  color: var(--text-primary);
  text-align: center;
}

.vyakaran-choices {
  display: grid;
  grid-template-columns: repeat(2, 160px);
  gap: 12px;
  justify-content: center;
}

.vyakaran-choice-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.2s ease;
}

.vyakaran-choice-card:hover {
  transform: translateX(4px);
}

.vyakaran-type-title {
  font-size: 18px;
  font-weight: 800;
}

.vyakaran-type-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Celebrations */
.celebration-card {
  text-align: center;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.celebration-icon {
  font-size: 64px;
  animation: bounceSquish 1s infinite alternate;
}

.celebration-card h2 {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--text-primary);
}

.reward-summary {
  display: flex;
  gap: 20px;
  margin: 10px 0;
}

.reward-item {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  background: rgba(59, 130, 246, 0.1);
  padding: 8px 18px;
  border-radius: 30px;
  color: var(--color-primary);
}

.celebrate-btn {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  border: none;
  border-radius: var(--border-radius-md);
  padding: 14px 32px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}

.celebrate-btn:hover {
  transform: scale(1.05);
}

/* Floating Reward Pills */
.floating-reward-pill {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  padding: 6px 16px;
  border-radius: 20px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.xp-reward {
  background: #3B82F6;
  color: #FFFFFF;
}

.star-reward {
  background: #F59E0B;
  color: #FFFFFF;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 650px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title-wrap h2 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text-primary);
}

.modal-icon {
  font-size: 26px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
}

.section-title {
  font-family: var(--font-display);
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.avatar-card {
  background: var(--bg-main);
  border: 2px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
}

.avatar-card.active-avatar {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.12);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

.avatar-emoji {
  font-size: 32px;
}

.avatar-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
}

.profile-name-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.profile-name-bar label {
  font-size: 13px;
  font-weight: 700;
}

.profile-name-bar input {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
}

.save-name-btn {
  background: var(--color-primary);
  color: #FFFFFF;
  border: none;
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  font-weight: 700;
  cursor: pointer;
}

/* Badges Grid */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.badge-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--border-radius-md);
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
}

.badge-card.badge-unlocked {
  border-color: #F59E0B;
  background: rgba(245, 158, 11, 0.06);
}

.badge-icon-wrap {
  font-size: 32px;
}

.badge-title {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-primary);
}

.badge-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.badge-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  margin: 6px 0 2px;
  overflow: hidden;
}

.badge-progress-fill {
  height: 100%;
  background: #3B82F6;
}

.badge-progress-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.badge-status-tag {
  font-size: 11px;
  font-weight: 700;
  color: #D97706;
}

/* Parent Modal Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.metric-card {
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-val {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
}

.metric-lbl {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 700;
}

.text-cyan { color: #06B6D4; }
.text-green { color: #10B981; }
.text-purple { color: #8B5CF6; }
.text-amber { color: #F59E0B; }

.curriculum-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.curriculum-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-main);
  border-radius: var(--border-radius-sm);
}

.curr-name {
  font-size: 13px;
  font-weight: 700;
}

.curr-status-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
}

.status-good {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.status-started {
  background: rgba(59, 130, 246, 0.15);
  color: #3B82F6;
}

.safety-banner {
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(6, 214, 160, 0.1);
  border: 1px solid #06D6A0;
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  font-size: 12px;
  color: var(--text-primary);
}

.safety-icon {
  font-size: 24px;
}

.parent-actions {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reset-danger-btn {
  background: transparent;
  border: 1px dashed #EF4444;
  color: #EF4444;
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  font-weight: 700;
  cursor: pointer;
  align-self: flex-start;
}

.gate-box {
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 14px;
}

.gate-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.gate-input-row {
  display: flex;
  gap: 8px;
}

.gate-input-row input {
  width: 100px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.gate-confirm-btn {
  background: #EF4444;
  color: #FFFFFF;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.gate-error {
  font-size: 12px;
  color: #EF4444;
  margin-top: 6px;
}

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes wobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-6deg); }
  75% { transform: rotate(6deg); }
}

@keyframes bounceSquish {
  0% { transform: scale(1); }
  40% { transform: scale(1.3, 0.8); }
  80% { transform: scale(0.9, 1.1); }
  100% { transform: scale(1); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes popDisappear {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
  100% { transform: scale(0); opacity: 0; }
}

@keyframes hopForward {
  0% { transform: translateY(0); }
  50% { transform: translateY(-24px); }
  100% { transform: translateY(0); }
}

@keyframes celebrateRotate {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.2) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}

@keyframes pulseBorder {
  0%, 100% { border-color: #F59E0B; }
  50% { border-color: #8B5CF6; }
}

.pulse-border {
  animation: pulseBorder 1.5s infinite;
}

.pop-in {
  animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fade-in {
  animation: fadeIn 0.25s ease;
}

/* ==========================================================================
   Multi-Page Application Architecture Views
   ========================================================================== */
.app-page-view {
  width: 100%;
}

.page-view-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

/* Breadcrumb & Sub-Navigation Header Bar */
.view-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.back-nav-btn {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: 30px;
  padding: 8px 18px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.back-nav-btn:hover {
  transform: translateX(-3px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.child-indicator-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 6px 16px;
  border-radius: 30px;
  font-family: var(--font-display);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.indicator-emoji {
  font-size: 22px;
}

.indicator-name {
  font-size: 15px;
  color: var(--text-primary);
}

.indicator-stars {
  font-size: 13px;
  color: #F59E0B;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  background: var(--bg-card);
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.crumb-link {
  cursor: pointer;
  color: var(--color-primary);
  transition: opacity 0.2s;
}

.crumb-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

.crumb-separator {
  color: var(--text-secondary);
  opacity: 0.5;
}

.crumb-current {
  color: var(--text-primary);
}

/* Switch Child button in Top Nav */
.nav-btn.switch-child-nav-btn {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.25);
  color: var(--color-primary);
  font-weight: 800;
}

.nav-btn.switch-child-nav-btn:hover {
  background: var(--color-primary);
  color: #FFFFFF;
}

/* Page 1: Child Profile Selection View */
.profiles-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 10px 0 16px;
}

.hero-badge-pill {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(16, 185, 129, 0.12));
  color: var(--color-primary);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 5px 16px;
  border-radius: 30px;
}

.profiles-hero-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  color: var(--text-primary);
}

.profiles-hero-sub {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.5;
}

.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  width: 100%;
}

.child-profile-card {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  box-shadow: var(--shadow-md);
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.child-profile-card:hover {
  transform: translateY(-6px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
}

.child-profile-card.active-profile-card {
  border-color: #10B981;
  background: linear-gradient(180deg, var(--bg-card), rgba(16, 185, 129, 0.04));
}

.current-active-tag {
  position: absolute;
  top: 12px;
  right: 14px;
  background: #10B981;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.delete-profile-btn {
  position: absolute;
  top: 12px;
  left: 14px;
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s, transform 0.2s;
  padding: 4px;
}

.delete-profile-btn:hover {
  opacity: 1;
  transform: scale(1.2);
}

.profile-avatar-large {
  width: 86px;
  height: 86px;
  background: rgba(59, 130, 246, 0.08);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.06);
}

.avatar-face {
  font-size: 48px;
  animation: float 3s ease-in-out infinite;
}

.profile-name-text {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

.profile-tier-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
  background: rgba(59, 130, 246, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
  margin-top: 4px;
}

.profile-stats-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 6px;
}

.mini-stat {
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: 12px;
  color: var(--text-secondary);
}

.select-child-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--color-primary), #2563EB);
  color: #FFFFFF;
  border: none;
  border-radius: var(--border-radius-md);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all 0.2s ease;
  margin-top: 6px;
}

.select-child-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
}

.add-child-card {
  background: rgba(59, 130, 246, 0.04);
  border: 3px dashed rgba(59, 130, 246, 0.35);
  border-radius: var(--border-radius-lg);
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  cursor: pointer;
  min-height: 270px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.add-child-card:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: var(--color-primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-sm);
}

.add-icon-circle {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #3B82F6, #10B981);
  color: #FFFFFF;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28px;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}

.add-card-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}

.add-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 200px;
}

/* Add Child Modal Form */
.new-profile-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.form-group input[type="text"] {
  padding: 12px 16px;
  border: 2px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  font-family: var(--font-body);
  font-size: 16px;
  background: var(--bg-main);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.form-group input[type="text"]:focus {
  border-color: var(--color-primary);
}

.avatar-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px;
  background: var(--bg-main);
  border: 2px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.avatar-option.selected {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.12);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.25);
}

.av-emoji {
  font-size: 32px;
}

.av-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
}

.tier-choice-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tier-choice-label {
  display: block;
  cursor: pointer;
}

.tier-choice-label input {
  display: none;
}

.tier-choice-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  background: var(--bg-main);
  border: 2px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  transition: all 0.2s;
}

.tier-choice-box strong {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-primary);
}

.tier-choice-box small {
  font-size: 12px;
  color: var(--text-secondary);
}

.tier-choice-label input:checked + .tier-choice-box {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.08);
}

.modal-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.cancel-modal-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  padding: 10px 18px;
  border-radius: var(--border-radius-sm);
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
}

.create-profile-btn {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  border: none;
  padding: 10px 22px;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Page 2: Subject Selection View */
.subjects-hero {
  text-align: center;
  margin: 8px 0 20px;
}

.subjects-hero-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  color: var(--text-primary);
}

.subjects-hero-sub {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 6px auto 0;
}

.subjects-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  width: 100%;
}

.subject-hero-card {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  min-height: 240px;
}

.subject-hero-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow);
}

.subject-hero-card.subject-ready {
  border-color: rgba(59, 130, 246, 0.3);
}

.subject-hero-card.subject-ready:hover {
  border-color: var(--color-primary);
}

.subject-hero-card.subject-locked {
  opacity: 0.8;
  cursor: default;
}

.sub-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sub-card-icon {
  font-size: 52px;
  animation: wobble 4s ease-in-out infinite;
}

.sub-card-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
}

.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.badge-soon {
  background: #E2E8F0;
  color: #64748B;
}

.sub-card-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.sub-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.sub-card-action-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: var(--border-radius-md);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ready {
  background: linear-gradient(135deg, var(--color-primary), #2563EB);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-soon {
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* Page 3: Games Header Banner (Locked to Child's Profile Stage) */
.games-header-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 16px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.games-header-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}

.games-header-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.profile-stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 30px;
}

.stage-badge-icon {
  font-size: 18px;
}

/* ==========================================================================
   Mobile Bottom Dock Navigation & Touch Ergonomics
   ========================================================================== */
.mobile-bottom-dock {
  display: none;
}

/* Tablet & Mobile Devices (<= 768px) */
@media (max-width: 768px) {
  /* Prevent content from being hidden behind fixed bottom dock */
  .app-container {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    gap: 14px;
  }

  /* Fixed Mobile Bottom Dock */
  .mobile-bottom-dock {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
    padding: 6px 12px calc(8px + env(safe-area-inset-bottom, 0px)) 12px;
    justify-content: space-around;
    align-items: center;
    transition: background 0.3s ease;
  }

  body[data-tier="tier3"] .mobile-bottom-dock {
    background: rgba(16, 22, 36, 0.94);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
  }

  .dock-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: none;
    border-radius: 12px;
    padding: 6px 8px;
    min-width: 52px;
    min-height: 48px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    -webkit-tap-highlight-color: transparent;
  }

  .dock-btn:active {
    transform: scale(0.9);
    background: rgba(59, 130, 246, 0.1);
  }

  .dock-btn.active {
    color: var(--color-primary);
  }

  .dock-btn.dock-btn-muted {
    opacity: 0.55;
  }

  .dock-icon {
    font-size: 20px;
    line-height: 1;
  }

  .dock-label {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
  }

  .dock-install-btn {
    background: linear-gradient(135deg, #10B981, #059669);
    color: #FFFFFF !important;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
    animation: pulseGlow 2.5s infinite;
  }

  /* Compact Top Navigation as Mobile Status Header */
  .top-nav {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    border-radius: 18px;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .profile-pill {
    padding: 4px 10px;
    gap: 8px;
  }

  .avatar-bubble {
    font-size: 24px;
  }

  .player-name {
    font-size: 13px;
    max-width: 95px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .level-tag {
    font-size: 11px;
  }

  .xp-bar-wrap {
    width: 60px;
    height: 5px;
  }

  .nav-stats-group {
    gap: 8px;
    flex-wrap: nowrap;
  }

  .stat-chip {
    padding: 4px 10px;
    font-size: 13px;
    gap: 4px;
  }

  .star-icon {
    font-size: 15px;
  }

  /* Hide top desktop buttons on mobile - migrated to bottom dock */
  .nav-controls-group {
    display: none !important;
  }

  /* Multi-page mobile view adaptations */
  .profiles-hero-title,
  .subjects-hero-title {
    font-size: 26px;
  }

  .profiles-hero-sub,
  .subjects-hero-sub {
    font-size: 13px;
  }

  .profiles-grid,
  .subjects-card-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .view-header-bar {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .back-nav-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 13px;
  }

  .child-indicator-pill {
    flex-shrink: 0;
    padding: 5px 12px;
    font-size: 13px;
  }

  .breadcrumb-trail {
    flex-shrink: 0;
    font-size: 12px;
    padding: 6px 14px;
    white-space: nowrap;
  }

  .games-header-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
    gap: 10px;
  }

  .games-header-title {
    font-size: 18px;
  }

  .games-header-sub {
    font-size: 12px;
  }

  .profile-stage-badge {
    font-size: 12px;
    padding: 5px 12px;
  }

  .avatar-select-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  /* Horizontal touch scrolling for Subject Navigation */
  .subject-nav-container {
    gap: 8px;
    padding: 2px 0 6px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  .subject-chip {
    scroll-snap-align: start;
    padding: 8px 16px;
    font-size: 14px;
    gap: 8px;
    border-radius: 14px;
  }

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

  /* Age Tier Selector on Mobile */
  .tier-selector-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px;
    gap: 12px;
  }

  .tier-title-wrap {
    text-align: left;
  }

  .tier-title-wrap h2 {
    font-size: 17px;
  }

  .tier-title-wrap p {
    font-size: 12px;
  }

  .tier-pills-group {
    display: flex;
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 8px;
    padding-bottom: 4px;
  }

  .tier-pill-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 20px;
  }

  /* Game Catalog Grid Mobile */
  .games-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .game-card {
    padding: 18px;
    border-radius: 20px;
    gap: 14px;
  }

  .game-card-icon {
    font-size: 40px;
  }

  .game-card-title {
    font-size: 19px;
  }

  .game-card-desc {
    font-size: 13px;
  }

  .play-game-btn {
    padding: 12px 18px;
    font-size: 15px;
    min-height: 48px;
  }

  /* Mini-Game Stage Ergonomics */
  .game-stage {
    padding: 16px 14px;
    min-height: auto;
    border-radius: 20px;
    gap: 18px;
  }

  .game-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 6px;
  }

  .back-btn {
    padding: 8px 12px;
    font-size: 13px;
    min-height: 44px;
    min-width: 44px;
  }

  .game-progress-pills {
    font-size: 13px;
    padding: 5px 12px;
  }

  .audio-prompt-btn {
    padding: 8px 12px;
    font-size: 13px;
    min-height: 44px;
  }

  /* Safari Meadow Mobile */
  .safari-question {
    font-size: 22px;
  }

  .safari-subtext {
    font-size: 14px;
  }

  .safari-meadow {
    gap: 12px;
    padding: 16px;
    max-width: 100%;
    min-height: 120px;
  }

  .safari-animal-card {
    width: 64px;
    height: 64px;
  }

  .animal-emoji {
    font-size: 34px;
  }

  .animal-badge {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }

  .safari-choices {
    gap: 12px;
  }

  .safari-num-btn {
    width: 64px;
    height: 64px;
    font-size: 28px;
  }

  /* Shape Matcher Mobile */
  .shape-question {
    font-size: 22px;
  }

  .shape-subtext {
    font-size: 14px;
  }

  .shape-silhouette {
    width: 120px;
    height: 120px;
  }

  .silhouette-icon {
    font-size: 52px;
  }

  .shape-options {
    gap: 12px;
    width: 100%;
    max-width: 320px;
  }

  .shape-choice-btn {
    flex: 1 1 calc(50% - 12px);
    padding: 12px 14px;
    min-height: 64px;
  }

  .shape-symbol {
    font-size: 32px;
  }

  .shape-name {
    font-size: 14px;
  }

  /* Memory Twins Mobile */
  .memory-question {
    font-size: 22px;
  }

  .memory-subtext {
    font-size: 14px;
  }

  .memory-board {
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    max-width: 320px;
    gap: 10px;
  }

  .memory-card {
    width: 100%;
    height: 98px;
  }

  .card-emoji {
    font-size: 32px;
  }

  .card-label {
    font-size: 12px;
  }

  .front-sparkle {
    font-size: 28px;
  }

  /* Bubble Pop Mobile */
  .target-number {
    font-size: 34px;
  }

  .bubble-pond {
    padding: 16px 8px;
    gap: 12px;
    min-height: 160px;
  }

  .math-bubble {
    width: 62px;
    height: 62px;
  }

  .bubble-text {
    font-size: 22px;
  }

  /* Number Bridge Mobile */
  .bridge-title {
    font-size: 22px;
  }

  .bridge-equation-card {
    padding: 12px 18px;
    font-size: 28px;
    gap: 10px;
  }

  .eq-blank {
    width: 52px;
    height: 52px;
  }

  .bridge-scene {
    height: 75px;
    padding: 6px 14px;
  }

  .cliff {
    font-size: 24px;
  }

  .bridge-walker {
    font-size: 28px;
  }

  .bridge-plank-choices {
    gap: 10px;
  }

  .wood-plank-btn {
    padding: 10px 20px;
    font-size: 24px;
    min-height: 52px;
  }

  /* Pattern Detective Mobile */
  .pattern-title {
    font-size: 22px;
  }

  .pattern-sequence-track {
    gap: 10px;
    padding: 12px 4px;
  }

  .stepping-stone {
    width: 54px;
    height: 54px;
    font-size: 20px;
  }

  .pattern-clue-choices {
    gap: 10px;
  }

  .clue-card-btn {
    padding: 10px 18px;
    font-size: 22px;
    min-height: 50px;
  }

  /* Times Table Blitz Mobile */
  .blitz-equation {
    font-size: 36px;
  }

  .blitz-equation-card {
    padding: 16px 28px;
  }

  .blitz-options {
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
    max-width: 320px;
    gap: 12px;
  }

  .blitz-choice-btn {
    padding: 14px;
    font-size: 26px;
    min-height: 56px;
  }

  /* Fraction Feast Mobile */
  .fraction-title {
    font-size: 22px;
  }

  .fraction-pizza-container {
    padding: 4px;
  }

  .fraction-svg {
    max-width: 200px;
    max-height: 200px;
    width: 100%;
  }

  .fraction-choices {
    gap: 10px;
    width: 100%;
    max-width: 320px;
  }

  .fraction-card-btn {
    flex: 1 1 calc(50% - 10px);
    padding: 10px 16px;
    min-height: 54px;
  }

  .frac-symbol {
    font-size: 20px;
  }

  /* Math Ninja Mobile */
  .ninja-title {
    font-size: 22px;
  }

  .ninja-scroll {
    padding: 14px 20px;
  }

  .ninja-eq-text {
    font-size: 28px;
  }

  .ninja-slash-targets {
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
    max-width: 300px;
    gap: 12px;
  }

  .ninja-slash-btn {
    padding: 12px;
    font-size: 22px;
    min-height: 54px;
  }

  /* Celebration Card Mobile */
  .celebration-card {
    padding: 24px 14px;
    gap: 12px;
  }

  .celebration-icon {
    font-size: 48px;
  }

  .celebration-card h2 {
    font-size: 24px;
  }

  .reward-summary {
    flex-direction: row;
    gap: 12px;
  }

  .reward-item {
    font-size: 15px;
    padding: 6px 14px;
  }

  /* Modals: Bottom-Sheet Drawer on Mobile */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-dialog {
    max-width: 100%;
    max-height: 88vh;
    border-radius: 24px 24px 0 0;
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0px)) 16px;
    animation: slideUpModal 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }

  .modal-header {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 10;
  }

  .modal-close-btn {
    font-size: 26px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .avatar-grid {
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 8px;
  }

  .badges-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

/* Smartphone Compact (<= 480px) */
@media (max-width: 480px) {
  .player-name {
    max-width: 70px;
  }

  .xp-bar-wrap {
    width: 45px;
  }

  .stat-chip {
    padding: 3px 8px;
    font-size: 12px;
  }

  .safari-animal-card {
    width: 58px;
    height: 58px;
  }

  .animal-emoji {
    font-size: 30px;
  }

  .safari-num-btn {
    width: 58px;
    height: 58px;
    font-size: 26px;
  }

  .memory-card {
    height: 90px;
  }

  .stepping-stone {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  .dock-btn {
    min-width: 46px;
    padding: 5px 4px;
  }

  .dock-label {
    font-size: 10px;
  }
}

/* Ultra-Compact Screens (<= 360px) */
@media (max-width: 360px) {
  .player-name {
    display: none;
  }

  .level-tag {
    font-size: 10px;
  }
}

@keyframes slideUpModal {
  from {
    transform: translateY(100%);
    opacity: 0.5;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ==========================================================================
   PARENT PORTAL TABS & REPORT CARD STYLING
   ========================================================================== */

.portal-tabs-bar {
  display: flex;
  gap: 8px;
  padding: 12px 24px 0;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.4);
  overflow-x: auto;
  scrollbar-width: none;
}

.portal-tabs-bar::-webkit-scrollbar {
  display: none;
}

.portal-tab-btn {
  padding: 10px 18px;
  border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.portal-tab-btn:hover {
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.05);
}

.portal-tab-btn.active {
  color: var(--color-primary);
  background: var(--bg-card);
  border-color: var(--border-subtle);
  border-bottom: 2px solid var(--color-primary);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
}

.duels-summary-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.12), rgba(168, 85, 247, 0.12));
  border: 1px solid rgba(236, 72, 153, 0.3);
  border-radius: var(--border-radius-lg);
  padding: 12px 16px;
  margin-top: 14px;
}

.duel-summary-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--text-light);
}

.duel-summary-info strong {
  color: #F472B6;
}

/* Report Card Tab */
.report-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.report-student-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.report-avatar-emoji {
  font-size: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.report-student-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-light);
  margin-bottom: 2px;
}

.report-student-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.report-grade-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #F59E0B, #D97706);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
}

.report-grade-val {
  font-size: 20px;
  font-weight: 900;
  color: #FFFFFF;
  line-height: 1;
}

.report-grade-lbl {
  font-size: 9px;
  text-transform: uppercase;
  font-weight: 800;
  color: #FEF3C7;
}

.report-subjects-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.report-subject-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 16px;
}

.report-subject-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.report-subj-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-subj-title h4 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-light);
}

.report-subj-tag {
  font-size: 13px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 20px;
}

.report-competencies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.comp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.comp-check {
  color: #10B981;
  font-weight: 900;
  font-size: 15px;
}

.report-recommendation-box {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--border-radius-md);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}

.report-recommendation-box strong {
  color: #FBBF24;
  display: block;
  margin-bottom: 4px;
}

/* ==========================================================================
   PRINTABLE CERTIFICATE OF MASTERY
   ========================================================================== */

.cert-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.cert-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  border: none;
  border-radius: var(--border-radius-md);
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}

.cert-print-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.cert-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* Parchment / Diploma Frame */
.certificate-frame {
  background: #FFFDF8;
  color: #1E293B;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  position: relative;
  font-family: 'Fredoka', 'Noto Sans Devanagari', serif, sans-serif;
  overflow: hidden;
}

.cert-inner-border {
  border: 4px double #D97706;
  border-radius: 6px;
  padding: 28px 24px 20px;
  position: relative;
  background: radial-gradient(circle at center, rgba(254, 243, 199, 0.3) 0%, rgba(255, 253, 248, 0.9) 100%);
  text-align: center;
}

.cert-corner {
  position: absolute;
  color: #D97706;
  font-size: 20px;
  line-height: 1;
}

.cert-top-left { top: 8px; left: 8px; }
.cert-top-right { top: 8px; right: 8px; }
.cert-bottom-left { bottom: 8px; left: 8px; }
.cert-bottom-right { bottom: 8px; right: 8px; }

.cert-academy-logo {
  font-size: 36px;
  margin-bottom: 4px;
}

.cert-academy-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #78350F;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.cert-diploma-label {
  font-size: 12px;
  letter-spacing: 4px;
  color: #B45309;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.cert-presentation {
  font-size: 14px;
  color: #475569;
  font-style: italic;
  margin-bottom: 10px;
}

.cert-recipient-wrap {
  margin: 10px auto 16px;
  display: inline-block;
}

.cert-recipient-name {
  font-size: 32px;
  font-weight: 900;
  color: #0F172A;
  letter-spacing: 1px;
}

.cert-recipient-underline {
  height: 3px;
  background: linear-gradient(90deg, transparent, #D97706, transparent);
  margin-top: 4px;
}

.cert-citation {
  font-size: 14px;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto 20px;
  color: #334155;
}

.cert-stats-bar {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.cert-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(254, 243, 199, 0.6);
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: 8px 16px;
  min-width: 100px;
}

.cert-stat-icon {
  font-size: 20px;
  margin-bottom: 2px;
}

.cert-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #78350F;
  font-weight: 700;
}

.cert-stat-val {
  font-size: 14px;
  color: #1E293B;
  font-weight: 800;
}

.cert-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 10px;
  padding: 0 10px;
}

.cert-sig-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 180px;
}

.cert-signature-art {
  font-family: 'Brush Script MT', cursive, sans-serif;
  font-size: 20px;
  color: #1E293B;
  margin-bottom: 4px;
}

.cert-sig-line {
  width: 100%;
  height: 1px;
  background: #94A3B8;
  margin-bottom: 4px;
}

.cert-sig-title {
  font-size: 10px;
  color: #64748B;
  font-weight: 600;
}

.cert-gold-seal {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: radial-gradient(circle, #F59E0B, #B45309);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid #FEF3C7;
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.4);
  color: #FFFFFF;
  justify-content: center;
}

.seal-ribbon {
  font-size: 20px;
  line-height: 1;
}

.seal-text {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1px;
}

.seal-sub {
  font-size: 7px;
  font-weight: 800;
  color: #FEF3C7;
}

/* ==========================================================================
   PRINT MEDIA STYLESHEET (High-res landscape A4 diploma print)
   ========================================================================== */

@media print {
  @page {
    size: landscape;
    margin: 0.6cm;
  }

  body * {
    visibility: hidden;
  }

  body, html {
    background: #FFFFFF !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100%;
  }

  #certificate-print-area,
  #certificate-print-area * {
    visibility: visible;
  }

  #certificate-print-area {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    box-shadow: none;
    border-radius: 0;
    margin: 0;
    padding: 10px;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .top-nav,
  .mobile-bottom-dock,
  .modal-header,
  .portal-tabs-bar,
  .cert-action-bar,
  #app-view-container {
    display: none !important;
  }
}

/* ==========================================================================
   2-PLAYER CHALLENGE DUEL STYLES
   ========================================================================== */

/* Duel Banner on Subjects View */
.duel-promo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(168, 85, 247, 0.25), rgba(99, 102, 241, 0.2));
  border: 2px solid rgba(236, 72, 153, 0.4);
  border-radius: var(--border-radius-lg);
  padding: 16px 24px;
  margin-bottom: 24px;
  cursor: pointer;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.18);
  transition: all 0.25s ease;
}

.duel-promo-banner:hover {
  transform: translateY(-2px);
  border-color: #F472B6;
  box-shadow: 0 8px 30px rgba(236, 72, 153, 0.35);
}

.duel-promo-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.duel-promo-icon {
  font-size: 38px;
}

.duel-promo-title {
  font-size: 18px;
  font-weight: 800;
  color: #FDF2F8;
  margin-bottom: 3px;
}

.duel-promo-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.duel-promo-btn {
  background: linear-gradient(135deg, #EC4899, #8B5CF6);
  color: #FFFFFF;
  border: none;
  border-radius: var(--border-radius-md);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
}

/* Duel Lobby Setup */
.challenge-lobby-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px;
}

.challenge-hero-header {
  text-align: center;
  margin-bottom: 28px;
}

.duel-swords-badge {
  font-size: 48px;
  margin-bottom: 8px;
}

.challenge-title {
  font-size: 30px;
  font-weight: 900;
  background: linear-gradient(135deg, #F472B6, #C084FC, #60A5FA);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.challenge-subtitle {
  font-size: 15px;
  color: var(--text-muted);
}

.duel-players-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.player-setup-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.player-1-card {
  border: 2px solid rgba(56, 189, 248, 0.4);
}

.player-2-card {
  border: 2px solid rgba(168, 85, 247, 0.4);
}

.player-card-badge {
  position: absolute;
  top: -12px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #FFFFFF;
}

.p1-badge { background: #0284C7; }
.p2-badge { background: #9333EA; }

.player-avatar-preview {
  font-size: 54px;
  background: rgba(255, 255, 255, 0.08);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3);
}

.setup-field {
  width: 100%;
  margin-bottom: 14px;
}

.setup-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.setup-select, .setup-input {
  width: 100%;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  color: var(--text-light);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
}

.setup-select:focus, .setup-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.avatar-mini-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.mini-avatar-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid transparent;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mini-avatar-btn:hover {
  transform: scale(1.15);
}

.mini-avatar-btn.active {
  border-color: #F59E0B;
  background: rgba(245, 158, 11, 0.25);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

/* VS Divider */
.duel-vs-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.vs-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle, #EC4899, #BE185D);
  color: #FFFFFF;
  font-weight: 900;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.6);
  border: 3px solid #FDF2F8;
}

/* Duel Settings Card */
.duel-settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 18px 22px;
  margin-bottom: 24px;
}

.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.setting-item label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.duel-pill-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.duel-pill-btn {
  padding: 8px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid transparent;
  color: var(--text-light);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.duel-pill-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.duel-pill-btn.active {
  background: var(--color-primary);
  border-color: #818CF8;
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.4);
}

.duel-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.back-hub-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-light);
  border-radius: var(--border-radius-md);
  padding: 12px 20px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.start-duel-btn {
  background: linear-gradient(135deg, #EC4899, #8B5CF6);
  border: none;
  color: #FFFFFF;
  border-radius: var(--border-radius-md);
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 25px rgba(236, 72, 153, 0.45);
  transition: all 0.2s ease;
}

.start-duel-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(236, 72, 153, 0.6);
}

/* Turn Countdown Transition Overlay */
.turn-countdown-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.turn-countdown-card {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--border-radius-xl);
  padding: 36px 32px;
  text-align: center;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.turn-round-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--color-primary);
  background: rgba(99, 102, 241, 0.15);
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.turn-player-avatar {
  font-size: 64px;
  margin-bottom: 8px;
}

.turn-player-heading {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 6px;
}

.p1-color { color: #38BDF8; }
.p2-color { color: #C084FC; }

.turn-instruction {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.turn-timer-number {
  font-size: 48px;
  font-weight: 900;
  color: #F59E0B;
  animation: pulse 1s infinite;
}

/* Active Duel Arena */
.duel-arena-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px;
}

.duel-scoreboard {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 12px 18px;
  margin-bottom: 14px;
}

.score-side {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: var(--border-radius-md);
  transition: all 0.25s ease;
}

.score-side.active-turn {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.score-avatar {
  font-size: 32px;
}

.score-info {
  display: flex;
  flex-direction: column;
}

.score-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-light);
}

.score-points {
  font-size: 16px;
  font-weight: 900;
}

.right-align {
  text-align: right;
}

.duel-round-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.center-round-tag {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
}

.turn-chip {
  font-size: 11px;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 12px;
}

.p1-chip {
  background: rgba(56, 189, 248, 0.2);
  color: #38BDF8;
  border: 1px solid #38BDF8;
}

.p2-chip {
  background: rgba(192, 132, 252, 0.2);
  color: #C084FC;
  border: 1px solid #C084FC;
}

/* 10s Timer Bar */
.duel-timer-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 18px;
}

.duel-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #F59E0B, #EF4444);
  transition: width 0.1s linear;
}

/* Question Card */
.duel-question-card {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--border-radius-xl);
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  margin-bottom: 18px;
}

.question-subject-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: #FCD34D;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.question-prompt-text {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-light);
  line-height: 1.4;
  margin-bottom: 24px;
}

.duel-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.duel-option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(30, 41, 59, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-lg);
  padding: 16px 18px;
  font-family: var(--font-main);
  color: var(--text-light);
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s ease;
}

.duel-option-btn:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  background: rgba(99, 102, 241, 0.15);
}

.opt-key {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 900;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.opt-val {
  font-size: 18px;
  font-weight: 800;
}

.correct-choice {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: #10B981 !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5) !important;
}

.wrong-choice {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #EF4444 !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.5) !important;
}

.duel-bottom-bar {
  display: flex;
  justify-content: center;
}

.duel-exit-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  border-radius: var(--border-radius-md);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* Victory Podium */
.duel-victory-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 30px 20px;
  text-align: center;
}

.victory-header-box {
  margin-bottom: 30px;
}

.victory-crown-icon {
  font-size: 52px;
  margin-bottom: 8px;
}

.victory-heading {
  font-size: 28px;
  font-weight: 900;
  color: #FCD34D;
  margin-bottom: 6px;
}

.victory-subtext {
  font-size: 15px;
  color: var(--text-muted);
}

.podium-stage {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 20px;
  margin: 0 auto 36px;
  max-width: 500px;
}

.podium-pedestal {
  flex: 1;
  border-radius: var(--border-radius-lg);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.pedestal-gold {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.3) 0%, rgba(180, 83, 9, 0.4) 100%);
  border: 2px solid #F59E0B;
  min-height: 220px;
  transform: translateY(-10px);
}

.pedestal-silver {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.3) 0%, rgba(71, 85, 105, 0.4) 100%);
  border: 2px solid #94A3B8;
  min-height: 190px;
}

.pedestal-bronze {
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.2) 0%, rgba(120, 53, 15, 0.3) 100%);
  border: 2px solid #B45309;
  min-height: 180px;
}

.pedestal-rank {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.pedestal-avatar {
  font-size: 44px;
  margin-bottom: 6px;
}

.pedestal-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-light);
  margin-bottom: 4px;
}

.pedestal-score {
  font-size: 20px;
  font-weight: 900;
  color: #FCD34D;
  margin-bottom: 8px;
}

.pedestal-reward {
  font-size: 12px;
  font-weight: 800;
  color: #10B981;
  background: rgba(16, 185, 129, 0.15);
  padding: 4px 10px;
  border-radius: 12px;
}

.victory-actions-bar {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.duel-rematch-btn {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  border: none;
  border-radius: var(--border-radius-md);
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.duel-home-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

/* Mobile Responsiveness for 2-Player Duel */
@media (max-width: 768px) {
  .duel-players-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .duel-vs-divider {
    margin: -6px 0;
  }

  .settings-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .duel-options-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .question-prompt-text {
    font-size: 19px;
  }

  .podium-stage {
    gap: 10px;
  }

  .certificate-frame {
    padding: 12px;
  }

  .cert-inner-border {
    padding: 16px 12px;
  }

  .cert-recipient-name {
    font-size: 24px;
  }

  .cert-stats-bar {
    gap: 8px;
  }

  .cert-stat-item {
    min-width: 75px;
    padding: 6px 8px;
  }

  .cert-footer {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }
}

