:root {
  --sky: #8fd3ff;
  --sun: #ffe27a;
  --pink: #ff9ecf;
  --peach: #ffc89c;
  --mint: #adf0d1;
  --blueberry: #355070;
  --paper: #fffaf2;
  --white: #ffffff;
  --shadow: rgba(53, 80, 112, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Fredoka", sans-serif;
  color: var(--blueberry);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.85), transparent 30%),
    linear-gradient(180deg, #89d7ff 0%, #ffd7ef 45%, #fff3b7 100%);
}

.page {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.quick-nav {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.quick-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--blueberry);
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 12px 24px rgba(53, 80, 112, 0.1);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.quick-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 26px rgba(53, 80, 112, 0.16);
}

.quick-link i {
  font-size: 1.1rem;
}

.hero,
.card {
  background: rgba(255, 250, 242, 0.88);
  border: 3px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  box-shadow: 0 18px 40px var(--shadow);
  backdrop-filter: blur(10px);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 40px 28px;
  text-align: center;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  z-index: 0;
}

.hero::before {
  width: 180px;
  height: 180px;
  top: -40px;
  left: -20px;
  background: rgba(255, 158, 207, 0.35);
}

.hero::after {
  width: 220px;
  height: 220px;
  right: -60px;
  bottom: -80px;
  background: rgba(173, 240, 209, 0.45);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-label {
  margin: 0 0 8px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: clamp(2.7rem, 7vw, 5rem);
  line-height: 0.95;
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
}

.intro,
.card p,
.favorites-list {
  font-size: 1.08rem;
  line-height: 1.7;
}

.about-details {
  margin-top: 14px;
}

.about-details p {
  margin: 0 0 10px;
}

.intro {
  width: min(620px, 100%);
  margin: 18px auto 0;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  transform: translateY(-2px) rotate(-1deg);
  box-shadow: 0 10px 24px rgba(53, 80, 112, 0.18);
}

.button-primary {
  background: var(--pink);
  color: var(--blueberry);
}

.button-secondary {
  background: var(--sun);
  color: var(--blueberry);
}

.compliment {
  margin: 18px 0 0;
  font-family: "Gaegu", cursive;
  font-size: 1.5rem;
}

main {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}

.card {
  padding: 26px;
}

.about-card {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 20px;
  align-items: center;
}

.sparkle-box {
  display: grid;
  gap: 12px;
  position: relative;
  overflow: hidden;
  min-height: 300px;
}

.sparkle-trigger,
.mood {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  border-radius: 24px;
  font-family: "Gaegu", cursive;
  font-size: 1.7rem;
  font-weight: 700;
}

.sparkle-trigger {
  border: 0;
  color: var(--blueberry);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
  gap: 10px;
}

.sparkle-trigger:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 10px 22px rgba(53, 80, 112, 0.14);
}

.sparkle-trigger i {
  font-size: 1.3rem;
}

.sparkle-trigger:nth-child(1) {
  background: rgba(255, 226, 122, 0.8);
}

.sparkle-trigger:nth-child(2) {
  background: rgba(255, 158, 207, 0.8);
}

.sparkle-trigger:nth-child(3) {
  background: rgba(143, 211, 255, 0.8);
}

.animation-stage {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.magic-pop {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(2rem, 5vw, 3.6rem);
  animation: float-pop 1200ms ease-out forwards;
  opacity: 0;
}

.magic-pop.star::before {
  content: "★";
  color: #ffbf1f;
  text-shadow: 0 0 18px rgba(255, 191, 31, 0.45);
}

.magic-pop.heart::before {
  content: "♥";
  color: #ff5d98;
  text-shadow: 0 0 18px rgba(255, 93, 152, 0.4);
}

.magic-pop.sun::before {
  content: "☀";
  color: #ff9f1c;
  text-shadow: 0 0 18px rgba(255, 159, 28, 0.42);
}

@keyframes float-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -30%) scale(0.4) rotate(-12deg);
  }

  20% {
    opacity: 1;
  }

  65% {
    opacity: 1;
    transform: translate(calc(-50% + var(--drift-x)), calc(-50% + var(--drift-y)))
      scale(1.15) rotate(10deg);
  }

  100% {
    opacity: 0;
    transform: translate(
        calc(-50% + var(--drift-x) * 1.35),
        calc(-50% + var(--drift-y) * 1.35 - 24px)
      )
      scale(0.8)
      rotate(18deg);
  }
}

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.favorites-list {
  margin: 16px 0 0;
  padding-left: 20px;
}

.gallery-card {
  text-align: center;
}

.friends-card {
  text-align: center;
}

.drawing-card {
  display: grid;
  gap: 20px;
}

.drawing-copy {
  text-align: center;
}

.drawing-tools,
.drawing-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 22px rgba(53, 80, 112, 0.1);
}

.tool-chip span,
.size-readout {
  font-weight: 600;
}

#color-picker {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

#brush-size {
  width: 140px;
  accent-color: var(--pink);
}

.drawing-board {
  padding: 16px;
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(255, 226, 122, 0.5), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.94));
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.62);
}

#drawing-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 253, 0.98));
  cursor: crosshair;
  touch-action: none;
}

.share-button {
  background: var(--mint);
}

.drawing-note {
  margin: 0;
  text-align: center;
  font-family: "Gaegu", cursive;
  font-size: 1.45rem;
}

.reading-card {
  display: grid;
  gap: 22px;
}

.math-card {
  display: grid;
  gap: 22px;
}

.arabic-card {
  display: grid;
  gap: 22px;
}

.science-card {
  display: grid;
  gap: 22px;
}

.reading-copy {
  text-align: center;
}

.math-copy {
  text-align: center;
}

.arabic-copy {
  text-align: center;
}

.science-copy {
  text-align: center;
}

.arabic-alphabet-intro {
  padding: 24px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 251, 240, 0.98), rgba(239, 250, 255, 0.98));
  box-shadow: 0 14px 28px rgba(53, 80, 112, 0.12);
  text-align: center;
}

.math-controls,
.math-answer-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.math-chip {
  min-width: 220px;
}

#math-grade,
#math-answer {
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--blueberry);
  min-width: 120px;
  outline: none;
}

.math-board {
  padding: 24px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.98), rgba(238, 252, 255, 0.98));
  box-shadow: 0 14px 28px rgba(53, 80, 112, 0.12);
  text-align: center;
}

.math-board h3 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 10px;
}

.math-hint,
.math-feedback,
.math-score {
  margin: 10px 0 0;
}

.math-feedback,
.math-score {
  font-family: "Gaegu", cursive;
  font-size: 1.35rem;
}

.arabic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.arabic-alphabet-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.arabic-word-card,
.arabic-practice {
  padding: 24px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(246, 253, 255, 0.98), rgba(255, 247, 238, 0.98));
  box-shadow: 0 14px 28px rgba(53, 80, 112, 0.12);
  text-align: center;
}

.arabic-letter-card {
  padding: 20px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 255, 0.98));
  box-shadow: 0 12px 24px rgba(53, 80, 112, 0.1);
  text-align: center;
}

.arabic-letter-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.arabic-letter-icon {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(143, 211, 255, 0.34);
  color: var(--blueberry);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.arabic-letter-icon:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 18px rgba(53, 80, 112, 0.16);
}

.arabic-letter-symbol {
  margin: 0 0 10px;
  font-size: clamp(2.2rem, 5vw, 3rem);
}

.arabic-letter-name,
.arabic-letter-example,
.arabic-letter-sound {
  margin: 0 0 8px;
}

.arabic-letter-sound {
  font-family: "Gaegu", cursive;
  font-size: 1.25rem;
}

.arabic-word {
  font-size: clamp(2rem, 5vw, 2.8rem);
  margin-bottom: 10px;
}

.arabic-phrase {
  margin-top: 8px;
}

.arabic-english,
.arabic-sound {
  margin: 0 0 10px;
}

.arabic-sound {
  font-family: "Gaegu", cursive;
  font-size: 1.35rem;
}

.arabic-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 14px;
}

.science-topics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.science-note {
  min-height: 170px;
  padding: 22px;
  border-radius: 26px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.42);
}

.science-animation-card,
.science-facts {
  padding: 24px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(245, 252, 255, 0.98), rgba(255, 248, 239, 0.98));
  box-shadow: 0 14px 28px rgba(53, 80, 112, 0.12);
}

.science-scene {
  display: grid;
  grid-template-columns: 1.05fr 1.1fr 0.9fr;
  align-items: center;
  gap: 18px;
  min-height: 340px;
  padding: 22px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(255, 226, 122, 0.42), transparent 24%),
    radial-gradient(circle at left center, rgba(143, 211, 255, 0.2), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 248, 255, 0.98));
  box-shadow: inset 0 0 0 1px rgba(143, 211, 255, 0.28);
}

.science-person {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.science-head {
  position: relative;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: #ffd7b3;
  box-shadow: inset 0 -8px 0 rgba(255, 183, 120, 0.35);
}

.science-head .eye {
  position: absolute;
  top: 28px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blueberry);
}

.science-head .eye.left {
  left: 22px;
}

.science-head .eye.right {
  right: 22px;
}

.science-head .smile {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 22px;
  height: 10px;
  border-bottom: 3px solid var(--blueberry);
  border-radius: 0 0 14px 14px;
  transform: translateX(-50%);
}

.science-torso {
  position: relative;
  width: 170px;
  height: 180px;
  border-radius: 40px;
  background: linear-gradient(180deg, rgba(93, 140, 195, 0.16), rgba(93, 140, 195, 0.08));
  box-shadow: inset 0 0 0 2px rgba(93, 140, 195, 0.18);
}

.science-airway {
  position: absolute;
  inset: 0;
}

.mouth-dot {
  position: absolute;
  top: 14px;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: #ff9aa2;
}

.trachea,
.bronchi {
  position: absolute;
  background: rgba(53, 80, 112, 0.35);
}

.trachea {
  top: 26px;
  left: 50%;
  width: 10px;
  height: 54px;
  margin-left: -5px;
  border-radius: 10px;
}

.bronchi {
  top: 72px;
  width: 52px;
  height: 8px;
  border-radius: 12px;
}

.bronchi.left {
  left: 34px;
  transform: rotate(28deg);
}

.bronchi.right {
  right: 34px;
  transform: rotate(-28deg);
}

.science-lungs {
  position: absolute;
  inset: 44px 14px 14px;
  position: relative;
}

.lung {
  position: absolute;
  top: 6px;
  width: 62px;
  height: 96px;
  border-radius: 52px 52px 40px 40px;
  background: linear-gradient(180deg, rgba(255, 158, 207, 0.92), rgba(255, 120, 172, 0.86));
  transform-origin: center;
  animation: lung-breathe 2.2s ease-in-out infinite;
  overflow: hidden;
  box-shadow: inset 0 -10px 18px rgba(190, 64, 117, 0.28);
}

.lung.left {
  left: 8px;
}

.lung.right {
  right: 8px;
}

.lung-glow {
  position: absolute;
  inset: 14px 10px 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(255, 255, 255, 0.72), transparent 62%);
}

.science-flow-panel {
  display: grid;
  gap: 16px;
}

.science-flow {
  position: relative;
  min-height: 150px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(233, 246, 255, 0.82));
  box-shadow: inset 0 0 0 1px rgba(143, 211, 255, 0.24);
}

.gas-bubble {
  position: absolute;
  left: 10%;
  min-width: 52px;
  padding: 10px 12px;
  border-radius: 999px;
  text-align: center;
  font-weight: 700;
  animation: drift-gas 2.8s linear infinite;
}

.gas-bubble:nth-child(1) {
  top: 18px;
}

.gas-bubble:nth-child(2) {
  top: 58px;
  animation-delay: 0.8s;
}

.gas-bubble:nth-child(3) {
  top: 98px;
  animation-delay: 1.6s;
}

.gas-bubble.oxygen {
  background: rgba(143, 211, 255, 0.82);
}

.gas-bubble.breath {
  background: rgba(255, 200, 156, 0.88);
}

.science-chart {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 0 0 1px rgba(53, 80, 112, 0.08);
}

.science-chart-row {
  display: grid;
  grid-template-columns: 92px 1fr 48px;
  gap: 10px;
  align-items: center;
}

.chart-label,
.chart-value {
  font-size: 0.9rem;
  font-weight: 600;
}

.chart-bar {
  height: 16px;
  border-radius: 999px;
  background: rgba(53, 80, 112, 0.12);
  overflow: hidden;
}

.chart-fill {
  display: block;
  height: 100%;
  width: 50%;
  border-radius: inherit;
  transition: width 260ms ease;
}

.oxygen-fill {
  background: linear-gradient(90deg, #6fc7ff, #2ba4ff);
}

.carbon-fill {
  background: linear-gradient(90deg, #7fe3b9, #25b97e);
}

.wind-fill {
  background: linear-gradient(90deg, #ffd37c, #ff9c3d);
}

.science-flame-zone {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.candle {
  display: grid;
  justify-items: center;
  align-self: end;
}

.flame-wrap {
  position: relative;
  width: 62px;
  height: 88px;
}

.candle-flame {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  transform-origin: center bottom;
}

.candle-flame.glow {
  width: 58px;
  height: 82px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 213, 94, 0.46), rgba(255, 213, 94, 0));
  filter: blur(6px);
}

.candle-flame.outer {
  width: 34px;
  height: 62px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: linear-gradient(180deg, #fff0b3 0%, #ffbf3f 34%, #ff7f1f 72%, #ff5f1f 100%);
  box-shadow: 0 0 24px rgba(255, 153, 35, 0.4);
  animation: flame-dance 1.1s ease-in-out infinite;
}

.candle-flame.inner {
  width: 15px;
  height: 34px;
  bottom: 8px;
  border-radius: 50% 50% 46% 46%;
  background: linear-gradient(180deg, #ffffff 0%, #fff3a4 72%, rgba(255, 243, 164, 0.2) 100%);
}

.candle-stick {
  width: 22px;
  height: 90px;
  margin-top: -8px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff8d9, #ffd277);
}

.candle-shadow {
  width: 70px;
  height: 18px;
  margin-top: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(53, 80, 112, 0.18), rgba(53, 80, 112, 0));
}

.science-scene[data-mode="breath"] .candle-flame {
  opacity: 0.85;
}

.science-scene[data-mode="breath"] .candle-flame.outer {
  animation: flame-wobble 0.7s ease-in-out infinite;
  transform: translateX(-50%) scale(0.58) rotate(-24deg);
}

.science-scene[data-mode="breath"] .candle-flame.inner {
  transform: translateX(-50%) scale(0.54) rotate(-18deg);
  opacity: 0.78;
}

.science-scene[data-mode="breath"] .candle-flame.glow {
  transform: translateX(-50%) scale(0.65);
  opacity: 0.48;
}

.science-scene[data-mode="breath"][data-flame="off"] .candle-flame.outer {
  animation: none;
  transform: translateX(-50%) scale(0.22) rotate(-38deg);
  opacity: 0.16;
}

.science-scene[data-mode="breath"][data-flame="off"] .candle-flame.inner {
  transform: translateX(-50%) scale(0.15) rotate(-22deg);
  opacity: 0.08;
}

.science-scene[data-mode="breath"][data-flame="off"] .candle-flame.glow {
  opacity: 0.08;
  transform: translateX(-50%) scale(0.34);
}

.science-scene[data-mode="breath"][data-flame="off"] .candle-shadow {
  background: radial-gradient(circle, rgba(53, 80, 112, 0.26), rgba(53, 80, 112, 0));
}

.science-controls {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 18px;
}

.science-feedback {
  margin: 16px 0 0;
  text-align: center;
  font-family: "Gaegu", cursive;
  font-size: 1.4rem;
}

.science-caption {
  margin: 0;
  text-align: center;
  font-family: "Gaegu", cursive;
  font-size: 1.2rem;
}

@keyframes lung-breathe {
  0%,
  100% {
    transform: scale(0.96);
  }

  50% {
    transform: scale(1.06);
  }
}

@keyframes drift-gas {
  0% {
    opacity: 0;
    transform: translateX(0) translateY(0) scale(0.7);
  }

  15% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateX(250px) translateY(-10px) scale(1);
  }
}

@keyframes flame-dance {
  0%,
  100% {
    transform: scale(1) rotate(-2deg);
  }

  50% {
    transform: scale(1.06) rotate(2deg);
  }
}

@keyframes flame-wobble {
  0%,
  100% {
    transform: scale(0.7) rotate(-18deg);
  }

  50% {
    transform: scale(0.56) rotate(-30deg);
  }
}

.arabic-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 20;
}

.arabic-modal.is-open {
  display: flex;
}

.arabic-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(53, 80, 112, 0.48);
  backdrop-filter: blur(6px);
}

.arabic-modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  padding: 28px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.99), rgba(239, 250, 255, 0.99));
  box-shadow: 0 26px 48px rgba(53, 80, 112, 0.24);
}

.arabic-modal-close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--blueberry);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.arabic-modal-letter {
  margin: 4px 0 10px;
  text-align: center;
}

.arabic-modal-words {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.arabic-modal-word {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 20px rgba(53, 80, 112, 0.1);
  text-align: center;
}

.arabic-modal-emoji {
  font-size: 2rem;
  margin-bottom: 8px;
}

.arabic-modal-word h4 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.arabic-modal-word p {
  margin: 0 0 6px;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.book-card,
.storybook {
  padding: 24px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 14px 28px rgba(53, 80, 112, 0.12);
}

.book-card h3,
.storybook h3 {
  margin-bottom: 12px;
}

.book-tag {
  margin: 0 0 10px;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a14c77;
}

.story-button {
  margin-top: 8px;
}

.voice-corner {
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(240, 252, 255, 0.96), rgba(255, 247, 239, 0.96));
  box-shadow: 0 14px 28px rgba(53, 80, 112, 0.12);
}

.voice-copy {
  text-align: center;
}

.voice-grid {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.voice-chip {
  min-width: 220px;
}

#voice-mood,
#voice-choice {
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--blueberry);
  min-width: 140px;
  outline: none;
}

.voice-feedback {
  margin: 0;
  text-align: center;
  font-family: "Gaegu", cursive;
  font-size: 1.35rem;
  color: #7b4360;
}

.storybook {
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(255, 245, 229, 0.98));
}

.storybook-scene {
  perspective: 1800px;
}

.storybook-spread {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  padding: 14px;
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(195, 140, 90, 0.95), rgba(145, 96, 60, 0.94));
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.18),
    0 18px 28px rgba(94, 61, 38, 0.18);
}

.page-face {
  min-height: 320px;
  padding: 24px;
  border-radius: 24px;
}

.page-left {
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(255, 245, 229, 0.98));
  box-shadow: inset -2px 0 0 rgba(191, 151, 104, 0.28);
}

.page-right {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(255, 248, 239, 0.98));
  box-shadow:
    inset 10px 0 18px rgba(191, 151, 104, 0.16),
    inset 0 0 0 1px rgba(191, 151, 104, 0.18);
}

.story-page-sheet {
  min-height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

.story-page-sheet.turn-next {
  animation: page-turn-next 900ms ease-in-out;
}

.story-page-sheet.turn-prev {
  animation: page-turn-prev 900ms ease-in-out;
}

.story-progress-page {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 230, 122, 0.32);
}

.story-mini-note {
  margin-top: 18px;
  font-family: "Gaegu", cursive;
  font-size: 1.4rem;
}

.story-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.story-nav-button {
  flex: 1 1 180px;
}

.story-progress,
.story-feedback {
  margin: 10px 0 0;
  font-family: "Gaegu", cursive;
  font-size: 1.35rem;
}

.story-feedback {
  color: #7b4360;
}

.story-text {
  min-height: 100%;
}

.story-word {
  display: inline-block;
  padding: 0 0.08em;
  border-radius: 0.35em;
  transition: background-color 120ms ease, transform 120ms ease, color 120ms ease;
}

.story-word.is-active {
  background: rgba(255, 226, 122, 0.92);
  color: #7b4360;
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 6px 14px rgba(255, 226, 122, 0.38);
}

.story-text p {
  margin: 0 0 14px;
}

@keyframes page-turn-next {
  0% {
    opacity: 1;
    transform: rotateY(0deg) translateX(0);
  }

  45% {
    opacity: 0.35;
    transform: rotateY(-86deg) translateX(8px);
  }

  55% {
    opacity: 0.25;
    transform: rotateY(86deg) translateX(-8px);
  }

  100% {
    opacity: 1;
    transform: rotateY(0deg) translateX(0);
  }
}

@keyframes page-turn-prev {
  0% {
    opacity: 1;
    transform: rotateY(0deg) translateX(0);
  }

  45% {
    opacity: 0.35;
    transform: rotateY(86deg) translateX(-8px);
  }

  55% {
    opacity: 0.25;
    transform: rotateY(-86deg) translateX(8px);
  }

  100% {
    opacity: 1;
    transform: rotateY(0deg) translateX(0);
  }
}

.friends-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.friend-tile {
  min-height: 180px;
  padding: 22px 18px;
  border-radius: 26px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.friend-tile h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.friend-tile p {
  margin: 0;
}

.mood-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.bubble-pink {
  background: rgba(255, 158, 207, 0.85);
}

.bubble-yellow {
  background: rgba(255, 226, 122, 0.92);
}

.bubble-blue {
  background: rgba(143, 211, 255, 0.9);
}

.bubble-green {
  background: rgba(173, 240, 209, 0.92);
}

@media (max-width: 780px) {
  .quick-nav,
  .about-card,
  .arabic-alphabet-grid,
  .arabic-grid,
  .arabic-modal-words,
  .science-topics,
  .favorites-grid,
  .book-grid,
  .friends-grid,
  .mood-board {
    grid-template-columns: 1fr;
  }

  .page {
    width: min(100% - 20px, 640px);
    padding-top: 20px;
  }

  .tool-chip {
    width: 100%;
    justify-content: center;
  }

  .voice-chip {
    min-width: 0;
  }

  .storybook-spread {
    grid-template-columns: 1fr;
  }

  .science-scene {
    grid-template-columns: 1fr;
  }

  .page-face {
    min-height: 0;
  }

  .math-chip {
    min-width: 0;
  }

  .hero,
  .card {
    border-radius: 24px;
  }
}
