@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');
:root{color-scheme:dark;--bg:#11110f;--surface:#191917;--line:#30302b;--text:#f2f0e7;--muted:#929189;--lime:#d6fa6a;--mono:'DM Mono',monospace;--sans:'Space Grotesk',sans-serif}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:var(--sans);font-size:15px}a{color:inherit;text-decoration:none}.topbar{height:76px;border-bottom:1px solid var(--line);padding:0 max(5vw,24px);display:flex;align-items:center;justify-content:space-between}.brand{display:flex;align-items:center;gap:11px;font-size:17px;font-weight:700;letter-spacing:-.7px}.brand-mark{width:29px;height:29px;display:grid;place-items:center;background:var(--lime);color:#171811;font-size:18px;font-weight:700}.brand-slash{color:var(--lime)}.topbar-right{display:flex;align-items:center;gap:10px;color:#aaa99f;font:10px var(--mono);letter-spacing:.4px}.status-dot{width:7px;height:7px;border-radius:50%;background:var(--lime);box-shadow:0 0 12px #d6fa6a66}.icon-button{margin-left:12px;width:29px;height:29px;border:1px solid #484840;border-radius:50%;background:transparent;color:var(--text);font:13px var(--mono);cursor:pointer}
main{max-width:1180px;margin:auto;padding:0 32px}.hero{min-height:460px;display:grid;grid-template-columns:1.1fr .9fr;align-items:center;border-bottom:1px solid var(--line);overflow:hidden}.hero-copy{padding:64px 0}.eyebrow{font:10px var(--mono);letter-spacing:1.5px;color:#aaa99f}.eyebrow-line{display:inline-block;width:23px;height:1px;margin:0 9px 3px 0;background:var(--lime)}h1{font-size:clamp(52px,7vw,82px);letter-spacing:-6px;line-height:.94;margin:25px 0 22px;font-weight:600}h1 span,h2 span{color:var(--lime)}.hero-copy>p:not(.microcopy){max-width:420px;color:#aaa99f;line-height:1.65;font-size:16px;margin:0 0 26px}.primary-button{height:52px;min-width:230px;display:inline-flex;align-items:center;justify-content:space-between;gap:20px;padding:0 17px;background:var(--lime);color:#171811;font:11px var(--mono);font-weight:500;letter-spacing:.4px;cursor:pointer;transition:transform .2s,background .2s}.primary-button:hover{transform:translateY(-2px);background:#e2ff82}.button-plus{font-size:19px}.button-arrow{font-size:16px}.microcopy{font:10px var(--mono);color:#77766f;margin-top:13px}.hero-art{height:370px;position:relative;display:grid;place-items:center}.orbit{position:absolute;border:1px solid #34342e;border-radius:50%;width:330px;height:330px}.orbit-two{width:250px;height:250px;border-style:dashed;opacity:.65}.cart{position:absolute;width:180px;height:208px;border:2px solid #171714;border-radius:8px 8px 13px 13px;box-shadow:8px 10px 0 #090909;display:flex;align-items:center;justify-content:center;transform:rotate(-12deg)}.cart-back{background:#d1c6a6;transform:translate(49px,-21px) rotate(14deg)}.cart-front{background:#92ac86;transform:translate(-24px,16px) rotate(-12deg)}.cart-label{width:135px;height:123px;border:1px solid #292921;border-radius:5px;color:#292921;text-align:center;padding-top:30px;font:12px var(--mono);letter-spacing:3px;line-height:1.5}.cart-label b{font-size:17px;letter-spacing:1px}.cart-teeth{position:absolute;bottom:-8px;left:26px;width:8px;height:15px;background:#555348;box-shadow:16px 0 #555348,32px 0 #555348,48px 0 #555348,64px 0 #555348,80px 0 #555348,96px 0 #555348,112px 0 #555348}.pixel{position:absolute;width:12px;height:12px;background:var(--lime);box-shadow:16px 0 #d6fa6a66}.pixel-a{top:71px;right:55px}.pixel-b{bottom:71px;left:65px;width:8px;height:8px;background:#ee9d6f}.pixel-c{top:140px;left:48px;width:6px;height:6px;background:#849eef}.art-caption{position:absolute;right:5px;bottom:24px;color:#818078;font:9px var(--mono);letter-spacing:1px;line-height:1.7;text-align:right}
.library-section{padding:55px 0 52px}.section-heading{display:flex;align-items:end;justify-content:space-between;margin-bottom:23px}h2{font-size:36px;letter-spacing:-1.7px;margin:10px 0 0;font-weight:500}.section-note{font:10px var(--mono);color:#83827a;margin-bottom:5px}.console-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.console-card{height:182px;border:1px solid var(--line);background:#171715;padding:14px 16px 13px;position:relative;overflow:hidden;transition:border-color .2s,transform .2s}.console-card:hover{border-color:#626258;transform:translateY(-2px)}.card-top,.card-bottom{display:flex;justify-content:space-between;align-items:center}.card-number,.card-year{font:9px var(--mono);color:#78776f;letter-spacing:.6px}.card-year{color:#77766f}.card-bottom{position:absolute;bottom:13px;left:16px;right:16px}.card-bottom h3{font-size:14px;font-weight:500;margin:0 0 5px}.card-status{font:8px var(--mono);letter-spacing:.8px;color:#8b8a81}.card-arrow{color:#77766f;font-size:18px}.console-glyph{height:80px;display:grid;place-items:center}.console-glyph:before,.console-glyph:after,.console-glyph span{content:'';display:block;position:absolute}.glyph-gbc:before{width:31px;height:47px;border:2px solid #8a9e88;border-radius:6px;box-shadow:inset 0 -8px #8a9e88}.glyph-gbc:after{width:10px;height:10px;border-radius:50%;background:#d07c8b;transform:translate(8px,12px);box-shadow:-13px 1px #777}.glyph-gba:before{width:64px;height:26px;border:2px solid #c8a45b;border-radius:15px}.glyph-gba:after{width:16px;height:12px;background:#c8a45b;clip-path:polygon(40% 0,60% 0,60% 35%,100% 35%,100% 65%,60% 65%,60% 100%,40% 100%,40% 65%,0 65%,0 35%,40% 35%);transform:translate(-19px,1px)}.glyph-n64:before{width:58px;height:25px;border:2px solid #718bc5;border-radius:8px 8px 17px 17px;clip-path:polygon(0 0,100% 0,88% 100%,12% 100%)}.glyph-n64:after{width:8px;height:8px;border-radius:50%;background:#d2786f;transform:translate(15px,7px);box-shadow:12px -3px #d5bf69,-33px 0 #718bc5}.glyph-ps1:before{width:45px;height:31px;border:2px solid #9b80b6;border-radius:3px;transform:perspective(40px) rotateX(8deg)}.glyph-ps1:after{width:10px;height:10px;border:2px solid #9b80b6;border-radius:50%;transform:translateY(-15px);background:#171715}.glyph-dc:before{width:48px;height:37px;border:2px solid #df966b;border-radius:13px 13px 8px 8px;clip-path:polygon(12% 0,88% 0,100% 100%,0 100%)}.glyph-dc:after{width:7px;height:7px;background:#df966b;border-radius:50%;transform:translateY(8px)}.glyph-psp:before{width:69px;height:31px;border:2px solid #c989b5;border-radius:15px}.glyph-psp:after{width:27px;height:17px;border:1px solid #c989b5;border-radius:3px;transform:translateX(-1px)}.console-card.mint:hover{border-color:#8a9e88}.console-card.amber:hover{border-color:#c8a45b}.console-card.blue:hover{border-color:#718bc5}.console-card.violet:hover{border-color:#9b80b6}.console-card.orange:hover{border-color:#df966b}.console-card.pink:hover{border-color:#c989b5}
.selected-game{display:flex;align-items:center;gap:15px;padding:17px;border:1px solid #48483d;background:#191916;margin:0 0 14px}.selected-game[hidden],.notice[hidden]{display:none}.selected-icon{font-size:24px;color:var(--lime)}.selected-copy{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}.selected-copy strong{font-size:14px;overflow:hidden;text-overflow:ellipsis}.selected-copy>span:last-child{font:9px var(--mono);color:#85847c}.selected-tag{font:9px var(--mono);color:var(--lime);border:1px solid #464a36;padding:7px 9px}.notice{border-left:2px solid var(--lime);padding:13px 16px;color:#c4c2b8;font-size:13px;line-height:1.55;background:#191916;margin-bottom:36px}.save-strip{display:flex;align-items:center;gap:15px;border:1px solid var(--line);padding:18px 19px;margin-bottom:60px}.save-icon{font-size:22px;color:var(--lime)}.save-strip>div:nth-child(2){flex:1}.save-strip strong{font-weight:500;font-size:13px}.save-strip p{margin:5px 0 0;font-size:11px;color:#8d8c84}.coming-soon{font:8px var(--mono);color:#a7a69d;border:1px solid #41413b;padding:7px 9px;letter-spacing:.5px}footer{border-top:1px solid var(--line);height:62px;padding:0 max(5vw,24px);display:flex;align-items:center;justify-content:space-between;font:9px var(--mono);letter-spacing:.6px;color:#b1b0a8}.footer-muted{color:#73726c}footer a{color:var(--lime)}dialog{width:min(480px,calc(100vw - 32px));background:#191917;color:var(--text);border:1px solid #4b4b42;padding:34px}dialog::backdrop{background:#000b}dialog h2{font-size:30px;margin:15px 0}dialog p{font-size:13px;line-height:1.65;color:#b3b2a9}dialog>a{display:inline-block;color:var(--lime);font:11px var(--mono);margin-top:8px}.dialog-close{float:right;background:transparent;border:0;color:#c7c6bd;font-size:24px;cursor:pointer}
@media(max-width:760px){.topbar{height:62px;padding:0 18px}.topbar-right{font-size:8px;gap:7px}.topbar-right .icon-button{margin-left:3px}main{padding:0 18px}.hero{grid-template-columns:1fr;min-height:0}.hero-copy{padding:53px 0 7px}.hero-art{height:270px;grid-row:1}.orbit{width:235px;height:235px}.orbit-two{width:180px;height:180px}.cart{width:140px;height:165px}.cart-label{width:105px;height:99px;padding-top:23px;font-size:10px}.cart-teeth{left:20px;width:6px;height:11px;box-shadow:13px 0 #555348,26px 0 #555348,39px 0 #555348,52px 0 #555348,65px 0 #555348,78px 0 #555348,91px 0 #555348}.cart-back{transform:translate(39px,-15px) rotate(14deg)}.cart-front{transform:translate(-20px,12px) rotate(-12deg)}.art-caption{right:0;bottom:6px}h1{font-size:61px;letter-spacing:-4px;margin-top:18px}.hero-copy>p:not(.microcopy){font-size:14px}.section-heading{align-items:start;flex-direction:column;gap:11px}h2{font-size:29px}.console-grid{grid-template-columns:repeat(2,1fr);gap:9px}.console-card{height:161px;padding:12px}.card-bottom{left:12px;right:12px;bottom:11px}.card-bottom h3{font-size:12px}.console-glyph{height:67px}.section-note{line-height:1.5}.library-section{padding:43px 0}.save-strip{align-items:flex-start;padding:15px;gap:11px;margin-bottom:40px}.save-strip p{line-height:1.5}.coming-soon{display:none}footer{height:auto;min-height:62px;padding:14px 18px;gap:16px;font-size:8px}footer a{text-align:right}.selected-tag{display:none}}
@media(max-width:760px){.hero-actions{display:grid;grid-template-columns:1fr;width:100%;max-width:380px}.hero-actions .primary-button{width:100%;min-width:0}.hero-actions .reload-button{width:100%;height:42px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important}}

/* Compact per-session controls and immersive play surface. */
.player-section{position:relative}
.touch-control-settings[hidden]{display:none!important}
.touch-control-settings{display:block;max-width:640px;margin:10px 0 20px;padding:0}
.touch-control-settings summary{display:flex;align-items:center;gap:12px;min-height:42px;padding:8px 12px;cursor:pointer;list-style:none}
.touch-control-settings summary::-webkit-details-marker{display:none}
.touch-control-settings summary strong{font-size:11px;font-weight:500}
.touch-control-body{display:grid;gap:11px;padding:0 14px 14px}
.touch-settings-toggle{position:absolute;z-index:20;right:8px;top:8px;min-height:30px;padding:0 10px;border:1px solid #ffffff70;border-radius:16px;background:#111c;color:var(--lime);font:8px var(--mono);cursor:pointer;touch-action:manipulation}
.touch-settings-toggle[hidden]{display:none!important}
.emulator-menu-toggle{position:absolute;z-index:20;right:50px;top:8px;width:34px;min-width:34px;min-height:30px;padding:0;border:1px solid #ffffff70;border-radius:16px;background:#111c;color:var(--lime);font:15px var(--sans);cursor:pointer;touch-action:manipulation}
.emulator-menu-toggle[hidden]{display:none!important}
#game-screen.virtual-controls-hidden .ejs_virtualGamepad_parent{display:none!important}
#game-screen.virtual-controls-forced-visible .ejs_virtualGamepad_parent{display:block!important;visibility:visible!important;opacity:1!important;pointer-events:none!important;z-index:12!important}
#game-screen.virtual-controls-forced-visible .ejs_virtualGamepad_parent .ejs_virtualGamepad_left,#game-screen.virtual-controls-forced-visible .ejs_virtualGamepad_parent .ejs_virtualGamepad_right,#game-screen.virtual-controls-forced-visible .ejs_virtualGamepad_parent .ejs_virtualGamepad_bottom{visibility:visible!important;opacity:1!important;pointer-events:auto!important}
#game-screen.virtual-controls-forced-visible .ejs_virtualGamepad_parent .ejs_virtualGamepad_left,#game-screen.virtual-controls-forced-visible .ejs_virtualGamepad_parent .ejs_virtualGamepad_right{touch-action:none}
#game-screen.ps1-touch-controls-enabled .ejs_virtualGamepad_parent{display:none!important}
.ps1-touch-controls .touch-edit-float,.ps1-touch-controls .touch-visibility-float{display:none!important}
.ps1-touch-controls [data-touch-control]{z-index:6}
.ps1-touch-controls .touch-face,.ps1-touch-controls .touch-shoulder,.ps1-touch-controls .touch-system{position:absolute}
.game-fullscreen .player-section{position:fixed;inset:0;gap:0;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);overflow:hidden}
.game-fullscreen .player-heading,.game-fullscreen .player-footnote{display:none!important}
.game-fullscreen .game-screen{flex:1 1 100%;width:100%;height:100%;min-height:0;max-height:none;margin:0;aspect-ratio:auto}
.game-fullscreen .touch-settings-toggle{position:fixed;top:auto;right:calc(env(safe-area-inset-right) + 8px);bottom:calc(env(safe-area-inset-bottom) + 8px);min-width:34px;min-height:30px;opacity:.38}
.game-fullscreen .touch-settings-toggle:focus,.game-fullscreen .touch-settings-toggle:hover{opacity:1}
.game-fullscreen .touch-control-settings{display:none}
.game-fullscreen.game-fullscreen-tools-open .touch-control-settings{display:block;position:fixed;z-index:10002;left:env(safe-area-inset-left);right:env(safe-area-inset-right);bottom:calc(env(safe-area-inset-bottom) + 44px);max-height:min(48dvh,360px);overflow:auto;margin:0;background:#111e;border:1px solid #7778;backdrop-filter:blur(10px)}
.game-fullscreen.game-fullscreen-tools-open .touch-control-settings[open]{display:block}
.game-fullscreen .touch-control-settings summary{color:var(--text)}
@media(max-width:760px){.game-fullscreen .game-screen{min-height:0;aspect-ratio:auto}.touch-settings-toggle{right:8px;top:8px}}
.game-fullscreen #toggle-fullscreen{position:fixed;z-index:10003;top:calc(env(safe-area-inset-top) + 8px);left:calc(env(safe-area-inset-left) + 8px);min-width:34px;min-height:30px;padding:0 8px;background:#111c;font-size:8px;opacity:.45}
.game-fullscreen #toggle-fullscreen:hover,.game-fullscreen #toggle-fullscreen:focus{opacity:1}
.game-fullscreen #touch-settings-toggle{font-size:0;width:34px;min-width:34px}
.game-fullscreen #touch-settings-toggle::after{content:'⋯';font:18px/1 var(--sans)}
.touch-control-settings[hidden]{display:none!important}
.game-fullscreen .player-section{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);overflow:hidden}
.game-fullscreen .player-heading,.game-fullscreen .player-footnote{display:none!important}
.game-fullscreen .game-screen{flex:1 1 100%;width:100%;height:100%;min-height:0;max-height:none;margin:0;aspect-ratio:auto}
.game-fullscreen.game-fullscreen-tools-open .touch-control-settings{display:block;position:fixed;z-index:10002;left:env(safe-area-inset-left);right:env(safe-area-inset-right);bottom:calc(env(safe-area-inset-bottom) + 44px);max-height:min(48dvh,360px);overflow:auto;margin:0;background:#111e;border:1px solid #7778;backdrop-filter:blur(10px)}
.gamepad-check{display:flex;align-items:center;justify-content:space-between;gap:16px;max-width:490px;border:1px solid var(--line);background:#171715;padding:14px;margin-top:18px}.gamepad-check>div{display:flex;flex-direction:column;gap:5px;min-width:0}.gamepad-check strong{font-size:12px;font-weight:500}.gamepad-check #gamepad-status{font:9px/1.5 var(--mono);color:var(--lime);overflow-wrap:anywhere}.gamepad-check button{flex:0 0 auto}@media(max-width:760px){.gamepad-check{align-items:stretch;flex-direction:column}.gamepad-check button{min-height:42px}}
.player-actions .fullscreen-toggle{color:var(--lime);border-color:#62694b}.game-fullscreen .player-section{position:fixed;inset:0;z-index:10000;display:flex;flex-direction:column;width:100%;height:100%;height:100dvh;max-height:100dvh;margin:0;padding:calc(env(safe-area-inset-top) + 8px) calc(env(safe-area-inset-right) + 8px) calc(env(safe-area-inset-bottom) + 8px) calc(env(safe-area-inset-left) + 8px);overflow:auto;border:0;background:#050505}.game-fullscreen .player-heading{flex:0 0 auto;gap:8px}.game-fullscreen .player-heading>div:first-child{min-width:0}.game-fullscreen .player-heading strong{max-width:35vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.game-fullscreen .player-actions{flex-wrap:wrap;justify-content:flex-end}.game-fullscreen .game-screen{flex:1 1 auto;width:100%;height:auto;min-height:0;max-height:none;aspect-ratio:auto}.game-fullscreen .game-screen canvas,.game-fullscreen .game-screen iframe{max-width:100%;max-height:100%;object-fit:contain}.game-fullscreen .player-footnote{flex:0 0 auto;margin:5px 0 0;font-size:8px;max-height:8vh;overflow:auto}@media(max-width:760px){.game-fullscreen .player-section{padding:calc(env(safe-area-inset-top) + 5px) calc(env(safe-area-inset-right) + 5px) calc(env(safe-area-inset-bottom) + 5px) calc(env(safe-area-inset-left) + 5px)}.game-fullscreen .player-heading{align-items:flex-start}.game-fullscreen .player-heading>div:first-child{max-width:34vw}.game-fullscreen .player-heading .eyebrow{font-size:7px}.game-fullscreen .player-heading strong{font-size:10px;max-width:34vw}.game-fullscreen .player-heading #player-status{font-size:7px}.game-fullscreen .player-actions{max-width:62vw;gap:4px}.game-fullscreen .player-actions .secondary-button{padding:7px 6px;font-size:7px}.game-fullscreen .player-footnote{max-height:7vh}}
.ps1-firmware{max-width:490px;border:1px solid #51495b;background:#19171b;padding:14px;margin:0 0 14px}.ps1-firmware[hidden]{display:none}.ps1-firmware>div{display:flex;flex-direction:column;gap:6px}.ps1-firmware strong{font-weight:400;font-size:11px;line-height:1.5;color:#d2cbd8}.ps1-firmware label{display:inline-flex;margin-top:12px;cursor:pointer}.ps1-firmware p{font:9px/1.5 var(--mono);color:#89848d;margin:10px 0 0}
.folder-button{display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.hero-actions .folder-button{min-height:42px}.ps1-disc-chooser{display:grid;gap:10px;max-width:490px;border:1px solid #51495b;background:#19171b;padding:14px;margin:0 0 14px}.ps1-disc-chooser[hidden]{display:none}.ps1-disc-chooser select{width:100%;min-height:42px;padding:8px;background:#11110f;color:var(--text);border:1px solid #4d4d43;font:11px var(--mono)}.ps1-disc-chooser p{font:9px/1.5 var(--mono);color:var(--lime);margin:0}
@media(max-width:760px){.hero-actions .folder-button{width:100%;height:42px}.ps1-disc-chooser{padding:12px}}
.hero-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px;max-width:490px}.hero-actions .start-button{justify-content:center;border:0;font-family:var(--mono)}.hero-actions .start-button:disabled{opacity:.48;cursor:not-allowed;transform:none}.hero-actions .reload-button{height:42px;letter-spacing:.3px;color:#c5c3b8}.start-hint{color:var(--lime)}
.selected-game{flex-wrap:wrap}.selected-game .secondary-button{flex:0 0 auto}.selected-copy #selection-message{font:9px/1.5 var(--mono);color:var(--lime)}.secondary-button:disabled{opacity:.45;cursor:not-allowed}.player-actions{display:flex;align-items:center;gap:8px}.choose-another{display:inline-flex;align-items:center;cursor:pointer}.game-screen #game{width:100%}@media(max-width:760px){.selected-game{gap:10px;padding:13px}.selected-game .selected-copy{flex-basis:calc(100% - 52px)}.selected-game #start-game{width:100%;min-height:42px;justify-content:center}.player-actions{gap:6px}.player-actions .secondary-button{padding:9px 8px;font-size:8px}.player-heading{align-items:flex-start}}
.console-card.console-active{border-color:#42483a}.console-card.console-active .card-status{color:var(--lime)}.console-card.console-active .card-arrow{font-size:8px;color:var(--lime);text-shadow:0 0 8px #d6fa6a77}.player-section{border:1px solid #48483d;background:#141412;margin:0 0 20px;padding:16px}.player-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:13px}.player-heading>div{display:flex;flex-direction:column;gap:5px}.player-heading strong{font-size:15px;font-weight:500}.player-heading #player-status{font:9px var(--mono);color:var(--lime)}.secondary-button{border:1px solid #4d4d43;background:transparent;color:var(--text);padding:10px 12px;font:9px var(--mono);cursor:pointer}.secondary-button:hover{border-color:var(--lime);color:var(--lime)}.game-screen{position:relative;width:100%;min-height:320px;aspect-ratio:4/3;max-height:75vh;background:#050505;overflow:hidden}.game-screen canvas,.game-screen iframe{max-width:100%;max-height:100%}.player-footnote{font:9px/1.6 var(--mono);color:#89887f;margin:12px 0 0}@media(max-width:760px){.player-section{padding:11px;margin-bottom:12px}.game-screen{min-height:220px;aspect-ratio:3/4;max-height:68vh}.player-heading strong{max-width:55vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}

/* Touch setup stays readable and emulator controls scale with the actual game viewport. */
.touch-control-settings{display:grid;gap:11px;max-width:490px;margin-top:14px;padding:14px;border:1px solid var(--line);background:#171715}
.touch-control-settings>strong{font-size:12px;font-weight:500}
.touch-control-settings label{display:grid;grid-template-columns:1fr auto;gap:7px 12px;font:9px var(--mono);color:#aaa99f}
.touch-control-settings select{grid-column:1/-1;width:100%;min-height:40px;padding:8px;background:#11110f;color:var(--text);border:1px solid #4d4d43;font:11px var(--mono)}
.touch-control-settings input[type=range]{grid-column:1/-1;width:100%;accent-color:var(--lime);touch-action:pan-y}
.touch-control-settings output{color:var(--lime)}
.touch-control-settings p{margin:0;color:var(--lime);font:9px/1.5 var(--mono)}
#game-screen .ejs_virtualGamepad_left,#game-screen .ejs_virtualGamepad_right{width:clamp(112px,25vmin,176px)!important;height:clamp(112px,25vmin,176px)!important;bottom:clamp(12px,3vh,34px)!important}
#game-screen .ejs_virtualGamepad_button{width:clamp(40px,8vmin,62px)!important;height:clamp(40px,8vmin,62px)!important;line-height:clamp(40px,8vmin,62px)!important;font-size:clamp(18px,4.5vmin,30px)!important}
#game-screen.gameboy-touch-controls .ejs_virtualGamepad_button{display:grid!important;place-items:center!important;padding:0 2px!important;overflow:hidden!important;white-space:nowrap!important;line-height:1!important;font-size:clamp(9px,2.4vmin,12px)!important}
#game-screen.gameboy-touch-controls .ejs_virtualGamepad_parent .ejs_virtualGamepad_top *,#game-screen.gameboy-touch-controls .ejs_virtualGamepad_parent .ejs_virtualGamepad_bottom *{box-sizing:border-box!important;text-align:center!important;white-space:nowrap!important;overflow:hidden!important;line-height:1.1!important;font-size:clamp(8px,2vmin,11px)!important}
#game-screen.gameboy-touch-controls .ejs_virtualGamepad_parent .ejs_virtualGamepad_top>*,#game-screen.gameboy-touch-controls .ejs_virtualGamepad_parent .ejs_virtualGamepad_bottom>*{display:flex!important;align-items:center!important;justify-content:center!important}
#game-screen.gameboy-touch-controls .ejs_virtualGamepad_parent .ejs_virtualGamepad_top>*>*,#game-screen.gameboy-touch-controls .ejs_virtualGamepad_parent .ejs_virtualGamepad_bottom>*>*{line-height:1.1!important;font-size:inherit!important}
#game-screen .ejs_virtualGamepad_top{bottom:auto!important;top:2%!important}
#game-screen .ejs_virtualGamepad_bottom{bottom:2%!important}
@media(orientation:landscape) and (max-height:600px){#game-screen .ejs_virtualGamepad_left,#game-screen .ejs_virtualGamepad_right{width:clamp(92px,23vmin,138px)!important;height:clamp(92px,23vmin,138px)!important;bottom:clamp(8px,2vh,18px)!important}#game-screen .ejs_virtualGamepad_button{width:clamp(34px,7vmin,48px)!important;height:clamp(34px,7vmin,48px)!important;line-height:clamp(34px,7vmin,48px)!important;font-size:clamp(16px,4vmin,23px)!important}}
#game-screen.touch-layout-portrait .ejs_virtualGamepad_left{left:clamp(10px,3vw,24px)!important}
#game-screen.touch-layout-portrait .ejs_virtualGamepad_right{right:clamp(10px,3vw,24px)!important}
#game-screen.touch-layout-landscape .ejs_virtualGamepad_left{left:clamp(10px,2vw,30px)!important}
#game-screen.touch-layout-landscape .ejs_virtualGamepad_right{right:clamp(10px,2vw,30px)!important}

/* PS1 touch controls: traditional single-direction layout, draggable per device. */
.touch-control-settings{display:grid;gap:11px;max-width:640px;margin:14px 0 20px;padding:14px;border:1px solid var(--line);background:#171715}
.touch-control-settings>div:first-child{display:grid;gap:5px}.touch-control-settings>div:first-child strong{font-size:12px;font-weight:500}
.touch-control-settings label{display:grid;gap:7px;font:9px var(--mono);color:#aaa99f}
.touch-control-settings select{width:100%;min-height:40px;padding:8px;background:#11110f;color:var(--text);border:1px solid #4d4d43;font:11px var(--mono)}
.touch-layout-actions{display:flex;flex-wrap:wrap;gap:9px}.touch-control-settings p{margin:0;color:var(--lime);font:9px/1.5 var(--mono)}
#game-screen.ps1-touch-controls-enabled .ejs_virtualGamepad_parent{display:none!important}
.ps1-touch-controls{position:absolute;inset:0;width:100%;height:100%;z-index:5;pointer-events:none;touch-action:none}
.ps1-touch-controls .touch-edit-float{position:absolute;top:8px;left:50%;transform:translateX(-50%);width:auto;height:30px;padding:0 10px;border-radius:15px;background:#111c;color:var(--lime);font:8px var(--mono);pointer-events:auto;z-index:8}
.ps1-touch-controls .touch-visibility-float{position:absolute;top:8px;right:8px;width:auto;height:30px;padding:0 10px;border-radius:15px;background:#111c;color:var(--lime);font:8px var(--mono);pointer-events:auto;z-index:8}
.ps1-touch-controls [data-touch-control]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
.ps1-touch-controls [data-touch-control][hidden]{display:none!important}
.ps1-touch-controls.controls-hidden [data-touch-control]{visibility:hidden;pointer-events:none}
.ps1-touch-controls.controls-hidden .touch-edit-float{display:none}
.ps1-touch-controls button{display:grid;place-items:center;margin:0;padding:0;color:#fff;background:#777b80a8;border:1.5px solid #ffffffa8;box-shadow:0 2px 6px #0006;font:600 21px var(--sans);cursor:pointer}
.ps1-touch-controls .touch-dpad{width:clamp(96px,26vmin,144px);height:clamp(96px,26vmin,144px);display:grid;grid-template:repeat(3,1fr)/repeat(3,1fr);place-items:center;color:#fff;background:#55585eaa;border:1px solid #ffffff70;border-radius:24%;font:18px var(--sans)}
.ps1-touch-controls .touch-dpad{width:var(--touch-dpad-size,144px);height:var(--touch-dpad-size,144px)}
.ps1-touch-controls .touch-dpad i{font-style:normal;display:grid;place-items:center;width:100%;height:100%;background:#777b80cc}.ps1-touch-controls .touch-dpad i:nth-child(1){grid-area:1/2}.ps1-touch-controls .touch-dpad i:nth-child(2){grid-area:2/1}.ps1-touch-controls .touch-dpad i:nth-child(3){grid-area:2/2;border-radius:50%}.ps1-touch-controls .touch-dpad i:nth-child(4){grid-area:2/3}.ps1-touch-controls .touch-dpad i:nth-child(5){grid-area:3/2}
.ps1-touch-controls .touch-stick{width:clamp(100px,27vmin,148px);height:clamp(100px,27vmin,148px);display:grid;place-items:center;border:2px solid #ffffff99;border-radius:50%;background:#45495088;box-shadow:inset 0 0 0 12px #ffffff12}
.ps1-touch-controls .touch-stick{width:var(--touch-stick-size,148px);height:var(--touch-stick-size,148px)}
.ps1-touch-controls .touch-stick span{width:42%;height:42%;border:2px solid #ffffffbb;border-radius:50%;background:#a4303bcc;box-shadow:0 2px 8px #0008;pointer-events:none}
.ps1-touch-controls .touch-face{width:clamp(42px,11vmin,62px);height:clamp(42px,11vmin,62px);border-radius:50%;font-size:clamp(20px,6vmin,34px)}
.ps1-touch-controls .touch-shoulder{width:clamp(52px,15vmin,78px);height:clamp(32px,8vmin,42px);border-radius:10px;font:12px var(--mono)}
.ps1-touch-controls .touch-system{min-width:clamp(56px,16vmin,78px);height:clamp(30px,8vmin,40px);padding:0 8px;border-radius:16px;font:9px var(--mono)}
.ps1-touch-controls.editing [data-touch-control]{outline:2px dashed var(--lime);outline-offset:3px;cursor:move;touch-action:none}
.ps1-touch-controls.editing::after{content:'ARRASTE OS CONTROLES';position:absolute;top:10px;left:50%;transform:translateX(-50%);padding:6px 9px;background:#111d;color:var(--lime);font:9px var(--mono);pointer-events:none}
@media(orientation:landscape) and (max-height:600px){.ps1-touch-controls .touch-dpad{width:clamp(78px,22vmin,112px);height:clamp(78px,22vmin,112px)}.ps1-touch-controls .touch-stick{width:clamp(82px,23vmin,118px);height:clamp(82px,23vmin,118px)}.ps1-touch-controls .touch-face{width:clamp(36px,9vmin,48px);height:clamp(36px,9vmin,48px);font-size:clamp(17px,5vmin,25px)}}
.ps1-touch-controls .touch-dpad,.ps1-touch-controls .touch-stick{max-width:min(60vw,60vh);max-height:min(60vw,60vh)}
@media(orientation:landscape) and (max-height:600px){.ps1-touch-controls .touch-dpad{width:var(--touch-dpad-size,144px);height:var(--touch-dpad-size,144px)}.ps1-touch-controls .touch-stick{width:var(--touch-stick-size,148px);height:var(--touch-stick-size,148px)}}
@media(pointer:fine){.ps1-touch-controls .touch-edit-float,.ps1-touch-controls .touch-visibility-float{display:none}}

/* Final overrides: keep options closed in play and use the full mobile viewport. */
.touch-control-settings[hidden]{display:none!important}
.game-fullscreen .player-section{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);overflow:hidden}
.game-fullscreen .player-heading,.game-fullscreen .player-footnote{display:none!important}
.game-fullscreen .game-screen{flex:1 1 100%;width:100%;height:100%;min-height:0;max-height:none;margin:0;aspect-ratio:auto}
.game-fullscreen.game-fullscreen-tools-open .touch-control-settings{display:block;position:fixed;z-index:10002;left:env(safe-area-inset-left);right:env(safe-area-inset-right);bottom:calc(env(safe-area-inset-bottom) + 44px);max-height:min(48dvh,360px);overflow:auto;margin:0;background:#111e;border:1px solid #7778;backdrop-filter:blur(10px)}

/* Keep the app's gear next to its fullscreen exit, clear of EmulatorJS's top-right menu. */
.game-fullscreen #toggle-fullscreen{left:calc(env(safe-area-inset-left) + 8px);right:auto;top:calc(env(safe-area-inset-top) + 8px);bottom:auto}
.game-fullscreen #touch-settings-toggle{left:calc(env(safe-area-inset-left) + 54px);right:auto;top:calc(env(safe-area-inset-top) + 8px);bottom:auto;width:34px;min-width:34px;font-size:15px;transform:none}
.game-fullscreen #touch-settings-toggle::after{content:none}.game-fullscreen #game-screen.gameboy-touch-controls #touch-settings-toggle{width:34px;min-width:34px;max-width:34px;overflow:hidden;font-size:0!important}
.game-fullscreen #game-screen.gameboy-touch-controls #touch-settings-toggle::after{content:'⋯';display:block;font:18px/1 var(--sans)}
.game-fullscreen #emulator-menu-toggle{position:fixed;left:calc(env(safe-area-inset-left) + 98px);right:auto;top:calc(env(safe-area-inset-top) + 8px);bottom:auto;opacity:.58}
.game-fullscreen #emulator-menu-toggle:focus,.game-fullscreen #emulator-menu-toggle:hover{opacity:1}
.game-fullscreen .touch-control-settings.panel-moving{right:auto;bottom:auto;width:min(640px,calc(100vw - 16px));max-height:min(80dvh,620px);margin:0;z-index:10005}
.touch-control-settings.panel-floating{position:fixed;right:auto;bottom:auto;transform:none;width:min(640px,calc(100vw - 16px));max-height:min(82dvh,620px);overflow:auto;margin:0;z-index:10005}
.touch-control-settings.panel-moving{z-index:10006}
.touch-control-settings>.touch-panel-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:7px;margin:0 0 8px;border:1px dashed #7778;background:#1119;touch-action:none}
.touch-panel-actions>span{flex:1 1 100%;font:8px var(--mono);color:var(--lime)}
.touch-panel-actions button{min-height:34px;padding:6px 9px;font-size:8px}
.touch-control-settings.panel-moving .touch-panel-actions{cursor:move}
#game-screen.ps1-toolbar-closed .ejs_menu_bar{opacity:0!important;pointer-events:none!important;transform:translateY(100%)!important}
#game-screen.ps1-toolbar-open .ejs_menu_bar{opacity:1!important;pointer-events:auto!important;transform:translateY(0)!important}
#game-screen.ps1-toolbar-closed .ejs_small_screen .ejs_menu_bar{transform:translate(-50%,100%)!important}
#game-screen.ps1-toolbar-open .ejs_small_screen .ejs_menu_bar{transform:translate(-50%,0)!important}

/* Google Drive access setup; ROMs stay session-only in memory. */
.drive-picker-button{min-height:42px;cursor:pointer}
.drive-setup{display:grid;gap:10px;max-width:490px;margin:12px 0 14px;padding:14px;border:1px solid #48483d;background:#191916}
.drive-setup[hidden]{display:none!important}
.drive-setup summary{cursor:pointer;font:9px var(--mono);letter-spacing:.7px;color:var(--lime)}
.drive-setup p{margin:0;color:#aaa99f;font:9px/1.5 var(--mono)}
.drive-setup label{display:grid;gap:6px;color:#aaa99f;font:8px var(--mono)}
.drive-setup input{width:100%;min-height:38px;padding:8px;background:#11110f;color:var(--text);border:1px solid #4d4d43;font:10px var(--mono)}
.drive-setup>div{display:flex;flex-wrap:wrap;gap:8px}
.drive-setup button{min-height:36px}
#google-drive-status{color:var(--lime)}
@media(max-width:760px){.drive-picker-button{width:100%;min-height:42px}.drive-setup{padding:12px}}