/* Display tools stay inside the fullscreen element, including on the start/win screens. */
.iphone-guide { margin:14px auto 0; text-align:left; border-top:1px solid #d9c9d2; color:var(--ink); font-size:16px; line-height:1.55; }
.iphone-guide summary { cursor:pointer; padding:12px 5px; min-height:44px; font-size:14px; font-weight:900; border-radius:8px; }
.iphone-guide summary:focus-visible { outline:3px solid #764da9; outline-offset:2px; }
.iphone-guide[open] summary { margin-bottom:8px; }
.iphone-guide p { margin:10px 4px; }
.iphone-guide ol { margin:12px 0; padding-left:27px; }
.iphone-guide li { padding-left:3px; margin:10px 0; }
.iphone-guide .guide-note { font-size:14px; }
.display-controls { position:absolute; z-index:12; top:20px; right:22px; display:flex; gap:8px; }
.game-hud { right:138px; }
.expand-button .collapse-icon, .expand-button[aria-pressed="true"] .expand-icon { display:none; }
.expand-button[aria-pressed="true"] .collapse-icon { display:block; }
.game-shell .icon-button { min-width:44px; min-height:44px; }
.screen { padding-top:82px; }
.win-card { max-height:100%; overflow-y:auto; }
.game-shell { min-height:0; }
.level-badge { min-width:0; }
.level-badge strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.coin-counter { flex-shrink:0; }
html.game-expanded, html.game-expanded body { overflow:hidden; overscroll-behavior:none; }
html.game-expanded .masthead, html.game-expanded footer { display:none; }
html.game-expanded .app { padding:0; }
body .game-shell.is-expanded {
  position:fixed; inset:0; z-index:100; width:100%; height:100vh; height:100dvh;
  min-height:0; max-height:none; margin:0; border:0; border-radius:0; box-shadow:none;
}
.is-expanded .game-hud { top:max(14px,env(safe-area-inset-top)); left:max(14px,env(safe-area-inset-left)); right:calc(max(14px,env(safe-area-inset-right)) + 116px); }
.is-expanded .display-controls { top:max(14px,env(safe-area-inset-top)); right:max(14px,env(safe-area-inset-right)); }
.is-expanded .screen { padding-top:calc(max(14px,env(safe-area-inset-top)) + 64px); padding-bottom:max(18px,env(safe-area-inset-bottom)); }
.is-expanded .touch-controls { left:max(20px,env(safe-area-inset-left)); right:max(20px,env(safe-area-inset-right)); bottom:calc(18px + env(safe-area-inset-bottom)); }
.is-expanded .hint-bubble { top:calc(max(14px,env(safe-area-inset-top)) + 66px); }
.is-expanded .game-toast { top:calc(max(14px,env(safe-area-inset-top)) + 67px); }
.is-expanded .missed-marker { top:calc(max(14px,env(safe-area-inset-top)) + 118px); }
.is-expanded .start-credits { display:block; }
.is-expanded .start-description { margin-bottom:7px; }
.is-expanded .chest-action { bottom:calc(130px + env(safe-area-inset-bottom)); }
@media(max-width:800px) {
  .display-controls { top:15px; right:14px; }
  .game-hud { right:130px; }
}
@media(max-width:600px) {
  .display-controls { top:13px; right:11px; gap:6px; }
  .display-controls .icon-button { width:44px; height:44px; border-radius:13px; }
  .game-hud { right:113px; gap:5px; }
  .level-badge { padding:7px 5px; }
  .level-badge strong { display:none; }
  .level-badge>span { font-size:10px; letter-spacing:.4px; white-space:nowrap; }
  .coin-counter { min-width:0; padding:5px 6px; gap:4px; }
  .is-expanded .game-hud { right:calc(max(11px,env(safe-area-inset-right)) + 102px); left:max(11px,env(safe-area-inset-left)); }
  .is-expanded .display-controls { right:max(11px,env(safe-area-inset-right)); }
}
@media(max-height:570px) and (orientation:landscape) {
  .display-controls { top:9px; right:12px; }
  .game-hud { right:128px; }
  .screen { padding-top:67px; padding-bottom:10px; }
  .is-expanded .screen { padding-top:calc(max(9px,env(safe-area-inset-top)) + 55px); padding-bottom:max(10px,env(safe-area-inset-bottom)); }
  .is-expanded .game-hud, .is-expanded .display-controls { top:max(9px,env(safe-area-inset-top)); }
  .is-expanded .touch-controls { bottom:calc(8px + env(safe-area-inset-bottom)); }
  .is-expanded .chest-action { bottom:calc(85px + env(safe-area-inset-bottom)); }
  .is-expanded .hint-bubble { top:calc(max(9px,env(safe-area-inset-top)) + 55px); }
  .is-expanded .missed-marker { top:calc(max(9px,env(safe-area-inset-top)) + 97px); }
}
@media(max-width:350px) {
  .start-card .emoji-choice { width:44px; }
  .start-card .emoji-choice .face { font-size:26px; }
  .start-card h1 { font-size:36px; }
}
