/* VT3 touch layout: use the side margins without stretching the game. */
@media (orientation: landscape) {
  body.vt3-touch .stage {
    padding: 0 env(safe-area-inset-right, 0px) max(8px, env(safe-area-inset-bottom, 0px)) env(safe-area-inset-left, 0px) !important;
  }
  body.vt3-touch canvas,
  body.vt3-touch.panel-open canvas,
  body.vt3-touch.browser-fullscreen canvas,
  body.vt3-touch .stage:fullscreen canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    aspect-ratio: auto !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    object-fit: fill;
  }
}

/* Managed player: one canvas, no second header or emulator file panel. */
body.publication-player #panelToggleBtn,body.publication-player .panel,body.publication-player aside{display:none!important}
body.publication-player.panel-open{--panel-w:0px}
body.publication-player header{position:fixed!important;z-index:60;top:4px;left:50%;width:54px!important;height:36px!important;min-height:0!important;padding:0!important;border:0!important;background:transparent!important;transform:translateX(48px);backdrop-filter:none!important}
body.publication-player header>*:not(#displayGroup){display:none!important}
body.publication-player header #displayGroup{display:contents!important}
body.publication-player header #displayGroup>*:not(#fullscreenBtn){display:none!important}
body.publication-player .body-main{grid-template-columns:minmax(0,1fr)!important}
body.publication-player header #fullscreenBtn{display:flex!important;width:44px;height:36px;min-height:36px;padding:6px;background:#0b192ed9;border:1px solid #66829c;border-radius:8px}
body.publication-player .stage{padding:0!important;flex:1!important;min-height:0!important;width:100%!important}
body.publication-player .fps-badge,body.publication-player .status-badge,body.publication-player #fpsBadge,body.publication-player #statusBadge{display:none!important}
body.publication-player .stage-status,body.publication-player #status{display:none!important}
body.publication-player.embedded-player app-root{height:100%!important;flex:1!important}
@media(orientation:landscape){body.publication-player.vt3-touch .stage{padding:0 env(safe-area-inset-right,0px) 0 env(safe-area-inset-left,0px)!important}}
body.publication-player #statusPill,body.publication-player .status-pill{display:none!important}
body.publication-player #stageMini{display:none!important}
.vt3-performance-toggle{position:fixed;z-index:70;top:4px;left:calc(50% + 104px);width:46px;height:36px;min-height:36px;padding:0;border:1px solid #66829c;border-radius:8px;background:#0b192ed9;color:#c6d9e6;font:600 10px system-ui;cursor:pointer}
.vt3-performance-toggle[aria-pressed=true]{color:#d5ff63}
.vt3-performance-toggle:disabled{display:none}
@media(orientation:portrait){body.vt3-touch .vt3-performance-toggle{top:calc(var(--portrait-game-height,35vh) + 79px)}}
.vt3-system-controls{position:fixed;inset:0;z-index:80;pointer-events:none}
.vt3-system-controls[hidden]{display:none!important}
.vt3-system-controls button{position:absolute;top:calc(var(--court-bottom) + 3px);width:64px;height:28px;min-height:28px;max-height:28px;padding:0;border:0;border-radius:4px;background:#0b152099;color:#e9f0f5;font:600 11px/28px system-ui,sans-serif;letter-spacing:.06em;pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.vt3-system-select{left:var(--court-left);text-align:left!important;justify-content:flex-start!important}
.vt3-system-start{left:calc(var(--court-right) - 64px);text-align:right!important;justify-content:flex-end!important}
.vt3-system-controls button.pressed{color:#d5ff63;background:#244032}
.vt3-start-tip{position:absolute;top:calc(var(--court-bottom) + 7px);left:calc(var(--court-left) + 72px);width:calc(var(--court-width) - 144px);margin:0;color:#b9c9d6;text-align:center;font:12px/1.4 system-ui,sans-serif;pointer-events:none}
.vt3-start-tip strong{color:#d5ff63}
@media(orientation:portrait){
 body.publication-player.vt3-touch .stage canvas{width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;aspect-ratio:auto!important;object-fit:fill!important;transform:translateY(calc(-1 * var(--portrait-shift,0px)));border:0;box-shadow:none}
 body.publication-player.vt3-touch header{top:calc(var(--portrait-game-height,35vh) + 79px)}
 .vt3-start-tip{top:calc(var(--court-bottom) + 43px);left:calc(var(--court-left) + 16px);width:calc(var(--court-width) - 32px);font-size:12px;line-height:1.5}
 .vt3-system-controls button{top:calc(var(--court-bottom) + 7px);height:30px;min-height:30px;font-size:12px;line-height:30px}
}

.vt3-sound-toggle{position:fixed;z-index:70;top:4px;left:calc(50% + 154px);width:44px;height:36px;min-height:36px;padding:0;border:1px solid #66829c;border-radius:8px;background:#0b192ed9;color:#c6d9e6;font:18px system-ui;cursor:pointer}.vt3-sound-toggle[aria-pressed=true]{border-color:#d5ff63}.vt3-sound-toggle:disabled{display:none}@media(orientation:portrait){body.vt3-touch .vt3-sound-toggle{top:calc(var(--portrait-game-height,35vh) + 79px)}}@media(max-width:399px){.vt3-sound-toggle{left:auto;right:8px;top:44px}body.vt3-touch .vt3-sound-toggle{top:calc(var(--portrait-game-height,35vh) + 119px)}}
