/* ============================================================
   Bodhvik — Futuristic Space Theme Stylesheet
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
  --bg-deep:        #F8FAFC;
  --bg-body:        #F8FAFC;
  --bg-gradient:    none;
  --text-primary:   #1E293B;
  --text-muted:     #64748B;
  --purple:         #7C3AED;
  --cyan:           #7C3AED;
  --pink:           #EC4899;
  --green:          #10B981;
  --gold:           #D97706;
  --accent-primary: #7C3AED;
  --accent-secondary: #6D28D9;
  --heading-color:  #1E293B;
  --heading-glow:   none;
  --subtitle-color: #7C3AED;
  --btn-primary-bg: #7C3AED;
  --btn-primary-border: transparent;
  --btn-primary-color: #ffffff;
  --btn-primary-glow: none;
  --card-radius:    18px;
  --card-border-width: 1px;
  --card-reading-border: linear-gradient(135deg, #7C3AED, #C4B5FD);
  --card-writing-border: linear-gradient(135deg, #C4B5FD, #A78BFA);
  --card-maths-border:   linear-gradient(135deg, #A78BFA, #7C3AED);
  --card-life-border:    linear-gradient(135deg, #6D28D9, #C4B5FD);
  --card-glow-reading: rgba(124, 58, 237, 0.14);
  --card-glow-writing: rgba(167, 139, 250, 0.14);
  --card-glow-maths:   rgba(109, 40, 217, 0.14);
  --card-glow-life:    rgba(196, 181, 253, 0.14);

  --glass-bg:       rgba(255, 255, 255, 0.92);
  --glass-border:   rgba(221, 214, 254, 0.8);
  --glass-blur:     0px;

  /* Theme colour variables (overridden per-theme by JS) */
  --theme-bg:             #F8FAFC;
  --theme-card-bg:        rgba(255,255,255,0.92);
  --theme-card-border:    1px solid #DDD6FE;
  --theme-btn-bg:         #7C3AED;
  --theme-accent:         #7C3AED;
  --theme-text-primary:   #1E293B;
  --theme-text-secondary: #64748B;
  --theme-text-muted:     #94A3B8;

  --font-heading:   'Nunito', sans-serif;
  --font-body:      'Nunito', sans-serif;
  --font-weight-heading: 700;

  --transition:     0.3s ease;
  --theme-transition: 0.6s ease;
  --radius-pill:    999px;
  --radius-card:    18px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  transition: background var(--theme-transition), color var(--theme-transition);
}

body.theme-switching,
body.theme-switching * {
  transition: background var(--theme-transition), color var(--theme-transition),
              border-color var(--theme-transition), box-shadow var(--theme-transition) !important;
}

/* Landing theme — pre-login professional pages */
body.theme-landing {
  background-color: #F8FAFC;
  color: #0F172A;
}

body.theme-landing #starfield,
body.theme-landing #particles,
body.theme-landing #cartoon-bubbles,
body.theme-landing #theme-decorations,
body.theme-landing #theme-lightning {
  display: none;
}

/* --- Starfield Canvas --- */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* --- Floating Particles --- */
#particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0.55;
  animation: particle-drift linear infinite;
}

.particle--purple {
  background: radial-gradient(circle, var(--purple) 0%, transparent 70%);
  box-shadow: 0 0 20px var(--purple), 0 0 40px rgba(124, 58, 237, 0.4);
}

.particle--cyan {
  background: radial-gradient(circle, var(--cyan) 0%, transparent 70%);
  box-shadow: 0 0 20px var(--cyan), 0 0 40px rgba(6, 182, 212, 0.4);
}

.particle--gold {
  background: radial-gradient(circle, #FFD700 0%, transparent 70%);
  box-shadow: 0 0 24px #FFD700, 0 0 48px rgba(255, 215, 0, 0.4);
}

.particle--white {
  background: radial-gradient(circle, #FFFFF0 0%, transparent 70%);
  box-shadow: 0 0 20px #FFFFF0;
}

.particle--red {
  background: radial-gradient(circle, #DC2626 0%, transparent 70%);
  box-shadow: 0 0 20px #DC2626;
}

.particle--cartoon {
  border-radius: 50%;
  animation: cartoon-bounce 4s ease-in-out infinite;
}

.particle--leaf {
  width: 24px !important;
  height: 32px !important;
  background: rgba(74, 222, 128, 0.35);
  border-radius: 0 80% 0 80%;
  box-shadow: none;
  animation: leaf-drift 14s linear infinite;
}

@keyframes cartoon-bounce {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -30px); }
}

@keyframes leaf-drift {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0.5; }
  50% { transform: translate(40px, -60px) rotate(180deg); opacity: 0.8; }
  100% { transform: translate(0, 0) rotate(360deg); opacity: 0.5; }
}

@keyframes particle-drift {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(30px, -40px) scale(1.1); }
  50%  { transform: translate(-20px, -80px) scale(0.9); }
  75%  { transform: translate(40px, -30px) scale(1.05); }
  100% { transform: translate(0, 0) scale(1); }
}

/* --- App Container --- */
.app {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  margin-bottom: 2.5rem;
  animation: fade-in-down 0.8s ease forwards;
}

.header__main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

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

.header__emoji {
  font-size: 2.8rem;
  animation: float-gentle 3s ease-in-out infinite;
  filter: drop-shadow(0 0 12px var(--purple));
}

.header__title {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-heading, 900);
  font-size: 4rem;
  letter-spacing: 0.04em;
  color: var(--heading-color);
  text-shadow: var(--heading-glow);
  line-height: 1.1;
}

.header__subtitle {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1.15rem;
  color: var(--subtitle-color);
  margin-top: 0.25rem;
  letter-spacing: 0.02em;
}

.header__datetime {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  letter-spacing: 0.03em;
}

/* Stars counter — top right */
.header__stars {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 0.5rem 1.1rem;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.25);
  flex-shrink: 0;
}

.header__star-icon {
  font-size: 1.3rem;
  filter: drop-shadow(0 0 6px var(--gold));
  animation: pulse-glow 2s ease-in-out infinite;
}

.header__star-count {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
}

/* ============================================================
   LEVEL SELECTOR
   ============================================================ */
.level-selector {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 2.5rem;
  animation: fade-in-down 0.8s 0.2s ease both;
}

.level-btn {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.65rem 1.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: rgba(226, 232, 240, 0.7);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  outline: none;
}

.level-btn:hover {
  color: #fff;
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.3);
}

/* Active level — purple glow + pulsing ring */
.level-btn--active {
  background: color-mix(in srgb, var(--accent-primary) 25%, transparent);
  border-color: var(--accent-primary);
  color: var(--btn-primary-color, #fff);
  box-shadow:
    0 0 20px color-mix(in srgb, var(--accent-primary) 60%, transparent),
    0 0 40px color-mix(in srgb, var(--accent-primary) 30%, transparent);
}

.level-btn--active::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--accent-primary);
  animation: pulse-ring 1.8s ease-out infinite;
  pointer-events: none;
}

@keyframes pulse-ring {
  0%   { transform: scale(1);   opacity: 0.8; }
  70%  { transform: scale(1.12); opacity: 0; }
  100% { transform: scale(1.12); opacity: 0; }
}

/* ============================================================
   SUBJECT CARDS GRID
   ============================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

/* --- Card Base --- */
.card {
  position: relative;
  border-radius: var(--card-radius);
  cursor: pointer;
  animation: slide-up 0.7s ease both;
  transition: transform var(--transition), box-shadow var(--theme-transition);
}

/* Staggered entrance delays */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.25s; }
.card:nth-child(3) { animation-delay: 0.4s; }
.card:nth-child(4) { animation-delay: 0.55s; }

/* Animated gradient border wrapper */
.card__border {
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
  padding: var(--card-border-width);
  background-size: 300% 300%;
  animation: border-shimmer 4s linear infinite;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.card--reading .card__border { background-image: var(--card-reading-border); background: var(--card-reading-border); }
.card--writing .card__border  { background-image: var(--card-writing-border);  background: var(--card-writing-border); }
.card--maths .card__border    { background-image: var(--card-maths-border);    background: var(--card-maths-border); }
.card--life .card__border     { background-image: var(--card-life-border);     background: var(--card-life-border); }

body[data-child-theme="warner"] .card__border {
  background: #000000 !important;
  background-image: none !important;
  animation: none;
}

@keyframes border-shimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Glass card inner content — premium */
.card__content {
  position: relative;
  background: var(--theme-card-bg, var(--glass-bg));
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: calc(var(--radius-card) - 2px);
  padding: 1.6rem 1.4rem 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  height: 100%;
  min-height: 180px;
  overflow: hidden;
  transition: all 0.25s ease;
  border: var(--theme-card-border, var(--card-border-width) solid var(--glass-border));
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}

/* Thin top accent bar per card type */
.card--reading .card__content::before,
.card--writing .card__content::before,
.card--maths   .card__content::before,
.card--life    .card__content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--card-radius) var(--card-radius) 0 0;
}
.card--reading .card__content::before { background: var(--card-accent-reading, var(--accent-primary)); }
.card--writing .card__content::before { background: var(--card-accent-writing, var(--accent-secondary)); }
.card--maths   .card__content::before { background: var(--card-accent-maths,   var(--accent-primary)); }
.card--life    .card__content::before { background: var(--card-accent-life,    var(--accent-secondary)); }

/* Icon in a themed circle */
.card__icon {
  font-size: 2rem;
  line-height: 1;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--theme-accent, var(--accent-primary)) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.35rem;
  flex-shrink: 0;
}

.card__title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--text-primary);
  line-height: 1.2;
}

.card__desc {
  font-size: 0.88rem;
  color: #64748B;
  flex: 1;
  line-height: 1.6;
}

/* Progress bar — thicker and premium */
.card__progress {
  width: 100%;
  height: 8px;
  background: rgba(0,0,0,0.06);
  border-radius: 50px;
  overflow: hidden;
  margin-top: 0.4rem;
}

.card__progress-bar {
  height: 100%;
  border-radius: 50px;
  transition: width 0.6s ease;
  width: 0%;
  background: var(--theme-accent, var(--accent-primary));
}

.card--reading .card__progress-bar { background: var(--card-accent-reading, var(--theme-accent, #7C3AED)); }
.card--writing .card__progress-bar { background: var(--card-accent-writing, var(--theme-accent, #7C3AED)); }
.card--maths   .card__progress-bar { background: var(--card-accent-maths,   var(--theme-accent, #7C3AED)); }
.card--life    .card__progress-bar { background: var(--card-accent-life,    var(--theme-accent, #7C3AED)); }

.card__progress-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* Start Learning button — themed solid color */
.card__btn {
  width: 100%;
  margin-top: 0.65rem;
  height: 44px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: none;
  border-radius: 12px;
  background: var(--theme-btn-bg, var(--btn-primary-bg, #7C3AED));
  color: #ffffff;
  cursor: pointer;
  transition: all 0.25s ease;
  outline: none;
}

.card__btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* Per-card premium hover lift */
.card--reading:hover,
.card--writing:hover,
.card--maths:hover,
.card--life:hover {
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  transform: translateY(-5px);
}

/* ============================================================
   PROGRESS PANEL
   ============================================================ */
.progress-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 1.75rem 2rem;
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.15);
  animation: slide-up 0.7s 0.7s ease both;
}

.progress-panel__title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1.25rem;
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.progress-panel__stats {
  display: flex;
  gap: 2.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.progress-panel__stat {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-panel__stat-icon {
  font-size: 1.8rem;
}

.progress-panel__stat-icon--gold {
  filter: drop-shadow(0 0 8px var(--gold));
  animation: pulse-glow 2s ease-in-out infinite;
}

.progress-panel__stat-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.progress-panel__stat-label {
  display: block;
  font-size: 0.8rem;
  color: rgba(226, 232, 240, 0.55);
}

.progress-panel__message {
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.85);
  padding-top: 0.75rem;
  border-top: 1px solid var(--glass-border);
  transition: color var(--transition);
}

/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */
@keyframes fade-in-down {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 4px var(--gold)); }
  50%       { filter: drop-shadow(0 0 14px var(--gold)); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 768px) {
  .header__title {
    font-size: 2.8rem;
  }

  .header__emoji {
    font-size: 2.2rem;
  }

  .cards-grid {
    gap: 1.25rem;
  }

  .card__title {
    font-size: 1.1rem;
  }

  .progress-panel__stats {
    gap: 1.5rem;
  }
}

/* Mobile */
@media (max-width: 540px) {
  .app {
    padding: 1.5rem 1rem 3rem;
  }

  .header__title {
    font-size: 2.5rem;
  }

  .header__emoji {
    font-size: 1.8rem;
  }

  .header__subtitle {
    font-size: 1rem;
  }

  .header__main {
    flex-direction: column;
    align-items: flex-start;
  }

  .header__stars {
    align-self: flex-end;
    margin-top: -2.5rem;
  }

  .level-selector {
    flex-wrap: wrap;
  }

  .level-btn {
    font-size: 0.75rem;
    padding: 0.55rem 1.2rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .card__content {
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .progress-panel {
    padding: 1.5rem 1.25rem;
  }

  .progress-panel__stat-value {
    font-size: 1.3rem;
  }
}

/* ============================================================
   SCREEN SYSTEM
   ============================================================ */
.screen {
  display: none;
  position: relative;
  z-index: 2;
  min-height: 100vh;
}

.screen--active {
  display: block;
  animation: fade-in-down 0.5s ease forwards;
}

.app--wide {
  max-width: 900px;
}

#screen-children .app--wide {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#screen-children .dashboard-footer {
  margin-top: auto;
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-overlay[hidden] {
  display: none;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  border: 3px solid rgba(124, 58, 237, 0.2);
  border-top-color: var(--purple);
  border-right-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.6), 0 0 48px rgba(6, 182, 212, 0.3);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   CELEBRATION OVERLAY
   ============================================================ */
.celebration-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in-down 0.4s ease;
}

.celebration-overlay[hidden] {
  display: none;
}

.celebration-overlay__content {
  text-align: center;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 2.5rem 2rem;
  box-shadow: 0 0 60px rgba(124, 58, 237, 0.4);
  max-width: 360px;
  width: 90%;
}

.celebration-overlay__emoji {
  font-size: 4rem;
  display: block;
  margin-bottom: 0.5rem;
  animation: float-gentle 2s ease-in-out infinite;
}

.celebration-overlay__title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: #fff; /* intentionally white — on dark overlay */
  text-shadow: 0 0 20px var(--purple);
  margin-bottom: 0.5rem;
}

.celebration-overlay__text {
  color: var(--cyan);
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

.celebration-overlay__btn {
  min-width: 180px;
}

/* ============================================================
   LANDING PAGE (pre-login)
   ============================================================ */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.landing-header {
  padding: 1.5rem 2rem;
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.landing-logo__emoji {
  font-size: 1.75rem;
}

.landing-logo__text {
  font-family: var(--font-body);
  font-size: 2rem;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.02em;
}

.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1.5rem 4rem;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.landing-hero__title {
  font-family: var(--font-body);
  font-size: 3rem;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.landing-hero__subtitle {
  font-size: 1.1rem;
  color: #64748B;
  max-width: 500px;
  line-height: 1.65;
  margin-bottom: 2rem;
}

.landing-hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.btn--landing-primary {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  padding: 14px 32px;
  border-radius: 10px;
  border: none;
  background: #0F172A;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn--landing-primary:hover {
  background: #1E293B;
  transform: translateY(-1px);
  box-shadow: none;
}

.btn--landing-outline {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  padding: 14px 32px;
  border-radius: 10px;
  border: 2px solid #0F172A;
  background: transparent;
  color: #0F172A;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn--landing-outline:hover {
  background: rgba(15, 23, 42, 0.05);
  transform: none;
  box-shadow: none;
}

.landing-features {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  justify-content: center;
  padding: 0;
}

.landing-features li {
  font-size: 0.9rem;
  color: #64748B;
  font-weight: 600;
}

.landing-subjects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
  width: 100%;
}

.landing-subject {
  text-align: center;
  padding: 1.5rem 1rem;
}

.landing-subject__icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.75rem;
}

.landing-subject__title {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 0.35rem;
}

.landing-subject__desc {
  font-size: 0.9rem;
  color: #64748B;
  line-height: 1.5;
}

.landing-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.8rem;
  color: #94A3B8;
  border-top: 1px solid #E2E8F0;
}

/* Landing auth (sign in / sign up) */
.landing-auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.landing-auth__back {
  align-self: flex-start;
  max-width: 440px;
  width: 100%;
  margin: 0 auto 1rem;
  color: #64748B;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.landing-auth__back:hover {
  color: #0F172A;
}

.landing-auth__card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

.landing-auth__title {
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 800;
  color: #0F172A;
  text-align: center;
  margin-bottom: 2rem;
}

.landing-auth__link {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: #64748B;
}

.landing-auth__link a {
  color: #0F172A;
  font-weight: 700;
  text-decoration: none;
}

.landing-auth__link a:hover {
  text-decoration: underline;
}

body.theme-landing .form-group label {
  color: #475569;
}

body.theme-landing .form-input {
  background: #F8FAFC;
  border-color: #E2E8F0;
  color: #0F172A;
}

body.theme-landing .form-input:focus {
  border-color: #0F172A;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
  background: #fff;
}

body.theme-landing .form-input::placeholder {
  color: #94A3B8;
}

body.theme-landing .form-message--error {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #DC2626;
}

body.theme-landing .form-message--success {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #16A34A;
}

/* Delete account — child selection footer */
.dashboard-footer {
  margin-top: 4rem;
  padding: 3rem 0 2rem;
  text-align: center;
}

.dashboard-footer__delete {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: #F87171;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.2s ease;
  padding: 0.5rem;
}

.dashboard-footer__delete:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Delete account modal */
.delete-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.delete-modal[hidden] {
  display: none;
}

.delete-modal__card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 2rem 1.75rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 40px rgba(220, 38, 38, 0.15);
}

.delete-modal__icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.75rem;
}

.delete-modal__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #DC2626;
  margin-bottom: 0.75rem;
}

.delete-modal__message {
  font-size: 0.95rem;
  color: rgba(226, 232, 240, 0.8);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.delete-modal__error {
  font-size: 0.85rem;
  color: #FCA5A5;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 0.6rem;
  margin-bottom: 1rem;
}

.delete-modal__error[hidden] {
  display: none;
}

.delete-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn--landing-cancel {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  padding: 14px 24px;
  border-radius: 10px;
  border: 2px solid #94A3B8;
  background: #fff;
  color: #0F172A;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn--landing-cancel:hover {
  background: #F1F5F9;
}

.btn--danger {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  background: #DC2626;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn--danger:hover {
  background: #B91C1C;
}

/* Post-deletion toast */
.account-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 110;
  background: #0F172A;
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  font-size: 0.95rem;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.25);
  max-width: 90%;
  text-align: center;
}

.account-toast[hidden] {
  display: none;
}

@media (max-width: 768px) {
  .landing-hero__title {
    font-size: 2rem;
  }

  .landing-subjects {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .landing-header {
    padding: 1.25rem 1.25rem;
  }

  .landing-logo__text {
    font-size: 1.5rem;
  }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn--primary {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-border);
  color: var(--btn-primary-color);
  box-shadow: var(--btn-primary-glow);
}

.btn--primary:hover {
  filter: brightness(1.1);
  box-shadow: var(--btn-primary-glow);
  transform: translateY(-2px);
}

.btn--secondary {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

.btn--secondary:hover {
  background: rgba(6, 182, 212, 0.3);
  color: #fff;
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.6);
  transform: translateY(-2px);
}

.btn--ghost {
  background: var(--glass-bg, rgba(255,255,255,0.92));
  border-color: var(--glass-border, #E2E8F0);
  color: var(--text-primary, #1E293B);
  backdrop-filter: blur(var(--glass-blur));
}

.btn--ghost:hover {
  border-color: var(--accent-primary, #7C3AED);
  color: var(--accent-primary, #7C3AED);
  box-shadow: none;
}

.btn--large {
  padding: 1rem 2rem;
  font-size: 0.95rem;
}

.btn--small {
  padding: 0.45rem 1rem;
  font-size: 0.7rem;
}

.btn--full {
  width: 100%;
}

/* ============================================================
   AUTH CARDS & FORMS
   ============================================================ */
.auth-card {
  max-width: 440px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-left: 1px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
  box-shadow: 0 0 40px rgba(124, 58, 237, 0.1);
}

/* Add-child screen: scrollable, buttons always visible */
#screen-add-child .auth-card,
#screen-add-child .auth-card--wide {
  justify-content: flex-start;
  padding-top: 2rem;
  padding-bottom: 2rem;
  overflow-y: auto;
  min-height: 0;
  height: 100vh;
  max-height: 100vh;
}

#screen-add-child .auth-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

#screen-add-child .btn--full {
  flex-shrink: 0;
  margin-top: 0.5rem;
}

.auth-card--wide {
  max-width: 520px;
}

.auth-card__title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2rem;
  letter-spacing: 0.04em;
}

.auth-card__title--purple {
  color: #fff;
  text-shadow: 0 0 20px var(--purple), 0 0 40px rgba(124, 58, 237, 0.5);
}

.auth-card__title--cyan {
  color: #fff;
  text-shadow: 0 0 20px var(--cyan), 0 0 40px rgba(6, 182, 212, 0.5);
}

.auth-card__link {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.6);
}

.auth-card__link a {
  color: var(--cyan);
  text-decoration: none;
  transition: color var(--transition);
}

.auth-card__link a:hover {
  color: #fff;
  text-shadow: 0 0 8px var(--cyan);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.75);
  margin-bottom: 0.4rem;
  letter-spacing: 0.03em;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  outline: none;
  transition: all var(--transition);
}

.form-input::placeholder {
  color: rgba(226, 232, 240, 0.35);
}

.form-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2), 0 0 20px rgba(6, 182, 212, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.form-input-wrap {
  position: relative;
}

.form-input-wrap .form-input {
  padding-right: 48px;
}

.form-toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  opacity: 0.6;
  transition: opacity var(--transition);
  padding: 4px;
}

.form-toggle-pw:hover {
  opacity: 1;
}

.form-message {
  font-size: 0.9rem;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  text-align: center;
}

.form-message--error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #FCA5A5;
}

.form-message--success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6EE7B7;
}

.form-message[hidden] {
  display: none;
}

.level-selector--form {
  margin-bottom: 0;
  animation: none;
}

/* ============================================================
   AVATAR PICKER
   ============================================================ */
.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.avatar-picker__option {
  width: 52px;
  height: 52px;
  font-size: 1.6rem;
  border-radius: 50%;
  border: 2px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-picker__option:hover {
  border-color: var(--purple);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
  transform: scale(1.08);
}

.avatar-picker__option--active {
  border-color: var(--purple);
  background: rgba(124, 58, 237, 0.25);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.6);
}

/* ============================================================
   CHILD SELECTION
   ============================================================ */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-top: 2rem;
}

.dashboard-header__title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 12px rgba(124, 58, 237, 0.5);
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cyan);
  text-align: center;
  margin-bottom: 2rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.children-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  padding-bottom: 3rem;
}

.child-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 1.75rem 1.25rem;
  text-align: center;
  transition: all var(--transition);
  animation: slide-up 0.6s ease both;
}

.child-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 8px 40px rgba(124, 58, 237, 0.35);
  border-color: rgba(124, 58, 237, 0.4);
}

.child-card__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 1rem;
  background: rgba(124, 58, 237, 0.15);
  border: 2px solid rgba(124, 58, 237, 0.4);
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.4);
}

.child-card__name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.35rem;
}

.child-card__level {
  font-size: 0.8rem;
  color: var(--cyan);
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
}

.child-card__stars {
  font-size: 0.85rem;
  color: var(--gold);
  margin-bottom: 1rem;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.child-card__btn {
  width: 100%;
}

.child-card--add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  cursor: pointer;
  border-style: dashed;
  border-color: rgba(6, 182, 212, 0.35);
}

.child-card--add:hover {
  border-color: var(--cyan);
  box-shadow: 0 8px 40px rgba(6, 182, 212, 0.3);
}

.child-card--add .child-card__plus {
  font-size: 3rem;
  color: var(--cyan);
  line-height: 1;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 16px rgba(6, 182, 212, 0.6);
}

.child-card--add .child-card__add-label {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.7);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.child-card--add[hidden] {
  display: none;
}

/* ============================================================
   HOME — CHILD BAR
   ============================================================ */
.child-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-top: 1rem;
}

.child-bar__greeting {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--subtitle-color);
  text-shadow: 0 0 10px color-mix(in srgb, var(--subtitle-color) 40%, transparent);
}

.child-bar__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-theme-palette {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-theme-palette:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent-primary) 40%, transparent);
  transform: scale(1.08);
}

/* Welcome screen responsive — landing mobile tweaks in landing section above */
@media (max-width: 540px) {
  .auth-card {
    padding: 2rem 1.25rem;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .dashboard-header__title {
    font-size: 1.1rem;
  }

  .children-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   EXERCISE ENGINE
   ============================================================ */
.exercise-root {
  min-height: 100vh;
  padding: 1rem 1.25rem 3rem;
  max-width: 720px;
  margin: 0 auto;
}

.exercise-shell {
  animation: fade-in-down 0.4s ease;
}

.exercise-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.exercise-topbar__title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--cyan);
  letter-spacing: 0.06em;
}

.exercise-progress {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: rgba(226, 232, 240, 0.6);
  margin-bottom: 1.25rem;
  letter-spacing: 0.08em;
}

.exercise-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 2rem 1.5rem;
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.15);
  transition: box-shadow 0.3s ease;
}

.exercise-flash--correct {
  box-shadow: 0 0 0 3px #16A34A !important;
  border-color: #16A34A !important;
}

.exercise-shake {
  animation: exercise-shake 0.5s ease;
  box-shadow: 0 0 0 3px #DC2626 !important;
}

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

.exercise-btn-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.exercise-question {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1rem 0;
  color: #fff;
}

.exercise-mc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.exercise-mc-btn {
  padding: 1rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  cursor: pointer;
  transition: all var(--transition);
}

.exercise-mc-btn:hover {
  border-color: var(--purple);
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
}

.exercise-mc-btn--correct {
  background: rgba(16, 185, 129, 0.35) !important;
  border-color: var(--green) !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.6) !important;
}

.exercise-mc-btn--wrong {
  background: rgba(239, 68, 68, 0.3) !important;
  border-color: #EF4444 !important;
}

/* Reading */
.reading-word {
  font-family: var(--font-heading);
  font-size: 5rem;
  font-weight: 900;
  text-align: center;
  color: #fff;
  text-shadow: 0 0 20px var(--purple), 0 0 40px rgba(124, 58, 237, 0.5);
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.reading-word--sm {
  font-size: 3rem;
}

.reading-split {
  text-align: center;
  font-size: 1.3rem;
  color: var(--cyan);
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}

.reading-hint {
  text-align: center;
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.5);
  margin-bottom: 1.25rem;
}

.letter-boxes {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.letter-box {
  width: 52px;
  height: 58px;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 10px;
  border: 2px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(226, 232, 240, 0.5);
  cursor: pointer;
  transition: all var(--transition);
}

.letter-box--revealed {
  color: #fff;
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.5);
  background: rgba(6, 182, 212, 0.15);
}

.reading-sentence {
  text-align: center;
  font-size: 1rem;
  color: rgba(226, 232, 240, 0.75);
  margin: 1.25rem 0;
  line-height: 1.6;
}

.exercise-highlight {
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.6);
  font-weight: 700;
}

/* Writing */
.writing-prompt {
  text-align: center;
  margin-bottom: 0.75rem;
  min-height: 100px;
}

.writing-attempt {
  text-align: center;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.5);
  margin-bottom: 0.5rem;
}

.writing-input {
  width: 100%;
  padding: 14px;
  font-family: var(--font-heading);
  font-size: 2rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--cyan);
  border-radius: 14px;
  outline: none;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.25);
  margin-bottom: 1rem;
}

.touch-keyboard {
  margin-bottom: 1rem;
}

.touch-keyboard__row {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.touch-key {
  min-width: 36px;
  height: 44px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  transition: all var(--transition);
}

.touch-key:hover {
  background: rgba(124, 58, 237, 0.3);
  border-color: var(--purple);
}

.touch-key--wide {
  min-width: 56px;
}

.writing-feedback {
  text-align: center;
  margin-top: 1rem;
  min-height: 2rem;
}

.feedback--correct {
  color: var(--green);
  font-weight: 700;
  font-size: 1.1rem;
}

.feedback--reveal {
  color: var(--cyan);
  margin-top: 0.5rem;
}

.letter-feedback span {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin: 0 0.15rem;
}

.letter-correct { color: var(--green); }
.letter-wrong { color: #EF4444; }

/* Maths */
.math-sum {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 900;
  text-align: center;
  color: #fff;
  text-shadow: 0 0 20px var(--purple);
  margin-bottom: 1rem;
}

.math-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.math-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-block;
}

.math-dot--purple {
  background: var(--purple);
  box-shadow: 0 0 8px var(--purple);
}

.math-dot--cyan {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.math-op {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--pink);
  margin: 0 0.5rem;
}

.clock-canvas {
  display: block;
  margin: 0 auto 1rem;
  max-width: 100%;
  height: auto;
}

.calendar-title {
  font-family: var(--font-heading);
  text-align: center;
  font-size: 1.1rem;
  color: var(--cyan);
  margin-bottom: 0.75rem;
}

.calendar-grid {
  margin-bottom: 1rem;
}

.calendar-header,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.calendar-header span {
  font-size: 0.7rem;
  color: rgba(226, 232, 240, 0.5);
  padding: 0.25rem;
}

.calendar-days span {
  font-size: 0.85rem;
  padding: 0.4rem;
  border-radius: 6px;
  color: rgba(226, 232, 240, 0.75);
}

.calendar-day--today {
  background: rgba(124, 58, 237, 0.35);
  color: #fff !important;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
  font-weight: 700;
}

/* Life Skills */
.colour-circle {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.shape-svg {
  width: 200px;
  height: 200px;
  display: block;
  margin: 0 auto 1rem;
  filter: drop-shadow(0 0 12px var(--purple));
}

.day-strip,
.month-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.day-strip__item,
.month-strip__item {
  font-size: 0.7rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  color: rgba(226, 232, 240, 0.6);
}

.day-strip__item--active,
.month-strip__item--active {
  background: rgba(124, 58, 237, 0.35);
  border-color: var(--purple);
  color: #fff;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.5);
}

/* Session summary */
.exercise-shell--summary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90vh;
}

.summary-card {
  text-align: center;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 2.5rem 2rem;
  box-shadow: 0 0 50px rgba(124, 58, 237, 0.3);
  max-width: 420px;
  width: 100%;
}

.summary-card__emoji {
  font-size: 4rem;
  display: block;
  margin-bottom: 0.75rem;
}

.summary-card__score {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: #fff;
  margin-bottom: 0.35rem;
}

.summary-card__pct {
  color: var(--cyan);
  margin-bottom: 1rem;
}

.summary-card__stars {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 8px var(--gold));
}

.summary-card__message {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: rgba(226, 232, 240, 0.85);
}

.summary-card__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Exercise celebration + confetti */
.exercise-celebration {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(10, 14, 26, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.exercise-celebration[hidden] {
  display: none;
}

.exercise-celebration__title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  text-shadow:
    0 0 10px var(--purple),
    0 0 20px var(--cyan),
    0 0 30px var(--pink);
  z-index: 2;
  animation: float-gentle 2s ease-in-out infinite;
}

.confetti-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti-particle {
  position: absolute;
  top: -10px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0.3; }
}

/* Adaptive level popup */
.level-popup {
  position: fixed;
  inset: 0;
  z-index: 96;
  background: rgba(10, 14, 26, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.level-popup[hidden] {
  display: none;
}

.level-popup__card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 2rem 1.5rem;
  max-width: 360px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 40px rgba(124, 58, 237, 0.4);
}

.level-popup__text {
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  color: rgba(226, 232, 240, 0.9);
}

.level-popup__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

@media (max-width: 540px) {
  .reading-word {
    font-size: 3rem;
  }

  .math-sum {
    font-size: 2rem;
  }

  .exercise-mc-grid {
    grid-template-columns: 1fr;
  }

  .touch-key {
    min-width: 28px;
    height: 38px;
    font-size: 0.75rem;
  }
}

/* ============================================================
   THEME PICKER & MODAL
   ============================================================ */
.theme-picker {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.25rem 0 0.75rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.theme-picker::-webkit-scrollbar {
  height: 4px;
}

.theme-picker::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 4px;
}

.theme-card {
  flex: 0 0 120px;
  width: 120px;
  height: 80px;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  position: relative;
  scroll-snap-align: start;
  transition: all var(--transition);
}

.theme-card:hover {
  transform: scale(1.04);
}

.theme-card--active {
  border-color: var(--accent-primary, #7C3AED);
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent-primary, #7C3AED) 50%, transparent);
}

.theme-card__emoji {
  font-size: 1.5rem;
}

.theme-card__name {
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  text-align: center;
  line-height: 1.2;
  padding: 0 4px;
}

body.theme-light-app .theme-card__name {
  color: #1A1A1A;
  text-shadow: none;
}

.theme-card__check {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.85rem;
  color: #fff;
  background: var(--accent-primary, #7C3AED);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* (old theme-modal block superseded by new tpc block above) */

.theme-picker--modal {
  /* inherits flex from parent, tpc-list handles layout */
}

/* Marvel lightning flash */
.theme-lightning {
  position: fixed;
  inset: 0;
  z-index: 3;
  background: rgba(255, 255, 255, 0.10);
  pointer-events: none;
}

.theme-lightning[hidden] { display: none; }

/* =================================================================
   LIGHT APP THEME — comprehensive text colour overrides
   All 5 themes are light/pastel so every screen uses these rules.
   ================================================================= */

/* --- Body base --- */
body.theme-light-app {
  color: var(--theme-text-primary, #1E293B);
}

/* --- Headings & app title --- */
body.theme-light-app h1,
body.theme-light-app h2,
body.theme-light-app h3,
body.theme-light-app h4 {
  color: var(--theme-text-primary, #1E293B);
  text-shadow: none;
}

/* Bodhvik app title matches theme accent */
body.theme-light-app .header__title {
  color: var(--theme-accent, #7C3AED);
  text-shadow: none;
}

/* Dashboard & children screen */
body.theme-light-app .section-title {
  color: var(--theme-accent, #7C3AED);
  text-shadow: none;
}
body.theme-light-app .dashboard-header__title {
  color: var(--theme-text-primary, #1E293B);
  text-shadow: none;
}

/* Child cards */
body.theme-light-app .child-card {
  background: rgba(255,255,255,0.92);
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
body.theme-light-app .child-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  border-color: rgba(0,0,0,0.12);
}
body.theme-light-app .child-card__name {
  color: var(--theme-text-primary, #1E293B);
}
body.theme-light-app .child-card__level {
  color: var(--theme-text-secondary, #64748B);
}
body.theme-light-app .child-card__stars {
  color: var(--gold, #D97706);
  text-shadow: none;
}
body.theme-light-app .child-card__avatar {
  background: color-mix(in srgb, var(--theme-accent, #7C3AED) 12%, transparent);
  border-color: color-mix(in srgb, var(--theme-accent, #7C3AED) 30%, transparent);
  box-shadow: none;
}
body.theme-light-app .child-card--add {
  border-color: color-mix(in srgb, var(--theme-accent, #7C3AED) 30%, transparent);
}
body.theme-light-app .child-card--add:hover {
  border-color: var(--theme-accent, #7C3AED);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--theme-accent, #7C3AED) 20%, transparent);
}
body.theme-light-app .child-card__plus {
  color: var(--theme-accent, #7C3AED);
  text-shadow: none;
}
body.theme-light-app .child-card__add-label {
  color: var(--theme-text-secondary, #64748B);
}

/* Auth card titles (create account / sign in screens) */
body.theme-light-app .auth-card__title,
body.theme-light-app .auth-card__title--purple,
body.theme-light-app .auth-card__title--cyan {
  color: var(--theme-text-primary, #1E293B);
  text-shadow: none;
}
body.theme-light-app .auth-card__link {
  color: var(--theme-text-secondary, #64748B);
}
body.theme-light-app .auth-card__link a {
  color: var(--theme-accent, #7C3AED);
}
body.theme-light-app .auth-card__link a:hover {
  color: var(--theme-accent, #7C3AED);
  text-shadow: none;
  filter: brightness(0.85);
}

/* Form labels + inputs */
body.theme-light-app .form-group label {
  color: var(--theme-text-primary, #1E293B);
}
body.theme-light-app .form-input {
  color: var(--theme-text-primary, #1E293B);
  background: #ffffff;
  border-color: #E2E8F0;
}
body.theme-light-app .form-input::placeholder {
  color: var(--theme-text-muted, #94A3B8);
}
body.theme-light-app .form-input:focus {
  border-color: var(--theme-accent, #7C3AED);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-accent, #7C3AED) 18%, transparent);
  background: #ffffff;
}

/* Buttons */
body.theme-light-app .btn--ghost {
  color: var(--theme-text-primary, #1E293B);
  background: #ffffff;
  border-color: #E2E8F0;
  backdrop-filter: none;
}
body.theme-light-app .btn--ghost:hover {
  border-color: var(--theme-accent, #7C3AED);
  color: var(--theme-accent, #7C3AED);
  box-shadow: none;
}
body.theme-light-app .btn--secondary {
  background: color-mix(in srgb, var(--theme-accent, #7C3AED) 12%, transparent);
  border-color: var(--theme-accent, #7C3AED);
  color: var(--theme-accent, #7C3AED);
  box-shadow: none;
}
body.theme-light-app .btn--secondary:hover {
  background: var(--theme-accent, #7C3AED);
  color: #ffffff;
  box-shadow: none;
}
body.theme-light-app .card__btn {
  background: var(--theme-btn-bg, #7C3AED);
  color: #ffffff;
  border: none;
}
body.theme-light-app .card__btn:hover {
  filter: brightness(1.1);
  color: #ffffff;
}

/* Level selector buttons */
body.theme-light-app .level-btn {
  color: var(--theme-text-secondary, #64748B);
  background: transparent;
  border: 1.5px solid #E2E8F0;
  box-shadow: none;
  backdrop-filter: none;
}
body.theme-light-app .level-btn:hover {
  color: var(--theme-text-primary, #1E293B);
  border-color: var(--theme-accent, #7C3AED);
  box-shadow: none;
}
body.theme-light-app .level-btn--active {
  background: var(--theme-btn-bg, #7C3AED);
  border-color: var(--theme-btn-bg, #7C3AED);
  color: #ffffff;
  box-shadow: none;
}
body.theme-light-app .level-btn--active::after {
  border-color: var(--theme-accent, #7C3AED);
}

/* Progress panel */
body.theme-light-app .progress-panel {
  background: rgba(255,255,255,0.92);
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}
body.theme-light-app .progress-panel__title {
  color: var(--theme-accent, #7C3AED);
  text-shadow: none;
}
body.theme-light-app .progress-panel__stat-value {
  color: var(--theme-text-primary, #1E293B);
}
body.theme-light-app .progress-panel__stat-label {
  color: var(--theme-text-secondary, #64748B);
}
body.theme-light-app .progress-panel__message {
  color: var(--theme-text-primary, #1E293B);
}
body.theme-light-app .progress-panel__stat-icon--gold {
  filter: none;
}

/* Exercise card wrapper */
body.theme-light-app .exercise-card {
  background: rgba(255,255,255,0.92);
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

/* Exercise topbar */
body.theme-light-app .exercise-topbar__title {
  color: var(--theme-accent, #7C3AED);
}
body.theme-light-app .exercise-progress {
  color: var(--theme-text-secondary, #64748B);
}

/* Question text */
body.theme-light-app .exercise-question {
  color: var(--theme-text-primary, #1E293B);
}

/* Multiple-choice answer buttons */
body.theme-light-app .exercise-mc-btn {
  color: var(--theme-text-primary, #1E293B);
  background: #ffffff;
  border: 1.5px solid #E2E8F0;
}
body.theme-light-app .exercise-mc-btn:hover {
  background: color-mix(in srgb, var(--theme-accent, #7C3AED) 8%, white);
  border-color: var(--theme-accent, #7C3AED);
  box-shadow: none;
}
body.theme-light-app .exercise-mc-btn--correct {
  background: #DCFCE7 !important;
  color: #166534 !important;
  border-color: #16A34A !important;
  box-shadow: none !important;
}
body.theme-light-app .exercise-mc-btn--wrong {
  background: #FEE2E2 !important;
  color: #991B1B !important;
  border-color: #DC2626 !important;
  box-shadow: none !important;
}

/* Reading exercises */
body.theme-light-app .reading-word {
  color: var(--theme-text-primary, #1E293B);
  text-shadow: none;
}
body.theme-light-app .reading-split {
  color: var(--theme-accent, #7C3AED);
}
body.theme-light-app .reading-hint {
  color: var(--theme-text-secondary, #64748B);
}
body.theme-light-app .reading-sentence {
  color: var(--theme-text-secondary, #64748B);
}
body.theme-light-app .exercise-highlight {
  color: var(--theme-accent, #7C3AED);
  text-shadow: none;
}
body.theme-light-app .letter-box {
  color: var(--theme-text-muted, #94A3B8);
  background: #ffffff;
  border-color: #E2E8F0;
}
body.theme-light-app .letter-box--revealed {
  color: var(--theme-text-primary, #1E293B);
  border-color: var(--theme-accent, #7C3AED);
  background: color-mix(in srgb, var(--theme-accent, #7C3AED) 10%, white);
  box-shadow: none;
}

/* Touch keyboard */
body.theme-light-app .touch-key {
  color: var(--theme-text-primary, #1E293B);
  background: #ffffff;
  border-color: #E2E8F0;
}
body.theme-light-app .touch-key:hover {
  background: var(--theme-accent, #7C3AED);
  color: #ffffff;
  border-color: var(--theme-accent, #7C3AED);
}

/* Writing exercises */
body.theme-light-app .writing-attempt {
  color: var(--theme-text-muted, #94A3B8);
}
body.theme-light-app .feedback--correct { color: #16A34A; }
body.theme-light-app .feedback--reveal  { color: var(--theme-accent, #7C3AED); }

/* Maths */
body.theme-light-app .math-sum {
  color: var(--theme-text-primary, #1E293B);
  text-shadow: none;
}
body.theme-light-app .math-op {
  color: var(--theme-accent, #7C3AED);
}

/* Calendar / life skills */
body.theme-light-app .calendar-title {
  color: var(--theme-accent, #7C3AED);
}
body.theme-light-app .calendar-header span {
  color: var(--theme-text-secondary, #64748B);
}
body.theme-light-app .calendar-days span {
  color: var(--theme-text-primary, #1E293B);
}
body.theme-light-app .calendar-day--today {
  background: color-mix(in srgb, var(--theme-accent, #7C3AED) 18%, white);
  color: var(--theme-accent, #7C3AED) !important;
  box-shadow: none;
  font-weight: 700;
}
body.theme-light-app .day-strip__item,
body.theme-light-app .month-strip__item {
  color: var(--theme-text-secondary, #64748B);
  border-color: #E2E8F0;
}
body.theme-light-app .day-strip__item--active,
body.theme-light-app .month-strip__item--active {
  background: var(--theme-accent, #7C3AED);
  border-color: var(--theme-accent, #7C3AED);
  color: #ffffff;
  box-shadow: none;
}

/* Summary card */
body.theme-light-app .summary-card {
  background: rgba(255,255,255,0.92);
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 4px 30px rgba(0,0,0,0.08);
}
body.theme-light-app .summary-card__score {
  color: var(--theme-text-primary, #1E293B);
}
body.theme-light-app .summary-card__pct {
  color: var(--theme-accent, #7C3AED);
}
body.theme-light-app .summary-card__message {
  color: var(--theme-text-secondary, #64748B);
}

/* Level-up popup */
body.theme-light-app .level-popup__card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
}
body.theme-light-app .level-popup__text {
  color: var(--theme-text-primary, #1E293B);
}

/* Delete modal text */
body.theme-light-app .delete-modal__message {
  color: var(--theme-text-secondary, #64748B);
}

/* Edit / add child card backgrounds */
body.theme-light-app .edit-child-modal__card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
}
body.theme-light-app .edit-child-modal__title {
  color: var(--theme-text-primary, #1E293B);
}

/* Navigation back buttons */
body.theme-light-app .btn-back {
  color: var(--theme-text-primary, #1E293B);
}

/* Score display inside exercises */
body.theme-light-app .exercise-topbar__score {
  color: var(--theme-text-primary, #1E293B);
}

/* Theme palette button */
body.theme-light-app .btn-theme-palette {
  background: #ffffff;
  border-color: #E2E8F0;
}
body.theme-light-app .btn-theme-palette:hover {
  border-color: var(--theme-accent, #7C3AED);
  box-shadow: none;
}

/* Child bar greeting uses subtitle-color which is now themed */
body.theme-light-app .child-bar__greeting {
  text-shadow: none;
}

/* ============================================================
   THEME BACKGROUNDS — PREMIUM
   ============================================================ */

/* Storybook orb container */
.storybook-orbs-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Storybook paper texture overlay */
body[data-child-theme="warner"]::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(0,0,0,0.012) 0px,
      rgba(0,0,0,0.012) 1px,
      transparent 1px,
      transparent 20px
    );
  background-size: 20px 20px;
}

/* Storybook soft floating orbs */
.storybook-orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  animation: orb-float ease-in-out infinite alternate;
  filter: blur(40px);
}

@keyframes orb-float {
  0%   { transform: translateY(0)   scale(1); }
  100% { transform: translateY(-5%) scale(1.04); }
}

/* Lightning flash (Superhero) */
.theme-lightning {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
}

.theme-lightning__bolt {
  width: 80px;
  height: auto;
  opacity: 0.9;
  filter: drop-shadow(0 0 14px #FBBF24);
}

/* ============================================================
   BACKGROUND ILLUSTRATION WATERMARKS
   ============================================================ */
.theme-decorations {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

/* Watermark containers */
.watermark {
  position: absolute;
  pointer-events: none;
  user-select: none;
}

/* Space — rocket, bottom right */
.watermark--space {
  bottom: -10px;
  right: 2%;
  opacity: 0.32;
}

.wm-rocket {
  animation: wm-float 6s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 18px rgba(124,58,237,0.35));
}

@keyframes wm-float {
  from { transform: translateY(0); }
  to   { transform: translateY(-15px); }
}

/* Kingdom — castle, bottom centre */
.watermark--disney {
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.22;
}

.wm-castle {
  animation: wm-castle-float 5s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 22px rgba(107,33,168,0.45));
}

@keyframes wm-castle-float {
  from { transform: translateY(0); }
  to   { transform: translateY(-12px); }
}

/* Superhero — shield right + lightning top-left */
.watermark--superhero {
  display: contents;
}

.wm-lightning {
  position: absolute;
  top: 5%;
  left: 2%;
  animation: wm-bolt-pulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 10px #F59E0B);
  opacity: 0.55;
}

@keyframes wm-bolt-pulse {
  0%, 100% { filter: drop-shadow(0 0 6px #F59E0B); transform: scale(1); }
  50%       { filter: drop-shadow(0 0 20px #FBBF24); transform: scale(1.06); }
}

.wm-shield {
  position: absolute;
  right: 1%;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.28;
  animation: wm-shield-spin 25s linear infinite;
  filter: drop-shadow(0 0 18px rgba(220,38,38,0.50));
}

@keyframes wm-shield-spin {
  from { transform: translateY(-50%) rotate(0deg); }
  to   { transform: translateY(-50%) rotate(360deg); }
}

/* Storybook — book, bottom right */
.watermark--storybook {
  bottom: -10px;
  right: 1%;
  opacity: 0.22;
}

.wm-book {
  animation: wm-book-breathe 4s ease-in-out infinite alternate;
}

@keyframes wm-book-breathe {
  from { transform: scale(1); }
  to   { transform: scale(1.02); }
}

/* Forest — tree, bottom left */
.watermark--forest {
  bottom: -10px;
  left: 1%;
  opacity: 0.22;
}

.wm-tree {
  transform-origin: bottom center;
  animation: wm-tree-sway 4s ease-in-out infinite alternate;
}

@keyframes wm-tree-sway {
  from { transform: rotate(-1.5deg); }
  to   { transform: rotate(1.5deg); }
}

/* Storybook light-theme card overrides */
body[data-child-theme="warner"] .card__content {
  background: rgba(255,255,255,0.88);
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.10);
}

body[data-child-theme="warner"] .card__border {
  background: var(--card-reading-border) !important;
}

body[data-child-theme="warner"] .card__btn {
  color: #ffffff;
  border: none;
}

body[data-child-theme="warner"] .card__icon {
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
}

/* ============================================================
   AVATAR SYSTEM
   ============================================================ */
/* ============================================================
   AVATAR PICKER — fixed-size grid, no overlap
   ============================================================ */
.avatar-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.avatar-tabs {
  display: flex;
  gap: 6px;
}

.avatar-tabs__btn {
  flex: 1;
  padding: 8px 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.avatar-tabs__btn--active {
  border-color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 22%, transparent);
}

/* Scrollable panel wrapper */
.avatar-panel {
  display: grid;
  grid-template-columns: repeat(4, 70px);
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px 2px;
  justify-content: start;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}

.avatar-panel--drawn {
  grid-template-columns: repeat(3, 70px);
}

/* Each avatar cell: fixed 70×70, self-contained */
.avatar-option {
  position: relative;
  width: 70px;
  height: 70px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--glass-border);
  background: var(--glass-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  transition: all var(--transition);
  overflow: hidden;
  box-sizing: border-box;
}

.avatar-option--drawn {
  border-radius: 14px;
}

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

.avatar-option--active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent-primary) 50%, transparent);
}

.avatar-option__check {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.62rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  z-index: 2;
  pointer-events: none;
}

/* Drawn avatar inside button — fixed size, centred */
.avatar-option--drawn .drawn-avatar {
  width: 54px !important;
  height: 54px !important;
  border: none;
}

.emoji-avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent-primary) 20%, transparent);
  border: 2px solid var(--glass-border);
}

.drawn-avatar {
  position: relative;
  border-radius: 50%;
  background: #FDBA74;
  border: 2px solid var(--glass-border);
  overflow: hidden;
}

.da-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding-top: 35%;
  gap: 4px;
}

.da-eye {
  width: 8px;
  height: 8px;
  background: #1A1A1A;
  border-radius: 50%;
}

.da-eye--blue { background: #3B82F6; box-shadow: inset 0 0 0 3px #1A1A1A; }
.da-eye--wide { width: 10px; height: 12px; border-radius: 50%; }
.da-eye--star {
  width: 10px; height: 10px;
  background: #FBBF24;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.da-mouth {
  width: 14px;
  height: 6px;
  border-bottom: 2px solid #1A1A1A;
  border-radius: 0 0 50% 50%;
  margin-top: 2px;
}

.da-mouth--smile { border-bottom-width: 3px; width: 16px; }
.da-mouth--o { width: 8px; height: 8px; border: 2px solid #1A1A1A; border-radius: 50%; border-bottom: 2px solid #1A1A1A; }
.da-mouth--grin { width: 18px; height: 8px; background: #1A1A1A; border-radius: 0 0 50% 50%; }
.da-mouth--dream { width: 16px; border-bottom-style: dashed; }
.da-mouth--confident { width: 12px; height: 3px; background: #1A1A1A; border: none; border-radius: 2px; margin-top: 6px; }

.da-hair {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 45%;
}

.da-hair--brown { background: #78350F; border-radius: 50% 50% 0 0; }
.da-hair--soft { background: #A16207; border-radius: 50% 50% 30% 30%; opacity: 0.85; }

.da-hair--pigtails::before,
.da-hair--pigtails::after {
  content: '';
  position: absolute;
  top: 20%;
  width: 18px;
  height: 28px;
  background: #92400E;
  border-radius: 50%;
}

.da-hair--pigtails::before { left: -4px; }
.da-hair--pigtails::after { right: -4px; }

.da-hair--pigtails {
  background: #92400E;
  border-radius: 50% 50% 0 0;
  height: 38%;
}

.da-smudge {
  position: absolute;
  bottom: 28%;
  right: 22%;
  width: 8px;
  height: 8px;
  background: #EC4899;
  border-radius: 50%;
  opacity: 0.7;
}

.da-glasses {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 16px;
  border: 2px solid #1A1A1A;
  border-radius: 8px;
  z-index: 2;
}

.da-glasses::before,
.da-glasses::after {
  content: '';
  position: absolute;
  top: 2px;
  width: 22px;
  height: 14px;
  border: 2px solid #1A1A1A;
  border-radius: 50%;
}

.da-glasses::before { left: 2px; }
.da-glasses::after { right: 2px; }

.da-cap {
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 30%;
  background: #DC2626;
  border-radius: 50% 50% 0 0;
  border: 2px solid #1A1A1A;
}

.da-cap::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: -8px;
  right: -8px;
  height: 8px;
  background: #DC2626;
  border: 2px solid #1A1A1A;
  border-radius: 4px;
}

.da-cape {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 55%;
  background: #DC2626;
  clip-path: polygon(0 0, 100% 0, 85% 100%, 15% 100%);
  opacity: 0.85;
}

/* Child card with edit */
.child-card {
  position: relative;
}

.child-card__edit {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 2;
}

.child-card__edit:hover {
  border-color: var(--accent-primary);
  transform: scale(1.08);
}

.child-card__avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}

/* ============================================================
   THEME PICKER MODAL — full-screen overlay, white card
   ============================================================ */
.theme-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.theme-modal[hidden] { display: none !important; }

.theme-modal__card {
  background: #ffffff;
  border-radius: 24px;
  padding: 32px;
  max-width: 560px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 60px rgba(0,0,0,0.2);
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}

.theme-modal__title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1E293B;
  text-align: center;
  margin-bottom: 24px;
  letter-spacing: 0.3px;
}

/* 2-column theme card grid */
.tpc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Theme picker card (tpc) — new clean design */
.tpc {
  display: flex;
  width: 100%;
  height: 80px;
  border-radius: 14px;
  border: 2px solid #E2E8F0;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  background: white;
  padding: 0;
  text-align: left;
}

.tpc:hover {
  border-color: rgba(0,0,0,0.2);
  transform: scale(1.01);
}

.tpc--active {
  border-color: var(--tpc-accent, #7C3AED);
  background: color-mix(in srgb, var(--tpc-accent, #7C3AED) 4%, white);
}

/* Left emoji panel */
.tpc__left {
  width: 80px;
  height: 100%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

/* Right info panel */
.tpc__right {
  flex: 1;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.tpc__top {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tpc__name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1E293B;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tpc__desc {
  font-size: 0.78rem;
  color: #64748B;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tpc__dots {
  display: flex;
  gap: 4px;
}

.tpc__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tpc__check {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--tpc-accent, #7C3AED);
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
  z-index: 2;
}

/* Apply / Cancel buttons */
.theme-modal__apply {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 20px;
  background: var(--theme-btn-bg, #7C3AED);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: filter 0.2s;
}

.theme-modal__apply:hover { filter: brightness(1.08); }

.theme-modal__cancel {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #64748B;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: center;
  margin-top: 12px;
  padding: 6px;
}

.theme-modal__cancel:hover { color: #1E293B; }

/* Legacy action row (kept for compatibility) */
.theme-modal__actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.theme-modal__actions .btn { flex: 1; height: 48px; font-weight: 700; }

/* ============================================================
   COMPACT THEME PICKER (child forms) — clean white cards
   ============================================================ */
.compact-theme-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ctc = compact theme card */
.ctc {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 72px;
  border-radius: 12px;
  padding: 0 16px 0 0;
  border: none;
  border-left: 6px solid var(--ctc-accent, #7C3AED);
  background: rgba(255,255,255,0.95);
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: background 0.15s ease, transform 0.15s ease;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
  overflow: hidden;
  flex-shrink: 0;
}

.ctc:hover {
  background: rgba(0,0,0,0.04);
  transform: scale(1.01);
}

.ctc--active {
  background: color-mix(in srgb, var(--ctc-accent, #7C3AED) 8%, white);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--ctc-accent, #7C3AED) 28%, transparent);
}

/* Left circle with gradient + emoji */
.ctc__circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-left: 12px;
  overflow: hidden;
}

/* Text block */
.ctc__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ctc__name {
  font-size: 14px;
  font-weight: 700;
  color: #1A1A1A;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ctc__desc {
  font-size: 12px;
  color: #64748B;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Checkmark — accent colour, right side */
.ctc__check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ctc-accent, #7C3AED);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.theme-preview-mini {
  width: 48px;
  height: auto;
}

/* Edit child modal */
.edit-child-modal {
  position: fixed;
  inset: 0;
  z-index: 98;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.edit-child-modal[hidden] {
  display: none;
}

.edit-child-modal__card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 2rem 1.5rem;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.edit-child-modal__title {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-heading, 700);
  text-align: center;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.edit-child-modal__actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.edit-child-modal__actions .btn {
  flex: 1;
}

@media (max-width: 480px) {
  /* On very small screens, allow 3-column emoji grid */
  .avatar-panel { grid-template-columns: repeat(3, 70px); }
  .avatar-panel--drawn { grid-template-columns: repeat(2, 70px); }
  .theme-modal__card { padding: 24px 16px; }
  .tpc-grid { grid-template-columns: 1fr; }
  .ctc { height: 64px; }
  .ctc__circle { width: 38px; height: 38px; font-size: 1.1rem; }
}

/* ============================================================
   SVG CHARACTER DECORATIONS — float animation
   ============================================================ */
@keyframes characterFloat {
  from { transform: translateY(0px); }
  to   { transform: translateY(-10px); }
}

.theme-character {
  position: absolute;
  opacity: 0.14;
  animation: characterFloat 6s ease-in-out infinite alternate;
  pointer-events: none;
  display: block;
}

.theme-character svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Hide decorative characters on small screens */
@media (max-width: 767px) {
  .hide-mobile { display: none !important; }
}

/* Also hide all characters on very small mobile to avoid overlap */
@media (max-width: 480px) {
  .theme-character { display: none !important; }
}

/* ============================================================
   FEEDBACK SYSTEM
   ============================================================ */

/* App footer (home screen, contains hidden admin link) */
.app-footer {
  padding: 1.5rem 0 0.75rem;
  text-align: center;
}
.app-footer__admin-link {
  font-size: 0.72rem;
  color: #CBD5E1;
  background: none;
  border: none;
  cursor: pointer;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s ease;
}
.app-footer__admin-link:hover {
  color: #94A3B8;
}

/* ── Floating Action Button ── */
.feedback-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.feedback-fab[hidden] { display: none; }

.feedback-fab__tooltip {
  background: #1E293B;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 50px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.feedback-fab:hover .feedback-fab__tooltip {
  opacity: 1;
  transform: translateY(0);
}

.feedback-fab__btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #E2E8F0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  line-height: 1;
}
.feedback-fab__btn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
}

/* ── Feedback Modal ── */
.feedback-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.feedback-modal[hidden] { display: none; }

.feedback-modal__card {
  background: #ffffff;
  border-radius: 24px;
  padding: 28px 28px 24px;
  max-width: 480px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0,0,0,0.2);
  animation: fade-in-down 0.25s ease;
}

.feedback-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}
.feedback-modal__title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1E293B;
  margin-bottom: 4px;
}
.feedback-modal__subtitle {
  font-size: 0.88rem;
  color: #64748B;
  line-height: 1.5;
}
.feedback-modal__close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F1F5F9;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748B;
  transition: background 0.2s ease;
}
.feedback-modal__close:hover {
  background: #E2E8F0;
  color: #1E293B;
}

/* Form fields */
.feedback-field {
  margin-bottom: 20px;
}
.feedback-label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: #1E293B;
  margin-bottom: 8px;
}

/* Stars */
.feedback-stars {
  display: flex;
  gap: 6px;
}
.feedback-star {
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #D1D5DB;
  line-height: 1;
  padding: 2px;
  transition: color 0.15s ease, transform 0.15s ease;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feedback-star:hover,
.feedback-star.feedback-star--filled {
  color: #F59E0B;
}
.feedback-star:hover {
  transform: scale(1.15);
}

/* Category pills */
.feedback-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.feedback-cat-btn {
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  color: #64748B;
  border-radius: 50px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-family: var(--font-body, 'Nunito', sans-serif);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.feedback-cat-btn:hover {
  border-color: var(--theme-accent, #7C3AED);
  color: var(--theme-accent, #7C3AED);
}
.feedback-cat-btn--selected {
  background: color-mix(in srgb, var(--theme-accent, #7C3AED) 10%, white);
  border-color: var(--theme-accent, #7C3AED);
  color: var(--theme-accent, #7C3AED);
  font-weight: 700;
}

/* Textarea */
.feedback-textarea {
  width: 100%;
  min-height: 100px;
  max-height: 200px;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  padding: 12px;
  font-size: 0.95rem;
  font-family: var(--font-body, 'Nunito', sans-serif);
  color: #1E293B;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
  line-height: 1.55;
}
.feedback-textarea:focus {
  border-color: var(--theme-accent, #7C3AED);
}
.feedback-textarea::placeholder {
  color: #94A3B8;
}
.feedback-char-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  min-height: 20px;
}
.feedback-char-count {
  font-size: 0.78rem;
  color: #94A3B8;
  text-align: right;
  margin-left: auto;
}

/* Error messages */
.feedback-error {
  font-size: 0.82rem;
  color: #DC2626;
  margin-top: 4px;
}
.feedback-error[hidden] { display: none; }

@keyframes feedback-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.feedback-shake { animation: feedback-shake 0.4s ease; }

/* Submit button */
.feedback-submit-btn {
  width: 100%;
  height: 48px;
  background: var(--theme-btn-bg, #7C3AED);
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  font-family: var(--font-body, 'Nunito', sans-serif);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: filter 0.2s ease, opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.feedback-submit-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}
.feedback-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Spinner */
.feedback-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Success state */
.feedback-modal__success {
  text-align: center;
  padding: 16px 0 8px;
}
.feedback-modal__success[hidden] { display: none; }
.feedback-success__icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 16px;
}
.feedback-success__title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1E293B;
  margin-bottom: 8px;
}
.feedback-success__msg {
  font-size: 0.95rem;
  color: #64748B;
  line-height: 1.6;
}

/* ── Admin Dashboard ── */
.admin-root {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.admin-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-top: 0.5rem;
  flex-wrap: wrap;
}
.admin-back {
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--theme-text-primary, #1E293B);
  background: none;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.admin-back:hover { border-color: var(--theme-accent, #7C3AED); }
.admin-title {
  flex: 1;
  font-size: 1.4rem;
  font-weight: 800;
  color: #1E293B;
}
.admin-export-btn {
  font-size: 0.82rem;
  font-weight: 700;
  background: #1E293B;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.admin-export-btn:hover { background: #334155; }

/* Stats row */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 1.5rem;
}
.admin-stat-card {
  background: #ffffff;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
}
.admin-stat-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: #1E293B;
  line-height: 1.1;
}
.admin-stat-label {
  font-size: 0.75rem;
  color: #64748B;
  margin-top: 4px;
  display: block;
}

/* Filter buttons */
.admin-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.admin-filter-btn {
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-body, 'Nunito', sans-serif);
  border-radius: 50px;
  border: 1.5px solid #E2E8F0;
  background: #F8FAFC;
  color: #64748B;
  cursor: pointer;
  transition: all 0.15s ease;
}
.admin-filter-btn:hover {
  border-color: #1E293B;
  color: #1E293B;
}
.admin-filter-btn--active {
  background: #1E293B;
  border-color: #1E293B;
  color: #ffffff;
}

/* Feedback cards */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-loading {
  color: #64748B;
  font-size: 0.95rem;
  text-align: center;
  padding: 2rem 0;
}

.admin-fb-card {
  background: #ffffff;
  border: 1.5px solid #E2E8F0;
  border-radius: 16px;
  padding: 16px 18px;
  transition: opacity 0.2s ease;
}
.admin-fb-card--reviewed {
  opacity: 0.55;
}

.admin-fb-card__top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.admin-fb-card__stars {
  font-size: 1rem;
  color: #F59E0B;
  letter-spacing: 2px;
}
.admin-fb-card__cat {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
  background: #F1F5F9;
  color: #475569;
}
.admin-fb-card__reviewed-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94A3B8;
  padding: 2px 8px;
  border: 1px solid #E2E8F0;
  border-radius: 50px;
  margin-left: auto;
}

.admin-fb-card__message {
  font-size: 0.95rem;
  color: #1E293B;
  line-height: 1.6;
  margin-bottom: 10px;
}

.admin-fb-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.75rem;
  color: #64748B;
  margin-bottom: 12px;
}

.admin-fb-card__mark-btn {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748B;
  background: #F8FAFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.admin-fb-card__mark-btn:hover {
  background: #DCFCE7;
  border-color: #16A34A;
  color: #16A34A;
}

@media (max-width: 540px) {
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-title { font-size: 1.1rem; }
}

/* ============================================================
   ADMIN SCREEN (onclick-driven simple dashboard)
   ============================================================ */
.act-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem 1.25rem;
  background: #ffffff;
  border-bottom: 1px solid #E2E8F0;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
}
.act-title {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 800;
  color: #1E293B;
}
.back-btn {
  background: none;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 1rem;
  cursor: pointer;
  color: #1E293B;
  font-weight: 700;
  transition: border-color 0.15s ease;
}
.back-btn:hover { border-color: #1E293B; }

.act-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 4rem;
}

.admin-filter {
  padding: 6px 14px;
  border-radius: 50px;
  border: 1.5px solid #E2E8F0;
  background: white;
  color: #64748B;
  font-family: Nunito, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.admin-filter.active {
  background: #1E293B;
  color: white;
  border-color: #1E293B;
}
.admin-filter:hover:not(.active) {
  border-color: #1E293B;
  color: #1E293B;
}

.feedback-card {
  background: white;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: opacity 0.2s ease;
}
.feedback-card.reviewed {
  opacity: 0.5;
}
