/* babyweb — one stylesheet for the whole site. No external fonts or network. */
:root {
  --ink: #22303f;
  --muted: #5d6f83;
  --paper: #fffdf6;
  --line: #e3e9f1;
  --c1: #ff8a3d;
  --c2: #2fbfa0;
  --c3: #7a6cff;
  --c4: #ff5d8f;
  --c5: #ffc53d;
  --c6: #4fa3ff;
  --r: 18px;
  --bar: 4.5rem;
  --shadow: 0 5px 0 rgba(34, 48, 63, .09), 0 14px 26px -14px rgba(34, 48, 63, .45);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 18px/1.55 "Schoolbell", "Fredoka", "Comic Sans MS", "Chalkboard SE", cursive, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
/* the play-mat: the welcome art, fixed behind every page so nothing shifts under the content */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("/assets/learning-world.webp") center / cover no-repeat;
}
body.home::before { display: none; }
a { color: #1665c0; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin: .1em 0 .15em; }
h2 { font-size: 1.15rem; margin: 1.6em 0 .3em; }
p { margin: .5em 0; }
.wrap { max-width: 62rem; margin: 0 auto; padding: clamp(1rem, 3.5vw, 2rem) clamp(1rem, 4vw, 2rem) 1rem; }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 34rem; }
.tip { color: var(--muted); font-size: .9rem; margin-top: 1rem; }

/* the bar: translucent over the page, blurred, so the wash stays visible behind it */
.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem clamp(1rem, 4vw, 2rem);
  background: rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 2px solid var(--line);
}
.logo {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
}
.logo::before { content: "🎈"; font-size: 1.35rem; }
.bar .lang { margin-left: auto; font: inherit; padding: .3rem .6rem; border-radius: 1rem; }
.bar nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 .8rem;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.bar nav a:hover, .bar nav a:focus-visible, .bar nav a[aria-current] { background: rgba(122, 108, 255, .13); }
.nav-menu { position: relative; }
.nav-menu summary {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 .8rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after { content: " ▾"; margin-left: .25rem; }
.nav-menu summary:hover, .nav-menu summary:focus-visible, .nav-menu summary[aria-current] { background: rgba(122, 108, 255, .13); }
.nav-menu div {
  position: absolute;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr;
  min-width: 100%;
  white-space: nowrap;
  gap: .3rem;
  padding: .45rem;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.nav-menu div a {
  display: grid;
  place-items: center start;
  min-width: 2.6rem;
  min-height: 2.5rem;
  padding: 0 .5rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
}
.nav-menu div a:hover, .nav-menu div a:focus-visible { background: rgba(122, 108, 255, .13); }
.nav-menu div a[aria-current] { color: #fff; background: var(--c3); }
.nav-menu:not([open]) div { display: none; }
.mute {
  min-width: 2.75rem;
  min-height: 2.75rem;
  margin-left: .25rem;
  font-size: 1.1rem;
  line-height: 1;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.mute { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a4bea' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4z' fill='%238f82ff'/%3E%3Cpath d='M16.5 8.5a5 5 0 0 1 0 7M19 6a8.5 8.5 0 0 1 0 12'/%3E%3C/svg%3E") center / 1.4rem no-repeat; }
.mute[aria-pressed="true"] { color: var(--muted); background: #f3f5f9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a93a6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4z' fill='%23c5cad6'/%3E%3Cpath d='M17 9l5 6M22 9l-5 6'/%3E%3C/svg%3E") center / 1.4rem no-repeat; }

/* the roster of games on the front page */
.games {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  padding: 0;
  margin: 1.5rem 0 0;
  list-style: none;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 1.05rem 1.15rem;
  color: inherit;
  text-decoration: none;
  background: #fff;
  border: 2px solid var(--line);
  border-left: 9px solid var(--c, var(--c3));
  border-radius: var(--r);
  box-shadow: var(--shadow);
  transition: transform .12s ease;
}
.tile:hover, .tile:focus-visible { transform: translateY(-3px); }
.tile .icon { width: 5.5rem; height: 5.5rem; border-radius: 18px; box-shadow: 0 4px 10px rgba(40, 30, 90, .18); }
.tile p { margin: 0; }
/* the text sits on top, so the icon drops to the foot of a full-height tile and lines up across a row */
.games li { display: flex; }
.games .tile { flex: 1; }
.games .tile .icon { margin-top: auto; }
.tile b { font-size: 1.12rem; }
.tile span { color: var(--muted); font-size: .93rem; }
.tile .age { margin-top: .5rem; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); opacity: .72; }
.a1 { --c: var(--c1); } .a2 { --c: var(--c2); } .a3 { --c: var(--c3); }
.a4 { --c: var(--c4); } .a5 { --c: var(--c5); } .a6 { --c: var(--c6); }

/* controls: thumbs and keyboards, never a hover-only target */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 3rem;
  padding: .55rem 1.3rem;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--c, var(--c3));
  border: 0;
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(34, 48, 63, .22);
  cursor: pointer;
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(34, 48, 63, .22); }
.btn.ghost { color: var(--ink); background: #fff; border: 2px solid var(--line); box-shadow: none; }
.btn.is-wrong { background: #e9edf3; color: var(--muted); box-shadow: none; }

.hud { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: .9rem; font-weight: 700; color: var(--muted); }
.hud b { color: var(--ink); font-variant-numeric: tabular-nums; }
.stage {
  position: relative;
  margin-top: .9rem;
  padding: clamp(.75rem, 2.5vw, 1.25rem);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.board { display: grid; gap: .5rem; touch-action: manipulation; }

/* memory: cards turn over in 3D; both sides are always in the card */
.board.memory { grid-template-columns: repeat(4, 1fr); gap: clamp(.4rem, 2vw, .75rem); max-width: 30rem; margin: 0 auto; perspective: 900px; }
@media (max-width: 30rem) { .board.memory { grid-template-columns: repeat(3, 1fr); } }
.flip {
  position: relative;
  aspect-ratio: 3 / 4;
  padding: 0;
  font-size: clamp(1.7rem, 8vw, 2.6rem);
  background: none;
  border: 0;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform .45s cubic-bezier(.3, 1.4, .5, 1);
}
.flip .side {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
  backface-visibility: hidden;
  box-shadow: 0 4px 0 rgba(34, 48, 63, .14), 0 10px 18px -10px rgba(34, 48, 63, .5);
}
.flip .back {
  background:
    radial-gradient(circle at 50% 50%, #fff 0 18%, transparent 19%),
    radial-gradient(circle at 50% 50%, var(--c5) 0 27%, transparent 28%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .14) 0 6px, transparent 6px 14px),
    linear-gradient(150deg, #8f82ff, #5a4bea);
  border: 3px solid #fff;
}
.flip .front { transform: rotateY(180deg); background: linear-gradient(#fff, #f4f8ff); border: 3px solid var(--line); }
.flip.is-open, .flip.is-matched { transform: rotateY(180deg); }
.flip.is-matched .front { background: linear-gradient(#f2fff9, #d9f7ee); border-color: var(--c2); animation: glow .6s ease-out; }
.flip.is-miss { animation: shake .4s; }
@keyframes glow { 50% { box-shadow: 0 0 0 8px rgba(47, 191, 160, .35); } }
@keyframes shake { 25% { translate: -5px; } 75% { translate: 5px; } }

/* whack-a-mole: a garden of mounds, a drawn mole, and a draining clock along the top */
.board.whack {
  position: relative;
  grid-template-columns: repeat(3, 1fr);
  gap: .7rem;
  max-width: 28rem;
  margin: 0 auto;
  padding: 1.4rem .9rem .9rem;
  background: radial-gradient(circle at 80% 10%, #fff7c2 0 8%, transparent 9%), linear-gradient(#bde8ff 0 22%, #8fd96b 22% 100%);
  border-radius: 16px;
}
.board.whack::before {
  content: "";
  position: absolute;
  top: .5rem; left: .9rem; right: .9rem;
  height: .45rem;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--c2), var(--c5)) left / calc(var(--left, 1) * 100%) 100% no-repeat, rgba(255, 255, 255, .6);
  transition: background-size 1s linear;
}
.hole {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  padding: 0;
  background: none;
  border: 0;
  cursor: default;
}
.hole .mound { position: absolute; left: 6%; right: 6%; bottom: 4%; height: 34%; border-radius: 50%; background: radial-gradient(ellipse at 50% 35%, #3b2416 0 45%, #6b4529 47%, #8b5d38 70%); z-index: 1; }
.hole .mole {
  position: absolute;
  left: 18%; bottom: 14%;
  width: 64%;
  transform: translateY(110%);
  transition: transform .16s cubic-bezier(.3, 1.6, .5, 1);
  clip-path: inset(-50% -50% 0 -50%);
}
.hole .stars { opacity: 0; }
.hole.is-up { cursor: pointer; }
.hole.is-up .mole { transform: translateY(0); }
.hole.is-bonk .mole { transform: translateY(18%) scale(1.12, .8); transition-duration: .08s; }
.hole.is-bonk .stars { opacity: 1; animation: spin .4s linear; transform-origin: 50% 20%; }
@keyframes spin { to { rotate: 40deg; } }

/* bubbles: soap film with a rim, a highlight and a shimmer of colour */
.field {
  position: relative;
  height: min(56vh, 24rem);
  overflow: hidden;
  background: radial-gradient(circle at 15% 85%, rgba(255, 255, 255, .7) 0 14%, transparent 15%), radial-gradient(circle at 85% 20%, rgba(255, 255, 255, .6) 0 10%, transparent 11%), linear-gradient(#bfe6ff, #eef9ff 70%, #dff3ff);
  border-radius: 14px;
}
.board.bubbles { position: relative; grid-template-columns: none; overflow: hidden; border-radius: 14px; }
.bubble {
  position: absolute;
  width: var(--s);
  height: var(--s);
  padding: 0;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .95) 0 9%, transparent 22%),
    radial-gradient(circle at 70% 76%, rgba(255, 255, 255, .5) 0 6%, transparent 14%),
    radial-gradient(circle, transparent 58%, color-mix(in srgb, var(--c, var(--c6)) 55%, transparent) 72%, rgba(255, 255, 255, .85) 76%, transparent 77%),
    conic-gradient(from 40deg, rgba(255, 138, 61, .18), rgba(122, 108, 255, .22), rgba(47, 191, 160, .2), rgba(255, 93, 143, .2), rgba(255, 138, 61, .18));
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  animation: bob 2.6s ease-in-out infinite alternate;
}
@keyframes bob { 50% { scale: 1.03 .97; } to { transform: translateY(-10px); } }
.bubble.is-pop { transform: scale(1.5); opacity: 0; transition: transform .16s ease, opacity .16s ease; animation: none; }
.drop {
  position: absolute;
  width: 7px; height: 7px;
  margin: -3.5px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--c, var(--c6)) 60%, #fff);
  pointer-events: none;
  animation: fly .5s ease-out forwards;
}
@keyframes fly { to { transform: rotate(var(--a)) translateX(var(--d)) scale(.3); opacity: 0; } }

/* snake: grass checkerboard, a cartoon snake with eyes that look where it goes, a shiny apple */
.board.snake {
  grid-template-columns: repeat(var(--n), 1fr);
  gap: 0;
  max-width: 30rem;
  margin: 0 auto;
  padding: 6px;
  /* two cells to a check, drawn behind transparent cells, since the row length is even */
  background: repeating-conic-gradient(#a7dd7a 0 25%, #9ad46c 0 50%) 6px 6px / calc((100% - 12px) / 8) calc((100% - 12px) / 8), #5aa83f;
  border-radius: 14px;
  box-shadow: inset 0 0 0 3px #4a9233;
}
.board.snake.is-crash { animation: shake .45s; }
.cell { position: relative; aspect-ratio: 1; }
.cell.is-snake { background: radial-gradient(circle at 40% 35%, #6fe3c3, #1fa384 70%); border-radius: 30%; scale: .96; }
.cell.is-snake.is-tail { scale: .7; border-radius: 50%; }
.cell.is-head { z-index: 1; background: radial-gradient(circle at 40% 35%, #7cf0d0, #168a6f 75%); border-radius: 45%; scale: 1.12; }
.cell.is-head::before, .cell.is-head::after {
  content: "";
  position: absolute;
  width: 32%; height: 32%;
  top: 18%;
  border-radius: 50%;
  background: radial-gradient(circle at var(--px, 50%) var(--py, 50%), #22303f 0 38%, #fff 40%);
}
.cell.is-head::before { left: 12%; }
.cell.is-head::after { right: 12%; }
.cell.to-right { --px: 70%; } .cell.to-left { --px: 30%; } .cell.to-up { --py: 25%; } .cell.to-down { --py: 75%; }
.cell.is-food { background: radial-gradient(circle at 35% 30%, #fff 0 8%, transparent 14%), radial-gradient(circle at 50% 58%, #ff5a4f 0 58%, transparent 60%); animation: beat 1s ease-in-out infinite; }
.cell.is-food::after { content: ""; position: absolute; width: 30%; height: 18%; top: 6%; left: 50%; border-radius: 0 80% 0 80%; background: #3fa34d; }
@keyframes beat { 50% { scale: 1.12; } }
.gameover { text-align: center; padding: 1rem 0; }
.gameover p { font-weight: 800; font-size: 1.3rem; }

/* tic-tac-toe: a wooden board and pen strokes that draw themselves in */
.board.ttt { grid-template-columns: repeat(3, 1fr); gap: .45rem; max-width: 21rem; margin: 0 auto; padding: .55rem; background: repeating-linear-gradient(100deg, #d9a66c 0 14px, #d19c60 14px 22px); border-radius: 16px; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .12); }
.cell-btn {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 12%;
  background: #fffaf0;
  border: 0;
  border-radius: 12px;
  box-shadow: inset 0 -4px 0 rgba(34, 48, 63, .08);
  cursor: pointer;
}
.cell-btn svg { width: 100%; height: 100%; fill: none; stroke-width: 13; stroke-linecap: round; }
.cell-btn svg * { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ink .35s ease-out forwards; }
.cell-btn svg path + path { animation-delay: .18s; }
.cell-btn[data-mark="X"] svg { stroke: var(--c3); }
.cell-btn[data-mark="O"] svg { stroke: var(--c4); }
.cell-btn:disabled { cursor: default; }
.cell-btn.is-line { background: #fff4c2; animation: glow .6s ease-out .3s both; }
@keyframes ink { to { stroke-dashoffset: 0; } }

/* counting: the animals stand on a little meadow and wear their count when tapped */
.count-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  padding: 1rem .5rem 1.6rem;
  font-size: clamp(2rem, 9vw, 3.2rem);
  line-height: 1.3;
  min-height: 2.5em;
  align-content: center;
  background: radial-gradient(ellipse at 30% 100%, #9ad46c 0 30%, transparent 31%), radial-gradient(ellipse at 80% 100%, #8fcf5f 0 34%, transparent 35%), linear-gradient(#d8f1ff, #f3fbff 70%);
  border-radius: 14px;
}
.count-row img { display: block; width: 1.2em; height: 1.2em; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .18)); pointer-events: none; }
.flip .front img { width: 78%; height: 78%; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .15)); }
.count-row span { position: relative; cursor: pointer; animation: hop .5s cubic-bezier(.3, 1.6, .5, 1) both; user-select: none; }
.count-row i { position: absolute; top: -.2em; right: -.3em; min-width: 1.5em; padding: .1em .3em; font: 800 .32em/1.2 inherit; font-style: normal; text-align: center; color: #fff; background: var(--c4); border-radius: 99px; animation: hop .3s both; }
@keyframes hop { from { transform: translateY(.6em) scale(.4); opacity: 0; } }
.answers { display: grid; grid-template-columns: repeat(4, 1fr); gap: .55rem; max-width: 26rem; margin: 1.1rem auto 0; }
.answers .btn { aspect-ratio: 1; padding: 0; font-size: clamp(1.4rem, 6vw, 2rem); border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .45), transparent 45%), var(--c, var(--c6)); }

@media (prefers-reduced-motion: reduce) {
  .flip, .hole .mole, .bubble, .cell.is-food, .count-row span, .count-row i, .cell-btn svg * { transition: none; animation: none; }
  .cell-btn svg * { stroke-dashoffset: 0; }
}

/* round-over / congratulations panel */
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center start;
  padding: 1rem;
  text-align: center;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border-radius: var(--r);
}
.overlay[hidden] { display: none; }
.overlay p { font-weight: 800; font-size: 1.35rem; margin: 0 0 .6rem; }

.foot { padding: 2.5rem 1rem 3rem; text-align: center; color: var(--muted); font-size: .85rem; }
.foot a { color: var(--muted); }

/* the rooms on the front page: the same tiles as the games, wider, because there are four of them
   across the whole site and they are what a grown-up is looking for */
.rooms {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  padding: 0;
  margin: 1.5rem 0 0;
  list-style: none;
}

/* school: the row of ages, then one year at a time */
.ages { flex: 0 1 16rem; margin-left: auto; display: flex; align-items: center; gap: .5rem; font-weight: 800; }
.ages + .lang { margin-left: 0; }
.ages input { flex: 1; min-width: 4rem; accent-color: var(--c3); }
.ages output { min-width: 1.5rem; font-size: 1.3rem; }
.areas, .piano-lesson { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1rem 0; }
.areas a, .piano-lesson a { display: grid; justify-items: center; gap: .3rem; width: 8.5rem; padding: .6rem; font-weight: 800; text-align: center; color: var(--ink); text-decoration: none; background: rgba(255, 255, 255, .18); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 0; border-radius: var(--r); }
.areas a.is-here { box-shadow: 0 0 0 3px var(--c3); }
.areas img, .piano-lesson img { height: 5.5rem; width: auto; max-width: 100%; object-fit: contain; }
.year-head h2 { margin: 1.2rem 0 0; font-size: clamp(1.3rem, 3.4vw, 1.7rem); }
.grades { color: var(--muted); font-size: .9rem; margin: 0; }
.aim { font-weight: 700; }
.lesson { padding: .8rem 1rem 1rem; background: #fff; border: 2px solid var(--line); border-left: 9px solid var(--c2); border-radius: var(--r); }
.lesson ol { margin: .5rem 0 0; padding-left: 1.2rem; }
.lesson li { margin-bottom: .3rem; }
.pathway { margin-top: 1.5rem; }
.pathway .intro { color: var(--muted); margin: .3rem 0 0; }
.pics { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .8rem; }
.pics img { height: 9rem; width: auto; }
.pathway .lesson { margin-top: .8rem; }
.pathway .lesson h4 { margin: 0; font-size: 1.04rem; }
.pathway .lesson p { margin: .5rem 0; }
.pathway .check { color: #216451; }
.pathway .ready { color: var(--muted); }
.talk { margin-left: .5rem; padding: 0 .4rem; font-size: 1rem; line-height: 1.6; background: #f3f5f9; border: 2px solid var(--line); border-radius: 999px; cursor: pointer; }
.talk.on { background: #ffe9a8; }
.lesson li { list-style: none; margin-left: -1.2rem; }
.lesson li input { margin-right: .5rem; width: 1.2rem; height: 1.2rem; vertical-align: middle; }
.lesson li.is-done span { text-decoration: line-through; color: var(--muted); }
.lesson .progress { font-weight: 700; color: var(--muted); }
.lesson.done { border-left-color: #2e9e6b; background: #f1fbf5; }
.lesson.done .progress { color: #216451; }
ul.resources { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .55rem; }
ul.resources li { padding: .7rem 1rem; background: #fff; border: 2px solid var(--line); border-radius: var(--r); }
ul.resources .what { display: block; color: var(--muted); font-size: .9rem; }

/* radio: one station playing at a time, on a screen above the list */
.player { display: grid; gap: .8rem; justify-items: center; margin-top: 1rem; }
.player[hidden] { display: none; }
.now { color: var(--muted); font-size: .95rem; font-weight: 700; margin: 0; text-align: center; }
.screen { width: 100%; max-width: 46rem; aspect-ratio: 16 / 9; overflow: hidden; background: #12202e; border-radius: var(--r); }
.screen iframe { width: 100%; height: 100%; border: 0; }
.stations { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.station { display: grid; gap: .35rem; align-content: start; padding: 1rem 1.1rem; background: #fff; border: 2px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.station .what { color: var(--muted); font-size: .9rem; }
.station-play { justify-self: start; }
.station-play[aria-pressed="true"] { background: var(--c2); }
.station-link { font-size: .9rem; }
.station-group { margin: 1.8rem 0 0; }
.station-group + .lede { margin-top: .2rem; }

/* the channel list: the same tile as a game, but it leaves the site */
.channels { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.channels li { display: flex; }
.channels .tile { flex: 1; }
.channels .tile .age { color: var(--muted); opacity: 1; }
.channels .preview { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; background: #e9e4f5; margin-bottom: .4rem; }

/* five rooms in the bar is too many for a phone held sideways: let it wrap rather than spill */
.bar { flex-wrap: wrap; }
@media (max-width: 30rem) {
  .bar nav a { padding: 0 .55rem; font-size: .95rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.brand { position: relative; display: flex; line-height: 1.1; }
.ver { align-self: flex-end; margin-left: .3rem; white-space: nowrap; font: 600 .8rem "Fredoka", sans-serif; color: #6b8aa8; }
/* kid font, bundled so the site still loads nothing from the network */
@font-face { font-family: "Fredoka"; src: url("/assets/fredoka.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }
/* sign-in gate: everything but the title waits until a name is set (site.js adds .signed-in) */
.desk { position: fixed; inset: 0; z-index: -1; } /* desk art is the page background, whole picture incl. the wall plank */
.desk-bg { width: 100%; height: 100%; object-fit: fill; display: block; }
.desk a { position: absolute; bottom: 30%; transition: transform .2s; }
.desk a:hover, .desk a:focus { transform: scale(1.08); }
.desk a img { width: 100%; display: block; }
body:not(.signed-in) :is(.bar .ages, .bar .lang, .bar .mute, main, .foot) { display: none; }
.gate { max-width: 22rem; margin: 12vh auto; padding: 1.5rem; text-align: center; border-radius: 1.5rem; background: rgba(255, 255, 255, .55); backdrop-filter: blur(12px); }
.gate input, .gate button { font: inherit; display: block; width: 100%; margin-top: .6rem; padding: .6rem 1rem; border-radius: 999px; border: 0; }
.gate button { background: #7a6cff; color: #fff; cursor: pointer; }
.gate [hidden] { display: none; }
@font-face { font-family: "Comic Neue"; src: url("/assets/comicneue.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Baloo 2"; src: url("/assets/baloo2.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Patrick Hand"; src: url("/assets/patrickhand.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Andika"; src: url("/assets/andika.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Schoolbell"; src: url("/assets/schoolbell.ttf") format("truetype"); font-display: swap; }
.pick { background: rgba(255,255,255,.7); border-radius: 16px; padding: 12px 20px; margin-top: 16px; }
.pick-row { display: flex; gap: 12px; flex-wrap: wrap; }
.pick figure { margin: 0; text-align: center; font-weight: 700; }
.pick img { width: 110px; height: 110px; border-radius: 16px; }
.pick p { font-size: 22px; margin: 6px 0; }
/* the report card: a round face in the bar opens it */
.me { flex: none; width: 2.6rem; height: 2.6rem; padding: 0; border: 2px solid #fff; border-radius: 50%; overflow: hidden; background: #7a6cff; color: #fff; font: 700 1.3rem "Fredoka", sans-serif; cursor: pointer; }
.me img, .card .face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card { width: min(26rem, 92vw); border: 0; border-radius: 1.5rem; padding: 1.5rem; text-align: center; }
.card::backdrop { background: rgba(0, 0, 0, .4); }
.card .face { width: 6rem; height: 6rem; margin: 0 auto; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #7a6cff; color: #fff; font: 700 3rem "Fredoka", sans-serif; }
.card h2 { margin: .5rem 0; }
.card select { font: inherit; padding: .2rem .5rem; border-radius: 1rem; }
.card .buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 1rem 0; }
.card button, .lesson .exam, .test > button { font: inherit; border: 0; border-radius: 999px; padding: .4rem .9rem; background: #7a6cff; color: #fff; cursor: pointer; }
.card .grades { list-style: none; padding: 0; text-align: left; max-height: 40vh; overflow: auto; }
.card .grades li { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-bottom: 1px solid #eee; }
.lesson .passed { font-weight: 800; color: #1a8a3a; }
.test fieldset { border: 0; padding: 0; margin: 1rem 0; }
.test legend { font-weight: 800; }
.test label { display: flex; gap: .5rem; align-items: baseline; padding: .2rem 0; }
.home-logo{display:block;max-width:min(320px,80%);height:auto;margin:0 0 1rem}
.brand .logo::before{content:none}
.bar-logo{display:block;height:2.6rem;width:auto}
/* logo: owl cropped out of the picture, wordmark is real text so its letters are as tall as the owl (2.6rem) */
.bar-logo { width: 2.47rem; object-fit: cover; object-position: left; }
.bar-word { font: 700 3.4rem/.8 "Fredoka", sans-serif; color: #18a8f0; }
.bar-word b { color: #004080; }
.bar .lang { color: #fff; font-weight: 700; text-shadow: 0 0 3px #000, 0 0 3px #000; border: 2px solid #fff; background-size: cover; background-position: center; }
.bar .lang option { color: #000; text-shadow: none; background: #fff; }
.bar .lang[data-lang="fr"] { background-image: linear-gradient(90deg, #0055a4 33.3%, #fff 33.3% 66.6%, #ef4135 66.6%); }
.bar .lang[data-lang="ro"] { background-image: linear-gradient(90deg, #002b7f 33.3%, #fcd116 33.3% 66.6%, #ce1126 66.6%); }
.bar .lang[data-lang="en"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30' preserveAspectRatio='none'%3E%3Crect width='60' height='30' fill='%23012169'/%3E%3Cpath d='M0 0L60 30M60 0L0 30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0 0L60 30M60 0L0 30' stroke='%23c8102e' stroke-width='2'/%3E%3Cpath d='M30 0V30M0 15H60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30 0V30M0 15H60' stroke='%23c8102e' stroke-width='6'/%3E%3C/svg%3E"); }
input:not([type=range],[type=checkbox],[type=radio]), textarea, select { background: rgba(255, 255, 255, .18); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 0; border-radius: .5rem; }
input:not([type=range],[type=checkbox],[type=radio]), textarea, select { color: #fff; text-shadow: 1px 1px 0 #000; }
:is(select, textarea) option { color: #000; text-shadow: none; }

/* slides: a page of [data-slide] sections is a deck. Each is a screenful under the bar, snaps into place on a
   swipe, and its content settles in as it arrives (the slide itself never moves, only what is inside it). */
html:has([data-slide]) { scroll-snap-type: y proximity; scroll-behavior: smooth; scroll-padding-top: var(--bar); }
.wrap:has([data-slide]) { padding-block: 0; }
[data-slide] {
  display: grid;
  align-content: center;
  min-height: calc(100vh - var(--bar));
  min-height: calc(100svh - var(--bar));
  padding-block: clamp(1rem, 4vh, 2.5rem);
  scroll-snap-align: start;
  scroll-margin-top: var(--bar);
}
[data-slide].is-arriving > * { animation: slide-down .55s cubic-bezier(.22, .61, .36, 1) both; }
[data-slide].is-leaving > * { animation: slide-up .45s cubic-bezier(.4, 0, .75, .25) both; }
@keyframes slide-down { from { transform: translateY(-3rem); } }
@keyframes slide-up { to { transform: translateY(-3rem); } }

/* Shared game polish: painted scene backdrops, stars, sparks, shake. */
.stage.scene { background: var(--scene) center / cover no-repeat, var(--paper); }
.stars-row { display: flex; justify-content: center; gap: .4rem; margin: .4rem 0 .8rem; font-size: clamp(2.4rem, 9vw, 3.6rem); line-height: 1; }
.stars-row .star { width: 1em; height: 1em; filter: grayscale(1) opacity(.35); }
.stars-row .star.is-won { filter: drop-shadow(0 3px 0 #e09a12) drop-shadow(0 0 12px rgba(255, 197, 61, .7)); animation: star-land .5s calc(.25s + var(--i) * .32s) cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes star-land { from { transform: scale(0) rotate(-120deg); opacity: 0; } to { transform: none; opacity: 1; } }
.tile-stars { position: absolute; bottom: .6rem; right: .7rem; padding: .1rem .5rem; border-radius: 99px; display: inline-flex; align-items: center; gap: .2rem; font-size: .85rem; font-weight: 800; color: #8a5a00; background: #fff4cf; }
.tile-stars img { width: 1.15rem; height: 1.15rem; }
.tile { position: relative; }
.levels { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.levels button[aria-pressed="true"] { outline: 3px solid var(--ink); outline-offset: 2px; }
.fx-spark { position: fixed; z-index: 60; pointer-events: none; width: 22px; height: 22px; translate: -50% -50%; animation: spark .7s ease-out forwards; }
@keyframes spark { to { transform: rotate(var(--a)) translateX(var(--d)) scale(.2); opacity: 0; } }
.fx-shake { animation: fx-shake .45s ease-in-out; }
@keyframes fx-shake { 20%, 60% { transform: translateX(-7px) rotate(-2deg); } 40%, 80% { transform: translateX(7px) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .fx-shake, .stars-row .star.is-won { animation: none; } }
