@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=Rajdhani:wght@600;700&display=swap');
:root{color-scheme:dark;--yellow:var(--menu-accent);--ink:#101322;--line:#ffffff24}*{box-sizing:border-box}body{margin:0;background:var(--menu-bg);color:#fff;font-family:var(--skin-font, "Exo 2", sans-serif)}button,input,select{font:inherit}button,a,input,select{outline-offset:4px}button{cursor:pointer}button:disabled{opacity:.5;cursor:wait}#game{position:fixed;inset:0;width:100%;height:100%;z-index:-2}#shade{position:fixed;inset:0;background:linear-gradient(105deg,#101216ef,#10121699 55%,#101216cf);z-index:-1}header{height:104px;padding:0 5vw;display:flex;align-items:center;gap:30px;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;color:white;text-decoration:none;font:700 30px var(--skin-font, "Exo 2", sans-serif);letter-spacing:-1.4px}.brand>span:not(.smiley){color:var(--yellow)}.brand small{font:10px var(--skin-font, "Exo 2", sans-serif);letter-spacing:2px;margin:7px 0 0 18px;color:#b0b9cf}.smiley{font:54px var(--skin-font, "Exo 2", sans-serif);color:var(--yellow);margin-right:12px;line-height:1}.tag{margin-left:auto;font-size:10px;letter-spacing:2px;color:#adb7cc}.tag i{display:inline-block;width:6px;height:6px;background:#9bce98;border-radius:50%;margin-left:12px}main{min-height:calc(100vh - 170px);max-width:1280px;margin:auto;padding:45px 5vw;display:grid;grid-template-columns:1.1fr 1fr;align-items:center;gap:8%}.eyebrow{color:var(--yellow);letter-spacing:2.5px;font-size:10px;font-weight:700}h1{font:600 clamp(45px,5.1vw,76px)/1.03 var(--skin-font, "Exo 2", sans-serif);letter-spacing:-3.5px;margin:22px 0}p{color:#bdc7dc;font-size:14px;line-height:1.8}.intro>p{font-size:16px}.pills{display:flex;flex-wrap:wrap;gap:7px;margin-top:28px}.pills span{border:1px solid #ffffff25;border-radius:3px;padding:7px 9px;font-size:10px;color:#cfdaeb}.keys{margin-top:48px;font-size:10px;color:#acb8ca}kbd{background:#ffffff12;border:1px solid #ffffff35;border-bottom:3px solid #ffffff35;padding:5px 7px;border-radius:3px;margin:0 4px}.window{background:var(--menu-panel);border:1px solid var(--menu-line);border-radius:7px;box-shadow:0 22px 60px #0006;overflow:hidden}.titlebar{height:34px;display:flex;justify-content:space-between;align-items:center;background:linear-gradient(90deg,#151d3f,#101631);padding:0 14px;color:#e8efff;font:11px var(--skin-font, "Exo 2", sans-serif);border-bottom:1px solid #617496}.tabs{display:flex;margin:20px 22px 0;border-bottom:1px solid var(--line)}.tabs button{border:0;border-bottom:2px solid transparent;background:none;color:#93a4c0;padding:10px 0;margin-right:24px;font-size:12px}.tabs .selected{color:var(--yellow);border-bottom-color:var(--yellow)}#setup,#help{padding:20px 22px 18px}label{display:block;color:#aebed6;font-size:11px;font-weight:500}input:not([type=checkbox]),select{width:100%;background:var(--menu-field);color:var(--menu-ink);border:1px solid var(--menu-line);border-radius:3px;padding:10px 11px;margin-top:6px;font-size:12px}.row{display:flex;gap:16px;margin-top:16px}.row>label{flex:1;min-width:0}.mapcaption{display:flex;justify-content:space-between;margin-top:7px;font-size:9px;color:#9aabc8}#mapName{color:#d1def1}.color-options{display:flex;gap:6px;align-items:center;height:40px}.color-options button{width:19px;height:19px;border-radius:50%;padding:0;border:2px solid transparent}.color-options .chosen{outline:1px solid #fff;outline-offset:3px}#roomfield{margin-top:15px}small{font-size:10px;color:#9cacc6}.primary{display:flex;align-items:center;justify-content:space-between;background:var(--yellow);color:#28250c;padding:14px 17px;border:1px solid var(--menu-accent);border-radius:3px;font-size:13px;font-weight:700;width:100%;margin-top:22px}.primary:hover{background:#ffe76c}.primary span{font-size:20px}#status{text-align:center;color:#93a5c1;font-size:10px;margin-top:12px}footer{padding:20px 5vw;display:flex;justify-content:space-between;color:#8696ae;font-size:9px;letter-spacing:.6px;border-top:1px solid #ffffff16}.credits{font-size:10px;color:#8193b1;line-height:1.8;border-top:1px solid var(--line);padding-top:15px}.credits a{color:var(--yellow)}[hidden]{display:none!important}.ingame #shade,.ingame #header,.ingame #menu,.ingame #footer{display:none}.hud-top{position:absolute;top:0;left:0;right:0;height:64px;background:#090932b3;border-bottom:1px solid #e5dd39;display:flex;font:11px var(--skin-font, "Exo 2", sans-serif);color:#ffff00}.portrait{background:#101039;width:64px;text-align:center;border-right:1px solid #ff0;flex-shrink:0}.portrait>span{font:49px/45px var(--skin-font, "Exo 2", sans-serif);color:#ffeb00}#feed{padding:8px;color:#ffed39;line-height:15px;overflow:hidden}.roominfo{margin-left:auto;padding:12px 18px;text-align:right}.roominfo small{display:block;margin-top:6px;color:#d3d6ff}#crosshair{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font:24px var(--skin-font, "Exo 2", sans-serif);color:#ffff00;text-shadow:1px 1px #222}#minimap{position:absolute;left:20px;bottom:70px;width:160px;height:160px;border:1px solid #ffd72c80;background:#080830b0}.bottomhud{position:absolute;bottom:0;left:0;right:0;padding:12px 22px;background:#08082fb3;display:flex;align-items:center;justify-content:space-between;font:10px var(--skin-font, "Exo 2", sans-serif);color:#e6e991}#health{color:#ffdd00;font-size:25px;letter-spacing:3px}#activeitems{color:#ffff00}#shopbutton{position:absolute;right:20px;bottom:70px}#overlay{position:fixed;inset:0;background:#0c1222b0;display:grid;place-items:center;backdrop-filter:blur(5px)}.pause{width:370px;padding-bottom:25px}.pause h2,.pause p{margin:22px 25px}.pause button{margin:10px 25px;width:calc(100% - 50px)}.secondary{background:var(--menu-raised);color:var(--menu-ink);border:1px solid var(--menu-line);padding:12px;border-radius:3px}#shop{position:absolute;inset:10% 20%;overflow:auto;padding:24px;background:#070731ed;border:1px solid #dedf58;color:#ffeb00}#shop p{color:#d2d3aa;margin:5px 0 18px;font-size:12px}.shophead{display:flex;align-items:center;gap:20px}.shophead h2{font:20px var(--skin-font, "Exo 2", sans-serif);margin:0}.shophead button{margin-left:auto;background:none;border:1px solid #ffffff55;color:white;padding:7px}#itemlist{display:grid;gap:12px}#itemlist button{text-align:left;padding:10px;background:#08082d;border:1px solid #ffffff30;color:#94ed86;font:12px var(--skin-font, "Exo 2", sans-serif)}#itemlist .poor{color:#ee7d7d}#itemlist .owned{color:#ffef00;background:#585b2940}#itemlist small{display:block;color:#aaaed4;font:10px/1.5 var(--skin-font, "Exo 2", sans-serif);margin-top:5px}#scoreboard{position:absolute;top:20%;left:20%;width:60%;padding:20px;background:#070731e8;border:1px solid #e6e327;color:#ff0;font:13px var(--skin-font, "Exo 2", sans-serif)}table{width:100%;border-collapse:collapse}td,th{text-align:left;padding:10px 8px;border-bottom:1px solid #ffffff24}#toast{position:absolute;left:50%;top:28%;transform:translateX(-50%);color:#ffef3b;text-shadow:1px 2px #000;font:700 28px var(--skin-font, "Exo 2", sans-serif);pointer-events:none;text-align:center}button:hover{filter:brightness(1.1)}@media(max-width:800px){header{height:76px}.tag{display:none}.brand small{display:none}main{grid-template-columns:1fr;padding:28px 6vw;gap:26px}.intro h1{font-size:47px;margin:15px 0}.intro>p{font-size:13px}.keys,.pills{display:none}.intro{padding:5px 0}.eyebrow{font-size:9px}.window{max-width:500px;width:100%;margin:auto}footer{font-size:8px;gap:10px}#shop{inset:8% 5%}.roominfo{font-size:9px}#scoreboard{left:5%;width:90%}}
/* Scale the HUD with the viewport. */
:root{--hud-height:clamp(96px,14vh,150px)}
.hud-top{height:var(--hud-height);font-size:clamp(13px,1.6vh,20px);line-height:1.25}
.portrait{width:calc(var(--hud-height)*.86);display:flex;flex-direction:column;align-items:center;justify-content:center}
.portrait>.portrait-image{display:block;width:calc(var(--hud-height) - 22px);height:calc(var(--hud-height) - 22px);object-fit:contain;image-rendering:auto}
#feed{padding:8px 10px;line-height:1.2}.roominfo{font-size:14px}.roominfo small{font-size:12px}
#crosshair{font-size:30px}#minimap{opacity:.82;width:clamp(190px,20vh,255px);height:clamp(190px,20vh,255px);bottom:94px}
.bottomhud{font-size:clamp(13px,1.5vh,19px);padding:14px 25px;gap:20px}#health{font-size:34px}#activeitems{max-width:45%;line-height:1.5}#shopbutton{bottom:95px;font-size:16px}
#shop{inset:8% 15%;font-size:16px}#shop p{font-size:15px}#itemlist button{font-size:15px;padding:13px}#itemlist small{font-size:13px}.shophead h2{font-size:25px}#scoreboard{font-size:17px}
label{font-size:14px}input,select{font-size:15px}.tabs button{font-size:14px}.primary{font-size:16px}.titlebar{font-size:13px}#status{font-size:12px}.mapcaption{font-size:11px}
@media(max-width:800px){:root{--hud-height:94px}.roominfo{font-size:10px;padding:8px}.roominfo small{font-size:9px}#feed{font-size:10px}.bottomhud{font-size:10px;gap:8px;padding:10px}#activeitems{display:none}#health{font-size:25px}#minimap{width:145px;height:145px;bottom:65px}#shop{inset:6% 4%}#shopbutton{bottom:65px;font-size:13px}#scoreboard{font-size:12px}input,select{font-size:14px}.tabs button{font-size:12px}}

/* Mazar home: one centered game menu. */
#header{position:absolute;inset:0 0 auto;height:80px;border:0;z-index:1}#sound{margin-left:auto}
#menu{display:grid;grid-template-columns:minmax(0,540px);justify-content:center;align-content:center;gap:0;max-width:none;min-height:100svh;padding:90px 24px;margin:0}
#menu>.window{width:100%;max-width:none;margin:0}
.control-guide{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:20px 0 24px}.control-guide>div{display:flex;align-items:center;gap:12px;min-height:36px}.control-guide kbd{font-size:12px;white-space:nowrap;margin:0}.control-guide span{font-size:13px;color:#bdc7dc}
/* Keep as many complete feed lines as the full HUD height can hold. */
#feed{flex:1;min-width:0;height:100%;padding:5px 10px;overflow:hidden;font-size:clamp(13px,1.6vh,20px);line-height:1.2}#feed{display:flex;flex-direction:column;justify-content:flex-start}
#feed>div{flex:none;white-space:nowrap;overflow:hidden;min-height:1.2em}.roominfo{flex-shrink:0;max-width:30%}


@media(max-width:600px){#header{height:72px;padding:0 20px}#menu{padding:82px 14px}.brand{font-size:27px}.control-guide{grid-template-columns:1fr}.roominfo{max-width:28%;overflow:hidden}#feed{font-size:11px;padding:5px 7px}}
/* Compact setup and a manual that scrolls inside the same window. */
#menu>.window{height:min(630px,calc(100svh - 120px));display:flex;flex-direction:column}.titlebar,.tabs{flex-shrink:0}#setup,#help{min-height:0;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#526b99 #142037;overscroll-behavior:contain}#help{flex:1}#help h3{font-size:16px;color:#ffe77e;margin-top:26px}.powers-reference th{position:sticky;top:0;background:#111532;color:#ffe17b;font-size:12px}.powers-reference td{font-size:12px;line-height:1.5;vertical-align:top;padding:10px 6px}.powers-reference td:nth-child(2){white-space:nowrap;color:#ffe17b}.powers-reference td:first-child{color:#e8edf7;min-width:105px}#status:empty{display:none}
.window-actions{display:flex;align-items:center;gap:2px;height:100%;font:14px/1 var(--skin-font, "Exo 2", sans-serif)}.window-actions>span{display:grid;place-items:center;width:16px;height:16px}.window-actions>span:first-child{transform:translateY(-1px)}
.bot-field{flex:1;min-width:0}.bot-field>span{font-size:14px;color:#aebed6}.bot-counter{display:flex;align-items:center;justify-content:space-between;margin-top:6px;min-height:44px;border:1px solid #4e607b;border-radius:4px;background:#090d25;padding:4px}.bot-counter button{display:grid;place-items:center;flex:none;padding:0;width:33px;height:33px;border:1px solid #405675;border-radius:5px;background:#111630;color:#f6df6c}.bot-counter button:disabled{opacity:.28;cursor:default}.bot-counter svg{display:block;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}.bot-counter output{font:600 18px var(--skin-font, "Exo 2", sans-serif);min-width:25px;text-align:center;font-variant-numeric:tabular-nums}
/* Saturated red; death leaves only a small clear opening. */


#victory{position:fixed;inset:0;z-index:90;overflow:auto;display:grid;place-items:center;padding:30px 20px;background:radial-gradient(ellipse at 50% 30%,#171e40ed,#0c1324f5 72%);backdrop-filter:blur(9px)}.victory-panel{width:min(660px,100%);text-align:center;padding:35px 34px 28px;border:1px solid #d9b95855;border-radius:16px;background:linear-gradient(150deg,#121732d9,#090d25f0);box-shadow:0 30px 100px #0008;animation:podium-enter .55s ease both}.victory-eyebrow{font-size:10px;letter-spacing:4px;color:#aabbd7}.victory-crown{font:48px/1.1 var(--skin-font, "Exo 2", sans-serif);color:#ffdb62;text-shadow:0 0 35px #ffc13b55;margin:15px 0 6px}.victory-panel h1{font:600 clamp(27px,4vw,40px)/1.2 var(--skin-font, "Exo 2", sans-serif);letter-spacing:-1px;color:#ffe294;margin:8px 0}.victory-panel>p{font-size:13px;color:#b5c6e1;margin:10px 0 0}.podium-stage{height:245px;margin-top:5px}.podium-stage canvas{display:block;width:100%;height:100%}#podium-labels{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0 0 28px}.podium-label{display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0}.podium-label strong{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:17px;color:var(--player-color)}.podium-label>span{font-size:11px;color:#a6b7d2}.medal{display:grid;place-items:center;width:30px;height:30px;border:1px solid #ffffff50;border-radius:50%;font:700 14px var(--skin-font, "Exo 2", sans-serif);background:#929eac;color:#121d2c}.rank-1 .medal{background:#f2ca57}.rank-3 .medal{background:#b97b51}.victory-actions{display:flex;align-items:center;gap:12px}.victory-actions button{flex:1;margin:0;font-size:13px;padding:13px 12px;justify-content:center}#podium-fallback{height:100%;display:flex;align-items:flex-end;justify-content:center;gap:8px;padding:15px 30px}.podium-placeholder{width:30%;display:flex;align-items:center;flex-direction:column;gap:12px}.podium-placeholder img{width:70px;filter:drop-shadow(0 9px 8px #0005)}.podium-placeholder>div{width:100%;height:65px;background:linear-gradient(110deg,#b3c3d5,#6a819c);border:1px solid #ffffff30;border-radius:5px 5px 0 0;font:700 30px var(--skin-font, "Exo 2", sans-serif);padding-top:15px;color:#111b2e}.podium-placeholder.rank-1>div{height:100px;background:linear-gradient(110deg,#ffe190,#b08322)}.podium-placeholder.rank-3>div{height:45px;background:linear-gradient(110deg,#dca371,#88562b);padding-top:7px}#scoreboard{z-index:100;max-height:60vh;overflow:auto}#scoreboard:not([hidden]){box-shadow:0 15px 80px #0009}@keyframes podium-enter{from{opacity:0;transform:translateY(20px) scale(.97)}to{opacity:1;transform:none}}
@media(max-width:600px){#menu>.window{height:min(630px,calc(100svh - 110px))}.victory-panel{padding:24px 14px 20px}.podium-stage{height:210px}.podium-label strong{font-size:13px}.podium-label>span{font-size:10px}.victory-actions{flex-direction:column}.victory-actions button{width:100%;flex:auto}.bot-field>span{font-size:14px}}
@media(prefers-reduced-motion:reduce){.victory-panel{animation:none}}
.shophead{justify-content:space-between}#crosshair{transform:translate(-50%,-50%) rotate(0deg);transform-origin:center;will-change:transform}
/* Shared panel and control defaults. The theme styles supply component overrides. */
#menu>.window,.victory-panel,#scoreboard{border:1px solid var(--skin-line,var(--menu-line));border-radius:var(--skin-radius,4px);background:var(--skin-face,var(--menu-panel));color:var(--skin-ink,var(--menu-ink));font-family:var(--skin-font, "Exo 2", sans-serif)}
#menu>.window *,.victory-panel *{font-family:var(--skin-font, "Exo 2", sans-serif)}#menu .titlebar{background:var(--skin-caption,var(--menu-raised));color:var(--skin-caption-ink,var(--menu-ink));border-bottom:1px solid var(--skin-line,var(--menu-line));font-weight:bold;letter-spacing:.3px}#menu .tabs{border-bottom:1px solid #b9b32c}#menu .tabs button{color:#e1dc84;border-bottom-color:transparent}#menu .tabs button.selected{color:#ffff00;border-bottom-color:#ffff00;background:#161644}#menu label,#menu .bot-field>span,#menu .mapcaption,#menu small,#menu #help p,#menu .control-guide span{color:#e7e58c}#menu input,#menu select,#menu .bot-counter{color:var(--skin-ink,var(--menu-ink));background:var(--skin-field,var(--menu-field));border:1px solid var(--skin-line,var(--menu-line));border-radius:3px}#menu .primary,.victory-panel .primary{background:var(--skin-primary,var(--menu-accent));color:var(--skin-primary-ink,#201b0d);border:1px solid var(--skin-primary-border,var(--menu-accent));border-radius:3px;font-weight:bold}#menu .bot-counter button{border-radius:0;background:#101039;border-color:#aeac60;color:#ffff00}#menu .powers-reference th{background:#05052a;color:#ffff00}#menu .powers-reference td{color:#eeee9b;border-color:#8c8a4355}#menu .credits{color:#b7b9d6;border-color:#a2a33b66}#menu .credits a{color:#ffff00}
.color-field{line-height:18px}.bot-field>span{display:block;line-height:18px}.color-options{height:44px;margin-top:6px;justify-content:space-between;align-items:center;gap:5px;padding:0 5px}.color-options button{width:clamp(18px,2vw,28px);height:clamp(18px,2vw,28px);flex-shrink:0}.portrait>.portrait-image{image-rendering:auto}
#toast{z-index:85}:is(.player-dead,.connection-reconnecting,.player-spawning) #toast{font:700 clamp(18px,2.3vw,30px)/1.3 var(--skin-font, "Exo 2", sans-serif);color:#ffff00;background:#070731e8;border:1px solid #e6e327;padding:10px 18px;text-shadow:1px 2px #000}
#victory{background:#090c30e8;backdrop-filter:none}.victory-panel{padding:24px 26px;animation:none}.victory-eyebrow{color:#ffff00;font-size:13px;letter-spacing:2px;padding-bottom:12px;border-bottom:1px solid #e6e327}.victory-crown{font-size:30px;text-shadow:none;margin:16px 0 8px}.victory-panel h1{font:bold clamp(24px,4vw,34px)/1.25 var(--skin-font, "Exo 2", sans-serif);color:#ffff00;letter-spacing:0}.victory-panel .secondary,#scoreboard .secondary{border:1px solid var(--skin-line,var(--menu-line));background:var(--skin-button,var(--menu-raised));color:var(--skin-ink,var(--menu-ink));border-radius:3px}.victory-panel .medal{border-radius:0;font-family:var(--skin-font, "Exo 2", sans-serif)}.podium-label>span{color:#e5e18a}.results-open #game{filter:brightness(.25)}.results-open #hud{visibility:hidden}#scoreboard.results-board{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(660px,92vw);max-height:80svh;padding:24px;box-shadow:none;overscroll-behavior:contain}#scoreboard .results-back{padding:12px 16px;margin-top:20px;font:14px var(--skin-font, "Exo 2", sans-serif)}#scoreboard th,#scoreboard td{border-bottom-color:#dedb3055}#scoreboard h3{margin-top:0;font-size:18px}
/* Shared colors and controls. */
body,button,input,select,option,kbd,.titlebar,.shophead h2,#itemlist button,#itemlist small,.brand,.bot-counter output{font-family:var(--skin-font, "Exo 2", sans-serif)}
button,input,select,kbd{border-radius:3px;box-shadow:none}button{background:var(--skin-button,var(--menu-raised));color:var(--skin-ink,var(--menu-ink))}input{background:var(--skin-field,var(--menu-field));color:var(--skin-ink,var(--menu-ink))}select,option{background:var(--menu-field);color:var(--menu-ink)}button{border:1px solid var(--skin-line,var(--menu-line))}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--skin-focus,var(--menu-accent));outline-offset:2px}button:hover{filter:none;background:#151541}button:disabled:hover{background:var(--skin-button,var(--menu-raised))}.primary{background:var(--skin-primary,var(--menu-accent));color:var(--skin-primary-ink,#201b0d);border:1px solid var(--skin-primary-border,var(--menu-accent));font-weight:bold}.primary:hover{background:#ffff68}.secondary,.quiet{background:var(--skin-button,var(--menu-raised));border:1px solid var(--skin-line,var(--menu-line));color:var(--skin-ink,var(--menu-ink));border-radius:3px}kbd{background:#05052a;border-color:#adaf5c;color:#ffff00}.window{background:var(--skin-face,var(--menu-panel));border:1px solid var(--skin-line,var(--menu-line));border-radius:var(--skin-radius,4px);color:var(--skin-ink,var(--menu-ink))}.titlebar{background:var(--skin-caption,var(--menu-raised));color:var(--skin-caption-ink,var(--menu-ink));border-bottom:1px solid var(--skin-line,var(--menu-line));font-weight:bold}.pause h2{font:bold 22px var(--skin-font, "Exo 2", sans-serif);color:#ffff00}.pause p,#shop p{color:#e5e58b}#overlay{background:#090c30d9;backdrop-filter:none}#shop{position:fixed;border:1px solid #e6e327;border-radius:0;background:#070731f5;color:#ffff00}#itemlist button{border-color:#a9a44a;background:#05052a}#itemlist button:hover{background:#11113a}#itemlist .poor{color:#ff7575}#itemlist .owned{color:#ffff00;background:#171743}#itemlist small{color:#cdcdae}.brand{font-weight:bold}.window-actions{font-family:var(--skin-font, "Exo 2", sans-serif)}#scoreboard{border-radius:0;box-shadow:none}.podium-placeholder>div{border-radius:0}.medal{border-radius:0}.bot-counter button{border-radius:0}
/* Enough height for all multiplayer fields; only the Manual normally scrolls. */
#menu{padding:85px 24px;align-content:center}#menu>.window{height:min(760px,calc(100svh - 115px))}
#share-dialog{position:fixed;inset:0;z-index:110;display:grid;place-items:center;padding:20px;background:#090c30dc}#share-dialog>.window{width:min(460px,100%)}#share-dialog p{margin:20px;color:#e5e58b;font-size:13px}#share-link{margin:0 20px;width:calc(100% - 40px)}#share-close{margin:20px;padding:10px 18px}
@media(max-height:820px) and (min-width:601px){#menu{padding:75px 24px 20px}#menu>.window{height:calc(100svh - 95px)}#setup{padding:12px 18px}#menu .tabs{margin:10px 18px 0}#menu .tabs button{padding:8px 0}#menu input,#menu select{padding:8px 10px}#menu .row{margin-top:12px}#menu .primary{margin-top:16px;padding:11px 14px}#roomfield{margin-top:12px}}
@media(max-width:600px){#menu{padding:78px 14px 16px}#menu>.window{height:min(760px,calc(100svh - 94px))}}
/* Gameplay HUD and panels keep safe gaps above and below. */
:root{--footer-space:48px}#shop{z-index:96;top:calc(var(--hud-height) + 14px);bottom:calc(var(--footer-space) + 14px);left:12%;right:12%;padding:20px;display:flex;flex-direction:column;gap:10px;overflow:hidden}.shophead{flex-shrink:0}.shophead h2{font-size:25px}#balance{font:bold clamp(26px,3vw,38px)/1.1 var(--skin-font, "Exo 2", sans-serif);color:#ffff00;white-space:nowrap}#shop>p{margin:0;flex-shrink:0}#itemlist{min-height:0;flex:1;overflow:auto;align-content:start;padding-right:5px;scrollbar-color:#c2bf3f #05052a;scrollbar-width:thin}#bottomhud{min-height:38px;max-height:112px;overflow:auto;align-items:center}#activeitems{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:3px 0;max-width:72%;font:13px/1.35 var(--skin-font, "Exo 2", sans-serif);color:#ffff00}#activeitems:empty{display:none}.power-chip{display:inline-flex;align-items:center;white-space:nowrap}.power-chip:not(:last-child)::after{content:'·';display:inline-flex;align-items:center;justify-content:center;font-size:18px;line-height:1;padding:0 8px}.player-powers{max-width:300px;min-width:130px}.owned-power{display:inline-block;font-size:11px;color:#aaaa9a;margin:2px 7px 2px 0}.owned-power.active{color:#ffff00}.player-table-scroll{overflow-x:auto}#scoreboard th,#scoreboard td{font-size:13px;padding:9px 7px}.results-open #hud{visibility:visible}#victory{background:#05052af5}.victory-panel{padding-top:16px}.victory-panel h1{margin:0 0 4px}#toast{white-space:pre-line}:is(.player-dead,.connection-reconnecting,.player-spawning) #toast{font-size:clamp(22px,2.5vw,34px);line-height:1.45;padding:16px 24px;max-width:90vw;width:max-content;box-sizing:border-box}

/* Retro touch controls: movement left, aim right, fire at the outer right. */
#rotate-device{
 display:none;position:fixed;inset:0;z-index:200;place-items:center;padding:24px;
 background:#080b12bb;backdrop-filter:blur(5px);color:#f1f2f3;font-family:Inter,system-ui,sans-serif;
}
.rotate-panel{
 max-width:420px;padding:30px;text-align:center;background:#20232a;
 border:1px solid #383d46;border-radius:4px;box-shadow:0 15px 48px #0006;
}
.rotate-panel svg{width:150px;height:105px;stroke:#fdce01;stroke-width:3;fill:none}
.rotate-panel .phone-landscape{opacity:.45;stroke-dasharray:5 4}
.rotate-panel h2{font:700 24px Rajdhani,'Arial Narrow',sans-serif;letter-spacing:.02em;text-transform:uppercase;margin:15px 0}
.rotate-panel p{font-size:16px;color:#a6aab2;margin-bottom:0}
#touch-controls{position:fixed;inset:0;z-index:105;pointer-events:none;user-select:none;-webkit-user-select:none}.touch-toolbar{position:absolute;right:12px;top:calc(var(--hud-height) + 8px);display:flex;gap:6px}.touch-toolbar button{font:12px var(--skin-font, "Exo 2", sans-serif);padding:9px 11px;pointer-events:auto;touch-action:none}.touch-stick{
 position:absolute;width:var(--move-size,112px);height:var(--move-size,112px);
 border-radius:50%;pointer-events:none;transform:translate(-50%,-50%);opacity:0;
 transition:opacity 200ms ease-out;
}
.touch-stick.active{opacity:1}.stick-knob{position:absolute;left:50%;top:50%;width:44px;height:44px;transform:translate(-50%,-50%);border-radius:50%;pointer-events:none}#touch-fire{position:absolute;right:20px;bottom:69px;width:72px;height:72px;pointer-events:auto;touch-action:none}.controls-paused #touch-fire{display:none}.controls-dead #touch-fire{opacity:.2;pointer-events:none}.mobile-help{display:none}

@media(orientation:portrait){.touch-device #rotate-device{display:grid}.touch-device{overflow:hidden}}
@media(pointer:coarse) and (orientation:portrait){#rotate-device{display:grid}body:not(.admin-page){overflow:hidden}}
@media(pointer:coarse) and (orientation:landscape){body.ingame{touch-action:none;overflow:hidden}.touch-device{--hud-height:60px}.touch-device #header{height:42px;pointer-events:none}.touch-device #menu{padding:48px 12px 8px;min-height:100svh;grid-template-columns:minmax(0,780px)}.touch-device #menu>.window{height:calc(100svh - 56px)}.touch-device .titlebar{height:26px;font-size:11px;padding:0 10px}.touch-device #menu .tabs{margin:4px 12px 0}.touch-device #menu .tabs button{padding:5px 0;font-size:12px}.touch-device #status{grid-column:1/-1;margin:0;font-size:10px}.touch-device #menu label,.touch-device .bot-field>span{font-size:11px;line-height:14px}.touch-device #menu input,.touch-device #menu select{padding:6px 8px;margin-top:4px;font-size:12px}.touch-device #menu .bot-counter{min-height:33px;height:33px;margin-top:4px;padding:2px}.touch-device .bot-counter button{width:26px;height:26px}.touch-device .bot-counter output{font-size:15px}.touch-device .color-options{height:33px;margin-top:4px;gap:4px;padding:0 3px}.touch-device .color-options button{width:21px;height:21px}.touch-device .touch-device #feed{font-size:10px}.touch-device .roominfo{font-size:9px;padding:8px}.touch-device .roominfo small{font-size:8px}.touch-device #bottomhud{padding:6px 12px;min-height:30px;max-height:65px}.touch-device #activeitems{max-width:100%;font-size:10px;line-height:1.2}.touch-device .power-chip:not(:last-child)::after{padding:0 5px;font-size:14px}.touch-device .desktop-hints{display:none}.touch-device #minimap{width:105px;height:105px;left:12px;bottom:182px}.touch-device #shop{top:calc(var(--hud-height) + 48px);bottom:calc(var(--footer-space) + 8px);left:9%;right:9%;padding:12px;gap:7px}.touch-device #balance{font-size:25px}.touch-device .shophead h2{font-size:20px}.touch-device #shop>p{font-size:10px}.touch-device #itemlist button{font-size:11px;padding:8px}.touch-device #itemlist small{font-size:10px}.touch-device #scoreboard{top:24%;left:10%;width:80%;font-size:11px;max-height:68svh}.touch-device #scoreboard.results-board{top:50%;left:50%;width:90vw;max-height:88svh}.touch-device #scoreboard td,.touch-device #scoreboard th{font-size:10px;padding:6px}.touch-device .player-powers{max-width:230px}.touch-device .owned-power{font-size:9px}.touch-device :is(.player-dead,.connection-reconnecting,.player-spawning) #toast{font-size:18px;padding:10px 16px;top:30%}.touch-device #toast{font-size:18px}.touch-device .victory-panel{padding:10px 20px;width:min(630px,96vw)}.touch-device .victory-panel h1{font-size:23px}.touch-device .podium-stage{height:150px}.touch-device #podium-labels{margin-bottom:10px}.touch-device .victory-actions{flex-direction:row}.touch-device .victory-actions button{padding:8px}.touch-device #victory{padding:8px}.touch-device #help{font-size:12px;padding:10px 15px}.touch-device #help p{font-size:12px}.touch-device .mobile-help{display:block}.touch-device .control-guide{grid-template-columns:1fr 1fr}.touch-device .pause{max-width:330px}.touch-device .pause button{padding:10px}.touch-device .pause{padding-bottom:12px}}
#overlay .pause{padding-top:0}#overlay .pause button:first-of-type{margin-top:22px}#overlaytext:empty{display:none}

/* Keep wheel input inside the shop and its related map upgrades adjacent. */
#itemlist{overscroll-behavior:contain;overflow-anchor:none;touch-action:pan-y}#itemlist button:disabled{cursor:not-allowed;opacity:.65}
#winner-announcement{position:fixed;inset:0;z-index:110;display:grid;place-items:center;pointer-events:none}#winner-announcement .window{width:max-content;max-width:90vw;text-align:center;background:#070731f5}#winner-announcement .titlebar{justify-content:center}#winner-announcement h2{font:bold clamp(22px,4vw,38px) var(--skin-font, "Exo 2", sans-serif);color:#ffff00;margin:24px 30px}

/* Mobile HUD reserves the header center for controls and the footer center for stats. */
@media(pointer:coarse) and (orientation:landscape){
 .touch-device{--hud-height:calc(60px + env(safe-area-inset-top,0px));--touch-toolbar-width:clamp(210px,32vw,260px);--side-safe:max(8px,env(safe-area-inset-left,0px),env(safe-area-inset-right,0px))}
 .touch-device .hud-top{display:grid;grid-template-columns:minmax(0,1fr) var(--touch-toolbar-width) minmax(0,1fr);padding:env(safe-area-inset-top,0px) var(--side-safe) 0;align-items:center}
 .touch-device #feed{grid-column:1;width:calc(100% - 56px);margin-left:56px;padding:4px 4px;line-height:12px;font-size:9px;min-width:0}
 .touch-device .roominfo{grid-column:3;max-width:none;width:100%;min-width:0;margin:0;padding:4px 6px;align-self:center;white-space:nowrap}
 .touch-device #roomlabel,.touch-device #net{display:block;overflow:hidden;text-overflow:ellipsis}
 .touch-device .touch-toolbar{top:calc(env(safe-area-inset-top,0px) + 14px);left:50%;right:auto;width:var(--touch-toolbar-width);height:32px;transform:translateX(-50%);gap:6px}
 .touch-device .touch-toolbar button{flex:1;min-width:0;padding:4px 5px;font-size:11px;line-height:20px;white-space:nowrap;text-align:center}
 .touch-device #bottomhud{height:calc(54px + env(safe-area-inset-bottom,0px));min-height:0;max-height:none;padding:6px var(--side-safe) calc(6px + env(safe-area-inset-bottom,0px));display:grid;grid-template-columns:minmax(0,1fr) min(300px,45vw) minmax(0,1fr);gap:8px;overflow:hidden}
 .touch-device #activeitems{grid-column:1;max-width:100%;max-height:42px;overflow:auto;font-size:9px;line-height:12px}
 .touch-device #shop{top:calc(var(--hud-height) + 8px);bottom:calc(var(--footer-space) + 8px);left:max(5%,env(safe-area-inset-left,0px));right:max(5%,env(safe-area-inset-right,0px))}

 .touch-device #touch-fire{right:calc(var(--side-safe) + 12px);bottom:calc(var(--footer-space) + 33px);display:grid;place-items:center;padding:0;line-height:0}
 .touch-device #touch-fire svg{display:block;width:38px;height:38px;fill:none;stroke:currentColor;stroke-width:2.5;stroke-linecap:round;pointer-events:none}
}
@media(pointer:coarse) and (orientation:landscape){.touch-device .controls-paused #touch-fire{display:none}}

/* Keep every panel above the death notice while retaining reachable touch buttons. */
#overlay{z-index:95}
@media(pointer:coarse) and (orientation:landscape){
 .touch-device{
  --footer-button-width:clamp(54px,9vw,70px);
  --touch-toolbar-bottom:calc(6px + env(safe-area-inset-bottom,0px));
  --touch-toolbar-height:42px;
  --touch-toolbar-top:calc(var(--touch-toolbar-bottom) + var(--touch-toolbar-height));
 }
 .touch-device .hud-top{display:flex;align-items:stretch;overflow:hidden;padding:env(safe-area-inset-top,0px) var(--side-safe) 0}
 .touch-device .portrait{position:static;flex:0 0 56px;align-self:stretch;width:56px;height:100%;min-height:0;max-height:100%;overflow:hidden;box-sizing:border-box}
 .touch-device .portrait>.portrait-image{flex:none;width:36px;height:36px;max-width:100%;max-height:36px}
 .touch-device  .touch-device #feed{flex:1;width:auto;max-width:none;margin:0;min-height:0;padding:4px 6px}
 .touch-device .roominfo{flex:0 1 auto;width:auto;max-width:28%;margin:0}
 .touch-device .touch-toolbar{top:auto;bottom:var(--touch-toolbar-bottom);left:var(--side-safe);right:var(--side-safe);width:auto;height:var(--touch-toolbar-height);transform:none;gap:6px;pointer-events:none}
 .touch-device .touch-toolbar button{flex:0 0 var(--footer-button-width);width:var(--footer-button-width);height:var(--touch-toolbar-height);padding:4px 2px;line-height:20px;font-size:11px;pointer-events:auto}
 .touch-device #bottomhud{grid-template-columns:repeat(3,minmax(0,1fr))}
 .touch-device #activeitems{position:fixed;left:var(--side-safe);bottom:calc(var(--footer-space) + 6px);width:max-content;max-width:calc(100vw - 2*var(--side-safe));max-height:28px;background:#05052a99;text-shadow:1px 1px #05052a;pointer-events:auto}

 .touch-device #touch-fire{bottom:calc(var(--footer-space) + 55px)}
}
@media(pointer:coarse) and (orientation:landscape) and (max-height:360px){
 .touch-device #minimap{top:calc(var(--hud-height) + 8px);bottom:auto;width:56px;height:56px}
}

/* Panels cover gameplay controls; the shop is the foremost game menu. */
#scoreboard{z-index:115}#shop{z-index:150}
@media(pointer:coarse) and (orientation:landscape){
 .touch-device{--power-header-width:clamp(180px,40vw,340px)}
 .touch-device .hud-top{display:grid;grid-template-columns:56px minmax(0,1fr) var(--power-header-width) minmax(0,1fr) 56px;align-items:center}
 .touch-device .portrait{grid-column:1;grid-row:1}
 .touch-device #feed{grid-column:2;grid-row:1;width:100%;height:100%;margin:0;min-width:0}
 .touch-device .roominfo{grid-column:4/6;grid-row:1;width:100%;max-width:none;min-width:0}
 .touch-device #activeitems{grid-column:3;grid-row:1;position:static;left:auto;bottom:auto;transform:none;align-self:center;justify-self:center;display:flex;align-items:center;justify-content:center;text-align:center;width:100%;max-width:100%;max-height:51px;overflow:auto;background:none;font-size:10px;line-height:14px;text-shadow:none;padding:2px 4px;pointer-events:auto}
 .touch-device #activeitems:empty{display:none}
}

/* Button labels share one alignment, including primary actions. */
button,.secondary,#itemlist button{text-align:center}.primary{justify-content:center;gap:10px}

#rearview{position:fixed;top:calc(var(--hud-height) + 10px);left:50%;transform:translateX(-50%);width:clamp(230px,28vw,360px);aspect-ratio:3.25;border:2px solid #e6e327;border-radius:12px;background:none;box-shadow:0 2px 10px #0009;overflow:hidden;pointer-events:none;z-index:2}
#rearview small{position:absolute;left:8px;top:4px;font:bold 8px/1 var(--skin-font, "Exo 2", sans-serif);letter-spacing:1px;color:#ffffa0;text-shadow:1px 1px 2px #000,-1px -1px 2px #000}
@media(pointer:coarse) and (orientation:landscape){.touch-device #rearview{top:calc(var(--hud-height) + 6px);width:clamp(168px,27vw,240px);aspect-ratio:3.3;border-radius:12px}.touch-device #rearview small{font-size:7px;top:3px;left:7px}}

/* Room actions keep their dimensions while temporary feedback is shown. */
.room-actions{display:flex;gap:10px;margin-top:12px;width:100%;align-items:stretch}
.room-actions>button{flex:1 1 0;min-width:0;min-height:46px;margin:0!important;padding:10px 8px!important;font-size:14px;line-height:1.25;white-space:normal;overflow-wrap:normal}
.room-feedback{background:#612a35!important;color:#fff5a5!important}
#toast[hidden]{display:none!important}
body:not(.ingame) #toast{display:none!important}
body:not(.ingame) #screen-effects{display:none}
#overlay .pause{padding-top:14px}
#share-dialog>.window{padding-top:4px}
@media(pointer:coarse) and (orientation:landscape){
 .touch-device #roomfield .room-actions{gap:7px;margin-top:6px}
 .touch-device #roomfield .room-actions>button{font-size:11px;min-height:34px;padding:6px 5px!important}

 .touch-device #menu>.window{height:calc(100svh - 56px)}
}
#status:empty{display:none}
@media(pointer:coarse) and (orientation:landscape){


 .touch-device #roomfield .room-actions>button{min-height:44px}
 .touch-device .color-options{min-width:0;gap:3px;padding:0 2px;justify-content:space-between}
 .touch-device .color-options button{flex:none;width:clamp(14px,2.6vw,21px);height:clamp(14px,2.6vw,21px)}
 .touch-device #status{font-size:9px;line-height:1.15;margin:0}
}


/* Mask a solid color so transparency only changes coverage. */
#screen-effects{position:fixed;inset:0;pointer-events:none;z-index:80;overflow:hidden;mix-blend-mode:normal;filter:none}
.screen-flash{position:absolute;inset:0;opacity:0;will-change:opacity;pointer-events:none;mix-blend-mode:normal;filter:none}
/* Let the red build gradually all the way to the corners. */
@property --damage-clear{syntax:'<percentage>';inherits:false;initial-value:100%}
#fx-death,#fx-damage{
 background:#ef003b;
 background:color(display-p3 .95 0 .16);
}
#fx-death{
 --red-hole:var(--death-hole,100%);
 mask-image:radial-gradient(ellipse farthest-corner at center,
  #0000 var(--red-hole),#0008 calc(var(--red-hole) + 12%),#000 calc(var(--red-hole) + 30%));
}
#fx-damage{
 --damage-clear:100%;
 --damage-mask:radial-gradient(ellipse farthest-corner at center,
  #0000 var(--damage-clear),#0008 calc(var(--damage-clear) + 18%),#000 calc(var(--damage-clear) + 36%));
 mask-image:var(--damage-mask);
}
#fx-damage[data-direction]:not([data-direction=front]){
 mask-image:var(--damage-mask),linear-gradient(var(--damage-side),#0000 50%,#000 73%);
 mask-composite:intersect;
}
#fx-damage[data-direction=right]{--damage-side:to right}
#fx-damage[data-direction=left]{--damage-side:to left}
#fx-damage[data-direction=rear]{--damage-side:to bottom}
#fx-heal{background:radial-gradient(ellipse closest-side at center,rgba(0,255,0,0) 64%,rgba(0,255,0,.5) 82%,rgb(0,255,0) 100%)}
#fx-purchase{background:radial-gradient(ellipse closest-side at center,rgba(165,65,241,0) 64%,rgba(165,65,241,.5) 82%,rgb(165,65,241) 100%)}

/* Shared purchase controls use the same icon, price and touch styling. */
#touch-jump,#touch-helmet,#touch-dash{position:absolute;left:calc(var(--side-safe,12px) + 145px);bottom:calc(var(--footer-space,54px) + 128px);width:48px;height:48px;display:grid;place-content:center;gap:0;padding:3px;pointer-events:auto;touch-action:none;font:bold 11px/13px var(--skin-font, "Exo 2", sans-serif)}
#touch-jump svg,#touch-helmet svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:2}
#touch-jump:disabled,#touch-helmet:disabled,#touch-dash:disabled{opacity:.35;cursor:default}
.controls-paused #touch-jump,.controls-paused #touch-helmet,.controls-paused #touch-dash{display:none}


#itemlist .replaceable-power:not(.poor) {
 color: #96f1aa;
 border-color: #96f1aa;
}
#itemlist button.owned:disabled {
 opacity: 1;
}

.player-powers .owned-power { margin-inline-end: 0; }
.player-powers .power-separator { margin-inline: .35em; color: #aaaa9a; }

#scoreboard .scoreboard-actions {
 display: flex;
 justify-content: space-between;
 gap: 12px;
 margin-top: 20px;
}
#scoreboard .scoreboard-actions button {
 width: auto;
 margin: 0;
 padding: 10px 14px;
}
#scoreboard .scoreboard-actions .primary {
 background: #e6e327;
 color: #101052;
 border-color: #ffff83;
}
.next-maze-panel {
 box-sizing: border-box;
 min-height: min(440px, 85svh);
 display: grid;
 align-content: center;
 gap: 12px;
}
#next-maze-timer { margin: 0; font-size: clamp(16px, 3vw, 23px); }
#next-maze-preview {
 width: 100%;
 height: clamp(90px, 30svh, 245px);
 background: #111a2b;
 border: 1px solid #3a4b68;
}
.next-maze-panel .mapcaption { margin: 0; min-height: 1.4em; }
#next-maze-select, #next-maze-bots, .next-maze-actions button { margin: 0; }
#next-maze-bots-field { display: grid; gap: 4px; }
#next-maze-bots-field[hidden] { display: none; }
.next-maze-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 4px; }
.next-maze-actions button { padding: 8px 12px; }
@media (pointer: coarse) and (orientation: landscape) {
 .next-maze-panel { min-height: 0; gap: 7px; }
 .next-maze-actions { margin-top: 2px; }
}

#pause-room-code {
 margin: 18px 25px 4px;
 color: #ffff00;
 font-weight: bold;
}
#scoreboard.results-board, .touch-device #scoreboard.results-board {
 inset: 0;
 margin: auto;
 height: fit-content;
 transform: none;
}
#sound, #victory-next-maze, #scoreboard [data-next-maze] {
 filter: none;
 font-weight: 700;
}
#sound:hover { background: #11113a; }
#victory-next-maze:hover, #scoreboard [data-next-maze]:hover { background: #ffff83; }
.victory-actions { flex-wrap: wrap; }
.victory-actions button { flex-basis: 125px; }

#touch-aim,#touch-move {
 position: absolute;
 inset: var(--hud-height, 42px) 0 var(--footer-space, 54px);
 touch-action: none;
 pointer-events: auto;
}
#touch-move{right:50%}
.stick-right #touch-move{left:50%;right:0}
.controls-paused :is(#touch-aim,#touch-move),.controls-dead #touch-move{display:none}
#touch-controls.controls-dead :is(#touch-fire,#touch-jump,#touch-dash,#touch-helmet){pointer-events:none}
#touch-controls .touch-toolbar{z-index:1}
.touch-device {
 --move-size: 112px;
 --move-bottom: calc(var(--footer-space, 54px) + 38px);
 --fire-size: 84px;
 --teleport-size: 36px;
 --action-offset-x: 60px;
 --action-offset-y: 48px;
 --helmet-offset-x: 50px;
 --dash-offset-y: 42px;
 --fire-right: calc(var(--side-safe, 12px) + 28px);
 --control-center: calc(var(--move-bottom) + var(--move-size) / 2);
}
.touch-device #touch-fire {
 width: var(--fire-size);
 height: var(--fire-size);
 right: var(--fire-right);
 bottom: calc(var(--control-center) - var(--fire-size) / 2);
}
.touch-device :is(#touch-jump,#touch-helmet,#touch-dash) {
 left:auto;
 bottom:calc(var(--control-center) + var(--action-offset-y) - var(--teleport-size) / 2);
 width: var(--teleport-size);
 height: var(--teleport-size);
 font-size: 10px;
 line-height: 10px;
}
.touch-device :is(#touch-jump,#touch-dash){right:calc(var(--fire-right) + var(--fire-size) / 2 + var(--action-offset-x) - var(--teleport-size) / 2)}
.touch-device #touch-helmet{right:calc(var(--fire-right) + var(--fire-size) / 2 - var(--helmet-offset-x) - var(--teleport-size) / 2)}
#touch-jump svg,#touch-helmet svg { width: 15px; height: 15px; }
@media (max-height: 360px) {
 .touch-device { --move-size: 104px; --move-bottom: calc(var(--footer-space, 54px) + 24px); }
}

/* Navigation stays a link while sharing the secondary button appearance. */
.action-link{display:inline-flex;align-items:center;justify-content:center;padding:.55rem .75rem;text-decoration:none;font-size:.85rem}
#editor-link{pointer-events:auto}
#editor-test-options { margin: 24px 0 0; min-width:0; border:1px solid #e6e327; }
#editor-test-options .row { margin-top:0; }
#editor-test-options select { max-width:100%; }
.editor-playtest [data-tab="online"], .editor-playtest #victory-next-maze { display:none; }

.editor-playtest #menu>.window { overflow-y:auto; }

.test-power-list { border: 1px solid #e6e32780; margin: 12px 0 0; min-width: 0; }
#test-powers { display: grid; grid-template-columns: repeat(auto-fit,minmax(125px,1fr)); gap: 5px 12px; max-height: 165px; overflow: auto; }
#test-powers label { display: flex; align-items: center; gap: 6px; color: #ffff00; min-height: 26px; }
#test-powers input { width: auto; margin: 0; accent-color: #ffff00; }

#fx-crush-blur{
 position:fixed;inset:0;z-index:-1;pointer-events:none;opacity:0;
 backdrop-filter:blur(var(--crush-blur,0px));
}
#fx-death-crack{
 position:absolute;inset:0;width:100%;height:100%;opacity:0;pointer-events:none;
 fill:none;stroke:#f4e9e9;stroke-width:1.7;stroke-linejoin:round;stroke-linecap:round;
 filter:drop-shadow(1px 1px 1px #25070b);
 mask-image:radial-gradient(ellipse farthest-corner at center,transparent calc(var(--crack-heal,0%) - 1%),#000 calc(var(--crack-heal,0%) + 2%));
}
#fx-death-crack path{
 vector-effect:non-scaling-stroke;
 stroke-dasharray:1;stroke-dashoffset:calc(1 - var(--crack-reveal,0));
}
#fx-death-crack .crack-branch{stroke-width:1;opacity:.65;stroke-dashoffset:calc(1 - clamp(0,(var(--crack-reveal,0) - .25) / .75,1))}
#fx-crush{
 position:fixed;inset:0;z-index:-1;pointer-events:none;opacity:0;
 background:#000;
 mask-image:radial-gradient(ellipse farthest-corner at center,
  #0000 var(--crush-hole,100%),
  #0003 calc(var(--crush-hole,100%) + 25%),
  #000a calc(var(--crush-hole,100%) + 50%),
  #000 calc(var(--crush-hole,100%) + 80%));
}
#feed .feed-own-event{font-weight:bold}



#preferences-home{display:contents}
#preferences{padding:14px 22px;min-height:0;overflow-y:auto;scrollbar-width:thin;overscroll-behavior:contain}

#preferences fieldset{min-width:0;margin:0 0 12px;border:1px solid var(--skin-line,var(--menu-line));color:var(--skin-muted,var(--menu-muted))}
#preferences .row{margin:0}
#preferences output{float:right}
#preferences input[type=range]{padding:0;accent-color:var(--skin-focus,var(--menu-accent))}
#overlay #preferences input:not([type=range]){color:var(--skin-ink,var(--menu-ink));background:var(--skin-field,var(--menu-field));border:1px solid var(--skin-line,var(--menu-line));border-radius:3px;padding:8px 10px}
.touch-device #editor-link{pointer-events:auto}
#preferences-identity:disabled{opacity:.5}
body:not(.touch-device) #mobile-preferences,.touch-device :is(#desktop-preferences,#show-hotkeys-option){display:none}
#overlay .pause:has(#preferences){width:min(620px,96vw);max-width:none;max-height:94svh;display:flex;flex-direction:column;padding:0}
#overlay #preferences .color-options button{width:clamp(14px,3vw,28px);height:clamp(14px,3vw,28px);margin:0;padding:0}
#overlay #preferences-back{margin:0;width:100%}
.touch-device #touch-controls.stick-right #touch-fire{right:auto;left:var(--fire-right)}
.touch-device #touch-controls.stick-right :is(#touch-jump,#touch-dash){right:auto;left:calc(var(--fire-right) + var(--fire-size) / 2 + var(--action-offset-x) - var(--teleport-size) / 2)}
.touch-device #touch-controls.stick-right #touch-helmet{right:auto;left:calc(var(--fire-right) + var(--fire-size) / 2 - var(--helmet-offset-x) - var(--teleport-size) / 2)}
@media(max-width:600px){
 #menu .tabs button{margin-right:0;flex:1}
 #preferences{padding:10px 12px}
}
@media(pointer:coarse) and (orientation:landscape){
 .touch-device #menu .tabs button{margin-right:12px}

 .touch-device #preferences{padding:8px 12px}
}

#setup{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px;align-content:start}
.setup-preview,.setup-options{min-width:0}
.setup-options{display:grid;gap:14px;align-content:start}
#menu .setup-options .row{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;margin:0}
#setup-map-preview{
 --preview-max-height:clamp(180px,42svh,360px);
 display:block;
 width:min(100%,calc(var(--preview-ratio,1) * var(--preview-max-height)));
 height:auto;
 aspect-ratio:var(--preview-ratio,1);
 margin-inline:auto;
 background:#05052a;
 border:1px solid #aeac60;
}
#setup>:is(#start,#roomfield,#status,#editor-test-options){grid-column:1/-1;margin:0}
#roomfield label{margin-top:0}
#preferences{font-size:14px}
#preferences :is(label,legend,input,select,button){font-size:inherit}
#preferences .shortcut-field{flex:1;min-width:0;display:grid;align-content:start;justify-items:start;gap:2px}
#preferences .shortcut-heading{display:flex;align-items:center;gap:4px}
#preferences #desktop-preferences .shortcut-reset{display:grid;place-items:center;width:25px;min-height:25px;padding:0;margin:0;background:none;border:0;box-shadow:none}
#preferences .shortcut-reset svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#preferences .shortcut-field button:not(.shortcut-reset){width:auto;min-width:58px;min-height:32px;padding:3px 7px;margin:0}
#preferences .shortcut-field button kbd{background:none;border:0;box-shadow:none;margin:0;padding:0;color:inherit}
#preferences #reset-shortcuts{width:auto;margin:0 0 8px;padding:7px 10px}
#shortcut-status{color:#e7e58c;margin-bottom:8px}
#shortcut-status:empty,.touch-device #shortcut-status,.touch-device #reset-shortcuts{display:none}
@media(max-width:600px){
 #setup{gap:12px}
 .setup-options,#menu .setup-options .row{gap:7px}
}
@media(pointer:coarse) and (orientation:landscape){
 .touch-device #setup{gap:8px 14px;padding:8px 12px}
 .touch-device #setup-map-preview{--preview-max-height:clamp(105px,40svh,190px);width:100%;max-height:var(--preview-max-height)}
 .touch-device #setup>.primary{padding:8px 12px;font-size:12px}
 .touch-device #preferences{font-size:12px}
 .touch-device .setup-options,.touch-device #menu .setup-options .row{gap:5px}
}

#help{display:flex;flex-direction:column;overflow:hidden}
.tutorial-entry{flex:none}
.tutorial-entry .primary{width:100%;margin:0!important}
#help>hr{width:100%;border:0;border-top:1px solid #e6e32770;margin:14px 0;flex:none}
.manual-body{overflow-y:auto;min-height:0;scrollbar-width:thin;padding-right:6px}
.manual-body>p:first-child{margin-top:0}
#tutorial-dialog{
 position:fixed;inset:0;z-index:115;display:flex;overflow-y:auto;
 padding:max(12px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right))
         max(12px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));
 background:#090c30b8;
}
#tutorial-dialog>.window{width:min(540px,calc((100vw - 32px)/var(--interface-scale)));margin:auto;flex:none;padding:0}
#tutorial-banner{display:block;flex:none;width:100%;height:auto;aspect-ratio:3 / 1;object-fit:cover}
.tutorial-lesson-body{padding:22px}
#tutorial-title{font-size:20px;margin:0 0 12px}
#tutorial-text{color:#e7e58c;font-size:14px;line-height:1.7;margin:0 0 22px}
#tutorial-lesson-controls{font-size:13px;line-height:2;color:#e7e58c;margin-bottom:16px}
#tutorial-ok{width:100%;margin:0}
#tutorial-checklist{position:fixed;left:18px;top:calc(var(--hud-height,72px) + 18px);z-index:82;max-width:min(330px,60vw);padding:12px 14px;border:1px solid transparent;background:#070731dc;font:13px/1.45 var(--skin-font, "Exo 2", sans-serif);color:#ffff00;pointer-events:none}
#tutorial-tasks{list-style:none;padding:0;margin:10px 0}
#tutorial-tasks li{display:flex;gap:8px;margin:8px 0}
#tutorial-tasks .complete{color:#80ce66}
#tutorial-tasks small{display:block;color:#e7e58c;font-size:11px;margin-top:3px}
#tutorial-tip{font-size:11px;color:#e7e58c;margin:0}
#tutorial-checklist kbd,#tutorial-lesson-controls kbd{font-size:inherit;padding:2px 4px}
.tutorial-control{border:1px solid #adaf5c;padding:1px 4px}
.in-tutorial .desktop-hints{display:none}
@media(pointer:coarse){
 #tutorial-checklist{padding:7px 9px;font-size:11px}
 #tutorial-tasks{margin:5px 0}
 #tutorial-tasks li{margin:4px 0}
 #tutorial-checklist small,#tutorial-tip{font-size:9px}
 .tutorial-lesson-body{padding:16px}
}


.kill-announcement{color:#ffff70;font-weight:bold}
#itemlist button{display:grid;grid-template-columns:32px minmax(0,1fr) auto;align-items:center;column-gap:10px;row-gap:7px}
#itemlist .shop-icon{display:grid;place-items:center;width:32px;height:32px;border:1px solid currentColor;background:#ffffff06}
.shop-icon svg{width:24px;height:24px}
#itemlist .shop-item-name{font-weight:bold;min-width:0}
#itemlist button>b{justify-self:end;white-space:nowrap;color:inherit}
#itemlist button>small{grid-column:1/-1;margin:0;line-height:1.45}
#itemlist button:disabled{opacity:.45}
.mouse-icon{display:inline-block;width:18px;height:22px;vertical-align:middle;stroke:currentColor;fill:none;stroke-width:1.5}
#welcome{position:fixed;inset:0;z-index:116;display:grid;place-items:center;background:#090c30b8;padding:16px}
#welcome>.window{width:min(500px,94vw);padding:24px;text-align:center}
#welcome p{color:#e7e58c;line-height:1.6;font-size:14px}
#welcome button{display:block;width:100%;margin-top:12px}
@media(pointer:coarse){
 #itemlist button{grid-template-columns:26px minmax(0,1fr) auto;column-gap:7px}
 #itemlist .shop-icon{width:26px;height:26px}
 .shop-icon svg{width:20px;height:20px}
}

.welcome-pending #menu{display:none}
#itemlist button{row-gap:12px}
#itemlist .shop-item-name{font-weight:700}
#itemlist button>small{margin-top:3px}

.checklist-border{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;display:block;overflow:visible}
.checklist-border rect{width:calc(100% - 4px);height:calc(100% - 4px);fill:none;stroke:#ffff00;stroke-width:3;stroke-dasharray:6 5;animation:checklist-border-march .75s linear infinite}
@keyframes checklist-border-march{to{stroke-dashoffset:-22}}

.desktop-hints{display:flex;align-items:center;justify-content:center;gap:16px;flex-wrap:wrap;padding:3px 0;color:#e7e58c}
.shortcut-hint{display:inline-flex;align-items:center;gap:7px;white-space:nowrap;font-size:12px}
.shortcut-hint kbd{display:inline-flex;align-items:center;justify-content:center;min-width:30px;min-height:26px;margin:0;padding:3px 7px;font-size:12px;line-height:1;border:1px solid #adaf5c;border-bottom-width:3px;background:#05052a;color:#ffff00}
/* Compact setup/preferences panels, with the manual retaining its reading area. */
#menu>.window:has(#setup:not([hidden])),#menu>.window:has(#preferences:not([hidden])){
 height:auto;max-height:calc(100svh - 96px)
}
#menu>.window:has(#preferences:not([hidden])) #preferences{flex:0 1 auto}
@media(pointer:coarse) and (orientation:landscape){
 #menu>.window:has(#setup:not([hidden])),#menu>.window:has(#preferences:not([hidden])){max-height:calc(100svh - 56px)}
}

#fx-rampage{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;mask-image:radial-gradient(ellipse closest-side at center,transparent 64%,rgba(0,0,0,.5) 82%,#000 100%)}

#touch-fire[hidden],#touch-jump[hidden],#touch-helmet[hidden],#touch-dash[hidden]{display:none!important}

@media(pointer:coarse),(max-width:600px){
 #welcome{padding:12px}
 #welcome>.window{width:min(500px,100%);max-height:calc(100dvh - 24px);overflow-y:auto;padding:16px}
 #welcome p{font-size:13px;line-height:1.5;margin:10px 0 16px}
 #welcome .welcome-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 #welcome .welcome-actions button{margin:0;padding:12px 6px;min-height:44px;font-size:12px}
 #welcome-tutorial{grid-column:2;grid-row:1}
 #welcome-skip{grid-column:1;grid-row:1}
}

/* Keep mobile kill messages on a full row, separate from powers and room info. */
@media(pointer:coarse) and (orientation:landscape){
 .touch-device .hud-top{grid-template-columns:56px minmax(0,1fr) minmax(96px,24vw);grid-template-rows:repeat(2,minmax(0,1fr))}
 .touch-device .portrait{grid-column:1;grid-row:1/3}
 .touch-device #feed{grid-column:2/4;grid-row:1}
 .touch-device #activeitems{grid-column:2;grid-row:2;max-height:100%;padding-block:0}
 .touch-device .roominfo{grid-column:3;grid-row:2;padding:0 6px;font-size:8px;line-height:11px}
 .touch-device .roominfo small{font-size:8px;line-height:11px}
}
#touch-controls,#touch-controls *{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
#touch-controls button:focus:not(:focus-visible){outline:none}

@media(pointer:coarse){
 .touch-device{--mobile-map-size:min(78px,max(32px,calc(100svh - var(--hud-height,60px) - var(--move-bottom) - var(--move-size) - 20px)))}
 .touch-device #minimap{width:var(--mobile-map-size);height:var(--mobile-map-size);top:auto;bottom:calc(var(--move-bottom) + var(--move-size) + 10px);left:calc(var(--side-safe,12px) + 16px + (var(--move-size) - var(--mobile-map-size)) / 2);right:auto}
 .touch-device:has(#touch-controls.stick-right) #minimap{left:auto;right:calc(var(--side-safe,12px) + 16px + (var(--move-size) - var(--mobile-map-size)) / 2)}
}
@media(pointer:coarse) and (orientation:landscape){
 .touch-device #activeitems{position:absolute;left:50%;right:auto;top:50%;bottom:auto;transform:translateX(-50%);width:var(--power-header-width);height:50%;max-height:50%;justify-content:center}
}


:root{--skin-cue:#ffff00;--skin-cue-soft:#ffff0033}
.player-name{color:var(--player-color)}

.touch-device #touch-dash{
 bottom:calc(var(--control-center) - var(--dash-offset-y) - var(--teleport-size) / 2);
}
.dash-icon{display:inline-block;width:1.35em;height:1.35em;vertical-align:middle;object-fit:contain}
.dash-only :is(#touch-move,#touch-aim){display:none}
.touch-device .desktop-dash-help{display:none}

@media(pointer:coarse) and (orientation:landscape){
 .touch-device{
  --move-bottom:calc(var(--touch-toolbar-top) + 8px);
  --control-center:calc(var(--move-bottom) + var(--move-size) / 2 + 16px);
 }
 .touch-device #touch-dash{
  bottom:max(calc(var(--touch-toolbar-top) + 8px),calc(var(--control-center) - var(--dash-offset-y) - var(--teleport-size) / 2));
 }
}
