*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
body{
  font-family:"Baloo 2","Comic Sans MS","Chalkboard SE",ui-rounded,system-ui,sans-serif;
  background:linear-gradient(160deg,#e7defc 0%,#d9ccf7 55%,#cfeee2 130%);
  min-height:100dvh;display:flex;align-items:center;justify-content:center;
  color:#43306e;overflow:hidden;
}
.stage{display:flex;align-items:center;justify-content:center;width:100%;height:100dvh;padding:8px}
/* ---------- THE CASE ---------- */
.case{
  width:min(94vw,42rem,calc((100dvh - 18px)*0.72));
  aspect-ratio:72/100;max-height:calc(100dvh - 18px);
  background:
    radial-gradient(circle at 22% 16%,rgba(255,255,255,.55) 0 4px,transparent 5px),
    radial-gradient(circle at 78% 30%,rgba(255,255,255,.45) 0 3px,transparent 4px),
    radial-gradient(circle at 30% 78%,rgba(255,255,255,.4) 0 3px,transparent 4px),
    linear-gradient(165deg,#d9c8fb 0%,#c3aef3 55%,#b298ec 100%);
  border-radius:50% 50% 50% 50%/44% 44% 56% 56%;
  box-shadow:0 18px 40px rgba(90,60,160,.35),inset 0 -14px 28px rgba(120,86,200,.35),inset 0 10px 22px rgba(255,255,255,.5);
  display:flex;flex-direction:column;align-items:stretch;
  padding:7.5% 7% 4.5%;
}
/* ---------- THE SCREEN (inset, contoured, rim all around) ---------- */
.screen{
  flex:1 1 auto;min-height:0;position:relative;
  background:linear-gradient(170deg,#fdfaff 0%,#f1eafd 60%,#e2f5ec 100%);
  border:5px solid #8a6bd6;
  border-radius:50% 50% 50% 50%/34% 34% 30% 30%;
  box-shadow:inset 0 6px 18px rgba(120,86,200,.28),inset 0 -8px 16px rgba(120,86,200,.14);
  overflow:hidden;
}
.screen-inner{position:absolute;inset:0;padding:8.5% 9.5% 6.5%;display:flex}
.view{display:none;flex-direction:column;align-items:center;width:100%;height:100%;min-height:0}
.view.active{display:flex}
.view-title{margin:0 0 4px;font-size:clamp(17px,5.4cqw,26px);font-weight:800;color:#5b439e;text-align:center}
@supports (width:1cqw){.case{container-type:size}}
.speech{
  background:#fff;border:2px solid #cdbcf2;border-radius:999px;
  padding:4px 14px;font-weight:700;font-size:clamp(12px,3.6cqw,17px);color:#6a54a8;text-align:center;
}
.hint{font-size:clamp(11px,3.2cqw,15px);color:#8a76bd;font-weight:700;text-align:center;margin-top:auto;padding-top:4px}
.name-chip{
  background:#7c5cd0;color:#fff;font-weight:800;border-radius:999px;
  padding:3px 18px;font-size:clamp(16px,5cqw,24px);letter-spacing:.5px;
  box-shadow:0 3px 8px rgba(90,60,160,.3);
}
/* ---------- OLIVE ---------- */
.olive-stage{flex:1 1 auto;min-height:0;width:100%;display:flex;align-items:center;justify-content:center;position:relative;cursor:pointer}
.olive-stage svg{height:100%;max-width:88%;filter:drop-shadow(0 6px 8px rgba(90,60,160,.25))}
.olive-stage.small svg{max-width:56%}
.olive-stage.tiny{flex:0 0 34%;cursor:default}
.olive-stage.tiny svg{max-width:100%}
.olive-stage.dress{flex:1 1 auto;min-height:96px;cursor:default}
.olive-stage.dress svg{height:100%;width:auto;max-width:82%}
.bob{animation:bob 2.6s ease-in-out infinite;transform-origin:50% 90%}
@keyframes bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-1.6%)}}
.blink{animation:blink 4.4s infinite;transform-origin:center;transform-box:fill-box}
@keyframes blink{0%,92%,100%{transform:scaleY(1)}95%{transform:scaleY(.08)}}
.hop{animation:hop .45s ease}
@keyframes hop{0%{transform:translateY(0)}40%{transform:translateY(-9%)}100%{transform:translateY(0)}}
.wiggle{animation:wiggle .5s ease}
@keyframes wiggle{0%,100%{transform:rotate(0)}25%{transform:rotate(-4deg)}75%{transform:rotate(4deg)}}
.dance{animation:dance .5s ease-in-out infinite}
@keyframes dance{0%,100%{transform:rotate(-5deg) translateY(0)}50%{transform:rotate(5deg) translateY(-4%)}}
.sleepy{animation:bob 4.5s ease-in-out infinite}
.zzz{animation:zzzfloat 2.8s ease-in infinite;font-weight:800;fill:#8a6bd6}
@keyframes zzzfloat{0%{opacity:0;transform:translateY(4px)}30%{opacity:1}100%{opacity:0;transform:translateY(-10px)}}
.eatfood{transition:all .28s ease}
/* ---------- FX ---------- */
.fx-layer{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.fx-heart{position:absolute;font-size:22px;color:#f278a8;animation:floatup 1.2s ease-out forwards}
.fx-confetti{position:absolute;width:8px;height:12px;top:-14px;animation:confetti-fall linear forwards}
.fx-note{position:absolute;font-size:18px;color:#8a6bd6;animation:floatup 2.6s ease-out forwards}
@keyframes floatup{0%{opacity:0;transform:translateY(8px) scale(.7)}18%{opacity:1}100%{opacity:0;transform:translateY(-64px) scale(1.15)}}
@keyframes confetti-fall{to{transform:translateY(120cqh) rotate(640deg);opacity:.9}}
.plus100{position:absolute;font-weight:800;color:#2f9e6e;font-size:26px;animation:floatup 1.1s ease-out forwards;text-shadow:0 2px 0 #fff}
/* ---------- MENU ---------- */
.menu-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;width:100%;flex:1;align-content:center}
.menu-tile{
  background:#fff;border:3px solid #e0d4fa;border-radius:18px;padding:7px 2px 5px;
  display:flex;flex-direction:column;align-items:center;gap:1px;cursor:pointer;
  font:inherit;font-weight:800;color:#5b439e;font-size:clamp(10.5px,3.1cqw,15px);line-height:1.1;
}
.menu-tile .mt-icon{font-size:clamp(17px,5.4cqw,27px);line-height:1}
.menu-tile.sel{border-color:#7c5cd0;background:#efe8ff;box-shadow:0 0 0 3px #cdbcf2}
/* ---------- METERS ---------- */
.meter-row{display:flex;align-items:center;gap:8px;width:100%;margin:3px 0}
.meter-label{font-weight:800;width:52px;text-align:right;font-size:clamp(12px,3.6cqw,17px)}
.meter{flex:1;height:16px;background:#e9e1fb;border-radius:999px;overflow:hidden;border:2px solid #cdbcf2}
.meter-fill{height:100%;border-radius:999px;transition:width .7s ease}
.meter-fill.tummy{background:linear-gradient(90deg,#ffb35c,#ff8a5c)}
.meter-fill.happy{background:linear-gradient(90deg,#f78fb8,#f278a8)}
.meter-fill.energy{background:linear-gradient(90deg,#ffd95c,#f5b921)}
.meter-fill.love{background:linear-gradient(90deg,#c39bf5,#9a6ae0)}
.meter-val{font-weight:800;width:28px;font-size:clamp(11px,3.2cqw,15px)}
.meters-list{width:100%;display:flex;flex-direction:column;gap:9px;margin-top:8px}
.meters-list .meter{height:20px}
.cared{margin-top:auto;font-weight:800;color:#5b439e;background:#eafaf2;border:2px solid #a9dfc5;border-radius:999px;padding:4px 14px;font-size:clamp(12px,3.6cqw,17px)}
/* ---------- FEED ---------- */
.snack-row{display:flex;gap:8px;justify-content:center;width:100%;margin-top:4px}
.snack{
  background:#fff;border:3px solid #e0d4fa;border-radius:16px;padding:5px 7px;cursor:pointer;font:inherit;
  display:flex;flex-direction:column;align-items:center;font-weight:800;font-size:clamp(10.5px,3cqw,14px);color:#5b439e;min-width:64px;
}
.snack svg{width:30px;height:30px}
.snack.sel{border-color:#7c5cd0;background:#efe8ff;box-shadow:0 0 0 3px #cdbcf2}
/* ---------- SEEK ---------- */
.leaves{display:flex;gap:6px;width:100%;flex:1;align-items:center;justify-content:center}
.leaf{
  flex:1;max-width:31%;aspect-ratio:.82;background:linear-gradient(160deg,#8fd694,#57b368);
  border:4px solid transparent;border-radius:6px 78% 6px 78%;cursor:pointer;position:relative;
  display:flex;align-items:center;justify-content:center;transform:rotate(-8deg);
}
.leaf.focus{border-color:#7c5cd0;box-shadow:0 0 0 4px #cdbcf2}
.leaf .peek-olive{width:78%;display:none}
.leaf.found .peek-olive{display:block}
.leaf.found{background:linear-gradient(160deg,#cdeffd,#a9dfc5)}
/* ---------- ROAD ---------- */
.road-wrap{position:relative;width:100%;flex:1;min-height:0;border-radius:14px;overflow:hidden;background:#79c25f}
#roadCanvas{width:100%;height:100%;display:block}
.road-party{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.road-status{
  display:flex;justify-content:center;align-items:center;width:100%;
  font-weight:800;font-size:clamp(11px,3.4cqw,16px);color:#43306e;padding:4px 6% 0;gap:5px 10px;flex-wrap:wrap;text-align:center;
}
.road-status .hearts{color:#f2547d;letter-spacing:2px}
.road-msg{text-align:center;font-weight:700;color:#8a76bd;font-size:clamp(11px,3.2cqw,15px);padding:0 7%}
.gameover{
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:82%;
  background:#fffdf7;border:3px solid #7c5cd0;border-radius:20px;padding:10px 14px;text-align:center;
  box-shadow:0 10px 24px rgba(67,48,110,.35);z-index:5;
}
.go-title{font-weight:800;font-size:clamp(17px,5cqw,24px)}
.go-score{font-weight:800;color:#2f9e6e}
.go-best{display:inline-block;background:#ffe27a;border-radius:999px;padding:2px 10px;font-weight:800;margin:3px 0}
.scoreboard{margin:6px auto 2px;padding-left:22px;text-align:left;font-weight:700;font-size:clamp(11px,3.2cqw,15px);max-width:250px}
.gameover .hint{margin-top:4px}
/* ---------- DRESS-UP ---------- */
.dress-panel{width:100%;display:flex;flex-direction:column;gap:4px}
.dress-panel .hint{margin-top:0;font-size:clamp(10px,2.9cqw,13px)}
.kind-pills{display:flex;gap:5px;justify-content:center;flex-wrap:wrap}
.kind-pill{
  font:inherit;font-weight:800;border-radius:999px;border:3px solid #e0d4fa;background:#fff;color:#5b439e;
  padding:3px 11px;cursor:pointer;font-size:clamp(11px,3.2cqw,15px);
}
.kind-pill.on{border-color:#7c5cd0;background:#7c5cd0;color:#fff}
.now-wearing{
  display:flex;align-items:center;gap:6px;background:#fff;border:3px solid #e0d4fa;border-radius:16px;padding:4px 8px;
}
.step-btn{
  font:inherit;font-size:22px;font-weight:800;line-height:1;width:38px;height:38px;border-radius:50%;
  border:3px solid #cdbcf2;background:#efe8ff;color:#5b439e;cursor:pointer;flex:0 0 auto;
}
.nw-text{flex:1;text-align:center;min-width:0}
.nw-label{font-weight:800;font-size:clamp(13px,3.9cqw,18px)}
.nw-count{font-weight:700;color:#8a76bd;font-size:clamp(11px,3cqw,14px)}
.nw-dots{display:flex;gap:5px;justify-content:center;margin-top:2px}
.nw-dot{width:11px;height:11px;border-radius:50%;background:#e0d4fa;border:2px solid #cdbcf2;cursor:pointer;padding:0}
.nw-dot.on{background:#7c5cd0;border-color:#7c5cd0}
/* ---------- TIMER ---------- */
.timer-stage{display:flex;align-items:center;width:100%;gap:2%}
.clock-wrap{flex:0 0 52%;display:flex;justify-content:center}
.clock{width:100%;max-width:118px}
@media (min-width:600px) and (min-height:600px){.clock{max-width:205px}}
@media (max-height:860px){#view-timer .view-title{display:none}}
.screen-inner:has(#view-timer.active){padding-top:5.5%;padding-bottom:4%}
.pref-chip{
  font:inherit;font-weight:800;border-radius:999px;border:3px solid #e0d4fa;background:#fff;color:#5b439e;
  padding:4px 12px;cursor:pointer;font-size:clamp(11px,3.2cqw,15px);min-height:32px;width:100%;margin-top:4px;
}
#minPanel .big-start{width:100%;margin-top:4px}
#prefPanel{display:flex;flex-direction:column;gap:7px}
#prefPanel[hidden]{display:none}
.clock-face{fill:#fff;stroke:#e0d4fa;stroke-width:3}
.clock-ring{fill:none;stroke:#8a6bd6;stroke-width:7;stroke-linecap:round;stroke-dasharray:339.3;stroke-dashoffset:0;transform:rotate(-90deg);transform-origin:center;transition:stroke-dashoffset .3s linear}
.clock-text{font-size:30px;font-weight:800;fill:#5b439e;font-family:inherit}
.timer-setup{width:94%;margin:2px auto 0;display:flex;flex-direction:column;gap:4px}
.min-grid{display:flex;gap:4px;justify-content:center;flex-wrap:wrap}
.min-btn{
  font:inherit;font-weight:800;width:37px;height:37px;border-radius:12px;border:3px solid #e0d4fa;background:#fff;color:#5b439e;cursor:pointer;font-size:15px;
}
.min-btn.on{border-color:#7c5cd0;background:#7c5cd0;color:#fff}
.pref-row{display:flex;align-items:center;gap:6px;justify-content:center;flex-wrap:wrap}
.pref-label{font-weight:800;font-size:clamp(11px,3.2cqw,15px)}
.pref-opts{display:flex;gap:4px;flex-wrap:wrap;justify-content:center}
.pref-opt{
  font:inherit;font-weight:700;border-radius:999px;border:2.5px solid #e0d4fa;background:#fff;color:#5b439e;
  padding:2px 9px;cursor:pointer;font-size:clamp(11px,3.1cqw,14px);min-height:31px;
}
.pref-opt.on{border-color:#2f9e6e;background:#eafaf2}
.big-start{
  font:inherit;font-weight:800;font-size:clamp(15px,4.4cqw,20px);border-radius:999px;border:none;cursor:pointer;
  background:linear-gradient(90deg,#f278a8,#f2547d);color:#fff;padding:6px 10px;box-shadow:0 4px 10px rgba(242,84,125,.4);min-height:41px;
}
.timer-running,.timer-party{width:100%;text-align:center}
.party-title{font-weight:800;font-size:clamp(20px,6cqw,30px);color:#f2547d}
/* ---------- SOUND ---------- */
.sound-toggle-row{display:flex;align-items:center;gap:12px;font-weight:800;font-size:clamp(15px,4.4cqw,21px);margin-top:10px}
.toggle{width:64px;height:36px;border-radius:999px;border:3px solid #cdbcf2;background:#e9e1fb;position:relative;cursor:pointer}
.toggle::after{content:"";position:absolute;top:2px;left:3px;width:26px;height:26px;border-radius:50%;background:#fff;box-shadow:0 2px 5px rgba(0,0,0,.2);transition:left .2s}
.toggle[aria-checked="true"]{background:#7ed491}
.toggle[aria-checked="true"]::after{left:31px}
.sound-btns{display:flex;flex-wrap:wrap;gap:7px;justify-content:center;margin-top:14px}
.sound-btn{
  font:inherit;font-weight:800;border-radius:16px;border:3px solid #e0d4fa;background:#fff;color:#5b439e;
  padding:9px 13px;cursor:pointer;font-size:clamp(12px,3.5cqw,16px);min-height:44px;
}
/* ---------- CONTROLS (case) ---------- */
.controls{
  flex:0 0 auto;display:flex;align-items:center;justify-content:center;gap:9%;
  padding-top:2.8%;padding-bottom:1%;
}
.dpad{display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);width:clamp(86px,26%,128px);aspect-ratio:1}
.dp-btn{
  font-size:clamp(11px,3cqw,15px);color:#fff;background:linear-gradient(180deg,#9678dd,#7c5cd0);
  border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;
  box-shadow:0 3px 0 #5f43a8;border-radius:9px;padding:0;min-width:34px;min-height:34px;
}
.dp-btn:active{transform:translateY(2px);box-shadow:0 1px 0 #5f43a8}
.dp-center{background:#6a4db8;border-radius:50%;margin:32%}
.dp-empty{background:transparent}
.round-btns{display:flex;gap:14px;align-items:center}
.round-btn{
  width:clamp(52px,15.5vw,72px);aspect-ratio:1;border-radius:50%;border:none;cursor:pointer;color:#fff;
  font-size:clamp(19px,5.6cqw,27px);display:flex;align-items:center;justify-content:center;
}
.round-btn.pink{background:radial-gradient(circle at 34% 30%,#ffb1c9,#f2547d 72%);box-shadow:0 5px 0 #c93a5f,0 8px 14px rgba(0,0,0,.22)}
.round-btn.purple{background:radial-gradient(circle at 34% 30%,#bda6f2,#7c5cd0 72%);box-shadow:0 5px 0 #5f43a8,0 8px 14px rgba(0,0,0,.22)}
.round-btn:active{transform:translateY(3px)}
.gia-plate{
  align-self:center;background:linear-gradient(90deg,#b8ecd2,#93dfba);color:#43306e;font-weight:800;
  border-radius:999px;padding:3px 20px;font-size:clamp(14px,4.2cqw,20px);letter-spacing:.6px;
  box-shadow:inset 0 2px 4px rgba(255,255,255,.7),0 3px 7px rgba(90,60,160,.3);margin-top:1%;
}
.gia-plate .star{color:#7c5cd0}
.gia-plate .leaf{color:#2f9e6e}
@media (max-height:500px) and (orientation:landscape){
  .case{width:calc((100dvh - 14px)*0.72)}
}
