:root{font-family:ui-rounded,"Arial Rounded MT Bold",Nunito,system-ui,sans-serif;color:#243c5f;background:#fff3cf;touch-action:manipulation}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;min-height:100dvh;background:radial-gradient(circle at 13% 4%,#fffbec 0 15%,transparent 45%),linear-gradient(155deg,#fff1c9,#ffdabf 55%,#d4f4ed);overflow-x:hidden}button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}button:focus-visible{outline:4px solid #245ac9;outline-offset:3px}.wrap{width:min(1100px,100%);min-height:100dvh;margin:auto;padding:clamp(12px,2vw,25px);display:flex;flex-direction:column;gap:12px}.top{display:flex;align-items:center;justify-content:space-between;gap:10px}.brand{display:flex;align-items:center;gap:11px;font-size:clamp(22px,3.5vw,33px);font-weight:1000;letter-spacing:-.045em}.brand-icon{display:grid;place-items:center;width:48px;height:48px;border-radius:17px;background:#ffcd53;box-shadow:0 5px 0 #e9a832;transform:rotate(-8deg);font-size:28px}.top-actions{display:flex;align-items:center;gap:8px}.age-pill,.icon-btn{background:#fff;border:2px solid #fff;box-shadow:0 5px 0 #50678122;border-radius:999px;font-weight:900;color:#3f5878}.age-pill{padding:9px 13px}.icon-btn{width:44px;height:44px;font-size:21px}.heading{text-align:center}.heading h1{font-size:clamp(30px,5.4vw,58px);letter-spacing:-.06em;line-height:1.05;margin:0;text-wrap:balance}.heading h1 span{color:#f1724b}.heading p{font-size:clamp(13px,2vw,18px);color:#526b88;font-weight:750;margin:6px 0 0}.game-shell{position:relative;flex:1;min-height:410px;max-height:650px;border:5px solid white;border-radius:32px;overflow:hidden;background:linear-gradient(#8bd8ef 0%,#c6f4ed 70%,#c0e685 70%,#8bca68);box-shadow:0 13px 0 #8db9b4,0 25px 36px #365e7250;isolation:isolate}.stage-art{position:absolute;inset:0;pointer-events:none;overflow:hidden}.sun{position:absolute;top:15%;right:13%;width:75px;aspect-ratio:1;border-radius:50%;background:#fff7c9}.hill{position:absolute;bottom:-6%;height:36%;width:70%;border-radius:50% 50% 0 0;background:#9ad67a}.hill-a{left:-22%}.hill-b{right:-17%;background:#a3df7e}.flower{position:absolute;bottom:10%;font-size:22px}.f1{left:10%}.f2{left:30%;bottom:17%}.f3{right:23%;bottom:12%}.f4{right:8%;bottom:21%}.hud{position:absolute;top:12px;left:12px;right:12px;display:flex;justify-content:space-between;gap:8px;z-index:4}.hud-left,.hud-right{display:flex;gap:7px;flex-wrap:wrap}.hud-badge,.hud-button{min-height:42px;display:inline-flex;align-items:center;justify-content:center;padding:7px 11px;background:#fffdf6;border:2px solid #fff;border-radius:15px;box-shadow:0 4px 0 #32536a25;font-weight:1000;font-size:clamp(13px,2vw,17px);white-space:nowrap}.hud-button{color:#2b486a}.timer-track{position:absolute;z-index:3;top:63px;left:14px;right:14px;height:10px;background:#ffffffa9;border-radius:99px;overflow:hidden}.timer-track>div{height:100%;width:100%;border-radius:99px;background:linear-gradient(90deg,#ffce4e,#f17754)}#catch-canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none}.screen{position:absolute;inset:0;z-index:6;display:grid;place-items:center;padding:15px;background:#2b658b26;backdrop-filter:blur(5px)}.card{width:min(560px,100%);max-height:100%;overflow:auto;background:#fffdf6;border:5px solid white;border-radius:29px;text-align:center;padding:clamp(15px,2.5vw,25px);box-shadow:0 10px 0 #d7ba74,0 25px 40px #3c60705a}.hero{font-size:clamp(45px,7vw,67px);line-height:1.1}.card h2{font-size:clamp(25px,4.5vw,38px);letter-spacing:-.05em;line-height:1.07;margin:6px 0 8px}.card p{font-size:clamp(14px,2vw,17px);line-height:1.4;font-weight:740;color:#526981;margin:8px 0 12px}.level-list{display:grid;gap:8px;margin:14px 0}.level-option{width:100%;min-height:67px;display:flex;align-items:center;text-align:left;gap:13px;border:2px solid #def0e7;background:#effaf2;color:#243d60;border-radius:17px;padding:8px 13px;box-shadow:0 3px 0 #bbd9c9}.level-option:not(:disabled):hover{background:#e2f7e7}.level-option:disabled{opacity:.65;cursor:default;background:#f0f1ed}.level-emoji{font-size:30px;width:38px;text-align:center}.level-copy{flex:1;display:grid;gap:2px}.level-copy strong{font-size:17px}.level-copy small{font-size:12px;color:#577083;font-weight:800}.level-mark{font-size:20px}.primary,.secondary{min-height:53px;border:0;border-radius:17px;padding:11px 20px;font-size:18px;font-weight:1000}.primary{background:#ffca42;color:#263759;box-shadow:0 5px 0 #db9b32}.secondary{background:#e8f6f3;color:#365875;box-shadow:0 5px 0 #b5d7d3}.action-row{display:flex;justify-content:center;gap:9px;flex-wrap:wrap;margin-top:16px}.small{font-size:12px!important;color:#788a9a!important}.challenge-head{text-align:center;z-index:1;position:relative;margin:75px auto 13px;max-width:650px;padding:0 10px}.challenge-icon{font-size:34px}.challenge-head h2{margin:0;font-size:clamp(24px,4vw,37px);letter-spacing:-.05em}.challenge-head p{margin:3px 0;color:#385878;font-size:clamp(12px,1.9vw,16px);font-weight:800}.memory-stage,.maze-stage{position:absolute;inset:0;overflow:auto;padding-bottom:15px}.memory-grid{position:relative;z-index:1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:clamp(7px,2vw,14px);width:min(480px,92%);margin:auto}.memory-card{aspect-ratio:1/1;min-height:65px;border:3px solid white;border-radius:18px;background:#fff9e8;color:#2f4e71;box-shadow:0 6px 0 #caa96b;display:grid;place-items:center;font-size:clamp(30px,6vw,50px);font-weight:1000;transition:transform .15s,background .15s}.memory-card.is-hidden{background:#ffcb65}.memory-card.is-hidden:after{content:'✦';font-size:clamp(30px,5vw,47px)}.memory-card.is-hidden .face{visibility:hidden;position:absolute}.memory-card.is-matched{background:#c7f1d3;box-shadow:0 5px 0 #80bd96}.memory-card:active{transform:translateY(3px)}.maze-grid{position:relative;z-index:1;display:grid;grid-template-columns:repeat(5,1fr);gap:clamp(3px,.8vw,8px);width:min(410px,88vw);margin:auto}.maze-cell{aspect-ratio:1;border:2px solid #ffffffc4;border-radius:clamp(10px,2vw,17px);background:#fffde9c9;box-shadow:0 3px 0 #618b6d5a;font-size:clamp(20px,4.4vw,35px);display:grid;place-items:center;padding:0;color:#3a6080}.maze-cell.wall{background:#8bc8a0;border-color:#8bc8a0;box-shadow:inset 0 3px 0 #6aa485;cursor:default}.maze-cell.player{background:#ffe291;box-shadow:0 4px 0 #d7aa58}.maze-cell.goal{background:#e1d5ff}.maze-cell.next{outline:3px dashed #429b6c;outline-offset:-5px}.maze-progress{position:relative;z-index:1;width:max-content;max-width:95%;margin:10px auto 0;background:#fffef1;border-radius:14px;padding:7px 13px;font-size:15px;font-weight:950}.bottom-bar{min-height:65px;display:grid;place-items:center;padding:0 5px}.bar-hint{font-weight:850;color:#466981;text-align:center}.move-controls{width:100%;display:flex;justify-content:space-between;align-items:center;gap:10px}.move-controls span{text-align:center;font-weight:850;color:#466981;font-size:14px}.control,.dpad button{border:0;min-width:83px;min-height:58px;background:#fff;color:#2a4b77;font-size:27px;font-weight:1000;border-radius:19px;box-shadow:0 5px 0 #b7d5d1;touch-action:none;user-select:none}.dpad{display:grid;justify-items:center;gap:5px}.dpad>div{display:flex;gap:8px}.dpad button{min-width:58px;min-height:43px;font-size:21px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:699px){.hud-left .hud-badge:first-child{display:none}.wrap{padding:9px 9px 12px;gap:8px}.brand{font-size:22px;gap:7px}.brand-icon{width:39px;height:39px;font-size:22px}.age-pill{font-size:11px;padding:7px 9px}.icon-btn{width:40px;height:40px}.heading h1{font-size:clamp(27px,8vw,40px)}.heading p{font-size:12px}.game-shell{min-height:350px;max-height:none;border-width:4px;border-radius:25px}.card{padding:15px;border-width:4px}.card p{font-size:14px}.level-list{margin:10px 0}.level-option{min-height:59px}.challenge-head{margin-top:75px}.memory-grid{width:min(400px,92%)}.bottom-bar{min-height:62px}}@media(max-width:390px){.age-pill{display:none}.memory-card{min-height:58px}.level-copy strong{font-size:15px}.level-copy small{font-size:11px}}@media(max-height:720px) and (max-width:699px){.heading p{display:none}.heading h1{font-size:25px}.game-shell{min-height:310px}.bottom-bar{min-height:49px}.control{min-height:48px}.challenge-head{margin-top:70px;margin-bottom:6px}.challenge-icon{display:none}.challenge-head h2{font-size:23px}.maze-grid{width:min(250px,45vh)}.memory-grid{width:min(340px,70vh)}.card{padding:11px}.hero{font-size:35px}.card h2{font-size:24px}}@media(min-width:700px) and (pointer:fine){.move-controls{display:none!important}.bottom-bar{min-height:25px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
.top{position:sticky;top:0;z-index:20;padding:5px 7px;border-radius:18px;background:#fff8e4e8;backdrop-filter:blur(9px)}.home-btn{min-height:44px;padding:7px 13px;border:2px solid #fff;border-radius:15px;background:#fff;color:#2c4d72;box-shadow:0 4px 0 #50678122;font-weight:1000;white-space:nowrap}.home-btn:hover{background:#ecfaf4}@media(max-width:699px){.age-pill{display:none}.home-btn{min-height:40px;padding:6px 10px;font-size:14px}}@media(max-width:350px){.brand{font-size:20px}.home-btn{padding:6px 8px}}
/* Use the width of tablet screens for the level picker. */
@media(min-width:700px){
  .game-shell{border-width:3px;border-radius:24px;box-shadow:0 7px 0 #8db9b4,0 16px 26px #365e7236}
  .screen{padding:10px}
  .menu-card{width:min(960px,100%);padding:12px;background:transparent;border:0;box-shadow:none}
  .menu-card .level-list{grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;margin:12px 0}
  .menu-card .level-option{position:relative;min-height:145px;flex-direction:column;justify-content:center;text-align:center;gap:5px;padding:15px 12px}
  .menu-card .level-emoji{font-size:36px;width:auto}
  .menu-card .level-copy{flex:none}
  .menu-card .level-copy strong{font-size:17px;line-height:1.2}
  .menu-card .level-copy small{font-size:12px;line-height:1.2}
  .menu-card .level-mark{position:absolute;top:8px;right:10px}
}
@media(min-width:700px) and (max-height:820px){
  .wrap{padding:9px 12px;gap:7px}
  .brand-icon{width:40px;height:40px;font-size:22px}
  .brand{font-size:26px}
  .heading h1{font-size:clamp(32px,4.5vw,45px)}
  .heading p{display:none}
  .game-shell{max-height:none;min-height:0}
  .menu-card .hero,.menu-card .small{display:none}
  .menu-card h2{margin:0 0 5px}
  .menu-card p{margin:0 0 9px}
  .bottom-bar{min-height:0}
  .bar-hint{display:none}
}
@media(max-width:699px){.menu-card .level-list{grid-template-columns:1fr}}
@media(max-width:699px) and (max-height:720px){.menu-card .small{display:none}}
@media(min-width:700px){.dpad{display:none!important}.bottom-bar{min-height:0}}
@media(min-width:700px) and (max-height:820px){.maze-grid{width:min(380px,55vh)}.challenge-head{margin-top:70px;margin-bottom:8px}.maze-progress{margin-top:6px}}
@media(min-width:700px) and (max-height:820px){.challenge-icon{display:none}.challenge-head{margin-top:65px;margin-bottom:6px}.maze-grid{width:min(360px,52vh)}.maze-progress{margin-top:5px}.memory-stage,.maze-stage{padding-bottom:0}}
@media(min-width:700px){.maze-stage{padding-bottom:0}}
@media(min-width:700px) and (min-height:821px){.maze-grid{width:min(390px,88vw)}}
