*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #eaecf0;
  --sidebar-bg: #ffffff;
  --card-bg: #ffffff;
  --primary: #3b3fc4;
  --primary-dark: #2e31a8;
  --primary-light: #eef0ff;
  --primary-mid: #6366f1;
  --accent-orange: #f59e0b;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-pink: #ec4899;
  --text-900: #0f1117;
  --text-700: #374151;
  --text-500: #6b7280;
  --text-400: #9ca3af;
  --border: #e5e7eb;
  --input-bg: #fafafa;
  --toast-bg: #0f1117;
  --streak-bg: linear-gradient(135deg, #fff7ed, #fff);
  color-scheme: light;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-primary: 0 4px 20px rgba(59, 63, 196, 0.28);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --sidebar-w: 260px;
  --font-display: "Plus Jakarta Sans", sans-serif;
  --font-body: "DM Sans", sans-serif;
}

html,
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-700);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 99px;
}

/* ─── Layout ────────────────────────────────────────────── */
#app-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ───────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
}
.sidebar-logo-text {
  line-height: 1.1;
}
.sidebar-logo-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 17px;
  color: var(--text-900);
  letter-spacing: -0.3px;
}
.sidebar-logo-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-400);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-500);
  cursor: pointer;
  transition: all 0.18s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  text-decoration: none;
}
.nav-item:hover {
  background: var(--bg);
  color: var(--text-900);
}
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}
.nav-item svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.sidebar-streak {
  background: linear-gradient(135deg, #1e2a78 0%, #3b3fc4 100%);
  border-radius: var(--radius-lg);
  padding: 16px;
  color: white;
  margin-top: 12px;
}
.streak-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.streak-number {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
}
.streak-days {
  font-size: 16px;
  font-weight: 600;
  opacity: 0.85;
}
.streak-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 99px;
  margin-top: 12px;
  overflow: hidden;
}
.streak-bar-fill {
  height: 100%;
  background: var(--accent-orange);
  border-radius: 99px;
  width: 60%;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-400);
  cursor: pointer;
  transition: all 0.18s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  margin-top: 8px;
}
.sidebar-logout:hover {
  color: var(--accent-red);
  background: #fee2e2;
}

/* ─── Main Content ───────────────────────────────────────── */
#main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  padding: 36px 40px;
  overflow-x: hidden;
}

/* ─── Page animations ───────────────────────────────────── */
.page {
  animation: pageFadeIn 0.28s ease;
}
@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}
.card:hover {
  box-shadow: var(--shadow-md);
}
.card-interactive {
  cursor: pointer;
}
.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ─── Hero Banner ───────────────────────────────────────── */
.hero-banner {
  background: linear-gradient(135deg, #1e2a78 0%, #3b3fc4 60%, #5b60e0 100%);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  color: white;
  position: relative;
  overflow: hidden;
}
.hero-banner::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -20px;
  width: 260px;
  height: 260px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}
.hero-banner-icon {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.15;
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  border-radius: 99px;
  transition: all 0.18s;
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--primary);
  color: white;
  padding: 12px 28px;
  font-size: 14px;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-white {
  background: white;
  color: var(--primary);
  padding: 12px 28px;
  font-size: 14px;
}
.btn-white:hover {
  background: #f5f5ff;
  transform: translateY(-1px);
}

.btn-orange {
  background: var(--accent-orange);
  color: white;
  padding: 12px 28px;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}
.btn-orange:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  padding: 10px 20px;
  font-size: 14px;
  border: 1.5px solid var(--primary-light);
}
.btn-ghost:hover {
  background: var(--primary-light);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 13px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  flex-shrink: 0;
}

/* ─── Stat chips ─────────────────────────────────────────── */
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-700);
}
.stat-chip svg {
  width: 16px;
  height: 16px;
}

/* ─── Section heading ───────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-900);
}
.section-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
}
.section-link:hover {
  text-decoration: underline;
}

/* ─── Progress bar ──────────────────────────────────────── */
.progress-track {
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  background: linear-gradient(90deg, var(--primary), var(--primary-mid));
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
}

/* ─── Badge/pill ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
}
.badge-easy {
  background: #d1fae5;
  color: #065f46;
}
.badge-medium {
  background: #fef3c7;
  color: #92400e;
}
.badge-hard {
  background: #fee2e2;
  color: #991b1b;
}
.badge-new {
  background: var(--primary-light);
  color: var(--primary);
}
.badge-done {
  background: #d1fae5;
  color: #065f46;
}
.badge-progress {
  background: #fef3c7;
  color: #92400e;
}

/* ─── Inputs ─────────────────────────────────────────────── */
.bibo-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-900);
  background: var(--input-bg);
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.bibo-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 63, 196, 0.1);
  background: var(--card-bg);
}
.bibo-input::placeholder {
  color: var(--text-400);
}

.input-group {
  position: relative;
}
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-400);
  pointer-events: none;
}
.input-group .bibo-input {
  padding-left: 42px;
}

/* ─── Chat ───────────────────────────────────────────────── */
.chat-bubble-ai {
  background: var(--card-bg);
  border-radius: 18px 18px 18px 4px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.chat-bubble-user {
  background: var(--primary);
  color: white;
  border-radius: 18px 18px 4px 18px;
}

/* ─── Toast ─────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--toast-bg);
  color: white;
  padding: 12px 24px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  white-space: nowrap;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Spinner ───────────────────────────────────────────── */
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── Typing dots ───────────────────────────────────────── */
.typing-dot {
  width: 7px;
  height: 7px;
  background: var(--primary-mid);
  border-radius: 50%;
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes typingBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-7px);
    opacity: 1;
  }
}

/* ─── Shake ─────────────────────────────────────────────── */
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}
.shake {
  animation: shake 0.4s;
}

/* ─── Auth pages ─────────────────────────────────────────── */
#app-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  position: relative;      
  overflow: hidden;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

/* ─── Subject color themes ──────────────────────────────── */
.sub-math {
  --sc: #3b3fc4;
  --sp: #eef0ff;
}
.sub-science {
  --sc: #0d9488;
  --sp: #ccfbf1;
}
.sub-reading {
  --sc: #f59e0b;
  --sp: #fef3c7;
}
.sub-filipino {
  --sc: #ef4444;
  --sp: #fee2e2;
}
.sub-arts {
  --sc: #ec4899;
  --sp: #fce7f3;
}
.sub-values {
  --sc: #10b981;
  --sp: #d1fae5;
}

/* ─── Section dots (lesson) ─────────────────────────────── */
.section-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.2s;
}
.section-dot.active {
  background: var(--primary);
  transform: scale(1.3);
}
.section-dot.done {
  background: var(--accent-green);
}

/* ─── Step dots (register) ──────────────────────────────── */
.step-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-400);
  transition: all 0.3s;
}
.step-dot.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 0 4px rgba(59, 63, 196, 0.18);
}
.step-dot.done {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: white;
}

/* ─── Quiz option cards ─────────────────────────────────── */
.quiz-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.18s;
  background: var(--card-bg);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-700);
}
.quiz-option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.quiz-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.quiz-option.correct {
  border-color: var(--accent-green);
  background: #d1fae5;
  color: #065f46;
}
.quiz-option.wrong {
  border-color: var(--accent-red);
  background: #fee2e2;
  color: #991b1b;
}
.quiz-option-key {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  transition: all 0.18s;
}

/* ─── Leaderboard ───────────────────────────────────────── */
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.leaderboard-row:last-child {
  border-bottom: none;
}
.leaderboard-row.me {
  background: var(--primary-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 0 -16px;
  border-bottom: none;
}

/* ─── Mobile hamburger ──────────────────────────────────── */
#mobile-menu-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 101;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
#mobile-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-700);
  border-radius: 99px;
  transition: all 0.2s;
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 900px) {
  #sidebar {
    transform: translateX(-100%);
  }
  #sidebar.open {
    transform: translateX(0);
  }
  #sidebar-overlay {
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  #sidebar-overlay.open {
    opacity: 1;
    pointer-events: all;
  }
  #main-content {
    margin-left: 0;
    padding: 24px 20px;
    padding-top: 72px;
  }
  #mobile-menu-btn {
    display: flex;
  }
}

@media (max-width: 640px) {
  #main-content {
    padding: 16px;
    padding-top: 68px;
  }
  .hero-banner {
    padding: 24px 24px;
  }
  .hero-banner-icon {
    display: none;
  }
  .auth-card {
    padding: 28px 24px;
  }
}

/* ─── Utility ───────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1200px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.flex-center {
  display: flex;
  align-items: center;
}
.gap-8 {
  gap: 8px;
}
.gap-12 {
  gap: 12px;
}
.gap-16 {
  gap: 16px;
}
.mb-8 {
  margin-bottom: 8px;
}
.mb-12 {
  margin-bottom: 12px;
}
.mb-16 {
  margin-bottom: 16px;
}
.mb-24 {
  margin-bottom: 24px;
}
.mb-32 {
  margin-bottom: 32px;
}
.text-sm {
  font-size: 13px;
}
.text-xs {
  font-size: 11px;
}
.font-bold {
  font-weight: 700;
}
.font-black {
  font-weight: 900;
}
.text-primary {
  color: var(--primary);
}
.text-muted {
  color: var(--text-500);
}
.text-orange {
  color: var(--accent-orange);
}
.text-green {
  color: var(--accent-green);
}
.text-red {
  color: var(--accent-red);
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  color: var(--text-900);
  line-height: 1.2;
}
h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-900);
}
h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-900);
}

/* ─── Password strength ─────────────────────────────────── */
.pw-bar {
  height: 4px;
  flex: 1;
  border-radius: 99px;
  background: var(--border);
  transition: background 0.3s;
}

/* ─── Pulse animation for streak ────────────────────────── */
@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
  }
}
.pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════
   PARENT DASHBOARD
   ═══════════════════════════════════════════════════════════ */
.pd {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.pd-section {
  margin: 0;
}
.pd-sub {
  font-size: 13px;
  color: var(--text-400);
}

/* Header */
.pd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pd-header h1 {
  font-size: 26px;
  margin-bottom: 2px;
}

.pd-bell {
  position: relative;
}
.pd-bell-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.pd-bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-red);
  border: 2px solid white;
  color: white;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.pd-notif {
  position: absolute;
  right: 0;
  top: 52px;
  width: 310px;
  z-index: 200;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.pd-notif-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
  font-size: 14px;
  color: var(--text-900);
}
.pd-notif-head button {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.pd-notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  background: var(--primary-light);
  border-bottom: 1px solid var(--border);
}
.pd-notif-item:last-child {
  border-bottom: none;
}
.pd-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 6px;
}

/* Child card */
.pd-child {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.pd-child-info {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pd-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 28px;
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
  display: flex;
  align-items: center;
  justify-content: center;
}
.pd-child-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--text-900);
}
.pd-child-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pd-child-switch > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-400);
  margin-right: 4px;
}
.pd-chip {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
  background: var(--bg);
  border: 2px solid var(--border);
  transition: all 0.18s;
}
.pd-chip:hover {
  border-color: var(--primary);
}
.pd-chip-active {
  background: var(--primary);
  border-color: var(--primary);
}

/* Stats */
.pd-stat {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.pd-stat-val {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  line-height: 1.1;
}
.pd-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-400);
}

/* Two-column layout */
.pd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}
.pd-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* Generic card */
.pd-card {
  padding: 20px 22px;
}
.pd-card-head {
  margin-bottom: 14px;
}
.pd-card-head h3 {
  font-size: 15px;
  font-weight: 800;
}
.pd-card-head p {
  font-size: 12px;
  color: var(--text-400);
  margin-top: 2px;
}

/* Shared rows */
.pd-list {
  display: flex;
  flex-direction: column;
}
.pd-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.pd-row:first-child {
  padding-top: 0;
}
.pd-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.pd-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.pd-row-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-900);
}
.pd-row-sub {
  font-size: 12px;
  color: var(--text-500);
  font-weight: 500;
}
.pd-row-meta {
  font-size: 11px;
  color: var(--text-400);
}
.pd-row-pct {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
}
.pd-empty {
  text-align: center;
  padding: 24px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-400);
}

.pd-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
}
.pd-pill-good {
  background: #d1fae5;
  color: #065f46;
}
.pd-pill-warn {
  background: #fef3c7;
  color: #92400e;
}
.pd-pill-bad {
  background: #fee2e2;
  color: #991b1b;
}

/* ARAL banner */
.pd-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #1e2a78 0%, #3b3fc4 100%);
}
.pd-banner-icon {
  font-size: 30px;
}
.pd-banner-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: white;
}
.pd-banner-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 2px;
}
.pd-banner-phase {
  flex-shrink: 0;
  text-align: center;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
}
.pd-banner-phase strong {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  color: white;
}
.pd-banner-phase span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

/* Weekly chart */
.pd-chart {
  display: flex;
  gap: 10px;
  height: 160px;
}
.pd-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.pd-bar-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-900);
}
.pd-bar-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
}
.pd-bar {
  width: 100%;
  border-radius: 8px 8px 4px 4px;
  background: var(--primary-mid);
  transition: opacity 0.2s;
}
.pd-bar:hover {
  opacity: 0.8;
}
.pd-bar.today {
  background: var(--primary);
}
.pd-bar.empty {
  background: var(--border);
}
.pd-bar-day {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-400);
}
.pd-bar-day.today {
  color: var(--primary);
  font-weight: 800;
}

/* Streak */
.pd-streak {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--streak-bg);
}
.pd-streak-icon {
  font-size: 28px;
}
.pd-streak-num {
  margin-left: auto;
  text-align: right;
  line-height: 1;
}
.pd-streak-num strong {
  display: block;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  color: var(--accent-orange);
}
.pd-streak-num span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-400);
}

/* Intervention tools */
.pd-tool {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.pd-card-head + .pd-tool {
  border-top: none;
  padding-top: 0;
}
.pd-tool:last-child {
  padding-bottom: 0;
}
.pd-tool-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-900);
  margin-bottom: 10px;
}
.pd-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pd-btn-row .btn {
  flex: 1 1 auto;
  white-space: nowrap;
}
.pd-goal {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.pd-goal input {
  flex: 1;
  accent-color: var(--primary);
}
.pd-goal-val {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
}
.pd-full {
  width: 100%;
}

/* Tips */
.pd-tips {
  list-style: none;
  counter-reset: tip;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pd-tips li {
  counter-increment: tip;
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--text-700);
  line-height: 1.5;
}
.pd-tips li::before {
  content: counter(tip);
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modals */
.pd-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.pd-modal-box {
  width: 100%;
  max-width: 420px;
  padding: 28px;
}

/* Responsive */
@media (max-width: 1100px) {
  .pd-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .pd-header h1 {
    font-size: 22px;
  }
  .pd-banner {
    flex-wrap: wrap;
  }
  .pd-child-switch > span {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════
   DARK THEME — toggled via <html data-theme="dark">
   ═══════════════════════════════════════════════════════════ */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1120;
  --sidebar-bg: #151929;
  --card-bg: #1a1f33;
  --input-bg: #141828;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #262a50;
  --primary-mid: #818cf8;
  --text-900: #f1f3f9;
  --text-700: #cbd2e1;
  --text-500: #9aa3b8;
  --text-400: #7c8499;
  --border: #2a3048;
  --toast-bg: #2a3048;
  --streak-bg: linear-gradient(135deg, #2b2116, var(--card-bg));
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.55);
  --shadow-primary: 0 4px 20px rgba(99, 102, 241, 0.35);
}
:root[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #3a4160;
}
:root[data-theme="dark"] .nav-item.active,
:root[data-theme="dark"] .text-primary,
:root[data-theme="dark"] .section-link,
:root[data-theme="dark"] .btn-ghost {
  color: var(--primary-mid);
}
:root[data-theme="dark"] .badge-new {
  color: var(--primary-mid);
}
:root[data-theme="dark"] .pd-bell-badge {
  border-color: var(--card-bg);
}
:root[data-theme="dark"] .quiz-option.correct {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}
:root[data-theme="dark"] .quiz-option.wrong {
  border-color: var(--accent-red);
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

/* Smooth swap, but not on first paint */
html.theme-ready body,
html.theme-ready .card,
html.theme-ready #sidebar {
  transition:
    background-color 0.25s,
    border-color 0.25s,
    color 0.25s;
}

/* ─── Toggle switch ─────────────────────────────────────── */
.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.pref-row:last-child {
  border-bottom: none;
}
.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: var(--border);
  transition: background 0.2s;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}
.switch input:checked + .switch-track {
  background: var(--primary);
}
.switch input:checked + .switch-track::after {
  transform: translateX(20px);
}
.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--primary-mid);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════
   GAMES — shared
   ═══════════════════════════════════════════════════════════ */
.game-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.game-head h1 {
  font-size: 24px;
  margin-bottom: 2px;
}
.game-head p {
  font-size: 13px;
  color: var(--text-400);
}
.game-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.game-stat {
  padding: 14px 18px;
  text-align: center;
}
.game-stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.game-stat-val {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
}

.game-over {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
}
.game-over-emoji {
  font-size: 72px;
  margin-bottom: 16px;
}
.game-over h1 {
  font-size: 32px;
  margin-bottom: 8px;
}
.game-over-sub {
  color: var(--text-400);
  margin-bottom: 28px;
}
.game-over-score {
  border: 2px solid;
  border-radius: var(--radius-xl);
  padding: 24px 48px;
  margin-bottom: 28px;
}
.game-over-num {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 900;
  line-height: 1;
}
.game-over-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-500);
  margin-top: 4px;
}
.game-over-detail {
  font-size: 12px;
  color: var(--text-400);
  margin-top: 2px;
}

/* ─── Logic Puzzles ─────────────────────────────────────── */
.lp-card {
  padding: 32px;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}
.lp-prompt {
  font-size: 20px;
  line-height: 1.5;
  margin: 14px auto 20px;
  max-width: 600px;
}
.lp-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}
.lp-tokens:empty {
  display: none;
}
.lp-token {
  min-width: 52px;
  height: 56px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--text-900);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
}
.lp-token-q {
  background: var(--primary);
  color: white;
  animation: pulse-glow 2s ease-in-out infinite;
}
.lp-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
}
.lp-choice {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--card-bg);
  color: var(--text-900);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  transition: all 0.18s;
}
.lp-choice:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}
.lp-choice:disabled {
  cursor: default;
}
.lp-choice-out {
  opacity: 0.25;
  text-decoration: line-through;
}
.lp-choice-correct {
  border-color: var(--accent-green);
  background: #d1fae5;
  color: #065f46;
}
.lp-choice-wrong {
  border-color: var(--accent-red);
  background: #fee2e2;
  color: #991b1b;
}
.lp-feedback {
  min-height: 28px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.lp-fb-ok {
  color: var(--accent-green);
  font-weight: 700;
}
.lp-fb-bad {
  color: var(--accent-red);
  font-weight: 700;
}
.lp-why {
  font-size: 13px;
  color: var(--text-500);
}
.lp-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

/* ─── Eco-Sorter ────────────────────────────────────────── */
.eco-stage {
  padding: 28px;
  text-align: center;
  margin-bottom: 16px;
}
.eco-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-400);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 14px;
}
.eco-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 32px;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
  background: var(--bg);
  cursor: grab;
  user-select: none;
}
.eco-item.dragging {
  opacity: 0.4;
  cursor: grabbing;
}
.eco-item-icon {
  font-size: 64px;
  line-height: 1;
}
.eco-item-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-900);
}
.eco-pop {
  animation: ecoPop 0.25s ease;
}
@keyframes ecoPop {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.eco-feedback {
  min-height: 44px;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.eco-bins {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.eco-bin {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 12px 16px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-top: 6px solid var(--bin);
  color: var(--text-900);
  transition:
    transform 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}
.eco-bin:hover,
.eco-bin.over {
  transform: translateY(-3px);
  border-color: var(--bin);
  box-shadow: var(--shadow-md);
}
.eco-bin-key {
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-400);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 5px;
}
.eco-bin-icon {
  font-size: 34px;
}
.eco-bin-label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
}
.eco-bin-sub {
  font-size: 11px;
  color: var(--text-400);
}
.eco-bin.flash-ok {
  animation: binOk 0.45s;
}
.eco-bin.flash-bad {
  animation: shake 0.4s;
  border-color: var(--accent-red);
}
@keyframes binOk {
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--bin) 30%, transparent);
  }
}
.eco-tip {
  text-align: center;
  font-size: 12px;
  color: var(--text-400);
  margin-top: 12px;
}
.eco-learn {
  max-width: 520px;
  margin: 0 auto 24px;
  padding: 20px 22px;
}
.eco-learn h3 {
  font-size: 15px;
  margin-bottom: 12px;
}

@media (max-width: 768px) {
  .game-stats,
  .eco-bins {
    grid-template-columns: repeat(2, 1fr);
  }
  .lp-card {
    padding: 22px 16px;
  }
  .eco-tip {
    display: none;
  }
}

/* ─── Memory Match ──────────────────────────────────────── */
.mm-start {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px;
  text-align: center;
}
.mm-start h2 {
  margin: 16px 0 4px;
}
.mm-start-flag .mm-flag {
  width: 120px;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}
.mm-levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 24px;
}
.mm-level {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 12px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  background: var(--card-bg);
  color: var(--text-900);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.18s;
}
.mm-level:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
}
.mm-level strong {
  font-family: var(--font-display);
  font-size: 16px;
}
.mm-level span:last-child {
  font-size: 12px;
  color: var(--text-400);
}
.mm-level-emoji {
  font-size: 28px;
}

.mm-status {
  text-align: center;
  font-weight: 700;
  color: var(--text-700);
  min-height: 24px;
  margin-bottom: 14px;
}
.mm-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  gap: 12px;
  max-width: calc(var(--cols, 4) * 150px);
  margin: 0 auto 20px;
}
.mm-card {
  aspect-ratio: 4 / 5;
  perspective: 800px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}
.mm-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.mm-card.flipped .mm-inner {
  transform: rotateY(180deg);
}
.mm-card:hover:not(.flipped) .mm-inner {
  transform: translateY(-3px);
}
.mm-face {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.mm-back {
  background: var(--card-bg);
  border: 2px solid var(--border);
}
.mm-back .mm-flag {
  width: 80%;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.mm-front {
  transform: rotateY(180deg);
  background: var(--card-bg);
  border: 2px solid var(--primary);
  text-align: center;
}
.mm-front-role {
  background: var(--primary-light);
}
.mm-icon {
  font-size: 40px;
  line-height: 1;
}
.mm-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  color: var(--text-900);
  line-height: 1.2;
}
.mm-role-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-400);
}
.mm-role {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  color: var(--primary);
  line-height: 1.25;
}
:root[data-theme="dark"] .mm-role {
  color: var(--primary-mid);
}
.mm-card.matched {
  cursor: default;
}
.mm-card.matched .mm-front {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-green) 30%, transparent);
}
.mm-card.matched .mm-inner {
  animation: mmPop 0.4s ease;
}
.mm-card.miss .mm-front {
  border-color: var(--accent-red);
}
.mm-card.miss {
  animation: shake 0.4s;
}
@keyframes mmPop {
  50% {
    transform: rotateY(180deg) scale(1.08);
  }
}

.mm-fact {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mm-fact-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--primary);
}
:root[data-theme="dark"] .mm-fact-label {
  color: var(--primary-mid);
}
.mm-fact p {
  font-size: 14px;
  color: var(--text-700);
}

.mm-learned {
  max-width: 640px;
  margin: 0 auto 24px;
  padding: 20px 22px;
}
.mm-learned h3 {
  font-size: 15px;
  margin-bottom: 12px;
}
.mm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 99px;
  background: var(--bg);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-900);
}
.mm-chip em {
  font-style: normal;
  font-weight: 500;
  color: var(--text-500);
}

@media (max-width: 640px) {
  .mm-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  .mm-icon {
    font-size: 28px;
  }
  .mm-name,
  .mm-role {
    font-size: 11px;
  }
  .mm-levels {
    grid-template-columns: 1fr;
  }
}
.mm-flag-inline {
  display: inline-flex;
  vertical-align: -0.12em;
}
.mm-flag-inline .mm-flag {
  height: 0.8em;
  width: auto;
  border-radius: 2px;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}
.bibo-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Links from the student login to the other portals */
.portal-link {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.portal-link:hover { filter: brightness(0.95); }

/* ─── Login slideshow ─── */
.login-bg { position: absolute; inset: 0; z-index: 0; }
.login-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,107,107,.55), rgba(78,205,196,.45));
}
.login-bg .slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; animation: kenburns 18s infinite;
}
.login-bg .slide:nth-child(2) { animation-delay: 6s; }
.login-bg .slide:nth-child(3) { animation-delay: 12s; }
@keyframes kenburns {
  0%   { opacity: 0; transform: scale(1); }
  5%   { opacity: 1; }
  33%  { opacity: 1; }
  38%  { opacity: 0; transform: scale(1.12); }
  100% { opacity: 0; }
}
#app-auth .auth-card { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .login-bg .slide { animation: none; }
  .login-bg .slide:first-child { opacity: 1; }
}

/* ─── Locked games ─── */
.game-locked { position: relative; opacity: .55; filter: grayscale(.6); }
.game-locked::after { content: "🔒"; position: absolute; top: 12px; right: 12px; font-size: 20px; }

.game-locked { cursor: not-allowed; }
.game-locked:hover { transform: none; }

/* ─── Cute illustrated dashboard banner ─── */
.hero-banner--cute {
  background:
    linear-gradient(90deg, rgba(255,250,240,.95) 0%, rgba(255,250,240,.85) 35%, rgba(255,250,240,0) 60%),
    url("images/dashboard-bg.jpg") right center / cover no-repeat,
    linear-gradient(135deg, #ffe8d6 0%, #dff3ff 100%);
  border: 3px solid #fff;
  box-shadow: 0 10px 30px rgba(59, 63, 196, .12);
  min-height: 220px;
  display: flex;
  align-items: center;
}
.hero-banner--cute::after { display: none; }
.hero-banner--cute .hero-banner-content { max-width: 520px; position: relative; z-index: 1; }
.hero-banner--cute h2 { color: #1e2a78; font-size: 28px; font-weight: 900; margin-bottom: 12px; line-height: 1.25; }
.hero-banner--cute p { color: #475569; font-size: 14px; margin-bottom: 24px; line-height: 1.6; }
.hero-banner--cute p strong { color: #3b3fc4; }

@media (max-width: 768px) {
  .hero-banner--cute {
    background:
      linear-gradient(rgba(255,250,240,.88), rgba(255,250,240,.88)),
      url("images/dashboard-banner.png") right center / cover no-repeat,
      linear-gradient(135deg, #ffe8d6 0%, #dff3ff 100%);
  }
}

/* ── Missing spacing utility (used in Achievements + progress track) ── */
.mb-28 { margin-bottom: 28px; }

/* ── Achievements header summary (Total XP · Game Points · Rank) ── */
.ach-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.ach-summary {
  display: flex;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.ach-summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 28px;
  min-width: 120px;
}
.ach-summary-item + .ach-summary-item { border-left: 1px solid var(--border); }
.ach-summary-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-400);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}
.ach-summary-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
  color: var(--c);
}
@media (max-width: 640px) {
  .ach-summary { width: 100%; }
  .ach-summary-item { flex: 1; min-width: 0; padding: 12px 8px; }
  .ach-summary-value { font-size: 20px; }
}

/* ── Background photo slideshow (student login) ── */
#app-auth { padding-bottom: 80px; }
.bg-slideshow { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.bg-slideshow::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: rgba(0, 0, 0, 0.12);
}
.bg-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transform: scale(1.06);
  transition: opacity 1.2s ease, transform 6s ease;
}
.bg-slide.active { opacity: 1; transform: scale(1); }
.bg-controls {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 3; display: flex; gap: 2px; padding: 4px;
  border-radius: 12px; background: rgba(0,0,0,.5); backdrop-filter: blur(6px);
}
.bg-controls button {
  width: 38px; height: 34px; border: 0; border-radius: 8px;
  background: transparent; color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.bg-controls button:hover { background: rgba(255,255,255,.15); }
.bg-controls button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .bg-slide { transition: none; transform: none; }
}

@media (max-width: 640px) {
  .bg-slide { background-position: 18% center; }
}

body:has(#app-auth) #mobile-menu-btn { display: none; }

@media (max-width: 640px) {
  #app-auth .auth-card {
    background: rgba(26, 31, 51, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}