/* Photo mode (roadmap item 88, src/photo-mode.js, docs/photo-mode.md). Loaded after hud-reference.css.
   Every direct child of #game except the two game canvases, open dialogs and the mode's own bar/flash is hidden with
   visibility (not display) so no HUD layout or ResizeObserver changes; panels added by later systems hide too.
   Elements outside #game can opt in with the attribute data-photo-hide. */
body.photo-mode #game>:not(#world):not(#terrain):not(dialog):not(#photo-mode-bar):not(#photo-flash),
body.photo-mode [data-photo-hide]{visibility:hidden!important;pointer-events:none!important}
body.photo-mode #game>#world{cursor:default}

.photo-mode-bar{display:none}
body.photo-mode #game>.photo-mode-bar{position:absolute;z-index:40;left:50%;bottom:calc(14px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);display:flex;align-items:center;gap:8px;max-width:calc(100% - 24px);padding:6px 8px;border:1px solid #c8a76799;border-radius:12px;background:#142027c7;color:#fff0be;box-shadow:0 6px 18px #0006;font-size:14px;line-height:1.2;opacity:1;transition:opacity .45s ease;visibility:visible}
body.photo-mode #game>.photo-mode-bar.is-idle{opacity:.12}
body.photo-mode #game>.photo-mode-bar.is-idle:hover,body.photo-mode #game>.photo-mode-bar.is-idle:focus-within{opacity:1}
.photo-mode-bar button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:38px;min-height:38px;padding:6px 12px;border:1px solid #c8a767;border-radius:8px;background:#22362be6;color:#fff0be;font-weight:700;white-space:nowrap}
.photo-mode-bar button:hover{background:#2f4a37}
.photo-mode-bar button:disabled{opacity:.6;cursor:progress}
.photo-mode-bar .photo-mode-shoot{background:#6b5320e6;border-color:#e4c77d}
.photo-mode-bar .photo-mode-shoot:hover{background:#7d6226}
.photo-mode-bar kbd{padding:1px 5px;border:1px solid #c8a76799;border-radius:4px;background:#0b1418;color:#f4e2b0;font-family:inherit;font-size:11px;font-weight:600;line-height:1.3}
.photo-mode-icon{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.photo-mode-status{min-width:0;max-width:340px;padding:0 4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#f6e7b8;font-size:13px}
.photo-mode-status:empty{display:none}
.photo-flash{position:absolute;inset:0;z-index:41;background:#fff;opacity:0;pointer-events:none;visibility:hidden}
body.photo-mode #game>.photo-flash{visibility:visible}
.photo-flash.is-flashing{animation:photo-flash .15s ease-out}
@keyframes photo-flash{0%{opacity:.85}100%{opacity:0}}
@media(prefers-reduced-motion:reduce){.photo-flash.is-flashing{animation:none}body.photo-mode #game>.photo-mode-bar{transition:none}}
/* Touch screens: the bar stays shown, keys hints are hidden, buttons get a little larger. */
@media(pointer:coarse){
 .photo-mode-bar kbd{display:none}
 body.photo-mode #game>.photo-mode-bar{bottom:calc(10px + env(safe-area-inset-bottom,0px));gap:10px}
 .photo-mode-bar button{min-width:44px;min-height:44px}
 .photo-mode-status{max-width:220px;font-size:12px}
}
@media(max-width:520px){.photo-mode-bar button span{display:none}.photo-mode-status{max-width:150px}}
/* Navy HUD theme (src/hud-navy.js). */
body.hud-navy.photo-mode #game>.photo-mode-bar{background:#121c2ec9;border-color:#b9a06b99}
body.hud-navy .photo-mode-bar button{background:#1d2a44e6}
body.hud-navy .photo-mode-bar .photo-mode-shoot{background:#5d4a1fe6}
/* Camera button among the touch utility buttons (shown on coarse pointers only, hud-reference.css). */
.hud-utilities>.hud-photo .photo-mode-icon{width:20px;height:20px}
