:root{font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;color:#263f3b;background:#f6f5f0;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a,input,select{touch-action:manipulation}button{cursor:pointer;color:inherit}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #8c572b;outline-offset:5px}button{border:0}header{max-width:1280px;margin:auto;display:flex;justify-content:space-between;align-items:center;padding:32px 48px;border-bottom:1px solid #ddded5}.brand{display:flex;align-items:center;gap:12px;font-size:28px;font-weight:750;letter-spacing:-1px;text-decoration:none;color:inherit}.brand-icon{background:#dce7c9;border-radius:12px;padding:1px 10px;font-size:32px}.tag{font-size:12px;letter-spacing:.4px;font-weight:500;border-left:1px solid #cdd3ca;padding-left:17px;margin-left:10px;color:#68766e}.quiet,.back{background:transparent;padding:12px 16px;border:1px solid #d4d9ce;border-radius:12px;font-size:14px}.quiet span{margin-left:12px}main{max-width:1184px;margin:auto;padding:0 0 32px}.intro{padding:62px 0 36px}.eyebrow{font-size:11px;letter-spacing:2px;font-weight:700;color:#61776b}h1{font-size:clamp(32px,4vw,48px);font-weight:550;line-height:1.15;letter-spacing:-1.7px;margin:18px 0}p{line-height:1.65;color:#66746c}.intro p{font-size:16px;margin:20px 0 0}.activities{display:grid;grid-template-columns:1fr 1fr;gap:24px}.activity{padding:24px;text-align:left;border-radius:24px;overflow:hidden}.puzzle-card{background:#e6ecd9}.video-card{background:#efe4d6}.card-art,.video-art{height:245px;position:relative;display:flex;justify-content:center;align-items:center;overflow:hidden;border-radius:14px}.card-art{display:grid;grid-template-columns:100px 100px;grid-template-rows:100px 100px;gap:7px;transform:rotate(-5deg)}.tile{display:grid;place-items:center;font-size:58px;border-radius:19px}.t1{background:#f3cf76;color:#fff3c8}.t2{background:#9bac85;color:#e7eccd}.t3{background:#cededb;color:#f9faf6}.t4{background:#e8b394;color:#fff0da}.video-art{background:#e4d7bf;margin:0 18px}.sun{position:absolute;width:90px;height:90px;border-radius:50%;background:#f2ca83;left:65%;top:30px}.hill{position:absolute;border-radius:50% 60% 0 0;background:#a7b49c;width:140%;height:220px;top:130px;transform:rotate(-12deg)}.play{z-index:1;background:#fff9e8e8;border-radius:50%;width:68px;height:68px;display:grid;place-items:center;font-size:23px;padding-left:5px}.card-bottom{display:flex;align-items:center;justify-content:space-between;padding:25px 6px 5px}.card-bottom h2{font-size:27px;font-weight:550;letter-spacing:-.6px;margin:9px 0 4px}.card-bottom p{font-size:14px;margin:0}.arrow{display:grid;place-items:center;background:#ffffff88;border-radius:50%;width:44px;height:44px;font-size:24px}footer{display:flex;align-items:center;gap:9px;margin-top:30px;font-size:12px;color:#738076}.status-dot{width:7px;height:7px;border-radius:50%;background:#79956c}.footer-note{margin-left:auto}section:not(#home){padding-top:32px}.back{display:block;margin-bottom:28px}.resource-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:18px;margin:25px 0}.resource-card{background:#e7ecdf;border-radius:16px;padding:12px;text-align:left;overflow:hidden}.resource-card img,.resource-card .video-thumb{width:100%;aspect-ratio:1;object-fit:cover;border-radius:10px}.resource-card span{display:block;margin:10px 2px;overflow-wrap:anywhere}.video-thumb{display:grid;place-items:center;background:#e7d9c5;font-size:40px}.game-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.game-heading h1{font-size:32px}.game-layout{display:grid;grid-template-columns:1fr 1fr;gap:35px;max-width:940px}.board,.pieces{display:grid;gap:5px;aspect-ratio:1}.board{padding:8px;background:#dfe6d6;border-radius:16px}.slot,.piece{min-width:0;padding:0;border-radius:7px;aspect-ratio:1;background-color:#f7f7ed;background-repeat:no-repeat}.slot{border:1px dashed #a9b99f}.piece{border:2px solid transparent}.piece.selected{border:4px solid #254f45;box-shadow:0 0 0 3px #efbb69}.piece:disabled{opacity:.15;cursor:default}.slot.filled{border:0}.small-heading{font-size:16px;margin:0 0 14px}.completion{font-size:25px;color:#355f47}.primary,.upload-label{display:inline-block;background:#345b4b;color:white;padding:14px 20px;border-radius:12px;cursor:pointer}.family-panel{background:#e9eddf;padding:26px;border-radius:18px;margin:30px 0}#upload{display:block;margin:18px 0;max-width:100%}select,input{padding:12px;border:1px solid #b4bfad;border-radius:8px;background:#fff}video{width:100%;max-height:65vh;background:#17211b;border-radius:16px}dialog{border:1px solid #d9ded0;border-radius:22px;padding:30px;max-width:450px;color:inherit;background:#f6f5f0}dialog::backdrop{background:#263f3b66}.dialog-actions{display:flex;gap:12px;margin-top:22px}[hidden]{display:none!important}@media(min-width:1500px){main{max-width:1184px}}@media(max-width:1279px){main{padding-left:48px;padding-right:48px}}@media(max-width:650px){header{padding:22px}.tag{display:none}main{padding:0 22px 25px}.intro{padding-top:38px}.activities{grid-template-columns:1fr}.card-art,.video-art{height:210px}.footer-note{display:none}.game-layout{grid-template-columns:1fr}.game-heading{align-items:flex-start;flex-direction:column}.brand{font-size:25px}.resource-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}

/* Keep the board and a compact piece tray close together on phones. */
.piece{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;cursor:grab}
.piece.dragging{opacity:.25;cursor:grabbing}
.drag-ghost{position:fixed;z-index:1000;pointer-events:none;transform:translate(-50%,-65%);opacity:.95;box-shadow:0 8px 25px #263f3b40;border:2px solid #345b4b}
.slot.drop-target{outline:3px solid #345b4b;outline-offset:-3px;background-color:#dce7c9}
.game-layout>div{min-width:0}
#game-title{overflow-wrap:anywhere}
button,select,.upload-label{min-height:44px}
.piece,.slot{min-height:0}
@media(max-width:650px){
 header{padding:14px 16px;gap:10px}
 main{padding-left:16px;padding-right:16px;padding-bottom:max(20px,env(safe-area-inset-bottom))}
 #adult{padding:10px;font-size:12px;white-space:nowrap}
 #adult span{margin-left:3px}
 section#game{padding-top:12px}
 #game>.back{margin-bottom:8px}
 .game-heading{flex-direction:row;align-items:center;gap:8px}
 .game-heading h1{font-size:24px;margin:8px 0;letter-spacing:-.6px}
 .game-heading label{font-size:12px;flex-shrink:0}
 .game-heading select{padding:8px 4px;font-size:16px}
 #game-instruction{font-size:13px;line-height:1.4;margin:8px 0 12px;min-height:36px}
 .game-layout{gap:14px;justify-items:center}
 .board{width:min(100%,42svh);min-width:min(100%,240px);position:sticky;top:8px;z-index:2;box-shadow:0 0 0 5px #f6f5f0}
 .game-layout>div:last-child{width:100%;max-width:360px}
 .pieces{grid-template-columns:repeat(4,minmax(0,1fr))!important;aspect-ratio:auto;gap:8px}
 .small-heading{font-size:13px;margin-bottom:8px}
 #restart{margin-top:12px}
 .completion{font-size:20px;margin:12px 0}
 dialog{width:calc(100% - 32px);padding:22px}
 dialog input{width:100%;font-size:16px}
 .family-panel{padding:18px}
}
@media(max-height:500px) and (orientation:landscape){
 .game-layout{grid-template-columns:1fr 1fr;align-items:start;gap:18px;max-width:650px;margin:auto}
 .board{width:min(100%,65svh);position:sticky;top:8px}
 .pieces{grid-template-columns:repeat(4,minmax(0,1fr))!important;aspect-ratio:auto}
}

/* One-row carousel: horizontal swipes browse, vertical drags place pieces. */
.game-layout{grid-template-columns:1fr;justify-items:center;gap:16px;max-width:660px;margin-inline:auto}
.board{width:min(100%,420px)}
.game-layout>div:last-child{width:100%;max-width:100%}
.pieces{display:flex;flex-wrap:nowrap;gap:12px;aspect-ratio:auto;overflow-x:auto;overflow-y:hidden;padding:8px 6px 12px;overscroll-behavior-x:contain;touch-action:pan-x;scroll-snap-type:x proximity;scrollbar-width:thin;scrollbar-color:#9bac85 #e6ecd9}
.pieces .piece{flex:0 0 80px;width:80px;height:80px;scroll-snap-align:start;touch-action:pan-x}
.pieces .piece:disabled{pointer-events:none}
.tray-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.tray-heading .small-heading{margin:0}
.carousel-controls{display:flex;gap:8px}
.carousel-controls button{width:44px;height:44px;border-radius:12px;background:#e6ecd9;font-size:22px}
#restart{margin-top:8px}
@media(max-width:650px) and (orientation:portrait){
 body:has(#game:not([hidden])) header{padding-block:8px}
 body:has(#game:not([hidden])) main{padding-bottom:max(8px,env(safe-area-inset-bottom))}
 #game{--board-size:min(100%,calc(100svh - 350px));}
 section#game{padding-top:8px}
 #game>.back{margin-bottom:2px;padding-block:8px}
 .game-heading h1{font-size:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #game-instruction{margin:4px 0 8px;font-size:12px;min-height:34px;line-height:1.4}
 .game-layout{gap:8px}
 .board{width:var(--board-size);min-width:0;position:static;box-shadow:none;padding:5px;gap:3px}
 .pieces{gap:10px;padding-block:6px 10px}
 .pieces .piece{flex-basis:64px;width:64px;height:64px}
 .completion{font-size:16px;margin:4px 0;line-height:1.3}
 .completion:empty{display:none}
 #restart{margin-top:4px;padding-block:8px}
}
@media(max-height:500px) and (orientation:landscape){
 .game-layout{grid-template-columns:1fr 1fr;align-items:center}
 .board{width:min(100%,60svh)}
}
