/* =====================================================================
   DND STUDIO + GALLERY + PAINT SNAKE + new Home tiles
   ===================================================================== */
body.studio-on{overflow:hidden}
body.studio-on .topbar,body.studio-on .bottom-nav{display:none!important}
body.studio-on .st{display:flex}
body.studio-on main{padding:0!important;max-width:none!important}
#studio.view.active{display:block;animation:none}
.st{position:fixed;inset:0;z-index:40;background:#141019;color:#efeaf6;display:none;flex-direction:column;font-family:var(--dnd-font-body);user-select:none;-webkit-user-select:none;touch-action:none}
.st button{font-family:inherit;color:inherit}
.st-top{height:52px;padding:6px 8px;padding-top:max(6px,env(safe-area-inset-top));display:flex;align-items:center;gap:4px;background:#1d1726;border-bottom:1px solid #2c2338;flex:none}
.st-top .sp{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font:700 13px var(--dnd-font-head);color:#bfb3d1;text-align:center}
.ib{width:40px;height:40px;flex:none;border:0;border-radius:11px;background:transparent;display:grid;place-items:center;cursor:pointer;position:relative}
.ib svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.ib:active{background:#2c2338}
.ib[aria-pressed="true"]{background:#ffd000;color:#190529}
.ib:disabled{opacity:.35}
.st-save{height:36px;padding:0 14px;border:0;border-radius:999px;background:#ffd000;color:#190529!important;font-weight:800;font-size:13px;cursor:pointer;flex:none}
.st-stage{position:relative;flex:1;min-height:0;overflow:hidden;background:#100c15}
.st-stage canvas.stv{position:absolute;inset:0;width:100%;height:100%;touch-action:none;cursor:crosshair}
.st-side{position:absolute;left:8px;top:50%;transform:translateY(-50%);z-index:3;display:flex;flex-direction:column;align-items:center;gap:10px;background:#1d1726e6;border:1px solid #2c2338;border-radius:16px;padding:10px 6px}
.vs{position:relative;width:30px;height:120px}
.vs input{position:absolute;left:50%;top:50%;width:120px;height:30px;margin:0;transform:translate(-50%,-50%) rotate(-90deg);accent-color:#ffd000;background:transparent}
.st-side small{font-size:10px;font-weight:800;color:#bfb3d1;line-height:1;text-align:center}
.st-side .dot{width:26px;height:26px;display:grid;place-items:center}
.st-side .dot i{display:block;border-radius:50%;background:#efeaf6}
.st-bottom{flex:none;background:#1d1726;border-top:1px solid #2c2338;padding:6px 6px;padding-bottom:max(6px,env(safe-area-inset-bottom));display:flex;align-items:center;gap:2px;overflow-x:auto;scrollbar-width:none}
.st-bottom::-webkit-scrollbar{display:none}
.st-bottom .ib{width:44px;height:44px}
.st-bottom .sep{width:1px;height:28px;background:#2c2338;flex:none;margin:0 3px}
.swatch{width:38px;height:38px;border-radius:50%;border:3px solid #efeaf6;box-shadow:0 0 0 2px #1d1726,0 0 0 3px #4a3d5c;cursor:pointer;flex:none;margin:0 6px}
.st-label{position:absolute;bottom:8px;right:10px;z-index:3;font-size:11px;font-weight:700;color:#bfb3d1;background:#1d1726cc;padding:3px 8px;border-radius:999px;pointer-events:none}
.st-float{position:absolute;right:10px;top:10px;z-index:4;width:150px;background:#fff;border-radius:12px;box-shadow:0 8px 24px #0008;overflow:hidden;touch-action:none}
.st-float img{display:block;width:100%;pointer-events:none}
.st-float b{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:#190529;padding:4px 8px;background:#ffd000;cursor:move}
.st-float b button{border:0;background:none;font-weight:900;color:#190529;cursor:pointer;font-size:13px}
/* sheets */
.st-sheet{position:absolute;left:0;right:0;bottom:0;z-index:20;background:#221b2d;border-top:1px solid #3a2f4a;border-radius:20px 20px 0 0;padding:10px 14px 16px;padding-bottom:max(16px,env(safe-area-inset-bottom));max-height:72%;overflow:auto;transform:translateY(105%);transition:transform .22s ease,visibility .22s;visibility:hidden}
.st-sheet.on{transform:none;visibility:visible;box-shadow:0 -10px 30px #0007}
.st-sheet h3{margin:4px 0 10px;font:800 15px var(--dnd-font-head);color:#fff;display:flex;justify-content:space-between;align-items:center}
.st-sheet h3 button{border:0;background:#33284a;color:#fff;border-radius:999px;width:30px;height:30px;font-size:15px;cursor:pointer}
.st-sheet .grab{width:40px;height:4px;border-radius:9px;background:#4a3d5c;margin:0 auto 6px}
.st-sheet h4{margin:14px 0 8px;font:700 12px var(--dnd-font-body);letter-spacing:.06em;color:#bfb3d1;text-transform:uppercase}
.bgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.bgrid button{border:1px solid #3a2f4a;background:#2a2236;border-radius:14px;padding:8px 4px;display:grid;gap:4px;justify-items:center;cursor:pointer;font-size:11px;font-weight:700}
.bgrid button canvas{width:100%;height:30px}
.bgrid button[aria-pressed="true"]{border-color:#ffd000;background:#3a2f12}
.rowr{display:flex;align-items:center;gap:10px;margin:8px 0}
.rowr label{width:78px;font-size:12px;font-weight:700;color:#bfb3d1;flex:none}
.rowr input[type=range]{flex:1;accent-color:#ffd000}
.rowr output{width:40px;text-align:right;font-size:12px;font-weight:800}
.chipsr{display:flex;flex-wrap:wrap;gap:6px}
.chipsr button{border:1px solid #3a2f4a;background:#2a2236;color:#efeaf6;border-radius:999px;padding:7px 12px;font-size:12px;font-weight:700;cursor:pointer}
.chipsr button[aria-pressed="true"]{background:#ffd000;color:#190529;border-color:#ffd000}
.cp{display:grid;gap:10px}
.cp canvas{width:100%;border-radius:12px;touch-action:none;display:block}
.cp .sv{height:170px}
.cp .hue{height:26px}
.cp .hexr{display:flex;gap:10px;align-items:center}
.cp .hexr i{width:44px;height:44px;border-radius:12px;border:2px solid #fff;flex:none}
.cp .hexr input{flex:1;min-width:0;background:#15111b;border:1px solid #3a2f4a;color:#fff;border-radius:10px;padding:10px;font:700 15px monospace}
.sw{display:grid;grid-template-columns:repeat(10,1fr);gap:6px}
.sw button{aspect-ratio:1;border-radius:9px;border:1px solid #0004;cursor:pointer;padding:0}
.ly{display:grid;gap:8px}
.lyr{display:flex;align-items:center;gap:8px;background:#2a2236;border:1px solid #3a2f4a;border-radius:14px;padding:6px}
.lyr.sel{border-color:#ffd000;background:#33290f}
.lyr canvas{width:48px;height:48px;border-radius:8px;background:#fff;flex:none}
.lyr .nm{flex:1;min-width:0}
.lyr .nm b{display:block;font-size:13px}
.lyr .nm small{font-size:11px;color:#bfb3d1}
.lyr .ib{width:34px;height:34px}
.lyr .ib svg{width:18px;height:18px}
.lyset{background:#1a1422;border-radius:12px;padding:8px 10px;margin-top:6px}
.lyset select{background:#15111b;color:#fff;border:1px solid #3a2f4a;border-radius:8px;padding:6px;font-weight:700}
.refs{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.refs button{aspect-ratio:1;border-radius:12px;border:2px solid #3a2f4a;background:#fff center/cover no-repeat;cursor:pointer;padding:0;overflow:hidden;position:relative}
.refs button[aria-pressed="true"]{border-color:#ffd000;box-shadow:0 0 0 2px #ffd000}
.refs .up{background:#2a2236;color:#ffd000;font-size:26px;font-weight:800;display:grid;place-items:center}
.refs .up small{font-size:10px;color:#bfb3d1;display:block}
.prj{display:grid;gap:6px}
.prj button{display:flex;gap:10px;align-items:center;text-align:left;background:#2a2236;border:1px solid #3a2f4a;border-radius:12px;padding:8px 10px;cursor:pointer}
.prj button span{font-size:22px}
.prj button b{font-size:13px;display:block}
.prj button small{font-size:11px;color:#bfb3d1}
.steps{background:#1a1422;border-radius:14px;padding:12px;display:grid;gap:8px}
.steps p{margin:0;font-size:14px;line-height:1.45}
.steps .nav{display:flex;gap:8px;align-items:center}
.steps .nav span{flex:1;text-align:center;font-size:12px;color:#bfb3d1;font-weight:700}
.steps .nav button{border:0;background:#ffd000;color:#190529;border-radius:999px;padding:8px 14px;font-weight:800;cursor:pointer}
.menu{display:grid;gap:8px}
.menu button{display:flex;gap:12px;align-items:center;text-align:left;background:#2a2236;border:1px solid #3a2f4a;border-radius:12px;padding:12px;cursor:pointer;font-size:14px;font-weight:700}
.menu button small{display:block;font-size:11px;color:#bfb3d1;font-weight:500}
.st-tips{position:absolute;inset:0;z-index:30;background:#0009;display:grid;place-items:center;padding:20px}
.st-tips .box{background:#fff;color:#20152c;border-radius:20px;padding:20px;max-width:340px;display:grid;gap:10px;text-align:center}
.st-tips .box b{font:800 18px var(--dnd-font-head)}
.st-tips .box p{margin:0;font-size:14px;line-height:1.5;color:#4b4258}
.st-tips .box .big{font-size:40px}
.st-tips .box button{border:0;background:#ffd000;color:#190529;border-radius:999px;padding:11px;font-weight:800;font-size:14px;cursor:pointer}
.st-tips .box .dots{display:flex;gap:6px;justify-content:center}
.st-tips .box .dots i{width:7px;height:7px;border-radius:50%;background:#ddd}
.st-tips .box .dots i.on{background:#190529}
.st-toast{position:absolute;left:50%;top:64px;transform:translateX(-50%);z-index:35;background:#ffd000;color:#190529;font-weight:800;font-size:13px;padding:8px 16px;border-radius:999px;opacity:0;transition:.25s;pointer-events:none;max-width:88%;text-align:center;line-height:1.35}
.st-toast.on{opacity:1}

/* ---------- Home: hero + tiles + snake ---------- */
.hero2{position:relative;overflow:hidden;border-radius:24px;padding:20px;background:linear-gradient(135deg,#190529,#45206c);color:#fff;display:grid;gap:12px;box-shadow:0 14px 34px #19052926;margin:6px 0 18px}
.hero2:after{content:"";position:absolute;right:-60px;top:-60px;width:200px;height:200px;border-radius:50%;background:radial-gradient(circle,#ffd00055,transparent 70%)}
.hero2 .eb{font:800 11px var(--dnd-font-body);letter-spacing:.12em;color:#ffd000;position:relative}
.hero2 h2{margin:0;font:800 24px/1.15 var(--dnd-font-head);position:relative}
.hero2 p{margin:0;color:#ddd0ee;font-size:14px;line-height:1.45;position:relative}
.hero2 .emo{position:absolute;right:16px;top:14px;font-size:44px;filter:drop-shadow(0 4px 8px #0006)}
.hero2 .acts{display:flex;gap:8px;flex-wrap:wrap;position:relative}
.hero2 .acts button{border:0;border-radius:999px;padding:11px 18px;font-weight:800;font-size:14px;cursor:pointer;font-family:inherit}
.hero2 .go{background:#ffd000;color:#190529}
.hero2 .alt{background:#ffffff1f;color:#fff;border:1px solid #ffffff40!important}
.hero2 .small{font-size:12px;color:#c9b8e4}
.studio-cta{display:flex;align-items:center;gap:14px;width:100%;border:0;border-radius:20px;padding:16px;margin:0 0 18px;cursor:pointer;text-align:left;font-family:inherit;color:#190529;background:linear-gradient(120deg,#ffd000,#ffb800);box-shadow:0 10px 26px #ffb80040}
.studio-cta .ic2{width:52px;height:52px;border-radius:16px;background:#190529;display:grid;place-items:center;font-size:26px;flex:none}
.studio-cta b{display:block;font:800 18px var(--dnd-font-head)}
.studio-cta small{display:block;font-size:13px;font-weight:600;opacity:.8}
.tiles3{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:0 0 20px}
.tiles3 button{border:0;border-radius:20px;padding:14px 10px;min-height:128px;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;text-align:left;cursor:pointer;font-family:inherit;color:#fff;box-shadow:0 8px 20px #19052918;position:relative;overflow:hidden}
.tiles3 button:after{content:"";position:absolute;right:-24px;bottom:-24px;width:80px;height:80px;border-radius:50%;background:#ffffff22}
.tiles3 .e{font-size:28px}
.tiles3 b{font:800 14px/1.2 var(--dnd-font-head)}
.tiles3 small{font-size:11px;opacity:.9;line-height:1.3}
.tiles3 .t1{background:linear-gradient(150deg,#ff7a59,#e8435a)}
.tiles3 .t2{background:linear-gradient(150deg,#16a6a0,#1f6fd1)}
.tiles3 .t3{background:linear-gradient(150deg,#ffd000,#f29a1d);color:#190529}
.latest{display:flex;gap:12px;align-items:center;background:#fff;border:1px solid var(--line);border-radius:18px;padding:12px;margin:0 0 18px;cursor:pointer;width:100%;text-align:left;font-family:inherit}
.latest .yt{width:64px;height:48px;border-radius:12px;background:#ff0000;display:grid;place-items:center;flex:none}
.latest .yt i{width:0;height:0;border-left:14px solid #fff;border-top:9px solid transparent;border-bottom:9px solid transparent;margin-left:4px}
.latest b{display:block;font:800 15px var(--dnd-font-head);color:var(--ink)}
.latest small{color:var(--muted);font-size:12px}
.snake{background:#190529;border-radius:22px;padding:14px;color:#fff;display:grid;gap:10px;margin:8px 0 18px}
.snake .hd{display:flex;align-items:center;gap:10px}
.snake .hd b{font:800 17px var(--dnd-font-head);flex:1}
.snake .hd span{font-size:12px;font-weight:800;background:#ffffff1a;padding:4px 10px;border-radius:999px}
.snake canvas{width:100%;aspect-ratio:1;border-radius:14px;background:#0f0a17;touch-action:none;display:block}
.snake .pad{display:grid;grid-template-columns:repeat(3,52px);grid-template-rows:repeat(2,44px);gap:6px;justify-content:center}
.snake .pad button{border:0;border-radius:12px;background:#ffffff1a;color:#fff;font-size:18px;cursor:pointer}
.snake .pad .u{grid-column:2}
.snake .pad .l{grid-column:1;grid-row:2}.snake .pad .d{grid-column:2;grid-row:2}.snake .pad .r{grid-column:3;grid-row:2}
.snake .row{display:flex;gap:8px}
.snake .row button{flex:1;border:0;border-radius:999px;padding:11px;font-weight:800;cursor:pointer;font-family:inherit}
.snake .play{background:#ffd000;color:#190529}
.snake .note{font-size:12px;color:#c9b8e4;margin:0}
/* nav studio button */
.bottom-nav .nav-item.studio-nav span{background:#ffd000;color:#190529;border-radius:16px;width:46px;height:34px;display:grid;place-items:center;box-shadow:0 6px 14px #ffd00055}
/* gallery */
.chal{border-radius:22px;padding:18px;background:linear-gradient(135deg,#ff7a59,#e8435a);color:#fff;display:grid;gap:8px;margin:0 0 18px}
.chal .eb{font:800 11px var(--dnd-font-body);letter-spacing:.12em;opacity:.9}
.chal h2{margin:0;font:800 22px var(--dnd-font-head)}
.chal p{margin:0;font-size:14px;line-height:1.45;opacity:.95}
.chal .acts{display:flex;gap:8px;flex-wrap:wrap}
.chal button{border:0;border-radius:999px;padding:10px 16px;font-weight:800;cursor:pointer;font-family:inherit}
.chal .go{background:#fff;color:#c2334a}
.chal .alt{background:#ffffff26;color:#fff}
.chal .pal{display:flex;gap:6px}
.chal .pal i{width:24px;height:24px;border-radius:7px;border:2px solid #fff}
.gal{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.gal .it{background:#fff;border:1px solid var(--line);border-radius:18px;overflow:hidden;display:grid}
.gal .it img{width:100%;aspect-ratio:1;object-fit:cover;background:#fff;display:block;cursor:pointer}
.gal .it .ft{display:flex;flex-wrap:wrap;align-items:center;padding:6px 8px 4px;gap:0}
.gal .it .ft small{flex:1 1 100%;font-size:11px;color:var(--muted);line-height:1.3;padding:0 2px 4px}
.gal .it .ft button{border:0;background:#f5f1fa;flex:1;height:34px;border-radius:9px;cursor:pointer;font-size:15px;margin:0 2px}
.gal-empty{text-align:center;padding:30px 16px;background:#fff;border:1px dashed #d9cfe6;border-radius:18px;color:var(--muted)}
.gal-empty b{display:block;font:800 17px var(--dnd-font-head);color:var(--ink);margin:6px 0}
.gal-empty button{margin-top:10px;border:0;border-radius:999px;background:#ffd000;color:#190529;padding:11px 18px;font-weight:800;cursor:pointer;font-family:inherit}
@media(min-width:700px){.gal{grid-template-columns:repeat(3,1fr)}.snake{max-width:460px}}
.latest[hidden]{display:none}
/* ---------- DND Paint Jr (kids theme) ---------- */
.st.jr{background:#FFFBE6;color:#0A0136;font-family:"Nunito","Baloo 2",system-ui,sans-serif}
.st.jr .st-top{background:#6328B6;border-bottom:3px solid #0A0136;color:#fff;height:58px}
.st.jr .st-top .sp{color:#FEF275;font-family:"Baloo 2","Nunito",sans-serif;font-size:17px}
.st.jr .ib:active{background:#4A1D8A}
.st.jr .st-save{background:#FEF275;border:2.5px solid #0A0136;box-shadow:0 3px 0 #0A0136;font-size:15px;height:40px}
.st.jr .st-stage{background:#FFF3B8}
.st.jr .st-side{background:#fff;border:2.5px solid #0A0136;box-shadow:0 4px 0 #0A0136}
.st.jr .st-side small{color:#0A0136}
.st.jr .st-side .dot i{outline:2px solid #0A0136}
.st.jr .vs input{accent-color:#6328B6}
.st.jr .st-bottom{background:#fff;border-top:3px solid #0A0136;gap:4px;padding:8px}
.st.jr .st-bottom .ib{width:52px;height:52px;border-radius:16px;color:#0A0136}
.st.jr .st-bottom .ib svg{width:28px;height:28px;stroke-width:2.2}
.st.jr .ib[aria-pressed="true"]{background:#FEF275;box-shadow:inset 0 0 0 2.5px #0A0136}
.st.jr .swatch{width:46px;height:46px;border-color:#fff;box-shadow:0 0 0 3px #0A0136}
.st.jr .st-bottom .sep{background:#E4DDF3}
.st.jr .st-label{background:#fff;color:#0A0136;border:2px solid #0A0136}
.st.jr .st-toast{background:#6328B6;color:#fff;border:2.5px solid #0A0136;font-size:15px}
.st.jr .st-sheet{background:#FFFBE6;color:#0A0136;border:3px solid #0A0136;border-bottom:0}
.st.jr .st-sheet h3{color:#0A0136;font-family:"Baloo 2",sans-serif;font-size:19px}
.st.jr .st-sheet h3 button{background:#fff;color:#0A0136;border:2.5px solid #0A0136}
.st.jr .st-sheet h4{color:#55506E}
.st.jr .bgrid{grid-template-columns:repeat(3,1fr)}
.st.jr .bgrid button,.st.jr .chipsr button,.st.jr .menu button{background:#fff;color:#0A0136;border:2.5px solid #0A0136;box-shadow:0 3px 0 #0A0136;font-size:13px}
.st.jr .bgrid button[aria-pressed="true"],.st.jr .chipsr button[aria-pressed="true"]{background:#FEF275;color:#0A0136;border-color:#0A0136}
.st.jr .menu button small{color:#55506E}
.st.jr .refs{grid-template-columns:repeat(3,1fr)}
.st.jr .refs button{border:3px solid #0A0136}
.st.jr .refs button[aria-pressed="true"]{border-color:#6328B6;box-shadow:0 0 0 3px #FEF275}
.st.jr .sw{grid-template-columns:repeat(5,1fr);gap:10px}
.st.jr .sw button{border:2.5px solid #0A0136;border-radius:50%}
.st.jr .cp .hexr{display:none}
.st.jr .cp .sv{height:130px}
.st.jr .st-tips .box{border:3px solid #0A0136;box-shadow:0 6px 0 #0A0136;font-family:"Nunito",sans-serif}
.st.jr .st-tips .box b{font-family:"Baloo 2",sans-serif;font-size:22px;color:#6328B6}
.st.jr .st-tips .box button{background:#FEF275;border:2.5px solid #0A0136;box-shadow:0 3px 0 #0A0136;font-size:16px}
.st.jr .st-float{border:3px solid #0A0136}
.st.jr .st-float b{background:#FEF275}
.st [hidden]{display:none!important}
.addref{display:flex;align-items:center;gap:12px;width:100%;text-align:left;border:2px dashed #ffd000;background:#2a2236;color:#efeaf6;border-radius:16px;padding:12px 14px;cursor:pointer;margin-bottom:6px;font-family:inherit}
.addref span:first-child{font-size:30px}
.addref b{display:block;font-size:15px;color:#ffd000}
.addref small{display:block;font-size:12px;color:#bfb3d1;line-height:1.35}
.refs button .rm{position:absolute;right:3px;top:3px;width:22px;height:22px;border-radius:50%;background:#000a;color:#fff;font-style:normal;font-size:11px;display:grid;place-items:center}
.st.jr .addref{background:#fff;border:3px dashed #6328B6;color:#0A0136}
.st.jr .addref b{color:#6328B6}
.st.jr .addref small{color:#55506E}
