@font-face{font-family:Fredoka;src:url("assets/Fredoka.woff2");font-weight:300 700}
@font-face{font-family:Manjari;src:url("assets/Manjari-Regular.woff2")}
@font-face{font-family:Manjari;src:url("assets/Manjari-Bold.woff2");font-weight:700}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0}
body{background:#f9f1db;color:#30302f;font-family:Fredoka,Manjari,sans-serif;min-height:100dvh;-webkit-text-size-adjust:100%;overscroll-behavior:none}
body.ml{font-family:Manjari,Fredoka,sans-serif}
[hidden]{display:none!important}
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none}
:focus-visible{outline:3px solid #30302f;outline-offset:3px}

/* shared OHO activity bar */
.actbar{position:relative;display:flex;align-items:center;min-height:58px;background:#ff585e;color:#fffaf0;padding:calc(env(safe-area-inset-top,0px) + 8px) 12px 8px;border-radius:0 0 14px 14px;font-size:15px}
.barlinks{display:flex;align-items:center;gap:10px}
.barlinks a{background:#fffaf0;color:#30302f;border-radius:12px;padding:0 12px;height:32px;display:inline-flex;align-items:center;font-size:14px;font-weight:600;text-decoration:none;white-space:nowrap}
.barlogo{position:absolute;left:50%;top:50%;transform:translate(calc(-50% + 10px),-50%);height:32px}
.blang{margin-left:auto;display:flex;gap:8px;align-items:center}
.blang #langswitch{background:#30302f;color:#fffaf0;border-radius:12px;padding:0 12px;height:32px;min-width:72px;font-size:14px;font-weight:600;font-family:Manjari,Fredoka,sans-serif}
.blang #audioswitch{background:#fffaf0;color:#30302f;border:0;border-radius:50%;width:32px;height:32px;display:flex;align-items:center;justify-content:center}
.blang #audioswitch[aria-pressed=true]{background:#30302f;color:#fffaf0}
@media(max-width:360px){.barlogo{height:24px;transform:translate(-50%,-50%)}.barlinks a{font-size:12px;padding:0 8px}}


.game{max-width:760px;margin:0 auto;padding:10px 15px calc(env(safe-area-inset-bottom,0px) + 22px)}
.screen{animation:in .35s ease both}
@keyframes in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.overline{text-transform:uppercase;letter-spacing:2px;font-size:12px;font-weight:700;margin:14px 0 6px}
h1{font-size:44px;line-height:1.04;letter-spacing:-1px;margin:0 0 12px}
body.ml h1{letter-spacing:0;line-height:1.2}

/* buttons: black primary, white secondary (OHO rule) */
.primary,.secondary{display:inline-flex;align-items:center;justify-content:center;min-height:58px;padding:0 28px;border-radius:30px;font-weight:700;font-size:21px;text-decoration:none;touch-action:manipulation;transition:transform .12s}
.primary{background:#30302f;color:#fffaf0}
.secondary{background:#fffaf0;color:#30302f;border:2px solid #30302f;font-size:18px;min-height:52px;padding:0 20px}
.primary:active,.secondary:active{transform:scale(.97)}
.primary.big{min-height:72px;min-width:220px;font-size:28px;border-radius:38px}

/* play */
.top{display:flex;justify-content:flex-end;padding:6px 4px 10px}
.progress{font-size:20px;font-weight:600;margin:0;text-align:right}
.dots{display:flex;gap:7px;margin-top:8px;justify-content:flex-end}
.dots i{width:16px;height:16px;border-radius:50%;border:1.5px solid #30302f;transition:background .25s}
.dots i.done{background:#61d9b6}.dots i.now{background:#ff585e}
.top{flex-direction:column;align-items:flex-end}
.play-space{border:2px solid #30302f;background:#fffaf0;border-radius:32px;padding:18px 16px 18px;text-align:center;position:relative}
.task{font-size:30px;font-weight:650;margin:0 0 12px;line-height:1.15}
.task:focus{outline:none}
.bottom{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-top:14px}
.friend{display:flex;align-items:center;gap:12px;font-size:15px;line-height:1.3;transform-origin:30% 100%}
.friend img{display:block}
.friend.jump img{animation:jump .62s cubic-bezier(.3,.7,.4,1)}
.friend.tilt img{animation:tilt .6s ease}
.friend.look img{animation:look .9s ease}
.friend.bob img{animation:bob 3.2s ease-in-out infinite}
@keyframes jump{0%{transform:none}30%{transform:translateY(-22px) scale(.94,1.08)}55%{transform:translateY(0) scale(1.08,.9)}75%{transform:translateY(-6px)}100%{transform:none}}
@keyframes tilt{35%{transform:rotate(-7deg)}70%{transform:rotate(3deg)}}
@keyframes look{40%,70%{transform:translateX(10px) rotate(4deg)}}
@keyframes bob{50%{transform:translateY(-3px)}}

/* flying clone + sparkles */
.fx{position:fixed;inset:0;pointer-events:none;z-index:50;overflow:hidden}
.fly{position:absolute;left:0;top:0;transform-origin:50% 50%;will-change:transform}
.spark{position:absolute;width:14px;height:14px;margin:-7px;will-change:transform,opacity}

/* end */
.end{text-align:center;padding-top:16px}
.end-friend{animation:jump .9s .2s both}
.end-copy{font-size:22px;line-height:1.4;margin:0 0 22px}
.end-actions{display:flex;flex-direction:column;gap:12px;align-items:center}
.end-actions .primary{min-width:230px}.end-actions .secondary{min-width:230px}
.note{font-size:14px;color:#56534a;margin-top:20px}

.feedback{margin:16px auto 0;max-width:520px;min-height:48px;font-size:19px;line-height:1.3;padding:10px 46px 10px 14px;border:2px solid transparent;border-radius:16px;position:relative;text-align:center}
.feedback[data-s=wrong]{background:#ffaaa4;border-color:#30302f}
.feedback[data-s=correct]{background:#61d9b6;border-color:#30302f}
.feedback .fmark{position:absolute;right:10px;top:8px;font:30px/1 Arial,sans-serif;pointer-events:none}
.friend-line{display:flex;align-items:center;justify-content:center;gap:14px;font-size:16px;margin:20px 0 0}

/* ---- Colour Catch ---- */
.start{text-align:center}
.start-help{font-size:21px;line-height:1.35;margin:16px auto 18px;max-width:340px}
.demo{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;max-width:420px;margin:8px auto 4px;background:#fffaf0;border:2px solid #30302f;border-radius:32px;padding:16px}
.demo img{width:100%;height:84px;object-fit:contain;animation:bobb 3.4s ease-in-out infinite}
.demo img:nth-child(2n){animation-delay:-1.1s}.demo img:nth-child(3n){animation-delay:-2.2s}
.cpill{display:inline-flex;align-items:center;gap:10px;background:#f9f1db;border:2px solid #30302f;border-radius:24px;padding:4px 16px 4px 6px;font-size:22px;font-weight:650;margin:0 0 12px}
.cpill i{width:30px;height:30px;border-radius:50%;border:2px solid #30302f;display:block}
.things{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;max-width:600px;margin:0 auto;position:relative;z-index:1}
.thing{position:relative;display:grid;place-items:center;min-height:132px;border:2.5px solid #30302f;border-radius:26px;background:#ece3cf;padding:10px;touch-action:manipulation;-webkit-touch-callout:none;user-select:none;-webkit-user-select:none;transition:background .2s,transform .12s;animation:bobb 3.6s ease-in-out infinite}
.thing:nth-child(2){animation-delay:-.7s}.thing:nth-child(3){animation-delay:-1.4s}.thing:nth-child(4){animation-delay:-2.1s}.thing:nth-child(5){animation-delay:-2.8s}.thing:nth-child(6){animation-delay:-3.2s}
@keyframes bobb{50%{transform:translateY(-6px)}}
.thing img{width:100%;max-width:104px;height:98px;object-fit:contain;pointer-events:none}
.thing.pressed{transform:scale(.95)}
.thing .mark{position:absolute;right:-6px;top:-8px;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;border:2px solid #30302f;pointer-events:none}
.thing .mark:empty{display:none}
.thing .mark svg{width:18px;height:18px;display:block}
.thing.found{background:#61d9b6;animation:none;border-width:4px}.thing.found .mark{background:#61d9b6}
.thing.wrong{background:#ffaaa4;animation:wob .42s ease}.thing.wrong .mark{background:#ffaaa4}
@keyframes wob{20%{transform:rotate(-5deg)}50%{transform:rotate(4deg)}80%{transform:rotate(-2deg)}}
.thing[data-hint=ring]{box-shadow:0 0 0 6px #30302f;animation:ringp 1s ease-in-out infinite}
.thing[data-hint=lift]{box-shadow:0 0 0 6px #30302f;animation:hintbounce .9s ease-in-out infinite}
@keyframes ringp{50%{box-shadow:0 0 0 9px #30302f}}
@keyframes hintbounce{50%{transform:translateY(-10px) scale(1.05)}}
.wash{position:absolute;inset:0;border-radius:30px;pointer-events:none;opacity:0;z-index:0}
.wash.go{animation:washa 1.5s ease-out both}
@keyframes washa{0%{opacity:0;transform:scale(.4)}25%{opacity:.55}100%{opacity:0;transform:scale(1.25)}}
.shake{animation:wob .42s ease}
.fx .fly{overflow:visible}
body.rm .thing,body.rm .demo img,body.rm .thing[data-hint],body.rm .wash.go{animation:none!important}
@media(prefers-reduced-motion:reduce){.thing,.demo img,.thing[data-hint]{animation:none!important}.wash.go{animation:none!important}}
@media(max-width:360px){.thing{min-height:104px;padding:6px}.thing img{max-width:84px;height:78px}.things{gap:9px}.task{font-size:24px}h1{font-size:36px}.play-space{padding:14px 12px}.feedback{font-size:16px;padding:8px 38px 8px 10px}.cpill{font-size:19px}}
@media(orientation:portrait) and (max-height:700px){.thing{min-height:104px}.thing img{height:78px}.friend span{display:none}.friend img{width:54px;height:auto}.bottom{margin-top:8px}}
@media(min-width:700px){.thing{min-height:170px}.thing img{max-width:140px;height:132px}.things{gap:16px}.cpill{font-size:26px}}
@media(orientation:landscape) and (max-height:520px){
 .game{max-width:none;padding:6px 14px 12px}.top{flex-direction:row;justify-content:space-between;align-items:center;padding:0 4px 6px}.dots{margin:0}
 .play-space{padding:10px 14px}.task{font-size:20px;margin:0 0 4px}.cpill{margin:0 0 6px;font-size:17px;padding:2px 12px 2px 4px}.cpill i{width:22px;height:22px}
 .things{grid-template-columns:repeat(6,1fr);gap:8px}.thing{min-height:96px;padding:4px}.thing img{max-width:74px;height:68px}
 .feedback{margin:8px 0 0;font-size:15px;min-height:40px;padding:6px 38px 6px 10px}.bottom{margin-top:8px}.friend span{display:none}
}
.slot-side{display:flex;flex-direction:column;align-items:flex-start;gap:10px;text-align:left}
.slot-label{font-size:21px;line-height:1.25;margin:0;max-width:150px}
.listen{display:inline-flex;gap:8px;align-items:center;border:2px solid #30302f;background:#f9f1db;border-radius:22px;min-height:48px;padding:0 16px;font-size:18px;font-weight:600;touch-action:manipulation}
.listen.muted{opacity:.55}
.feedback[data-s=hint]{background:#fff6dc;border-color:#30302f;padding-right:14px}
#endTitle:focus,#endTitle:focus-visible{outline:none}
