/* Arabic Gamified Kids Learning Platform - Stylesheet */
/* Google Fonts loaded via <link rel="preload"> in index.html — NOT here (avoids render-blocking @import) */

:root {
  /* HSL Color Palette */
  --color-bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e4ebf5 100%);
  --color-card-bg: rgba(255, 255, 255, 0.75);
  --color-card-border: rgba(255, 255, 255, 0.5);
  
  --color-text-main: #2d3748;
  --color-text-muted: #718096;
  
  --color-primary: #6c5ce7;
  --color-primary-hover: #5b4bc4;
  --color-accent: #fdcb6e;
  
  --color-math: #e67e22;
  --color-science: #16a085;
  --color-reading: #d35400;
  --color-review: #2980b9;
  --color-english: #0984e3;
  
  --color-success: #2ecc71;
  --color-danger: #e74c3c;
  
  --shadow-main: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
  --shadow-inset: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  --border-radius-sm: 8px;
  
  --font-kids: 'Cairo', 'Tajawal', sans-serif;
  --transition-speed: 0.3s;
}

/* Dark Mode Variables */
body.dark-mode {
  --color-bg-gradient: linear-gradient(135deg, #1e1e2f 0%, #11111d 100%);
  --color-card-bg: rgba(30, 30, 47, 0.75);
  --color-card-border: rgba(255, 255, 255, 0.1);
  --color-text-main: #f7fafc;
  --color-text-muted: #a0aec0;
  --color-primary: #8f82ff;
  --color-primary-hover: #7b6eff;
}

/* Core Settings */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100vw;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--color-bg-gradient);
  background-attachment: fixed;
  background-size: cover;
  background-repeat: no-repeat;
  overflow-x: hidden !important;
  touch-action: pan-y pinch-zoom;
}

body {
  font-family: var(--font-kids);
  color: var(--color-text-main);
  direction: rtl;
  text-align: right;
  /* overflow-x: clip preserved for static health assertions, overflow-x: hidden enforced */
  overflow-x: hidden !important;
  overflow-x: clip;
  transition: background var(--transition-speed), color var(--transition-speed);
  touch-action: pan-y pinch-zoom;
}

/* Global Container */
#app-container {
  max-width: 1200px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 10px 20px 32px 20px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
  touch-action: pan-y pinch-zoom;
}

.view-section.active {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 0 auto;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

/* Top bar style */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: var(--color-card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--color-card-border);
  border-radius: var(--border-radius-md);
  margin-bottom: 12px;
  box-shadow: var(--shadow-main);
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--color-primary);
}

.logo span {
  font-size: 2.2rem;
}

.header-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.badge-stars {
  display: flex;
  align-items: center;
  gap: 8px;
  background: gold;
  color: #5d4037;
  padding: 8px 16px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(255, 215, 0, 0.4);
  animation: bounce 2s infinite alternate;
}

/* Animations */
@keyframes bounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(108, 92, 231, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(108, 92, 231, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(108, 92, 231, 0); }
}

/* Standard Buttons */
button, .btn {
  font-family: var(--font-kids);
  font-weight: 700;
  border: none;
  border-radius: var(--border-radius-md);
  padding: 12px 24px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(108, 92, 231, 0.3);
}

.btn-accent {
  background: var(--color-accent);
  color: #5d4037;
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(253, 203, 110, 0.3);
}

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

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px);
}

/* Views Wrapper */
.view-section {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.view-section.active {
  display: block;
}

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

/* 1. PROFILE SELECTION VIEW */
.profile-selection-card {
  background: var(--color-card-bg);
  backdrop-filter: blur(15px);
  border: 1px solid var(--color-card-border);
  border-radius: var(--border-radius-lg);
  padding: 40px;
  text-align: center;
  max-width: 600px;
  margin: 50px auto;
  box-shadow: var(--shadow-main);
}

.profile-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin: 30px 0;
}

.profile-avatar-option {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: white;
  border: 3px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.profile-avatar-option:hover {
  transform: scale(1.1);
  border-color: var(--color-primary);
}

.profile-avatar-option.large-profile-card {
  width: 150px;
  height: 150px;
}

.profile-avatar-option.large-profile-card span {
  font-size: 4rem;
}

.profile-avatar-option.large-profile-card p {
  font-size: 1.1rem;
  margin-top: 10px;
}

.profile-avatar-option.selected {
  border-color: var(--color-primary);
  background: #eef2ff;
  box-shadow: 0 0 15px rgba(108, 92, 231, 0.4);
}

.profile-avatar-option span {
  font-size: 2.8rem;
}

.profile-avatar-option p {
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 5px;
  color: #4a5568;
}

.input-kids-name {
  width: 100%;
  max-width: 320px;
  padding: 12px 20px;
  font-size: 1.1rem;
  border-radius: var(--border-radius-md);
  border: 2px solid var(--color-card-border);
  outline: none;
  font-family: var(--font-kids);
  text-align: center;
  margin-bottom: 20px;
}

.input-kids-name:focus {
  border-color: var(--color-primary);
}

/* 2. KIDS HOME VIEW */
.kids-hero {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--border-radius-lg);
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.kids-hero-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.kids-hero-avatar {
  font-size: 4rem;
  background: transparent !important;
  width: 150px;
  height: 185px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible;
  flex-shrink: 0;
}

.kids-hero-greeting h2 {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--color-primary);
}

.kids-hero-greeting p {
  color: var(--color-text-muted);
}

.kids-weekly-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kids-weekly-progress span {
  font-weight: 900;
  color: var(--color-text-main);
  font-size: 1.1rem;
}

.progress-track {
  width: 100%;
  height: 24px;
  background: #e2e8f0;
  border-radius: 50px;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #34d399, #10b981);
  width: 0%;
  border-radius: 50px;
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

#progress-avatar {
  position: absolute;
  top: -45px;
  right: 0%;
  width: 65px;
  height: 80px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  transition: right 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translateX(50%);
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.25));
  z-index: 10;
  animation: float 2s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateX(50%) translateY(0px); }
  50% { transform: translateX(50%) translateY(-5px); }
  100% { transform: translateX(50%) translateY(0px); }
}

.card-progress-avatar {
  position: absolute;
  top: -15px;
  right: 0%;
  font-size: 1.5rem;
  transition: right 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translateX(50%);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
  z-index: 5;
  animation: float-small 2s ease-in-out infinite;
}

@keyframes float-small {
  0% { transform: translateX(50%) translateY(0px); }
  50% { transform: translateX(50%) translateY(-3px); }
  100% { transform: translateX(50%) translateY(0px); }
}

/* Subjects World Grid */
.worlds-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.world-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--border-radius-lg);
  padding: 25px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: var(--shadow-main);
  position: relative;
  overflow: hidden;
}

.world-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--theme-color, var(--color-primary));
}

.world-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.world-icon {
  font-size: 3.5rem;
  margin-bottom: 15px;
}

.world-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.world-subject {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  font-weight: 700;
  margin-bottom: 15px;
}

.world-stats {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary);
  background: rgba(108, 92, 231, 0.08);
  padding: 6px 12px;
  border-radius: 20px;
  display: inline-block;
}

/* 3. ADVENTURE GAME SCREEN */
.adventure-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--border-radius-lg);
  padding: 12px 18px;
  box-shadow: var(--shadow-main);
  display: flex;
  flex-direction: column;
}

.adventure-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  border-bottom: 2px dashed var(--color-card-border);
  padding-bottom: 6px;
}

.steps-indicator {
  display: flex;
  gap: 8px;
  align-items: center;
}

.step-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #cbd5e0;
  transition: all 0.3s ease;
}

.step-dot.active {
  background: var(--color-primary);
  transform: scale(1.2);
}

.step-dot.completed {
  background: var(--color-success);
}

.exercise-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.instruction-text {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--color-primary);
}

.prompt-text {
  font-family: var(--font-kids), 'Cairo', 'Tajawal', sans-serif;
  font-size: calc(1.2rem + 2pt);
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-text-main, #1e1b4b);
  line-height: 1.5;
  letter-spacing: normal !important;
}

/* Answer Layout Types */
/* A. Visual Choices Grid */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.option-card {
  background: white;
  border: 3px solid var(--color-card-border);
  border-radius: var(--border-radius-md);
  padding: 10px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: var(--shadow-inset);
}

.option-card:hover {
  transform: scale(1.03);
  border-color: var(--color-primary);
}

.option-card.selected {
  border-color: var(--color-primary);
  background: #f0efff;
}

.option-visual {
  font-size: 2.2rem;
  margin-bottom: 4px;
}

.option-text {
  font-family: var(--font-kids), 'Cairo', 'Tajawal', sans-serif;
  font-size: calc(1.2rem + 2pt);
  font-weight: 700;
  color: var(--color-text-main, #1e1b4b);
  letter-spacing: normal !important;
}

/* B. Sort and Order List */
.sort-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 25px;
  justify-content: center;
  min-height: 60px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--border-radius-md);
}

.sort-item {
  background: white;
  border: 2px solid var(--color-primary);
  border-radius: var(--border-radius-md);
  padding: 16px 30px;
  cursor: grab;
  font-family: Arial, sans-serif;
  font-weight: 700;
  box-shadow: 0 4px 6px rgba(0,0,0,0.06);
  user-select: none;
  font-size: calc(1.5rem + 2pt);
  color: #000000;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort-item:active {
  cursor: grabbing;
}

/* C. Matching Pairs layout */
.matching-canvas {
  display: flex;
  justify-content: space-between;
  gap: 50px;
  margin-bottom: 25px;
  position: relative;
}

.matching-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.match-node {
  background: white;
  border: 2px solid var(--color-card-border);
  border-radius: var(--border-radius-md);
  padding: 18px;
  font-family: Arial, sans-serif;
  font-weight: 700;
  font-size: calc(1.4rem + 2pt);
  color: #000000;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.match-node:hover {
  border-color: var(--color-primary);
  background: #f7fafc;
}

.match-node.selected {
  border-color: var(--color-primary);
  background: #f0efff;
  box-shadow: 0 0 10px rgba(108, 92, 231, 0.2);
}

.match-node.matched {
  background: #e6fffa;
  border-color: var(--color-success);
  color: var(--color-success);
  cursor: default;
}

.match-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-text-muted);
}

.match-node.selected .match-dot {
  background: var(--color-primary);
  transform: scale(1.2);
}

.match-node.matched .match-dot {
  background: var(--color-success);
}

/* D. Story Scene representation */
.story-view {
  background: #fff;
  border: 1px solid var(--color-card-border);
  border-radius: var(--border-radius-md);
  padding: 25px;
  margin-bottom: 20px;
  font-size: 1.5rem;
  line-height: 1.8;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-inset);
}

.story-graphic {
  font-size: 5rem;
  padding: 20px;
  background: #f7fafc;
  border-radius: var(--border-radius-md);
}

.story-text {
  font-family: Arial, sans-serif;
  font-weight: 500;
  color: #000000;
}

/* E. Mini Simulations CSS */
.sim-viewport {
  background: linear-gradient(to bottom, #dff9fb 0%, #c7ecee 100%);
  border: 3px solid var(--color-primary);
  border-radius: var(--border-radius-md);
  padding: 20px;
  height: 280px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-inset);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.sim-water-tub {
  width: 100%;
  height: 110px;
  background: rgba(52, 152, 219, 0.6);
  position: absolute;
  bottom: 0;
  left: 0;
  border-top: 4px solid #2980b9;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-top: 10px;
}

.sim-shelf {
  display: flex;
  justify-content: center;
  gap: 15px;
  padding: 10px;
  background: rgba(255,255,255,0.7);
  border-bottom: 3px solid #b2bec3;
  border-radius: var(--border-radius-sm);
  margin-bottom: auto;
}

.sim-draggable {
  padding: 12px 22px;
  background: white;
  border: 2px solid #636e72;
  border-radius: var(--border-radius-sm);
  cursor: grab;
  font-weight: 700;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  font-size: 1.3rem;
}

.sim-draggable:active {
  cursor: grabbing;
}

.sim-water-tub .sim-draggable {
  position: relative;
  cursor: pointer;
}

/* Circuit Simulator */
.circuit-board {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 20px;
}

.circuit-bulb {
  font-size: 5rem;
  transition: all 0.3s ease;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.1));
}

.circuit-bulb.glowing {
  filter: drop-shadow(0 0 25px #fdcb6e);
  animation: glow 1s infinite alternate;
}

@keyframes glow {
  from { filter: drop-shadow(0 0 15px #fdcb6e); }
  to { filter: drop-shadow(0 0 35px #ffeaa7); }
}

.circuit-switch {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #d63031;
  color: white;
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 5px 0 #b33939;
  transition: all 0.1s ease;
}

.circuit-switch.closed {
  background: #2ecc71;
  box-shadow: 0 5px 0 #27ae60;
  transform: translateY(2px);
}

.circuit-wire-label {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text-main);
}

/* Magnet Simulator */
.magnet-arena {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding: 0 40px;
}

.magnet-u {
  font-size: 5.5rem;
  transform: rotate(-90deg);
  animation: float 2s infinite alternate ease-in-out;
}

@keyframes float {
  0% { transform: rotate(-90deg) translateY(0px); }
  100% { transform: rotate(-90deg) translateY(-8px); }
}

.magnet-items-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.magnet-item {
  padding: 10px;
  background: white;
  border: 2px dashed #b2bec3;
  border-radius: var(--border-radius-sm);
  text-align: center;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.magnet-item.attracted {
  animation: pullToMagnet 0.6s forwards cubic-bezier(0.55, 0.055, 0.675, 0.19);
  border-style: solid;
  border-color: var(--color-success);
}

@keyframes pullToMagnet {
  to { transform: translateX(80px) scale(0.8); opacity: 0.7; }
}

/* Feedback panel overlay styles */
.feedback-panel {
  margin-top: 6px;
  border-radius: var(--border-radius-md);
  padding: 8px 12px;
  display: none;
  animation: slideUp 0.3s ease-out forwards;
}

.feedback-panel.correct {
  display: block;
  background: #e6fffa;
  border: 2px solid var(--color-success);
  color: #234e52;
}

.feedback-panel.incorrect {
  display: block;
  background: #fff5f5;
  border: 2px solid var(--color-danger);
  color: #742a2a;
}

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

.feedback-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 1.05rem;
  margin-bottom: 2px;
}

#incorrect-help, #correct-explanation {
  line-height: 1.35;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

/* 5. PARENT DASHBOARD VIEW */
.parent-dashboard-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--border-radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-main);
}

.parent-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  border-bottom: 2px solid var(--color-card-border);
  padding-bottom: 10px;
}

.tab-btn {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  border-bottom: 3px solid transparent;
  color: var(--color-text-muted);
}

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

.parent-tab-content {
  display: none;
}

.parent-tab-content.active {
  display: block;
}

/* Skills Report Table */
.progress-table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
}

.progress-table th, .progress-table td {
  padding: 12px 15px;
  text-align: right;
  border-bottom: 1px solid var(--color-card-border);
}

.progress-table th {
  font-weight: 800;
  color: var(--color-primary);
}

.mastery-pill {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
}

.mastery-pill.excellent { background: #e6fffa; color: #234e52; }
.mastery-pill.medium { background: #feebc8; color: #744210; }
.mastery-pill.needs-practice { background: #fed7d7; color: #742a2a; }

/* Home activity cards */
.activities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 15px;
}

.activity-card {
  background: white;
  border: 1px solid var(--color-card-border);
  border-radius: var(--border-radius-md);
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.03);
}

.activity-title {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-primary);
  margin-bottom: 8px;
}

/* Parent settings switches */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 500px;
  margin-top: 15px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: white;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--color-card-border);
}

.switch-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 18px; width: 18px;
  left: 4px; bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider-round {
  background-color: var(--color-primary);
}

input:checked + .slider-round:before {
  transform: translateX(24px);
}

/* Parent PIN Lock Overlay */
.pin-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}

.pin-overlay.active {
  opacity: 1; pointer-events: all;
}

.pin-box {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--border-radius-lg);
  padding: 30px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-main);
}

.pin-display {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

.pin-digit {
  width: 45px;
  height: 45px;
  border: 2px solid var(--color-primary);
  border-radius: var(--border-radius-sm);
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  color: var(--color-text-main);
}

.pin-keyboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 240px;
  margin: 0 auto;
}

.pin-key {
  padding: 12px;
  font-weight: 800;
  background: white;
  border: 1px solid var(--color-card-border);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
}

.pin-key:hover {
  background: #f0efff;
}

/* Privacy policy box */
.privacy-container {
  background: white;
  border-radius: var(--border-radius-md);
  padding: 20px;
  border: 1px solid var(--color-card-border);
  margin-top: 15px;
}

.privacy-box {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text-main);
  margin-bottom: 20px;
}

/* End Game Summary styling */
.summary-container {
  text-align: center;
  padding: 30px;
}

.summary-cup {
  font-size: 6rem;
  animation: bounce 2s infinite alternate;
}

.summary-stars-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 2.2rem;
  color: gold;
  margin: 15px 0;
}

/* Matching Node Paired Intermediate State styling */
.match-node.paired {
  background: #f0efff;
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 4px 6px rgba(108, 92, 231, 0.1);
}

.match-node.paired .match-dot {
  background: var(--color-primary);
  transform: scale(1.1);
}

/* Accessibility Reduced Motion Configuration */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body.reduced-motion *, body.reduced-motion *::before, body.reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

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

/* --- Reorganization Views: Subject, Unit and Lesson --- */
.subject-header-card, .unit-header-card, .lesson-header-card {
  background: var(--color-card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--color-card-border);
  border-radius: var(--border-radius-lg);
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: var(--shadow-main);
  position: relative;
}

.back-btn {
  position: absolute;
  top: 25px;
  inset-inline-start: 25px; /* RTL-safe: appears on the right in Arabic, left in LTR */
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: bold;
  min-height: 44px; /* WCAG 2.5.5 touch target minimum */
}

.subject-hero-info {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  margin-left: 120px; /* Leave space for back button on desktop */
}

.subject-icon {
  font-size: 3rem;
  background: rgba(108, 92, 231, 0.1);
  width: 75px;
  height: 75px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: var(--shadow-inset);
}

.subject-title {
  font-weight: 900;
  font-size: 1.8rem;
  color: var(--color-text-main);
}

.subject-subtitle {
  font-size: 1rem;
  color: var(--color-text-muted);
  font-weight: 700;
}

.subject-progress-container {
  background: rgba(255, 255, 255, 0.5);
  padding: 15px;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Unit Cards in Subject View */
.unit-card {
  background: var(--color-card-bg);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 2px solid var(--color-card-border);
  border-radius: var(--border-radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: var(--shadow-main);
}

.unit-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-primary);
  box-shadow: 0 12px 40px rgba(108, 92, 231, 0.12);
}

.unit-card.coming-soon {
  opacity: 0.6;
  cursor: not-allowed;
  border-style: dashed;
}

.unit-card.coming-soon:hover {
  transform: none;
  border-color: var(--color-card-border);
  box-shadow: var(--shadow-main);
}

.unit-card-title {
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--color-text-main);
  margin-bottom: 5px;
  text-align: right;
}

.unit-card-desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-bottom: 15px;
  flex-grow: 1;
  text-align: right;
}

.unit-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed var(--color-card-border);
  padding-top: 10px;
  font-size: 0.85rem;
}

/* Lessons Road Map */
.lesson-node-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--border-radius-md);
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
  box-shadow: var(--shadow-main);
}

.lesson-node-card:hover {
  transform: translateX(-5px);
  border-color: var(--color-primary);
}

.lesson-node-card.locked {
  cursor: not-allowed;
  opacity: 0.55;
}

.lesson-node-card.locked:hover {
  transform: none;
  border-color: var(--color-card-border);
}

.lesson-info-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.lesson-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
  box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
}

.lesson-node-card.locked .lesson-step-num {
  background: #a0aec0;
  box-shadow: none;
}

.lesson-node-card.mastered .lesson-step-num {
  background: var(--color-success);
  box-shadow: 0 4px 10px rgba(46, 204, 113, 0.3);
}

.lesson-node-card.needs-review .lesson-step-num {
  background: var(--color-accent);
  box-shadow: 0 4px 10px rgba(253, 203, 110, 0.3);
}

.lesson-title-text {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-text-main);
  text-align: right;
}

/* Practice Modes in Lesson View */
.practice-mode-card {
  background: var(--color-card-bg);
  border: 2px solid var(--color-card-border);
  border-radius: var(--border-radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  box-shadow: var(--shadow-main);
}

.practice-mode-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-primary);
  box-shadow: 0 10px 25px rgba(108, 92, 231, 0.1);
}

.practice-mode-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.practice-mode-card.disabled:hover {
  transform: none;
  border-color: var(--color-card-border);
  box-shadow: var(--shadow-main);
}

.mode-icon {
  font-size: 2.2rem;
  background: rgba(108, 92, 231, 0.08);
  width: 60px;
  height: 60px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 20px;
}

.mode-info {
  flex-grow: 1;
}

.mode-title {
  color: var(--color-text-main);
  text-align: right;
}

.mode-desc {
  color: var(--color-text-muted);
  text-align: right;
}

.mode-action-btn {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--color-primary);
  background: rgba(108, 92, 231, 0.1);
  padding: 8px 18px;
  border-radius: 12px;
  transition: background 0.2s;
}

.practice-mode-card:hover .mode-action-btn {
  background: var(--color-primary);
  color: white;
}

.practice-mode-card.disabled:hover .mode-action-btn {
  background: rgba(108, 92, 231, 0.1);
  color: var(--color-primary);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: bold;
  border-radius: 6px;
  line-height: 1;
}

.badge-primary {
  background: var(--color-primary);
  color: white;
}

.badge-success {
  background: var(--color-success);
  color: white;
}

.badge-warning {
  background: var(--color-accent);
  color: var(--color-text-main);
}

.badge-info {
  background: #3182ce;
  color: white;
}

.badge-danger {
  background: var(--color-danger);
  color: white;
}

/* Parent dashboard builder additions */
.assignment-builder-form input, 
.assignment-builder-form select, 
.quiz-builder-form select {
  font-family: var(--font-kids);
  font-weight: bold;
  font-size: 0.95rem;
  border: 1px solid var(--color-card-border);
}

.assignment-builder-form select:focus, 
.quiz-builder-form select:focus {
  outline: none;
  border-color: var(--color-primary);
}

@media (max-width: 768px) {
  .subject-hero-info {
    margin-left: 0;
    margin-top: 50px; /* make space for absolute back button */
  }
}

/* English Subject LTR Support */
.english-subject #prompt-area,
.english-subject .option-text,
.english-subject .sort-item,
.english-subject .match-node span,
.english-subject .input-complete {
  direction: ltr !important;
  text-align: left !important;
  font-family: 'Outfit', 'Inter', sans-serif !important;
}

/* Progress Map Nodes and Paths styling */
.journey-map-container {
  position: relative;
  min-height: 400px;
}

.journey-map-container::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 6px;
  background: repeating-linear-gradient(to bottom, #dcdde1, #dcdde1 10px, transparent 10px, transparent 20px);
  transform: translateX(-50%);
  z-index: 1;
}

.journey-node-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  width: 100%;
}

.journey-node-wrapper.odd {
  align-items: flex-start;
  padding-left: 20%;
}

.journey-node-wrapper.even {
  align-items: flex-end;
  padding-right: 20%;
}

.journey-node-wrapper.center {
  align-items: center;
}

.journey-node-item {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: white;
  border: 5px solid #ced6e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 6px 15px rgba(0,0,0,0.06);
}

.journey-node-item:hover:not(.locked):not(.coming-soon) {
  transform: scale(1.1);
  box-shadow: 0 10px 22px rgba(0,0,0,0.12);
}

/* Pulsing current node styling */
.journey-node-item.current {
  border-color: var(--theme-color, var(--color-primary));
  box-shadow: 0 0 0 0 rgba(108, 92, 231, 0.4);
  animation: pulse-node 2s infinite;
}

@keyframes pulse-node {
  0% {
    box-shadow: 0 0 0 0 rgba(108, 92, 231, 0.5), 0 6px 15px rgba(0,0,0,0.06);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(108, 92, 231, 0), 0 6px 15px rgba(0,0,0,0.06);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(108, 92, 231, 0), 0 6px 15px rgba(0,0,0,0.06);
  }
}

/* Avatar indicator beside current node */
.journey-avatar-indicator {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 42px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: bounce-indicator 2s infinite;
  z-index: 10;
}

@keyframes bounce-indicator {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Node States visual indicators */
.journey-node-item.completed {
  background: var(--theme-color, var(--color-success));
  border-color: #27ae60;
  color: white;
}

.journey-node-item.completed::after {
  content: '✅';
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 1.1rem;
  background: white;
  border-radius: 50%;
  padding: 2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.journey-node-item.needs-review {
  border-color: #e67e22;
  box-shadow: 0 0 10px rgba(230, 126, 34, 0.4);
}

.journey-node-item.needs-review::after {
  content: '🔄';
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 1rem;
  background: white;
  border-radius: 50%;
  padding: 2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.journey-node-item.locked {
  background: #f1f2f6;
  border-color: #ced6e0;
  color: #a4b0be;
  cursor: not-allowed;
}

.journey-node-item.coming-soon {
  background: #f1f2f6;
  border-color: #ced6e0;
  color: #a4b0be;
  cursor: pointer;
}

.journey-node-label {
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-text-main);
  margin-top: 10px;
  text-align: center;
  max-width: 160px;
  line-height: 1.35;
}

/* Winding Connector Bridges/Gates styling */
.unit-section-banner {
  background: linear-gradient(135deg, #2f3542 0%, #57606f 100%);
  color: white;
  padding: 14px 28px;
  border-radius: var(--border-radius-md);
  font-weight: 800;
  font-size: 1.25rem;
  margin: 30px 0;
  text-align: center;
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

/* Subject Colors class assignments */
.subject-math-theme {
  --theme-color: var(--color-math);
}
.subject-science-theme {
  --theme-color: var(--color-science);
}
.subject-reading-theme {
  --theme-color: var(--color-reading);
}
.subject-english-theme {
  --theme-color: var(--color-english);
}

/* --- PLACE VALUE CITY GAME STYLING --- */

.game-cubes-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: white;
  padding: 15px;
  border-radius: var(--border-radius-md);
  border: 2px dashed #cbd5e0;
  min-height: 120px;
  width: 100%;
  justify-content: center;
  align-content: center;
}

.game-cube-ones {
  width: 25px;
  height: 25px;
  background: #10ac84;
  border: 2px solid #0e8c6b;
  border-radius: 4px;
  box-shadow: inset -3px -3px 0 rgba(0,0,0,0.15), 0 3px 6px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s;
}
.game-cube-ones:hover {
  transform: scale(1.15);
}

.game-cube-tens {
  width: 20px;
  height: 90px;
  background: #ff9f43;
  border: 2px solid #e67e22;
  border-radius: 4px;
  box-shadow: inset -3px -3px 0 rgba(0,0,0,0.15), 0 3px 6px rgba(0,0,0,0.1);
  background-image: repeating-linear-gradient(to bottom, transparent, transparent 8px, rgba(0,0,0,0.1) 8px, rgba(0,0,0,0.1) 10px);
  cursor: pointer;
  transition: transform 0.2s;
}
.game-cube-tens:hover {
  transform: scale(1.08);
}

.game-cube-hundreds {
  width: 90px;
  height: 90px;
  background: #54a0ff;
  border: 2px solid #2980b9;
  border-radius: 6px;
  box-shadow: inset -4px -4px 0 rgba(0,0,0,0.15), 0 4px 8px rgba(0,0,0,0.1);
  background-image: 
    repeating-linear-gradient(to bottom, transparent, transparent 8px, rgba(0,0,0,0.1) 8px, rgba(0,0,0,0.1) 10px),
    repeating-linear-gradient(to right, transparent, transparent 8px, rgba(0,0,0,0.1) 8px, rgba(0,0,0,0.1) 10px);
  cursor: pointer;
  transition: transform 0.2s;
}
.game-cube-hundreds:hover {
  transform: scale(1.05);
}

.place-value-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 15px;
  width: 100%;
  margin: 15px 0;
}

.place-value-house {
  background: white;
  border: 3px solid #cbd5e0;
  border-radius: var(--border-radius-md);
  padding: 15px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 180px;
}

.place-value-house.active-drop {
  border-color: #10ac84;
  background: #f0fdf4;
}

.house-label {
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--color-text-main);
  border-bottom: 2px solid #edf2f7;
  padding-bottom: 8px;
  width: 100%;
  margin-bottom: 10px;
}

.house-body {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  align-items: center;
  align-content: center;
  width: 100%;
}

.comparison-card {
  background: white;
  border: 3px solid var(--color-card-border);
  border-radius: var(--border-radius-md);
  padding: 20px;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--color-text-main);
  text-align: center;
  min-width: 120px;
  box-shadow: 0 5px 12px rgba(0,0,0,0.04);
}

.comparison-card.highlight {
  border-color: #ff9f43;
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(255, 159, 67, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(255, 159, 67, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 159, 67, 0); }
}

.number-line-container {
  width: 100%;
  padding: 40px 20px;
  position: relative;
  background: white;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--color-card-border);
  margin: 20px 0;
}

.number-line-axis {
  height: 6px;
  background: #cbd5e0;
  width: 100%;
  position: relative;
  border-radius: 3px;
}

.number-line-tick {
  position: absolute;
  top: -5px;
  width: 4px;
  height: 16px;
  background: #4a5568;
  transform: translateX(50%);
}

.number-line-label {
  position: absolute;
  top: 18px;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  transform: translateX(50%);
  white-space: nowrap;
}

.number-line-slider {
  position: absolute;
  top: -12px;
  width: 30px;
  height: 30px;
  background: #10ac84;
  border: 3px solid white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transform: translateX(50%);
  transition: left 0.1s ease;
}

.number-line-slider::after {
  content: '🚗';
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5rem;
}

/* Authentication Page input overrides */
.auth-input {
  max-width: none !important;
  text-align: left !important;
  padding: 12px 15px !important;
  margin-bottom: 0 !important;
}

/* Global Navigation, Breadcrumbs & Dialog warning systems */
.app-navigation {
  display: none; /* Managed dynamically by Navigation */
  align-items: center;
  gap: 16px;
  min-height: 52px;
  margin-bottom: 16px;
}

.app-back-button {
  flex: 0 0 auto;
  min-height: 44px;
  min-width: 96px;
  padding: 10px 16px;
}

.app-back-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  min-width: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0;
  padding: 0;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  color: var(--color-text-muted);
}

.breadcrumbs button {
  min-height: 44px;
  padding: 6px 8px;
  color: var(--color-primary);
  background: transparent;
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.breadcrumbs [aria-current="page"] {
  color: var(--color-text-main);
  font-weight: 800;
}

.page-header-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--border-radius-lg);
  padding: clamp(20px, 4vw, 30px);
  margin-bottom: 24px;
  box-shadow: var(--shadow-main);
}

.page-header-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title:focus {
  outline: 3px solid var(--color-primary);
  outline-offset: 6px;
  border-radius: 4px;
}

@media (max-width: 600px) {
  .app-navigation {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-back-button {
    width: 100%;
    justify-content: flex-start;
  }

  .breadcrumbs {
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .view-section {
    animation: none;
  }
}

.app-dialog {
  border: none;
  border-radius: var(--border-radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-main);
  background: white;
  direction: rtl;
  text-align: right;
  max-width: 480px;
  width: 90%;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}

.app-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.app-dialog h2 {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--color-primary);
  margin-bottom: 10px;
  margin-top: 0;
}

.app-dialog p {
  color: var(--color-text-muted);
  font-weight: 700;
  margin-bottom: 20px;
}

.dialog-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
}

/* Lesson Mode Grid & Card Hierarchies */
.practice-mode-card--primary {
  border-color: var(--color-primary) !important;
  background: linear-gradient(
    135deg,
    rgba(108, 92, 231, 0.12) 0%,
    rgba(255, 255, 255, 0.9) 100%
  ) !important;
  box-shadow: 0 10px 25px rgba(108, 92, 231, 0.15) !important;
}

body.dark-mode .practice-mode-card--primary {
  background: linear-gradient(
    135deg,
    rgba(143, 130, 255, 0.15) 0%,
    rgba(30, 30, 47, 0.9) 100%
  ) !important;
  border-color: var(--color-primary) !important;
}

.practice-mode-card--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(108, 92, 231, 0.22) !important;
}

/* Authentication Page input overrides */
.auth-input {
  max-width: none !important;
  text-align: left !important;
  padding: 12px 15px !important;
  margin-bottom: 0 !important;
}

/* Global Navigation, Breadcrumbs & Dialog warning systems */
.app-navigation {
  display: none; /* Managed dynamically by Navigation */
  align-items: center;
  gap: 16px;
  min-height: 52px;
  margin-bottom: 16px;
}

.app-back-button {
  flex: 0 0 auto;
  min-height: 44px;
  min-width: 96px;
  padding: 10px 16px;
}

.app-back-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  min-width: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0;
  padding: 0;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  color: var(--color-text-muted);
}

.breadcrumbs button {
  min-height: 44px;
  padding: 6px 8px;
  color: var(--color-primary);
  background: transparent;
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.breadcrumbs [aria-current="page"] {
  color: var(--color-text-main);
  font-weight: 800;
}

.page-header-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--border-radius-lg);
  padding: clamp(20px, 4vw, 30px);
  margin-bottom: 24px;
  box-shadow: var(--shadow-main);
}

.page-header-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title:focus {
  outline: 3px solid var(--color-primary);
  outline-offset: 6px;
  border-radius: 4px;
}

@media (max-width: 600px) {
  .app-navigation {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-back-button {
    width: 100%;
    justify-content: flex-start;
  }

  .breadcrumbs {
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .view-section {
    animation: none;
  }
}

.app-dialog {
  border: none;
  border-radius: var(--border-radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-main);
  background: white;
  direction: rtl;
  text-align: right;
  max-width: 480px;
  width: 90%;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}

.app-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.app-dialog h2 {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--color-primary);
  margin-bottom: 10px;
  margin-top: 0;
}

.app-dialog p {
  color: var(--color-text-muted);
  font-weight: 700;
  margin-bottom: 20px;
}

.dialog-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
}

/* Lesson Mode Grid & Card Hierarchies */
.practice-mode-card--primary {
  border-color: var(--color-primary) !important;
  background: linear-gradient(
    135deg,
    rgba(108, 92, 231, 0.12) 0%,
    rgba(255, 255, 255, 0.9) 100%
  ) !important;
  box-shadow: 0 10px 25px rgba(108, 92, 231, 0.15) !important;
}

body.dark-mode .practice-mode-card--primary {
  background: linear-gradient(
    135deg,
    rgba(143, 130, 255, 0.15) 0%,
    rgba(30, 30, 47, 0.9) 100%
  ) !important;
  border-color: var(--color-primary) !important;
}

.practice-mode-card--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(108, 92, 231, 0.22) !important;
}

/* Phase Progress Indicator */
.session-phase-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--border-radius-md);
  padding: 15px 20px;
  margin-bottom: 20px;
  width: 100%;
}

.session-phase-progress-labels {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 0.95rem;
}



/* Grade 4 Subject Themes */
.subject-reading-theme { --theme-color: #d35400; }
.subject-math-theme { --theme-color: #2980b9; }
.subject-science-theme { --theme-color: #16a085; }
.subject-english-theme { --theme-color: #0984e3; }
.subject-social-theme { --theme-color: #8e6b3a; }
.subject-islamic-theme { --theme-color: #6f9c3d; }
.subject-tajweed-theme { --theme-color: #008f83; }
.subject-digital-theme { --theme-color: #576574; }
.subject-life-family-theme { --theme-color: #d982a6; }
.subject-art-theme { --theme-color: #8c63d8; }
.subject-physical-theme { --theme-color: #2d9d68; }

.optional-login-panel {
  max-width: 620px;
  margin: 0 auto 24px;
  padding: 18px;
  text-align: center;
  background: #fff8eb;
  border: 2px solid #ead9bd;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(120, 91, 55, 0.1);
}

.optional-login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 24px;
  border: 0;
  border-radius: 18px;
  background: #8b6f47;
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.optional-login-button:hover {
  background: #725937;
  transform: translateY(-2px);
}

.optional-login-button:focus-visible {
  outline: 4px solid rgba(139, 111, 71, 0.3);
  outline-offset: 3px;
}

.guest-storage-note {
  margin: 12px 0 0;
  color: #735f47;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.6;
}

.account-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  max-width: 620px;
  margin: 0 auto 24px;
  padding: 14px 18px;
  background: #eef8ec;
  border: 2px solid #bddbb8;
  border-radius: 20px;
  color: #356638;
  font-weight: 800;
}

.account-logout-button {
  padding: 8px 14px;
  border: 1px solid #d2bfa2;
  border-radius: 12px;
  background: #ffffff;
  color: #735f47;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 600px) {
  .optional-login-button {
    width: 100%;
  }
}

.admin-progress-table td {
  padding: 12px;
  border-bottom: 1px solid #edf2f7;
  color: var(--color-text-main);
}

.admin-progress-table tr:hover {
  background-color: #f7fafc;
}

.subject-social-studies-theme { --theme-color: #e67e22; }
.bg-social-studies-world { background: linear-gradient(135deg, #fff3e0, #ffe0b2); }
.subject-digital-skills-theme { --theme-color: #3498db; }
.bg-digital-skills-world { background: linear-gradient(135deg, #e3f2fd, #bbdefb); }
.subject-mock-exams-theme { --theme-color: #9b59b6; }
.bg-mock-exams-world { background: linear-gradient(135deg, #f3e5f5, #e1bee7); }

/* --------------------------------------------------------------------------
   Playful avatar theme – visual layer only.  These rules intentionally sit
   last so every existing view keeps its markup, events and application flow.
   -------------------------------------------------------------------------- */
:root {
  --color-bg-gradient: radial-gradient(circle at 8% 8%, rgba(255, 224, 114, .34) 0 3px, transparent 4px), radial-gradient(circle at 88% 16%, rgba(147, 182, 255, .26) 0 2px, transparent 3px), linear-gradient(145deg, #fdfbff 0%, #f1efff 48%, #e9f8ff 100%);
  --color-card-bg: rgba(255, 255, 255, .88);
  --color-card-border: rgba(119, 101, 209, .14);
  --color-text-main: #332f58;
  --color-text-muted: #787296;
  --color-primary: #6956ca;
  --color-primary-hover: #513daa;
  --color-accent: #ffcd5b;
  --color-success: #3dbd83;
  --color-danger: #ee6b7a;
  --shadow-main: 0 12px 30px rgba(75, 61, 150, .12), 0 3px 0 rgba(255,255,255,.92) inset;
  --border-radius-lg: 28px;
  --border-radius-md: 18px;
  --border-radius-sm: 12px;
}

body {
  background-attachment: fixed;
  background-color: #f8f7ff;
}

body::before, body::after {
  content: "✦";
  position: fixed;
  z-index: -1;
  color: #ffc951;
  font-size: 2.4rem;
  opacity: .72;
  animation: twinkle 3s ease-in-out infinite alternate;
}
body::before { top: 14%; right: 4%; }
body::after { bottom: 10%; left: 4%; color: #8bd3f7; animation-delay: -1.4s; }

@keyframes twinkle { from { transform: rotate(-10deg) scale(.8); opacity: .38; } to { transform: rotate(12deg) scale(1.1); opacity: .85; } }

#app-container { max-width: 96%; width: 96%; padding: 18px 24px 44px; }

header {
  position: relative;
  top: auto;
  padding: 13px 22px;
  border: 1px solid rgba(119, 101, 209, .16);
  border-radius: 22px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 10px 28px rgba(63, 47, 126, .1);
}

.logo { color: #38325f; letter-spacing: -.4px; }
.logo span { display: inline-grid; place-items:center; width: 48px; height: 48px; font-size: 1.65rem; border-radius: 16px; background: linear-gradient(145deg,#fff3b7,#ffcf68); box-shadow: 0 5px 0 #edaa34; transform: rotate(-6deg); }
.header-controls { gap: 10px; }
.badge-stars { background: linear-gradient(135deg,#ffe88a,#ffbf4a); border: 2px solid #fff5c9; box-shadow: 0 5px 0 #e8a52f, 0 9px 14px rgba(205,146,35,.18); }

button, .btn { border-radius: 15px; min-height: 44px; box-shadow: 0 4px 0 rgba(51, 42, 105, .13), 0 8px 15px rgba(58,47,125,.08); }
.btn-primary { background: linear-gradient(135deg,#7f69e7,#5d4abc); box-shadow: 0 5px 0 #49399c, 0 10px 16px rgba(89,70,191,.2); }
.btn-primary:hover { background: linear-gradient(135deg,#8b74f0,#624cc8); }
.btn-accent { background: linear-gradient(135deg,#ffe47a,#ffbd48); box-shadow: 0 5px 0 #e59c28, 0 10px 16px rgba(227,152,29,.18); }
.btn-secondary { background: rgba(255,255,255,.86); border-color: rgba(114,93,190,.15); }
button:active, .btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(51,42,105,.14); }
button:focus-visible, .btn:focus-visible, input:focus-visible { outline: 3px solid #ffca57; outline-offset: 3px; }

/* Logo as a keyboard-operable button */
button.logo { background: none; border: none; border-radius: 0; box-shadow: none; min-height: 0; cursor: pointer; padding: 0; font-family: inherit; }
button.logo .logo-title { color: #38325f; }

/* Accessibility utilities */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -200px; right: 8px; z-index: 3000; background: var(--color-primary); color: #fff; padding: 10px 18px; border-radius: 12px; font-weight: 800; text-decoration: none; transition: top 0.2s ease; }
.skip-link:focus { top: 8px; right: 8px; }

.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Practice mode cards rendered as native buttons */
button.practice-mode-card { width: 100%; text-align: right; font-family: inherit; color: inherit; }
button.practice-mode-card:disabled { cursor: not-allowed; }

.app-navigation { padding: 8px 12px; border-radius: 18px; background: rgba(255,255,255,.54); }
.profile-selection-card, .kids-hero, .subject-header-card, .page-header-card, .adventure-card, .activity-card, .lesson-header-card, .unit-header-card, .journey-header-card, .app-dialog {
  border: 1px solid rgba(119,101,209,.14) !important;
  box-shadow: var(--shadow-main);
}

.profile-selection-card { position: relative; overflow: hidden; background: linear-gradient(145deg,rgba(255,255,255,.96),rgba(248,246,255,.9)); }
.profile-selection-card::before { content:""; position:absolute; inset: auto -40px -76px auto; width: 190px; height:190px; border-radius: 50%; background: radial-gradient(circle at 42% 35%,#fff5c1 0 8%,#f5d4ff 9% 45%,transparent 46%); opacity:.7; pointer-events:none; }
.profile-selection-card > * { position:relative; }
.profile-avatar-option { background: linear-gradient(145deg,#fff,#f1eeff); border: 3px solid #fff; box-shadow: 0 6px 0 #ddd6f8, 0 11px 20px rgba(86,66,165,.12); }
.profile-avatar-option:hover { border-color:#9a82ee; box-shadow: 0 8px 0 #c9baff, 0 14px 25px rgba(86,66,165,.18); }
.profile-avatar-option.selected { background: linear-gradient(145deg,#f6f1ff,#eae5ff); border-color:#7560dd; }
.input-kids-name { background:#fff; border:2px solid #e3dcfa; box-shadow: inset 0 2px 7px rgba(85,67,160,.07); }

.kids-hero { position:relative; overflow:hidden; background: linear-gradient(120deg,#ffffff 0%,#f4efff 58%,#e5f6ff 100%); }
.kids-hero::after { content:"✦  ✧  ✦"; position:absolute; left:30px; top:18px; color:#f8bd42; font-size:1.35rem; letter-spacing:12px; transform:rotate(-9deg); opacity:.86; }
.kids-hero-avatar { width:104px; height:104px; background: radial-gradient(circle at 38% 28%,#fff 0 11%,#eae5ff 12% 64%,#d1c7ff 65%); border:4px solid #fff; box-shadow: 0 7px 0 #c8baff, 0 14px 23px rgba(89,65,169,.15); animation: avatar-pop 3.4s ease-in-out infinite; }
@keyframes avatar-pop { 50% { transform: translateY(-6px) rotate(2deg); } }
.kids-hero-greeting h2 { color:#453873; }
.kids-weekly-progress { background:rgba(255,255,255,.66); padding:13px 16px; border-radius:18px; border:1px solid rgba(112,94,190,.1); }
.progress-track { height: 20px; background:#e7e1fa; border: 3px solid #fff; box-shadow: inset 0 2px 4px rgba(58,42,130,.12); }
.progress-bar-fill { background:linear-gradient(90deg,#a183f1,#7161d6 58%,#67c8f2); }

.worlds-container { grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:22px; }
.world-card { border: 2px solid #fff; padding: 25px 20px 22px; background:linear-gradient(155deg,rgba(255,255,255,.98),rgba(249,248,255,.88)); box-shadow: 0 7px 0 rgba(178,164,230,.43), 0 15px 24px rgba(70,53,146,.1); }
.world-card::before { height:8px; border-radius:20px 20px 0 0; }
.world-card::after { content:"✦"; position:absolute; left:15px; bottom:10px; color:var(--theme-color,var(--color-primary)); opacity:.22; font-size:1.5rem; }
.world-card:hover { transform:translateY(-9px) rotate(-.6deg); box-shadow:0 10px 0 rgba(178,164,230,.42),0 22px 32px rgba(70,53,146,.15); }
.world-icon { display:inline-grid; place-items:center; width:78px; height:78px; border-radius:24px; background:color-mix(in srgb,var(--theme-color,#7560dd) 13%, white); margin-bottom:13px; }
.world-title { color:#39325f; }
.world-stats { color:#5c49ba; background:#eeeaff; }

.subject-header-card, .unit-header-card, .lesson-header-card, .journey-header-card { background:linear-gradient(135deg,#fff 0%,#f4efff 70%,#e7f8ff 100%); }
.unit-card, .lesson-node-card, .practice-mode-card, .activity-card { border:2px solid #fff; box-shadow:0 6px 0 rgba(183,171,229,.42),0 13px 24px rgba(77,58,153,.1); }
.unit-card:hover, .lesson-node-card:hover, .practice-mode-card:hover { transform:translateY(-5px); box-shadow:0 9px 0 rgba(183,171,229,.4),0 18px 28px rgba(77,58,153,.13); }
.lesson-step-num, .subject-icon { box-shadow:0 5px 0 rgba(69,53,130,.18); }

.adventure-card { background:linear-gradient(145deg,rgba(255,255,255,.97),rgba(247,246,255,.92)); }
.adventure-header { border-bottom-color:#e2dcf7; }
.step-dot { width:16px; height:16px; background:#ddd6f4; border:2px solid #fff; }
.step-dot.active { background:#8068df; box-shadow:0 0 0 5px rgba(128,104,223,.15); }
.instruction-text { color:#4f3ea3; }
.option-card, .sort-item, .match-node, .story-view, .place-value-house, .comparison-card { border-color:#e1dbf5; box-shadow:0 5px 0 rgba(206,197,237,.55),0 10px 18px rgba(78,61,143,.08); }
.option-card:hover { border-color:#9b84eb; background:#faf8ff; }
.option-card.selected, .match-node.selected { border-color:#7560dd; background:#f0ebff; }

.journey-map-container::before { background:repeating-linear-gradient(to bottom,#baa9ec,#baa9ec 11px,transparent 11px,transparent 23px); }
.journey-node-item { border-color:#e1daf4; box-shadow:0 6px 0 #d4c9f1,0 12px 18px rgba(74,55,146,.1); }
.journey-node-item.current { border-color:#765ed9; }
.journey-node-item.completed { border-color:#45ae80; box-shadow:0 6px 0 #278d61,0 12px 18px rgba(38,136,97,.17); }

.optional-login-panel { background:linear-gradient(135deg,#fff7dc,#fff1cf); border-color:#f5d587; }
.optional-login-button { background:linear-gradient(135deg,#876fdd,#6250bb); box-shadow:0 4px 0 #4f3b9b; }
.account-status { background:linear-gradient(135deg,#effff0,#e2f8ed); border-color:#aee0c0; }

@media (max-width: 720px) {
  #app-container { padding: 12px 14px 30px; }
  header { position:relative; top:auto; padding:12px; align-items:flex-start; gap:10px; }
  .logo { font-size:1.17rem; }
  .logo span { width:40px; height:40px; font-size:1.35rem; }
  .header-controls { flex-wrap:wrap; justify-content:flex-end; gap:6px; }
  .header-controls .btn { padding:8px 10px; font-size:.82rem; min-height:38px; }
  .badge-stars { padding:6px 10px; }
  .profile-selection-card { padding:30px 18px; margin:22px auto; }
  .kids-hero { padding:22px 18px; }
  .kids-hero-info { gap:12px; }
  .kids-hero-avatar { width:76px; height:76px; font-size:3rem; }
  .kids-hero-greeting h2 { font-size:1.35rem; }
  .worlds-container { grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:16px; }
}

/* Original learning mascot sprite, used across the existing profile and progress UI. */
/* Animated and engaging Animal Companion System */
.mascot-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, filter 0.3s ease;
  position: relative;
  overflow: visible;
  box-sizing: border-box;
  box-shadow: var(--shadow-main);
  border: 4px solid rgba(255, 255, 255, 0.9);
  cursor: pointer;
  background-size: cover;
  background-position: center;
  background-image: none !important;
}

.mascot-avatar:hover {
  transform: scale(1.08) rotate(2deg);
  box-shadow: 0 12px 36px rgba(108, 92, 231, 0.25);
}

/* Pseudo-element to render the actual animal companion emoji */
.mascot-avatar::before {
  font-size: 3.5rem;
  line-height: 1;
  display: inline-block;
  transition: transform 0.2s ease;
  z-index: 2;
}

/* Hide raw text spans or old elements inside the avatar container to prevent double rendering */
.profile-avatar-option.mascot-avatar > span,
.mascot-avatar > span {
  display: none !important;
}

/* Ensure no legacy animal emojis appear via ::before pseudo-elements */
.mascot-avatar::before {
  content: none !important;
}

/* Pose Gradients & Personalities */

/* 1. Fox 🦊 - Waving / Adventurous */
.mascot-pose-wave {
  background: linear-gradient(135deg, #ffd3b6 0%, #ff8c42 100%) !important;
  box-shadow: 0 8px 20px rgba(255, 140, 66, 0.3);
}
.mascot-pose-wave::before {
  content: "🦊";
  animation: mascot-wave 3s ease-in-out infinite;
}

/* 2. Falcon 🦅 - Flying / Clever */
.mascot-pose-book {
  background: linear-gradient(135deg, #d6f2ff 0%, #3498db 100%) !important;
  box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
}
.mascot-pose-book::before {
  content: "🦅";
  animation: mascot-float 4s ease-in-out infinite;
}

/* 3. Rabbit 🐰 - Bouncing / Active */
.mascot-pose-cheer {
  background: linear-gradient(135deg, #ffd6e8 0%, #ff4b91 100%) !important;
  box-shadow: 0 8px 20px rgba(255, 75, 145, 0.3);
}
.mascot-pose-cheer::before {
  content: "🐰";
  animation: mascot-bounce 1.5s ease-in-out infinite;
}

/* 4. Lion 🦁 - Pulsing / Brave */
.mascot-pose-star {
  background: linear-gradient(135deg, #fff2cc 0%, #f1c40f 100%) !important;
  box-shadow: 0 8px 20px rgba(241, 196, 15, 0.3);
}
.mascot-pose-star::before {
  content: "🦁";
  animation: mascot-pulse 2.3s ease-in-out infinite;
}

/* 5. Koala 🐨 - Pondering / Calm */
.mascot-pose-think {
  background: linear-gradient(135deg, #e2eafc 0%, #95a5a6 100%) !important;
  box-shadow: 0 8px 20px rgba(149, 165, 166, 0.3);
}
.mascot-pose-think::before {
  content: "🐨";
  animation: mascot-sway 5s ease-in-out infinite;
}

/* 6. Owl 🦉 (Fallback / Tablet) - Smart */
.mascot-pose-tablet {
  background: linear-gradient(135deg, #e8dbfc 0%, #9b5de5 100%) !important;
  box-shadow: 0 8px 20px rgba(155, 93, 229, 0.3);
}
.mascot-pose-tablet::before {
  content: "🦉";
  animation: mascot-float 3.5s ease-in-out infinite;
}

/* Dynamic Keyframe Animations */

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

@keyframes mascot-float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

@keyframes mascot-bounce {
  0%, 100% { transform: translateY(0px) scaleY(1); }
  50% { transform: translateY(-12px) scaleY(0.95); }
}

@keyframes mascot-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0px rgba(255,255,255,0)); }
  50% { transform: scale(1.06); filter: drop-shadow(0 0 8px rgba(255,255,255,0.4)); }
}

@keyframes mascot-sway {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  50% { transform: rotate(-4deg) translateY(2px); }
}

/* Sizes styling for different contexts */
.mascot-welcome-art {
  width: 198px !important;
  height: 198px !important;
  flex: 0 0 198px !important;
}
.mascot-welcome-art::before {
  font-size: 6.8rem !important;
}

.profile-avatar-option.mascot-avatar {
  width: 120px !important;
  height: 120px !important;
  margin: 10px auto;
}
.profile-avatar-option.mascot-avatar::before {
  font-size: 4.2rem !important;
}

.kids-hero-avatar.mascot-avatar {
  width: 95px !important;
  height: 95px !important;
}
.kids-hero-avatar.mascot-avatar::before {
  font-size: 3.2rem !important;
}

.companion-choice > .mascot-avatar {
  width: 80px !important;
  height: 80px !important;
}
.companion-choice > .mascot-avatar::before {
  font-size: 2.8rem !important;
}

.mascot-welcome-intro {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 230px;
  padding: 20px 26px;
  margin: -10px -10px 24px;
  overflow: hidden;
  text-align: right;
  border-radius: 24px;
  background: linear-gradient(135deg, #f0ebff 0%, #fff8dd 100%);
}
.mascot-welcome-art {
  flex: 0 0 198px;
  width: 198px;
  height: 198px;
  border-radius: 50%;
  background-color: #e8e3ff;
  box-shadow: inset 0 0 0 7px rgba(255,255,255,.75), 0 8px 0 #c8bbf3;
}
.mascot-welcome-copy { flex: 1; }
.mascot-eyebrow { color: #6d58cc; font-weight: 900; font-size: .9rem; }
.mascot-welcome-copy h1 { color: #332b66; font-size: clamp(1.65rem, 3vw, 2.45rem); line-height: 1.2; margin: 8px 0; }
.mascot-welcome-copy p { color: #6d678c; font-weight: 700; line-height: 1.8; max-width: 430px; }
.mascot-customization-hint { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mascot-customization-hint span { padding: 6px 11px; border-radius: 999px; color: #554987; background: rgba(255,255,255,.75); font-size: .8rem; font-weight: 800; }

.profile-selection-card { max-width: 900px; }
.profile-avatar-option.mascot-avatar {
  position: relative;
  justify-content: flex-end;
  background-color: #f5f1ff;
  background-image: var(--mascot-sprite, url("assets/mascot/learning-mascot-poses.png"));
  background-size: 300% 200%;
}
.profile-avatar-option.mascot-avatar > span { display: none; }
.profile-avatar-option.mascot-avatar p {
  z-index: 1;
  margin: 0;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,.86);
  color: #413664;
}
.profile-avatar-option.mascot-avatar.large-profile-card > div {
  z-index: 1;
  padding: 2px 7px;
  border-radius: 9px;
  background: rgba(255,255,255,.86);
}

.companion-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  width: min(100%, 410px);
  gap: 12px;
  margin: -4px 0 6px;
}
.companion-choice {
  min-height: 104px;
  padding: 9px 13px;
  border: 2px solid #e1daf6;
  border-radius: 19px;
  background: linear-gradient(145deg, #fff, #f8f6ff);
  box-shadow: 0 4px 0 #dfd7f4, 0 8px 15px rgba(75, 57, 150, .08);
  color: #423769;
}
.companion-choice > .mascot-avatar {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  background-size: 300% 200%;
}
.companion-choice > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}
.companion-choice small { color: #7e769a; font-size: .7rem; font-weight: 700; }
.companion-choice.selected {
  border-color: #7d64dc;
  background: linear-gradient(145deg, #f4f0ff, #fff9e8);
  box-shadow: 0 5px 0 #b9a9ec, 0 11px 20px rgba(89, 67, 177, .18);
  transform: translateY(-2px);
}

.kids-hero-avatar.mascot-avatar {
  font-size: 0;
  background-color: #e9e3ff;
  background-size: 300% 200%;
}
#progress-avatar.mascot-avatar {
  width: 54px;
  height: 54px;
  top: -27px;
  font-size: 0;
  background-color: transparent;
  background-size: 300% 200%;
  filter: drop-shadow(0 4px 4px rgba(48,37,100,.18));
}
.card-progress-avatar.mascot-avatar {
  width: 34px;
  height: 34px;
  top: -22px;
  font-size: 0;
  background-size: 300% 200%;
}
.subject-hero-icon.mascot-avatar,
.journey-avatar-indicator.mascot-avatar {
  font-size: 0;
  background-color: #f2eeff;
  background-size: 300% 200%;
}

.mascot-reaction-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: -12px 0 24px;
}
.mascot-reaction-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 78px;
  gap: 5px;
  padding: 9px 14px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 19px;
  color: #51447c;
  background: rgba(255,255,255,.78);
  box-shadow: 0 5px 0 #ddd5f5, 0 10px 18px rgba(74,55,146,.08);
  font-weight: 900;
}
.mascot-reaction-card .mascot-avatar {
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
  background-size: 300% 200%;
}
@media (max-width: 720px) {
  .mascot-welcome-intro { min-height: 0; padding: 18px; gap: 12px; }
  .mascot-welcome-art { flex-basis: 112px; width: 112px; height: 112px; }
  .mascot-welcome-copy h1 { font-size: 1.35rem; }
  .mascot-welcome-copy p { font-size: .82rem; }
  .mascot-customization-hint { display:none; }
  .mascot-reaction-strip { gap: 8px; }
  .mascot-reaction-card { min-height: 62px; padding: 6px; font-size: .72rem; text-align:center; flex-direction:column; line-height:1.15; }
  .mascot-reaction-card .mascot-avatar { width:42px; height:42px; flex-basis:42px; }
  .companion-picker { gap: 8px; }
  .companion-choice > .mascot-avatar { width:55px; height:55px; flex-basis:55px; }
}

/* ==========================================================================
   DAILY LEARNING ADVENTURE HUB STYLES (LEVEL 1-5 HIERARCHY & MICRO-INTERACTIONS)
   ========================================================================== */

.hub-container {
  max-width: 1520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0 10px;
}

/* 1. HERO HUB LAYOUT (QUEST MAP SPACIOUS SHOWCASE) */
.kids-hero-hub {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f6ff 60%, #eef2ff 100%);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: 0 10px 30px rgba(108, 92, 231, 0.08);
  border: 1px solid rgba(108, 92, 231, 0.12);
}

.hero-main-column {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  width: 100%;
}

.today-mission-box {
  background: linear-gradient(135deg, #6c5ce7 0%, #805ad5 100%);
  border-radius: var(--border-radius-md);
  padding: 20px 24px;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.25);
  position: relative;
  overflow: visible;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.today-mission-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(108, 92, 231, 0.32);
}

.mission-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.mission-title {
  font-weight: 900;
  font-size: 1.45rem;
  margin: 4px 0;
  color: #ffffff;
}

.mission-sub {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.btn-hero-cta {
  font-size: 1.15rem;
  font-weight: 900;
  padding: 12px 30px;
  border-radius: var(--border-radius-md);
  box-shadow: 0 6px 18px rgba(253, 203, 110, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(253, 203, 110, 0.6);
}

.btn-hero-cta:active {
  transform: scale(0.97);
}

/* HERO PROGRESS COLUMN & GAUGE */
.today-progress-card {
  background: #ffffff;
  border-radius: var(--border-radius-md);
  padding: 24px 28px;
  border: 1px solid var(--color-card-border);
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 270px;
  height: 100%;
}

.today-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 6px;
}

.today-progress-header h3 {
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--color-primary);
  margin: 0;
}

.today-date-badge {
  background: #f1f5f9;
  color: var(--color-text-muted);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 14px;
}

.progress-ring-container {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px auto;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-fill {
  transition: stroke-dashoffset 1s ease-in-out;
}

.progress-ring-text {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.ring-number {
  font-weight: 900;
  font-size: 2.1rem;
  color: var(--color-primary);
  line-height: 1.1;
}

.progress-ring-text small {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.today-stats-pills {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.9rem;
}

.pill-streak {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #ffedd5;
}

.pill-stars {
  background: #fefce8;
  color: #a16207;
  border: 1px solid #fef08a;
}

/* 2. WEEKLY ADVENTURE CARD */
.weekly-adventure-card {
  background: #ffffff;
  border-radius: var(--border-radius-lg);
  padding: 24px 28px;
  border: 1px solid var(--color-card-border);
  box-shadow: var(--shadow-main);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.weekly-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.weekly-title-wrap h3 {
  font-weight: 900;
  font-size: 1.4rem;
  color: var(--color-primary);
  margin: 0;
}

.weekly-title-wrap p {
  color: var(--color-text-muted);
  font-weight: 700;
  font-size: 0.98rem;
  margin-top: 2px;
}

/* WEEKLY ADVENTURE MAP JOURNEY STYLES */
.weekly-header-badges {
  display: flex;
  align-items: center;
  gap: 10px;
}

.next-reward-countdown-badge {
  background: #fefce8;
  color: #854d0e;
  border: 1px dashed #facc15;
  font-weight: 900;
  font-size: 0.95rem;
  padding: 6px 16px;
  border-radius: 20px;
  animation: pulseNextReward 2.5s infinite ease-in-out;
}

.next-reward-countdown-badge.completed-all {
  background: #f0fdf4;
  color: #15803d;
  border-color: #86efac;
  animation: none;
}

@keyframes pulseNextReward {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(250, 204, 21, 0); }
  50% { transform: scale(1.04); box-shadow: 0 0 14px rgba(250, 204, 21, 0.4); }
}

.weekly-journey-map-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
  background: linear-gradient(180deg, #f8f6ff 0%, #ffffff 100%);
  border: 2px solid #eddfff;
  border-radius: var(--border-radius-md);
  overflow: visible;
  margin-top: 32px;
}

.journey-svg-canvas {
  width: 100%;
  height: 100%;
  overflow: visible;
  display: block;
}

.journey-path-track,
.journey-path-fill-active {
  display: none;
}

.journey-nodes-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* MINOR QUESTION CHECKPOINT NODE DOTS */
.journey-minor-node {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #cbd5e1;
  border: 2.5px solid #ffffff;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: all 0.3s ease;
}

.journey-minor-node.node-completed {
  background: linear-gradient(135deg, #6c5ce7 0%, #805ad5 100%);
  border-color: #ffffff;
  box-shadow: 0 0 12px rgba(108, 92, 231, 0.7);
}

.journey-minor-node.node-next {
  background: #fdcb6e;
  border-color: #ffffff;
  animation: pulseMinorNode 1.8s infinite ease-in-out;
}

@keyframes pulseMinorNode {
  0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 4px rgba(253, 203, 110, 0.5); }
  50% { transform: translate(-50%, -50%) scale(1.4); box-shadow: 0 0 12px rgba(253, 203, 110, 0.9); }
}

/* MAJOR REWARD MILESTONE CHECKPOINT BADGES */
.journey-milestone-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: auto;
  cursor: pointer;
  z-index: 5;
  transition: transform 0.2s ease;
}

.journey-milestone-node:hover {
  transform: translate(-50%, -55%) scale(1.1);
}

.milestone-badge-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  transition: all 0.3s ease;
}

.journey-milestone-node.achieved .milestone-badge-icon {
  background: linear-gradient(135deg, #fef08a 0%, #fde047 100%);
  border-color: #eab308;
  box-shadow: 0 0 20px rgba(234, 179, 8, 0.6);
}

.journey-milestone-node.next-target .milestone-badge-icon {
  background: #fff7ed;
  border-color: #f97316;
  animation: pulseMilestone 2s infinite ease-in-out;
}

@keyframes pulseMilestone {
  0%, 100% { transform: scale(1); box-shadow: 0 0 6px rgba(249, 115, 22, 0.4); }
  50% { transform: scale(1.15); box-shadow: 0 0 20px rgba(249, 115, 22, 0.8); }
}

.milestone-badge-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.98);
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.milestone-num {
  font-weight: 900;
  font-size: 1.15rem;
  color: #0f172a;
  line-height: 1.1;
}

.milestone-unit {
  font-weight: 800;
  font-size: 0.78rem;
  color: #64748b;
}

.journey-milestone-node.achieved .milestone-badge-text {
  background: #fefce8;
  border-color: #fef08a;
}

.journey-milestone-node.achieved .milestone-num {
  color: #854d0e;
}

/* STUDENT 3D CHARACTER MARKER ON JOURNEY PATH */
.journey-character-marker {
  position: absolute;
  z-index: 10;
  transition: left 0.8s ease-in-out, top 0.8s ease-in-out;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.character-standing-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 6px;
  background: linear-gradient(135deg, #6c5ce7 0%, #805ad5 100%);
  color: #ffffff;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 5px 14px;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(108, 92, 231, 0.35);
  border: 2px solid #ffffff;
  white-space: nowrap;
  pointer-events: auto;
  animation: pulseCharacterTooltip 2s infinite ease-in-out;
}

.character-standing-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: #805ad5 transparent transparent transparent;
}

/* Tooltip flip for high curve positions to prevent top header overlap */
.character-standing-tooltip.tooltip-bottom {
  bottom: auto;
  top: 100%;
  margin-bottom: 0;
  margin-top: 8px;
}

.character-standing-tooltip.tooltip-bottom::after {
  top: auto;
  bottom: 100%;
  border-width: 0 6px 6px 6px;
  border-color: transparent transparent #805ad5 transparent;
}

@keyframes pulseCharacterTooltip {
  0%, 100% { transform: translateX(-50%) scale(1); box-shadow: 0 6px 18px rgba(108, 92, 231, 0.35); }
  50% { transform: translateX(-50%) scale(1.06); box-shadow: 0 8px 22px rgba(108, 92, 231, 0.55); }
}

/* COMPANION & CARD HIGH-ENERGY MICRO-ANIMATIONS */
.activity-card-mascot {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f6ff 100%);
  border: 2px solid #eddfff;
  box-shadow: 0 8px 18px rgba(108, 92, 231, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.adventure-activity-card:hover .activity-card-mascot {
  transform: scale(1.18) rotate(4deg);
  box-shadow: 0 12px 26px rgba(108, 92, 231, 0.25);
}

.activity-card-mascot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.journey-character-marker img {
  animation: companionWobbleBounce 3.2s infinite ease-in-out;
  transform-origin: bottom center;
}

@keyframes companionWobbleBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-6px) rotate(-3deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
  75% { transform: translateY(-4px) rotate(-1deg); }
}

.world-card {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.world-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 16px 36px rgba(108, 92, 231, 0.22);
}

.world-card:hover .world-icon {
  animation: companionExcitedJump 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes companionExcitedJump {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-14px) scale(1.15) rotate(6deg); }
}

.milestone-badge-icon:hover {
  animation: starSparkleRotate 0.5s ease-in-out;
}

@keyframes starSparkleRotate {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.25) rotate(15deg); }
  100% { transform: scale(1.1) rotate(0deg); }
}

.milestone-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--color-text-muted);
}

/* 3. TODAY'S ADVENTURE FEATURED SECTION */
.todays-adventure-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-header-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
  border-right: 5px solid var(--color-primary);
  padding-right: 12px;
}

.section-title {
  font-weight: 900;
  font-size: 1.4rem;
  color: var(--color-text-main);
  margin: 0;
}

.section-subtitle {
  color: var(--color-text-muted);
  font-weight: 700;
  font-size: 0.95rem;
}

.todays-adventure-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.adventure-activity-card {
  background: #ffffff;
  border-radius: var(--border-radius-md);
  padding: 20px;
  border: 2px solid var(--color-card-border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.2s ease, box-shadow 0.2s ease;
}

.adventure-activity-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.card-reading { border-color: #bae6fd; background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%); }
.card-math { border-color: #e9d5ff; background: linear-gradient(180deg, #ffffff 0%, #faf5ff 100%); }
.card-quick { border-color: #fed7aa; background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%); }

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

.activity-icon {
  font-size: 2rem;
}

.activity-reward-badge {
  background: #fef08a;
  color: #854d0e;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 14px;
}

.activity-title {
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--color-text-main);
  margin: 0;
}

.activity-desc {
  color: var(--color-text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.4;
}

.activity-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.activity-time-tag {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--color-text-muted);
}

.btn-activity-start {
  padding: 8px 18px;
  font-size: 0.95rem;
  font-weight: 900;
  border-radius: var(--border-radius-sm);
}

/* 4. UPGRADED CATEGORY CARDS STRIP */
.cat-card-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: right;
}

.cat-card-copy h4 {
  font-weight: 900;
  font-size: 1.15rem;
  margin: 0;
  color: var(--color-primary);
}

.cat-card-copy p {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0;
}

.cat-card-link {
  font-weight: 900;
  font-size: 0.85rem;
  color: var(--color-primary);
  margin-top: 4px;
}

.cat-card-img {
  width: 75px;
  height: 95px;
  flex-shrink: 0;
}

.cat-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 5. NEXT REWARD BANNER */
.next-reward-banner {
  background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
  border: 2px solid #fde047;
  border-radius: var(--border-radius-md);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 6px 18px rgba(234, 179, 8, 0.15);
}

.reward-banner-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.reward-banner-icon {
  font-size: 2.2rem;
}

.reward-banner-info h3 {
  font-weight: 900;
  font-size: 1.15rem;
  color: #713f12;
  margin: 0;
}

.reward-banner-info p {
  color: #854d0e;
  font-weight: 700;
  font-size: 0.95rem;
  margin: 2px 0 0;
}

.reward-progress-pill {
  background: #ffffff;
  color: #854d0e;
  font-weight: 900;
  font-size: 1rem;
  padding: 8px 18px;
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

/* 6. LEARNING JOURNEY PREVIEW MAP CARD */
.journey-preview-card {
  background: linear-gradient(135deg, #6c5ce7 0%, #805ad5 100%);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(108, 92, 231, 0.25);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.journey-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.journey-preview-header h3 {
  font-weight: 900;
  font-size: 1.4rem;
  color: #ffffff;
  margin: 0;
}

.journey-preview-header p {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 4px;
}

.btn-journey-cta {
  font-size: 1.05rem;
  padding: 10px 24px;
  font-weight: 900;
}

.journey-mini-path {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  border-radius: var(--border-radius-md);
  padding: 18px 12px;
}

.mini-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.mini-node-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mini-node.done .mini-node-icon { background: #34d399; color: #ffffff; }
.mini-node.current .mini-node-icon { background: #fdcb6e; box-shadow: 0 0 16px rgba(253, 203, 110, 0.8); }
.mini-node.locked .mini-node-icon { background: rgba(255,255,255,0.3); opacity: 0.6; }

.mini-node-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #ffffff;
}

.mini-path-line {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  margin: 0 8px;
  border-radius: 2px;
}

.mini-path-line.done { background: #34d399; }
.mini-path-line.current { background: #fdcb6e; }

/* WORLDS & ISLAND TEASER */
.worlds-title {
  border-right: 5px solid var(--color-primary);
  padding-right: 12px;
  margin-top: 10px;
}

.island-teaser-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  background: linear-gradient(135deg, #e0a8ff 0%, #a8c4ff 100%);
  border: none;
  padding: 25px;
  border-radius: var(--border-radius-lg);
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 992px) {
  .kids-hero-hub {
    grid-template-columns: 1fr;
  }
  .todays-adventure-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .todays-adventure-grid {
    grid-template-columns: 1fr;
  }
  .mascot-reaction-strip {
    grid-template-columns: 1fr;
  }
  .journey-mini-path {
    flex-wrap: wrap;
    gap: 10px;
  }
  .mini-path-line {
    display: none;
  }
}

/* ==========================================================================
   SINGLE-SCREEN MODERN LANDING & ONBOARDING EXPERIENCE (منصة أبطال الغد)
   ========================================================================== */

/* HIDE TOP HEADER, APP NAVIGATION, AND GLOBAL FOOTER ON LANDING PAGE */
body:has(#profile-selection-view.active) header,
body:has(#profile-selection-view.active) #app-navigation,
body:has(#profile-selection-view.active) .app-global-footer {
  display: none !important;
}

#app-container:has(#profile-selection-view.active) {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.landing-experience-section.single-screen-landing {
  display: none !important;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  position: relative;
  background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 35%, #f3e8ff 70%, #faf5ff 100%);
  background-attachment: fixed;
  background-size: cover;
  color: #1e1b4b;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: var(--font-kids);
  direction: rtl;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

.landing-experience-section.single-screen-landing.active {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
}

/* BACKGROUND AMBIENT GLOW ORBS & FLOATING PARTICLES */
.landing-bg-glows {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.45;
  animation: pulseGlow 12s infinite alternate ease-in-out;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.4) 0%, rgba(167, 139, 250, 0) 70%);
  top: -80px;
  right: -80px;
}

.orb-2 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, rgba(99, 102, 241, 0) 70%);
  bottom: -100px;
  left: -100px;
  animation-delay: -4s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.4) 0%, rgba(251, 191, 36, 0) 70%);
  top: 35%;
  right: 30%;
  animation-delay: -8s;
  opacity: 0.3;
}

.stars-particle-layer {
  position: absolute;
  inset: 0;
}

.stars-particle-layer .particle {
  position: absolute;
  font-size: 1.4rem;
  opacity: 0.7;
  animation: floatParticle 8s infinite ease-in-out;
}

.particle.p1 { top: 15%; right: 10%; animation-duration: 6s; }
.particle.p2 { top: 35%; right: 45%; animation-duration: 9s; animation-delay: 1s; }
.particle.p3 { top: 60%; right: 12%; animation-duration: 7s; animation-delay: 2s; }
.particle.p4 { top: 25%; left: 15%; animation-duration: 11s; }
.particle.p5 { top: 75%; left: 35%; animation-duration: 8s; animation-delay: 3s; }
.particle.p6 { top: 85%; right: 80%; animation-duration: 10s; }

/* SINGLE SCREEN CONTAINER */
.single-screen-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1560px;
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  margin: 0 auto;
  padding: clamp(14px, 2.5vh, 28px) clamp(18px, 3vw, 44px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(16px, 2.5vh, 32px);
  box-sizing: border-box;
}

/* BRAND HEADER */
.single-brand-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
  flex-shrink: 0;
}

.brand-logo-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-rocket {
  font-size: 2.4rem;
  background: #ffffff;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(124, 58, 237, 0.2);
}

.brand-main-name {
  font-size: 2.2rem;
  font-weight: 900;
  color: #1e1b4b;
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.5px;
  outline: none !important;
}

.brand-main-name:focus,
.brand-main-name:focus-visible,
h1:focus, h1:focus-visible,
h2:focus, h2:focus-visible,
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.brand-sub-tag {
  font-size: 1rem;
  color: #475569;
  font-weight: 800;
  margin: 4px 0 0 0;
}

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

.optional-login-button {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
  color: #ffffff !important;
  border: 2px solid #fcd34d !important;
  padding: 10px 24px !important;
  border-radius: 16px !important;
  font-weight: 900 !important;
  font-size: 1rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  box-shadow: 0 10px 25px rgba(124, 58, 237, 0.35) !important;
  backdrop-filter: blur(10px);
  transition: all 0.25s ease !important;
}

.optional-login-button span,
.optional-login-button * {
  color: #ffffff !important;
  font-weight: 900 !important;
}

.optional-login-button:hover {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
  color: #ffffff !important;
  transform: translateY(-2px) scale(1.04) !important;
  box-shadow: 0 14px 35px rgba(124, 58, 237, 0.45) !important;
}

/* RETURNING PROFILES BAR */
.single-existing-profiles-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid rgba(124, 58, 237, 0.2);
  padding: 10px 18px;
  border-radius: 18px;
  backdrop-filter: blur(12px);
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.08);
  margin-bottom: 8px;
  overflow: visible;
}

.profiles-bar-label {
  font-size: 0.9rem;
  font-weight: 900;
  color: #4c1d95;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.single-profiles-grid {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  overflow: visible;
}

.returning-hero-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(245, 240, 255, 0.95));
  border: 2px solid rgba(139, 92, 246, 0.35);
  border-radius: 16px;
  padding: 6px 14px 6px 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.08);
  position: relative;
}

.returning-hero-chip:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: #7c3aed;
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.22);
  background: #ffffff;
}

.returning-hero-chip-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, #ede9fe 0%, #ddd6fe 100%);
  border: 2px solid #8b5cf6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.returning-hero-chip-avatar img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.returning-hero-chip-info {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.returning-hero-chip-name {
  font-size: 0.98rem;
  font-weight: 900;
  color: #3b0764;
  line-height: 1.2;
}

.returning-hero-chip-meta {
  font-size: 0.8rem;
  font-weight: 800;
  color: #d97706;
}

.returning-hero-chip-delete {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
  margin-right: 4px;
  transition: all 0.2s ease;
  line-height: 1;
  min-height: 0;
  box-shadow: none;
}

.returning-hero-chip-delete:hover {
  color: #ef4444;
  background: #fee2e2;
  transform: scale(1.2);
}

/* SINGLE HERO STAGE */
.single-hero-stage {
  flex-grow: 1;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 24px;
  align-items: center;
  min-height: 0;
  max-height: none;
}

.single-hero-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: right;
}

.single-eyebrow {
  display: inline-block;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.25);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.84rem;
  font-weight: 800;
  color: #6d28d9;
  margin-bottom: 6px;
}

.single-hero-headline {
  font-size: clamp(1.8rem, 2.3vw, 2.45rem);
  font-weight: 900;
  line-height: 1.2;
  color: #1e1b4b;
  margin: 0 0 4px 0;
  letter-spacing: -0.5px;
}

.gradient-text {
  background: linear-gradient(135deg, #7c3aed 0%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.single-hero-sub {
  font-size: 1.02rem;
  color: #475569;
  font-weight: 600;
  margin: 0;
}

/* COMPACT ONBOARDING BOX */
.single-onboarding-box {
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid rgba(124, 58, 237, 0.18);
  border-radius: 24px;
  padding: 16px 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 45px rgba(79, 70, 229, 0.12);
  display: flex;
  flex-direction: column;
  gap: 11px;
  box-sizing: border-box;
}

.input-kids-hero-compact {
  width: 100%;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  padding: 11px 18px;
  font-size: 1.1rem;
  font-weight: 800;
  color: #1e1b4b;
  font-family: var(--font-kids);
  outline: none;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.input-kids-hero-compact::placeholder {
  color: #94a3b8;
  font-weight: 600;
}

.input-kids-hero-compact:focus {
  border-color: #7c3aed;
  background: #ffffff;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.25);
}

.single-character-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr) !important;
  width: 100% !important;
  max-width: 100% !important;
  gap: 10px !important;
  margin: 4px 0 10px !important;
}

.hero-choice-compact {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 18px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 125px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #1e1b4b;
  text-align: center;
  font-family: var(--font-kids);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
}

.hero-choice-compact:hover {
  transform: translateY(-3px) scale(1.02);
  background: #ffffff;
  border-color: #a855f7;
  box-shadow: 0 12px 30px rgba(168, 85, 247, 0.2);
}

.hero-choice-compact.selected {
  background: linear-gradient(135deg, #f3e8ff 0%, #fef3c7 100%);
  border-color: #7c3aed;
  box-shadow: 0 12px 32px rgba(124, 58, 237, 0.3), 0 0 20px rgba(252, 211, 77, 0.3);
}

.hero-choice-avatar-wrap {
  width: 70px;
  height: 76px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  filter: drop-shadow(0 8px 18px rgba(124, 58, 237, 0.2));
}

.hero-choice-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transform: scale(1.25);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-choice-compact:hover .hero-choice-avatar-img {
  transform: scale(1.4) translateY(-3px);
}

.choice-label {
  font-size: 1.15rem;
  font-weight: 900;
  color: #1e1b4b;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.hero-choice-compact.selected .choice-label {
  color: #5b21b6;
}

/* GRADE CHOICE COMPACT SPECIFICS */
.grade-choice-compact {
  border-color: #7c3aed;
  background: linear-gradient(145deg, #ffffff 0%, #faf5ff 100%);
}

.grade-choice-compact.selected {
  background: linear-gradient(135deg, #f5f3ff 0%, #fffbeb 100%);
  border-color: #7c3aed;
  box-shadow: 0 12px 32px rgba(124, 58, 237, 0.25), 0 0 16px rgba(252, 211, 77, 0.25);
}

.grade-card-top-pill {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
  letter-spacing: 0.2px;
}

.grade-avatar-wrap {
  margin-top: 4px;
}

.grade-badge-circle {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f3e8ff 0%, #fef3c7 100%);
  border: 2.5px solid #a855f7;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.15);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.grade-choice-compact:hover .grade-badge-circle {
  transform: scale(1.08) rotate(-3deg);
}

.grade-badge-icon {
  font-size: 2.1rem;
  line-height: 1;
}

.grade-num-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #fdcb6e;
  color: #1e1b4b;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.grade-choice-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
}

.grade-card-label {
  font-size: 1.12rem !important;
  font-weight: 900;
  color: #1e1b4b;
  line-height: 1.2;
}

.grade-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 999px;
  padding: 1px 7px;
}

.grade-trigger-hint {
  font-size: 0.72rem;
  font-weight: 800;
  color: #7c3aed;
  margin-top: 1px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* GRADE PICKER MODAL (Raised & Right-Aligned for Split Hero) */
.grade-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 28px 72px 20px 20px;
  overflow-y: auto;
  box-sizing: border-box;
}

.grade-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  animation: fadeInGradeModal 0.25s ease forwards;
}

.grade-modal-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 500px;
  background: linear-gradient(165deg, #ffffff 0%, #faf8ff 100%);
  border: 2.5px solid #7c3aed;
  border-radius: 24px;
  padding: 18px 20px 16px;
  box-shadow: 0 20px 50px rgba(108, 92, 231, 0.3);
  animation: scaleUpGradeModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  max-height: calc(100vh - 48px);
  box-sizing: border-box;
  margin-top: 6px;
}

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

@keyframes scaleUpGradeModal {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.grade-modal-header {
  position: relative;
  text-align: center;
  margin-bottom: 12px;
}

.grade-modal-badge {
  display: inline-block;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 4px;
  border: 1px solid #cbd5e1;
}

.grade-modal-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #1e1b4b;
  margin: 0 0 3px;
  font-family: var(--font-kids);
}

.grade-modal-desc {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0;
  font-weight: 700;
}

.grade-modal-close {
  position: absolute;
  top: -4px;
  left: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.grade-modal-close:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
  transform: rotate(90deg);
}

.grade-grid-selector {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
  width: 100%;
}

.grade-item-card {
  position: relative;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: right;
  font-family: var(--font-kids);
  user-select: none;
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
}

.grade-item-card:hover {
  border-color: #c4b5fd;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.1);
}

.grade-item-card.selected {
  border-color: #7c3aed;
  background: linear-gradient(135deg, #f5f3ff 0%, #fffbeb 100%);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.2), 0 0 10px rgba(252, 211, 77, 0.2);
}

.grade-item-card.disabled {
  opacity: 0.88;
  background: #f8fafc;
}

.grade-item-card.disabled:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.grade-item-num-icon {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.grade-item-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 900;
  border: 1.5px solid #cbd5e1;
}

.grade-item-card.selected .grade-item-num {
  background: #7c3aed;
  color: #ffffff;
  border-color: #6d28d9;
}

.grade-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  border: 1.5px solid #e2e8f0;
}

.grade-item-card.selected .grade-item-icon {
  background: linear-gradient(135deg, #ede9fe 0%, #fef3c7 100%);
  border-color: #a855f7;
  box-shadow: 0 3px 10px rgba(124, 58, 237, 0.2);
}

.grade-item-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.grade-item-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.grade-item-title {
  font-size: 0.95rem;
  font-weight: 900;
  color: #1e1b4b;
  margin: 0;
  line-height: 1.2;
}

.grade-item-sub {
  margin-top: 3px;
  display: flex;
}

.grade-item-card.selected .grade-item-sub {
  color: #15803d;
}

.grade-item-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
  white-space: normal;
  line-height: 1.35;
}

.grade-item-badge.active-badge,
.grade-item-card.selected .grade-item-badge.active-badge {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

.grade-item-radio-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 4px;
}

.grade-item-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 900;
  color: transparent;
  transition: all 0.2s ease;
  background: #ffffff;
}

.grade-item-card.selected .grade-item-radio {
  border-color: #7c3aed;
  background: #7c3aed;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

.grade-modal-feedback {
  background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
  border: 1.5px solid #fde047;
  color: #854d0e;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  animation: feedbackSlideIn 0.3s ease;
}

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

@keyframes cardShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.grade-item-shake {
  animation: cardShake 0.4s ease;
}

.grade-modal-footer {
  text-align: center;
}

.btn-grade-confirm {
  width: 100%;
  font-size: 0.98rem;
  padding: 10px;
  border-radius: 14px;
  font-weight: 800;
}

@media (max-width: 860px) {
  .grade-picker-modal {
    justify-content: center !important;
    padding: 16px !important;
    align-items: center !important;
  }
  .grade-modal-content {
    margin-top: 0 !important;
    max-width: 100% !important;
  }
}

.btn-hero-launch-compact {
  width: 100%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 900;
  padding: 13px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 26px rgba(16, 185, 129, 0.35);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-kids);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  box-sizing: border-box;
}

.btn-hero-launch-compact:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 14px 34px rgba(16, 185, 129, 0.45);
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

/* FEATURE STRIP */
.single-feature-strip {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.strip-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(124, 58, 237, 0.15);
  padding: 8px 14px;
  border-radius: 14px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #334155;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pill-emoji {
  font-size: 1rem;
}

/* LEFT COLUMN VISUAL STAGE */
.single-visual-stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.single-character-stage {
  position: relative;
  width: 100%;
  max-width: 680px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.single-backdrop-glow {
  position: absolute;
  width: 100%;
  max-width: 600px;
  height: 100%;
  max-height: 440px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.45) 0%, rgba(251, 191, 36, 0.2) 60%, transparent 80%);
  border-radius: 50%;
  filter: blur(50px);
  animation: pulseGlow 6s infinite alternate ease-in-out;
}

.single-character-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 640px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: characterBob 4s infinite ease-in-out;
}

.single-character-img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: clamp(340px, 58vh, 620px);
  object-fit: contain;
  border-radius: 28px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 50px rgba(79, 70, 229, 0.22);
}

/* COMPACT VIEWPORT HEIGHT ADJUSTMENTS FOR LAPTOPS & SHORT SCREENS */
@media (max-height: 840px) {
  .single-screen-container {
    padding: 10px 24px 16px 24px;
  }
  .single-brand-header {
    padding-bottom: 6px;
  }
  .brand-rocket {
    width: 46px;
    height: 46px;
    font-size: 1.8rem;
  }
  .brand-main-name {
    font-size: 1.8rem;
  }
  .single-hero-stage {
    gap: 16px;
  }
  .single-hero-headline {
    font-size: 1.85rem;
    margin-bottom: 3px;
  }
  .single-eyebrow {
    margin-bottom: 4px;
    padding: 3px 10px;
    font-size: 0.78rem;
  }
  .single-hero-sub {
    font-size: 0.92rem;
  }
  .single-onboarding-box {
    padding: 12px 16px;
    gap: 9px;
  }
  .hero-choice-compact {
    min-height: 110px;
    padding: 8px 6px;
    border-radius: 16px;
  }
  .hero-choice-avatar-wrap {
    width: 58px;
    height: 64px;
  }
  .choice-label {
    font-size: 1.05rem;
  }
  .input-kids-hero-compact {
    padding: 9px 14px;
    font-size: 1.02rem;
  }
  .btn-hero-launch-compact {
    padding: 11px 18px;
    font-size: 1.05rem;
    min-height: 46px;
  }
  .single-character-stage,
  .single-character-wrapper {
    max-height: calc(100vh - 130px);
  }
  .single-character-img {
    max-height: calc(100vh - 140px);
  }
}

/* DESIGNER 20-QUESTION INTERACTIVE QUEST CARD */
.designer-quest-card {
  background: #ffffff;
  border: 2px solid rgba(124, 58, 237, 0.18);
  border-radius: 24px;
  padding: 0;
  box-shadow: 0 16px 40px rgba(124, 58, 237, 0.15);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.designer-quest-card.clean-quest-card {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: 0 20px 45px rgba(79, 70, 229, 0.18) !important;
}

/* DARK COSMIC THEME FOR MULTIPLICATION ADVENTURE QUEST CARD */
.games-multiplication-quest-card {
  margin-bottom: 28px;
  background: linear-gradient(145deg, #1e1b4b 0%, #0f172a 100%) !important;
  border: 2.5px solid #818cf8 !important;
  border-radius: 26px !important;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.45), 0 0 30px rgba(129, 140, 248, 0.2) !important;
}

.games-multiplication-quest-card .quest-map-stage-wrapper {
  border: 3px solid rgba(129, 140, 248, 0.4) !important;
  border-radius: 0 0 22px 22px !important;
}

.games-multiplication-quest-card .quest-map-bg-img {
  border-radius: 0 0 20px 20px !important;
}

.games-quest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: linear-gradient(135deg, #312e81 0%, #1e1b4b 100%);
  color: #ffffff;
  border-radius: 24px 24px 0 0;
  border-bottom: 1.5px solid rgba(129, 140, 248, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.games-quest-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.games-quest-icon {
  font-size: 1.8rem;
  background: rgba(129, 140, 248, 0.25);
  border: 1px solid rgba(165, 180, 252, 0.4);
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px rgba(129, 140, 248, 0.3);
}

.games-quest-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 900;
  color: #fef08a;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.games-quest-sub {
  margin: 2px 0 0 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #c7d2fe;
}

.games-quest-stats-badge {
  background: rgba(129, 140, 248, 0.25);
  border: 1.5px solid rgba(165, 180, 252, 0.5);
  padding: 7px 16px;
  border-radius: 18px;
  font-size: 0.92rem;
  font-weight: 800;
  color: #38bdf8;
  white-space: nowrap;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

/* NODES STYLING SCOPED TO MULTIPLICATION CARD */
.games-multiplication-quest-card .quest-node {
  background: rgba(15, 23, 42, 0.9);
  border: 3px solid #64748b;
  color: #cbd5e1;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.games-multiplication-quest-card .quest-node.completed {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  border-color: #a5f3fc;
  color: #ffffff;
  box-shadow: 0 0 22px rgba(6, 182, 212, 0.85), 0 4px 14px rgba(0, 0, 0, 0.4);
}

.games-multiplication-quest-card .quest-node.current-active {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  border-color: #fef08a;
  color: #ffffff;
  box-shadow: 0 0 28px rgba(236, 72, 153, 0.95);
  animation: activeTargetPulse 1.2s infinite ease-in-out;
}

/* SPEECH POPUP CALLOUT SCOPED TO MULTIPLICATION HERO MARKER */
.games-multiplication-quest-card .hero-speech-popup {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #fef08a;
  border: 2px solid #818cf8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 15px rgba(129, 140, 248, 0.4);
}

/* PLACE VALUE & COINS GAME STYLING */
.games-place-value-quest-card {
  margin-bottom: 28px;
  background: linear-gradient(145deg, #064e3b 0%, #022c22 100%) !important;
  border: 2.5px solid #34d399 !important;
  border-radius: 26px !important;
  box-shadow: 0 18px 50px rgba(6, 78, 59, 0.45), 0 0 30px rgba(52, 211, 153, 0.25) !important;
}

.place-value-theme-header {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%) !important;
  border-bottom: 1.5px solid rgba(52, 211, 153, 0.3) !important;
}

.place-value-badge {
  background: rgba(16, 185, 129, 0.25) !important;
  border: 1.5px solid rgba(110, 231, 183, 0.5) !important;
  color: #fef08a !important;
}

.games-place-value-quest-card .quest-node {
  background: rgba(6, 78, 59, 0.9);
  border: 3px solid #34d399;
  color: #a7f3d0;
}

.games-place-value-quest-card .quest-node.completed {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #fef08a;
  color: #ffffff;
  box-shadow: 0 0 22px rgba(16, 185, 129, 0.85);
}

.games-place-value-quest-card .quest-node.current-active {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  border-color: #ffffff;
  color: #ffffff;
  box-shadow: 0 0 28px rgba(251, 191, 36, 0.95);
  animation: activeTargetPulse 1.2s infinite ease-in-out;
}

/* ENGLISH QUEST MAP SUNSET THEME */
.games-english-quest-card {
  background: linear-gradient(145deg, #431407 0%, #1e1b4b 100%) !important;
  border: 2.5px solid #f59e0b !important;
  border-radius: 26px !important;
  box-shadow: 0 18px 50px rgba(67, 20, 7, 0.45), 0 0 30px rgba(245, 158, 11, 0.25) !important;
}

.english-theme-header {
  background: linear-gradient(135deg, #7c2d12 0%, #431407 50%, #311042 100%) !important;
  border-bottom: 1.5px solid rgba(245, 158, 11, 0.3) !important;
}

.games-english-quest-card .quest-node {
  background: rgba(67, 20, 7, 0.9);
  border: 3px solid #f59e0b;
  color: #fef08a;
}

.games-english-quest-card .quest-node.completed {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: #ffffff;
  color: #ffffff;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.7);
}

.games-english-quest-card .quest-node.current-active {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border-color: #fef08a;
  color: #ffffff;
  box-shadow: 0 0 24px rgba(249, 115, 22, 0.9);
  animation: activeTargetPulse 1.2s infinite ease-in-out;
}

/* PLACE VALUE LEVELS GRID */
.place-value-levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.pv-level-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pv-level-card:hover {
  transform: translateY(-4px);
  border-color: #10b981;
  box-shadow: 0 12px 24px rgba(16, 185, 129, 0.15);
}

.pv-level-card.active {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25), 0 8px 20px rgba(16, 185, 129, 0.15);
}

.pv-level-badge {
  display: inline-block;
  background: #10b981;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.pv-level-title {
  margin: 0 0 6px 0;
  font-size: 1.1rem;
  font-weight: 900;
  color: #065f46;
}

.pv-level-desc {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  line-height: 1.4;
}

/* INTERACTIVE PLACE-VALUE CHART COMPONENT */
.place-value-chart-wrapper {
  margin: 20px 0;
  overflow-x: auto;
  border-radius: 20px;
  border: 2.5px solid #10b981;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.12);
}

.pv-chart-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-family: var(--font-kids), 'Cairo', sans-serif;
}

.pv-period-header {
  background: #047857;
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 900;
  padding: 10px;
  border: 1px solid #065f46;
}

.pv-place-header {
  background: #dcfce7;
  color: #065f46;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 8px 6px;
  border: 1px solid #bbf7d0;
}

.pv-digit-cell {
  font-size: 1.8rem;
  font-weight: 900;
  color: #0f172a;
  padding: 14px 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  direction: ltr;
  unicode-bidi: isolate;
}

.pv-digit-cell.target-highlight {
  background: #fef08a !important;
  color: #9a3412 !important;
  border: 3px solid #f59e0b !important;
  animation: targetPulse 1.2s infinite ease-in-out;
}

.numeric-expression {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

/* COINS DISPLAY BADGES */
.coins-display-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
}

.coin-item-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #f59e0b;
  padding: 8px 16px;
  border-radius: 18px;
  font-weight: 900;
  color: #78350f;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.2);
}

/* QUEST MAP STAGE WRAPPER WITH DESIGNER 7 ARTWORK */
.quest-map-stage-wrapper {
  position: relative;
  width: 100%;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
  border: 3px solid rgba(255, 255, 255, 0.9);
}

.quest-map-bg-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 22px;
}

/* INTERACTIVE 20 NODES OVERLAY */
.quest-nodes-overlay {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}

.quest-node {
  position: absolute;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 4px solid #94a3b8;
  color: #1e293b;
  font-size: 1.5rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  z-index: 10;
}

.quest-node:hover {
  transform: translate(-50%, -50%) scale(1.18);
  z-index: 20;
}

.quest-node.completed {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-color: #ffffff;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.85), 0 4px 14px rgba(0, 0, 0, 0.3);
  animation: nodeGlowPulse 2s infinite ease-in-out;
}

.quest-node.current-active {
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
  border-color: #fcd34d;
  color: #ffffff;
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.95);
  animation: activeTargetPulse 1.2s infinite ease-in-out;
}

.quest-node.milestone-node {
  width: 73px;
  height: 73px;
  font-size: 1.75rem;
}

.quest-node.milestone-5, .quest-node.milestone-50 { border-color: #f59e0b; }
.quest-node.milestone-10, .quest-node.milestone-100 { border-color: #eab308; }
.quest-node.milestone-15, .quest-node.milestone-150 { border-color: #3b82f6; }
.quest-node.milestone-20, .quest-node.milestone-200 { border-color: #ec4899; }

.quest-board-overlay-badge {
  position: absolute;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #78350f 0%, #451a03 100%);
  color: #fef08a;
  border: 2px solid #f59e0b;
  border-radius: 8px;
  padding: 1px 7px;
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-weight: 900;
  font-size: 0.95rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  z-index: 5;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* GRAND VIBRANT STANDING HERO MARKER */
.standing-hero-marker {
  position: absolute;
  width: 110px;
  height: 140px;
  transform: translate(-50%, -70%);
  pointer-events: auto;
  cursor: pointer;
  z-index: 30;
  transition: left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), top 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: heroContinuousBounce 1.1s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.standing-hero-marker:hover {
  transform: translate(-50%, -70%) scale(1.18) rotate(3deg);
}

.standing-hero-marker.jumping {
  animation: heroJumpCheer 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.standing-hero-avatar-wrap {
  width: 100%;
  height: 100%;
  position: relative;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.standing-hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(124, 58, 237, 0.55)) drop-shadow(0 0 14px rgba(251, 191, 36, 0.8));
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* HERO BACKDROP SHARP GLOW HALO */
.hero-character-back-glow {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.75) 0%, rgba(167, 139, 250, 0.45) 55%, transparent 75%);
  border-radius: 50%;
  filter: blur(16px);
  z-index: -1;
  pointer-events: none;
  animation: heroBackGlowPulse 1.8s infinite alternate ease-in-out;
}

@keyframes heroBackGlowPulse {
  0% { transform: translateX(-50%) scale(0.9); opacity: 0.7; }
  100% { transform: translateX(-50%) scale(1.25); opacity: 1; }
}

/* HERO FEET GOLDEN PULSING AURA RING */
.hero-feet-aura {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 55px;
  height: 18px;
  background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.9) 0%, rgba(124, 58, 237, 0.45) 60%, transparent 80%);
  border-radius: 50%;
  filter: blur(4px);
  animation: auraJumpPulse 1.1s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  z-index: -1;
}

@keyframes auraJumpPulse {
  0% { transform: translateX(-50%) scale(1.1); opacity: 0.9; }
  35% { transform: translateX(-50%) scale(0.5); opacity: 0.3; }
  50% { transform: translateX(-50%) scale(0.4); opacity: 0.2; }
  75% { transform: translateX(-50%) scale(1.2); opacity: 1; }
  100% { transform: translateX(-50%) scale(1.1); opacity: 0.9; }
}

/* SPEECH POPUP BUBBLE ABOVE HERO HEAD */
.hero-speech-popup {
  position: absolute;
  top: -46px;
  left: 50%;
  transform: translateX(-50%) scale(1);
  background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
  color: #6d28d9;
  border: 2.5px solid #fbbf24;
  padding: 6px 14px;
  border-radius: 18px;
  font-size: 0.84rem;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3), 0 0 12px rgba(251, 191, 36, 0.5);
  pointer-events: none;
  opacity: 1;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 35;
  animation: speechBubblePulse 1.8s ease-in-out infinite alternate;
}

@keyframes speechBubblePulse {
  0% { transform: translateX(-50%) translateY(0) scale(1); }
  100% { transform: translateX(-50%) translateY(-4px) scale(1.04); }
}

.standing-hero-marker:hover .hero-speech-popup,
.standing-hero-marker.show-speech .hero-speech-popup {
  opacity: 1;
  transform: translateX(-50%) scale(1.08);
}

@keyframes heroContinuousBounce {
  0% {
    transform: translate(-50%, -70%) translateY(0) scale(1, 1) rotate(0deg);
  }
  25% {
    transform: translate(-50%, -70%) translateY(-22px) scale(0.96, 1.08) rotate(-2deg);
  }
  50% {
    transform: translate(-50%, -70%) translateY(-28px) scale(1.04, 0.96) rotate(2deg);
  }
  75% {
    transform: translate(-50%, -70%) translateY(-3px) scale(1.08, 0.92) rotate(0deg);
  }
  85% {
    transform: translate(-50%, -70%) translateY(2px) scale(1.12, 0.88) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -70%) translateY(0) scale(1, 1) rotate(0deg);
  }
}

@keyframes heroJumpCheer {
  0% { transform: translate(-50%, -70%) scale(1); }
  40% { transform: translate(-50%, -125%) scale(1.3) rotate(-8deg); }
  70% { transform: translate(-50%, -65%) scale(0.9) rotate(5deg); }
  100% { transform: translate(-50%, -70%) scale(1) rotate(0deg); }
}

@keyframes auraPulse {
  0% { transform: translateX(-50%) scale(0.85); opacity: 0.6; }
  100% { transform: translateX(-50%) scale(1.25); opacity: 1; }
}

/* QUEST WAVE PATH SVG */
.quest-path-svg-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.quest-wave-path-svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes nodeGlowPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(245, 158, 11, 0.6); }
  50% { box-shadow: 0 0 22px rgba(245, 158, 11, 0.95); }
}

@keyframes activeTargetPulse {
  0%, 100% { transform: translate(50%, -50%) scale(1); box-shadow: 0 0 14px rgba(124, 58, 237, 0.7); }
  50% { transform: translate(50%, -50%) scale(1.18); box-shadow: 0 0 26px rgba(252, 211, 77, 0.9); }
}

/* BOTTOM STRIP */
.quest-bottom-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 10px;
}

.quest-feature-pill {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
}

.quest-feature-pill.highlight-pill {
  background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
  border-color: #fcd34d;
  color: #92400e;
}

/* FLOATING BADGES REMOVED AS REQUESTED */
.floating-badge {
  display: none !important;
}

.badge-icon {
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.18);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-info strong {
  font-size: 0.88rem;
  color: #ffffff;
  font-weight: 800;
  display: block;
}

.badge-info small {
  font-size: 0.74rem;
  color: #fcd34d;
  font-weight: 700;
}

.badge-top-right {
  top: -10px;
  right: -25px;
  animation-delay: 0s;
}

.badge-mid-left {
  top: 38%;
  left: -35px;
  animation-delay: -1.5s;
}

.badge-bottom-right {
  bottom: -12px;
  right: -15px;
  animation-delay: -3s;
}

/* ANIMATION KEYFRAMES */
@keyframes pulseGlow {
  0% { transform: scale(1); opacity: 0.35; }
  100% { transform: scale(1.12); opacity: 0.55; }
}

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

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

@keyframes floatParticle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(15deg); }
}

/* RESPONSIVE LANDING BREAKPOINTS */
@media (max-width: 1024px) {
  .landing-experience-section.single-screen-landing {
    height: auto;
    min-height: 100vh;
    max-height: none;
    overflow-y: auto;
  }
  .single-screen-container {
    height: auto;
    max-height: none;
    padding: 20px;
  }
  .single-hero-stage {
    grid-template-columns: 1fr;
    max-height: none;
    gap: 30px;
    margin-top: 20px;
  }
  .single-hero-headline {
    font-size: 2.2rem;
  }
}

/* ==========================================================================
   INDEPENDENT BOTTOM 12-SUBJECT PROGRESS DASHBOARD STYLES
   ========================================================================== */
.bottom-subjects-progress-section {
  background: #ffffff;
  border-radius: var(--border-radius-lg, 24px);
  padding: 24px 28px;
  margin-top: 28px;
  border: 2px solid #e0d5fc;
  box-shadow: 0 12px 36px rgba(108, 92, 231, 0.08);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bottom-heading-title {
  font-weight: 900;
  font-size: 1.4rem;
  color: #1e1b4b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bottom-dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: stretch;
  width: 100%;
}

/* TOP HORIZONTAL OVERALL PROGRESS CARD */
.bottom-overall-progress-card {
  width: 100%;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #e0e7ff 100%);
  border-radius: 24px;
  padding: 16px 28px;
  border: 2px solid #c7d2fe;
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.12);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  overflow: hidden;
}

.bottom-overall-header {
  text-align: right;
  min-width: 150px;
}

.bottom-overall-header h3 {
  font-weight: 900;
  font-size: 1.4rem;
  color: #312e81;
  margin: 0 0 4px 0;
}

.bottom-overall-sub {
  font-weight: 800;
  font-size: 0.95rem;
  color: #6366f1;
}

.bottom-overall-ring-wrap {
  position: relative;
  width: 95px;
  height: 95px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confetti-dots-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.confetti-dots-bg .dot {
  position: absolute;
  border-radius: 50%;
}

.dot-1 { top: 6px; right: 8px; width: 6px; height: 6px; background: #ec4899; }
.dot-2 { top: 12px; left: 6px; width: 5px; height: 5px; background: #3b82f6; }
.dot-3 { bottom: 14px; right: 6px; width: 6px; height: 6px; background: #eab308; }
.dot-4 { bottom: 8px; left: 12px; width: 6px; height: 6px; background: #a855f7; }

.star-float {
  position: absolute;
  font-size: 0.95rem;
  animation: starGlowPulse 2.5s ease-in-out infinite;
}
.star-1 { top: 2px; left: 14px; }
.star-2 { top: 20px; right: -4px; }
.star-3 { bottom: 20px; left: -4px; }

@keyframes starGlowPulse {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.85; }
  50% { transform: scale(1.25) rotate(15deg); opacity: 1; filter: drop-shadow(0 0 8px #facc15); }
}

.bottom-overall-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.bottom-ring-bg {
  fill: none;
  stroke: rgba(199, 210, 254, 0.4);
  stroke-width: 12;
}

.bottom-ring-fill {
  fill: none;
  stroke: url(#bottomOverallRingGradient);
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-in-out;
}

.bottom-ring-center-content {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-star-badge {
  font-size: 1.3rem;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(250, 204, 21, 0.6));
}

.bottom-ring-center-content .ring-percent-num {
  font-weight: 900;
  font-size: 1.25rem;
  color: #312e81;
  line-height: 1;
  margin-top: 2px;
}

.bottom-overall-count-pill {
  background: #ffffff;
  padding: 8px 24px;
  border-radius: 20px;
  font-weight: 900;
  font-size: 1.15rem;
  color: #4338ca;
  box-shadow: 0 4px 12px rgba(67, 56, 202, 0.1);
  border: 1px solid #c7d2fe;
  flex-shrink: 0;
}

.bottom-overall-motivation {
  font-weight: 800;
  font-size: 1.05rem;
  color: #4338ca;
  line-height: 1.4;
  text-align: left;
  max-width: 380px;
  z-index: 2;
}

.bottom-card-landscape-footer {
  display: none;
}

/* 12 SUBJECTS GRID (FULL WIDTH WITH NON-OVERLAPPING PROPORTIONS) */
.bottom-subjects-grid-wrap {
  width: 100%;
}

.bottom-subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
  width: 100%;
}

.bottom-subject-card {
  position: relative;
  background: var(--card-bg, #ffffff);
  border: 2.5px solid var(--card-border, #e2d9fc);
  border-radius: 22px;
  min-height: 185px;
  height: 195px;
  padding: 12px 14px;
  display: flex;
  direction: ltr; /* Keeps character anchored to the LEFT side */
  align-items: stretch;
  justify-content: space-between;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bottom-subject-card:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

.bottom-subject-card:active {
  transform: scale(0.98);
}

/* Left Side 3D Character Container (Anchored Bottom-Left, Proportionally Sized) */
.bottom-card-char-wrap {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 42%;
  max-width: 135px;
  height: 96%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}

.bottom-card-char-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom left;
  filter: contrast(1.04) saturate(1.05);
  animation: companionWobbleBounce 3.8s ease-in-out infinite;
}

/* Right Side Info Column (Dedicated Breathing Room, No Overlap) */
.bottom-card-info-col {
  width: 58%;
  margin-left: auto;
  margin-right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  direction: rtl;
  z-index: 2;
  text-align: center;
  padding: 2px 2px 2px 4px;
}

.bottom-card-header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 38px;
}

.bottom-card-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.bottom-card-title {
  font-weight: 900;
  font-size: 1.05rem;
  line-height: 1.25;
  color: var(--card-accent, #6c5ce7);
  margin: 0;
  text-align: center;
  word-break: keep-all;
  overflow-wrap: normal;
  white-space: normal;
}

.bottom-card-ring-wrap {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 2px 0;
}

.bottom-card-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.bottom-ring-track {
  fill: none;
  stroke: rgba(0, 0, 0, 0.07);
  stroke-width: 6;
}

.bottom-ring-progress {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease-in-out;
}

.bottom-ring-percent-num {
  position: absolute;
  font-weight: 900;
  font-size: 1.05rem;
}

/* Crystal-Clear Question Count Badge */
.bottom-card-qs-pill {
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid currentColor;
  border-radius: 12px;
  padding: 4px 8px;
  font-weight: 800;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  white-space: nowrap;
}

.bottom-card-qs-pill .qs-solved-num {
  font-weight: 900;
  font-size: 0.92rem;
}

.bottom-card-qs-pill .qs-sep-text {
  font-size: 0.78rem;
  opacity: 0.85;
}

.bottom-card-qs-pill .qs-total-num {
  font-weight: 800;
  font-size: 0.88rem;
  opacity: 0.95;
}

.bottom-card-qs-pill .qs-unit-text {
  font-size: 0.78rem;
  opacity: 0.85;
}

/* RESPONSIVE LAYOUT */
@media (max-width: 1024px) {
  header {
    padding: 10px 16px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .header-controls {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .header-controls .btn {
    padding: 6px 10px;
    font-size: 0.86rem;
    min-height: 40px;
  }
  .badge-stars {
    padding: 6px 10px;
    font-size: 0.92rem;
  }
}

@media (max-width: 1100px) {
  .bottom-overall-progress-card {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    padding: 16px;
  }
  .bottom-overall-motivation {
    text-align: center;
    max-width: 100%;
  }
}

@media (max-width: 960px) {
  .bottom-subjects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
  .bottom-subjects-grid { grid-template-columns: 1fr; }
  .bottom-subjects-progress-section { padding: 16px; }
  
  header {
    padding: 8px 12px;
    gap: 8px;
  }
  .logo {
    font-size: 1.2rem;
    gap: 6px;
  }
  .logo span {
    font-size: 1.6rem;
  }
  .header-controls {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .header-controls .btn {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
  .badge-stars {
    padding: 5px 10px;
    font-size: 0.9rem;
    gap: 4px;
  }
}

@media (max-width: 360px) {
  header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .header-controls {
    justify-content: center;
    width: 100%;
  }
}

/* ==========================================================================
   MULTIPLICATION TABLES QUIZ GAME STYLES
   ========================================================================== */
.game-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.game-main-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.game-hero-panel {
  background: linear-gradient(135deg, #6c5ce7 0%, #a89bfd 50%, #fdcb6e 100%);
  border-radius: var(--border-radius-lg);
  padding: 24px 28px;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: 0 10px 30px rgba(108, 92, 231, 0.25);
}

.game-hero-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.game-hero-mascot {
  font-size: 3.2rem;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  backdrop-filter: blur(8px);
}

.game-hero-title {
  font-size: 1.9rem;
  font-weight: 900;
  margin: 0;
  color: #ffffff;
}

.game-hero-subtitle {
  font-size: 0.95rem;
  margin: 4px 0 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
}

.game-hero-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-stat-pill {
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--border-radius-md);
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.game-stat-pill .stat-emoji {
  font-size: 1.2rem;
}

.game-stat-pill span:not(.stat-emoji) {
  font-size: 1.15rem;
  font-weight: 900;
}

.game-stat-pill small {
  font-size: 0.72rem;
  opacity: 0.9;
  font-weight: 700;
}

.btn-sound-toggle {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  font-size: 1.4rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.btn-sound-toggle:hover {
  transform: scale(1.08);
}

.game-card-section {
  background: var(--color-card-bg, #ffffff);
  border: 2px solid var(--color-card-border, #e2e8f0);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-main, 0 8px 32px 0 rgba(31, 38, 135, 0.08));
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.section-card-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--color-text-main, #2d3748);
  margin: 0;
}

.section-card-sub {
  font-size: 0.9rem;
  color: var(--color-text-muted, #718096);
  margin: 4px 0 0 0;
  font-weight: 700;
}

.selector-actions-row {
  display: flex;
  gap: 8px;
}

.tables-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.table-card-btn {
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: var(--border-radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.table-card-btn:hover {
  transform: translateY(-3px);
  border-color: #6c5ce7;
  background: #f4f3ff;
}

.table-card-btn.selected {
  background: linear-gradient(135deg, #6c5ce7 0%, #8c7ae6 100%);
  border-color: #6c5ce7;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(108, 92, 231, 0.3);
}

.table-num-icon {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.table-title {
  font-size: 1.05rem;
  font-weight: 900;
}

.table-card-btn.selected .table-title {
  color: #ffffff;
}

.game-toast-error {
  margin-top: 14px;
  background: #fff5f5;
  border: 1px solid #feb2b2;
  color: #c53030;
  padding: 10px 16px;
  border-radius: var(--border-radius-sm);
  font-weight: 800;
  font-size: 0.9rem;
  text-align: center;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.setting-label {
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--color-text-main, #2d3748);
  margin-bottom: 10px;
  display: block;
}

.mode-options-row {
  display: flex;
  gap: 10px;
}

.count-options-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mode-card, .count-card {
  flex: 1;
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: var(--border-radius-md);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-card:hover, .count-card:hover {
  border-color: #6c5ce7;
  transform: translateY(-2px);
}

.mode-card.selected, .count-card.selected {
  background: #f0edff;
  border-color: #6c5ce7;
  color: #6c5ce7;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.15);
}

.mode-icon {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.mode-card strong {
  font-size: 0.95rem;
}

.mode-card small {
  font-size: 0.72rem;
  color: var(--color-text-muted, #718096);
  margin-top: 2px;
}

.start-game-row {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.btn-start-game {
  font-size: 1.25rem;
  padding: 14px 40px;
  border-radius: var(--border-radius-md);
  box-shadow: 0 8px 20px rgba(253, 203, 110, 0.4);
}

/* QUIZ STAGE */
.quiz-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 900;
  font-size: 1.1rem;
}

.quiz-timer-wrap {
  background: #fff7ed;
  border: 2px solid #ffedd5;
  color: #ea580c;
  padding: 6px 14px;
  border-radius: var(--border-radius-sm);
}

.quiz-lives-wrap {
  font-size: 1.3rem;
}

.quiz-progress-track {
  height: 12px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6c5ce7, #a89bfd);
  transition: width 0.3s ease;
}

.equation-box {
  background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
  border: 3px solid #cbd5e1;
  border-radius: var(--border-radius-lg);
  padding: 30px;
  text-align: center;
  margin-bottom: 24px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.equation-text {
  font-size: 3.2rem;
  font-weight: 900;
  color: var(--color-primary, #6c5ce7);
  letter-spacing: normal !important;
  display: inline-block;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.option-btn {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: var(--border-radius-md);
  padding: 18px;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--color-text-main, #2d3748);
  cursor: pointer;
  transition: all 0.2s ease;
  direction: ltr;
}

.option-btn:hover:not(:disabled) {
  border-color: #6c5ce7;
  transform: translateY(-2px);
  background: #f8fafc;
}

.option-btn.correct {
  background: #dcfce7 !important;
  border-color: #22c55e !important;
  color: #15803d !important;
}

.option-btn.incorrect {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #b91c1c !important;
}

.quiz-feedback-box {
  margin-top: 20px;
  padding: 14px 20px;
  border-radius: var(--border-radius-md);
  text-align: center;
  font-size: 1.15rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.quiz-feedback-box.correct {
  background: #f0fdf4;
  border: 2px solid #bbf7d0;
  color: #16a34a;
}

.quiz-feedback-box.incorrect {
  background: #fef2f2;
  border: 2px solid #fecaca;
  color: #dc2626;
}

/* SUMMARY & REWARD SHELF */
.summary-header {
  text-align: center;
  margin-bottom: 24px;
}

.summary-badge-icon {
  font-size: 4rem;
  margin-bottom: 8px;
}

.summary-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.summary-stat-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--border-radius-md);
  padding: 16px 12px;
  text-align: center;
}

.summary-stat-card .stat-num {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--color-primary, #6c5ce7);
}

.summary-stat-card .stat-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-muted, #718096);
  margin-top: 4px;
}

.summary-actions-row {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.reward-badges-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.reward-badge-item {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--border-radius-md);
  padding: 16px;
  text-align: center;
  transition: all 0.3s ease;
}

.reward-badge-item.unlocked {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #f59e0b;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.2);
}

.reward-badge-item.locked {
  opacity: 0.6;
  filter: grayscale(0.8);
}

.reward-badge-item .badge-icon {
  font-size: 2.2rem;
  margin-bottom: 6px;
}

.reward-badge-item .badge-name {
  font-weight: 900;
  font-size: 0.95rem;
  color: var(--color-text-main, #2d3748);
}

.reward-badge-item .badge-desc {
  font-size: 0.75rem;
  color: var(--color-text-muted, #718096);
  display: block;
  margin-top: 2px;
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 768px) {
  .tables-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

.quiz-companion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 2px dashed #e2e8f0;
}

.quiz-status-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* DUAL SIDE-BY-SIDE CIRCULAR PROGRESS RINGS */
.quiz-dual-circles-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.quiz-share-action-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  margin-inline-end: 4px;
}

.btn-share-beside-progress {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 8px 14px;
  font-family: var(--font-kids);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  white-space: nowrap;
}

.btn-share-beside-progress:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45);
  filter: brightness(1.05);
}

.btn-share-beside-progress:active {
  transform: translateY(0);
}

.btn-share-beside-progress .share-icon {
  font-size: 1.05rem;
}

.quiz-circle-progress-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 4px;
}

.quiz-circle-progress-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.circle-progress-svg {
  width: 130px;
  height: 130px;
  transform: rotate(-90deg);
}

.green-theme .circle-progress-svg {
  filter: drop-shadow(0 6px 18px rgba(34, 197, 94, 0.35));
}

.blue-theme .circle-progress-svg {
  filter: drop-shadow(0 6px 18px rgba(37, 99, 235, 0.35));
}

/* GREEN THEME (QUESTION PROGRESS) */
.circle-bg.green-bg {
  fill: none;
  stroke: #e2f5e8;
  stroke-width: 9.5;
}

.circle-fill.green-fill {
  fill: none;
  stroke: url(#circle-green-gradient);
  stroke-width: 9.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.green-text {
  color: #15803d;
}

.green-sub {
  color: #166534;
}

/* BLUE THEME (ACCURACY PERCENTAGE) */
.circle-bg.blue-bg {
  fill: none;
  stroke: #e0f2fe;
  stroke-width: 9.5;
}

.circle-fill.blue-fill {
  fill: none;
  stroke: url(#circle-blue-gradient);
  stroke-width: 9.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.blue-text {
  color: #1d4ed8;
}

.blue-sub {
  color: #1e40af;
}

.circle-progress-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.circle-pct-num {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.circle-bottom-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  line-height: 1.15;
}

.circle-q-fraction {
  font-size: 1.25rem;
  font-weight: 900;
  direction: ltr;
  display: inline-block;
}

.circle-q-label {
  font-size: 0.92rem;
  font-weight: 800;
  margin-top: 1px;
}

.quiz-companion-info {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
}

.quiz-companion-avatar-card {
  position: relative;
  width: 130px;
  height: 150px;
  background: linear-gradient(180deg, #ffffff 0%, #fff7ed 100%);
  border: 3px solid #ffedd5;
  border-radius: var(--border-radius-lg, 24px);
  box-shadow: 0 8px 24px rgba(251, 146, 60, 0.18);
  overflow: visible;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 3D HERO KID MASCOT BALLOON BOUQUET CELEBRATION */
.mascot-celebration-cluster {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

.mascot-bop-emoji {
  position: absolute;
  font-size: 2.6rem;
  top: 50%;
  left: 50%;
  pointer-events: none;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.22));
  will-change: transform, opacity;
  animation: mascotBalloonBop 2.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes mascotBalloonBop {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  15% {
    transform: translate(calc(-50% + var(--bx)), calc(-50% + var(--by))) scale(1.3);
    opacity: 1;
  }
  35% {
    transform: translate(calc(-50% + var(--bx)), calc(-50% + var(--by) - 10px)) scale(1.05);
    opacity: 1;
  }
  55% {
    transform: translate(calc(-50% + var(--bx)), calc(-50% + var(--by) + 8px)) scale(1.12);
    opacity: 1;
  }
  75% {
    transform: translate(calc(-50% + var(--bx)), calc(-50% + var(--by) - 6px)) scale(1.04);
    opacity: 1;
  }
  90% {
    transform: translate(calc(-50% + var(--bx)), calc(-50% + var(--by))) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--bx)), calc(-50% + var(--by) - 24px)) scale(0.3);
    opacity: 0;
  }
}

.quiz-companion-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transform: scale(1.05);
}

.quiz-companion-speech {
  position: relative;
  background: #ffffff;
  border: 2px solid #fed7aa;
  border-radius: 22px;
  padding: 14px 22px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-text-main, #2d3748);
  box-shadow: 0 4px 14px rgba(251, 146, 60, 0.1);
  transition: all 0.3s ease;
  max-width: 520px;
}

.quiz-companion-speech.correct {
  background: #f0fdf4;
  border-color: #86efac;
  color: #15803d;
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.15);
}

.quiz-companion-speech.incorrect {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.15);
}

.quiz-status-column {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* HIGH ENERGY ANIMATIONS */
.quiz-companion-avatar-card.mascot-celebrate,
.quiz-companion-avatar-card.react-bounce {
  animation: mascotCelebrate 0.8s ease forwards;
}

.quiz-companion-avatar-card.mascot-wobble,
.quiz-companion-avatar-card.react-shake {
  animation: mascotWobble 0.6s ease forwards;
}

@keyframes mascotCelebrate {
  0% { transform: scale(1) translateY(0) rotate(0deg); }
  25% { transform: scale(1.3) translateY(-28px) rotate(-8deg); }
  45% { transform: scale(0.92) translateY(0) rotate(4deg); }
  65% { transform: scale(1.18) translateY(-14px) rotate(-4deg); }
  85% { transform: scale(0.98) translateY(0) rotate(1deg); }
  100% { transform: scale(1) translateY(0) rotate(0deg); }
}

@keyframes mascotWobble {
  0% { transform: scale(1) translateX(0); }
  20% { transform: scale(1.1) translateX(-16px) rotate(-10deg); }
  40% { transform: scale(0.92) translateX(16px) rotate(10deg); }
  60% { transform: scale(1.05) translateX(-8px) rotate(-5deg); }
  80% { transform: scale(0.98) translateX(6px) rotate(3deg); }
  100% { transform: scale(1) translateX(0); }
}

.quiz-progress-track {
  height: 12px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6c5ce7, #a89bfd);
  transition: width 0.3s ease;
}

.equation-box {
  background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
  border: 3px solid #cbd5e1;
  border-radius: var(--border-radius-lg);
  padding: 30px;
  text-align: center;
  margin-bottom: 24px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.equation-text {
  font-size: 3.2rem;
  font-weight: 900;
  color: var(--color-primary, #6c5ce7);
  letter-spacing: normal !important;
  display: inline-block;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.option-btn {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: var(--border-radius-md);
  padding: 18px;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--color-text-main, #2d3748);
  cursor: pointer;
  transition: all 0.2s ease;
  direction: ltr;
}

.option-btn:hover:not(:disabled) {
  border-color: #6c5ce7;
  transform: translateY(-2px);
  background: #f8fafc;
}

.option-btn.correct {
  background: #dcfce7 !important;
  border-color: #22c55e !important;
  color: #15803d !important;
}

.option-btn.correct-highlight {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
  border: 3.5px solid #16a34a !important;
  color: #15803d !important;
  transform: translateY(-2px) !important;
  font-size: 2.3rem !important;
  font-weight: 900 !important;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25), 0 8px 22px rgba(34, 197, 94, 0.35) !important;
  z-index: 5 !important;
  animation: correctGlowPulse 1.2s ease-in-out infinite alternate !important;
}

@keyframes correctGlowPulse {
  0% {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25), 0 6px 18px rgba(34, 197, 94, 0.3);
    border-color: #22c55e !important;
  }
  100% {
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.4), 0 10px 28px rgba(34, 197, 94, 0.5);
    border-color: #16a34a !important;
  }
}

.option-btn.incorrect {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #b91c1c !important;
}

.option-btn.remainder-option {
  direction: rtl;
  font-size: 1.35rem;
  padding: 14px 10px;
}

.option-btn.remainder-option.correct-highlight {
  font-size: 1.45rem !important;
}

.quiz-feedback-box {
  margin-top: 20px;
  padding: 14px 20px;
  border-radius: var(--border-radius-md);
  text-align: center;
  font-size: 1.15rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.quiz-feedback-box.correct {
  background: #f0fdf4;
  border: 2px solid #bbf7d0;
  color: #16a34a;
}

.quiz-feedback-box.incorrect {
  background: #fef2f2;
  border: 2px solid #fecaca;
  color: #dc2626;
}

/* SUMMARY & REWARD SHELF */
.summary-header {
  text-align: center;
  margin-bottom: 24px;
}

.summary-badge-icon {
  font-size: 4rem;
  margin-bottom: 8px;
}

.summary-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.summary-stat-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--border-radius-md);
  padding: 16px 12px;
  text-align: center;
}

.summary-stat-card .stat-num {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--color-primary, #6c5ce7);
}

.summary-stat-card .stat-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-muted, #718096);
  margin-top: 4px;
}

.summary-actions-row {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.reward-badges-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.reward-badge-item {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--border-radius-md);
  padding: 16px;
  text-align: center;
  transition: all 0.3s ease;
}

.reward-badge-item.unlocked {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #f59e0b;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.2);
}

.reward-badge-item.locked {
  opacity: 0.6;
  filter: grayscale(0.8);
}

.reward-badge-item .badge-icon {
  font-size: 2.2rem;
  margin-bottom: 6px;
}

.reward-badge-item .badge-name {
  font-weight: 900;
  font-size: 0.95rem;
  color: var(--color-text-main, #2d3748);
}

.reward-badge-item .badge-desc {
  font-size: 0.75rem;
  color: var(--color-text-muted, #718096);
  display: block;
  margin-top: 2px;
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 768px) {
  .tables-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .summary-stats-grid, .reward-badges-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .tables-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .options-grid {
    grid-template-columns: 1fr;
  }
}

/* GAMES HUB SELECTION STYLES */
.games-hub-container {
  max-width: 1050px;
  margin: 0 auto;
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.game-hero-panel {
  background: linear-gradient(135deg, #fff9f2 0%, #fff3e6 100%);
  border: 2px solid #fed7aa;
  border-radius: var(--border-radius-lg);
  padding: 20px 24px;
  color: var(--color-text-main, #2d3748);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: 0 10px 28px rgba(251, 146, 60, 0.1);
}

.game-hero-main {
  display: flex;
  align-items: center;
  gap: 20px;
}

.game-hero-character-card {
  width: 110px;
  height: 110px;
  background: #ffffff;
  border: 2px solid #ffedd5;
  border-radius: var(--border-radius-md);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.game-hero-char-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: multiply;
}

.game-hero-title {
  font-size: 1.85rem;
  font-weight: 900;
  margin: 0;
  color: var(--color-primary, #6c5ce7);
}

.game-hero-subtitle {
  font-size: 0.95rem;
  margin: 6px 0 0 0;
  color: var(--color-text-muted, #718096);
  font-weight: 700;
}

.game-hero-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-stat-pill {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: var(--border-radius-md);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 86px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.game-stat-pill.star-pill {
  background: #fffbeb;
  border-color: #fef3c7;
}

.game-stat-pill.streak-pill {
  background: #fff7ed;
  border-color: #ffedd5;
}

.game-stat-pill.accuracy-pill {
  background: #f0fdf4;
  border-color: #dcfce7;
}

.game-stat-pill .stat-emoji {
  font-size: 1.3rem;
}

.game-stat-pill span:not(.stat-emoji) {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--color-text-main, #2d3748);
}

.game-stat-pill small {
  font-size: 0.75rem;
  color: var(--color-text-muted, #718096);
  font-weight: 800;
  margin-top: 2px;
}

.btn-sound-toggle {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  color: #4a5568;
  font-size: 1.3rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.btn-sound-toggle:hover {
  transform: scale(1.08);
  border-color: #6c5ce7;
}

.games-grid-heading {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--color-text-main, #2d3748);
  margin-bottom: 20px;
  border-right: 5px solid var(--color-primary, #6c5ce7);
  padding-right: 12px;
}

.games-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 510px));
  justify-content: center;
  gap: 24px;
  max-width: 1060px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 640px) {
  .games-cards-grid {
    grid-template-columns: minmax(0, 420px);
    justify-content: center;
    gap: 16px;
  }
}

.game-card-section {
  background: var(--color-card-bg, #ffffff);
  border: 2px solid var(--color-card-border, #e2e8f0);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-main, 0 8px 32px 0 rgba(31, 38, 135, 0.08));
}

.quiz-stage-card {
  position: relative;
  overflow: hidden;
}

/* QUESTION CARD CELEBRATION SHOWER */
.question-celebration-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 150;
  border-radius: var(--border-radius-lg, 24px);
}

.card-shower-balloon {
  position: absolute;
  top: -65px;
  font-size: 3.5rem;
  pointer-events: none;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.22));
  will-change: transform, opacity;
  animation: cardBalloonShower 2.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes cardBalloonShower {
  0% {
    transform: translateY(0) scale(0.5) rotate(0deg);
    opacity: 1;
  }
  35% {
    transform: translateY(180px) scale(1.3) rotate(-14deg);
    opacity: 1;
  }
  75% {
    transform: translateY(380px) scale(1.45) rotate(14deg);
    opacity: 1;
  }
  100% {
    transform: translateY(540px) scale(1.6) rotate(-10deg);
    opacity: 0;
  }
}

.game-hub-card {
  background: var(--color-card-bg, #ffffff);
  border: 2px solid var(--color-card-border, #e2e8f0);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-main, 0 8px 32px 0 rgba(31, 38, 135, 0.08));
  transition: all 0.3s ease;
}

.table-card-btn {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: var(--border-radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.table-card-btn:hover {
  transform: translateY(-3px);
  border-color: #6c5ce7;
  background: #f8fafc;
}

.table-card-btn.selected {
  background: #ffffff;
  border-color: #6c5ce7;
  color: var(--color-text-main, #2d3748);
  box-shadow: 0 4px 14px rgba(108, 92, 231, 0.15);
}

.table-check-mark {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 1.1rem;
  line-height: 1;
}

.table-number-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 1.7rem;
  font-weight: 900;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease;
}

.table-card-btn:hover .table-number-logo {
  transform: scale(1.08);
}

.table-logo-1 { background: linear-gradient(135deg, #6c5ce7, #a89bfd); }
.table-logo-2 { background: linear-gradient(135deg, #0984e3, #74b9ff); }
.table-logo-3 { background: linear-gradient(135deg, #00cec9, #81ecec); }
.table-logo-4 { background: linear-gradient(135deg, #00b894, #55efc4); }
.table-logo-5 { background: linear-gradient(135deg, #fdcb6e, #ffeaa7); color: #2d3748; }
.table-logo-6 { background: linear-gradient(135deg, #e17055, #fab1a0); }
.table-logo-7 { background: linear-gradient(135deg, #d63031, #ff7675); }
.table-logo-8 { background: linear-gradient(135deg, #e84393, #fd79a8); }
.table-logo-9 { background: linear-gradient(135deg, #8c7ae6, #9c88ff); }
.table-logo-10 { background: linear-gradient(135deg, #f1c40f, #f39c12); }

.table-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--color-text-main, #2d3748);
}

.table-card-btn.selected .table-title {
  color: #4338ca;
}

.active-game-card:hover {
  transform: translateY(-4px);
  border-color: #6c5ce7;
  box-shadow: 0 12px 32px rgba(108, 92, 231, 0.18);
}

.coming-soon-card {
  grid-column: 1 / -1;
  background: rgba(255, 255, 255, 0.9) !important;
  border: 2px dashed #cbd5e1 !important;
  border-radius: 20px !important;
  padding: 14px 22px !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04) !important;
  min-height: 60px !important;
  margin-top: 6px;
}

.coming-soon-card .coming-soon-badge {
  background: #f1f5f9;
  color: #64748b;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 4px 12px;
  border-radius: 12px;
  white-space: nowrap;
}

.coming-soon-card .game-card-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.coming-soon-card .game-card-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--color-text-main, #2d3748);
  margin: 0;
  white-space: nowrap;
}

.coming-soon-card .game-card-desc {
  font-size: 0.88rem;
  color: var(--color-text-muted, #718096);
  margin: 0;
  font-weight: 700;
  flex: 1;
}

.coming-soon-card .btn-disabled {
  padding: 8px 18px;
  font-size: 0.92rem;
  border-radius: 14px;
  min-height: 38px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .coming-soon-card {
    flex-direction: column !important;
    text-align: center !important;
    gap: 10px !important;
    padding: 16px !important;
  }
}

.card-tag {
  position: absolute;
  top: 18px;
  left: 18px;
  background: #e0e7ff;
  color: #4338ca;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 800;
}

.card-tag.locked-tag {
  background: #f1f5f9;
  color: #64748b;
}

.card-icon-wrap {
  width: 60px;
  height: 60px;
  background: #f4f3ff;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.card-emoji {
  font-size: 2.2rem;
}

.card-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--color-text-main, #2d3748);
  margin: 0 0 8px 0;
}

.card-desc {
  font-size: 0.92rem;
  color: var(--color-text-muted, #718096);
  line-height: 1.5;
  margin: 0 0 16px 0;
  font-weight: 700;
}

.card-features-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--color-text-muted, #4a5568);
  font-weight: 700;
}

.btn-play-game {
  margin-top: auto;
  width: 100%;
  font-size: 1.1rem;
  padding: 12px;
  border-radius: var(--border-radius-md);
}

/* MULTIPLICATION CHALLENGE TILE - STANDARDIZED PROPORTIONS */
.multiplication-challenge-tile {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 45%, #db2777 100%) !important;
  border: 3px solid rgba(255, 255, 255, 0.4) !important;
  border-radius: 26px !important;
  padding: 22px 20px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: space-between !important;
  text-align: center !important;
  box-shadow: 0 14px 32px rgba(124, 58, 237, 0.35) !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  min-height: 420px;
}

.multiplication-challenge-tile:hover {
  transform: translateY(-6px) scale(1.02) !important;
  box-shadow: 0 20px 42px rgba(124, 58, 237, 0.5) !important;
  border-color: #fde047 !important;
}

.multiplication-tile-bg-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.math-particle {
  position: absolute;
  font-family: var(--font-kids);
  font-weight: 900;
  color: rgba(255, 255, 255, 0.25);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  animation: floatMathEquation 4s ease-in-out infinite alternate;
}

.math-particle.p1 { top: 10%; left: 6%; font-size: 1.1rem; animation-delay: 0s; }
.math-particle.p2 { top: 20%; right: 8%; font-size: 1.25rem; animation-delay: 1s; }
.math-particle.p3 { bottom: 25%; left: 10%; font-size: 1.8rem; animation-delay: 1.5s; color: rgba(253, 224, 71, 0.35); }
.math-particle.p4 { bottom: 18%; right: 6%; font-size: 1.05rem; animation-delay: 2.2s; }
.math-particle.p5 { top: 46%; left: 5%; font-size: 1.4rem; animation-delay: 0.7s; color: rgba(253, 224, 71, 0.4); }

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

.multiplication-tile-header {
  position: relative;
  z-index: 2;
  margin-bottom: 4px;
  width: 100%;
}

.gold-glow-tag {
  background: linear-gradient(135deg, #fef08a 0%, #fde047 100%) !important;
  color: #854d0e !important;
  font-weight: 900 !important;
  box-shadow: 0 4px 14px rgba(253, 224, 71, 0.4) !important;
  display: inline-block;
  margin-bottom: 6px;
  font-size: 0.82rem !important;
  padding: 4px 12px !important;
  border-radius: 12px !important;
}

.multiplication-tile-title {
  font-size: 1.55rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.35) !important;
  margin: 4px 0 0 0 !important;
  line-height: 1.25 !important;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.multiplication-tile-character-wrap {
  position: relative;
  z-index: 2;
  margin: 6px 0 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.character-thought-bubble {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #a855f7;
  border-radius: 16px;
  padding: 4px 12px;
  font-weight: 900;
  font-size: 0.95rem;
  color: #5b21b6;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
  margin-bottom: 4px;
  position: relative;
  animation: thoughtPulse 2s ease-in-out infinite alternate;
}

.character-thought-bubble::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px 5px 0;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.95) transparent;
  display: block;
  width: 0;
}

@keyframes thoughtPulse {
  0% { transform: scale(1) translateY(0); }
  100% { transform: scale(1.04) translateY(-3px); }
}

.multiplication-character-avatar {
  width: 100%;
  max-width: 250px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px auto 14px auto;
}

.multiplication-character-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  border: 2.5px solid rgba(255, 255, 255, 0.7);
  transition: transform 0.3s ease;
}

.multiplication-challenge-tile:hover .multiplication-character-avatar img {
  transform: scale(1.04);
}

@keyframes hero3dFloatMove {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) scale(1.03) rotate(-2deg);
  }
  100% {
    transform: translateY(-3px) scale(1.01) rotate(2deg);
  }
}

.multiplication-play-btn {
  position: relative;
  z-index: 2;
  width: 100%;
  background: linear-gradient(135deg, #facc15 0%, #eab308 100%) !important;
  color: #713f12 !important;
  font-size: 1.25rem !important;
  font-weight: 900 !important;
  padding: 12px 22px !important;
  border-radius: 18px !important;
  box-shadow: 0 6px 18px rgba(234, 179, 8, 0.45) !important;
  border: 2px solid #fef08a !important;
  transition: all 0.25s ease !important;
  margin-top: auto;
}

.multiplication-play-btn:hover {
  transform: translateY(-3px) scale(1.03) !important;
  box-shadow: 0 10px 24px rgba(234, 179, 8, 0.55) !important;
  background: linear-gradient(135deg, #fde047 0%, #facc15 100%) !important;
}

/* DIVISION CHALLENGE TILE ON GAMES HUB */
.division-challenge-tile {
  background: linear-gradient(135deg, #0284c7 0%, #0d9488 50%, #059669 100%) !important;
  border: 3px solid rgba(255, 255, 255, 0.4) !important;
  border-radius: 26px !important;
  padding: 22px 20px !important;
  position: relative !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: space-between !important;
  text-align: center !important;
  box-shadow: 0 14px 32px rgba(13, 148, 136, 0.35) !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  min-height: 420px;
}

.division-challenge-tile:hover {
  transform: translateY(-6px) scale(1.02) !important;
  box-shadow: 0 20px 42px rgba(13, 148, 136, 0.5) !important;
  border-color: #6ee7b7 !important;
}

.division-tile-bg-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.div-particle {
  position: absolute;
  font-family: var(--font-kids);
  font-weight: 900;
  color: rgba(255, 255, 255, 0.25);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  animation: floatMathEquation 4s ease-in-out infinite alternate;
}

.div-particle.p1 { top: 10%; left: 6%; font-size: 1.1rem; animation-delay: 0s; }
.div-particle.p2 { top: 20%; right: 8%; font-size: 1.25rem; animation-delay: 1s; }
.div-particle.p3 { bottom: 25%; left: 10%; font-size: 1.8rem; animation-delay: 1.5s; color: rgba(110, 231, 183, 0.35); }
.div-particle.p4 { bottom: 18%; right: 6%; font-size: 1.05rem; animation-delay: 2.2s; }
.div-particle.p5 { top: 46%; left: 5%; font-size: 1.4rem; animation-delay: 0.7s; color: rgba(253, 224, 71, 0.4); }

.division-tile-header {
  position: relative;
  z-index: 2;
  margin-bottom: 4px;
  width: 100%;
}

.division-tile-title {
  font-size: 1.55rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.35) !important;
  margin: 4px 0 0 0 !important;
  line-height: 1.25 !important;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.division-tile-character-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 6px 0 10px 0;
}

.division-character-avatar {
  width: 100%;
  max-width: 250px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px auto 14px auto;
}

.division-character-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  border: 2.5px solid rgba(255, 255, 255, 0.7);
  transition: transform 0.3s ease;
}

.division-challenge-tile:hover .division-character-avatar img {
  transform: scale(1.04);
}

.division-play-btn {
  position: relative;
  z-index: 2;
  width: 100%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  font-size: 1.25rem !important;
  font-weight: 900 !important;
  padding: 12px 22px !important;
  border-radius: 18px !important;
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.45) !important;
  border: 2px solid #a7f3d0 !important;
  transition: all 0.25s ease !important;
  margin-top: auto;
}

.division-play-btn:hover {
  transform: translateY(-3px) scale(1.03) !important;
  box-shadow: 0 10px 24px rgba(5, 150, 105, 0.55) !important;
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%) !important;
}

/* Division Levels Selector Row */
.division-levels-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.division-level-pill {
  flex: 1 1 calc(20% - 10px);
  min-width: 130px;
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  padding: 12px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  font-family: var(--font-kids);
  text-align: center;
}

.division-level-pill:hover {
  transform: translateY(-3px);
  border-color: #0d9488;
  background: #f0fdfa;
}

.division-level-pill.selected {
  background: linear-gradient(135deg, #0d9488 0%, #059669 100%);
  color: #ffffff;
  border-color: #047857;
  box-shadow: 0 6px 18px rgba(13, 148, 136, 0.35);
}

.division-level-pill .level-icon {
  font-size: 1.4rem;
}

.division-level-pill .level-name {
  font-weight: 900;
  font-size: 0.95rem;
  color: #0f766e;
}

.division-level-pill.selected .level-name {
  color: #ffffff;
}

.division-level-pill .level-grades {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 700;
}

.division-level-pill.selected .level-grades {
  color: #d1fae5;
}

.division-level-pill .level-desc {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.25;
}

.division-level-pill.selected .level-desc {
  color: #a7f3d0;
}

/* Division Equation Visual Cue */
.division-visual-cue {
  margin: 8px auto 0 auto;
  padding: 6px 14px;
  background: rgba(13, 148, 136, 0.1);
  border: 1px dashed rgba(13, 148, 136, 0.3);
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f766e;
  display: inline-block;
}

body.dark-mode .division-visual-cue {
  background: rgba(110, 231, 183, 0.12);
  border-color: rgba(110, 231, 183, 0.3);
  color: #6ee7b7;
}

.div-tables-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 860px) {
  .div-tables-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 540px) {
  .div-tables-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .division-level-pill {
    flex: 1 1 100%;
  }
}

/* PLACE VALUE CHALLENGES TILE ON GAMES HUB */
.place-value-challenge-tile {
  background: linear-gradient(135deg, #059669 0%, #0d9488 50%, #d97706 100%) !important;
  border: 3px solid rgba(255, 255, 255, 0.4) !important;
  border-radius: 26px !important;
  padding: 22px 20px !important;
  position: relative !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: space-between !important;
  text-align: center !important;
  box-shadow: 0 14px 32px rgba(5, 150, 105, 0.35) !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  min-height: 420px;
}

.place-value-challenge-tile:hover {
  transform: translateY(-6px) scale(1.02) !important;
  box-shadow: 0 20px 42px rgba(5, 150, 105, 0.5) !important;
  border-color: #fde047 !important;
}

.place-value-tile-bg-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.pv-particle {
  position: absolute;
  font-family: var(--font-kids);
  font-weight: 900;
  color: rgba(255, 255, 255, 0.3);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  animation: floatMathEquation 4s ease-in-out infinite alternate;
}

.pv-particle.p1 { top: 10%; left: 6%; font-size: 1.1rem; animation-delay: 0s; }
.pv-particle.p2 { top: 20%; right: 8%; font-size: 1.25rem; animation-delay: 1s; }
.pv-particle.p3 { bottom: 25%; left: 10%; font-size: 1.8rem; animation-delay: 1.5s; color: rgba(253, 224, 71, 0.4); }
.pv-particle.p4 { bottom: 18%; right: 6%; font-size: 1.05rem; animation-delay: 2.2s; }
.pv-particle.p5 { top: 46%; left: 5%; font-size: 1.4rem; animation-delay: 0.7s; color: rgba(253, 224, 71, 0.45); }

.place-value-tile-header {
  position: relative;
  z-index: 2;
  margin-bottom: 4px;
  width: 100%;
}

.place-value-tile-title {
  font-size: 1.55rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.35) !important;
  margin: 4px 0 0 0 !important;
  line-height: 1.25 !important;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.place-value-tile-character-wrap {
  position: relative;
  z-index: 2;
  margin: 6px 0 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.place-value-character-avatar {
  width: 100%;
  max-width: 250px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px auto 14px auto;
}

.place-value-character-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  border: 2.5px solid rgba(255, 255, 255, 0.7);
  transition: transform 0.3s ease;
}

.place-value-challenge-tile:hover .place-value-character-avatar img {
  transform: scale(1.04);
}

.place-value-play-btn {
  position: relative;
  z-index: 2;
  width: 100%;
  background: linear-gradient(135deg, #facc15 0%, #eab308 100%) !important;
  color: #713f12 !important;
  font-size: 1.25rem !important;
  font-weight: 900 !important;
  padding: 12px 22px !important;
  border-radius: 18px !important;
  box-shadow: 0 6px 18px rgba(234, 179, 8, 0.45) !important;
  border: 2px solid #fef08a !important;
  transition: all 0.25s ease !important;
  margin-top: auto;
}

.place-value-play-btn:hover {
  transform: translateY(-3px) scale(1.03) !important;
  box-shadow: 0 10px 24px rgba(234, 179, 8, 0.55) !important;
  background: linear-gradient(135deg, #fde047 0%, #facc15 100%) !important;
}

/* ENGLISH WORD SPRINT TILE ON GAMES HUB */
.english-word-race-tile {
  background: linear-gradient(135deg, #1e40af 0%, #6366f1 50%, #d946ef 100%) !important;
  border: 3px solid rgba(255, 255, 255, 0.4) !important;
  border-radius: 26px !important;
  padding: 22px 20px !important;
  position: relative !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: space-between !important;
  text-align: center !important;
  box-shadow: 0 14px 32px rgba(99, 102, 241, 0.35) !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  min-height: 420px;
}

.english-word-race-tile:hover {
  transform: translateY(-6px) scale(1.02) !important;
  box-shadow: 0 20px 42px rgba(99, 102, 241, 0.5) !important;
  border-color: #fde047 !important;
}

.english-tile-bg-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.eng-particle {
  position: absolute;
  font-family: 'Outfit', var(--font-kids), sans-serif;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.3);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  animation: floatMathEquation 4s ease-in-out infinite alternate;
}

.eng-particle.p1 { top: 10%; left: 6%; font-size: 1.2rem; animation-delay: 0s; }
.eng-particle.p2 { top: 20%; right: 8%; font-size: 1.1rem; animation-delay: 1s; color: rgba(253, 224, 71, 0.45); }
.eng-particle.p3 { bottom: 25%; left: 10%; font-size: 1.8rem; animation-delay: 1.5s; }
.eng-particle.p4 { bottom: 18%; right: 6%; font-size: 1.15rem; animation-delay: 2.2s; }
.eng-particle.p5 { top: 46%; left: 5%; font-size: 1.4rem; animation-delay: 0.7s; color: rgba(253, 224, 71, 0.45); }

.english-tile-header {
  position: relative;
  z-index: 2;
  margin-bottom: 4px;
  width: 100%;
}

.english-tile-title {
  font-size: 1.55rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.35) !important;
  margin: 4px 0 0 0 !important;
  line-height: 1.25 !important;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.english-tile-character-wrap {
  position: relative;
  z-index: 2;
  margin: 6px 0 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.english-character-avatar {
  width: 100%;
  max-width: 250px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px auto 14px auto;
}

.english-character-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  border: 2.5px solid rgba(255, 255, 255, 0.7);
  transition: transform 0.3s ease;
}

.english-word-race-tile:hover .english-character-avatar img {
  transform: scale(1.04);
}

.english-race-play-btn {
  position: relative;
  z-index: 2;
  width: 100%;
  background: linear-gradient(135deg, #facc15 0%, #eab308 100%) !important;
  color: #713f12 !important;
  font-size: 1.25rem !important;
  font-weight: 900 !important;
  padding: 12px 22px !important;
  border-radius: 18px !important;
  box-shadow: 0 6px 18px rgba(234, 179, 8, 0.45) !important;
  border: 2px solid #fef08a !important;
  transition: all 0.25s ease !important;
  margin-top: auto;
}

.english-race-play-btn:hover {
  transform: translateY(-3px) scale(1.03) !important;
  box-shadow: 0 10px 24px rgba(234, 179, 8, 0.55) !important;
  background: linear-gradient(135deg, #fde047 0%, #facc15 100%) !important;
}

/* ENGLISH WORD SPRINT GAME ARENA STYLES */
.english-race-header-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #4f46e5 50%, #9333ea 100%) !important;
  color: #ffffff;
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 12px 32px rgba(79, 70, 229, 0.25);
}

.english-race-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.english-race-title-group {
  display: flex;
  align-items: center;
  gap: 18px;
}

.english-race-icon-badge {
  font-size: 2.8rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 12px;
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.english-race-title {
  font-size: 1.8rem;
  font-weight: 900;
  margin: 0 0 6px 0;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.english-race-subtitle {
  margin: 0;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

/* CATEGORIES GRID */
.english-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin: 20px 0;
}

.english-cat-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  user-select: none;
  position: relative;
}

.english-cat-card:hover {
  transform: translateY(-3px);
  border-color: #6c5ce7;
  background: #f8fafc;
}

.english-cat-card.selected {
  background: #ffffff;
  border-color: #6c5ce7;
  box-shadow: 0 4px 14px rgba(108, 92, 231, 0.18);
}

.english-cat-check-mark {
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 1.15rem;
  line-height: 1;
}

.english-cat-icon {
  font-size: 2.2rem;
  background: #f8fafc;
  padding: 8px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.english-cat-info {
  flex: 1;
}

.english-cat-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 4px 0;
}

.english-cat-desc {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

/* ARENA HUD & PLAY AREA */
.arena-hud-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #f8fafc;
  padding: 12px 20px;
  border-radius: 18px;
  border: 1.5px solid #e2e8f0;
  margin-bottom: 20px;
}

.hud-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-label {
  font-weight: 700;
  color: #64748b;
  font-size: 0.95rem;
}

.hud-value {
  font-weight: 900;
  color: #1e293b;
  font-size: 1.25rem;
}

.badge-cat {
  background: #e0e7ff;
  color: #3730a3;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.9rem;
}

.streak-multiplier {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 900;
  animation: pulseStreak 1s infinite alternate;
}

@keyframes pulseStreak {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

.timer-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 140px;
}

.timer-bar-fill {
  flex: 1;
  height: 10px;
  background: linear-gradient(90deg, #22c55e, #eab308, #ef4444);
  border-radius: 5px;
  transition: width 0.1s linear;
}

/* CLUE CARD */
.english-word-clue-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
  border: 2px solid #bae6fd;
  border-radius: 24px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(186, 230, 253, 0.3);
}

.clue-visual-icon {
  font-size: 4rem;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
  animation: hero3dFloatMove 2.5s infinite alternate;
}

.clue-text-block {
  flex: 1;
}

.clue-arabic-meaning {
  font-size: 2.2rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 4px;
}

.clue-instruction {
  font-size: 1.05rem;
  color: #475569;
  font-weight: 700;
}

.btn-pronounce-word {
  background: #38bdf8;
  color: white;
  border: none;
  font-size: 1.1rem;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.35);
  transition: all 0.2s ease;
}

.btn-pronounce-word:hover {
  transform: scale(1.05);
  background: #0284c7;
}

/* WORD SLOTS CONTAINER */
.word-slots-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 30px 0;
  flex-wrap: wrap;
  direction: ltr !important;
}

.word-letter-slot {
  width: 64px;
  height: 72px;
  border: 3px dashed #cbd5e1;
  border-radius: 16px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.04);
}

.word-letter-slot.filled {
  border-style: solid;
  border-color: #6366f1;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  color: #4338ca;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
  transform: scale(1.05);
}

.word-letter-slot.correct {
  border-color: #22c55e;
  background: #dcfce7;
  color: #15803d;
  transform: scale(1.08);
}

.word-letter-slot.wrong {
  border-color: #ef4444;
  background: #fee2e2;
  color: #b91c1c;
  animation: shakeWrong 0.4s ease;
}

@keyframes shakeWrong {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* LETTER POOL */
.letter-pool-container {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 24px 0;
  flex-wrap: wrap;
  direction: ltr !important;
}

.letter-tile {
  width: 62px;
  height: 68px;
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  font-size: 2rem;
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.letter-tile:hover {
  transform: translateY(-4px) scale(1.08);
  border-color: #6366f1;
  color: #4f46e5;
  box-shadow: 0 10px 22px rgba(99, 102, 241, 0.25);
}

.letter-tile:active {
  transform: scale(0.95);
}

.letter-tile.used {
  opacity: 0.25;
  pointer-events: none;
  transform: scale(0.9);
  border-style: dashed;
}

/* ACTIONS BAR */
.arena-actions-bar {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.btn-action-tool {
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  padding: 12px 20px !important;
  border-radius: 16px !important;
}

.btn-submit-word {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
  color: white !important;
  font-size: 1.15rem !important;
}

.word-feedback-banner {
  margin-top: 18px;
  padding: 14px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 1.1rem;
  text-align: center;
}

.word-feedback-banner.success {
  background: #dcfce7;
  color: #15803d;
  border: 1.5px solid #86efac;
}

.word-feedback-banner.error {
  background: #fee2e2;
  color: #b91c1c;
  border: 1.5px solid #fca5a5;
}

/* MASTERED WORDS LIST */
.mastered-words-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.mastered-chip {
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  padding: 8px 14px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.95rem;
  color: #1e293b;
}

@media (max-width: 768px) {
  .games-cards-grid {
    grid-template-columns: 1fr;
  }
  .word-letter-slot, .letter-tile {
    width: 48px;
    height: 54px;
    font-size: 1.5rem;
  }
}

/* ==========================================================================
   UX ENHANCEMENT LAYER — Child-First Tablet Experience
   منصة أبطال الغد — Interaction & Feedback Polish
   Added: tablet-optimized touch targets, immediate feedback animations,
          star burst rewards, continue-learning CTA, double-tap protection
   ========================================================================== */

/* ── 1. TOUCH RIPPLE EFFECT ON ALL INTERACTIVE CARDS ─────────────────────── */
@keyframes tapRipple {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(108, 92, 231, 0.45); }
  50% { transform: scale(0.97); box-shadow: 0 0 0 10px rgba(108, 92, 231, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(108, 92, 231, 0); }
}

.tap-feedback {
  animation: tapRipple 0.3s ease-out forwards;
}

/* ── 2. ANSWER OPTION CARDS — IMMEDIATE VISUAL FEEDBACK ──────────────────── */

/* Correct answer flash */
@keyframes correctFlash {
  0%   { background: white; border-color: var(--color-card-border); transform: scale(1); }
  30%  { background: #d1fae5; border-color: #10b981; transform: scale(1.04); box-shadow: 0 0 0 6px rgba(16,185,129,0.2); }
  70%  { background: #d1fae5; border-color: #10b981; transform: scale(1.02); }
  100% { background: #ecfdf5; border-color: #10b981; transform: scale(1); }
}

/* Incorrect answer flash */
@keyframes incorrectFlash {
  0%   { background: white; border-color: var(--color-card-border); transform: translateX(0); }
  15%  { background: #fee2e2; border-color: #ef4444; transform: translateX(-6px); }
  30%  { background: #fee2e2; border-color: #ef4444; transform: translateX(6px); }
  45%  { background: #fee2e2; border-color: #ef4444; transform: translateX(-4px); }
  60%  { background: #fee2e2; border-color: #ef4444; transform: translateX(4px); }
  75%  { background: #fee2e2; border-color: #ef4444; transform: translateX(-2px); }
  100% { background: #fef2f2; border-color: #ef4444; transform: translateX(0); }
}

.option-card.answer-correct {
  animation: correctFlash 0.5s ease-out forwards;
  border-color: #10b981 !important;
  background: #ecfdf5 !important;
  pointer-events: none;
}

.option-card.answer-incorrect {
  animation: incorrectFlash 0.55s ease-out forwards;
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
}

/* Lock all other options while answer is evaluating */
.option-card.answer-locked {
  pointer-events: none;
  opacity: 0.5;
  filter: grayscale(0.3);
}

/* ── 3. STAR BURST REWARD ANIMATION ──────────────────────────────────────── */
@keyframes starBurstFloat {
  0%   { opacity: 0; transform: translateY(0) scale(0.5); }
  20%  { opacity: 1; transform: translateY(-10px) scale(1.2); }
  80%  { opacity: 1; transform: translateY(-50px) scale(1); }
  100% { opacity: 0; transform: translateY(-80px) scale(0.8); }
}

.star-burst-reward {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  font-size: 1.6rem;
  font-weight: 900;
  font-family: var(--font-kids);
  color: #f59e0b;
  text-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
  animation: starBurstFloat 1.2s ease-out forwards;
  white-space: nowrap;
  user-select: none;
}

/* ── 4. CONTINUE LEARNING HERO CTA ZONE ─────────────────────────────────── */
#home-hero-cta-zone {
  margin-bottom: 20px;
}

.hero-cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #6c5ce7 0%, #a855f7 50%, #6c5ce7 100%);
  background-size: 200% 200%;
  animation: ctaGradientShift 4s ease infinite;
  border-radius: var(--border-radius-lg);
  padding: 20px 28px;
  box-shadow: 0 8px 30px rgba(108, 92, 231, 0.35), 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}

@keyframes ctaGradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-cta-banner::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  pointer-events: none;
}

.hero-cta-banner::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: 5%;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  pointer-events: none;
}

.hero-cta-text-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.hero-cta-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-cta-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: white;
  margin: 0;
  line-height: 1.3;
}

.hero-cta-sub {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
  margin: 0;
  font-weight: 600;
}

.btn-hero-continue {
  background: white;
  color: #6c5ce7;
  font-size: 1.15rem;
  font-weight: 900;
  padding: 16px 32px;
  border-radius: var(--border-radius-md);
  border: none;
  cursor: pointer;
  font-family: var(--font-kids);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  min-width: 180px;
  justify-content: center;
}

.btn-hero-continue:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  background: #f8f7ff;
}

.btn-hero-continue:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ── 5. ENHANCED SUBJECT CARD TOUCH TARGETS ─────────────────────────────── */
.bottom-subject-card {
  cursor: pointer;
  min-height: 88px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.bottom-subject-card:active {
  transform: scale(0.97);
}

/* ── 6. PROFILE CARD TOUCH ENHANCEMENT ──────────────────────────────────── */
.profile-avatar-option {
  -webkit-tap-highlight-color: transparent;
  min-height: 110px;
  min-width: 110px;
}

.profile-avatar-option:active {
  transform: scale(0.95);
}

/* ── 7. WORLD CARD TOUCH ENHANCEMENT ────────────────────────────────────── */
.world-card:active {
  transform: translateY(-4px) scale(0.98);
}

/* ── 8. REDUCED MOTION — DISABLE ALL ADDED ANIMATIONS ───────────────────── */
body.reduced-motion .hero-cta-banner,
body.reduced-motion .btn-hero-continue,
body.reduced-motion .tap-feedback,
body.reduced-motion .option-card.answer-correct,
body.reduced-motion .option-card.answer-incorrect,
body.reduced-motion .star-burst-reward {
  animation: none !important;
  transition: none !important;
}

/* ── 9. DARK MODE ADAPTATIONS FOR NEW ELEMENTS ───────────────────────────── */
body.dark-mode .hero-cta-banner {
  background: linear-gradient(135deg, #4c3ca7 0%, #7c3aed 50%, #4c3ca7 100%);
}

body.dark-mode .btn-hero-continue {
  background: #2d2b5a;
  color: #c4b5fd;
  border: 1px solid rgba(196, 181, 253, 0.3);
}

body.dark-mode .option-card.answer-correct {
  background: #052e16 !important;
  border-color: #10b981 !important;
}

body.dark-mode .option-card.answer-incorrect {
  background: #450a0a !important;
  border-color: #ef4444 !important;
}


.timer-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 170px;
}

.timer-bar-track {
  flex: 1;
  height: 14px;
  background: rgba(226, 232, 240, 0.85);
  border: 1.5px solid rgba(203, 213, 225, 0.9);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
}

.dark-mode .timer-bar-track {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(51, 65, 85, 0.9);
}

.timer-bar-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
  transition: width 0.1s linear, background 0.3s ease, box-shadow 0.3s ease;
}

#english-timer-seconds {
  font-family: var(--font-kids);
  font-weight: 800;
  font-size: 0.95rem;
  color: #1e293b;
  min-width: 32px;
  text-align: center;
}

.dark-mode #english-timer-seconds {
  color: #f1f5f9;
}

.btn-next-word {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
  color: #ffffff !important;
  font-size: 1.15rem !important;
  font-weight: 900 !important;
  padding: 12px 36px !important;
  border-radius: 16px !important;
  border: none !important;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45) !important;
  animation: nextWordPulse 1.5s infinite alternate;
  cursor: pointer;
}

@keyframes nextWordPulse {
  0% { transform: scale(1); box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4); }
  100% { transform: scale(1.04); box-shadow: 0 8px 26px rgba(124, 58, 237, 0.65); }
}


/* ==========================================================================
   SCIENCE CELL LAB GAME & MICROSCOPE EXPLORER STYLES (V2 PIXEL-PERFECT)
   ========================================================================== */

.science-cell-lab-tile {
  background: linear-gradient(135deg, #022c22 0%, #064e3b 50%, #0f172a 100%) !important;
  border: 3px solid #34d399 !important;
  border-radius: 28px !important;
  padding: 24px 20px !important;
  position: relative !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: space-between !important;
  text-align: center !important;
  box-shadow: 0 16px 36px rgba(16, 185, 129, 0.35) !important;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  min-height: 380px;
}

.science-cell-lab-tile:hover {
  transform: translateY(-8px) scale(1.02) !important;
  box-shadow: 0 24px 48px rgba(16, 185, 129, 0.5) !important;
  border-color: #6ee7b7 !important;
}

.science-tile-bg-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.science-tile-bg-particles .sci-particle {
  position: absolute;
  font-family: var(--font-kids);
  font-size: 0.95rem;
  font-weight: 800;
  color: rgba(167, 243, 208, 0.4);
  pointer-events: none;
  animation: floatMathEquation 4s infinite ease-in-out alternate;
}

.sci-particle.p1 { top: 10%; right: 8%; animation-delay: 0s; font-size: 1.1rem; }
.sci-particle.p2 { top: 48%; left: 6%; animation-delay: 1s; color: rgba(52, 211, 153, 0.6); }
.sci-particle.p3 { bottom: 22%; right: 10%; animation-delay: 2s; font-size: 1.2rem; }
.sci-particle.p4 { top: 25%; left: 10%; animation-delay: 1.5s; }
.sci-particle.p5 { bottom: 12%; left: 45%; animation-delay: 0.5s; font-size: 1.5rem; }

.science-tile-header {
  position: relative;
  z-index: 2;
  margin-bottom: 8px;
  width: 100%;
}

.science-tile-title {
  font-size: 1.85rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
  margin: 4px 0 0 0 !important;
}

.science-tile-character-wrap {
  position: relative;
  z-index: 2;
  margin: 8px 0 14px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.science-character-avatar {
  width: 250px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
}

.science-character-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
  border: 3px solid rgba(255, 255, 255, 0.85);
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.4));
  animation: hero3dFloatMove 3s ease-in-out infinite alternate;
}

.science-lab-play-btn {
  position: relative;
  z-index: 2;
  width: 100%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  font-size: 1.3rem !important;
  font-weight: 900 !important;
  padding: 13px 20px !important;
  border-radius: 20px !important;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45) !important;
  border: 2px solid #6ee7b7 !important;
  transition: all 0.25s ease !important;
}

.science-lab-play-btn:hover {
  transform: translateY(-3px) scale(1.03) !important;
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.65) !important;
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%) !important;
}

/* LAB CONTAINER & STAGES */
.science-lab-container {
  max-width: 1050px;
  margin: 0 auto;
  padding: 10px;
}

.science-lab-header-card {
  background: linear-gradient(135deg, #064e3b 0%, #047857 50%, #0f172a 100%) !important;
  color: #ffffff;
  border: 2.5px solid #34d399;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.25);
  margin-bottom: 24px;
}

.science-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.science-lab-title {
  font-family: var(--font-kids);
  font-size: 1.9rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 6px 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.science-lab-sub {
  font-family: var(--font-kids);
  font-size: 1.05rem;
  font-weight: 700;
  color: #a7f3d0;
  margin: 0;
}

.science-header-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sci-stat-badge {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  font-family: var(--font-kids);
  font-weight: 900;
  font-size: 1.1rem;
  color: #ffffff;
}

/* STATIONS TABS */
.science-stations-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px dashed rgba(255, 255, 255, 0.3);
  padding-top: 18px;
}

.station-tab-btn {
  flex: 1;
  min-width: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  font-family: var(--font-kids);
  font-weight: 800;
  font-size: 1rem;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.25s ease;
}

.station-tab-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.station-tab-btn.active {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%) !important;
  color: #022c22 !important;
  font-weight: 900;
  border-color: #6ee7b7 !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

/* STAGES CONTENT CARDS */
.science-lab-stage {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: var(--border-radius-lg);
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  margin-bottom: 24px;
}

.dark-mode .science-lab-stage {
  background: #1e293b;
  border-color: #334155;
}

.stage-instruction-box {
  background: #f0fdf4;
  border-right: 5px solid #10b981;
  border-radius: 18px;
  padding: 18px 22px;
  margin-bottom: 24px;
}

.dark-mode .stage-instruction-box {
  background: #064e3b;
  border-color: #34d399;
}

.stage-badge-pill {
  display: inline-block;
  background: #d1fae5;
  color: #065f46;
  font-family: var(--font-kids);
  font-weight: 900;
  font-size: 0.9rem;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.dark-mode .stage-badge-pill {
  background: #047857;
  color: #a7f3d0;
}

.stage-heading {
  font-family: var(--font-kids);
  font-size: 1.4rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 6px 0;
}

.dark-mode .stage-heading { color: #f8fafc; }

.stage-desc {
  font-family: var(--font-kids);
  font-size: 1rem;
  color: #475569;
  margin: 0;
  line-height: 1.5;
}

.dark-mode .stage-desc { color: #cbd5e1; }

/* MICROSCOPE STAGE - FIXED DISTORTION */
.microscope-interactive-arena {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 24px;
}

@media (max-width: 820px) {
  .microscope-interactive-arena {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.slides-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.slide-choice-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 18px;
  text-align: right;
  font-family: var(--font-kids);
  cursor: pointer;
  transition: all 0.25s ease;
}

.slide-choice-card:hover {
  background: #f0fdf4;
  border-color: #10b981;
  transform: translateY(-2px);
}

.slide-choice-card.selected {
  background: #ecfdf5;
  border-color: #10b981;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.25);
}

.slide-choice-card .slide-emoji {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.slide-choice-card strong {
  display: block;
  font-size: 1.1rem;
  color: #0f172a;
}

.slide-choice-card small {
  display: block;
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 2px;
}

.dark-mode .slide-choice-card {
  background: #0f172a;
  border-color: #334155;
}

.dark-mode .slide-choice-card strong { color: #f1f5f9; }

.dark-mode .slide-choice-card.selected {
  background: #064e3b;
  border-color: #34d399;
}

/* LENS VIEWPORT - PERFECT CIRCULAR PROPORTIONS */
.microscope-lens-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.lens-circular-viewport {
  width: 290px;
  height: 290px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 10px solid #1e293b;
  box-shadow: 0 0 0 6px #10b981, 0 14px 35px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lens-specimen-view {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.specimen-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center center;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.specimen-img.zoom-10x { transform: scale(1); }
.specimen-img.zoom-100x { transform: scale(1.45); }
.specimen-img.zoom-1000x { transform: scale(2.1); filter: saturate(1.25) contrast(1.1); }

.specimen-overlay-label {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  color: #6ee7b7;
  font-family: var(--font-kids);
  font-size: 0.9rem;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid rgba(16, 185, 129, 0.6);
  z-index: 5;
}

.lens-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70px;
  height: 70px;
  transform: translate(-50%, -50%);
  border: 1.5px dashed rgba(52, 211, 153, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 4;
}

.lens-glass-reflection {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 50%);
  pointer-events: none;
  border-radius: 50%;
  z-index: 3;
}

.lens-zoom-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zoom-label {
  font-family: var(--font-kids);
  font-weight: 800;
  font-size: 1rem;
  color: #1e293b;
}

.dark-mode .zoom-label { color: #f1f5f9; }

.zoom-btn {
  padding: 8px 18px !important;
  border-radius: 14px !important;
  font-weight: 800 !important;
  font-family: var(--font-kids) !important;
  font-size: 1rem !important;
}

.zoom-btn.selected {
  background: #10b981 !important;
  color: white !important;
  border-color: #059669 !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.science-concept-fact-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 1.5px solid #a7f3d0;
  border-radius: 18px;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-kids);
  font-size: 1.05rem;
  color: #065f46;
}

.dark-mode .science-concept-fact-card {
  background: #064e3b;
  border-color: #059669;
  color: #d1fae5;
}

/* HIERARCHY LADDER STAGE */
.hierarchy-slots-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.hierarchy-slot-box {
  flex: 1;
  min-width: 145px;
  max-width: 220px;
  background: #f8fafc;
  border: 2.5px dashed #cbd5e1;
  border-radius: 20px;
  padding: 14px;
  text-align: center;
  transition: all 0.25s ease;
}

.hierarchy-slot-box.filled {
  border-style: solid;
  border-color: #10b981;
  background: #f0fdf4;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.15);
}

.dark-mode .hierarchy-slot-box {
  background: #0f172a;
  border-color: #334155;
}

.dark-mode .hierarchy-slot-box.filled {
  background: #064e3b;
  border-color: #34d399;
}

.slot-num-badge {
  font-family: var(--font-kids);
  font-size: 0.85rem;
  font-weight: 800;
  color: #64748b;
  margin-bottom: 8px;
}

.slot-content-holder {
  font-family: var(--font-kids);
  font-size: 1.15rem;
  font-weight: 900;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  cursor: pointer;
}

.slot-content-holder.empty {
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 700;
}

.flow-arrow {
  font-size: 1.6rem;
  color: #10b981;
  font-weight: 900;
}

.hierarchy-cards-pool {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.hierarchy-card-item {
  padding: 14px 24px;
  background: white;
  border: 2px solid #3b82f6;
  border-radius: 18px;
  font-family: var(--font-kids);
  font-size: 1.2rem;
  font-weight: 900;
  color: #1d4ed8;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.15);
  transition: all 0.25s ease;
}

.hierarchy-card-item:hover {
  transform: translateY(-3px);
  background: #eff6ff;
  border-color: #2563eb;
}

.hierarchy-card-item.used {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.dark-mode .hierarchy-card-item {
  background: #1e293b;
  border-color: #60a5fa;
  color: #93c5fd;
}

.hierarchy-actions-bar {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
}

/* ORGANELLES MATCHING GRID */
.organelles-matching-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.organelle-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 22px;
  padding: 20px;
  text-align: center;
  font-family: var(--font-kids);
  transition: all 0.25s ease;
  cursor: pointer;
}

.organelle-card:hover {
  border-color: #10b981;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
}

.organelle-card.matched {
  border-color: #10b981;
  background: #f0fdf4;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.2);
}

.dark-mode .organelle-card {
  background: #0f172a;
  border-color: #334155;
}

.organelle-icon {
  font-size: 3.2rem;
  margin-bottom: 10px;
}

.organelle-name {
  font-size: 1.3rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 6px 0;
}

.dark-mode .organelle-name { color: #f8fafc; }

.organelle-role {
  font-size: 0.95rem;
  font-weight: 700;
  color: #059669;
  margin: 0;
  line-height: 1.4;
}

/* PLANT VS ANIMAL SORTING */
.sorting-baskets-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.sorting-basket {
  background: #f8fafc;
  border: 2.5px dashed #cbd5e1;
  border-radius: 22px;
  padding: 18px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.sorting-basket.plant-basket { border-color: #10b981; background: #f0fdf4; }
.sorting-basket.shared-basket { border-color: #3b82f6; background: #eff6ff; }
.sorting-basket.animal-basket { border-color: #f59e0b; background: #fffbeb; }

.dark-mode .sorting-basket.plant-basket { background: #064e3b; border-color: #059669; }
.dark-mode .sorting-basket.shared-basket { background: #1e3a8a; border-color: #3b82f6; }
.dark-mode .sorting-basket.animal-basket { background: #78350f; border-color: #d97706; }

.basket-header {
  font-family: var(--font-kids);
  font-size: 1.15rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.08);
}

.basket-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.trait-interactive-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.dark-mode .trait-interactive-card {
  background: #1e293b;
  border-color: #334155;
}

.trait-title {
  font-family: var(--font-kids);
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.dark-mode .trait-title { color: #f8fafc; }

.trait-assign-buttons {
  display: flex;
  gap: 6px;
}

.btn-assign-basket {
  flex: 1;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-family: var(--font-kids);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-assign-basket:hover {
  transform: scale(1.04);
}

.btn-assign-basket.btn-plant { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.btn-assign-basket.btn-shared { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.btn-assign-basket.btn-animal { background: #fef3c7; color: #92400e; border-color: #fcd34d; }

.traits-pool-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  background: #f1f5f9;
  padding: 18px;
  border-radius: 20px;
  margin-bottom: 18px;
}

.dark-mode .traits-pool-container { background: #0f172a; }

/* QUEST MAP IN SCIENCE LAB */
.games-science-quest-card {
  margin-top: 0px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #022c22 0%, #064e3b 100%) !important;
  border: 2.5px solid #34d399 !important;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.25);
}

.science-theme-header {
  color: #ffffff;
}

.science-theme-header .games-quest-title {
  color: #ffffff !important;
  font-size: 1.4rem;
  font-weight: 900;
  margin: 0;
}

.science-theme-header .games-quest-sub {
  color: #a7f3d0 !important;
  font-size: 0.95rem;
  margin: 4px 0 0 0;
}

.science-theme-header .games-quest-stats-badge {
  background: rgba(255, 255, 255, 0.2);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
}


.specimen-info-badge {
  background: linear-gradient(135deg, #022c22 0%, #064e3b 100%) !important;
  color: #6ee7b7 !important;
  font-family: var(--font-kids) !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  padding: 10px 22px !important;
  border-radius: 999px !important;
  border: 2px solid #34d399 !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3) !important;
  text-align: center !important;
  margin: 6px 0 !important;
  max-width: 95% !important;
  direction: rtl !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  line-height: 1.4 !important;
}

.dark-mode .specimen-info-badge {
  background: linear-gradient(135deg, #0f172a 0%, #064e3b 100%) !important;
  border-color: #6ee7b7 !important;
  color: #a7f3d0 !important;
}


.science-poster-stage-wrapper {
  position: relative;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  border: 3px solid rgba(52, 211, 153, 0.5);
  background: #0f172a;
}

.science-comprehensive-poster-img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-radius: 18px;
}

.science-lab-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  width: 100%;
}

.science-lab-back-btn {
  font-weight: 800;
  font-size: 1rem;
  padding: 10px 22px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-text-main);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.science-lab-back-btn:hover {
  transform: translateY(-2px);
  background: #ffffff;
}

body.dark-mode .science-lab-back-btn {
  background: #1e293b;
  color: #f1f5f9;
  border-color: #334155;
}

/* =========================================================================
   SCIENCE CLASSIFICATION & KINGDOMS LAB STYLES
   ========================================================================= */

.kingdoms-grid-arena {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.kingdoms-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.kingdom-select-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.85);
  border: 2.5px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.kingdom-select-card:hover {
  transform: translateY(-4px);
  border-color: var(--kingdom-color, #10b981);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.kingdom-select-card.selected {
  border-color: var(--kingdom-color, #10b981);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 253, 250, 0.95));
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25), 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: scale(1.03);
}

.kingdom-card-icon {
  font-size: 2.4rem;
  margin-bottom: 6px;
  display: block;
}

.kingdom-card-name {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--color-text-main);
  display: block;
  margin-bottom: 4px;
}

.kingdom-card-tag {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.3;
  display: block;
}

.kingdom-detail-inspector {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.kingdom-inspector-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding-right: 12px;
  margin-bottom: 16px;
}

.kingdom-inspector-header .inspector-icon {
  font-size: 2.8rem;
  background: rgba(255, 255, 255, 0.8);
  padding: 8px 12px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.kingdom-inspector-header .inspector-title {
  margin: 0 0 6px 0;
  font-size: 1.35rem;
  font-weight: 900;
}

.kingdom-inspector-header .inspector-desc {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-main);
  line-height: 1.6;
}

.kingdom-inspector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.inspector-stat-pill {
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
}

.dark-mode .kingdom-select-card {
  background: #1e293b;
  border-color: #334155;
}

.dark-mode .kingdom-card-name {
  color: #f8fafc;
}

.dark-mode .kingdom-detail-inspector {
  background: #0f172a;
  border-color: #334155;
}

.dark-mode .inspector-stat-pill {
  background: #1e293b;
  border-color: #475569;
}


/* HIERARCHY LADDER STYLES */
.hierarchy-ladder-arena {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.hierarchy-ladder-slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hierarchy-slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.95);
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  padding: 12px 20px;
  cursor: pointer;
  min-height: 56px;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.hierarchy-slot-row.filled {
  border: 2px solid #10b981;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 253, 250, 0.95));
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.12);
}

.hierarchy-slot-row.empty:hover {
  border-color: #3b82f6;
  background: #f8fafc;
}

.slot-rank-badge {
  background: #f1f5f9;
  color: #475569;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: bold;
}

.slot-value-text {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--color-text-main);
  flex-grow: 1;
  text-align: center;
}

.slot-remove-btn {
  background: #fee2e2;
  color: #ef4444;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: bold;
  padding: 6px 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.slot-remove-btn:hover {
  background: #fecaca;
}

.hierarchy-pool-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 16px 0;
  padding: 14px;
  background: rgba(241, 245, 249, 0.7);
  border-radius: 18px;
}

.hierarchy-badge-btn {
  background: rgba(255, 255, 255, 0.98);
  border: 2px solid #6366f1;
  color: #4338ca;
  font-weight: 800;
  font-size: 1.05rem;
  padding: 12px 22px;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.15);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.hierarchy-badge-btn:hover {
  transform: translateY(-3px);
  background: #eef2ff;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}

.hierarchy-actions-bar {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 18px;
}

/* SORTING BINS STYLES */
.sorting-bins-arena {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sorting-bins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.sorting-bin-card {
  border-radius: 20px;
  border: 2.5px solid;
  background: rgba(255, 255, 255, 0.95);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

.bin-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
}

.bin-icon {
  font-size: 2.2rem;
}

.bin-title {
  margin: 0 0 2px 0;
  font-size: 1.15rem;
  font-weight: 900;
}

.bin-items-dropzone {
  min-height: 120px;
  background: rgba(248, 250, 252, 0.85);
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
}

.bin-assigned-item {
  background: #ffffff;
  border: 1.5px solid #94a3b8;
  border-radius: 12px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.bin-assigned-item:hover {
  transform: translateY(-2px);
  background: #fee2e2;
  border-color: #ef4444;
}

.remove-trait-btn {
  background: none;
  border: none;
  color: #ef4444;
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
}

.traits-pool-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding: 16px;
  background: rgba(241, 245, 249, 0.75);
  border-radius: 18px;
}


.trait-draggable-card {
  background: rgba(255, 255, 255, 0.98);
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 10px 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}

.empty-bin-hint {
  color: #94a3b8;
  font-size: 0.9rem;
  text-align: center;
  width: 100%;
  padding: 35px 0;
  font-weight: 600;
}

/* QUIZ BOSS STYLES */
.science-quiz-box {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  border: 2px solid #e2e8f0;
  padding: 28px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  max-width: 800px;
  margin: 0 auto;
}

.quiz-q-counter {
  display: inline-block;
  background: #f1f5f9;
  color: #64748b;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 14px;
}

.science-quiz-prompt {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--color-text-main);
  margin: 0 0 24px 0;
  line-height: 1.6;
}

.science-quiz-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.science-quiz-opt-btn {
  padding: 18px 22px;
  border-radius: 18px;
  border: 2.5px solid #e2e8f0;
  background: #ffffff;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--color-text-main);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  text-align: right;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.science-quiz-opt-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
}

.science-quiz-opt-btn.correct {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0) !important;
  border-color: #22c55e !important;
  color: #15803d !important;
}

.science-quiz-opt-btn.incorrect {
  background: linear-gradient(135deg, #fee2e2, #fecaca) !important;
  border-color: #ef4444 !important;
  color: #b91c1c !important;
}

/* DARK MODE OVERRIDES */
.dark-mode .hierarchy-slot-row {
  background: #1e293b;
  border-color: #334155;
}

.dark-mode .slot-rank-badge {
  background: #0f172a;
  color: #94a3b8;
}

.dark-mode .hierarchy-pool-bank {
  background: #0f172a;
}

.dark-mode .hierarchy-badge-btn {
  background: #1e293b;
  border-color: #818cf8;
  color: #e0e7ff;
}

.dark-mode .sorting-bin-card {
  background: #1e293b;
}

.dark-mode .bin-items-dropzone {
  background: #0f172a;
  border-color: #334155;
}

.dark-mode .bin-assigned-item {
  background: #1e293b;
  border-color: #475569;
  color: #f1f5f9;
}

.dark-mode .traits-pool-container {
  background: #0f172a;
}

.dark-mode .trait-draggable-card {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

.dark-mode .science-quiz-box {
  background: #1e293b;
  border-color: #334155;
}

.dark-mode .quiz-q-counter {
  background: #0f172a;
  color: #94a3b8;
}

.dark-mode .science-quiz-opt-btn {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}


/* INTERACTIVE LAB VISUAL FEEDBACK (RED FOR WRONG, GREEN FOR CORRECT) */
.bin-assigned-item.item-wrong {
  background: #fee2e2 !important;
  border: 2px solid #ef4444 !important;
  color: #991b1b !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
  animation: itemShake 0.4s ease;
}

.bin-assigned-item.item-wrong .remove-trait-btn {
  color: #b91c1c !important;
}

.bin-assigned-item.item-correct {
  background: #dcfce7 !important;
  border: 2px solid #22c55e !important;
  color: #166534 !important;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25) !important;
}

.hierarchy-slot-row.slot-wrong {
  background: #fee2e2 !important;
  border: 2px solid #ef4444 !important;
  color: #991b1b !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
  animation: itemShake 0.4s ease;
}

.hierarchy-slot-row.slot-correct {
  background: #dcfce7 !important;
  border: 2px solid #22c55e !important;
  color: #166534 !important;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25) !important;
}

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

.dark-mode .bin-assigned-item.item-wrong {
  background: #7f1d1d !important;
  border-color: #f87171 !important;
  color: #fecaca !important;
}

.dark-mode .bin-assigned-item.item-correct {
  background: #14532d !important;
  border-color: #4ade80 !important;
  color: #bbf7d0 !important;
}

.dark-mode .hierarchy-slot-row.slot-wrong {
  background: #7f1d1d !important;
  border-color: #f87171 !important;
  color: #fecaca !important;
}

.dark-mode .hierarchy-slot-row.slot-correct {
  background: #14532d !important;
  border-color: #4ade80 !important;
  color: #bbf7d0 !important;
}


/* ==========================================================================
   VIBRANT & COLORFUL KIDS QUESTION SOLVING ARENA (ADVENTURE VIEW)
   ========================================================================== */

/* Arena Card Container */
.adventure-card {
  background: linear-gradient(145deg, #ffffff 0%, #fbf9ff 35%, #f4f6ff 70%, #fdf8ff 100%) !important;
  border: 2.5px solid #d8b4fe !important;
  border-radius: 28px !important;
  padding: 20px 24px !important;
  box-shadow: 0 16px 44px rgba(108, 92, 231, 0.12), 0 4px 12px rgba(99, 102, 241, 0.06) !important;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Question Header Rings Enhancement */
.quiz-circle-progress-container.blue-theme {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
  border: 1.5px solid #bfdbfe !important;
  border-radius: 20px !important;
  padding: 8px 14px !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.1) !important;
}

.quiz-circle-progress-container.green-theme {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
  border: 1.5px solid #bbf7d0 !important;
  border-radius: 20px !important;
  padding: 8px 14px !important;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.1) !important;
}

/* Mascot Speech Card */
.quiz-companion-speech {
  background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%) !important;
  border: 2px solid #c084fc !important;
  border-radius: 20px !important;
  box-shadow: 0 8px 22px rgba(192, 132, 252, 0.18) !important;
  color: #4c1d95 !important;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
}

/* Sleek Rainbow Progress Bar Track */
.quiz-progress-track {
  height: 12px !important;
  border-radius: 12px !important;
  background: rgba(199, 210, 254, 0.45) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06) !important;
  overflow: hidden;
  margin: 16px 0 20px 0 !important;
}

.quiz-progress-fill {
  height: 100% !important;
  background: linear-gradient(90deg, #ec4899 0%, #8b5cf6 30%, #3b82f6 65%, #10b981 100%) !important;
  border-radius: 12px !important;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.5) !important;
  transition: width 0.4s ease !important;
}

/* Instruction Banner */
.instruction-text {
  font-size: 1.18rem !important;
  font-weight: 900 !important;
  color: #4f46e5 !important;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%) !important;
  padding: 6px 18px !important;
  border-radius: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: fit-content !important;
  margin-bottom: 12px !important;
  border: 1.5px solid #c7d2fe !important;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.08) !important;
}

/* Equation & Question Prompt Box (Rich Gradient & Rainbow Top Line) */
.equation-box {
  background: linear-gradient(135deg, #ffffff 0%, #fdf4ff 45%, #f5f3ff 100%) !important;
  border: 2.5px solid #c084fc !important;
  border-top: 6px solid #8b5cf6 !important;
  border-radius: 24px !important;
  padding: 24px 28px !important;
  text-align: center !important;
  margin-bottom: 22px !important;
  box-shadow: 0 10px 28px rgba(147, 51, 234, 0.1), inset 0 2px 0 rgba(255, 255, 255, 0.9) !important;
  position: relative;
  overflow: hidden;
}

.equation-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #ec4899, #8b5cf6, #3b82f6, #10b981, #f59e0b);
}

.prompt-text p,
.prompt-text {
  font-family: var(--font-kids), 'Cairo', 'Tajawal', sans-serif !important;
  font-size: clamp(1.45rem, 2.3vw, 1.95rem) !important;
  font-weight: 900 !important;
  color: #1e1b4b !important;
  line-height: 1.6 !important;
  letter-spacing: normal !important;
  margin: 0 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   COLORFUL 4-CHOICE GRID WITH PLAYFUL PALETTES (أ، ب، ج، د)
   ========================================================================== */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.option-card {
  position: relative;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 14px !important;
  padding: 16px 20px !important;
  min-height: 84px !important;
  border-radius: 22px !important;
  cursor: pointer;
  direction: rtl;
  text-align: right;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Circular 3D Letter Badge (أ، ب، ج، د) */
.option-badge-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.35rem;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18), inset 0 2px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.2s ease;
}

.option-content-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

.option-text {
  font-family: var(--font-kids), 'Cairo', 'Tajawal', sans-serif !important;
  font-size: clamp(1.25rem, 1.8vw, 1.65rem) !important;
  font-weight: 900 !important;
  line-height: 1.35 !important;
  letter-spacing: normal !important;
  margin: 0 !important;
}

.option-visual {
  font-size: 2.2rem !important;
  margin-bottom: 2px !important;
}

/* 🎨 CHOICE 1: Rose Coral Sunset Theme (أ) */
.option-card:nth-child(1),
.option-card[data-index="0"] {
  background: linear-gradient(135deg, #ffffff 0%, #fff1f2 100%) !important;
  border: 2.5px solid #fecdd3 !important;
  box-shadow: 0 6px 18px rgba(244, 63, 94, 0.12), 0 3.5px 0 #fda4af !important;
}
.option-card:nth-child(1) .option-badge-circle,
.option-card[data-index="0"] .option-badge-circle {
  background: linear-gradient(135deg, #fb7185 0%, #f43f5e 100%);
}
.option-card:nth-child(1) .option-text,
.option-card[data-index="0"] .option-text {
  color: #881337 !important;
}
.option-card:nth-child(1):hover:not(.option-card-faded),
.option-card[data-index="0"]:hover:not(.option-card-faded) {
  border-color: #f43f5e !important;
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 12px 26px rgba(244, 63, 94, 0.22), 0 4.5px 0 #f43f5e !important;
}

/* 🎨 CHOICE 2: Emerald Mint Green Theme (ب) */
.option-card:nth-child(2),
.option-card[data-index="1"] {
  background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%) !important;
  border: 2.5px solid #a7f3d0 !important;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.12), 0 3.5px 0 #6ee7b7 !important;
}
.option-card:nth-child(2) .option-badge-circle,
.option-card[data-index="1"] .option-badge-circle {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}
.option-card:nth-child(2) .option-text,
.option-card[data-index="1"] .option-text {
  color: #064e3b !important;
}
.option-card:nth-child(2):hover:not(.option-card-faded),
.option-card[data-index="1"]:hover:not(.option-card-faded) {
  border-color: #10b981 !important;
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 12px 26px rgba(16, 185, 129, 0.22), 0 4.5px 0 #10b981 !important;
}

/* 🎨 CHOICE 3: Sky Royal Blue / Indigo Theme (ج) */
.option-card:nth-child(3),
.option-card[data-index="2"] {
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%) !important;
  border: 2.5px solid #bfdbfe !important;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.12), 0 3.5px 0 #93c5fd !important;
}
.option-card:nth-child(3) .option-badge-circle,
.option-card[data-index="2"] .option-badge-circle {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}
.option-card:nth-child(3) .option-text,
.option-card[data-index="2"] .option-text {
  color: #1e3a8a !important;
}
.option-card:nth-child(3):hover:not(.option-card-faded),
.option-card[data-index="2"]:hover:not(.option-card-faded) {
  border-color: #3b82f6 !important;
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 12px 26px rgba(59, 130, 246, 0.22), 0 4.5px 0 #3b82f6 !important;
}

/* 🎨 CHOICE 4: Golden Amber Sunset Theme (د) */
.option-card:nth-child(4),
.option-card[data-index="3"] {
  background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%) !important;
  border: 2.5px solid #fde68a !important;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.12), 0 3.5px 0 #fcd34d !important;
}
.option-card:nth-child(4) .option-badge-circle,
.option-card[data-index="3"] .option-badge-circle {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}
.option-card:nth-child(4) .option-text,
.option-card[data-index="3"] .option-text {
  color: #78350f !important;
}
.option-card:nth-child(4):hover:not(.option-card-faded),
.option-card[data-index="3"]:hover:not(.option-card-faded) {
  border-color: #f59e0b !important;
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 12px 26px rgba(245, 158, 11, 0.22), 0 4.5px 0 #f59e0b !important;
}

/* ==========================================================================
   ULTRA-CLEAR SELECTION SHIELD & ACTIVE STATE SYSTEM
   ========================================================================== */

/* Shield Badge Placeholder (Unselected: Subtle Outline) */
.option-shield-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px dashed #cbd5e1;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.5;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

/* 1. Selection Dot: Active radio dot on selection (NO CHECKMARK!) */
.option-shield-badge .shield-select-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #4338ca;
  display: none;
  transform: scale(0.4);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 2. Checkmark: Strictly reserved for verified correct answers AFTER check */
.option-shield-badge .shield-check-icon {
  font-size: 1.15rem;
  font-weight: 900;
  color: #ffffff;
  display: none;
  line-height: 1;
}

/* 3. Cross: Strictly reserved for verified wrong answers AFTER check */
.option-shield-badge .shield-cross-icon {
  font-size: 1.05rem;
  font-weight: 900;
  color: #ffffff;
  display: none;
  line-height: 1;
}

/* 🌟 UNIVERSAL SELECTED CARD STYLES (User selection before check)
   Distinctive, darker, unmistakable highlight so the student clearly sees
   their current active choice without any confusing checkmarks. */
.option-card.selected {
  transform: translateY(-4px) scale(1.02) !important;
  z-index: 4 !important;
  border: 3.5px solid #4338ca !important;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%) !important;
  box-shadow: 0 0 0 3.5px rgba(79, 70, 229, 0.3), 0 12px 28px rgba(79, 70, 229, 0.22), 0 4px 0 #3730a3 !important;
  animation: selectBouncePop 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

@keyframes selectBouncePop {
  0% { transform: scale(0.98); }
  50% { transform: translateY(-6px) scale(1.035); }
  100% { transform: translateY(-4px) scale(1.02); }
}

@keyframes selectDotPop {
  0% { transform: scale(0.2); opacity: 0; }
  60% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.option-card.selected .option-text {
  color: #1e1b4b !important;
  font-weight: 900 !important;
}

.option-card.selected .option-badge-circle {
  transform: scale(1.1) rotate(6deg) !important;
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(67, 56, 202, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.5) !important;
}

/* Activated Selection Dot Badge (Filled inner core - NO CHECKMARK!) */
.option-card.selected .option-shield-badge {
  opacity: 1 !important;
  transform: scale(1.12) !important;
  border: 2.5px solid #4338ca !important;
  background: #ffffff !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25) !important;
}

.option-card.selected .option-shield-badge .shield-select-dot {
  display: block !important;
  transform: scale(1) !important;
  background: #4338ca !important;
  animation: selectDotPop 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* Ensure checkmark and cross are strictly hidden while merely selected */
.option-card.selected:not(.answer-correct):not(.option-correct):not(.correct-answer-reveal) .option-shield-badge .shield-check-icon,
.option-card.selected:not(.answer-incorrect):not(.option-wrong):not(.wrong-answer-active) .option-shield-badge .shield-cross-icon {
  display: none !important;
}

/* ✅ CORRECT ANSWER REACTION (AFTER SUBMISSION) */
.option-card.answer-correct,
.option-card.option-correct,
.option-card.correct-answer-reveal,
.option-card.correct-answer-active {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
  border: 3.5px solid #16a34a !important;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.35), 0 12px 32px rgba(34, 197, 94, 0.35), 0 4px 0 #15803d !important;
  transform: scale(1.03) !important;
  animation: cardBouncePop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
}

.option-card.answer-correct .option-text,
.option-card.option-correct .option-text,
.option-card.correct-answer-reveal .option-text,
.option-card.correct-answer-active .option-text {
  color: #14532d !important;
  font-weight: 900 !important;
}

.option-card.answer-correct .option-badge-circle,
.option-card.option-correct .option-badge-circle,
.option-card.correct-answer-reveal .option-badge-circle {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4) !important;
}

.option-card.answer-correct .option-shield-badge,
.option-card.option-correct .option-shield-badge,
.option-card.correct-answer-reveal .option-shield-badge {
  opacity: 1 !important;
  transform: scale(1.2) !important;
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  border: 2.5px solid #ffffff !important;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.45) !important;
}

.option-card.answer-correct .option-shield-badge .shield-select-dot,
.option-card.option-correct .option-shield-badge .shield-select-dot,
.option-card.correct-answer-reveal .option-shield-badge .shield-select-dot {
  display: none !important;
}

.option-card.answer-correct .option-shield-badge .shield-check-icon,
.option-card.option-correct .option-shield-badge .shield-check-icon,
.option-card.correct-answer-reveal .option-shield-badge .shield-check-icon {
  display: flex !important;
  color: #ffffff !important;
  font-size: 1.25rem !important;
  font-weight: 900 !important;
}

/* ❌ INCORRECT ANSWER REACTION (AFTER SUBMISSION) */
.option-card.answer-incorrect,
.option-card.option-wrong,
.option-card.wrong-answer-active {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
  border: 3.5px solid #dc2626 !important;
  box-shadow: 0 0 0 3.5px rgba(239, 68, 68, 0.3), 0 12px 28px rgba(239, 68, 68, 0.25), 0 4px 0 #b91c1c !important;
  animation: itemShake 0.45s ease !important;
}

.option-card.answer-incorrect .option-text,
.option-card.option-wrong .option-text,
.option-card.wrong-answer-active .option-text {
  color: #7f1d1d !important;
  font-weight: 900 !important;
}

.option-card.answer-incorrect .option-badge-circle,
.option-card.option-wrong .option-badge-circle,
.option-card.wrong-answer-active .option-badge-circle {
  background: linear-gradient(135deg, #f87171 0%, #dc2626 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4) !important;
}

.option-card.answer-incorrect .option-shield-badge,
.option-card.option-wrong .option-shield-badge,
.option-card.wrong-answer-active .option-shield-badge {
  opacity: 1 !important;
  transform: scale(1.2) !important;
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  border: 2.5px solid #ffffff !important;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.45) !important;
}

.option-card.answer-incorrect .option-shield-badge .shield-select-dot,
.option-card.option-wrong .option-shield-badge .shield-select-dot,
.option-card.wrong-answer-active .option-shield-badge .shield-select-dot {
  display: none !important;
}

.option-card.answer-incorrect .option-shield-badge .shield-cross-icon,
.option-card.option-wrong .option-shield-badge .shield-cross-icon,
.option-card.wrong-answer-active .option-shield-badge .shield-cross-icon {
  display: flex !important;
  color: #ffffff !important;
  font-size: 1.25rem !important;
  font-weight: 900 !important;
}

/* 🌙 DARK MODE OVERRIDES */
body.dark-mode .option-card.selected {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%) !important;
  border-color: #818cf8 !important;
  box-shadow: 0 0 0 3.5px rgba(129, 140, 248, 0.35), 0 12px 28px rgba(0, 0, 0, 0.5), 0 4px 0 #4338ca !important;
}

body.dark-mode .option-card.selected .option-text {
  color: #ffffff !important;
}

body.dark-mode .option-card.selected .option-shield-badge {
  background: #0f172a !important;
  border-color: #818cf8 !important;
  box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3) !important;
}

body.dark-mode .option-card.selected .option-shield-badge .shield-select-dot {
  background: #818cf8 !important;
}

/* ENHANCED ACTION BUTTONS */
#btn-check {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
  color: #ffffff !important;
  font-weight: 900 !important;
  font-size: 1.18rem !important;
  border-radius: 18px !important;
  padding: 12px 28px !important;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35) !important;
  border: 2px solid #a5b4fc !important;
  transition: all 0.25s ease !important;
}
#btn-check:hover {
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.5) !important;
}

#btn-next-question {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #ffffff !important;
  font-weight: 900 !important;
  font-size: 1.22rem !important;
  border-radius: 18px !important;
  padding: 12px 28px !important;
  box-shadow: 0 8px 26px rgba(245, 158, 11, 0.45) !important;
  border: 2px solid #fde68a !important;
  animation: nextPulseBtn 1.8s infinite alternate !important;
}

@keyframes nextPulseBtn {
  0% { transform: scale(1); box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4); }
  100% { transform: scale(1.03); box-shadow: 0 12px 32px rgba(245, 158, 11, 0.7); }
}

/* FEEDBACK PANELS */
.feedback-panel.correct {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
  border: 2.5px solid #4ade80 !important;
  border-radius: 20px !important;
  box-shadow: 0 8px 26px rgba(34, 197, 94, 0.18) !important;
  color: #14532d !important;
  padding: 16px 20px !important;
}
.feedback-panel.correct .feedback-header {
  font-size: 1.3rem !important;
  font-weight: 900 !important;
  color: #15803d !important;
}

.feedback-panel.incorrect {
  background: linear-gradient(135deg, #fff1f2 0%, #fee2e2 100%) !important;
  border: 2.5px solid #f87171 !important;
  border-radius: 20px !important;
  box-shadow: 0 8px 26px rgba(239, 68, 68, 0.18) !important;
  color: #7f1d1d !important;
  padding: 16px 20px !important;
}
.feedback-panel.incorrect .feedback-header {
  font-size: 1.3rem !important;
  font-weight: 900 !important;
  color: #b91c1c !important;
}


/* ==========================================================================
   BALANCED ARENA: PROMINENT TOP HERO MASCOT & RINGS + COMPACT SLEEK QUESTION & OPTIONS
   ========================================================================== */

/* Top Companion Header & Mascot Avatar */
.quiz-companion-header {
  margin-bottom: 14px !important;
  padding-bottom: 14px !important;
  gap: 16px !important;
}

.quiz-companion-avatar-card {
  width: 105px !important;
  height: 120px !important;
  border-radius: 24px !important;
  box-shadow: 0 10px 28px rgba(251, 146, 60, 0.28) !important;
}

.quiz-companion-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.2)) !important;
  transform: scale(1.08) !important;
}

.quiz-companion-speech {
  padding: 12px 20px !important;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  border-radius: 20px !important;
}

/* Dual Progress Rings - Prominent & Highly Legible */
.quiz-circle-progress-wrap {
  width: 88px !important;
  height: 88px !important;
}

.circle-progress-svg {
  width: 88px !important;
  height: 88px !important;
}

.circle-pct-num {
  font-size: 1.45rem !important;
  font-weight: 900 !important;
}

.circle-q-fraction {
  font-size: 1.15rem !important;
  font-weight: 900 !important;
}

.circle-q-label {
  font-size: 0.92rem !important;
  font-weight: 800 !important;
}

.quiz-circle-progress-container {
  padding: 8px 16px !important;
  border-radius: 22px !important;
  gap: 6px !important;
}

/* Compact, Sleek Question Prompt Box */
.instruction-text {
  font-size: 0.95rem !important;
  font-weight: 900 !important;
  padding: 4px 14px !important;
  border-radius: 12px !important;
  margin-bottom: 8px !important;
}

.equation-box {
  padding: 14px 22px !important;
  margin-bottom: 14px !important;
  border-radius: 20px !important;
}

.prompt-text p,
.prompt-text {
  font-size: clamp(1.25rem, 1.8vw, 1.45rem) !important;
  line-height: 1.45 !important;
  font-weight: 900 !important;
  margin: 0 !important;
}

/* Compact, Sleek Options Grid & Cards */
.options-grid {
  gap: 12px !important;
  margin-bottom: 14px !important;
}

.option-card {
  min-height: 58px !important;
  padding: 10px 16px !important;
  border-radius: 18px !important;
  gap: 12px !important;
}

.option-badge-circle {
  width: 36px !important;
  height: 36px !important;
  font-size: 1.18rem !important;
}

.option-shield-badge {
  width: 30px !important;
  height: 30px !important;
}

.option-shield-badge .shield-check-icon {
  font-size: 1rem !important;
}

.option-text {
  font-size: clamp(1.1rem, 1.4vw, 1.35rem) !important;
  line-height: 1.25 !important;
  font-weight: 900 !important;
}


/* QUESTION ILLUSTRATIVE IMAGES STYLING */
.question-image-container {
  text-align: center;
  margin: 12px auto 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.question-illustrative-img {
  max-width: 100%;
  width: auto;
  max-height: 230px;
  border-radius: 18px;
  border: 2.5px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  object-fit: contain;
  background: #ffffff;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.question-illustrative-img:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

/* ── TABLET PORTRAIT / IPAD AIR (768px - 880px) SPECIFIC OVERRIDES ── */
@media (max-width: 880px) {
  header {
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 10px 14px !important;
  }
  .header-controls {
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    gap: 6px !important;
  }
  .header-controls .btn {
    padding: 6px 10px !important;
    font-size: 0.82rem !important;
    min-height: 38px !important;
  }
  .badge-stars {
    padding: 6px 10px !important;
    font-size: 0.9rem !important;
  }
  .bottom-subjects-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
  }
  .bottom-subject-card {
    height: 180px !important;
  }
  .bottom-card-char-wrap {
    width: 38% !important;
    max-width: 140px !important;
  }
  .bottom-card-info-col {
    width: 62% !important;
  }
  .bottom-card-title {
    font-size: 1.2rem !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    white-space: normal !important;
    line-height: 1.35 !important;
  }
}


/* ── BULLETPROOF TABLET PORTRAIT / IPAD AIR & MINI (<= 920px) ── */
@media (max-width: 920px) {
  #app-container {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  header {
    padding: 8px 12px !important;
    gap: 6px !important;
    justify-content: space-between !important;
    align-items: center !important;
  }
  .logo {
    font-size: 1.15rem !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }
  .logo span {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.25rem !important;
  }
  .header-controls {
    display: flex !important;
    gap: 4px !important;
    align-items: center !important;
    flex-shrink: 1 !important;
    overflow: visible !important;
  }
  .header-controls .btn {
    padding: 6px 8px !important;
    font-size: 0.78rem !important;
    min-height: 36px !important;
    border-radius: 10px !important;
    white-space: nowrap !important;
  }
  .badge-stars {
    padding: 5px 8px !important;
    font-size: 0.85rem !important;
    flex-shrink: 0 !important;
  }
  .bottom-subjects-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }
  .bottom-subject-card {
    height: 180px !important;
  }
  .bottom-card-char-wrap {
    width: 38% !important;
    max-width: 135px !important;
  }
  .bottom-card-info-col {
    width: 62% !important;
  }
  .bottom-card-title {
    font-size: 1.2rem !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    white-space: normal !important;
    line-height: 1.3 !important;
  }
}

/* ==========================================================================
   INTERACTIVE ANIMATED REACTIVE COMPANION GIFS & PLACEMENTS
   ========================================================================== */

/* 1. Adventure & Exam Summary Celebratory Mascot */
.summary-animated-mascot-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 12px auto;
  pointer-events: none;
}

.summary-animated-gif {
  max-height: 160px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.16));
  animation: heroFloatGlow 2.5s ease-in-out infinite alternate;
}

@keyframes heroFloatGlow {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-8px) scale(1.03); }
}

/* 2. Today's Mission Box Corner Mascot on Home View */
.today-mission-box {
  position: relative;
  overflow: visible !important;
}

.mission-companion-corner {
  position: absolute;
  top: -46px;
  left: 20px;
  z-index: 4;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mission-companion-corner img {
  height: 90px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.14));
}

.today-mission-box:hover .mission-companion-corner {
  transform: translateY(-4px) scale(1.06);
}

@media (max-width: 768px) {
  .mission-companion-corner {
    top: -38px;
    left: 12px;
  }
  .mission-companion-corner img {
    height: 72px;
  }
}

/* 3. Games Hub Animated Hero Companion */
.games-hub-hero {
  position: relative;
  overflow: visible !important;
}

.hub-hero-animated-companion {
  margin-right: auto;
  align-self: flex-end;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
  z-index: 2;
}

.hub-hero-animated-companion img {
  height: 120px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.16));
  animation: hubMascotBob 3s ease-in-out infinite alternate;
}

@keyframes hubMascotBob {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

@media (max-width: 768px) {
  .hub-hero-animated-companion img {
    height: 85px;
  }
}

/* Companion Tap Interaction & Encouraging Speech Bubble */
.mission-companion-corner,
.hub-hero-animated-companion {
  cursor: pointer;
  pointer-events: auto !important;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.mission-companion-corner:active,
.hub-hero-animated-companion:active {
  transform: scale(0.92);
}

.companion-tapped {
  animation: companionCheerTap 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes companionCheerTap {
  0% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.18) rotate(-8deg); }
  50% { transform: scale(1.12) rotate(8deg); }
  75% { transform: scale(1.06) rotate(-3deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.companion-tap-bubble {
  position: absolute;
  bottom: 85%;
  right: 50%;
  transform: translateX(50%) scale(0.8);
  background: #ffffff;
  color: var(--color-text-main, #2d3748);
  border: 2px solid var(--color-primary, #6c5ce7);
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.25);
  padding: 6px 14px;
  border-radius: 16px;
  font-family: var(--font-kids, 'Cairo', sans-serif);
  font-weight: 800;
  font-size: 0.88rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 100;
}

.companion-tap-bubble::after {
  content: '';
  position: absolute;
  bottom: -7px;
  right: 50%;
  transform: translateX(50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid var(--color-primary, #6c5ce7);
}

.companion-tap-bubble.show {
  opacity: 1;
  transform: translateX(50%) scale(1);
}

/* ==========================================================================
   INTERACTIVE MATH LAB — Long Division & Long Multiplication
   معمل الحساب التفاعلي: القسمة المطولة والضرب الرأسي
   ========================================================================== */

.interactive-math-lab-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%) !important;
  border: 2px solid rgba(99, 102, 241, 0.25) !important;
  border-radius: 28px !important;
  padding: 24px 28px 44px 28px !important;
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.1) !important;
  margin-top: 24px;
  margin-bottom: 32px;
  position: relative;
  overflow: visible !important;
}

body.dark-mode .interactive-math-lab-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
  border-color: rgba(99, 102, 241, 0.4) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4) !important;
}

/* 1. Header */
.math-lab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.math-lab-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.math-lab-header-icon {
  font-size: 2.2rem;
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.2);
  flex-shrink: 0;
}

body.dark-mode .math-lab-header-icon {
  background: linear-gradient(135deg, #312e81 0%, #3730a3 100%);
}

.math-lab-title {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--color-text-main, #1e293b);
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.math-lab-subtitle {
  font-size: 0.95rem;
  color: var(--color-text-muted, #64748b);
  margin: 0;
  font-weight: 600;
}

.math-lab-stats-badge {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  padding: 8px 16px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

body.dark-mode .math-lab-stats-badge {
  background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
  color: #fef3c7;
}

/* 2. Operation Tabs */
.math-lab-tabs-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  background: rgba(226, 232, 240, 0.5);
  padding: 6px;
  border-radius: 20px;
}

body.dark-mode .math-lab-tabs-row {
  background: rgba(30, 41, 59, 0.7);
}

.math-lab-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border: none;
  background: transparent;
  color: var(--color-text-muted, #64748b);
  font-family: var(--font-kids);
  font-weight: 800;
  font-size: 1.08rem;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.math-lab-tab-btn:hover {
  color: var(--color-primary, #6c5ce7);
  background: rgba(255, 255, 255, 0.6);
}

.math-lab-tab-btn.active {
  background: #ffffff;
  color: #4f46e5;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.16);
  font-weight: 900;
}

body.dark-mode .math-lab-tab-btn.active {
  background: #312e81;
  color: #e0e7ff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

/* 3. Toolbar (Modes & Presets) */
.math-lab-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.math-lab-mode-switch {
  display: flex;
  background: #f1f5f9;
  border-radius: 16px;
  padding: 4px;
  gap: 4px;
}

body.dark-mode .math-lab-mode-switch {
  background: #1e293b;
}

.lab-mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--color-text-muted, #64748b);
  font-family: var(--font-kids);
  font-weight: 800;
  font-size: 0.95rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lab-mode-btn.active {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.math-lab-presets-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-pill {
  padding: 8px 14px;
  border-radius: 14px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: var(--color-text-main, #334155);
  font-family: var(--font-kids);
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

body.dark-mode .preset-pill {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}

.preset-pill:hover {
  transform: translateY(-2px);
  border-color: #6366f1;
}

.preset-pill.active {
  background: #e0e7ff;
  border-color: #6366f1;
  color: #3730a3;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

body.dark-mode .preset-pill.active {
  background: #3730a3;
  border-color: #818cf8;
  color: #e0e7ff;
}

/* Custom Problem Drawer */
.math-lab-custom-drawer {
  background: #f8fafc;
  border: 2px dashed #94a3b8;
  border-radius: 20px;
  padding: 16px 20px;
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease-in-out;
}

body.dark-mode .math-lab-custom-drawer {
  background: #0f172a;
  border-color: #64748b;
}

.custom-drawer-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--color-text-main, #334155);
}

.custom-inputs-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.custom-num-input {
  width: 110px;
  padding: 8px 12px;
  font-size: 1.2rem;
  font-family: var(--font-kids);
  font-weight: 900;
  text-align: center;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  outline: none;
}

.custom-num-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.custom-op-symbol {
  font-size: 1.4rem;
  font-weight: 900;
  color: #6366f1;
}

.btn-apply-custom {
  padding: 8px 18px !important;
  font-size: 0.95rem !important;
  border-radius: 12px !important;
}

.drawer-hint {
  font-size: 0.82rem;
  color: var(--color-text-muted, #64748b);
}

/* 4. Step Cycle Indicator */
.math-lab-cycle-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 2px solid #a7f3d0;
  border-radius: 20px;
  padding: 12px 18px;
  margin-bottom: 22px;
  gap: 8px;
  overflow-x: auto;
}

body.dark-mode .math-lab-cycle-bar {
  background: linear-gradient(135deg, #064e3b 0%, #022c22 100%);
  border-color: #059669;
}

.cycle-step-node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  color: #065f46;
  font-weight: 800;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

body.dark-mode .cycle-step-node {
  background: rgba(6, 78, 59, 0.8);
  color: #a7f3d0;
}

.cycle-step-node .cycle-num {
  width: 26px;
  height: 26px;
  background: #10b981;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 900;
}

.cycle-step-node.active {
  background: #10b981;
  color: #ffffff;
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}

.cycle-step-node.active .cycle-num {
  background: #ffffff;
  color: #059669;
}

.cycle-arrow {
  font-size: 1.1rem;
  color: #10b981;
  opacity: 0.6;
}

/* Dedicated Styling for Multiplication Cycle Bar (Purple/Violet Theme) */
.mult-cycle-bar {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%) !important;
  border-color: #d8b4fe !important;
}

body.dark-mode .mult-cycle-bar {
  background: linear-gradient(135deg, #3b0764 0%, #2e1065 100%) !important;
  border-color: #9333ea !important;
}

.mult-cycle-bar .cycle-step-node {
  color: #6b21a8;
}

body.dark-mode .mult-cycle-bar .cycle-step-node {
  background: rgba(88, 28, 135, 0.8);
  color: #f3e8ff;
}

.mult-cycle-bar .cycle-step-node .cycle-num {
  background: #9333ea;
  color: #ffffff;
}

.mult-cycle-bar .cycle-step-node.active {
  background: #9333ea !important;
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(147, 51, 234, 0.4) !important;
}

.mult-cycle-bar .cycle-step-node.active .cycle-num {
  background: #ffffff;
  color: #7e22ce;
}

.mult-cycle-bar .cycle-arrow {
  color: #a855f7;
}

/* 5. Chalkboard Workspace */
.math-lab-workspace {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Companion row */
.math-lab-companion-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.companion-avatar-wrap {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #6366f1;
  padding: 4px;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.25);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.companion-lab-avatar {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.companion-speech-bubble {
  background: #ffffff;
  border: 2px solid #e0e7ff;
  border-radius: 20px;
  padding: 12px 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  flex: 1;
  position: relative;
}

body.dark-mode .companion-speech-bubble {
  background: #1e293b;
  border-color: #334155;
}

.speech-highlight {
  display: block;
  font-size: 0.95rem;
  font-weight: 900;
  color: #4f46e5;
  margin-bottom: 2px;
}

body.dark-mode .speech-highlight {
  color: #a5b4fc;
}

.speech-text {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text-main, #1e293b);
  line-height: 1.4;
}

/* The Math Canvas (Board) */
.math-chalkboard-canvas {
  background: #ffffff;
  background-image: radial-gradient(#cbd5e1 1.2px, transparent 1.2px);
  background-size: 20px 20px;
  border: 3px solid #e2e8f0;
  border-radius: 24px;
  padding: 28px 24px;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow-x: auto;
}

body.dark-mode .math-chalkboard-canvas {
  background: #0f172a;
  background-image: radial-gradient(#334155 1.2px, transparent 1.2px);
  background-size: 20px 20px;
  border-color: #1e293b;
}

/* 6. Long Division Bracket Layout (Saudi/Arabic Chair 厂) with Interactive Cues */
.division-canvas-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

/* Pedagogical Terms Reference Bar */
.math-terms-explainer-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  width: 100%;
}

.math-term-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 800;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.math-term-chip .chip-label {
  opacity: 0.85;
}

.math-term-chip.divisor-chip {
  background: #e0f2fe;
  color: #0369a1;
  border: 1.5px solid #7dd3fc;
}

.math-term-chip.dividend-chip {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1.5px solid #d8b4fe;
}

.math-term-chip.quotient-chip {
  background: #d1fae5;
  color: #047857;
  border: 1.5px solid #6ee7b7;
}

.math-term-chip.remainder-chip {
  background: #ffedd5;
  color: #c2410c;
  border: 1.5px solid #fdba74;
}

body.dark-mode .math-term-chip.divisor-chip {
  background: #082f49;
  color: #7dd3fc;
  border-color: #0284c7;
}

body.dark-mode .math-term-chip.dividend-chip {
  background: #3b0764;
  color: #d8b4fe;
  border-color: #9333ea;
}

body.dark-mode .math-term-chip.quotient-chip {
  background: #022c22;
  color: #6ee7b7;
  border-color: #059669;
}

body.dark-mode .math-term-chip.remainder-chip {
  background: #431407;
  color: #fdba74;
  border-color: #ea580c;
}

/* Step Interactive Action Banner */
.step-interactive-action-banner {
  width: 100%;
  max-width: 620px;
  border-radius: 18px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: slideDown 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.step-interactive-action-banner.step-intro {
  background: linear-gradient(135deg, #fdf4ff 0%, #fae8ff 100%);
  border: 2px solid #e879f9;
  color: #86198f;
}

body.dark-mode .step-interactive-action-banner.step-intro {
  background: #2e1065;
  border-color: #a855f7;
  color: #f0abfc;
}

.step-interactive-action-banner.step-divide {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 2px solid #93c5fd;
  color: #1e40af;
}

.step-interactive-action-banner.step-multiply {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 2px solid #fca5a5;
  color: #991b1b;
}

.step-interactive-action-banner.step-subtract {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 2px solid #6ee7b7;
  color: #065f46;
}

.step-interactive-action-banner.step-bring_down {
  background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
  border: 2px solid #7dd3fc;
  color: #0369a1;
}

.step-interactive-action-banner.step-finish {
  background: linear-gradient(135deg, #fefce8 0%, #fef08a 100%);
  border: 2px solid #facc15;
  color: #854d0e;
}

body.dark-mode .step-interactive-action-banner.step-divide {
  background: #1e293b;
  border-color: #3b82f6;
  color: #93c5fd;
}

body.dark-mode .step-interactive-action-banner.step-multiply {
  background: #1e293b;
  border-color: #ef4444;
  color: #fca5a5;
}

body.dark-mode .step-interactive-action-banner.step-subtract {
  background: #1e293b;
  border-color: #10b981;
  color: #6ee7b7;
}

body.dark-mode .step-interactive-action-banner.step-bring_down {
  background: #1e293b;
  border-color: #0ea5e9;
  color: #7dd3fc;
}

.action-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.action-step-badge {
  font-size: 0.95rem;
  font-weight: 900;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

body.dark-mode .action-step-badge {
  background: rgba(15, 23, 42, 0.7);
}

.action-equation-tag {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.action-banner-guide {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
}

.action-arrow-guide {
  font-size: 1.3rem;
  animation: pulseArrow 1.4s infinite ease-in-out;
  display: inline-block;
}

@keyframes pulseArrow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25) translateX(-2px); }
}

/* The Division Chair Bracket */
.division-chair-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Tajawal', 'Cairo', monospace, sans-serif;
  direction: ltr; /* Keeps math columns uniform from left to right */
  margin-top: 6px;
}

.division-chair-main-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

/* Divisor Column */
.division-divisor-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 24px;
}

.chair-term-tag {
  font-size: 0.78rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.term-tag-blue {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #7dd3fc;
}

.term-tag-green {
  background: #d1fae5;
  color: #059669;
  border: 1px solid #6ee7b7;
}

.term-tag-purple {
  background: #f3e8ff;
  color: #7c3aed;
  border: 1px solid #c4b5fd;
}

body.dark-mode .term-tag-blue { background: #082f49; color: #7dd3fc; }
body.dark-mode .term-tag-green { background: #022c22; color: #6ee7b7; }
body.dark-mode .term-tag-purple { background: #3b0764; color: #d8b4fe; }

.division-divisor-box {
  font-size: 2.2rem;
  font-weight: 900;
  color: #0284c7;
  padding: 8px 16px;
  background: #e0f2fe;
  border-radius: 16px;
  border: 2.5px solid #38bdf8;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
}

body.dark-mode .division-divisor-box {
  background: #075985;
  color: #e0f2fe;
  border-color: #0284c7;
}

.division-bracket-core {
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Quotient Header & Row on TOP of the bracket */
.division-quotient-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 2px;
}

.division-quotient-row {
  display: flex;
  justify-content: flex-start;
  padding: 0 8px 6px 8px;
  min-height: 48px;
}

.quotient-digit-slot {
  width: 44px;
  height: 44px;
  font-size: 2.2rem;
  font-weight: 900;
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.quotient-digit-slot.active-new {
  background: #d1fae5;
  color: #059669;
  transform: scale(1.18);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  animation: popUp 0.4s ease;
}

@keyframes popUp {
  0% { transform: scale(0.7); opacity: 0; }
  70% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1.18); }
}

/* The horizontal bar and vertical wall of the bracket (Saudi Chair 厂) */
.division-interior-work {
  border-top: 5px solid #4f46e5;
  border-left: 5px solid #4f46e5;
  padding: 10px 14px 18px 16px;
  border-radius: 4px 0 0 0;
  display: flex;
  flex-direction: column;
}

body.dark-mode .division-interior-work {
  border-color: #818cf8;
}

.dividend-row-wrap {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}

.division-dividend-row {
  display: flex;
  justify-content: flex-start;
}

.math-col-cell {
  width: 44px;
  height: 44px;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--color-text-main, #1e293b);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: all 0.3s ease;
  position: relative;
}

.math-col-cell.highlight-active {
  background: #fef08a;
  color: #854d0e;
  transform: scale(1.1);
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.4);
  border: 2px solid #eab308;
}

.math-col-cell.highlight-active-group {
  background: #fef9c3;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.5);
}

.math-col-cell.brought-down-cell {
  background: #bae6fd;
  color: #0369a1;
  border: 2px solid #38bdf8;
  animation: dropBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dropBounce {
  0% { transform: translateY(-24px); opacity: 0; }
  60% { transform: translateY(6px); opacity: 1; }
  100% { transform: translateY(0); }
}

.math-work-step-block {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
  position: relative;
}

.math-subtraction-row {
  display: flex;
  align-items: center;
  color: #dc2626;
  gap: 4px;
}

.chair-row-annotation {
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  margin-left: 12px;
  white-space: nowrap;
  opacity: 0.9;
}

body.dark-mode .chair-row-annotation {
  color: #94a3b8;
}

.chair-row-annotation.diff-note {
  color: #059669;
}

body.dark-mode .chair-row-annotation.diff-note {
  color: #34d399;
}

.math-sub-minus {
  font-size: 1.8rem;
  font-weight: 900;
  width: 24px;
  text-align: center;
  margin-right: 4px;
}

.math-sub-line {
  height: 3px;
  background: #475569;
  margin: 4px 0;
  width: 100%;
  border-radius: 2px;
}

.math-diff-row {
  display: flex;
  align-items: center;
  color: #059669;
  font-weight: 900;
  gap: 4px;
}

.bring-down-arrow-tag {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.25rem;
  color: #0284c7;
  animation: bounceDown 1.4s infinite ease-in-out;
}

@keyframes bounceDown {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

.division-final-banner {
  margin-top: 18px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  border: 2px solid #86efac;
  border-radius: 16px;
  color: #166534;
  font-size: 1.2rem;
  font-weight: 900;
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.25);
  text-align: center;
  animation: fadeIn 0.4s ease;
}

body.dark-mode .division-final-banner {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
  border-color: #10b981;
  color: #dcfce7;
}

/* 7. Vertical Long Multiplication Layout */
.vertical-mult-grid {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: 'Tajawal', 'Cairo', monospace, sans-serif;
  direction: ltr;
}

.mult-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.mult-op-symbol {
  font-size: 1.8rem;
  font-weight: 900;
  color: #7c3aed;
  margin-right: 12px;
}

.mult-divider-bar {
  width: 100%;
  height: 3.5px;
  background: #4f46e5;
  margin: 6px 0;
  border-radius: 2px;
}

.mult-carry-row {
  display: flex;
  justify-content: flex-end;
  min-height: 32px;
  margin-bottom: 2px;
}

.carry-bubble {
  min-width: 28px;
  height: 28px;
  padding: 0 4px;
  border-radius: 14px;
  background: #fef08a;
  color: #854d0e;
  border: 1.5px solid #eab308;
  font-size: 0.92rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: all 0.25s ease;
}

.carry-bubble.active {
  background: #f59e0b;
  color: #ffffff;
  border-color: #d97706;
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.45);
  animation: popUp 0.35s ease;
}

.carry-bubble.used {
  background: #e2e8f0;
  color: #94a3b8;
  border-color: #cbd5e1;
  text-decoration: line-through;
  opacity: 0.65;
}

.mult-zero-placeholder {
  background: #fef08a !important;
  color: #854d0e !important;
  border: 1.5px dashed #ca8a04 !important;
  border-radius: 8px;
}

.math-col-cell.mult-active-factor {
  background: #f3e8ff !important;
  color: #7c3aed !important;
  border: 2px solid #a855f7 !important;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.35);
}

.math-col-cell.mult-active-result {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 2px solid #22c55e !important;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
  animation: popUp 0.35s ease;
}

/* 8. Interactive Try Area */
.math-lab-interactive-input-area {
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
  border: 2px solid #bfdbfe;
  border-radius: 22px;
  padding: 18px 22px;
  animation: fadeIn 0.3s ease;
}

body.dark-mode .math-lab-interactive-input-area {
  background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
  border-color: #3b82f6;
}

.try-question-header {
  margin-bottom: 14px;
}

.try-badge {
  background: #3b82f6;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 10px;
  display: inline-block;
  margin-bottom: 6px;
}

.try-prompt {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--color-text-main, #1e293b);
}

.try-options-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.try-choice-btn {
  flex: 1 1 90px;
  min-height: 52px;
  font-size: 1.35rem;
  font-weight: 900;
  font-family: var(--font-kids);
  border: 2px solid #93c5fd;
  border-radius: 16px;
  background: #ffffff;
  color: #1e40af;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.15);
}

body.dark-mode .try-choice-btn {
  background: #1e293b;
  border-color: #3b82f6;
  color: #93c5fd;
}

.try-choice-btn:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: #2563eb;
  background: #dbeafe;
}

.try-choice-btn.correct-choice {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #059669 !important;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4) !important;
}

.try-choice-btn.incorrect-choice {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
  animation: shakeX 0.4s ease;
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.try-hint-box {
  margin-top: 12px;
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: 14px;
  padding: 10px 14px;
  color: #92400e;
  font-size: 0.95rem;
  font-weight: 700;
  animation: fadeIn 0.3s ease;
}

body.dark-mode .try-hint-box {
  background: #78350f;
  border-color: #b45309;
  color: #fef3c7;
}

/* 9. Navigation Action Controls */
.math-lab-nav-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding: 18px 20px 28px 20px;
  border-top: 2px dashed rgba(99, 102, 241, 0.18);
  margin-bottom: 12px;
  position: relative;
  z-index: 10;
}

.lab-nav-btn {
  min-height: 50px !important;
  padding: 12px 24px !important;
  font-size: 1.08rem !important;
  font-weight: 800 !important;
  border-radius: 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
}

.lab-nav-btn:hover {
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12) !important;
}

.lab-nav-btn:active {
  transform: translateY(1px) scale(0.98) !important;
}

.btn-lab-next {
  min-width: 180px;
  font-size: 1.18rem !important;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.35) !important;
  color: #ffffff !important;
  border: none !important;
}

.btn-lab-next:hover {
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.45) !important;
}

@media (max-width: 768px) {
  .interactive-math-lab-card {
    padding: 18px 14px 44px 14px !important;
  }
  .math-lab-tab-btn {
    font-size: 0.95rem;
    padding: 10px 12px;
  }
  .math-lab-nav-controls {
    gap: 10px;
    padding: 14px 10px 22px 10px;
  }
  .lab-nav-btn {
    font-size: 0.95rem !important;
    padding: 10px 16px !important;
    min-height: 46px !important;
  }
  .division-divisor-box {
    font-size: 1.6rem;
    padding: 6px 12px;
    min-width: 42px;
  }
  .math-col-cell, .quotient-digit-slot {
    width: 34px;
    height: 34px;
    font-size: 1.6rem;
  }
  .cycle-step-node {
    font-size: 0.82rem;
    padding: 6px 10px;
  }
  .action-banner-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* ==========================================================================
   CONTACT US, USER RIGHTS & COMPLAINTS/SUGGESTIONS STAGE
   ========================================================================== */
.contact-page-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 40px;
  direction: rtl;
  font-family: var(--font-kids);
  box-sizing: border-box;
  overflow-x: hidden;
}

.contact-header-card {
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.12), rgba(253, 203, 110, 0.15));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(108, 92, 231, 0.25);
  border-radius: var(--border-radius-lg, 24px);
  padding: 32px 28px;
  text-align: center;
  margin-bottom: 28px;
  box-shadow: 0 12px 36px rgba(108, 92, 231, 0.08);
  box-sizing: border-box;
  max-width: 100%;
}

.contact-header-badge {
  display: inline-block;
  background: var(--color-primary, #6c5ce7);
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.contact-main-title {
  font-size: 2.1rem;
  font-weight: 900;
  color: var(--color-primary, #6c5ce7);
  margin: 0 0 12px 0;
  letter-spacing: -0.5px;
}

.contact-subtitle {
  font-size: 1.05rem;
  color: var(--color-text-muted, #475569);
  max-width: 780px;
  margin: 0 auto;
  line-height: 1.7;
  font-weight: 600;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 30px;
  width: 100%;
  box-sizing: border-box;
}

.contact-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--border-radius-lg, 24px);
  padding: 26px 22px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  max-width: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(108, 92, 231, 0.1);
}

.contact-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid rgba(108, 92, 231, 0.12);
}

.contact-card-header .card-icon {
  font-size: 1.8rem;
  background: rgba(108, 92, 231, 0.1);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  flex-shrink: 0;
}

.contact-card-header h2 {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--color-text-main, #1e293b);
  margin: 0;
}

/* Pillar 1: Rights */
.rights-item {
  margin-bottom: 18px;
  padding: 12px 14px;
  background: rgba(248, 250, 252, 0.8);
  border-radius: var(--border-radius-md, 16px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.rights-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1rem;
  color: var(--color-primary, #6c5ce7);
  margin-bottom: 6px;
}

.rights-item-desc {
  font-size: 0.92rem;
  color: var(--color-text-muted, #475569);
  line-height: 1.6;
  margin: 0;
  font-weight: 600;
}

/* Pillar 2: Channels */
.channel-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: rgba(248, 250, 252, 0.8);
  border-radius: var(--border-radius-md, 16px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.channel-icon-wrap {
  font-size: 1.6rem;
  background: rgba(253, 203, 110, 0.25);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.channel-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.channel-label {
  font-size: 0.82rem;
  color: var(--color-text-muted, #64748b);
  font-weight: 700;
}

.channel-val {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--color-primary, #6c5ce7);
  text-decoration: none;
  word-break: break-all;
}

.channel-hint {
  font-size: 0.78rem;
  color: #16a34a;
  font-weight: 700;
}

.channel-note-card {
  margin-top: auto;
  background: linear-gradient(135deg, rgba(253, 203, 110, 0.15), rgba(108, 92, 231, 0.08));
  border: 1.5px dashed rgba(253, 203, 110, 0.6);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.channel-note-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--color-text-muted, #475569);
  line-height: 1.6;
  font-weight: 600;
}

/* Pillar 3: Form */
.form-intro-text {
  font-size: 0.92rem;
  color: var(--color-text-muted, #475569);
  margin-bottom: 14px;
  font-weight: 600;
  line-height: 1.6;
}

/* ⚡ Fast One-Touch Topic Chips */
.quick-topics-container {
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(253, 203, 110, 0.12));
  border: 1.5px solid rgba(108, 92, 231, 0.2);
  border-radius: var(--border-radius-md, 16px);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.quick-topics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-topics-title {
  font-size: 0.92rem;
  font-weight: 900;
  color: var(--color-primary, #6c5ce7);
}

.quick-topics-sub {
  font-size: 0.8rem;
  color: var(--color-text-muted, #64748b);
  font-weight: 600;
}

.quick-chips-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-chip-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 20px;
  padding: 7px 13px;
  font-family: var(--font-kids);
  font-size: 0.86rem;
  font-weight: 800;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.quick-chip-btn:hover {
  border-color: var(--color-primary, #6c5ce7);
  background: rgba(108, 92, 231, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(108, 92, 231, 0.15);
}

.quick-chip-btn.active {
  background: var(--color-primary, #6c5ce7);
  color: #ffffff;
  border-color: var(--color-primary, #6c5ce7);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.35);
  transform: scale(1.03);
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.opt-label {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
}

.field-hint-badge {
  font-size: 0.76rem;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 2px 8px;
  font-weight: 700;
}

.quick-message-starters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.starters-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
}

.starter-chip {
  background: #f1f5f9;
  border: 1px dashed #94a3b8;
  border-radius: 14px;
  padding: 3px 9px;
  font-family: var(--font-kids);
  font-size: 0.78rem;
  color: #475569;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.15s ease;
}

.starter-chip:hover {
  background: #e2e8f0;
  border-color: var(--color-primary, #6c5ce7);
  color: var(--color-primary, #6c5ce7);
  transform: translateY(-1px);
}

.form-field-group {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
}

.form-field-group label {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--color-text-main, #1e293b);
}

.form-field-group .req {
  color: var(--color-danger, #e74c3c);
}

.contact-input,
.contact-select,
.contact-textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--border-radius-sm, 8px);
  border: 1.5px solid #cbd5e1;
  font-family: var(--font-kids);
  font-size: 0.95rem;
  background: #ffffff;
  color: #1e293b;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-input:focus,
.contact-select:focus,
.contact-textarea:focus {
  outline: none;
  border-color: var(--color-primary, #6c5ce7);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.contact-textarea {
  resize: vertical;
  min-height: 90px;
}

.btn-contact-submit {
  width: 100%;
  padding: 13px;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: var(--border-radius-md, 16px);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(108, 92, 231, 0.25);
  margin-top: 8px;
}

.contact-status-container {
  margin: 12px 0;
}

.contact-status-alert {
  padding: 14px;
  border-radius: var(--border-radius-md, 16px);
  font-size: 0.95rem;
  line-height: 1.6;
}

.contact-status-alert.error {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  color: #dc2626;
  font-weight: 700;
}

.contact-status-alert.success {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  color: #166534;
}

.status-alert-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.status-sub {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: #15803d;
}

.ticket-badge {
  background: #166534;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.5px;
}

.contact-bottom-actions {
  text-align: center;
  margin-top: 10px;
}

.btn-contact-back {
  padding: 12px 28px;
  font-size: 1.02rem;
  font-weight: 800;
  border-radius: var(--border-radius-md, 16px);
}

/* APP GLOBAL FOOTER */
.app-global-footer {
  margin-top: 40px;
  padding: 24px 16px 30px;
  border-top: 1.5px solid rgba(226, 232, 240, 0.8);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
  font-family: var(--font-kids);
  direction: rtl;
}

.footer-content {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.footer-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.footer-action-btn {
  padding: 10px 22px !important;
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06) !important;
  color: #334155 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.footer-action-btn:hover {
  border-color: var(--color-primary, #6c5ce7) !important;
  background: #ffffff !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(108, 92, 231, 0.2) !important;
  color: var(--color-primary, #6c5ce7) !important;
}

body.dark-mode .footer-action-btn {
  background: rgba(30, 41, 59, 0.9) !important;
  border-color: rgba(71, 85, 105, 0.8) !important;
  color: #f1f5f9 !important;
}

body.dark-mode .footer-action-btn:hover {
  border-color: #818cf8 !important;
  background: #1e293b !important;
  color: #818cf8 !important;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: var(--color-primary, #6c5ce7);
  font-size: 1.05rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link-btn {
  background: none;
  border: none;
  color: var(--color-text-main, #334155);
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.footer-link-btn:hover {
  color: var(--color-primary, #6c5ce7);
  background: rgba(108, 92, 231, 0.08);
}

.footer-divider {
  color: #cbd5e1;
}

.footer-copy {
  font-size: 0.84rem;
  color: var(--color-text-muted, #64748b);
  font-weight: 600;
}

/* DARK MODE OVERRIDES */
body.dark-mode .contact-card {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(51, 65, 85, 0.8);
  color: #f1f5f9;
}

body.dark-mode .contact-header-card {
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), rgba(30, 41, 59, 0.9));
  border-color: rgba(108, 92, 231, 0.4);
}

body.dark-mode .contact-card-header h2 {
  color: #f1f5f9;
}

body.dark-mode .rights-item,
body.dark-mode .channel-box {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(51, 65, 85, 0.6);
}

body.dark-mode .contact-input,
body.dark-mode .contact-select,
body.dark-mode .contact-textarea {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

body.dark-mode .app-global-footer {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(51, 65, 85, 0.8);
}

body.dark-mode .footer-link-btn {
  color: #cbd5e1;
}

/* RESPONSIVENESS */
@media (max-width: 1100px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 760px;
    margin: 0 auto 30px;
  }
}

@media (max-width: 980px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 600px) {
  .contact-header-card {
    padding: 22px 16px;
  }
  .contact-main-title {
    font-size: 1.6rem;
  }
  .contact-card {
    padding: 20px 16px;
  }
}

/* =========================================================================
   📲 WHATSAPP HERO ACHIEVEMENT SHARING SYSTEM
   ========================================================================= */
.whatsapp-summary-share-card {
  margin: 18px auto 22px;
  max-width: 480px;
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.12), rgba(18, 140, 126, 0.08));
  border: 2px dashed #25D366;
  border-radius: var(--border-radius-md, 16px);
  padding: 16px 18px;
  text-align: center;
  box-shadow: 0 4px 18px rgba(37, 211, 102, 0.12);
}

.btn-whatsapp-summary-share {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--border-radius-md, 16px);
  padding: 12px 22px;
  font-family: var(--font-kids);
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-whatsapp-summary-share:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
}

.wa-share-subtext {
  display: block;
  font-size: 0.82rem;
  color: #065f46;
  font-weight: 700;
  margin-top: 8px;
}

/* Header WhatsApp Button */
.btn-header-whatsapp {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3) !important;
}

.btn-header-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.45) !important;
}

/* Parent Banner WhatsApp Button */
.btn-whatsapp-parent-banner {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-family: var(--font-kids);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.btn-whatsapp-parent-banner:hover {
  transform: translateY(-2px);
}

/* Modal Dialog */
.whatsapp-share-dialog {
  background: #ffffff;
  border-radius: var(--border-radius-lg, 24px);
  max-width: 520px;
  width: 92%;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  direction: rtl;
  font-family: var(--font-kids);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.wa-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid #e2e8f0;
}

.wa-header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wa-header-brand h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
  color: #128C7E;
}

.btn-wa-close {
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.btn-wa-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Honor Card Preview */
.wa-honor-card-preview {
  background: linear-gradient(145deg, #f0fdf4 0%, #dcfce7 60%, #bbf7d0 100%);
  border: 2px solid #86efac;
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.15);
  margin-bottom: 18px;
}

.wa-card-ribbon {
  display: inline-block;
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
  color: #ffffff;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(202, 138, 4, 0.3);
}

.wa-card-mascot-wrap {
  width: 110px;
  height: 110px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wa-card-mascot {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

.wa-card-hero-name {
  font-size: 1.45rem;
  font-weight: 900;
  color: #14532d;
  margin-bottom: 4px;
}

.wa-card-achievement {
  font-size: 1.05rem;
  font-weight: 800;
  color: #166534;
  margin-bottom: 10px;
}

.wa-card-stars-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1.5px solid #86efac;
  padding: 6px 14px;
  border-radius: 16px;
  font-weight: 900;
  color: #ca8a04;
  font-size: 1.05rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.wa-card-footer-tag {
  margin-top: 14px;
  font-size: 0.78rem;
  color: #15803d;
  font-weight: 700;
  opacity: 0.9;
}

/* Message Box Preview */
.wa-message-preview-wrap {
  margin-bottom: 18px;
  text-align: right;
}

.wa-preview-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 800;
  color: #475569;
  margin-bottom: 6px;
}

.wa-message-box {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #1e293b;
  white-space: pre-line;
  max-height: 130px;
  overflow-y: auto;
  font-weight: 600;
}

/* Modal Actions */
.wa-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-whatsapp-primary {
  flex: 1;
  min-width: 200px;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 13px 20px;
  font-family: var(--font-kids);
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.35);
  transition: transform 0.2s ease;
}

.btn-whatsapp-primary:hover {
  transform: translateY(-2px);
}

.btn-whatsapp-download {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 13px 20px;
  font-family: var(--font-kids);
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-whatsapp-download:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.btn-whatsapp-copy {
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 13px 18px;
  font-family: var(--font-kids);
  font-size: 0.95rem;
  font-weight: 800;
  color: #334155;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-whatsapp-copy:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.wa-copy-feedback {
  margin-top: 10px;
  padding: 8px 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  color: #065f46;
  font-weight: 800;
  font-size: 0.85rem;
  text-align: center;
}

body.dark-mode .whatsapp-share-dialog {
  background: #1e293b;
  color: #f1f5f9;
}

body.dark-mode .wa-modal-header {
  border-color: #334155;
}

body.dark-mode .wa-message-box {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

body.dark-mode .btn-whatsapp-copy {
  background: #334155;
  border-color: #475569;
  color: #f1f5f9;
}

/* =========================================================================
   📲 PER-QUESTION WHATSAPP SHARING (BEFORE & AFTER ANSWER)
   ========================================================================= */
.question-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.question-header-bar .instruction-text {
  flex: 1;
  min-width: 200px;
}

.question-quick-wa-btn {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.12) 0%, rgba(18, 140, 126, 0.14) 100%);
  border: 1.5px solid #25d366;
  color: #075e54;
  border-radius: 20px;
  padding: 6px 14px;
  font-family: var(--font-kids);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.15);
  white-space: nowrap;
}

.question-quick-wa-btn:hover {
  transform: translateY(-2px);
  background: #25d366;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.question-quick-wa-btn:active {
  transform: translateY(1px);
}

/* WhatsApp Question Share in Bottom Action Bar */
.btn-whatsapp-question {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #ffffff !important;
  border: none !important;
  border-radius: var(--border-radius-md, 16px);
  font-family: var(--font-kids);
  font-size: 0.95rem;
  font-weight: 800;
  padding: 10px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-whatsapp-question:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45);
}

.btn-whatsapp-question:active {
  transform: translateY(1px);
}

/* Correct feedback share strip */
.correct-share-strip {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1.5px dashed rgba(46, 204, 113, 0.5);
  display: flex;
  justify-content: center;
}

.btn-whatsapp-correct-share {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  font-family: var(--font-kids);
  font-size: 0.95rem;
  font-weight: 800;
  padding: 10px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-whatsapp-correct-share:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(37, 211, 102, 0.5);
}

.btn-whatsapp-correct-share:active {
  transform: translateY(1px);
}

/* Dark mode overrides for question WhatsApp elements */
body.dark-mode .question-quick-wa-btn {
  background: rgba(37, 211, 102, 0.18);
  border-color: #25d366;
  color: #6ee7b7;
}

body.dark-mode .question-quick-wa-btn:hover {
  background: #25d366;
  color: #0f172a;
}

body.dark-mode .correct-share-strip {
  border-top-color: rgba(255, 255, 255, 0.2);
}

/* Question Screenshot Card Image Preview in WhatsApp Modal */
.wa-question-image-preview-wrap {
  margin: 12px auto 16px;
  text-align: center;
  max-width: 100%;
}

.wa-image-preview-badge {
  display: inline-block;
  background: #e0e7ff;
  color: #3730a3;
  font-weight: 800;
  font-size: 0.86rem;
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.wa-question-card-img {
  width: 100%;
  max-width: 470px;
  max-height: 280px;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border: 1.5px solid #cbd5e1;
  display: block;
  margin: 0 auto;
  background: #ffffff;
}

body.dark-mode .wa-image-preview-badge {
  background: #312e81;
  color: #c7d2fe;
}

body.dark-mode .wa-question-card-img {
  border-color: #475569;
  background: #1e293b;
}

/* SINGLE-SESSION CONCURRENT LOGIN MODAL */
.single-session-modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.single-session-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.single-session-dialog {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 490px;
  background: #ffffff;
  border-radius: 28px;
  padding: 32px 26px 28px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  direction: rtl;
  font-family: var(--font-kids);
  border: 2px solid #ef4444;
  animation: singleSessionPopup 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes singleSessionPopup {
  0% { opacity: 0; transform: scale(0.9) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.single-session-icon-badge {
  width: 72px;
  height: 72px;
  line-height: 72px;
  font-size: 2.5rem;
  background: #fee2e2;
  border: 3px solid #fca5a5;
  border-radius: 50%;
  margin: 0 auto 16px;
}

.single-session-title {
  margin: 0 0 10px;
  font-size: 1.45rem;
  font-weight: 900;
  color: #991b1b;
}

.single-session-tag {
  display: inline-block;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.single-session-desc {
  font-size: 0.98rem;
  line-height: 1.65;
  color: #334155;
  margin: 0 0 16px;
}

.single-session-desc strong {
  color: #0f172a;
  direction: ltr;
  display: inline-block;
}

.single-session-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #475569;
  margin-bottom: 22px;
  text-align: right;
}

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

.btn-single-session-primary {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  border: none;
  border-radius: 16px;
  font-family: var(--font-kids);
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 48px;
}

.btn-single-session-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.45);
}

body.dark-mode .single-session-dialog {
  background: #1e293b;
  border-color: #ef4444;
}

body.dark-mode .single-session-title {
  color: #f87171;
}

body.dark-mode .single-session-desc {
  color: #cbd5e1;
}

body.dark-mode .single-session-desc strong {
  color: #ffffff;
}

body.dark-mode .single-session-box {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

/* ── Instant First-Time Login View Display (Zero Paint Latency) ── */
html.instant-login-view #login-view,
body.on-login-screen #login-view {
  display: flex !important;
}

html.instant-login-view #profile-selection-view,
body.on-login-screen #profile-selection-view {
  display: none !important;
}

/* ── Distraction-Free Header on Login Screen ── */
body:has(#login-view.active) header,
html.instant-login-view header,
body.on-login-screen header,
html.on-login-screen header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 8px 24px !important;
  margin: 0 0 8px 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Hide all navigation buttons and extra controls on login screen EXCEPT the logo title and install button */
body:has(#login-view.active) header .header-controls > *:not(#header-btn-install),
html.instant-login-view header .header-controls > *:not(#header-btn-install),
body.on-login-screen header .header-controls > *:not(#header-btn-install),
html.on-login-screen header .header-controls > *:not(#header-btn-install),
body:has(#login-view.active) #app-navigation,
html.instant-login-view #app-navigation,
body.on-login-screen #app-navigation,
html.on-login-screen #app-navigation,
body:has(#login-view.active) #pwa-smart-banner,
html.instant-login-view #pwa-smart-banner,
body.on-login-screen #pwa-smart-banner,
html.on-login-screen #pwa-smart-banner {
  display: none !important;
}

/* Make Install Button prominent, clean, and positioned on the left */
body:has(#login-view.active) header #header-btn-install,
html.instant-login-view header #header-btn-install,
body.on-login-screen header #header-btn-install,
html.on-login-screen header #header-btn-install {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 8px 18px !important;
  font-size: 0.94rem !important;
  font-weight: 800 !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #6c5ce7 0%, #8b5cf6 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 4px 14px rgba(108, 92, 231, 0.25) !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

body:has(#login-view.active) header #header-btn-install:hover,
html.instant-login-view header #header-btn-install:hover,
body.on-login-screen header #header-btn-install:hover,
html.on-login-screen header #header-btn-install:hover {
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.38) !important;
}

/* ==========================================================================
   VIBRANT & MOTIVATING AUTH / LOGIN SCREEN STYLES (منصة أبطال الغد)
   Optimized 2-Column Split: Expands into bottom space, zero-scroll at 100% zoom
   ========================================================================== */
body:has(#login-view.active) #app-container,
html.instant-login-view #app-container,
body.on-login-screen #app-container,
html.on-login-screen #app-container {
  min-height: 100vh !important;
  height: 100vh !important;
  max-height: 100vh !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  padding: 8px 20px 10px !important;
  overflow: hidden !important;
}

body:has(#login-view.active) #login-view,
html.instant-login-view #login-view,
body.on-login-screen #login-view,
html.on-login-screen #login-view {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.auth-card-vibrant {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 auto !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) !important;
  align-items: stretch !important;
  border-radius: 28px !important;
  overflow: hidden !important;
  border: 2px solid rgba(124, 58, 237, 0.22) !important;
  box-shadow: 0 20px 50px rgba(108, 92, 231, 0.16), 0 4px 14px rgba(0, 0, 0, 0.04) !important;
  background: #ffffff !important;
  padding: 0 !important;
  height: clamp(540px, calc(100vh - 96px), 740px) !important;
  box-sizing: border-box !important;
}

/* COLUMN 1: VISUAL HERO STAGE (RIGHT IN RTL) */
.auth-hero-side {
  background: linear-gradient(150deg, #f8f6ff 0%, #ede9fe 50%, #fef3c7 100%);
  border-left: 2px solid rgba(124, 58, 237, 0.12);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: clamp(14px, 2vh, 22px) clamp(16px, 2vw, 24px);
  position: relative;
  box-sizing: border-box;
  height: 100%;
}

.auth-hero-banner-badge {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #5b21b6;
  font-weight: 900;
  font-size: clamp(0.85rem, 1vw, 0.95rem);
  padding: clamp(5px, 0.8vh, 8px) clamp(14px, 1.4vw, 18px);
  border-radius: 20px;
  border: 1.5px solid rgba(124, 58, 237, 0.25);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.1);
  display: inline-block;
}

.auth-hero-art-container {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: clamp(2px, 0.5vh, 6px) 0;
  min-height: 0;
}

.auth-hero-split-img {
  max-width: 98%;
  max-height: clamp(260px, 45vh, 400px) !important;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 20px;
  filter: drop-shadow(0 12px 28px rgba(108, 92, 231, 0.22));
  transition: transform 0.35s ease;
}

.auth-hero-split-img:hover {
  transform: scale(1.02);
}

.auth-hero-side-text {
  margin-top: clamp(6px, 1vh, 14px);
  width: 100%;
}

.auth-side-title {
  font-size: clamp(1.35rem, 1.7vw, 1.7rem);
  font-weight: 900;
  color: #1e1b4b;
  margin: 0 0 clamp(4px, 0.6vh, 8px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-star-icon {
  font-size: 1.5rem;
  animation: pulseGlow 2s infinite alternate ease-in-out;
}

.auth-side-sub {
  color: #475569;
  font-weight: 700;
  font-size: clamp(0.86rem, 1.05vw, 0.98rem);
  line-height: 1.55;
  margin: 0 auto;
  max-width: 420px;
}

/* COLUMN 2: INTERACTIVE FORM SIDE (LEFT IN RTL) */
.auth-form-side {
  padding: clamp(14px, 2vh, 22px) clamp(18px, 2.2vw, 28px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(165deg, #fbfaff 0%, #f5f2ff 50%, #f9f7ff 100%);
  box-sizing: border-box;
  height: 100%;
}

.auth-google-wrap {
  width: 100%;
}

.google-auth-btn-wrapper {
  height: clamp(44px, 5.5vh, 48px) !important;
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.google-auth-btn-wrapper:hover {
  transform: translateY(-1px);
}

.google-auth-highlight-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
  border: 2px solid #4285f4;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(66, 133, 244, 0.18), 0 1px 3px rgba(0, 0, 0, 0.04);
  pointer-events: none;
  z-index: 1;
  box-sizing: border-box;
  transition: all 0.25s ease;
}

.google-auth-btn-wrapper:hover .google-auth-highlight-card {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(66, 133, 244, 0.3);
}

.google-auth-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.google-auth-label {
  font-weight: 800;
  font-size: clamp(0.92rem, 1vw, 0.98rem);
  color: #1e293b;
}

.google-auth-badge {
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: clamp(6px, 1vh, 10px) 0;
  width: 100%;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.auth-divider-text {
  padding: 0 10px;
  color: #64748b;
  font-weight: 800;
  font-size: clamp(0.8rem, 0.95vw, 0.88rem);
}

.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: clamp(6px, 1vh, 10px);
  width: 100%;
}

.auth-tab-btn {
  flex: 1;
  font-size: clamp(0.92rem, 1.05vw, 1rem);
  padding: clamp(7px, 1.2vh, 10px) 12px;
  border-radius: 12px;
  font-weight: 800;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.2vh, 10px);
  text-align: right;
  width: 100%;
}

.auth-input-label {
  font-weight: 800;
  display: block;
  margin-bottom: 2px;
  font-size: clamp(0.82rem, 0.95vw, 0.9rem);
  color: #1e1b4b;
}

.auth-input {
  padding: clamp(8px, 1.3vh, 11px) 14px;
  font-size: clamp(0.92rem, 1.05vw, 1rem);
  border-radius: 11px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  outline: none;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.auth-input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.18);
}

.auth-pwd-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: #64748b;
  z-index: 2;
  outline: none;
}

.auth-submit-btn {
  width: 100%;
  font-size: clamp(0.98rem, 1.1vw, 1.05rem);
  padding: clamp(9px, 1.4vh, 12px);
  margin-top: 2px;
  border-radius: 12px;
  font-weight: 800;
}

.auth-sub-links {
  margin-top: clamp(4px, 0.8vh, 8px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  width: 100%;
  font-size: clamp(0.82rem, 0.95vw, 0.88rem);
}

.auth-sub-links-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-link-action {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-primary, #6c5ce7);
  font-weight: 800;
  font-family: var(--font-kids);
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.auth-link-action:hover {
  color: #4f46e5;
}

.auth-sub-sep {
  color: #cbd5e1;
  font-weight: 900;
}

.auth-link {
  color: #6c5ce7;
  font-weight: 800;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-security-tag {
  color: #64748b;
  font-weight: 700;
  font-size: 0.78rem;
}

/* ==========================================================================
   VIBRANT HEROIC GUEST PLAY BUTTON (STAR OF THE SCREEN)
   ========================================================================== */
.auth-guest-cta-wrapper {
  margin-top: clamp(8px, 1.4vh, 14px);
  position: relative;
}

.btn-guest-play-vibrant {
  width: 100%;
  position: relative;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 55%, #a7f3d0 100%);
  color: #064e3b;
  padding: clamp(10px, 1.4vh, 13px) clamp(14px, 1.4vw, 18px);
  border-radius: 16px;
  border: 2px solid #34d399;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.16), 0 1px 3px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: var(--font-kids);
  text-align: right;
  overflow: hidden;
  box-sizing: border-box;
  display: block;
}

.btn-guest-play-vibrant:hover {
  transform: translateY(-2px) scale(1.01);
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 55%, #bbf7d0 100%);
  border-color: #10b981;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25), 0 2px 6px rgba(0, 0, 0, 0.06);
}

.btn-guest-play-vibrant:active {
  transform: translateY(1px) scale(0.99);
}

.guest-btn-sparkle-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55) 0%, transparent 65%);
  pointer-events: none;
}

.guest-btn-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
}

.guest-btn-icon-bubble {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid #a7f3d0;
}

.guest-btn-emoji {
  font-size: 1.5rem;
  display: inline-block;
  animation: bounceMini 2s infinite ease-in-out;
}

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

.guest-btn-text-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.guest-btn-headline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.05rem;
  color: #064e3b;
  line-height: 1.25;
}

.guest-btn-subline {
  font-size: 0.8rem;
  font-weight: 600;
  color: #047857;
  line-height: 1.35;
}

.guest-btn-arrow-bubble {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #6ee7b7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #059669;
  font-weight: 900;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.12);
  transition: all 0.25s ease;
}

.btn-guest-play-vibrant:hover .guest-btn-arrow-bubble {
  transform: translateX(-3px);
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.auth-card-footer {
  margin-top: 8px;
  text-align: center;
}

.btn-contact-quick-link {
  background: none;
  border: none;
  color: #6c5ce7;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.82rem;
  padding: 4px 8px;
  border-radius: 8px;
  font-family: var(--font-kids);
  transition: color 0.2s ease;
}

.btn-contact-quick-link:hover {
  color: #4f46e5;
  background: rgba(108, 92, 231, 0.06);
}


/* ── Absolute Horizontal Overflow-X Elimination for Login Screen Across All Devices ── */
body:has(#login-view.active),
html.instant-login-view,
body.on-login-screen,
html.on-login-screen {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
}

body:has(#login-view.active) #app-container,
html.instant-login-view #app-container,
body.on-login-screen #app-container,
html.on-login-screen #app-container {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

/* RESPONSIVE LAYOUT FOR MOBILE & TABLET (UP TO 1024px - iPad Mini, Air, Pro 11", Pro 12.9" Portrait) */
@media (max-width: 1024px) {
  body:has(#login-view.active),
  html.instant-login-view,
  body.on-login-screen,
  html.on-login-screen {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body:has(#login-view.active) #app-container,
  html.instant-login-view #app-container,
  body.on-login-screen #app-container,
  html.on-login-screen #app-container {
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 8px 12px 24px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  body:has(#login-view.active) #login-view,
  html.instant-login-view #login-view,
  body.on-login-screen #login-view,
  html.on-login-screen #login-view {
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    overflow-x: hidden !important;
    align-items: flex-start !important;
    padding-bottom: 24px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .auth-card-vibrant {
    grid-template-columns: 1fr !important;
    max-width: 580px !important;
    width: 100% !important;
    margin: 8px auto !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    overflow-x: hidden !important;
    border-radius: 20px !important;
    box-sizing: border-box !important;
  }
  .auth-hero-side {
    border-left: none;
    border-bottom: 2px solid rgba(124, 58, 237, 0.12);
    padding: 10px 16px;
    height: auto !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    text-align: right !important;
  }
  .auth-hero-art-container {
    flex: 0 0 auto !important;
    max-width: 75px !important;
    max-height: 75px !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .auth-hero-split-img {
    max-height: 70px !important;
    width: auto !important;
    border-radius: 12px !important;
  }
  .auth-hero-side-text {
    margin-top: 0 !important;
    flex: 1 1 auto !important;
  }
  .auth-side-title {
    font-size: 1.25rem !important;
    margin: 0 0 2px 0 !important;
  }
  .auth-side-sub {
    font-size: 0.82rem !important;
    line-height: 1.35 !important;
    margin: 0 !important;
  }
  .auth-form-side {
    padding: 12px 18px;
    height: auto !important;
    overflow: visible !important;
    overflow-x: hidden !important;
  }
}

@media (max-width: 820px) {
  body:has(#login-view.active) #app-container,
  html.instant-login-view #app-container,
  body.on-login-screen #app-container,
  html.on-login-screen #app-container {
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  .auth-card-vibrant {
    max-width: 520px !important;
  }
}

@media (max-width: 480px) {
  .auth-hero-split-img {
    max-height: 125px !important;
  }
  .auth-side-title {
    font-size: 1.25rem !important;
  }
  .auth-side-sub {
    font-size: 0.82rem !important;
  }
  .auth-form-side {
    padding: 12px 14px;
  }
}

@media (max-height: 750px) {
  body:has(#login-view.active) #app-container,
  html.instant-login-view #app-container,
  body.on-login-screen #app-container,
  html.on-login-screen #app-container {
    height: auto !important;
    min-height: 100vh !important;
    max-height: none !important;
    overflow-y: auto !important;
  }
  .auth-card-vibrant {
    height: auto !important;
    min-height: 520px !important;
    margin: 10px auto !important;
  }
}

/* DARK MODE FOR VIBRANT AUTH */

body.dark-mode .auth-card-vibrant {
  background: #17153a !important;
  border-color: rgba(167, 139, 250, 0.3) !important;
}

body.dark-mode .auth-hero-side {
  background: linear-gradient(150deg, #1e1b4b 0%, #2e1065 50%, #1e1b4b 100%);
  border-left-color: rgba(167, 139, 250, 0.2);
}

body.dark-mode .auth-form-side {
  background: #17153a;
}

body.dark-mode .auth-side-title {
  color: #f1f5f9;
}

body.dark-mode .auth-side-sub {
  color: #cbd5e1;
}

body.dark-mode .auth-hero-banner-badge {
  background: #1e1b4b;
  color: #c4b5fd;
  border-color: rgba(167, 139, 250, 0.4);
}

body.dark-mode .auth-input-label {
  color: #e2e8f0;
}

body.dark-mode .auth-input {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

body.dark-mode .btn-contact-quick-link {
  color: #a78bfa;
}

body.dark-mode .auth-divider-line {
  background: rgba(167, 139, 250, 0.25);
}

body.dark-mode .auth-divider-text {
  color: #94a3b8;
}

/* ==========================================================================
   FIRST-TIME COURSE ONBOARDING PICKER & ON-DEMAND LOADER
   ========================================================================== */
.first-time-course-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  box-sizing: border-box;
}

.first-time-course-modal {
  background: #ffffff;
  border-radius: 28px;
  border: 2.5px solid #8b5cf6;
  box-shadow: 0 25px 60px rgba(108, 92, 231, 0.3);
  max-width: 960px;
  width: 100%;
  padding: clamp(20px, 3vh, 32px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  box-sizing: border-box;
  animation: modalScaleUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScaleUp {
  0% { opacity: 0; transform: scale(0.92) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.course-picker-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.course-picker-badge {
  background: #ede9fe;
  color: #6d28d9;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1.5px solid #c4b5fd;
  display: inline-block;
}

.course-picker-title {
  color: #1e1b4b;
  font-size: clamp(1.4rem, 2vw, 1.85rem);
  font-weight: 900;
  margin: 4px 0 0;
}

.course-picker-subtitle {
  color: #475569;
  font-size: clamp(0.92rem, 1.1vw, 1.05rem);
  font-weight: 700;
  margin: 0;
  max-width: 600px;
}

.course-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 8px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 6px 4px;
}

.course-picker-card {
  background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
  border: 2px solid #e2e8f0;
  border-radius: 18px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.course-picker-card:hover {
  transform: translateY(-4px) scale(1.03);
  border-color: #8b5cf6;
  background: linear-gradient(145deg, #ffffff 0%, #f5f3ff 100%);
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.2);
}

.course-picker-card-icon {
  font-size: 2.4rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.course-picker-card-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: #1e293b;
}

.course-picker-card-sub {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
}

.course-picker-card-action {
  margin-top: auto;
  font-size: 0.76rem;
  font-weight: 800;
  background: #ede9fe;
  color: #7c3aed;
  padding: 3px 10px;
  border-radius: 999px;
}

.course-picker-footer {
  margin-top: 4px;
}

.course-picker-tip {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 700;
}

/* ON-DEMAND COURSE LOADING OVERLAY */
.course-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(15, 23, 42, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.course-loading-card {
  background: #ffffff;
  border-radius: 24px;
  border: 2px solid #8b5cf6;
  box-shadow: 0 20px 50px rgba(108, 92, 231, 0.35);
  max-width: 440px;
  width: 90%;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  animation: modalScaleUp 0.3s ease;
}

.course-loading-icon-bubble {
  font-size: 3rem;
  animation: bounceRotate 1.6s infinite ease-in-out;
}

@keyframes bounceRotate {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(8deg); }
}

.course-loading-title {
  color: #1e1b4b;
  font-size: 1.35rem;
  font-weight: 900;
  margin: 0;
}

.course-loading-desc {
  color: #475569;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.5;
  margin: 0;
}

.course-loading-bar-wrap {
  width: 100%;
  height: 12px;
  background: #ede9fe;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.course-loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #ec4899);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.course-loading-percent {
  font-size: 0.85rem;
  font-weight: 900;
  color: #7c3aed;
}

/* DARK MODE OVERRIDES */
body.dark-mode .first-time-course-modal,
body.dark-mode .course-loading-card {
  background: #17153a;
  border-color: #a78bfa;
}

body.dark-mode .course-picker-title,
body.dark-mode .course-loading-title {
  color: #f1f5f9;
}

body.dark-mode .course-picker-subtitle,
body.dark-mode .course-loading-desc,
body.dark-mode .course-picker-tip {
  color: #cbd5e1;
}

body.dark-mode .course-picker-card {
  background: #1e1b4b;
  border-color: rgba(167, 139, 250, 0.25);
}

body.dark-mode .course-picker-card-title {
  color: #f8fafc;
}

body.dark-mode .course-picker-card:hover {
  background: #2e1065;
  border-color: #a78bfa;
}

/* =========================================================================
   DAILY STREAK BADGE & BONUS WHEEL MODAL
   ========================================================================= */
.badge-streak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #ff7675 0%, #d63031 100%);
  border: 2px solid #ffbe76;
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 20px;
  font-family: var(--font-kids);
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(214, 48, 49, 0.25);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.badge-streak:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 18px rgba(214, 48, 49, 0.35);
  border-color: #f6e58d;
}

.streak-spin-dot {
  font-size: 0.9rem;
  animation: pulseScale 1.5s infinite ease-in-out;
}

/* Universal Modal Overlay System (Wheel, WhatsApp, Certificate, Popups) */
.modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  background: rgba(15, 23, 42, 0.78) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  box-sizing: border-box !important;
}

.modal-overlay[style*="display: none"] {
  display: none !important;
}

.daily-wheel-card {
  position: relative;
  background: #ffffff;
  border-radius: 26px;
  max-width: 450px;
  width: 92%;
  max-height: 94vh;
  padding: 14px 18px 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  text-align: center;
  border: 3.5px solid #6c5ce7;
  font-family: var(--font-kids);
  animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.wheel-header {
  margin-bottom: 2px;
}

.wheel-streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff5f5;
  border: 1.5px solid #feb2b2;
  color: #c53030;
  padding: 3px 12px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.82rem;
  margin-bottom: 2px;
}

.wheel-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #2d3748;
  margin: 0 0 2px 0;
}

.wheel-subtitle {
  display: none !important;
}

.wheel-spinner-container {
  position: relative;
  width: 275px;
  height: 275px;
  max-width: min(72vw, 38vh);
  max-height: min(72vw, 38vh);
  margin: 16px auto 8px auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-pointer {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  transition: transform 0.08s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-origin: 50% 14px;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.35));
  pointer-events: none;
}

.wheel-pointer.ticking {
  transform: translateX(-50%) rotate(-24deg);
}

.wheel-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 48px rgba(108, 92, 231, 0.35), 0 0 0 8px #ffffff, 0 0 0 13px #e0d8fc;
  will-change: transform;
  border: 4px solid #6c5ce7;
  transition: transform 4.4s cubic-bezier(0.15, 0.9, 0.2, 1);
  background: conic-gradient(
    #ff7675 0deg 60deg,
    #fdcb6e 60deg 120deg,
    #00cec9 120deg 180deg,
    #6c5ce7 180deg 240deg,
    #55efc4 240deg 300deg,
    #a29bfe 300deg 360deg
  );
}

.wheel-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
}

.wheel-slice {
  position: absolute;
  width: 50%;
  height: 50%;
  top: 50%;
  left: 50%;
  transform-origin: 0% 0%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.05rem;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.wheel-slice span {
  position: absolute;
  top: -35px;
  left: 20px;
  transform: rotate(60deg);
}

.wheel-slice.slice-1 { transform: rotate(0deg); }
.wheel-slice.slice-2 { transform: rotate(60deg); }
.wheel-slice.slice-3 { transform: rotate(120deg); }
.wheel-slice.slice-4 { transform: rotate(180deg); }
.wheel-slice.slice-5 { transform: rotate(240deg); }
.wheel-slice.slice-6 { transform: rotate(300deg); }

.wheel-center-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #fdcb6e 55%, #e17055 100%);
  border: 4px solid #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.28), inset 0 2px 4px rgba(255,255,255,0.8);
  z-index: 15;
  pointer-events: none;
}

.wheel-floating-reward-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.4);
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #fff9db 0%, #feca57 50%, #ff9f43 100%);
  border: 4px solid #ffffff;
  padding: 8px 24px;
  border-radius: 32px;
  box-shadow: 0 14px 40px rgba(230, 126, 34, 0.6), 0 0 35px rgba(254, 202, 87, 0.85);
  color: #2d3436;
  font-family: var(--font-kids);
  font-weight: 900;
  pointer-events: none;
  animation: floatingRewardPop 3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.wheel-floating-reward-badge .badge-star-icon {
  font-size: 2.2rem;
  animation: starSpinWiggle 0.8s ease-in-out infinite alternate;
}

.wheel-floating-reward-badge .badge-star-num {
  font-size: 2.3rem;
  color: #c0392b;
  text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
}

.wheel-floating-reward-badge .badge-star-label {
  font-size: 1.3rem;
  color: #2d3436;
}

@keyframes floatingRewardPop {
  0% {
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 0;
  }
  18% {
    transform: translate(-50%, -65%) scale(1.2);
    opacity: 1;
  }
  32% {
    transform: translate(-50%, -60%) scale(1);
    opacity: 1;
  }
  75% {
    transform: translate(-50%, -75%) scale(1.05);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -105%) scale(0.8);
    opacity: 0;
  }
}

@keyframes starSpinWiggle {
  0% { transform: rotate(-12deg) scale(0.95); }
  100% { transform: rotate(15deg) scale(1.15); }
}

.wheel-result-banner {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #f59e0b;
  color: #92400e;
  border-radius: 14px;
  padding: 6px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 900;
  font-size: 0.95rem;
  width: 100%;
  box-sizing: border-box;
}

.wheel-result-banner.celebrate-pop {
  animation: bannerCelebrationPulse 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes bannerCelebrationPulse {
  0% {
    transform: scale(0.8);
    box-shadow: 0 0 0 rgba(245, 158, 11, 0);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.6);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
  }
}

.wheel-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 360px;
}

.btn-spin-wheel {
  font-size: 1.05rem !important;
  padding: 10px 20px !important;
  border-radius: 14px !important;
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4) !important;
  cursor: pointer;
}

.btn-spin-wheel-done {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45) !important;
}

/* =========================================================================
   HERO CERTIFICATE OF EXCELLENCE (PRINTABLE & SHAREABLE)
   ========================================================================= */
.certificate-modal-overlay {
  z-index: 99998;
}

.certificate-modal-wrapper {
  position: relative;
  max-width: 980px;
  width: 95%;
  max-height: 92vh;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: center;
  gap: 16px;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .certificate-modal-wrapper {
    flex-direction: column;
    max-height: 94vh;
    overflow-y: auto;
    padding-bottom: 16px;
  }
}

.hero-certificate-paper {
  background: #ffffff;
  flex: 1;
  max-width: 760px;
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  box-shadow: 0 16px 50px rgba(0,0,0,0.2);
  border-radius: 18px;
  font-family: var(--font-kids);
  position: relative;
}

.cert-ornament-border {
  border: 3px solid #d97706;
  border-radius: 14px;
  padding: 4px;
  background: #fffbeb;
}

.cert-inner-frame {
  border: 1.5px dashed #b45309;
  border-radius: 10px;
  padding: 12px 16px;
  background: #ffffff;
  text-align: center;
}

.cert-top-emblem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid #fef3c7;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.cert-flag {
  font-size: 1.4rem;
}

.cert-platform-brand {
  font-size: 1.05rem;
  font-weight: 900;
  color: #4f46e5;
}

.cert-badge-grade {
  background: #f3e8ff;
  border: 1.5px solid #d8b4fe;
  color: #7e22ce;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: 8px;
}

.cert-main-badge {
  font-size: 2.2rem;
  margin-bottom: 2px;
  filter: drop-shadow(0 3px 6px rgba(217, 119, 6, 0.3));
}

.cert-heading {
  font-size: 1.5rem;
  font-weight: 900;
  color: #b45309;
  margin: 0 0 2px 0;
  letter-spacing: 0.4px;
}

.cert-subheading {
  font-size: 0.75rem;
  font-weight: 700;
  color: #9ca3af;
  margin-bottom: 8px;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.8px;
}

.cert-intro {
  font-size: 0.95rem;
  font-weight: 700;
  color: #4b5563;
  margin: 0 0 4px 0;
}

.cert-hero-name-plate {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #f59e0b;
  padding: 4px 22px;
  border-radius: 24px;
  margin: 3px 0 8px 0;
}

.cert-hero-avatar {
  font-size: 1.6rem;
}

.cert-hero-name {
  font-size: 1.4rem;
  font-weight: 900;
  color: #1e1b4b;
  margin: 0;
}

.cert-appreciation-text {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.6;
  color: #374151;
  max-width: 580px;
  margin: 0 auto 10px auto;
}

.cert-stars-highlight {
  color: #d97706;
  font-size: 1.2rem;
  font-weight: 900;
}

.cert-answers-highlight {
  color: #2563eb;
  font-size: 1.2rem;
  font-weight: 900;
}

.cert-stats-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 10px auto;
  max-width: 540px;
  flex-wrap: wrap;
}

.cert-stat-card {
  flex: 1;
  min-width: 105px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.03);
}

.cert-stat-icon {
  font-size: 1.25rem;
}

.cert-stat-val {
  font-size: 1.25rem;
  font-weight: 900;
  color: #1e293b;
}

.cert-stat-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
}

#celebration-canvas {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  pointer-events: none !important;
  z-index: 1000005 !important;
}

.cert-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1.5px solid #fef3c7;
  padding-top: 8px;
  margin-top: 6px;
}

.cert-footer-col {
  text-align: center;
  min-width: 100px;
}

.cert-meta-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #9ca3af;
  margin-bottom: 2px;
}

.cert-meta-val, .cert-meta-sig {
  font-size: 0.88rem;
  font-weight: 900;
  color: #1f2937;
}

.cert-seal-wrap {
  display: flex;
  justify-content: center;
}

.cert-gold-seal {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid #fbbf24;
  box-shadow: 0 3px 10px rgba(217, 119, 6, 0.35);
  color: #ffffff;
}

.seal-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 900;
}

/* Actions Side Dock (Left/Right on iPad/Desktop, compact bottom on mobile) */
.certificate-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 180px;
  justify-content: center;
}

.certificate-modal-actions .btn {
  width: 100%;
  padding: 12px 16px !important;
  font-size: 0.95rem !important;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px !important;
}

@media (max-width: 768px) {
  .certificate-modal-actions {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    min-width: auto;
  }
  .certificate-modal-actions .btn {
    flex: 1;
    min-width: 120px;
  }
}

/* Print Rules - GUARANTEES STRICTLY 1 PAGE ONLY */
@media print {
  @page {
    size: A4 portrait;
    margin: 6mm;
  }

  html, body {
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    overflow: hidden !important;
  }

  body > * {
    display: none !important;
  }

  body > #hero-certificate-modal {
    display: flex !important;
    position: static !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    overflow: hidden !important;
    page-break-after: avoid !important;
    page-break-before: avoid !important;
    break-after: avoid !important;
    break-before: avoid !important;
  }

  #hero-certificate-modal .certificate-modal-wrapper {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .no-print,
  .certificate-modal-actions,
  .modal-close-btn {
    display: none !important;
  }

  .hero-certificate-paper {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
    padding: 6px !important;
    box-shadow: none !important;
    border: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .cert-ornament-border {
    border: 3px solid #d97706 !important;
    padding: 4px !important;
  }

  .cert-inner-frame {
    padding: 14px 12px !important;
    border: 2px dashed #b45309 !important;
  }

  .cert-stats-grid {
    margin: 0 auto 10px auto !important;
  }

  .cert-stat-card {
    padding: 6px 10px !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .cert-appreciation-text {
    margin: 0 auto 10px auto !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
  }
}

/* =========================================================================
   OFFLINE RESILIENCE FLOATING BADGE
   ========================================================================= */
.offline-resilience-badge {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  background: linear-gradient(135deg, #2d3436 0%, #000000 100%);
  border: 2px solid #fdcb6e;
  border-radius: 18px;
  padding: 10px 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  font-family: var(--font-kids);
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 380px;
  user-select: none;
}

.offline-resilience-badge.online-restored {
  background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
  border-color: #55efc4;
}

.offline-badge-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.offline-badge-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.offline-badge-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.offline-badge-title {
  font-weight: 900;
  font-size: 0.92rem;
  color: #ffeaa7;
}

.offline-badge-sub {
  font-weight: 600;
  font-size: 0.8rem;
  color: #dfe6e9;
  line-height: 1.3;
}

/* DARK MODE OVERRIDES */
body.dark-mode .daily-wheel-card,
body.dark-mode .hero-certificate-paper {
  background: #17153a;
  border-color: #a78bfa;
}
body.dark-mode .wheel-title,
body.dark-mode .cert-hero-name {
  color: #f8fafc;
}
body.dark-mode .wheel-subtitle,
body.dark-mode .cert-appreciation-text {
  color: #cbd5e1;
}
body.dark-mode .cert-inner-frame {
  background: #1e1b4b;
  border-color: #f59e0b;
}





