/* The Nook frame (round 4): one layout for every game, plus Nook's shelf, each game's sub-menu on the shelf (phase 9)
   and the Grown-ups hold. Layout reference: docs/little-patterns-round-4/mockups/frame.css. Load before the game's own
   object stylesheet, with nook.css (the rig) and shared.css (dialogs).

   Frame pages put class "lp-frame" on <html>. The frame height follows the visual viewport (frame.js sets --app-h
   from visualViewport, falling back to 100dvh), so when a device keyboard or large text leaves less room the task
   card scrolls inside the frame and the shelf button, Help, Delete and Enter stay reachable. Zoom stays on.

   Layouts: phone portrait (Nook above the task); phone landscape under 520 px tall (Nook in a left column, task in
   the centre, actions in a right column; Words folds the bubble into the card); tablet from 760 px wide (Nook
   larger beside the task). Motion follows review-opus-pass-1 section 4 as amended by BUILD-BRIEF items 60 and 64:
   travel at most 12 px, scale at most 1.06; Softer and reduced motion keep only short opacity changes. */
:root{--ink:#293d60;--paper:#fffcdf;--sky:#dcf3ed;--sand:#f8edba;--grass:#c6df99;--mint:#b3e2d4;--mint-dark:#6bb9a6;--butter:#ffe393;--butter-dark:#debd50;--lilac:#e1d3f1;--lilac-dark:#b09bd0;--coral:#f8c1b5;--coral-dark:#d99389;--green:#376e5a;--green-dark:#285347;--lp-out:cubic-bezier(.2,.7,.3,1);--lp-in:cubic-bezier(.4,0,1,1);--lp-inout:cubic-bezier(.45,0,.55,1);--app-h:100vh;font-family:"Trebuchet MS",Arial,sans-serif;color:var(--ink);font-synthesis:none}
@supports (height:100dvh){:root{--app-h:100dvh}}
*{box-sizing:border-box}
html.lp-frame,html.lp-frame body{margin:0;height:100%;overflow:hidden;overscroll-behavior:none}
html.lp-frame body{background:linear-gradient(var(--sky) 0 38%,var(--sand) 38% 100%);-webkit-tap-highlight-color:transparent;touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-text-size-adjust:100%;text-size-adjust:100%}
html.lp-frame input,html.lp-frame textarea,html.lp-frame .lp-dialog p{-webkit-user-select:text;user-select:text}
html.lp-frame img,html.lp-frame svg{-webkit-user-drag:none;-webkit-touch-callout:none}
:where(.lp-frame) button{font:inherit;color:inherit;appearance:none;-webkit-appearance:none;border:0;background:none;padding:0;margin:0;cursor:pointer;touch-action:manipulation}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---- the frame: top bar, Nook and bubble, task card, two-slot action bar ---- */
.nf{height:var(--app-h);max-width:1000px;margin:0 auto;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:56px minmax(0,1fr) auto;padding:0 0 env(safe-area-inset-bottom)}
.nf-top{display:flex;align-items:center;gap:8px;padding:6px 10px;min-width:0}
.nf-shelf{width:46px;height:46px;flex:none;border-radius:14px;background:#fff;border:2px solid var(--lilac-dark);display:grid;place-items:center;color:#7862a4;box-shadow:0 3px 0 #cdbfe3}
.nf-shelf svg{width:26px;height:26px}
.nf-shelf:active{transform:translateY(2px);box-shadow:0 1px 0 #cdbfe3}
a.nf-shelf{text-decoration:none;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}
/* The caption (phase 9, navigation proposal 2): the game's small icon and where the child is, "Add · Up to 5". Plain
   text that states a fact: no border, no background, no press feedback, not focusable, and a tap passes through it.
   The child changes activity or level on the game's sub-menu: the back arrow top-left goes there (phase 9b). */
.caption{margin-left:auto;display:flex;align-items:center;gap:8px;min-width:0;padding:0 4px;font-size:15px;font-weight:900;line-height:1.2;color:#6b6350;text-align:right;pointer-events:none;-webkit-user-select:none;user-select:none}
.caption-art{display:flex;flex:none}
.caption-art svg{display:block;width:28px;height:28px}
.caption-text{min-width:0;overflow-wrap:break-word}

.nf-stage{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:4px;min-height:0;min-width:0;padding:0 12px}
.nf-nook{display:flex;align-items:flex-end;gap:10px;min-width:0}
.nook-btn{flex:none;position:relative;width:112px;height:134px;display:block;border-radius:24px}
.nook-pos{position:absolute;inset:0;display:block}
.nook-pos svg.nook{display:block;width:100%;height:100%}
.nf-bubble{position:relative;flex:1;min-width:0;min-height:56px;margin-bottom:28px;padding:12px 44px 12px 16px;border:2px solid #c0b1d7;background:#f0e7fa;border-radius:20px;font-size:21px;font-weight:900;line-height:1.25;color:#3d2f5e;text-align:left;transition:background-color 150ms linear,border-color 150ms linear}
.nf-bubble:after{content:"";position:absolute;left:-9px;bottom:14px;width:16px;height:16px;background:inherit;border-left:2px solid;border-bottom:2px solid;border-color:inherit;transform:rotate(45deg)}
.nf-bubble .hear{position:absolute;right:10px;top:50%;transform:translateY(-50%);width:28px;height:28px;color:#7862a4;opacity:.85}
.nf-bubble .hear svg{display:block;width:100%;height:100%}
.nf-bubble.silent{padding-right:16px}.nf-bubble.silent .hear{display:none}
.nf-bubble.success{background:#e4f3e3;border-color:#8fbf92;color:#2f5a44}
.nf-bubble #speech,.nf-bubble .line{display:block;overflow-wrap:break-word}
.nf-bubble .line.fade{animation:lp-fade-in 150ms linear}
.bubble-inline{display:none}

.nf-task{position:relative;min-height:0;min-width:0;display:flex;flex-direction:column;background:var(--paper);border:3px solid #e4d69c;border-radius:26px;overflow:hidden}
.nf-task:before{content:"";position:absolute;left:-6%;right:-6%;bottom:-96px;height:120px;border-radius:50% 50% 0 0;background:var(--grass);opacity:.7;pointer-events:none}
.nf-task>.task{position:relative;flex:1;min-height:0;display:flex;flex-direction:column;gap:10px;padding:14px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}
.objects{flex:1 0 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-width:0}
.answers{flex:none;display:flex;justify-content:center;align-items:stretch;gap:14px;min-height:96px;min-width:0}
.answers:empty{display:none}

/* The answer buttons shared by every game: tall, one colour, the chosen one green with a tick, the others faded. */
.answer{flex:1 1 0;min-width:44px;max-width:120px;min-height:96px;display:inline-flex;align-items:center;justify-content:center;padding:0 4px;background:#ccead9;border:3px solid #75ad91;border-bottom-width:7px;border-radius:20px;font-size:42px;font-weight:900;line-height:1;color:#2f4f3c;white-space:nowrap;position:relative;transition:transform 70ms var(--lp-out),opacity 200ms linear,background-color 150ms linear,border-color 150ms linear}
.answer:active:not(:disabled){transform:translateY(3px);border-bottom-width:4px}
.answer.hint{outline:4px solid #477b59;outline-offset:4px}
.answer.chosen{background:#9fd3b1;border-color:#3f8f5c;color:#20462f;opacity:1}
.answer.chosen:after{content:"";position:absolute;right:6px;top:6px;width:18px;height:10px;border-left:4px solid #2f6a4a;border-bottom:4px solid #2f6a4a;transform:rotate(-45deg);animation:lp-fade-in 150ms linear}
.answer.faded{opacity:.5}
.answer:disabled{cursor:default}
.answer.chosen:disabled{opacity:1}

.nf-actions{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:62px;gap:10px;padding:10px 12px 20px}
.nf-actions>button{grid-row:1;min-height:62px;min-width:44px;border-radius:18px;font-weight:900;font-size:19px;display:flex;align-items:center;justify-content:center;gap:10px;border:3px solid;transition:transform 70ms var(--lp-out),box-shadow 70ms var(--lp-out)}
.nf-actions>button:active{transform:translateY(3px)}
.nf-actions>.nf-help{grid-column:1;background:#fff1b5;border-color:#dcc05a;color:#5a4a12;box-shadow:0 4px 0 #dcc05a}
.nf-help svg{width:32px;height:32px;flex:none}
.nf-actions>.nf-again{grid-column:1;justify-self:start;width:72%;background:#fffdf3;border-color:#adcfc3;color:#2f675a;box-shadow:0 4px 0 #adcfc3;font-size:17px}
.nf-actions>.nf-next{grid-column:2;background:var(--green);border-color:var(--green-dark);color:#fff;box-shadow:0 4px 0 var(--green-dark)}
.nf-next:not([hidden]){animation:lp-fade-in 150ms linear}

/* ---- phone landscape: Nook in a left column, task centre, actions right ---- */
@media (orientation:landscape) and (max-height:520px){
  .nf{grid-template-columns:124px minmax(0,1fr) 124px;grid-template-rows:52px minmax(0,1fr);gap:0 8px;padding:0 8px 8px;max-width:none}
  .nf-top{grid-column:1/-1;padding:4px 0}
  .nf-shelf{width:44px;height:44px}
  .caption{font-size:14px}
  .nf-stage{display:contents}
  .nf-nook{grid-column:1;grid-row:2;flex-direction:column;align-items:center;justify-content:flex-start;gap:8px;min-height:0}
  .nook-btn{width:82px;height:98px}
  .nf-bubble{flex:none;width:100%;margin:0;padding:8px 30px 8px 10px;border-radius:14px;font-size:16px}
  .nf-bubble.silent{padding-right:10px}
  .nf-bubble:after{left:46%;bottom:auto;top:-9px;transform:rotate(135deg)}
  .nf-bubble .hear{width:20px;height:20px;right:6px}
  .nf-task{grid-column:2;grid-row:2;border-radius:20px}
  .nf-task>.task{padding:6px 8px;gap:6px}
  .answers{min-height:76px;gap:10px}
  .answer{min-height:76px;font-size:34px;border-radius:16px}
  .nf-actions{grid-column:3;grid-row:2;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;gap:8px;padding:0 0 12px}
  .nf-actions>button{min-height:56px;font-size:16px;border-radius:14px;width:100%}
  .nf-actions>.nf-help,.nf-actions>.nf-again{grid-row:1;grid-column:1;width:100%}.nf-actions>.nf-next{grid-row:3;grid-column:1}
  .nf-help svg{width:26px;height:26px}
  .nf-actions>.nf-again{font-size:15px}
  /* Words: the bubble folds into the card and the keyboard gets the width */
  .nf.words{grid-template-columns:minmax(0,1fr) 116px}
  .nf.words .nf-nook{display:none}
  .nf.words .nf-task{grid-column:1}
  .nf.words .nf-actions{grid-column:2}
  .nf.words .bubble-inline{display:block;flex:none;align-self:center;max-width:100%;margin:0;padding:3px 12px;border:2px solid #c0b1d7;background:#f0e7fa;border-radius:12px;font-size:16px;font-weight:900;line-height:1.25;color:#3d2f5e;text-align:center}
  .nf.words .bubble-inline.success{background:#e4f3e3;border-color:#8fbf92;color:#2f5a44}
}
/* ---- tablets and desktop: Nook larger beside the task ---- */
@media (min-width:760px) and (min-height:521px){
  .nf{grid-template-rows:64px minmax(0,1fr) auto}
  .nf-top{padding:8px 20px}
  .nf-stage{grid-template-columns:230px minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:16px;padding:0 20px}
  .nf-nook{flex-direction:column;align-items:center;justify-content:center;gap:12px}
  .nook-btn{width:190px;height:228px}
  .nf-bubble{flex:none;width:100%;margin:0;order:-1;padding:12px 42px 12px 16px;font-size:20px;text-align:center}
  .nf-bubble.silent{padding:12px 16px}
  .nf-bubble:after{left:46%;bottom:-10px;transform:rotate(-45deg)}
  .nf-task>.task{padding:20px}
  .answer{max-width:130px;min-height:104px;font-size:46px}
  .answers{min-height:104px}
  .nf-actions{width:100%;max-width:600px;margin:0 auto;padding:12px 20px 20px}
}
/* ---- portrait tablets and tall windows (phase 7): Nook and the bubble above the task, as on a phone but larger, so
   the card keeps the whole width (an iPad held upright, a tall desktop pane) ---- */
@media (min-width:760px) and (min-height:521px) and (orientation:portrait){
  .nf-stage{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:8px}
  .nf-nook{flex-direction:row;align-items:flex-end;justify-content:center;gap:16px}
  .nook-btn{width:150px;height:180px}
  .nf-bubble{flex:0 1 560px;width:auto;order:0;margin:0 0 40px;text-align:left;font-size:22px}
  .nf-bubble:after{left:-9px;bottom:14px;transform:rotate(45deg)}
}

@media (max-width:389px){.nf-top{gap:6px;padding:6px 8px}.caption{gap:6px;font-size:14px}.caption-art svg{width:24px;height:24px}}

/* ---- Nook's small calm responses (wrapper only; never the svg, which owns the breath) ---- */
.nook-wiggle{animation:lp-wiggle 520ms var(--lp-inout) both;transform-origin:50% 100%}
@keyframes lp-wiggle{0%,100%{transform:none}25%{transform:rotate(-3deg)}55%{transform:rotate(2.5deg)}80%{transform:rotate(-1deg)}}
@keyframes lp-fade-in{from{opacity:0}to{opacity:1}}
@keyframes lp-rise{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@keyframes lp-drop{from{opacity:0;transform:translateY(-12px)}to{opacity:1;transform:none}}
@keyframes lp-fade-out{from{opacity:1}to{opacity:0}}

/* ---- the shelf (the hub page, phase 9): the six games with choices first, each tile a folder preview of what is
   inside (one simple glyph per activity or level, in the tile's own ink); a thin rule; then Paint and Blocks with
   their single icon ---- */
.shelf{position:relative;height:var(--app-h);max-width:900px;margin:0 auto;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;gap:6px;padding:10px 12px 0}
.shelf-top{display:flex;align-items:flex-end;gap:10px;min-width:0}
.shelf-top .nook-btn{width:116px;height:139px}
.shelf-top .nf-bubble{margin-bottom:34px}
.tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr)) auto minmax(0,1fr);gap:12px;align-content:center;min-height:0;padding:6px 0 8px}
.tiles-rule{grid-column:1/-1;height:2px;margin:0 10%;border-radius:2px;background:#e4d69c}
.tile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:88px;max-height:150px;min-width:0;width:100%;border-radius:22px;border:3px solid;box-shadow:0 5px 0;font-weight:900;font-size:19px;letter-spacing:.5px;color:var(--ink);transition:transform 140ms var(--lp-out),box-shadow 140ms var(--lp-out)}
.tile:active{transform:translateY(3px);transition-duration:70ms}
.tile svg{width:56px;height:56px;flex:none}
.tile span{white-space:nowrap}
/* the folder preview: a small 2x2 grid (Add and Shapes 2x1, Patterns three cells) on a pale card */
.tile.folder{gap:6px}
.peek{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;width:84px;height:64px;padding:6px;border-radius:12px;background:rgba(255,255,255,.44);flex:none}
.peek-cell{display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;border-radius:7px;background:#fffdf3}
.tile .peek-cell svg{width:26px;height:26px}
.tile[aria-current=true]{outline:4px solid #314b59;outline-offset:3px}
.tile.count{background:var(--mint);border-color:var(--mint-dark);box-shadow:0 5px 0 var(--mint-dark)}.tile.add{background:var(--butter);border-color:var(--butter-dark);box-shadow:0 5px 0 var(--butter-dark)}.tile.words{background:var(--lilac);border-color:var(--lilac-dark);box-shadow:0 5px 0 var(--lilac-dark)}.tile.patterns{background:var(--coral);border-color:var(--coral-dark);box-shadow:0 5px 0 var(--coral-dark)}.tile.shapes{background:#fde9b8;border-color:#e3b85c;box-shadow:0 5px 0 #e3b85c}.tile.feelings{background:#ece4f6;border-color:#b09bd0;box-shadow:0 5px 0 #b09bd0}.tile.paint{background:#fff4d6;border-color:#d9b36b;box-shadow:0 5px 0 #d9b36b}.tile.blocks{background:#dbe8dc;border-color:#9bbf9f;box-shadow:0 5px 0 #9bbf9f}
.tile:active{box-shadow:0 2px 0 currentColor}
.tile.count:active{box-shadow:0 2px 0 var(--mint-dark)}.tile.add:active{box-shadow:0 2px 0 var(--butter-dark)}.tile.words:active{box-shadow:0 2px 0 var(--lilac-dark)}.tile.patterns:active{box-shadow:0 2px 0 var(--coral-dark)}.tile.shapes:active{box-shadow:0 2px 0 #e3b85c}.tile.feelings:active{box-shadow:0 2px 0 #b09bd0}.tile.paint:active{box-shadow:0 2px 0 #d9b36b}.tile.blocks:active{box-shadow:0 2px 0 #9bbf9f}
.shelf-foot{display:flex;justify-content:flex-end;align-items:center;gap:12px;min-height:68px;padding:6px 6px calc(14px + env(safe-area-inset-bottom))}
.sound-badge{width:34px;height:34px;display:grid;place-items:center;border-radius:50%;background:#fffdf3;border:1.5px solid #cfd6c7;color:#6d7a73}
.sound-badge svg{width:20px;height:20px}
.nf-grown{position:relative;width:48px;height:48px;flex:none;border-radius:50%;display:grid;place-items:center;color:#6d7a73;background:#fffdf3;border:1.5px solid #cfd6c7;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:none}
.nf-grown>svg:not(.ring){width:24px;height:24px}
.nf-grown .ring{position:absolute;left:-7px;top:-7px;width:62px;height:62px;overflow:visible;pointer-events:none}
.nf-grown .ring circle{fill:none;stroke:#7862a4;stroke-width:4;stroke-linecap:round;stroke-dasharray:169.65;stroke-dashoffset:169.65;transform:rotate(-90deg);transform-origin:50% 50%;transition:stroke-dashoffset 250ms var(--lp-out)}
.nf-grown.holding .ring circle{stroke-dashoffset:0;transition:stroke-dashoffset 1700ms linear}
.lp-modal.lp-rise .lp-dialog{animation:lp-rise 220ms var(--lp-out)}

@media (orientation:landscape) and (max-height:520px){
  .shelf{grid-template-columns:150px minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;column-gap:12px;padding:8px 10px 0;max-width:none}
  .shelf-top{grid-row:1;flex-direction:column;align-items:center;justify-content:center;gap:8px}
  .shelf-top .nook-btn{width:92px;height:110px}
  .shelf-top .nf-bubble{flex:none;width:100%;margin:0;padding:8px 30px 8px 10px;border-radius:14px;font-size:16px}
  .shelf-top .nf-bubble.silent{padding-right:10px}
  .shelf-top .nf-bubble:after{left:46%;bottom:auto;top:-9px;transform:rotate(135deg)}
  .shelf-top .nf-bubble .hear{width:20px;height:20px;right:6px}
  .tiles{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:10px;padding:4px 0}
  .tiles-rule{display:none}
  .tile{min-height:72px;font-size:15px;gap:2px;border-radius:16px}
  .tile svg{width:40px;height:40px}
  .tile.folder{gap:4px}
  .peek{width:68px;height:52px;padding:5px;gap:5px}
  .tile .peek-cell svg{width:21px;height:21px}
  .shelf-foot{grid-column:1/-1;min-height:56px;padding:2px 4px calc(6px + env(safe-area-inset-bottom))}
}
@media (min-width:760px) and (min-height:521px){
  .shelf{padding:16px 24px 0}
  .shelf-top{justify-content:center}
  .shelf-top .nook-btn{width:160px;height:192px}
  .shelf-top .nf-bubble{flex:0 1 420px;order:0;margin:0 0 30px;text-align:left;font-size:22px}
  .shelf-top .nf-bubble:after{left:-9px;bottom:14px;top:auto;transform:rotate(45deg)}
  /* three columns; rows no taller than the tiles, centred together (phase 8: an upright iPad left a band between the
     rows); the Grown-ups button sits in the corner beside Paint and Blocks, so the tiles keep the height */
  .tiles{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,190px)) auto minmax(0,190px);gap:18px}
  .tile{min-height:118px;max-height:190px;font-size:21px}
  .tile svg{width:76px;height:76px}
  .peek{width:110px;height:84px;padding:7px;gap:7px}
  .tile .peek-cell svg{width:34px;height:34px}
  .shelf-foot{position:absolute;right:24px;bottom:0}
}

/* ---- the Grown-ups sheet (inside shared.js's dialog) ---- */
.gu-list{display:flex;flex-direction:column;gap:8px;margin:16px 0}
/* the game's own section (phase 7): its name, the level now, and Levels and puzzles (every difficulty and content choice) */
.gu-game{margin:4px 0 12px;padding:12px 14px;border:2px solid #d8d0a8;border-radius:16px;background:#fff8e4}
.lp-dialog .gu-game h3{margin:0 0 4px;font-size:19px;line-height:1.25}
.lp-dialog .gu-now{display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px;margin:0 0 10px;font-size:15px;font-weight:bold;line-height:1.4}
.gu-now-art{display:inline-flex;align-items:center;gap:3px;flex:none}
.gu-now svg{display:block;width:30px;height:30px;overflow:visible}
.lp-dialog #gu-levels{width:100%;background:#fff1b5;border-color:#dcc05a;color:#5a4a12}

/* ---- a game's sub-menu (phase 9): a second screen of the shelf, in its look. The back arrow sits top-left exactly
   where the play screens' link to all games sits (the bar copies the frame's top bar at every breakpoint), with the
   game's icon and name beside it; Nook asks the game's question (hidden on a phone held sideways); then the activity
   tiles, a picture and one word each, at least 120 px tall, pressed like the shelf's tiles, the last one marked like
   the shelf's current tile; directly under them the level tiles, a picture and a short label each, the current one
   marked, wrapping so none is ever scrolled off. ---- */
.shelf-bar{position:fixed;left:0;right:0;top:0;z-index:1}
.shelf-bar[hidden]{display:none}
.shelf-bar-in{max-width:1000px;height:56px;margin:0 auto;padding:6px 10px;display:flex;align-items:center;gap:10px;min-width:0}
.nf-back{color:#4d3b73}
.menu-name{margin:0;display:flex;align-items:center;gap:8px;min-width:0;font-size:21px;font-weight:900;line-height:1.1;color:#3d2f5e;white-space:nowrap}
.menu-name-art{display:flex;flex:none}
.menu-name-art svg{display:block;width:36px;height:36px}
.shelf.in-menu{padding-top:60px}
.submenu{display:flex;flex-direction:column;gap:16px;min-height:0;min-width:0;padding:4px 0 10px}
.menu-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(120px,auto);gap:12px}
.tile.menu-tile{min-height:120px;max-height:none;gap:8px;padding:10px 8px;font-size:19px;line-height:1.15;letter-spacing:.2px;animation:lp-rise 220ms var(--lp-out) backwards}
.menu-art{display:flex;align-items:center;justify-content:center;gap:4px;height:min(130px,15vh);min-height:60px;max-width:100%;pointer-events:none}
.has-levels .menu-art{height:min(116px,13vh)}
.tile .menu-art svg{display:block;width:auto;height:100%;max-width:100%;flex:none}
.tile span.menu-word{display:block;max-width:100%;white-space:normal;overflow-wrap:break-word;text-align:center}
.menu-art .mini{display:flex;align-items:center;gap:5px;font-size:20px;font-weight:900;line-height:1;color:#3f4a5c;white-space:nowrap}
.menu-art .mini i{font-style:normal}
.menu-art .mini .mw.arrow{color:#6d7a73;font-size:18px}
.menu-art .mini .mgap{width:36px;height:28px;border:3px dashed #7e9a78;border-radius:8px;background:#fff}
.menu-art .mini .mgap.small{width:20px}
.menu-art .mini .mchip{padding:4px 5px;border:2px solid #d8c17a;border-radius:7px;background:#fff1c4;font-size:13px;color:#594777}
.menu-art .mini .mchip:nth-child(2){transform:translateY(-5px) rotate(-5deg)}
.menu-art .mini .mchip:nth-child(3){transform:translateY(3px) rotate(4deg)}
.menu-art .menu-scene{border-radius:12px}
/* the level tiles: three to a row on a phone, about 120 by 80; the current one lilac, as a chosen chip was */
.levels-row{display:flex;flex-wrap:wrap;justify-content:center;gap:10px}
.lvl{flex:0 0 calc((100% - 20px) / 3);min-width:0;min-height:80px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:8px 6px;border-radius:16px;background:#fffdf3;border:2px solid #d8d0a8;box-shadow:0 3px 0 #d8d0a8;color:#5a5236;font-weight:900;transition:transform 140ms var(--lp-out),box-shadow 140ms var(--lp-out);animation:lp-rise 220ms var(--lp-out) backwards}
.lvl:active{transform:translateY(2px);box-shadow:0 1px 0 #d8d0a8;transition-duration:70ms}
.lvl[aria-current=true]{background:var(--lilac);border-color:#7862a4;color:#4d3b73;box-shadow:inset 0 0 0 1px #7862a4,0 3px 0 #7862a4}
.lvl-art{display:flex;align-items:center;justify-content:center;height:30px;max-width:100%;pointer-events:none}
.lvl-art svg{display:block;width:auto;height:100%;max-width:100%}
.lvl-word{max-width:100%;font-size:14px;line-height:1.15;text-align:center;white-space:nowrap}
/* Count has levels only: bigger level tiles */
.submenu.only-levels .lvl{min-height:128px;gap:10px}
.submenu.only-levels .lvl-art{height:50px}
.submenu.only-levels .lvl-word{font-size:17px}
@media (max-width:389px){.shelf-bar-in{gap:8px;padding:6px 8px}.menu-tiles{gap:10px}.tile.menu-tile{padding:10px 4px;font-size:18px}.levels-row{gap:8px}.lvl{flex-basis:calc((100% - 16px) / 3)}.lvl-word{font-size:13px}}
/* a phone held sideways: Nook and the question make room; one row of activities, the levels wrapped under them */
@media (orientation:landscape) and (max-height:520px){
  .shelf-bar-in{max-width:none;height:52px;padding:4px 8px}
  .menu-name{font-size:19px}.menu-name-art svg{width:32px;height:32px}
  .shelf.in-menu{grid-template-columns:minmax(0,1fr);padding-top:54px}
  .shelf.in-menu .shelf-top{display:none}
  .submenu{gap:10px;padding:2px 0 4px}
  .menu-tiles{gap:12px}
  .menu-tiles.n4{grid-template-columns:repeat(4,minmax(0,1fr))}
  .menu-tiles.n2{width:min(100%,560px);align-self:center}
  .tile.menu-tile{font-size:17px;gap:6px;border-radius:16px;padding:8px 6px}
  .menu-art,.has-levels .menu-art{height:min(84px,22vh);min-height:0}
  .submenu:not(.has-levels) .menu-art{height:min(130px,36vh)}
  .menu-art .mini{font-size:17px;gap:3px}.menu-art .mini .mgap{width:28px;height:24px}.menu-art .mini .mgap.small{width:16px}.menu-art .mini .mchip{padding:3px 4px;font-size:11px}
  .lvl{flex:1 1 96px;max-width:132px;min-height:66px;gap:4px;padding:6px}
  .lvl-art{height:26px}
  .lvl-word{font-size:13px}
  .submenu.only-levels{justify-content:center}
  .submenu.only-levels .lvl{flex-basis:200px;min-height:92px}
  .submenu.only-levels .lvl-art{height:36px}
}
/* tablets: two centred columns of activities, the levels in a row under them */
@media (min-width:760px) and (min-height:521px){
  .shelf-bar-in{height:64px;padding:8px 20px}
  .menu-name{font-size:24px}.menu-name-art svg{width:40px;height:40px}
  .shelf.in-menu{padding-top:72px}
  .submenu{width:100%;max-width:760px;justify-self:center;gap:20px}
  .menu-tiles{grid-auto-rows:minmax(150px,auto);gap:18px}
  .tile.menu-tile{font-size:21px;gap:10px}
  .menu-art{height:min(120px,14vh);min-height:72px}
  .has-levels .menu-art{height:min(104px,12vh)}
  .menu-art .mini{font-size:24px}
  .levels-row{gap:12px}
  .lvl{flex:0 0 calc((100% - 60px) / 6);min-height:92px}
  .lvl-art{height:34px}
  .lvl-word{font-size:15px}
  .submenu.only-levels .lvl{flex-basis:calc((100% - 24px) / 3);min-height:136px}
  .submenu.only-levels .lvl-art{height:56px}
  .submenu.only-levels .lvl-word{font-size:19px}
}
/* an iPad held upright and tall windows: bigger pictures, the room is there (Nook stays where it stands on the shelf) */
@media (min-width:760px) and (min-height:521px) and (orientation:portrait){
  .menu-art{height:min(150px,15vh)}
  .has-levels .menu-art{height:min(130px,13vh)}
  .lvl{min-height:108px}
  .lvl-art{height:42px}
  .lvl-word{font-size:16px}
  .submenu.only-levels .lvl{min-height:170px}
  .submenu.only-levels .lvl-art{height:70px}
}
.gu-list button{text-align:left}
.gu-list a{min-height:48px;display:flex;align-items:center;padding:10px 16px;border:1px solid #a6bba0;border-radius:12px;background:#fff;color:inherit;font-weight:700;text-decoration:none}

/* ---- Softer and reduced motion: no travel, no wiggle; short fades only ---- */
.softer .nook-wiggle,.softer .lp-modal.lp-rise .lp-dialog{animation:none}
.softer .tile.menu-tile,.softer .lvl{animation:lp-fade-in 150ms linear backwards}
.softer .tile,.softer .lvl,.softer .answer,.softer .nf-actions>button{transition:opacity 120ms linear}
.softer .tile:active,.softer .lvl:active,.softer .nf-shelf:active,.softer .answer:active,.softer .nf-actions>button:active{transform:none}
@media (prefers-reduced-motion:reduce){
  .nook-wiggle,.lp-modal.lp-rise .lp-dialog{animation:none}
  .tile.menu-tile,.lvl{animation:lp-fade-in 150ms linear backwards}
  .tile,.lvl,.answer,.nf-actions>button{transition:opacity 120ms linear}
  .tile:active,.lvl:active,.nf-shelf:active,.answer:active,.nf-actions>button:active{transform:none}
}
/* ---- Nook's small pay-offs in the games (round 4, item 33): on success only, each under a second ----
   .nook-munch   Take away: the mouth opens and closes three times (frame.js swaps it), with a 2 px chew
   .nook-prop    Shapes: the solved shape beside the raised mitten, one 8 px hop, then gone (900 ms)
   .bubble-prop  Patterns: the finished bead string just under the bubble, fading in and out (950 ms)
   Softer and reduced motion: no chew and no hop; the shape and the beads only fade. */
.nook-munch{animation:lp-munch 840ms linear}
@keyframes lp-munch{0%,33%,67%,100%{transform:none}17%,50%,83%{transform:translateY(2px)}}
.nook-prop{position:absolute;right:-14%;top:4%;width:42%;height:35%;pointer-events:none;transform-origin:50% 100%;animation:lp-prop-hop 900ms both}
.nook-prop svg{display:block;width:100%;height:100%;overflow:visible}
@keyframes lp-prop-hop{0%{opacity:0;transform:none}12%{opacity:1;transform:none;animation-timing-function:cubic-bezier(.2,.7,.3,1)}40%{transform:translateY(-8px);animation-timing-function:cubic-bezier(.4,0,1,1)}64%{transform:none}86%{opacity:1}100%{opacity:0;transform:none}}
@keyframes lp-prop-fade{0%{opacity:0}15%{opacity:1}85%{opacity:1}100%{opacity:0}}
.bubble-prop{position:absolute;left:14px;top:calc(100% + 5px);display:flex;align-items:center;gap:4px;pointer-events:none;animation:lp-prop-fade 950ms linear both}
.softer .nook-munch{animation:none}
.softer .nook-prop{animation-name:lp-prop-fade}
@media (prefers-reduced-motion:reduce){.nook-munch{animation:none}.nook-prop{animation-name:lp-prop-fade}}

/* ---- a short landscape phone (phase 9c, Jof's S24: Chrome's address bar and the Android gesture bar leave about
   340 px or less). frame.js adds lp-short below 350 px of visible height; the card's paddings and the answer row
   tighten so the last row stays on screen. If it still does not fit, the task card scrolls inside the frame. ---- */
.lp-short .nf{padding-bottom:4px}
.lp-short .nf.garden .nf-task{border-width:2px;border-radius:16px}
.lp-short .nf.garden .nf-task>.task{padding:3px 6px;gap:3px}
.lp-short .answers{min-height:64px;gap:8px}
.lp-short .answer{min-height:64px;font-size:30px;border-bottom-width:5px}
.lp-short .nf-actions{padding-bottom:6px}
.lp-short .nf-actions>button{min-height:52px}
