/* Additional controls only. No selectors modify native HUD or canvas resolution. */
.halo-touch{position:absolute;inset:0;z-index:25;pointer-events:none;color:#e7f8ff;font:12px system-ui,sans-serif;contain:layout style}
.halo-touch[hidden],.halo-touch [hidden]{display:none!important}
.halo-touch-layer{position:absolute;inset:max(48px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.halo-touch-control{position:absolute;transform:translate(-50%,-50%);min-width:0;min-height:0;margin:0;padding:0;border:0;border-radius:50%;background:transparent;color:white;touch-action:none;opacity:.78;user-select:none;-webkit-user-select:none}
.halo-touch-icon{display:block;width:100%;height:100%;background-size:500% 400%;background-repeat:no-repeat;pointer-events:none}
.halo-touch-label{position:absolute;bottom:0;left:50%;transform:translateX(-50%);max-width:125%;padding:1px 3px;border-radius:3px;background:#061a28e0;white-space:nowrap;font-size:10px;pointer-events:none}
.halo-touch-control:not(:has(.halo-touch-icon)){border:1px solid #68d1ff;background:#09344ad9;border-radius:9px}
.halo-touch-control:not(:has(.halo-touch-icon)) .halo-touch-label{position:static;transform:none;background:none;white-space:normal}
.halo-touch-control[data-pressed=true]{opacity:1;filter:brightness(1.2)}
.halo-touch-thumb{position:absolute;left:33%;top:33%;width:34%;height:34%;box-sizing:border-box;border-radius:50%;border:1px solid #8cf0ff;background:radial-gradient(circle at 35% 25%,#b2f7ff,#09a4e7 42%,#035a9b 75%);pointer-events:none}
.halo-touch-toolbar{position:absolute;top:max(4px,env(safe-area-inset-top));left:max(6px,env(safe-area-inset-left));right:max(6px,env(safe-area-inset-right));display:flex;justify-content:center;gap:5px;align-items:center;pointer-events:none}
.halo-touch-toolbar button,.halo-touch-editor button,.halo-touch-editor input,.halo-touch-editor select{pointer-events:auto;min-width:44px;min-height:44px;padding:5px 8px;border:1px solid #478cb0;border-radius:6px;background:#071d2ef0;color:#e7f8ff;font:inherit;touch-action:manipulation;box-sizing:border-box}
.halo-touch-status{max-width:150px;font-size:10px;background:#041b2be0;border-radius:4px;padding:4px;pointer-events:none}
.halo-touch-help{position:absolute;top:48px;left:20%;right:20%;margin:0;text-align:center;background:#021724e8;border-radius:6px;padding:6px;pointer-events:none}
.halo-touch-editor{position:absolute;top:52px;left:50%;transform:translateX(-50%);width:min(300px,calc(100% - 20px));max-height:calc(100% - 62px);overflow:auto;overscroll-behavior:contain;box-sizing:border-box;padding:10px;border:1px solid #5dbde6;border-radius:8px;background:#031521f5;pointer-events:auto;display:flex;flex-direction:column;gap:7px}
.halo-touch-editor p{font-size:11px;margin:0}.halo-touch-editor select{width:100%}
.halo-touch-field{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px}
.halo-touch-field input[type=range]{width:58%;padding:0;accent-color:#4dccff}.halo-touch-field input[type=checkbox]{width:22px;min-width:22px;min-height:30px;margin:0;accent-color:#4dccff}
.halo-touch-editor-actions{display:flex;gap:5px;flex-wrap:wrap}.halo-touch-editor-actions button{flex:1}
.halo-touch[data-editing=true] .halo-touch-control{outline:1px dashed #6ecffc}
.halo-touch[data-editing=true] .halo-touch-control[data-selected=true]{outline:3px solid #fff;opacity:1}
.halo-touch[data-editing=true] .halo-touch-control[data-visible=false]{opacity:.3;outline-color:#ffbe66}
.halo-touch button:focus-visible,.halo-touch input:focus-visible,.halo-touch select:focus-visible{outline:3px solid white;outline-offset:2px}
@media(max-height:420px){.halo-touch-status,.halo-touch-help{display:none}.halo-touch-editor{left:6px;transform:none;width:min(250px,calc(100% - 12px))}.halo-touch-toolbar button{font-size:11px}}
/* Portrait needs space for separate touch hit rectangles, not a 4:3 letterbox.
   Only CSS presentation changes; fullscreen and framebuffer ownership stay intact. */
@media(any-pointer:coarse) and (orientation:portrait){.public-game .touch-viewport:not(:fullscreen){aspect-ratio:auto;height:min(72svh,680px);min-height:500px}}
/* Active touch viewport owns its height; the landing's later phone breakpoints
   must not crop its toolbar back into the fixed promotional hero height. */
.public-shell .landing-hero.runtime-active:has(.touch-viewport){height:auto;min-height:0}
/* The fallback keeps the same canvas/HUD in place. Neutralize only marked
   ancestors that would otherwise clip a fixed descendant or create its viewport. */
.touch-immersive-ancestor{overflow:visible!important;clip-path:none!important;transform:none!important;filter:none!important;perspective:none!important;contain:none!important;isolation:auto!important;will-change:auto!important;z-index:auto!important}
body.touch-immersive-page{overflow:hidden!important;overscroll-behavior:none}
.public-game .touch-viewport.touch-immersive{position:fixed!important;inset:0!important;width:100vw!important;width:100dvw!important;height:100vh!important;height:100dvh!important;min-height:0!important;max-height:none!important;max-width:none!important;aspect-ratio:auto!important;margin:0!important;border:0!important;z-index:2147483000!important;background:#000}
.touch-viewport:fullscreen{width:100vw;width:100dvw;height:100vh;height:100dvh;min-height:0;max-height:none;aspect-ratio:auto;background:#000}
.touch-viewport:-webkit-full-screen{width:100vw;height:100vh;min-height:0;max-height:none;aspect-ratio:auto;background:#000}
.touch-fullscreen-exit{position:absolute;right:max(6px,env(safe-area-inset-right));top:max(4px,env(safe-area-inset-top));z-index:2147483646;min-width:44px;min-height:44px;width:104px;padding:4px 7px;border:1px solid #65bde3;border-radius:6px;background:#061d2cf2;color:#eefaff;font:11px system-ui,sans-serif;line-height:1.2;touch-action:manipulation}
.touch-fullscreen-exit[hidden]{display:none!important}
.touch-fullscreen-exit:focus-visible{outline:3px solid white;outline-offset:2px}
.touch-viewport:has(>.touch-fullscreen-exit:not([hidden])) .halo-touch-toolbar{right:max(116px,calc(env(safe-area-inset-right) + 110px));justify-content:flex-start}
.touch-viewport:has(>.touch-fullscreen-exit:not([hidden])) .halo-touch-toolbar button{flex:1 1 0;min-width:44px;padding:4px;font-size:10px;white-space:normal}
.touch-viewport:has(>.touch-fullscreen-exit:not([hidden])) .halo-touch-status{display:none}

/* One compact entry point during mobile gameplay; utility actions live inside it. */
.halo-touch-options-toggle{position:absolute;top:max(6px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:0;background:transparent;pointer-events:auto;touch-action:manipulation;cursor:pointer}
.halo-touch-options-icon{display:block;width:100%;height:100%;background:url('./assets/touch/menu-holographic.png') center/48px 48px no-repeat;pointer-events:none}
.halo-touch-options-toggle:hover,.halo-touch-options-toggle[aria-expanded=true]{filter:brightness(1.2)}
.halo-touch-toolbar{top:max(60px,calc(env(safe-area-inset-top) + 54px));left:50%;right:auto;transform:translateX(-50%);width:min(300px,calc(100% - 24px));max-height:calc(100% - max(72px,calc(env(safe-area-inset-top) + 66px)) - env(safe-area-inset-bottom));overflow:auto;overscroll-behavior:contain;box-sizing:border-box;padding:12px;display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;gap:8px;border:1px solid #58caff;border-radius:10px;background:#041320f5;box-shadow:0 8px 30px #0009;pointer-events:auto}
.halo-touch-toolbar button{flex-shrink:0;font-size:13px;font-weight:600;text-align:left;padding:10px 12px}
.halo-touch-toolbar .halo-touch-resume{border-color:#7bddff;background:#103d58}
.halo-touch-toolbar .halo-touch-status{display:block;max-width:none;background:none;font-size:11px}
.halo-touch-toolbar .halo-touch-help{position:static;display:block;margin:0;text-align:left;font-size:11px}
.public-game.touch-game-playing>.toolbar{display:none}

.halo-touch-toolbar .audio-control{display:flex;align-items:center;gap:8px;min-height:44px;flex-shrink:0;pointer-events:auto}
.halo-touch-toolbar .audio-control input{min-width:0;flex:1;width:100%;accent-color:#5bd4ff;touch-action:manipulation}
.halo-touch-toolbar .audio-control svg{width:22px;height:22px}

.halo-touch-editor .halo-touch-status{display:block;max-width:none;font-size:11px}

.halo-touch .halo-touch-options-toggle,.halo-touch .halo-touch-options-toggle:hover{background:transparent;border:0;box-shadow:none}
