/* Player V2: scoped to the ordinary player, never the admin or catalogue. */
.player-v2 .player-layout{width:min(1280px,calc(100% - 28px));margin:12px auto 32px;display:block}.player-v2 .player-header{gap:14px;min-height:56px;padding:10px 18px}.player-header>a:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:58vw}.player-v2 .player-stage{--control-scale:1;--control-opacity:.9;--control-offset:4px;position:relative;background:#0c1115;border:1px solid #37433d;border-radius:18px;display:grid;grid-template-areas:"screen";grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);height:min(76dvh,780px);min-height:260px;overflow:hidden;touch-action:none;overscroll-behavior:contain;-webkit-user-select:none;user-select:none;color:#edf3ed;isolation:isolate}
.player-v2 #emulator{grid-area:screen;width:100%;height:100%;min-height:0;min-width:0;overflow:hidden;position:relative;background:#06090b;contain:size layout}.player-v2 #emulator canvas{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;image-rendering:pixelated;touch-action:none}.player-stage.changing-layout #emulator{visibility:hidden}.player-stage[data-shared=true] .ejs_menu_bar,.player-stage[data-shared=true] .ejs_virtualGamepad{display:none!important}.player-stage #emulator input[type=range]{padding:0;min-height:0}
.player-v2 .touch-control{display:none;touch-action:none;opacity:var(--control-opacity)}.player-v2 .player-stage[data-controls=true][data-shared=true]{grid-template-areas:"left screen right" "left system right";grid-template-columns:clamp(116px,18%,190px) minmax(0,1fr) clamp(116px,18%,190px);grid-template-rows:minmax(0,1fr) 42px}.player-v2 [data-controls=true][data-shared=true] .touch-control{display:flex}.touch-control.left-control{grid-area:left}.touch-control.right-control{grid-area:right}.player-v2 .left-control,.player-v2 .right-control{align-items:center;justify-content:center;flex-direction:column;padding:12px calc(8px + var(--control-offset));gap:10px;min-width:0}.player-v2 .system-controls{grid-area:system;justify-content:center;align-items:center;gap:12px;padding-bottom:4px}.player-v2 .player-stage button{touch-action:none;border:1px solid #65786d;background:#263730;color:#f4f7f1;border-radius:12px;min-height:36px;padding:6px 12px;line-height:1.1;font-family:inherit;-webkit-tap-highlight-color:transparent}.player-v2 .system-controls button{font-size:11px;min-width:68px;padding:7px 12px;border-radius:30px;min-height:32px}.player-v2 .stage-actions{position:absolute;top:8px;right:8px;z-index:4;display:flex;gap:6px}.player-v2 .stage-actions button{background:#17241de8;min-height:36px;font-size:12px;box-shadow:0 2px 8px #0005}.stage-actions #open-player-menu{font-size:20px;width:40px;padding:4px}.player-v2 .stick{width:min(calc(138px * var(--control-scale)),100%);aspect-ratio:1;border-radius:50%;position:relative;background:radial-gradient(circle,#34493d 0 20%,#203029 65%);border:2px solid #6c8173;touch-action:none;box-shadow:inset 0 2px 8px #0006}.stick:before,.stick:after{content:"";position:absolute;background:#82958555;pointer-events:none}.stick:before{width:2px;height:70%;top:15%;left:50%}.stick:after{height:2px;width:70%;left:15%;top:50%}.player-v2 .stick-thumb{width:44%;height:44%;left:28%;top:28%;position:absolute;border-radius:50%;background:#9bab94;border:2px solid #c9d1bd;box-shadow:0 3px 7px #0008;pointer-events:none;z-index:1}.player-v2 .stick.active .stick-thumb{background:#c9deb6}.stick-cross{display:none}.player-stage[data-stick-style=cross] .stick{border-radius:22%}.player-stage[data-stick-style=cross] .stick-cross{position:absolute;display:grid;place-items:center;inset:0;font-size:80px;color:#8c9d86;pointer-events:none}.player-stage[data-stick-style=cross] .stick-thumb{opacity:.55;width:28%;height:28%;top:36%;left:36%}
.player-v2 .action-buttons{width:min(calc(168px * var(--control-scale)),100%);display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));aspect-ratio:1;gap:2px;align-items:center}.player-v2 .action-buttons button{width:100%;aspect-ratio:1;min-height:0;padding:0;border-radius:50%;font-size:18px;font-weight:700;box-shadow:0 3px 0 #0006;position:relative}.action-buttons[data-count="4"] [data-button=x]{grid-area:1/2}.action-buttons[data-count="4"] [data-button=y]{grid-area:2/1}.action-buttons[data-count="4"] [data-button=a]{grid-area:2/3}.action-buttons[data-count="4"] [data-button=b]{grid-area:3/2}.player-v2 .action-buttons[data-count="2"]{grid-template-columns:1fr 1fr;grid-template-rows:1fr .65fr;aspect-ratio:1.2;gap:8px}.action-buttons[data-count="2"] [data-button=a]{align-self:start}.action-buttons[data-count="2"] [data-button=b]{align-self:end}.player-v2 .action-buttons .combo-button{grid-column:1/-1;justify-self:center;width:60%;aspect-ratio:auto;height:36px;border-radius:30px;font-size:12px}.player-v2 .action-buttons[data-count="6"]{grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(2,1fr);aspect-ratio:1.5;gap:5px}.player-v2 .shoulder-buttons{display:flex;justify-content:center;gap:8px;width:100%}.player-v2 .shoulder-buttons button{flex:1;max-width:72px}.player-v2 .player-stage .pressed{background:#d6e7b9!important;color:#17221a!important;border-color:#effada;box-shadow:none}
.player-v2 .launch-panel{position:absolute;inset:0;z-index:6;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#f1f2e9;color:#29382e;padding:24px;text-align:center;gap:12px}.player-v2 .launch-panel h1{font-size:clamp(22px,4vw,42px);max-width:750px;line-height:1.15;margin:0}.player-v2 .launch-panel p{margin:0;max-width:640px}.player-v2 .launch-panel button{background:#385744;color:#fff;font-size:15px;padding:12px 18px;min-height:44px}.player-v2 .launch-buttons{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}.player-v2 .launch-panel progress{width:min(430px,90%);height:10px;accent-color:#486c49}.player-v2 #load-detail{min-height:24px;font-size:12px;overflow-wrap:anywhere}.player-v2 #load-phase{font-size:14px}.player-v2 .player-toolbar{display:flex;gap:8px;flex-wrap:wrap;padding:12px 0}.player-v2 .player-toolbar>*{font-size:12px}.player-v2 .player-status{display:flex;justify-content:space-between;gap:12px;font-size:12px;flex-wrap:wrap;padding:12px 0}.player-v2 .player-help{font-size:13px;border-top:1px solid #ced4c4;padding:12px 0}.player-v2 .player-help summary{cursor:pointer;min-height:38px}.runtime-choice{display:flex;gap:12px;align-items:end;flex-wrap:wrap}.runtime-choice label{display:flex;flex-direction:column;gap:6px}.player-menu label{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:14px 0;font-size:14px}.player-menu label input[type=range]{width:60%;padding:0;min-height:24px}.player-menu label input[type=checkbox]{width:20px;min-height:20px}.player-menu select{max-width:65%}.menu-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.player-v2 .progress-dialog{max-height:calc(100dvh - 32px);width:min(700px,calc(100vw - 24px));padding:24px;overflow:auto}.player-v2 .snapshot-row>div:last-child{display:flex;flex-wrap:wrap;gap:6px}.player-v2 #game-save-section,.player-v2 #old-snapshots{padding-top:16px;margin-top:16px;border-top:1px solid #cbd4c5}
body.player-immersive{overflow:hidden}.player-immersive #player-stage,.player-v2 #player-stage:fullscreen{position:fixed;left:var(--player-left,0);top:var(--player-top,0);width:var(--player-vw,100vw);height:var(--player-vh,100dvh);max-height:none;border:0;border-radius:0;z-index:1000;padding:max(0px,env(safe-area-inset-top)) max(0px,env(safe-area-inset-right)) max(0px,env(safe-area-inset-bottom)) max(0px,env(safe-area-inset-left));min-height:0}.player-v2 #player-stage:fullscreen{left:0;top:0;width:100vw;height:100dvh}.player-immersive .recovery-question:not([hidden]){position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);max-width:90vw;width:450px;z-index:1001;background:#f3f6eb;padding:18px;box-shadow:0 12px 60px #0008}.player-v2 [hidden]{display:none!important}
@media(max-width:650px){.player-v2 .player-header{font-size:11px;min-height:46px;gap:8px;padding:8px 12px}.player-v2 .player-brand,.player-v2 #gamepad-status{display:none}.player-v2 .player-layout{width:calc(100% - 16px);margin-top:8px}.player-v2 .player-stage[data-orientation=portrait][data-controls=true][data-shared=true]{grid-template-areas:"screen screen" "system system" "left right";grid-template-columns:1fr 1fr;grid-template-rows:minmax(0,1fr) 38px clamp(170px,29dvh,240px);height:min(80dvh,820px);min-height:440px}.player-v2 .player-stage .left-control,.player-v2 .player-stage .right-control{padding:6px calc(12px + var(--control-offset))}.player-v2 .launch-panel{padding:16px}.player-v2 .player-toolbar>*{padding:8px 10px;min-height:40px}.player-v2 .progress-dialog{padding:18px}}
@media(orientation:landscape) and (max-height:540px){.player-v2 .player-stage[data-orientation=landscape][data-controls=true][data-shared=true]{grid-template-columns:clamp(110px,18%,168px) minmax(0,1fr) clamp(110px,18%,168px);grid-template-rows:minmax(0,1fr) 36px;min-height:210px;height:calc(var(--player-vh,100dvh) - 70px)}.player-v2 .left-control,.player-v2 .right-control{padding:4px calc(8px + var(--control-offset));gap:4px}.player-v2 .stick{width:min(calc(120px * var(--control-scale)),100%)}.player-v2 .action-buttons{width:min(calc(146px * var(--control-scale)),100%)}.player-v2 .action-buttons button{font-size:16px}.player-v2 .shoulder-buttons button{min-height:30px;padding:4px}.player-v2 .system-controls button{min-height:30px}.player-v2 .stage-actions{top:4px;right:4px}.player-v2 .player-header{min-height:42px}.player-v2 .launch-panel{padding:12px;gap:6px}.player-v2 .launch-panel h1{font-size:22px}.player-v2 .launch-panel .quiet{font-size:11px}.player-v2 .launch-panel button{min-height:40px}.player-immersive #player-stage[data-orientation=landscape]{height:var(--player-vh,100dvh);min-height:0}}

/* Recovery remains actionable in native fullscreen and immersive mode. */
.player-v2 .player-stage .recovery-question:not([hidden]){position:absolute;left:50%;top:auto;bottom:max(8px,env(safe-area-inset-bottom));transform:translateX(-50%);width:min(480px,calc(100% - 24px));max-width:none;max-height:calc(100% - 16px);overflow:auto;z-index:7;background:#f3f6eb;color:#24372a;padding:12px 16px;box-shadow:0 8px 30px #0008;border-radius:12px;font-size:13px}.player-v2 .player-stage .recovery-question p{margin:0 0 8px}.player-v2 .player-stage .recovery-question button{min-height:36px;font-size:12px}
