:root{font-family:Arial,Helvetica,sans-serif;color:#163f55;background:#102f42;font-synthesis:none}*{box-sizing:border-box}body{margin:0;padding:22px;min-height:100svh;display:grid;place-items:center}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer}button:focus-visible,a:focus-visible,canvas:focus-visible{outline:3px solid #f6b740;outline-offset:4px}button:disabled{cursor:wait;opacity:.65}[hidden]{display:none!important}.game-shell{width:min(1160px,100%);filter:drop-shadow(0 20px 40px #00162266)}.topbar{height:75px;display:flex;align-items:center;justify-content:space-between;background:#fffaf0;padding:12px 25px;border-radius:20px 20px 0 0}.wordmark{display:flex;align-items:center;gap:10px;text-decoration:none;color:#163f55;font-family:Georgia,serif;font-size:14px;line-height:1.2}.wordmark strong{font-size:19px}.mark{background:#f7b638;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;font:bold italic 29px Georgia;color:#163f55}.header-right{display:flex;align-items:center;gap:28px}.book-label,.eyebrow{font-size:12px;font-weight:800;letter-spacing:2px}.small-button{border:1px solid #b4c4c9;color:#163f55;background:transparent;border-radius:9px;min-height:42px;padding:0 15px;font-weight:700}.small-button:disabled{opacity:.35;cursor:default}.game{position:relative;overflow:hidden;height:min(720px,calc(100svh - 150px));min-height:400px;background:#9dd5ee url('assets/balcony.webp') center/cover no-repeat;isolation:isolate}canvas{display:block;width:100%;height:100%;touch-action:none}.overlay{position:absolute;inset:0}.title-screen{background:linear-gradient(90deg,#fff9edfa 0%,#fff9edea 27%,#fff9ed72 52%,#fff9ed00 75%);overflow:hidden}.title-copy{position:absolute;left:7%;top:8%;width:48%;z-index:3}.eyebrow{color:#34667a}h1{font:500 clamp(32px,4.3vw,58px)/1.02 Georgia,serif;letter-spacing:-1.8px;margin:20px 0}h1 em{font-weight:700;font-style:normal;color:#153f57;font-size:1.22em}.intro{font:20px/1.4 Georgia,serif;margin:18px 0 23px}.primary{border:0;border-radius:12px;background:#f6b740;color:#173d50;padding:16px 30px;font-weight:800;font-size:18px;box-shadow:0 4px 0 #d78d20;min-height:54px;transition:transform .15s,background .15s}.primary:hover{background:#ffc755;transform:translateY(-1px)}.primary:active{transform:translateY(3px);box-shadow:0 1px 0 #d78d20}.rules{font-size:14px;line-height:1.6;margin-top:24px}.controls{display:flex;gap:18px;font-size:13px;color:#466477;margin-top:16px}.title-character{position:absolute;right:0;bottom:-2%;width:49%;height:84%;object-fit:contain;filter:drop-shadow(0 12px 5px #4d42202a)}.title-duck{position:absolute;width:9%;object-fit:contain;animation:bob 3s ease-in-out infinite}.d1{right:30%;top:8%;transform:rotate(-15deg)}.d2{right:8%;top:17%;animation-delay:-1.5s}.hud{position:absolute;top:20px;left:22px;right:22px;display:flex;gap:10px;justify-content:space-between;pointer-events:none}.stat{background:#fffaf0f2;border:1px solid #ffffff;border-radius:12px;box-shadow:0 4px 15px #163f5520;padding:12px 18px;min-width:115px}.stat>span{display:block;font-size:11px;letter-spacing:1.4px;font-weight:800;color:#426477}.stat strong{display:block;font-size:30px;line-height:1.3}.stat small{font-size:16px;font-weight:400;color:#597283}.catch-stat{width:220px}.progress{height:5px;background:#dce7e7;border-radius:5px;margin-top:3px;overflow:hidden}.progress i{display:block;background:#288581;height:100%;width:0;transition:width .15s}.miss-stat{margin-left:auto;min-width:126px}.lives{font-size:13px;color:#e89291;letter-spacing:2px}.dialog-screen{display:grid;place-items:center;background:#133f5760;backdrop-filter:blur(5px);padding:20px}.dialog{text-align:center;background:#fffaf0;width:min(450px,95%);padding:40px 30px;border-radius:22px;box-shadow:0 15px 60px #163f5540}.dialog h2{font:700 40px/1.1 Georgia,serif;margin:15px 0;color:#173f55}.dialog p{font-size:17px;line-height:1.5;color:#456573;margin:15px 0}.summary{display:flex;justify-content:center;gap:30px;margin:25px 0;font-size:14px}.summary strong{display:block;font:700 29px Georgia;margin-bottom:6px}.text-button{display:block;margin:20px auto 0;border:0;background:none;color:#486d7d;text-decoration:underline;font-size:14px;padding:8px}.toast{position:absolute;top:36%;left:50%;transform:translate(-50%,-50%);font:bold 38px Georgia;color:#163f55;background:#fffaf0ec;padding:16px 25px;border-radius:15px;pointer-events:none;opacity:0;transition:opacity .2s;text-align:center;white-space:nowrap}.toast.show{opacity:1}footer{display:flex;justify-content:space-between;background:#fffaf0;padding:14px 25px;border-radius:0 0 18px 18px;color:#4d6b78;font-size:12px;letter-spacing:.3px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}@keyframes bob{50%{translate:0 -12px}}@media(max-height:770px) and (min-width:701px){.title-copy{top:5%}h1{font-size:38px;margin:13px 0}.intro{font-size:17px;margin:12px 0 15px}.rules{margin:16px 0 0}.controls{margin-top:10px}.primary{padding:13px 25px}.title-character{height:90%}}@media(max-width:700px){body{padding:0;background:#fffaf0;display:block}.game-shell{width:100%;filter:none}.topbar{height:66px;border-radius:0;padding:10px 16px}.book-label{display:none}.wordmark strong{font-size:16px}.wordmark{font-size:12px}.mark{width:34px;height:34px;font-size:24px}.small-button{padding:0 12px}.game{height:calc(100svh - 106px);min-height:530px}.title-screen{background:linear-gradient(180deg,#fff9edf5 0%,#fff9eddd 43%,#fff9ed20 74%)}.title-copy{top:5%;left:7%;width:86%}h1{font-size:36px;margin:14px 0 10px;line-height:1.05}h1 em{font-size:1.18em}h1 em br{display:none}.intro{font-size:18px;line-height:1.3;margin:13px 0 18px}.intro br{display:none}.title-character{width:58%;height:43%;right:0;bottom:-1%}.title-duck{width:15%}.d1{top:auto;bottom:23%;left:12%}.d2{top:auto;bottom:11%;left:27%}.rules{font-size:14px;margin-top:20px}.controls{font-size:12px;gap:16px}.eyebrow{font-size:10px;letter-spacing:1.6px}.hud{top:12px;left:10px;right:10px;gap:6px}.stat{min-width:0;padding:9px 10px;border-radius:9px}.stat>span{font-size:9px;letter-spacing:.7px}.stat strong{font-size:25px}.stat small{font-size:13px}.stage-stat{width:76px}.catch-stat{flex:1;max-width:180px}.miss-stat{width:95px}.lives{font-size:10px;letter-spacing:1px}.dialog{padding:30px 24px}.dialog h2{font-size:34px}.toast{font-size:27px}footer{border-radius:0;padding:12px 14px;font-size:10px;height:40px}footer span:last-child{display:none}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* A lively storybook title, using the original character artwork. */
.title-screen{background:linear-gradient(100deg,#fff9edf5 0%,#fff9ede8 30%,#fff9ed00 69%)}
.adventure-label{display:inline-block;background:#164c66;color:#fff5d5;padding:9px 14px;border-radius:6px;transform:rotate(-3deg);letter-spacing:1.5px}
h1 em{color:#125674;text-shadow:2px 3px 0 #fff9ed,4px 6px 0 #efb64266}
.title-character{animation:ready-bounce 3s ease-in-out infinite;transform-origin:50% 95%}
.title-duck{animation:duck-tumble 4s ease-in-out infinite;filter:drop-shadow(0 6px 3px #164c6630)}
.d1{right:33%;top:6%}.d2{right:8%;top:12%;animation-delay:-1.7s}.d3{right:22%;top:29%;width:7%;animation-delay:-2.6s}.d4{right:47%;top:67%;width:7%;animation-delay:-.8s}
.title-callout{position:absolute;right:3%;bottom:9%;background:#f8bf47;border:3px solid #fff7df;color:#173f55;padding:15px 20px;border-radius:50%;font:bold 20px/1.2 Georgia;text-align:center;transform:rotate(9deg);box-shadow:0 5px 0 #143f5730}
.title-screen .primary{animation:button-glow 2s ease-in-out infinite}
@keyframes duck-tumble{0%,100%{translate:0 -12px;rotate:-13deg}50%{translate:12px 21px;rotate:15deg}}
@keyframes ready-bounce{50%{transform:rotate(-2deg) translateY(-7px)}}
@keyframes button-glow{50%{box-shadow:0 4px 0 #d78d20,0 0 0 7px #f6b74033}}
@media(max-width:700px){.title-screen{background:linear-gradient(180deg,#fff9edf5 0%,#fff9ede8 44%,#fff9ed00 77%)}.adventure-label{font-size:11px}.d1{top:auto;bottom:25%;left:9%;right:auto}.d2{top:auto;bottom:11%;left:23%;right:auto}.d3{top:auto;bottom:37%;right:15%;width:11%}.d4{display:none}.title-callout{right:auto;left:5%;bottom:3%;font-size:16px;padding:12px}.title-copy{top:4%}.title-character{height:42%}}
@media(prefers-reduced-motion:reduce){.title-character,.title-duck,.title-screen .primary{animation:none}}

/* Edge-to-edge play area. Controls float above the balcony, not outside it. */
html,body{width:100%;height:100%;margin:0;padding:0;overflow:hidden;overscroll-behavior:none}
body{display:block}
.game-shell{position:relative;width:100%;height:100vh;height:100dvh;filter:none}
.game{position:absolute;inset:0;width:100%;height:100%;min-height:0}
.topbar{position:absolute;z-index:5;top:0;left:0;right:0;height:auto;min-height:60px;padding:calc(10px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left));background:transparent;border-radius:0;pointer-events:none}
.topbar .wordmark{display:none}
.header-right{margin-left:auto;gap:8px;pointer-events:auto}
.book-label{display:none}
.small-button{background:#fffaf0ed;box-shadow:0 2px 8px #163f5520;min-height:42px;font-size:14px}
footer{display:none}
.hud{top:calc(16px + env(safe-area-inset-top));left:max(16px,env(safe-area-inset-left));right:250px;justify-content:flex-start}
.miss-stat{margin-left:0}
.title-copy{top:calc(9% + env(safe-area-inset-top));max-height:calc(88% - env(safe-area-inset-top));overflow-y:auto;padding:8px 8px 16px 0}
.dialog-screen{padding-top:calc(70px + env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));overflow:auto}
.dialog{max-height:100%;overflow-y:auto}
.toast{max-width:90%;white-space:normal;font-size:clamp(20px,3vw,38px)}
@media(max-width:800px){
 .hud{top:calc(66px + env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));gap:6px}
 .stat{min-width:0;padding:8px 10px}.stage-stat{width:76px}.catch-stat{flex:1;max-width:180px}.miss-stat{width:95px;margin-left:auto}
 .title-copy{top:calc(65px + env(safe-area-inset-top));max-height:calc(100% - 80px - env(safe-area-inset-top));left:7%;width:86%}
 .title-character{bottom:env(safe-area-inset-bottom)}
}
@media(max-height:500px) and (min-width:600px){
 .title-copy{top:20px;left:5%;width:52%;max-height:calc(100% - 30px)}
 h1{font-size:30px;margin:12px 0}h1 em br{display:none}
 .intro{font-size:16px;margin:8px 0 12px}.rules{margin:12px 0 0}.controls{margin-top:8px}
 .title-character{width:40%;height:85%}.title-callout{font-size:16px;padding:10px}
 .hud{top:calc(62px + env(safe-area-inset-top));right:auto;max-width:65%}
 .stat strong{font-size:22px}.stat>span{font-size:10px}.lives{display:none}
 .dialog{padding:20px}.dialog h2{font-size:28px;margin:8px 0}.summary{margin:12px 0}
}

.stage-total{color:#145674;margin:0 0 18px}.stage-total strong{display:block;font:bold clamp(80px,18vw,130px)/1 Georgia;text-shadow:3px 4px 0 #f6b740}.stage-total span{display:block;font-size:14px;font-weight:800;letter-spacing:1px;margin-top:10px}.stage-total.celebrate strong{animation:stage-flash .8s ease-in-out 3}@keyframes stage-flash{0%,100%{transform:scale(1);color:#145674}50%{transform:scale(1.14);color:#a15a00}}@media(prefers-reduced-motion:reduce){.stage-total.celebrate strong{animation:none}}
/* Larger, glanceable scores on desktop and touch screens. */
.hud{right:240px;gap:12px}.stat{padding:12px 18px;min-width:135px}.stat>span{font-size:14px;letter-spacing:1px}.stat strong{font-size:48px;line-height:1.15}.stat small{font-size:23px}.catch-stat{width:260px}.stage-stat{width:160px}.miss-stat{min-width:150px}.progress{height:8px;margin-top:7px}.lives{font-size:15px}
@media(max-width:1000px){.hud{top:calc(66px + env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));gap:8px}.stat{min-width:0;padding:10px 12px}.stat strong{font-size:42px}.stat small{font-size:20px}.stat>span{font-size:12px;letter-spacing:.5px}.stage-stat{width:120px}.catch-stat{width:auto;max-width:260px;flex:1}.miss-stat{width:130px;margin-left:auto}.lives{font-size:13px}}
@media(max-width:480px){.hud{gap:5px}.stat{padding:9px 8px}.stat strong{font-size:36px}.stat small{font-size:17px}.stat>span{font-size:11px;letter-spacing:0}.stage-stat{width:99px}.miss-stat{width:99px}.lives{font-size:11px;letter-spacing:1px}.catch-stat{min-width:105px}}

.lives{display:grid;grid-template-columns:repeat(5,1fr);max-width:100px;line-height:1.2;white-space:normal;word-spacing:0}

/* Keep the expanded sound controls clear of the larger rescue scores. */
.hud{top:calc(66px + env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right))}.header-right{gap:6px}.title-copy .controls{flex-wrap:wrap}.title-copy .rules{line-height:1.5}

/* Duck Dash title: one complete teatime illustration, with clear play controls. */
.title-screen{background:#fff6e3}.title-scene{position:absolute;right:0;bottom:0;width:62%;height:100%;object-fit:cover;object-position:center}.title-copy{left:5%;top:25%;width:35%;max-height:70%;padding:0;overflow:auto}.title-copy h1{font-size:clamp(32px,4.3vw,62px)}.title-copy h1 em{font-size:1.15em}.title-copy .intro{font-size:18px}.title-copy .adventure-label{font-size:11px;letter-spacing:1px}
@media(max-width:700px) and (orientation:portrait){.title-scene{width:100%;height:51%;object-fit:cover}.title-copy{left:7%;top:calc(73px + env(safe-area-inset-top));width:86%;max-height:calc(49% - 75px);text-align:center}.title-copy h1{font-size:clamp(30px,8vw,43px);margin:8px 0}.title-copy .intro{font-size:16px;margin:8px 0 12px}.title-copy .adventure-label{display:none}.title-copy .primary{padding:12px 25px;min-height:48px}}
@media(max-height:600px) and (orientation:landscape){.title-copy{top:70px;max-height:calc(100% - 80px)}.title-copy h1{font-size:30px;margin:8px 0}.title-copy .intro{font-size:14px;margin:8px 0}.title-copy .adventure-label{display:none}}

.title-scene{object-fit:contain;background:#fff6e3}@media(max-width:700px) and (orientation:portrait){.title-scene{object-fit:contain;object-position:center bottom}}
