/* Match the width of this desktop's Dock; preserve native actor pixel density.
   The clear space above the scene contains the original boss health frame. */
.tba-floating-game{position:absolute;top:0;left:0;width:324px;height:128px;max-width:calc(100% - 20px);z-index:9;overflow:visible;border:0;border-radius:0;background:transparent;box-shadow:none;transform:translate3d(var(--tba-window-x,0px),var(--tba-window-y,0px),0);text-align:left}
.tba-floating-game-help{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.tba-scene .tba-floating-game>.tba-world{flex:1;height:100%;min-height:0;width:100%;aspect-ratio:auto;background:transparent;border:0;box-shadow:none;cursor:grab;touch-action:none;--tba-game-scale:2}
.tba-floating-game .tba-game-controls{top:auto;bottom:74px;right:4px;opacity:0;pointer-events:none;transition:opacity .14s ease}
.tba-floating-game .tba-game-controls:focus-within{opacity:1;pointer-events:auto}
.tba-floating-game .tba-game-controls button{width:23px;height:23px;padding:3px}
.tba-floating-game .tba-actors{right:66px;left:4%}
.tba-floating-game .tba-damage{font-size:13px}.tba-floating-game .tba-damage-second{font-size:11px}
.tba-floating-game .tba-enemy-health{width:24px;height:3px}
@container(max-width:420px){
  .tba-scene .tba-floating-game>.tba-world{--tba-game-scale:1}
}

/* Shared window manager: the app frames and game use the same bounded drag. */
.tba-mac-desktop .tba-managed-window{left:0;top:0;right:auto;bottom:auto;transform:translate3d(var(--tba-window-x,0px),var(--tba-window-y,0px),0);min-width:0;min-height:0}
.tba-mac-desktop .tba-managed-window[hidden]{display:none!important}
.tba-mac-desktop .tba-managed-window[data-maximized=true]{width:100%!important;height:100%!important;max-width:none;transform:none;left:0;top:0;border-radius:0}
.tba-mac-desktop .tba-managed-titlebar{padding:0 9px;gap:8px}
.tba-mac-traffic{display:flex;gap:6px;flex:none;align-items:center}
.tba-scene .tba-mac-traffic .tba-window-control{display:grid;place-items:center;width:12px;height:12px;border:1px solid #0002;border-radius:50%;padding:0;background:#ff5f57;color:#261c19;box-shadow:none;flex:none}
.tba-scene .tba-mac-traffic .tba-control-minimize{background:#febc2e}
.tba-scene .tba-mac-traffic .tba-control-maximize{background:#28c840}
.tba-window-control img{display:block;width:9px;height:9px;opacity:0;pointer-events:none}
.tba-mac-traffic:hover .tba-window-control img,.tba-window-control:focus-visible img{opacity:.85}
.tba-scene .tba-window-control:focus-visible{outline:2px solid #a2c9ff;outline-offset:2px}
.tba-scene .tba-window-drag-handle{display:flex;align-items:center;justify-content:center;gap:5px;align-self:stretch;flex:1;min-width:0;border:0;border-radius:0;background:none;color:#c9cdd5;font:500 9px/1 system-ui,-apple-system,sans-serif;padding:0 2px;box-shadow:none;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}
.tba-window-drag-handle>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tba-window-drag-handle>img{width:13px;height:13px;flex:none;pointer-events:none;image-rendering:pixelated}
.tba-window-drag-handle>img:last-child{margin-left:auto;filter:invert(.65);opacity:.7}
.tba-managed-window[data-dragging=true] .tba-window-drag-handle{cursor:grabbing}
.tba-scene .tba-window-drag-handle:focus-visible{outline:2px solid #9fc8ff;outline-offset:-2px}
.tba-mac-desktop .tba-game-hero-popover{z-index:2000}
.tba-mac-desktop .tba-game-map-popover{width:250px;max-width:calc(100% - 16px);background:transparent;border:0;overflow:visible}
.tba-macos-about{position:absolute;z-index:2100;left:50%;top:50%;transform:translate(-50%,-50%);width:250px;max-width:calc(100% - 24px);padding:28px 20px 22px;border:1px solid #707783;border-radius:10px;background:#292d35;box-shadow:0 14px 32px #0007;display:flex;align-items:center;flex-direction:column;gap:9px;color:#e8edf4;text-align:center;font-family:system-ui,-apple-system,sans-serif}
.tba-macos-about>button{position:absolute;right:8px;top:8px;width:21px;height:21px;border:0;background:none;padding:3px}
.tba-macos-about>button img{width:100%;height:100%;filter:invert(.7)}
.tba-macos-about>img{width:64px;height:60px;object-fit:contain;image-rendering:pixelated}
.tba-macos-about>strong{font-size:17px}.tba-macos-about>span{font-size:10px;color:#b2bbc9}.tba-macos-about>small{font-size:8px;color:#9da7b6}
@container(max-width:650px){.tba-mac-desktop .tba-managed-window>.tba-managed-titlebar{height:28px;min-height:28px}.tba-scene .tba-mac-traffic .tba-window-control{width:13px;height:13px}.tba-mac-traffic{gap:5px}.tba-scene .tba-window-drag-handle{font-size:8px}}

/* The adventure itself is transparent like the original native overlay. Only
   the PNG pixels and small controls appear over the desktop. Other app frames
   retain their normal macOS chrome, borders and shadows. */
.tba-scene .tba-mac-desktop .tba-mac-window.tba-floating-game{overflow:visible;background:transparent;background-image:none;border:0;border-radius:0;box-shadow:none}
.tba-scene .tba-floating-game>.tba-world,.tba-scene .tba-floating-game>.tba-world-zone-5{background:transparent;background-image:none;border:0;border-radius:0;box-shadow:none}
.tba-scene .tba-floating-game>.tba-world::before,.tba-scene .tba-floating-game>.tba-world::after{display:none;background:transparent;box-shadow:none}
.tba-scene .tba-floating-game[data-dragging=true]>.tba-world{cursor:grabbing}
.tba-scene .tba-floating-game button{cursor:pointer}
/* Pointer clicks do not inherit the landing page's orange focus rectangles. */
html[data-visual="forge"] .tba-mac-desktop :focus:not(:focus-visible){outline:none!important}
html[data-visual="forge"] .tba-mac-desktop :focus-visible{outline:2px solid #7ab7ff;outline-offset:-2px}
html[data-visual="forge"] .tba-floating-game:focus,html[data-visual="forge"] .tba-floating-game:focus-visible{outline:none!important}
@media(prefers-reduced-motion:reduce){.tba-floating-game .tba-game-controls{transition:none}}

/* The main adventure floats over the complete Mac, including its menu and Dock.
   Its transparent sky lets clicks reach the app underneath. */
.tba-managed-desktop{position:relative}
.tba-scene .tba-floating-game,.tba-scene .tba-floating-game>.tba-world{pointer-events:none}
.tba-game-drag-surface{position:absolute;left:0;right:0;bottom:0;height:calc(30px * var(--tba-game-scale));z-index:3;pointer-events:auto;cursor:grab;touch-action:none}
.tba-floating-game[data-dragging=true] .tba-game-drag-surface{cursor:grabbing}
.tba-mac-desktop .tba-floating-game>.tba-game-hero-popover{position:absolute;left:0;right:auto;top:auto;bottom:calc(100% + 10px);width:var(--tba-panel-width,250px);max-width:100%;max-height:none;z-index:20;pointer-events:auto}
.tba-mac-desktop .tba-floating-game[data-panel-side=below]>.tba-game-hero-popover{top:calc(100% + 10px);bottom:auto}

.tba-mac-desktop .tba-floating-game[data-maximized=true]>.tba-game-hero-popover{top:10px;bottom:auto;left:10px;width:min(250px,calc((100cqh - 20px) * 318 / 468));max-width:calc(100% - 20px)}
