/* WordNest: a bird's nest in a big tree at golden hour, in cut paper. */

:root {
  --cream: #FFF8EC;
  --paper: #FFFDF7;
  --teal: #0F5E63;
  --teal-deep: #0A4449;
  --sun: #FFC23C;
  --sun-deep: #E59A1C;
  --coral: #F26B5B;
  --leaf: #6BBF8A;
  --ink: #1E2A32;
  --grey: #C9CFD2;

  --font-ui: "Baloo 2", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --font-read: "Andika", "Comic Sans MS", "Trebuchet MS", system-ui, sans-serif;
  --font-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;

  --lift: 0 5px 0 rgba(15, 94, 99, .16), 0 16px 26px -14px rgba(15, 94, 99, .55);
  --lift-low: 0 2px 0 rgba(15, 94, 99, .16), 0 6px 12px -8px rgba(15, 94, 99, .5);

  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --gutter: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:disabled { cursor: default; }
:focus { outline: none; }
:focus-visible { outline: 4px solid var(--sun); outline-offset: 3px; }

h1, h2, h3, p { margin: 0; }

/* ---------- the world behind everything ---------- */
.scene { position: fixed; inset: 0; z-index: 0; pointer-events: none; transition: opacity .3s; }
.scene svg { width: 100%; height: 100%; display: block; }
body[data-screen="game"] .scene,
body[data-screen="grownups"] .scene { opacity: .5; }

#app { position: relative; z-index: 1; }
#fx { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }

/* ---------- screens ---------- */
.screen {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding:
    calc(var(--gutter) + var(--sat))
    calc(var(--gutter) + var(--sar))
    calc(var(--gutter) + 4px + var(--sab))
    calc(var(--gutter) + var(--sal));
  animation: screen-in .26s ease-out both;
}
/* Entrances only shrink or drop in from above, so nothing ever pokes past the
   bottom edge and flashes a scrollbar. */
@keyframes screen-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }

/* ---------- Pip ---------- */
.pip { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 3px 0 rgba(30, 42, 50, .1)); }
.pip-btn { flex: none; width: clamp(62px, 9vw, 96px); border-radius: 50%; }
.pip-lids ellipse { transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(0); animation: blink 4.6s infinite; }
.pip-bob, .pip-beak-low { transform-box: fill-box; transform-origin: 50% 100%; }
.pip-beak-low { transform-origin: 50% 0; }
@keyframes blink { 0%, 91%, 100% { transform: scaleY(0); } 94%, 97% { transform: scaleY(1); } }
.pip-talking .pip-bob { animation: pip-bounce .44s ease-in-out infinite; }
.pip-talking .pip-beak-low { animation: pip-beak .22s ease-in-out infinite alternate; }
@keyframes pip-bounce { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-5px) scale(1.02, .98); } }
@keyframes pip-beak { from { transform: translateY(0); } to { transform: translateY(3.5px); } }

/* ---------- buttons ---------- */
.round-btn {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--teal);
  display: grid;
  place-items: center;
  box-shadow: var(--lift);
  transition: transform .15s, box-shadow .15s, opacity .2s, background-color .2s;
}
.round-btn:active:not(:disabled) { transform: translateY(4px); box-shadow: var(--lift-low); }
.round-btn:disabled { opacity: .38; box-shadow: var(--lift-low); }
.ico { width: 30px; height: 30px; display: block; }
.hear-btn { background: var(--sun); color: var(--ink); box-shadow: 0 5px 0 var(--sun-deep), 0 16px 26px -14px rgba(229, 154, 28, .9); width: 68px; height: 68px; }
.hear-btn .ico { width: 34px; height: 34px; }

.btn {
  min-height: 64px;
  padding: 0 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 800;
  font-size: 22px;
  line-height: 1;
  white-space: nowrap;
  transition: transform .15s, box-shadow .15s;
}
.btn .ico { width: 28px; height: 28px; }
.btn .nest-ico { width: 40px; height: auto; }
.btn:active { transform: translateY(4px); }
.btn-main { background: var(--teal); color: #fff; box-shadow: 0 5px 0 var(--teal-deep), 0 16px 24px -12px rgba(10, 68, 73, .8); }
.btn-main:active { box-shadow: 0 1px 0 var(--teal-deep); }
.btn-sun { background: var(--sun); color: var(--ink); box-shadow: 0 5px 0 var(--sun-deep), 0 16px 24px -12px rgba(229, 154, 28, .8); }
.btn-sun:active { box-shadow: 0 1px 0 var(--sun-deep); }
.btn-quiet { background: var(--paper); color: var(--teal); box-shadow: var(--lift); }
.btn-quiet:active { box-shadow: var(--lift-low); }
.btn-huge { min-height: 96px; padding: 0 56px 0 44px; font-size: 40px; gap: 14px; }
.btn-huge .ico { width: 46px; height: 46px; }
.btn-small { min-height: 48px; font-size: 18px; padding: 0 20px; }

/* ---------- logo ---------- */
.logo {
  font-weight: 800;
  font-size: clamp(42px, 8vw, 76px);
  line-height: .95;
  letter-spacing: -.01em;
  color: var(--teal);
  text-shadow: 0 3px 0 rgba(15, 94, 99, .14);
}
.logo span { color: var(--coral); }

/* ---------- splash ---------- */
.splash { align-items: center; justify-content: center; gap: 18px; text-align: center; }
.splash-pip { width: clamp(150px, 30vmin, 230px); animation: float 3.2s ease-in-out infinite; }
.splash .logo { font-size: clamp(56px, 13vmin, 110px); margin-bottom: 14px; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.btn-huge { animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* ---------- home ---------- */
.home { gap: 16px; }
.home-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "nest grown" "brand brand";
  align-items: center;
  gap: 4px 10px;
}
.brand { grid-area: brand; display: flex; align-items: center; justify-content: center; gap: 8px; }
.brand .pip-btn { width: clamp(84px, 13vw, 124px); }

.nest-btn {
  grid-area: nest;
  justify-self: start;
  min-height: 64px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--lift);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 20px;
  color: var(--teal);
  transition: transform .15s, box-shadow .15s;
}
.nest-btn:active { transform: translateY(4px); box-shadow: var(--lift-low); }
.nest-ico { width: 52px; height: auto; display: block; flex: none; }
.nest-count {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 17px;
  background: var(--sun);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}
.grown-btn {
  grid-area: grown;
  justify-self: end;
  min-height: 64px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 16px;
  color: var(--teal);
  opacity: .8;
}
.grown-btn .ico { width: 20px; height: 20px; }
.grown-words { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.1; }
.grown-words [lang="he"] { font-family: "Segoe UI", "Arial Hebrew", "Noto Sans Hebrew", Arial, system-ui, sans-serif; font-weight: 700; font-size: 16px; }
.grown-words small { font-family: "Segoe UI", Arial, system-ui, sans-serif; font-weight: 600; font-size: 12px; letter-spacing: .02em; opacity: .85; }
/* grown-ups: the language of the screen, at the top */
.grown .bar .glang { flex: none; }
.grown .glang .seg-btn { min-width: 0; padding: 0 14px; font-weight: 700; }
@media (max-width: 480px) { .grown .glang .seg-btn { padding: 0 10px; font-size: 14px; } .grown .bar-title { font-size: 22px; } }

.zones {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: center;
}
.zone-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--paper);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 6px 0 rgba(15, 94, 99, .16), 0 22px 30px -18px rgba(15, 94, 99, .6);
  text-align: center;
  transition: transform .18s, box-shadow .18s;
  animation: card-in .34s cubic-bezier(.2, .9, .3, 1.2) both;
}
.zone-card:nth-child(2) { animation-delay: .05s; }
.zone-card:nth-child(3) { animation-delay: .1s; }
.zone-card:nth-child(4) { animation-delay: .15s; }
@keyframes card-in { from { opacity: 0; transform: translateY(-14px) scale(.96) rotate(-1.5deg); } to { opacity: 1; transform: none; } }
.zone-card:active { transform: translateY(5px); box-shadow: 0 1px 0 rgba(15, 94, 99, .16), 0 8px 14px -10px rgba(15, 94, 99, .6); }
@media (hover: hover) { .zone-card:hover { transform: translateY(-4px) rotate(-.6deg); } .zone-card:hover:active { transform: translateY(5px); } }
.zone-art { display: block; width: 100%; aspect-ratio: 200 / 130; overflow: hidden; }
.zone-art svg { display: block; width: 100%; height: 100%; }
.zone-info { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px 14px; }
.zone-name { font-weight: 800; font-size: clamp(19px, 2.5vw, 27px); line-height: 1.1; color: var(--teal); }

.stars { display: inline-flex; gap: 2px; }
.star { width: 20px; height: 20px; display: block; }
.star.on path { fill: var(--sun); stroke: var(--sun-deep); stroke-width: 1; stroke-linejoin: round; }
.star.off path { fill: rgba(15, 94, 99, .13); }

/* ---------- top bar + prompt ---------- */
.bar { display: flex; align-items: center; gap: 12px; min-height: 68px; }
.bar-gap { flex: none; width: 64px; }
.bar-title { flex: 1; text-align: center; font-weight: 800; font-size: clamp(24px, 4vw, 38px); color: var(--teal); line-height: 1; }
.dots { flex: 1; display: flex; justify-content: center; align-items: center; gap: clamp(7px, 1.6vw, 14px); }
.dot {
  width: 18px;
  height: 23px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: rgba(15, 94, 99, .16);
  transition: transform .2s, background-color .2s;
}
.dot.now { background: var(--teal); transform: scale(1.25); }
.dot.done { background: var(--leaf); }
.dot.gold { background: var(--sun); box-shadow: inset 0 -3px 0 var(--sun-deep); }

.prompt { display: flex; align-items: center; gap: 12px; }
.bubble {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  padding: 10px 18px;
  background: var(--paper);
  border-radius: 24px;
  box-shadow: var(--lift);
}
.bubble::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  width: 20px;
  height: 20px;
  background: var(--paper);
  border-radius: 4px;
  transform: translateY(-50%) rotate(45deg);
}
.bubble-text { position: relative; font-weight: 700; font-size: clamp(18px, 2.7vw, 28px); line-height: 1.2; color: var(--teal); }

.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 0 10px;
}
.stage-in > * { animation: stage-in .28s ease-out both; }
@keyframes stage-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- picture cards ---------- */
.choice, .build, .seq-game { width: 100%; display: flex; flex-direction: column; align-items: center; gap: clamp(16px, 3.4vh, 34px); }
.options { width: min(100%, 660px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 2.6vw, 28px); }

.pic-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 96px;
  display: grid;
  place-items: center;
  background: var(--paper);
  border-radius: 26px;
  box-shadow: var(--lift);
  transition: transform .18s, box-shadow .18s, filter .25s, opacity .25s;
}
.pic-card:active:not(:disabled) { transform: translateY(4px); box-shadow: var(--lift-low); }
.pic {
  font-family: var(--font-emoji);
  font-size: clamp(64px, calc(9vw + 20px), 96px);
  line-height: 1;
  display: block;
  pointer-events: none;
}
.pic-label {
  position: absolute;
  left: 0; right: 0; bottom: 4px;
  font-family: var(--font-read);
  font-weight: 700;
  font-size: 17px;
  line-height: 1;
  color: var(--teal);
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
}
.target .pic { font-size: clamp(72px, 12vh, 96px); }
.show-label .pic-label { opacity: 1; }
.show-label .pic { transform: translateY(-7px); }

.pic-card.target {
  width: clamp(132px, 24vh, 196px);
  border: 5px solid var(--sun);
  border-radius: 34px;
}
.pic-card.target::after {
  /* a small ear on the card: tap to hear the word */
  content: "";
  position: absolute;
  right: -12px; top: -12px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--sun) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E2A32' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9.5v5h3.5l5 4v-13l-5 4z' fill='%231E2A32'/%3E%3Cpath d='M16 9a4.5 4.5 0 0 1 0 6'/%3E%3C/svg%3E") center / 22px no-repeat;
  box-shadow: 0 3px 0 var(--sun-deep);
}

.talking { transform: translateY(-8px) scale(1.05); box-shadow: 0 0 0 5px var(--sun), 0 22px 26px -14px rgba(15, 94, 99, .6); }
.is-right { box-shadow: 0 0 0 6px var(--leaf), 0 16px 26px -14px rgba(15, 94, 99, .55); }
.option.is-right { transform: scale(1.05); }
.is-out { filter: grayscale(1); opacity: .38; box-shadow: none; }
.hint { animation: hint 1.1s ease-in-out infinite; }
@keyframes hint {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 194, 60, .95), 0 16px 26px -14px rgba(15, 94, 99, .55); transform: scale(1); }
  50% { box-shadow: 0 0 0 11px rgba(255, 194, 60, .3), 0 16px 26px -14px rgba(15, 94, 99, .55); transform: scale(1.05); }
}
.wobble { animation: wobble .4s ease-in-out; }
@keyframes wobble {
  0%, 100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-7px) rotate(-3deg); }
  45% { transform: translateX(6px) rotate(2.5deg); }
  70% { transform: translateX(-4px) rotate(-1.5deg); }
  88% { transform: translateX(2px) rotate(.5deg); }
}

/* ---------- letter tiles ---------- */
.tiles, .slots, .seq { display: flex; justify-content: center; flex-wrap: wrap; gap: clamp(6px, 1.8vw, 16px); max-width: 100%; }
.tile {
  flex: none;
  width: clamp(64px, 16.5vw, 104px);
  height: clamp(70px, 18vw, 112px);
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--paper);
  color: var(--teal);
  font-family: var(--font-read);
  font-weight: 700;
  font-size: clamp(40px, 9.5vw, 62px);
  line-height: 1;
  padding-bottom: .12em;
  box-shadow: var(--lift);
  transition: transform .18s, box-shadow .18s, background-color .2s, color .2s, filter .25s, opacity .25s;
}
/* rows of three or four tiles have room to be bigger on a phone */
.slots .tile, .seq-game .tile {
  width: clamp(64px, 20.5vw, 104px);
  height: clamp(70px, 22vw, 112px);
  font-size: clamp(40px, 11.5vw, 62px);
}
.tile-btn { touch-action: none; }
.tile-btn:active:not(:disabled) { transform: translateY(4px); box-shadow: var(--lift-low); }
.tile-btn.used { visibility: hidden; }
.tile-btn.dragging { z-index: 4; transition: none; box-shadow: 0 0 0 4px var(--sun), 0 26px 30px -14px rgba(15, 94, 99, .7); }
.slot {
  background: rgba(255, 253, 247, .65);
  border: 3px dashed rgba(15, 94, 99, .38);
  box-shadow: none;
}
.slot.filled { background: var(--paper); border-color: transparent; box-shadow: var(--lift); }
.seq-blank:not(.filled) { background: rgba(255, 194, 60, .22); border-color: var(--sun-deep); }
.tile.lit { background: var(--sun); color: var(--ink); transform: translateY(-7px); box-shadow: 0 5px 0 var(--sun-deep), 0 20px 22px -14px rgba(229, 154, 28, .9); }
.slots.is-right, .seq.is-right { box-shadow: none; }

/* ---------- tracing ---------- */
.trace { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.trace-pad {
  position: relative;
  width: min(100%, 60vh, 540px);
  aspect-ratio: 1 / 1;
  background: var(--paper);
  border-radius: 30px;
  box-shadow: var(--lift);
  overflow: hidden;
  touch-action: none;
  transition: box-shadow .25s;
}
.trace-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.trace-ink { touch-action: none; cursor: crosshair; }
.trace-pad.gentle { box-shadow: 0 0 0 5px rgba(255, 194, 60, .8), var(--lift); }
.trace-pad.solved { box-shadow: 0 0 0 6px var(--leaf), var(--lift); }
.trace-pic { position: absolute; top: 10px; right: 12px; opacity: 0; transform: scale(.5) rotate(-12deg); transition: opacity .25s, transform .3s cubic-bezier(.2, .9, .3, 1.4); pointer-events: none; }
.trace-pic .pic { font-size: clamp(40px, 9vmin, 64px); }
.trace-pad.solved .trace-pic { opacity: 1; transform: none; }
.trace-tools { display: flex; gap: 18px; }
.tool-next:not(:disabled) { background: var(--teal); color: #fff; box-shadow: 0 5px 0 var(--teal-deep), 0 16px 24px -12px rgba(10, 68, 73, .8); }
.tool-next.pulse { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* ---------- end of round ---------- */
.result { display: flex; flex-direction: column; align-items: center; gap: clamp(14px, 3vh, 26px); width: 100%; }
.result-stars { display: flex; align-items: flex-end; gap: 8px; }
.star.big { width: clamp(64px, 15vmin, 116px); height: auto; aspect-ratio: 1; animation: star-pop .45s cubic-bezier(.2, .9, .3, 1.5) both; }
.star.big:nth-child(2) { animation-delay: .16s; margin-bottom: 16px; }
.star.big:nth-child(3) { animation-delay: .32s; }
@keyframes star-pop { from { opacity: 0; transform: scale(.2) rotate(-30deg); } to { opacity: 1; transform: none; } }
.result-egg { display: flex; align-items: center; gap: 14px; }
.egg { display: block; width: 100%; height: auto; filter: drop-shadow(0 3px 0 rgba(30, 42, 50, .13)); }
.egg-slot { filter: none; }
.egg-drop { width: clamp(64px, 13vmin, 96px); animation: egg-drop .7s cubic-bezier(.3, 1.4, .5, 1) .5s both; }
@keyframes egg-drop { 0% { opacity: 0; transform: translateY(-70px) rotate(-18deg); } 60% { opacity: 1; transform: translateY(6px) rotate(6deg); } 100% { opacity: 1; transform: none; } }
.egg-count {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px 6px 10px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--lift-low);
  font-size: 26px; font-weight: 800; color: var(--teal);
}
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

/* ---------- my nest ---------- */
.nest-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 12px; padding-bottom: 4vh; }
.flock {
  width: 100%;
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  align-content: flex-end;
  justify-content: center;
  gap: 6px 10px;
  padding: 8px 8px 0;
  border-bottom: 9px solid #C98B4A;
  border-radius: 0 0 9px 9px;
  min-height: 96px;
}
.flock-empty { border-bottom-color: rgba(201, 139, 74, .45); }
.bird-btn { width: clamp(64px, 12vmin, 92px); min-height: 64px; margin-bottom: -4px; display: grid; align-items: end; }
.bird { display: block; width: 100%; height: auto; filter: drop-shadow(0 3px 0 rgba(30, 42, 50, .12)); animation: card-in .4s cubic-bezier(.2, .9, .3, 1.4) both; }
.hop .bird { animation: hop .5s ease-out; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-22px) rotate(-6deg); } 60% { transform: translateY(0); } 80% { transform: translateY(-8px); } }
.nest-box { position: relative; width: min(84%, 440px); }
.nest-eggs { position: relative; z-index: 0; display: flex; justify-content: center; gap: 3%; margin: 0 auto -21%; width: 74%; }
.nest-egg { flex: 1; min-width: 0; }
.nest-egg:nth-child(2) { transform: translateY(-9%); }
.nest-art { position: relative; z-index: 1; display: block; width: 100%; height: auto; }
.nest-note { font-family: var(--font-read); font-size: 16px; color: var(--teal); background: rgba(255, 253, 247, .85); padding: 4px 14px; border-radius: 999px; }

/* ---------- grown-ups ---------- */
.grown { -webkit-user-select: text; user-select: text; }
.grown-main { flex: 1; display: flex; flex-direction: column; gap: 14px; width: min(100%, 760px); margin: 0 auto; }
.gate { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; }
.gate-text { font-family: var(--font-read); font-size: 19px; line-height: 1.45; color: var(--ink); }
.hold-btn { position: relative; width: 132px; height: 132px; border-radius: 50%; background: var(--paper); box-shadow: var(--lift); color: var(--teal); touch-action: none; -webkit-user-select: none; user-select: none; }
.hold-btn svg:first-child { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); transform: rotate(-90deg); }
.hold-track { fill: none; stroke: rgba(15, 94, 99, .12); stroke-width: 9; }
.hold-ring { fill: none; stroke: var(--teal); stroke-width: 9; stroke-linecap: round; stroke-dashoffset: 100; transition: stroke-dashoffset .2s ease-out; }
.hold-btn.holding .hold-ring { stroke-dashoffset: 0; transition: stroke-dashoffset 3s linear; }
.hold-ico { position: absolute; inset: 0; display: grid; place-items: center; }
.hold-ico .ico { width: 44px; height: 44px; }
.hold-btn.holding { transform: scale(.97); }

.panel { background: var(--paper); border-radius: 22px; padding: 16px 18px 18px; box-shadow: var(--lift-low); font-family: var(--font-read); font-size: 16.5px; line-height: 1.5; }
.panel h3 { font-family: var(--font-ui); font-weight: 800; font-size: 24px; color: var(--teal); margin-bottom: 6px; }
.panel p + p { margin-top: 8px; }
.panel .small { font-size: 14.5px; color: #4B5A63; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 0; flex-wrap: wrap; }
.row + .row { border-top: 1px solid rgba(15, 94, 99, .1); }
.table-wrap { overflow-x: auto; margin: 0 -4px 8px; }
.progress { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.progress th, .progress td { text-align: left; padding: 7px 6px; border-bottom: 1px solid rgba(15, 94, 99, .1); vertical-align: top; }
.progress thead th { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #4B5A63; font-weight: 700; }
.progress tbody th { font-weight: 700; color: var(--teal); }
.switch { flex: none; width: 76px; height: 44px; border-radius: 22px; background: var(--grey); position: relative; transition: background-color .2s; }
.switch i { position: absolute; top: 4px; left: 4px; width: 36px; height: 36px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(30, 42, 50, .25); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--teal); }
.switch[aria-checked="true"] i { transform: translateX(32px); }
.seg { display: inline-flex; background: rgba(15, 94, 99, .1); border-radius: 999px; padding: 4px; gap: 2px; }
.seg-btn { min-height: 44px; padding: 0 16px; border-radius: 999px; font-family: var(--font-ui); font-weight: 700; font-size: 17px; color: var(--teal); }
.seg-btn[aria-pressed="true"] { background: var(--teal); color: #fff; }
.confirm { background: rgba(255, 194, 60, .2); border-radius: 16px; padding: 14px; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }

/* ---------- celebration bits ---------- */
.bit { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; animation: bit .7s cubic-bezier(.15, .7, .3, 1) both; }
.bit-dot { border-radius: 50%; }
.bit-leaf { border-radius: 0 100% 0 100%; width: 16px; height: 16px; }
.bit-star { clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 36%); width: 18px; height: 18px; }
@keyframes bit {
  0% { opacity: 1; transform: translate(0, 0) rotate(0) scale(.4); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1); }
}

/* ---------- bigger screens ---------- */
@media (min-width: 600px) {
  :root { --gutter: 20px; }
  .screen { gap: 16px; }
  .round-btn { width: 72px; height: 72px; }
  .bar-gap { width: 72px; }
  .hear-btn { width: 80px; height: 80px; }
  .hear-btn .ico { width: 40px; height: 40px; }
  .ico { width: 34px; height: 34px; }
  .star { width: 24px; height: 24px; }
  .bubble { min-height: 76px; padding: 12px 24px; border-radius: 28px; }
  .dot { width: 22px; height: 28px; }
  .grown-btn { font-size: 18px; }
  .panel { padding: 20px 24px 22px; }
}

/* tablet and desktop in landscape: four zone cards in one row */
@media (min-width: 820px) and (orientation: landscape) {
  .home-top { grid-template-columns: 1fr auto 1fr; grid-template-areas: "nest brand grown"; }
  .zones { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
  .zones.game-cards { grid-template-columns: repeat(2, minmax(0, 300px)); justify-content: center; gap: 30px; }
  .zone-art { aspect-ratio: 1 / 1; }
  .game-cards .zone-art { aspect-ratio: 200 / 130; }
  .zone-info { padding: 14px 10px 18px; gap: 6px; }
  .trace { flex-direction: row; justify-content: center; gap: 28px; }
  .trace-tools { flex-direction: column; }
}

/* phones: two game cards side by side would be tiny, so stack them on narrow portrait */
@media (max-width: 819px) {
  .zones.game-cards { grid-template-columns: minmax(0, 420px); justify-content: center; }
}
@media (max-width: 380px) {
  .nest-btn-label { display: none; }
}

/* short landscape screens (a phone on its side): keep everything reachable */
@media (max-height: 520px) and (orientation: landscape) {
  .pip-btn { width: 60px; }
  .bar { min-height: 56px; }
  .choice, .build, .seq-game { flex-direction: row; justify-content: center; flex-wrap: wrap; }
  .pic-card.target { width: 120px; }
  .options { width: min(62%, 420px); }
  .trace { flex-direction: row; justify-content: center; }
  .trace-tools { flex-direction: column; gap: 8px; }
  .trace-pad { width: min(100%, 72vh); }
  .zones { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home-top { grid-template-columns: 1fr auto 1fr; grid-template-areas: "nest brand grown"; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
  }
  .pip-lids ellipse { animation: none; }
}

/* ===== 0.2: levels, the pointing hand, Hebrew ===== */
.level-cards {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 2.4vw, 26px);
  align-content: center;
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 8px 0 12px;
}
.level-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: clamp(150px, 30vh, 260px);
  padding: 16px 6px;
  border-radius: 26px;
  background: var(--paper);
  color: var(--teal);
  box-shadow: var(--lift);
  animation: card-in .4s both;
  transition: transform .12s ease, box-shadow .12s ease;
}
.level-card:nth-child(2) { animation-delay: .05s; }
.level-card:nth-child(3) { animation-delay: .1s; }
.level-card:active { transform: translateY(5px); box-shadow: var(--lift-low); }
.level-num { font-family: var(--font-ui); font-weight: 800; font-size: clamp(60px, 13vw, 120px); line-height: .9; }
.level-card .star { width: clamp(18px, 3.6vw, 32px); height: auto; aspect-ratio: 1; }
.level-card.is-locked { background: rgba(255, 253, 247, .6); color: rgba(15, 94, 99, .5); }
.level-lock .ico { width: 36px; height: 36px; display: block; }

/* The hand that shows a first-time player what to tap. It lives in #fx, above the game. */
.demo-hand {
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(0 6px 5px rgba(30, 42, 50, .28));
  animation: demo-tap 1.3s ease-in-out infinite;
}
.demo-hand svg { display: block; width: 100%; height: 100%; }
@keyframes demo-tap {
  0%, 100% { transform: translate(16px, 22px); }
  45%, 62% { transform: translate(0, 0) scale(.93); }
}


/* Hebrew: instructions in the bubble, and the grown-ups screen. */
.bubble-text[dir="auto"] { unicode-bidi: plaintext; text-align: start; }
.grown[dir="rtl"] .progress th, .grown[dir="rtl"] .progress td { text-align: right; }
.grown[dir="rtl"] .progress thead th { letter-spacing: 0; }
.grown, .grown .panel, .grown .panel h3, .grown .bar-title, .grown .seg-btn, .grown .btn, .grown .gate-text {
  font-family: "Segoe UI", "Arial Hebrew", "Noto Sans Hebrew", Arial, system-ui, sans-serif;
}
.grown-btn[lang="he"] { font-family: "Segoe UI", "Arial Hebrew", "Noto Sans Hebrew", Arial, system-ui, sans-serif; font-weight: 700; }

/* The version, in plain sight, and the refresh button. */
.version-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px; margin-top: 8px; font-family: "Segoe UI", "Arial Hebrew", "Noto Sans Hebrew", Arial, system-ui, sans-serif; font-size: 16px; color: var(--teal); }
.version-row .btn { min-height: 44px; padding: 0 16px; font-family: inherit; font-size: 15px; font-weight: 700; animation: none; }
.version-status { flex-basis: 100%; min-height: 1.3em; text-align: center; font-size: 15px; }
.home-version { align-self: center; padding: 3px 14px; border-radius: 999px; background: rgba(255, 253, 247, .92); box-shadow: var(--lift-low); font-family: "Segoe UI", "Arial Hebrew", "Noto Sans Hebrew", Arial, system-ui, sans-serif; font-size: 14px; color: var(--teal); }

/* First screen: language choice and install. */
.splash-ask { font-family: "Segoe UI", "Arial Hebrew", "Noto Sans Hebrew", Arial, system-ui, sans-serif; font-weight: 700; font-size: 22px; color: var(--teal); }
.splash-langs { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.splash-langs .btn { min-height: 88px; min-width: 150px; padding: 0 30px; font-size: 32px; }
.splash-langs .btn[lang="he"], .splash-install { font-family: "Segoe UI", "Arial Hebrew", "Noto Sans Hebrew", Arial, system-ui, sans-serif; font-weight: 700; }
.splash-install { min-height: 56px; }
.ios-help { max-width: 360px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px; background: var(--paper); box-shadow: var(--lift-low); font-family: "Segoe UI", Arial, system-ui, sans-serif; font-size: 16px; line-height: 1.4; color: var(--ink); text-align: start; }
.ios-help svg { flex: none; width: 34px; height: 34px; color: var(--teal); }

/* Nine stars (three games) must stay inside the card. */
.zone-info .stars { flex-wrap: wrap; justify-content: center; max-width: 100%; }
.zone-card[data-zone="sounds"] .star { width: 15px; height: 15px; }

/* Grown-ups: progress in sentences, and the "coming soon" card. */
.insights { margin: 2px 0 12px; padding: 10px 14px; border-radius: 14px; background: rgba(107, 191, 138, .16); }
.insights p + p { margin-top: 4px; }
.soon { display: inline-block; margin-inline-start: 8px; padding: 2px 12px; border-radius: 999px; background: var(--sun); color: var(--ink); font-size: 14px; font-weight: 700; vertical-align: middle; }

/* ---------- Write a Letter ---------- */
.write-stage { width: 100%; }
.write-work { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.write-pad {
  position: relative;
  /* the stage has no fixed height, so the pad is sized from the screen: room left under the header, or the width */
  height: min(calc(100vh - 330px), calc((100vw - 32px) * 1.25), 680px);
  height: min(calc(100dvh - 330px), calc((100vw - 32px) * 1.25), 680px);
  min-height: 240px;
  max-width: 100%;
  aspect-ratio: 80 / 100;
  background: var(--paper);
  border-radius: 28px;
  box-shadow: var(--lift);
  touch-action: none;
  -webkit-user-select: none; user-select: none;
}
.write-svg { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; overflow: visible; }
/* every touch lands on the board itself, never on a shape inside it */
.write-svg * { pointer-events: none; }
.write-pad, .write-work, .write-stage { touch-action: none; overscroll-behavior: none; }
.diag-box { position: fixed; left: 6px; right: 6px; bottom: 6px; z-index: 99; max-height: 42vh; overflow: hidden; margin: 0; padding: 8px 10px; border-radius: 10px; background: rgba(30, 42, 50, .86); color: #fff; font: 12px/1.35 ui-monospace, Consolas, monospace; white-space: pre-wrap; pointer-events: none; direction: ltr; text-align: left; }
.write-tools { display: flex; gap: 18px; }
.write[data-step="watch"] .write-tools [data-w="clear"],
.write[data-step="paper"] .write-tools, .write[data-step="word"] .write-tools { visibility: hidden; }
.ln { stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ln-top, .ln-below { stroke: rgba(15, 94, 99, .16); stroke-width: 2; }
.ln-mid { stroke: rgba(15, 94, 99, .2); stroke-width: 2; stroke-dasharray: 7 8; }
.ln-base { stroke: rgba(15, 94, 99, .42); stroke-width: 2.5; }
.w-shadow path { fill: none; stroke: #E7ECEC; stroke-width: 9.5; stroke-linecap: round; stroke-linejoin: round; }
.w-stroke, .w-progress { fill: none; stroke: var(--teal); stroke-width: 6.4; stroke-linecap: round; stroke-linejoin: round; }
.w-dash { fill: none; stroke: #8FA3A6; stroke-width: 1.3; stroke-dasharray: 2.2 2.6; stroke-linecap: round; }
.w-free { fill: none; stroke: var(--teal); stroke-width: 5.6; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s, opacity .45s; }
.w-free.ok { stroke: var(--teal); }
.w-free.bad { stroke: #E02424; opacity: 0; transition-delay: 0s, .2s; }
.w-dot { fill: #2EA862; stroke: #fff; stroke-width: 1; }
.w-ring { fill: none; stroke: #2EA862; stroke-width: 1.2; transform-box: fill-box; transform-origin: center; animation: w-ring 1.6s ease-out infinite; }
@keyframes w-ring { 0% { transform: scale(1); opacity: .75; } 100% { transform: scale(2.3); opacity: 0; } }
.w-num { fill: #fff; font: 800 5px var(--font-ui); text-anchor: middle; pointer-events: none; }
.w-arrow { fill: #2EA862; opacity: .9; }
.w-flash { animation: w-flash .3s ease-in-out 3 !important; transform-box: fill-box; transform-origin: center; }
@keyframes w-flash { 50% { transform: scale(1.45); } }
.w-edge path { fill: none; stroke: #6F8F92; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s; }
.w-road path { fill: none; stroke: var(--paper); stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s; }
.write-pad.is-ok .w-edge path { stroke: #1E9E4A; }
.write-pad.is-ok .w-road path { stroke: #BDEFCB; }
.write-pad.is-ok .w-free { stroke: #1E9E4A; }
.write-pad.is-wrong .w-edge path { stroke: #E02424; }
.write-pad.is-wrong .w-road path { stroke: #FFD3D3; }
.write-pad.is-wrong .w-free { stroke: #E02424; }
.write-pad.is-ok { box-shadow: 0 0 0 6px #1E9E4A, var(--lift); }
.write-pad.is-wrong { box-shadow: 0 0 0 6px #E02424, var(--lift); }
/* a small shake of the letter only, not of the whole pad */
.w-shake { animation: w-shake .36s ease-in-out; }
@keyframes w-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-3px); } }
.w-try { fill: rgba(15, 94, 99, .14); }
.w-try.on { fill: var(--sun); stroke: var(--sun-deep); stroke-width: 1.5; }
.w-pen { pointer-events: none; filter: drop-shadow(0 1px 1px rgba(30, 42, 50, .25)); }

/* step 4: on paper */
.write-paper { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(18px, 4vh, 34px); }
.paper-sheet { width: min(100%, 720px); aspect-ratio: 5 / 2; background: #fff; border-radius: 10px; box-shadow: 0 2px 0 rgba(15, 94, 99, .1), 0 18px 34px -16px rgba(15, 94, 99, .55); transform: rotate(-1.2deg); }
.paper-sheet svg { display: block; width: 100%; height: 100%; overflow: visible; }
.paper-sheet .w-stroke { stroke: #2B3A55; stroke-width: 3.2; }
.write-wrote { min-height: 96px; padding: 0 40px 0 34px; gap: 14px; font-size: 40px; }
.write-wrote .ico { width: 46px; height: 46px; }
.write-wrote-letter { font-family: var(--font-read); font-weight: 700; letter-spacing: .08em; }
.write-wrote.pulse { animation: pulse 1.2s ease-in-out infinite; }

/* step 5: the word */
.write-word { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(10px, 2.2vh, 22px); }
.word-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 44px 18px; border-radius: 30px; background: var(--paper); box-shadow: var(--lift); animation: star-pop .5s cubic-bezier(.2, .9, .3, 1.4) both; }
.word-pic { font-family: var(--font-emoji); font-size: clamp(76px, 14vmin, 130px); line-height: 1.05; }
.word-text { font-family: var(--font-read); font-weight: 700; font-size: clamp(54px, 11vmin, 96px); line-height: 1; color: var(--ink); letter-spacing: .02em; }
.word-hit { color: var(--coral); }
.btn-next-letter { min-width: 150px; gap: 10px; }
.next-glyph { font-family: var(--font-read); font-weight: 700; font-size: 40px; line-height: 1; }

/* the characters (pip.js): every face is a picture; only the one that matches is shown */
.pip-art { position: relative; display: block; width: 100%; aspect-ratio: 377 / 480; filter: drop-shadow(0 4px 3px rgba(30, 42, 50, .16)); transform-origin: 50% 100%; animation: char-breathe 3.8s ease-in-out infinite; }
.pip-art img, .char-bird img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .22s ease; pointer-events: none; user-select: none; -webkit-user-drag: none; }
html:not([data-pip]) .pip-art .m-listening,
html[data-pip="listening"] .pip-art .m-listening, html[data-pip="encouraging"] .pip-art .m-encouraging,
html[data-pip="happy"] .pip-art .m-happy, html[data-pip="thinking"] .pip-art .m-thinking,
html[data-pip="proud"] .pip-art .m-proud, html[data-pip="surprised"] .pip-art .m-surprised { opacity: 1; }
.pip-talking .pip-art { animation: char-talk .46s ease-in-out infinite; }
.char-bird { position: relative; display: block; height: 100%; aspect-ratio: 243 / 400; filter: drop-shadow(0 3px 2px rgba(30, 42, 50, .14)); transform-origin: 50% 100%; }
.char-bird[data-mood="neutral"] .m-neutral, .char-bird[data-mood="listening"] .m-listening, .char-bird[data-mood="happy"] .m-happy { opacity: 1; }
.char-bird.is-talking { animation: char-talk .46s ease-in-out infinite; }
.pip-cheer .pip-art { animation: char-cheer .9s cubic-bezier(.3, 1.6, .5, 1) 1; }
@keyframes char-cheer { 0% { transform: translateY(0) scale(1); } 30% { transform: translateY(-16%) scale(1.06, .96); } 55% { transform: translateY(0) scale(.96, 1.05); } 75% { transform: translateY(-5%); } 100% { transform: translateY(0) scale(1); } }
@keyframes char-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, 1.022); } }
@keyframes char-talk { 0%, 100% { transform: translateY(0) scale(1, 1); } 40% { transform: translateY(-3%) scale(.99, 1.02); } }
@media (prefers-reduced-motion: reduce) { .pip-art, .pip-talking .pip-art, .char-bird.is-talking { animation: none; } }
.splash-pip .pip-art, .brand .pip-art { width: 100%; }

/* whose turn is it */
.who-birds { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); justify-content: center; align-content: center; gap: clamp(16px, 4vw, 44px); }
.who-birds[data-count="3"], .who-birds[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 220px)); }
@media (min-width: 820px) and (orientation: landscape) { .who-birds[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 240px)); } .who-birds[data-count="4"] { grid-template-columns: repeat(4, minmax(0, 220px)); } }
.who-bird { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: clamp(14px, 3vh, 26px) 12px clamp(12px, 2.4vh, 20px); border-radius: 32px; background: var(--paper); box-shadow: var(--lift); animation: card-in .4s both; transition: transform .12s, box-shadow .12s; }
.who-bird:nth-child(2) { animation-delay: .06s; }
.who-bird:active { transform: translateY(5px); box-shadow: var(--lift-low); }
.who-bird.is-now { box-shadow: 0 0 0 5px var(--sun), var(--lift); }
.who-pic { height: clamp(140px, 30vmin, 240px); display: flex; justify-content: center; align-items: flex-end; }
.who-pic .bird { height: 100%; width: auto; display: block; }
.who-pic svg.bird { height: 82%; }
.who-eggs, .kid-eggs { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 20px; color: var(--teal); }
.who-eggs .nest-ico, .kid-eggs .nest-ico { width: 40px; }
.home-left { grid-area: nest; justify-self: start; display: flex; align-items: center; gap: 10px; }
.home-left .nest-btn { grid-area: auto; white-space: nowrap; }
.who-btn { flex: none; width: 64px; height: 64px; padding: 6px; border-radius: 50%; background: var(--paper); box-shadow: var(--lift); transition: transform .15s, box-shadow .15s; }
.who-btn:active { transform: translateY(4px); box-shadow: var(--lift-low); }
.who-btn .bird { width: 100%; height: 100%; display: block; }
.who-btn .char-bird { width: auto; margin: 0 auto; height: 112%; transform: translateY(-4%); }
.who-btn { overflow: hidden; }
/* grown-ups: the children */
.kid-list { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 8px; }
.kid-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 16px; background: rgba(15, 94, 99, .06); }
.kid-bird { width: 52px; flex: none; }
.kid-bird .bird, .panel-bird .bird, .kid-btn .bird { width: 100%; height: auto; display: block; }
.kid-bird .char-bird { width: auto; height: 64px; margin: -6px auto; }
.panel-bird .char-bird { width: auto; height: 42px; margin: -6px auto -4px; }
.kid-btn .char-bird { width: auto; height: 46px; margin: 0 auto; }
.kid-actions { margin-inline-start: auto; display: flex; gap: 8px; }
.kid-confirm { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.panel-bird { display: inline-block; width: 34px; vertical-align: middle; margin-inline-start: 6px; }
.kid-seg { margin: 4px 0 10px; }
.kid-btn { width: 56px; padding: 4px 8px; }
/* children's names (0.14): shown, never spoken */
.who-name { max-width: 100%; font-family: var(--font-ui); font-weight: 800; font-size: clamp(22px, 3.4vmin, 30px); line-height: 1.1; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
.kid-name { flex: 1 1 140px; min-width: 0; max-width: 240px; font: inherit; font-weight: 700; font-size: 18px; padding: 8px 12px; border-radius: 12px; border: 2px solid rgba(15, 94, 99, .25); background: var(--paper); color: var(--ink); unicode-bidi: plaintext; }
.kid-name:focus { outline: none; border-color: var(--teal); }
.kid-name::placeholder { color: rgba(30, 42, 50, .45); font-weight: 600; }
.kid-btn:has(.kid-btn-name) { width: auto; min-width: 56px; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.kid-btn-name { font-size: 13px; font-weight: 800; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the letter picker: the a b c / A B C switch sits in the top bar */
.write-pick .bar { justify-content: space-between; }
.case-switch { display: inline-flex; padding: 5px; gap: 4px; border-radius: 999px; background: var(--paper); box-shadow: var(--lift); }
.case-btn { min-width: 112px; min-height: 58px; padding: 0 18px; border-radius: 999px; font-family: var(--font-read); font-weight: 700; font-size: 26px; letter-spacing: .06em; color: var(--teal); transition: background-color .15s, color .15s; }
.case-btn[aria-pressed="true"] { background: var(--teal); color: #fff; }
@media (max-width: 420px) { .case-btn { min-width: 92px; font-size: 22px; padding: 0 12px; } }
/* phones: four things in the bar (back, a b c / A B C, ?, home) */
@media (max-width: 480px) {
  .write-pick .bar { gap: 6px; }
  .write-pick .bar .round-btn { width: 52px; height: 52px; }
  .write-pick .bar .round-btn svg { width: 26px; height: 26px; }
  .write-pick .bar-right { gap: 6px; }
  .write-pick .help-btn { font-size: 26px; }
  .case-btn { min-width: 76px; min-height: 50px; font-size: 20px; padding: 0 10px; letter-spacing: .03em; }
}

/* the grown-ups' intro to Write a Letter */
.bar-right { display: inline-flex; align-items: center; gap: 10px; }
.help-btn { font-family: var(--font-ui); font-weight: 800; font-size: 30px; color: var(--teal); }
.write-intro { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(30, 42, 50, .38); animation: wi-fade .25s both; }
.write-intro[hidden] { display: none; }
.wi-card { width: min(560px, 100%); max-height: 100%; overflow: auto; padding: clamp(18px, 3vh, 28px) clamp(18px, 3vw, 32px); border-radius: 32px; background: var(--paper); box-shadow: var(--lift); text-align: left; color: var(--ink); animation: card-in .35s both; }
.wi-art { display: block; width: 120px; height: auto; margin: 0 auto 4px; }
.wi-card h2 { margin: 0; text-align: center; font-family: var(--font-ui); font-size: clamp(28px, 4vw, 36px); line-height: 1.1; color: var(--teal); }
.wi-for { margin: 4px 0 12px; text-align: center; font-family: var(--font-read); font-size: 17px; color: rgba(30, 42, 50, .7); }
.wi-steps { margin: 0; padding-left: 26px; display: grid; gap: 8px; font-family: var(--font-read); font-size: clamp(17px, 2.2vw, 20px); line-height: 1.35; }
.wi-steps b { color: var(--teal); }
.wi-note { margin: 12px 0 0; font-family: var(--font-read); font-size: 16px; color: rgba(30, 42, 50, .7); }
.wi-actions { margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 14px; }
@keyframes wi-fade { from { opacity: 0; } to { opacity: 1; } }

/* the grown-ups' choice: a photo of the notebook, or "I wrote it" */
.pc-bird { display: block; height: 72px; width: 46px; margin: 0 auto 4px; }
.pc-bird .bird { height: 100%; width: auto; margin: 0 auto; }
.pc-card { text-align: start; }
.pc-card[dir], .paper-choice .wi-card { font-family: "Segoe UI", "Arial Hebrew", "Noto Sans Hebrew", Arial, system-ui, sans-serif; }
.pc-ask { margin: 0 0 12px; font-size: 18px; line-height: 1.45; }
.pc-options { display: grid; gap: 12px; }
.pc-option { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: start; padding: 14px 16px; border-radius: 20px; background: rgba(15, 94, 99, .07); box-shadow: var(--lift-low); color: var(--ink); }
.pc-option .ico { grid-row: span 2; width: 40px; height: 40px; color: var(--teal); }
.pc-option b { font-size: 20px; color: var(--teal); }
.pc-option span { font-size: 15px; line-height: 1.4; color: rgba(30, 42, 50, .75); }
.pc-option:active { transform: translateY(3px); }

/* the paper step with a camera */
.snap-result { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.snap-photo { display: block; max-width: min(92vw, 640px); max-height: calc(100vh - 390px); max-height: calc(100dvh - 390px); min-height: 160px; object-fit: contain; border-radius: 14px; box-shadow: var(--lift); transform: rotate(1.2deg); background: #fff; }
.write-paper.is-snapped .paper-sheet { display: none; }
.snap-actions { display: flex; align-items: center; gap: 16px; }
.snap-go { min-height: 80px; padding: 0 34px; }
.snap-go .ico { width: 44px; height: 44px; }
.snap-skip { font-family: "Segoe UI", "Arial Hebrew", Arial, system-ui, sans-serif; font-size: 15px; color: var(--teal); text-decoration: underline; padding: 8px 12px; opacity: .8; }
.snap-note { max-width: 560px; margin: 0; text-align: center; font-family: "Segoe UI", "Arial Hebrew", Arial, system-ui, sans-serif; font-size: 15px; color: rgba(30, 42, 50, .75); }
.write-snap .ico { width: 50px; height: 50px; }

/* grown-ups: the notebook */
.nb-letter { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(15, 94, 99, .12); }
.nb-char { flex: none; width: 40px; font-family: var(--font-read); font-size: 30px; line-height: 1.1; color: var(--teal); text-align: center; }
.nb-shots { display: flex; flex-wrap: wrap; gap: 10px; }
.nb-shot { position: relative; margin: 0; width: 132px; height: 96px; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: var(--lift-low); }
.nb-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nb-del { position: absolute; top: 4px; inset-inline-end: 4px; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .9); color: var(--ink); font-size: 20px; line-height: 30px; text-align: center; box-shadow: var(--lift-low); }
.nb-del.armed { background: #E02424; color: #fff; }
.nb-full { margin: 6px 0; padding: 8px 12px; border-radius: 12px; background: rgba(255, 194, 60, .25); }

/* locked and done letters */
.letter-tile { position: relative; }
.letter-tile.is-locked { background: rgba(255, 253, 247, .55); box-shadow: var(--lift-low); }
.letter-tile.is-locked .letter-glyph { color: rgba(30, 42, 50, .32); }
.letter-tile.is-locked .stars { opacity: .35; }
.tile-lock { position: absolute; top: 8px; right: 8px; width: clamp(16px, 2.4vw, 24px); height: auto; color: rgba(15, 94, 99, .55); }
.tile-done { position: absolute; top: 7px; right: 7px; width: clamp(18px, 2.6vw, 26px); height: auto; }
.letter-tile.pulse-once { animation: pulse .45s ease-in-out 2; }
/* the next letter opens */
.btn-next-letter { position: relative; }
.unlock-badge { position: absolute; top: -14px; left: -10px; width: 34px; height: 34px; padding: 5px; border-radius: 50%; background: var(--sun); color: var(--ink); box-shadow: 0 3px 0 var(--sun-deep); }
.unlock-badge svg { display: block; width: 100%; height: 100%; overflow: visible; }
.unlock-badge .shackle { transform-box: fill-box; transform-origin: 100% 100%; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.btn-next-letter.opening .shackle { transform: translateY(-3px) rotate(-28deg); }
.btn-next-letter.opening { animation: pulse 1s ease-in-out 3; }

/* the letter picker */
.letter-tiles { flex: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 2.4vw, 24px); align-content: center; width: min(100%, 860px); margin: 0 auto; }
.letter-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: clamp(130px, 26vh, 220px); border-radius: 26px; background: var(--paper); color: var(--teal); box-shadow: var(--lift); animation: card-in .4s both; transition: transform .12s, box-shadow .12s; }
.letter-tile:active { transform: translateY(5px); box-shadow: var(--lift-low); }
.letter-glyph { font-family: var(--font-read); font-weight: 700; font-size: clamp(64px, 13vw, 120px); line-height: .95; color: var(--ink); }
.letter-tile .star { width: clamp(16px, 3vw, 26px); height: auto; aspect-ratio: 1; }
.letter-tile.is-next { box-shadow: 0 0 0 5px var(--sun), var(--lift); }
@media (max-width: 560px) { .letter-tiles.few { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.letter-tiles.many { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(8px, 1.4vw, 14px); align-content: start; padding-bottom: 12px; }
.letter-tiles.many .letter-tile { min-height: clamp(76px, 14vh, 118px); border-radius: 20px; gap: 2px; }
.letter-tiles.many .letter-glyph { font-size: clamp(40px, 7vw, 64px); }
.letter-tiles.many .star { width: clamp(11px, 1.6vw, 15px); }
@media (max-width: 560px) {
  .letter-tiles.many { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .letter-tiles.many .letter-tile { min-height: 64px; border-radius: 16px; }
  .letter-tiles.many .letter-glyph { font-size: 34px; }
}
.letter-glyph { line-height: 1.12; }

@media (min-width: 820px) and (orientation: landscape) {
  .write-work { flex-direction: row; gap: 30px; }
  .write-tools { flex-direction: column; }
  .write-pad { height: min(calc(100vh - 285px), 680px); height: min(calc(100dvh - 285px), 680px); }
}
@media (max-height: 520px) and (orientation: landscape) {
  .write-work { flex-direction: row; }
  .write-tools { flex-direction: column; gap: 10px; }
  .write-pad { height: calc(100vh - 150px); height: calc(100dvh - 150px); min-height: 200px; }
}

/* The recording screen (grown-ups). */
.rec-tabs { margin-top: 10px; }
.rec-card { text-align: center; border: 3px solid transparent; }
.rec-card.is-done { border-color: var(--leaf); }
.rec-text { font-size: clamp(26px, 6vw, 40px); font-weight: 700; line-height: 1.25; color: var(--ink); margin: 6px 0; }
.rec-text.rec-letter { font-family: var(--font-read); font-size: clamp(64px, 16vw, 110px); line-height: 1; }
.rec-hint { min-height: 1.2em; }
.rec-meter { height: 10px; border-radius: 999px; background: rgba(15, 94, 99, .1); overflow: hidden; margin: 12px auto 6px; max-width: 420px; direction: ltr; }
.rec-meter i { display: block; height: 100%; background: var(--coral); transform: scaleX(0); transform-origin: left center; }
.rec-status { min-height: 1.4em; }
.rec-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; }
.rec-go { min-width: 190px; min-height: 76px; font-size: 26px; }
.rec-go.is-recording { background: var(--coral); box-shadow: 0 5px 0 #B9483B, 0 16px 26px -14px rgba(185, 72, 59, .6); }
.rec-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.rec-row { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; background: rgba(15, 94, 99, .06); font: inherit; color: var(--ink); text-align: start; }
.rec-row i { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(15, 94, 99, .35); }
.rec-row.is-done i { background: var(--leaf); border-color: var(--leaf); }
.rec-row.is-now { outline: 3px solid var(--sun); }
.rec-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A zone with three games (Sounds and Rhymes): keep all three on one screen. */
@media (max-width: 819px) {
  .zones.game-cards[data-count="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zones.game-cards[data-count="3"] .zone-card:nth-child(3) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 7px); }
}
@media (min-width: 820px) and (orientation: landscape) {
  .zones.game-cards[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 280px)); gap: 24px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .zones.game-cards[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .zones.game-cards[data-count="3"] .zone-card:nth-child(3) { grid-column: auto; width: auto; }
  .level-card { min-height: 120px; }
  .level-num { font-size: 56px; }
}

@media (prefers-reduced-motion: reduce) { .demo-hand { animation: none; } }

/* ---------------------------------------------------------------------------
   Pip's wardrobe (0.14). The drawings are temporary; Noam's layers replace them.
   --------------------------------------------------------------------------- */
.pip-art .wear { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.pip-art img.wear { opacity: 1; transition: none; object-fit: contain; }
/* head and eye pieces: the encouraging set while Pip talks, the listening set otherwise */
.pip-art img.wear.wear-pose-e { opacity: 0; }
html[data-pip="encouraging"] .pip-art img.wear.wear-pose-e { opacity: 1; }
html[data-pip="encouraging"] .pip-art img.wear.wear-pose-l { opacity: 0; }
img.wear-tile-art { object-fit: contain; }
.wear-tile.is-locked img.wear-tile-art { filter: grayscale(1); }
.closet-btn { flex: none; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--paper); color: var(--teal); box-shadow: var(--lift); transition: transform .15s, box-shadow .15s; }
.closet-btn .ico { width: 34px; height: 34px; }
.closet-btn:active { transform: translateY(4px); box-shadow: var(--lift-low); }
.closet-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(12px, 3vw, 36px); align-items: center; padding: 0 clamp(4px, 2vw, 24px) 16px; }
.closet-pip { justify-self: center; width: min(100%, 300px, calc((100dvh - 260px) * 377 / 480)); }
.closet-side { display: grid; gap: 16px; align-content: center; }
.wear-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(8px, 1.4vw, 14px); }
.wear-tile { position: relative; aspect-ratio: 1; display: grid; place-items: center; padding: 8px; border-radius: 22px; background: var(--paper); box-shadow: var(--lift); transition: transform .12s, box-shadow .12s; }
.wear-tile:active { transform: translateY(4px); box-shadow: var(--lift-low); }
.wear-tile.is-on { box-shadow: 0 0 0 4px var(--teal), var(--lift); }
.wear-tile.is-picked { box-shadow: 0 0 0 5px var(--sun), var(--lift); }
.wear-tile.is-locked { background: rgba(255, 255, 255, .55); box-shadow: none; }
.wear-tile.is-locked .wear-tile-art { opacity: .45; }
.wear-tile-art { width: 100%; height: 100%; }
.wear-lock { position: absolute; inset-inline-end: 6px; bottom: 6px; width: 26px; height: 26px; color: var(--ink); opacity: .55; }
.wear-lock .ico { width: 100%; height: 100%; }
.wear-colors { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; min-height: 54px; }
.wear-swatch { width: 52px; height: 52px; border-radius: 50%; background: var(--c); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .15), var(--lift-low); transition: transform .12s; }
.wear-swatch.is-on { box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--ink); transform: scale(1.06); }
@media (orientation: portrait) {
  .closet-main { grid-template-columns: 1fr; align-content: start; }
  .closet-pip { width: min(60vw, 240px, calc((100dvh - 560px) * 377 / 480)); min-width: 140px; }
}
.gift { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(30, 42, 50, .45); animation: card-in .25s both; }
.gift-card { width: min(420px, 100%); display: grid; justify-items: center; gap: 12px; padding: 20px 20px 18px; border-radius: 32px; background: var(--paper); box-shadow: var(--lift); text-align: center; }
.gift-pip { width: min(220px, 50vw, calc((100dvh - 260px) * 377 / 480)); }
.gift-card .bubble-text { margin: 0; font-size: clamp(20px, 3vmin, 26px); }
.gift-actions { display: flex; gap: 16px; align-items: center; }
.gift-wear { min-width: 120px; height: 64px; }
.gift-wear .ico { width: 36px; height: 36px; }

/* ---------------------------------------------------------------------------
   Art pack v2 (Noam, 28.11): pictures in place of the flat drawings
   --------------------------------------------------------------------------- */
.zone-art .art-img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(30, 42, 50, .14)); }
.egg-img { aspect-ratio: 613 / 783; object-fit: contain; }
.nest-img { aspect-ratio: 784 / 609; object-fit: contain; }
.nest-box:has(.nest-img) .nest-eggs { z-index: 2; width: 44%; margin: 0 auto -40%; }
.nest-box:has(.nest-img) .nest-egg:nth-child(2) { transform: translateY(-6%); }
.hatchling { animation: card-in .4s cubic-bezier(.2, .9, .3, 1.4) both; }
.hop .hatchling { animation: hop .5s ease-out; }
body[data-screen="home"] .grown-btn { background: rgba(255, 253, 247, .9); box-shadow: var(--lift-low); }
.hatchling { display: block; width: 100%; height: auto; aspect-ratio: 517 / 753; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(30, 42, 50, .15)); }
.pic .word-art { display: block; width: 1.25em; height: 1.25em; object-fit: contain; margin: 0 auto; filter: drop-shadow(0 4px 5px rgba(30, 42, 50, .14)); }
.word-pic .word-art { display: block; width: 1.3em; height: 1.3em; object-fit: contain; }
.welcome-anim { display: block; width: 100%; aspect-ratio: 449 / 469; object-fit: contain; pointer-events: none; }
.splash-pip:has(.welcome-anim) { width: clamp(190px, 40vmin, 320px); animation: none; }
body[data-screen="home"] .scene, body[data-screen="splash"] .scene { background: #FFF3DC url("img/art/home-sunset.webp") center / cover no-repeat; }
body[data-screen="home"] .scene svg, body[data-screen="splash"] .scene svg { opacity: 0; }

/* 0.15.1: the wardrobe fits the screen on every size. The screen is exactly the window's height; the tiles take
   the height that is left (a size container), the colours are one row of eight (two columns on low landscape screens). */
.screen.closet { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.closet .closet-main { align-items: stretch; }
.closet .closet-pip { align-self: center; }
.closet .closet-side { min-height: 0; grid-template-rows: minmax(0, 1fr) auto; align-content: stretch; }
.wear-tiles-box { container-type: size; min-height: 0; display: grid; place-items: center; }
.closet .wear-tiles { width: min(100cqw, calc((100cqh - 28px) * 4 / 3 + 42px)); }
.closet .wear-colors { display: grid; grid-template-columns: repeat(8, minmax(0, 52px)); gap: clamp(6px, 1.2vw, 12px); justify-content: center; min-height: 0; }
.closet .wear-swatch { width: 100%; height: auto; aspect-ratio: 1; }
@media (orientation: portrait) {
  .closet .closet-main { grid-template-rows: auto minmax(0, 1fr); }
  .closet .closet-pip { min-width: 110px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  /* the home button sits in the row of Pip's line, so the wardrobe gets the height */
  .closet .bar { position: absolute; inset-inline-start: calc(var(--gutter) + var(--sal)); top: calc(var(--gutter) + var(--sat)); min-height: 0; z-index: 2; }
  .closet .prompt { padding-inline-start: 64px; }
  .closet .closet-side { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr); }
  .closet .wear-colors { grid-template-columns: repeat(2, 40px); align-content: center; }
}

/* ---- 0.16.2: the before-you-start window in Hebrew too; the child's Pip in the notebook question ---- */
.write-intro[dir="rtl"] .wi-card { text-align: right; font-family: "Segoe UI", "Arial Hebrew", "Noto Sans Hebrew", Arial, system-ui, sans-serif; }
.write-intro[dir="rtl"] .wi-steps { padding-left: 0; padding-right: 26px; font-family: inherit; }
.pc-bird .kid-pip { height: 64px; }

/* ---- 0.16.1: meet the letter, before the demo ---- */
.write-meet { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(10px, 2.4vh, 22px); width: min(100%, 560px); margin: 0 auto; padding: clamp(16px, 3vh, 30px) 20px; border-radius: 32px; background: var(--paper); box-shadow: var(--lift); animation: card-in .35s both; }
.write-meet:active { transform: translateY(4px); box-shadow: var(--lift-low); }
.meet-letters { display: flex; align-items: baseline; gap: .12em; font-family: 'Andika', var(--font-ui); font-weight: 700; line-height: 1; font-size: clamp(96px, min(24vh, 22vw), 220px); color: rgba(30, 42, 50, .32); }
.meet-letters b { font-weight: 700; }
.meet-letters b:not(.is-now) { font-size: .7em; }
.meet-letters b.is-now { opacity: 1; color: var(--teal); }
.meet-word { display: flex; align-items: center; gap: 14px; font-family: 'Andika', var(--font-ui); font-size: clamp(26px, 4.4vmin, 40px); color: var(--ink); }
.meet-word .word-pic { width: clamp(56px, 10vmin, 92px); height: clamp(56px, 10vmin, 92px); display: grid; place-items: center; }
.meet-word .word-pic img, .meet-word .word-pic svg { width: 100%; height: 100%; object-fit: contain; }
/* 0.16.4: a word with no drawing shows an emoji; it must fit the box and not cover the word */
.meet-word .word-pic { font-size: clamp(46px, 8.4vmin, 78px); line-height: 1; }
.meet-word .word-hit { color: var(--coral, #E5484D); }
.meet-go { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--teal, #0F5E63); color: #fff; }
.meet-go svg { width: 28px; height: 28px; }
.write[data-step="meet"] .write-tools { display: none; }

/* ---- 0.16: the child's own Pip (colour) and the who-plays screen ---- */
.kid-pip { display: block; height: 100%; aspect-ratio: 377 / 480; margin: 0 auto; }
.kid-pip img { width: 100%; height: 100%; object-fit: contain; display: block; }
.who-pic .kid-pip { height: 100%; }
.who-btn .kid-pip { height: 118%; transform: translateY(-2%); }
.kid-bird .kid-pip { height: 60px; margin: -4px auto; }
.panel-bird .kid-pip { height: 40px; margin: -6px auto -4px; display: inline-block; }
.kid-btn .kid-pip { height: 44px; }
.who-bird { position: relative; }
.who-edit { position: absolute; top: 10px; inset-inline-end: 10px; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--cream, #FFF8EC); color: var(--ink); box-shadow: var(--lift-low); }
.who-edit svg { width: 26px; height: 26px; }
.me-btn { overflow: hidden; padding: 4px; }
.me-btn .kid-pip { height: 120%; transform: translateY(4%); }

.me-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(12px, 3vw, 36px); align-items: center; padding: 0 clamp(4px, 2vw, 24px) 16px; }
.me-pip { justify-self: center; width: min(100%, 300px, calc((100dvh - 260px) * 377 / 480)); }
.me-pip .pip-art { width: 100%; height: auto; }
.me-side { display: flex; flex-direction: column; gap: clamp(12px, 2.4vh, 22px); align-items: stretch; min-width: 0; }
.me-name { display: flex; align-items: center; gap: 10px; background: var(--paper); border-radius: 24px; box-shadow: var(--lift); padding: 8px 16px; }
.me-name-icon svg { width: 30px; height: 30px; color: var(--ink); opacity: .7; }
.me-name input { flex: 1; min-width: 0; border: 0; background: transparent; font-family: var(--font-ui); font-weight: 800; font-size: clamp(26px, 4.4vmin, 38px); color: var(--ink); padding: 8px 0; outline: none; unicode-bidi: plaintext; }
.me-name:focus-within { box-shadow: 0 0 0 4px var(--sun), var(--lift); }
.me-colors { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(8px, 1.6vw, 16px); }
.me-color { aspect-ratio: 4 / 5; border-radius: 22px; background: var(--paper); box-shadow: var(--lift); padding: 6px; display: grid; place-items: center; transition: transform .12s, box-shadow .12s; border-bottom: 8px solid var(--c); }
.me-color .kid-pip { height: 100%; }
.me-color:active { transform: translateY(4px); box-shadow: var(--lift-low); }
.me-color.is-on { box-shadow: 0 0 0 5px var(--sun), var(--lift); }
.me-go { align-self: center; min-width: 200px; }
@media (max-width: 700px), (orientation: portrait) {
  .me-main { grid-template-columns: 1fr; align-content: start; }
  .me-pip { width: min(46vw, 200px, calc((100dvh - 600px) * 377 / 480)); min-width: 120px; }
  .me-colors { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 420px; margin: 0 auto; width: 100%; }
  .me-color { aspect-ratio: 5 / 4; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .me-color { border-radius: 16px; padding: 3px; border-bottom-width: 6px; }
  .me-pip { width: min(100%, 180px, calc((100dvh - 150px) * 377 / 480)); }
}
@media (max-width: 700px) and (orientation: portrait) {
  .me-colors { grid-template-columns: repeat(6, minmax(0, 1fr)); max-width: none; gap: 6px; }
  .me-color { aspect-ratio: 3 / 4; border-radius: 14px; padding: 2px; border-bottom-width: 5px; }
  .me-pip { width: min(40vw, 170px, calc((100dvh - 560px) * 377 / 480)); min-width: 100px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .me-main { padding-bottom: 8px; }
  .me-side { gap: 8px; }
  .me-name { padding: 2px 12px; border-radius: 18px; }
  .me-name input { font-size: 22px; padding: 4px 0; }
  .me-go { min-height: 0; padding-top: 6px; padding-bottom: 6px; font-size: 20px; }
  .me-go svg { width: 30px; height: 30px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .me-side { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .me-name { grid-column: 1; grid-row: 1; }
  .me-go { grid-column: 2; grid-row: 1; min-width: 96px; }
  .me-colors { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-height: 380px) and (orientation: landscape) {
  .me-color { aspect-ratio: 1; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .write-meet { flex-direction: row; gap: 22px; padding: 12px 22px; width: auto; max-width: 100%; }
  .meet-letters { font-size: clamp(72px, 30vh, 130px); }
}

/* 0.16.3: the letter named in the writing bubbles */
.bubble-text .say-letter { color: var(--coral, #E5484D); font-size: 1.3em; line-height: 1; unicode-bidi: isolate; }
