/* The lesson screen (lesson.js). Since 23 Nov: the cream page of the path, plain white cards with a soft shadow, a thin progress bar,
   the sign's video in a plain rounded card. No beach, no clay frame (testers found them childish). Mimi stays in the feedback strip. */
:root { --lift:0 1px 2px rgba(39,50,74,.06), 0 6px 18px rgba(39,50,74,.07); --line:rgba(39,50,74,.1); }   /* the soft shadow and hairline of the cards */
html.playing, html.playing body { overflow:hidden; }
.play { position:fixed; inset:0; z-index:60; display:grid; grid-template-rows:auto 1fr auto; color:var(--ink);
  background:var(--paper); }
.play[hidden] { display:none; }
.play > * { width:min(100%, 520px); margin:0 auto; }

/* top: quit, progress, combo */
.play-top { display:flex; align-items:center; gap:12px; padding:calc(12px + env(safe-area-inset-top)) 16px 6px; }
.pbtn { flex:none; width:40px; height:40px; border:0; border-radius:50%; background:transparent; color:var(--ink2); font:500 22px/1 "Francois One", sans-serif;
  cursor:pointer; -webkit-tap-highlight-color:transparent; }
.pbtn:active { transform:scale(.98); }
.pbar { flex:1; height:8px; border-radius:99px; background:rgba(39,50,74,.1); overflow:hidden; }
.pbar i { display:block; height:100%; width:0; border-radius:99px; background:var(--pink); position:relative;
  transition:width .6s cubic-bezier(.34,1.56,.64,1); }
.combo { flex:none; min-width:44px; display:inline-flex; align-items:center; gap:2px; font:700 17px/1 "Francois One", sans-serif; color:#d9541e; }
.combo img { width:26px; height:26px; }

/* the stage: one step at a time */
.play-stage { overflow-y:auto; overscroll-behavior:contain; padding:14px 20px 16px; display:flex; flex-direction:column; align-items:center; gap:12px; text-align:center; }
/* the step's label and question sit on the left, like a page title */
.play-stage > .ptag, .play-stage > .pq, .play-stage > .pword, .play-stage > .pask { align-self:stretch; text-align:left; }
.ptag { display:block; color:var(--ink2); font:600 12px/1 "Francois One", sans-serif; letter-spacing:.08em; text-transform:uppercase; margin-bottom:-6px; }
.pq { margin:0; font:600 clamp(20px, 5.6vw, 25px)/1.25 "Francois One", sans-serif; }
.pword { margin:0; font:600 clamp(30px, 9vw, 40px)/1.1 "Francois One", sans-serif; }
.pask { margin:0; font-weight:600; }

/* a sign's video in a plain rounded card (4:3) */
.tv { position:relative; width:100%; aspect-ratio:4 / 3; flex:none; border-radius:20px; overflow:hidden; background:var(--fill); box-shadow:var(--lift); }
.tv video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; transform:scaleX(-1); }
.tv.lefty video, .pvopt.lefty video { transform:none; }
.tv-ctl { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; }
.chipbtn { border:1px solid var(--line); border-radius:99px; background:var(--card); color:var(--ink); font:500 14px/1 "Francois One", sans-serif; padding:11px 14px; cursor:pointer; }
.chipbtn:active { transform:scale(.98); }
.credit { margin:0; font-size:12px; line-height:1.4; color:var(--ink2); max-width:400px; }
.credit a { color:inherit; }

/* answers: clay cards */
.popts { width:100%; display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.popt { position:relative; min-height:60px; border:2px solid transparent; border-radius:16px; background:var(--card); color:var(--ink); font:500 17px/1.2 "Francois One", sans-serif;
  padding:12px 10px 12px 38px; text-align:left; box-shadow:var(--lift); cursor:pointer; transition:transform .12s, box-shadow .12s, background .2s, border-color .2s;
  -webkit-tap-highlight-color:transparent; }
.popt .k { position:absolute; left:10px; top:50%; translate:0 -50%; width:20px; height:20px; border-radius:50%; background:var(--fill); color:var(--ink2);
  font:600 12px/20px "Francois One", sans-serif; text-align:center; }
.popt:active:not([disabled]) { transform:scale(.98); }
.popt.sel { border-color:var(--pink); }
.popt.right { border-color:#3f9e62; background:var(--fill); box-shadow:var(--lift); }
.popt.wrong { border-color:#d0583a; background:color-mix(in oklab, #fbece7 var(--tint), var(--card)); box-shadow:var(--lift); }
.popt[disabled] { cursor:default; }
.popt:focus-visible, .pgo:focus-visible, .pbtn:focus-visible, .chipbtn:focus-visible { outline:3px solid var(--ink); outline-offset:3px; }
.two .popt { text-align:center; padding-left:12px; font-size:19px; }
.two .popt .k { display:none; }
.pvopts { width:100%; display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.pvopt { padding:8px; }
.pvopt .k { left:14px; top:14px; translate:none; z-index:1; }
.pvopt video { display:block; width:100%; aspect-ratio:4 / 3; object-fit:cover; border-radius:12px; transform:scaleX(-1); background:#26364a; }

.recall { display:flex; flex-direction:column; align-items:center; gap:8px; background:var(--card); border-radius:22px; padding:16px; max-width:380px;
  box-shadow:var(--lift); }
.recall img { width:110px; height:auto; }
.recall p { margin:0; font-weight:500; line-height:1.4; }

/* the camera round (camera.js): the sign in its frame on the left, the learner's mirror on the right */
.camduo { display:grid; grid-template-columns:1fr 1fr; gap:10px; align-items:center; width:100%; }
.camref .tv { width:100%; }
/* on a computer the camera step gets more room (Eliott, 22 Nov: "both should be bigger"): up to 1000px wide, but never so tall
   that the hints and buttons fall off the screen (the two boxes are about 0.41 of the width tall); never smaller than before */
.play > .play-stage:has(.camduo) { width:min(100%, max(520px, min(1000px, calc((100dvh - 460px) * 2.4)))); }
.play-stage:has(.camduo) > :not(.camduo) { max-width:640px; }
.camduo { gap:clamp(10px, 2vw, 24px); }
/* 28 Nov: on a phone, before the try, the two pictures stack and take the empty half of the screen, big enough to see a handshape.
   Once the result is there they go back side by side, so the hints and the buttons stay on screen. A short screen keeps them side by side. */
@media (max-width:560px) and (min-height:700px) {
  .play-stage:has(.camduo):not(:has(.cres:not(:empty))) .camduo { grid-template-columns:1fr; justify-items:center; gap:10px; }
  .play-stage:has(.camduo):not(:has(.cres:not(:empty))) .camduo > * { width:min(100%, calc((100dvh - 300px) * 2 / 3)); }
}
.camcover { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; aspect-ratio:4 / 3; background:var(--card);
  border-radius:22px; padding:10px; box-shadow:var(--lift); }
.camcover img { width:58%; height:auto; }
.camcover p { margin:0; font-size:13px; font-weight:600; line-height:1.3; }
.mecam { position:relative; aspect-ratio:4 / 3; border-radius:22px; overflow:hidden; background:#26364a; border:3px solid var(--card);
  box-shadow:var(--lift); transition:border-color .2s, box-shadow .2s; }
.mecam video, .mecam canvas { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; transform:scaleX(-1); }   /* a mirror, like a selfie */
.mecam.rec { border-color:var(--pink); animation:rec-glow 1s ease-in-out infinite; }
@keyframes rec-glow { 50% { box-shadow:0 0 0 6px rgba(198,57,107,.25); } }
.me-idle { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; padding:8px; background:var(--fill); }
.me-idle img { width:46%; max-height:60%; object-fit:contain; }
.me-idle p { margin:0; font-size:12.5px; font-weight:600; line-height:1.3; color:var(--ink2); }
.mecam .count { position:absolute; inset:0; display:grid; place-items:center; pointer-events:none; font:700 clamp(56px, 18vw, 92px)/1 "Francois One", sans-serif;
  color:#fff; text-shadow:0 4px 0 var(--pink-d), 0 0 18px rgba(0,0,0,.35); }
.mecam .status { position:absolute; left:6px; right:6px; bottom:6px; font-size:12px; font-weight:600; line-height:1.25; color:#fff; }
.mecam .status:not(:empty) { background:rgba(39,50,74,.78); border-radius:12px; padding:5px 8px; }
.cres { display:flex; flex-direction:column; align-items:center; gap:10px; width:100%; }
.cres:empty { display:none; }
.parts { display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; width:100%; }
.part { display:flex; flex-direction:column; gap:2px; border-radius:16px; padding:9px 4px; background:var(--card); box-shadow:var(--lift); }
.part small { font-size:12px; font-weight:600; color:var(--ink2); }
.part b { font:700 17px/1.1 "Francois One", sans-serif; }
.part em { font-style:normal; font-size:11px; color:var(--ink2); }
/* letters (25 Nov): a closeness gauge and the hand finger by finger (camera.js, letterResult) */
.lgauge { width:100%; display:flex; flex-direction:column; gap:4px; }
.lg-bar { position:relative; height:14px; border-radius:99px; background:linear-gradient(90deg, color-mix(in oklab, #f3d6c9 var(--tint), var(--card)) 0 50%, color-mix(in oklab, #f7e6b5 var(--tint), var(--card)) 50% 75%, var(--fill) 75%); box-shadow:var(--lift); }
.lg-bar i { position:absolute; inset:0 auto 0 0; border-radius:99px; background:#2fa36b; opacity:.85; }
.lg-bar em { position:absolute; top:-3px; bottom:-3px; width:3px; margin-left:-1px; border-radius:2px; background:var(--ink2); }
.lg-scale { display:flex; justify-content:space-between; font-size:12px; font-weight:600; color:var(--ink2); }
.lg-scale span:nth-child(2) { margin-left:25%; }
.lhand { display:flex; align-items:center; gap:14px; justify-content:center; }
.lhand svg { width:96px; height:120px; flex:none; }
.lhand rect { fill:#efe3d6; stroke:#b9a491; stroke-width:2; }
.lhand rect.good { fill:#bfe6cd; stroke:#2fa36b; }
.lhand rect.bad { fill:#f6c4c4; stroke:#c6396b; }
.lhand rect.unsure { stroke-dasharray:4 3; }
.lhand rect.palm { fill:#f6ece2; }
.lhand ul { list-style:none; margin:0; padding:0; font-weight:600; font-size:14px; display:flex; flex-direction:column; gap:4px; }
.lhand li.bad { color:#a3214f; }
.lhand li.good { color:#1f7a4d; }
.part.lv-close { background:color-mix(in oklab, #e6f8ec var(--tint), var(--card)); box-shadow:var(--lift); } .part.lv-close b { color:var(--good-t); }
.part.lv-near { background:color-mix(in oklab, #fff6d9 var(--tint), var(--card)); box-shadow:var(--lift); } .part.lv-near b { color:#a47712; }
.part.lv-far { background:var(--fill); } .part.lv-far b { color:var(--ink2); }
.selfcheck, .setup { display:flex; flex-direction:column; gap:7px; width:100%; text-align:left; background:var(--card); border-radius:20px; padding:12px 14px;
  box-shadow:var(--lift); font-size:14px; line-height:1.35; }
.selfcheck > b, .setup > b { font:700 16px/1.2 "Francois One", sans-serif; }
.selfcheck > span { display:flex; gap:8px; align-items:flex-start; }
.setup small { color:var(--ink2); font-size:12px; }
.srow { display:flex; gap:8px; align-items:center; }
.srow i { flex:none; width:22px; height:22px; border-radius:50%; display:grid; place-items:center; font:700 13px/1 "Francois One", sans-serif; font-style:normal;
  background:var(--fill); color:var(--ink2); }
.srow.ok i { background:#5fc27e; color:#fff; }
.srow.warn i { background:#f2a35e; color:#fff; }
.setup.ready { background:color-mix(in oklab, #e6f8ec var(--tint), var(--card)); }
.ctools { display:flex; gap:8px; justify-content:center; align-items:center; flex-wrap:wrap; }
/* after a try (28 Nov): the tools in an even grid. Filled pink is for the screen's main button; the good next step ("Réessayer") is outlined. */
.chipbtn.again { color:var(--pink-t); border:1.5px solid var(--pink); }
.cres > .ctools { display:grid; grid-template-columns:1fr 1fr; gap:8px; width:100%; }
.cres > .ctools .chipbtn { min-height:44px; padding:8px 10px; }
.cres > .ctools .chipbtn:last-child:nth-child(odd) { grid-column:1 / -1; }
.ctools input[type=range] { flex:1 1 120px; accent-color:var(--pink); }
#c-more { width:100%; display:flex; flex-direction:column; align-items:center; gap:8px; }
#c-more:empty { display:none; }
.replay { display:grid; grid-template-columns:1fr 1fr; gap:10px; width:100%; }
.replay figure { margin:0; display:flex; flex-direction:column; gap:4px; font-size:12.5px; font-weight:600; color:var(--ink2); }
.replay video { width:100%; aspect-ratio:4 / 3; object-fit:cover; border-radius:16px; background:#26364a; border:0; box-shadow:var(--lift); }
.replay video.flip { transform:scaleX(-1); }
.compare { display:flex; flex-direction:column; gap:8px; width:100%; background:var(--card); border-radius:20px; padding:10px; box-shadow:var(--lift); }
.compare canvas { width:100%; height:auto; border-radius:14px; background:var(--fill); }
.legend { display:flex; gap:14px; justify-content:center; font-size:13px; font-weight:600; }
.legend i { display:inline-block; width:12px; height:12px; border-radius:50%; margin-right:5px; vertical-align:-1px; }
.legend i.me { background:#c6396b; } .legend i.them { background:#2f9e62; }
.plinks { display:flex; gap:6px 16px; justify-content:center; flex-wrap:wrap; }
.plink { border:0; background:none; padding:6px; font:600 14px/1.2 "Francois One", sans-serif; color:var(--ink2); text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
.plink:focus-visible { outline:3px solid var(--ink); outline-offset:2px; border-radius:6px; }

/* bottom: Mimi's feedback and the main button (28 Nov: the same small lip as .go on the other screens; it sinks when pressed) */
.play-foot { padding:8px 16px calc(18px + env(safe-area-inset-bottom)); display:flex; flex-direction:column; gap:10px; }
.fb { position:relative; display:grid; grid-template-columns:auto 1fr; align-items:center; gap:10px; text-align:left; border-radius:20px; padding:10px 14px 10px 8px;
  background:var(--card); box-shadow:var(--lift); }
.fb[hidden] { display:none; }
.fb img { width:68px; height:76px; object-fit:contain; margin-top:-26px; }
.fb b { display:block; font:700 19px/1.15 "Francois One", sans-serif; }
.fb span { display:block; font-size:14px; line-height:1.35; color:var(--ink2); margin-top:2px; }
.fb.ok { background:var(--fill); } .fb.ok b { color:var(--good-t); }
.fb.no { background:color-mix(in oklab, #fbece7 var(--tint), var(--card)); } .fb.no b { color:#c26a1c; }
.fb.mid { background:var(--card); }
.pgo { width:100%; border:0; border-radius:16px; padding:17px; font:600 18px/1 "Francois One", sans-serif; color:#fff; background:var(--pink); box-shadow:0 4px 0 var(--pink-d);
  cursor:pointer; transition:background .2s, transform .12s, box-shadow .12s; -webkit-tap-highlight-color:transparent; }
.pgo:active:not(:disabled) { transform:translateY(3px); box-shadow:0 1px 0 var(--pink-d); }
.pgo:disabled { background:var(--off); color:var(--off-ink); box-shadow:0 4px 0 var(--off-d); cursor:default; }
.pgo.ok { background:#2f8a50; box-shadow:0 4px 0 var(--good-d); } .pgo.ok:active:not(:disabled) { box-shadow:0 1px 0 var(--good-d); }
.pgo.no { background:#c4562f; box-shadow:0 4px 0 var(--bad-d); } .pgo.no:active:not(:disabled) { box-shadow:0 1px 0 var(--bad-d); }
.pmap { border:0; background:none; font:600 15px/1 "Francois One", sans-serif; color:var(--ink2); padding:6px; cursor:pointer; }

/* the end of a session */
.end { display:flex; flex-direction:column; align-items:center; gap:10px; width:100%; padding-top:6px; }
.end-mimi { width:min(42vw, 170px); height:auto; filter:drop-shadow(0 10px 8px rgba(20,60,100,.25)); }
.end-title { margin:0; font:600 clamp(26px, 8vw, 34px)/1.1 "Francois One", sans-serif; outline:none; }
.end-stats { display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; width:100%; }
.tile { background:var(--card); border-radius:18px; padding:10px 6px 8px; display:flex; flex-direction:column; align-items:center; box-shadow:var(--lift); }
.tile img { width:34px; height:34px; }
.tile b { font:700 24px/1.1 "Francois One", sans-serif; }
.tile small { font-size:12px; font-weight:600; color:var(--ink2); }
.end-signs { list-style:none; margin:0; padding:10px 14px; width:100%; background:var(--card); border-radius:18px; display:flex; flex-direction:column; gap:7px; }
.end-signs li { display:grid; grid-template-columns:1fr auto 60px; align-items:center; gap:8px; text-align:left; font-weight:600; }
.end-signs em { font-style:normal; font-size:13px; font-weight:700; text-align:right; color:var(--ink2); }
.end-signs em.up { color:var(--good-t); } .end-signs em.down { color:#c26a1c; }
.end-quest { margin:0; display:flex; align-items:center; gap:8px; background:var(--card); border-radius:14px; padding:8px 12px; font-weight:600; font-size:14px; text-align:left; }
.end-quest img { width:26px; height:26px; flex:none; }

/* the motion kit's moves (motion.js) */
.pop { animation:pop .32s cubic-bezier(.34,1.56,.64,1); }
.shake { animation:shake .42s ease; }
.bounce-in { animation:bounce-in .6s cubic-bezier(.34,1.56,.64,1); }
.rise { animation:rise .35s cubic-bezier(.2,.9,.3,1.1); }
.slide-in { animation:slide-in .35s cubic-bezier(.2,.9,.3,1); }
@keyframes pop { 50% { transform:scale(1.1); } }
@keyframes shake { 20%, 60% { transform:translateX(-7px); } 40%, 80% { transform:translateX(7px); } }
@keyframes bounce-in { from { transform:translateY(30px) scale(.4); opacity:0; } }
@keyframes rise { from { transform:translateY(30px); opacity:0; } }
@keyframes slide-in { from { transform:translateY(24px); opacity:0; } }
.confetti { position:fixed; inset:0; z-index:80; pointer-events:none; overflow:hidden; }
.confetti i { position:absolute; width:9px; height:13px; border-radius:2px; }
.flytext { position:fixed; z-index:90; pointer-events:none; font:700 21px/1 "Francois One", sans-serif; color:var(--pink); text-shadow:0 2px 0 #fff, 0 0 8px #fff; white-space:nowrap; }
/* back on the map: the stone just done pops (it keeps its place: translate as in world.css) */
.node.pop { animation:stone-pop .55s cubic-bezier(.34,1.56,.64,1); }
@keyframes stone-pop { 50% { transform:translate(-50%, -54%) scale(1.3); } }
.end-quest.trophy-new { background:color-mix(in oklab, #fff6d9 var(--tint), var(--card)); box-shadow:var(--lift); } .end-quest.trophy-new img { width:34px; height:34px; animation:bounce-in .7s cubic-bezier(.34,1.56,.64,1); }
/* the day's free camera tries are done (camera.js limit, plus.js) */
.camlimit { display:flex; flex-direction:column; align-items:center; gap:10px; padding:16px; border-radius:22px; background:var(--card); box-shadow:var(--lift); text-align:center; }
.camlimit img { width:110px; height:auto; }
.camlimit p { margin:0; font-size:15px; line-height:1.45; }
