/* The drawing canvas is also the live board texture and accessible input surface. */
.has-3d .pane{background:none;filter:none;border-radius:0}
.has-3d .play-area{inset:0;overflow:visible;background:none;box-shadow:none;border:0}
.has-3d #canvas{opacity:0;position:absolute;inset:0;z-index:2}
.puffy-webgl{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.has-3d #emptyHint{z-index:3;pointer-events:none;color:#806c50;font-size:clamp(15px,2vw,23px)}
.game{grid-template-rows:78px 68px auto minmax(0,1fr) auto 98px 28px}
header{grid-row:1}.stages{grid-row:2}.lesson-bar{grid-row:3}.workspace{grid-row:4}.puff-profiles{grid-row:5}footer{grid-row:6}.hint{grid-row:7}
.stages button{width:175px;height:59px}.stages{padding:0 0 8px}
.puff-profiles{display:flex;justify-content:center;align-items:center;gap:18px;padding:3px 0 7px}
.puff-styles{display:flex;gap:6px;padding:5px;background:#f7efdf;border:1px solid #dcc9a9;border-radius:22px;box-shadow:0 3px 8px #7053380c}
.puff-styles button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;width:75px;min-height:65px;padding:3px;border:2px solid transparent;border-radius:16px;background:transparent;color:#725e43;font-size:11px;font-weight:800}
.puff-styles svg{width:42px;height:36px;filter:drop-shadow(0 2px 1px #60442a20)}
.puff-styles button[aria-pressed=true]{border-color:#528b83;background:#e4eee5;box-shadow:inset 0 1px 2px #fff}
.puff-styles button:active{transform:translateY(1px)}
.puff-height{display:flex;flex-direction:column;gap:8px;width:128px;font-size:12px;font-weight:bold;color:#617a70}
.puff-height input{width:100%;accent-color:#528b83;min-height:28px}
#puffHeightHandle{position:absolute;z-index:4;transform:translate(-50%,-50%);width:44px;height:44px;border:2px solid #fff9df;border-radius:50%;background:#578d84;color:white;font:bold 29px system-ui;box-shadow:0 3px 8px #34554a44;touch-action:none;cursor:ns-resize}
#viewButton{flex:0 0 auto}
@media(max-width:620px){
 .game{padding-left:8px;padding-right:8px;grid-template-rows:64px 54px auto minmax(0,1fr) auto 112px 30px}
 .wordmark{max-width:170px}.stages{gap:12px}.stages button{width:145px;height:48px}
 .workspace{--tools-width:48px;--tool-size:44px;--tool-gap:5px;gap:2px}
 .tools{gap:5px;padding:0}.tools .tool{width:44px;height:44px}
 .puff-profiles{flex-direction:column;gap:1px;padding:0 0 4px}.puff-styles{gap:0;padding:3px;width:min(100%,380px);justify-content:space-around;border-radius:17px}
 .puff-styles button{width:20%;min-height:56px;font-size:10px;padding:1px}.puff-styles svg{width:34px;height:30px}
 .puff-height{width:85%;max-width:300px;flex-direction:row;align-items:center;gap:9px;font-size:10px}.puff-height span{white-space:nowrap}.puff-height input{min-height:24px}
 header .header-toy{width:44px}header nav{gap:3px}.round{width:36px;min-height:36px;height:36px}
 .lesson-bar{min-height:76px}.lesson-copy strong{font-size:14px}.lesson-copy span{font-size:9px}.lesson-pieces{margin-top:1px}.lesson-piece{width:22px;height:22px}
 .hint{font-size:10px;line-height:12px}.little-counts{gap:12px}
}
@media(max-height:580px) and (min-width:480px) and (orientation:landscape){
 .game{grid-template-rows:46px 0 auto minmax(0,1fr) auto 59px 22px;padding-left:9px;padding-right:9px}
 .stages{position:absolute;right:185px;top:3px;z-index:5;gap:6px}.stages button{width:90px;height:33px}.stage-number{width:16px;height:16px;font-size:9px}
 .brand .wordmark{width:150px}.brand>span{display:none}.workspace{--tool-size:44px;--tools-width:96px;--tool-gap:4px;--tool-columns:2;--tool-rows:3}
 .puff-profiles{gap:10px;padding:1px}.puff-styles{padding:1px;border-radius:14px}.puff-styles button{min-height:44px;width:66px;font-size:9px;gap:0}.puff-styles svg{height:26px;width:30px}.puff-height{gap:0;width:112px;font-size:10px}
 .lesson-bar{min-height:46px}.lesson-copy{padding-right:115px}.lesson-pieces{display:flex}.hint{font-size:10px}.puff{height:45px}
}
@media(max-width:360px){.wordmark{max-width:127px}.stages button{width:135px}.puff-styles button{font-size:9px}.game{grid-template-rows:60px 51px auto minmax(0,1fr) auto 108px 28px}}
@media(max-height:580px) and (min-width:480px) and (orientation:landscape){
 .stages{right:210px}
 .lesson-bar{min-height:36px;height:36px;gap:8px;padding:0 0 3px}
 .lesson-copy{flex:0 1 auto;display:flex;align-items:center;gap:9px;padding:0;min-width:0}
 .lesson-copy #lessonNumber,.lesson-copy #lessonFocus{display:none}
 .lesson-copy strong{font-size:12px;white-space:nowrap}
 .lesson-pieces{position:static;display:flex;gap:2px;margin:0}.lesson-piece{width:22px;height:22px}
 .lesson-surprise{flex-direction:row;width:auto;min-height:33px;height:33px;padding:3px 8px;gap:5px;border-radius:12px;font-size:10px}.lesson-surprise svg{width:22px;height:22px}
 footer{gap:18px}.color-tray-group{flex:0 1 355px;gap:6px}.color-tray-group .palette-tray{flex:1 1 295px;height:52px;padding:6px 9px}.palette{height:100%;gap:2px}.swatch{height:40px;max-width:44px}.swatch img{width:100%;height:100%;object-fit:contain}.more-colors{min-height:50px}
}

.board-controls{position:absolute;bottom:8px;left:50%;transform:translateX(-50%);z-index:5;display:flex;gap:3px;padding:4px;border:1px solid #d6bd96;border-radius:19px;background:#fbf3e3ed;box-shadow:0 3px 10px #62452118;white-space:nowrap}
.board-controls button{min-width:36px;min-height:36px;border:0;border-radius:14px;background:transparent;color:#725839;font:bold 20px system-ui;cursor:pointer}
.board-controls #moveBoard{font-size:11px;padding:0 9px}.board-controls #moveBoard span{font-size:19px;vertical-align:middle;margin-right:3px}
.board-controls button:hover,.board-controls button[aria-pressed=true]{background:#e2e9d8;color:#3e7167}
.has-3d #canvas.board-navigation{cursor:grab}.has-3d #canvas.moving-board{cursor:grabbing}
@media(max-height:580px){.board-controls{bottom:0;padding:2px}.board-controls button{min-height:30px;min-width:32px}}

/* A full-screen worktable, with tools floating over the same scene. */
.game.has-3d{position:relative;display:block;max-width:none;padding:0;isolation:isolate;overflow:hidden}
.has-3d .workspace{position:absolute;inset:0;display:block;--tool-columns:1;--tool-rows:6;--tool-size:58px;--tool-gap:12px;--tools-width:70px}
.has-3d .pane{position:absolute;inset:0}
.has-3d .tools{position:absolute;left:14px;top:50%;transform:translateY(-50%);z-index:6;filter:drop-shadow(0 8px 7px #53351728)}
.has-3d header{position:absolute;inset:env(safe-area-inset-top,0) 18px auto;height:78px;z-index:7}
.has-3d .stages{position:absolute;top:82px;left:50%;transform:translateX(-50%);z-index:6;right:auto;padding:0}
.has-3d .lesson-bar{position:absolute;top:151px;left:50%;transform:translateX(-50%);z-index:6;min-height:0;width:max-content;max-width:calc(100% - 180px);padding:9px 16px;border-radius:23px;background:#faf1dfed;box-shadow:0 7px 20px #5e422322}
.has-3d footer{position:absolute;left:18px;right:18px;bottom:28px;z-index:6;height:90px;filter:drop-shadow(0 8px 6px #5a391e30)}
.has-3d .little-counts{padding:5px 10px;border-radius:18px;background:#faf1dfdd;box-shadow:0 4px 10px #5a391e16}
.has-3d .puff-profiles{position:absolute;bottom:124px;left:50%;transform:translateX(-50%);z-index:6;padding:6px 10px;border-radius:23px;background:#fbf3e4ec;box-shadow:0 8px 20px #54382025;max-width:calc(100% - 28px)}
.has-3d .puff-styles{border:0;background:none;box-shadow:none;padding:0}
.has-3d .hint{position:absolute;bottom:3px;left:12px;right:12px;z-index:6;pointer-events:none;text-shadow:0 1px 2px #fff;line-height:20px}
.has-3d .board-controls{left:auto;right:18px;top:88px;bottom:auto;transform:none;z-index:6;box-shadow:0 8px 18px #52381f25}
.has-3d .eye-choices,.has-3d .mouth-choices{z-index:8;top:38%}
.has-3d #emptyHint{top:45%;background:none;text-shadow:0 1px 4px #fff8e9}
/* Transparent gaps pass pointer input through to the table. */
.has-3d header,.has-3d footer,.has-3d .stages{pointer-events:none}
.has-3d header a,.has-3d header button,.has-3d footer button,.has-3d .palette-tray,.has-3d .stages button{pointer-events:auto}
@media(max-width:1000px){.has-3d .board-controls{top:auto;bottom:129px;right:14px}.has-3d.playing .board-controls{bottom:212px}}
@media(max-width:620px){
 .has-3d header{left:8px;right:8px;height:60px}.has-3d .stages{top:66px;gap:8px}.has-3d .stages button{width:145px;height:48px}
 .has-3d .workspace{--tool-size:44px;--tool-gap:8px;--tools-width:52px}.has-3d .tools{left:6px;top:44%}
 .has-3d .lesson-bar{top:123px;max-width:calc(100% - 24px);padding:7px 10px;gap:8px}.has-3d .lesson-copy{flex:1}.has-3d .lesson-copy #lessonFocus{display:none}
 .has-3d footer{left:8px;right:8px;bottom:26px;height:114px}.has-3d .little-counts{padding:3px 6px}
 .has-3d .puff-profiles{bottom:146px;width:calc(100% - 18px);max-width:390px;padding:4px 7px;gap:0}
 .has-3d .board-controls{bottom:149px;right:10px;padding:3px}.has-3d.playing .board-controls{bottom:240px}
 .has-3d .board-controls button{min-width:32px;min-height:34px}.has-3d .board-controls #moveBoard{font-size:10px;padding:0 6px}
 .has-3d .hint{font-size:10px;line-height:12px;bottom:2px}.has-3d #emptyHint{top:39%;left:48px;font-size:17px}
}
@media(max-height:580px) and (min-width:480px) and (orientation:landscape){
 .has-3d header{height:43px;left:9px;right:9px}.has-3d .stages{top:4px;left:50%;gap:5px}.has-3d .stages button{width:90px;height:33px}
 .has-3d .workspace{--tool-size:44px;--tool-gap:7px;--tool-columns:2;--tool-rows:3;--tools-width:98px}.has-3d .tools{left:7px;top:49%}
 .has-3d .lesson-bar{top:47px;padding:4px 10px;max-width:calc(100% - 270px);border-radius:14px;min-height:34px;height:auto}
 .has-3d footer{bottom:23px;height:56px;left:12px;right:12px}.has-3d .puff-profiles{bottom:84px;padding:3px 8px}
 .has-3d .board-controls,.has-3d.playing .board-controls{top:48px;bottom:auto;right:9px;flex-wrap:wrap;width:113px;justify-content:center;padding:3px;gap:0}.has-3d .board-controls #moveBoard{width:100%;min-height:28px}.has-3d .board-controls button{min-width:26px;min-height:29px;font-size:18px}
 .has-3d .hint{line-height:16px;bottom:1px}.has-3d #emptyHint{top:40%}
}

@media(max-height:580px) and (min-width:480px) and (orientation:landscape){.has-3d .board-controls,.has-3d.playing .board-controls{display:grid;grid-template-columns:repeat(4,26px);width:113px}.has-3d .board-controls #moveBoard{grid-column:1/-1}.has-3d .board-controls button{padding:0}}
