/* ===================================================================
   Ayeshu ki Sehat Kahani — Princess PWA Stylesheet
   Made with love for My Queen
   Palette: Pastel Pink / Lavender / White / Gold
   =================================================================== */

/* ---------- 1. ROOT TOKENS ---------- */
:root {
  /* Colors */
  --pink-1: #ffe5f0;
  --pink-2: #ffc8dd;
  --pink-3: #ff8fab;
  --pink-4: #ff6b95;
  --lav-1: #f3e8ff;
  --lav-2: #e0c3fc;
  --lav-3: #c8b6ff;
  --lav-4: #b388eb;
  --gold-1: #fff4c2;
  --gold-2: #ffe98a;
  --gold-3: #f9c74f;
  --gold-4: #e6a817;
  --white-soft: #fffafd;
  --text-main: #4a3f52;
  --text-soft: #7a6b80;
  --text-faint: #a89cae;
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.85);
  --shadow-soft: 0 10px 30px rgba(180, 120, 160, 0.18);
  --shadow-float: 0 18px 50px rgba(180, 120, 160, 0.22);
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --nav-h: 74px;
  --header-h: 70px;

  /* Fonts */
  --font-body: 'Quicksand', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-script: 'Pacifico', 'Brush Script MT', cursive;
}

/* ---------- 2. RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overscroll-behavior-y: contain; }
body {
  font-family: var(--font-body);
  color: var(--text-main);
  background: linear-gradient(160deg, #ffe5f0 0%, #f3e8ff 45%, #fff4f9 100%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* ---------- 3. AMBIENT BACKGROUND ---------- */
.ambient-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.cloud {
  position: absolute;
  width: 200px; height: 90px;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.9), rgba(255,255,255,0) 70%),
              radial-gradient(circle at 65% 60%, rgba(255,255,255,0.85), rgba(255,255,255,0) 70%),
              radial-gradient(circle at 80% 45%, rgba(255,255,255,0.8), rgba(255,255,255,0) 70%);
  filter: blur(2px);
  animation: cloudDrift 60s linear infinite;
  opacity: 0.7;
}
.cloud-1 { top: 8%; left: -20%; animation-duration: 70s; }
.cloud-2 { top: 35%; left: -30%; animation-duration: 90s; animation-delay: -20s; transform: scale(1.4); }
.cloud-3 { top: 65%; left: -25%; animation-duration: 80s; animation-delay: -40s; transform: scale(0.9); }
@keyframes cloudDrift {
  from { transform: translateX(0); }
  to { transform: translateX(150vw); }
}

.floating-layer { position: absolute; inset: 0; pointer-events: none; }

.heart {
  position: absolute;
  font-size: 18px;
  color: var(--pink-3);
  animation: floatUp linear infinite;
  opacity: 0;
  filter: drop-shadow(0 2px 4px rgba(255, 143, 171, 0.4));
}
@keyframes floatUp {
  0% { transform: translateY(20vh) translateX(0) rotate(0); opacity: 0; }
  10% { opacity: 0.9; }
  50% { transform: translateY(50vh) translateX(15px) rotate(10deg); }
  90% { opacity: 0.9; }
  100% { transform: translateY(-10vh) translateX(-10px) rotate(-10deg); opacity: 0; }
}

.butterfly {
  position: absolute;
  font-size: 22px;
  animation: butterflyFly 18s ease-in-out infinite;
  opacity: 0.85;
  filter: drop-shadow(0 3px 6px rgba(180, 140, 200, 0.3));
}
@keyframes butterflyFly {
  0%   { transform: translate(-10vw, 70vh) rotate(-5deg); }
  25%  { transform: translate(30vw, 40vh) rotate(8deg); }
  50%  { transform: translate(60vw, 60vh) rotate(-6deg); }
  75%  { transform: translate(80vw, 30vh) rotate(10deg); }
  100% { transform: translate(110vw, 50vh) rotate(-8deg); }
}

.sparkle {
  position: absolute;
  width: 14px; height: 14px;
  background: radial-gradient(circle, #fff 0%, var(--gold-2) 40%, transparent 70%);
  border-radius: 50%;
  animation: sparkleBlink 2.5s ease-in-out infinite;
  opacity: 0;
}
@keyframes sparkleBlink {
  0%, 100% { opacity: 0; transform: scale(0.4); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ---------- 4. SPLASH SCREEN ---------- */
.splash-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #ffe5f0 0%, #f3e8ff 50%, #fff4f9 100%);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.splash-screen.fade-out { opacity: 0; transform: scale(1.05); pointer-events: none; }
.splash-content { text-align: center; padding: 24px; }
.splash-crown { width: 130px; margin: 0 auto 18px; animation: crownBob 2.5s ease-in-out infinite; }
.splash-crown svg { width: 100%; height: auto; filter: drop-shadow(0 8px 16px rgba(230, 168, 23, 0.4)); }
@keyframes crownBob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-12px) rotate(2deg); }
}
.splash-title {
  font-family: var(--font-script);
  font-size: 34px;
  background: linear-gradient(90deg, var(--pink-4), var(--lav-4), var(--gold-4));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.splash-subtitle { font-size: 15px; color: var(--text-soft); margin-bottom: 30px; }
.splash-loader { display: flex; gap: 8px; justify-content: center; }
.splash-loader span {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--pink-3);
  animation: dotBounce 1.2s ease-in-out infinite;
}
.splash-loader span:nth-child(2) { background: var(--lav-3); animation-delay: 0.2s; }
.splash-loader span:nth-child(3) { background: var(--gold-3); animation-delay: 0.4s; }
@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.5); opacity: 0.4; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* ---------- 5. APP SHELL ---------- */
.app-shell {
  position: relative; z-index: 1;
  max-width: 520px; margin: 0 auto;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
}
.app-shell.hidden { display: none; }

.app-header {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  padding: 0 14px;
  background: linear-gradient(180deg, rgba(255, 250, 253, 0.95) 0%, rgba(255, 250, 253, 0.75) 100%);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  display: flex; align-items: center;
}
.header-inner { display: flex; align-items: center; gap: 10px; width: 100%; }
.header-crown-mini { width: 36px; height: 30px; flex-shrink: 0; }
.header-crown-mini svg { width: 100%; height: 100%; animation: crownBob 4s ease-in-out infinite; }
.header-titles { flex: 1; min-width: 0; }
.header-title { font-size: 18px; color: var(--pink-4); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-sub { font-size: 12px; color: var(--text-soft); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--lav-4); transition: transform 0.2s, background 0.2s;
}
.icon-btn:active { transform: scale(0.9); background: var(--pink-2); }

/* ---------- 6. SCREEN CONTAINER ---------- */
.screen-container { flex: 1; position: relative; }
.screen {
  display: none;
  animation: screenIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.screen.active { display: block; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.screen-pad { padding: 16px 14px calc(var(--nav-h) + 30px); }

/* ---------- 7. GLASS CARD BASE ---------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

/* ---------- 8. BUTTONS ---------- */
.btn-primary {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px;
  background: linear-gradient(135deg, var(--pink-3), var(--pink-4));
  color: #fff; font-weight: 600; font-size: 15px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(255, 107, 149, 0.35);
  transition: transform 0.15s, box-shadow 0.2s;
}
.btn-primary:active { transform: scale(0.95); box-shadow: 0 4px 12px rgba(255, 107, 149, 0.3); }
.btn-primary.sm { padding: 8px 16px; font-size: 13px; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-soft {
  padding: 12px 20px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  color: var(--pink-4); font-weight: 600; font-size: 14px;
  border-radius: 999px;
  transition: transform 0.15s;
}
.btn-soft:active { transform: scale(0.95); }
.btn-soft.danger { color: #d94e6f; background: rgba(255, 200, 220, 0.6); }
.ripple {
  position: absolute; border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0); animation: rippleAnim 0.6s ease-out;
  pointer-events: none;
}
@keyframes rippleAnim {
  to { transform: scale(3.5); opacity: 0; }
}

/* ---------- 9. HOME — HERO ---------- */
.hero-card {
  position: relative; overflow: hidden;
  padding: 24px 20px; text-align: center; margin-bottom: 16px;
}
.hero-glow {
  position: absolute; inset: -50%;
  background: radial-gradient(circle at 30% 20%, rgba(255, 143, 171, 0.25), transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(200, 182, 255, 0.25), transparent 50%);
  pointer-events: none;
}
.hero-greeting { font-size: 14px; color: var(--text-soft); position: relative; }
.hero-name {
  font-family: var(--font-script);
  font-size: 32px; margin: 4px 0 10px;
  background: linear-gradient(90deg, var(--pink-4), var(--lav-4));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  position: relative;
}
.hero-msg { font-size: 15px; color: var(--text-main); line-height: 1.6; margin-bottom: 18px; position: relative; }
.hero-card .btn-primary { position: relative; }

/* ---------- 10. HOME — PROGRESS ---------- */
.progress-card {
  padding: 22px 20px; text-align: center; margin-bottom: 18px;
  position: relative; overflow: hidden;
}
.progress-crown-wrap { position: relative; height: 90px; margin-bottom: 8px; display: flex; align-items: center; justify-content: center; }
.progress-crown { width: 80px; transition: transform 0.4s; }
.progress-crown svg { width: 100%; height: auto; filter: drop-shadow(0 4px 10px rgba(230, 168, 23, 0.4)); }
.progress-crown.celebrate { animation: crownCelebrate 1.2s ease-in-out; }
@keyframes crownCelebrate {
  0%, 100% { transform: scale(1) rotate(0); }
  25% { transform: scale(1.2) rotate(-8deg); }
  50% { transform: scale(1.3) rotate(8deg); }
  75% { transform: scale(1.2) rotate(-4deg); }
}
.progress-stars {
  position: absolute; inset: 0; display: flex; gap: 6px; justify-content: center; align-items: center;
  pointer-events: none;
}
.star {
  font-size: 20px; opacity: 0; transform: scale(0); transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--gold-3); filter: drop-shadow(0 2px 4px rgba(249, 199, 79, 0.5));
}
.star.lit { opacity: 1; transform: scale(1); }
.card-title { font-size: 18px; color: var(--text-main); margin-bottom: 4px; }
.card-sub { font-size: 13px; color: var(--text-soft); margin-bottom: 14px; }
.progress-bar {
  height: 12px; background: rgba(255, 255, 255, 0.5); border-radius: 999px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--pink-3), var(--lav-3), var(--gold-3));
  background-size: 200% 100%;
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  animation: gradShift 3s linear infinite;
}
@keyframes gradShift { to { background-position: 200% 0; } }
.progress-count { margin-top: 8px; font-size: 13px; color: var(--text-soft); }
.progress-count strong { color: var(--pink-4); }

/* ---------- 11. SECTION HEADING ---------- */
.section-heading {
  font-size: 16px; color: var(--text-main); margin: 20px 4px 12px;
  display: flex; align-items: center; gap: 8px;
}
.section-heading::before {
  content: ''; width: 4px; height: 18px;
  background: linear-gradient(180deg, var(--pink-3), var(--lav-3));
  border-radius: 4px;
}

/* ---------- 12. MEDICINE GRID ---------- */
.med-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.med-card {
  position: relative; overflow: hidden;
  padding: 16px 12px; text-align: center;
  background: var(--glass-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s;
}
.med-card:active { transform: scale(0.96); }
.med-card.done {
  background: linear-gradient(135deg, rgba(255, 233, 240, 0.9), rgba(243, 232, 255, 0.9));
  border-color: var(--pink-3);
}
.med-card.done::after {
  content: '✓'; position: absolute; top: 8px; right: 10px;
  color: #fff; background: var(--pink-4); width: 22px; height: 22px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }
.med-emoji { font-size: 32px; margin-bottom: 6px; }
.med-name { font-size: 13px; font-weight: 700; color: var(--text-main); line-height: 1.2; }
.med-time { font-size: 11px; color: var(--text-soft); margin-top: 2px; }
.med-detail { font-size: 10px; color: var(--text-faint); margin-top: 4px; line-height: 1.3; }

/* ---------- 13. QUICK LINKS ---------- */
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-link {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; text-align: left;
  background: var(--glass-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s;
}
.quick-link:active { transform: scale(0.96); }
.ql-icon {
  width: 42px; height: 42px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--pink-1), var(--lav-1));
}
.ql-text { display: flex; flex-direction: column; min-width: 0; }
.ql-text strong { font-size: 13px; color: var(--text-main); }
.ql-text span { font-size: 11px; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 14. PAGE TITLE CARD ---------- */
.page-title-card {
  padding: 22px 20px; margin-bottom: 16px; text-align: center;
  position: relative; overflow: hidden;
}
.page-title {
  font-family: var(--font-script);
  font-size: 26px;
  background: linear-gradient(90deg, var(--pink-4), var(--lav-4));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
.page-sub { font-size: 13px; color: var(--text-soft); }

/* ---------- 15. SCHEDULE — TIMELINE ---------- */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: ''; position: absolute; left: 12px; top: 6px; bottom: 6px; width: 3px;
  background: linear-gradient(180deg, var(--pink-3), var(--lav-3), var(--gold-3));
  border-radius: 4px;
}
.tl-item {
  position: relative; margin-bottom: 14px;
  padding: 14px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  animation: slideInLeft 0.5s ease both;
}
.tl-item:nth-child(1) { animation-delay: 0.05s; }
.tl-item:nth-child(2) { animation-delay: 0.1s; }
.tl-item:nth-child(3) { animation-delay: 0.15s; }
.tl-item:nth-child(4) { animation-delay: 0.2s; }
.tl-item:nth-child(5) { animation-delay: 0.25s; }
.tl-item:nth-child(6) { animation-delay: 0.3s; }
.tl-item:nth-child(7) { animation-delay: 0.35s; }
.tl-item:nth-child(8) { animation-delay: 0.4s; }
.tl-item:nth-child(9) { animation-delay: 0.45s; }
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
.tl-item::before {
  content: ''; position: absolute; left: -22px; top: 18px;
  width: 14px; height: 14px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pink-3), var(--lav-3));
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--pink-3);
}
.tl-item.highlight::before {
  background: linear-gradient(135deg, var(--gold-2), var(--gold-4));
  box-shadow: 0 0 0 2px var(--gold-3), 0 0 12px var(--gold-3);
}
.tl-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.tl-time { font-size: 13px; font-weight: 700; color: var(--pink-4); }
.tl-emoji { font-size: 22px; }
.tl-title { font-size: 15px; font-weight: 700; color: var(--text-main); margin-bottom: 2px; }
.tl-desc { font-size: 12px; color: var(--text-soft); line-height: 1.5; }
.tl-tag {
  display: inline-block; margin-top: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 600;
  background: rgba(255, 143, 171, 0.15); color: var(--pink-4);
}
.tl-tag.gold { background: rgba(249, 199, 79, 0.2); color: var(--gold-4); }
.tl-tag.lav { background: rgba(200, 182, 255, 0.2); color: var(--lav-4); }

/* ---------- 16. CALLOUT ---------- */
.callout {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px; margin-top: 16px;
  background: linear-gradient(135deg, rgba(255, 250, 253, 0.85), rgba(243, 232, 255, 0.75));
  border: 1px solid var(--pink-2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}
.callout-icon { font-size: 36px; flex-shrink: 0; }
.callout-body strong { display: block; color: var(--pink-4); font-size: 15px; margin-bottom: 4px; }
.callout-body p { font-size: 13px; color: var(--text-main); line-height: 1.5; }

/* ---------- 17. STORY BOOK ---------- */
.story-book { padding: 20px 16px; margin-bottom: 16px; }
.story-pages { position: relative; min-height: 280px; }
.story-page {
  display: none; animation: pageIn 0.5s ease;
}
.story-page.active { display: block; }
@keyframes pageIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
.sp-emoji { font-size: 56px; text-align: center; margin-bottom: 12px; animation: spBob 3s ease-in-out infinite; }
@keyframes spBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.sp-title {
  font-family: var(--font-script); font-size: 22px; text-align: center;
  background: linear-gradient(90deg, var(--pink-4), var(--lav-4));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}
.sp-text { font-size: 14px; line-height: 1.7; color: var(--text-main); text-align: center; }
.sp-text strong { color: var(--pink-4); }
.story-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.story-dots { display: flex; gap: 6px; }
.story-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255, 143, 171, 0.3); transition: all 0.3s;
}
.story-dot.active { background: var(--pink-4); width: 22px; border-radius: 999px; }

/* ---------- 18. ANIMATIONS ---------- */
.anim-card { padding: 18px 16px; margin-bottom: 16px; }
.anim-title { font-size: 16px; color: var(--text-main); margin-bottom: 4px; }
.anim-desc { font-size: 12px; color: var(--text-soft); margin-bottom: 14px; }
.anim-stage {
  position: relative; overflow: hidden;
  height: 200px; margin-bottom: 14px;
  background: linear-gradient(180deg, rgba(255, 250, 253, 0.7), rgba(243, 232, 255, 0.5));
  border-radius: var(--radius-md);
  border: 1px dashed rgba(200, 182, 255, 0.4);
}
.anim-body-castle, .anim-blood, .anim-tongue {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 40px; opacity: 0.9;
}
.anim-character {
  position: absolute; font-size: 32px;
  display: flex; flex-direction: column; align-items: center;
  transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.anim-character span { font-size: 10px; color: var(--text-soft); margin-top: 2px; font-weight: 600; background: rgba(255,255,255,0.7); padding: 1px 6px; border-radius: 8px; }
.thyroid-princess { left: 16px; top: 40%; }
.milk-carton { left: 16px; top: 10%; opacity: 0; }
.calcium-knight { left: 50%; top: 50%; opacity: 0; }
.iron-princess { left: 16px; top: 50%; }
.tea-monster { left: 45%; top: 20%; opacity: 0; }
.milk-castle { left: 45%; top: 75%; opacity: 0; }
.vitc-fairy { left: 16px; top: 10%; opacity: 0; }
.b12-princess { left: 16px; top: 50%; }
.anim-glow-path {
  position: absolute; left: 20%; top: 50%; width: 0; height: 4px;
  background: linear-gradient(90deg, var(--lav-3), var(--gold-2));
  border-radius: 4px; transition: width 1.5s ease; transform: translateY(-50%);
  box-shadow: 0 0 12px var(--lav-3);
}
.anim-play { width: 100%; margin-top: 4px; }
.anim-lesson {
  margin-top: 12px; padding: 12px;
  background: rgba(255, 233, 240, 0.5); border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.6; color: var(--text-main);
  border-left: 3px solid var(--pink-3);
  min-height: 20px;
}
.anim-lesson:empty { display: none; }

/* ---------- 19. GAMES HUB ---------- */
.game-cards { display: grid; gap: 14px; }
.game-card {
  padding: 20px; text-align: left;
  background: var(--glass-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s;
  position: relative; overflow: hidden;
}
.game-card:active { transform: scale(0.97); }
.game-card::after {
  content: ''; position: absolute; right: -30px; top: -30px;
  width: 100px; height: 100px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 143, 171, 0.18), transparent 70%);
}
.game-emoji { font-size: 40px; margin-bottom: 8px; }
.game-card h3 { font-size: 17px; color: var(--text-main); margin-bottom: 4px; }
.game-card p { font-size: 13px; color: var(--text-soft); margin-bottom: 10px; }
.game-go {
  display: inline-block; font-size: 13px; font-weight: 700;
  color: var(--pink-4); padding: 4px 0;
}

/* ---------- 20. QUIZ ---------- */
.quiz-card { padding: 22px 18px; margin-bottom: 16px; }
.quiz-progress { font-size: 12px; color: var(--text-soft); margin-bottom: 14px; text-align: center; }
.quiz-question {
  font-size: 17px; line-height: 1.5; color: var(--text-main);
  margin-bottom: 18px; text-align: center;
}
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  padding: 14px 16px; text-align: left;
  background: var(--glass-bg-strong);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-md);
  font-size: 14px; color: var(--text-main); font-weight: 500;
  transition: all 0.2s;
  position: relative; overflow: hidden;
}
.quiz-option:active { transform: scale(0.98); }
.quiz-option.correct {
  background: linear-gradient(135deg, #d4f5dd, #b8ecc9);
  border-color: #6fc97f; color: #2d7a3d;
}
.quiz-option.wrong {
  background: linear-gradient(135deg, #ffd9d9, #ffb8b8);
  border-color: #e88a8a; color: #b03a3a;
  animation: shake 0.4s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
#quizNext { margin-top: 16px; width: 100%; }
.quiz-result { padding: 28px 22px; text-align: center; }
.result-crown { font-size: 60px; margin-bottom: 10px; animation: crownBob 2s ease-in-out infinite; }
.quiz-result h3 { font-family: var(--font-script); font-size: 26px; color: var(--pink-4); margin-bottom: 6px; }
.quiz-result p { font-size: 14px; color: var(--text-main); margin-bottom: 12px; line-height: 1.6; }
.result-stars { font-size: 28px; margin-bottom: 18px; display: flex; gap: 6px; justify-content: center; }
.result-stars .star { opacity: 1; transform: scale(1); }
.quiz-result .btn-primary { width: 100%; margin-bottom: 10px; }

/* ---------- 21. DRAG & DROP ---------- */
.dd-card { padding: 18px 16px; margin-bottom: 16px; }
.dd-instruction { font-size: 13px; color: var(--text-soft); margin-bottom: 14px; text-align: center; }
.dd-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.dd-slot {
  min-height: 90px; padding: 10px;
  background: rgba(255, 255, 255, 0.4);
  border: 2px dashed var(--lav-3);
  border-radius: var(--radius-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: all 0.25s;
  text-align: center;
}
.dd-slot.over { background: rgba(200, 182, 255, 0.25); border-color: var(--lav-4); transform: scale(1.04); }
.dd-slot.correct { background: rgba(180, 230, 200, 0.4); border-color: #6fc97f; border-style: solid; }
.dd-slot.wrong { background: rgba(255, 200, 200, 0.4); border-color: #e88a8a; animation: shake 0.4s; }
.dd-slot-label { font-size: 12px; font-weight: 700; color: var(--text-main); margin-bottom: 4px; }
.dd-slot-time { font-size: 10px; color: var(--text-soft); }
.dd-slot-filled { font-size: 28px; margin-top: 4px; }
.dd-items {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  min-height: 60px; padding: 10px;
  background: rgba(255, 255, 255, 0.4); border-radius: var(--radius-md);
}
.dd-item {
  padding: 10px 14px; background: var(--glass-bg-strong);
  border: 1.5px solid var(--glass-border);
  border-radius: 999px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  cursor: grab; transition: transform 0.15s;
  touch-action: none;
}
.dd-item:active { cursor: grabbing; transform: scale(0.95); }
.dd-item.placed { opacity: 0.3; pointer-events: none; }
.dd-item-emoji { font-size: 18px; }
.dd-feedback {
  margin-top: 14px; padding: 12px; border-radius: var(--radius-sm);
  font-size: 13px; text-align: center; min-height: 20px;
}
.dd-feedback.success { background: rgba(180, 230, 200, 0.4); color: #2d7a3d; }
.dd-feedback.error { background: rgba(255, 200, 200, 0.4); color: #b03a3a; }
.dd-controls { display: flex; gap: 10px; margin-top: 14px; }
.dd-controls button { flex: 1; }

/* ---------- 22. MEMORY ---------- */
.mem-card { padding: 18px 16px; margin-bottom: 16px; }
.mem-stats {
  display: flex; justify-content: space-around;
  font-size: 13px; color: var(--text-soft); margin-bottom: 14px;
}
.mem-stats strong { color: var(--pink-4); }
.mem-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  perspective: 800px;
}
.mem-card-item {
  aspect-ratio: 1;
  position: relative; cursor: pointer;
  transition: transform 0.5s;
  transform-style: preserve-3d;
}
.mem-card-item.flipped { transform: rotateY(180deg); }
.mem-card-item.matched { animation: matchedPop 0.6s; }
@keyframes matchedPop {
  0%, 100% { transform: rotateY(180deg) scale(1); }
  50% { transform: rotateY(180deg) scale(1.1); }
}
.mem-face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); padding: 4px; text-align: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  font-size: 22px;
}
.mem-front {
  background: linear-gradient(135deg, var(--pink-3), var(--lav-3));
  color: #fff; font-size: 28px;
  box-shadow: 0 4px 10px rgba(255, 143, 171, 0.3);
}
.mem-back {
  background: var(--glass-bg-strong); border: 1.5px solid var(--glass-border);
  transform: rotateY(180deg);
  font-size: 11px; line-height: 1.2; color: var(--text-main);
}
.mem-back strong { font-size: 13px; color: var(--pink-4); }
.mem-feedback { margin-top: 14px; font-size: 13px; text-align: center; min-height: 20px; color: var(--text-soft); }
#memRestart { width: 100%; margin-top: 12px; }

/* ---------- 23. REWARDS ---------- */
.rewards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.reward-card {
  padding: 16px 12px; text-align: center;
  background: var(--glass-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  position: relative; overflow: hidden;
  transition: transform 0.3s;
}
.reward-card.unlocked {
  background: linear-gradient(135deg, rgba(255, 244, 194, 0.7), rgba(255, 233, 240, 0.7));
  border-color: var(--gold-3);
  animation: rewardGlow 2s ease-in-out infinite;
}
@keyframes rewardGlow {
  0%, 100% { box-shadow: 0 4px 14px rgba(249, 199, 79, 0.2); }
  50% { box-shadow: 0 4px 24px rgba(249, 199, 79, 0.5); }
}
.reward-emoji { font-size: 40px; margin-bottom: 6px; filter: grayscale(1) opacity(0.4); transition: filter 0.4s; }
.reward-card.unlocked .reward-emoji { filter: none; animation: rewardBounce 0.8s; }
@keyframes rewardBounce {
  0% { transform: scale(0) rotate(-180deg); }
  60% { transform: scale(1.3) rotate(20deg); }
  100% { transform: scale(1) rotate(0); }
}
.reward-name { font-size: 13px; font-weight: 700; color: var(--text-main); }
.reward-desc { font-size: 11px; color: var(--text-soft); margin-top: 2px; }
.reward-locked-overlay {
  position: absolute; top: 6px; right: 6px;
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: rgba(0,0,0,0.05); color: var(--text-faint);
}
.reward-card.unlocked .reward-locked-overlay { display: none; }

/* ---------- 24. LETTER ---------- */
.letter-card {
  position: relative; padding: 30px 22px; text-align: center;
  background: linear-gradient(135deg, rgba(255, 250, 253, 0.95), rgba(243, 232, 255, 0.9));
  overflow: hidden;
}
.letter-seal {
  font-size: 50px; margin-bottom: 14px;
  animation: heartBeat 1.6s ease-in-out infinite;
}
@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.2); }
  28% { transform: scale(1); }
  42% { transform: scale(1.2); }
}
.letter-title {
  font-family: var(--font-script); font-size: 30px; margin-bottom: 18px;
  background: linear-gradient(90deg, var(--pink-4), var(--lav-4));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.letter-body p {
  font-size: 15px; line-height: 1.9; color: var(--text-main); margin-bottom: 12px;
}
.letter-body strong { color: var(--pink-4); }
.letter-sign {
  font-family: var(--font-script); font-size: 22px;
  color: var(--pink-4); margin-top: 16px !important;
}
.letter-flutter {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 143, 171, 0.15), transparent 30%),
    radial-gradient(circle at 90% 80%, rgba(200, 182, 255, 0.15), transparent 30%);
}

/* ---------- 25. SETTINGS ---------- */
.settings-card { padding: 18px 16px; margin-bottom: 14px; }
.settings-section-title { font-size: 15px; color: var(--pink-4); margin-bottom: 12px; }
.settings-text { font-size: 13px; color: var(--text-main); line-height: 1.6; margin-bottom: 10px; }
.settings-text.small { font-size: 12px; color: var(--text-soft); }
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  font-size: 13px; color: var(--text-main); font-weight: 600;
}
.setting-row:last-of-type { border-bottom: none; }
.setting-row input[type="time"] {
  padding: 6px 10px; border-radius: 10px;
  border: 1.5px solid var(--lav-3);
  background: var(--glass-bg-strong); color: var(--text-main);
  font-size: 13px;
}
#enableNotifBtn { width: 100%; margin-top: 12px; }
.settings-note { font-size: 12px; color: var(--text-soft); margin-top: 8px; text-align: center; }
.pet-names { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pet-name {
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: linear-gradient(135deg, var(--pink-1), var(--lav-1));
  border: 1px solid var(--glass-border); color: var(--text-main);
}
.disclaimer-card { background: linear-gradient(135deg, rgba(255, 244, 194, 0.6), rgba(255, 250, 253, 0.6)); }
#resetProgress { width: 100%; }

/* ---------- 26. BOTTOM NAV ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; height: var(--nav-h);
  background: linear-gradient(180deg, rgba(255, 250, 253, 0.92), rgba(255, 250, 253, 0.98));
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.7);
  display: flex; align-items: stretch;
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -8px 24px rgba(180, 120, 160, 0.12);
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--text-faint); font-size: 10px; font-weight: 600;
  transition: color 0.2s, transform 0.2s;
  position: relative;
}
.nav-btn svg { transition: transform 0.2s; }
.nav-btn.active { color: var(--pink-4); }
.nav-btn.active svg { transform: translateY(-2px) scale(1.1); }
.nav-btn.active::before {
  content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: 30px; height: 3px; border-radius: 999px;
  background: linear-gradient(90deg, var(--pink-3), var(--lav-3));
}
.nav-btn:active { transform: scale(0.92); }

/* ---------- 27. CONFETTI CANVAS ---------- */
.confetti-canvas {
  position: fixed; inset: 0; z-index: 200; pointer-events: none;
  width: 100%; height: 100%;
}

/* ---------- 28. TOAST ---------- */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 20px); left: 50%; transform: translateX(-50%) translateY(100px);
  padding: 12px 20px; max-width: 90%;
  background: linear-gradient(135deg, rgba(74, 63, 82, 0.95), rgba(122, 107, 128, 0.95));
  color: #fff; font-size: 13px; font-weight: 500;
  border-radius: 999px; box-shadow: var(--shadow-float);
  z-index: 250; opacity: 0;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 29. INSTALL PROMPT ---------- */
.install-prompt {
  position: fixed; bottom: calc(var(--nav-h) + 16px); left: 12px; right: 12px;
  z-index: 60; max-width: 496px; margin: 0 auto;
  animation: slideUp 0.4s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.install-inner {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: linear-gradient(135deg, rgba(255, 250, 253, 0.95), rgba(243, 232, 255, 0.95));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
}
.install-icon { font-size: 28px; }
.install-text { flex: 1; }
.install-text strong { display: block; font-size: 13px; color: var(--text-main); }
.install-text span { font-size: 11px; color: var(--text-soft); }
.install-close { font-size: 18px; color: var(--text-faint); padding: 4px 8px; }

/* ---------- 30. FOOTER SPACER ---------- */
.footer-spacer { height: 30px; }

/* ---------- 31. REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .cloud, .heart, .butterfly, .sparkle { display: none; }
}

/* ---------- 32. TABLET / DESKTOP ---------- */
@media (min-width: 600px) {
  .med-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .quick-links { grid-template-columns: 1fr 1fr 1fr; }
  .rewards-grid { grid-template-columns: 1fr 1fr 1fr; }
  .game-cards { grid-template-columns: 1fr 1fr 1fr; }
}

/* ---------- 33. SAFE AREA ---------- */
@supports (padding: env(safe-area-inset-top)) {
  .app-header { padding-top: env(safe-area-inset-top, 0); height: calc(var(--header-h) + env(safe-area-inset-top, 0)); }
}
