/* ========== Лобби: заставка, серверы, зал героев, создание, загрузка (горизонталь) ========== */
#login.lobby {
  position: fixed; inset: 0; height: var(--app-h, 100%); padding: 0; display: block; overflow: hidden; touch-action: none;
  background: #050408; color: #efe4cc; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sl: max(12px, env(safe-area-inset-left)); --sr: max(12px, env(safe-area-inset-right)); --sb: max(8px, env(safe-area-inset-bottom));
  --gold: #e8c66a; --gold-d: #8a6a2a; --edge: #6a5128;
}
#login.lobby::before, #login.lobby::after { display: none; }
#lb-scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---- экраны и переходы ---- */
.lb-screen {
  position: absolute; inset: 0; opacity: 0; visibility: hidden; transform: translateX(28px);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(.2,.8,.2,1), visibility 0s linear 0.45s; pointer-events: none;
}
.lb-screen.back { transform: translateX(-28px); }
.lb-screen.on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; pointer-events: auto; }

/* ---- общие элементы ---- */
.lb-panel {
  border: 1px solid var(--edge); border-radius: 4px;
  background: radial-gradient(ellipse 90% 40px at 50% 0, rgba(232,198,106,0.10), transparent), linear-gradient(rgba(26,20,16,0.9), rgba(10,8,7,0.93));
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.85), inset 0 1px 0 rgba(255,230,170,0.08), 0 0 0 1px #000, 0 8px 24px rgba(0,0,0,0.55);
}
.lb-btn {
  min-height: 48px; min-width: 48px; padding: 0 16px; border-radius: 4px; cursor: pointer; white-space: nowrap;
  font: 700 14px/1 var(--serif); letter-spacing: 0.06em; color: #f1e2bd;
  border: 1px solid #6e5427; background: linear-gradient(#3a2f26, #1b1511 55%, #120e0b);
  box-shadow: inset 0 1px 0 rgba(255,236,190,0.14), inset 0 0 0 1px rgba(0,0,0,0.7), 0 0 0 1px #000, 0 3px 8px rgba(0,0,0,0.5);
  text-shadow: 0 1px 2px #000; transition: transform 0.08s, filter 0.15s;
}
.lb-btn:active:not(:disabled) { transform: translateY(1px); filter: brightness(1.2); }
.lb-btn:disabled { opacity: 0.42; filter: grayscale(0.6); cursor: default; }
.lb-gold {
  color: #2a1a05; text-shadow: 0 1px 0 rgba(255,240,200,0.6); border-color: #ffe08a;
  background: linear-gradient(#fff0b8, #e8c66a 35%, #b8862a 70%, #8a5e1a);
  box-shadow: inset 0 1px 0 #fff6d0, inset 0 0 0 1px rgba(90,60,10,0.6), 0 0 0 1px #000, 0 0 16px rgba(255,190,80,0.35), 0 3px 8px rgba(0,0,0,0.5);
}
.lb-big { font-size: 17px; min-width: 128px; letter-spacing: 0.12em; text-transform: uppercase; }
.lb-ghost { background: linear-gradient(rgba(40,32,26,0.75), rgba(14,11,9,0.85)); color: #d8c8a4; }
.lb-danger { color: #ffe6e0; border-color: #c0483a; background: linear-gradient(#8a2a20, #4a120c); }
.lb-ico {
  width: 48px; height: 48px; padding: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  border: 1px solid #6e5427; background: radial-gradient(circle at 50% 35%, #3a2f26, #120e0b); box-shadow: 0 0 0 1px #000, inset 0 1px 0 rgba(255,236,190,0.12);
}
.lb-ico svg { width: 22px; height: 22px; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lb-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--st, #4fd06a); box-shadow: 0 0 6px var(--st, #4fd06a), 0 0 0 1px #000; flex: none; }
.lb-input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 4px; outline: none; font: 600 17px var(--serif); color: #fff6dc;
  border: 1px solid #7a5c26; background: rgba(0,0,0,0.6); box-shadow: inset 0 2px 6px rgba(0,0,0,0.8), 0 0 0 1px #000;
  user-select: text; -webkit-user-select: text;
}
.lb-input:focus { border-color: var(--gold); box-shadow: inset 0 2px 6px rgba(0,0,0,0.8), 0 0 10px rgba(232,198,106,0.4); }
.lb-input.ok { border-color: #5fbf6a; } .lb-input.bad { border-color: #d8584a; }

/* ---- верхняя панель ---- */
.lb-top { position: absolute; top: 4px; left: var(--sl); right: var(--sr); height: 48px; display: flex; align-items: center; gap: 8px; z-index: 3; }
.lb-top-l { flex: 1 1 0; min-width: 0; display: flex; }
.lb-ttl {
  flex: none; font: 700 15px var(--serif); letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold);
  text-shadow: 0 1px 2px #000, 0 0 12px rgba(255,190,80,0.35); padding: 0 22px; position: relative;
}
.lb-ttl::before, .lb-ttl::after { content: ''; position: absolute; top: 50%; width: 16px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.lb-ttl::before { left: 0; } .lb-ttl::after { right: 0; transform: scaleX(-1); }
.lb-top > .lb-snd { flex: none; margin-left: auto; }
.lb-top::after { content: ''; flex: 1 1 0; order: 2; }
.lb-top .lb-snd { order: 3; } .lb-top .lb-ttl { order: 1; }
.lb-back { min-width: 0; padding: 0 14px; font-size: 13px; }

/* ---- заставка ---- */
#lb-splash { cursor: pointer; }
.lb-logo { position: absolute; left: 0; right: 0; top: 16%; text-align: center; pointer-events: none; }
.lb-crest { width: 120px; height: 24px; margin: 0 auto 2px; background: var(--orn-crest, none) center / contain no-repeat; filter: drop-shadow(0 0 6px rgba(255,190,80,0.5)); }
.lb-logo h1 {
  margin: 0; padding-left: 0.16em; font: 700 clamp(44px, 16vh, 92px) / 1.05 var(--serif); letter-spacing: 0.16em; text-transform: uppercase;
  background:
    linear-gradient(105deg, transparent 42%, rgba(255,255,255,0.95) 50%, transparent 58%) -150% 0 / 250% 100% no-repeat,
    linear-gradient(#fffbe6 8%, #f6d887 38%, #a8741e 52%, #ffe7a0 72%, #c8922e 94%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #2a1604) drop-shadow(0 0 1px #000) drop-shadow(0 0 22px rgba(255,170,50,0.55));
  animation: lbShine 6s ease-in-out infinite, lbRise 1.2s ease-out both;
}
.lb-logo p { margin: 2px 0 0; font: italic 13px var(--serif); letter-spacing: 0.3em; text-transform: uppercase; color: #e2cfa4; text-shadow: 0 1px 3px #000; animation: lbRise 1.2s 0.2s ease-out both; }
@keyframes lbShine { 0%, 60% { background-position: -150% 0, 0 0; } 100% { background-position: 250% 0, 0 0; } }
@keyframes lbRise { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
.lb-tap {
  position: absolute; left: 50%; bottom: calc(18% + var(--sb)); transform: translateX(-50%); padding: 10px 26px; white-space: nowrap;
  font: 700 15px var(--serif); letter-spacing: 0.24em; text-transform: uppercase; color: #fff0c8;
  text-shadow: 0 0 10px rgba(255,190,80,0.8), 0 1px 2px #000; animation: lbPulse 2.2s ease-in-out infinite;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.55) 20%, rgba(0,0,0,0.55) 80%, transparent);
}
@keyframes lbPulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
.lb-foot { position: absolute; left: var(--sl); right: var(--sr); bottom: var(--sb); display: flex; justify-content: space-between; font-size: 11px; color: rgba(230,215,180,0.6); text-shadow: 0 1px 2px #000; }

/* ---- серверы ---- */
.lb-srvbody { position: absolute; top: 58px; bottom: var(--sb); left: var(--sl); right: var(--sr); display: flex; gap: 10px; }
.lb-srvlist { flex: 1.45 1 0; min-width: 0; align-self: flex-start; max-height: 100%; margin: 0; padding: 6px; list-style: none; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; touch-action: pan-y; }
.lb-srvwait { padding: 16px; color: #bba; font-size: 13px; }
.lb-srv {
  width: 100%; min-height: 56px; padding: 6px 10px 6px 6px; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; gap: 3px 10px; align-items: center;
  text-align: left; cursor: pointer; color: inherit; font: inherit; border-radius: 3px; border: 1px solid #3e301a;
  background: linear-gradient(90deg, rgba(255,236,180,0.05), rgba(0,0,0,0.25)); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.6);
  transition: border-color 0.2s, background 0.2s;
}
.lb-srv.sel { border-color: var(--gold); background: linear-gradient(90deg, rgba(232,198,106,0.2), rgba(232,198,106,0.04)); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.6), 0 0 12px rgba(232,198,106,0.25); }
.lb-srv-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.lb-srv-top b { flex: 0 1 auto; min-width: 0; font: 700 15px var(--serif); color: #fff0cc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; }
.lb-srv.sel .lb-srv-top b { color: #ffe39a; }
.lb-tag { flex: none; font: 700 11px/1 sans-serif; font-style: normal; padding: 3px 6px; border-radius: 2px; letter-spacing: 0.03em; }
.lb-tag-rec { color: #2a1a05; background: linear-gradient(#ffe7a0, #c8922e); }
.lb-tag-new { color: #062a0c; background: linear-gradient(#a8f0b0, #3fae55); }
.lb-tag-last { color: #d8d0ff; border: 1px solid #6a64a8; background: rgba(60,50,120,0.4); }
.lb-srv-bot { display: flex; align-items: center; gap: 8px; font-size: 12px; min-width: 0; }
.lb-st { color: var(--st); font-weight: 700; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.lb-onl { color: #cfc2a6; white-space: nowrap; }
.lb-load { flex: 1 1 40px; max-width: 120px; height: 5px; border-radius: 3px; background: rgba(0,0,0,0.6); box-shadow: 0 0 0 1px #2a2014; overflow: hidden; }
.lb-load i { display: block; height: 100%; background: var(--st); box-shadow: 0 0 6px var(--st); }
.lb-emb {
  grid-row: 1 / 3; grid-column: 1; width: 38px; height: 44px; display: grid; place-items: center; font: 700 15px var(--serif); color: #2a1a05;
  clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%); background: linear-gradient(#fff0b8, #c8922e 55%, #7a4e14); padding-bottom: 6px;
}
.lb-emb::before { content: attr(data-s); }
.lb-srv:not(.sel) .lb-emb { filter: saturate(0.4) brightness(0.75); }
.lb-srv-top { grid-column: 2; } .lb-srv-bot { grid-column: 2; }
.lb-si-emb { width: 44px; height: 50px; font-size: 17px; filter: drop-shadow(0 0 10px rgba(255,190,80,0.45)); }
.lb-hc { grid-row: 1 / 3; grid-column: 3; display: flex; flex-direction: column; align-items: center; min-width: 46px; padding: 3px 6px; border-left: 1px solid rgba(232,198,106,0.2); }
.lb-hc b { font: 700 18px var(--serif); color: var(--gold); line-height: 1.1; }
.lb-hc small { font-size: 11px; color: #bba98a; }
.lb-hc.none b { color: #7d725e; }
.lb-srvinfo { flex: 1 1 0; min-width: 200px; max-width: 330px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.lb-si-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 5px; }
.lb-si-scroll > .lb-si-emb { position: absolute; right: 10px; top: 8px; }
.lb-srvinfo { position: relative; }
.lb-si-head, .lb-si-st { padding-right: 50px; }
.lb-si-head b { display: block; font: 700 19px var(--serif); color: #ffe39a; text-shadow: 0 1px 2px #000, 0 0 12px rgba(255,190,80,0.3); line-height: 1.15; }
.lb-si-head small { font-size: 12px; color: #bba98a; font-style: italic; }
.lb-si-st { white-space: nowrap; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--st); font-weight: 700; }
.lb-si-onl { color: #cfc2a6; font-weight: 400; }
.lb-si-cap { font: 700 11px sans-serif; color: #a8987a; text-transform: uppercase; letter-spacing: 0.1em; border-top: 1px solid rgba(232,198,106,0.15); padding-top: 6px; }
.lb-si-heroes { display: flex; flex-wrap: wrap; gap: 4px; }
.lb-chip { display: inline-flex; gap: 5px; align-items: baseline; padding: 3px 7px; border-radius: 2px; border-left: 3px solid var(--cc); background: rgba(0,0,0,0.4); font-size: 12px; }
.lb-chip b { color: #fff0cc; } .lb-chip small { color: #bba98a; font-size: 11px; }
.lb-si-none { font-size: 12px; color: #a8987a; font-style: italic; }
#lb-srv-go { flex: none; width: 100%; }

/* ---- зал героев (реф 04): таблички над головами, кнопки по углам ---- */
.lb-slots { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.lb-slot { position: absolute; flex-direction: column; justify-content: flex-start !important; align-items: stretch !important; pointer-events: auto; cursor: pointer; background: none; border: 0; padding: 0; display: flex; align-items: flex-start; justify-content: center; color: inherit; font: inherit; -webkit-tap-highlight-color: transparent; }
.lb-pw { flex: none; display: flex; align-items: flex-end; justify-content: center; min-width: 0; }
.lb-slot:focus-visible { outline: 1px dashed rgba(232,198,106,0.6); outline-offset: -2px; }
/* табличка: тёмная полупрозрачная плашка, тонкая светлая рамка; имя капсом, ниже «Ур. N, Класс» */
.lb-plate {
  display: flex; flex-direction: column; align-items: center; max-width: 100%; min-width: 0; padding: 3px 8px 4px; line-height: 1.2; text-align: center;
  background: rgba(8,8,12,0.66); border: 1px solid rgba(225,220,205,0.42); border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.5);
}
.lb-plate b { display: block; max-width: 100%; font: 700 12px/1.2 var(--serif); letter-spacing: 0.08em; text-transform: uppercase; color: #ece6d6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; }
/* длинное имя (login.js fitPlates): 1 — без капса, 2 — 11 px, 3 — перенос на 2 строки */
.lb-plate b.fit1 { text-transform: none; letter-spacing: 0.02em; }
.lb-plate b.fit2 { font-size: 11px; letter-spacing: 0; }
.lb-plate b.fit3 { white-space: normal; overflow-wrap: anywhere; word-break: break-word; text-overflow: clip; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lb-plate small { display: block; max-width: 100%; font: 11px/1.2 var(--serif); color: #a9a293; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-slot.sel .lb-plate { border-color: rgba(255,226,150,0.85); background: rgba(24,18,8,0.74); box-shadow: 0 0 0 1px rgba(0,0,0,0.6), 0 0 10px rgba(255,200,90,0.35); }
.lb-slot.sel .lb-plate b { color: #ffe7a6; }
.lb-slot.sel .lb-plate small { color: #d9c79a; }
.lb-bar { position: absolute; left: var(--sl); right: var(--sr); bottom: var(--sb); height: 60px; display: flex; gap: 8px; align-items: stretch; z-index: 2; }
.lb-acts { display: flex; gap: 6px; flex: none; }
/* нижние кнопки: маленькие прямоугольные, тёмные, с тонкой рамкой; отступ от краёв ~2–3% */
.lb-bar.lb-hallbar { left: max(2.5vw, var(--sl)); right: max(2.5vw, var(--sr)); bottom: max(2.5vh, var(--sb)); height: 44px; justify-content: space-between; gap: 12px; pointer-events: none; }
.lb-hg { display: flex; gap: 6px; pointer-events: auto; }
.lb-hb {
  min-height: 44px; height: 44px; min-width: 64px; padding: 0 14px; border-radius: 2px; font: 700 12px/1 var(--serif); letter-spacing: 0.1em; text-transform: uppercase;
  color: #ddd5c2; border: 1px solid rgba(200,190,170,0.38); background: linear-gradient(rgba(30,28,32,0.92), rgba(12,11,14,0.94));
  box-shadow: 0 0 0 1px #000, inset 0 1px 0 rgba(255,255,255,0.06), 0 3px 8px rgba(0,0,0,0.5);
}
.lb-hb.on { border-color: var(--gold); color: #ffe7a6; }
.lb-red { color: #fff1ea; border-color: #e0604c; background: linear-gradient(#a8291c, #6c140c 60%, #4a0c07); box-shadow: 0 0 0 1px #000, inset 0 1px 0 rgba(255,190,170,0.25), 0 0 14px rgba(220,60,40,0.35); }
.lb-red:disabled { box-shadow: 0 0 0 1px #000; }
/* меню (сервер, звук, выход) — над кнопкой «Меню» */
.lb-menu { position: absolute; z-index: 5; left: max(2.5vw, var(--sl)); bottom: calc(max(2.5vh, var(--sb)) + 50px); width: 236px; max-height: calc(var(--app-h, 100vh) - 70px); overflow-y: auto; padding: 5px; display: flex; flex-direction: column; gap: 4px; }
.lb-menu.hidden { display: none; }
.lb-mi { min-height: 44px; width: 100%; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 2px; cursor: pointer; color: #e6dcc6; font: 600 13px var(--serif); text-align: left; border: 1px solid rgba(200,190,170,0.22); background: rgba(0,0,0,0.35); }
.lb-mi svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lb-mi:active { filter: brightness(1.25); }
.lb-srvchip b { font: 700 13px var(--serif); color: #fff0cc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lb-srvchip small { font-size: 11px; color: #bba98a; white-space: nowrap; }
.lb-chev { margin-left: auto; font: 700 18px var(--serif); color: var(--gold); }
@media (max-width: 720px) { .lb-plate small { white-space: normal; } .lb-plate b { font-size: 11px; letter-spacing: 0.05em; } }
@media (max-width: 520px) { .lb-pcls { display: none; } .lb-plate { padding: 2px 4px 3px; } .lb-plate b { letter-spacing: 0.02em; } }
@media (max-width: 420px) {
  .lb-bar.lb-hallbar { height: auto; flex-wrap: wrap; row-gap: 6px; }
  .lb-hg-r { margin-left: auto; }
  .lb-hb { padding: 0 9px; min-width: 48px; font-size: 11px; letter-spacing: 0.04em; }
  .lb-menu { bottom: calc(max(2.5vh, var(--sb)) + 100px); }
}

/* ---- создание ---- */
.lb-clscol { position: absolute; top: 58px; bottom: var(--sb); left: var(--sl); width: clamp(146px, 21vw, 190px); display: flex; flex-direction: column; justify-content: center; gap: 6px; z-index: 2; }
.lb-cls {
  min-height: 52px; display: flex; align-items: center; gap: 8px; padding: 4px 8px; text-align: left; cursor: pointer; color: inherit; font: inherit;
  border-radius: 3px; border: 1px solid #3e301a; border-left: 3px solid var(--cc);
  background: linear-gradient(90deg, rgba(0,0,0,0.75), rgba(0,0,0,0.45)); box-shadow: 0 0 0 1px #000; transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.lb-cls.sel { border-color: var(--gold); border-left-color: var(--cc); transform: translateX(4px); background: linear-gradient(90deg, rgba(232,198,106,0.24), rgba(0,0,0,0.5)); box-shadow: 0 0 0 1px #000, 0 0 14px rgba(232,198,106,0.3); }
.lb-cls-ic { flex: none; font-size: 20px; width: 26px; text-align: center; filter: drop-shadow(0 1px 2px #000); }
.lb-cls-t { display: flex; flex-direction: column; min-width: 0; }
.lb-cls-t b { font: 700 13px/1.2 var(--serif); color: #fff0cc; white-space: nowrap; }
.lb-cls.sel .lb-cls-t b { color: #ffe39a; }
.lb-cls-t small { font-size: 11px; color: #a8987a; white-space: nowrap; }
.lb-clsinfo { position: absolute; top: 58px; max-height: calc(var(--app-h, 100vh) - 58px - var(--sb) - 66px); right: var(--sr); width: clamp(190px, 31vw, 300px); padding: 8px 11px; overflow-y: auto; z-index: 2; border-top: 2px solid var(--cc); touch-action: pan-y; overscroll-behavior: contain; }
.lb-ci-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.lb-ci-head b { font: 700 18px var(--serif); color: #ffe39a; text-shadow: 0 1px 2px #000; }
.lb-ci-head em { font-size: 11px; font-style: normal; color: #2a1a05; background: var(--cc); padding: 2px 6px; border-radius: 2px; filter: brightness(1.4); }
.lb-ci-role { margin: 4px 0 6px; font-size: 12px; line-height: 1.35; color: #d8c8a4; }
.lb-ci-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; }
.lb-ci-bar { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: #bba98a; }
.lb-ci-bar i { display: block; height: 5px; background: rgba(0,0,0,0.6); box-shadow: 0 0 0 1px #2a2014; border-radius: 2px; overflow: hidden; }
.lb-ci-bar s { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-d), var(--gold)); box-shadow: 0 0 6px rgba(232,198,106,0.6); }
.lb-ci-cap { margin-top: 7px; font: 700 11px sans-serif; color: #a8987a; text-transform: uppercase; letter-spacing: 0.1em; }
.lb-ci-sk { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.lb-sk { width: 34px; height: 34px; } .lb-sk canvas { width: 100%; height: 100%; display: block; }
.lb-namebar { left: calc(var(--sl) + clamp(146px, 21vw, 190px) + 12px); }
.lb-field { position: relative; flex: 1 1 auto; min-width: 0; max-width: 360px; margin-left: auto; display: flex; align-items: flex-end; }
.lb-nhint { position: absolute; left: 4px; top: -16px; font-size: 11px; color: #e2cfa4; text-shadow: 0 1px 2px #000, 0 0 4px #000; white-space: nowrap; }
.lb-namebar .lb-input { height: 52px; }
.lb-namebar .lb-big { height: 52px; align-self: flex-end; }
.lb-namebar { align-items: flex-end; }

/* ---- сообщения и диалог ---- */
#login.lobby #err {
  position: absolute; z-index: 20; top: 58px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 40px); margin: 0; min-height: 0;
  padding: 0; font-size: 13px; text-align: center; cursor: pointer;
}
#login.lobby #err.err, #login.lobby #err.info { padding: 8px 14px; border-radius: 3px; box-shadow: 0 0 0 1px #000, 0 6px 18px rgba(0,0,0,0.6); }
#login.lobby #err.err { color: #ffe0d8; border: 1px solid #c0483a; background: rgba(60,12,8,0.94); }
#login.lobby #err.info { color: #fff0cc; border: 1px solid var(--edge); background: rgba(20,16,12,0.94); }
.lb-modal { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 8px var(--sr) 8px var(--sl); background: rgba(0,0,0,0.65); }
.lb-dlg { width: min(420px, 100%); max-height: calc(var(--app-h, 100vh) - 16px); overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.lb-dq { font: 700 16px var(--serif); color: #ffe39a; }
.lb-dlg p { margin: 0; font-size: 12px; line-height: 1.35; color: #d8c8a4; }
.lb-dlg .lb-acts { justify-content: flex-end; }
#login.busy .lb-screen.on { filter: saturate(0.7); }

/* ---- загрузка мира ---- */
#lb-load {
  position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: radial-gradient(ellipse 70% 60% at 50% 45%, rgba(120,70,20,0.35), transparent 70%), radial-gradient(ellipse at 50% 120%, rgba(110,20,10,0.5), transparent 60%), #07050a;
  transition: opacity 0.45s; color: #efe4cc; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#lb-load.out { opacity: 0; pointer-events: none; }
.lb-ld-box { width: min(520px, 100%); text-align: center; }
.lb-ld-logo {
  font: 700 clamp(30px, 11vh, 52px) / 1.1 "Palatino Linotype", Palatino, Georgia, serif; letter-spacing: 0.16em; text-transform: uppercase;
  background: linear-gradient(#fffbe6 8%, #f6d887 38%, #a8741e 52%, #ffe7a0 72%, #c8922e 94%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #2a1604) drop-shadow(0 0 16px rgba(255,170,50,0.45));
}
.lb-ld-who { margin: 2px 0 12px; font: italic 13px Georgia, serif; color: #e2cfa4; letter-spacing: 0.08em; }
.lb-ld-bar { height: 12px; border-radius: 2px; padding: 2px; background: #0a0806; border: 1px solid #6a5128; box-shadow: 0 0 0 1px #000, inset 0 2px 4px #000; }
.lb-ld-bar i {
  display: block; height: 100%; width: 0; border-radius: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5) 50%, transparent) 0 0 / 60px 100% repeat-x, linear-gradient(#ffe7a0, #c8922e 60%, #8a5e1a);
  box-shadow: 0 0 10px rgba(255,190,80,0.6); animation: lbSheen 1.2s linear infinite;
}
@keyframes lbSheen { to { background-position: 60px 0, 0 0; } }
.lb-ld-stage { margin-top: 8px; font-size: 12px; color: #d8c8a4; }
.lb-ld-tip { margin-top: 10px; font-size: 12px; color: #a8987a; font-style: italic; }

/* ---- низкие экраны (браузер с панелями) ---- */
@media (max-height: 300px) {
  .lb-top { height: 48px; top: 2px; }
  .lb-ttl { font-size: 13px; letter-spacing: 0.16em; padding: 0 18px; }
  .lb-srvbody, .lb-clscol, .lb-clsinfo { top: 54px; }
  .lb-logo { top: 10%; }
  .lb-logo p { font-size: 11px; }
  .lb-tap { bottom: calc(16% + var(--sb)); font-size: 13px; }
  .lb-bar { height: 54px; }
  .lb-clsinfo { max-height: calc(var(--app-h, 100vh) - 54px - var(--sb) - 60px); }
  .lb-namebar .lb-input, .lb-namebar .lb-big { height: 50px; }
  .lb-cname { font-size: 15px; }
  .lb-ci-role { font-size: 11px; }
  .lb-cls { min-height: 48px; }
  .lb-clsinfo { -webkit-mask-image: linear-gradient(#000 82%, transparent); mask-image: linear-gradient(#000 82%, transparent); padding-bottom: 18px; }
  .lb-ci-role { margin: 2px 0 4px; }
}
@media (max-width: 700px) {
  .lb-srv-top b { font-size: 14px; }
  .lb-srv-top .lb-tag { font-size: 11px; padding: 2px 4px; }
  .lb-load { display: none; }
  .lb-srvinfo { flex: 0 0 186px; min-width: 186px; }
  #lb-srv-go { font-size: 13px; letter-spacing: 0.05em; padding: 0 8px; min-width: 0; }
  .lb-si-head b { font-size: 17px; }
  .lb-srv .lb-emb { width: 30px; height: 36px; font-size: 13px; }
  .lb-hc { min-width: 40px; padding: 2px 4px; }
  .lb-srv { gap: 3px 8px; }
}
@media (max-width: 600px) {
  .lb-cls-t b { font-size: 12px; }
  .lb-cls { padding: 4px 6px; gap: 5px; }
  .lb-ttl { display: none; }
  .lb-big { min-width: 104px; font-size: 15px; }
}

/* ---- книжная ориентация: создание героя — классы рядом сверху, описание под ними, герой посередине ---- */
@media (orientation: portrait) {
  .lb-clscol { right: var(--sr); width: auto; bottom: auto; height: 52px; flex-direction: row; justify-content: stretch; }
  .lb-cls { flex: 1 1 0; min-width: 0; padding: 4px 6px; }
  .lb-cls.sel { transform: none; }
  .lb-cls-ic { display: none; }
  .lb-cls-t b { font-size: 11px; white-space: normal; line-height: 1.1; }
  .lb-clsinfo { top: 116px; left: var(--sl); width: auto; max-height: 30vh; }
  .lb-namebar { left: var(--sl); }
}

/* Создание героя на низком экране (568×258, 667×260): описание класса и «Умения» видны целиком, без обрезки маской —
   панель шире, роль короче по высоте, умения строкой с подписью слева */
@media (max-height: 300px) and (orientation: landscape) {
  .lb-clsinfo { width: clamp(200px, 38vw, 300px); padding: 5px 9px 6px; -webkit-mask-image: none; mask-image: none; }
  .lb-ci-head { flex-wrap: nowrap; }
  .lb-ci-head b { font-size: 14.5px; white-space: nowrap; }
  .lb-ci-head em { flex: none; padding: 1px 4px; white-space: nowrap; }
  .lb-ci-role { margin: 2px 0 3px; font-size: 11px; line-height: 1.25; }
  .lb-ci-bars { gap: 1px 8px; }
  .lb-ci-bar { flex-direction: row; align-items: center; gap: 4px; line-height: 13px; }
  .lb-ci-bar span { flex: none; width: 58px; }
  .lb-ci-bar i { flex: 1 1 auto; height: 4px; }
  .lb-ci-cap { display: inline-block; margin: 4px 5px 0 0; vertical-align: middle; letter-spacing: 0; }
  .lb-ci-sk { display: inline-flex; flex-wrap: nowrap; gap: 3px; margin-top: 4px; vertical-align: middle; }
  .lb-sk { width: 20px; height: 20px; }
  .lb-clsinfo { top: 50px; max-height: calc(var(--app-h, 100vh) - 50px - var(--sb) - 58px); }
}
