:root{color-scheme:light;--ink:#161815;--sun:#eebd0f;--paper:#fff}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--paper);color:var(--ink);font-family:Nunito,'Trebuchet MS',sans-serif}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer}button:focus-visible,a:focus-visible{outline:4px solid #bd7800;outline-offset:6px}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.screen{position:relative;width:100%;height:100svh;min-height:550px;overflow:hidden}.welcome-art{position:absolute;inset:0;width:100%;height:91%;object-fit:contain;object-position:center}.begin{position:absolute;left:50%;bottom:8%;transform:translateX(-50%);border:2px solid var(--ink);border-radius:52% 47% 48% 45%/22% 29% 24% 30%;background:#f9ca27;padding:16px 38px;font-size:clamp(19px,2vw,26px);font-weight:850;white-space:nowrap;box-shadow:3px 4px 0 var(--ink);animation:beckon 3.6s ease-in-out infinite}.begin:hover{animation:none;background:#ffdb5e}.begin span{margin-left:14px}.intro-leaving{animation:leave .7s ease forwards;pointer-events:none}.collection-entering{animation:arrive 1s ease both}.site-footer{position:absolute;bottom:14px;left:24px;right:24px;display:flex;justify-content:center;gap:22px;z-index:10;font-size:13px}.site-footer button{padding:6px 8px;border:0;background:none;color:#514933;text-decoration:underline;text-underline-offset:4px}.credit{align-self:center;color:#514933}.scene{isolation:isolate}.sun-title{position:absolute;top:1.5%;left:50%;transform:translateX(-50%);width:min(620px,95vw);aspect-ratio:2048/590;overflow:hidden;z-index:1}.sun-title img{width:100%;height:auto;display:block}.boat{position:absolute;z-index:4;width:min(650px,70vw);left:50%;bottom:calc(44% - min(40px,4vw));transform:translateX(-50%);animation:boat-rock 6s ease-in-out infinite;transform-origin:50% 80%;pointer-events:none}.sea{position:absolute;inset:56% 0 0;z-index:2;background:linear-gradient(#f9f0cc88,#eff5ea99 48%,#deeae5);border-top:1px solid #9fbaaa44}.surface{position:absolute;top:-32px;left:-25%;width:150%;height:70px;fill:none;stroke:#29362a;stroke-width:2.2;opacity:.45;animation:waves 9s ease-in-out infinite}.surface.back{top:-39px;opacity:.21;animation-direction:reverse;animation-duration:13s}.boat-ripples{position:absolute;left:50%;top:-13px;width:min(610px,72vw);height:30px;transform:translateX(-50%);border:2px solid #6e816866;border-radius:50%;animation:ripple 4.8s ease-out infinite}.boat-ripples.second{animation-delay:2.4s}.underwater-lines{position:absolute;inset:14% 0 0;opacity:.18;overflow:hidden}.underwater-lines i{position:absolute;width:130%;height:35px;left:-15%;border-top:2px solid #62887b;border-radius:50%;animation:waves 12s ease-in-out infinite}.underwater-lines i:nth-child(2){top:30%;animation-delay:-4s}.underwater-lines i:nth-child(3){top:65%;animation-delay:-8s}.bubble{position:absolute;width:8px;height:8px;border:1px solid #657c6b77;border-radius:50%;bottom:-10px;animation:bubble 11s linear infinite}.bubble.b1{left:13%}.bubble.b2{left:35%;animation-delay:-7s;width:5px;height:5px}.bubble.b3{left:72%;animation-delay:-3s}.bubble.b4{left:89%;animation-delay:-9s;width:12px;height:12px}
.games{position:absolute;z-index:6;top:63%;left:50%;transform:translateX(-50%);display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(20px,5vw,100px);width:min(1000px,91%)}.game-link{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;position:relative;text-decoration:none;color:var(--ink);padding:8px 8px 15px;border:2px solid #243e306b;border-radius:43% 51% 38% 47%/21% 31% 27% 29%;background:#ffffff9c;box-shadow:0 8px 0 #59746d12;transition:transform .25s,background .25s,border-color .25s}.game-link:nth-child(2){margin-top:14px;margin-bottom:-14px}.game-link:hover,.game-link:focus-visible{transform:translateY(-7px);background:#fff5c9;border-color:#80661e}.game-link .art{width:100%;height:clamp(70px,14vh,140px);display:flex;align-items:center;justify-content:center}.art img{height:100%;max-width:100%;object-fit:contain;filter:drop-shadow(0 4px 5px #29413e26)}.game-link strong{font-size:clamp(16px,1.8vw,24px);line-height:1.13;max-width:240px}.game-link small{font-size:clamp(10px,1vw,12px);font-weight:650;color:#52625a;letter-spacing:.025em}.game-key{position:absolute;top:10px;left:16px;font-size:12px;opacity:.55}.collection-back{position:absolute;top:20px;left:22px;z-index:8;background:white;border:1px solid #b7b3a6;border-radius:24px;padding:8px 15px;font-size:13px}.collection-footer{bottom:9px}.collection-footer .credit{font-size:12px}
dialog{border:2px solid #252a20;border-radius:24px;background:#fffdf4;color:#20261e;max-width:min(580px,calc(100vw - 32px));max-height:85svh;padding:26px;box-shadow:0 20px 90px #182d3244;line-height:1.6}dialog::backdrop{background:#17262288;backdrop-filter:blur(5px)}dialog h2{margin:0 0 14px;font-size:24px}dialog button{border:1px solid #54461d;border-radius:18px;background:#f5ca38;padding:10px 16px;color:#17231a;margin:6px 5px 6px 0;font-weight:700}dialog li{margin-bottom:8px}.privacy-small{font-size:12px}.privacy-actions{display:flex;gap:6px;flex-wrap:wrap}.privacy-details{font-size:13px}.privacy-details summary{cursor:pointer}.privacy-details ul{padding-left:20px}.text-button{background:transparent!important}.dialog-close{float:right;background:none}.like-status{font-size:13px}
@keyframes beckon{0%,100%{opacity:1;box-shadow:3px 4px 0 #161815}50%{opacity:.52;box-shadow:3px 4px 0 #16181555}}@keyframes boat-rock{0%,100%{transform:translate(-50%,0) rotate(-1deg)}50%{transform:translate(-50%,-7px) rotate(1.1deg)}}@keyframes waves{0%,100%{transform:translateX(-2%) scaleY(.9)}50%{transform:translateX(2%) scaleY(1.15)}}@keyframes ripple{0%{transform:translateX(-50%) scale(.75);opacity:.6}100%{transform:translateX(-50%) scale(1.1,1.5);opacity:0}}@keyframes bubble{from{transform:translateY(0);opacity:0}15%{opacity:.5}to{transform:translate(15px,-38vh);opacity:0}}@keyframes leave{to{opacity:0;transform:scale(1.025)}}@keyframes arrive{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media(max-width:650px){.screen{min-height:620px}.welcome-art{height:75%;top:2%;object-fit:contain;object-position:center}.begin{bottom:15%;font-size:20px;padding:14px 24px}.site-footer{left:8px;right:8px;gap:10px}.sun-title{top:9%;width:110vw;max-width:560px}.boat{width:96vw;bottom:calc(44% - 6vw)}.collection-back{top:12px;left:12px}.games{top:64%;width:96%;gap:8px}.game-link{padding:12px 4px;gap:7px;border-width:1.5px}.game-link .art{height:clamp(65px,11vh,105px)}.game-link strong{font-size:15px}.game-link small{font-size:10px}.game-key{display:none}.collection-footer{flex-wrap:wrap;gap:8px;bottom:12px}.collection-footer .credit{width:100%;text-align:center;order:3;font-size:11px}}
@media(max-height:580px) and (min-width:651px){.screen{min-height:380px}.sun-title{width:350px;top:0}.boat{width:370px;bottom:calc(44% - 23px)}.games{top:64%;gap:45px;width:min(810px,86%)}.game-link{padding:3px 10px 8px;gap:2px}.game-link .art{height:55px}.game-link strong{font-size:16px}.game-link small{display:none}.collection-footer{bottom:3px}.begin{padding:10px 25px;bottom:7%}.site-footer{font-size:11px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}.begin{opacity:1}}

/* Temporary selector: the complete, unaltered illustration supplied by Mr. Salazar. */
.scene .original-scene{position:absolute;inset:0 0 auto;width:100%;height:calc(100% - 145px);object-fit:contain;object-position:center center}
.scene .games{top:auto;bottom:65px;width:min(1050px,94%);gap:18px}
.scene .game-link{padding:13px 16px;min-height:58px;border-radius:12px;border:1.5px solid #24271e;background:#fff;box-shadow:none;justify-content:center;gap:0}
.scene .game-link:nth-child(2){margin:0}
.scene .game-link .art,.scene .game-link small,.scene .game-key{display:none}
.scene .game-link strong{font-size:18px;max-width:none}
.scene .game-link:hover,.scene .game-link:focus-visible{transform:none;background:#fff1b2}
@media(max-width:650px){.scene .original-scene{height:calc(100% - 245px)}.scene .games{bottom:78px;grid-template-columns:1fr;gap:8px;width:min(390px,90%)}.scene .game-link{min-height:44px;padding:10px 12px}.scene .game-link strong{font-size:16px}}
@media(max-height:580px) and (min-width:651px){.scene .original-scene{height:calc(100% - 108px)}.scene .games{bottom:42px;gap:12px}.scene .game-link{min-height:46px;padding:9px 10px}.scene .game-link strong{font-size:15px}}

.game-frame{position:fixed;inset:0;width:100%;height:100%;height:100dvh;border:0;z-index:1000;background:#080b13}.game-open{overflow:hidden}

/* English and Science collections share the same simple navigation. */
a.collection-back{text-decoration:none;color:var(--ink)}
.collection-next{left:auto;right:22px}
#collectionScreen .games{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
#collectionScreen .game-link strong{font-size:16px}
#scienceScreen .games{grid-template-columns:repeat(2,minmax(0,1fr));max-width:800px}
@media(max-width:650px){
 .collection-next{left:auto;right:12px}
 #collectionScreen .games{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 #collectionScreen .game-link strong{font-size:14px}
 #scienceScreen{height:100dvh;min-height:400px}
 #scienceScreen .original-scene{height:calc(100% - 170px)}
 #scienceScreen .games{bottom:70px;width:94%;gap:8px}
 #scienceScreen .game-link strong{font-size:16px}
}

/* Five English games, one compact row. Science keeps its two-card layout. */
#collectionScreen .games{grid-template-columns:repeat(5,minmax(0,1fr));width:min(1120px,94%);gap:10px}#collectionScreen .game-link{padding:11px 8px;min-height:58px}#collectionScreen .game-link strong{font-size:clamp(12px,1.25vw,16px);overflow-wrap:normal}
@media(max-width:650px){#collectionScreen .games{grid-template-columns:repeat(5,minmax(0,1fr));width:96%;gap:4px;bottom:75px}#collectionScreen .game-link{padding:8px 3px;min-height:62px;border-radius:9px}#collectionScreen .game-link strong{font-size:clamp(9px,2.3vw,12px);line-height:1.25}#collectionScreen .original-scene{height:calc(100% - 175px)}}

/* Keep six game links in view, including on shorter displays. */
#collectionScreen{min-height:0}
#collectionScreen .games{grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
#collectionScreen .game-link{padding:6px;min-height:50px;gap:2px}
#collectionScreen .game-link strong{font-size:clamp(11px,1.2vw,15px)}
.game-new{display:block;color:#8d124e;font-size:11px;font-weight:800;line-height:1;animation:game-new-pulse 3.8s ease-in-out infinite}
@keyframes game-new-pulse{0%,100%{opacity:1}50%{opacity:.43}}
@media(max-width:650px){
 #collectionScreen .games{grid-template-columns:repeat(3,minmax(0,1fr));bottom:clamp(47px,11svh,75px);gap:5px}
 #collectionScreen .game-link{min-height:39px;padding:5px 3px}
 #collectionScreen .game-link strong{font-size:clamp(10px,2.45vw,13px)}
 #collectionScreen .original-scene{height:calc(100% - 166px)}
}
@media(prefers-reduced-motion:reduce){.game-new{animation:none}}


#collectionScreen .game-cluster{position:absolute;z-index:6;bottom:65px;left:50%;transform:translateX(-50%);width:min(1120px,94%);min-height:58px;display:grid;place-items:center;pointer-events:none}
#gameToggle{grid-area:1/1;z-index:2;pointer-events:auto;padding:12px 28px;min-height:46px;border-radius:14px;background:#fff5cd;color:var(--ink);border:1.5px solid var(--ink);font:inherit;font-weight:800;cursor:pointer}
#collectionScreen #gameChoices{grid-area:1/1;position:static;transform:none;width:100%;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;opacity:0;visibility:hidden;transform-origin:center;scale:.86 1;transition:opacity .24s ease,scale .24s ease,visibility .24s}
#collectionScreen #gameChoices .game-link{min-height:50px}
#collectionScreen .game-cluster.expanded #gameChoices{opacity:1;visibility:visible;scale:1;pointer-events:auto}
#collectionScreen .game-cluster.expanded #gameToggle{opacity:0;pointer-events:none}
@media(max-height:580px) and (min-width:651px){#collectionScreen .game-cluster{bottom:42px}}
@media(max-width:650px){
 #collectionScreen .game-cluster{bottom:clamp(47px,11svh,75px);width:96%}
 #collectionScreen #gameChoices{gap:4px}
 #collectionScreen #gameChoices .game-link{padding:5px 2px;min-height:54px}
 #collectionScreen #gameChoices .game-link strong{font-size:clamp(9px,2.3vw,12px);overflow-wrap:anywhere}
}
@media(prefers-reduced-motion:reduce){#collectionScreen #gameChoices{transition:none}}

.scene .collection-back{transition:background-color .2s ease}
.scene .collection-back:hover,.scene .collection-back:focus-visible{background-color:#f9ca27}
@media(prefers-reduced-motion:reduce){.scene .collection-back{transition:none}}
