@charset "UTF-8";
.brand-wrap{display:flex;align-items:center;gap:12px}.brand-friends{display:none;align-items:end}.brand-friends img:first-child{width:38px}.brand-friends img:last-child{height:53px}.item-svg{width:90%;height:80%;min-height:0;flex:1;display:block;overflow:hidden}
:root{color-scheme:light;--purple:#5930ac;--deep:#342452;--yellow:#ffda5b;--ink:#352747;--scene:#75b32d;font-family:"Trebuchet MS","Arial Rounded MT Bold",Arial,sans-serif;color:var(--ink);font-synthesis:none}
*{box-sizing:border-box}body{margin:0;min-height:100vh;background:#a9db5c url('assets/world.png') center 32%/cover fixed}body:before{content:"";position:fixed;inset:0;z-index:-1;background:linear-gradient(180deg,#def4ffbd 0%,#eef7cd77 40%,#6eac2433 80%);pointer-events:none}button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:4px solid #ef8e15;outline-offset:5px}button:disabled{cursor:default}button,dialog{color:inherit}.topbar{max-width:1420px;margin:auto;padding:25px 44px 0;display:flex;align-items:center;justify-content:space-between;gap:16px}.brand{display:flex;flex-direction:column;align-items:center;line-height:1.05;color:var(--purple);font-weight:900;transform:rotate(-2deg)}.brand>span{font-size:26px;letter-spacing:-1.4px;text-shadow:0 2px 0 white}.brand i{font-style:normal;font-size:20px;color:#60822b}.brand small{font-size:12px;letter-spacing:5.5px;padding-top:6px;margin-left:5px}.toolbar{display:flex;gap:10px;align-items:center}.soft-button,.round-button{border:2px solid #fff;background:#ffffffd9;box-shadow:0 3px 0 #586c4122;font-weight:bold;min-height:46px}.soft-button{border-radius:17px;padding:0 18px}.soft-button span{font-size:24px;vertical-align:-2px;margin-right:7px}.round-button{width:46px;border-radius:50%;font-size:23px;position:relative}.sound-off{position:absolute;left:22px;top:8px;font-weight:normal}.chapter{text-align:center;margin:25px auto 23px;padding:0 18px}.chapter-tag,.eyebrow{font-size:12px;font-weight:900;letter-spacing:2.7px;color:#4a6630}.chapter-tag:before,.chapter-tag:after{content:"—";margin:0 12px;opacity:.5}h1{font-size:clamp(29px,3.4vw,46px);letter-spacing:-1.6px;line-height:1.1;margin:9px 0 10px;font-weight:900;color:var(--deep);text-shadow:0 2px 0 #fff9}.chapter p{margin:0;font-size:16px;color:#45523d}.play-area{display:grid;grid-template-columns:minmax(105px,190px) minmax(0,820px) minmax(110px,190px);gap:16px;align-items:end;max-width:1260px;padding:0 22px;margin:auto}.game-panel{background:#fffffff2;border:3px solid #fff;border-radius:30px;box-shadow:0 12px 0 #5e742826,0 20px 60px #3e5a1829;padding:20px 24px;min-width:0;position:relative}.game-top{display:flex;align-items:center;justify-content:space-between;gap:10px}.level-pill{font-size:14px;font-weight:900;color:var(--purple);background:#f0e9fb;padding:10px 14px;border-radius:13px}.stats{display:flex;gap:20px}.stats>span{font-size:13px;color:#7b7283;display:flex;align-items:center;gap:8px}.stats strong{font-size:20px;color:var(--deep)}.progress{height:5px;border-radius:10px;background:#ece6f2;margin:17px 0 21px;overflow:hidden}.progress>div{height:100%;width:0;background:#98ca49;border-radius:10px;transition:width .4s}.board{--cols:3;display:grid;grid-template-columns:repeat(var(--cols),minmax(0,1fr));gap:13px;max-width:480px;margin:0 auto;perspective:900px}.card{aspect-ratio:1.05;position:relative;border:0;padding:0;background:transparent;border-radius:17px;min-width:0;touch-action:manipulation}.card-inner{display:block;width:100%;height:100%;position:relative;transition:transform .36s;transform-style:preserve-3d}.card.open .card-inner,.card.matched .card-inner{transform:rotateY(180deg)}.card-face{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;backface-visibility:hidden;border-radius:17px;overflow:hidden}.card-back{color:#e0caff;background:linear-gradient(135deg,#8050c6,#5930ac);border:3px solid #6a3aae;box-shadow:0 5px 0 #402178,inset 0 0 0 4px #ffffff12}.card-back:before{content:"";position:absolute;inset:12px;border:1.5px dashed #ffffff36;border-radius:10px}.card-back span{font-size:48px;font-weight:900;transform:rotate(-9deg);line-height:1;text-shadow:0 3px #0002}.card:not(.open):not(.matched):hover .card-back{background:linear-gradient(135deg,#9160d5,#693abd)}.card:not(.open):not(.matched):active{transform:translateY(3px)}.card-front{transform:rotateY(180deg);background:white;border:3px solid #e5d8f4;box-shadow:0 4px 0 #d9cbe8;padding:9px;flex-direction:column;gap:3px}.card-front img{height:80%;width:94%;object-fit:contain}.card-front .item-art{width:80%;aspect-ratio:1;background-image:url('assets/items.png');background-size:400% 400%;flex:1;min-height:0;max-width:100%;background-repeat:no-repeat}.card-front small{font-size:12px;font-weight:bold;line-height:1.15}.card.matched .card-front{border-color:#9acb57;box-shadow:0 4px 0 #81ae42;background:#f9fff1}.card.matched .card-front:after{content:"✓";position:absolute;right:5px;top:4px;width:21px;height:21px;border-radius:50%;background:#77a536;color:#fff;font-size:14px;font-weight:bold}.board-footer{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-top:24px;min-height:34px}.text-button{background:none;border:0;font-size:14px;color:var(--purple);font-weight:bold;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:10px 4px;min-height:42px}.text-button:disabled{opacity:.4}.text-button b{background:#efe5fb;width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-size:12px}#feedback{font-size:13px;text-align:center;color:#677052}.companion{display:flex;flex-direction:column;align-items:center;padding-bottom:22px;min-width:0}.companion img{width:100%;height:auto;object-fit:contain;filter:drop-shadow(0 12px 8px #49691922)}.companion.kumka img{margin-top:13px}.companion.dumka img{max-height:290px}.companion strong{margin-top:10px;color:#3f5527;font-size:18px;text-shadow:0 1px white}.speech{position:relative;max-width:175px;padding:15px 14px;background:#ffffffe8;border-radius:20px 20px 20px 3px;box-shadow:0 4px 0 #607b2122;font-size:14px;line-height:1.45;font-weight:bold;text-align:center}.dumka .speech{border-radius:20px 20px 3px 20px;margin-bottom:10px}.journey{max-width:720px;padding:20px 24px;margin:27px auto 18px;text-align:center;border-radius:24px;background:#fff9;backdrop-filter:blur(10px);box-shadow:0 5px 20px #41651b10}.journey-caption{font-size:10px;letter-spacing:3px;font-weight:900;color:#566439}.journey>div{display:flex;justify-content:space-between;gap:10px;margin:13px 0}.world-button{border:0;background:none;display:flex;align-items:center;gap:7px;padding:5px 7px;border-radius:12px;font-size:13px;color:#5b6944}.world-button>span{width:27px;height:27px;display:grid;place-items:center;border-radius:50%;border:1px solid #8d9f71;font-weight:bold}.world-button.active{color:var(--purple);font-weight:bold}.world-button.active>span{background:var(--purple);border-color:var(--purple);color:white}.completed-label{font-size:12px;color:#5c6849}dialog{width:min(620px,calc(100% - 28px));padding:30px;border:3px solid #fff;border-radius:28px;box-shadow:0 22px 100px #1f164066;background:#fffefb;max-height:90dvh}dialog::backdrop{background:#24371188;backdrop-filter:blur(6px)}.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px}h2{font-size:29px;line-height:1.15;color:var(--purple);margin:8px 0}.dialog-head .round-button{flex-shrink:0;background:#f1ebf7;border:0}.save-note{font-size:13px;color:#797180;line-height:1.5}.rules{padding-left:26px}.rules li{padding:10px 0;line-height:1.5}dialog>p{line-height:1.5}#levelsGrid section h3{font-size:15px;margin:23px 0 10px}#levelsGrid section>div{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}.level-button{background:#f1ebfa;border:2px solid transparent;border-radius:15px;padding:12px 3px;color:var(--purple);display:flex;flex-direction:column;align-items:center;gap:6px}.level-button strong{font-size:21px}.level-button small{font-size:12px}.level-button.done{background:#edf7db;color:#487118}.level-button.current{border-color:var(--purple)}.primary-button{background:var(--purple);color:#fff;border:0;border-bottom:5px solid #3c1b7d;border-radius:17px;font-size:17px;font-weight:bold;padding:17px 27px;min-height:54px}.primary-button:hover{background:#6d40bc}#winDialog{text-align:center;width:min(480px,calc(100% - 28px))}#winDialog .eyebrow{color:#8c710f}#winDialog .text-button{display:flex;margin:12px auto 0}.celebration{font-size:49px;color:#edb929;letter-spacing:10px;margin:8px 0 15px}.win-characters{height:135px;display:flex;align-items:end;justify-content:center;margin:15px 0 24px;gap:16px}.win-characters img:first-child{width:120px}.win-characters img:last-child{height:140px}.board.dense{max-width:650px;gap:9px}.board.dense .card{aspect-ratio:1.05}.board.dense .card-back span{font-size:34px}.board.dense .card-front{padding:5px}.board.dense .card-front small{font-size:12px}.board.dense .card-back:before{inset:7px}.board.dense .card-face{border-radius:12px}body[data-world="1"]{--scene:#e1a43d}body[data-world="2"]{--scene:#277c60}body[data-world="3"]{--scene:#574993}body[data-world="2"]:before{background:linear-gradient(#cef0ded9,#639c6866)}body[data-world="3"]:before{background:linear-gradient(#ded7ffdf,#48468488)}body[data-world="3"] .chapter p,body[data-world="3"] .chapter-tag{color:#3f3556}
@media(min-width:1450px){.chapter{margin-top:42px;margin-bottom:32px}.play-area{max-width:1380px;grid-template-columns:200px minmax(0,880px) 200px}.board{max-width:490px}.journey{margin-top:38px}}
@media(max-width:1000px){.play-area{grid-template-columns:95px minmax(0,1fr) 100px;gap:9px;padding:0 17px}.speech{font-size:12px;padding:12px 9px}.game-panel{padding:18px}.companion.dumka img{max-height:220px}.companion strong{font-size:15px}.board-footer{flex-wrap:wrap}#feedback{order:3;width:100%;min-height:16px}.topbar{padding:20px 25px 0}.chapter{margin-top:22px}.journey{max-width:620px}}
@media(max-width:680px){body{background-position:center top;background-attachment:scroll}.topbar{padding:15px 15px 0}.brand>span{font-size:21px;letter-spacing:-1px}.brand small{font-size:10px;letter-spacing:4px}.toolbar{gap:6px}.soft-button{font-size:13px;padding:0 10px;min-height:41px}.soft-button span{display:none}.round-button{width:40px;min-height:40px;font-size:20px}.sound-off{top:6px;left:20px}.chapter{margin:24px auto 18px;padding:0 12px}.chapter-tag{font-size:10px;letter-spacing:2px}.chapter-tag:before,.chapter-tag:after{margin:0 6px}h1{font-size:29px;letter-spacing:-1px}.chapter p{font-size:14px;max-width:280px;margin:auto;line-height:1.45}.play-area{display:block;padding:0 12px;position:relative}.game-panel{padding:15px 13px;border-radius:23px;border-width:2px}.companion{display:none}.stats{gap:13px}.stats>span{font-size:12px;gap:5px}.stats strong{font-size:18px}.level-pill{font-size:12px;padding:9px 10px}.progress{margin:14px 0 17px}.board{gap:11px;max-width:440px}.card-face{border-radius:13px}.card-back span{font-size:40px}.card-front{padding:6px}.card-front small{font-size:12px}.board-footer{margin-top:16px}.text-button{font-size:13px}.journey{margin:21px 12px 15px;padding:16px 12px;border-radius:20px}.journey>div{gap:2px}.world-button{flex-direction:column;font-size:12px;gap:5px;padding:4px 2px;flex:1}.journey-caption{font-size:10px}.board.dense{gap:7px}.board.dense .card{aspect-ratio:.92}.board.dense .card-front small{display:none}.board.dense .card-front{padding:3px}.board.dense .card-front img{height:95%}.board.dense .card-front .item-art{width:100%;flex:none}.board.dense .card-back span{font-size:25px}.board.dense .card-back:before{inset:5px}.board.dense .card-face{border-width:2px;border-radius:10px}.board.dense .card.matched .card-front:after{height:15px;width:15px;font-size:11px;top:2px;right:2px}dialog{padding:22px 18px}h2{font-size:25px}#levelsGrid section>div{gap:6px}.level-button{padding:12px 0}.level-button small{font-size:11px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media(max-width:680px){.brand-wrap{gap:4px}.brand-friends{display:flex}.brand>span{font-size:18px}.brand small{font-size:9px;letter-spacing:3px}.brand-friends img:first-child{width:28px}.brand-friends img:last-child{height:44px}.toolbar{gap:5px}.round-button{width:36px;min-height:36px}.soft-button{min-height:36px;padding:0 9px}.board.dense .item-svg{width:100%;height:100%}.card.matched .item-svg{mix-blend-mode:multiply}}
@media(max-width:350px){.brand-friends{display:none}.topbar{padding-inline:12px}.stats{gap:9px}.game-panel{padding:13px 10px}.board.dense{gap:6px}}

/* Branded game surface */
.brand-friends{display:flex}.brand-friends img:first-child{width:51px}.brand-friends img:last-child{height:74px}.brand>span{font-size:31px}.brand small{font-size:12px;letter-spacing:3px}.brand-wrap{gap:12px}.topbar{padding-top:17px}.brand{transform:none}.card-back{flex-direction:column;padding:8px;background:linear-gradient(145deg,#7647be,#4c2391)}.card-back .card-brand-art{display:flex;align-items:end;justify-content:center;width:100%;height:60%;transform:none;font-size:initial;text-shadow:none;position:relative;z-index:1}.card-brand-art img:first-child{width:45%;height:64%;object-fit:contain}.card-brand-art img:last-child{width:43%;height:100%;object-fit:contain}.card-back .card-brand-name{font-size:clamp(12px,1.15vw,19px);line-height:1;transform:none;color:#fff6cb;text-align:center;letter-spacing:-.3px;text-shadow:0 2px 0 #2d1358;font-weight:900;z-index:1}.card-brand-name i{font-style:normal;color:#bee66e;font-size:.8em}.card-back:before{inset:7px}.board.dense .card-back .card-brand-name{font-size:13px}.board.dense .card-back .card-brand-art{font-size:initial}.speech{font-size:16px}.chapter p{font-size:17px}.stats>span{font-size:14px}.text-button{font-size:15px}#feedback{font-size:14px}.journey-caption{font-size:12px;letter-spacing:2px}.world-button{font-size:14px}.completed-label{font-size:14px}
@media(max-width:680px){.brand-wrap{gap:7px}.brand-friends img:first-child{width:33px}.brand-friends img:last-child{height:52px}.brand>span{font-size:23px}.brand small{font-size:10px;letter-spacing:2px}.topbar{flex-wrap:wrap;justify-content:center;padding-top:12px;gap:12px}.toolbar{gap:9px}.soft-button{font-size:14px;min-height:44px;padding:0 15px}.round-button{width:44px;min-height:44px}.chapter{margin-top:19px}.chapter p{font-size:16px}.chapter-tag{font-size:12px}.level-pill{font-size:14px}.stats>span{font-size:14px}.card-front small{font-size:12px}.board.dense .card-front small{display:block;font-size:12px;line-height:1.15}.board.dense .card-front img,.board.dense .item-svg{height:78%;width:90%;flex:1;min-height:0}.world-button{font-size:13px}.board.dense .card-back .card-brand-name{font-size:12px}.card-back .card-brand-name{font-size:16px}.text-button{font-size:14px}.brand-friends{display:flex}}

/* Five adventures, one consistent Kumka i Dumka identity. */
body{background-image:var(--world-art,url('assets/world.png'));background-position:center 32%;background-size:cover;background-attachment:fixed}
body[data-scene="forest"]{background-position:center center;background-color:#4c7e40}
body[data-scene="forest"]:before{background:linear-gradient(#d9efbc70,#b5d78630)}
body[data-scene="night"]{background-position:center center;background-color:#191a54}
body[data-scene="night"]:before{background:linear-gradient(#100d3818,#2014412e)}
body[data-scene="night"] h1,body[data-scene="night"] .brand>span{color:#fff6d5;text-shadow:0 2px 4px #15123a}
body[data-scene="night"] .chapter p,body[data-scene="night"] .chapter-tag,body[data-scene="night"] .brand small,body[data-scene="night"] .companion strong{color:#fffbe5;text-shadow:0 2px 3px #17143c}
body[data-scene="night"] .brand i{color:#cbea8b}
.difficulty-badge{display:inline-flex;align-items:center;padding:6px 13px;border-radius:20px;background:#fff8d2;color:#654913;border:1px solid #dfc46280;font-size:14px;font-weight:bold;margin:1px 0 12px}
.chapter p{max-width:640px;margin:auto;line-height:1.45}
.game-panel{max-width:100%}.game-top{flex-wrap:wrap}.board{max-width:500px}.board.dense{max-width:730px;gap:11px}.board.dense .card{aspect-ratio:.83}.board.dense .card-front{padding:6px 5px}.card-front small{display:block;font-size:13px;line-height:1.1;max-width:100%;overflow-wrap:anywhere;hyphens:auto;text-align:center}.card-front img,.item-svg{flex:1;min-height:0}
.card-back .card-brand-art{flex:1;min-height:0}.card-back .card-brand-name{flex:none;padding-bottom:4px}.board.dense .card-back .card-brand-name{font-size:14px}.card-back:before{pointer-events:none}
.journey{max-width:880px}.journey>div{gap:8px}.world-button{flex:1;flex-direction:column;gap:8px;line-height:1.2}.world-button>span{width:32px;height:32px;flex-shrink:0}.journey-caption{letter-spacing:2px}
.world-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0 12px}.world-tab{font:inherit;border:2px solid #e7dcf5;background:#fff;border-radius:13px;font-size:14px;line-height:1.2;min-height:44px;padding:9px 13px;color:var(--purple);font-weight:bold}.world-tab[aria-pressed="true"]{background:var(--purple);border-color:var(--purple);color:white}
#chapterDescription{font-size:16px;line-height:1.45;color:#665c71}#levelsGrid section h3{font-size:16px;line-height:1.4}#levelsGrid section>div{grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}.level-button{min-height:68px}.level-button strong{font-size:24px}.level-button small{font-size:13px}.save-note{font-size:14px}.win-brand{display:block;color:var(--purple);font-size:20px;font-weight:900;margin:13px 0 8px}.win-characters{height:155px}.win-characters img:first-child{width:115px}.win-characters img:last-child{height:155px}
@media(min-width:1100px){.companion{position:sticky;bottom:24px}.play-area{align-items:start}.companion img{margin-top:20px}.companion.dumka img{height:300px}.companion.kumka{margin-top:100px}}
@media(max-width:680px){body{background-attachment:fixed}.board.dense{gap:9px}.board.dense .card{aspect-ratio:.78}.board.dense .card-face{border-radius:12px}.board.dense .card-front small{font-size:12px;display:block}.board.dense .card-back .card-brand-name{font-size:13px}.card-back{padding:7px 5px}.card-back:before{inset:4px}.board.dense .card-back:before{inset:4px}.world-button{font-size:13px;min-width:80px}.journey>div{display:flex;flex-wrap:wrap;justify-content:center;gap:12px 3px}.journey>div>.world-button{flex:0 0 29%}.chapter p{max-width:350px}.difficulty-badge{font-size:14px}.stats{gap:14px}.stats strong{font-size:19px}.board-footer{gap:4px 12px}.level-pill{padding:9px 10px}.game-top{gap:12px}.level-button small{font-size:12px}.world-tabs{gap:7px}.world-tab{padding:9px 11px;font-size:14px}.speech{font-size:14px}.brand>span{font-size:25px}.brand small{font-size:12px;letter-spacing:2px}}
@media(max-width:390px){.game-top{justify-content:center}.stats{flex:1;justify-content:center}.level-pill{flex:0 0 auto}.chapter h1{font-size:28px}.board.dense .card-back .card-brand-name{font-size:12px}}

/* Keep the active round and its controls on screen; large boards scroll internally. */
@media(max-width:680px),(max-height:700px){
 html{height:100%;overflow:hidden}
 body{height:100dvh;min-height:0;overflow:hidden;display:flex;flex-direction:column;padding-bottom:54px}
 .topbar{flex:none;width:100%;padding:8px 12px 0;gap:6px;flex-wrap:nowrap;justify-content:space-between}
 .brand-wrap{min-width:0;gap:4px}.memory-brand-duo{display:none!important}
 .topbar .kd-logo{width:100px;max-height:45px;object-fit:contain}.topbar .kd-brand small{display:none}
 .toolbar{gap:5px}.soft-button{padding:0 10px;min-height:44px}.round-button{width:44px;min-height:44px}
 body>main{flex:1;min-height:0;display:flex;flex-direction:column;padding-top:5px}
 .chapter{flex:none;margin:4px auto 8px;padding:0 12px}.chapter-tag,.difficulty-badge{display:none}
 .chapter h1{font-size:22px;letter-spacing:-.4px;margin:0 0 4px}.chapter p{font-size:14px;line-height:1.25;max-width:none}
 .play-area{display:block;flex:1;min-height:0;width:100%;padding:0 10px}
 .companion,.journey{display:none}
 .game-panel{height:100%;display:flex;flex-direction:column;padding:10px;border-radius:20px}
 .game-top{flex:none;flex-wrap:nowrap;justify-content:space-between;gap:8px}.level-pill{font-size:12px;padding:6px 8px}.stats{flex:0 1 auto;gap:9px}.stats>span{font-size:12px}.stats strong{font-size:16px}
 .progress{flex:none;margin:7px 0 10px;height:4px}
 .board,.board.dense{width:100%;min-height:0;overflow-y:auto;overscroll-behavior:contain;align-content:start;grid-auto-rows:max-content;align-items:start;flex:1;scrollbar-gutter:stable;padding:3px 4px 8px;gap:9px}
 .card{min-height:44px}.board-footer{flex:none;margin-top:7px;min-height:44px;gap:5px}.board-footer .text-button{min-height:44px;font-size:12px}#feedback{font-size:12px;line-height:1.2}
}

.memory-save-status{padding:10px 14px;margin:10px 0;border:2px solid #854116;border-radius:14px;background:#fff6e8;color:#512807;font-size:14px;line-height:1.4}.memory-save-status[hidden]{display:none}.memory-save-status p{margin:0 0 6px}.memory-save-status button{min-height:44px;white-space:normal}

#winDialog button:disabled{opacity:.45;cursor:not-allowed}

/* Whole character illustrations use the available card area, never intrinsic image height. */
.card-front > .memory-figure{display:block;position:relative;width:94%;height:80%;flex:1;min-height:0;min-width:0;overflow:hidden}
.card-front > .memory-figure > img{display:block;position:absolute;inset:0;width:100%;height:100%;object-fit:contain}

/* A single portrait card is a close-up, not a shared character scale scene. */
[data-kd-game="memory"] .card-front > .memory-figure[data-character] > img{height:100%;width:100%;max-width:100%;object-position:center}
[data-kd-game="memory"] .pair-picture .memory-figure[data-character] > img,[data-kd-game="memory"] .memory-collection-art .memory-figure[data-character] > img{height:100%;width:100%;object-position:center}
