:root{--ink:#243d35;--muted:#6e7c73;--paper:#f7f5ed;--green:#31634e;--line:#dedfd3;--mint:#e8f0d9;--lavender:#efebf7;--sand:#f8efdf;--sage:#edf2eb;--warm:#d4a267}
*{box-sizing:border-box}
html,body{height:100%;margin:0;overflow:hidden;overscroll-behavior:none;touch-action:manipulation;-webkit-text-size-adjust:100%}
body{background:var(--paper);color:var(--ink);font-family:ui-rounded,'Avenir Next',Avenir,system-ui,sans-serif}
body *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
img{pointer-events:none;-webkit-user-drag:none}
button,select{font:inherit;color:inherit;-webkit-tap-highlight-color:transparent;cursor:pointer}
button:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #8a70c4;outline-offset:3px}
main{height:100dvh;display:flex;flex-direction:column;padding:max(10px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left))}

.toolbar{flex:none;display:flex;align-items:center;justify-content:space-between;gap:8px}
.stars{font-weight:800;font-size:20px;color:#c98a2e;min-width:60px}
.stars.bump{animation:bump .5s ease-out}
.controls{display:flex;gap:6px}
select,.icon-button{height:40px;border:1px solid var(--line);border-radius:10px;background:transparent;padding:0 10px;font-size:14px;font-weight:600}
.icon-button{width:40px;padding:0;font-size:17px}
#case[aria-pressed=false]{text-transform:none;opacity:.7}
#mute[aria-pressed=true]{text-decoration:line-through;opacity:.6}

.board{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:space-evenly;gap:12px;padding:8px 0}
.picture{position:relative;flex:1 1 0;min-height:90px;max-height:46vh;width:min(100%,560px);border:1px solid #dce6ce;border-radius:28px;background:var(--mint);padding:0;overflow:hidden}
.picture img{position:absolute;inset:8%;width:84%;height:84%;object-fit:contain;filter:drop-shadow(0 10px 0 #264b3212)}
.picture:active{transform:scale(.98)}
.picture.spawn{animation:spawn .4s ease-out}

.slots{flex:none;display:flex;gap:clamp(6px,1.6vw,14px);justify-content:center}
.slot{width:clamp(52px,12vw,96px);height:clamp(62px,14vw,112px);border-radius:16px;border:3px dashed #c3cbbb;background:#fffdfa;display:grid;place-items:center;font-size:clamp(32px,8vw,64px);font-weight:800;color:var(--green)}
.slot.current{border:3px solid var(--green);background:#fff;animation:pulse 1.2s ease-in-out infinite}
.slot.filled{border:3px solid var(--green);background:var(--mint);animation:pop .35s ease-out}
.slots.done .slot{animation:hop .6s ease-in-out calc(var(--i) * 90ms) 2;background:#deefda}

.choices{flex:none;display:flex;gap:clamp(12px,3vw,28px);justify-content:center}
.choice{width:clamp(84px,20vw,150px);height:clamp(84px,20vw,150px);border-radius:24px;border:2px solid var(--line);background:#fffdf9;font-size:clamp(44px,11vw,84px);font-weight:800;color:var(--ink);box-shadow:0 5px 0 #243d3518;transition:transform .12s,opacity .2s}
.choice:nth-child(3n+2){background:var(--lavender)}
.choice:nth-child(3n){background:var(--sand)}
.choice:hover:not(:disabled){transform:translateY(-3px)}
.choice:active:not(:disabled){transform:translateY(2px);box-shadow:0 2px 0 #243d3518}
.choice.wrong{animation:shake .4s;border-color:var(--warm)}
.choice:disabled{opacity:.28;cursor:default}
.choice.right{border-color:var(--green);background:#deefda}
.choices.locked .choice{pointer-events:none}

.uppercase-words .slot,.uppercase-words .choice{text-transform:uppercase}
.slot,.choice{text-transform:lowercase}

.burst{position:fixed;inset:0;pointer-events:none;overflow:hidden}
.burst i{position:absolute;left:50%;top:45%;font-style:normal;font-size:clamp(22px,4vw,38px);animation:fly 1.3s cubic-bezier(.2,.7,.3,1) forwards}

.audio-status{flex:none;margin:0;text-align:center;font-size:11px;color:#a34732}
.audio-status:empty{display:none}
.credits{position:fixed;right:12px;bottom:max(8px,env(safe-area-inset-bottom));font-size:11px;color:var(--muted);max-width:min(380px,80vw);text-align:right}
.credits summary{list-style:none;cursor:pointer;display:inline-grid;place-items:center;width:22px;height:22px;border:1px solid var(--line);border-radius:50%;font-family:Georgia,serif;font-style:italic}
.credits summary::-webkit-details-marker{display:none}
.credits p{background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:10px;margin:6px 0 0;text-align:left;-webkit-user-select:text;user-select:text}
.credits a{color:var(--green)}

@keyframes pulse{50%{box-shadow:0 0 0 7px #31634e22}}
@keyframes pop{0%{transform:scale(.6)}70%{transform:scale(1.12)}100%{transform:scale(1)}}
@keyframes hop{50%{transform:translateY(-16px) rotate(-4deg)}}
@keyframes shake{20%,60%{transform:translateX(-9px)}40%,80%{transform:translateX(9px)}}
@keyframes spawn{0%{transform:scale(.9);opacity:.3}70%{transform:scale(1.03)}100%{transform:scale(1);opacity:1}}
@keyframes bump{40%{transform:scale(1.35)}}
@keyframes fly{0%{transform:translate(-50%,-50%) scale(.4);opacity:1}100%{transform:translate(calc(-50% + var(--x)),calc(-50% + var(--y))) scale(1) rotate(var(--r));opacity:0}}

@media(max-height:560px){.board{gap:6px;padding:4px 0}.picture{max-height:34vh}.slot{height:clamp(46px,11vh,80px);width:clamp(40px,9vh,70px);font-size:clamp(26px,7vh,48px)}.choice{width:clamp(64px,17vh,110px);height:clamp(64px,17vh,110px);font-size:clamp(34px,9vh,64px)}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
.start{position:fixed;inset:0;z-index:10;border:0;background:#f7f5edee;font-size:clamp(36px,8vw,64px);font-weight:800;color:var(--green)}
