@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}

/* start */
.start{text-align:center}
.demo{position:relative;height:300px;max-width:420px;margin:6px auto 4px;background:#fffaf0;border:2px solid #30302f;border-radius:32px;overflow:hidden}
.demo-slot{position:absolute;left:50%;top:22px;width:130px;height:122px;margin-left:-65px;display:grid;place-items:center;border:2px dashed #30302f;border-radius:24px;background:#f9f1db}
.demo-slot svg{width:92px;height:92px}.ghost{fill:#30302f}
.demo-opt{position:absolute;bottom:26px;width:112px;height:104px;display:grid;place-items:center;border:2px solid #30302f;border-radius:22px}
.demo-opt svg{width:84px;height:84px}
.demo-opt.a{left:50px;background:#b69be1}.demo-opt.b{right:50px;background:#ffe15a;animation:dflight 4.6s cubic-bezier(.3,.7,.3,1) infinite}
.demo-hand{position:absolute;width:40px;right:74px;bottom:2px;animation:dhand 4.6s ease-in-out infinite;filter:drop-shadow(0 2px 0 rgba(48,48,47,.25))}
@keyframes dhand{0%,12%{transform:translate(0,20px);opacity:0}22%{transform:translate(0,0);opacity:1}30%{transform:translate(0,-4px) scale(.9)}38%,100%{transform:translate(0,10px);opacity:0}}
@keyframes dflight{0%,30%{transform:none;opacity:1}58%{transform:translate(-78px,-148px) scale(.82) rotate(-8deg);opacity:1}64%{transform:translate(-78px,-150px) scale(.9,.74)}70%{transform:translate(-78px,-150px) scale(.82);opacity:1}86%{opacity:0;transform:translate(-78px,-150px) scale(.82)}92%,100%{transform:none;opacity:0}}
.start-help{font-size:21px;line-height:1.35;margin:16px auto 18px;max-width:340px}
.friend-line{display:flex;align-items:center;justify-content:center;gap:14px;font-size:16px;margin:20px 0 0}

/* 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}
body.ml .task{font-size:27px;line-height:1.3}
.task:focus{outline:none}
.slot-row{display:flex;justify-content:center;align-items:center;gap:18px;margin:6px 0 16px}
.slot{position:relative;width:150px;height:140px;display:grid;place-items:center;border:2.5px dashed #30302f;border-radius:26px;background:#f9f1db;transition:border-width .12s,background .2s,transform .2s;flex:none}
.slot svg{width:104px;height:104px;overflow:visible;transition:transform .25s}
.slot.near{border-width:5px;background:#fff3b8}
.slot[data-state=correct]{border-style:solid;background:#61d9b6}
.slot[data-state=hint]{animation:pulse 1.1s ease-in-out infinite}
@keyframes pulse{50%{transform:scale(1.05)}}
.slot .mark,.opt .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}
.slot .mark:empty,.opt .mark:empty{display:none}
.slot .mark{background:#61d9b6}.opt .mark{background:#ffaaa4}
.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}

.options{display:grid;gap:12px;margin:0 auto;max-width:640px;touch-action:none;user-select:none;-webkit-user-select:none}
.options[data-n="2"]{grid-template-columns:repeat(2,1fr);max-width:460px}
.options[data-n="3"]{grid-template-columns:repeat(3,1fr)}
.options[data-n="4"]{grid-template-columns:repeat(2,1fr);max-width:440px}
.opt{position:relative;display:grid;place-items:center;min-height:124px;border:2.5px solid #30302f;border-radius:26px;touch-action:none;cursor:grab;transition:transform .12s,box-shadow .12s;-webkit-touch-callout:none;will-change:transform;padding:0}
.opt svg{width:96px;height:96px;pointer-events:none;overflow:visible}
.opt[data-c="0"]{background:#ffe15a}.opt[data-c="1"]{background:#b69be1}.opt[data-c="2"]{background:#61d9b6}.opt[data-c="3"]{background:#87d1e0}
.opt.pressed{transform:scale(.95)}
.opt.dragging{z-index:5;cursor:grabbing;transform:scale(1.1);box-shadow:0 12px 0 rgba(48,48,47,.2);transition:none}
.opt.back{transition:transform .32s cubic-bezier(.3,1.5,.5,1)}
.opt.wobble{animation:wob .42s ease}
@keyframes wob{20%{transform:rotate(-5deg)}50%{transform:rotate(4deg)}80%{transform:rotate(-2deg)}}
.opt[data-hint=true]{animation:hintbounce .9s ease-in-out infinite}
@keyframes hintbounce{50%{transform:translateY(-8px) scale(1.04)}}
.opt.used{background:transparent!important;border:2.5px dashed #30302f55;box-shadow:none}.opt.used>svg:first-child{visibility:hidden}
.opt[data-gone=true]{pointer-events:none}

.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}
.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}

/* wider screens */
@media(min-width:700px){h1{font-size:60px}.task{font-size:36px}.slot{width:180px;height:166px}.slot svg{width:124px;height:124px}.slot-label{font-size:24px;max-width:190px}.opt{min-height:150px}.opt svg{width:116px;height:116px}.options[data-n="4"]{grid-template-columns:repeat(4,1fr);max-width:640px}.feedback{font-size:21px}.demo{height:340px;max-width:480px}}
/* short landscape phones: two columns so everything stays on screen */
@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{display:grid;grid-template-columns:minmax(210px,34%) 1fr;grid-template-areas:"task options" "slot options" "fb options";column-gap:18px;padding:12px 16px;text-align:left;align-items:center}
 .task{grid-area:task;font-size:22px;margin:0 0 4px}.slot-row{grid-area:slot;margin:0;gap:12px}.slot{width:104px;height:96px}.slot svg{width:70px;height:70px}.slot-label{font-size:16px;max-width:110px}.listen{min-height:40px;padding:0 12px;font-size:15px}
 .options{grid-area:options;max-width:none}.options[data-n="4"]{grid-template-columns:repeat(4,1fr);max-width:none}.opt{min-height:112px}.opt svg{width:78px;height:78px}
 .feedback{grid-area:fb;margin:8px 0 0;font-size:15px;min-height:40px;padding:6px 38px 6px 10px;text-align:left}
 .bottom{margin-top:8px}.friend span{display:none}.start .demo{height:200px}.start h1{font-size:34px;margin-bottom:4px}.start-help{margin:8px auto}.primary.big{min-height:56px}
}
@media(prefers-reduced-motion:reduce){
 .screen{animation:none}.demo-opt.b,.demo-hand,.slot[data-state=hint],.opt[data-hint=true],.end-friend,.friend img{animation:none!important}
 .opt,.opt.back{transition:none}
}
body.rm .screen,body.rm .demo-opt.b,body.rm .demo-hand,body.rm .slot[data-state=hint],body.rm .opt[data-hint=true],body.rm .end-friend,body.rm .friend img{animation:none!important}
body.rm .opt{transition:none}

.opt[data-hint=true]{box-shadow:0 0 0 6px #30302f}
.slot[data-state=hint]{border-style:solid;border-width:5px}
.slot{width:160px;height:150px}.slot svg{width:112px;height:112px}
.options[data-n="2"] .opt{min-height:172px}.options[data-n="2"] .opt svg{width:132px;height:132px}
.options[data-n="3"] .opt{min-height:132px}.options[data-n="3"] .opt svg{width:100px;height:100px}
.options[data-n="4"] .opt{min-height:150px}.options[data-n="4"] .opt svg{width:112px;height:112px}
@media(min-width:700px){.slot{width:190px;height:176px}.slot svg{width:132px;height:132px}.options[data-n="2"] .opt{min-height:220px}.options[data-n="2"] .opt svg{width:170px;height:170px}.options[data-n="3"] .opt{min-height:170px}.options[data-n="3"] .opt svg{width:130px;height:130px}.options[data-n="4"] .opt{min-height:160px}.options[data-n="4"] .opt svg{width:120px;height:120px}}
@media(orientation:landscape) and (max-height:520px){.slot{width:104px;height:96px}.slot svg{width:70px;height:70px}.options .opt{min-height:112px!important}.options .opt svg{width:80px!important;height:80px!important}}

.mark svg{width:18px!important;height:18px!important;display:block}
.slot .mark svg{width:20px!important;height:20px!important}
.opt.used .mark{display:none}
body.ml .overline{letter-spacing:0;text-transform:none;font-size:14px}
@media(max-width:360px){.slot-row{gap:10px}.slot{width:118px;height:112px}.slot svg{width:84px;height:84px}.slot-label{font-size:17px;max-width:120px}.listen{min-height:44px;padding:0 12px;font-size:16px}.task{font-size:24px}h1{font-size:36px}.play-space{padding:14px 12px}.feedback{font-size:16px;padding:8px 38px 8px 10px;min-height:42px}.friend span{font-size:13px}.secondary{font-size:16px;padding:0 14px}}
@media(orientation:portrait) and (max-height:700px){.options{gap:10px}.options[data-n="2"] .opt{min-height:128px}.options[data-n="2"] .opt svg{width:96px;height:96px}.options[data-n="3"] .opt{min-height:104px}.options[data-n="3"] .opt svg{width:76px;height:76px}.options[data-n="4"] .opt{min-height:100px}.options[data-n="4"] .opt svg{width:76px;height:76px}.slot-row{margin:2px 0 10px}.task{margin-bottom:8px}.feedback{margin-top:10px}.top{padding:2px 4px 6px}.dots{margin-top:5px}}
@media(orientation:portrait) and (max-height:700px){.friend span{display:none}.friend img{width:54px;height:auto}.bottom{margin-top:8px}}

.opt.lifted{background:transparent!important;border:2.5px dashed #30302f55}.opt.lifted>svg:first-child{visibility:hidden}.opt.lifted .mark{display:none}
.fly.ghost{filter:drop-shadow(0 10px 0 rgba(48,48,47,.18))}
.fx .fly{overflow:visible}

/* Malayalam: the long word in the side question needs a little more room to stay inside the card */
body.ml .slot-label{font-size:17px;max-width:162px}
@media(min-width:700px){body.ml .slot-label{font-size:22px;max-width:240px}}
@media(max-width:360px){body.ml .slot-label{font-size:16px;max-width:146px}}
@media(orientation:landscape) and (max-height:520px){body.ml .slot-label{font-size:15px;max-width:138px}}
