/* Colourful discoveries, calm learning surfaces. */
body.is-home {
  background:
    radial-gradient(ellipse at 7% 18%, #fff0c9 0, transparent 35%),
    radial-gradient(ellipse at 92% 45%, #ede5fc 0, transparent 36%), #fcfbf6;
}
.is-home .hero {
  background: linear-gradient(125deg, #eff4d9 0%, #e3f1dc 48%, #d9eef0 100%);
  border-color: #d1dfbe;
  box-shadow: 0 12px 35px #667d3d0c;
}
.is-home .profile-welcome {
  position: relative;
  background: linear-gradient(
    135deg,
    #fff2d6,
    #f8e9ee 44%,
    #e7e5f8 72%,
    #e2f0e4
  );
  border: 1px solid #ecdec8;
  border-radius: 30px;
  padding: 30px 20px 40px;
  overflow: hidden;
}
.profile-welcome:before,
.profile-welcome:after {
  content: "✿";
  position: absolute;
  font-size: 130px;
  color: #ffffff85;
  pointer-events: none;
}
.profile-welcome:before {
  left: -22px;
  top: 20px;
  rotate: -15deg;
}
.profile-welcome:after {
  right: -16px;
  bottom: 0;
  rotate: 12deg;
}
.profile-welcome > * {
  position: relative;
  z-index: 1;
}
.profile-card {
  background: #fffef9e8;
}
.profile-card:nth-child(3n) {
  border-color: #c9dfe9;
  box-shadow: 0 6px 0 #dcebf0;
}
.subject-gardens {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 26px;
}
.subject-garden {
  display: grid;
  gap: 10px;
  text-align: left;
  padding: 22px 18px;
  border-radius: 20px;
  border: 1px solid #0000000a;
  box-shadow: 0 5px 0 #00000005;
}
.subject-garden > span {
  font-size: 34px;
}
.subject-garden > b {
  font: 500 21px Fredoka;
}
.subject-garden > small {
  letter-spacing: 0;
  font-size: 10px;
  color: #455c48;
}
.tile-maths {
  background: #e5eed3;
}
.tile-english {
  background: #f5deea;
}
.tile-science {
  background: #dcedf6;
}
.tile-history {
  background: #f6e6c7;
}
.is-home .card:nth-child(1) {
  background: linear-gradient(#fffefa, #f4f7e9);
}
.is-home .card:nth-child(2) {
  background: linear-gradient(#fffefa, #fff2da);
}
.is-home .card:nth-child(3) {
  background: linear-gradient(#fffefa, #f8eaf0);
}
h1 {
  overflow-wrap: anywhere;
}
.music-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.music-controls button {
  font-size: 11px;
  padding: 9px 11px;
}
#musicVolume {
  width: 55px;
  accent-color: #9c83b7;
}
#voiceSettings {
  background: #ece5f4;
}
.header-actions {
  max-width: 650px;
}
.subject-intro {
  display: flex;
  align-items: center;
  gap: 23px;
  padding: 26px;
  border-radius: 23px;
  margin-bottom: 24px;
  background: #e9efdc;
}
.subject-intro > span {
  font-size: 65px;
}
.subject-intro h3 {
  font: 500 28px Fredoka;
  margin: 0 0 10px;
}
.subject-intro p {
  font-size: 13px;
  line-height: 1.8;
  margin: 0;
  color: #52644c;
}
.subject-english {
  background: #f5e5ef;
}
.subject-science {
  background: #e1eef6;
}
.subject-history {
  background: #f6ead3;
}
.lesson-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}
.lesson-card h2 {
  font: 500 30px Fredoka;
}
.lesson-card > p {
  line-height: 1.9;
  font-size: 15px;
}
.worked-example {
  padding: 19px;
  background: #faf1d8;
  border: 1px solid #eee1b8;
  border-radius: 15px;
  line-height: 1.9;
  font-size: 14px;
  margin: 20px 0;
}
.lesson-card .controls {
  margin-top: 24px;
  align-items: end;
}
.lesson-card select {
  max-width: 260px;
}
.explore-card h3 {
  font: 500 24px Fredoka;
  margin: 0 0 20px;
}
.explore-card label {
  display: grid;
  gap: 10px;
  margin: 15px 0;
  font-size: 13px;
}
.explore-card input[type="range"] {
  width: 100%;
  accent-color: #71935b;
}
.explore-card input[type="number"] {
  width: 100px;
}
.explore-card p {
  font-size: 13px;
  line-height: 1.9;
}
.reading-passage {
  background: #f4f2fb;
  border: 1px solid #e4ddf1;
  border-radius: 16px;
  padding: 20px;
  line-height: 2;
  font-size: 17px;
  max-width: 800px;
  margin: 20px auto;
}
.reading-passage h3 {
  font: 500 23px Fredoka;
  margin: 0;
}
.reading-passage button {
  font-size: 12px;
  background: white;
}
.typed-answer {
  max-width: 500px;
  margin: 25px auto;
  text-align: center;
  display: grid;
  gap: 13px;
}
.typed-answer input {
  text-align: center;
  font-size: 24px;
  width: 100%;
}
.word-pieces,
.ordered-words {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 20px auto;
  max-width: 700px;
}
.word-pieces button {
  background: #eee8f7;
  min-height: 50px;
}
.ordered-words {
  background: #f7f7ef;
  border: 2px dashed #ccd9bb;
  min-height: 70px;
  border-radius: 15px;
  padding: 18px;
  align-items: center;
  font: 500 21px Fredoka;
}
.picture-clue {
  font-size: 85px;
  text-align: center;
  margin: 22px;
}
.clock-face,
.shape-visual {
  display: block;
  width: 240px;
  max-width: 100%;
  margin: 20px auto;
}
.fraction-strip {
  display: flex;
  border: 3px solid #7b9465;
  max-width: 650px;
  height: 70px;
  margin: 28px auto;
  border-radius: 12px;
  overflow: hidden;
}
.fraction-strip > span {
  flex: 1;
  border-right: 2px solid #7b9465;
  background: #f9f7e8;
}
.fraction-strip > span:last-child {
  border: 0;
}
.fraction-strip .filled {
  background: #9fc07e;
}
.rectangle-visual {
  width: 220px;
  max-width: 90%;
  background:
    repeating-linear-gradient(0deg, transparent 0 23px, #ffffff70 23px 25px),
    repeating-linear-gradient(90deg, #bcda9e 0 23px, #ffffff70 23px 25px);
  border: 3px solid #749758;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 25px auto;
  min-height: 45px;
}
.rectangle-visual span {
  background: white;
  padding: 8px;
  border-radius: 8px;
  font-size: 13px;
}
.mirror-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  font-size: 30px;
  margin: 25px auto;
}
.mirror-visual > b {
  color: #8a78b3;
}
.number-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
}
.number-jumps > span {
  background: #edf3e5;
  border-radius: 12px;
  padding: 10px;
  font: 500 22px Fredoka;
}
.coin-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
}
.coin-tray button {
  border-radius: 50%;
  background: #f0db9c;
  border: 2px solid #c1a65c;
  width: 58px;
  height: 58px;
  padding: 3px;
}
.area-grid {
  display: grid;
  gap: 2px;
  max-width: 330px;
  margin: 20px auto;
  border: 2px solid #64864d;
  padding: 2px;
}
.area-grid > span {
  aspect-ratio: 1;
  background: #c1d8a3;
  min-width: 5px;
}
.symmetry-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  max-width: 340px;
  margin: 20px auto;
}
.symmetry-grid button {
  aspect-ratio: 1;
  background: #eceaf5;
  padding: 0;
  border-radius: 8px;
}
.symmetry-grid button:nth-child(6n + 3) {
  border-right: 3px solid #9e83bc;
}
.symmetry-grid .mirror-filled {
  background: #ae92cc;
}
.letter-model {
  text-align: center;
  font: 500 90px Fredoka;
  color: #8170a8;
  margin: 20px;
}
#traceCanvas {
  width: 100%;
  height: 180px;
  border: 2px dashed #d2c7e3;
  border-radius: 16px;
  background: repeating-linear-gradient(#fff 0 43px, #e9e2f0 44px 45px);
  touch-action: none;
}
textarea {
  width: 100%;
  border: 1px solid #cbd8bf;
  border-radius: 12px;
  padding: 15px;
  font:
    16px/1.9 "DM Sans",
    sans-serif;
  background: #fffef8;
  resize: vertical;
  min-height: 100px;
}
#storyDraft {
  min-height: 230px;
}
.particles {
  height: 200px;
  display: grid;
  grid-template-columns: repeat(6, 18px);
  gap: 7px;
  align-content: center;
  justify-content: center;
  background: #f0f4f7;
  border-radius: 17px;
  margin: 20px 0;
  overflow: hidden;
}
.particles span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #74a4c4;
  animation: particle-vibrate 1s ease-in-out infinite alternate;
}
.state-liquid {
  grid-template-columns: repeat(6, 20px);
  gap: 9px;
  align-content: end;
  padding-bottom: 15px;
}
.state-liquid span:nth-child(even) {
  animation: particle-liquid 2s ease-in-out infinite alternate;
}
.state-gas {
  grid-template-columns: repeat(6, 1fr);
  gap: 15px;
  padding: 25px;
}
.state-gas span {
  animation: particle-gas 2s ease-in-out infinite alternate;
}
.state-gas span:nth-child(2n) {
  animation-delay: -1s;
}
.circuit {
  border: 6px solid #86937b;
  border-radius: 30px;
  padding: 28px 15px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin: 25px auto;
  font-size: 45px;
  max-width: 330px;
}
.circuit .bulb {
  opacity: 0.28;
}
.circuit.on {
  border-color: #e1bd55;
}
.circuit.on .bulb {
  opacity: 1;
  filter: drop-shadow(0 0 13px #f3d55c);
}
.space-demo {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: #34364f;
  border-radius: 20px;
  height: 200px;
  overflow: hidden;
}
.demo-sun {
  font-size: 65px;
}
.demo-earth {
  font-size: 90px;
  position: relative;
  display: block;
  line-height: 1;
}
.demo-earth i {
  position: absolute;
  left: 3px;
  top: 40%;
  font-size: 15px;
  color: #f8c95a;
  font-style: normal;
}
.timeline-buttons {
  display: grid;
  gap: 8px;
  border-left: 3px solid #c6aa77;
  padding-left: 15px;
}
.timeline-buttons button {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  text-align: left;
  background: #faf2e3;
  font-size: 12px;
}
.timeline-buttons b {
  color: #896b37;
}
.profile-management {
  margin-bottom: 22px;
}
.profile-management h3 {
  font: 500 24px Fredoka;
}
.profile-management fieldset {
  border: 1px solid #dce3d3;
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  padding: 16px;
  font-size: 13px;
}
.subject-check {
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-management .controls {
  margin-top: 20px;
}
#voiceDialog {
  width: 570px;
  max-width: 92vw;
}
#voiceDialog > label {
  display: grid;
  gap: 10px;
  font-size: 14px;
  margin: 20px 0;
}
#voiceDialog select {
  max-width: 100%;
  width: 100%;
}
#voiceDialog .check {
  display: flex;
  align-items: center;
}
.button-spring {
  animation: button-press 0.32s ease-out;
}
.answers .correct {
  box-shadow: 0 0 0 3px #bfdc9e;
  animation: answer-pop 0.45s ease-out;
}
#celebrationLayer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  overflow: hidden;
}
.star-particle {
  position: absolute;
  display: block;
  font-size: 19px;
  animation: star-burst 0.95s ease-out forwards;
}
.quiet-star {
  position: absolute;
  top: 18%;
  left: 50%;
  font-size: 30px;
}
@keyframes star-burst {
  from {
    transform: translate(-50%, -50%) scale(0.3);
    opacity: 1;
  }
  60% {
    opacity: 1;
  }
  to {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)))
      rotate(var(--spin)) scale(0.7);
    opacity: 0;
  }
}
@keyframes button-press {
  0%,
  100% {
    scale: 1;
  }
  35% {
    scale: 0.95;
  }
  70% {
    scale: 1.025;
  }
}
@keyframes answer-pop {
  50% {
    scale: 1.035;
  }
}
@keyframes particle-vibrate {
  to {
    translate: 2px 1px;
  }
}
@keyframes particle-liquid {
  to {
    translate: 8px -5px;
  }
}
@keyframes particle-gas {
  to {
    translate: 15px 20px;
  }
}
@media (max-width: 1100px) {
  .lesson-layout {
    grid-template-columns: 1fr;
  }
  .subject-gardens {
    grid-template-columns: repeat(2, 1fr);
  }
  .header-actions {
    max-width: 420px;
  }
  .music-controls {
    justify-content: flex-end;
  }
}
@media (max-width: 700px) {
  header {
    display: block;
  }
  .header-actions {
    max-width: none !important;
    justify-content: flex-start !important;
    margin-top: 15px;
    gap: 9px !important;
  }
  .music-controls {
    justify-content: flex-start;
    gap: 5px;
  }
  #brand > span {
    display: inline;
    margin-left: 3px;
    font-size: 19px;
  }
  #brand small {
    margin-left: 28px;
    font-size: 7px;
  }
  #musicVolume {
    width: 45px;
  }
  .subject-gardens {
    gap: 10px;
  }
  .subject-garden {
    padding: 17px 14px;
  }
  .subject-garden > b {
    font-size: 19px;
  }
  .subject-intro {
    padding: 20px;
    gap: 13px;
  }
  .subject-intro > span {
    font-size: 42px;
  }
  .subject-intro h3 {
    font-size: 23px;
  }
  .lesson-layout {
    gap: 15px;
  }
  .lesson-card h2 {
    font-size: 26px;
  }
  .lesson-card > p {
    font-size: 14px;
  }
  .worked-example {
    padding: 15px;
  }
  .question-text {
    font-size: 24px;
  }
  .answers {
    gap: 10px;
  }
  .answers button {
    font-size: 19px;
    padding: 18px 13px;
  }
  .reading-passage {
    font-size: 15px;
    padding: 16px;
  }
  .clock-face {
    width: 210px;
  }
  .profile-welcome {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  .subject-garden > small {
    font-size: 10px;
  }
  .profile-management fieldset {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .timeline-buttons button {
    grid-template-columns: 74px 1fr;
  }
  .word-pieces button {
    font-size: 14px;
    padding: 12px;
  }
  .ordered-words {
    font-size: 18px;
  }
  .fraction-strip {
    height: 55px;
  }
  .music-controls button {
    font-size: 10px;
  }
  .story-clue {
    font-size: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .star-particle {
    display: none;
  }
  .button-spring,
  .answers .correct,
  .particles span {
    animation: none !important;
  }
  .correct {
    outline: 3px solid #bfdc9e;
  }
  .is-home .float,
  .is-home .bunny {
    animation: none;
  }
}
button {
  min-height: 44px;
}
#previewNotice {
  background: #e5e0f3;
  color: #4e426a;
  padding: 11px 20px;
  text-align: center;
  font-size: 12px;
  border-bottom: 1px solid #cfc2e7;
}
.correct {
  animation: answer-pop 0.45s ease-out;
}
