*{box-sizing:border-box}
body{margin:0;color:#203049;font:600 17px system-ui,sans-serif;background:#fff8f0 url("assets/cream-gold-menu.png") center/cover no-repeat fixed}
header{display:flex;align-items:center;gap:14px;padding:12px max(16px,calc((100% - 1120px)/2));background:linear-gradient(#a7181d,#630c0d);border-bottom:4px solid #e5a323;color:white}
header a,button,.button{font:inherit;text-decoration:none;cursor:pointer;border:2px solid white;border-radius:16px;padding:10px 16px;color:white;background:linear-gradient(#a7181d,#750c10);box-shadow:0 4px #50090b}
header a{background:linear-gradient(#4889ff,#1847c8);box-shadow:none}
#progress{margin-left:auto}
main{width:min(1100px,calc(100% - 26px));margin:32px auto}
h1,h2{text-align:center;color:#851013;margin:0 0 14px}
.hero{margin:0 auto 18px;padding:13px 20px;width:fit-content;border:2px solid #ffb000;border-radius:18px;background:linear-gradient(#a7181d,#620909);box-shadow:0 6px #400709;color:white}
.subtitle{width:fit-content;margin:0 auto 24px;padding:8px 16px;border-radius:12px;background:linear-gradient(#f9a41a,#a94a00);color:white;text-align:center}
.pages{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:16px}
.page{display:flex;align-items:center;gap:12px;min-height:82px;border:2px solid #851013;border-radius:18px;padding:10px;background:#fffdfa;box-shadow:0 5px #650b0c;text-decoration:none;color:inherit}
.page img{width:52px;height:52px;border:2px solid #851013;border-radius:50%;object-fit:cover}
.page small{display:block;color:#526479;margin-top:3px}
.panel{padding:clamp(14px,4vw,40px);border:3px solid white;border-radius:30px;background:linear-gradient(140deg,#fff,#fffaf3);box-shadow:0 9px #e9dac7,0 20px 45px #683b2122;text-align:center}
.instruction{display:inline-block;background:#fff7e9;color:#851013;border:2px solid #f1ddbc;border-bottom:4px solid #e1bb83;border-radius:30px;padding:8px 18px}
.visual{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:5px;margin:18px auto;min-height:92px;max-width:570px;font-size:clamp(28px,6vw,55px)}
.choices{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:18px auto}
.choices button{color:#203049;border:3px solid white;border-bottom:7px solid #279c56;padding:15px 8px;min-height:76px;background:#e7f7ed;box-shadow:0 8px 18px #283a471c;overflow-wrap:anywhere}
.choices button:nth-child(2){background:#fff0d4;border-bottom-color:#ef9226}
.choices button:nth-child(3){background:#f1e6fc;border-bottom-color:#8648c9}
.choices button:nth-child(4){background:#e3effc;border-bottom-color:#3784e9}
.choices button.correct{outline:3px solid #087b37}.choices button.wrong{outline:3px solid #b91b23}
.feedback{min-height:30px;color:#851013}
.controls{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:12px;margin-top:20px}
button:disabled{opacity:.55;cursor:default}
details{margin-top:20px}summary{cursor:pointer;color:#771516}
.book{display:block;max-width:100%;max-height:620px;margin:12px auto;border-radius:14px}
canvas{display:block;width:min(100%,460px);height:auto;margin:16px auto;background:#fff;border:2px solid #e1bb83;border-radius:14px;touch-action:none}
.dots{position:relative;width:min(100%,400px);aspect-ratio:1;margin:auto;background:#fff4df;border-radius:16px}
.dots svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.dots button{position:absolute;translate:-50% -50%;width:36px;height:36px;padding:0;border-radius:50%}
.dots button.joined{background:#27804a;opacity:1;box-shadow:none}
:focus-visible{outline:3px solid #1158c5;outline-offset:4px}
@media(max-width:620px){.choices{grid-template-columns:repeat(2,1fr)}header{gap:8px;font-size:14px}}

.launch{min-height:calc(100svh - 145px);display:grid;align-content:center;justify-items:center}
.launch .hero{font-size:clamp(20px,3vw,27px);padding:13px 32px;margin-bottom:15px}
.launch .subtitle{font-size:14px;margin-bottom:28px}
.launch-card{width:min(100%,470px);min-height:112px;border-width:3px;border-radius:22px;padding:15px 18px;text-align:left;box-shadow:0 7px #620b0d,0 14px 25px #65372226}
.launch-card img{flex:0 0 58px;width:58px;height:58px}
.launch-card progress{display:block;margin:6px 0;width:min(220px,100%);height:8px;accent-color:#b87512}
.activity-count{width:fit-content;border:1px solid #9a1518;color:#851013!important;border-radius:12px;padding:2px 7px;font-size:11px}
.arrow,.round{margin-left:auto;display:grid;place-items:center;width:38px;height:38px;border-radius:50%;flex-shrink:0}
.arrow{color:white;background:linear-gradient(#a7191d,#600509)}
.round{margin-left:0;background:#fffaf5;color:#2a1c16;padding:0;border:2px solid white;box-shadow:0 4px #d9b480}
.topbadge{background:linear-gradient(#ffb326,#b85900);border:2px solid #fff4db;border-radius:24px;padding:5px 14px}
#steps{flex:1;display:flex;justify-content:center;gap:5px}
#steps i{width:9px;height:16px;border:2px solid #c4d4f2;border-radius:8px}
#steps i.current{border-color:#e6b741;background:#e9bb41;box-shadow:inset 0 0 0 1px #fff}
body.playing{width:min(1120px,calc(100% - 22px));margin:18px auto;border:3px solid white;border-radius:34px;overflow:hidden;box-shadow:0 20px 65px #75402f30;background:#f7ebe2}
html:has(body.playing){background:#fff8f0 url("assets/cream-gold-menu.png") center/cover no-repeat fixed}
.playing header{padding:12px 20px;background:linear-gradient(#fff,#fcf6ef);color:#851013;border:0;border-bottom:5px solid #f1e3e4}
.playing header a{background:#fffdf9;color:#851013;box-shadow:0 4px #d9b480}
.playing .topbadge{background:linear-gradient(#a7181d,#680b0d);color:white;border:2px solid #eba517;font-size:14px}
.playing #progress{margin:0;border:2px solid #f0d8ad;border-radius:13px;padding:6px 9px;background:#fffbf2}
.playing main{width:100%;margin:0;padding:24px clamp(10px,4vw,44px) 0;background:linear-gradient(145deg,#fcf3e8,#eee1dd)}
.playing .panel{padding:clamp(14px,4vw,34px);min-height:min(610px,75svh)}
.playing .panel h1{font-size:clamp(22px,3vw,29px);font-weight:850}
.playing .visual{width:min(100%,480px);min-height:clamp(110px,23vh,230px);padding:15px;border-radius:18px;background:linear-gradient(145deg,#dcefff,#fff3d1);font-size:clamp(27px,5vw,53px)}
.playing .choices{max-width:850px;margin:30px auto 6px}
.playing .choices button{min-height:112px;font-size:22px;font-weight:800}
.playing .choices button::after{content:"";display:block;width:17px;height:17px;border:2px solid white;border-radius:50%;background:#e5ecf7;margin:10px auto 0;box-shadow:0 1px 4px #7e99b555}
.game-footer{margin:25px calc(-1 * clamp(10px,4vw,44px)) 0;padding:14px clamp(10px,3vw,30px);background:#fffbf6;display:flex;align-items:center;justify-content:space-between;gap:6px;color:#851013}
.game-footer strong{border-radius:24px;padding:6px 12px;background:white;border-bottom:4px solid #dfafb1;white-space:nowrap}
.game-footer div{display:flex;gap:7px}
.game-footer #hint,.game-footer #back{background:#fffaf4;color:#711215;box-shadow:0 4px #d9b480}
.finish main{min-height:75svh;display:grid;place-items:center}
@media(max-width:620px){.playing .choices button{min-height:70px}.playing header{padding:8px}.playing .topbadge{font-size:11px}.game-footer button{padding:7px 10px}}

.choices[hidden]{display:none}

/* Match the quiz reference's tile proportions and button layout. */
header{position:relative}
#settings-panel{position:absolute;right:16px;top:calc(100% + 4px);z-index:2;background:#fffaf4;color:#851013;padding:12px 16px;border-radius:14px;box-shadow:0 5px 18px #6a302333}
.playing .score{min-width:62px;text-align:center;font-size:14px;line-height:1}
.playing .score small{display:block;margin-top:3px;font-size:10px;color:#9a430a}
.playing .instruction{font-size:14px;font-weight:600}
.playing .visual{width:min(100%,398px);min-height:clamp(125px,29vh,281px);margin:28px auto 42px}
.playing .choices{gap:14px;margin:16px auto 8px}
.playing .choices button{position:relative;min-height:138px;border-width:4px;border-bottom-width:9px;border-radius:23px;padding:16px 8px 39px}
.playing .choices button:nth-child(1){background:linear-gradient(#f7fcf8,#e2f6e9)}
.playing .choices button:nth-child(2){background:linear-gradient(#fffbf2,#fff0d2)}
.playing .choices button:nth-child(3){background:linear-gradient(#fbf7ff,#efe3fa)}
.playing .choices button:nth-child(4){background:linear-gradient(#f4faff,#e1ecfb)}
.playing .choices button::after{position:absolute;bottom:10px;left:50%;translate:-50% 0;width:19px;height:19px;margin:0;box-shadow:inset 0 2px 4px #7e99b54d,0 1px 4px #7e99b54d}
.playing .choices button.correct::after{background:#279c56}
.playing .choices button.wrong::after{background:#b91b23}
.playing .choices button:disabled{opacity:.78}
.playing .choices button.correct{opacity:1}
.large-answers .choices button{font-size:30px}
.game-footer #next{min-width:108px}
@media(max-width:620px){.playing .choices button{min-height:88px;padding-bottom:24px}.playing .choices button::after{bottom:6px;width:15px;height:15px}.playing .visual{margin:18px auto}.game-footer #next{min-width:0}}
.playing .visual[data-scene]{overflow:hidden;border:1px solid #ffffff80;box-shadow:inset 0 -16px 30px #547b5222}
.playing .visual[data-scene="meadow"]{background:linear-gradient(#baecff 0 64%,#d6ef91 65%,#a9d567)}
.playing .visual[data-scene="sunrise"]{background:radial-gradient(circle at 78% 24%,#fff1a8 10%,transparent 11%),linear-gradient(#ffc5a5,#fff2c8 70%,#d0e595 71%)}
.playing .visual[data-scene="ocean"]{background:linear-gradient(#cef4ff,#a4ddfa 58%,#a2efd8 59%,#71cfd0)}
.playing .visual[data-scene="garden"]{background:linear-gradient(#f4e5fd,#fff7df 65%,#c8e498 66%)}
.playing .visual[data-scene="party"]{background:radial-gradient(circle at 23% 28%,#fffde0 8%,transparent 9%),linear-gradient(#d5cdff,#ffe8dc)}
.playing .visual.number-path{font-weight:800;color:#73101b;white-space:pre}
.playing header a{display:grid;place-items:center;width:42px;height:40px;border-radius:50%;padding:0}
.playing .topbadge{box-shadow:0 4px #4e080b,0 7px 12px #6e222431}
.playing .panel{background:linear-gradient(145deg,#fff 0%,#fcf9f3 100%)}
.playing .visual[data-scene]:has(.book-art){background:linear-gradient(155deg,#fffaf0,#fff4df);padding:0;box-shadow:none}
.book-art{height:min(281px,28vh);max-width:100%;position:relative;overflow:hidden;background:#fff;border-radius:13px}
.book-art img{position:absolute;max-width:none}
.playing .choices button{font-size:20px}
.large-answers .choices button{font-size:30px}
.playing .game-footer{border-top:3px solid white}
@media(min-width:800px){.playing .game-footer{display:grid;grid-template-columns:1fr auto 1fr}.playing .game-footer #hint{justify-self:start}.playing .game-footer div{justify-self:end}}
.page-picker{display:grid;gap:12px;width:min(100%,470px);padding:20px;background:#fffaf4;border:3px solid #851013;border-radius:22px}.page-picker select{width:100%;font:inherit;padding:10px;border:1px solid #d4b990;border-radius:10px;background:white;color:#203049}

.playing .visual:has(.reading){flex-direction:column;flex-wrap:nowrap}.reading{margin:0;font-size:clamp(19px,3vw,29px);line-height:1.35;color:#702026;text-align:center}
.playing .visual:has(.pre-primer-art){background:linear-gradient(150deg,#fff,#fff7e9);padding:14px;box-shadow:inset 0 0 0 1px #f2e5d5;gap:12px}
.pre-primer-art{position:relative;overflow:hidden;height:clamp(100px,24vh,230px);max-width:100%;border-radius:12px;flex:none}
.pre-primer-art img{position:absolute;max-width:none;display:block}
.playing .visual:has(.reading) .pre-primer-art{height:clamp(90px,18vh,170px)}
.playing .visual .reading{font-size:clamp(16px,2.3vw,24px)}