:root { --nav-h: calc(env(safe-area-inset-top) + var(--edge) + max(54px, calc(56 * var(--u))) + 6px); }

#lobby { font-family: var(--f-font); }
#lobby button { font-family: var(--f-font); }

.lnav { position: absolute; z-index: 7; top: calc(env(safe-area-inset-top) + var(--edge)); left: calc(env(safe-area-inset-left) + var(--edge)); right: calc(env(safe-area-inset-right) + var(--edge)); display: flex; align-items: center; gap: 8px; pointer-events: none; }
.lnav > * { pointer-events: auto; }
.lnav-tabs { flex: 1 1 auto; min-width: 0; }
.lnav-tabs .f-tab { text-shadow: 0 2px 2px rgba(0, 0, 0, 0.35); }
.lnav-tabs .f-tab.sel, body:not(.page-open) .lnav-tabs [data-nav=""], body[data-page="locker"] .lnav [data-nav="locker"], body[data-page="shop"] .lnav [data-nav="shop"], body[data-page="quests"] .lnav [data-nav="quests"], body[data-page="patches"] .lnav [data-nav="patches"], body[data-page="profile"] .lnav [data-nav="profile"] { background: var(--f-nav-sel); color: var(--f-ink); text-shadow: none; opacity: 1; }
.lnav .off { opacity: 0.45; }
.lnav-right { flex: none; display: flex; align-items: center; gap: 8px; }
.lcur { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 8px; background: rgba(4, 16, 60, 0.45); color: #fff; font-weight: 700; font-size: max(calc(17 * var(--u)), 15px); cursor: pointer; }
.lcur .coin, .lcur .crystal { width: 18px; height: 20px; min-width: 0; min-height: 0; }
.lcur .coin { height: 18px; }
.lplus { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--f-green); color: var(--f-ink); font-size: 18px; line-height: 1; }
.lico { position: relative; width: max(48px, calc(48 * var(--u))); height: max(48px, calc(48 * var(--u))); border: 0; border-radius: 8px; background: rgba(4, 16, 60, 0.45); cursor: pointer; display: grid; place-items: center; }
.lico svg { width: 58%; height: 58%; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
body[data-page="friends"] .lnav [data-nav="friends"], body[data-page="settings"] .lnav [data-nav="settings"] { background: var(--f-nav-sel); }
body[data-page="friends"] .lnav [data-nav="friends"] svg, body[data-page="settings"] .lnav [data-nav="settings"] svg { stroke: var(--f-ink); }
.lme { border: 0; padding: 0; background: none; cursor: pointer; width: max(48px, calc(48 * var(--u))); height: max(48px, calc(48 * var(--u))); }
.lme .me-avatar { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 0 3px #fff; overflow: hidden; }
.lme .me-av-in { font-size: max(calc(20 * var(--u)), 18px); }

.lleft { position: absolute; left: calc(env(safe-area-inset-left) + var(--edge)); top: calc(var(--nav-h) + 4px); display: flex; flex-direction: column; gap: 8px; width: min(calc(230 * var(--u)), 30vw); }
.lcard { text-align: left; border: 0; border-radius: 10px; padding: 10px 12px; min-height: 52px; background: rgba(4, 16, 60, 0.55); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.16); color: #fff; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.lcard .f-sub { font-size: max(calc(12 * var(--u)), 12px); color: var(--f-yellow); }
.lcard b { font-weight: 700; font-size: max(calc(15 * var(--u)), 14px); text-transform: uppercase; line-height: 1.1; }
.lcard .f-prog { height: 7px; }

.lslot { position: absolute; left: 0; top: 0; width: max(48px, calc(52 * var(--u))); height: max(48px, calc(52 * var(--u))); border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.18); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.65); color: #fff; font-weight: 700; font-size: 30px; line-height: 1; cursor: pointer; }
.lslot[hidden] { display: none; }

.lbottom { position: absolute; left: calc(env(safe-area-inset-left) + var(--edge)); bottom: calc(env(safe-area-inset-bottom) + var(--edge)); display: flex; gap: 8px; }

.lrank { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + var(--edge)); display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 99px; background: rgba(4, 16, 60, 0.55); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.16); max-width: 34vw; }
.lvl-ring { flex: none; width: 50px; height: 50px; border-radius: 50%; background: conic-gradient(var(--f-yellow) var(--lp, 0%), rgba(255, 255, 255, 0.2) 0); display: grid; place-items: center; }
.lvl-ring i { font-style: normal; width: 40px; height: 40px; border-radius: 50%; background: #0b3a9a; display: grid; place-items: center; font-weight: 700; font-size: 17px; }
.lrank-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.05; }
.lrank-text b#me-nick { font-weight: 700; font-size: max(calc(16 * var(--u)), 14px); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#me-rank { font-weight: 700; font-size: max(calc(12 * var(--u)), 12px); text-transform: uppercase; color: var(--rc, #fff); }
.lrank-text .f-prog { height: 5px; margin: 3px 0; width: calc(120 * var(--u)); }
.lrank-text .f-prog i { background: var(--rc, var(--f-yellow)); }
.lrank-text small { font-weight: 600; font-size: max(calc(11 * var(--u)), 12px); color: var(--f-dim); }
.lrank-text small b { color: var(--f-yellow); }

.lmode { position: absolute; right: calc(env(safe-area-inset-right) + var(--edge)); bottom: calc(env(safe-area-inset-bottom) + var(--edge)); width: min(calc(270 * var(--u)), 36vw); min-width: 220px; padding: 12px; border-radius: 12px; background: rgba(4, 16, 60, 0.62); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18); display: flex; flex-direction: column; gap: 6px; }
.lmode .f-title { font-size: max(calc(24 * var(--u)), 20px); }
.lmode .f-sub { font-size: max(calc(12 * var(--u)), 12px); }
.lmode-sel { display: flex; gap: 6px; }
.lmode-sel .f-btn { flex: 1; font-size: max(calc(14 * var(--u)), 13px); min-height: 44px; padding: 0 8px; }
.lmode .f-btn.big { width: 100%; }
.lmode .net-status { align-self: center; font-weight: 600; font-size: 12px; color: var(--f-dim); background: none; padding: 0; }
.lmode .net-status[hidden] { display: none; }

body.mode-lobby .page-wrap .f-page { padding-top: calc(var(--nav-h) + 6px); }
body.mode-lobby.page-open .lnav { z-index: 9; }
body.page-open #lobby > :not(.lnav):not(#lobby-names) { visibility: hidden; }
body.page-open #lobby-names { visibility: hidden; }
#lobby .lobby-name b { font-family: var(--f-font); text-transform: uppercase; }
#lobby-names .me-plate { position: absolute; left: 0; top: 0; text-align: center; font-weight: 700; text-transform: uppercase; text-shadow: 0 2px 3px rgba(0, 0, 0, 0.45); color: #fff; font-size: max(calc(15 * var(--u)), 14px); white-space: nowrap; transform: translate(-50%, -100%); }
#lobby-names .me-plate small { display: block; font-size: 12px; color: #63ff8a; }

@media (max-aspect-ratio: 3/2) {
  .lleft { width: 34vw; }
  .lrank { display: none; }
}
body.side-open #lobby > .lnav { opacity: 1; pointer-events: none; }
body.side-open #lobby .lnav button { pointer-events: auto; }
.lnav-tabs .f-tab { font-size: clamp(17px, calc(20 * var(--u)), 22px); padding: 0 clamp(9px, calc(14 * var(--u)), 18px); min-height: max(54px, calc(56 * var(--u))); }
.lnav-tabs { gap: 2px; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.lnav-right { gap: 6px; }
.lcur { min-height: 0; height: clamp(46px, calc(48 * var(--u)), 58px); padding: 0 12px; gap: 8px; font-size: clamp(19px, calc(22 * var(--u)), 24px); }
.lcur .coin, .lcur .crystal { width: 28px; height: 30px; }
.lcur .coin { height: 28px; }
.lplus { width: 30px; height: 30px; font-size: 22px; }
.lico, .lme { width: clamp(46px, calc(48 * var(--u)), 58px); height: clamp(46px, calc(48 * var(--u)), 58px); }
.lico svg { width: 62%; height: 62%; }
#lobby .f-btn.dark, .lmode .f-btn.dark { background: rgba(4, 16, 60, 0.62); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18); }
.lcard { min-height: 48px; }
.lleft { width: min(calc(210 * var(--u)), 28vw); }
.sum { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; text-align: center; }
.sum-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.sum-tile { min-width: 150px; padding: 14px 18px; border-radius: 12px; background: rgba(4, 16, 60, 0.45); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.16); display: flex; flex-direction: column; gap: 4px; }
.sum-tile .f-title { font-size: max(calc(36 * var(--u)), 28px); display: flex; align-items: center; gap: 8px; justify-content: center; }
.sum-tile .coin { width: 30px; height: 30px; }
body[data-page="profile"] .lme .me-avatar { box-shadow: 0 0 0 3px var(--f-yellow); }
.lbottom .lnarrow { display: none; }
.lbottom .f-btn { min-height: max(54px, calc(56 * var(--u))); }
@media (max-width: 1400px) {
  .lnav-tabs [data-nav="profile"] { display: none; }
  .lnav-tabs .f-tab { padding: 0 10px; }
}
@media (max-width: 960px) {
  .lnav-right [data-nav="friends"], .lnav-right [data-nav="settings"] { display: none; }
  .lbottom .lnarrow { display: grid; }
  .lnav-tabs .f-tab { padding: 0 9px; }
  .lnav-tabs { -webkit-mask-image: none; mask-image: none; }
}
@media (max-width: 800px) {
  .lnav-tabs .f-tab { font-size: 15px; padding: 0 7px; }
  .lcur { font-size: 17px; padding: 0 8px; gap: 6px; }
  .lcur .coin, .lcur .crystal { width: 22px; height: 24px; }
  .lcur .coin { height: 22px; }
  .lplus { width: 26px; height: 26px; }
}
body.mode-lobby .set-page .f-page-head > .f-title { display: none; }
.set-tabs .f-tab { flex: 1 0 auto; justify-content: center; }
#app > .fxcv { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; visibility: hidden; contain: strict; }

.lparty { cursor: default; }
.lparty[hidden] { display: none; }
.lparty { flex-direction: row; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; }
.lparty .lp-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lparty .lp-tx b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lparty .lp-out { flex: none; min-height: 48px; padding: 0 10px; font-size: max(calc(13 * var(--u)), 12px); }
#lobby .lobby-name { display: flex; align-items: center; gap: 4px; }
#lobby .lobby-name .lp-crown { font-style: normal; color: var(--f-yellow); }
#lobby .lobby-name .lp-ready { font-style: normal; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--f-green); color: var(--f-ink); font-size: 13px; font-weight: 700; text-shadow: none; }
.lmode .f-btn.big.wait { background: #8a93a6; color: #20283a; filter: grayscale(0.3); }
.lmode .f-btn.big.ready { background: var(--f-green); color: var(--f-ink); }
.lduel-fr { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--f-red); color: #fff; cursor: pointer; font-weight: 700; text-transform: uppercase; font-size: max(calc(15 * var(--u)), 14px); }
.lduel-fr i { font-style: normal; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: var(--f-red); font-size: 14px; }
.party-inv { position: absolute; z-index: 30; top: calc(env(safe-area-inset-top) + var(--edge) + max(60px, calc(64 * var(--u)))); left: 50%; transform: translateX(-50%); width: min(420px, calc(100vw - 2 * var(--edge) - env(safe-area-inset-left) - env(safe-area-inset-right))); padding: 12px 14px 16px; border-radius: 12px; background: linear-gradient(180deg, rgba(14, 40, 120, 0.97), rgba(6, 20, 70, 0.97)); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2), 0 10px 30px rgba(0, 0, 0, 0.45); color: #fff; font-family: var(--f-font); overflow: hidden; display: flex; flex-direction: column; gap: 10px; animation: piIn 0.25s ease-out; }
.party-inv[hidden] { display: none; }
.party-inv .pi-row { display: flex; align-items: center; gap: 12px; }
.party-inv .pi-av { width: 48px; height: 48px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 22px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8); overflow: hidden; }
.party-inv .pi-av img { width: 100%; height: 100%; }
.party-inv .pi-tx { display: flex; flex-direction: column; min-width: 0; }
.party-inv .pi-tx b { font-weight: 700; text-transform: uppercase; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party-inv .pi-tx small { font-size: 14px; color: var(--f-dim); }
.party-inv .pi-btns { display: flex; gap: 10px; }
.party-inv .pi-btns .f-btn { flex: 1; min-height: 48px; font-size: 16px; }
.party-inv .pi-bar { position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: var(--f-yellow); transform-origin: left; animation: piBar linear forwards; }
@keyframes piBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes piIn { from { opacity: 0; } to { opacity: 1; } }
#lobby .lobby-name b { font-size: clamp(13px, calc(15 * var(--u)), 21px); }
#lobby .lobby-name.far b { font-size: clamp(11px, calc(12 * var(--u)), 16px); }
.pm-foot { display: flex; gap: 10px; }
.pm-foot .f-btn { flex: 1; min-height: 48px; padding: 0 14px; }
