/* ==========================================================================
   MiniMind Design System & Modern Responsive Stylesheet
   Theme: Vibrant Indigo / Deep Violet Slate (Dark/Light mode native)
   ========================================================================== */

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

:root {
  /* Default Theme: Light Mode (Dyslexia Friendly & Accessible) */
  --bg-primary: #F1F5F9;       /* Requested App Background */
  --bg-secondary: #FFFFFF;     /* Container / Card Background */
  --bg-tertiary: #E2E8F0;      /* Secondary Component Background */
  --bg-card: #FFFFFF;          /* Modal / Dashboard Cards */
  --bg-glass: rgba(241, 245, 249, 0.85);
  --bg-glass-card: rgba(255, 255, 255, 0.92);

  /* Flashcard Specific (Soft Warm Off-white #FFFDF0 & High-Contrast Dyslexia Friendly Text #111827) */
  --card-bg: #FFFDF0;          /* Requested Flashcard Background */
  --card-text: #111827;        /* Requested Flashcard Text Color */
  --card-border: #E2E8F0;
  --card-shadow: 0 10px 30px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);

  --accent-primary: #4F46E5;
  --accent-primary-hover: #4338CA;
  --accent-gradient: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #EC4899 100%);
  --accent-gradient-hover: linear-gradient(135deg, #4338CA 0%, #6D28D9 50%, #DB2777 100%);

  --success: #059669;
  --warning: #D97706;
  --danger: #DC2626;
  --info: #2563EB;

  --text-primary: #1E293B;
  --text-secondary: #475569;
  --text-muted: #64748B;

  --border-color: rgba(0, 0, 0, 0.08);
  --border-color-hover: rgba(79, 70, 229, 0.4);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.1);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.25);

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Explicit Light Theme */
[data-theme="light"] {
  --bg-primary: #F1F5F9;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #E2E8F0;
  --bg-card: #FFFFFF;
  --bg-glass: rgba(241, 245, 249, 0.85);
  --bg-glass-card: rgba(255, 255, 255, 0.92);

  --card-bg: #FFFDF0;
  --card-text: #111827;
  --card-border: #E2E8F0;
  --card-shadow: 0 10px 30px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);

  --accent-primary: #4F46E5;
  --accent-primary-hover: #4338CA;
  --accent-gradient: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #EC4899 100%);
  --accent-gradient-hover: linear-gradient(135deg, #4338CA 0%, #6D28D9 50%, #DB2777 100%);

  --success: #059669;
  --warning: #D97706;
  --danger: #DC2626;
  --info: #2563EB;

  --text-primary: #1E293B;
  --text-secondary: #475569;
  --text-muted: #64748B;

  --border-color: rgba(0, 0, 0, 0.08);
  --border-color-hover: rgba(79, 70, 229, 0.4);

  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.1);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.25);
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-card: #1e293b;
  --bg-glass: rgba(30, 41, 59, 0.75);
  --bg-glass-card: rgba(30, 41, 59, 0.85);

  --card-bg: #1e293b;
  --card-text: #f8fafc;
  --card-border: rgba(255, 255, 255, 0.1);
  --card-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --accent-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #9333ea 50%, #db2777 100%);

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border-color: rgba(255, 255, 255, 0.1);
  --border-color-hover: rgba(99, 102, 241, 0.4);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.35);
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Background Ambient Glow Effects */
body::before {
  content: '';
  position: fixed;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.08) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.content-area {
  flex: 1;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Header & Glass Navbar */
.glass-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-glow);
  padding: 6px;
  overflow: hidden;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.logo-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.brand-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-item {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: var(--transition-fast);
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-item:hover, .nav-item.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.nav-item.active {
  color: var(--accent-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

@media (max-width: 640px) {
  .glass-header {
    padding: 0.5rem 0.75rem;
  }
  .nav-actions {
    gap: 0.35rem;
  }
  .btn-lang {
    padding: 0.35rem 0.55rem;
    font-size: 0.78rem;
    gap: 0.3rem;
  }
  .brand-name {
    font-size: 1.15rem;
  }
  .brand-tag {
    display: none;
  }
}

/* Language Switcher */
.lang-selector-dropdown {
  position: relative;
}

.btn-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-theme-toggle:hover {
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
  transform: scale(1.05);
}

.btn-lang {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-lang:hover {
  border-color: var(--accent-primary);
}

.lang-menu {
  position: absolute;
  top: 110%;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  min-width: 160px;
  overflow: hidden;
  z-index: 1000;
}

.lang-menu.show {
  display: flex;
}

.lang-menu button {
  padding: 0.65rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-menu button:hover {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-normal);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-outline {
  background: transparent;
  color: var(--accent-primary);
  border: 1.5px solid var(--accent-primary);
}

.btn-outline:hover {
  background: rgba(99, 102, 241, 0.1);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  border-radius: var(--radius-lg);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

/* Light Mode Defaults (High Contrast & WCAG Compliant) */
.badge-indigo { background: rgba(79, 70, 229, 0.12); color: #4338ca; border: 1px solid rgba(79, 70, 229, 0.3); }
.badge-green  { background: rgba(16, 185, 129, 0.14); color: #065f46; border: 1px solid rgba(16, 185, 129, 0.35); }
.badge-amber, .badge-warning { background: rgba(245, 158, 11, 0.15); color: #92400e; border: 1px solid rgba(217, 119, 6, 0.38); }
.badge-yellow { background: rgba(234, 179, 8, 0.15); color: #854d0e; border: 1px solid rgba(202, 138, 4, 0.38); }
.badge-rose, .badge-red, .badge-danger { background: rgba(220, 38, 38, 0.12); color: #991b1b; border: 1px solid rgba(220, 38, 38, 0.32); }
.badge-blue   { background: rgba(37, 99, 235, 0.12); color: #1e40af; border: 1px solid rgba(37, 99, 235, 0.32); }
.badge-gray, .badge-secondary { background: rgba(148, 163, 184, 0.16); color: #475569; border: 1px solid rgba(148, 163, 184, 0.38); }

/* Dark Mode Overrides (Vibrant Glowing Pastels on Dark Backgrounds) */
[data-theme="dark"] .badge-indigo { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.4); }
[data-theme="dark"] .badge-green  { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.4); }
[data-theme="dark"] .badge-amber, [data-theme="dark"] .badge-warning { background: rgba(245, 158, 11, 0.2); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.4); }
[data-theme="dark"] .badge-yellow { background: rgba(234, 179, 8, 0.2); color: #fde047; border: 1px solid rgba(234, 179, 8, 0.4); }
[data-theme="dark"] .badge-rose, [data-theme="dark"] .badge-red, [data-theme="dark"] .badge-danger { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }
[data-theme="dark"] .badge-blue   { background: rgba(59, 130, 246, 0.2); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.4); }
[data-theme="dark"] .badge-gray, [data-theme="dark"] .badge-secondary { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }

/* Glass Cards */
.glass-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
}

.glass-card:hover {
  border-color: var(--border-color-hover);
}

/* Landing Page / Portal Switcher Hero */
.hero-section {
  text-align: center;
  padding: 3rem 1rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: 3rem;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
}

.portal-switch-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
  margin-top: 2rem;
}

.portal-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  border: 2px solid var(--border-color);
  transition: var(--transition-normal);
}

.portal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  border-color: var(--accent-primary);
}

.portal-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.portal-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.portal-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Form Styles */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Form Dropdown Option Styling for Dark Theme */
.form-input option, .form-select option, select option {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.5rem;
}

/* Modal Windows */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Stacked Modals (e.g. Card Inspector on top of Student Cards Overview) */
#card-inspector-modal {
  z-index: 1100;
}

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-box {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.5rem;
}

.modal-close:hover { color: var(--text-primary); }

/* Dashboard Grids */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-val {
  font-size: 1.8rem;
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.1;
}

.stat-lbl {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Flashcard Study Area & FSRS Engine UI */
.study-container {
  max-width: 680px;
  margin: 0 auto;
}

.study-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 2rem;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  width: 0%;
  transition: width 0.3s ease;
}

/* 3D Flip Card Effect */
.card-perspective {
  perspective: 1000px;
  -webkit-perspective: 1000px;
  width: 100%;
  min-height: 320px;
  margin-bottom: 1.25rem;
}

.flashcard-3d {
  width: 100%;
  height: 100%;
  min-height: 320px;
  position: relative;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.flashcard-3d.flipped {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

/* WebKit / Safari iOS & iPadOS 3D Card Flip Bleed-Through Bug Fix */
.flashcard-3d.flipped .card-front {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

.flashcard-3d.flipped .card-front * {
  visibility: hidden !important;
  animation: none !important;
}

.flashcard-3d.flipped .card-back {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 2 !important;
}

.flashcard-3d:not(.flipped) .card-back {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

.flashcard-3d:not(.flipped) .card-back * {
  visibility: hidden !important;
  animation: none !important;
}

.flashcard-3d:not(.flipped) .card-front {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 2 !important;
}

@keyframes cardShakeError {
  0%, 100% { transform: rotateY(180deg) translateX(0); }
  15%, 45%, 75% { transform: rotateY(180deg) translateX(-12px) rotate(-1.5deg); }
  30%, 60%, 90% { transform: rotateY(180deg) translateX(12px) rotate(1.5deg); }
}

.flashcard-3d.shake-error {
  animation: cardShakeError 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.flashcard-3d.shake-error .card-face {
  box-shadow: 0 0 35px rgba(239, 68, 68, 0.6) !important;
  border-color: #ef4444 !important;
}

.flashcard-3d.glow-success .card-face {
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.6) !important;
  border-color: #10b981 !important;
}

.flashcard-3d.glow-warning .card-face {
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.6) !important;
  border-color: #f59e0b !important;
}

/* ==========================================================================
   Foutendossier / Knelpunt Super-uitdaging (Flashcard & Game Mascotte)
   ========================================================================== */
.flashcard-3d.dossier-challenge-card .card-face {
  border: 2.5px solid #F59E0B !important;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.35), var(--card-shadow) !important;
}

.dossier-challenge-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.28));
  border: 1.5px solid #F59E0B;
  color: #B45309;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 0.85rem;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.2);
  animation: pulseChallenge 2.5s infinite ease-in-out;
}

[data-theme="dark"] .dossier-challenge-badge {
  color: #FDE68A;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.4));
  border-color: #FBBF24;
}

.dossier-challenge-icon {
  font-size: 1rem;
}

.dossier-challenge-title {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.dossier-challenge-sub {
  font-weight: 600;
  opacity: 0.85;
}

.dossier-challenge-solved-banner {
  animation: challengeSuccessPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pulseChallenge {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.2);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.45);
  }
}

@keyframes challengeSuccessPop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Junior Game Engine Mascot Speech Bubble */
.hero-speech-bubble {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  background: #FFFFFF;
  color: #1E293B;
  padding: 0.4rem 0.95rem;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  border: 2px solid #F59E0B;
  z-index: 25;
  pointer-events: none;
}

.hero-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 9px 8px 0;
  border-style: solid;
  border-color: #F59E0B transparent transparent;
  display: block;
  width: 0;
}

.hero-speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px 6px 0;
  border-style: solid;
  border-color: #FFFFFF transparent transparent;
  display: block;
  width: 0;
  z-index: 1;
}

.bounce-in {
  animation: speechBubbleBounce 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes speechBubbleBounce {
  0% { opacity: 0; transform: translateX(-50%) scale(0.6) translateY(10px); }
  70% { transform: translateX(-50%) scale(1.08) translateY(-2px); }
  100% { opacity: 1; transform: translateX(-50%) scale(1) translateY(0); }
}

.badge-challenge {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(217, 119, 6, 0.45)) !important;
  border: 1.5px solid #FBBF24 !important;
  color: #FEF3C7 !important;
  font-weight: 800 !important;
  border-radius: 14px !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.4) !important;
}

.pulse-challenge {
  animation: pulseChallengeGlow 2s infinite ease-in-out;
}

@keyframes pulseChallengeGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.35); }
  50% { box-shadow: 0 0 22px rgba(245, 158, 11, 0.7); transform: scale(1.04); }
}

.pulse-challenge-actor {
  filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.65)) drop-shadow(0 10px 20px rgba(0,0,0,0.4)) !important;
}

.dossier-challenge-prompt .prompt-host-card {
  border-color: #F59E0B !important;
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.45) !important;
}

/* Visual Splitsboom / Number Bond Component */
.splitsboom-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0.5rem 0;
  width: 100%;
}

.splitsboom-top-box {
  width: 72px;
  height: 60px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-family: var(--font-heading);
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.splitsboom-legs-svg {
  width: 170px;
  height: 40px;
  margin: 0.15rem 0;
}

.splitsboom-bottom-row {
  display: flex;
  justify-content: space-between;
  width: 190px;
}

.splitsboom-bottom-box {
  width: 68px;
  height: 56px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.splitsboom-bottom-box.missing {
  border: 2px dashed var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
}

.splitsboom-bottom-box.filled-solution {
  border: 2px solid var(--success);
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

/* Bridge Math Visual Component */
.bridge-math-container {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
  width: 100%;
}

.bridge-math-inline-term {
  font-size: 2.5rem;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--text-primary);
  height: 44px;
  line-height: 44px;
  display: flex;
  align-items: center;
}

.bridge-splitsboom {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0.1rem;
  width: auto !important;
}

.splitsboom-top-box.bridge-top {
  width: 50px;
  height: 44px;
  font-size: 1.8rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.3);
}

.splitsboom-legs-svg.bridge-svg {
  width: 100px;
  height: 28px;
  margin: 0.05rem 0;
}

.splitsboom-bottom-row.bridge-row {
  width: 108px;
  gap: 0.5rem;
  justify-content: center;
}

.splitsboom-bottom-box.bridge-box.bridge-input {
  width: 44px;
  height: 38px;
  font-size: 1.35rem;
  font-family: var(--font-heading);
  font-weight: 800;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 2px dashed var(--accent-primary);
  color: var(--text-primary);
  text-align: center;
  outline: none;
  cursor: text;
  transition: all 0.2s ease;
}

.splitsboom-bottom-box.bridge-box.bridge-input::placeholder {
  color: var(--accent-primary);
  opacity: 0.6;
}

@keyframes activeBoxPulse {
  0% {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.6), 0 0 14px rgba(99, 102, 241, 0.6);
    transform: scale(1.06);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(168, 85, 247, 0.85), 0 0 24px rgba(168, 85, 247, 0.9);
    transform: scale(1.13);
  }
  100% {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.6), 0 0 14px rgba(99, 102, 241, 0.6);
    transform: scale(1.06);
  }
}

.splitsboom-bottom-box.active-target,
.math-inline-box.active-target {
  border-style: solid !important;
  border-width: 3px !important;
  border-color: #6366f1 !important;
  background: rgba(99, 102, 241, 0.28) !important;
  color: #ffffff !important;
  animation: activeBoxPulse 1.5s infinite ease-in-out !important;
  z-index: 10;
}

/* Inline Math Answer Box for Equations */
.math-inline-box {
  min-width: 64px;
  height: 56px;
  padding: 0 0.8rem;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.math-inline-box.missing {
  border: 2px dashed var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
}

.math-inline-box.filled-solution {
  border: 2px solid var(--success);
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

/* Game Arena Math Equation Target Box Enhancement */
.game-stage .math-inline-box {
  min-width: 68px;
  height: 58px;
  font-size: 2.3rem;
  border-radius: 14px;
  margin: 0 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

@media (max-width: 600px) {
  .game-stage .prompt-math-text {
    font-size: 2.1rem !important;
  }
  .game-stage .math-inline-box {
    min-width: 52px !important;
    height: 48px !important;
    font-size: 1.7rem !important;
    margin: 0 0.2rem !important;
  }
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  background: var(--card-bg);
  color: var(--card-text);
  border: 2px solid var(--card-border);
  box-shadow: var(--card-shadow);
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.card-face::-webkit-scrollbar {
  display: none;
}

/* ==========================================================================
   Global Study View Scrollability (Guarantees scrolling on all devices)
   ========================================================================== */
html.view-study,
body.view-study {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: auto !important;
  min-height: 100% !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
}

body.view-study .app-container {
  min-height: 100vh !important;
  height: auto !important;
  overflow: visible !important;
}

body.view-study .content-area {
  height: auto !important;
  overflow: visible !important;
  padding-bottom: 5rem !important;
}

body.view-study .study-container {
  height: auto !important;
  overflow: visible !important;
  padding-bottom: 6rem !important;
}

/* Compact Card Height Adaptation ONLY for extreme low-height screens (landscape phones <= 520px height) */
@media (max-width: 900px) and (max-height: 520px) {
  body.view-study.classify-mode .card-perspective,
  body.view-study.classify-mode .flashcard-3d {
    min-height: 110px !important;
    margin-bottom: 0.35rem !important;
  }

  body.view-study.typing-mode .card-perspective,
  body.view-study.typing-mode .flashcard-3d {
    min-height: 135px !important;
    margin-bottom: 0.35rem !important;
  }

  body.view-study.classify-mode .card-prompt-word,
  body.view-study.typing-mode .card-prompt-word {
    font-size: 1.55rem !important;
    margin-bottom: 0.1rem !important;
  }
}

/* Tablet & iPad Portrait / Normal height (screens <= 900px and height > 520px) */
@media (max-width: 900px) and (min-height: 521px) {
  body.view-study.classify-mode .card-perspective,
  body.view-study.classify-mode .flashcard-3d {
    min-height: 200px !important;
    margin-bottom: 0.75rem !important;
  }

  body.view-study.typing-mode .card-perspective,
  body.view-study.typing-mode .flashcard-3d {
    min-height: 240px !important;
    margin-bottom: 0.75rem !important;
  }

  body.view-study.typing-mode .flashcard-3d.flipped,
  body.view-study.classify-mode .flashcard-3d.flipped {
    min-height: 280px !important;
  }
}

/* Mobile Responsive Scaling for Math & Language Cards */
@media (max-width: 640px) {
  body.view-study {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .study-container {
    padding: 0 0.4rem 5rem 0.4rem !important;
  }

  .study-header {
    margin-bottom: 0.4rem !important;
  }

  .progress-bar-container {
    margin-bottom: 0.5rem !important;
  }

  .card-perspective, .flashcard-3d {
    min-height: 220px !important;
    margin-bottom: 0.4rem !important;
  }

  .card-face {
    padding: 0.6rem 0.8rem !important;
    justify-content: flex-start !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  .card-face.card-back {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 0.6rem 0.5rem !important;
    justify-content: flex-start !important;
  }

  .card-prompt-word {
    font-size: 1.6rem !important;
    margin-bottom: 0.15rem !important;
  }

  .card-hint-badge {
    font-size: 0.75rem !important;
    padding: 0.15rem 0.5rem !important;
    margin-bottom: 0.25rem !important;
  }

  .card-sentence-context {
    font-size: 0.78rem !important;
    margin-top: 0.25rem !important;
  }

  /* Fluid typography and compact elements for Answer Card */
  .card-back-primary-text {
    font-size: clamp(1.2rem, 5.2vw, 1.7rem) !important;
    line-height: 1.2 !important;
    margin-bottom: 0.2rem !important;
  }

  .card-back-primary-text.classify-text {
    font-size: clamp(1.1rem, 4.4vw, 1.45rem) !important;
  }

  .card-back-primary-text.is-long {
    font-size: clamp(1rem, 3.8vw, 1.25rem) !important;
  }

  .latin-dict-entry-badge {
    font-size: clamp(0.82rem, 3.4vw, 0.98rem) !important;
    padding: 0.2rem 0.55rem !important;
    margin: 0.2rem 0 !important;
  }

  .card-back-base-meaning {
    font-size: 0.85rem !important;
    margin-top: 0.15rem !important;
  }

  .card-back-secondary-badge {
    margin-top: 0.25rem !important;
  }

  .card-back-secondary-badge .badge-secondary {
    font-size: clamp(0.74rem, 2.9vw, 0.84rem) !important;
    padding: 0.18rem 0.5rem !important;
  }

  .card-back-explanation-box {
    margin-top: 0.35rem !important;
    padding: 0.4rem 0.55rem !important;
    font-size: 0.78rem !important;
    line-height: 1.35 !important;
  }

  /* Latin multi-modal question pill compact sizing on mobile */
  .latin-pill-question-container {
    padding: 0.65rem 0.75rem !important;
    margin-bottom: 0.5rem !important;
  }

  .latin-step-badge {
    font-size: 0.74rem !important;
    margin-bottom: 0.3rem !important;
  }

  .latin-pill-grid {
    gap: 0.32rem !important;
  }

  .latin-pill-btn {
    font-size: 0.78rem !important;
    padding: 0.32rem 0.55rem !important;
    border-radius: 6px !important;
  }

  /* Dynamic Card Height Adaptation by Exercise Mode */
  body.view-study.typing-mode .card-perspective,
  body.view-study.typing-mode .flashcard-3d {
    min-height: 165px !important;
    margin-bottom: 0.35rem !important;
  }

  body.view-study.classify-mode .card-perspective,
  body.view-study.classify-mode .flashcard-3d {
    min-height: 135px !important;
    margin-bottom: 0.35rem !important;
  }

  body.view-study.classify-mode .card-prompt-word,
  body.view-study.typing-mode .card-prompt-word {
    font-size: 1.55rem !important;
    margin-bottom: 0.1rem !important;
  }

  body.view-study.typing-mode .glass-card {
    padding: 0.75rem 0.9rem !important;
    margin-bottom: 0.6rem !important;
  }

  /* When flipped to answer back, give enough room for content and internal scroll */
  body.view-study.typing-mode .flashcard-3d.flipped,
  body.view-study.classify-mode .flashcard-3d.flipped {
    min-height: 220px !important;
  }

  .splitsboom-container {
    margin: 0.15rem 0 !important;
  }

  .splitsboom-top-box {
    width: 64px !important;
    height: 50px !important;
    font-size: 1.75rem !important;
  }

  .splitsboom-legs-svg {
    width: 140px !important;
    height: 32px !important;
    margin: 0.05rem 0 !important;
  }

  .splitsboom-bottom-row {
    width: 155px !important;
  }

  .splitsboom-bottom-box {
    width: 56px !important;
    height: 46px !important;
    font-size: 1.55rem !important;
  }

  .math-inline-box {
    min-width: 54px !important;
    height: 48px !important;
    font-size: 1.8rem !important;
  }
}

.card-face.card-back {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
  border-color: var(--accent-primary);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.card-face.card-back::-webkit-scrollbar {
  display: none;
}

.card-front-content-wrapper,
.card-back-content-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto 0;
  box-sizing: border-box;
}

.card-back-primary-text {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  word-break: break-word;
  text-align: center;
}

.card-back-primary-text.classify-text {
  font-size: 1.8rem;
  margin-bottom: 0.35rem;
}

.card-back-primary-text.is-long {
  font-size: 1.6rem;
}

.latin-dict-entry-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--accent-primary);
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0.35rem 0;
}

.card-back-base-meaning {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  text-align: center;
}

.card-back-secondary-badge {
  margin-top: 0.45rem;
  text-align: center;
}

.card-back-secondary-badge .badge-secondary {
  font-size: 0.9rem;
  padding: 0.25rem 0.65rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.card-back-explanation-box {
  margin-top: 0.6rem;
  padding: 0.5rem 0.8rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-primary);
  text-align: left;
  box-sizing: border-box;
  width: 100%;
  max-width: 480px;
}

.card-prompt-word {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.card-hint-badge {
  font-size: 0.85rem;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  margin-bottom: 0.5rem;
  cursor: help;
  display: inline-flex;
  align-items: center;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.card-hint-badge:hover {
  background: rgba(99, 102, 241, 0.22);
  transform: translateY(-1px);
}

.card-sentence-context {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 90%;
  margin-top: 0.5rem;
}

/* FSRS Rating Buttons (Again, Hard, Good, Easy) */
.fsrs-button-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  width: 100%;
}

.btn-rating {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-rating:hover {
  transform: translateY(-2px);
}

.btn-rating.again { border-color: var(--danger); }
.btn-rating.again:hover { background: rgba(239, 68, 68, 0.15); }
.btn-rating.hard  { border-color: var(--warning); }
.btn-rating.hard:hover  { background: rgba(245, 158, 11, 0.15); }
.btn-rating.good  { border-color: var(--accent-primary); }
.btn-rating.good:hover  { background: rgba(99, 102, 241, 0.15); }
.btn-rating.easy  { border-color: var(--success); }
.btn-rating.easy:hover  { background: rgba(16, 185, 129, 0.15); }

.rating-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.2rem; }
.rating-interval { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }

/* Tables */
.custom-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.custom-table th, .custom-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.custom-table th {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 2000;
}

.toast {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  animation: slideIn 0.3s ease;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error   { border-left: 4px solid var(--danger); }
.toast-info    { border-left: 4px solid var(--info); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* Responsive Media Queries */
@media (max-width: 768px), (max-height: 720px) {
  .hero-title { font-size: 2.2rem; }
  .fsrs-button-grid { grid-template-columns: repeat(2, 1fr); }
  .glass-header { padding: 0.6rem 1rem; }
  .nav-links { display: none; }
  .content-area { padding: 1rem 0.75rem 2rem; }

  /* Mobile Flashcard Compact Adaptations for Virtual Keyboards */
  .study-container { padding: 0 0.25rem; }
  .progress-bar-container { margin-bottom: 0.75rem; height: 6px; }
  .study-header { margin-bottom: 0.6rem; }
  body:not(.math-mode) .card-perspective,
  body:not(.math-mode) .flashcard-3d { min-height: 180px; margin-bottom: 0.85rem; }
  body.view-study.math-mode .card-perspective,
  body.view-study.math-mode .flashcard-3d { min-height: 290px; margin-bottom: 0.85rem; }
  .card-face { padding: 1rem 0.75rem; }
  .card-prompt-word { font-size: 1.8rem; margin-bottom: 0.2rem; }
  .card-hint-badge { font-size: 0.78rem; padding: 0.15rem 0.6rem; margin-bottom: 0.35rem; }
  .card-sentence-context { font-size: 0.82rem; margin-top: 0.35rem; max-width: 95%; }
  .card-face p[style*="margin-top:2rem"] { margin-top: 0.5rem !important; font-size: 0.78rem !important; }

  /* Input box & button compactness */
  .glass-card { padding: 0.9rem !important; margin-bottom: 0.85rem !important; }
  .form-group { margin-bottom: 0.4rem !important; }
  .form-input { padding: 0.5rem 0.75rem !important; font-size: 0.95rem !important; }
}

/* ==========================================================================
   Hoe Werkt MiniMind? (Science-Based Learning & Forgetting Curve Styles)
   ========================================================================== */

.how-it-works-page {
  padding-bottom: 4rem;
  animation: fadeIn 0.3s ease;
}

.hiw-container {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

/* Sub-nav breadcrumbs & quick anchors */
.hiw-subnav {
  position: sticky;
  top: 72px;
  z-index: 90;
  margin-bottom: 2rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.hiw-subnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.hiw-anchors {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.hiw-anchors a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-fast);
}

.hiw-anchors a:hover {
  color: var(--accent-primary);
}

/* Hero Section */
.hiw-hero {
  padding: 2.5rem 0 3.5rem;
}

.hiw-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 2.5rem;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.hiw-hero-content {
  min-width: 0;
  box-sizing: border-box;
}

.hiw-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-bottom: 1.25rem;
}

.hiw-eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: pulse 2s infinite;
}

.hiw-title {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 3.8vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
}

.hiw-title em {
  font-style: normal;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hiw-lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.hiw-buttons {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.hiw-note {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Forgetting Curve Interactive Card */
.hiw-curve-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.hiw-card-head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.85rem;
}

.hiw-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  margin-bottom: 0.15rem;
}

.hiw-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
}

.hiw-card-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.hiw-status-bar {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.hiw-status {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  transition: var(--transition-normal);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .hiw-status {
  border-color: rgba(255, 255, 255, 0.1);
}

/* Chart Canvas Area */
.hiw-chart-wrap {
  margin-top: 1.25rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.hiw-chart {
  height: 270px;
  position: relative;
  border-left: 2px solid var(--border-color);
  border-bottom: 2px solid var(--border-color);
  background: repeating-linear-gradient(to top, transparent 0, transparent 53px, rgba(0, 0, 0, 0.03) 54px);
  cursor: crosshair;
  border-radius: 0 0 0 4px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

[data-theme="dark"] .hiw-chart {
  background: repeating-linear-gradient(to top, transparent 0, transparent 53px, rgba(255, 255, 255, 0.04) 54px);
}

.hiw-chart svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hiw-axis-y {
  position: absolute;
  left: -34px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.hiw-axis-y-100 {
  top: -6px;
}

.hiw-axis-y-75 {
  top: 33.33%;
  transform: translateY(-50%);
}

.hiw-axis-y-50 {
  top: 66.67%;
  transform: translateY(-50%);
}

.hiw-axis-y-25 {
  bottom: -6px;
}

.hiw-axis-x-container {
  position: relative;
  margin-top: 6px;
  padding-bottom: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

.hiw-axis-x-ticks {
  position: relative;
  width: 100%;
  height: 18px;
}

.hiw-tick {
  position: absolute;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.hiw-tick:first-child {
  transform: translateX(0);
  align-items: flex-start;
}

.hiw-tick:last-child {
  transform: translateX(-100%);
  align-items: flex-end;
}

.hiw-axis-x-label {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.hiw-tooltip {
  position: absolute;
  display: none;
  transform: translate(-50%, -115%);
  background: #111827;
  color: #ffffff;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 10;
}

#hiw-slider-halo {
  animation: hiwPulse 2s infinite ease-in-out;
  transform-origin: center;
}

@keyframes hiwPulse {
  0% { r: 10; opacity: 0.8; }
  50% { r: 16; opacity: 0.25; }
  100% { r: 10; opacity: 0.8; }
}

#hiw-slider-dot {
  filter: drop-shadow(0 2px 6px rgba(239, 68, 68, 0.6));
}

.hiw-legend {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.hiw-legend span {
  display: flex;
  align-items: center;
}

.hiw-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.4rem;
}

.hiw-controls {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  box-sizing: border-box;
}

.hiw-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.hiw-controls input[type="range"] {
  width: 100%;
  accent-color: var(--accent-primary);
  cursor: pointer;
  margin: 0.4rem 0;
}

.hiw-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.25rem;
}

/* Sections General */
.hiw-section {
  padding: 4.5rem 0;
  border-top: 1px solid var(--border-color);
}

.hiw-section-head {
  max-width: 800px;
  margin-bottom: 2.75rem;
}

.hiw-section-head h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  line-height: 1.15;
  margin: 0.4rem 0 0.85rem;
}

.hiw-section-head h2 em {
  font-style: normal;
  color: var(--accent-primary);
}

.hiw-section-head p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Cards Grid */
.hiw-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.hiw-info-card {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  box-sizing: border-box;
}

.hiw-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
}

.hiw-info-card h3 {
  font-size: 1.25rem;
  margin: 0 0 0.6rem;
  font-weight: 700;
}

.hiw-info-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 1.25rem;
}

.hiw-card-footer-metric {
  margin-top: auto;
}

/* Dark Engine Section */
.hiw-dark-section {
  background: #0f172a;
  color: #ffffff;
}

[data-theme="dark"] .hiw-dark-section {
  background: #090d16;
}

.hiw-dark-section .hiw-section-head h2 {
  color: #ffffff;
}

.hiw-dark-section .hiw-section-head p {
  color: #94a3b8;
}

.hiw-engine-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 2rem;
  width: 100%;
  box-sizing: border-box;
}

.hiw-engine-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius-lg);
  padding: 2rem;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.hiw-engine-card h3 {
  font-size: 1.5rem;
  color: #ffffff;
  margin: 0.4rem 0 0.85rem;
}

.hiw-engine-card p {
  color: #cbd5e1;
  font-size: 0.92rem;
  line-height: 1.55;
}

.hiw-metrics-list {
  margin-top: 1.5rem;
}

.hiw-metric-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid #334155;
  min-width: 0;
  box-sizing: border-box;
}

.hiw-metric-row:first-of-type {
  border-top: none;
}

.hiw-metric-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.hiw-metric-row strong {
  display: block;
  font-size: 0.95rem;
  color: #ffffff;
}

.hiw-metric-row small {
  color: #94a3b8;
  font-size: 0.82rem;
  line-height: 1.35;
  display: block;
}

.hiw-memory-card {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.hiw-memory-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hiw-progress-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.hiw-progress-bar span {
  display: block;
  height: 100%;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.hiw-review-timeline {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

.hiw-timeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
  min-width: 0;
  gap: 0.5rem;
}

.hiw-timeline-item:last-child {
  border-bottom: none;
}

.hiw-timeline-item small {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* Age Grid */
.hiw-age-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.hiw-age-card {
  padding: 1.75rem;
  min-width: 0;
  box-sizing: border-box;
}

.hiw-age-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
}

.hiw-age-card h3 {
  font-size: 1.3rem;
  margin: 0 0 0.5rem;
}

.hiw-age-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 1.25rem;
}

.hiw-mockup-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.hiw-mockup-header {
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
}

.hiw-mockup-emojis {
  font-size: 1.5rem;
  margin: 0.6rem 0;
  text-align: center;
}

.hiw-mockup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.82rem;
  gap: 0.5rem;
}

.hiw-mockup-row:last-child {
  border-bottom: none;
}

/* Teacher Grid */
.hiw-teacher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.75rem;
  width: 100%;
  box-sizing: border-box;
}

.hiw-perspective-card {
  padding: 2rem;
  min-width: 0;
  box-sizing: border-box;
}

.hiw-perspective-card h3 {
  font-size: 1.4rem;
  margin: 0.35rem 0 0.75rem;
}

.hiw-perspective-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 1.25rem;
}

.hiw-quote-box {
  background: rgba(99, 102, 241, 0.08);
  border-left: 4px solid var(--accent-primary);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-weight: 600;
  font-size: 0.9rem;
}

/* CTA Section */
.hiw-cta-section {
  padding: 4rem 0 2rem;
}

.hiw-cta-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.08));
  border: 2px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  min-width: 0;
  box-sizing: border-box;
}

.hiw-cta-box h2 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  margin: 0 auto 0.85rem;
  max-width: 700px;
  line-height: 1.15;
}

.hiw-cta-box p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hiw-cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Home View Banner Card */
.how-it-works-banner {
  cursor: pointer;
  margin-top: 2.25rem;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border: 1.5px solid rgba(99, 102, 241, 0.25);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.05));
  padding: 1.5rem 1.75rem;
  transition: var(--transition-normal);
  width: 100%;
  box-sizing: border-box;
}

.how-it-works-banner:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary) !important;
  box-shadow: var(--shadow-glow);
}

.hiw-banner-content {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
}

.hiw-banner-icon {
  font-size: 2.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  flex-shrink: 0;
}

.hiw-banner-text {
  min-width: 0;
}

.hiw-banner-text h3 {
  margin: 0.2rem 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hiw-banner-text p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.45;
}

.hiw-banner-action {
  flex-shrink: 0;
}

.hiw-banner-action .btn {
  pointer-events: none;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .hiw-hero-grid,
  .hiw-engine-grid,
  .hiw-cards-grid,
  .hiw-age-grid,
  .hiw-teacher-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    width: 100%;
  }

  .hiw-anchors {
    display: none;
  }

  .hiw-hero {
    padding: 1.5rem 0 2rem;
  }

  .hiw-section {
    padding: 2.5rem 0;
  }

  .hiw-card,
  .hiw-engine-card,
  .hiw-memory-card,
  .hiw-curve-card,
  .hiw-info-card,
  .hiw-age-card,
  .hiw-perspective-card,
  .hiw-cta-box {
    padding: 1.25rem 1rem !important;
    border-radius: var(--radius-md);
  }

  .hiw-engine-card h3 {
    font-size: 1.3rem;
  }

  .hiw-metric-row {
    gap: 0.75rem;
    padding: 0.65rem 0;
  }

  .hiw-timeline-item {
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: flex-start;
  }

  .hiw-cta-box {
    padding: 2rem 1rem !important;
  }

  .hiw-cta-box h2 {
    font-size: 1.6rem;
  }

  .hiw-title {
    font-size: clamp(1.8rem, 6vw, 2.4rem);
  }

  .hiw-section-head h2 {
    font-size: 1.6rem;
  }

  .hiw-legend {
    gap: 0.75rem;
    font-size: 0.75rem;
  }

  .hiw-controls {
    padding: 0.85rem;
  }

  .hiw-subnav {
    top: 60px;
    padding: 0.5rem 0.85rem;
  }

  .how-it-works-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem 1rem !important;
    gap: 1rem;
  }

  .hiw-banner-content {
    align-items: flex-start;
    gap: 0.85rem;
  }

  .hiw-banner-icon {
    width: 42px;
    height: 42px;
    font-size: 1.8rem;
  }

  .hiw-banner-action {
    width: 100%;
  }

  .hiw-banner-action .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   QR Scanner & Camera Viewfinder Component
   ========================================================================== */
#qr-reader {
  width: 100% !important;
  border: none !important;
}

#qr-reader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 10px;
}

#qr-reader__scan_region {
  min-height: 220px;
  background: transparent !important;
}

#qr-reader__dashboard {
  padding: 0.5rem !important;
}

.qr-scanner-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(280px, 80%);
  aspect-ratio: 1 / 1;
  pointer-events: none;
  z-index: 10;
}

.qr-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: #6366f1;
  border-style: solid;
}

.qr-corner.top-left {
  top: 0;
  left: 0;
  border-width: 4px 0 0 4px;
  border-top-left-radius: 8px;
}

.qr-corner.top-right {
  top: 0;
  right: 0;
  border-width: 4px 4px 0 0;
  border-top-right-radius: 8px;
}

.qr-corner.bottom-left {
  bottom: 0;
  left: 0;
  border-width: 0 0 4px 4px;
  border-bottom-left-radius: 8px;
}

.qr-corner.bottom-right {
  bottom: 0;
  right: 0;
  border-width: 0 4px 4px 0;
  border-bottom-right-radius: 8px;
}

@keyframes scanLaser {
  0% { top: 6px; opacity: 0.2; }
  50% { opacity: 1; }
  100% { top: calc(100% - 10px); opacity: 0.2; }
}

.qr-laser-line {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #6366f1, #a855f7, transparent);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.9);
  animation: scanLaser 2s ease-in-out infinite;
  border-radius: 999px;
}

/* ==========================================================================
   Teacher QR Sticker Sheet Generator & Printable Card System
   ========================================================================== */
.sticker-sheet-page {
  display: grid;
  gap: 12px;
  width: 100%;
}

.sticker-sheet-page.grid-2x4 {
  grid-template-columns: repeat(2, 1fr);
}

.sticker-sheet-page.herma-4203 {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sticker-sheet-page.grid-3x7 {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sticker-sheet-page.cards {
  grid-template-columns: repeat(2, 1fr);
  align-content: start;
  gap: 16px;
}

@media (max-width: 768px) {
  .sticker-sheet-page.grid-2x4,
  .sticker-sheet-page.herma-4203,
  .sticker-sheet-page.grid-3x7,
  .sticker-sheet-page.cards {
    grid-template-columns: 1fr;
  }
}

.sticker-card {
  background: #ffffff;
  color: #0f172a;
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  position: relative;
  overflow: hidden;
}

.sticker-card.is-cutout-card {
  border: 1.5px dashed #94a3b8;
  padding: 12px 14px;
  border-radius: 10px;
  min-height: 190px;
}

.sticker-card.is-herma {
  padding: 8px 10px;
  min-height: 145px;
}

.sticker-card.is-compact {
  padding: 6px 8px;
  min-height: 120px;
}

.sticker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.sticker-brand {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sticker-logo-dot {
  font-size: 0.95rem;
}

.sticker-app-name {
  font-weight: 800;
  font-size: 0.85rem;
  color: #4f46e5;
  letter-spacing: -0.02em;
}

.sticker-class-tag {
  font-size: 0.72rem;
  font-weight: 700;
  background: #e0e7ff;
  color: #3730a3;
  padding: 2px 6px;
  border-radius: 4px;
}

.sticker-class-num-badge {
  font-size: 0.72rem;
  font-weight: 800;
  background: #1e1b4b;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sticker-student-num {
  color: #4f46e5;
  font-weight: 800;
  margin-right: 4px;
}

.sticker-body {
  display: flex;
  gap: 10px;
  align-items: center;
}

.sticker-qr-wrap {
  background: #ffffff;
  padding: 4px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  width: 76px;
  height: 76px;
  box-sizing: border-box;
}

.sticker-card.is-herma .sticker-qr-wrap {
  width: 66px;
  height: 66px;
  padding: 3px;
}

.sticker-card.is-compact .sticker-qr-wrap {
  width: 58px;
  height: 58px;
  padding: 3px;
}

.sticker-card.is-cutout-card .sticker-qr-wrap {
  width: 105px;
  height: 105px;
  padding: 6px;
}

.sticker-qr-wrap canvas {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

/* QRCode.js creates both a canvas and a fallback img. Hide duplicate img when canvas is present */
.sticker-qr-wrap canvas + img {
  display: none !important;
}

.sticker-qr-wrap img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.sticker-qr-wrap img:only-child {
  display: block !important;
}

.sticker-info {
  flex: 1;
  min-width: 0;
}

.sticker-student-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.sticker-card.is-herma .sticker-student-name {
  font-size: 0.85rem;
}

.sticker-card.is-compact .sticker-student-name {
  font-size: 0.78rem;
}

.sticker-creds-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 0.72rem;
  line-height: 1.35;
}

.sticker-card.is-herma .sticker-creds-box {
  padding: 3px 5px;
  font-size: 0.66rem;
  line-height: 1.28;
}

.sticker-card.is-compact .sticker-creds-box {
  padding: 2px 4px;
  font-size: 0.62rem;
  line-height: 1.22;
}

.sticker-cred-row {
  display: flex;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cred-label {
  color: #64748b;
  font-weight: 500;
}

.cred-val {
  color: #0f172a;
  font-family: monospace;
}

.sticker-footer {
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px dashed #e2e8f0;
  font-size: 0.65rem;
  color: #64748b;
  text-align: center;
}

/* ==========================================================================
   Print Specific Stylesheet (@media print)
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 0 !important;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 210mm !important;
    height: auto !important;
  }

  /* Hide app container and any overlays */
  #app,
  .app-container,
  .modal-overlay,
  .no-print,
  .sheet-page-indicator {
    display: none !important;
  }

  #printable-sticker-sheet {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    width: 210mm !important;
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #printable-sticker-sheet * {
    visibility: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #printable-sticker-sheet .sticker-sheet-pages-wrapper {
    display: block !important;
    width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .sticker-sheet-page {
    display: grid !important;
    width: 210mm !important;
    height: 297mm !important;
    max-height: 297mm !important;
    min-height: 297mm !important;
    box-sizing: border-box !important;
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    overflow: hidden !important;
    margin: 0 !important;
    background: #ffffff !important;
    align-content: start !important;
  }

  .sticker-sheet-page:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }

  /* HERMA 4203: 63.5 x 46.6 mm, 3x6 = 18 labels per sheet (margins: top/bottom 8.7mm, left/right 9.75mm, gap 0mm) */
  .sticker-sheet-page.herma-4203 {
    grid-template-columns: repeat(3, 63.5mm) !important;
    grid-template-rows: repeat(6, 46.6mm) !important;
    padding-top: 8.7mm !important;
    padding-bottom: 8.7mm !important;
    padding-left: 9.75mm !important;
    padding-right: 9.75mm !important;
    gap: 0 !important;
  }

  .sticker-sheet-page.herma-4203 .sticker-card {
    width: 63.5mm !important;
    height: 46.6mm !important;
    min-height: 46.6mm !important;
    max-height: 46.6mm !important;
    box-sizing: border-box !important;
    padding: 2.2mm 3.2mm !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    overflow: hidden !important;
    background: #ffffff !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .sticker-sheet-page.herma-4203 .sticker-qr-wrap {
    width: 25mm !important;
    height: 25mm !important;
    min-width: 25mm !important;
    min-height: 25mm !important;
    max-width: 25mm !important;
    max-height: 25mm !important;
    padding: 1mm !important;
    box-sizing: border-box !important;
  }

  .sticker-sheet-page.herma-4203 .sticker-header {
    margin-bottom: 1mm !important;
    padding-bottom: 0.8mm !important;
  }

  .sticker-sheet-page.herma-4203 .sticker-student-name {
    font-size: 0.80rem !important;
    margin-bottom: 1mm !important;
    line-height: 1.1 !important;
  }

  .sticker-sheet-page.herma-4203 .sticker-creds-box {
    padding: 1mm 1.8mm !important;
    font-size: 0.58rem !important;
    line-height: 1.2 !important;
  }

  .sticker-sheet-page.herma-4203 .sticker-footer {
    margin-top: 1mm !important;
    padding-top: 0.8mm !important;
    font-size: 0.55rem !important;
    line-height: 1.1 !important;
  }

  /* Avery L7160 / Universeel 3x7: 63.5 x 38.1 mm, 21 labels per sheet */
  .sticker-sheet-page.grid-3x7 {
    grid-template-columns: repeat(3, 63.5mm) !important;
    grid-template-rows: repeat(7, 38.1mm) !important;
    padding-top: 15.1mm !important;
    padding-bottom: 15.2mm !important;
    padding-left: 7.2mm !important;
    padding-right: 7.2mm !important;
    column-gap: 2.5mm !important;
    row-gap: 0 !important;
  }

  .sticker-sheet-page.grid-3x7 .sticker-card {
    width: 63.5mm !important;
    height: 38.1mm !important;
    min-height: 38.1mm !important;
    max-height: 38.1mm !important;
    box-sizing: border-box !important;
    padding: 1.5mm 2.2mm !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    overflow: hidden !important;
    background: #ffffff !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .sticker-sheet-page.grid-3x7 .sticker-qr-wrap {
    width: 20mm !important;
    height: 20mm !important;
    min-width: 20mm !important;
    min-height: 20mm !important;
    max-width: 20mm !important;
    max-height: 20mm !important;
    padding: 0.8mm !important;
    box-sizing: border-box !important;
  }

  .sticker-sheet-page.grid-3x7 .sticker-header {
    margin-bottom: 0.6mm !important;
    padding-bottom: 0.5mm !important;
  }

  .sticker-sheet-page.grid-3x7 .sticker-student-name {
    font-size: 0.70rem !important;
    margin-bottom: 0.6mm !important;
    line-height: 1.1 !important;
  }

  .sticker-sheet-page.grid-3x7 .sticker-creds-box {
    padding: 0.8mm 1.4mm !important;
    font-size: 0.52rem !important;
    line-height: 1.15 !important;
  }

  .sticker-sheet-page.grid-3x7 .sticker-footer {
    margin-top: 0.6mm !important;
    padding-top: 0.5mm !important;
    font-size: 0.50rem !important;
  }

  /* Grid 2x4: 105 x 74.25 mm, 8 labels per sheet */
  .sticker-sheet-page.grid-2x4 {
    grid-template-columns: repeat(2, 105mm) !important;
    grid-template-rows: repeat(4, 74.25mm) !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  .sticker-sheet-page.grid-2x4 .sticker-card {
    width: 105mm !important;
    height: 74.25mm !important;
    min-height: 74.25mm !important;
    max-height: 74.25mm !important;
    box-sizing: border-box !important;
    padding: 5mm 7mm !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* Cards (Knipkaarten met kniplijnen): 8 kaarten per A4 (2 kolommen x 4 rijen) */
  .sticker-sheet-page.cards {
    grid-template-columns: repeat(2, 90mm) !important;
    grid-template-rows: repeat(4, 64mm) !important;
    gap: 7mm 8mm !important;
    padding: 10mm 11mm !important;
    align-content: start !important;
    justify-content: center !important;
  }

  .sticker-sheet-page.cards .sticker-card {
    width: 90mm !important;
    height: 64mm !important;
    min-height: 64mm !important;
    max-height: 64mm !important;
    box-sizing: border-box !important;
    padding: 3.5mm 4.5mm !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    overflow: hidden !important;
  }

  .sticker-sheet-page.cards .sticker-card.is-cutout-card {
    border: 1.5px dashed #64748b !important;
    border-radius: 8px !important;
  }

  .sticker-sheet-page.cards .sticker-qr-wrap {
    width: 38mm !important;
    height: 38mm !important;
    min-width: 38mm !important;
    min-height: 38mm !important;
    max-width: 38mm !important;
    max-height: 38mm !important;
    padding: 1.5mm !important;
    box-sizing: border-box !important;
    border-radius: 4px !important;
  }

  .sticker-sheet-page.cards .sticker-student-name {
    font-size: 0.88rem !important;
    font-weight: 800 !important;
    margin-bottom: 1.5mm !important;
    line-height: 1.15 !important;
  }

  .sticker-sheet-page.cards .sticker-creds-box {
    padding: 1.5mm 2.2mm !important;
    font-size: 0.62rem !important;
    line-height: 1.3 !important;
  }

  .sticker-sheet-page.cards .sticker-footer {
    margin-top: 1mm !important;
    padding-top: 0.8mm !important;
    font-size: 0.58rem !important;
    line-height: 1.15 !important;
  }

  .sticker-class-tag {
    background: #e0e7ff !important;
    color: #3730a3 !important;
  }

  .sticker-class-num-badge {
    background: #1e1b4b !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .sticker-student-num {
    color: #3730a3 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .sticker-creds-box {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
  }
}

/* ==========================================================================
   🎮 MINIMIND GAME ARENA MOBILE RESPONSIVE STYLES
   ========================================================================== */
@media (max-width: 640px) {
  .game-arena-wrapper {
    margin: 0 !important;
    border-radius: 0 !important;
    min-height: 100dvh !important;
    border: none !important;
    box-shadow: none !important;
  }

  .game-header-bar {
    padding: 0.5rem 0.6rem !important;
    gap: 0.35rem !important;
  }

  .game-header-bar .btn-sm {
    padding: 0.25rem 0.55rem !important;
    font-size: 0.76rem !important;
  }

  .game-header-bar .badge {
    font-size: 0.72rem !important;
    padding: 0.2rem 0.45rem !important;
  }

  .game-header-bar .hud-pill {
    padding: 0.22rem 0.42rem !important;
    font-size: 0.78rem !important;
    gap: 0.18rem !important;
    border-radius: 8px !important;
    flex-shrink: 0 !important;
  }

  .game-stage {
    padding: 0.6rem 0.5rem !important;
  }

  .hero-actor-emoji {
    font-size: 2.8rem !important;
  }

  .prompt-host-card {
    padding: 0.6rem 1rem !important;
    margin-bottom: 0.7rem !important;
    border-radius: 18px !important;
  }

  .prompt-label-badge {
    font-size: 0.68rem !important;
    letter-spacing: 0.8px !important;
    margin-bottom: 0.25rem !important;
  }

  .prompt-math-text {
    font-size: 2.1rem !important;
  }

  .splitsboom-prompt-card .splitsboom-container {
    transform: scale(0.92) !important;
    margin: 0.1rem auto !important;
  }

  .choose-mechanic-container {
    padding: 0.2rem 0.3rem !important;
    width: 100% !important;
  }

  .choose-options-grid {
    gap: 0.55rem !important;
  }

  .choose-token-btn {
    padding: 0.75rem 0.4rem !important;
    font-size: 1.6rem !important;
    min-height: 62px !important;
    border-radius: 14px !important;
  }

  .choose-token-btn .token-key-badge {
    display: none !important;
  }
}

/* ==========================================================================
   MINIMIND JUNIOR (ONDERBOUW 6-9 JAAR) — DE MAGISCHE ARCHIPEL & EILAND PAD
   ========================================================================== */

.junior-world-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 3rem;
  animation: fadeIn 0.4s ease-out;
}

/* Junior Topbar */
.junior-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  flex-wrap: wrap;
  gap: 1rem;
}

.junior-profile-chip {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.junior-avatar-circle {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #4F46E5, #EC4899);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
  animation: floatBounce 3s ease-in-out infinite;
}

.junior-user-meta {
  display: flex;
  flex-direction: column;
}

.junior-greeting {
  font-size: 1.15rem;
  color: var(--text-primary);
  font-family: var(--font-heading);
}

.junior-rank-badge {
  font-size: 0.78rem;
  color: var(--accent-primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.junior-stats-cluster {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.junior-stat-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  white-space: nowrap;
}

/* Junior Royal Missions Pill (High contrast in both light & dark themes) */
.scroll-pill {
  position: relative;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.26));
  border: 1.5px solid #d97706;
  color: #78350f;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.scroll-pill .pill-lbl {
  font-weight: 800;
  color: #78350f;
  transition: color 0.2s ease;
}

[data-theme="dark"] .scroll-pill {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.35));
  border-color: #f59e0b;
  color: #fef3c7;
}

[data-theme="dark"] .scroll-pill .pill-lbl {
  color: #fef3c7;
}

.scroll-pill:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

.scroll-pill.pulse-gold {
  animation: pulseGoldGlow 2s infinite;
}

@keyframes pulseGoldGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.75);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

.mission-counter-badge {
  background: #d97706;
  color: #ffffff;
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  border-radius: 9999px;
  font-weight: 800;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  line-height: 1;
}

[data-theme="dark"] .mission-counter-badge {
  background: #fbbf24;
  color: #1e1b4b;
}

/* Floating MiniMind Mission Mascot Callout */
.junior-mission-wrapper {
  position: relative;
  display: inline-flex;
}

.mission-mascot-callout {
  position: absolute;
  bottom: calc(100% + 6px);
  right: -6px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  z-index: 40;
  animation: missionMascotFloat 3s ease-in-out infinite;
  pointer-events: auto;
  user-select: none;
}

@keyframes missionMascotFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.mission-mascot-avatar {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mission-mascot-callout:hover .mission-mascot-avatar {
  transform: scale(1.18) rotate(8deg);
}

.mission-mascot-bubble {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #78350f;
  font-family: var(--font-heading, inherit);
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3), 0 2px 6px rgba(0, 0, 0, 0.1);
  border: 1.5px solid #d97706;
  white-space: nowrap;
  position: relative;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.mission-mascot-bubble::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 5px solid #d97706;
}

[data-theme="dark"] .mission-mascot-bubble {
  background: linear-gradient(135deg, #78350f, #92400e);
  color: #fef3c7;
  border-color: #f59e0b;
}

[data-theme="dark"] .mission-mascot-bubble::after {
  border-left-color: #f59e0b;
}

@media (max-width: 600px) {
  .mission-mascot-bubble {
    font-size: 0.68rem;
    padding: 0.2rem 0.45rem;
  }
  .mission-mascot-avatar {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 768px) {
  .junior-topbar {
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    justify-content: center;
  }
  .junior-profile-chip {
    width: 100%;
    justify-content: center;
  }
  .junior-stats-cluster {
    width: 100%;
    justify-content: center;
    gap: 0.4rem;
  }
  .junior-stat-pill {
    padding: 0.3rem 0.65rem;
    font-size: 0.82rem;
  }
  .junior-actions-cluster {
    width: 100%;
    justify-content: center;
  }
}

.streak-pill {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #D97706;
}

.coins-pill {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #4F46E5;
}

.trophy-pill {
  background: rgba(59, 130, 246, 0.15) !important;
  border: 1px solid rgba(59, 130, 246, 0.4) !important;
  color: #2563EB !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.trophy-pill .pill-lbl,
.trophy-pill .pill-val {
  color: #2563EB !important;
}

.trophy-pill:hover {
  background: rgba(59, 130, 246, 0.25) !important;
  transform: translateY(-2px);
}

.junior-actions-cluster {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-junior-mode-toggle {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.82rem;
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-junior-mode-toggle:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary);
}

.btn-junior-logout {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  font-size: 1.2rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.btn-junior-logout:hover {
  transform: scale(1.1);
}

/* ==========================================================================
   ARCHIPELAGO VIEW (OCEAN WORLD)
   ========================================================================== */

.archipelago-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.archipelago-hero-banner {
  background: linear-gradient(135deg, #1E1B4B 0%, #312E81 50%, #4338CA 100%);
  border-radius: 28px;
  padding: 2rem 2.5rem;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 16px 36px rgba(30, 27, 75, 0.35);
  position: relative;
  overflow: hidden;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.archipelago-hero-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.hero-ship-icon {
  font-size: 3.5rem;
  animation: shipSway 4s ease-in-out infinite;
}

.hero-world-title {
  font-size: 2rem;
  margin: 0 0 0.4rem;
  font-weight: 900;
  color: #FFFFFF !important;
  font-family: var(--font-heading);
  letter-spacing: -0.5px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.hero-world-sub {
  margin: 0;
  font-size: 0.95rem;
  color: #E0E7FF !important;
  max-width: 480px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.hero-quick-play-box {
  position: relative;
  z-index: 2;
}

.btn-junior-quick-play {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: #FFFFFF;
  color: #1E1B4B;
  border: none;
  padding: 0.85rem 1.6rem;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-junior-quick-play:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0,0,0,0.3);
}

.btn-play-icon {
  font-size: 1.6rem;
  background: #EEF2FF;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-play-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.btn-play-text strong {
  font-size: 0.95rem;
  color: #1E1B4B;
}

.btn-play-text small {
  font-size: 0.78rem;
  color: #6366F1;
  font-weight: 700;
}

.btn-arrow {
  font-size: 1.4rem;
  color: #4F46E5;
  font-weight: 800;
}

/* ==========================================================================
   MAGICAL ARCHIPELAGO REALM (CELESTIAL FLOATING ISLANDS WORLD)
   ========================================================================== */

.archipelago-realm-stage {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.4) 0%, rgba(30, 27, 75, 0.55) 100%), url('assets/junior/archipelago_world_bg.jpg') center center / cover no-repeat;
  border-radius: 36px;
  padding: 3rem 2rem 4rem;
  position: relative;
  overflow: hidden;
  min-height: 640px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.35);
  border: 2px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
}

.archipelago-sky-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3.5rem 2.5rem;
  padding: 1.5rem 1rem;
  align-items: start;
  justify-items: center;
}

.floating-island-entity {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 320px;
  width: 100%;
}

.floating-island-entity:hover {
  transform: translateY(-12px);
}

/* Staggered gentle bobbing animations */
@keyframes floatIsland1 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(0.8deg); }
}
@keyframes floatIsland2 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(-1deg); }
}
@keyframes floatIsland3 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(0.6deg); }
}
@keyframes floatIsland4 {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(-0.8deg); }
}

.float-island-anim-1 .island-landmass-wrap { animation: floatIsland1 4.2s ease-in-out infinite; }
.float-island-anim-2 .island-landmass-wrap { animation: floatIsland2 4.8s ease-in-out infinite 0.6s; }
.float-island-anim-3 .island-landmass-wrap { animation: floatIsland3 4.5s ease-in-out infinite 1.2s; }
.float-island-anim-4 .island-landmass-wrap { animation: floatIsland4 5.0s ease-in-out infinite 1.8s; }

/* 3D Floating Landmass */
.island-landmass-wrap {
  width: 250px;
  height: 250px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 20px 25px rgba(0,0,0,0.4));
  transition: filter 0.3s, transform 0.3s;
}

.floating-island-entity:hover .island-landmass-wrap {
  filter: drop-shadow(0 28px 38px rgba(99, 102, 241, 0.65)) drop-shadow(0 0 25px var(--island-accent));
}

.floating-island-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3));
}

.island-sky-halo {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  opacity: 0.25;
  filter: blur(30px);
  pointer-events: none;
  transition: opacity 0.3s;
}

.floating-island-entity:hover .island-sky-halo {
  opacity: 0.55;
}

.island-cloud-shadow {
  position: absolute;
  bottom: -15px;
  width: 160px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,0,0,0.35) 0%, transparent 70%);
  filter: blur(8px);
}

/* Floating Category Badge */
.island-sky-badge-wrap {
  margin-bottom: 0.4rem;
  z-index: 5;
}

.island-sky-badge {
  font-size: 0.8rem;
  font-weight: 800;
  color: #FFFFFF;
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border: 1.5px solid rgba(255,255,255,0.4);
  backdrop-filter: blur(4px);
}

/* Island Info & Glassmorphic Progress Capsule */
.island-sky-infobox {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  width: 100%;
  z-index: 5;
}

.island-sky-title {
  font-size: 1.35rem;
  margin: 0;
  font-weight: 900;
  color: #FFFFFF !important;
  font-family: var(--font-heading);
  text-shadow: 0 2px 8px rgba(0,0,0,0.6), 0 0 16px rgba(0,0,0,0.4);
  letter-spacing: -0.3px;
}

.island-sky-stat-capsule {
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 0.6rem 1rem;
  width: 90%;
  max-width: 240px;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform 0.2s, border-color 0.2s;
}

.floating-island-entity:hover .island-sky-stat-capsule {
  transform: scale(1.04);
  border-color: rgba(255, 255, 255, 0.45);
}

.sky-stars-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.sky-star-icon {
  font-size: 1rem;
}

.sky-star-text {
  font-size: 0.9rem;
  font-weight: 800;
  color: #FBBF24;
}

.sky-stars-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  overflow: hidden;
}

.sky-stars-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s ease;
}

.sky-pill-alert {
  font-size: 0.72rem;
  font-weight: 800;
  color: #EF4444;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  animation: pulseGlow 2s infinite;
}

.sky-pill-gold {
  font-size: 0.72rem;
  font-weight: 800;
  color: #F59E0B;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.sky-pill-status {
  font-size: 0.72rem;
  font-weight: 700;
  color: #A5B4FC;
}

/* ==========================================================================
   ISLAND LEVEL PATH VIEW (DETAILED LEVEL ROUTE)
   ========================================================================== */

.island-detail-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.island-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1rem 1.75rem;
  border-radius: 24px;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn-junior-back-ocean {
  background: #EEF2FF;
  color: #4F46E5;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.65rem 1.3rem;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-junior-back-ocean:hover {
  background: #E0E7FF;
  transform: translateX(-3px);
}

.island-header-center {
  text-align: center;
}

.island-detail-title {
  font-size: 1.6rem;
  margin: 0.2rem 0 0;
  color: var(--text-primary);
  font-family: var(--font-heading);
}

/* Trail Canvas & SVG */
.island-path-viewport {
  background: radial-gradient(circle at 50% 20%, rgba(16, 185, 129, 0.15), transparent 70%), var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 32px;
  padding: 3rem 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.06);
}

.island-trail-canvas {
  position: relative;
  min-height: 520px;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

.trail-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1 !important;
  pointer-events: none;
}

.island-waypoints-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 520px;
  z-index: 10 !important;
  pointer-events: auto;
}

/* Individual Level Node (100% Solid Opaque Background) */
.island-waypoint-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
  z-index: 20 !important;
  user-select: none;
}

.island-waypoint-node:hover {
  transform: translate(-50%, -55%) scale(1.12);
  z-index: 45 !important;
}

.island-waypoint-node:active {
  transform: translate(-50%, -48%) scale(1.04);
}

.island-waypoint-node.node-locked {
  cursor: not-allowed;
  opacity: 0.75;
}

.island-waypoint-node.node-locked:hover {
  transform: translate(-50%, -50%) scale(1.02);
}

/* Curved Stars Arc */
.node-stars-arc {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 4px;
  margin-bottom: 2px;
  z-index: 15;
  pointer-events: none;
}

.star-arc-item {
  font-size: 1.35rem;
  line-height: 1;
  transition: all 0.2s ease;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.85));
}

.star-arc-item.star-1 {
  transform: rotate(-24deg) translateY(3px);
}

.star-arc-item.star-2 {
  transform: rotate(0deg) translateY(-5px);
  font-size: 1.6rem;
}

.star-arc-item.star-3 {
  transform: rotate(24deg) translateY(3px);
}

.star-arc-item.star-filled {
  color: #FBBF24;
  text-shadow: 0 0 10px rgba(251, 191, 36, 1), 0 2px 6px rgba(0,0,0,0.95);
}

.star-arc-item.star-empty {
  color: rgba(255, 255, 255, 0.35);
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* 3D Stone Wrapper & Progress SVG */
.node-stone-wrapper {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible !important;
}

.node-progress-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 96px;
  height: 96px;
  transform: rotate(-90deg);
  pointer-events: none;
  z-index: 5;
}

.progress-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 5;
}

.progress-fill {
  fill: none;
  stroke: #3B82F6;
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease;
}

.progress-fill.progress-gold {
  stroke: #F59E0B;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.75));
}

.progress-fill.progress-alarm {
  stroke: #EF4444;
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.75));
}

/* 3D Stepping Stone Disc Body */
.node-stone-disc {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5), 0 3px 8px rgba(0, 0, 0, 0.3);
  border: 3px solid rgba(255, 255, 255, 0.8);
  background: #0F172A;
  transition: all 0.25s ease;
  z-index: 2;
}

.stone-disc-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
  transform: scale(1.18);
}

.node-stone-disc.is-locked {
  filter: grayscale(0.5) brightness(0.85);
  border-color: rgba(148, 163, 184, 0.6);
}

.node-stone-disc.is-gold {
  border-color: #FDE68A;
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.55), 0 10px 22px rgba(0, 0, 0, 0.45);
}

.node-stone-disc.is-due {
  border-color: #EF4444;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.65);
  animation: pulseDueRing 2s infinite;
}

/* Badges on Stone Wrapper (High Contrast Shields Floating Above Progress Ring) */
.stone-lock-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.75);
  z-index: 25 !important;
  pointer-events: none;
}

.stone-alarm-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  background: linear-gradient(135deg, #EF4444, #DC2626);
  border: 2.5px solid #FFFFFF;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.95rem;
  color: #FFFFFF;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.8), 0 2px 5px rgba(0, 0, 0, 0.5);
  z-index: 25 !important;
  pointer-events: none;
  animation: floatBounce 2s infinite;
}

.stone-alarm-badge small {
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.stone-gold-sparkle {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  border: 2.5px solid #FEF3C7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.85), 0 2px 6px rgba(0, 0, 0, 0.45);
  z-index: 25 !important;
  pointer-events: none;
  animation: pulseGlow 2s infinite;
}

.stone-new-badge {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  font-size: 0.64rem;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 10px;
  border: 2px solid #FFFFFF;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.7), 0 0 10px rgba(16, 185, 129, 0.6);
  letter-spacing: 0.5px;
  z-index: 25 !important;
  pointer-events: none;
  white-space: nowrap;
}

/* Compact Title Pill (Up to 2 lines) */
.node-title-pill {
  margin-top: 6px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  padding: 0.25rem 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  width: max-content;
  max-width: 155px;
  min-width: 80px;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.island-waypoint-node:hover .node-title-pill {
  background: rgba(15, 23, 42, 0.98);
  border-color: #6366F1;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}

.node-pill-index {
  background: #6366F1;
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 900;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.node-gold .node-pill-index {
  background: #F59E0B;
}

.node-due .node-pill-index {
  background: #EF4444;
}

.node-pill-title {
  font-size: 0.74rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.15;
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  white-space: normal;
}

/* Mascot Companion (Floating centered above active waypoint) */
.mascot-trail-companion {
  position: absolute;
  top: -104px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 35;
  pointer-events: none;
  animation: mascotFloat 3s ease-in-out infinite;
}

.mascot-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.55));
}

.mascot-bubble {
  background: #FFFFFF;
  color: #1E1B4B;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.38rem 0.85rem;
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  border: 2px solid #6366F1;
  position: relative;
  margin-bottom: 5px;
  text-align: center;
}

.mascot-bubble::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid #6366F1;
}

@keyframes mascotFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-10px); }
}

.is-mascot-focus {
  transform: translate(-50%, -50%) scale(1.06);
}

.is-mascot-focus .node-stone-disc {
  border-color: #FBBF24 !important;
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.7), 0 10px 22px rgba(0, 0, 0, 0.45) !important;
}

/* Floating Royal Homework Companion */
.homework-trail-companion {
  position: absolute;
  top: -58px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 25;
  pointer-events: none;
  animation: floatActor 3s ease-in-out infinite;
}

.homework-pill {
  background: linear-gradient(135deg, #FBBF24, #D97706);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  border: 1px solid #FDE68A;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.4);
  white-space: nowrap;
  margin-bottom: 2px;
}

.homework-crown-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #312E81, #1E1B4B);
  border: 2px solid #FBBF24;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

@keyframes mascotBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

@keyframes pulseDueRing {
  0%, 100% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 24px rgba(239, 68, 68, 0.85); }
}

@keyframes pulseGoldRing {
  0%, 100% { box-shadow: 0 0 12px rgba(245, 158, 11, 0.5); }
  50% { box-shadow: 0 0 28px rgba(245, 158, 11, 0.9); }
}

/* Island Pirate Mission Banner */
.island-pirate-banner {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.94), rgba(15, 23, 42, 0.96));
  border: 2px solid #FBBF24;
  border-radius: 18px;
  padding: 0.9rem 1.25rem;
  margin: 0.8rem 1rem 1.2rem 1rem;
  max-width: 580px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  position: relative;
  box-sizing: border-box;
}

@media (min-width: 641px) {
  .island-pirate-banner {
    margin-left: auto;
    margin-right: auto;
  }
}

.pirate-banner-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1 1 auto;
}

.pirate-banner-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
  animation: floatActor 3s ease-in-out infinite;
  flex-shrink: 0;
}

.pirate-banner-body {
  text-align: left;
  min-width: 0;
}

.pirate-banner-btn {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  border: 1px solid #FDE68A;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.84rem;
  padding: 0.6rem 1.1rem;
  white-space: nowrap;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.pirate-banner-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.6);
}

@media (max-width: 640px) {
  .junior-topbar {
    padding: 0.6rem 1rem;
  }
  .archipelago-hero-banner {
    padding: 1.5rem;
  }
  .hero-world-title {
    font-size: 1.5rem;
  }
  .island-pirate-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 0.85rem 1rem;
    gap: 0.75rem;
    margin: 0.6rem 0.75rem 1rem 0.75rem;
  }
  .pirate-banner-btn {
    width: 100%;
    text-align: center;
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
  }
  .island-trail-canvas {
    min-height: 460px;
  }
  .node-stone-wrapper {
    width: 84px;
    height: 84px;
  }
  .node-progress-svg {
    width: 84px;
    height: 84px;
  }
  .node-stone-disc {
    width: 72px;
    height: 72px;
  }
  .node-title-pill {
    max-width: 140px;
    padding: 0.2rem 0.55rem;
  }
  .node-pill-title {
    font-size: 0.72rem;
  }
}

/* ==========================================================================
   SUBITIZING (GETALBEELDEN) VISUAL FLASHCARD COMPONENTS
   ========================================================================== */

.subitizing-dice-container {
  display: flex;
  justify-content: center;
  margin: 0.5rem auto;
}

.subitizing-dice-face {
  width: 90px;
  height: 90px;
  background: #FFFFFF;
  border-radius: 20px;
  border: 3px solid #E2E8F0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18), inset 0 -4px 0 #CBD5E1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 10px;
  gap: 4px;
}

.dice-pip.filled {
  background: #1E1B4B;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  margin: auto;
  box-shadow: inset 0 2px 2px rgba(0,0,0,0.4);
}

.dice-pip.empty {
  visibility: hidden;
}

/* Ten Frame (Tienveld / Eierdoos) */
.subitizing-ten-frame-container {
  display: flex;
  justify-content: center;
  margin: 0.5rem auto;
}

.ten-frame-grid {
  display: grid;
  grid-template-columns: repeat(5, 36px);
  grid-template-rows: repeat(2, 36px);
  gap: 4px;
  background: #FFFFFF;
  padding: 8px;
  border-radius: 16px;
  border: 3px solid #3B82F6;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
  max-width: 100%;
  box-sizing: border-box;
}

.ten-frame-grid.twenty-frame {
  grid-template-columns: repeat(10, 30px);
  gap: 3px;
  padding: 6px;
}

@media (max-width: 440px) {
  .ten-frame-grid.twenty-frame {
    grid-template-columns: repeat(10, 24px);
    gap: 2px;
    padding: 4px;
  }
  .ten-frame-grid.twenty-frame .ten-frame-slot {
    border-radius: 5px;
  }
  .ten-frame-grid.twenty-frame .ten-frame-counter {
    width: 20px;
    height: 20px;
  }
}

.ten-frame-slot {
  background: #F1F5F9;
  border: 1px dashed #CBD5E1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ten-frame-counter {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  animation: floatBounce 2s ease-in-out infinite;
}

.counter-red {
  background: radial-gradient(circle at 35% 35%, #F87171, #DC2626);
}

.counter-blue {
  background: radial-gradient(circle at 35% 35%, #60A5FA, #2563EB);
}

/* Fruit Cluster */
.subitizing-fruit-container {
  display: flex;
  justify-content: center;
  margin: 0.5rem auto;
}

.fruit-cluster {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  max-width: 260px;
  background: rgba(255,255,255,0.12);
  padding: 0.8rem 1.2rem;
  border-radius: 20px;
  border: 2px dashed rgba(255,255,255,0.3);
}

.fruit-token {
  font-size: 2.2rem;
  animation: floatBounce 3s ease-in-out infinite;
  display: inline-block;
}

/* Double Dice (7 to 12) */
.subitizing-double-dice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.subitizing-dice-plus {
  font-size: 2rem;
  font-weight: 800;
  color: #E2E8F0;
  line-height: 1;
}

/* Finger Patterns (1 to 10) with 5-Structure */
.subitizing-fingers-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0.5rem auto;
}

.hands-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
}

.hand-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  padding: 8px 12px 6px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.hand-svg {
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.25));
  transition: transform 0.2s ease;
}

.hand-svg:hover {
  transform: scale(1.05);
}

.hand-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: #FEF08A;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 10px;
  border-radius: 999px;
}

/* Rekenrek (1 to 20 beads: 5 red, 5 white per rod) */
.subitizing-rekenrek-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0.5rem auto;
}

.rekenrek-frame {
  display: flex;
  background: linear-gradient(180deg, #92400e 0%, #78350f 100%);
  border: 3px solid #451a03;
  border-radius: 12px;
  padding: 8px 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.2);
  width: 310px;
  max-width: 95%;
  box-sizing: border-box;
}

.rekenrek-post {
  width: 16px;
  background: #5c2807;
  border-radius: 4px;
  flex-shrink: 0;
}

.rekenrek-rods-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 8px;
}

.rekenrek-rod-row {
  position: relative;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rekenrek-wire {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  background: linear-gradient(180deg, #ffffff, #94a3b8);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.rekenrek-beads-group {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 1.5px;
}

.rekenrek-separator-gap {
  flex: 1;
  min-width: 24px;
}

.rekenrek-bead {
  width: 20px;
  height: 30px;
  border-radius: 9px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(0, 0, 0, 0.3);
}

.rekenrek-bead.bead-red {
  background: radial-gradient(circle at 35% 30%, #ef4444, #b91c1c);
}

.rekenrek-bead.bead-white {
  background: radial-gradient(circle at 35% 30%, #ffffff, #cbd5e1);
}

.rekenrek-beads-group.parked-group .rekenrek-bead {
  opacity: 0.28;
  filter: saturate(0.2) brightness(1.15);
  box-shadow: none;
  border-color: rgba(148, 163, 184, 0.4);
}

.rekenrek-beads-group.active-group .rekenrek-bead {
  opacity: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.rekenrek-count-badge {
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary, #334155);
  display: flex;
  align-items: center;
  gap: 8px;
}

[data-theme="dark"] .rekenrek-count-badge {
  color: #cbd5e1;
}

.bead-indicator {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.bead-indicator.red-dot { background: #ef4444; }
.bead-indicator.white-dot { background: #ffffff; border: 1px solid #94a3b8; }

/* ==========================================================================
   MATH TOUCH NUMPAD & RESPONSIVE SPLIT-SCREEN ARENA
   ========================================================================== */
.math-study-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

/* Responsive Orientation Split-Screen:
   In Landscape: Prompt visual on LEFT, Touch Numpad on RIGHT.
   In Portrait: Stacked vertically. */
@media (orientation: landscape) and (min-width: 560px) {
  .math-study-split-layout {
    display: flex;
    flex-direction: row !important;
    align-items: stretch !important;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 1050px;
    margin: 0 auto;
  }
  .math-study-split-layout .math-split-left {
    flex: 1.15;
    display: flex;
    flex-direction: column;
    align-items: stretch !important;
    justify-content: stretch !important;
    min-width: 0;
  }
  .math-study-split-layout .math-split-right {
    flex: 0.85;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 280px;
    max-width: 420px;
  }
  .math-study-split-layout .math-split-left .card-perspective {
    height: 100% !important;
    min-height: 350px !important;
    margin-bottom: 0 !important;
    display: flex;
    flex-direction: column;
  }
  .math-study-split-layout .math-split-left .flashcard-3d {
    height: 100% !important;
    min-height: 350px !important;
    flex: 1;
  }
  .math-study-split-layout .math-split-right .glass-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
    width: 100%;
    display: flex;
    justify-content: center;
  }
}

/* Math & Subitizing Card Sizing in Portrait & General Modes */
body.view-study.math-mode .card-perspective,
body.view-study.math-mode .flashcard-3d {
  min-height: 300px !important;
}

@media (min-height: 650px) {
  body.view-study.math-mode .card-perspective,
  body.view-study.math-mode .flashcard-3d {
    min-height: 340px !important;
  }
}

@media (min-height: 850px) {
  body.view-study.math-mode .card-perspective,
  body.view-study.math-mode .flashcard-3d {
    min-height: 380px !important;
  }
}

.math-numpad-container {
  background: var(--bg-card, #ffffff);
  border: 2px solid var(--border-color, #cbd5e1);
  border-radius: 24px;
  padding: 1.1rem 1rem;
  box-shadow: var(--card-shadow, 0 10px 30px rgba(0, 0, 0, 0.08));
  backdrop-filter: blur(16px);
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
}

[data-theme="dark"] .math-numpad-container {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.math-numpad-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  margin-bottom: 0.75rem;
  text-align: center;
  letter-spacing: -0.01em;
}

[data-theme="dark"] .math-numpad-title {
  color: #f1f5f9;
}

.math-numpad-grid {
  display: grid;
  gap: 8px;
  width: 100%;
}

.math-numpad-grid.grid-1-to-10 {
  grid-template-columns: repeat(5, 1fr);
}

.math-numpad-grid.grid-1-to-20 {
  grid-template-columns: repeat(5, 1fr);
}

.math-numpad-grid.grid-standard {
  grid-template-columns: repeat(3, 1fr);
}

.numpad-btn {
  appearance: none;
  border: none;
  background: var(--bg-secondary, #ffffff);
  color: var(--text-primary, #0f172a);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  border-radius: 14px;
  padding: 0.7rem 0.4rem;
  border: 1.5px solid var(--border-color, #cbd5e1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.12s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
}

[data-theme="dark"] .numpad-btn {
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.02) 100%), #1e293b;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.numpad-btn:hover {
  background: #f1f5f9;
  border-color: var(--accent-primary, #4f46e5);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.22);
}

[data-theme="dark"] .numpad-btn:hover {
  background: #334155;
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 6px 14px rgba(99, 102, 241, 0.35);
}

.numpad-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  background: #e2e8f0;
}

[data-theme="dark"] .numpad-btn:active {
  background: #475569;
}

.numpad-btn.btn-action {
  background: #4f46e5;
  border-color: #6366f1;
  color: #ffffff;
}

.numpad-btn.btn-action:hover {
  background: #4338ca;
}

/* Junior Royal Scroll & Homework Mission Badges */
.pulse-gold {
  animation: pulseGold 2s infinite ease-in-out;
}

@keyframes pulseGold {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 15px 4px rgba(245, 158, 11, 0.4);
    transform: scale(1.04);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    transform: scale(1);
  }
}

.node-homework-flag {
  pointer-events: none;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.5));
}

/* ==========================================================================
   Trophy Cabinet & Badges Grid Scroll Container (No Squishing)
   ========================================================================== */
.trophy-cabinet-dialog {
  width: 100%;
  max-width: 880px;
  max-height: 85vh;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .trophy-cabinet-dialog {
    max-height: 92vh;
    height: auto;
    padding: 1.1rem 1rem !important;
  }
}

.trophy-badges-scroll-container {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-content: start;
  align-items: start;
  grid-auto-rows: min-content;
  gap: 1.1rem;
  padding: 0.3rem 0.6rem 0.8rem 0.2rem;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-primary, #6366f1) rgba(255, 255, 255, 0.08);
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 680px) {
  .trophy-badges-scroll-container {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }
}

.trophy-badges-scroll-container::-webkit-scrollbar {
  width: 8px;
}

.trophy-badges-scroll-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.trophy-badges-scroll-container::-webkit-scrollbar-thumb {
  background: var(--accent-primary, #6366f1);
  border-radius: 8px;
  border: 2px solid rgba(0, 0, 0, 0.2);
}

.trophy-badges-scroll-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover, #4f46e5);
}

.trophy-badge-card {
  background: var(--bg-card, #FFFFFF);
  border: 1.5px solid var(--border-color, rgba(0, 0, 0, 0.1));
  color: var(--text-primary);
  border-radius: 16px !important;
  padding: 1.25rem 1.35rem !important;
  position: relative !important;
  overflow: hidden !important;
  min-height: 180px;
  height: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.trophy-badge-card.unlocked {
  background: var(--bg-card, #FFFFFF);
  opacity: 1;
}

.trophy-badge-card.locked {
  background: rgba(148, 163, 184, 0.08) !important;
  border-color: var(--border-color, rgba(0, 0, 0, 0.1)) !important;
  opacity: 0.72;
  box-shadow: none;
}

[data-theme="dark"] .trophy-badge-card {
  background: var(--bg-card, #1e293b);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .trophy-badge-card.locked {
  background: rgba(30, 41, 59, 0.45) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* ==========================================================================
   Latin Multi-Modal Question Types & Tweetraps UI Styles
   ========================================================================== */
.latin-pill-question-container {
  background: var(--bg-card, #FFFFFF);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  padding: 1.1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  margin-bottom: 0.8rem;
}

.latin-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-primary);
  margin-bottom: 0.45rem;
}

.latin-pill-grid {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.latin-pill-btn {
  background: var(--bg-tertiary, rgba(241, 245, 249, 0.9));
  border: 1.5px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.42rem 0.75rem;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.latin-pill-btn:hover {
  border-color: var(--accent-primary);
  transform: translateY(-1px);
  background: rgba(99, 102, 241, 0.08);
}

.latin-pill-btn.active {
  background: var(--accent-primary) !important;
  color: #FFFFFF !important;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

@keyframes latinFadeSlide {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.latin-step-2-wrapper {
  animation: latinFadeSlide 0.25s ease forwards;
}

/* ==========================================================================
   Student Course Area Progress Tiles Grid
   - Desktop (>1024px): 1 single line (Tegel 1 is 2fr, Tegel 2 & 3 are 1fr each)
   - Tablet (641px - 1024px): Tegel 1 full width, Tegels 2 & 3 side by side (1fr 1fr)
   - Mobile (<=640px): 1 column stacked cleanly
   ========================================================================== */
.student-course-stats-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.course-status-hero {
  grid-column: auto;
}

@media (max-width: 1024px) {
  .student-course-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .course-status-hero {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .student-course-stats-grid {
    grid-template-columns: 1fr;
  }
  .course-status-hero {
    grid-column: 1 / -1;
  }
}

/* ==========================================================================
   Offline Status Indicator Banner & Synchronization UI
   ========================================================================== */
.offline-status-banner {
  width: 100%;
  max-width: 1200px;
  margin: 0.5rem auto 1rem auto;
  padding: 0.65rem 1.25rem;
  border-radius: 14px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.15);
  backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.offline-status-banner.hidden {
  display: none;
  opacity: 0;
  transform: translateY(-8px);
}

.offline-status-banner.visible {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(217, 119, 6, 0.16));
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #b45309;
}

[data-theme="dark"] .offline-status-banner.visible {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.22));
  border-color: rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}

.offline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.8);
  animation: offlinePulse 2s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes offlinePulse {
  0%, 100% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
    box-shadow: 0 0 14px rgba(245, 158, 11, 1);
  }
}

.offline-text {
  line-height: 1.4;
}

.offline-text strong {
  font-weight: 700;
}

/* ==========================================================================
   Personal MiniMind Brain Syncing Indicators
   ========================================================================== */
.minimind-brain-syncing-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.1rem 1.4rem;
  margin-bottom: 1.5rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
  backdrop-filter: blur(12px);
  animation: fadeIn 0.4s ease-out;
}

.syncing-icon-wrapper {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.3));
  border: 1px solid rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.syncing-brain-icon {
  font-size: 1.85rem;
  animation: brainFloat 2.5s ease-in-out infinite;
}

.syncing-sparkle {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 1rem;
  animation: sparkleTwinkle 1.8s ease-in-out infinite;
}

@keyframes brainFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.06); }
}

@keyframes sparkleTwinkle {
  0%, 100% { opacity: 0.4; transform: rotate(0deg) scale(0.8); }
  50% { opacity: 1; transform: rotate(180deg) scale(1.2); }
}

.syncing-content {
  flex: 1;
  min-width: 0;
}

.syncing-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-primary);
  font-family: var(--font-heading);
  margin-bottom: 0.2rem;
}

.syncing-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
  line-height: 1.35;
}

.syncing-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.2);
  overflow: hidden;
  position: relative;
}

.syncing-progress-shimmer {
  width: 40%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
  animation: indeterminateShimmer 1.6s infinite ease-in-out;
}

@keyframes indeterminateShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* Junior Sync Banner */
.junior-sync-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 0.85rem 1.4rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.22), rgba(236, 72, 153, 0.22));
  border: 2px solid rgba(129, 140, 248, 0.45);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.25);
  backdrop-filter: blur(14px);
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  animation: fadeIn 0.4s ease-out;
}

.junior-sync-icon {
  font-size: 1.5rem;
  animation: brainFloat 2.5s infinite ease-in-out;
}

.junior-sync-text {
  line-height: 1.4;
}

.junior-sync-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #a855f7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* =========================================================================
 * App Version Tag & PWA Update Banner
 * ========================================================================= */
.app-version-tag {
  font-size: 0.65rem;
  color: var(--text-muted, #94a3b8);
  opacity: 0.5;
  font-family: monospace;
  margin-left: 0.4rem;
  cursor: pointer;
  user-select: none;
  display: inline-block;
  vertical-align: middle;
  transition: opacity 0.2s ease;
}

.app-version-tag:hover {
  opacity: 0.85;
}

.app-update-banner {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--accent-primary, #6366f1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(99, 102, 241, 0.25);
  border-radius: 12px;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-primary, #fff);
  font-size: 0.9rem;
  animation: fadeIn 0.3s ease-out;
}

.app-update-banner.hidden {
  display: none !important;
}

/* ==========================================================================
   LOCKED COURSE & JUNIOR ARCHIPELAGO SLEEPING ISLAND STYLES
   ========================================================================== */

/* Fully Locked Island Entity in Junior Archipelago */
.floating-island-entity.island-locked {
  filter: grayscale(1) contrast(0.85) brightness(0.82);
  opacity: 0.78;
  cursor: pointer;
  transition: all 0.3s ease;
}

.floating-island-entity.island-locked:hover {
  transform: translateY(-5px);
  filter: grayscale(0.82) contrast(0.9) brightness(0.9);
  opacity: 0.92;
}

.floating-island-entity.island-locked .island-sky-halo {
  background: radial-gradient(circle, rgba(148, 163, 184, 0.35) 0%, transparent 70%) !important;
  opacity: 0.3 !important;
}

.island-sky-badge.island-locked-badge {
  background: linear-gradient(135deg, #475569, #64748b) !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.island-locked-overlay {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  background: rgba(15, 23, 42, 0.82);
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  z-index: 5;
  transition: transform 0.2s ease;
}

.floating-island-entity.island-locked:hover .island-locked-overlay {
  transform: translate(-50%, -50%) scale(1.1);
  border-color: rgba(255, 255, 255, 0.7);
}

.island-lock-symbol {
  font-size: 1.6rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.sky-pill-locked {
  font-size: 0.75rem;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  display: inline-block;
}

/* Island Detail Sleeping Announcement */
.island-locked-announcement {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.1rem 1.6rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(71, 85, 105, 0.25), rgba(15, 23, 42, 0.5));
  border: 1.5px solid rgba(148, 163, 184, 0.35);
  backdrop-filter: blur(10px);
  margin-bottom: 0.5rem;
}

/* Regular Student View Locked Course Styles */
.course-tab-locked {
  opacity: 0.75 !important;
  border: 2px dashed rgba(148, 163, 184, 0.45) !important;
  background: rgba(30, 41, 59, 0.35) !important;
}

.course-tab-locked:hover {
  opacity: 0.95 !important;
  border-color: rgba(148, 163, 184, 0.7) !important;
}

.course-locked-hero {
  border-left: 4px solid #64748b !important;
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.12), rgba(30, 41, 59, 0.05)) !important;
}




