/* Keep the activity and its controls together on released app pages. */
body[data-engine] .batch-nav{max-width:1000px;margin:auto;padding:6px 0;gap:14px;font-size:13px}
body[data-engine] .batch-nav a{min-height:32px;padding:5px 0}
body[data-engine] .offline-notice{max-width:1000px;margin:6px auto;padding:6px 10px;font-size:12px;line-height:1.4;border-radius:6px}
body[data-engine="games"] main,body[data-engine="tools"] main{width:min(calc(100% - 32px),1000px);max-width:1000px;margin:auto;padding:0 0 20px}
body[data-engine="games"] #play{padding-top:4px}
body[data-engine="games"] .gamehead{margin:2px 0 8px;gap:8px}
body[data-engine="games"] .gamehead .eyebrow{margin:0 0 2px;font-size:10px}
body[data-engine="games"] #title{font-size:clamp(25px,4vw,34px);letter-spacing:-1px;line-height:1.15;margin:0}
.game-controls{border:1px solid var(--line);background:var(--panel);border-radius:10px;padding:8px;display:flex;flex-direction:column;gap:6px}
.game-primary{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px}
body[data-engine="games"] #options,body[data-engine="games"] #extra{gap:6px;margin:0;align-items:center;justify-content:center;flex-wrap:wrap}
body[data-engine="games"] #options{display:contents}
body[data-engine="games"] .game-controls button,body[data-engine="games"] .game-controls select{min-height:40px;padding:7px 10px;font-size:13px;border-radius:7px;max-width:100%}
body[data-engine="games"] #extra:empty{display:none}
body[data-engine="games"] #status{font-size:13px;line-height:1.4;min-height:18px;margin:6px 0;text-align:center}
body[data-engine="games"] #board{margin:6px auto 12px;max-width:440px}
body[data-engine="games"] #board.classic-board{max-width:480px!important}
body[data-engine="games"] #board.arcade-board,body[data-engine="games"] #board.gorillas-board{max-width:760px!important}
body[data-engine="games"] #board.solitaire{max-width:900px!important}
body[data-engine="games"] .arcade-controls{gap:6px;flex-basis:auto}
body[data-engine="games"] .arcade-controls button{min-height:44px;min-width:52px}
body[data-engine="games"] .arcade-hud,body[data-engine="games"] .gorillas-score{margin:0;font-size:12px;flex-basis:auto}
body[data-engine="games"] .arcade-hint{margin:0;font-size:11px}
body[data-engine="games"] .gorillas-controls{padding:4px;gap:6px;flex-basis:auto;background:transparent}
body[data-engine="games"] .gorillas-controls input{min-height:40px;padding:6px;width:85px;font-size:16px}
body[data-engine="games"] .gorillas-controls button{width:auto}
body[data-engine="games"] .gorillas-trail{flex-basis:auto;margin:0}
body[data-engine="games"] .board-history{max-height:65px;margin:6px 0;font-size:12px}
body[data-engine="games"] .board-rules{margin:8px 0;padding:10px;max-width:none}
.compact-instructions,.compact-more{margin:12px 0;border-top:1px solid var(--line);padding:10px 0;font-size:14px}
.compact-instructions summary,.compact-more summary{cursor:pointer;font-weight:650;min-height:32px;padding:4px 0}
body[data-engine="games"] .game-guide{margin:18px auto;font-size:14px}
body[data-engine="tools"] .workspace{margin:8px 0 18px;padding:16px;border-radius:14px;box-shadow:none;scroll-margin-top:12px}
body[data-engine="tools"] .workspace-head{margin-bottom:12px;gap:12px;align-items:center}
body[data-engine="tools"] #workspaceTitle{font-size:clamp(24px,4vw,32px);line-height:1.15;letter-spacing:-1px;margin:0}
body[data-engine="tools"] #workspaceCategory{font-size:10px;margin:0 0 4px}
body[data-engine="tools"] #workspaceDescription{font-size:14px;margin:6px 0 0}
.compact-browse{margin-left:auto;flex-shrink:0;color:inherit;font-size:13px;padding:8px}
body[data-engine="tools"] .drop-zone{padding:14px;min-height:0;border-radius:10px}
body[data-engine="tools"] .drop-symbol{display:none}
body[data-engine="tools"] .drop-zone>span{margin:3px 0 8px}
body[data-engine="tools"] .drop-zone small{margin-top:6px}
body[data-engine="tools"] .settings{gap:10px;margin-top:12px;padding:12px}
body[data-engine="tools"] .workspace-actions{margin-top:10px;gap:8px}
body[data-engine="tools"] .result{margin-top:12px;padding:12px}
body[data-engine="tools"] .compatibility{margin:10px 0;padding:16px}
body[data-engine="tools"] .tool-section{padding:12px 0;border:0}
body[data-engine="tools"] .tool-section .section-heading{display:none}
body[data-engine="tools"] .tool-controls{margin-bottom:12px}
body[data-engine="tools"] .tool-grid{grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:8px}
body[data-engine="tools"] .tool-card{min-height:44px;padding:10px;font-size:13px}
body[data-engine="tools"] .promise{margin:20px 0;padding:16px;gap:14px}
body[data-engine="tools"] .seo-guide{margin:18px auto;padding:0;font-size:14px}
@media(max-width:700px){body[data-engine]>.batch-nav,body[data-engine]>.offline-notice{margin-left:16px;margin-right:16px}body[data-engine="games"] .game-controls button,body[data-engine="games"] .game-controls select{min-height:44px}body[data-engine="tools"] .workspace{padding:12px;margin-left:0;margin-right:0}body[data-engine="tools"] .workspace-head{align-items:flex-start}body[data-engine="tools"] .settings{padding:10px}.game-primary{gap:5px}}

/* Read-only results above the board; hands-on controls below it. */
body[data-engine="games"] .game-controls{margin:0 auto 12px;max-width:900px}
body[data-engine="games"] #personal-best{font-size:12px;color:var(--muted);text-align:center;margin:3px 0 6px;min-height:0}
body[data-engine="games"] #personal-best:empty{display:none}
body[data-engine="tools"] .workspace{display:flex;flex-direction:column}
body[data-engine="tools"] .workspace-head{order:0}
body[data-engine="tools"] .drop-zone{order:1}
body[data-engine="tools"] .file-list{order:2}
body[data-engine="tools"] .result{order:3}
body[data-engine="tools"] .settings{order:4}
body[data-engine="tools"] .tool-message{order:5}
body[data-engine="tools"] .workspace-actions{order:6}

/* Setup above the activity; controls used during play immediately below. */
.game-settings{border:1px solid var(--line);background:var(--panel);border-radius:10px;padding:8px;margin:0 auto 8px;max-width:900px}
body[data-engine="games"] .game-settings button,body[data-engine="games"] .game-settings select{min-height:40px;padding:7px 10px;font-size:13px;border-radius:7px;max-width:100%}
body[data-engine="games"] .game-controls:has(#extra:empty){display:none}
body[data-engine="tools"] .settings{order:1}
body[data-engine="tools"] .drop-zone{order:2}
body[data-engine="tools"] .file-list{order:3}
body[data-engine="tools"] .result{order:4}
@media(max-width:700px){body[data-engine="games"] .game-settings button,body[data-engine="games"] .game-settings select{min-height:44px}}
