/* Touch layout follows the player-camp palette, with clear space for aiming. */
#touchPad,#lookHint,.touch-settings{display:none}
html[data-touch=true]{overscroll-behavior:none;-webkit-text-size-adjust:100%}
html[data-touch=true] body{overscroll-behavior:none}
html[data-touch=true] #view{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
html[data-touch=true] .club-game .touch-move{display:none}
html[data-touch=true] #touchPad{display:grid;place-items:center;position:fixed;z-index:18;left:max(26px,env(safe-area-inset-left));bottom:max(28px,env(safe-area-inset-bottom));width:156px;height:156px;border:2px solid #d4ff5070;border-radius:50%;background:radial-gradient(circle,#bda5ff14 30%,#15152580 31% 65%,#bda5ff19 66%);box-shadow:0 3px 14px #0003;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;cursor:grab}
#touchPad:before{content:'✥';position:absolute;font-size:124px;line-height:1;color:#e5e0ff21;pointer-events:none}
#touchKnob{width:60px;height:60px;border:2px solid #e4ff94a0;border-radius:50%;background:#d4ff50b8;box-shadow:0 4px 18px #0005;pointer-events:none;will-change:transform}
#touchPad>small{position:absolute;bottom:-19px;letter-spacing:2px;font-size:9px;color:#fff9;pointer-events:none}
#touchPad[data-active=true]{border-color:#d4ff50}#touchPad[data-active=true] #touchKnob{background:#d4ff50}
html[data-touch=true] #lookHint{display:block;position:fixed;right:24%;bottom:40%;font-size:11px;color:#ffffffe0;text-shadow:0 2px 4px #000;pointer-events:none;transition:opacity .4s}
html[data-touch=true] #hud[data-controls-blocked=true] :is(#touchPad,#lookHint,.quick){visibility:hidden;pointer-events:none}
html[data-touch=true] #hud :is(button,#touchPad){touch-action:none}
/* A thumb arc: the clear area between buttons still accepts look swipes. */
html[data-touch=true] .club-game .quick{
 --action-scale:1;z-index:18;top:auto;right:max(22px,env(safe-area-inset-right));
 bottom:max(28px,env(safe-area-inset-bottom));display:block;
 width:calc(256px * var(--action-scale));height:calc(270px * var(--action-scale));
 max-width:none;pointer-events:none
}
html[data-touch=true] .quick button{
 position:absolute;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;
 width:calc(68px * var(--action-scale));height:calc(68px * var(--action-scale));min-height:0;
 margin:0;padding:6px 2px;box-sizing:border-box;border:2px solid #ffffff94;border-radius:50%;
 background:#111b2a38;color:#fff;box-shadow:inset 0 0 0 3px #ffffff0c,0 2px 6px #0002;
 text-shadow:0 1px 3px #000,0 0 6px #0009;font-size:12px;font-weight:700;line-height:1.1;
 pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;
 -webkit-tap-highlight-color:transparent;appearance:none;-webkit-appearance:none;
 transition:background-color .1s,border-color .1s,box-shadow .1s
}
html[data-touch=true] .quick button::before{
 content:'';display:block;flex:none;width:26px;height:26px;background:currentColor;
 -webkit-mask:var(--action-icon) center / contain no-repeat;mask:var(--action-icon) center / contain no-repeat;
 pointer-events:none;filter:drop-shadow(0 1px 2px #0008)
}
html[data-touch=true] .quick button:active{
 background:#ffffff38;border-color:#fff;box-shadow:inset 0 0 0 4px #ffffff20,0 0 16px #ffffff24
}
html[data-touch=true] .quick button:focus-visible{outline:3px solid #fff;outline-offset:4px}
html[data-touch=true] .quick #fire{
 right:0;bottom:0;width:calc(116px * var(--action-scale));height:calc(116px * var(--action-scale));
 border-color:#e6ffafcc;background:#c8ff681f;color:#f0ffd6;font-weight:900;font-size:16px;
 box-shadow:inset 0 0 0 5px #d4ff5010,0 2px 8px #0002
}
html[data-touch=true] .quick #fire::before{width:36px;height:36px}
html[data-touch=true] .quick #fire:active{background:#d4ff5045;border-color:#f4ffd8;box-shadow:inset 0 0 0 5px #d4ff5026,0 0 20px #d4ff5033}
html[data-touch=true] .quick #run{
 right:calc(136px * var(--action-scale));bottom:0;
 width:calc(80px * var(--action-scale));height:calc(80px * var(--action-scale))
}
html[data-touch=true] .quick #run[aria-pressed=true]{background:#d4ff5038;border-color:#d4ff50;color:#efffc7;box-shadow:inset 0 0 0 4px #d4ff5017,0 0 10px #d4ff5022}
html[data-touch=true] .quick #interact{
 right:calc(128px * var(--action-scale));bottom:calc(100px * var(--action-scale));
 width:calc(84px * var(--action-scale));height:calc(84px * var(--action-scale))
}
html[data-touch=true] .quick #chatToggle{right:calc(12px * var(--action-scale));bottom:calc(144px * var(--action-scale))}
html[data-touch=true] .quick #wave{right:calc(108px * var(--action-scale));bottom:calc(200px * var(--action-scale))}
html[data-touch=true] .quick #lock{display:none}
html[data-touch=true] .quick #fire{--action-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%227%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%222%22%2F%3E%3Cpath%20d%3D%22M12%201v4m0%2014v4M1%2012h4m14%200h4%22%2F%3E%3C%2Fsvg%3E")}
html[data-touch=true] .quick #run{--action-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2215%22%20cy%3D%224%22%20r%3D%222%22%2F%3E%3Cpath%20d%3D%22m12%208%204%203%204%201M6%209l5-2-2%207%205%203v5M3%2020l6-6m-7-1h4m-5%204h3%22%2F%3E%3C%2Fsvg%3E")}
html[data-touch=true] .quick #interact{--action-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%207h15m-4-4%204%204-4%204M20%2017H5m4-4-4%204%204%204%22%2F%3E%3C%2Fsvg%3E")}
html[data-touch=true] .quick #chatToggle{--action-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M21%2011a8%208%200%200%201-8%208H8l-5%203v-6a8%208%200%200%201-1-4%209%209%200%200%201%2019-1Z%22%2F%3E%3Cpath%20d%3D%22M7%2011h.01M12%2011h.01M17%2011h.01%22%2F%3E%3C%2Fsvg%3E")}
html[data-touch=true] .quick #wave{--action-icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M8%2012V5a1.5%201.5%200%200%201%203%200v6-8a1.5%201.5%200%200%201%203%200v8-6a1.5%201.5%200%200%201%203%200v7-3a1.5%201.5%200%200%201%203%200v6a7%207%200%200%201-12%205l-4-5a1.5%201.5%200%200%201%202-2l2%201Z%22%2F%3E%3Cpath%20d%3D%22M3%205%202%208m20-4%201%203%22%2F%3E%3C%2Fsvg%3E")}
html[data-touch=true] .club-game .topbar{top:max(10px,env(safe-area-inset-top));left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right));gap:10px}
html[data-touch=true] .club-game .compact{padding:10px 13px;min-width:0;width:auto;max-width:calc(100vw - 28px)}
html[data-touch=true] .compact>.eyebrow{display:none}
html[data-touch=true] .roomline{margin:0 0 6px;gap:8px;flex-wrap:wrap;font-size:12px}
html[data-touch=true] .roomline button{font-size:12px;min-height:44px;padding:8px 10px}
html[data-touch=true] #share{display:none}
html[data-touch=true] #round{font-size:12px}
html[data-touch=true] #connection{font-size:10px;line-height:1.4}
html[data-touch=true] .apple-threat{margin:6px 0;padding:5px 8px;font-size:11px;gap:6px}
html[data-touch=true] .apple-threat-total b{font-size:17px}
html[data-touch=true] .apple-threat-icon{font-size:17px}
html[data-touch=true] .scores{display:none}
html[data-touch=true] .club-game .bottom{left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right));bottom:218px;align-items:flex-end;gap:12px;pointer-events:none}
html[data-touch=true] .club-game .bottom .radar{max-width:260px;min-width:0;padding:10px 12px;gap:5px;box-shadow:0 3px 0 #090a10}
html[data-touch=true] .radar>strong{font-size:12px}
html[data-touch=true] .radar>#range{font-size:10px}
html[data-touch=true] .radar #sound{position:absolute;left:175px;top:6px;min-height:44px;font-size:10px;padding:6px}
html[data-touch=true] .powerup-title{display:none}
html[data-touch=true] .powerup-pack{padding-top:5px;margin-top:2px;max-width:none}
html[data-touch=true] .powerup-buttons{margin-top:4px}
html[data-touch=true] .club-game .powerup-buttons button{min-height:44px;font-size:11px}
html[data-touch=true] .compass-dial{width:38px;height:38px}
html[data-touch=true] .compass-arrow{font-size:29px!important}
html[data-touch=true] .compass-reading{margin-top:5px;gap:8px}
html[data-touch=true] .cloak-reading{margin:4px 0 0;font-size:10px}
html[data-touch=true] .club-game .gadget{position:fixed;right:max(22px,env(safe-area-inset-right));bottom:max(316px,calc(env(safe-area-inset-bottom) + 288px));max-width:215px;padding:10px 12px;gap:4px;box-shadow:0 3px 0 #090a10}
html[data-touch=true] #gadget{font-size:12px}
html[data-touch=true] #ammo{font-size:11px}
html[data-touch=true] #controls{display:none!important}
html[data-touch=true] #toast{bottom:200px;left:calc(50% - 40px);max-width:min(62vw,calc(100vw - 540px));font-size:12px;padding:8px 14px;z-index:20}
html[data-touch=true] #aimLabel{font-size:11px;padding:5px 8px;max-width:240px}
html[data-touch=true] #aimLabel small{font-size:10px}
html[data-touch=true] :is(#danger,#streamStatus){top:168px;left:14px;right:auto;font-size:11px;max-width:calc(100vw - 28px)}
html[data-touch=true] #streamStatus{top:208px}
html[data-touch=true] #elevatorPrompt{z-index:19;top:auto;bottom:200px;left:50%;transform:translateX(-50%);min-height:48px;font-size:14px}
html[data-touch=true] .touch-settings{display:block;border-top:1px solid #ffffff24;margin-top:18px;padding-top:12px}
.touch-settings input{width:100%;min-height:44px;accent-color:#d4ff50}.touch-settings label{margin:4px 0;font-size:13px}
html[data-touch=true] :is(#lobby,#pause,.chat-panel,.campus-map,.quiz-dialog,#elevatorDialog){max-height:calc(var(--visible-height,100dvh) - 24px);overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
html[data-touch=true] #chatPanel{bottom:calc(var(--keyboard-inset,0px) + 12px);max-height:calc(var(--visible-height,100dvh) - 24px);z-index:35}
html[data-touch=true] :is(input,textarea,select,#chatInput){font-size:16px!important}
html[data-touch=true] :is(#pause,.quiz-dialog,#elevatorDialog) button{min-height:48px}
html[data-touch=true] .touch-guide{display:block;background:#bda5ff16;border:1px solid #bda5ff55;border-radius:12px;padding:14px;font-size:13px;line-height:1.6;margin:16px 0}
.touch-guide{display:none}
html[data-touch=true] .touch-guide strong{display:block;color:#d4ff50;margin-bottom:4px}
@media(orientation:portrait){html[data-touch=true] .club-game .compact{width:100%}html[data-touch=true] .club-game .bottom{bottom:224px}html[data-touch=true] #lookHint{right:20%;bottom:46%}}
@media(max-width:600px){html[data-touch=true] .club-game .bottom .radar{max-width:55%;padding:8px}html[data-touch=true] .radar #sound{position:static;min-height:34px}html[data-touch=true] .club-game .gadget{max-width:42%;padding:8px}html[data-touch=true] #touchPad{width:140px;height:140px;left:20px}html[data-touch=true] #touchKnob{width:54px;height:54px}html[data-touch=true] #toast{max-width:90vw}}
@media(max-height:620px) and (orientation:landscape){html[data-touch=true] .apple-threat{display:none}html[data-touch=true] .roomline{margin-bottom:2px}html[data-touch=true] .club-game .compact{padding:6px 10px}html[data-touch=true] .club-game .bottom{bottom:auto;top:10px;left:auto;right:14px;width:260px;display:block}html[data-touch=true] .club-game .bottom .radar{max-width:none;width:260px;padding:7px 10px}html[data-touch=true] .gadget{display:none}html[data-touch=true] #touchPad{width:130px;height:130px;bottom:20px}html[data-touch=true] #touchKnob{width:50px;height:50px}html[data-touch=true] .powerup-pack{border:0}html[data-touch=true] .compass-reading{position:absolute;right:270px;top:0;width:190px;background:#1e1d2fee;border-radius:10px;padding:8px}html[data-touch=true] #toast{bottom:20px;max-width:calc(100vw - 540px)}html[data-touch=true] #range{display:none}html[data-touch=true] #danger{top:112px}html[data-touch=true] #streamStatus{top:140px}html[data-touch=true] #lookHint{bottom:45%;right:27%}}

/* Short landscape keeps larger buttons clear of the top-right radar. */
@media(max-height:620px) and (orientation:landscape){
 html[data-touch=true] .club-game .quick{--action-scale:.9;bottom:max(20px,env(safe-area-inset-bottom))}
}
@media(max-height:440px) and (orientation:landscape){
 html[data-touch=true] .club-game .quick{width:300px;height:180px;--action-scale:1}
 html[data-touch=true] .quick #fire{width:104px;height:104px}
 html[data-touch=true] .quick #run{right:120px;bottom:0;width:72px;height:72px}
 html[data-touch=true] .quick #interact{right:120px;bottom:88px;width:76px;height:76px}
 html[data-touch=true] .quick #chatToggle{right:208px;bottom:12px;width:60px;height:60px}
 html[data-touch=true] .quick #wave{right:212px;bottom:100px;width:60px;height:60px}
 html[data-touch=true] .quick button::before{width:23px;height:23px}
 html[data-touch=true] .quick #fire::before{width:32px;height:32px}
}
@media(max-width:600px) and (orientation:portrait){
 html[data-touch=true] .club-game .quick{width:216px;height:300px}
 html[data-touch=true] .quick #fire{width:104px;height:104px}
 html[data-touch=true] .quick #run{right:120px;bottom:116px;width:72px;height:72px}
 html[data-touch=true] .quick #interact{right:0;bottom:120px;width:80px;height:80px}
 html[data-touch=true] .quick #chatToggle{right:100px;bottom:212px;width:64px;height:64px}
 html[data-touch=true] .quick #wave{right:4px;bottom:228px;width:64px;height:64px}
 html[data-touch=true] .club-game .bottom .radar{max-width:calc(100vw - 218px)}
 html[data-touch=true] .club-game .gadget{display:none}
 html[data-touch=true] #lookHint{display:none}
 html[data-touch=true] #toast{top:180px;bottom:auto;left:50%}
}
@media(prefers-reduced-motion:reduce){html[data-touch=true] .quick button{transition:none}}
