/* TakeApart placement: toolbar, metadata, board, bottom hint; same shell bounds. */
.shariki-shell{width:100%;max-width:none;min-height:0;padding:0 clamp(22px,3vw,64px)}
.shariki-shell .wp-topbar{margin-bottom:20px}
.play-layout{padding:0;align-items:stretch}
.game-card{max-width:none;max-height:none;width:100%;padding:0;display:flex;flex-direction:column;gap:0;border-radius:29px;background:#323c49}
.game-toolbar{height:66px;padding:20px 25px 8px;display:flex;align-items:center;justify-content:space-between;gap:8px;flex-shrink:0}
.game-toolbar .secondary-button{min-height:38px;padding:9px 11px;background:#494760;border:0;color:#e1d9ff;font-size:11px;border-radius:9px}
.toolbar-best{display:flex;gap:10px;align-items:center;font-size:8px;letter-spacing:1px;color:#b8c3cd}
.toolbar-best strong{font-size:13px;color:#ff9cbd;letter-spacing:0;font-variant-numeric:tabular-nums}
.restart-button{width:38px;height:38px;border:0;border-radius:50%;background:transparent;color:#b9c8cf;font-size:27px;line-height:1}
.object-heading{display:flex;align-items:center;justify-content:center;gap:26px;padding:12px 18px 0;flex-shrink:0}
.object-heading .stat{display:flex;align-items:center;gap:9px}
.object-heading .stat>span{font-size:8px;letter-spacing:1px;margin:0}
.object-heading .stat strong{font-size:20px;letter-spacing:-.5px;color:#edf0f5}
.board-stage{flex:1;min-height:0;margin:12px 12px 0;padding:0}
.game-bottom{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-shrink:0;padding:12px 28px 16px}
.game-bottom #game-status{margin:0;text-align:left;font-size:10px;min-height:0}
.game-bottom .rules-button{background:#494760;color:#e1d9ff;border-radius:9px;padding:8px 10px;min-height:36px;max-width:none;white-space:nowrap}
.shariki-shell>.wp-save-note{margin:9px 0;font-size:9px}
.shariki-shell>.wp-footer{min-height:40px}
.swap-layer{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:4;overflow:visible}
.swap-settled .tile{transition:none!important}
/* Explicit square geometry avoids percentage-height resolution in mobile flex layouts. */
#board-frame{--frame-inset:15px;flex:none;min-height:0}
#board{position:absolute;inset:var(--frame-inset);width:auto;height:auto}
.tile{height:auto;aspect-ratio:1}
.tile .sphere{height:auto;aspect-ratio:1}
.tile .sphere{transition:transform .15s,filter .15s,border-radius .18s,width .18s}
.tile.selected .sphere,.tile.cubed .sphere{width:92%;border-radius:12%;transform:translateY(-2%);box-shadow:inset -4px -5px 6px #02091460,inset 2px 2px 2px #ffffff80,2px 5px 5px #07132180}
.tile.selected .sphere:before,.tile.cubed .sphere:before{border-radius:20%;width:55%;height:12%;left:15%;top:8%;transform:none}
#sound{flex-direction:row;gap:4px;line-height:1}
#sound .sound-note{font-size:22px;line-height:22px}
#sound .sound-state{font-size:8px;line-height:12px;font-weight:600}
@media(max-width:1024px){
 .shariki-shell{padding:env(safe-area-inset-top) max(8px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px,env(safe-area-inset-left))}
 .shariki-shell .wp-topbar{display:grid;grid-template-columns:minmax(0,1fr) auto;height:auto;min-height:0;gap:0 4px;padding:2px 0;margin-bottom:6px}
 .shariki-shell .wp-brand{font-size:14px}
 .shariki-shell .wp-tools{grid-column:2;grid-row:1;gap:2px}
 .shariki-shell .header-game-title{position:static;transform:none;grid-column:1/-1;grid-row:2;justify-content:center;padding:4px 0 7px;font-size:20px}
 .game-card{border-radius:20px}
 .game-toolbar{height:48px;padding:5px 10px;gap:5px}
 .object-heading{padding:2px 6px 0}
 .board-stage{margin:8px 4px 0}
 .game-bottom{padding:6px 12px 8px}
 .shariki-shell>.wp-save-note{margin:4px 0;font-size:8px}
 .shariki-shell>.wp-footer{min-height:26px;padding:0;font-size:9px}
 .shariki-shell>.wp-footer button{min-height:26px;padding:4px 0}
}
@media(orientation:landscape) and (max-height:550px){
 .shariki-shell{padding:0 8px}
 .shariki-shell .wp-topbar{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);margin-bottom:4px;height:48px;min-height:48px}
 .shariki-shell .header-game-title{grid-column:2;grid-row:1;padding:0;font-size:19px}
 .shariki-shell .wp-tools{grid-column:3;justify-self:end}
 .game-card{display:grid;grid-template-columns:minmax(0,1fr) 210px;grid-template-rows:48px auto minmax(0,1fr)}
 .board-stage{grid-column:1;grid-row:1/4;margin:4px}
 .game-toolbar{grid-column:2;grid-row:1;padding:4px;height:48px}
 .object-heading{grid-column:2;grid-row:2;gap:14px;flex-wrap:wrap}
 .game-bottom{grid-column:2;grid-row:3;align-self:end;padding:8px;flex-wrap:wrap}
 .toolbar-best{gap:4px;font-size:7px}
 .shariki-shell>.wp-save-note{display:none}
}
.game-focused .game-card{padding:0}
.game-focused .game-toolbar{padding-right:62px}

/* One centred readout row, with labels on the number baseline. */
.game-toolbar{position:relative;justify-content:center;padding:12px 62px;height:64px}
.game-toolbar .object-heading{padding:0;gap:40px;margin:0;justify-content:center}
.game-toolbar .stat{display:flex;align-items:center;gap:10px;white-space:nowrap}
.game-toolbar .stat>span{font-size:17px;font-weight:550;line-height:1.2;letter-spacing:.3px;margin:0}
.game-toolbar .stat strong{font-size:22px;font-weight:600;line-height:1.2;letter-spacing:0}
.game-toolbar .best-stat strong{color:#ff9cbd}
.game-toolbar .restart-button{position:absolute;right:20px;top:50%;transform:translateY(-50%)}
@media(max-width:650px){
 #board-frame{--frame-inset:10px}
 .game-toolbar{height:58px;padding:10px 38px 10px 8px}
 .game-toolbar .object-heading{gap:17px}
 .game-toolbar .stat{gap:5px}
 .game-toolbar .stat>span{font-size:12px;letter-spacing:0}
 .game-toolbar .stat strong{font-size:17px}
 .game-toolbar .restart-button{right:3px;width:30px;height:30px;font-size:24px}
}
@media(orientation:landscape) and (max-height:550px){
 #board-frame{--frame-inset:10px}
 .game-toolbar{height:auto;padding:8px 32px 8px 3px}
 .game-toolbar .object-heading{gap:10px;flex-wrap:wrap}
 .game-toolbar .stat{gap:5px}
 .game-toolbar .stat>span{font-size:11px}
 .game-toolbar .stat strong{font-size:16px}
 .game-toolbar .restart-button{right:0;width:30px}
}
/* The expanded layout must win over every responsive header rule. */
body.game-focused .shariki-shell>.wp-topbar,
body.game-focused .shariki-shell>.wp-save-note,
body.game-focused .shariki-shell>.wp-footer{display:none!important}
body:not(.game-focused) #fullscreen-exit{display:none!important}
body.game-focused .shariki-shell{height:100dvh;min-height:0}
body.game-focused .play-layout{height:100%;min-height:0}
