/* ======================================================
   Mascot — Children's Educational Platform
   Design System & Component Styles
   ====================================================== */

/* ── GOOGLE FONTS are loaded in <head> ── */

/* ── CSS CUSTOM PROPERTIES ── */
:root {
  /* Brand Colors */
  --clr-bg:        #FFF9F0;
  --clr-bg-warm:   #FFFDF5;
  --clr-pink:      #FF8FAB;
  --clr-pink-soft: #FFD6E7;
  --clr-mint:      #52D9A4;
  --clr-mint-soft: #B8F0D8;
  --clr-yellow:    #FFCF47;
  --clr-yellow-soft:#FFEAA7;
  --clr-lavender:  #9C7AF5;
  --clr-lavender-soft: #C8B6FF;
  --clr-peach:     #FFB347;
  --clr-peach-soft:#FFDCBA;
  --clr-teal:      #68D8D6;
  --clr-teal-soft: #A8EDEA;

  /* Text */
  --clr-text:       #3D2C5A;
  --clr-text-soft:  #7A6898;
  --clr-white:      #FFFFFF;

  /* Spacing */
  --sp-xs:  0.5rem;
  --sp-sm:  0.75rem;
  --sp-md:  1.25rem;
  --sp-lg:  2rem;
  --sp-xl:  3rem;

  /* Radii */
  --r-sm:   0.75rem;
  --r-md:   1.25rem;
  --r-lg:   2rem;
  --r-xl:   3rem;
  --r-full: 100vmax;

  /* Shadows */
  --shadow-card:  0 8px 28px rgba(100, 60, 160, 0.13);
  --shadow-hover: 0 16px 48px rgba(100, 60, 160, 0.22);
  --shadow-btn:   0 4px 16px rgba(100, 60, 160, 0.18);

  /* Typography */
  --font-display: 'Baloo 2', cursive;
  --font-body:    'Nunito', sans-serif;

  /* Transitions */
  --transition-fast: 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-med:  0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--clr-bg);
  color: var(--clr-text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  /* Page transition: fade in on load */
  animation: pageIn 0.28s ease both;
}

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

/* Fade-out class applied by JS before navigating */
body.page-exit {
  animation: pageOut 0.2s ease forwards;
}

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

/* ── FLOATING BUBBLES BACKGROUND ── */
.bubbles-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  opacity: 0.18;
  animation: floatBubble linear infinite;
}

.bubble:nth-child(1) { width: 80px; height: 80px; background: var(--clr-pink); left: 5%;  animation-duration: 18s; animation-delay: 0s;   bottom: -100px; }
.bubble:nth-child(2) { width: 50px; height: 50px; background: var(--clr-mint); left: 15%; animation-duration: 22s; animation-delay: -5s;  bottom: -100px; }
.bubble:nth-child(3) { width: 70px; height: 70px; background: var(--clr-yellow); left: 30%; animation-duration: 16s; animation-delay: -8s;  bottom: -100px; }
.bubble:nth-child(4) { width: 40px; height: 40px; background: var(--clr-lavender); left: 50%; animation-duration: 20s; animation-delay: -2s;  bottom: -100px; }
.bubble:nth-child(5) { width: 90px; height: 90px; background: var(--clr-teal); left: 65%; animation-duration: 25s; animation-delay: -12s; bottom: -100px; }
.bubble:nth-child(6) { width: 35px; height: 35px; background: var(--clr-peach); left: 75%; animation-duration: 19s; animation-delay: -4s;  bottom: -100px; }
.bubble:nth-child(7) { width: 60px; height: 60px; background: var(--clr-pink); left: 85%; animation-duration: 23s; animation-delay: -7s;  bottom: -100px; }
.bubble:nth-child(8) { width: 45px; height: 45px; background: var(--clr-mint); left: 92%; animation-duration: 17s; animation-delay: -10s; bottom: -100px; }

@keyframes floatBubble {
  0%   { translate: 0 0;       scale: 1;    opacity: 0; }
  10%  { opacity: 0.18; }
  90%  { opacity: 0.18; }
  100% { translate: 0 -110vh;  scale: 1.2;  opacity: 0; }
}

/* ── CORNER DECORATIONS ── */
.corner-deco {
  position: fixed;
  z-index: 1;
  pointer-events: none;
}
.corner-tl { top: 70px;  left: 10px; }
.corner-tr { top: 70px;  right: 10px; text-align: right; }
.corner-bl { bottom: 70px; left: 10px; }
.corner-br { bottom: 70px; right: 10px; text-align: right; }

.deco-star, .deco-rainbow, .deco-flower, .deco-cloud {
  font-size: 2rem;
  animation: wobble 3s ease-in-out infinite;
}
.corner-tr .deco-rainbow { animation-delay: -1s; }
.corner-bl .deco-flower  { animation-delay: -2s; }
.corner-br .deco-cloud   { animation-delay: -0.5s; }

.deco-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin: 4px;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}
.deco-dot.pink    { background: var(--clr-pink); }
.deco-dot.mint    { background: var(--clr-mint); animation-delay: -0.5s; }
.deco-dot.yellow  { background: var(--clr-yellow); animation-delay: -1s; }
.deco-dot.lavender{ background: var(--clr-lavender); animation-delay: -1.5s; }
.deco-dot.peach   { background: var(--clr-peach); animation-delay: -0.7s; }

@keyframes wobble {
  0%, 100% { rotate: -8deg; translate: 0 0; }
  50%       { rotate:  8deg; translate: 0 -6px; }
}
@keyframes pulse {
  0%, 100% { scale: 1; }
  50%       { scale: 1.5; }
}

/* ── HEADER ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 249, 240, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 3px solid var(--clr-pink-soft);
  padding: 0.6rem var(--sp-lg);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  translate: 0px;
  scale: 1;
  transition: scale var(--transition-fast);
}
.logo:hover { scale: 1.06; }

.logo-emoji {
  font-size: 2rem;
  animation: bounce 1.8s ease-in-out infinite;
  display: block;
}

/* Image-based logo icon (replaces emoji) */
.logo-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  object-position: center;
  display: block;
  flex-shrink: 0;
  animation: bounce 1.8s ease-in-out infinite;
  filter: drop-shadow(0 2px 6px rgba(255, 207, 71, 0.4));
}

@keyframes bounce {
  0%, 100% { translate: 0 0; }
  50%       { translate: 0 -6px; }
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.7rem;
  background: linear-gradient(135deg, var(--clr-pink), var(--clr-lavender), var(--clr-mint));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.nav-icons {
  display: flex;
  gap: var(--sp-sm);
}

.nav-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  background: var(--clr-white);
  border-radius: var(--r-full);
  text-decoration: none;
  color: var(--clr-text);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  border: 2.5px solid transparent;
  box-shadow: var(--shadow-btn);
  translate: 0px;
  scale: 1;
  transition: scale var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}
.nav-pill:hover {
  scale: 1.08;
  border-color: var(--clr-pink);
  background: var(--clr-pink-soft);
}
.nav-pill span:first-child { font-size: 1.1rem; }

.profile-bubble {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 3px solid var(--clr-lavender);
  background: var(--clr-lavender-soft);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-btn);
  translate: 0px;
  scale: 1;
  transition: scale var(--transition-fast);
}
.profile-bubble:hover { scale: 1.12; }

/* ── HERO ── */
.hero {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-xl) var(--sp-lg) var(--sp-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-content {
  display: flex;
  align-items: center;
  gap: var(--sp-xl);
  flex-wrap: wrap;
  justify-content: center;
}

/* Mascot */
.mascot-wrap {
  position: relative;
  flex-shrink: 0;
}

.mascot-img {
  width: 220px;
  height: 220px;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(255, 100, 140, 0.3));
  animation: mascotBounce 2.2s ease-in-out infinite;
  translate: 0px;
  scale: 1;
  transition: scale var(--transition-fast);
  cursor: pointer;
}
.mascot-img:hover { scale: 1.08; }

@keyframes mascotBounce {
  0%, 100% { translate: 0 0;     rotate: -2deg; }
  50%       { translate: 0 -14px; rotate: 2deg; }
}

.speech-bubble {
  position: absolute;
  top: -20px;
  right: -140px;
  background: var(--clr-white);
  border: 3px solid var(--clr-pink);
  border-radius: var(--r-lg) var(--r-lg) var(--r-lg) 0;
  padding: 0.6rem 1rem;
  max-width: 160px;
  box-shadow: 0 6px 24px rgba(255,100,140,0.15);
  animation: bubblePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -16px;
  left: -3px;
  width: 20px; height: 20px;
  background: var(--clr-white);
  border-left: 3px solid var(--clr-pink);
  border-bottom: 3px solid var(--clr-pink);
  border-radius: 0 0 0 80%;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

@keyframes bubblePop {
  from { scale: 0; opacity: 0; }
  to   { scale: 1; opacity: 1; }
}

.speech-text {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--clr-text);
  line-height: 1.4;
}

/* Hero text */
.hero-text { text-align: left; max-width: 380px; }

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--sp-sm);
}

.title-line1 {
  display: block;
  font-size: 3.5rem;
  color: var(--clr-lavender);
}

.title-line2 {
  display: block;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--clr-yellow), var(--clr-pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--clr-text-soft);
  font-weight: 600;
  margin-bottom: var(--sp-md);
}

.hero-cta-group {
  display: flex;
  gap: var(--sp-sm);
  flex-wrap: wrap;
}

/* Buttons */
.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.8rem 1.8rem;
  background: linear-gradient(135deg, var(--clr-pink), var(--clr-lavender));
  color: var(--clr-white);
  border: none;
  border-radius: var(--r-full);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 100, 140, 0.4);
  translate: 0px;
  scale: 1;
  transition: scale var(--transition-fast), box-shadow var(--transition-fast);
}
.btn-play:hover {
  scale: 1.08;
  box-shadow: 0 10px 32px rgba(255, 100, 140, 0.55);
}
.btn-play:active { scale: 0.96; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.8rem 1.6rem;
  background: var(--clr-white);
  color: var(--clr-lavender);
  border: 3px solid var(--clr-lavender-soft);
  border-radius: var(--r-full);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  translate: 0px;
  scale: 1;
  transition: scale var(--transition-fast), border-color var(--transition-fast);
}
.btn-secondary:hover {
  scale: 1.08;
  border-color: var(--clr-lavender);
  background: var(--clr-lavender-soft);
}

/* Floating shapes */
.floating-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.shape {
  position: absolute;
  font-size: 1.5rem;
  animation: floatShape ease-in-out infinite;
  opacity: 0.5;
}
.shape-circle {
  width: 60px; height: 60px;
  border-radius: 50%;
  top: 10%; right: 8%;
  animation-duration: 5s;
}
.shape-star {
  top: 70%; left: 5%;
  animation-duration: 6.5s;
  animation-delay: -2s;
  font-size: 2rem;
  color: var(--clr-yellow);
}
.shape-heart {
  top: 20%; left: 2%;
  animation-duration: 4.5s;
  animation-delay: -1s;
  color: var(--clr-pink);
  font-size: 1.8rem;
}
.shape-triangle {
  bottom: 10%; right: 5%;
  animation-duration: 7s;
  animation-delay: -3s;
  font-size: 1.2rem;
  color: var(--clr-mint);
}
.pink-shape  { background: var(--clr-pink-soft); }
.yellow-shape { }
.mint-shape  { }

@keyframes floatShape {
  0%, 100% { translate: 0 0;    rotate: 0deg;   }
  33%       { translate: 8px -12px; rotate: 10deg;  }
  66%       { translate: -6px 6px; rotate: -8deg;  }
}

/* ── CATEGORY BAR ── */
.category-bar {
  display: flex;
  gap: var(--sp-sm);
  padding: 0.75rem var(--sp-lg);
  max-width: 1200px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
  position: relative;
  z-index: 2;
}
.category-bar::-webkit-scrollbar { display: none; }

.cat-pill {
  flex-shrink: 0;
  padding: 0.55rem 1.2rem;
  background: var(--clr-white);
  border: 2.5px solid var(--clr-pink-soft);
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--clr-text);
  cursor: pointer;
  translate: 0px;
  scale: 1;
  transition: scale var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.cat-pill:hover {
  scale: 1.08;
  border-color: var(--clr-pink);
  background: var(--clr-pink-soft);
}
.cat-pill.active {
  background: linear-gradient(135deg, var(--clr-pink), var(--clr-lavender));
  border-color: transparent;
  color: var(--clr-white);
  box-shadow: 0 4px 16px rgba(255,100,140,0.35);
}

/* ── CONTENT SECTIONS ── */
.featured-section,
.content-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-lg) var(--sp-lg) 0;
  position: relative;
  z-index: 2;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-md);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--clr-text);
}

.see-all {
  color: var(--clr-lavender);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
  translate: 0px;
  scale: 1;
  transition: scale var(--transition-fast);
}
.see-all:hover { scale: 1.05; }

/* ── FEATURED CARD ── */
.featured-card {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  min-height: 200px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  translate: 0px;
  scale: 1;
  transition: scale var(--transition-med), box-shadow var(--transition-med);
  border: 3px solid rgba(255,255,255,0.8);
}
.featured-card:hover {
  scale: 1.02;
  box-shadow: var(--shadow-hover);
}
.featured-card:focus-visible {
  outline: 4px solid var(--clr-lavender);
  outline-offset: 3px;
}

.featured-bg {
  position: absolute;
  inset: 0;
}

.featured-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
  padding: var(--sp-lg);
}

.featured-icon-large {
  font-size: 5rem;
  flex-shrink: 0;
  animation: mascotBounce 2.5s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
}

.featured-info { flex: 1; }

.featured-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--clr-yellow), var(--clr-peach));
  color: var(--clr-text);
  font-weight: 800;
  font-size: 0.7rem;
  padding: 0.2rem 0.8rem;
  border-radius: var(--r-full);
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.featured-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  color: var(--clr-text);
  margin-bottom: 0.3rem;
}

.featured-desc {
  color: var(--clr-text-soft);
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.featured-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: var(--sp-sm);
}

.meta-tag {
  padding: 0.25rem 0.7rem;
  border-radius: var(--r-full);
  font-weight: 700;
  font-size: 0.8rem;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(4px);
  color: var(--clr-text);
}

.btn-play-card {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  background: linear-gradient(135deg, var(--clr-pink), var(--clr-lavender));
  color: var(--clr-white);
  border: none;
  border-radius: var(--r-full);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255,100,140,0.4);
  translate: 0px;
  scale: 1;
  transition: scale var(--transition-fast);
}
.btn-play-card:hover { scale: 1.08; }

.featured-confetti {
  position: absolute;
  top: var(--sp-sm);
  right: var(--sp-md);
  display: flex;
  gap: 0.3rem;
  font-size: 1.5rem;
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { translate: 0 0;    scale: 1; }
  50%       { translate: 0 -5px; scale: 1.15; }
}

/* ── GAME CARDS GRID ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--sp-md);
}
.cards-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Game card */
.game-card {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: var(--shadow-card);
  border: 3px solid rgba(255,255,255,0.8);
  translate: 0px;
  scale: 1;
  transition: scale var(--transition-med), box-shadow var(--transition-med);
}
.game-card:hover {
  scale: 1.04;
  box-shadow: var(--shadow-hover);
}
.game-card:focus-visible {
  outline: 4px solid var(--clr-lavender);
  outline-offset: 3px;
}

.card-bg {
  position: absolute;
  inset: 0;
}

.card-emoji {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -60%;
  font-size: 4.5rem;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.12));
  animation: floatShape 4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -0.7s);
}

.card-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, var(--glow-color, transparent) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.game-card:hover .card-glow { opacity: 0.5; }

.card-body {
  position: relative;
  z-index: 1;
  padding: var(--sp-sm) var(--sp-md);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 2px solid rgba(255,255,255,0.6);
}

.card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--clr-text);
  margin-bottom: 0.15rem;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--clr-text-soft);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

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

.age-badge {
  padding: 0.2rem 0.6rem;
  background: var(--clr-yellow-soft);
  border-radius: var(--r-full);
  font-weight: 800;
  font-size: 0.75rem;
  color: var(--clr-text);
  border: 2px solid var(--clr-yellow);
}

.card-play-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-pink), var(--clr-lavender));
  border: none;
  color: var(--clr-white);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(255,100,140,0.4);
  translate: 0px;
  scale: 1;
  transition: scale var(--transition-fast);
}
.card-play-btn:hover { scale: 1.18; }

.card-ribbon {
  position: absolute;
  top: 12px; right: -8px;
  background: linear-gradient(135deg, var(--clr-mint), var(--clr-teal));
  color: var(--clr-white);
  font-weight: 800;
  font-size: 0.65rem;
  padding: 0.25rem 0.8rem 0.25rem 0.6rem;
  border-radius: var(--r-full) 0 0 var(--r-full);
  letter-spacing: 0.04em;
  box-shadow: 0 3px 10px rgba(82,217,164,0.4);
}
.card-ribbon.hot {
  background: linear-gradient(135deg, var(--clr-yellow), var(--clr-pink));
}

/* ── VIDEO CARDS ── */
/* Link wrapper inside video cards */
.video-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.video-card {
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  background: var(--clr-white);
  box-shadow: var(--shadow-card);
  border: 3px solid rgba(255,255,255,0.9);
  translate: 0px;
  scale: 1;
  transition: scale var(--transition-med), box-shadow var(--transition-med);
}
.video-card:hover {
  scale: 1.04;
  box-shadow: var(--shadow-hover);
}
.video-card:focus-visible {
  outline: 4px solid var(--clr-lavender);
  outline-offset: 3px;
}

.video-thumb {
  position: relative;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.video-thumb-icon {
  font-size: 4rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
}

.video-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(61, 44, 90, 0.18);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.video-card:hover .video-play-overlay { opacity: 1; }

.video-play-circle {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--clr-white);
  color: var(--clr-pink);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  translate: 0px;
  scale: 0.9;
  transition: scale var(--transition-fast);
}
.video-card:hover .video-play-circle { scale: 1; }

.video-duration {
  position: absolute;
  bottom: 8px; right: 10px;
  background: rgba(61,44,90,0.75);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--r-sm);
}

.video-info {
  padding: 0.75rem 1rem;
}

.video-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--clr-text);
  margin-bottom: 0.2rem;
}

.video-views {
  font-size: 0.8rem;
  color: var(--clr-text-soft);
  font-weight: 600;
}

/* ── LEARN GRID ── */
.learn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--sp-md);
}

.learn-card {
  background: var(--clr-white);
  border-radius: var(--r-lg);
  padding: var(--sp-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  border: 3px solid rgba(255,255,255,0.9);
  translate: 0px;
  scale: 1;
  transition: scale var(--transition-med), box-shadow var(--transition-med);
}
.learn-card:hover {
  scale: 1.05;
  box-shadow: var(--shadow-hover);
}
.learn-card:focus-visible {
  outline: 4px solid var(--clr-lavender);
  outline-offset: 3px;
}

.learn-icon {
  width: 72px; height: 72px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  translate: 0px;
  scale: 1;
  transition: scale var(--transition-fast);
}
.learn-card:hover .learn-icon { scale: 1.1; }

.learn-label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: var(--clr-text);
}

.learn-progress {
  width: 100%;
  height: 8px;
  background: #EDE9F7;
  border-radius: var(--r-full);
  overflow: hidden;
}

.learn-progress-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── REWARD BANNER ── */
.reward-banner {
  max-width: 1200px;
  margin: var(--sp-xl) auto var(--sp-lg);
  padding: 0 var(--sp-lg);
  position: relative;
  z-index: 2;
}

.reward-inner {
  background: linear-gradient(135deg, #FFF0A0, #FFD6E7, #C8B6FF);
  border-radius: var(--r-xl);
  padding: var(--sp-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-md);
  border: 3px solid rgba(255,255,255,0.8);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.reward-inner::before {
  content: '🎉';
  position: absolute;
  right: 180px; top: -10px;
  font-size: 3rem;
  opacity: 0.3;
  animation: floatShape 5s ease-in-out infinite;
}

.reward-left {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.reward-icon {
  font-size: 3rem;
  animation: bounce 1.6s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(255,200,0,0.4));
}

.reward-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--clr-text);
}

.reward-desc {
  font-weight: 600;
  color: var(--clr-text-soft);
  font-size: 0.9rem;
}

.reward-stars {
  display: flex;
  gap: 0.5rem;
}
.reward-star {
  font-size: 2.2rem;
  animation: bounce 2s ease-in-out infinite;
}
.reward-star:nth-child(2) { animation-delay: -0.3s; }
.reward-star:nth-child(3) { animation-delay: -0.6s; }
.reward-star.empty { opacity: 0.35; filter: grayscale(1); }

/* ── FOOTER ── */
.site-footer {
  position: relative;
  z-index: 2;
  padding: var(--sp-lg);
  margin-top: var(--sp-xl);
  background: linear-gradient(135deg, var(--clr-lavender-soft), var(--clr-pink-soft));
  border-top: 3px solid rgba(255,255,255,0.7);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-sm);
  text-align: center;
}

.footer-mascot {
  font-size: 2.5rem;
  animation: bounce 2s ease-in-out infinite;
}

.footer-text {
  font-weight: 700;
  color: var(--clr-text-soft);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: var(--sp-md);
}

.footer-link {
  color: var(--clr-lavender);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  translate: 0px;
  scale: 1;
  transition: scale var(--transition-fast);
}
.footer-link:hover { scale: 1.08; }

/* ── MODAL (dialog) ── */
.play-modal {
  margin: auto;
  border: none;
  border-radius: var(--r-xl);
  padding: 0;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 24px 64px rgba(61,44,90,0.25);
  background: var(--clr-white);
  overflow: hidden;
}
.play-modal::backdrop {
  background: rgba(61, 44, 90, 0.45);
  backdrop-filter: blur(6px);
}
.play-modal[open] {
  animation: modalPop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes modalPop {
  from { scale: 0.7; opacity: 0; translate: 0 40px; }
  to   { scale: 1;   opacity: 1; translate: 0 0; }
}

.modal-inner {
  padding: var(--sp-xl) var(--sp-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-sm);
  text-align: center;
  background: linear-gradient(180deg, var(--clr-pink-soft) 0%, var(--clr-white) 40%);
}

.modal-close {
  position: absolute;
  top: 12px; right: 14px;
  background: var(--clr-pink-soft);
  border: none;
  border-radius: 50%;
  width: 32px; height: 32px;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--clr-pink);
  font-weight: 800;
  translate: 0px;
  scale: 1;
  transition: scale var(--transition-fast), background var(--transition-fast);
}
.modal-close:hover {
  scale: 1.15;
  background: var(--clr-pink);
  color: var(--clr-white);
}

.modal-emoji {
  font-size: 4rem;
  animation: mascotBounce 2s ease-in-out infinite;
}

.modal-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--clr-text);
}

.modal-desc {
  color: var(--clr-text-soft);
  font-weight: 600;
  font-size: 1rem;
}

.modal-play-btn {
  margin-top: var(--sp-sm);
  width: 100%;
  justify-content: center;
  font-size: 1.2rem;
  padding: 0.9rem;
}

/* ── ACCESSIBILITY: reduced motion ── */
@property --animation-reduced {
  syntax: "*";
  inherits: false;
  initial-value: none;
}
@media (prefers-reduced-motion: reduce) {
  * { --animation-reduced: none !important; }
  .mascot-img, .logo-emoji, .reward-star,
  .deco-star, .deco-rainbow, .deco-flower, .deco-cloud,
  .bubble, .shape, .featured-confetti, .reward-icon, .footer-mascot {
    animation: none !important;
  }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero-content    { gap: var(--sp-lg); }
  .speech-bubble   { right: -100px; max-width: 130px; }
  .title-line1     { font-size: 2.5rem; }
  .title-line2     { font-size: 2rem; }
  .featured-content { flex-direction: column; text-align: center; }
  .featured-icon-large { font-size: 3.5rem; }
  .play-modal[open] { display: flex; }
  .nav-label       { display: none; }
  .corner-deco     { display: none; }
  .reward-inner    { flex-direction: column; text-align: center; }
  .logo            { display: none; }
}

@media (max-width: 480px) {
  :root { --sp-lg: 1rem; --sp-xl: 1.5rem; }
  .header-inner    { gap: 0.5rem; }
  .hero-text       { text-align: center; }
  .hero-cta-group  { justify-content: center; }
  .speech-bubble   { position: static; margin-top: var(--sp-sm); border-radius: var(--r-lg); }
  .speech-bubble::before { display: none; }
}

/* ===================================================
   APP INSTALL SECTION
   =================================================== */
.simple-store-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  color: var(--clr-text);
  border: 2px solid var(--clr-text);
  border-radius: 50px;
  padding: 10px 20px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  transition: transform 0.2s;
}

.simple-store-btn:hover {
  transform: scale(1.05);
}

.simple-store-btn:active {
  transform: scale(0.95);
}

.shiny-rainbow-text {
  font-family: 'Baloo 2', cursive;
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 1.2rem;
  background: linear-gradient(
    to right,
    #FF8FAB, /* pink */
    #FFCF47, /* yellow */
    #52D9A4, /* mint */
    #9C7AF5, /* lavender */
    #68D8D6, /* teal */
    #FF8FAB  /* pink loop */
  );
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shine-rainbow 3s linear infinite;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

@keyframes shine-rainbow {
  to {
    background-position: 200% center;
  }
}

/* ════════════════════════════════════════════════════
   MOBILE PERFORMANCE OPTIMIZATIONS
════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Disable heavy blurs which kill GPU on low-end phones */
  * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Make header/modal backgrounds opaque since blur is gone */
  .site-header,
  .dashboard-header,
  .yt-modal,
  .game-modal {
    background: rgba(255, 248, 240, 0.98) !important;
  }

  .player-header {
    background: rgba(248, 244, 255, 0.98) !important;
  }

  /* Hide expensive decorative particle/animation backgrounds */
  #starfield,
  .bubbles-bg,
  .pattern-bg {
    display: none !important;
  }

  /* Hide corner decorations — each has wobble + pulse animations */
  .corner-deco {
    display: none !important;
  }

  /* Simplify hero icon animation */
  .main-icon,
  .mascot-img {
    animation: none !important;
  }

  /* Reduce card animation complexity */
  .game-card,
  .video-card,
  .learn-card,
  .featured-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
  }

  /* Disable floating shape animations */
  .floating-shapes .shape {
    animation: none !important;
  }
}

