/* Puddle Pals Wash Day. System fonts only, no inline styles in the markup.
   The painted world is a full-screen canvas; the buttons live on one "stage" per orientation
   (landscape 640 tall, portrait 640 wide) that game.js scales to fit, so nothing scrolls or spills off. */
[hidden]{display:none!important}
*{box-sizing:border-box}
html,body{margin:0;padding:0;height:100%;width:100%;overflow:hidden;overscroll-behavior:none;touch-action:none;
  -webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
body{position:fixed;inset:0;height:100dvh;background:#9fd3f2;color:#3d2a1a;
  font-family:ui-rounded,"SF Pro Rounded","Nunito","Segoe UI Rounded","Trebuchet MS",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
#pp{position:fixed;inset:0;height:100dvh;width:100vw;overflow:hidden;overscroll-behavior:none;touch-action:none}
#world{position:absolute;inset:0;width:100%;height:100%;touch-action:none;display:block}
#fx{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:60}
.title-art{position:absolute;inset:0;background:url(assets/title-wide.jpg) center center/cover no-repeat;display:none}
.is-port .title-art{background-image:url(assets/title-tall.jpg);background-position:center bottom}
.scr-title .title-art{display:block}
.safe{position:absolute;visibility:hidden;pointer-events:none;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)}
button,a{touch-action:manipulation;font:inherit;color:inherit}
button{cursor:pointer;-webkit-appearance:none;appearance:none}
button:disabled{cursor:default}
svg{display:block}
.nojs{position:absolute;inset:40% 10% auto;text-align:center;font-weight:800;background:#fff;padding:16px;border-radius:16px}
:focus-visible{outline:5px solid #2f6fd6;outline-offset:3px}

.stage{position:absolute;left:0;top:0;width:1000px;height:640px;transform-origin:0 0;pointer-events:none}
.stage button,.stage a,.stage .sheet,.stage .panel,.stage .title-box{pointer-events:auto}

/* ---------- buttons ---------- */
.hbtn{flex:0 0 auto;width:72px;height:72px;border-radius:23px;border:0;display:grid;place-items:center;padding:0;text-decoration:none;
  background:linear-gradient(#ffffff,#e3f4ff);box-shadow:0 4px 0 #6fa8cf,0 8px 16px #1d4a6a30,inset 0 2px 0 #fff;color:#2465a3}
.hbtn svg{width:40px;height:40px}
.port .hbtn{width:80px;height:80px;border-radius:26px}
.port .hbtn svg{width:44px;height:44px}
.hbtn:active,.lvl:active,.tool:active,.chip:active,.go:active,.swatch:active,.pot:active,.wear:active{transform:translateY(3px)}
.hbtn.kav-off,.hbtn.off{color:#9fb6c8}
.go{border:0;border-radius:40px;padding:0 30px;height:76px;font-weight:900;font-size:29px;color:#fff;letter-spacing:.3px;
  background:linear-gradient(#5cc4ff,#1f7fd6);box-shadow:0 6px 0 #0f4f94,0 12px 24px #0f3a6a55,inset 0 3px 0 #bfe8ff;text-shadow:0 2px 0 #0f4f94}

/* ---------- title ---------- */
.title-card{position:absolute;inset:0;z-index:5}
.title-box{position:absolute;left:34px;top:50%;transform:translateY(-50%);width:470px;padding:24px 26px 18px;border-radius:40px;
  background:linear-gradient(#ffffffef,#e9f7ffef);box-shadow:0 8px 0 #7db6dc,0 20px 40px #1d4a6a40;text-align:center}
.port .title-box{left:30px;right:30px;width:auto;top:34px;bottom:auto;transform:none}
.title-box h1{margin:0;line-height:.95;font-weight:900;font-size:60px;letter-spacing:-.5px}
.title-box h1 .t1{display:block;color:#8a5a2b;text-shadow:0 3px 0 #fff,0 6px 0 #4f3014}
.title-box h1 .t2{display:block;color:#1f86d6;font-size:54px;text-shadow:0 3px 0 #fff,0 6px 0 #0f4f94}
.lead{margin:14px 0 14px;font-size:22px;font-weight:800;line-height:1.3;color:#3d5a72}
.levels{display:flex;gap:12px;justify-content:center}
.lvl{flex:1 1 0;min-width:0;border:0;border-radius:26px;padding:10px 6px 10px;display:flex;flex-direction:column;align-items:center;gap:2px;
  background:linear-gradient(#fffdf4,#ffeec2);box-shadow:0 5px 0 #d4a64a,0 10px 18px #5a3a1430;color:#6b3f12}
.lvl b{font-size:26px;font-weight:900;line-height:1.05}
.lvl small{font-size:17px;font-weight:800;color:#8a6a3a}
.lvl.on{background:linear-gradient(#e2ffd9,#b7ef9f);box-shadow:0 5px 0 #4f9a3c,0 10px 18px #1f4a1430}
.lv-ic{width:66px;height:62px;background:center/contain no-repeat}
.li-little{background-image:url(assets/waddles.png)}
.li-middle{background-image:url(assets/truffle.png)}
.li-big{background-image:url(assets/nugget.png)}
.title-row{display:flex;gap:14px;justify-content:center;align-items:center;margin-top:14px}
.title-note{margin:0;font-size:16px;font-weight:700;color:#5a7488;line-height:1.35;text-align:left}
.title-note a{color:#1f6fb6}

/* ---------- play HUD ---------- */
.play{position:absolute;inset:0}
.hud{position:absolute;left:12px;right:12px;top:10px;height:80px;display:flex;align-items:center;gap:10px;z-index:10}
.goal{flex:1 1 auto;min-width:0;height:70px;border-radius:22px;display:flex;align-items:center;gap:10px;padding:0 14px 0 8px;pointer-events:none;
  background:linear-gradient(#fffffff0,#fff6dcf0);box-shadow:0 4px 0 #d9b25e,0 8px 14px #5a3a1425;font-weight:900;font-size:21px;line-height:1.12;color:#5a3812;overflow:hidden}
.goal span:last-child{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.goal-ic{flex:0 0 auto;width:48px;height:48px;border-radius:50%;background:#fff url(assets/sudsy.png) center 12%/120% no-repeat;box-shadow:inset 0 0 0 3px #f2c75c}
.goal.pulse{animation:pulse .9s ease 2}
@keyframes pulse{50%{transform:scale(1.04);box-shadow:0 4px 0 #d9b25e,0 0 0 8px #ffe27a88}}
.stars{flex:0 0 auto;height:60px;border-radius:28px;padding:0 14px 0 8px;display:flex;align-items:center;gap:6px;
  background:linear-gradient(#fffbe6,#ffe9a6);box-shadow:0 4px 0 #d4a33a;font-weight:900;font-size:26px;color:#8a5a00}
.star-ic{width:38px;height:38px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 2.5l4.1 8.5 9.3 1.3-6.8 6.5 1.7 9.2L16 23.6 7.7 28l1.7-9.2-6.8-6.5 9.3-1.3z' fill='%23ffc928' stroke='%23c58a00' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M11 12.5l2.6-.4' stroke='%23fff6c2' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat}
.stars.bump{animation:bump .5s ease}
@keyframes bump{40%{transform:scale(1.25)}}
.port .goal{position:absolute;left:0;right:0;top:92px;height:60px;font-size:22px}
.port .hud{gap:12px}
.port .hud .stars{margin-left:auto}

/* Sudsy's speech bubble */
.bubble{position:absolute;left:14px;top:98px;max-width:56%;display:flex;align-items:flex-start;gap:8px;z-index:9;pointer-events:none;
  opacity:0;transform:translateY(-8px);transition:opacity .25s,transform .25s}
.port .bubble{top:164px;right:14px;max-width:none}
.bubble.on{opacity:1;transform:none}
.bubble p{margin:0;padding:10px 16px;border-radius:20px 20px 20px 6px;background:#fffffff2;box-shadow:0 4px 0 #9cc6e2,0 8px 14px #1d4a6a30;
  font-weight:800;font-size:20px;line-height:1.25;color:#264a66;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.b-face{flex:0 0 auto;width:52px;height:52px;border-radius:50%;background:#fff url(assets/sudsy.png) center 10%/125% no-repeat;box-shadow:0 3px 0 #9cc6e2,inset 0 0 0 3px #bfe3ff}

/* ---------- tool tray ---------- */
.tray{position:absolute;z-index:8;display:flex;gap:12px}
.land .tray{right:12px;top:100px;bottom:12px;width:124px;flex-direction:column;justify-content:center}
.port .tray{left:12px;right:12px;bottom:12px;height:128px;flex-direction:row;justify-content:center}
.tool{position:relative;border:0;border-radius:26px;padding:6px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  background:linear-gradient(#ffffff,#e8f5ff);box-shadow:0 5px 0 #7fb2d6,0 10px 16px #1d4a6a30;color:#2a5577;font-weight:900;font-size:17px}
.land .tool{width:124px;height:106px}
.port .tool{flex:1 1 0;max-width:146px;height:122px}
.tool img{width:76px;height:64px;object-fit:contain;pointer-events:none;-webkit-user-drag:none}
.tool .num{position:absolute;left:8px;top:6px;width:24px;height:24px;border-radius:50%;background:#2f7fe0;color:#fff;font-size:15px;line-height:24px}
.tool.used{opacity:.55}
.tool.used::after{content:"";position:absolute;right:8px;top:8px;width:26px;height:26px;border-radius:50%;
  background:#3fae49 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/80% no-repeat}
.tool.dim{opacity:.35;filter:grayscale(.6)}
.tool.on{background:linear-gradient(#fff7c9,#ffe27a);box-shadow:0 5px 0 #d4a33a,0 0 0 5px #fff,0 10px 18px #5a3a1440}
.tool.glow{animation:glow 1.1s ease-in-out infinite}
@keyframes glow{50%{box-shadow:0 5px 0 #7fb2d6,0 0 0 7px #ffe27a,0 0 26px 10px #fff6a8}}
.tool.nope,.swatch.nope,.chip.nope,.pot.nope{animation:nope .4s ease}
@keyframes nope{20%{transform:translateX(-8px)}40%{transform:translateX(8px)}60%{transform:translateX(-5px)}80%{transform:translateX(4px)}}

/* ---------- question / color panel ---------- */
.panel{position:absolute;z-index:8;border-radius:30px;padding:8px 14px 12px;text-align:center;
  background:linear-gradient(#fffffff2,#ecf7fff2);box-shadow:0 6px 0 #7fb2d6,0 14px 26px #1d4a6a40}
.land .panel{left:50%;transform:translateX(-50%);bottom:12px;max-width:calc(100% - 300px);min-width:420px}
.land.notray .panel{max-width:calc(100% - 40px)}
.port .panel{left:12px;right:12px;bottom:152px}
.port.notray .panel{bottom:14px}
.panel h2{margin:2px 0 8px;font-size:23px;font-weight:900;color:#264a66;line-height:1.15}
.p-body{display:flex;gap:12px;justify-content:center;align-items:center;flex-wrap:nowrap}
.chip{flex:0 0 auto;min-width:84px;height:84px;border:0;border-radius:24px;padding:0 10px;font-size:44px;font-weight:900;color:#5a3812;
  background:linear-gradient(#fffdf4,#ffe9b0);box-shadow:0 5px 0 #d4a64a,0 10px 16px #5a3a1430}
.chip.glow,.swatch.glow,.pot.glow,.go.glow{animation:glow2 1s ease-in-out infinite}
@keyframes glow2{50%{box-shadow:0 5px 0 #d4a64a,0 0 0 7px #ffe27a,0 0 26px 10px #fff6a8}}
.chip.right{background:linear-gradient(#e2ffd9,#9fe38a);box-shadow:0 5px 0 #3f8f2f}
.swatch{flex:0 0 auto;width:86px;height:86px;border:0;border-radius:50%;padding:0;position:relative;box-shadow:0 5px 0 #0000003a,0 10px 16px #1d4a6a30,inset 0 -8px 12px #00000030,inset 0 8px 10px #ffffff70}
.swatch::after{content:"";position:absolute;left:20%;top:14%;width:30%;height:22%;border-radius:50%;background:#ffffffa0;transform:rotate(-25deg)}
.swatch span{position:absolute;left:-10px;right:-10px;bottom:-26px;font-size:16px;font-weight:900;color:#264a66}
.panel.named .p-body{padding-bottom:22px}
.c-red{background:#e53b3b}.c-orange{background:#f78a1f}.c-yellow{background:#ffd21f}.c-green{background:#3fae49}.c-blue{background:#2f7fe0}
.c-purple{background:#8b4fd6}.c-pink{background:#ff7fb6}.c-lightblue{background:#8fd3ff}.c-white{background:#ffffff}
.pot{flex:0 0 auto;width:84px;height:92px;border:0;padding:0;position:relative;background:none;
  border-radius:0 0 30px 30px}
.pot::before{content:"";position:absolute;left:6px;right:6px;bottom:0;height:62px;border-radius:12px 12px 30px 30px;
  background:linear-gradient(90deg,#d9e4ea,#ffffff 40%,#c3d1da);box-shadow:0 5px 0 #8aa1ae,0 10px 14px #1d4a6a30}
.pot i{position:absolute;left:10px;right:10px;top:16px;height:30px;border-radius:50%;box-shadow:inset 0 -6px 8px #00000030,inset 0 4px 6px #ffffff80}
.pot.on::before{background:linear-gradient(90deg,#ffe9a6,#fffbe6 40%,#f2cf6e);box-shadow:0 5px 0 #c99a2a,0 0 0 5px #fff}
.mixbowl{flex:0 0 auto;width:96px;height:86px;position:relative;margin-left:8px}
.mixbowl::before{content:"";position:absolute;left:0;right:0;bottom:0;height:52px;border-radius:8px 8px 48px 48px;background:linear-gradient(#f4f0e6,#d8cdb6);box-shadow:0 5px 0 #a8957f}
.mixbowl i{position:absolute;left:8px;right:8px;top:22px;height:26px;border-radius:50%;background:#efe9dc;box-shadow:inset 0 -5px 8px #00000025;transition:background .4s}
.plus,.eq{font-size:36px;font-weight:900;color:#3d5a72}
.wear{flex:0 0 auto;width:88px;height:88px;border:0;border-radius:24px;padding:6px;background:linear-gradient(#ffffff,#eef7ff);box-shadow:0 5px 0 #7fb2d6,0 10px 16px #1d4a6a30;
  display:grid;place-items:center;font-weight:900;font-size:17px;color:#2a5577}
.wear img{width:70px;height:64px;object-fit:contain;pointer-events:none}
.wear.on{background:linear-gradient(#fff7c9,#ffe27a);box-shadow:0 5px 0 #d4a33a,0 0 0 4px #fff}

/* ---------- chest sheet ---------- */
.sheet{position:absolute;inset:0;z-index:40;background:#0d2a4166;display:grid;place-items:center}
.sheet-in{width:calc(100% - 40px);height:calc(100% - 40px);border-radius:34px;display:flex;flex-direction:column;overflow:hidden;
  background:linear-gradient(#fffaf0,#ffefd0);box-shadow:0 8px 0 #c99456,0 24px 50px #0d2a4166}
.sh-head{flex:0 0 auto;display:flex;align-items:center;gap:14px;padding:14px 16px;background:linear-gradient(#e94f45,#c4362e);color:#fff}
.sh-head h2{flex:1 1 auto;margin:0;font-size:30px;font-weight:900;text-shadow:0 2px 0 #7a1a12}
.ch-body{flex:1 1 auto;display:flex;gap:14px;padding:14px;min-height:0}
.port .ch-body{flex-direction:column}
.ch-col{flex:1 1 0;min-width:0;min-height:0;display:flex;flex-direction:column;gap:8px}
.ch-col h3{margin:0;font-size:22px;font-weight:900;color:#7a3c16}
.book{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;flex:1 1 auto;min-height:0}
.sticker{border-radius:20px;background:#fff;box-shadow:0 3px 0 #e2c391;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4px;min-height:0;position:relative;font-weight:900;font-size:15px;color:#7a5a3a}
.sticker img{width:100%;height:calc(100% - 22px);min-height:0;object-fit:contain}
.sticker.never img{filter:grayscale(1) brightness(1.3) opacity(.45)}
.sticker b{position:absolute;right:6px;top:4px;min-width:26px;height:26px;border-radius:13px;background:#ffc928;color:#7a4a00;font-size:15px;line-height:26px;text-align:center}
.goods{display:flex;flex-wrap:wrap;gap:10px;align-content:flex-start}
.good{width:96px;height:100px;border:0;border-radius:22px;padding:4px;background:#fff;box-shadow:0 4px 0 #e2c391;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-weight:900;font-size:14px;color:#7a5a3a;position:relative}
.good img{width:64px;height:56px;object-fit:contain}
.good .bub{width:56px;height:56px;border-radius:50%}
.bub-white{background:radial-gradient(circle at 35% 30%,#fff 0 18%,#e8f6ff 40%,#bfe3ff 75%,#ffffff 100%)}
.bub-pink{background:radial-gradient(circle at 35% 30%,#fff 0 18%,#ffe0f0 40%,#ff9fcb 75%,#fff 100%)}
.bub-blue{background:radial-gradient(circle at 35% 30%,#fff 0 18%,#d8f0ff 40%,#5fb6ff 75%,#fff 100%)}
.bub-rainbow{background:conic-gradient(#ff8fb1,#ffd36b,#9be37a,#7cc8ff,#c39bff,#ff8fb1)}
.good.lock{opacity:.6}
.good.lock::after{content:attr(data-need);position:absolute;inset:auto 4px 4px auto;background:#5a3a14;color:#fff;border-radius:10px;padding:1px 7px;font-size:13px}
.good.on{box-shadow:0 4px 0 #d4a33a,0 0 0 4px #ffc928}
.ch-note{margin:0;font-size:18px;font-weight:800;color:#7a5a3a}
