/* =====================================================================
   BRICK STUDIO — compact icon-only UI (redo 2026-11-30)
   No words anywhere on screen. Refined 40-48px icons, tight spacing,
   small radii, soft glass. Engine hooks (ids/classes) all preserved.
   ===================================================================== */
:root{
  --ink:#33302e;
  --ink-soft:#6b625c;
  --accent:#ff6b4d;
  --accent-2:#ff9f1c;
  --sunny:#ffd23f;
  --leaf:#3fae5a;
  --sky:#2f9df0;
  --berry:#d94fd0;
  --glass:rgba(255,255,255,.94);
  --glass-strong:#ffffff;
  --stroke:rgba(255,255,255,.9);
  --shadow:0 10px 26px rgba(120,70,20,.16), 0 2px 6px rgba(120,70,20,.08);
  --tile:#fff7e8;
  --line:rgba(120,80,30,.14);
  --bg-a:#fff8e1; --bg-b:#ffe9c4; --bg-c:#cdeaff;
  --ring:rgba(255,140,40,.28);
  --ui-blur:blur(14px) saturate(1.2);
  --radius:16px;
  --gold:#f5a623;
}
body[data-theme="sunset"]{--bg-a:#fff2de;--bg-b:#ffd3b0;--bg-c:#ffc9a8;}
body[data-theme="snow"]{--bg-a:#ffffff;--bg-b:#e8f2ff;--bg-c:#cfe4ff;}
body[data-theme="night"]{--bg-a:#1b2440;--bg-b:#141b31;--bg-c:#0a0f22;--ink:#eef1f8;--ink-soft:#a9b2c6;--glass:rgba(38,48,80,.94);--glass-strong:#26305a;--tile:#2b3a66;--line:rgba(255,255,255,.14);--stroke:rgba(255,255,255,.16);}
body[data-theme="space"]{--bg-a:#1a2340;--bg-b:#101736;--bg-c:#05070f;--ink:#eef1f8;--ink-soft:#a9b2c6;--glass:rgba(38,48,80,.94);--glass-strong:#26305a;--tile:#2b3a66;--line:rgba(255,255,255,.14);--stroke:rgba(255,255,255,.16);}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;}
html,body{height:100%;}
body{
  margin:0;overflow:hidden;background:linear-gradient(180deg,var(--bg-a),var(--bg-b) 55%,var(--bg-c));
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Rounded","PingFang SC","Microsoft YaHei",sans-serif;
  color:var(--ink);user-select:none;-webkit-user-select:none;touch-action:none;
}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer;}
button:disabled{opacity:.38;cursor:default;}
svg{display:block;}
#stage{position:fixed;inset:0;}
#gl{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;}
#vignette{position:absolute;inset:0;pointer-events:none;background:radial-gradient(120% 90% at 50% 40%,transparent 60%,rgba(120,70,20,.10));}
#loaded{position:fixed;inset:0;background:linear-gradient(180deg,#fff8e1,#ffe9c4);display:flex;align-items:center;justify-content:center;z-index:60;transition:opacity .35s;}
#loaded.done{opacity:0;pointer-events:none;}
.loadStack{display:flex;gap:8px;}
.loadStack i{width:22px;height:22px;border-radius:6px;background:var(--accent);animation:lb 1s ease-in-out infinite;}
.loadStack i:nth-child(2){background:var(--sunny);animation-delay:.15s;}
.loadStack i:nth-child(3){background:var(--sky);animation-delay:.3s;}
@keyframes lb{0%,100%{transform:translateY(0)}50%{transform:translateY(-12px)}}

#ui{position:fixed;inset:0;pointer-events:none;z-index:20;}
#ui>*{pointer-events:auto;}
.glass{background:var(--glass);backdrop-filter:var(--ui-blur);-webkit-backdrop-filter:var(--ui-blur);border:1px solid var(--stroke);box-shadow:var(--shadow);}

/* ---------- icon base: thin outline icons ---------- */
.tbtn svg,.round svg,.hud-pill svg,.home-ic svg,.ibtn svg,.sheet-ic svg,.sheet-x svg,
.task-pic svg,.gbtn svg,.gcrown svg,.shop-stars svg,.badge-emoji svg,.hold-btn svg,
#dailyIcon svg,.onboard-x svg,.fbtn svg,.dtab svg,.toast svg,.pv-ic svg{
  width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;
}
.tbtn svg{width:21px;height:21px;}
.sheet-x svg{width:17px;height:17px;}
.ibtn svg{width:21px;height:21px;}
/* filled stars */
#starPill svg path,.task-star svg path,.shop-stars svg path,.celebrate-stars svg path,.celebrate-plus svg path{fill:currentColor;stroke:none;}
#starPill svg,.task-star svg,.shop-stars svg{width:18px;height:18px;}
#starPill,.task-star,.shop-stars{color:var(--gold);}
.celebrate-stars svg{width:44px;height:44px;color:var(--gold);}
.celebrate-plus svg{width:22px;height:22px;color:var(--gold);}

/* ---------- home HUD ---------- */
#homeHud{position:fixed;top:calc(10px + env(safe-area-inset-top));left:10px;right:10px;display:flex;justify-content:space-between;align-items:center;gap:8px;z-index:22;}
.hud-right{display:flex;gap:6px;align-items:center;}
.hud-pill{position:relative;height:36px;min-width:36px;padding:0 9px;border-radius:999px;background:var(--glass);backdrop-filter:var(--ui-blur);border:1px solid var(--stroke);box-shadow:var(--shadow);display:inline-flex;align-items:center;justify-content:center;gap:4px;font-size:15px;font-weight:800;color:var(--ink);}
.hud-pill svg{width:20px;height:20px;}
#dailyIcon{display:flex;}
#dailyIcon svg{width:20px;height:20px;}
.dot{position:absolute;top:-2px;right:-2px;width:9px;height:9px;border-radius:50%;background:var(--accent);border:2px solid #fff;}
#starPill .dot{display:none;}

/* ---------- home screen ---------- */
#homeScreen{position:fixed;left:0;right:0;bottom:calc(14px + env(safe-area-inset-bottom));display:flex;flex-direction:column;align-items:center;gap:12px;z-index:21;}
.build-fab{position:relative;width:72px;height:72px;border-radius:50%;background:linear-gradient(145deg,#ff7a5c,#ff5a3c);color:#fff;box-shadow:0 12px 28px rgba(255,90,60,.45),0 3px 8px rgba(120,70,20,.2);display:flex;align-items:center;justify-content:center;animation:fabPulse 2.4s ease-in-out infinite;}
.build-fab svg{width:40px;height:40px;}
.build-fab svg *{fill:currentColor;stroke:none;}
@keyframes fabPulse{0%,100%{box-shadow:0 12px 28px rgba(255,90,60,.45),0 0 0 0 rgba(255,107,77,.35)}50%{box-shadow:0 12px 28px rgba(255,90,60,.45),0 0 0 12px rgba(255,107,77,0)}}
#homeRow{display:flex;gap:10px;}
.home-ic{position:relative;width:48px;height:48px;border-radius:14px;background:var(--glass);backdrop-filter:var(--ui-blur);border:1px solid var(--stroke);box-shadow:var(--shadow);display:flex;align-items:center;justify-content:center;color:var(--ink);}
.home-ic svg{width:24px;height:24px;}
.home-ic:active{transform:scale(.93);}

/* ---------- top bar (build mode) ---------- */
#topbar{position:fixed;top:calc(10px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:2px;padding:4px;border-radius:999px;max-width:calc(100vw - 16px);overflow-x:auto;z-index:22;}
.tbtn{flex:0 0 auto;width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--ink);}
.tbtn:active{background:rgba(120,80,30,.08);}
.tbtn,.ibtn,.dtab{transition:transform .08s ease;}
.tbtn:active,.ibtn:active,.dtab:active{transform:scale(.92);}
button{-webkit-tap-highlight-color:transparent;}
.tbtn.on{color:var(--accent);background:rgba(255,107,77,.12);}
.sep{flex:0 0 auto;width:1px;height:22px;background:var(--line);margin:0 3px;}
#themeBtn .ico-moon{display:none;}
body[data-theme="night"] #themeBtn .ico-sun,body[data-theme="space"] #themeBtn .ico-sun{display:none;}
body[data-theme="night"] #themeBtn .ico-moon,body[data-theme="space"] #themeBtn .ico-moon{display:block;}
#soundBtn .ico-mute{display:none;}
body.muted #soundBtn .ico-snd{display:none;}
body.muted #soundBtn .ico-mute{display:block;}

/* ---------- floating round buttons ---------- */
.round{position:fixed;width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--ink);z-index:22;}
.round svg{width:24px;height:24px;}
#presetBtn{left:10px;top:calc(66px + env(safe-area-inset-top));}
#demoBtn{left:10px;top:calc(126px + env(safe-area-inset-top));}
#demoBtn .ico-stop{display:none;}
body.demo #demoBtn .ico-demo{display:none;}
body.demo #demoBtn .ico-stop{display:block;}
#demoBtn .ico-stop rect{fill:currentColor;stroke:none;}
#rotArmedBtn{left:50%;transform:translateX(-50%);bottom:calc(148px + env(safe-area-inset-bottom));width:64px;height:64px;color:#fff;background:linear-gradient(145deg,#ff7a5c,#ff5a3c);border:none;box-shadow:0 10px 24px rgba(255,90,60,.45);}
#rotArmedBtn svg{width:32px;height:32px;}
#rotArmedBtn[hidden]{display:none;}
/* first-armed hint: two pulses in 0.6s, once per session (see refreshArmedUI) */
@keyframes rotHint{0%{transform:translateX(-50%) scale(1)}25%{transform:translateX(-50%) scale(1.2)}50%{transform:translateX(-50%) scale(1)}75%{transform:translateX(-50%) scale(1.2)}100%{transform:translateX(-50%) scale(1)}}
#rotArmedBtn.hint{animation:rotHint .6s ease-in-out 1;}
#gameBtn{right:12px;bottom:176px;}
#gameBtn .gcrown{display:none;}

/* ---------- play button ---------- */
#playBtn{position:fixed;right:12px;bottom:calc(104px + env(safe-area-inset-bottom));width:60px;height:60px;border-radius:50%;background:linear-gradient(145deg,#ff7a5c,#ff5a3c);color:#fff;box-shadow:0 10px 24px rgba(255,90,60,.45);display:flex;align-items:center;justify-content:center;z-index:22;}
#playBtn svg{width:28px;height:28px;}
#playBtn .ico-play path{fill:currentColor;stroke:none;}
#playBtn .ico-stop{display:none;}
#playBtn .ico-stop rect{fill:currentColor;stroke:none;}
body.playing #playBtn .ico-play{display:none;}
body.playing #playBtn .ico-stop{display:block;}

/* ---------- game HUD ---------- */
#gameHud{position:fixed;top:calc(66px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);display:none;align-items:center;gap:8px;padding:5px 6px 5px 12px;border-radius:999px;z-index:22;}
body.game #gameHud,body.playing #gameHud{display:flex;}
.gcrown{color:var(--gold);display:flex;}
.gcrown svg{width:22px;height:22px;}
.gcrown svg path{fill:currentColor;stroke:none;}
.gdots{display:flex;gap:5px;}
.gdots i{width:9px;height:9px;border-radius:50%;background:var(--line);}
.gdots i.done{background:var(--gold);}
.gbtn{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--ink);}
.gbtn svg{width:20px;height:20px;}
.challenge-chip{position:fixed;top:calc(118px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);height:38px;padding:0 12px;border-radius:999px;background:var(--glass);backdrop-filter:var(--ui-blur);border:1px solid var(--stroke);box-shadow:var(--shadow);display:flex;align-items:center;gap:6px;color:var(--accent);z-index:22;}
.challenge-chip[hidden]{display:none;}
.challenge-chip svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;}
.challenge-chip b{font-size:15px;font-weight:800;color:var(--ink);}

/* ---------- presets / themes / files popups ---------- */
#presets{position:fixed;left:10px;top:calc(66px + env(safe-area-inset-top));display:none;width:296px;max-height:46vh;overflow-y:auto;padding:8px;border-radius:var(--radius);z-index:23;grid-template-columns:repeat(5,1fr);gap:6px;}
#presets.open{display:grid;}
.pcard{width:52px;height:52px;border-radius:12px;background:var(--tile);border:1px solid var(--line);display:flex;align-items:center;justify-content:center;padding:4px;}
.pcard svg{width:44px;height:44px;}
.pcard.sel{outline:2px solid var(--accent);outline-offset:1px;}
.pcard:active{transform:scale(.94);}
#themes{position:fixed;left:50%;transform:translateX(-50%);top:calc(66px + env(safe-area-inset-top));display:none;gap:6px;padding:6px;border-radius:999px;z-index:23;}
#themes.open{display:flex;}
.thcard{width:36px;height:36px;border-radius:50%;border:2px solid rgba(255,255,255,.85);box-shadow:0 2px 6px rgba(0,0,0,.18);}
.thcard[data-theme="studio"]{background:linear-gradient(135deg,#fff8e1,#cdeaff);}
.thcard[data-theme="sunset"]{background:linear-gradient(135deg,#ffd3b0,#ff9f6e);}
.thcard[data-theme="night"]{background:linear-gradient(135deg,#2b3a66,#0a0f22);}
.thcard[data-theme="snow"]{background:linear-gradient(135deg,#ffffff,#cfe4ff);}
.thcard[data-theme="space"]{background:linear-gradient(135deg,#3b2a66,#05070f);}
.thcard.sel{outline:2px solid var(--accent);outline-offset:2px;}
#filePanel{position:fixed;right:10px;top:calc(66px + env(safe-area-inset-top));display:none;gap:4px;padding:5px;border-radius:999px;z-index:23;}
#filePanel.open{display:flex;}
.fbtn{width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--ink);}
.fbtn:active{background:rgba(120,80,30,.08);}

/* ---------- dock ---------- */
#dockWrap{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(10px + env(safe-area-inset-bottom));max-width:calc(100vw - 16px);padding:6px 8px 8px;border-radius:var(--radius);z-index:22;}
#dockTabs{display:flex;gap:4px;margin-bottom:6px;}
.dtab{position:relative;width:44px;height:44px;border-radius:12px;display:flex;align-items:center;justify-content:center;color:var(--ink-soft);}
.dtab svg{width:24px;height:24px;}
.dtab.active{color:var(--accent);background:rgba(255,107,77,.12);}
.dtab.locked{opacity:.55;}
.dtab-dot{position:absolute;top:5px;right:5px;width:7px;height:7px;border-radius:50%;background:var(--accent-2);border:1.5px solid #fff;}
#dockRow{display:flex;align-items:center;gap:8px;}
#colorBtn{flex:0 0 auto;width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;}
#colorSwatch{width:28px;height:28px;border-radius:50%;border:2px solid #fff;box-shadow:0 2px 6px rgba(0,0,0,.2);display:block;}
.dvd{flex:0 0 auto;width:1px;height:36px;background:var(--line);}
#dock{flex:1;display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;max-width:62vw;touch-action:none;}
#dock::-webkit-scrollbar{display:none;}
.tile{flex:0 0 auto;width:48px;height:48px;border-radius:12px;background:var(--tile);border:1px solid var(--line);display:flex;align-items:center;justify-content:center;padding:5px;position:relative;transition:transform .08s ease;touch-action:none;}
.tile canvas,.tile svg{width:38px;height:38px;}
.tile img{width:38px;height:38px;object-fit:contain;display:block;}
.tile.sel,.tile.active{outline:2px solid var(--accent);outline-offset:1px;}
.tile:active,.tile.pressed{transform:scale(.9);}
.tile .ph{width:38px;height:38px;border-radius:9px;background-color:#b9c6d8;background-image:radial-gradient(circle at 50% 28%, rgba(255,255,255,.8) 0 5px, rgba(255,255,255,0) 6px),radial-gradient(circle at 50% 72%, rgba(255,255,255,.8) 0 5px, rgba(255,255,255,0) 6px);box-shadow:inset 0 -3px 0 rgba(0,0,0,.14);}
.tile.loading .ph{animation:phPulse .9s ease-in-out infinite alternate;}
@keyframes phPulse{from{opacity:.55}to{opacity:1}}
.tile.dragging{opacity:.55;}
#palette{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(96px + env(safe-area-inset-bottom));display:none;gap:6px;padding:6px;border-radius:999px;z-index:23;max-width:calc(100vw - 16px);overflow-x:auto;}
#palette.open{display:flex;}
.sw{flex:0 0 auto;width:32px;height:32px;border-radius:50%;border:2px solid rgba(255,255,255,.9);box-shadow:0 2px 5px rgba(0,0,0,.16);}
.sw.sel{outline:2px solid var(--accent);outline-offset:2px;}

/* ---------- sheets ---------- */
.sheet{position:fixed;inset:0;display:flex;align-items:flex-end;justify-content:center;background:rgba(40,25,10,.18);opacity:0;pointer-events:none;transition:opacity .22s;z-index:40;}
.sheet.open{opacity:1;pointer-events:auto;}
.sheet-card{width:min(480px,100vw);max-height:64vh;overflow-y:auto;background:var(--glass-strong);border-radius:20px 20px 0 0;padding:12px 14px calc(16px + env(safe-area-inset-bottom));box-shadow:0 -8px 30px rgba(120,70,20,.2);transform:translateY(12px);transition:transform .22s;}
.sheet.open .sheet-card{transform:translateY(0);}
.sheet-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;}
.sheet-ic{width:40px;height:40px;border-radius:50%;background:rgba(255,107,77,.1);color:var(--accent);display:flex;align-items:center;justify-content:center;}
.sheet-x{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--ink-soft);}
.sheet-x:active{background:rgba(120,80,30,.08);}
.sheet-list{display:flex;flex-direction:column;}
.sheet-empty{display:none;flex-direction:column;align-items:center;justify-content:center;padding:26px 0 14px;color:var(--ink-soft);}
.sheet-empty svg{width:56px;height:56px;opacity:.6;}
.sheet-empty svg *{fill:currentColor;stroke:none;}
.task-row{display:flex;align-items:center;gap:10px;padding:8px 2px;border-bottom:1px solid var(--line);}
.task-row:last-child{border-bottom:0;}
.task-pic{flex:0 0 auto;width:44px;height:44px;border-radius:12px;background:rgba(255,107,77,.09);color:var(--accent);display:flex;align-items:center;justify-content:center;}
.task-pic svg{width:26px;height:26px;}
.task-pic.locked{color:var(--ink-soft);background:rgba(120,80,30,.07);}
.task-star{flex:1;display:flex;align-items:center;gap:3px;font-size:15px;font-weight:800;color:var(--gold);}
.task-star b{color:var(--ink);}
.task-star .dim{color:var(--ink-soft);font-weight:700;}
.ibtn{flex:0 0 auto;width:44px;height:44px;border-radius:12px;background:var(--tile);border:1px solid var(--line);display:flex;align-items:center;justify-content:center;color:var(--ink);}
.ibtn.big{width:56px;height:56px;border-radius:16px;}
.ibtn:active{transform:scale(.93);}
.ibtn.on{color:var(--accent);border-color:var(--accent);background:rgba(255,107,77,.1);}
.shop-stars{display:flex;align-items:center;gap:4px;font-size:15px;font-weight:800;color:var(--ink);padding:0 10px;height:36px;border-radius:999px;background:var(--tile);border:1px solid var(--line);}
.badge-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:8px;padding:4px 0;}
.badge-cell{aspect-ratio:1;border-radius:12px;background:rgba(255,107,77,.09);display:flex;align-items:center;justify-content:center;color:var(--accent);}
.badge-cell.locked{opacity:.4;color:var(--ink-soft);background:rgba(120,80,30,.07);}
.badge-emoji{display:flex;}
.badge-emoji svg{width:26px;height:26px;}
.work-thumb{flex:0 0 auto;width:44px;height:44px;border-radius:12px;overflow:hidden;background:var(--tile);border:1px solid var(--line);display:flex;align-items:center;justify-content:center;color:var(--ink-soft);}
.work-thumb img{width:100%;height:100%;object-fit:cover;}
.work-thumb svg{width:30px;height:30px;}
.work-thumb svg *{fill:currentColor;stroke:none;}
#adaptiveRow:empty{display:none;}
.adaptive-row{background:rgba(255,159,28,.1);border-radius:12px;}
.adaptive-row .task-pic{background:rgba(255,159,28,.16);color:#d98200;animation:adaptPulse 1.8s ease-in-out infinite;}
@keyframes adaptPulse{0%,100%{box-shadow:0 0 0 0 rgba(255,159,28,.35)}50%{box-shadow:0 0 0 6px rgba(255,159,28,0)}}

/* ---------- parent view ---------- */
.pv-stats{display:flex;gap:8px;margin-bottom:12px;}
.pv-stat{flex:1;display:flex;align-items:center;justify-content:center;gap:5px;height:44px;border-radius:12px;background:var(--tile);border:1px solid var(--line);font-size:16px;font-weight:800;}
.pv-stat svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;}
.pv-stat .pv-ic{color:var(--accent);display:flex;}
.pv-stat .pv-ic svg path{fill:currentColor;stroke:none;}
.pv-skills{display:flex;flex-direction:column;gap:8px;margin-bottom:12px;}
.pv-row{display:flex;align-items:center;gap:8px;}
.pv-row .pv-ic{width:30px;height:30px;border-radius:9px;background:rgba(255,107,77,.09);color:var(--accent);display:flex;align-items:center;justify-content:center;flex:0 0 auto;}
.pv-row .pv-ic svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;}
.pv-bar{flex:1;height:8px;border-radius:999px;background:var(--line);overflow:hidden;}
.pv-bar i{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,var(--accent-2),var(--accent));}
.pv-row b{font-size:13px;font-weight:800;min-width:30px;text-align:right;}
.pv-week{display:flex;gap:6px;align-items:flex-end;height:64px;margin-bottom:12px;padding:0 2px;}
.pv-col{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:3px;height:100%;}
.pv-col i{width:100%;max-width:22px;border-radius:5px 5px 2px 2px;background:var(--sky);min-height:3px;}
.pv-col b{font-size:11px;font-weight:800;color:var(--ink-soft);}
.pv-works{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px;}
.pv-works .work-thumb{width:52px;height:52px;}

/* ---------- parent lock / verify ---------- */
.parent-body{display:flex;align-items:center;justify-content:center;gap:14px;padding:10px 0 6px;}
.state-dot{width:10px;height:10px;border-radius:50%;background:#c9c2bb;}
.state-dot.on{background:var(--leaf);}
.hold-btn{width:64px;height:64px;border-radius:50%;background:rgba(255,107,77,.12);color:var(--accent);display:flex;align-items:center;justify-content:center;margin:6px auto 10px;}
.hold-btn svg{width:30px;height:30px;}
.hold-track{height:6px;border-radius:999px;background:var(--line);overflow:hidden;margin:0 8px 6px;}
#holdFill{height:100%;width:0;background:var(--accent);border-radius:999px;}
.math-q{text-align:center;font-size:26px;font-weight:800;margin:10px 0 12px;letter-spacing:1px;}
.math-answers{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;}
.math-opt{font-size:20px;font-weight:800;}

/* ---------- celebrate ---------- */
.celebrate-card{text-align:center;padding:22px 14px 18px;}
.celebrate-stars{display:flex;justify-content:center;gap:6px;margin:0 0 10px;}
.celebrate-stars svg{animation:starPop .45s cubic-bezier(.2,1.6,.4,1) backwards;}
.celebrate-stars svg:nth-child(2){animation-delay:.12s;}
.celebrate-stars svg:nth-child(3){animation-delay:.24s;}
@keyframes starPop{from{transform:scale(.2) rotate(-30deg);opacity:0}to{transform:scale(1) rotate(0);opacity:1}}
.celebrate-plus{display:flex;justify-content:center;align-items:center;gap:6px;margin:0;font-size:22px;font-weight:800;color:var(--accent);}

/* ---------- toast (icon only) ---------- */
.toast{position:fixed;top:44%;left:50%;transform:translate(-50%,-50%) scale(.7);width:60px;height:60px;border-radius:50%;background:var(--glass);backdrop-filter:var(--ui-blur);border:1px solid var(--stroke);box-shadow:var(--shadow);display:flex;align-items:center;justify-content:center;color:var(--accent);opacity:0;pointer-events:none;transition:opacity .18s,transform .18s;z-index:10001;}
.toast.show{opacity:1;transform:translate(-50%,-50%) scale(1);}
.toast svg{width:30px;height:30px;}

/* ---------- onboarding: finger + pulse only ---------- */
.onboard{position:fixed;inset:0;pointer-events:none;z-index:50;}
.onboard-x{position:fixed;top:calc(12px + env(safe-area-inset-top));right:12px;width:40px;height:40px;border-radius:50%;background:var(--glass);border:1px solid var(--stroke);box-shadow:var(--shadow);display:flex;align-items:center;justify-content:center;color:var(--ink);pointer-events:auto;}
.onboard-x svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;}
#finger{position:fixed;left:50%;top:60%;width:46px;height:46px;margin:-23px 0 0 -23px;pointer-events:none;z-index:51;opacity:0;transition:left .5s ease,top .5s ease,opacity .3s;}
#finger.show{opacity:1;}
#finger .fr{position:absolute;inset:0;border:3px solid var(--accent);border-radius:50%;animation:ringPulse 1.1s ease-in-out infinite;}
#finger .fd{position:absolute;left:50%;top:50%;width:10px;height:10px;margin:-5px 0 0 -5px;border-radius:50%;background:var(--accent);}
#finger.tap .fr{transform:scale(.72);}
@keyframes ringPulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.25);opacity:.55}}
.demo-focus{outline:3px solid var(--accent) !important;outline-offset:3px;animation:demoPulse 1s ease-in-out infinite;}
@keyframes demoPulse{0%,100%{outline-color:rgba(255,107,77,.9)}50%{outline-color:rgba(255,107,77,.25)}}
#hint{display:none;}
#flash{position:fixed;inset:0;background:#fff;opacity:0;pointer-events:none;z-index:65;transition:opacity .3s;}
.pop{animation:popA .18s ease-out;}
@keyframes popA{0%{transform:scale(1.18)}100%{transform:scale(1)}}

/* ---------- mode visibility ---------- */
body.home #topbar,body.home #dockWrap,body.home #palette,body.home #presets,body.home #themes,
body.home #filePanel,body.home #presetBtn,body.home #demoBtn,body.home #rotArmedBtn,body.home #gameBtn,
body.home #playBtn,body.home #gameHud,body.home #modesBtn,body.home #driveHud,
body.home #scoreHud,body.home .challenge-chip{display:none !important;}
body.building #homeHud,body.building #homeScreen{display:none !important;}
body:not(.home) #homeScreen{display:none !important;}

/* ---------- feature-group injected DOM (icon-only) ---------- */
.bs-kid-alert{position:fixed;top:44%;left:50%;transform:translate(-50%,-50%);width:60px;height:60px;border-radius:50%;background:var(--glass);border:1px solid var(--stroke);box-shadow:var(--shadow);display:flex;align-items:center;justify-content:center;color:var(--accent);z-index:70;}
.bs-kid-alert svg{width:30px;height:30px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;}
.bs-lock-badge{position:absolute;top:4px;right:4px;width:16px;height:16px;border-radius:50%;background:var(--glass);display:flex;align-items:center;justify-content:center;color:var(--ink-soft);}
.bs-lock-badge svg{width:11px;height:11px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;}

/* ---------- play modes (drive + minigames, 2026-11-30) ---------- */
#modesBtn{left:10px;top:calc(186px + env(safe-area-inset-top));}
.play-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:4px 2px 2px;}
.play-grid button{width:56px;height:56px;border-radius:14px;background:var(--tile);border:1px solid var(--line);display:flex;align-items:center;justify-content:center;color:var(--ink);}
.play-grid button:active{transform:scale(.94);}
.play-grid button svg{width:30px;height:30px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;}
#driveHud{position:fixed;inset:0;pointer-events:none;z-index:24;}
#driveHud[hidden]{display:none;}
#driveHud>*{pointer-events:auto;}
.dh-steer{position:absolute;left:14px;bottom:calc(116px + env(safe-area-inset-bottom));display:flex;gap:10px;}
.dh-steer button{width:56px;height:56px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--ink);background:var(--glass);backdrop-filter:var(--ui-blur);border:1px solid var(--stroke);box-shadow:var(--shadow);}
.dh-steer button svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.dh-steer button:active,.dh-steer button.held{transform:scale(.92);background:var(--accent);color:#fff;}
#gasBtn{position:absolute;right:16px;bottom:calc(108px + env(safe-area-inset-bottom));width:78px;height:78px;border-radius:50%;background:linear-gradient(145deg,#ff7a5c,#ff5a3c);color:#fff;box-shadow:0 10px 24px rgba(255,90,60,.45);display:flex;align-items:center;justify-content:center;}
#gasBtn svg{width:34px;height:34px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;}
#gasBtn:active,#gasBtn.held{transform:scale(.93);}
.dh-x{position:absolute;top:calc(66px + env(safe-area-inset-top));right:12px;width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--ink);background:var(--glass);backdrop-filter:var(--ui-blur);border:1px solid var(--stroke);box-shadow:var(--shadow);}
.dh-x svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;}
#scoreHud{position:fixed;top:calc(66px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:10px;padding:5px 8px 5px 12px;border-radius:999px;z-index:10000;}
#scoreHud[hidden]{display:none;}
.sh-score,.sh-goal{display:flex;align-items:center;gap:6px;}
.sh-star,.sh-flag{display:flex;color:var(--gold);}
.sh-star svg,.sh-flag svg{width:22px;height:22px;}
.sh-star svg path{fill:currentColor;stroke:none;}
.sh-flag svg{fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;}
#scoreNum{font-size:17px;font-weight:800;color:var(--ink);min-width:18px;text-align:center;}
#scoreBar{width:92px;height:8px;border-radius:999px;background:var(--line);display:block;overflow:hidden;}
#scoreFill{display:block;height:100%;width:0%;border-radius:999px;background:var(--gold);transition:width .2s;}
#scoreHud[data-show="score"] .sh-goal{display:none;}
#scoreHud[data-show="goal"] .sh-score{display:none;}
#scoreHud[data-show="none"] .sh-score,#scoreHud[data-show="none"] .sh-goal{display:none;}
/* celebrate: icon only, no words */
.bs-celebrate{position:fixed;left:50%;top:38%;transform:translate(-50%,-50%) scale(.6);z-index:10001;pointer-events:none;opacity:0;transition:opacity .25s,transform .25s;}
.bs-celebrate.show{opacity:1;transform:translate(-50%,-50%) scale(1);}
.bs-celebrate-ic svg{width:96px;height:96px;filter:drop-shadow(0 8px 20px rgba(120,70,20,.3));}
.bs-celebrate-ic.ic-star svg path{fill:#ffd23f;stroke:none;}
.bs-celebrate-ic.ic-retry svg{color:var(--ink);}
.bs-celebrate-ic.ic-retry svg path{fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;}
.bs-arcade-canvas{border-radius:12px;box-shadow:0 16px 40px rgba(0,0,0,.35);}
/* during a play session: hide the building UI so the game owns the screen */
body.minigame #dockWrap,body.minigame #palette,body.minigame #topbar,body.minigame #presets,
body.minigame #themes,body.minigame #filePanel,body.minigame #presetBtn,body.minigame #demoBtn,
body.minigame #rotArmedBtn,body.minigame #gameBtn,body.minigame #playBtn,body.minigame #modesBtn,
body.minigame #gameHud,body.minigame .challenge-chip{display:none !important;}
