:root{color-scheme:dark;font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#111518;color:#e6e9e4;--surface:#191e22;--line:#333b3f;--muted:#909c97;--accent:#d5bd83;--ink:#1a1d19}
*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}[hidden]{display:none!important}a{color:var(--accent)}button{min-height:42px;padding:9px 14px;border:1px solid #404b4f;border-radius:7px;background:#252d31;color:#e0e6df;cursor:pointer;transition:background .12s,border-color .12s,transform .12s}button:hover{background:#303b3f;border-color:#59665f}button:active{transform:translateY(1px)}button:disabled{cursor:default;opacity:.45}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,#joystick:focus-visible{outline:2px solid var(--accent);outline-offset:3px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
main{width:min(880px,calc(100% - 40px));margin:0 auto;padding:28px 0 24px}.page-header{display:flex;align-items:center;gap:22px;margin-bottom:24px}.back{color:#9aa79e;text-decoration:none;font-size:12px;white-space:nowrap}.back:hover{color:#e3e8df}.game-heading{flex:1;min-width:0}.eyebrow{color:var(--muted);font-size:10px;letter-spacing:.14em;text-transform:uppercase}h1{font-size:29px;line-height:1.15;letter-spacing:-.03em;font-weight:650;margin:5px 0 0}.edition{display:grid;place-items:center;flex:none;width:42px;height:42px;border:1px solid #4a5143;border-radius:10px;font-size:17px;font-weight:700;color:var(--accent);background:#252a23}
.room-panel{padding:20px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}.room-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.room-heading h2{font-size:14px;font-weight:600;margin:0}#count{color:#a6b1a7;font-size:12px;white-space:nowrap}#count:before{content:"";display:inline-block;width:6px;height:6px;margin-right:7px;border-radius:50%;background:#a8bb8f}#join-form{display:flex;align-items:flex-end;gap:10px}.name-field{flex:1;min-width:0}label{font-size:12px;color:#a9b5ac}.name-field label{display:block;margin-bottom:6px}input{width:100%;height:44px;padding:10px 12px;border:1px solid #46504f;border-radius:7px;background:#111719;color:#ecf0e7}input::placeholder{color:#78857f}#join,#start{border-color:var(--accent);background:var(--accent);color:var(--ink);font-weight:650}#join{height:44px;min-width:132px}#join:hover,#start:hover{background:#e4ce9b}#status{min-height:18px;font-size:12px;color:#aebcaf;margin:12px 0 0}#players{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;list-style:none;margin:15px 0 12px;padding:0}#players li{min-height:56px;padding:10px 11px;border:1px solid #343d3e;border-radius:7px;background:#141a1d;font-size:13px;color:#7f8c86;overflow-wrap:anywhere}#players li.occupied{border-color:#68715c;color:#e5eae0;background:#202821}#players small{display:block;margin-top:2px;color:#8f9e92;font-size:10px}.actions{display:flex;flex-wrap:wrap;gap:8px}.actions button{min-height:36px;padding:7px 12px;font-size:12px}.actions .quiet{color:#9daa9e;background:transparent;border-color:transparent}.note{font-size:11px;line-height:1.5;color:var(--muted)}#host-note{margin:12px 0 0}
.game-shell{position:relative;overflow:hidden;margin-top:18px;border:1px solid var(--line);border-radius:12px;background:#0a0e10}.game-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:56px;padding:8px 12px;background:#1a2125;border-bottom:1px solid var(--line)}.toolbar-title{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.1em;color:#93a198;white-space:nowrap}.toolbar-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap}.toolbar-actions button{min-height:36px;padding:7px 11px;font-size:12px;background:#252e32;border-color:#46514e}.toolbar-actions button[aria-pressed="true"]{color:#e0cc9f;border-color:#726648;background:#37352b}.layout-control{display:none;align-items:center;gap:7px;white-space:nowrap}.layout-control span{font-size:11px;color:#9eaca2}.layout-control select{min-height:36px;max-width:140px;padding:5px 24px 5px 9px;border:1px solid #46514e;border-radius:7px;background:#252e32;color:#e0e6df;font-size:12px}#screen{position:relative;width:100%;aspect-ratio:4/3;overflow:hidden;background:#000;outline:none}#emulator,#relay-video{display:block;width:100%;height:100%;object-fit:contain;background:#000}#stream-status{position:absolute;inset:0;z-index:2;display:grid;place-items:center;padding:32px 24px 85px;text-align:center;background:#151b1f;color:#b4c0b6;font-size:14px}#video-actions{position:absolute;bottom:18px;left:16px;right:16px;z-index:3;display:flex;justify-content:center;gap:8px;flex-wrap:wrap}#retry-video{background:var(--accent);border-color:var(--accent);color:var(--ink)}#controls{padding:14px 18px 16px;border-top:1px solid #2b3437;background:#171e22}.control-guide{font-size:11px;color:#91a197}.control-guide summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:2px 0}.control-guide summary::-webkit-details-marker{display:none}.control-guide summary:after{content:"+";font-size:16px;color:#8b988e}.control-guide[open] summary:after{content:"−"}.control-guide .note{margin-bottom:0}.legend{display:flex;gap:8px 16px;flex-wrap:wrap;padding-top:12px;color:#b9c5b9}.legend span{display:flex;align-items:center;gap:6px}kbd{display:inline-block;padding:2px 5px;border:1px solid #4a5550;border-bottom-width:2px;border-radius:4px;color:#e4e9dd;font:10px/1.3 inherit;background:#242e2e}
.touch{display:none;align-items:center;justify-content:space-between;gap:20px;padding:4px 0 15px;user-select:none;-webkit-user-select:none;touch-action:none}.joystick-area{display:flex;flex-direction:column;align-items:center;gap:8px;flex:none}#joystick{position:relative;display:grid;place-items:center;flex:none;width:140px;height:140px;border:1px solid #4b5855;border-radius:50%;background:radial-gradient(circle at 50% 48%,#2a3639 0,#1b262a 55%,#121c20 100%);box-shadow:inset 0 0 0 12px #152025,inset 0 0 0 13px #354440,0 4px 14px #0004;touch-action:none;cursor:grab}#joystick:active{cursor:grabbing}#joystick-knob{position:relative;z-index:1;width:62px;height:62px;border:1px solid #7e8d80;border-radius:50%;background:radial-gradient(circle at 38% 30%,#758276,#4b5b50 65%,#34463d);box-shadow:0 5px 10px #0006,inset 0 1px #c2cdbb44;transform:translate(var(--stick-x,0px),var(--stick-y,0px));pointer-events:none}.joystick-axis{position:absolute;background:#35433f;opacity:.65;pointer-events:none}.joystick-axis.horizontal{width:104px;height:1px}.joystick-axis.vertical{width:1px;height:104px}.control-caption{color:#8fa294;font-size:10px;font-weight:600;letter-spacing:.08em;text-transform:uppercase}.touch-actions{display:grid;grid-template-rows:auto auto auto;justify-items:center;gap:9px;width:212px;flex:none}.touch button{touch-action:none;user-select:none;-webkit-user-select:none}.shoulder-buttons{display:flex;gap:8px;width:100%}.shoulder-buttons button{flex:1;min-height:34px;padding:5px 10px;border-radius:9px 9px 6px 6px;background:#293432;color:#bdc9ba;font-size:11px}.face-buttons{display:grid;grid-template-columns:repeat(3,1fr);align-items:center;gap:8px;width:100%}.face-buttons button{min-width:0;min-height:58px;padding:6px 4px;border-radius:50%;background:#354439;border-color:#697c60;color:#e5ebdb}.face-buttons button strong{display:block;font-size:19px;font-weight:700;line-height:1.1}.face-buttons button span{display:block;margin-top:3px;font-size:9px}.face-buttons .jump-button{min-height:48px;background:#343e42;border-color:#5c6e71;color:#c8d4d4;font-size:11px}.face-buttons .attack-button{background:#cfb77e;border-color:#ddc894;color:#19231a}.face-buttons .special-button{background:#4c5c40;border-color:#7c9166}.start-button{min-height:30px;min-width:66px;padding:4px 14px;border-radius:14px;color:#adbbb0;background:#28322f;border-color:#48584d;font-size:10px}.touch button:active,.touch button.pressed{background:#e1c990;border-color:#f0dfb8;color:#18211a;box-shadow:0 0 0 3px #c9b37e1f}.controls-hidden #controls{display:none!important}.show-touch .touch{display:flex}
footer{margin-top:24px;color:#6f8076;font-size:10px;text-align:center}footer a{color:inherit;text-decoration:none}footer a:hover{text-decoration:underline}
body.game-fullscreen{overflow:hidden;overscroll-behavior:none}#game-shell::backdrop{background:#080c0e}#game-shell:is(.is-fullscreen,:fullscreen){position:fixed;inset:0;z-index:1000;display:grid;grid-template-rows:auto minmax(0,1fr) auto;width:100%;height:100dvh;max-width:none;margin:0;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);border:0;border-radius:0;background:#080c0e}#game-shell:is(.is-fullscreen,:fullscreen) .game-toolbar{position:relative;z-index:6;min-height:50px;padding:6px 12px}#game-shell:is(.is-fullscreen,:fullscreen) .layout-control{display:flex}#game-shell:is(.is-fullscreen,:fullscreen) #screen{height:100%;min-height:0;aspect-ratio:auto}#game-shell:is(.is-fullscreen,:fullscreen) #controls{position:relative;padding:14px 24px 18px;border-top:1px solid #293237}#game-shell:is(.is-fullscreen,:fullscreen) .touch{justify-content:space-around;gap:24px;padding:0}#game-shell:is(.is-fullscreen,:fullscreen) .control-guide{display:none}#game-shell:is(.is-fullscreen,:fullscreen) #video-actions{bottom:12px}
@media(any-pointer:coarse){.touch{display:flex}.game-toolbar button{min-height:42px}.control-guide{margin-top:2px}}
@media(max-width:600px){main{width:calc(100% - 24px);padding:18px 0}.page-header{gap:14px;flex-wrap:wrap;margin-bottom:18px}.back{width:100%;font-size:11px}.game-heading{flex:1}h1{font-size:26px}.edition{width:38px;height:38px}.room-panel{padding:15px;border-radius:10px}.room-heading{margin-bottom:12px}#players{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-top:12px}#players li{min-height:50px;padding:8px 10px}#join{min-width:105px;padding:9px 12px}.game-shell{margin-top:14px;border-radius:10px}.game-toolbar{padding:7px 9px;justify-content:center}.toolbar-title{display:none}.toolbar-actions{width:100%;justify-content:space-between;gap:5px}.toolbar-actions button{padding:7px 10px;font-size:11px}#controls{padding:15px 14px 12px}.touch{gap:12px}#joystick{width:clamp(110px,32vw,128px);height:clamp(110px,32vw,128px)}#joystick-knob{width:58px;height:58px}.joystick-axis.horizontal{width:94px}.joystick-axis.vertical{height:94px}.touch-actions{width:clamp(164px,46.5vw,186px);gap:8px}.face-buttons{gap:6px}.face-buttons button{min-height:53px}.face-buttons .jump-button{min-height:44px}.shoulder-buttons{gap:6px}.shoulder-buttons button{padding:5px 6px}.layout-control{order:2;justify-content:flex-end;width:100%;border-top:1px solid #303b3e;padding-top:6px;margin-top:1px}.layout-control select{min-height:32px}#game-shell:is(.is-fullscreen,:fullscreen) #controls{padding:12px 20px 16px}#game-shell:is(.is-fullscreen,:fullscreen) .touch{gap:12px}}
@media(max-width:359px){main{width:calc(100% - 18px)}.room-panel{padding:12px}.touch{gap:10px}#controls{padding-left:10px;padding-right:10px}#joystick{width:106px;height:106px}#joystick-knob{width:52px;height:52px}.joystick-axis.horizontal{width:78px}.joystick-axis.vertical{height:78px}.touch-actions{width:160px}.face-buttons button{min-height:48px}.face-buttons .jump-button{min-height:40px}.toolbar-actions button{padding:7px 8px;font-size:10px}}
/* Landscape fullscreen leaves the game's center unobstructed and places the
   touch deck over the unused side edges. Explicit portrait always stays stacked. */
@media(orientation:landscape){#game-shell:is(.is-fullscreen,:fullscreen):not([data-fullscreen-layout="portrait"]){grid-template-rows:auto minmax(0,1fr)}#game-shell:is(.is-fullscreen,:fullscreen):not([data-fullscreen-layout="portrait"]) #controls{position:absolute;z-index:4;inset:64px 0 0;padding:14px max(18px,env(safe-area-inset-right,0px)) max(14px,env(safe-area-inset-bottom,0px));border:0;background:transparent;pointer-events:none}#game-shell:is(.is-fullscreen,:fullscreen):not([data-fullscreen-layout="portrait"]) .touch{height:100%;align-items:flex-end;justify-content:space-between;gap:12px}#game-shell:is(.is-fullscreen,:fullscreen):not([data-fullscreen-layout="portrait"]) .joystick-area,#game-shell:is(.is-fullscreen,:fullscreen):not([data-fullscreen-layout="portrait"]) .touch-actions{pointer-events:auto}#game-shell:is(.is-fullscreen,:fullscreen):not([data-fullscreen-layout="portrait"]) #joystick{width:116px;height:116px}#game-shell:is(.is-fullscreen,:fullscreen):not([data-fullscreen-layout="portrait"]) #joystick-knob{width:54px;height:54px}#game-shell:is(.is-fullscreen,:fullscreen):not([data-fullscreen-layout="portrait"]) .touch-actions{width:180px}#game-shell:is(.is-fullscreen,:fullscreen):not([data-fullscreen-layout="portrait"]) .control-caption{display:none}}
#game-shell:is(.is-fullscreen,:fullscreen)[data-fullscreen-layout="landscape"]{grid-template-rows:auto minmax(0,1fr)}#game-shell:is(.is-fullscreen,:fullscreen)[data-fullscreen-layout="landscape"] #controls{position:absolute;z-index:4;inset:64px 0 0;padding:14px max(18px,env(safe-area-inset-right,0px)) max(14px,env(safe-area-inset-bottom,0px));border:0;background:transparent;pointer-events:none}#game-shell:is(.is-fullscreen,:fullscreen)[data-fullscreen-layout="landscape"] .touch{height:100%;align-items:flex-end;justify-content:space-between;gap:12px}#game-shell:is(.is-fullscreen,:fullscreen)[data-fullscreen-layout="landscape"] .joystick-area,#game-shell:is(.is-fullscreen,:fullscreen)[data-fullscreen-layout="landscape"] .touch-actions{pointer-events:auto}#game-shell:is(.is-fullscreen,:fullscreen)[data-fullscreen-layout="landscape"] .control-caption{display:none}
@media(prefers-reduced-motion:reduce){button{transition:none}}
/* The shared toolbar owns audio, fullscreen and controls for both players. */
#emulator .ejs_menu_bar,#emulator .ejs_context_menu{display:none!important}
