/* Touch rounds occupy the visible viewport, with a protected bottom gesture zone. */
html.puzzle-playing{overflow:hidden;overscroll-behavior:none}
html.puzzle-playing body{position:fixed;inset:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
.puzzle-playing .shell{position:absolute;top:var(--puzzle-view-top,0);left:var(--puzzle-view-left,0);width:var(--puzzle-view-width,100%);height:var(--puzzle-view-height,100dvh);max-width:none;margin:0;padding: max(10px,env(safe-area-inset-top,0px)) max(16px,env(safe-area-inset-right,0px)) max(36px,calc(env(safe-area-inset-bottom,0px) + 24px)) max(16px,env(safe-area-inset-left,0px));overflow:hidden}
.puzzle-playing .topbar,.puzzle-playing .footer{display:none}
.puzzle-playing #app,.puzzle-playing .play-shell{height:100%;min-height:0;margin:0}
.puzzle-playing .play-shell{display:flex;flex-direction:column;max-width:560px;margin:auto}
.puzzle-playing .play-top{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;flex:none;margin:0 0 10px;min-height:44px}
.puzzle-playing .play-context{text-align:center;font-size:9px;line-height:1.5;min-width:0}
.puzzle-playing .play-context b{font-size:11px}.puzzle-playing .play-free{display:none}
.puzzle-playing .play-top .secondary{padding:9px 11px;font-size:11px;min-height:44px}
.puzzle-playing .game-host{flex:1;min-height:0;width:100%;overflow:hidden;touch-action:none;overscroll-behavior:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.puzzle-playing .game-host>.orchard,.puzzle-playing .game-host>.ten-game{width:100%;max-width:510px;margin:0 auto;padding:0}
.puzzle-playing .orchard-board,.puzzle-playing .ten-board{width:var(--puzzle-board-size,100%);max-width:100%;aspect-ratio:1;margin-left:auto;margin-right:auto;box-sizing:border-box;touch-action:none;overscroll-behavior:none;-webkit-touch-callout:none}
.puzzle-playing .orchard-kicker,.puzzle-playing .orchard-legend,.puzzle-playing .ten-keyboard{display:none}
.puzzle-playing .orchard h2,.puzzle-playing .ten-title h2{font-size:27px;margin:3px 0;line-height:1.15}
.puzzle-playing .orchard-heading{min-height:38px}.puzzle-playing .ten-title{min-height:42px}
.puzzle-playing .orchard-instruction,.puzzle-playing .ten-instruction{font-size:12px;line-height:1.45;margin:7px 0 10px}
.puzzle-playing .orchard-hud{margin-bottom:12px;min-height:51px}
.puzzle-playing .orchard-feedback{height:61px;min-height:61px;overflow:hidden}
.puzzle-playing .orchard-status{font-size:12px;line-height:1.4;margin:8px 0;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.puzzle-playing .orchard-hint{min-height:44px;padding:9px 15px;flex:none}
.puzzle-playing .ten-hud{margin:0 0 10px;padding:10px 14px;min-height:62px}
.puzzle-playing .ten-readout{height:60px;min-height:60px;overflow:hidden}
.puzzle-playing .ten-status{font-size:11px;line-height:1.35;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.puzzle-playing .ten-tools{gap:9px}.puzzle-playing .ten-tools button{min-height:44px;padding:9px 13px;font-size:11px}
.puzzle-playing dialog{max-height:calc(var(--puzzle-view-height,100dvh) - 40px);overflow:auto;overscroll-behavior:contain;touch-action:pan-y}
@media(min-aspect-ratio:5/4) and (max-height:600px){
 .puzzle-playing .play-shell{max-width:100%}
 .puzzle-playing .game-host>.orchard,.puzzle-playing .game-host>.ten-game{display:grid;grid-template-columns:minmax(170px,.9fr) minmax(0,1.1fr);column-gap:20px;align-content:start;max-width:100%;height:100%}
 .puzzle-playing .orchard-heading,.puzzle-playing .ten-title{grid-column:1;grid-row:1}
 .puzzle-playing .orchard-instruction,.puzzle-playing .ten-instruction{grid-column:1;grid-row:2}
 .puzzle-playing .orchard-hud,.puzzle-playing .ten-hud{grid-column:1;grid-row:3}
 .puzzle-playing .orchard-feedback,.puzzle-playing .ten-readout{grid-column:1;grid-row:4}
 .puzzle-playing .ten-tools{grid-column:1;grid-row:5;justify-content:flex-start}
 .puzzle-playing .orchard-stage,.puzzle-playing .ten-board{grid-column:2;grid-row:1/span 5;align-self:start;justify-self:center}
 .puzzle-playing .orchard-stage{width:100%}
 .puzzle-playing .ten-title .portrait{display:none}
}
@media(max-height:650px) and (max-aspect-ratio:5/4){
 .puzzle-playing .play-top{margin-bottom:7px}
 .puzzle-playing .orchard h2,.puzzle-playing .ten-title h2{font-size:24px}
 .puzzle-playing .orchard-instruction,.puzzle-playing .ten-instruction{font-size:11px;margin:5px 0 8px}
 .puzzle-playing .ten-title .portrait{width:33px;height:33px}
}
/* Explicit tracks avoid WebKit transferring a tall row size into wider columns. */
.puzzle-playing .game-host,.puzzle-playing .game-host>.ten-game,.puzzle-playing .game-host>.orchard{min-width:0}
.puzzle-playing .ten-board,.puzzle-playing .orchard-board{grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:repeat(6,minmax(0,1fr));width:var(--puzzle-board-size);height:var(--puzzle-board-size);max-width:100%;min-width:0;min-height:0;aspect-ratio:auto;overflow:hidden}
.puzzle-playing .ten-board>.ten-cell,.puzzle-playing .orchard-board>.orchard-cell{width:100%;height:100%;min-width:0;min-height:0;aspect-ratio:auto;box-sizing:border-box;overflow:hidden}
.puzzle-playing .ten-board .ten-fruit{pointer-events:none}

/* Small, unhurried number place puzzle uses the same fixed touch-game shell. */
.mini-sudoku{width:100%;max-width:510px;height:auto;display:flex;flex-direction:column;gap:10px;margin:auto;min-width:0;min-height:0}.mini-sudoku h2{font-size:26px;line-height:1.15;margin:0}.sudoku-rules{font-size:12px;line-height:1.5;margin:0;color:#697b64}.sudoku-hud{display:flex;justify-content:space-between;align-items:center;gap:10px;background:#eaf0dc;padding:12px;border-radius:12px;font-size:11px}.sudoku-hud span{font-size:10px}.sudoku-board{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(4,minmax(0,1fr));width:var(--puzzle-board-size,100%);height:var(--puzzle-board-size,auto);aspect-ratio:1;max-width:100%;max-height:100%;flex:none;align-self:center;border:3px solid #8eaa80;border-radius:15px;overflow:hidden;background:#8eaa80;gap:1px}.sudoku-cell{min-width:0;min-height:0;padding:0;border:0;border-radius:0;background:#fffaf0;color:#31654e;font:600 clamp(20px,7vw,42px)/1 system-ui;touch-action:manipulation}.sudoku-cell:nth-child(4n+2){border-right:3px solid #8eaa80}.sudoku-cell:nth-child(n+5):nth-child(-n+8){border-bottom:3px solid #8eaa80}.sudoku-cell.sudoku-given{background:#e2e9d3;color:#4a6049;opacity:1}.sudoku-cell.sudoku-selected{background:#f7e4b3;box-shadow:inset 0 0 0 3px #be9950}.sudoku-numbers{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px}.sudoku-numbers button{min-height:44px;padding:8px 0;border:1px solid #b9c7ad;background:#fffaf0;border-radius:10px;font-size:18px;color:#3b694f}.sudoku-numbers button:last-child{font-size:11px}.sudoku-numbers button:disabled{opacity:.35}.sudoku-status{font-size:11px;line-height:1.4;margin:0;min-height:32px;color:#6c7b67}.sudoku-tools{display:flex;justify-content:center;gap:15px;margin-top:auto}.sudoku-tools button{min-height:44px}.puzzle-playing .play-shell:has(.mini-sudoku){max-width:620px}
@media(min-aspect-ratio:5/4) and (max-height:600px){.mini-sudoku{display:grid;grid-template-columns:minmax(190px,.9fr) minmax(0,1.1fr);grid-template-rows:auto auto auto auto auto 1fr;column-gap:20px;align-content:start;max-width:100%;height:100%}.mini-sudoku h2,.sudoku-rules,.sudoku-hud,.sudoku-numbers,.sudoku-status,.sudoku-tools{grid-column:1}.sudoku-board{grid-column:2;grid-row:1/span 6;align-self:start;justify-self:center}.sudoku-tools{justify-content:flex-start}.puzzle-playing .play-shell:has(.mini-sudoku){max-width:100%}}

/* Pairs and Four share the compact round controls and keep ordinary page scrolling. */
@media (max-width:700px) {
 .shell:has(>#app>.maplewick-tap-round)>.topbar {display:none}
 .maplewick-tap-round {margin-top:max(10px,env(safe-area-inset-top,0px))}
 .maplewick-tap-round .play-top {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:8px;
  margin:0 0 10px;
  padding-bottom:6px;
 }
 .maplewick-tap-round .play-top .secondary {
  padding:9px 11px;
  font-size:11px;
  min-height:44px;
 }
 .maplewick-tap-round .play-context {
  min-width:0;
  font-size:10px;
  line-height:1.4;
  text-align:center;
 }
 .maplewick-tap-round .play-context b {font-size:11px}
 .maplewick-tap-round :is(.play-free,.keepsake-game>.eyebrow) {display:none}
 .maplewick-tap-round :is(.keepsake-game h2,.four-heading h2) {
  font-size:26px;
  line-height:1.12;
  margin:4px 0 8px;
 }
 .maplewick-tap-round :is(.keepsake-game>p,.four-heading p) {
  font-size:13px;
  line-height:1.45;
  margin:0 0 8px;
 }
 .maplewick-tap-round .puzzle-hud {padding:10px 12px;margin:9px 0}
 .maplewick-tap-round .keepsake-game .puzzle-status {min-height:36px;margin:8px 0}
 .maplewick-tap-round .keepsake-game .actions {margin-top:6px}
 .maplewick-tap-round .four-options {margin-bottom:8px}
 .maplewick-tap-round .four-tier-note {margin:8px 0;padding:7px 10px;font-size:12px}
 .maplewick-tap-round .four-status {margin:8px 0;font-size:14px}
}

@media (max-width:700px) and (max-height:700px) {
 .maplewick-tap-round:has(.keepsake-game) .play-top {margin-bottom:6px}
 .maplewick-tap-round .keepsake-game h2 {
  font-size:24px;
  margin:3px 0 5px;
 }
 .maplewick-tap-round .keepsake-game>p {
  line-height:1.35;
  margin-bottom:6px;
 }
 .maplewick-tap-round .keepsake-game .puzzle-hud {
  padding:7px 10px;
  margin:6px 0;
 }
 .maplewick-tap-round .keepsake-board {
  width:min(100%, 350px);
  margin-inline:auto;
  padding:8px;
  gap:6px;
 }
 .maplewick-tap-round .keepsake-card {
  aspect-ratio:1.16;
  min-height:44px;
  padding:3px;
  gap:2px;
 }
 .maplewick-tap-round .keepsake-card svg {
  width:min(58%, 36px);
  min-height:0;
 }
 .maplewick-tap-round .keepsake-game .puzzle-status {
  min-height:32px;
  margin:5px 0;
 }
 .maplewick-tap-round .keepsake-game .actions {
  gap:4px 8px;
  margin-top:4px;
 }
 .maplewick-tap-round .keepsake-game :is(.pair-start,.pair-hint) {
  min-height:44px;
  padding:8px 12px;
 }
 .maplewick-tap-round .keepsake-game .assistance-strip {
  gap:6px;
  margin:0;
  font-size:12px;
 }
}
