* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0f14; color: #e9eef2; font-family: "Inter", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif; user-select: none; }
.brand, .menu-body h1, .mode h3, .big, #end-title, #counters span, #ammo-mag, #lobby-countdown, .card > h3, .lobby-card h2, .end-card h2, #center-msg, #knocked, button.primary { font-family: "Russo One", "Inter", system-ui, sans-serif; font-weight: 400; letter-spacing: 1px; }
.mode h3 { font-size: 18px; }
button.primary { font-weight: 400; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 6px; padding: 10px 18px; background: #2a3441; color: #fff; letter-spacing: .5px; }
button:hover { background: #38455a; }
button.primary { background: linear-gradient(180deg, #ffd23f, #f5a623); color: #1a1408; font-weight: 800; }
button.primary:hover { filter: brightness(1.08); }
button.small { padding: 6px 12px; font-size: 13px; }
input { font: inherit; padding: 9px 12px; border-radius: 6px; border: 1px solid #3a4756; background: #121a23; color: #fff; }
input:focus { outline: 2px solid #ffd23f55; }
select { font: inherit; padding: 9px 12px; border-radius: 6px; border: 1px solid #3a4756; background: #121a23; color: #fff; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #aab7c4; }
.muted { color: #92a0ae; font-size: 14px; }
.row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 20; }

/* menu */
#menu { justify-content: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; background: radial-gradient(1200px 600px at 50% -10%, #244a5a55 0%, #0b0f1466 60%); }
#menu .menu-body { margin: auto; }   /* centred vertically when there is room, scrolls when there is not */
#menu-bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 5; }
.menu-top { position: relative; width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; flex-shrink: 0; flex-wrap: wrap; gap: 8px; }
.brand { font-weight: 900; font-size: 22px; letter-spacing: 4px; display: flex; align-items: center; gap: 10px; }
.logo { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: #ffd23f; color: #1a1408; border-radius: 8px; font-size: 21px; line-height: 1; letter-spacing: 0; padding: 0; box-sizing: border-box; }
.logo .glyph { display: block; line-height: 1; transform: translateY(0.4px); }
.account { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.menu-body { position: relative; max-width: 1080px; width: 100%; padding: 0 28px 40px; text-align: center; }
.topbar-right { display: flex; gap: 10px; align-items: center; }
.topbar-right select.small { padding: 6px 10px; font-size: 13px; }
.setup { display: grid; grid-template-columns: 320px 1fr; gap: 18px; text-align: left; }
.card { background: #121a24d9; border: 1px solid #26313d; border-radius: 14px; padding: 16px 18px; backdrop-filter: blur(8px); box-shadow: 0 10px 30px #0006; }
.card > h3 { margin: 0 0 10px; font-size: 13px; letter-spacing: 2px; color: #ffd23f; text-transform: uppercase; }
.character { display: flex; flex-direction: column; align-items: center; }
.skin-name { margin-top: 8px; font-weight: 700; letter-spacing: 1px; }
.game .modes { grid-template-columns: repeat(2, 1fr); margin-bottom: 12px; }
.game .mode { padding: 14px 14px; }
.menu-body h1 { font-size: 42px; margin: 6px 0 4px; letter-spacing: 1px; text-shadow: 0 4px 24px #000a; }
.sub { color: #b8c5d1; margin: 0 0 18px; font-size: 16px; }
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.mode { background: #141c25cc; border: 2px solid #26313d; border-radius: 12px; padding: 18px 14px; cursor: pointer; text-align: left; transition: transform .12s, border-color .12s; backdrop-filter: blur(6px); }
.mode:hover { transform: translateY(-2px); border-color: #4b5d72; }
.mode.selected { border-color: #ffd23f; box-shadow: 0 0 0 3px #ffd23f33; }
.mode h3 { margin: 0 0 4px; font-size: 20px; }
.mode .size { color: #ffd23f; font-size: 12px; font-weight: 700; letter-spacing: 1px; }
.mode p { margin: 8px 0 0; color: #9fb0c0; font-size: 13px; line-height: 1.35; }
.mode .waiting { margin-top: 10px; font-size: 12px; color: #7cd992; }
.join-row { display: flex; gap: 14px; justify-content: center; align-items: flex-end; flex-wrap: wrap; margin-top: 18px; }
.join-row label { flex: 1; min-width: 180px; }
.join-row input { width: 100%; }
.check { flex-direction: row; align-items: center; gap: 10px; font-size: 14px; color: #fff; padding: 6px 0; cursor: pointer; }
.check input { appearance: none; -webkit-appearance: none; width: 44px; height: 24px; margin: 0; border-radius: 12px; background: #1f2a36; border: 1px solid #3a4756; position: relative; cursor: pointer; transition: background .15s, border-color .15s; flex-shrink: 0; }
.check input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #8a97a4; transition: transform .15s, background .15s; }
.check input:checked { background: #ffd23f; border-color: #ffd23f; }
.check input:checked::after { transform: translateX(20px); background: #1a1408; }
.check input:focus-visible { outline: 2px solid #ffd23f88; }
#skin-preview { width: 240px; height: 280px; background: radial-gradient(circle at 50% 40%, #223447, #0b0f14 72%); border-radius: 12px; border: 1px solid #26313d; }
.skins { display: grid; grid-template-columns: repeat(4, 60px); gap: 8px; margin-top: 12px; }
.skin { width: 60px; height: 60px; border-radius: 10px; border: 2px solid #26313d; cursor: pointer; position: relative; overflow: hidden; background: #141c25 50% 6% / 190% auto no-repeat; }   /* head and shoulders of the portrait */
.skin:hover { border-color: #4b5d72; }
.skin.selected { border-color: #ffd23f; box-shadow: 0 0 0 3px #ffd23f33; }
.lobby-list { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow: auto; margin-bottom: 8px; }
.lobby-row { display: flex; justify-content: space-between; align-items: center; background: #141c25; border: 1px solid #26313d; border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.lobby-row.empty { color: #8a97a4; justify-content: center; }
.join-row button { padding: 14px 44px; font-size: 20px; }
.stats { margin-top: 18px; display: flex; gap: 22px; justify-content: center; font-size: 14px; color: #b8c5d1; }
.stats b { display: block; font-size: 22px; color: #fff; }
.online { color: #7cd992; font-size: 13px; }
.help { margin-top: 18px; text-align: left; color: #9fb0c0; font-size: 13px; }
.help summary { cursor: pointer; text-align: center; }
.controls-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 18px; margin-top: 12px; }
.controls-grid b { color: #ffd23f; }
.footer { position: relative; padding: 10px; color: #5f6f7f; font-size: 12px; text-align: center; flex-shrink: 0; }
@media (max-width: 860px) { .setup { grid-template-columns: 1fr; } .menu-body h1 { font-size: 30px; } .controls-grid { grid-template-columns: 1fr; } .topbar-right .online { display: none; } }

/* modal */
.modal { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; z-index: 40; }
.modal form { background: #141c25; border: 1px solid #2c3a49; border-radius: 12px; padding: 24px; width: 360px; display: flex; flex-direction: column; gap: 12px; }
.modal h2 { margin: 0; }
.error { color: #ff7b7b; font-size: 13px; min-height: 16px; }

#key-list { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 13px; align-items: center; }
#key-list button { min-width: 84px; padding: 5px 10px; font-size: 12px; background: #1f2a36; }
#key-list button.listening { background: #ffd23f; color: #1a1408; }
/* lobby */
#lobby { background: #0b0f1488; }
.lobby-card { background: #141c25; border: 1px solid #2c3a49; border-radius: 14px; padding: 28px 36px; width: 460px; text-align: center; }
.big { font-size: 64px; font-weight: 900; color: #ffd23f; }
.lobby-players { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 16px 0; }
.lobby-players span { background: #1f2a36; padding: 4px 10px; border-radius: 20px; font-size: 13px; }
.lobby-players span.party { border: 1px solid #ffd23f; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-weight: 600; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px #0008; }
#crosshair.spread::before, #crosshair.spread::after { content: ""; position: absolute; background: #fff; box-shadow: 0 0 0 1px #0008; }
#crosshair.spread::before { left: -14px; top: 2px; width: 34px; height: 2px; }
#crosshair.spread::after { top: -14px; left: 2px; width: 2px; height: 34px; }
#crosshair.build { width: 10px; height: 10px; margin: -5px 0 0 -5px; background: transparent; border: 2px solid #7fd0ff; }
#hitmarker { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; opacity: 0; transition: opacity .15s; }
#hitmarker::before, #hitmarker::after { content: ""; position: absolute; inset: 0; border: 2px solid #fff; transform: rotate(45deg) scale(.6); border-radius: 2px; }
#hitmarker.show { opacity: 1; }
#hitmarker.head::before, #hitmarker.head::after { border-color: #ffd23f; }
#hitmarker.limb::before, #hitmarker.limb::after { border-color: #c9d2dc; opacity: .8; }
.dmg.limb { color: #c9d2dc; font-size: 15px; }
#damage-layer { position: absolute; inset: 0; overflow: hidden; }
.dmg { position: absolute; font-size: 18px; font-weight: 900; color: #fff; text-shadow: 0 0 4px #000, 0 2px 2px #000; animation: rise 1s forwards; }
.dmg.head { color: #ffd23f; font-size: 22px; }
.dmg.shield { color: #7fd0ff; }
@keyframes rise { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-40px); opacity: 0; } }
.top-left { position: absolute; left: 16px; top: 14px; }
#storm-box { background: #0009; padding: 8px 12px; border-radius: 8px; font-size: 14px; display: flex; gap: 8px; align-items: center; }
#storm-icon { color: #b47cff; }
#storm-box.danger #storm-icon { color: #ff6b6b; }
#killfeed { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
#killfeed div { background: #0008; padding: 3px 8px; border-radius: 4px; }
#killfeed .me { color: #ffd23f; }
#killfeed .team { color: #7cd992; }
.top-center { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); }
#compass { width: 320px; height: 22px; overflow: hidden; background: #0007; border-radius: 6px; position: relative; }
#compass::after { content: ""; position: absolute; left: 50%; top: 0; width: 2px; height: 100%; background: #ffd23f; }
#compass-strip { position: absolute; top: 0; height: 100%; white-space: nowrap; font-size: 12px; line-height: 22px; }
#compass-strip span { display: inline-block; width: 40px; text-align: center; color: #cbd5df; }
#compass-strip span.cardinal { color: #fff; font-weight: 800; }
.top-right { position: absolute; right: 16px; top: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#minimap-wrap { border: 2px solid #fff5; border-radius: 6px; overflow: hidden; background: #123; }
#minimap { display: block; }
#counters { display: flex; gap: 8px; }
#counters > div { background: #0009; padding: 6px 12px; border-radius: 6px; text-align: center; min-width: 64px; }
#counters span { font-size: 20px; display: block; }
#counters small { font-size: 10px; letter-spacing: 1px; color: #aab7c4; }
#team-panel { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; }
.mate { background: #0009; padding: 6px 10px; border-radius: 6px; width: 170px; font-size: 13px; }
.mate .mbar { height: 5px; background: #333; border-radius: 3px; margin-top: 4px; position: relative; overflow: hidden; }
.mate .mbar i { position: absolute; left: 0; top: 0; height: 100%; background: #7cd992; }
.mate .mbar b { position: absolute; left: 0; top: 0; height: 100%; background: #7fd0ff; opacity: .9; }
.mate.down { color: #ff8a8a; }
.mate.dead { opacity: .45; text-decoration: line-through; }
.bottom-left { position: absolute; left: 16px; bottom: 16px; }
#bars { width: 320px; }
.bar { height: 24px; background: #0009; border-radius: 4px; position: relative; margin-bottom: 5px; overflow: hidden; }
.bar > div { height: 100%; transition: width .15s; }
.bar span { position: absolute; left: 10px; top: 3px; font-size: 14px; text-shadow: 0 1px 2px #000; }
#health-fill { background: linear-gradient(180deg, #7ee787, #3cb371); width: 100%; }
#shield-fill { background: linear-gradient(180deg, #8fd8ff, #2e8bd6); width: 0%; }
#mats { display: flex; gap: 8px; margin-top: 8px; }
.mat { background: #0009; padding: 6px 10px; border-radius: 6px; display: flex; align-items: center; gap: 6px; font-size: 14px; min-width: 76px; }
.mat i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.mat.wood i { background: #b07a3c; } .mat.stone i { background: #9aa3ad; } .mat.metal i { background: #6fa8dc; }
.mat.active { outline: 2px solid #ffd23f; }
.bottom-right { position: absolute; right: 16px; bottom: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#ammo-box { background: #0009; padding: 8px 14px; border-radius: 6px; text-align: right; }
#ammo-mag { font-size: 28px; font-weight: 900; }
#ammo-pool { margin-left: 6px; color: #aab7c4; }
#weapon-name { font-size: 12px; color: #cbd5df; letter-spacing: 1px; }
#drop-hint { font-size: 10px; color: #8a97a4; margin-top: 3px; }
#inventory, #build-bar { display: flex; gap: 6px; }
.slot { width: 80px; height: 64px; background: #0009; border: 2px solid #ffffff22; border-radius: 6px; position: relative; font-size: 11px; text-align: center; padding-top: 6px; }
.slot.active { border-color: #fff; background: #ffffff22; }
.slot .key { position: absolute; left: 4px; top: 2px; font-size: 10px; color: #aab7c4; }
.slot .icon { font-size: 22px; line-height: 26px; }
.slot .gun { display: block; margin: 5px auto 1px; filter: drop-shadow(0 1px 1px #000); }
.slot .cnt { position: absolute; right: 4px; bottom: 2px; font-size: 11px; font-weight: 700; }
.slot .cnt::after { content: ''; }
.slot .lbl { font-size: 10px; line-height: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 3px; }
.slot.r-common { border-bottom: 3px solid #b3b3b3; } .slot.r-uncommon { border-bottom: 3px solid #5fd35f; } .slot.r-rare { border-bottom: 3px solid #4fa3ff; } .slot.r-epic { border-bottom: 3px solid #c85cff; } .slot.r-legendary { border-bottom: 3px solid #ffb340; }
#center-msg { position: absolute; left: 50%; top: 32%; transform: translateX(-50%); font-size: 26px; font-weight: 900; text-shadow: 0 2px 6px #000; text-align: center; }
#prompt { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); background: #000a; padding: 8px 14px; border-radius: 6px; font-size: 15px; white-space: nowrap; }
#prompt:empty { display: none; }
#prompt b { background: #fff; color: #000; padding: 1px 7px; border-radius: 4px; margin-right: 6px; }
#prompt .r-common { color: #b3b3b3; } #prompt .r-uncommon { color: #5fd35f; } #prompt .r-rare { color: #4fa3ff; } #prompt .r-epic { color: #c85cff; } #prompt .r-legendary { color: #ffb340; }
#vehicle-box { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); width: 240px; background: #0009; padding: 8px 12px; border-radius: 8px; text-align: center; font-size: 13px; }
#vehicle-hp { height: 100%; background: #7fd0ff; }
#vehicle-speed { margin-top: 4px; color: #cbd5df; }
#harvest { position: absolute; left: 50%; top: 54%; transform: translateX(-50%); width: 120px; }
#harvest-fill { height: 100%; background: #b07a3c; }
#progress { position: absolute; left: 50%; top: 64%; transform: translateX(-50%); width: 260px; text-align: center; font-size: 13px; }
.pbar { height: 8px; background: #0009; border-radius: 4px; overflow: hidden; margin-top: 4px; }
#progress-fill { height: 100%; background: #ffd23f; width: 0; }
#notices { position: absolute; left: 50%; bottom: 140px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 14px; }
#notices div { background: #0009; padding: 4px 12px; border-radius: 4px; animation: fadeout 3s forwards; }
@keyframes fadeout { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
#bus-hint { position: absolute; left: 50%; top: 70%; transform: translateX(-50%); background: #000a; padding: 10px 18px; border-radius: 8px; font-size: 18px; }
#knocked { position: absolute; left: 50%; top: 20%; transform: translateX(-50%); color: #ff6b6b; font-size: 34px; font-weight: 900; text-align: center; text-shadow: 0 2px 8px #000; }
#knocked small { font-size: 14px; color: #fff; font-weight: 500; }
#spectating { position: absolute; left: 50%; top: 12%; transform: translateX(-50%); background: #000a; padding: 8px 16px; border-radius: 8px; font-size: 16px; }
#chat { position: absolute; left: 16px; bottom: 130px; width: 340px; pointer-events: none; }
#chat-log { display: flex; flex-direction: column; gap: 2px; font-size: 13px; margin-bottom: 4px; }
#chat-log div { background: #0007; padding: 2px 8px; border-radius: 4px; animation: fadeout 9s forwards; }
#chat-log .sys { color: #ffd23f; }
#chat-input { pointer-events: auto; width: 100%; }
#bigmap { position: absolute; inset: 0; background: #000b; display: grid; place-items: center; }
#bigmap-canvas { max-width: 90vmin; max-height: 90vmin; width: 90vmin; height: 90vmin; border: 2px solid #fff5; border-radius: 8px; }
#perf { font-size: 11px; color: #aab7c4; text-shadow: 0 1px 2px #000; }
#scope { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, transparent 0, transparent 30vh, #000 31vh); }
.scope-ring { position: absolute; left: 50%; top: 50%; width: 60vh; height: 60vh; transform: translate(-50%, -50%); border-radius: 50%; border: 3px solid #111; box-shadow: inset 0 0 40px #000c, 0 0 0 2px #333; }
.scope-h { position: absolute; left: 50%; top: 50%; width: 60vh; height: 1px; background: #000; transform: translate(-50%, -50%); }
.scope-v { position: absolute; left: 50%; top: 50%; width: 1px; height: 60vh; background: #000; transform: translate(-50%, -50%); }
.scope-tick { position: absolute; left: 50%; width: 1px; height: 8vh; background: #000; transform: translateX(-50%); }
.scope-tick.t1 { top: calc(50% + 6vh); } .scope-tick.t2 { top: calc(50% + 14vh); height: 5vh; }
#scope-range { position: absolute; left: 50%; top: calc(50% + 24vh); transform: translateX(-50%); font: 700 16px "Russo One", sans-serif; color: #ffd23f; text-shadow: 0 1px 3px #000; letter-spacing: 1px; }
#scope::after { content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 6px #ff3b3b; }
#water-vignette { position: absolute; inset: 0; background: radial-gradient(circle, #1c6fa0aa 0, #0b3d5fcc 100%); opacity: 0; transition: opacity .2s; }
#storm-vignette { position: absolute; inset: 0; box-shadow: inset 0 0 160px #8a2be2aa; opacity: 0; transition: opacity .4s; }
#hit-flash { position: absolute; inset: 0; background: radial-gradient(circle, #ff000055 0, #ff000099 100%); opacity: 0; pointer-events: none; }
#hit-flash.show { animation: hitflash .45s ease-out; }
@keyframes hitflash { 0% { opacity: 1; } 100% { opacity: 0; } }
#hit-dir { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; transition: opacity .3s; }
#hit-dir.show { opacity: 1; transition: none; }
#hit-dir .arc { position: absolute; left: -90px; top: -90px; width: 180px; height: 180px; border-radius: 50%; border: 7px solid transparent; border-top-color: #ff3b3b; box-shadow: 0 0 12px #ff000066; }
#lowhp-vignette { position: absolute; inset: 0; box-shadow: inset 0 0 140px #d00000aa; opacity: 0; transition: opacity .4s; }

/* touch controls (laid out for landscape phones, ~900x420 and up) */
#touch { position: absolute; inset: 0; pointer-events: none; }
#stick { position: absolute; left: 24px; bottom: 110px; width: 140px; height: 140px; border-radius: 50%; background: #ffffff18; border: 2px solid #ffffff44; }
#stick.active { background: #ffffff28; }
#stick-knob { position: absolute; left: 45px; top: 45px; width: 50px; height: 50px; border-radius: 50%; background: #ffffffaa; }
.tbtn { pointer-events: auto; width: 56px; height: 56px; border-radius: 50%; background: #0009; border: 2px solid #ffffff55; color: #fff; font: 700 10px "Inter", sans-serif; letter-spacing: 1px; padding: 0; touch-action: none; -webkit-tap-highlight-color: transparent; }
.tbtn.big { width: 84px; height: 84px; font-size: 13px; background: #ffd23fcc; color: #1a1408; border-color: #ffd23f; grid-column: 3; grid-row: 1 / 3; align-self: center; }
.tbtn.small { width: 44px; height: 44px; border-radius: 10px; }
.tbtn.down { background: #ffffff66; } .tbtn.on { border-color: #ffd23f; box-shadow: 0 0 0 3px #ffd23f55; }
.tbtns-right { position: absolute; right: 12px; bottom: 125px; display: grid; grid-template-columns: 56px 56px 84px; grid-template-rows: 56px 56px; gap: 8px; align-items: center; justify-items: center; }
.tbtns-left { position: absolute; left: 215px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; }
.tbtns-top { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
body.touch #compass, body.touch #drop-hint, body.touch #chat, body.touch #perf, body.touch #team-panel { display: none; }
body.touch #hud { touch-action: none; }
body.touch #inventory, body.touch #build-bar, body.touch #mats { pointer-events: auto; }
body.touch .top-left { left: 8px; top: 8px; }
body.touch #storm-box { font-size: 12px; padding: 5px 8px; }
body.touch #killfeed { max-width: 260px; font-size: 11px; } body.touch #killfeed div:nth-child(n+3) { display: none; }
body.touch .top-right { right: 8px; top: 8px; gap: 4px; }
body.touch #minimap { width: 110px; height: 110px; }
body.touch #counters > div { padding: 3px 6px; min-width: 44px; } body.touch #counters span { font-size: 14px; } body.touch #counters small { font-size: 8px; }
body.touch .slot { width: 56px; height: 50px; font-size: 10px; } body.touch .slot .gun { width: 32px; height: 14px; margin-top: 4px; } body.touch .slot .icon { font-size: 17px; line-height: 20px; } body.touch .slot .lbl { font-size: 9px; }
body.touch .bottom-right { right: 8px; bottom: 8px; gap: 4px; } body.touch .bottom-left { left: 8px; bottom: 8px; }
body.touch #bars { width: 200px; } body.touch .bar { height: 16px; margin-bottom: 4px; } body.touch .bar span { font-size: 11px; top: 1px; }
body.touch #mats { margin-top: 4px; } body.touch .mat { padding: 3px 8px; min-width: 56px; font-size: 12px; }
body.touch #ammo-box { padding: 4px 10px; } body.touch #ammo-mag { font-size: 18px; } body.touch #weapon-name { font-size: 10px; }
body.touch #prompt { top: 40%; font-size: 13px; }
body.touch #vehicle-box { bottom: 200px; width: 200px; font-size: 12px; }
body.touch #notices { bottom: 76px; font-size: 12px; max-width: 60vw; } body.touch #notices div { padding: 3px 8px; }
body.touch #center-msg { font-size: 20px; top: 24%; }
@media (max-width: 700px) { .menu-body h1 { font-size: 26px; } .sub { font-size: 14px; } .join-row { flex-direction: column; align-items: stretch; } .join-row button { width: 100%; } #skin-preview { width: 200px; height: 230px; } .card { padding: 12px; } .lobby-card { width: 92vw; padding: 20px; } .end-card { min-width: 0; width: 92vw; padding: 20px; } #end-title { font-size: 30px; } }
/* end */
#end { background: #0b0f1499; }
.end-card { background: #141c25; border: 1px solid #2c3a49; border-radius: 14px; padding: 32px 44px; text-align: center; min-width: 420px; }
#end-title { font-size: 44px; font-weight: 900; color: #ffd23f; letter-spacing: 2px; }
#end-sub { color: #cbd5df; margin-top: 6px; font-size: 16px; }
#end-stats { display: flex; gap: 26px; justify-content: center; margin-top: 18px; }
#end-stats b { display: block; font-size: 30px; }
#end-stats span { color: #aab7c4; font-size: 12px; letter-spacing: 1px; }

#loading { position: fixed; inset: 0; background: #0b0f1466; display: grid; place-items: center; z-index: 30; text-align: center; }
.load-card { background: #121a24d9; border: 1px solid #26313d; border-radius: 14px; padding: 28px 36px; box-shadow: 0 10px 30px #0006; backdrop-filter: blur(8px); }
#loading-text { font-family: "Russo One", sans-serif; font-size: 20px; letter-spacing: 1px; margin-bottom: 6px; }
.spinner { width: 46px; height: 46px; border: 4px solid #2c3a49; border-top-color: #ffd23f; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

#build-tag.warn { color: #ff8a65; font-weight: 600; }
.vote-note { min-height: 20px; margin: 4px 0 10px; color: #ffd23f; }
.vote-note:empty { margin: 0; }
button.deny { background: #7a2b2b; border-color: #a33; color: #fff; }
button.deny:hover { background: #963434; }

.footer a { color: #8fb4d8; text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }

/* settings panel */
#settings { z-index: 60; }
.set-group { margin: 14px 0 4px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #8fa3b8; }
.set-row { display: grid; grid-template-columns: 1fr 150px 56px; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #ffffff10; }
.set-row input[type=range] { width: 100%; accent-color: #6fc1ff; }
.set-row input[type=checkbox] { justify-self: start; width: 18px; height: 18px; }
.set-row output { font-variant-numeric: tabular-nums; text-align: right; color: #cfe3f5; }
@media (max-width: 520px) { .set-row { grid-template-columns: 1fr 1fr 48px; } }
/* phones: this must come after the base .end-card rule, or its 420 px min-width wins and the end screen, pause,
   keys and settings cards overflow the screen */
@media (max-width: 700px) { .end-card { min-width: 0; width: 92vw; box-sizing: border-box; padding: 20px; } }

/* ---- meta: level, coins, locker, shop, battle pass ---------------------------------------------------------------- */
.meta-bar { display: flex; align-items: center; gap: 8px; }
.level-badge { min-width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #ffcf3a, #e8962a); color: #1a1206; font-weight: 800; font-size: 13px; }
.coins { padding: 5px 10px 5px 26px; border-radius: 16px; background: #1b2531 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='%23f5c542' stroke='%23b8871d' stroke-width='1.5'/%3E%3Ctext x='8' y='11.5' font-size='9' text-anchor='middle' font-family='Arial' font-weight='bold' fill='%23835f10'%3ES%3C/text%3E%3C/svg%3E") 6px 50%/16px no-repeat; font-weight: 700; font-variant-numeric: tabular-nums; }
button.link { background: none; border: 0; color: #8fc7ff; padding: 0; text-decoration: underline; cursor: pointer; }
.panel { background: #121a23; border: 1px solid #2c3a49; border-radius: 14px; width: min(1000px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column; box-sizing: border-box; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #243140; gap: 8px; }
.panel-body { padding: 16px; overflow: auto; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { background: transparent; border: 1px solid #2c3a49; }
.tabs button.on { background: #ffcf3a; color: #1a1206; border-color: #ffcf3a; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.tile { position: relative; border-radius: 10px; background: #18222d; border: 2px solid #253240; padding: 8px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.tile:hover { border-color: #4b6680; }
.tile.equipped { border-color: #ffcf3a; }
.tile.locked .thumb { filter: grayscale(0.7) brightness(0.6); }
.tile .thumb { height: 150px; border-radius: 6px; background: #0e151c center/cover no-repeat; }
.tile .name { font-weight: 700; }
.tile .tag { font-size: 12px; color: #9fb3c6; display: flex; justify-content: space-between; align-items: center; }
.tile .price { color: #f5c542; font-weight: 700; }
.r-common { box-shadow: inset 0 -4px 0 #7f8c8d; } .r-rare { box-shadow: inset 0 -4px 0 #3b8dff; } .r-epic { box-shadow: inset 0 -4px 0 #b05cff; } .r-legendary { box-shadow: inset 0 -4px 0 #ffb340; }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.pack { border-radius: 12px; padding: 16px; background: linear-gradient(160deg, #26374a, #18222d); border: 1px solid #36506a; text-align: center; }
.pack b { display: block; font-size: 22px; color: #f5c542; }
.pack .note { color: #7ee787; font-size: 12px; min-height: 16px; }
.pass-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.bar { height: 10px; border-radius: 5px; background: #0e151c; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #ffcf3a, #ff8a3a); }
.track { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.tier { flex: 0 0 104px; border-radius: 8px; background: #18222d; border: 1px solid #253240; padding: 6px; font-size: 12px; }
.tier.reached { border-color: #ffcf3a; }
.tier .num { font-weight: 800; text-align: center; margin-bottom: 4px; }
.tier .rw { height: 58px; border-radius: 6px; margin-bottom: 4px; display: grid; place-items: center; text-align: center; padding: 2px; background: #0e151c center/cover no-repeat; color: #cfe3f5; }
.tier .rw.prem { background-color: #2a1f0a; }
.tier .rw.empty { opacity: .25; }
.challenges { display: grid; gap: 8px; margin-top: 16px; }
.challenge { display: grid; grid-template-columns: 1fr 120px 60px; gap: 10px; align-items: center; background: #18222d; border-radius: 8px; padding: 8px 12px; }
.challenge.done { opacity: .6; }
#end-progress { margin: 12px 0; text-align: left; font-size: 14px; }
#end-progress .xp-row { display: flex; justify-content: space-between; color: #b9cadb; }
#end-progress .xp-total { display: flex; justify-content: space-between; font-weight: 800; border-top: 1px solid #2c3a49; margin-top: 4px; padding-top: 4px; }
#end-progress .up { color: #ffcf3a; font-weight: 700; margin-top: 6px; }
.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); background: #1d2a37; border: 1px solid #3b5670; padding: 10px 16px; border-radius: 10px; z-index: 80; }
.consent { display: flex !important; flex-direction: row !important; gap: 10px; align-items: flex-start; font-size: 13px; color: #b9cadb; margin: 8px 0 14px; }
.consent input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; }
.consent a, #end-progress a { color: #8fc7ff; }
@media (max-width: 700px) { .meta-bar { flex-wrap: wrap; } .challenge { grid-template-columns: 1fr 80px 48px; } }

/* inside CrazyGames: their account system replaces ours, coin packs wait for their payments, no text selection */
html.portal #btn-login, html.portal #btn-register, html.portal #btn-logout, html.portal .packs, html.portal .consent, html.portal #coin-heading { display: none !important; }
html.portal body { -webkit-user-select: none; user-select: none; }

/* ---- party and friends ---- */
.party-field { display: flex; gap: 6px; }
.party-field input { flex: 1; min-width: 0; }
.party-strip { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.party-member { display: inline-flex; align-items: center; gap: 6px; background: #1b2531; border: 1px solid #2c3a49; border-radius: 999px; padding: 3px 10px 3px 3px; font-weight: 600; }
.party-member.you { border-color: #ffd23f; }
.pm-face { width: 26px; height: 26px; border-radius: 50%; background: #0e151c 50% 6% / 190% auto no-repeat; }
.party-note { font-size: 13px; }
.invite-notice { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; background: #141c25; border: 1px solid #ffd23f; border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; box-shadow: 0 8px 30px #0008; max-width: calc(100vw - 32px); box-sizing: border-box; flex-wrap: wrap; }
.friends-card { text-align: left; width: min(460px, calc(100vw - 32px)); box-sizing: border-box; max-height: 85vh; overflow: auto; }
.friends-card h3 { margin: 14px 0 6px; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: #8a97a5; }
.friend-add input { flex: 1; min-width: 0; }
.friend { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid #222d39; }
.friend .grow { flex: 1; }
.friend .dot { width: 9px; height: 9px; border-radius: 50%; background: #4b5563; flex: none; }
.friend .dot.online { background: #3fd07a; }
.friend .dot.match { background: #ffb13b; }
.join-row .party-field button { padding: 8px 12px; font-size: 14px; flex: none; width: auto; }
.join-row .party-field input { min-width: 70px; width: auto; }
.join-row .party-field { min-width: 0; }
