/* Connection panel only. Gameplay visuals come from the original style.css. */
#connection-modal{position:fixed;inset:0;z-index:300;display:flex;align-items:center;justify-content:center;background:#071722d9;padding:24px;text-align:center;direction:rtl}#connection-modal .card{max-width:520px;padding:25px}#connection-modal p{line-height:1.9}#connection-dismiss{padding:14px 24px;border-radius:12px;background:#dfff87;color:#143047}#audio-open,#fullscreen{display:inline-flex;align-items:center;justify-content:center;padding:5px}#audio-open svg,#fullscreen svg{width:24px;height:24px;display:block;flex:none}#room-capacity{display:flex;justify-content:center;gap:8px}#room-capacity button{min-width:52px}#room-capacity button[aria-pressed=true]{background:#dfff87;color:#143047;border-color:#dfff87}#rooms-panel{min-width:260px;text-align:center}.room-actions{display:flex;justify-content:center}#rooms-panel .room-actions button{min-width:64px;font-size:24px}
[hidden]{display:none!important}
#panel{max-width:650px;max-height:85vh;overflow:auto;text-align:center}
#panel button,#panel select{margin:8px;padding:12px 22px;border-radius:12px}
#connect,#continue{background:#ddff87;color:#143047;font-weight:bold}
#panel .help{font-size:13px;line-height:1.8;color:#b9d6e5}
#panel input{max-width:100%}
#round-result{white-space:pre-line}
body.menu #combat-hud,body.menu #reload,body.menu #crosshair,body.menu #match-clock{visibility:hidden}

#network-banner{position:fixed;top:22%;left:50%;transform:translateX(-50%);z-index:100;background:#602731;color:white;padding:18px;border-radius:12px;pointer-events:none;text-align:center}
body.spectator #combat-hud,body.spectator #reload,body.spectator #aim,body.spectator #slide,body.spectator #jump,body.spectator #crosshair{display:none!important}

#observer-view{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);z-index:15;background:#16384d;color:white;padding:12px;border-radius:10px}

#exit-empty{position:fixed;top:38%;left:50%;transform:translateX(-50%);z-index:20;pointer-events:auto;background:#dcff6c;color:#17384c;border-radius:12px;padding:16px 26px;font-weight:bold}#leave{display:inline-block!important;background:#703c49;color:white}#leave[hidden]{display:none!important}#round-result table{width:100%;border-collapse:collapse}#round-result td,#round-result th{padding:10px;border-bottom:1px solid #ffffff33}

#lan-shop{max-width:1050px;max-height:90vh;overflow:auto}#lan-shop #gear-list:not([hidden]){display:grid}#lobby-network{position:fixed;top:20%;left:50%;transform:translateX(-50%);z-index:100;background:#602731;padding:15px;border-radius:10px}body[data-mode=lobby] #exit-empty{display:none!important}#difficulty-panel{display:flex;gap:8px;justify-content:center}#difficulty-panel button{border:2px solid var(--level-color);background:#17384c}#go-lobby{background:#294d65}
#fullscreen,#audio-open{color:#fff;background:transparent}#audio-open{border:1px solid #ffffff55;border-radius:9px;width:36px;height:38px;font-size:22px}#room-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}#rooms-panel button,#rooms-panel select{padding:12px;border-radius:10px;background:#17384c;color:white;border:1px solid #ffffff55;margin:5px}#room-grid .selected{border:2px solid #d9ff85}#room-status{line-height:1.8}#fixed-wallet{display:flex}#lan-shop{overflow:visible!important;max-height:none!important}#sound-panel{max-width:650px!important}body.spectator #equipped-toolbar,body.spectator #fixed-wallet{display:none!important}

#equipped-toolbar{background:#afc7d1;color:#132e40}#room-wait{position:fixed;bottom:12%;left:50%;transform:translateX(-50%);z-index:40;background:#102a3ddd;color:white;border-radius:18px;padding:12px 25px;text-align:center;backdrop-filter:blur(8px)}#room-wait button{padding:10px 25px;margin-top:8px;border-radius:10px;background:#dfff87;color:#183244}.urgent{color:#ff6666!important}#jump-height{position:fixed;bottom:3%;right:5%;color:white;pointer-events:none;z-index:12}body[data-mode=lobby] #jump-height,body.menu #jump-height{display:none}#go-lobby[hidden]{display:none!important}
#toolbar-center #equipped-toolbar{background:#afc7d1;color:#132e40;border-color:#dce9ed}

/* LAN 5: retain original icons, provide compact mobile actions and readable controls. */
#toolbar-center #equipped-toolbar{background:#d7e9ef!important;color:#132e40!important;border-color:#edf8fb!important}
#toolbar-center #equipped-toolbar #toolbar-weapon{color:#132e40!important}
#equipped-toolbar img{display:inline-block!important;max-width:54px;max-height:42px;object-fit:contain}
#panel button{background:#d7e9ef;color:#132e40;border:1px solid #edf8fb}
#panel #connect,#panel #continue,#panel #leave{background:#dcff7c;color:#132e40}
#panel button:disabled{background:#abc0ca;color:#344c5a;opacity:1}
#lobby-play{display:none!important}
#room-enter{position:fixed;bottom:18%;left:50%;transform:translateX(-50%);z-index:35;background:#dcff7c;color:#132e40;padding:16px 30px;border:0;border-radius:18px;font:700 20px Vazirmatn,Tahoma}
#room-enter[hidden]{display:none}
#toolbar-more{display:none;color:white;background:transparent;border:1px solid #66808f;border-radius:16px;font-size:32px}
@media(max-width:850px){
 header{position:fixed;display:flex!important;align-items:center;gap:8px;box-sizing:border-box;width:calc(100% - 16px);left:8px;right:8px;padding:8px!important}
 #toolbar-more{display:block;flex:0 0 42px;height:48px}
 #toolbar-right{display:none!important}
 header.actions-open #toolbar-right{display:flex!important;position:absolute;top:calc(100% + 6px);right:0;padding:10px;background:#132e40;border:1px solid #66808f;border-radius:16px;z-index:100;gap:8px}
 #toolbar-center{flex:1;min-width:0;display:flex!important;gap:8px!important;justify-content:center;flex-wrap:nowrap!important}
 #toolbar-center #equipped-toolbar{min-width:0;max-width:110px;padding:4px 8px!important;flex-shrink:1}
 #toolbar-weapon{font-size:13px!important}#equipped-toolbar img{max-width:35px;max-height:28px}
 #toolbar-center .wallet{font-size:14px!important;white-space:nowrap}
 #toolbar-back{flex:0 0 42px;width:42px!important;height:48px!important;padding:8px!important}
}

/* Comfort 6 */
#scene-transition{position:fixed;inset:0;z-index:200;display:grid;place-items:center;background:#102b43de;backdrop-filter:blur(8px);text-align:center;direction:rtl;animation:scene-fade .18s ease-out}
#scene-transition[hidden]{display:none}#scene-transition>div{padding:30px;max-width:90vw}#scene-transition h2{font-size:clamp(24px,4vw,40px);color:#f2fbff}#scene-transition p{font-size:clamp(22px,5vw,48px);font-weight:800;color:#dcff7c}
@keyframes scene-fade{from{opacity:0}to{opacity:1}}
@media(prefers-reduced-motion:reduce){#scene-transition{animation:none}}
#round-result .reward-total{display:flex;align-items:center;justify-content:space-between;gap:16px;background:#234657;border:1px solid #dfbb62;border-radius:16px;padding:18px;margin-bottom:14px}
#round-result .reward-total strong{display:flex;align-items:center;gap:10px;font-size:36px;color:#ffe092}
#round-result .reward-table{margin:12px 0 28px;background:#19394c;border-radius:12px;overflow:hidden}
#round-result .reward-table th{text-align:right;font-weight:500}#round-result .reward-table td{text-align:left;white-space:nowrap;color:#ffe092}
#round-result .reward-table svg,#round-result .reward-total svg{width:25px;height:25px;vertical-align:middle;margin-left:8px;color:#f6c74e;display:inline-block}
#menu[data-panel=results] #panel{display:flex;flex-direction:column;gap:12px}#menu[data-panel=results] #panel #connect{order:100;position:sticky;bottom:12px;align-self:center;min-width:210px;box-shadow:0 2px 18px #0005}
#menu[data-panel=results] #panel .help{display:none}
#toolbar-center #equipped-toolbar{max-width:200px;gap:10px;min-height:52px}
#toolbar-center #equipped-toolbar #equipped-thumb{width:90px!important;max-width:90px!important;height:48px!important;max-height:48px!important;object-fit:contain}
@media(max-width:850px){#toolbar-center #equipped-toolbar{max-width:150px;padding:3px 8px!important;gap:6px}#toolbar-center #equipped-toolbar #equipped-thumb{width:65px!important;max-width:65px!important;height:42px!important;max-height:42px!important}}
@media(max-width:460px){#toolbar-center #equipped-toolbar #equipped-thumb{display:none!important}#toolbar-center #equipped-toolbar{max-width:85px;min-height:44px}#toolbar-weapon{font-size:14px!important}}
#menu[data-panel=results] #panel>h1,#menu[data-panel=results] #panel>p:not(#status),#menu[data-panel=results] #notice{display:none}
#menu[data-panel=results] #panel{padding-bottom:100px!important}
#menu[data-panel=results] #status{margin:6px 0 12px;font-size:18px}
#menu[data-panel=results] #panel #connect{position:static;transform:none;align-self:center;margin:18px auto;box-shadow:none}
#menu[data-panel=results] #panel{padding-bottom:24px!important}
#panel .result-return{display:block;margin:20px auto;background:#dcff7c;color:#132e40;font-weight:700}
#round-result td .result-avatar{width:36px;height:36px;border-radius:10px;vertical-align:middle;margin-inline-end:8px}
header{box-sizing:border-box;max-width:calc(100vw - 16px);align-items:center}
#toolbar-right{flex-shrink:0;align-items:center}#toolbar-center{min-width:0}
@media(min-width:851px){header{display:flex!important;gap:24px!important}#toolbar-center{flex:1;justify-content:center;gap:clamp(20px,5vw,90px)!important}#fixed-wallet{gap:20px!important}.platform-balance{margin-inline-start:24px!important}}
header.actions-open #toolbar-right{max-width:calc(100vw - 40px);box-sizing:border-box;flex-wrap:wrap}
#startup-progress{position:fixed;inset:0;z-index:350;background:#102b43;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:30px;gap:14px}
#startup-progress strong{font-size:30px;color:#dcff7c}#startup-progress progress{width:min(400px,85vw);height:24px;accent-color:#dcff7c}#startup-progress p{margin:0}#startup-progress small{color:#b9d6e5}
#match-summary{position:fixed;top:82px;left:12px;right:12px;z-index:15;pointer-events:none;display:flex;align-items:flex-start;justify-content:center;gap:12px;flex-wrap:wrap}
#round-coins,#round-shield{background:#132e40dd;border-radius:10px;padding:8px;color:#ffe092;display:flex;align-items:center;gap:6px;font-weight:700}
#round-coins svg,#round-shield svg{width:22px;height:22px}#round-shield{color:#b5f1ff}
#bot-diagnostic{position:fixed;bottom:8px;left:50%;transform:translateX(-50%);font-size:11px;color:#e3eef4;background:#132e40c9;padding:4px 8px;border-radius:6px;max-width:80vw;text-align:center}
#online-live-board{display:flex;gap:6px;justify-content:center;max-width:100%}.online-racer{display:flex;flex-direction:column;align-items:center;width:66px;color:white;background:#132e40c9;border-radius:10px;padding:4px;box-sizing:border-box}.online-racer img{width:36px;height:36px;border-radius:8px}.online-racer small{font-size:10px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.online-racer b{font-size:11px}.online-racer.you{border:2px solid #dcff7c;width:74px}.online-racer.you img{width:42px;height:42px}
.reward-flight{position:fixed;z-index:180;pointer-events:none;color:#ffdc68;width:50px;height:50px}.reward-flight svg{width:100%;height:100%}
.coin-packs{display:flex;gap:12px;flex-wrap:wrap}.coin-packs article{flex:1;background:#234657;padding:20px;border-radius:12px;min-width:130px;text-align:center}.coin-packs svg{width:24px;height:24px;color:#ffd879;vertical-align:middle}.coin-packs button{display:block;margin:14px auto 0;padding:12px;background:#dcff7c;color:#132e40;border-radius:10px}
#sound-panel label{display:block;padding:16px;font-size:16px}
#round-coins{position:fixed;left:100px;top:16px}#round-shield{position:fixed;left:16px;top:145px}
@media(max-width:850px){#match-summary{top:76px;gap:6px}.online-racer{width:48px;padding:3px}.online-racer.you{width:54px}.online-racer img{width:27px;height:27px}.online-racer.you img{width:31px;height:31px}#online-live-board{gap:3px}#round-coins{font-size:12px}#round-coins small{display:none}}
@media(max-width:460px){#match-summary{top:156px}.online-racer{width:38px}.online-racer.you{width:42px}.online-racer img{width:24px;height:24px}.online-racer.you img{width:28px;height:28px}#online-live-board{width:100%}#round-shield{top:125px}}

/* Compact top rankings leave the centre of the arena clear. */
#match-summary{top:12px;left:92px;right:130px;flex-wrap:nowrap}#online-live-board{direction:ltr;gap:3px;width:auto}.online-racer{direction:rtl;width:48px;padding:2px}.online-racer.you{width:54px}.online-racer img{width:27px;height:27px}.online-racer.you img{width:31px;height:31px}.online-racer .racer-rank{color:#dcff87;font-size:12px}.online-racer small{max-width:44px}#round-coins{top:108px}
#revenge-marker{position:fixed;top:130px;left:50%;transform:translateX(-50%);display:flex;gap:8px;align-items:center;background:#142e40de;color:#ffd85a;border:1px solid #ffd85a;border-radius:12px;padding:5px 8px;z-index:22;direction:rtl}#revenge-marker[hidden]{display:none}#revenge-marker>span{font-size:25px}#revenge-marker button{background:transparent;color:white;padding:3px 9px;font-size:22px}.overdrive-confetti{position:fixed;top:15%;width:7px;height:12px;pointer-events:none;z-index:35}#sound-panel>label{display:block;padding:14px}#sound-panel input{width:22px;height:22px;vertical-align:middle}.upgrade details{font-size:13px}.upgrade details p{max-width:260px}.upgrade summary{cursor:pointer;color:#dfff87}
body.match-finish-popup #menu{visibility:hidden}body.match-finish-popup #scene-transition{background:#102b4355;backdrop-filter:none}body.match-finish-popup #scene-transition>div{background:#102b43eb;border:1px solid #caff87;border-radius:22px}#scene-transition button{margin:8px;padding:12px 20px;background:#dfff87;color:#122e40;border-radius:12px}
#toolbar-center #equipped-toolbar{background:linear-gradient(135deg,#7893a0,#bfced3)!important;border-color:#e4f1f5!important}
@media(max-width:850px){#match-summary{top:58px;left:8px;right:8px}.online-racer{width:40px}.online-racer.you{width:44px}#round-coins{top:110px}}
@media(max-width:460px){#match-summary{top:54px;left:5px;right:5px}#online-live-board{width:100%;gap:2px}.online-racer{width:calc((100vw - 38px)/10);min-width:0;padding:1px}.online-racer.you{width:calc((100vw - 38px)/10 + 4px)}.online-racer img{width:23px;height:23px}.online-racer.you img{width:25px;height:25px}.online-racer small{font-size:8px;max-width:100%}.online-racer b{font-size:9px}#round-coins{top:128px}#round-shield{top:162px}}

/* Review 8.1: room labels, end reward, and landscape breathing room. */
.finish-coin{display:inline-flex;vertical-align:middle;margin-inline-end:10px;color:#ffd66a}.finish-coin svg{width:1.25em;height:1.25em}
#match-summary{top:max(3px,env(safe-area-inset-top));left:92px;right:130px}.online-racer .racer-rank{order:-1;line-height:1.1;margin-bottom:2px}
@media(max-width:850px){#match-summary{top:45px;left:8px;right:8px}}
@media(max-width:460px){#match-summary{top:43px;left:5px;right:5px}}
@media(orientation:landscape) and (min-width:640px){
 #toolbar-center{flex:1;justify-content:space-evenly!important;gap:clamp(24px,5vw,88px)!important;padding-inline:16px}
 #toolbar-center #fixed-wallet{gap:clamp(20px,4vw,64px)!important}.platform-balance{margin-inline-start:18px!important}
 #match-summary{top:max(3px,env(safe-area-inset-top));left:94px;right:76px}
 #round-coins{top:90px}
}

.finish-reward{display:inline-flex;align-items:center;justify-content:center;gap:8px}.finish-reward .finish-coin{margin:0}

@media(orientation:landscape) and (min-width:640px){#toolbar-center #fixed-wallet{gap:8px!important}#fixed-wallet .platform-balance{margin-inline-start:clamp(28px,5vw,72px)!important}}
#scene-transition>div{box-sizing:border-box;max-height:calc(100dvh - 24px);overflow:auto}
@media(orientation:landscape) and (max-height:500px){#scene-transition>div{padding:18px 28px}#scene-transition h2{font-size:25px;margin:4px 0 12px}#scene-transition p{font-size:27px;line-height:1.5;margin:12px 0}#scene-transition button{margin:6px;padding:10px 18px}}

/* 8.2: portraits and counts only, unobtrusive combat controls. */
.online-racer{background:#132e4070;padding:1px 3px;border-radius:6px}.online-racer.you{border-width:1px}.online-racer .racer-rank{font-size:11px;line-height:1;margin:0}.online-racer>b:last-child{line-height:1.1;font-size:11px}.online-racer img{width:24px;height:24px}.online-racer.you img{width:27px;height:27px}
#revenge-marker{top:auto;bottom:18px;left:50%;padding:2px 6px;font-size:11px}#revenge-marker>span{display:none}
.gear-specs>span{display:grid;grid-template-columns:auto auto;justify-content:center;gap:3px 8px;text-align:center}.gear-specs>span>small{grid-column:1/-1;display:block;font-size:12px;line-height:1.6;color:#d9edf5;white-space:normal}
#aim{display:none!important}
@media(orientation:landscape) and (min-width:640px){#match-summary{left:94px;right:76px;top:max(1px,env(safe-area-inset-top))}#round-coins{top:60px}}
@media(max-width:460px){.online-racer img{width:21px;height:21px}.online-racer.you img{width:23px;height:23px}.online-racer b{font-size:9px}#round-coins{top:104px}}
/* 8.4: contained controls and readable compact HUD */
#sound-panel{box-sizing:border-box;width:min(680px,94vw)!important;text-align:right;direction:rtl}
#sound-panel #volume{display:block;width:100%}#sound-panel .volume-row{display:grid;grid-template-columns:minmax(110px,1fr) minmax(100px,2fr) 50px;align-items:center;gap:12px;margin:18px 0}
#sound-panel input[type=range]{width:100%;height:32px;min-width:0;direction:ltr;touch-action:pan-x!important}#sound-panel input[type=checkbox]{width:22px;height:22px}#sound-panel output{white-space:nowrap}#sound-panel button{background:#dfff87;color:#142e40;padding:12px 18px;border-radius:12px;margin:10px}
header{box-sizing:border-box;max-width:calc(100vw - 24px)}#toolbar-more{display:flex!important;align-items:center;justify-content:center;flex:0 0 42px;width:42px;height:44px;padding:0;line-height:1}#toolbar-right{display:none!important}header.actions-open #toolbar-right{display:flex!important;position:absolute;top:calc(100% + 6px);right:0;background:#132e40;padding:10px;border-radius:12px;z-index:100}
#round-coins{top:120px!important;left:16px!important;right:auto;font-size:15px;padding:6px 10px;pointer-events:none}#round-shield{top:158px!important}
#online-live-board .online-racer{font-family:inherit;border:0;pointer-events:auto;cursor:pointer}#online-live-board .online-racer:disabled{opacity:1;cursor:default}#online-live-board .online-racer.you{border:2px solid #dcff7c}
#upgrades{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px}.upgrade{min-width:0;display:flex!important;flex-direction:column;align-items:center;text-align:center}.upgrade button{margin-top:auto}.upgrade details p{max-width:100%}
.weapon-legend{direction:rtl;text-align:right;clear:both;padding:20px;background:#203e50;border-radius:14px}.weapon-legend p{display:flex;gap:12px;align-items:center}.weapon-legend svg{width:24px;height:24px;flex:none}.weapon-help-link{display:block;color:#dfff87;padding:12px}.gear-specs{grid-template-columns:repeat(3,1fr)}
#rotate-notice{display:none;position:fixed;inset:0;background:#102a3def;color:white;z-index:600;padding:24px;align-items:center;justify-content:center;text-align:center;direction:rtl}#rotate-notice section{max-width:350px;line-height:1.9}#rotate-notice strong{font-size:25px;color:#dfff87}
@media(orientation:portrait) and (hover:none){#rotate-notice{display:flex}}
@media(max-width:500px){#upgrades{grid-template-columns:repeat(2,minmax(0,1fr))!important}.volume-row{font-size:13px}}
@media(orientation:portrait){body.touch-controls #rotate-notice{display:flex}}
/* Weapon explanations are opt-in and live below the store, outside the cards. */
.weapon-help-link{margin:18px auto 10px;padding:12px 22px;background:#dfff87;color:#142e40;border:0;border-radius:12px;font:inherit;cursor:pointer}.weapon-legend[hidden]{display:none!important}
#online-live-board .tracking-target{outline:2px solid #ffe17c;outline-offset:2px;box-shadow:0 0 12px #ffdb65;background:#5b542fcc;animation:target-halo 1.4s ease-in-out infinite}
@keyframes target-halo{50%{box-shadow:0 0 20px #ffe990;outline-color:#fff}}
@media(prefers-reduced-motion:reduce){#online-live-board .tracking-target{animation:none}}
