/* Mila Tova — student screens (iPad, touch-first). Spec: design/mila-tova-teachers/HANDOFF-design.md §3.10–3.14 */
* { box-sizing: border-box; }
html { background: #8fc0e8; height: 100%; color-scheme: light; }
body { margin: 0; height: 100dvh; overflow: hidden; font-family: 'Nunito', system-ui, sans-serif; color: #4b4038; background: var(--sky);
  display: flex; align-items: center; justify-content: center; -webkit-text-size-adjust: 100%; touch-action: manipulation; }

/* Picture frame around the student screens, like the Pressman reading screen: warm outer frame,
   light mat, and the sky as a window cut into it. The screens are laid out on a fixed iPad-size
   canvas (--dw × --dh) and scaled by --s to fit whatever screen this is (fitFrame() in student.js). */
:root { --dw: 1180; --dh: 820; --s: .86; --fo: 18px; --fm: 12px;
  /* look of the day (setLook() in student.js): open-sky backdrop + see-through frame */
  --sky: linear-gradient(180deg, #4f8fd1 0%, #75aee3 50%, #a9d0f1 100%);
  --fr: rgba(255,255,255,.32); --mat: rgba(255,255,255,.5); --fr-edge: rgba(255,255,255,.7); --fr-shadow: rgba(20,50,95,.28); }
/* Slow puffy clouds behind everything; they show through the frame and the reading area. */
.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bcloud { position: absolute; left: 0; animation: bdrift linear infinite; will-change: transform; }
.bcloud svg { display: block; width: 100%; height: auto; overflow: visible; }
@keyframes bdrift { from { transform: translateX(-40vw); } to { transform: translateX(140vw); } }
.frame-outer { position: relative; z-index: 1; background: var(--fr); border-radius: calc(var(--fo) + var(--fm) + 26px); padding: var(--fo);
  -webkit-backdrop-filter: blur(4px) saturate(1.15); backdrop-filter: blur(4px) saturate(1.15);
  box-shadow: inset 0 0 0 1.5px var(--fr-edge), 0 24px 50px var(--fr-shadow); }
.frame-mat { background: var(--mat); border-radius: calc(var(--fm) + 26px); padding: var(--fm); box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
/* The reading area is see-through too (clouds drift behind it); cards and buttons on it stay solid. */
.frame-window { position: relative; overflow: hidden; border-radius: 26px; width: calc(var(--dw) * var(--s) * 1px); height: calc(var(--dh) * var(--s) * 1px);
  background: radial-gradient(circle at 88% -6%, rgba(255,222,176,.45) 0%, transparent 34%),
              linear-gradient(180deg, rgba(200,226,249,.62) 0%, rgba(222,240,252,.66) 40%, rgba(242,248,253,.74) 74%, rgba(253,246,238,.8) 100%); }
.frame-window::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 5;
  box-shadow: inset 0 12px 20px -10px rgba(25,45,80,.38); }
.scaler { position: absolute; left: 0; top: 0; width: calc(var(--dw) * 1px); height: calc(var(--dh) * 1px); transform: scale(var(--s)); transform-origin: 0 0; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #7559ad; outline-offset: 4px; border-radius: 14px; }
[hidden] { display: none !important; }

.screen { position: relative; z-index: 2; height: calc(var(--dh) * 1px); display: flex; flex-direction: column; padding: 24px 36px 30px; gap: 18px; }
.wm { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 32px; line-height: 1; color: #7559ad; }
.toprow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.h1 { margin: 0; font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 50px; line-height: 1.08; text-align: center; }
.pill { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 20px; border-radius: 999px; background: #fffaf3;
  border: 0; font-weight: 800; font-size: 17px; box-shadow: 0 6px 16px rgba(96,128,178,.16); }
.pill u { color: #6a50a6; }
.ini { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: 'Baloo 2', sans-serif; font-size: 19px; font-weight: 700; }
.go { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-width: 300px; min-height: 76px; padding: 0 36px;
  border-radius: 999px; border: 0; background: linear-gradient(180deg, #45a877, #2f8259); color: #fff; font-family: 'Baloo 2', sans-serif;
  font-weight: 800; font-size: 28px; box-shadow: 0 12px 24px rgba(47,130,89,.30); transition: transform .12s; }
.go:active:not(:disabled) { transform: scale(.97); }
.go:disabled { background: #e6ded4; color: #6f6258; box-shadow: none; }
.note { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-radius: 24px; background: #eaf2fb; border: 2px solid #c9dcf1;
  font-size: 18px; font-weight: 700; line-height: 1.4; color: #4b4038; }
.note svg { flex: none; color: #2f6aa0; }
.note.pink { background: #fdeef2; border-color: #f2c4d1; }
.note.pink svg { color: #b8456a; }

/* S1 PIN */
.pinwrap { flex: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; align-content: center; gap: 44px 72px; }
.pincol { flex: 0 1 470px; display: flex; flex-direction: column; align-items: center; gap: 24px; text-align: center; }
.pinbox { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 124px; padding: 0 20px; border-radius: 38px;
  background: #fff; box-shadow: 0 0 0 4px #e4d8f6, 0 14px 30px rgba(96,128,178,.18); }
.pinbox.full { box-shadow: 0 0 0 4px #b9e2cb, 0 14px 30px rgba(96,128,178,.18); }
.pinbox.shake { animation: shake .3s; box-shadow: 0 0 0 4px #f2bccb, 0 14px 30px rgba(96,128,178,.18); }
@keyframes shake { 0%,100% { transform: none; } 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
.slot { width: 54px; display: grid; place-items: center; font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 72px; line-height: 1; color: #4c3585; }
.slot:nth-child(4) { margin-left: 12px; }
.slot i { width: 18px; height: 18px; border-radius: 50%; background: #e4d8f6; }
.slot i.next { background: #8a6fc0; }
.pad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; width: 330px; padding: 20px; border-radius: 36px;
  background: rgba(255,250,243,.88); box-shadow: 0 14px 30px rgba(96,128,178,.16); }
.key { height: 80px; border: 0; border-radius: 26px; background: #fff; font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 36px;
  box-shadow: 0 4px 0 rgba(122,102,92,.10); display: grid; place-items: center; transition: transform .08s; user-select: none; -webkit-user-select: none; }
.key.alt { background: #f3ede6; font-size: 20px; color: #6f6258; }
.key:active { transform: scale(.94); background: #efe7fb; }
.foot { margin: 0; text-align: center; font-size: 16px; font-weight: 700; color: #4f6680; }

/* S2 names */
.names { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 86px; gap: 16px; padding: 6px 4px 10px; -webkit-overflow-scrolling: touch; }
@media (orientation: portrait) { .names { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.nbtn { display: flex; align-items: center; gap: 12px; padding: 0 16px 0 12px; border: 0; border-radius: 999px; background: #fffaf3;
  box-shadow: 0 8px 20px rgba(96,128,178,.14); font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 27px; text-align: left; transition: transform .1s; min-width: 0; }
.nbtn:active { transform: scale(.96); }
.nbtn .ini { width: 56px; height: 56px; font-size: 25px; }
.nbtn .nm { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nbtn small { font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700; color: #6f6258; }
.nbtn[aria-checked="true"] { background: #7559ad; color: #fff; box-shadow: 0 0 0 4px #c9b6ee, 0 8px 20px rgba(117,89,173,.3); }
.nbtn[aria-checked="true"] .ini { background: #fff !important; color: #7559ad !important; }
.nbtn.taken { background: #f3eee8; color: #6f6258; box-shadow: none; opacity: .8; }
.nbtn.taken .ini { background: #e8e0d6 !important; color: #8d7f74 !important; }

/* S3 choose */
.stories { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px 56px; width: 100%; }
.story { position: relative; display: block; flex: 0 1 400px; padding: 62px 0 0; border: 0; background: none; text-align: center;
  filter: drop-shadow(0 18px 26px rgba(96,128,178,.20)); transition: transform .12s; }
.story:active { transform: scale(.97); }
.bump { position: absolute; aspect-ratio: 1/1; border-radius: 50%; background: #fffaf3; }
.story .body { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px 34px 32px; border-radius: 80px; background: #fffaf3; }
.story .cv { display: grid; place-items: center; width: 100%; height: 170px; border-radius: 30px; overflow: hidden; }
.story .cv img { width: 100%; height: 100%; object-fit: cover; }
.story .t { font-family: 'Rubik', sans-serif; font-weight: 600; font-size: 36px; line-height: 1.3; color: #3d332c; }
.bar { position: relative; width: 80%; height: 12px; border-radius: 999px; background: #efe7e0; overflow: hidden; }
.bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.story .st { font-size: 17px; font-weight: 800; color: #6f6258; }

/* S4 reading */
.read { padding: 22px 34px 28px; }
.homebtn { flex: 0 0 60px; width: 60px; height: 60px; border-radius: 50%; border: 0; background: #fffaf3; box-shadow: 0 6px 16px rgba(96,128,178,.18); display: grid; place-items: center; color: #7559ad; }
.rtitle { display: flex; flex-direction: column; align-items: center; }
.rtitle .he { font-family: 'Rubik', sans-serif; font-weight: 600; font-size: 28px; line-height: 1.3; color: #3d332c; }
.rtitle small { font-size: 16px; font-weight: 800; color: #6f6258; }
.namechip { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px 0 6px; border-radius: 999px; background: #fffaf3;
  box-shadow: 0 6px 16px rgba(96,128,178,.16); font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 20px; }
.trail { position: relative; display: flex; justify-content: center; }
.trail .row { position: relative; display: flex; align-items: center; gap: 44px; padding: 10px 6px; }
.trail .line { position: absolute; left: 20px; right: 20px; top: 50%; height: 6px; margin-top: -3px; border-radius: 999px; background: #dfd3c2; }
.stone { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: 'Rubik', sans-serif;
  font-weight: 700; font-size: 16px; background: #fff; color: #6f6258; box-shadow: 0 3px 8px rgba(96,128,178,.16); }
.stone.green { background: #3a9c6b; color: #fff; }
.stone.yellow { background: #e7b53c; color: #4b3a10; }
.stone.red { background: #c24f72; color: #fff; }
button.stone { border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .12s ease; }
button.stone:hover { transform: scale(1.1); }
button.stone:active { transform: scale(.94); }
.stone.cur { background: #fff; color: #4c3585; box-shadow: 0 0 0 4px #fff, 0 0 0 7px #8a6fc0, 0 4px 10px rgba(96,128,178,.2); }
.stone.cur.green { background: #3a9c6b; color: #fff; } .stone.cur.yellow { background: #e7b53c; color: #4b3a10; } .stone.cur.red { background: #c24f72; color: #fff; }
.stone .halo { position: absolute; inset: -10px; border-radius: 50%; border: 2px solid #8a6fc0; animation: halo 2.6s ease-out infinite; pointer-events: none; }
@keyframes halo { from { transform: scale(1); opacity: .55; } to { transform: scale(1.22); opacity: 0; } }
.cardrow { flex: 1 1 auto; min-height: 0; display: flex; align-items: stretch; gap: 22px; }
.cardrow .nextbtn { align-self: center; }
/* the story's picture on the left of every line, like the Pressman reading screen */
.linepic { flex: none; width: 210px; height: 210px; border-radius: 28px; overflow: hidden; background: #fff; box-shadow: 0 6px 16px rgba(96,128,178,.16); }
.linepic img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (orientation: portrait) { .linepic { width: 160px; height: 160px; } }
.sentence { flex: 1 1 auto; min-width: 0; min-height: 0; overflow-y: auto; display: flex; align-items: center; justify-content: center; gap: 30px; padding: 30px 40px; border-radius: 40px;
  background: linear-gradient(180deg, #fffdf9, #fff7ef); box-shadow: 0 16px 36px rgba(96,128,178,.18); }
.words { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 16px; }
/* Like the Pressman app: right words stay plain, wrong words get a soft red pill you tap to hear;
   while a word plays, the rest of the line dims and the word glows gold. */
.word { font-family: 'Rubik', sans-serif; font-weight: 400; font-size: 54px; line-height: 1.5; padding: 0 6px; border-radius: 12px; color: #1b1a1a;
  transition: background .12s ease, box-shadow .12s ease, color .15s ease, text-shadow .2s ease; }
@media (orientation: portrait) { .word { font-size: 50px; } }
.wcol { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; }
.word.red { background: rgba(176,42,53,.14); box-shadow: 0 0 0 3px rgba(176,42,53,.14); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.word.red:hover, .word.red:focus-visible { background: rgba(176,42,53,.26); box-shadow: 0 0 0 3px rgba(176,42,53,.26); outline: none; }
.word.playing { text-shadow: 0 0 14px rgba(214,160,42,.9); }
.words.tts-active .word { color: #9aa8b4; }
.words.tts-active .word.playing { color: #1b1a1a; }
.word .pc.on { font-weight: 700; }
.word .dash { opacity: .5; margin: 0 1px; }
.hear { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid #c24f72;
  background: #c24f72; color: #fff; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 16px; transition: transform .12s ease, background .15s ease; }
.hear:active { transform: scale(.95); }
.hear.playing { background: #fff6dc; color: #8a6312; border-color: #f0d58a; }
.hear.heard { background: #fff; color: #2f8259; border-color: #bfe3cf; }
.msg { display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 12px 22px; border-radius: 24px; border: 2px solid #ddd0f3; background: #f3ecfb; }
.msg .ic { flex: 0 0 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: #7559ad; }
.msg .ic.pic { flex-basis: 54px; height: 54px; }
.allowmic { display: inline-flex; align-items: center; gap: 8px; margin-inline-start: 10px; padding: 8px 18px; border: 0; border-radius: 999px; background: #e0457b; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.allowmic:focus-visible { outline: 3px solid #7559ad; outline-offset: 2px; }
.msg span:last-child { font-size: 20px; font-weight: 700; line-height: 1.35; }
.msg.pink { background: #fdeef2; border-color: #f2c4d1; } .msg.pink .ic { color: #b8456a; }
.msg.green { background: #e4f4eb; border-color: #bfe3cf; } .msg.green .ic { color: #2f8259; }
.msg.calm { background: #eaf2fb; border-color: #c9dcf1; } .msg.calm .ic { color: #2f6aa0; }
.controls { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 20px; }
.nextbtn { justify-self: start; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: #24603f; }
.nextbtn .c { width: 84px; height: 84px; border-radius: 50%; background: linear-gradient(180deg, #5cc08e, #3a9c6b); box-shadow: 0 10px 22px rgba(58,156,107,.34);
  display: grid; place-items: center; color: #fff; }
.nextbtn:disabled { color: #8a9c92; }
.nextbtn:disabled .c { background: #dcebe2; box-shadow: none; color: #9cbcab; }
.nextbtn .lb, .miclb { font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 20px; }
.pulse { animation: nextPulse 1.6s ease-in-out infinite; }
@keyframes nextPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.miccol { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mic { position: relative; width: 132px; height: 132px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; color: #fff;
  background: linear-gradient(180deg, #f4a3b5, #e9849d); box-shadow: 0 12px 26px rgba(233,132,157,.45), 0 0 0 8px rgba(241,143,164,.18);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform .15s ease; }
.mic.rec { background: linear-gradient(180deg, #ef8fa4, #dd6f8b); transform: scale(1.06); }
.mic:disabled { background: #e6ded4; color: #a89a8e; box-shadow: none; }
.ring { position: absolute; inset: -14px; border-radius: 50%; border: 4px solid rgba(221,111,139,.55); animation: recPulse 1.4s ease-out infinite; pointer-events: none; }
.ring.r2 { animation-delay: .7s; }
@keyframes recPulse { from { transform: scale(.92); opacity: .9; } to { transform: scale(1.38); opacity: 0; } }
.miclb { color: #a23a5c; }
.miclb.off { color: #6f6258; }
.tries { justify-self: end; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dots { display: flex; gap: 8px; }
.dot { width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px #d9c9f2; }
.dot.used { background: #8a6fc0; box-shadow: inset 0 0 0 2px #8a6fc0; }
.tries small { font-size: 16px; font-weight: 800; color: #6f6258; }
/* Mic with the arched tip over it and the green ▶ (whole line) to its right */
.micwrap { position: relative; width: 132px; height: 132px; }
.micwrap .mic { position: relative; z-index: 2; }
.arch { position: absolute; left: 50%; top: -84px; width: 300px; height: 170px; margin-left: -150px; z-index: 3; pointer-events: none;
  transform-origin: 150px 150px; transform: scale(0); opacity: 0; }
.arch.show { animation: archIn 3s cubic-bezier(.3,1.25,.5,1) forwards; }   /* 2026-11-03: 1 s longer, a bit slower */
@keyframes archIn { 0% { transform: scale(0); opacity: 0; } 14% { transform: scale(1.05); opacity: 1; } 22% { transform: scale(1); }
  86% { transform: scale(1); opacity: 1; } 100% { transform: scale(0); opacity: 0; } }
.arch .band { fill: none; stroke: #efe7fb; stroke-width: 34; stroke-linecap: round; }
.arch text { font: 800 20px 'Baloo 2', sans-serif; fill: #7559ad; }
.playline { position: absolute; left: calc(100% + 26px); top: 50%; margin-top: -32px; width: 64px; height: 64px; border-radius: 50%; border: 0;
  display: grid; place-items: center; color: #fff; background: linear-gradient(180deg, #5cc08e, #3a9c6b); box-shadow: 0 8px 18px rgba(58,156,107,.34); }
.playline.playing { background: linear-gradient(180deg, #8fd6b0, #6bbb93); }
.playline:disabled { background: #dcebe2; box-shadow: none; color: #9cbcab; }
/* A red word that was just played: quick gold shine that fades; it keeps its red pill. */
.word.shine { animation: goldshine 1.1s ease-out; }
@keyframes goldshine { 0% { background: rgba(240,194,74,.75); box-shadow: 0 0 18px 6px rgba(240,194,74,.7); }
  100% { background: transparent; box-shadow: 0 0 0 0 rgba(240,194,74,0); } }
/* Rainbow (first pass after tapping a red word) and the "Catch me!" plane */
.playline.blink:not(:disabled) { animation: softblink 1.1s ease-in-out infinite alternate; }
@keyframes softblink { from { box-shadow: 0 8px 18px rgba(58,156,107,.34); transform: scale(1); } to { box-shadow: 0 0 0 10px rgba(92,192,142,.35), 0 8px 18px rgba(58,156,107,.34); transform: scale(1.1); } }
.nextbtn.locked { color: #8a9c92; }
.nextbtn.locked .c { background: #dcebe2; box-shadow: none; color: #9cbcab; }
.cardrow { position: relative; }
.arch.nexttip { left: 60px; top: auto; bottom: calc(50% + 30px); width: 220px; height: 125px; margin-left: -110px; transform-origin: 110px 110px; }
.arch.nexttip text { font-size: 20px; }
.lineplay { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 999px; border: 2px solid #d9c9f2;
  background: #fffaf3; color: #4c3585; font-weight: 800; font-size: 16px; }
.lineplay.playing { background: #efe7fb; }

/* S5 done */
.donewrap { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
.donecard { position: relative; width: 100%; max-width: 660px; padding-top: 80px; filter: drop-shadow(0 22px 36px rgba(96,128,178,.24)); }
.donecard .body { position: relative; display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 18px 44px 44px; border-radius: 90px; background: #fffaf3; text-align: center; }
.plant { width: 136px; height: 136px; border-radius: 50%; background: #e4f4eb; display: grid; place-items: center; color: #2f8259; animation: grow .9s cubic-bezier(.2,.8,.3,1); }
@keyframes grow { from { transform: scale(.6) translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
/* Reward icon (rewards.js): the circle pops in, then the drawing builds itself (~1.5 s). */
.rw { animation-duration: .7s; animation-delay: .5s; animation-fill-mode: backwards; }   /* 2026-11-03: 0.5 s wait, slower */
.rw .d { stroke-dasharray: 1; stroke-dashoffset: 1; animation: rwdraw calc(var(--dur, .45s) * 1.4) ease-out calc(var(--t) * 1.4 + .8s) forwards; }
.rw .p { transform-box: fill-box; transform-origin: var(--o, center); transform: scale(0);
  animation: rwpop .6s cubic-bezier(.3,1.6,.5,1) calc(var(--t) * 1.4 + .8s) forwards; }
.rw .wing { transform-box: fill-box; transform: scaleX(0);
  animation: rwpop .63s cubic-bezier(.3,1.5,.5,1) calc(var(--t) * 1.4 + .8s) forwards, rwflap .7s ease-in-out 2.7s 2; }
.rw .wing.l { transform-origin: 100% 50%; } .rw .wing.r { transform-origin: 0% 50%; }
.rw .rise { transform-box: fill-box; transform-origin: 50% 100%; transform: translateY(5px) scale(0); opacity: 0;
  animation: rwrise .84s cubic-bezier(.3,1.4,.5,1) calc(var(--t) * 1.4 + .8s) forwards; }
.rw .lift { animation: rwlift 1s ease-in-out 2.6s forwards; }
.rw .float { animation: rwfloat 2.2s ease-in-out 2.7s infinite alternate; }
@keyframes rwdraw { to { stroke-dashoffset: 0; } }
@keyframes rwpop { to { transform: none; } }
@keyframes rwflap { 50% { transform: scaleX(.55); } }
@keyframes rwrise { to { transform: none; opacity: 1; } }
@keyframes rwlift { 40% { transform: translateY(.6px); } to { transform: translateY(-1.6px); } }
@keyframes rwfloat { to { transform: translateY(-1px); } }
.donecard h1 { margin: 0; font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 54px; line-height: 1.05; color: #2f8259; }
.donecard p { margin: 0; font-size: 22px; line-height: 1.5; }
.dtrail .row { --gap: 30px; --sw: 36px; } .dtrail .stone { width: 36px; height: 36px; font-size: 15px; }
.dbtns { display: flex; flex-direction: column; align-items: stretch; gap: 14px; width: 100%; max-width: 420px; margin-top: 6px; }
.again { min-height: 64px; border-radius: 999px; border: 0; background: #efe7fb; color: #4c3585; font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 21px; }
.dbtns .go { min-width: 0; min-height: 64px; font-size: 24px; }
.donecard .right { display: flex; flex-direction: column; align-items: center; gap: 20px; }
@media (orientation: landscape) {
  .donecard { max-width: 980px; padding-top: 60px; }
  .donecard .body { flex-direction: row; align-items: center; gap: 44px; text-align: left; padding: 30px 50px 36px; }
  .donecard .right { align-items: flex-start; gap: 14px; }
  .donecard h1 { font-size: 48px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; }
  .bcloud { transform: translateX(var(--rest, 20vw)); }
  .rw .d { stroke-dashoffset: 0; } .rw .p, .rw .wing, .rw .rise { transform: none; opacity: 1; } }
@media (orientation: portrait) {
  .stories { gap: 24px; }
  .story { flex-basis: 340px; }
  .story .body { padding: 20px 26px 28px; border-radius: 70px; }
  .story .cv { height: 140px; }
  .story .t { font-size: 32px; }
}


/* 2026-11-03 — a word being played shows its syllables over itself, so nothing moves. */
.word { position: relative; }
.word .base.hide { visibility: hidden; }
.word .syl { position: absolute; top: 0; left: 50%; transform: translateX(-50%) scale(var(--fit, 1)); white-space: nowrap; direction: rtl; }
/* Next is locked while the try has red words: one red word glows softly (where to tap). */
.word.red.hint { animation: hintglow 1.4s ease-in-out infinite alternate; }
@keyframes hintglow { from { box-shadow: 0 0 0 3px rgba(176,42,53,.14), 0 0 4px 2px rgba(240,194,74,.35); }
  to { box-shadow: 0 0 0 3px rgba(176,42,53,.2), 0 0 20px 8px rgba(240,194,74,.75); } }
/* After the tap: a small speech bubble out of the word, ~2 s. */
.wbubble { position: fixed; z-index: 20; pointer-events: none; transform: translate(-50%, calc(-100% - 14px));
  white-space: nowrap; direction: ltr; font: 800 20px 'Baloo 2', sans-serif; color: #4c3585; background: #fff; padding: 8px 18px;
  border-radius: 999px; box-shadow: 0 8px 20px rgba(76,53,133,.22); animation: bubble 2s ease-out forwards; }
.wbubble::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -9px; border: 9px solid transparent; border-top-color: #fff; }
@keyframes bubble { 0% { opacity: 0; transform: translate(-50%, calc(-100% - 4px)) scale(.6); } 12% { opacity: 1; transform: translate(-50%, calc(-100% - 14px)) scale(1); }
  80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, calc(-100% - 20px)); } }
/* The banner's green ▶ (plays the whole line) */
.msg .ic.play { border: 0; padding: 0; cursor: pointer; color: #fff; background: linear-gradient(180deg, #5cc08e, #3a9c6b); box-shadow: 0 4px 10px rgba(58,156,107,.3); }
.msg .ic.play:disabled { background: #dcebe2; color: #9cbcab; box-shadow: none; cursor: default; }
/* Home blinks when the screen looks stuck (the way out) */
.homebtn.blink { animation: homeblink 1s ease-in-out infinite alternate; }
@keyframes homeblink { to { box-shadow: 0 0 0 10px rgba(117,89,173,.3), 0 6px 16px rgba(96,128,178,.18); transform: scale(1.08); } }
/* Top corner (as in the Pressman app): words needed for a green stone */
.toprow .tl { display: flex; align-items: center; gap: 14px; }
.gneed .gl { line-height: 1.15; }
.gneed { display: inline-flex; align-items: center; gap: 8px; font: 700 14px 'Baloo 2', sans-serif; color: #2f8259; }
.gneed .st { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #3a9c6b; color: #fff; font: 800 16px 'Rubik', sans-serif; }
/* Airplane reward: 3 lines in a row with no red words — flies across once, towing a banner */
.plane { position: absolute; top: 150px; left: 0; z-index: 6; display: flex; align-items: center; white-space: nowrap; pointer-events: none; }
.plane.ltr { animation: pltr 4.5s linear .5s both; }
.plane.rtl { animation: prtl 4.5s linear .5s both; flex-direction: row-reverse; }
.plane .pp { font-size: 64px; display: inline-block; transform: rotate(40deg); }
.plane.rtl .pp { transform: scaleX(-1) rotate(40deg); }
.plane .prope { width: 40px; height: 3px; background: #6f6258; }
.plane .pflag { font: 800 26px 'Baloo 2', sans-serif; color: #fff; background: #dd6f8b; padding: 6px 22px; border-radius: 8px; box-shadow: 0 6px 14px rgba(0,0,0,.12); }
@keyframes pltr { from { transform: translateX(-100%); } to { transform: translateX(100vw); } }
@keyframes prtl { from { transform: translateX(100vw); } to { transform: translateX(-100%); } }
/* 2026-11-03: many stones squeeze closer instead of leaving the card (the row never gets wider than its box) */
.trail .row { --gap: 44px; --sw: 40px; width: 100%; max-width: calc(var(--n, 10) * var(--sw) + (var(--n, 10) - 1) * var(--gap) + 12px);
  justify-content: space-between; gap: 4px; }
.trail .stone { flex: none; }
.dtrail { width: 100%; }
.donecard .right { flex: 1; min-width: 0; width: 100%; }
