/* Look "blocks": the original toy-brick UI, exactly as it was before the look switch.
   Every rule is scoped to html[data-style="blocks"] (generated from the old styles.css by prefixing
   each selector); edit it like any stylesheet. */
/* Vibe Story: warm, blocky toy look. Mobile-first (390 px portrait), tap targets >= 64 px. */
html[data-style="blocks"]{
  --cream:#fff7e8; --paper:#ffffff; --ink:#2b2d42; --ink-soft:#5c5f7a; --line:#eadfc8;
  --red:#e63946; --red-d:#a8232f; --yellow:#fcbf49; --yellow-d:#c98a12; --blue:#1982c4; --blue-d:#0e5a8a;
  --green:#6fb51e; --green-d:#4a7d10; --pink:#ff85a1; --purple:#6a4c93; --ghost-d:#dccdb0;
  --radius:24px; --tap:64px;
  --safe-t:env(safe-area-inset-top,0px); --safe-b:env(safe-area-inset-bottom,0px);
  --safe-l:env(safe-area-inset-left,0px); --safe-r:env(safe-area-inset-right,0px);
  color-scheme:light;
}
html[data-style="blocks"] *{box-sizing:border-box}
html[data-style="blocks"],html[data-style="blocks"] body{margin:0;height:100%;overflow:hidden}
html[data-style="blocks"] body{
  background-color:var(--cream);
  background-image:radial-gradient(circle at 12px 12px, rgba(252,191,73,.22) 5px, transparent 6px);
  background-size:24px 24px;
  color:var(--ink);font-family:Fredoka,"Baloo 2",ui-rounded,system-ui,sans-serif;font-size:18px;line-height:1.35;
  -webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:100%;
}
html[data-style="blocks"] button,html[data-style="blocks"] input,html[data-style="blocks"] textarea{font:inherit;color:inherit}
html[data-style="blocks"] [hidden]{display:none !important}

html[data-style="blocks"] #game-canvas{position:fixed;inset:0;width:100%;height:100%;display:block;touch-action:none}

/* ---------- screens ---------- */
html[data-style="blocks"] .screen{
  position:fixed;inset:0;height:100vh;height:100dvh;overflow-x:hidden;overflow-y:auto;
  display:flex;flex-direction:column;align-items:center;
  padding:calc(var(--safe-t) + 16px) calc(var(--safe-r) + 16px) calc(var(--safe-b) + 16px) calc(var(--safe-l) + 16px);
}
html[data-style="blocks"] .screen--overlay{justify-content:flex-start;background:linear-gradient(to top, rgba(43,45,66,.28), transparent 60%)}
html[data-style="blocks"] .screen--overlay > .card{margin-top:auto;flex:none}      /* a bottom sheet that still scrolls when taller than the screen */
@media (min-aspect-ratio: 4/3){ html[data-style="blocks"] .screen--overlay{align-items:flex-end;padding-right:calc(var(--safe-r) + 5vw)} html[data-style="blocks"] .screen--overlay > .card{margin-bottom:auto} }
html[data-style="blocks"] .stack{display:flex;flex-direction:column;gap:14px;width:100%}
html[data-style="blocks"] .row{display:flex;gap:12px;align-items:center;width:100%}
html[data-style="blocks"] .grow{flex:1}

/* ---------- brick buttons (ported from our earlier ship prototype) ---------- */
html[data-style="blocks"] .btn{
  --c:var(--red);--cd:var(--red-d);--fg:#fff;
  position:relative;min-height:var(--tap);padding:10px 26px 8px;border:0;border-radius:18px;cursor:pointer;
  background:var(--c);color:var(--fg);box-shadow:0 6px 0 var(--cd);
  font-size:22px;font-weight:600;letter-spacing:.01em;line-height:1.1;
  display:inline-flex;align-items:center;justify-content:center;gap:10px;text-align:center;
  transition:transform .08s, box-shadow .08s, filter .15s;margin-top:6px;touch-action:manipulation;
}
html[data-style="blocks"] .btn::before{ /* two studs on top */
  content:"";position:absolute;top:-6px;left:50%;width:58px;height:8px;transform:translateX(-50%);
  background:radial-gradient(ellipse 11px 6px at 13px 8px, var(--c) 10px, transparent 11px),radial-gradient(ellipse 11px 6px at 45px 8px, var(--c) 10px, transparent 11px);
  filter:brightness(1.06);
}
html[data-style="blocks"] .btn:hover{filter:brightness(1.05)}
html[data-style="blocks"] .btn:active{transform:translateY(4px);box-shadow:0 2px 0 var(--cd)}
html[data-style="blocks"] .btn:focus-visible{outline:4px solid var(--blue);outline-offset:5px}
html[data-style="blocks"] .btn--xl{min-height:76px;font-size:28px;font-weight:700;border-radius:22px}
html[data-style="blocks"] .btn--red{--c:var(--red);--cd:var(--red-d)}
html[data-style="blocks"] .btn--green{--c:var(--green);--cd:var(--green-d)}
html[data-style="blocks"] .btn--blue{--c:var(--blue);--cd:var(--blue-d)}
html[data-style="blocks"] .btn--yellow{--c:var(--yellow);--cd:var(--yellow-d);--fg:var(--ink)}
html[data-style="blocks"] .btn--ghost{--c:var(--paper);--cd:var(--ghost-d);--fg:var(--ink)}
html[data-style="blocks"] .btn--icon{width:var(--tap);min-width:var(--tap);padding:0;font-size:28px}
html[data-style="blocks"] .btn--icon::before{width:36px}
html[data-style="blocks"] .btn[disabled]{opacity:.45;pointer-events:none}

/* ---------- start ---------- */
html[data-style="blocks"] .screen--start{justify-content:space-between;
  background:radial-gradient(120% 70% at 50% 0%, #9bf6ff 0%, rgba(155,246,255,0) 60%), radial-gradient(90% 50% at 50% 110%, #caffbf 0%, rgba(202,255,191,0) 70%)}
html[data-style="blocks"] .start-body{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;width:min(640px,100%)}
html[data-style="blocks"] .start-body .stack{width:min(440px,100%)}
@media (max-height:520px){ html[data-style="blocks"] .start-body{gap:10px} html[data-style="blocks"] .screen--start .grownup{margin-top:4px} html[data-style="blocks"] .screen--start .music-toggle{position:absolute;top:calc(var(--safe-t) + 10px);right:calc(var(--safe-r) + 12px)} }
html[data-style="blocks"] .logo{display:flex;flex-wrap:wrap;justify-content:center;gap:.22em .4em;margin:0 0 4px;font-size:clamp(30px,min(10.5vw,12vh),64px);font-size:clamp(30px,min(10.5vw,12dvh),64px);font-weight:700;line-height:1}
html[data-style="blocks"] .logo .word{display:flex;gap:.1em;white-space:nowrap}
html[data-style="blocks"] .logo .word span{display:inline-grid;place-items:center;min-width:1.05em;padding:.12em .1em .06em;border-radius:.18em;color:#fff;box-shadow:0 .09em 0 rgba(0,0,0,.22);transform:rotate(var(--r,0deg))}
html[data-style="blocks"] .tagline{margin:0;text-align:center;font-size:21px;color:var(--ink-soft);max-width:22ch}
html[data-style="blocks"] .grownup{margin:12px 0 0;font-size:15px;color:var(--ink-soft);text-align:center;max-width:36ch}
html[data-style="blocks"] .music-toggle{align-self:flex-end;min-height:56px;padding:6px 16px;border-radius:999px;border:2px solid var(--line);background:var(--paper);font-size:16px;font-weight:600;cursor:pointer}
html[data-style="blocks"] .music-toggle:focus-visible{outline:4px solid var(--blue);outline-offset:3px}

/* ---------- cards ---------- */
html[data-style="blocks"] .card{
  width:min(520px,100%);background:var(--paper);border-radius:var(--radius);padding:22px 20px 20px;
  box-shadow:0 8px 0 var(--ghost-d), 0 18px 40px rgba(43,45,66,.18);display:flex;flex-direction:column;gap:10px;
  animation:rise .35s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes rise{from{transform:translateY(30px);opacity:0}to{transform:none;opacity:1}}
html[data-style="blocks"] .card h2{margin:0;font-size:clamp(28px,8vw,38px);line-height:1.05;font-weight:700;text-wrap:balance}
html[data-style="blocks"] .eyebrow{font-size:14px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red)}
html[data-style="blocks"] .story-text{margin:0;font-size:21px;line-height:1.45}
html[data-style="blocks"] .goal{margin:0;font-size:18px;font-weight:600;color:var(--blue-d)}
html[data-style="blocks"] .keys{margin:0;font-size:15px;color:var(--ink-soft)}
html[data-style="blocks"] .score{margin:0;font-size:20px;font-weight:600}
html[data-style="blocks"] .note{display:flex;flex-direction:column;gap:4px;margin-top:6px;padding:12px 14px;border-radius:14px;background:#fff3d6;font-size:15px}

/* ---------- game HUD ---------- */
html[data-style="blocks"] .screen--game{padding:0;overflow:hidden;touch-action:none;-webkit-user-select:none;user-select:none}
html[data-style="blocks"] .hud{position:absolute;left:0;right:0;top:0;display:flex;align-items:center;gap:12px;
  padding:calc(var(--safe-t) + 12px) calc(var(--safe-r) + 14px) 0 calc(var(--safe-l) + 14px);z-index:3;pointer-events:none}
html[data-style="blocks"] .hud .btn{pointer-events:auto;margin-top:0}
html[data-style="blocks"] .timebar{flex:1;height:18px;border-radius:999px;background:rgba(255,255,255,.75);box-shadow:inset 0 0 0 3px rgba(43,45,66,.12);overflow:hidden}
html[data-style="blocks"] .timebar i{display:block;height:100%;background:linear-gradient(90deg,var(--yellow),#ffd98a);border-radius:999px;transform-origin:left center}
html[data-style="blocks"] .hud-right{display:flex;align-items:center}
html[data-style="blocks"] .hearts{display:flex;gap:1px;font-size:26px;line-height:1;background:rgba(255,255,255,.75);padding:8px 10px;border-radius:999px}
html[data-style="blocks"] .hearts .lost{opacity:.55}
html[data-style="blocks"] .count{display:flex;align-items:center;gap:6px;font-size:28px;background:rgba(255,255,255,.85);padding:6px 16px 4px 12px;border-radius:999px}
html[data-style="blocks"] .count b{font-weight:700;font-variant-numeric:tabular-nums}
@media (max-width:420px){ html[data-style="blocks"] .hearts{font-size:20px;padding:7px 8px} html[data-style="blocks"] .count{font-size:24px} }

html[data-style="blocks"] .zone{position:absolute;top:0;bottom:0;width:50%;display:flex;align-items:flex-end;justify-content:center;padding-bottom:calc(var(--safe-b) + 40px);pointer-events:none;opacity:0;transition:opacity .4s}
html[data-style="blocks"] .zone span{font-size:44px;color:#fff;background:rgba(43,45,66,.28);width:92px;height:92px;border-radius:50%;display:grid;place-items:center}
html[data-style="blocks"] .zone--left{left:0}html[data-style="blocks"] .zone--right{right:0}
html[data-style="blocks"] .zone.hint{opacity:1}
html[data-style="blocks"] .zone.on{opacity:1;background:linear-gradient(to top, rgba(255,255,255,.18), transparent 50%)}
html[data-style="blocks"] .zone.on span{background:rgba(43,45,66,.45)}

html[data-style="blocks"] .call{position:absolute;left:50%;top:calc(var(--safe-t) + 92px);transform:translateX(-50%);max-width:calc(100% - 32px);
  padding:10px 20px 8px;border-radius:999px;background:var(--paper);box-shadow:0 5px 0 var(--ghost-d);font-size:24px;font-weight:700;white-space:nowrap;pointer-events:none;z-index:2}
html[data-style="blocks"] .call.show{animation:pop-in .35s cubic-bezier(.2,1.6,.4,1)}
html[data-style="blocks"] .oops{position:absolute;left:50%;top:38%;transform:translate(-50%,-50%);font-size:clamp(46px,14vw,80px);font-weight:700;color:#fff;
  -webkit-text-stroke:3px var(--red);paint-order:stroke fill;text-shadow:0 6px 0 var(--red-d);pointer-events:none;z-index:2}
html[data-style="blocks"] .oops.show{animation:oops .9s ease-out both}
@keyframes pop-in{from{transform:translateX(-50%) scale(.6)}to{transform:translateX(-50%) scale(1)}}
@keyframes oops{0%{transform:translate(-50%,-50%) scale(.5) rotate(-8deg);opacity:0}20%{transform:translate(-50%,-50%) scale(1.1) rotate(4deg);opacity:1}100%{transform:translate(-50%,-80%) scale(1);opacity:0}}
html[data-style="blocks"] .pops span{position:absolute;transform:translate(-50%,-50%);font-size:34px;font-weight:700;color:#fff;-webkit-text-stroke:2px var(--green-d);paint-order:stroke fill;opacity:0;pointer-events:none}
html[data-style="blocks"] .pops span.show{animation:float-up .9s ease-out both}
@keyframes float-up{0%{opacity:0;transform:translate(-50%,-30%) scale(.6)}20%{opacity:1;transform:translate(-50%,-60%) scale(1.15)}100%{opacity:0;transform:translate(-50%,-180%) scale(1)}}

html[data-style="blocks"] .pause{position:absolute;inset:0;z-index:5;display:grid;place-items:center;padding:16px;background:rgba(43,45,66,.45)}
html[data-style="blocks"] .card--pause{align-items:stretch;text-align:center;max-width:380px}

html[data-style="blocks"] .noscript{padding:24px;font-size:20px}

/* ---------- short landscape phones: compact cards on the right, hero stays visible on the left ---------- */
@media (max-height:520px) and (min-aspect-ratio: 4/3){
  html[data-style="blocks"] .screen--overlay{justify-content:center;padding-top:calc(var(--safe-t) + 10px);padding-bottom:calc(var(--safe-b) + 10px)}
  html[data-style="blocks"] .card{width:min(430px,56%);padding:14px 16px 16px;gap:6px}
  html[data-style="blocks"] .card h2{font-size:24px}
  html[data-style="blocks"] .story-text{font-size:17px;line-height:1.35}
  html[data-style="blocks"] .goal{font-size:16px}html[data-style="blocks"] .keys{font-size:13px}
  html[data-style="blocks"] .btn{font-size:19px;min-height:var(--tap)}
  html[data-style="blocks"] .btn--xl{min-height:var(--tap);font-size:23px}
  html[data-style="blocks"] .card .stack{gap:10px}
  html[data-style="blocks"] .call{top:calc(var(--safe-t) + 80px);font-size:20px}
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce){
  html[data-style="blocks"] *,html[data-style="blocks"] *::before,html[data-style="blocks"] *::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}
  html[data-style="blocks"] .call.show,html[data-style="blocks"] .oops.show,html[data-style="blocks"] .pops span.show{animation:none}
  html[data-style="blocks"] .oops.show{opacity:1}
  html[data-style="blocks"] .pops span.show{opacity:1}
}

/* ================= CP2: hero choice, builder, photo, parent, making ================= */
html[data-style="blocks"] .topbar{display:flex;align-items:center;gap:14px;width:min(640px,100%);flex:none}
html[data-style="blocks"] .topbar .btn{margin-top:0}
html[data-style="blocks"] .topbar-title{margin:0;font-size:clamp(26px,7vw,34px);font-weight:700;line-height:1.1}
html[data-style="blocks"] .lead{margin:0;font-size:20px;line-height:1.4;text-align:center;max-width:30ch}

/* who is the hero */
html[data-style="blocks"] .screen--pick{background:radial-gradient(120% 60% at 50% 0%, #caffbf 0%, rgba(202,255,191,0) 60%)}
html[data-style="blocks"] .choices{flex:1;display:flex;flex-direction:column;justify-content:center;gap:22px;width:min(520px,100%);padding:18px 0}
html[data-style="blocks"] .choice{--c:var(--paper);--cd:var(--ghost-d);display:flex;align-items:center;gap:18px;min-height:112px;padding:14px 22px;border:0;border-radius:var(--radius);
  background:var(--c);box-shadow:0 7px 0 var(--cd);cursor:pointer;text-align:left;transition:transform .08s, box-shadow .08s}
html[data-style="blocks"] .choice:active{transform:translateY(5px);box-shadow:0 2px 0 var(--cd)}
html[data-style="blocks"] .choice:focus-visible{outline:4px solid var(--blue);outline-offset:5px}
html[data-style="blocks"] .choice--build{--c:#ffe0e3;--cd:#f0a8b0}html[data-style="blocks"] .choice--photo{--c:#dff1ff;--cd:#9cc9ea}html[data-style="blocks"] .choice--surprise{--c:#fff1c9;--cd:#e8c66f}
html[data-style="blocks"] .choice-art{font-size:54px;line-height:1;flex:none;width:72px;text-align:center}
html[data-style="blocks"] .choice-text{display:flex;flex-direction:column;gap:2px}
html[data-style="blocks"] .choice-text b{font-size:27px;font-weight:700}
html[data-style="blocks"] .choice-text small{font-size:17px;color:var(--ink-soft)}
@media (min-aspect-ratio: 4/3) and (min-width:700px){ html[data-style="blocks"] .choices{flex-direction:row;width:min(900px,100%)} html[data-style="blocks"] .choice{flex:1;flex-direction:column;text-align:center;justify-content:center;min-height:220px} html[data-style="blocks"] .choice-art{font-size:72px;width:auto} }

/* builder */
html[data-style="blocks"] .screen--builder{gap:8px;padding-bottom:0}
html[data-style="blocks"] .progress{flex:1;display:flex;flex-direction:column;gap:4px}
html[data-style="blocks"] .dots{display:flex;gap:6px}
html[data-style="blocks"] .dots i{flex:1;height:10px;border-radius:999px;background:var(--line)}
html[data-style="blocks"] .dots i.done{background:var(--green)}
html[data-style="blocks"] .dots i.now{background:var(--yellow)}
html[data-style="blocks"] .step-label{font-size:14px;color:var(--ink-soft);font-weight:500}
html[data-style="blocks"] .preview{position:relative;flex:none;width:min(420px,100%);height:clamp(150px,27dvh,280px);border-radius:var(--radius);
  background:radial-gradient(circle at 50% 70%, #ffffff 0%, #eaf8ff 70%);box-shadow:inset 0 0 0 3px rgba(255,255,255,.8), 0 5px 0 var(--line)}
html[data-style="blocks"] .preview-canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
html[data-style="blocks"] .b-title{margin:4px 0 2px;font-size:clamp(24px,6.6vw,32px);font-weight:700;text-align:center}
html[data-style="blocks"] .options{flex:1;min-height:0;width:min(560px,100%);display:grid;gap:10px;align-content:start;overflow-y:auto;padding:10px 4px 14px}
html[data-style="blocks"] .grid--4{grid-template-columns:repeat(4,1fr)}
html[data-style="blocks"] .grid--2{grid-template-columns:repeat(2,1fr)}
html[data-style="blocks"] .grid--colors{grid-template-columns:repeat(4,1fr);justify-items:center}
html[data-style="blocks"] .tile{position:relative;min-height:84px;padding:8px 4px 6px;border:3px solid transparent;border-radius:18px;background:var(--paper);box-shadow:0 4px 0 var(--line);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;cursor:pointer;touch-action:manipulation}
html[data-style="blocks"] .tile-icon{font-size:36px;line-height:1}
html[data-style="blocks"] .tile-label{font-size:15px;font-weight:600;line-height:1.1;text-align:center}
html[data-style="blocks"] .grid--2 .tile{min-height:104px}html[data-style="blocks"] .grid--2 .tile-icon{font-size:48px}html[data-style="blocks"] .grid--2 .tile-label{font-size:19px}
html[data-style="blocks"] .tile[aria-checked="true"]{border-color:var(--green);background:#f2ffe3;box-shadow:0 4px 0 var(--green-d)}
html[data-style="blocks"] .tile[aria-checked="true"]::after,html[data-style="blocks"] .swatch[aria-checked="true"]::after{content:"✓";position:absolute;top:-8px;right:-8px;width:28px;height:28px;border-radius:50%;background:var(--green);color:#fff;font-size:17px;font-weight:700;display:grid;place-items:center;box-shadow:0 2px 0 var(--green-d)}
html[data-style="blocks"] .tile:focus-visible,html[data-style="blocks"] .swatch:focus-visible,html[data-style="blocks"] .chip:focus-visible,html[data-style="blocks"] .theme:focus-visible{outline:4px solid var(--blue);outline-offset:3px}
html[data-style="blocks"] .swatch{position:relative;width:100%;max-width:84px;aspect-ratio:1;min-height:64px;border-radius:20px;border:4px solid #fff;background:var(--sw);box-shadow:0 4px 0 rgba(43,45,66,.18);cursor:pointer;touch-action:manipulation}
html[data-style="blocks"] .swatch--light{border-color:var(--line)}
html[data-style="blocks"] .swatch[aria-checked="true"]{transform:scale(1.06);border-color:var(--ink)}
html[data-style="blocks"] .bottombar{position:sticky;bottom:0;display:flex;gap:12px;width:min(560px,100%);padding:12px 0 calc(var(--safe-b) + 14px);background:linear-gradient(to top, var(--cream) 75%, rgba(255,247,232,0))}
html[data-style="blocks"] .bottombar .btn{margin-top:0}
@media (min-aspect-ratio: 4/3) and (max-height:600px){
  html[data-style="blocks"] .screen--builder{display:grid;grid-template-columns:minmax(200px,38%) 1fr;grid-template-rows:auto auto 1fr auto;column-gap:18px;align-items:start;justify-items:center}
  html[data-style="blocks"] .screen--builder .topbar{grid-column:1/-1}
  html[data-style="blocks"] .screen--builder .preview{grid-column:1;grid-row:2/5;height:100%;min-height:160px}
  html[data-style="blocks"] .screen--builder .b-title{grid-column:2;margin:0}
  html[data-style="blocks"] .screen--builder .options{grid-column:2;grid-row:3;padding-top:12px}
  html[data-style="blocks"] .screen--builder .bottombar{grid-column:2;grid-row:4}
  html[data-style="blocks"] .grid--4,html[data-style="blocks"] .grid--colors{grid-template-columns:repeat(6,1fr)}
  html[data-style="blocks"] .grid--2{grid-template-columns:repeat(4,1fr)}
}

/* photo */
html[data-style="blocks"] .screen--photo{justify-content:space-between}
html[data-style="blocks"] .photo-body{flex:1;display:flex;align-items:center;justify-content:center;width:min(480px,100%)}
html[data-style="blocks"] .photo-state{display:flex;flex-direction:column;align-items:center;gap:16px;width:100%}
html[data-style="blocks"] .photo-state .btn{width:100%}
html[data-style="blocks"] .photo-art{font-size:96px;line-height:1;position:relative}
html[data-style="blocks"] .photo-art span{position:absolute;right:-34px;bottom:-6px;font-size:52px}
html[data-style="blocks"] .preview--photo{height:clamp(170px,32dvh,300px)}
html[data-style="blocks"] .stub-note{margin:0;font-size:14px;color:var(--ink-soft);text-align:center;background:#fff3d6;padding:8px 12px;border-radius:12px}
html[data-style="blocks"] .blocks{display:flex;gap:10px;height:90px;align-items:flex-end}
html[data-style="blocks"] .blocks i{width:44px;height:44px;border-radius:10px;background:var(--red);box-shadow:0 5px 0 var(--red-d);animation:hop .9s ease-in-out infinite}
html[data-style="blocks"] .blocks i:nth-child(2){background:var(--yellow);box-shadow:0 5px 0 var(--yellow-d);animation-delay:.15s}
html[data-style="blocks"] .blocks i:nth-child(3){background:var(--blue);box-shadow:0 5px 0 var(--blue-d);animation-delay:.3s}
@keyframes hop{0%,100%{transform:translateY(0)}50%{transform:translateY(-34px)}}

/* parent form */
html[data-style="blocks"] .screen--form{gap:10px}
html[data-style="blocks"] .form{display:flex;flex-direction:column;gap:16px;width:min(560px,100%);padding:6px 0 calc(var(--safe-b) + 12px)}
html[data-style="blocks"] .hero-row{display:flex;align-items:center;justify-content:center;gap:14px}
html[data-style="blocks"] .preview--mini{width:150px;height:150px;flex:none}
html[data-style="blocks"] .form .lead{align-self:center}
html[data-style="blocks"] .field{display:flex;flex-direction:column;gap:6px;border:0;margin:0;padding:0;min-width:0}
html[data-style="blocks"] .field > span,html[data-style="blocks"] .field legend{font-size:18px;font-weight:600;padding:0;margin-bottom:6px}
html[data-style="blocks"] .field small{font-size:14px;color:var(--ink-soft)}
html[data-style="blocks"] .field input,html[data-style="blocks"] .field textarea{width:100%;min-height:var(--tap);padding:14px 16px;border:3px solid var(--line);border-radius:18px;background:var(--paper);font-size:20px;resize:vertical}
html[data-style="blocks"] .field textarea{min-height:104px;line-height:1.35}
html[data-style="blocks"] .field input:focus,html[data-style="blocks"] .field textarea:focus{outline:none;border-color:var(--blue)}
html[data-style="blocks"] .chips{display:flex;flex-wrap:wrap;gap:10px}
html[data-style="blocks"] .chip{min-height:var(--tap);padding:8px 18px;border-radius:999px;border:3px solid var(--line);background:var(--paper);font-size:18px;font-weight:600;cursor:pointer}
html[data-style="blocks"] .chip[aria-pressed="true"]{background:var(--yellow);border-color:var(--yellow-d)}
html[data-style="blocks"] .themes{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}
html[data-style="blocks"] .theme{min-height:68px;padding:6px 2px;border-radius:16px;border:3px solid var(--line);background:var(--paper);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;cursor:pointer;font-size:12.5px;font-weight:600}
html[data-style="blocks"] .theme b{font-size:26px;font-weight:400;line-height:1}
html[data-style="blocks"] .theme[aria-checked="true"]{border-color:var(--green);background:#f2ffe3}
@media (max-width:360px){ html[data-style="blocks"] .themes{grid-template-columns:repeat(4,1fr)} }

/* making */
html[data-style="blocks"] .screen--making{justify-content:center;gap:14px;text-align:center;background:radial-gradient(90% 60% at 50% 40%, #fff1c9 0%, rgba(255,241,201,0) 70%)}
html[data-style="blocks"] .screen--making h2{margin:0;font-size:clamp(30px,8vw,42px)}
html[data-style="blocks"] .preview--making{width:min(320px,80vw);height:min(320px,40dvh);background:none;box-shadow:none}
html[data-style="blocks"] #parent-go{position:sticky;bottom:calc(var(--safe-b) + 12px);z-index:2}

/* ================= modes: hand hint, key cursor, lab ================= */
/* hand hint: a finger that shows the gesture for the first seconds of a mode (left/top = the touch point) */
html[data-style="blocks"] .hand{position:absolute;left:50%;top:60%;z-index:4;pointer-events:none;width:0;height:0;animation:hand-in .3s ease-out both}
html[data-style="blocks"] .hand-finger{position:absolute;left:-14px;top:-6px;font-size:64px;line-height:1;filter:drop-shadow(0 4px 0 rgba(43,45,66,.25));transform-origin:30% 10%}
html[data-style="blocks"] .hand-ring{position:absolute;left:-34px;top:-34px;width:68px;height:68px;border-radius:50%;border:5px solid #fff;box-shadow:0 0 0 4px rgba(43,45,66,.18);opacity:0}
html[data-style="blocks"] .hand--tap .hand-finger{animation:hand-tap 1s ease-in-out infinite}
html[data-style="blocks"] .hand--tap .hand-ring{animation:ring-pop 1s ease-out infinite}
html[data-style="blocks"] .hand--hold .hand-finger{animation:hand-hold 2s ease-in-out infinite}
html[data-style="blocks"] .hand--hold .hand-ring{animation:ring-hold 2s ease-in-out infinite}
html[data-style="blocks"] .hand--drag .hand-finger,html[data-style="blocks"] .hand--drag .hand-ring{animation:hand-drag 1.8s ease-in-out infinite}
html[data-style="blocks"] .hand--drag .hand-ring{opacity:.8;transform:scale(.6)}
html[data-style="blocks"] .hand--steer .hand-finger,html[data-style="blocks"] .hand--steer .hand-ring{animation:hand-steer 2.4s steps(1,end) infinite}
html[data-style="blocks"] .hand--steer .hand-ring{opacity:.8}
html[data-style="blocks"] .hand.still .hand-finger,html[data-style="blocks"] .hand.still .hand-ring{animation:none}
html[data-style="blocks"] .hand.still .hand-ring{opacity:.8}
@keyframes hand-in{from{opacity:0}to{opacity:1}}
@keyframes hand-tap{0%,100%{transform:translateY(-14px) rotate(-8deg)}45%,60%{transform:translateY(8px) rotate(0)}}
@keyframes ring-pop{0%,40%{opacity:0;transform:scale(.4)}55%{opacity:1;transform:scale(.8)}100%{opacity:0;transform:scale(1.5)}}
@keyframes hand-hold{0%{transform:translateY(-14px)}15%,80%{transform:translateY(8px)}100%{transform:translateY(-14px)}}
@keyframes ring-hold{0%,15%{opacity:0;transform:scale(.4)}20%{opacity:1;transform:scale(.6)}80%{opacity:1;transform:scale(1.5)}100%{opacity:0;transform:scale(1.5)}}
@keyframes hand-drag{0%,12%{transform:translate(0,8px)}70%,85%{transform:translate(var(--dx),calc(var(--dy) + 8px))}100%{transform:translate(0,8px)}}
@keyframes hand-steer{0%{transform:translate(0,8px)}50%{transform:translate(var(--dx),8px)}}

/* keyboard cursor: ring around the highlighted tap target */
html[data-style="blocks"] .kcursor{position:absolute;left:0;top:0;z-index:3;pointer-events:none;border-radius:50%;border:5px solid #fff;box-shadow:0 0 0 4px var(--blue), 0 0 18px rgba(25,130,196,.6)}
@media (prefers-reduced-motion: no-preference){ html[data-style="blocks"] .kcursor{animation:kpulse 1.2s ease-in-out infinite} }
@keyframes kpulse{50%{box-shadow:0 0 0 7px var(--blue), 0 0 22px rgba(25,130,196,.7)}}

/* lab link on the start screen (only with ?lab=1 or ?debug=1) */
html[data-style="blocks"] .lab-link{margin-top:4px;min-height:48px;padding:6px 18px;border-radius:999px;border:2px dashed var(--ink-soft);background:rgba(255,255,255,.7);font-size:16px;font-weight:600;cursor:pointer}
html[data-style="blocks"] .lab-link:focus-visible{outline:4px solid var(--blue);outline-offset:3px}

/* lab screen */
html[data-style="blocks"] .screen--lab{gap:10px;background:radial-gradient(120% 50% at 50% 0%, #e6e0ff 0%, rgba(230,224,255,0) 60%)}
html[data-style="blocks"] .lab-head{display:flex;flex-direction:column;gap:2px;min-width:0}
html[data-style="blocks"] .lab-count{font-size:14px;color:var(--ink-soft);font-weight:500}
html[data-style="blocks"] .lab-sub{margin:0;width:min(900px,100%);font-size:15px;color:var(--ink-soft)}
html[data-style="blocks"] .lab-hero{display:flex;gap:10px;width:min(900px,100%)}
html[data-style="blocks"] .lab-hero .chip[aria-checked="true"]{background:var(--yellow);border-color:var(--yellow-d)}
html[data-style="blocks"] .lab-grid{width:min(900px,100%);display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;padding:6px 0 calc(var(--safe-b) + 18px)}
html[data-style="blocks"] .lab-card{position:relative;min-height:112px;padding:12px 10px 10px;border:0;border-radius:20px;background:var(--paper);box-shadow:0 5px 0 var(--line);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;cursor:pointer;text-align:center;touch-action:manipulation;transition:transform .08s, box-shadow .08s}
html[data-style="blocks"] .lab-card:active{transform:translateY(4px);box-shadow:0 1px 0 var(--line)}
html[data-style="blocks"] .lab-card:focus-visible{outline:4px solid var(--blue);outline-offset:3px}
html[data-style="blocks"] .lab-card b{font-size:19px;font-weight:700;line-height:1.1}
html[data-style="blocks"] .lab-card small{font-size:13px;color:var(--ink-soft)}
html[data-style="blocks"] .lab-icon{font-size:32px;line-height:1}
html[data-style="blocks"] .lab-card--ready{background:#f2ffe3;box-shadow:0 5px 0 #b9dd8f}
html[data-style="blocks"] .lab-card--soon,html[data-style="blocks"] .lab-card--unknown{opacity:.5;cursor:default;background:#f4f1ea;box-shadow:0 5px 0 #e2dccd}
html[data-style="blocks"] .lab-card--broken{opacity:.75;cursor:default;background:#ffe0e3;box-shadow:0 5px 0 #f0a8b0}
html[data-style="blocks"] .lab-card[disabled]{pointer-events:none}
@media (max-width:420px){ html[data-style="blocks"] .lab-grid{grid-template-columns:repeat(2,1fr);gap:10px} html[data-style="blocks"] .lab-card{min-height:104px} }

/* ================= AI: access code, toast, edit, invent, debug ================= */
html[data-style="blocks"] .making-msg{min-height:2.8em}

/* access code modal (for grown-ups) */
html[data-style="blocks"] .modal{position:fixed;inset:0;z-index:60;display:flex;flex-direction:column;align-items:center;overflow-y:auto;
  padding:calc(var(--safe-t) + 16px) calc(var(--safe-r) + 16px) calc(var(--safe-b) + 16px) calc(var(--safe-l) + 16px);background:rgba(43,45,66,.55)}
html[data-style="blocks"] .card--code{max-width:440px;margin:auto 0;flex:none}   /* margin:auto centers but still scrolls when taller than the screen */
@media (max-height:520px){ html[data-style="blocks"] .card--code{gap:6px} html[data-style="blocks"] .code-msg{font-size:15px} html[data-style="blocks"] .card--code .btn--xl{min-height:var(--tap)} }
html[data-style="blocks"] .card--code .btn{margin-top:4px}
html[data-style="blocks"] .code-msg{margin:0;font-size:18px;line-height:1.4}
html[data-style="blocks"] .code-msg--wrong{color:var(--red-d);font-weight:600}

/* toast: "Using our own idea" */
html[data-style="blocks"] .toast{position:fixed;left:50%;top:calc(var(--safe-t) + 14px);z-index:55;transform:translateX(-50%);max-width:calc(100% - 32px);
  padding:12px 20px;border-radius:999px;background:var(--ink);color:#fff;font-size:18px;font-weight:600;text-align:center;box-shadow:0 6px 20px rgba(43,45,66,.3);pointer-events:none}
html[data-style="blocks"] .toast.show{animation:toast-in .35s cubic-bezier(.2,1.4,.4,1) both}
@keyframes toast-in{from{transform:translate(-50%,-20px);opacity:0}to{transform:translateX(-50%);opacity:1}}

/* story card: edit result + grown-up note */
html[data-style="blocks"] .story-msg{margin:0;padding:10px 14px;border-radius:14px;background:#f2ffe3;color:var(--green-d);font-size:17px;font-weight:600}

/* change something */
html[data-style="blocks"] .card--edit .field input{font-size:20px}
html[data-style="blocks"] .chips--small{gap:8px}
html[data-style="blocks"] .chips--small .chip{min-height:48px;padding:6px 14px;font-size:16px}
html[data-style="blocks"] .edit-msg{margin:0;padding:10px 14px;border-radius:14px;background:#fff3d6;font-size:16px}
html[data-style="blocks"] .card--edit .row{margin-top:4px}
html[data-style="blocks"] .card--edit .row .btn{margin-top:0}

/* parent screen: the second, separate way */
html[data-style="blocks"] .invent-link{display:flex;flex-direction:column;align-items:center;gap:2px;width:100%;min-height:var(--tap);padding:12px 16px;border-radius:20px;
  border:3px dashed #b9a6e6;background:#f4f0ff;color:var(--purple);cursor:pointer;text-align:center}
html[data-style="blocks"] .invent-link b{font-size:20px;font-weight:700}
html[data-style="blocks"] .invent-link small{font-size:14px;color:var(--ink-soft)}
html[data-style="blocks"] .invent-link:focus-visible{outline:4px solid var(--blue);outline-offset:3px}

/* invent: idea + quick/best */
html[data-style="blocks"] .screen--invent{background:radial-gradient(120% 50% at 50% 0%, #efe8ff 0%, rgba(239,232,255,0) 60%)}
html[data-style="blocks"] .models{display:grid;grid-template-columns:1fr 1fr;gap:10px}
html[data-style="blocks"] .model{min-height:92px;padding:10px 8px;border-radius:18px;border:3px solid var(--line);background:var(--paper);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;cursor:pointer;text-align:center}
html[data-style="blocks"] .model b{font-size:21px;font-weight:700}
html[data-style="blocks"] .model small{font-size:14px;color:var(--ink-soft);line-height:1.2}
html[data-style="blocks"] .model[aria-checked="true"]{border-color:var(--purple);background:#f4f0ff;box-shadow:0 4px 0 #b9a6e6}
html[data-style="blocks"] .model:focus-visible{outline:4px solid var(--blue);outline-offset:3px}
html[data-style="blocks"] .screen--invent .grownup{align-self:center}

/* inventing: 2-5 minutes */
html[data-style="blocks"] .screen--inventing{justify-content:flex-start}
html[data-style="blocks"] .inv-state{display:flex;flex-direction:column;align-items:center;gap:12px;width:min(480px,100%);margin:auto 0;flex:none}
html[data-style="blocks"] .inv-state h2{margin:0;font-size:clamp(28px,7.5vw,40px);text-align:center}
html[data-style="blocks"] .inv-state .stack{width:100%}
html[data-style="blocks"] .inv-bar{width:100%;height:22px;border-radius:999px;background:rgba(255,255,255,.85);box-shadow:inset 0 0 0 3px rgba(43,45,66,.12);overflow:hidden}
html[data-style="blocks"] .inv-bar i{display:block;width:0;height:100%;border-radius:999px;transition:width .5s linear;
  background:repeating-linear-gradient(-45deg,#8f6fd1 0 14px,#a98be0 14px 28px);background-size:40px 40px;animation:stripes 1.2s linear infinite}
@keyframes stripes{to{background-position:40px 0}}
html[data-style="blocks"] .inv-time{margin:0;font-size:16px;color:var(--ink-soft);font-variant-numeric:tabular-nums}
html[data-style="blocks"] .screen--inventing .preview--making{height:min(260px,30dvh)}
@media (max-height:520px){ html[data-style="blocks"] .screen--inventing .preview--making{height:26dvh} html[data-style="blocks"] .inv-state{gap:6px} }

/* the invented game: sandboxed iframe, fullscreen */
html[data-style="blocks"] .screen--custom{padding:0;background:#000;overflow:hidden}
html[data-style="blocks"] .custom-frame,html[data-style="blocks"] .custom-iframe{position:absolute;inset:0;width:100%;height:100%;border:0;display:block;background:#fff}
html[data-style="blocks"] .custom-exit{position:absolute;z-index:3;top:calc(var(--safe-t) + 8px);right:calc(var(--safe-r) + 8px);width:48px;height:48px;border-radius:50%;
  border:3px solid #fff;background:rgba(43,45,66,.6);color:#fff;font-size:22px;font-weight:700;line-height:1;cursor:pointer}
html[data-style="blocks"] .custom-exit:focus-visible{outline:4px solid var(--yellow);outline-offset:2px}
html[data-style="blocks"] .custom-end{position:absolute;inset:0;z-index:4;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;
  padding:16px calc(var(--safe-r) + 16px) calc(var(--safe-b) + 16px) calc(var(--safe-l) + 16px);background:rgba(43,45,66,.35)}
@media (min-aspect-ratio: 4/3){ html[data-style="blocks"] .custom-end{justify-content:center} }

/* lab: AI toggles */
html[data-style="blocks"] .lab-ai{display:flex;flex-wrap:wrap;gap:10px;width:min(900px,100%)}
html[data-style="blocks"] .lab-ai .chip[aria-pressed="true"]{background:#f4f0ff;border-color:var(--purple);color:var(--purple)}
html[data-style="blocks"] .chip--invent{border-style:dashed;border-color:#b9a6e6;background:#f4f0ff;color:var(--purple)}

/* ?debug=1 cost panel */
html[data-style="blocks"] .debug-panel{position:fixed;left:50%;transform:translateX(-50%);bottom:var(--safe-b);z-index:70;width:max-content;max-width:min(560px,100%);max-height:45dvh;overflow:auto;
  background:rgba(20,22,36,.85);color:#e8e8f0;border-radius:10px 10px 0 0;font:11px/1.35 ui-monospace,Menlo,monospace}
html[data-style="blocks"] .debug-panel summary{padding:3px 10px;cursor:pointer;font-weight:700}
html[data-style="blocks"] .debug-panel ol{margin:0;padding:0 10px 8px 28px}
html[data-style="blocks"] .debug-panel li{margin-top:4px}
html[data-style="blocks"] .debug-panel li b{display:block;color:#fcbf49}

/* ================= added for the look switch (not in the original stylesheet) ================= */
/* this look shows the emoji pictures (.v-emoji), never the cut-paper drawings (.v-art) or ornaments (.deco) */
html[data-style="blocks"] .v-art,html[data-style="blocks"] .deco{display:none !important}
/* wrappers the Paper look needs; here they step aside so the layout is exactly the original one */
html[data-style="blocks"] .note-paper,html[data-style="blocks"] .making-stage,html[data-style="blocks"] .start-top,html[data-style="blocks"] .logo-blocks{display:contents}
html[data-style="blocks"] .field > .note-paper{font-size:inherit;font-weight:inherit}
/* the look switch: a white pill like the music toggle, one button per look */
html[data-style="blocks"] .look{display:inline-flex;align-items:center;gap:2px;padding:2px;border-radius:999px;border:2px solid var(--line);background:var(--paper)}
html[data-style="blocks"] .look-label{padding:0 4px 0 12px;font-size:15px;font-weight:600}
html[data-style="blocks"] .look-opt{min-width:var(--tap);min-height:var(--tap);padding:4px 8px;border:0;border-radius:999px;background:transparent;cursor:pointer;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;font-size:13px;font-weight:600;line-height:1.1;touch-action:manipulation}
html[data-style="blocks"] .look-opt .ic{width:24px;height:24px;display:block}
html[data-style="blocks"] .look-opt[aria-pressed="true"]{background:var(--yellow);box-shadow:0 3px 0 var(--yellow-d)}
html[data-style="blocks"] .look-opt:focus-visible{outline:4px solid var(--blue);outline-offset:2px}
html[data-style="blocks"] .screen--start .look{position:absolute;z-index:1;top:calc(var(--safe-t) + 16px);left:calc(var(--safe-l) + 16px)}
@media (max-height:520px){ html[data-style="blocks"] .screen--start .look{top:calc(var(--safe-t) + 10px);left:calc(var(--safe-l) + 12px)} }
html[data-style="blocks"] .look--mini{position:absolute;z-index:2;top:8px;right:8px}
html[data-style="blocks"] .card--pause .look{align-self:center}

/* ---- game proposal (story card): "Kind of game" chips + the "More..." picker ---- */
html[data-style="blocks"] .proposal{display:flex;flex-direction:column;gap:8px;margin:2px 0 4px}
html[data-style="blocks"] .proposal .chips{gap:8px}
html[data-style="blocks"] .proposal .chip{min-height:44px;padding:5px 12px;font-size:15px;border-width:2.5px}
html[data-style="blocks"] .chip--mode{display:inline-flex;align-items:center;gap:6px}
html[data-style="blocks"] .chip--more{border-style:dashed}
html[data-style="blocks"] .chip[aria-busy="true"]{cursor:progress;animation:bk-busy .9s ease-in-out infinite alternate}
@keyframes bk-busy{from{opacity:.55}to{opacity:1}}
html[data-style="blocks"] .proposal-status{margin:0;font-size:15px;font-weight:600;color:var(--ink-soft)}
html[data-style="blocks"] .card--modes .lab-grid{width:100%;padding:6px 2px 4px}
html[data-style="blocks"] .card--modes .lab-card{min-height:92px}
html[data-style="blocks"] .card--modes .lab-card[aria-pressed="true"]{box-shadow:0 5px 0 var(--green);outline:3px solid var(--green)}
@media (prefers-reduced-motion:reduce){ html[data-style="blocks"] .chip[aria-busy="true"]{animation:none;opacity:.6} }

/* ---- polish: quiet "Kind of game" label, text-only chips, home | Change | Play row, compact picker, shorter card on phones ---- */
html[data-style="blocks"] .kind-label{font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-soft)}
html[data-style="blocks"] .proposal{gap:6px;margin:0}
html[data-style="blocks"] .proposal .chips{gap:6px 8px}
html[data-style="blocks"] .proposal .chip{min-height:40px;padding:4px 12px;font-size:15px}
html[data-style="blocks"] .card .row .btn--small{flex:0 1 auto;min-height:var(--tap);padding:6px 12px;font-size:15px;line-height:1.1}
html[data-style="blocks"] .card--modes{gap:8px;padding-top:18px}
html[data-style="blocks"] .card--modes h2{font-size:26px}
html[data-style="blocks"] .card--modes .lab-grid{grid-template-columns:repeat(3,1fr);gap:8px;padding:2px}
html[data-style="blocks"] .card--modes .lab-card{min-height:52px;padding:6px 4px}
html[data-style="blocks"] .card--modes .lab-card b{font-size:15px;line-height:1.1}
@media (max-width:430px){
  html[data-style="blocks"] .card--story{padding:16px 16px 14px;gap:8px}
  html[data-style="blocks"] .card--story h2{font-size:27px}
  html[data-style="blocks"] .card--story .story-text{font-size:18px;line-height:1.35}
  html[data-style="blocks"] .card--story .goal{font-size:16px}
}
@media (max-width:430px) and (max-height:720px){ html[data-style="blocks"] .card--story .eyebrow{display:none} }

/* ---------- free first game: "Want to make another game?" + the small "I have a tester code" link ---------- */
html[data-style="blocks"] .screen--more .lead{max-width:32ch}
html[data-style="blocks"] .code-link{align-self:center;min-height:44px;padding:6px 12px;border:0;background:none;font:inherit;font-size:16px;font-weight:600;
  color:var(--blue-d);text-decoration:underline;text-underline-offset:4px;cursor:pointer}
html[data-style="blocks"] .code-link:focus-visible{outline:4px solid var(--blue);outline-offset:2px;border-radius:8px}
@media (max-height:720px){ html[data-style="blocks"] .screen--more .photo-art{font-size:72px} }
