.touch-surface[hidden],.touch-mini-toolbar[hidden]{display:none!important}.touch-surface{position:absolute;inset:0;z-index:3;pointer-events:none;--touch-size:44px;--touch-opacity:.75;user-select:none;-webkit-user-select:none}.touch-group{position:absolute;transform:translate(-50%,-50%);pointer-events:none;touch-action:none}.touch-group button{pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;width:var(--touch-size);height:var(--touch-size);min-width:0;padding:0!important;margin:0!important;background:rgba(18,32,48,var(--touch-opacity));color:white;border:1px solid #b9d2e9a8;border-radius:50%;font-size:calc(var(--touch-size)*.4);display:grid;place-items:center;box-shadow:0 2px 7px #0008}.touch-group button.is-pressed{background:#c5ff44;color:#0a1920;border-color:#c5ff44}.touch-dpad{display:grid;grid-template-columns:repeat(3,var(--touch-size));gap:1px}.touch-dpad button{border-radius:12px}.touch-face{width:calc(var(--touch-size)*3);height:calc(var(--touch-size)*3)}.touch-face button{position:absolute}.touch-face .top{left:var(--touch-size);top:0}.touch-face .left{left:0;top:var(--touch-size)}.touch-face .right{right:0;top:var(--touch-size)}.touch-face .bottom{bottom:0;left:var(--touch-size)}.touch-left,.touch-right,.touch-system{display:flex;gap:6px}.touch-left button,.touch-right button{border-radius:14px;font-size:15px}.touch-system button{width:calc(var(--touch-size)*1.35);height:calc(var(--touch-size)*.7);border-radius:12px;font-size:10px}.touch-mini-toolbar{position:absolute;top:8px;left:50%;transform:translateX(-50%);z-index:4;display:flex;gap:6px}.touch-mini-toolbar button{padding:7px!important;font-size:10px;background:#0b1c2ee6;color:white;white-space:nowrap}.touch-surface.is-editing{background:#77baff18;pointer-events:auto}.touch-surface.is-editing .touch-group{outline:2px dashed #c5ff44;outline-offset:4px}.touch-settings{color:white;background:#132438;border:1px solid #7294ad;border-radius:16px;padding:20px;max-width:460px;width:calc(100% - 32px);max-height:85dvh;overflow:auto;z-index:8}.touch-settings::backdrop{background:#030c16c9}.touch-settings label{display:block;margin:16px 0}.touch-settings select,.touch-settings input{display:block;width:100%;margin-top:8px}.touch-settings button{margin:5px}.mobile-game-mode{overflow:hidden}.mobile-game-mode #we-stage{position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;max-width:none!important;aspect-ratio:auto!important;z-index:1000;background:#03070e}.mobile-game-mode #we-stage #psxCanvas{object-fit:contain!important}.mobile-game-mode .touch-mini-toolbar{top:max(8px,env(safe-area-inset-top))}
@media(max-width:600px) and (orientation:portrait){.arena-page #we-stage.has-touch:not(:fullscreen){aspect-ratio:auto}.arena-page #we-stage.has-touch:not(:fullscreen) #psxCanvas{position:relative;inset:auto;width:100%!important;height:auto!important;aspect-ratio:16/9}.arena-page #we-stage.has-touch:not(:fullscreen) .touch-surface{position:relative;inset:auto;height:250px;width:100%;background:#0c1929}.arena-page #we-stage.has-touch .touch-mini-toolbar{top:6px}.mobile-game-mode #we-stage.has-touch:not(:fullscreen) #psxCanvas{height:52dvh!important;object-fit:contain!important}.mobile-game-mode #we-stage.has-touch:not(:fullscreen) .touch-surface{height:48dvh!important}}
@media(pointer:coarse){.arena-toolbar button{min-height:44px}.arena-page header{flex-wrap:wrap}.account-bar{flex-wrap:wrap}.arena-page main{padding-left:10px;padding-right:10px}}
/* Keep the presentation ratio stable when the emulated game changes video mode. */
.mobile-game-mode #we-stage #psxCanvas{position:absolute!important;inset:auto!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%);width:min(100vw,177.7778dvh)!important;height:min(100dvh,56.25vw)!important;object-fit:fill!important}
@media(max-width:600px) and (orientation:portrait){.mobile-game-mode #we-stage.has-touch:not(:fullscreen) #psxCanvas{position:absolute!important;left:0!important;top:calc((52dvh - 56.25vw)/2)!important;transform:none;width:100vw!important;height:56.25vw!important;object-fit:fill!important}.mobile-game-mode #we-stage.has-touch:not(:fullscreen) .touch-surface{position:absolute;top:52dvh;left:0}}

.touch-group.touch-dpad{display:block;width:calc(var(--touch-size)*3.2);height:calc(var(--touch-size)*3.2)}.touch-group .joystick-base{position:relative;width:100%;height:100%;border-radius:50%;border:1px solid #91abc078;background:radial-gradient(circle at center,transparent 32%,#bed6e91a 33%,transparent 35%,transparent 64%,#bed6e920 65%,transparent 68%),rgba(9,23,38,var(--touch-opacity));box-shadow:inset 0 3px 15px #0007,0 2px 8px #0005;overflow:visible}.joystick-knob{position:absolute;left:50%;top:50%;width:40%;height:40%;transform:translate(-50%,-50%);border-radius:50%;border:1px solid #b8cfe796;background:radial-gradient(circle at 36% 25%,#587087,#233e55 60%,#122737);box-shadow:inset 0 2px 3px #ffffff26,0 5px 12px #0008;pointer-events:none;will-change:transform}.joystick-knob:after{content:'';position:absolute;inset:30%;border:1px solid #b6cbd94d;border-radius:50%;background:#ffffff08}.joystick-base.is-active{border-color:#c2f750a8;box-shadow:inset 0 3px 15px #0007,0 0 18px #c2f75016}.joystick-base.is-active .joystick-knob{border-color:#d4ff83;box-shadow:inset 0 2px 3px #ffffff26,0 4px 12px #0008,0 0 10px #c2f75030}.touch-surface.is-editing .touch-dpad{border-radius:50%}
