/* Рубеж — интерфейс. Палитра: пепел, оружейный металл, кость, сигнальный жёлтый, ржавчина, мох. */
:root {
  --ash: #8d948f;
  --gun: #262c30;
  --gun-a: rgba(33, 38, 42, .94);
  --steel: #3a4248;
  --steel-2: #4b555c;
  --bone: #e8e2d4;
  --bone-dim: #aea899;
  --hazard: #e0a526;
  --hazard-dk: #8a5f0e;
  --rust: #b24a2d;
  --moss: #7f9c55;
  --display: 'Russo One', 'Arial Black', 'Segoe UI', sans-serif;
  --body: 'PT Sans', 'Segoe UI', Roboto, Arial, sans-serif;
  --narrow: 'PT Sans Narrow', 'Arial Narrow', 'PT Sans', sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #3b4145; color: var(--bone); font: 16px/1.4 var(--body); -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--hazard); outline-offset: 2px; }
img { display: block; }
[hidden] { display: none !important; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.lbl { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); white-space: nowrap; pointer-events: none; will-change: transform; }

/* ---------- ярлыки над объектами ---------- */
.b-lbl { font: 700 13px/1 var(--narrow); background: var(--gun-a); padding: 4px 7px 4px 4px; border-left: 3px solid var(--hazard); display: flex; gap: 6px; align-items: center; }
.b-lbl b { font: 12px/1 var(--display); background: var(--hazard); color: var(--gun); padding: 3px 5px; }
.b-lbl.empty { border-left-color: var(--bone-dim); color: var(--bone-dim); }
.b-lbl.busy { border-left-color: var(--moss); }
.b-lbl .prog { display: block; width: 46px; height: 4px; background: var(--steel); }
.b-lbl .prog i { display: block; height: 100%; background: var(--moss); }
.t-lbl { font: 12px/1 var(--display); padding: 3px 5px; background: var(--rust); color: var(--bone); }
.t-lbl.lair { background: #5b1e1a; outline: 1px solid var(--rust); }
.t-lbl.easy { background: #4f6b35; }
.u-lbl { width: 70px; text-align: center; font: 700 11px/1.1 var(--narrow); text-shadow: 0 1px 2px #000; }
.u-lbl .hp { height: 5px; background: rgba(0,0,0,.6); margin-top: 2px; }
.u-lbl .hp i { display: block; height: 100%; background: var(--moss); transition: width .2s; }
.u-lbl.enemy .hp i { background: var(--rust); }
.u-lbl .cnt { font: 11px/1 var(--display); color: var(--hazard); }
.dmg { font: 18px/1 var(--display); color: #ff7a5c; text-shadow: 0 2px 0 #2a0d08, 0 0 6px #000; animation: rise 1s ease-out forwards; }
.dmg.crit { font-size: 25px; color: var(--hazard); }
.dmg.heal { color: #b6e27f; }
.dmg.info { font-size: 14px; color: var(--bone); }
.skill-name { font: 15px/1 var(--display); color: var(--gun); background: var(--hazard); padding: 5px 9px; animation: rise 1.3s ease-out forwards; }
@keyframes rise { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -46px; } }

/* ---------- верхняя панель: ресурсы как штампованные жетоны ---------- */
#hud { position: fixed; top: calc(8px + var(--safe-t)); left: 8px; right: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; pointer-events: none; }
#res-tags { display: flex; flex-wrap: wrap; gap: 6px; pointer-events: auto; }
.tag { position: relative; display: flex; align-items: center; gap: 6px; min-width: 104px; padding: 5px 12px 5px 6px;
  background: linear-gradient(#59636a, #3d464c); border: 1px solid #1d2225; border-radius: 3px 14px 3px 3px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 2px 0 #1a1e21; }
.tag::after { content: ''; position: absolute; right: 5px; top: 5px; width: 5px; height: 5px; border-radius: 50%; background: #262c30; box-shadow: inset 0 1px 1px #000; }
.tag img { width: 24px; height: 24px; }
.tag .v { font: 15px/1 var(--display); letter-spacing: .02em; }
.tag .r { font: 11px/1 var(--narrow); color: var(--bone-dim); margin-top: 2px; }
.tag.full .v { color: var(--hazard); }
.tag.energy { min-width: 88px; }
#hud-right { margin-left: auto; display: flex; gap: 6px; pointer-events: auto; }
#power-tag { font: 14px/1 var(--display); background: var(--gun-a); padding: 9px 10px; border-bottom: 2px solid var(--hazard); }
#power-tag::before { content: 'Мощь '; font: 700 12px/1 var(--narrow); color: var(--bone-dim); }
.icon-btn { background: var(--gun-a); border: 0; width: 38px; height: 36px; display: grid; place-items: center; padding: 0; }
.icon-btn img { width: 22px; height: 22px; }
.icon-btn.off { opacity: .45; }
#queues { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: auto; }
.qchip { font: 700 13px/1 var(--narrow); background: var(--gun-a); padding: 6px 8px; border-left: 3px solid var(--moss); display: flex; gap: 8px; align-items: center; }
.qchip time { font-family: var(--display); font-size: 12px; color: var(--hazard); }

/* ---------- нижняя навигация ---------- */
#nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(8px + var(--safe-b)); display: flex; background: var(--gun-a); border-top: 2px solid var(--steel-2); }
#nav button { background: none; border: 0; padding: 7px 14px 6px; display: grid; justify-items: center; gap: 2px; font: 700 12px/1 var(--narrow); color: var(--bone-dim); }
#nav button img { width: 26px; height: 26px; opacity: .7; }
#nav button.active { color: var(--bone); box-shadow: inset 0 3px 0 var(--hazard); }
#nav button.active img { opacity: 1; }

/* ---------- задание ---------- */
#quest { position: fixed; left: 8px; bottom: calc(76px + var(--safe-b)); max-width: 320px; background: var(--gun-a); padding: 8px 10px; display: flex; gap: 10px; align-items: center; border-left: 3px solid var(--bone-dim); }
#quest.done { border-left-color: var(--hazard); }
#quest img { width: 28px; height: 28px; }
#quest .qt { font: 700 14px/1.2 var(--narrow); }
#quest .qr { font-size: 12px; color: var(--bone-dim); }

/* ---------- боковая панель ---------- */
#panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100%); background: var(--gun-a); overflow-y: auto; padding: calc(16px + var(--safe-t)) 18px calc(90px + var(--safe-b));
  border-left: 1px solid #14181a; box-shadow: -8px 0 24px rgba(0,0,0,.35); overscroll-behavior: contain; }
#panel-close { position: sticky; top: 0; float: right; margin: -4px -6px 0 0; font-size: 18px; z-index: 2; }
#panel h2 { font: 24px/1.1 var(--display); margin: 0 0 4px; letter-spacing: .01em; }
#panel h3 { font: 15px/1.2 var(--display); margin: 20px 0 8px; color: var(--bone-dim); }
#panel p { margin: 6px 0; max-width: 60ch; }
.sub { color: var(--bone-dim); font-size: 14px; }
.lvl-big { font: 13px/1 var(--display); background: var(--hazard); color: var(--gun); padding: 3px 6px; display: inline-block; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 15px; margin: 8px 0; }
.kv dt { color: var(--bone-dim); }
.kv dd { margin: 0; font-weight: 700; text-align: right; }
.kv dd .up { color: var(--moss); }
.cost { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 10px 0; }
.cost span { display: flex; align-items: center; gap: 4px; font-weight: 700; }
.cost img { width: 18px; height: 18px; }
.cost .lack { color: #ff8f73; }
.cost time { color: var(--bone-dim); font-weight: 400; }
.btn { border: 0; padding: 11px 16px; font: 16px/1 var(--display); background: var(--steel-2); color: var(--bone); letter-spacing: .02em; }
.btn.primary { background: var(--hazard); color: #1f1a0e; box-shadow: 0 3px 0 var(--hazard-dk); }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--hazard-dk); }
.btn.danger { background: var(--rust); }
.btn:disabled { background: var(--steel); color: #7f8589; box-shadow: none; cursor: not-allowed; }
.btn.wide { width: 100%; }
.btn.small { padding: 7px 10px; font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; }
.note { font-size: 13px; color: var(--bone-dim); }
.warn { color: #ffb199; font-size: 14px; }
.progress { height: 8px; background: var(--steel); margin: 8px 0; }
.progress i { display: block; height: 100%; background: var(--moss); }

/* карточки бойцов, героев */
.unit-card { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--steel); }
.unit-card img { width: 44px; height: 44px; }
.unit-card .nm { font: 700 16px/1.1 var(--narrow); }
.unit-card .ds { font-size: 13px; color: var(--bone-dim); }
.pill { font: 11px/1 var(--display); padding: 3px 5px; background: var(--steel-2); }
.pill.R { background: #5b6368; } .pill.SR { background: #3f6b8c; } .pill.SSR { background: var(--hazard); color: var(--gun); }
.stars { color: var(--hazard); letter-spacing: 1px; font-size: 13px; }
.slider { width: 100%; accent-color: var(--hazard); margin: 10px 0 4px; }
.seg { display: flex; margin: 8px 0; }
.seg button { flex: 1; background: var(--steel); border: 0; padding: 9px 4px; font: 700 14px/1 var(--narrow); }
.seg button.on { background: var(--bone); color: var(--gun); }

.squad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 8px 0 4px; }
.slot { aspect-ratio: 3/4; background: #1c2124; border: 1px dashed var(--steel-2); display: grid; place-items: center; padding: 0; position: relative; overflow: hidden; }
.slot img { width: 100%; height: 100%; object-fit: cover; }
.slot .sl { position: absolute; bottom: 0; left: 0; right: 0; font: 700 11px/1.2 var(--narrow); background: rgba(20,24,26,.85); padding: 2px; text-align: center; }
.slot.sel { outline: 2px solid var(--hazard); }
.slot .plus { font: 22px/1 var(--display); color: var(--steel-2); }
.hero-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.hcard { background: #1c2124; border: 0; padding: 0 0 6px; text-align: left; position: relative; }
.hcard img { width: 100%; aspect-ratio: 1; }
.hcard .n { font: 700 13px/1.15 var(--narrow); padding: 4px 6px 0; }
.hcard .m { font-size: 12px; color: var(--bone-dim); padding: 0 6px; display: flex; justify-content: space-between; }
.hcard .pill { position: absolute; top: 4px; left: 4px; }
.hcard.in { outline: 2px solid var(--moss); }
.hero-top { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: start; }
.hero-top img { width: 120px; height: 120px; }
.skill { background: #1c2124; padding: 10px 12px; border-left: 3px solid var(--hazard); margin: 10px 0; }
.skill b { font-family: var(--display); font-weight: 400; }
.lb { width: 100%; border-collapse: collapse; }
.lb td { padding: 8px 4px; border-bottom: 1px solid var(--steel); }
.lb td:first-child { font-family: var(--display); color: var(--bone-dim); width: 40px; }
.lb td:last-child { text-align: right; font-weight: 700; }
.lb tr.me td { color: var(--hazard); }
.chance { font: 18px/1 var(--display); padding: 6px 10px; display: inline-block; }
.chance.hi { background: #4f6b35; } .chance.mid { background: var(--hazard); color: var(--gun); } .chance.lo { background: var(--rust); }

/* ---------- бой ---------- */
#battle-ui { position: fixed; top: calc(10px + var(--safe-t)); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
#battle-title { font: 20px/1 var(--display); background: var(--gun-a); padding: 8px 14px; }
#battle-controls { display: flex; gap: 4px; pointer-events: auto; }
#battle-controls button { border: 0; background: var(--gun-a); padding: 8px 12px; font: 14px/1 var(--display); }
#battle-controls button.active { background: var(--bone); color: var(--gun); }

/* ---------- модальное окно, тосты ---------- */
#modal { position: fixed; inset: 0; background: rgba(15, 18, 20, .72); display: grid; place-items: center; padding: 16px; z-index: 20; }
#modal-box { background: var(--gun); width: min(440px, 100%); max-height: 90vh; overflow-y: auto; padding: 22px; border-top: 4px solid var(--hazard); }
#modal-box.defeat { border-top-color: var(--rust); }
#modal-box h2 { font: 30px/1 var(--display); margin: 0 0 10px; }
.recruit-card { text-align: center; }
.recruit-card img { width: 180px; height: 180px; margin: 0 auto 10px; animation: reveal .6s ease-out; }
@keyframes reveal { from { transform: scale(.6) rotate(-4deg); opacity: 0; } to { transform: none; opacity: 1; } }
#toasts { position: fixed; top: calc(110px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: grid; gap: 6px; z-index: 30; pointer-events: none; width: min(420px, 92vw); }
.toast { background: var(--gun); padding: 10px 14px; border-left: 4px solid var(--moss); font-weight: 700; box-shadow: 0 6px 18px rgba(0,0,0,.4); animation: tin .25s ease-out; }
.toast.err { border-left-color: var(--rust); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- вход, загрузка ---------- */
#auth { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: linear-gradient(180deg, rgba(38,44,48,.35), rgba(38,44,48,.9)); z-index: 40; }
.auth-box { width: min(380px, 100%); background: var(--gun); padding: 26px 24px; border-top: 4px solid var(--hazard); }
.auth-box h1 { font: 44px/1 var(--display); margin: 0; letter-spacing: .03em; }
.auth-sub { color: var(--bone-dim); margin: 8px 0 18px; }
.auth-tabs { display: flex; margin-bottom: 14px; }
.auth-tabs button { flex: 1; background: var(--steel); border: 0; padding: 10px; font: 700 15px/1 var(--narrow); }
.auth-tabs button.active { background: var(--bone); color: var(--gun); }
#auth-form label { display: grid; gap: 4px; font: 700 14px/1 var(--narrow); color: var(--bone-dim); margin-bottom: 12px; }
#auth-form input { background: #1a1e21; border: 1px solid var(--steel-2); color: var(--bone); padding: 11px; font: 16px var(--body); }
#auth-form .btn { width: 100%; margin-top: 4px; }
#auth-error { color: #ff8f73; min-height: 1.4em; margin: 10px 0 0; }
#loading { position: fixed; inset: 0; background: var(--gun); display: grid; place-items: center; z-index: 50; transition: opacity .4s; }
#loading.gone { opacity: 0; pointer-events: none; }
.load-inner { width: min(300px, 80vw); text-align: center; }
.load-inner h2 { font: 40px/1 var(--display); margin: 0 0 18px; }
.bar { height: 6px; background: var(--steel); }
.bar i { display: block; height: 100%; width: 0; background: var(--hazard); transition: width .2s; }
#load-text { color: var(--bone-dim); font-size: 14px; }

/* ---------- мобильные ---------- */
@media (max-width: 700px) {
  .tag { min-width: 0; padding: 4px 9px 4px 4px; }
  .tag img { width: 20px; height: 20px; }
  .tag .v { font-size: 13px; }
  .tag .r { display: none; }
  #power-tag { padding: 8px; font-size: 12px; }
  #power-tag::before { content: ''; }
  #panel { top: auto; width: 100%; max-height: 68vh; border-left: 0; border-top: 3px solid var(--steel-2); padding-bottom: calc(84px + var(--safe-b)); }
  #nav { left: 0; right: 0; transform: none; bottom: 0; padding-bottom: var(--safe-b); justify-content: space-around; }
  #nav button { padding: 7px 4px 6px; flex: 1; }
  #quest { bottom: calc(66px + var(--safe-b)); right: 8px; max-width: none; }
  .hero-top { grid-template-columns: 90px 1fr; } .hero-top img { width: 90px; height: 90px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- пакет 2 ---------- */
.icon-btn { position: relative; }
.badge { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--rust); color: var(--bone); font: 700 11px/16px var(--narrow); font-style: normal; text-align: center; }
.badge.dot { min-width: 10px; width: 10px; height: 10px; padding: 0; }
.qchip.def { border-left-color: var(--rust); }
.card-img { width: 100%; max-width: 300px; display: block; margin: 8px auto 12px; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.recruit-card img.card-img { width: 240px; height: auto; }
.items { display: grid; gap: 6px; }
.item { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; background: #1c2124; padding: 8px 10px; border-left: 4px solid #6c7479; text-align: left; border-top: 0; border-right: 0; border-bottom: 0; width: 100%; }
.item img { width: 36px; height: 36px; }
.item .nm { font: 700 15px/1.15 var(--narrow); }
.item .st { font-size: 13px; color: var(--bone-dim); }
.item.C { border-left-color: #7a8388; } .item.U { border-left-color: var(--moss); } .item.E { border-left-color: #4f8fc4; } .item.L { border-left-color: var(--hazard); }
.item.C .nm { color: var(--bone); } .item.U .nm { color: #a9cf7c; } .item.E .nm { color: #8cc3f0; } .item.L .nm { color: var(--hazard); }
.eq-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.eq-slot { background: #1c2124; border: 1px dashed var(--steel-2); padding: 8px 6px; text-align: center; min-height: 92px; display: grid; justify-items: center; align-content: start; gap: 4px; font: 700 12px/1.15 var(--narrow); color: var(--bone-dim); }
.eq-slot img { width: 32px; height: 32px; opacity: .5; }
.eq-slot.on { border-style: solid; color: var(--bone); } .eq-slot.on img { opacity: 1; }
.eq-slot.C { border-color: #7a8388; } .eq-slot.U { border-color: var(--moss); } .eq-slot.E { border-color: #4f8fc4; } .eq-slot.L { border-color: var(--hazard); }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 10px 0; }
.day { background: #1c2124; padding: 8px 2px; text-align: center; font: 700 12px/1.2 var(--narrow); color: var(--bone-dim); }
.day b { display: block; font: 16px/1 var(--display); color: var(--bone); margin-bottom: 4px; }
.day.today { outline: 2px solid var(--hazard); color: var(--bone); } .day.past { opacity: .45; }
.task { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--steel); }
.task .progress { grid-column: 1 / -1; margin: 2px 0 0; height: 5px; }
.task.done .t { color: var(--moss); }
.chests { display: flex; gap: 8px; margin: 10px 0; }
.chest { flex: 1; background: #1c2124; padding: 8px; text-align: center; border: 0; }
.chest img { width: 34px; height: 34px; margin: 0 auto 4px; }
.chest.open { opacity: .45; } .chest.ready { outline: 2px solid var(--hazard); }
.mail-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 4px; border-bottom: 1px solid var(--steel); background: none; border-top: 0; border-left: 0; border-right: 0; width: 100%; text-align: left; }
.mail-item .ti { font: 400 15px/1.2 var(--narrow); } .mail-item.new .ti { font-weight: 700; color: var(--bone); }
.mail-item.new .ti::before { content: '● '; color: var(--hazard); }
.mail-item time { font-size: 12px; color: var(--bone-dim); }
.mail-item .ex { grid-column: 1 / -1; font-size: 13px; color: var(--bone-dim); }
#tut { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
#tut-ring { position: fixed; width: 60px; height: 60px; border: 3px solid var(--hazard); border-radius: 50%; box-shadow: 0 0 0 4px rgba(224,165,38,.25), 0 0 24px rgba(224,165,38,.6); transform: translate(-50%, -50%); animation: tpulse 1.2s ease-in-out infinite; display: none; }
@keyframes tpulse { 50% { transform: translate(-50%, -50%) scale(1.18); } }
#tut-bubble { position: fixed; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translateX(-50%); width: min(420px, 92vw); background: var(--gun); border-left: 4px solid var(--hazard); padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); pointer-events: auto; }
#tut-bubble p { margin: 0 0 10px; font-size: 15px; }

/* ---------- крышки, ВИП, магазин ---------- */
.tag.caps .v { color: #ffb08f; }
.vip-tag { font: 12px/1 var(--display); background: var(--hazard); color: var(--gun); padding: 3px 5px; margin-left: 4px; }
.crews { display: flex; gap: 8px; margin: 10px 0; }
.crew { flex: 1; background: #1c2124; padding: 10px 6px; text-align: center; font: 700 13px/1.2 var(--narrow); color: var(--bone-dim); border-top: 3px solid var(--steel-2); }
.crew img { width: 34px; height: 34px; margin: 0 auto 4px; opacity: .35; }
.crew.on { color: var(--bone); border-top-color: var(--moss); } .crew.on img { opacity: 1; }
.crew.vip { border-top-color: var(--hazard); }
.plans { display: grid; gap: 8px; margin: 10px 0; }
.plan { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; background: #1c2124; padding: 10px 12px; }
.plan b { font: 16px/1 var(--display); }
.pack { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; background: #1c2124; padding: 10px; margin-bottom: 6px; }
.pack img { width: 40px; height: 40px; }
.pack .bonus { color: var(--moss); font-size: 13px; }

/* ---------- задания, сюжет, звёзды ---------- */
#quest { display: none !important; }
.qrow { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--steel); }
.qrow .t { font: 700 15px/1.2 var(--narrow); } .qrow.done .t { color: var(--moss); } .qrow.done .t::before { content: '✓ '; }
.story-line { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: start; margin: 8px 0; }
.story-line img { width: 52px; height: 52px; border: 2px solid var(--steel-2); }
.story-line p { margin: 0; background: #1c2124; padding: 8px 10px; border-left: 3px solid var(--hazard); font-size: 15px; }
.story-line b { display: block; font: 12px/1.2 var(--display); color: var(--hazard); margin-bottom: 3px; }
.chapter { font: 13px/1 var(--display); color: var(--bone-dim); letter-spacing: .04em; }
.st { letter-spacing: 1px; font-size: 14px; } .st i { font-style: normal; opacity: .25; }
.summon-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0; }
.summon-grid div { text-align: center; font: 700 11px/1.15 var(--narrow); }
.summon-grid img { width: 100%; aspect-ratio: 1; border-bottom: 3px solid #5b6368; }
.summon-grid .SR img { border-color: #3f6b8c; } .summon-grid .SSR img { border-color: var(--hazard); }
.coupon-line { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-weight: 700; }

/* ---------- бой: полосы здоровья и числа ---------- */
.u-lbl { width: 86px; font: 700 11px/1.1 var(--narrow); text-shadow: 0 1px 2px #000, 0 0 4px #000; letter-spacing: .02em; }
.u-lbl .hp { height: 7px; background: rgba(10,12,14,.85); margin-top: 3px; border: 1px solid rgba(232,226,212,.35); box-shadow: 0 1px 3px rgba(0,0,0,.6); position: relative; overflow: hidden; }
.u-lbl .hp i { background: linear-gradient(#a8cf6f, #5e7f39); }
.u-lbl.enemy .hp i { background: linear-gradient(#e0694a, #8f2a18); }
.u-lbl .hp::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(0,0,0,.35) 9px 10px); }
.u-lbl .cnt { background: rgba(10,12,14,.8); padding: 1px 4px; margin-left: 2px; }
.dmg { font-size: 20px; -webkit-text-stroke: 1px #1a0a06; animation: rise 1s cubic-bezier(.2,.8,.3,1) forwards; }
.dmg.crit { font-size: 28px; animation: crit 1.1s ease-out forwards; }
@keyframes crit { 0% { opacity: 1; font-size: 42px; margin-top: 0; } 18% { font-size: 28px; } 100% { opacity: 0; font-size: 28px; margin-top: -50px; } }
.skill-name { font-size: 16px; padding: 6px 12px; box-shadow: 0 4px 14px rgba(0,0,0,.5); border-left: 4px solid #fff3c4; }
#battle-title { border-bottom: 2px solid var(--rust); letter-spacing: .03em; }
/* ---------- мировая карта: подписи поселений ---------- */
.c-lbl { font: 700 13px/1 var(--narrow); padding: 5px 8px; background: rgba(20,24,26,.9); border-bottom: 3px solid #c0503a; color: var(--bone); white-space: nowrap; box-shadow: 0 3px 10px rgba(0,0,0,.5); }
.c-lbl b { font-family: var(--display); font-weight: 400; color: #ffb49f; }
.c-lbl span { margin-left: 6px; font: 11px/1 var(--display); color: var(--bone-dim); }
.c-lbl.me { border-bottom-color: var(--hazard); } .c-lbl.me b { color: var(--hazard); }
.c-lbl.ally { border-bottom-color: #5aa0e0; } .c-lbl.ally b { color: #9ccaf2; }
.t-lbl { opacity: .92; }

/* ---------- чат (всегда онлайн, окна поверх него) ---------- */
#chat { position: fixed; left: 8px; bottom: calc(66px + var(--safe-b)); width: min(360px, 60vw); z-index: 5; background: rgba(24,28,31,.9); border-top: 2px solid var(--steel-2); font-size: 14px; }
#chat-head { display: flex; align-items: center; gap: 4px; padding: 4px 6px; }
#chat-head button { background: none; border: 0; color: var(--bone-dim); font: 700 12px/1 var(--narrow); padding: 4px 6px; }
#chat-head button.on { color: var(--bone); box-shadow: inset 0 -2px 0 var(--hazard); }
#chat-last { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--bone-dim); font-size: 12px; }
#chat-body { display: none; } #chat.open #chat-body { display: block; }
#chat-log { height: 190px; overflow-y: auto; padding: 4px 8px; }
#chat-log p { margin: 3px 0; line-height: 1.3; } #chat-log b { color: var(--hazard); } #chat-log i { color: #9ccaf2; font-style: normal; }
#chat-form { display: flex; gap: 4px; padding: 6px; } #chat-in { flex: 1; background: #1a1e21; border: 1px solid var(--steel-2); color: var(--bone); padding: 7px; font: 14px var(--body); }
#panel, #modal, #tut, #toasts { z-index: 20; } #panel { z-index: 15; }
@media (max-width: 700px) { #chat { bottom: calc(60px + var(--safe-b)); width: calc(100vw - 16px); } #chat-log { height: 150px; } }
#armies { position: fixed; right: 8px; bottom: calc(76px + var(--safe-b)); display: grid; gap: 4px; z-index: 4; }
#armies button { background: rgba(24,28,31,.9); border: 0; border-left: 3px solid var(--steel-2); color: var(--bone); font: 700 12px/1.2 var(--narrow); padding: 6px 8px; text-align: left; min-width: 150px; }
#armies button.sel { border-left-color: var(--hazard); } #armies button span { display: block; color: var(--bone-dim); font-weight: 400; }
.a-lbl { font: 700 11px/1 var(--narrow); padding: 3px 6px; background: rgba(20,24,26,.9); border-bottom: 2px solid #c0503a; }
.a-lbl.me { border-bottom-color: var(--hazard); } .a-lbl.ally { border-bottom-color: #5aa0e0; }

/* ---------- бой: панель навыков героев ---------- */
#skillbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b)); display: flex; gap: 6px; pointer-events: none; }
.sk-slot { width: 76px; background: rgba(20,24,26,.9); padding: 4px; text-align: center; border-bottom: 3px solid var(--steel-2); position: relative; }
.sk-slot img { width: 100%; aspect-ratio: 1; display: block; filter: grayscale(.6) brightness(.7); }
.sk-slot.ready img { filter: none; } .sk-slot.ready { border-bottom-color: var(--hazard); box-shadow: 0 0 12px rgba(224,165,38,.45); }
.sk-slot b { display: block; font: 700 10px/1.1 var(--narrow); margin-top: 3px; height: 22px; overflow: hidden; }
.sk-slot .lv { position: absolute; top: 6px; left: 6px; font: 10px/1 var(--display); background: var(--hazard); color: var(--gun); padding: 2px 3px; }
.sk-slot .cdb { height: 4px; background: #111; margin-top: 2px; } .sk-slot .cdb i { display: block; height: 100%; width: 0; background: var(--hazard); }
.sk-slot em { font: 700 10px/1 var(--narrow); font-style: normal; color: var(--bone-dim); }
@media (max-width: 700px) { .sk-slot { width: 58px; } .sk-slot b { display: none; } }

.c-lbl.capital { font-size: 15px; border-bottom-color: #d9b44a; background: rgba(40,30,12,.92); }
.c-lbl.capital span { color: #ffd88a; }

/* ---------- пакет 0: таймеры над зданиями, окно отрядов, настройки, отметки ---------- */
.b-lbl time, .b-job time { margin-left: 6px; font: 12px/1 var(--display); color: var(--hazard); }
.b-job { margin-top: 3px; background: rgba(20,24,26,.88); padding: 3px 7px; font: 700 11px/1.2 var(--narrow); color: var(--bone); border-left: 3px solid var(--moss); white-space: nowrap; }
#armies { left: 8px; right: auto; top: calc(64px + var(--safe-t, 0px)); bottom: auto; gap: 3px; }
#armies .ar-h { font: 12px/1 var(--display); color: var(--bone-dim); padding: 0 2px 2px; }
#armies button { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 7px; align-items: center; min-width: 158px; padding: 4px 8px 4px 4px; }
#armies button img, #armies button i { grid-row: span 2; width: 30px; height: 30px; display: block; background: #333; }
#armies button b { font-size: 12px; } #armies button span { font-size: 11px; }
#armies button.out { border-left-color: var(--moss); }
.tgl { display: flex; align-items: center; gap: 10px; padding: 10px 0; font: 700 16px/1 var(--narrow); border-bottom: 1px solid var(--steel); }
.tgl input { width: 22px; height: 22px; accent-color: var(--hazard); }
.inp { background: #1a1e21; border: 1px solid var(--steel-2); color: var(--bone); padding: 10px; font-size: 15px; }
.updot { position: relative; }
.updot::after { content: ''; position: absolute; top: 3px; right: 3px; width: 11px; height: 11px; border-radius: 50%; background: #e5372b; box-shadow: 0 0 0 2px #1a1e21, 0 0 8px rgba(229,55,43,.8); pointer-events: none; z-index: 2; }

/* ---------- бой: карточки героев внизу и таймер (как на скриншоте) ---------- */
#battle-clock { position: fixed; top: calc(52px + var(--safe-t, 0px)); left: 50%; transform: translateX(-50%); background: rgba(20,24,26,.85); padding: 6px 14px 6px 34px; border-radius: 20px; font: 18px/1 var(--display); color: #fff; }
#battle-clock::before { content: ''; position: absolute; left: 8px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: radial-gradient(circle, #fff 0 30%, transparent 32%), #e0a526; box-shadow: inset 0 0 0 3px #b9861a; }
#skillbar { gap: 8px; bottom: calc(14px + var(--safe-b)); }
.sk-slot { width: 82px; background: none; padding: 0; border: 0; box-shadow: none; text-align: center; }
.sk-slot em { display: block; font: 17px/1.2 var(--display); font-style: normal; color: #fff; text-shadow: 0 2px 3px #000; margin-bottom: 3px; }
.sk-slot.ready em { color: var(--hazard); }
.sk-slot .pf { position: relative; border: 3px solid #8b8f93; border-radius: 6px; overflow: hidden; background: #222; }
.sk-slot.r-SR .pf { border-color: #9a5ad6; } .sk-slot.r-SSR .pf { border-color: #f0a030; } .sk-slot.r-UR .pf { border-color: #ff4a3a; }
.sk-slot .pf img { width: 100%; aspect-ratio: 1; display: block; filter: none; }
.sk-slot .lv { position: absolute; left: 0; right: 0; bottom: 14px; font: 11px/1 var(--display); color: #fff; text-shadow: 0 1px 2px #000; background: none; top: auto; padding: 0; }
.sk-slot .st { position: absolute; left: 0; right: 0; bottom: 1px; font-size: 11px; letter-spacing: -1px; text-shadow: 0 1px 2px #000; }
.sk-slot .hpb { height: 7px; background: #111; margin-top: 4px; border-radius: 3px; overflow: hidden; } .sk-slot .hpb i { display: block; height: 100%; width: 100%; background: linear-gradient(#7fdc4f, #3f9a2b); }
.sk-slot.ready .pf { box-shadow: 0 0 14px rgba(224,165,38,.8); } .sk-slot.dead { opacity: .45; filter: grayscale(1); }
.sk-slot b, .sk-slot .cdb { display: none; }
@media (max-width: 700px) { .sk-slot { width: 62px; } .sk-slot em { font-size: 14px; } }

/* ---------- карта: дальний вид (районы) и подписи ---------- */
.z-lbl { font: 700 13px/1.1 var(--narrow); padding: 5px 10px; border-radius: 14px; background: rgba(20,24,26,.82); color: #fff; white-space: nowrap; border: 2px solid #d8503a; box-shadow: 0 3px 10px rgba(0,0,0,.45); }
.z-lbl b { font-family: var(--display); font-weight: 400; }
.z-lbl.me { border-color: #5fd34a; } .z-lbl.me b { color: #9be87f; }
.z-lbl.other b { color: #ffd36a; } .z-lbl.free { border-color: #8a8f86; }
.z-lbl i, .c-lbl i { font-style: normal; color: var(--bone-dim); font-size: 11px; }

/* ---------- пакет 1: лазарет ---------- */
.pat { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--steel); }
.pat .row { flex-wrap: wrap; gap: 6px; }
.b-job.warn { border-left-color: #e5372b; }
.tag.pop .v { color: #c9e6a8; }

/* нижнее меню: 7 разделов (добавлен «Город») */
#nav button { min-width: 0; flex: 1 1 0; } #nav button span { font-size: 11px; }

/* ---------- пакет 3: оборона башнями ---------- */
#td-hud { position: fixed; top: calc(52px + var(--safe-t, 0px)); left: 50%; transform: translateX(-50%); background: rgba(20,24,26,.88); padding: 7px 14px; display: flex; align-items: center; gap: 10px; font: 700 13px/1 var(--narrow); color: var(--bone); white-space: nowrap; }
#td-hud b { font: 16px/1 var(--display); color: var(--hazard); } #td-hud i { width: 140px; height: 9px; background: #111; display: block; border: 1px solid #555; }
#td-hud u { display: block; height: 100%; background: linear-gradient(#e0a526, #b9861a); text-decoration: none; }
#td-ctl { position: fixed; right: 10px; bottom: calc(16px + var(--safe-b)); display: grid; gap: 6px; }
#td-ctl button { background: rgba(30,80,150,.92); color: #fff; border: 0; border-radius: 8px; padding: 9px 12px; font: 16px/1 var(--display); }
#td-ctl button.on { background: var(--hazard); color: var(--gun); } #td-ctl #td-skip { font: 700 12px/1 var(--narrow); }
.td-slots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.tds { background: #1c2124; border: 2px solid var(--steel-2); padding: 7px 2px; text-align: center; font: 15px/1.1 var(--display); cursor: pointer; }
.tds span { display: block; font: 700 10px/1.1 var(--narrow); color: var(--bone-dim); margin-top: 3px; }
.tds.on { border-color: var(--hazard); } .tds.lock { opacity: .4; cursor: default; }

/* ---------- оборона: кнопки нажимаются (слой боя прозрачен для нажатий), улучшения в бою ---------- */
#td-ctl, #td-up, #td-hud { pointer-events: auto; }
#td-ctl #td-exit { background: #b8302a; font: 700 13px/1 var(--narrow); }
#td-up { position: fixed; left: 10px; bottom: calc(16px + var(--safe-b)); display: grid; gap: 6px; max-width: 46vw; }
#td-up button { display: grid; text-align: left; gap: 3px; background: rgba(20,24,26,.92); color: var(--bone); border: 0; border-left: 4px solid var(--hazard); padding: 7px 10px; }
#td-up button b { font: 700 13px/1.1 var(--narrow); } #td-up button span { font: 11px/1.1 var(--narrow); color: var(--bone-dim); }
#td-up button:disabled { opacity: .45; border-left-color: var(--steel-2); }

/* ---------- пакет 4: шкала энергии на карточках героев, ручной навык ---------- */
#skillbar .sk-slot { pointer-events: auto; }
.sk-slot .enb { height: 6px; background: #1a1a1a; margin-top: 3px; border-radius: 3px; overflow: hidden; }
.sk-slot .en { display: block; height: 100%; width: 0; background: linear-gradient(#ffe066, #e0a526); }
.sk-slot.ready .pf { animation: rdy .8s ease-in-out infinite alternate; }
@keyframes rdy { from { box-shadow: 0 0 6px rgba(255,214,90,.5); } to { box-shadow: 0 0 18px rgba(255,214,90,1); } }
.sk-slot.cast .pf { transform: scale(.92); }
#bt-auto.on { background: var(--hazard); color: var(--gun); }
.set-tag { display: inline-block; font: 700 10px/1 var(--narrow); padding: 2px 5px; margin-left: 4px; border-radius: 3px; background: #2a3238; color: #c9d6e0; }
.pill.UR { background: linear-gradient(90deg, #ff4a3a, #ffb04a); color: #1a0a06; }

/* ---------- пакет 5: деревья исследований ---------- */
.tnode { background: #1c2124; border-left: 3px solid var(--steel-2); padding: 9px 11px; margin: 6px 0; }
.tnode .nm { font: 700 15px/1.2 var(--narrow); } .tnode .nm b { color: var(--hazard); margin-left: 4px; }
.tnode .ds { font-size: 13px; color: var(--bone-dim); margin: 2px 0 4px; }
.tnode.special { border-left-color: var(--hazard); background: #241f15; }
.tnode.locked { opacity: .6; } .tnode.done { border-left-color: var(--moss); }

/* ---------- пакет 6: альянс ---------- */
.hpbar { height: 14px; background: #1a1a1a; border: 1px solid #555; margin: 8px 0 4px; } .hpbar i { display: block; height: 100%; background: linear-gradient(#e0694a, #8f2a18); }

/* ---------- пакет 7 ---------- */
.vipbar { display: flex; align-items: center; gap: 10px; background: #1c2124; padding: 10px 12px; margin: 8px 0; }
.vipbar b { font: 18px/1 var(--display); color: var(--hazard); } .vipbar i { flex: 1; height: 10px; background: #111; display: block; }
.vipbar u { display: block; height: 100%; background: linear-gradient(90deg, #b9861a, #ffd36a); } .vipbar span { font: 700 12px/1 var(--narrow); color: var(--bone-dim); }
.banner { display: grid; grid-template-columns: 96px 1fr; gap: 12px; background: linear-gradient(90deg, #3a2a10, #1c2124); border-left: 4px solid var(--hazard); padding: 10px; margin: 8px 0; }
.banner img { width: 96px; border: 2px solid var(--hazard); }
.qrow.locked { opacity: .5; }

/* ---------- пакет 8: календарь событий ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cd { background: #1c2124; padding: 6px 3px; text-align: center; border-top: 3px solid var(--steel-2); }
.cd b { display: block; font: 13px/1 var(--display); } .cd span { font: 11px/1.2 var(--narrow); color: var(--bone-dim); } .cd i { display: block; font: 700 10px/1.1 var(--narrow); font-style: normal; margin-top: 3px; }
.cd.bloodmoon { border-top-color: #b8302a; } .cd.hunt { border-top-color: var(--hazard); } .cd.heal { border-top-color: #8cc152; } .cd.gather { border-top-color: #4f8fd0; }
.cd.today { outline: 2px solid var(--hazard); }
/* пакет 9: уведомления */
.pu-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; margin: 4px 0 8px; }
.pu-kinds .btn { grid-column: 1 / -1; justify-self: start; margin-top: 8px; }
.tgl.small { font-size: 14px; padding: 7px 0; }
.tgl.small input { width: 18px; height: 18px; }
@media (max-width: 420px) { .pu-kinds { grid-template-columns: 1fr; } }
.chip { display: inline-block; padding: 3px 8px; margin: 2px 4px 2px 0; background: rgba(255,255,255,.07); border: 1px solid var(--steel); border-radius: 3px; font: 700 13px/1.2 var(--narrow); }
.row.wrap { flex-wrap: wrap; }
/* пакет 11: «Назад», цвета отрядов, выбор отряда перед боем */
:root { --sq0: #e0a526; --sq1: #4fa3e0; --sq2: #c45ad6; }
#panel-back { position: sticky; top: 0; float: left; margin: -4px 8px 6px -6px; z-index: 2; width: auto; padding: 0 12px; font: 700 14px/1 var(--narrow); }
.hcard { position: relative; }
.hcard.sq0 { outline: 3px solid var(--sq0); outline-offset: -3px; box-shadow: 0 0 10px rgba(224,165,38,.4); }
.hcard.sq1 { outline: 3px solid var(--sq1); outline-offset: -3px; box-shadow: 0 0 10px rgba(79,163,224,.4); }
.hcard.sq2 { outline: 3px solid var(--sq2); outline-offset: -3px; box-shadow: 0 0 10px rgba(196,90,214,.4); }
.sqb { position: absolute; top: 28px; left: 5px; z-index: 2; width: 20px; height: 20px; border-radius: 50%; color: #111; font: 800 12px/20px var(--narrow); text-align: center; }
.sqb.sq0 { background: var(--sq0); } .sqb.sq1 { background: var(--sq1); } .sqb.sq2 { background: var(--sq2); }
.sqtxt0 { color: var(--sq0); } .sqtxt1 { color: var(--sq1); } .sqtxt2 { color: var(--sq2); }
.sqseg .sqt0.on { background: var(--sq0); color: #111; } .sqseg .sqt1.on { background: var(--sq1); color: #111; } .sqseg .sqt2.on { background: var(--sq2); color: #111; }
.sqseg .sqt0 { border-bottom: 3px solid var(--sq0); } .sqseg .sqt1 { border-bottom: 3px solid var(--sq1); } .sqseg .sqt2 { border-bottom: 3px solid var(--sq2); }
.squad.sqbox0 .slot { border-color: var(--sq0); } .squad.sqbox1 .slot { border-color: var(--sq1); } .squad.sqbox2 .slot { border-color: var(--sq2); }
.sqpick { display: grid; gap: 8px; margin: 10px 0 14px; }
.sqp { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; text-align: left; padding: 10px 12px; background: rgba(255,255,255,.04); border: 2px solid var(--steel); color: inherit; cursor: pointer; }
.sqp b { font: 800 16px/1 var(--narrow); } .sqp span { color: var(--dim, #aaa); font-size: 13px; justify-self: end; }
.sqp .sqh { grid-column: 1 / -1; display: flex; gap: 4px; min-height: 36px; } .sqp .sqh img { width: 36px; height: 36px; object-fit: cover; border-radius: 3px; }
.sqp.sq0 { border-left: 6px solid var(--sq0); } .sqp.sq1 { border-left: 6px solid var(--sq1); } .sqp.sq2 { border-left: 6px solid var(--sq2); }
.sqp.on { background: rgba(224,165,38,.14); border-color: var(--hazard); }
.sqp:disabled { opacity: .45; cursor: not-allowed; }

/* =====================================================================
   Пакет 13: окна — всплывающие карточки. Один стиль для всех окон, адаптив телефон/компьютер.
   ===================================================================== */
:root { --hud-h: 64px; --nav-h: 70px; --card-bg: #262d32; --card-bg2: #1d2327; --line: #414b52; --gold: #f0b93a; --gold-dk: #9a6a10; }
#panel { position: fixed; inset: 0; width: auto; max-height: none; padding: 0; border: 0; background: rgba(10, 13, 15, .58); backdrop-filter: blur(2px);
  display: grid; place-items: center; overflow: hidden; z-index: 15; }
#panel-card { position: relative; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - var(--hud-h) - var(--nav-h) - 24px); margin-top: calc(var(--hud-h) - var(--nav-h));
  overflow-y: auto; overscroll-behavior: contain; padding: 0 22px 22px;
  background: radial-gradient(120% 60% at 50% 0%, rgba(240, 185, 58, .07), transparent 60%), repeating-linear-gradient(135deg, rgba(255,255,255,.012) 0 2px, transparent 2px 6px), linear-gradient(180deg, var(--card-bg), var(--card-bg2));
  border: 1px solid #10151a; outline: 1px solid var(--line); outline-offset: -4px; border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.06); }
#panel-card::before { content: ''; display: block; height: 5px; margin: 0 -22px 0; border-radius: 8px 8px 0 0;
  background: repeating-linear-gradient(-45deg, var(--gold) 0 12px, #1b1f22 12px 24px); opacity: .9; }
#panel.pop #panel-card { animation: cardIn .22s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
#panel-top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; height: 0; overflow: visible; }
#panel-close { position: absolute; right: -10px; top: 10px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #11161a; background: radial-gradient(circle at 35% 30%, #59646b, #2c3338);
  color: var(--bone); font: 18px/1 var(--display); box-shadow: 0 3px 0 #0c1013, 0 0 0 1px var(--line); float: none; margin: 0; }
#panel-close:hover { background: radial-gradient(circle at 35% 30%, #c9563a, #7e2c1c); }
#panel-back { position: absolute; left: -10px; top: 12px; height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid #11161a; background: linear-gradient(#4b555c, #343c41);
  font: 700 14px/1 var(--narrow); color: var(--bone); box-shadow: 0 2px 0 #0c1013; float: none; margin: 0; width: auto; }
#panel-body { padding-top: 14px; }
#panel h2 { font: 26px/1.1 var(--display); margin: 8px 48px 6px; text-align: center; color: #f3ead6; text-shadow: 0 2px 0 #0d1012, 0 0 18px rgba(240,185,58,.18); }
#panel h2 + .sub { text-align: center; max-width: none; }
#panel h3 { font: 15px/1.2 var(--display); margin: 22px 0 10px; color: var(--gold); display: flex; align-items: center; gap: 10px; }
#panel h3::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
#panel p { max-width: none; }
.sub { color: var(--bone-dim); }

/* вкладки — «таблетки» */
.seg { gap: 4px; padding: 4px; background: rgba(0,0,0,.28); border-radius: 22px; flex-wrap: wrap; }
.seg button { border-radius: 18px; background: transparent; color: var(--bone-dim); padding: 9px 10px; min-width: 64px; transition: background .15s; }
.seg button:hover { background: rgba(255,255,255,.06); color: var(--bone); }
.seg button.on { background: linear-gradient(#f6c650, #d79a1f); color: #241a06; box-shadow: 0 2px 0 var(--gold-dk), 0 0 12px rgba(240,185,58,.35); }

/* кнопки */
.btn { border-radius: 6px; background: linear-gradient(#56616a, #3c454b); box-shadow: 0 3px 0 #1a1f22, inset 0 1px 0 rgba(255,255,255,.15); transition: filter .12s, transform .06s; }
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #1a1f22; }
.btn.primary { background: linear-gradient(#ffd25e, #e6a72a 55%, #c98a14); color: #2a1c04; box-shadow: 0 3px 0 var(--gold-dk), inset 0 1px 0 rgba(255,255,255,.55), 0 0 14px rgba(240,185,58,.25); text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.btn.danger { background: linear-gradient(#e0644a, #b2412a); color: #fff3ec; box-shadow: 0 3px 0 #6a2215, inset 0 1px 0 rgba(255,255,255,.25); }
.btn:disabled { filter: grayscale(.7) brightness(.75); cursor: not-allowed; box-shadow: 0 2px 0 #1a1f22; }
.btn.buy { min-width: 132px; font-size: 17px; padding: 12px 18px; }

/* строки списков, задания, карточки юнитов */
.qrow, .task { padding: 10px 12px; border: 0; margin: 6px 0; background: rgba(255,255,255,.035); border-radius: 6px; border-left: 3px solid var(--line); }
.qrow.done, .task.done { border-left-color: var(--moss); opacity: .8; }
.unit-card, .tnode { background: rgba(255,255,255,.04); border-radius: 8px; border: 1px solid rgba(255,255,255,.05); }
.cost span { background: rgba(0,0,0,.25); padding: 3px 8px 3px 4px; border-radius: 12px; }

/* сундуки: что внутри, прогресс, кнопка */
.chestc { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: center; padding: 12px; margin: 8px 0; border-radius: 10px;
  background: linear-gradient(100deg, rgba(255,255,255,.05), rgba(255,255,255,.015)); border: 1px solid rgba(255,255,255,.06); position: relative; overflow: hidden; }
.chestc.t3 { background: linear-gradient(100deg, rgba(240,185,58,.16), rgba(240,185,58,.03)); border-color: rgba(240,185,58,.35); }
.chestc.t2 { background: linear-gradient(100deg, rgba(120,150,170,.14), rgba(120,150,170,.03)); }
.chestc.ready { box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(240,185,58,.35); }
.chestc.got { opacity: .6; filter: grayscale(.4); }
.cc-ico { position: relative; width: 72px; height: 72px; display: grid; place-items: center; }
.cc-ico img { width: 64px; height: 64px; filter: drop-shadow(0 4px 4px rgba(0,0,0,.5)); }
.chestc.ready .cc-ico img { animation: wobble 1.6s ease-in-out infinite; }
.cc-shine { position: absolute; inset: -6px; border-radius: 50%; background: radial-gradient(circle, rgba(255,214,90,.55), transparent 65%); animation: pulse 1.6s ease-in-out infinite; z-index: -1; }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-7deg); } 20% { transform: rotate(6deg); } 30% { transform: rotate(-3deg); } 40% { transform: rotate(0); } }
@keyframes pulse { 0%, 100% { opacity: .5; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.08); } }
.cc-h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.cc-h b { font: 16px/1.15 var(--display); }
.cc-h span { font: 700 13px/1 var(--narrow); color: var(--bone-dim); }
.cc-prog { height: 7px; background: rgba(0,0,0,.4); border-radius: 4px; margin: 6px 0 4px; overflow: hidden; }
.cc-prog i { display: block; height: 100%; background: linear-gradient(90deg, #c98a14, #ffd25e); border-radius: 4px; }
.cc-in { font: 700 12px/1 var(--narrow); color: var(--bone-dim); text-transform: uppercase; letter-spacing: .06em; margin: 8px 0 4px; }
.cc-st { font: 700 14px/1 var(--narrow); color: var(--moss); }
.ltiles { display: flex; flex-wrap: wrap; gap: 6px; }
.lt { display: flex; align-items: center; gap: 4px; padding: 4px 8px 4px 4px; border-radius: 6px; background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.06); }
.lt img { width: 22px; height: 22px; }
.lt b { font: 14px/1 var(--display); }
.lt.rare { background: linear-gradient(rgba(196,90,214,.22), rgba(196,90,214,.08)); border-color: rgba(196,90,214,.35); }

/* награды дня: календарь 7 дней */
.cal7 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.d7 { position: relative; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); min-height: 108px; }
.d7 .ltiles { gap: 4px; } .d7 .lt { padding: 2px 6px 2px 2px; } .d7 .lt img { width: 18px; height: 18px; } .d7 .lt b { font-size: 12px; }
.d7h { font: 700 13px/1 var(--narrow); color: var(--bone-dim); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.d7.today { border: 2px solid var(--gold); box-shadow: 0 0 18px rgba(240,185,58,.35); background: linear-gradient(rgba(240,185,58,.14), rgba(240,185,58,.03)); }
.d7.today .d7h { color: var(--gold); }
.d7.past, .d7.got { opacity: .55; }
.d7.big { grid-column: span 2; background: linear-gradient(120deg, rgba(240,185,58,.22), rgba(178,74,45,.12)); border-color: rgba(240,185,58,.5); }
.d7c { width: 54px; height: 54px; float: right; margin: -4px -2px 0 6px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.d7ok { position: absolute; right: 8px; top: 6px; color: var(--moss); font: 18px/1 var(--display); font-style: normal; }

/* магазин: предложения и товары */
.offers { display: grid; gap: 12px; }
.offer { position: relative; padding: 16px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.offer.gold { background: radial-gradient(90% 120% at 100% 0%, rgba(255,210,94,.35), transparent 60%), linear-gradient(135deg, #4a3a1a, #2a2418); border-color: rgba(240,185,58,.45); }
.offer.blue { background: radial-gradient(90% 120% at 100% 0%, rgba(79,163,224,.32), transparent 60%), linear-gradient(135deg, #1c3446, #1d2630); border-color: rgba(79,163,224,.4); }
.offer.purple { background: radial-gradient(90% 120% at 100% 0%, rgba(196,90,214,.32), transparent 60%), linear-gradient(135deg, #36203e, #241d2a); border-color: rgba(196,90,214,.4); }
.of-h b { display: block; font: 22px/1.1 var(--display); color: #fff6e0; text-shadow: 0 2px 0 rgba(0,0,0,.5); }
.of-h span, .of-d { color: var(--bone-dim); font-size: 14px; }
.of-f { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.ribbon { position: absolute; top: 12px; right: -38px; transform: rotate(35deg); background: linear-gradient(#e0644a, #b2412a); color: #fff; font: 700 12px/1 var(--narrow);
  padding: 6px 44px; box-shadow: 0 2px 6px rgba(0,0,0,.4); letter-spacing: .04em; white-space: nowrap; }
.offer .ribbon { right: -46px; }
.shopgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.sitem { position: relative; overflow: hidden; display: grid; gap: 6px; justify-items: center; text-align: center; padding: 14px 10px 12px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); border: 1px solid rgba(255,255,255,.07); }
.sitem b { font: 15px/1.15 var(--display); }
.sitem .si-ico { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.45)); }
.sitem.ssr { border-color: rgba(240,185,58,.5); background: linear-gradient(180deg, rgba(240,185,58,.2), rgba(240,185,58,.03)); }
.sitem.sr { border-color: rgba(196,90,214,.45); background: linear-gradient(180deg, rgba(196,90,214,.18), rgba(196,90,214,.03)); }
.sitem.soldout { opacity: .5; }
.sitem .inp { width: 100%; padding: 6px; }
.sitem .ribbon { right: -52px; top: 14px; font-size: 11px; }
.shopgrid.caps .sitem.cap1 { border-color: rgba(79,163,224,.45); } .shopgrid.caps .sitem.cap2 { border-color: rgba(196,90,214,.45); } .shopgrid.caps .sitem.cap3 { border-color: rgba(240,185,58,.6); box-shadow: 0 0 18px rgba(240,185,58,.25); }
.plans { gap: 10px; } .plan { border-radius: 10px; background: linear-gradient(180deg, rgba(240,185,58,.14), rgba(240,185,58,.03)); border: 1px solid rgba(240,185,58,.3); }

/* модальные окна (итоги боя, письма, выбор отряда) — в том же стиле */
#modal-box { border-radius: 10px; border: 1px solid #10151a; border-top: 5px solid var(--gold); outline: 1px solid var(--line); outline-offset: -4px;
  background: radial-gradient(120% 60% at 50% 0%, rgba(240,185,58,.08), transparent 60%), linear-gradient(180deg, var(--card-bg), var(--card-bg2)); box-shadow: 0 24px 60px rgba(0,0,0,.65); animation: cardIn .2s ease-out; }
#modal-box h2 { text-align: center; text-shadow: 0 2px 0 #0d1012; }

/* надписи каравана на карте */
.a-lbl.cv .cvd { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: 0; box-shadow: 0 0 0 1px #000; }
.a-lbl.cv s { color: #e0644a; }
b.bad, .bad { color: #e0644a; }

/* телефон: карточка — лист почти на весь экран */
@media (max-width: 700px) {
  #panel { place-items: end center; }
  #panel-card { width: 100vw; max-height: calc(100vh - var(--hud-h) - var(--nav-h) - 6px); margin: 0 0 var(--nav-h); border-radius: 14px 14px 0 0; padding: 0 14px 18px; outline-offset: -3px; }
  #panel-card::before { margin: 0 -14px; border-radius: 14px 14px 0 0; }
  #panel h2 { font-size: 22px; margin: 6px 44px 4px; }
  #panel-close { right: -4px; top: 8px; width: 38px; height: 38px; } #panel-back { left: -4px; top: 10px; }
  .cal7 { grid-template-columns: repeat(2, 1fr); }
  .chestc { grid-template-columns: 56px 1fr; } .chestc .cc-act { grid-column: 1 / -1; } .chestc .cc-act .btn { width: 100%; }
  .cc-ico, .cc-ico img { width: 52px; height: 52px; }
  .shopgrid { grid-template-columns: repeat(2, 1fr); }
  .btn.buy { width: 100%; }
}
#nav, #hud { z-index: 16; }
.seg button { flex: 1 1 auto; min-width: 0; padding: 9px 12px; white-space: nowrap; }
.ribbon, .offer .ribbon, .sitem .ribbon { transform: none; top: 0; right: 0; padding: 6px 12px; border-radius: 0 11px 0 10px; letter-spacing: .02em; }
.offer .of-h { padding-right: 150px; }
@media (max-width: 700px) { .offer .of-h { padding-right: 0; padding-top: 18px; } }

/* =====================================================================
   Пакет 14: дизайн всего — верхняя панель, нижнее меню, здания, герои, бой, загрузка и вход, награды
   ===================================================================== */
/* верхняя панель: жетоны ресурсов */
.tag { min-width: 0; padding: 4px 12px 4px 4px; gap: 7px; border-radius: 20px 8px 8px 20px; border: 1px solid #12171a;
  background: linear-gradient(180deg, rgba(74,84,91,.96), rgba(40,46,51,.96)); box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 3px 8px rgba(0,0,0,.35); transition: transform .15s; }
.tag::after { display: none; }
.tag img { width: 28px; height: 28px; padding: 3px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #3d464c, #1c2124); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.tag .v { font-size: 15px; } .tag .r { color: #9fb98a; }
.tag.full .v { color: var(--gold); } .tag.full { box-shadow: 0 0 0 1px var(--gold), 0 3px 8px rgba(0,0,0,.35); }
.tag.caps { cursor: pointer; background: linear-gradient(180deg, rgba(120,82,30,.96), rgba(64,44,18,.96)); }
.tag.bump { animation: bump .35s ease-out; }
@keyframes bump { 40% { transform: scale(1.12); box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(240,185,58,.6); } }
#power-tag { border-radius: 8px; border: 1px solid #12171a; border-bottom: 2px solid var(--gold); background: linear-gradient(180deg, rgba(74,84,91,.96), rgba(40,46,51,.96)); padding: 8px 12px; box-shadow: 0 3px 8px rgba(0,0,0,.35); }
#power-tag::before { content: '⚔ '; color: var(--gold); }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid #12171a; background: radial-gradient(circle at 35% 30%, #59646b, #2c3338); box-shadow: 0 3px 0 #0c1013, inset 0 1px 0 rgba(255,255,255,.18); position: relative; }
.icon-btn:hover { filter: brightness(1.15); }
.icon-btn img { width: 24px; height: 24px; }
.icon-btn .badge { position: absolute; top: -3px; right: -3px; }

/* нижнее меню: металлическая планка, активная вкладка приподнята */
#nav { border: 1px solid #10151a; border-radius: 14px 14px 0 0; padding: 4px 6px 2px; background: linear-gradient(180deg, rgba(60,68,74,.97), rgba(30,35,39,.97)); box-shadow: 0 -6px 18px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.12); }
#nav::before { content: ''; position: absolute; left: 10px; right: 10px; top: -3px; height: 3px; background: repeating-linear-gradient(-45deg, var(--gold) 0 8px, #1b1f22 8px 16px); border-radius: 2px; opacity: .8; }
#nav button { position: relative; padding: 8px 14px 7px; border-radius: 10px; transition: transform .15s, background .15s; }
#nav button img { width: 28px; height: 28px; transition: transform .15s; filter: drop-shadow(0 2px 1px rgba(0,0,0,.6)); }
#nav button:hover { background: rgba(255,255,255,.05); }
#nav button.active { box-shadow: none; color: #241a06; background: linear-gradient(#ffd25e, #d79a1f); transform: translateY(-8px); box-shadow: 0 4px 0 var(--gold-dk), 0 0 16px rgba(240,185,58,.45); }
#nav button.active img { opacity: 1; transform: scale(1.12); filter: drop-shadow(0 2px 1px rgba(0,0,0,.35)); }
#nav button .badge { position: absolute; top: 2px; right: 8px; }

/* окно здания: картинка, уровень, сравнение «сейчас → следующий уровень», блок улучшения */
.bhead { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: center; margin: 10px 0 8px; }
.bh-img { position: relative; height: 150px; display: grid; place-items: center; border-radius: 12px;
  background: radial-gradient(70% 60% at 50% 60%, rgba(240,185,58,.22), transparent 70%), radial-gradient(circle at 50% 120%, rgba(0,0,0,.45), transparent 60%); }
.bh-img img { max-width: 170px; max-height: 150px; filter: drop-shadow(0 10px 12px rgba(0,0,0,.55)); }
.bh-lvl { position: absolute; left: 6px; top: 6px; min-width: 38px; height: 38px; padding: 0 6px; border-radius: 19px; display: grid; place-items: center;
  font: 18px/1 var(--display); color: #241a06; background: linear-gradient(#ffd25e, #d79a1f); box-shadow: 0 3px 0 var(--gold-dk), 0 0 0 2px #1b1f22; }
.bhead h2 { text-align: left !important; margin: 0 0 4px !important; }
.bh-sub { font: 700 14px/1.2 var(--narrow); color: var(--bone-dim); } .bh-sub b { color: var(--gold); }
.newlook { display: flex; gap: 12px; align-items: center; padding: 10px 12px; margin: 6px 0 10px; border-radius: 10px; border: 1px dashed rgba(240,185,58,.5); background: rgba(240,185,58,.08); }
.newlook img { width: 74px; height: 62px; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0,0,0,.5)); }
.newlook b { display: block; font: 15px/1.2 var(--display); color: var(--gold); } .newlook span { font-size: 13px; color: var(--bone-dim); }
.cmp-h { display: flex; justify-content: space-between; font: 700 12px/1 var(--narrow); color: var(--bone-dim); text-transform: uppercase; letter-spacing: .06em; margin: 12px 2px 4px; }
.cmp-h i { color: #8fd36a; font-style: normal; }
.kv.cmp { gap: 0; background: rgba(0,0,0,.2); border-radius: 10px; overflow: hidden; }
.kv.cmp dt, .kv.cmp dd { padding: 8px 12px; border-top: 1px solid rgba(255,255,255,.05); }
.kv.cmp dt:first-of-type, .kv.cmp dd:first-of-type { border-top: 0; }
.kv dd .up { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px; color: #c6f0a8; background: rgba(127,180,85,.18); }
.upbox { margin: 14px 0 6px; padding: 14px; border-radius: 12px; background: linear-gradient(180deg, rgba(240,185,58,.1), rgba(240,185,58,.02)); border: 1px solid rgba(240,185,58,.25); }
.ub-h { display: flex; justify-content: space-between; align-items: center; } .ub-h b { font: 16px/1.2 var(--display); }
.ub-h time { font: 14px/1 var(--display); color: var(--gold); background: rgba(0,0,0,.3); padding: 5px 9px; border-radius: 12px; }
.ub-h time::before { content: '⏱ '; }

/* карточки героев: рамка и подсветка по редкости */
.hero-list { gap: 10px; }
.hcard { border-radius: 10px; overflow: hidden; padding: 0 0 8px; background: linear-gradient(180deg, #2c3338, #1c2124); border: 2px solid #5b6368; box-shadow: 0 4px 10px rgba(0,0,0,.4); transition: transform .12s; }
.hcard:hover { transform: translateY(-2px); }
.hcard img { border-bottom: 2px solid rgba(0,0,0,.35); }
.hcard.r-SR { border-color: #9b5fd0; background: linear-gradient(180deg, #3a2c4a, #1e1a25); box-shadow: 0 4px 12px rgba(155,95,208,.25); }
.hcard.r-SSR { border-color: var(--gold); background: linear-gradient(180deg, #4a3a1a, #221c12); box-shadow: 0 4px 14px rgba(240,185,58,.35); }
.hcard.r-UR { border-color: #ff6a3a; background: linear-gradient(180deg, #4a2418, #22130e); box-shadow: 0 0 16px rgba(255,106,58,.45); }
.hcard .pw { padding: 2px 6px 0; font: 13px/1 var(--display); color: var(--gold); } .hcard .pw::before { content: '⚔ '; }
.pill { border-radius: 4px; } .pill.SR { background: #7a45b0; color: #fff; } .pill.R { background: #4f6e86; color: #fff; }
.hero-top { grid-template-columns: 190px 1fr; gap: 18px; align-items: stretch; margin: 10px 0; }
.ht-card { position: relative; border-radius: 12px; overflow: hidden; border: 3px solid #5b6368; box-shadow: 0 8px 22px rgba(0,0,0,.5); }
.hero-top.r-SR .ht-card { border-color: #9b5fd0; } .hero-top.r-SSR .ht-card { border-color: var(--gold); box-shadow: 0 8px 22px rgba(0,0,0,.5), 0 0 22px rgba(240,185,58,.35); }
.hero-top.r-UR .ht-card { border-color: #ff6a3a; box-shadow: 0 0 26px rgba(255,106,58,.5); }
.ht-card img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 4; }
.ht-card .pill { position: absolute; left: 8px; top: 8px; font-size: 12px; padding: 4px 7px; }
.ht-info h2 { text-align: left !important; margin: 2px 0 4px !important; }
.ht-cls { font: 700 14px/1.2 var(--narrow); color: var(--bone-dim); } .ht-stars { margin: 6px 0; font-size: 18px; }
.ht-pw { display: flex; align-items: baseline; gap: 8px; } .ht-pw span { color: var(--bone-dim); font: 700 13px/1 var(--narrow); } .ht-pw b { font: 26px/1 var(--display); color: var(--gold); text-shadow: 0 0 14px rgba(240,185,58,.35); }
.ht-lvl { margin: 10px 0; } .ht-lvl span { font: 700 13px/1 var(--narrow); color: var(--bone-dim); }
.ht-lvl i { display: block; height: 8px; margin-top: 4px; background: rgba(0,0,0,.4); border-radius: 4px; overflow: hidden; } .ht-lvl u { display: block; height: 100%; background: linear-gradient(90deg, #5aa0e0, #9fd3ff); }
.stat4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.stat4 div { padding: 7px 10px; border-radius: 8px; background: rgba(0,0,0,.25); } .stat4 span { display: block; font: 700 11px/1 var(--narrow); color: var(--bone-dim); text-transform: uppercase; letter-spacing: .05em; } .stat4 b { font: 17px/1.2 var(--display); }
.bio { color: var(--bone-dim); font-style: italic; }
.skill { padding: 12px; border-radius: 10px; background: linear-gradient(100deg, rgba(79,163,224,.14), rgba(79,163,224,.03)); border: 1px solid rgba(79,163,224,.3); }
.eq-slot { border-radius: 10px; }

/* бой */
#battle-title { border-radius: 10px; border: 1px solid #10151a; border-bottom: 3px solid var(--rust); background: linear-gradient(180deg, rgba(60,68,74,.95), rgba(30,35,39,.95)); padding: 10px 18px; box-shadow: 0 6px 16px rgba(0,0,0,.45); }
#battle-clock { font: 15px/1 var(--display); padding: 6px 12px; border-radius: 14px; background: rgba(0,0,0,.55); color: var(--gold); }
#battle-controls button, #td-ctl button { border-radius: 18px; min-width: 46px; background: linear-gradient(180deg, rgba(74,84,91,.95), rgba(40,46,51,.95)); border: 1px solid #10151a; box-shadow: 0 3px 0 #0c1013; }
#battle-controls button.active, #td-ctl button.active { background: linear-gradient(#ffd25e, #d79a1f); color: #241a06; box-shadow: 0 3px 0 var(--gold-dk); }

/* загрузка и вход: кадр из игры на фоне, знак «РУБЕЖ» */
#loading, #auth { background: linear-gradient(180deg, rgba(15,18,20,.55), rgba(15,18,20,.92)), url('/assets/bg.jpg') center / cover no-repeat, #1b1f22; }
.logo { font: 64px/1 var(--display); letter-spacing: .08em; color: #f6ecd2; text-shadow: 0 4px 0 #0d1012, 0 0 30px rgba(240,185,58,.35); margin: 0; position: relative; display: inline-block; }
.logo::after { content: ''; display: block; height: 8px; margin: 10px auto 0; width: 86%; background: repeating-linear-gradient(-45deg, var(--gold) 0 14px, #1b1f22 14px 28px); border-radius: 2px; }
.load-inner { width: min(420px, 86vw); }
.load-inner .bar { height: 14px; border-radius: 8px; background: rgba(0,0,0,.55); border: 1px solid #10151a; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,.6); }
.load-inner .bar i { display: block; height: 100%; background: repeating-linear-gradient(-45deg, #ffd25e 0 10px, #e6a72a 10px 20px); animation: stripes 1s linear infinite; background-size: 28px 28px; transition: width .3s; }
@keyframes stripes { to { background-position: 28px 0; } }
#load-tip { margin-top: 14px; min-height: 2.6em; color: var(--bone-dim); font-size: 14px; }
.auth-box { border-radius: 14px; border: 1px solid #10151a; border-top: 5px solid var(--gold); outline: 1px solid var(--line); outline-offset: -5px; text-align: center;
  background: radial-gradient(120% 60% at 50% 0%, rgba(240,185,58,.1), transparent 60%), linear-gradient(180deg, rgba(38,45,50,.96), rgba(29,35,39,.96)); box-shadow: 0 24px 60px rgba(0,0,0,.65); padding: 28px 26px; width: min(400px, 100%); }
.auth-box .logo { font-size: 52px; }
.auth-box form { text-align: left; }
.auth-tabs button { border-radius: 18px; }

/* награда: карточка в центре, иконки улетают в верхнюю панель */
.reward-burst { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 60; min-width: 260px; max-width: 92vw; padding: 18px 20px; text-align: center; border-radius: 14px;
  background: radial-gradient(120% 80% at 50% 0%, rgba(240,185,58,.25), transparent 60%), linear-gradient(180deg, rgba(38,45,50,.97), rgba(25,30,34,.97)); border: 1px solid rgba(240,185,58,.5);
  box-shadow: 0 20px 50px rgba(0,0,0,.6), 0 0 40px rgba(240,185,58,.25); animation: burstIn .35s cubic-bezier(.2,1.4,.4,1); pointer-events: none; overflow: hidden; }
.reward-burst b { display: block; font: 22px/1.1 var(--display); color: var(--gold); margin-bottom: 10px; text-shadow: 0 2px 0 #0d1012; position: relative; }
.reward-burst .ltiles { justify-content: center; position: relative; } .reward-burst .lt { animation: tileIn .4s both; } .reward-burst .lt img { width: 30px; height: 30px; } .reward-burst .lt b { font-size: 16px; margin: 0; color: var(--bone); display: inline; }
.reward-burst .lt:nth-child(2) { animation-delay: .06s; } .reward-burst .lt:nth-child(3) { animation-delay: .12s; } .reward-burst .lt:nth-child(4) { animation-delay: .18s; } .reward-burst .lt:nth-child(n+5) { animation-delay: .24s; }
.rb-rays { position: absolute; left: 50%; top: 50%; width: 520px; height: 520px; margin: -260px 0 0 -260px; background: repeating-conic-gradient(rgba(240,185,58,.16) 0 10deg, transparent 10deg 20deg); animation: spin 8s linear infinite; }
.reward-burst.out { animation: burstOut .45s ease-in forwards; }
.fly-ico { position: fixed; z-index: 61; pointer-events: none; filter: drop-shadow(0 0 8px rgba(255,214,90,.9)); }
@keyframes burstIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.6); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes burstOut { to { opacity: 0; transform: translate(-50%, -50%) scale(.9); } }
@keyframes tileIn { from { opacity: 0; transform: translateY(10px) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* телефон */
@media (max-width: 700px) {
  #res-tags { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding-bottom: 2px; }
  #res-tags::-webkit-scrollbar { display: none; }
  .tag { padding: 3px 9px 3px 3px; gap: 5px; flex: 0 0 auto; } .tag img { width: 24px; height: 24px; } .tag .v { font-size: 13px; } .tag .r { font-size: 10px; }
  #hud-right { margin-left: 0; width: 100%; justify-content: flex-end; } .icon-btn { width: 38px; height: 38px; }
  #nav { border-radius: 14px 14px 0 0; padding: 4px 2px calc(2px + var(--safe-b)); } #nav button { padding: 7px 4px 6px; min-width: 0; flex: 1; } #nav button.active { transform: translateY(-6px); }
  .bhead { grid-template-columns: 1fr; text-align: center; } .bh-img { height: 130px; } .bhead h2 { text-align: center !important; }
  .hero-top { grid-template-columns: 120px 1fr; gap: 12px; } .stat4 b { font-size: 15px; }
  .logo { font-size: 46px; } .auth-box .logo { font-size: 42px; }
}
/* 14: под кнопкой «Назад» карточке героя нужен отступ сверху */
#panel-card:has(#panel-back:not([hidden])) #panel-body > .hero-top:first-child { margin-top: 46px; }
#panel-body > .hero-top:first-child { margin-top: 48px; }
#battle-clock { position: relative; left: auto; top: auto; transform: none; padding-left: 30px; }
#battle-clock::before { left: 7px; width: 15px; height: 15px; margin-top: -7.5px; }
/* 14.1: выход из записи боя */
#bt-exit { position: fixed; top: calc(10px + var(--safe-t, 0px)); left: 12px; z-index: 6; pointer-events: auto; height: 40px; padding: 0 16px 0 6px; display: flex; align-items: center; gap: 8px;
  border-radius: 20px; border: 1px solid #10151a; background: linear-gradient(180deg, rgba(74,84,91,.96), rgba(40,46,51,.96)); box-shadow: 0 3px 0 #0c1013, 0 6px 14px rgba(0,0,0,.4); color: var(--bone); font: 700 15px/1 var(--narrow); cursor: pointer; }
#bt-exit[hidden] { display: none; }
#bt-exit i { order: -1; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-style: normal; background: rgba(0,0,0,.35); font-size: 15px; }
#bt-exit:hover { filter: brightness(1.15); }
@media (max-width: 640px) { #bt-exit { top: auto; bottom: calc(170px + var(--safe-b, 0px)); left: 8px; height: 36px; } #bt-exit i { width: 26px; height: 26px; } }
/* 14.1: уже приглашённый игрок */
.btn.invited, .btn.invited:disabled { background: rgba(110,170,90,.16); border: 1px solid rgba(130,200,100,.55); color: #a9e08a; opacity: 1; box-shadow: none; cursor: default; }
/* 15: подпись «Новый уровень!» над зданием */
.lvlup { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 22px; background: linear-gradient(180deg, rgba(255,214,110,.96), rgba(214,150,30,.96));
  color: #2a1c05; font: 800 15px/1 var(--narrow); text-transform: uppercase; letter-spacing: .03em; box-shadow: 0 6px 18px rgba(0,0,0,.45), 0 0 24px rgba(255,200,80,.6);
  animation: lvlup 2.4s ease-out forwards; white-space: nowrap; }
.lvlup b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #2a1c05; color: #ffd36b; font-size: 16px; }
@keyframes lvlup { 0% { transform: translateY(20px) scale(.4); opacity: 0; } 12% { transform: translateY(0) scale(1.15); opacity: 1; } 22% { transform: scale(1); } 75% { opacity: 1; transform: translateY(-14px); } 100% { opacity: 0; transform: translateY(-40px); } }

/* ===== пакет 15: Армия, Альянс, Город, Почта ===== */
.tiles4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0 14px; }
.tile { position: relative; overflow: hidden; background: linear-gradient(180deg, #2c343a, #22292e); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px 10px; min-height: 58px; }
.tile > span { display: block; font: 700 11px/1 var(--narrow); text-transform: uppercase; letter-spacing: .05em; color: var(--bone-dim); }
.tile > b { display: block; margin-top: 6px; font: 20px/1 var(--display); color: var(--bone); }
.tile > b small { font: 600 13px/1 var(--narrow); color: var(--bone-dim); }
.tile > img { position: absolute; right: -6px; bottom: -14px; height: 64px; opacity: .55; }
.tile.warn > b { color: #ff9a7a; }
.tiles4.small .tile { min-height: 0; padding: 7px 10px 8px; } .tiles4.small .tile > b { font-size: 16px; margin-top: 5px; }
i.bar { display: block; height: 6px; margin-top: 8px; border-radius: 3px; background: rgba(0,0,0,.45); overflow: hidden; font-style: normal; }
i.bar u { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #f6cf62, #d89a1f); text-decoration: none; transition: width .4s; }
i.bar.red u { background: linear-gradient(90deg, #ff8a6a, #c2412a); } i.bar.green u { background: linear-gradient(90deg, #b6db7a, #6c9a3c); }

.ucards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ucard { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 9px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(160deg, #2e373d, #1f2529); position: relative; }
.ucard.front { box-shadow: inset 3px 0 0 #c96a3a; } .ucard.back { box-shadow: inset 3px 0 0 #4f8fc0; }
.u-art { position: relative; border-radius: 9px; background: radial-gradient(circle at 50% 35%, #5a5547, #2a2a26 70%); display: grid; place-items: end center; overflow: hidden; min-height: 116px; }
.u-art img { height: 112px; filter: drop-shadow(0 4px 4px rgba(0,0,0,.5)); }
.u-art .tier { position: absolute; left: 5px; top: 5px; background: linear-gradient(#ffd25e, #d79a1f); color: #241a06; font: 13px/1 var(--display); padding: 3px 6px; border-radius: 6px; }
.u-art .row-pill { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font: 700 10px/1 var(--narrow); text-transform: uppercase; padding: 4px 2px; background: rgba(0,0,0,.6); color: var(--bone-dim); }
.u-info .nm { font: 17px/1.1 var(--display); } .u-info .ds { font-size: 12.5px; color: var(--bone-dim); margin: 3px 0 6px; line-height: 1.25; }
.u-stats { display: flex; gap: 5px; flex-wrap: wrap; }
.u-stats span { background: rgba(0,0,0,.35); border-radius: 6px; padding: 3px 6px; font: 700 13px/1 var(--narrow); }
.u-stats em { font-style: normal; color: #e0704a; font-size: 10px; margin-right: 4px; }
.u-num { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.u-num b { font: 24px/1 var(--display); color: var(--gold); } .u-num span { font-size: 12px; color: var(--bone-dim); } .u-num em { font-style: normal; font-size: 12px; color: #ff9a7a; }
.u-lock { margin-top: 8px; font: 700 13px/1 var(--narrow); color: var(--bone-dim); }
.ucard.locked .u-art img { filter: grayscale(1) brightness(.45); } .ucard.locked { opacity: .82; }

.emblem { --eh: 30; position: relative; display: inline-grid; place-items: center; width: 44px; height: 50px; flex: none;
  background: linear-gradient(160deg, hsl(var(--eh) 62% 52%), hsl(var(--eh) 58% 30%)); clip-path: polygon(50% 0, 100% 14%, 100% 58%, 50% 100%, 0 58%, 0 14%); }
.emblem::after { content: ''; position: absolute; inset: 3px; clip-path: inherit; background: linear-gradient(160deg, hsl(var(--eh) 40% 24%), hsl(var(--eh) 45% 14%)); }
.emblem b { position: relative; z-index: 1; font: 13px/1 var(--display); color: hsl(var(--eh) 85% 75%); letter-spacing: .02em; margin-top: -4px; }
.emblem.big { width: 74px; height: 84px; } .emblem.big::after { inset: 4px; } .emblem.big b { font-size: 21px; }
.abanner { display: flex; gap: 14px; align-items: center; padding: 12px; margin: 4px 0 2px; border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(100deg, rgba(240,185,58,.12), transparent 60%), repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 10px, transparent 10px 20px), #232a2f; }
.ab-info { flex: 1; min-width: 0; } .ab-name { font: 22px/1.1 var(--display); }
.ab-lvl { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin-top: 8px; }
.ab-lvl b { font: 13px/1 var(--display); color: var(--gold); } .ab-lvl i.bar { margin: 0; height: 8px; } .ab-lvl span { font-size: 12px; color: var(--bone-dim); }
.a-about { font-style: italic; color: var(--bone-dim); margin: 6px 0 4px; }
.atask { padding: 9px 11px; border-radius: 9px; background: rgba(0,0,0,.2); border: 1px solid var(--line); margin-bottom: 7px; }
.atask .at-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; } .atask .at-top b { font-family: var(--display); font-size: 13px; color: var(--gold); white-space: nowrap; }
.atask i.bar { margin-top: 6px; } .atask em { display: block; font-style: normal; font-size: 11.5px; color: var(--bone-dim); margin-top: 4px; }
.atask.done { opacity: .75; } .atask.done .at-top b { color: #9fd36f; }
.acards { display: grid; gap: 7px; margin-bottom: 8px; }
.acard { display: flex !important; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: linear-gradient(90deg, #2b3338, #22292d); }
.acard .a-info { flex: 1; display: grid; gap: 3px; } .acard .a-info b { font: 16px/1.1 var(--display); } .acard .a-info span { font-size: 13px; color: var(--bone-dim); }
.acard .t { flex: 1; } .ok { color: #9fd36f; font-style: normal; }
.mcard { display: grid; grid-template-columns: 40px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; margin-bottom: 6px; border-radius: 10px; border: 1px solid var(--line); background: #262e33; }
.mcard.leader { border-color: rgba(240,185,58,.6); background: linear-gradient(90deg, rgba(240,185,58,.14), #262e33 55%); }
.mcard.me { box-shadow: inset 3px 0 0 var(--gold); }
.m-ava { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 17px/1 var(--display); background: linear-gradient(160deg, #4b555c, #2c3338); border: 2px solid var(--line); }
.mcard.leader .m-ava { border-color: var(--gold); color: var(--gold); } .mcard.officer .m-ava { border-color: #9b6fd0; }
.mcard .nm { font-weight: 700; } .mcard .ds { font-size: 12px; color: var(--bone-dim); } .m-pow { font: 15px/1 var(--display); color: var(--bone); white-space: nowrap; }

.dhead { display: grid; grid-template-columns: 170px 1fr; gap: 14px; align-items: center; padding: 10px 12px; margin-top: 4px; border-radius: 12px; border: 1px solid #5a2a20;
  background: radial-gradient(circle at 20% 80%, rgba(178,74,45,.35), transparent 60%), linear-gradient(160deg, #3a2622, #1d1716); }
.dhead.freed { border-color: #3f5a2c; background: radial-gradient(circle at 20% 80%, rgba(127,156,85,.35), transparent 60%), linear-gradient(160deg, #27332a, #171d18); }
.dh-foes { display: flex; align-items: flex-end; justify-content: center; height: 110px; }
.dh-foes img { height: 86px; margin: 0 -14px; filter: drop-shadow(0 4px 5px rgba(0,0,0,.6)); } .dh-foes img:first-child { height: 108px; z-index: 1; order: 2; } .dh-foes img:last-child { order: 3; }
.dh-n { font: 700 11px/1 var(--narrow); text-transform: uppercase; letter-spacing: .06em; color: var(--bone-dim); } .dhead h2 { margin: 4px 0 8px; text-align: left; }
.dh-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.pill.ok { background: #4f7a36; color: #fff; } .pill.danger { background: #a63a24; color: #fff; }
.lots3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.lotc { display: grid; justify-items: center; gap: 3px; padding: 8px 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: linear-gradient(180deg, #2e363b, #22292d); color: var(--bone); cursor: pointer; }
.lotc img { width: 100%; max-width: 110px; aspect-ratio: 1; object-fit: contain; } .lotc b { font: 14px/1.1 var(--display); text-align: center; } .lotc span { font-size: 12px; color: var(--gold); }
.lotc.ruin img, .bh-img img.ruin { filter: grayscale(.85) brightness(.55) sepia(.3); } .lotc.ruin span { color: var(--bone-dim); }
.lotc:not(:disabled):hover { border-color: var(--gold); transform: translateY(-1px); } .lotc:disabled { cursor: default; opacity: .7; }
.upbox.danger { border-color: rgba(178,74,45,.6); background: linear-gradient(180deg, rgba(178,74,45,.14), rgba(0,0,0,.15)); }

.mail-list { display: grid; gap: 6px; }
.mail-item { grid-template-columns: 42px 1fr auto !important; align-items: center; gap: 10px !important; padding: 8px 10px !important; border: 1px solid var(--line) !important; border-radius: 10px; background: #262e33 !important; color: var(--bone); cursor: pointer; }
.mail-item:hover { border-color: var(--steel-2) !important; filter: brightness(1.08); }
.mail-item.new { background: linear-gradient(90deg, rgba(240,185,58,.12), #262e33 60%) !important; border-color: rgba(240,185,58,.45) !important; }
.mail-item.new .ti::before { content: none; }
.mi-t { display: grid; gap: 2px; min-width: 0; } .mi-t .ex { grid-column: auto !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi-ico { position: relative; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: #36404a; }
.mi-ico img { width: 24px; height: 24px; } .mi-ico.big { width: 54px; height: 54px; border-radius: 13px; } .mi-ico.big img { width: 32px; height: 32px; }
.mk-war .mi-ico { background: linear-gradient(160deg, #8e3a26, #4c1e14); } .mk-def .mi-ico { background: linear-gradient(160deg, #6a6f75, #3a3f44); }
.mk-gift .mi-ico { background: linear-gradient(160deg, #d79a1f, #7a520c); } .mk-cv .mi-ico { background: linear-gradient(160deg, #5f7f3c, #2e4019); }
.mk-ally .mi-ico { background: linear-gradient(160deg, #6b4fa8, #34245a); }
.mail-item.new .mi-ico::after { content: ''; position: absolute; right: -3px; top: -3px; width: 11px; height: 11px; border-radius: 50%; background: #e5372b; border: 2px solid #262e33; }
.letter .lt-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; } .letter .lt-head h2 { margin: 0; text-align: left; font-size: 21px; }
.letter time { font-size: 12.5px; color: var(--bone-dim); }
.letter .lt-body { background: rgba(0,0,0,.22); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; line-height: 1.45; white-space: pre-line; }
.letter .got { opacity: .45; filter: grayscale(.7); }

@media (max-width: 640px) {
  .tiles4 { grid-template-columns: repeat(2, 1fr); }
  .ucards { grid-template-columns: 1fr; }
  .dhead { grid-template-columns: 110px 1fr; } .dh-foes { height: 86px; } .dh-foes img { height: 64px; margin: 0 -12px; } .dh-foes img:first-child { height: 82px; }
  .lotc b { font-size: 12.5px; }
  .mcard { grid-template-columns: 36px 1fr auto; } .mcard > span:last-child { grid-column: 1 / -1; display: flex; gap: 6px; justify-content: flex-end; }
  .abanner { padding: 10px; } .emblem.big { width: 60px; height: 68px; } .ab-name { font-size: 18px; }
}
#panel-body .dhead h2 { text-align: left; margin: 4px 0 8px; }
.ub-h span { display: inline-flex; align-items: center; gap: 4px; }
.ub-h span img { width: 18px; height: 18px; }
.letter .lt-head h2 { text-align: left !important; font-size: 20px !important; line-height: 1.15; margin: 0 !important; }
@media (max-width: 640px) { .letter .lt-head h2 { font-size: 17px !important; } }

/* ===== пакет 16: деревья технологий ===== */
.tb-sum { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0 4px; }
.tb-sum div { background: linear-gradient(180deg, #2c343a, #22292e); border: 1px solid var(--line); border-radius: 9px; padding: 7px 8px; }
.tb-sum span { display: block; font: 700 10.5px/1.1 var(--narrow); text-transform: uppercase; letter-spacing: .04em; color: var(--bone-dim); }
.tb-sum b { display: block; margin-top: 4px; font: 17px/1 var(--display); color: #9fd36f; } .tb-sum div:last-child b { color: var(--gold); }
.qrow.rq { align-items: center; } .qrow.rq .t { flex: 1; } .qrow.rq i.bar { margin-top: 5px; }
.rq-ico { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #ffd36b; background: radial-gradient(circle, #4a3a18, #2a2212); border: 2px solid var(--gold); margin-right: 8px; }
.rq-ico svg { width: 20px; height: 20px; }
.seg button small { opacity: .7; font-size: 11px; margin-left: 3px; }
.ttree { position: relative; padding: 14px 4px 6px; margin: 8px 0 4px; border-radius: 12px; border: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 0%, rgba(240,185,58,.07), transparent 60%), repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 28px), repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 1px, transparent 1px 28px), #1c2226; }
.tt-lines { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.tt-lines path { fill: none; stroke: #4a545b; stroke-width: 2.5; stroke-dasharray: 5 4; }
.tt-lines path.ok { stroke: #c9962a; stroke-dasharray: none; filter: drop-shadow(0 0 3px rgba(240,185,58,.45)); }
.tt-row { position: relative; z-index: 1; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 4px; margin-bottom: 22px; }
.tt-row:last-child { margin-bottom: 4px; }
.tn { --p: 0; display: grid; justify-items: center; gap: 3px; width: 92px; padding: 0; background: none; border: 0; color: var(--bone); cursor: pointer; }
.tn-ico { position: relative; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, #3d474e, #20262a); box-shadow: 0 4px 10px rgba(0,0,0,.45); transition: transform .15s; }
.tn-ico::before { content: ''; position: absolute; inset: -4px; border-radius: 50%; background: conic-gradient(var(--ring, #e0a526) calc(var(--p) * 1%), #2b3237 0); z-index: -1; }
.tn-ico::after { content: ''; position: absolute; inset: -1px; border-radius: 50%; border: 2px solid #11161a; pointer-events: none; }
.tn-ico svg { width: 30px; height: 30px; color: #c8c2b2; }
.tn-l { font: 12px/1 var(--display); background: #11161a; border: 1px solid var(--line); border-radius: 8px; padding: 3px 6px; margin-top: -10px; position: relative; z-index: 2; }
.tn em { font: 700 12px/1.15 var(--narrow); font-style: normal; text-align: center; color: var(--bone-dim); min-height: 2.3em; }
.tn:hover .tn-ico { transform: translateY(-2px) scale(1.05); }
.tn.st-ready .tn-ico { background: radial-gradient(circle at 50% 35%, #6a5420, #2b2310); animation: tnglow 2.2s ease-in-out infinite; } .tn.st-ready .tn-ico svg { color: #ffd36b; } .tn.st-ready em { color: var(--bone); }
.tn.st-avail .tn-ico svg { color: #e8e2d4; } .tn.st-avail em { color: var(--bone); }
.tn.st-done { --ring: #8fc35a; } .tn.st-done .tn-ico { background: radial-gradient(circle at 50% 35%, #3e5a2a, #1d2a15); } .tn.st-done .tn-ico svg { color: #b6e08a; } .tn.st-done .tn-l { color: #b6e08a; }
.tn.st-locked .tn-ico { filter: grayscale(1) brightness(.6); } .tn.st-locked em { opacity: .6; }
.tn.st-busy { --ring: #4fa3e0; } .tn.st-busy .tn-ico svg { color: #9fd2ff; }
.tn.special .tn-ico { border-radius: 14px; } .tn.special .tn-ico::before { border-radius: 17px; } .tn.special .tn-ico::after { border-radius: 15px; }
.tn-lock { position: absolute; right: -4px; bottom: -2px; font-size: 13px; font-style: normal; filter: none; }
.tn-busy { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid transparent; border-top-color: #4fa3e0; animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes tnglow { 0%, 100% { box-shadow: 0 4px 10px rgba(0,0,0,.45), 0 0 0 rgba(240,185,58,0); } 50% { box-shadow: 0 4px 10px rgba(0,0,0,.45), 0 0 16px rgba(240,185,58,.55); } }
.tt-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 12px; }
.tt-legend .lg { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.lg.ready { background: #e0a526; box-shadow: 0 0 6px rgba(240,185,58,.7); } .lg.avail { background: #8a8f93; } .lg.locked { background: #3a4248; border: 1px solid #555; } .lg.done { background: #8fc35a; }
.tmodal .tm-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; } .tmodal .tm-head > div { flex: 1; }
.tmodal h2 { text-align: left !important; margin: 0 0 4px !important; font-size: 21px !important; }
.tm-ico { width: 68px; height: 68px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 3px solid var(--gold); background: radial-gradient(circle at 50% 35%, #6a5420, #2b2310); color: #ffd36b; box-shadow: 0 0 18px rgba(240,185,58,.35); }
.tm-ico svg { width: 38px; height: 38px; } .tm-ico.st-done { border-color: #8fc35a; color: #b6e08a; background: radial-gradient(circle at 50% 35%, #3e5a2a, #1d2a15); box-shadow: none; }
.tm-ico.st-locked { border-color: #555; color: #999; background: #262c30; box-shadow: none; }
.tm-lv { font-size: 13px; color: var(--bone-dim); } .tm-lv b { color: var(--gold); font-family: var(--display); }
.tm-eff { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.tm-eff > div { flex: 1; text-align: center; padding: 8px 4px; border-radius: 9px; background: rgba(0,0,0,.25); border: 1px solid var(--line); }
.tm-eff span { display: block; font: 700 10.5px/1 var(--narrow); text-transform: uppercase; color: var(--bone-dim); } .tm-eff b { display: block; margin-top: 4px; font: 19px/1 var(--display); }
.tm-eff .nx { border-color: rgba(143,195,90,.6); background: rgba(143,195,90,.1); } .tm-eff .nx b { color: #b6e08a; } .tm-eff .mx b { color: var(--gold); } .tm-eff > i { font-style: normal; color: #9fd36f; font-size: 18px; }
.tm-req { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.tm-req span { font: 700 12.5px/1 var(--narrow); padding: 5px 8px; border-radius: 7px; background: rgba(0,0,0,.25); }
.tm-req .ok { color: #9fd36f; } .tm-req .no { color: #ff9d85; border: 1px solid rgba(255,120,90,.4); }
.old-t { color: var(--bone-dim); opacity: .7; font-size: 12px; }
@media (max-width: 640px) {
  .tb-sum { grid-template-columns: repeat(3, 1fr); } .tb-sum div:nth-child(n+4) { grid-column: span 1; }
  .tn { width: 76px; } .tn-ico { width: 50px; height: 50px; } .tn-ico svg { width: 26px; height: 26px; } .tn em { font-size: 11px; }
  .tt-row { gap: 8px 6px; }
}

/* ===== пакет 17: проводник, «Путь новичка», замки разделов ===== */
#tut-ring { transition: left .25s, top .25s, width .25s, height .25s; }
#tut.spot #tut-ring { box-shadow: 0 0 0 4px rgba(240,185,58,.35), 0 0 26px rgba(240,185,58,.75), 0 0 0 9999px rgba(8,10,12,.42); }
#tut-arrow { position: fixed; width: 0; height: 0; margin-left: -14px; border: 14px solid transparent; border-top: 22px solid #ffd25e; filter: drop-shadow(0 3px 4px rgba(0,0,0,.6)); display: none; animation: tarrow .8s ease-in-out infinite; pointer-events: none; }
#tut-arrow.up { border-top: 14px solid transparent; border-bottom: 22px solid #ffd25e; animation-name: tarrowup; }
@keyframes tarrow { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
@keyframes tarrowup { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
#tut-bubble { display: flex; gap: 12px; align-items: flex-start; width: min(470px, 94vw); border-left: 0; border-radius: 14px; padding: 12px 14px 12px 12px;
  background: linear-gradient(180deg, #2f383e, #20262a); border: 1px solid #4a545b; box-shadow: 0 14px 34px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
  bottom: calc(var(--nav-h, 70px) + 18px + var(--safe-b)); transition: bottom .3s, top .3s; }
#tut-bubble.top { bottom: auto; top: calc(var(--hud-h, 64px) + 12px); }
#tut-bubble.pop { animation: tbpop .35s cubic-bezier(.2,1.4,.4,1); }
@keyframes tbpop { from { transform: translateX(-50%) scale(.85); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
#tut-face { width: 64px; height: 64px; flex: none; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); box-shadow: 0 4px 10px rgba(0,0,0,.5); }
.tb-body { flex: 1; min-width: 0; } .tb-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3px; }
.tb-head b { font: 16px/1 var(--display); color: var(--gold); } .tb-head span { font-size: 12px; color: var(--bone-dim); }
#tut-bubble p { margin: 0 0 8px; font-size: 15px; line-height: 1.38; min-height: 2.6em; }
#tut-reward { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 8px; font-size: 12px; color: var(--bone-dim); }
#tut-reward .ltiles { margin: 0; gap: 4px; } #tut-reward .lt { padding: 2px 7px 2px 3px; font-size: 12px; }
.btn.ghost { background: transparent; border: 1px solid #4a545b; box-shadow: none; color: var(--bone-dim); }
@media (max-width: 640px) { #tut-face { width: 48px; height: 48px; } #tut-bubble p { font-size: 14px; } }

#nav button.locked { opacity: .5; filter: grayscale(1); position: relative; }
#nav button.locked::after { content: '🔒'; position: absolute; top: 2px; right: 6px; font-size: 11px; filter: none; }
#btn-newbie { animation: nbwiggle 4s ease-in-out infinite; } @keyframes nbwiggle { 0%, 90%, 100% { transform: rotate(0); } 93% { transform: rotate(-12deg); } 96% { transform: rotate(12deg); } }

.nb-head { display: flex; gap: 12px; align-items: center; margin: 4px 0 10px; } .nb-head img { width: 62px; height: 62px; } .nb-head > div { flex: 1; }
.nb-head h2 { text-align: left !important; margin: 0 0 3px !important; } .nb-sub { font-size: 13px; color: var(--bone-dim); }
.nb-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 6px; }
.nb-days button { position: relative; display: grid; justify-items: center; gap: 1px; padding: 7px 0 6px; border-radius: 9px; border: 1px solid var(--line); background: #262e33; color: var(--bone); cursor: pointer; }
.nb-days b { font: 18px/1 var(--display); } .nb-days span { font-size: 10.5px; color: var(--bone-dim); }
.nb-days button.on { border-color: var(--gold); background: linear-gradient(180deg, rgba(240,185,58,.25), #262e33); }
.nb-days button.all { border-color: #5f8a3c; } .nb-days button.all span { color: #9fd36f; } .nb-days button.lock { opacity: .55; }
.nb-days .badge { position: absolute; top: -4px; right: -4px; }
.nb-task { display: flex; gap: 10px; align-items: center; padding: 9px 11px; margin-bottom: 7px; border-radius: 10px; border: 1px solid var(--line); background: #252c31; }
.nb-task.done { border-color: rgba(240,185,58,.6); background: linear-gradient(90deg, rgba(240,185,58,.12), #252c31 70%); } .nb-task.got { opacity: .6; }
.nt-main { flex: 1; min-width: 0; } .nt-t { font-weight: 700; font-size: 14.5px; } .nt-main i.bar { margin: 6px 0 6px; }
.nt-r .ltiles { margin: 0; } .nt-act b { font: 14px/1 var(--display); color: var(--bone-dim); white-space: nowrap; } .nt-ok { font-size: 22px; color: #9fd36f; }
.unl { position: relative; text-align: center; overflow: hidden; }
.unl-rays { position: absolute; left: 50%; top: 60px; width: 420px; height: 420px; margin: -210px 0 0 -210px; background: repeating-conic-gradient(rgba(240,185,58,.16) 0 10deg, transparent 10deg 20deg); animation: spin 14s linear infinite; pointer-events: none; }
.unl-i { position: relative; margin: 8px 0 14px; } .unl-i img { width: 76px; height: 76px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); animation: tbpop2 .5s cubic-bezier(.2,1.5,.4,1); }
.unl-i b { display: block; font: 21px/1.2 var(--display); color: var(--gold); margin: 6px 0; } .unl-i p { margin: 0; color: var(--bone-dim); }
@keyframes tbpop2 { from { transform: scale(.3); } to { transform: scale(1); } }
#toasts { z-index: 40 !important; }

/* ===== пакет 18: призыв героя ===== */
.summon { --rc: #ffc23a; position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, rgba(40,44,48,.92), rgba(6,8,10,.97)); overflow: hidden; animation: smIn .25s ease-out; user-select: none; }
.summon.out { animation: smOut .25s ease-in forwards; }
@keyframes smIn { from { opacity: 0; } } @keyframes smOut { to { opacity: 0; } }
.sm-rays { position: absolute; left: 50%; top: 45%; width: 1400px; height: 1400px; margin: -700px 0 0 -700px; opacity: 0; transition: opacity .6s;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--rc) 30%, transparent) 0 6deg, transparent 6deg 18deg); animation: spin 22s linear infinite; mask: radial-gradient(circle, #000 10%, transparent 60%); -webkit-mask: radial-gradient(circle, #000 10%, transparent 60%); }
.summon.glow .sm-rays { opacity: .45; } .summon.done .sm-rays { opacity: .8; } .summon.epic .sm-rays { opacity: 1; animation-duration: 9s; }
.sm-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, var(--rc), transparent 65%); opacity: 0; pointer-events: none; }
.summon.epic .sm-flash { animation: smFlash .9s ease-out; } @keyframes smFlash { 0% { opacity: .95; } 100% { opacity: 0; } }
.summon.epic .sm-stage { animation: smShake .45s; } @keyframes smShake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px, -4px); } 60% { transform: translate(-4px, -2px); } 80% { transform: translate(3px, 3px); } }
.sm-stage { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 760px; padding: 0 12px; perspective: 1000px; }
.sm-card { width: 230px; height: 330px; animation: smDrop .55s cubic-bezier(.2,1.3,.4,1) both; animation-delay: calc(var(--d) * 60ms); }
.summon.multi .sm-card { width: 118px; height: 160px; }
@keyframes smDrop { from { transform: translateY(-120vh) rotate(-8deg); } }
.summon.one:not(.open) .sm-card { animation: smDrop .55s cubic-bezier(.2,1.3,.4,1) both, smWobble .5s .9s ease-in-out infinite; }
@keyframes smWobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-3deg) scale(1.02); } 75% { transform: rotate(3deg) scale(1.02); } }
.sm-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3,1.4,.5,1); }
.sm-card.flip .sm-in { transform: rotateY(180deg); }
.sm-back, .sm-front { position: absolute; inset: 0; border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.sm-back { display: grid; place-items: center; border: 3px solid #5a5040; background: repeating-linear-gradient(45deg, #2f2a22 0 14px, #3a3328 14px 28px), #2f2a22; box-shadow: 0 10px 30px rgba(0,0,0,.6); transition: box-shadow .5s, border-color .5s; }
.sm-back span { font: 64px/1 var(--display); color: #e0a526; text-shadow: 0 3px 0 #6b4a10; } .summon.multi .sm-back span { font-size: 36px; }
.summon.glow .sm-back { border-color: var(--rc); box-shadow: 0 0 34px var(--rc), 0 0 80px color-mix(in srgb, var(--rc) 50%, transparent), 0 10px 30px rgba(0,0,0,.6); }
.sm-front { transform: rotateY(180deg); background: #1c2226; border: 3px solid var(--rc); box-shadow: 0 0 30px var(--rc); display: flex; flex-direction: column; }
.sm-front img { width: 100%; flex: 1; object-fit: cover; min-height: 0; }
.sm-front .pill { position: absolute; left: 6px; top: 6px; } .sm-front b { font: 15px/1.2 var(--display); text-align: center; padding: 5px 4px 0; } .sm-front em { font-style: normal; text-align: center; font-size: 12px; color: var(--gold); padding: 0 4px 6px; }
.summon.one .sm-front b { font-size: 20px; padding-top: 8px; }
.sm-card.r-R .sm-front { box-shadow: 0 0 12px var(--rc); }
.sm-info { position: absolute; left: 0; right: 0; bottom: calc(26px + var(--safe-b, 0px)); text-align: center; padding: 0 16px; opacity: 0; transform: translateY(30px); transition: all .4s .1s; pointer-events: none; }
.summon.done .sm-info { opacity: 1; transform: none; pointer-events: auto; }
.sm-info h2 { margin: 6px 0 4px; font: 26px/1.1 var(--display); color: #fff; text-shadow: 0 0 18px var(--rc); } .sm-info p { margin: 0 0 12px; color: var(--bone); }
.sm-info .row { justify-content: center; }
.sm-skip { position: absolute; top: calc(14px + var(--safe-t, 0px)); left: 0; right: 0; text-align: center; font-size: 12px; color: rgba(232,226,212,.5); margin: 0; }
.summon.done .sm-skip { display: none; }
.summon.one .sm-stage { margin-bottom: 120px; } .summon.multi .sm-stage { margin-bottom: 130px; }
@media (max-width: 640px) { .summon.multi .sm-card { width: 62px; height: 92px; } .summon.multi .sm-front b { font-size: 10px; } .summon.multi .sm-front em { font-size: 9px; } .summon.multi .sm-stage { gap: 6px; }
  .sm-card { width: 200px; height: 290px; } }
/* повышение уровня героя */
.ht-card { position: relative; } .lvpulse { animation: lvp .6s ease-out; } @keyframes lvp { 0% { box-shadow: 0 0 0 0 rgba(255,210,94,.9); filter: brightness(1.6); } 100% { box-shadow: 0 0 0 26px rgba(255,210,94,0); filter: none; } }
.lvfx { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); display: grid; justify-items: center; gap: 3px; pointer-events: none; z-index: 5; }
.lvfx b { font: 26px/1 var(--display); color: #ffd25e; text-shadow: 0 2px 0 #6b4a10, 0 0 14px rgba(255,200,80,.8); animation: lvUp 1.6s ease-out forwards; white-space: nowrap; }
.lvfx span { font: 700 14px/1 var(--narrow); color: #b6e08a; background: rgba(0,0,0,.6); padding: 3px 7px; border-radius: 6px; animation: lvUp 1.6s ease-out forwards; animation-delay: calc(.12s + var(--i) * .1s); opacity: 0; white-space: nowrap; }
@keyframes lvUp { 0% { opacity: 0; transform: translateY(20px) scale(.6); } 15% { opacity: 1; transform: translateY(0) scale(1.15); } 25% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-40px); } }
/* пакет 18: Таверна, Мастерская, шапка события */
.tbanner { position: relative; display: grid; grid-template-columns: 150px 1fr; gap: 14px; margin: 10px 0 12px; padding: 12px; border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(240,185,58,.55); background: radial-gradient(circle at 15% 50%, rgba(240,185,58,.28), transparent 55%), linear-gradient(110deg, #3a2a10, #1d2226 70%); box-shadow: 0 8px 22px rgba(0,0,0,.35); }
.tbanner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.08) 50%, transparent 60%); background-size: 250% 100%; animation: shine 4.5s ease-in-out infinite; pointer-events: none; }
@keyframes shine { 0% { background-position: 120% 0; } 60%, 100% { background-position: -120% 0; } }
.tb-art { width: 150px; height: 200px; object-fit: cover; border-radius: 10px; border: 2px solid var(--gold); box-shadow: 0 0 20px rgba(240,185,58,.45); }
.tb-k { font: 700 11px/1 var(--narrow); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); } .tb-txt h3 { margin: 4px 0 4px; font: 24px/1.1 var(--display); color: #fff; }
.tb-txt p { margin: 0 0 8px; font-size: 13.5px; color: var(--bone-dim); }
.tb-pity { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: 12px; color: var(--bone-dim); margin: 6px 0 10px; } .tb-pity i.bar { margin: 0; } .tb-pity em { font-style: normal; font: 13px/1 var(--display); color: var(--gold); }
.sbtn { flex: 1; display: grid !important; justify-items: center; gap: 3px; padding: 9px 8px !important; } .sbtn b { font: 15px/1 var(--display); }
.sbtn span { display: inline-flex; align-items: center; gap: 4px; font: 700 13px/1 var(--narrow); opacity: .85; } .sbtn span img { width: 16px; height: 16px; }
.tsummon { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(180deg, #2a3237, #1f2529); margin-bottom: 10px; }
.ts-h { display: flex; justify-content: space-between; align-items: center; } .ts-h h3 { margin: 0; }
.coupon-line { display: inline-flex; align-items: center; gap: 6px; font: 16px/1 var(--display); } .coupon-line img { width: 22px; height: 22px; }
.ts-rates { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 2px; } .ts-rates .r { font: 700 12px/1 var(--narrow); padding: 4px 8px; border-radius: 6px; background: rgba(0,0,0,.3); }
.ts-rates .R { color: #8fc0ec; } .ts-rates .SR { color: #c9a0f3; } .ts-rates .SSR { color: var(--gold); }
.craftc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 4px; }
.craftc button { display: grid; justify-items: center; gap: 4px; padding: 12px 6px 10px; border-radius: 12px; border: 1px solid var(--line); background: radial-gradient(circle at 50% 30%, #4a3a20, #22292d 70%); color: var(--bone); cursor: pointer; transition: transform .15s; }
.craftc button img { width: 46px; height: 46px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); } .craftc b { font: 15px/1 var(--display); } .craftc span { font-size: 12px; color: var(--gold); }
.craftc button:not(:disabled):hover { transform: translateY(-2px); border-color: var(--gold); } .craftc button:disabled { opacity: .5; cursor: default; }
.evhead { --ec: #e0a526; display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px; margin: 8px 0 10px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--ec) 60%, transparent);
  background: radial-gradient(circle at 10% 50%, color-mix(in srgb, var(--ec) 30%, transparent), transparent 60%), #22292d; }
.evhead img { width: 60px; height: 60px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); } .evhead h2 { text-align: left !important; margin: 3px 0 4px !important; font-size: 21px !important; color: #fff; }
.evhead p { margin: 0; font-size: 13px; color: var(--bone-dim); } .eh-k { font: 700 11px/1 var(--narrow); text-transform: uppercase; letter-spacing: .06em; color: var(--ec); }
.eh-pts { text-align: center; padding: 6px 10px; border-radius: 10px; background: rgba(0,0,0,.3); } .eh-pts b { display: block; font: 26px/1 var(--display); color: var(--ec); } .eh-pts span { font-size: 11px; color: var(--bone-dim); }
.cd.build { border-top-color: #d9813a; } .cd.drill { border-top-color: #9b6fd0; }
@media (max-width: 640px) { .tbanner { grid-template-columns: 96px 1fr; } .tb-art { width: 96px; height: 140px; } .tb-txt h3 { font-size: 19px; } .evhead { grid-template-columns: 44px 1fr; } .evhead img { width: 44px; height: 44px; } .eh-pts { grid-column: 1 / -1; display: flex; gap: 8px; align-items: baseline; justify-content: center; } .eh-pts b { display: inline; } }
/* пакет 19: мессенджеры в настройках */
.msg-nets { display: grid; gap: 6px; margin: 6px 0; }
.msg-net { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: #262e33; }
.msg-net b { flex: 1; font: 15px/1 var(--display); color: var(--bone); } .msg-net .ok { color: #9fd36f; font-size: 13px; }
.msg-net.tg { box-shadow: inset 3px 0 0 #2aa3e0; } .msg-net.vk { box-shadow: inset 3px 0 0 #4a76a8; } .msg-net.max { box-shadow: inset 3px 0 0 #8a5cf6; }
.msg-net .btn { text-decoration: none; }
.msg-code { font-family: var(--display); letter-spacing: .12em; color: var(--gold); }

/* 6.1: живая 3D-карточка героя */
.hc3d { position: absolute; left: 0; right: 0; top: 0; bottom: 23.5%; overflow: hidden; opacity: 0; transition: opacity .35s; touch-action: pan-y; }
.hc3d.ready { opacity: 1; }
.hc3d-bg { position: absolute; inset: 0; background-size: cover; background-position: center top; }
.hc3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.hc3d-tip { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); white-space: nowrap; font-size: 10px; color: #e8e2d4; background: rgba(0,0,0,.45); padding: 2px 7px; border-radius: 8px; pointer-events: none; transition: opacity .4s; }
.hc3d.used .hc3d-tip { opacity: 0; }
.ht-card .pill { z-index: 2; }

/* =====================================================================
   6.3: окна поверх верхнего меню; телефон — всё в один экран, без прокрутки страницы
   ===================================================================== */
html, body { position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; touch-action: manipulation; }
#hud { z-index: 16; } #nav { z-index: 18; } #panel { z-index: 17; }
/* окно перекрывает ресурсы и кнопки сверху; снизу остаётся место под нижнее меню */
#panel { padding: calc(8px + var(--safe-t)) 0 var(--nav-h); place-items: center; }
#panel-card { margin: 0; max-height: calc(100vh - var(--nav-h) - var(--safe-t) - 20px); max-height: calc(100dvh - var(--nav-h) - var(--safe-t) - 20px); }
@media (max-width: 700px) {
  #panel { padding: calc(4px + var(--safe-t)) 0 var(--nav-h); place-items: end center; }
  #panel-card { width: 100vw; margin: 0; max-height: calc(100vh - var(--nav-h) - var(--safe-t) - 6px); max-height: calc(100dvh - var(--nav-h) - var(--safe-t) - 6px); }
  /* ресурсы: сетка 4 в ряд на всю ширину вместо ленты, которую нужно листать */
  #hud { left: 4px; right: 4px; gap: 4px; }
  #res-tags { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; width: 100%; overflow: visible; flex-wrap: initial; }
  .tag, .tag.energy { min-width: 0; width: auto; padding: 2px 6px 2px 2px; gap: 3px; border-radius: 8px; }
  .tag img { width: 20px; height: 20px; flex: 0 0 20px; } .tag .v { font-size: 12px; white-space: nowrap; } .tag .r { font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tag::after { display: none; } .tag > div { min-width: 0; overflow: hidden; }
  #hud-right { width: 100%; gap: 4px; justify-content: space-between; } .icon-btn { width: 36px; height: 36px; }
  #power-tag { padding: 0 8px; }
  #chat { width: min(300px, 58vw); }
  #armies { right: 4px; }
}
/* телефон боком: низкая высота — всё компактнее */
@media (max-height: 480px) {
  #res-tags { display: flex; flex-wrap: wrap; } .tag img { width: 18px; height: 18px; } .tag .r { display: none; }
  .icon-btn { width: 32px; height: 32px; } #nav button { padding: 3px 4px; font-size: 11px; }
  #panel-card { max-height: calc(100dvh - var(--nav-h) - 10px); }
}

/* ===== 6.5: профиль, аватар и рамки, шапка из 5 ресурсов, правая панель кнопок в 2 столбца ===== */
#btn-profile { position: relative; pointer-events: auto; border: 0; background: none; padding: 0; width: 46px; height: 46px; flex: none; cursor: pointer; }
#btn-profile .ava { --s: 42px; margin: 2px; }
.vipb { display: inline-block; font: 800 10px/1 var(--narrow); color: #1c1408; background: linear-gradient(180deg, #c98a4b, #7a4b22); border-radius: 6px; padding: 2px 5px; font-style: normal; }
.vipb.v1 { background: linear-gradient(180deg, #e9ecef, #8d969c); } .vipb.v2 { background: linear-gradient(180deg, #ffe07a, #c08a12); } .vipb.v3 { background: linear-gradient(180deg, #fff2b0, #e0a526); box-shadow: 0 0 6px #f2c94c; }
#btn-profile .vipb { position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); min-width: 18px; text-align: center; }
#btn-profile .vipb::before { content: 'V'; margin-right: 1px; opacity: .7; }
.ava { --s: 40px; --ring: none; position: relative; display: inline-block; width: var(--s); height: var(--s); border-radius: 50%; flex: none; vertical-align: middle; }
.ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; background: radial-gradient(circle at 40% 30%, #4a545b, #1c2124); }
.ava.empty img { padding: 18%; box-sizing: border-box; }
.ava::after { content: ''; position: absolute; inset: calc(var(--s) * -0.09); border-radius: 50%; background: var(--ring); pointer-events: none;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--s) * 0.1), #000 calc(100% - var(--s) * 0.1 + 1px)); mask: radial-gradient(farthest-side, transparent calc(100% - var(--s) * 0.1), #000 calc(100% - var(--s) * 0.1 + 1px)); }
.ava.big { --s: 92px; }
.fr-none { --ring: #12171a; }
.fr-rust { --ring: repeating-conic-gradient(#8a4a22 0 12deg, #5a2e14 12deg 24deg, #b0642c 24deg 30deg); }
.fr-vip1 { --ring: conic-gradient(#c98a4b, #f0c08a, #7a4b22, #c98a4b, #f0c08a, #7a4b22, #c98a4b); }
.fr-vip5 { --ring: conic-gradient(#e9ecef, #8d969c, #ffffff, #8d969c, #e9ecef, #6d767c, #e9ecef); }
.fr-vip10 { --ring: conic-gradient(#ffe07a, #b8860b, #fff2b0, #c08a12, #ffe07a, #9a6d12, #ffe07a); }
.fr-vip10::after, .fr-vip15::after { filter: drop-shadow(0 0 3px rgba(242,201,76,.8)); }
.fr-vip15 { --ring: conic-gradient(#fff2b0, #e0a526, #ff6a3a, #e0a526, #fff2b0, #b8860b, #fff2b0); }
.fr-vip15::before { content: '👑'; position: absolute; left: 50%; top: calc(var(--s) * -0.42); transform: translateX(-50%); font-size: calc(var(--s) * 0.38); z-index: 1; filter: drop-shadow(0 1px 1px #000); }
.fr-hq5 { --ring: conic-gradient(#5f8a3a, #a8d070, #3a5a20, #5f8a3a); }
.fr-hq15 { --ring: conic-gradient(#4f8fd0, #a8d0f0, #2a4a70, #4f8fd0, #a8d0f0, #2a4a70, #4f8fd0); }
.fr-hq25 { --ring: conic-gradient(#9b6fd0, #e0c0ff, #4a2a70, #d06fb0, #9b6fd0); }
.fr-hq25::after { filter: drop-shadow(0 0 4px rgba(155,111,208,.9)); }
.fr-ally { --ring: repeating-conic-gradient(#b8302a 0 30deg, #e8e2d4 30deg 36deg); }
.fr-hunter { --ring: repeating-conic-gradient(#e8e2d4 0 8deg, #6a5a44 8deg 20deg); }
.fr-arena { --ring: conic-gradient(#8a1a1a, #e05040, #3a0a0a, #e05040, #8a1a1a); }
.fr-season { --ring: repeating-conic-gradient(#2fa37a 0 20deg, #bff0d8 20deg 26deg, #e8c860 26deg 30deg); }
.fr-toxic { --ring: conic-gradient(#9cff3a, #2a6a10, #d8ff8a, #2a6a10, #9cff3a); }
.fr-toxic::after { filter: drop-shadow(0 0 5px rgba(156,255,58,.9)); animation: tox 2.4s ease-in-out infinite; }
@keyframes tox { 50% { filter: drop-shadow(0 0 1px rgba(156,255,58,.4)); } }

#hud { align-items: center; }
#res-tags { flex-wrap: nowrap; align-items: stretch; }
.tag.power .v { color: #ffd88a; }
.tag.allres { cursor: pointer; padding-right: 8px; color: var(--bone); font: inherit; }
.tag.allres .v { font-size: 13px; }
#hud-right { position: absolute; right: 0; top: calc(100% + 8px); margin: 0; width: auto; display: grid; grid-template-columns: repeat(2, 54px); gap: 8px 6px; justify-content: end; }
#hud-right .icon-btn { width: 54px; height: auto; min-height: 54px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 5px 2px 4px; }
#hud-right .icon-btn img { width: 26px; height: 26px; }
#hud-right .icon-btn > span { font: 700 10px/1 var(--narrow); color: var(--bone); letter-spacing: .01em; white-space: nowrap; text-shadow: 0 1px 1px #000; }
#hud-right .icon-btn[hidden] { display: none; }
#btn-vip { background: radial-gradient(circle at 35% 30%, #7a6230, #3a2c10); }
#btn-events { background: radial-gradient(circle at 35% 30%, #7a3a30, #3a1610); }
#queues:empty { display: none; }

.pf-head { display: flex; gap: 16px; align-items: center; margin: 6px 0 4px; }
.pf-info h3 { margin: 0 0 4px; color: var(--bone); font-size: 20px; }
.pf-pow { display: flex; align-items: center; gap: 6px; margin: 6px 0; font: 18px/1 var(--display); color: #ffd88a; } .pf-pow img { width: 22px; height: 22px; }
.coord { background: rgba(24,28,31,.85); border: 1px solid #3a4248; color: #ffd88a; font: 700 13px/1 var(--narrow); padding: 6px 9px; border-radius: 8px; cursor: pointer; }
.coord:hover { border-color: var(--gold); }
.coordbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.av-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; }
.av-opt, .av-up { width: 58px; height: 58px; border-radius: 50%; border: 2px solid #2c3338; background: #1c2124; padding: 0; overflow: hidden; cursor: pointer; display: grid; place-items: center; color: var(--bone); }
.av-opt img { width: 100%; height: 100%; object-fit: cover; } .av-opt.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(242,201,76,.4); }
.av-up { flex-direction: column; border-style: dashed; font: 700 11px/1 var(--narrow); } .av-up b { font-size: 22px; line-height: 1; }
.av-opt.reset { font-size: 18px; color: var(--bone-dim); }
.fr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.fr-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; border-radius: 10px; background: rgba(24,28,31,.7); border: 1px solid #2c3338; color: var(--bone); cursor: pointer; }
.fr-opt .ava { --s: 46px; margin-bottom: 4px; } .fr-opt b { font: 700 12px/1.1 var(--narrow); text-align: center; } .fr-opt span { font: 11px/1.1 var(--narrow); color: var(--bone-dim); text-align: center; }
.fr-opt.on { border-color: var(--gold); background: rgba(90,70,20,.45); } .fr-opt.locked { opacity: .55; } .fr-opt.locked .ava { filter: grayscale(1); }
.vipt { width: 100%; font-size: 13px; } .vipt td, .vipt th { padding: 5px 6px; text-align: left; } .vipt tr.me td { color: var(--gold); font-weight: 700; }
.vipall summary { cursor: pointer; margin: 10px 0 6px; color: var(--bone-dim); }
.allres { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin: 8px 0; }
.allres .ar { display: grid; grid-template-columns: 28px 1fr auto; grid-template-rows: auto auto; gap: 0 8px; align-items: center; background: rgba(24,28,31,.7); border-radius: 8px; padding: 6px 8px; }
.allres .ar img { width: 28px; height: 28px; grid-row: span 2; } .allres .ar b { font: 700 12px/1 var(--narrow); color: var(--bone-dim); } .allres .ar span { font: 16px/1 var(--display); grid-column: 2; }
.allres .ar em { grid-column: 3; grid-row: 1 / span 2; font: 11px/1 var(--narrow); color: #9fb98a; font-style: normal; } .allres .ar.full span { color: var(--gold); }
.ev-list { display: grid; gap: 6px; }
.ev-row { display: grid; grid-template-columns: 36px 1fr auto; grid-template-rows: auto auto; gap: 1px 10px; align-items: center; text-align: left; background: rgba(24,28,31,.75); border: 1px solid #2c3338; border-radius: 10px; padding: 8px 10px; color: var(--bone); cursor: pointer; }
.ev-row img { width: 34px; height: 34px; grid-row: span 2; } .ev-row b { font: 15px/1.1 var(--display); } .ev-row span { font: 12px/1.2 var(--narrow); color: var(--bone-dim); grid-column: 2; } .ev-row i { grid-column: 3; grid-row: 1 / span 2; font-style: normal; font-size: 22px; color: var(--gold); }
.ev-row:hover { border-color: var(--gold); }
.ev-links { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.sz-ico { font-size: 44px; line-height: 1; }
.near-list { display: grid; gap: 6px; max-height: 55vh; overflow: auto; }
.nr { display: grid; grid-template-columns: 1fr auto auto; grid-template-rows: auto auto; gap: 2px 8px; align-items: center; background: rgba(24,28,31,.7); border-radius: 8px; padding: 6px 8px; }
.nr b { font: 14px/1.1 var(--display); color: var(--bone); } .nr span { font: 12px/1 var(--narrow); color: var(--bone-dim); grid-column: 1; } .nr .coord, .nr .btn { grid-row: 1 / span 2; } .nr.ally b { color: #8cc0ff; }
.map-tools { display: flex; gap: 4px; margin-top: 4px; }
#armies .map-tools button { min-width: 0; flex: 1; border-left: 0; text-align: center; border-radius: 6px; padding: 7px 6px; font-size: 13px; }
.clink { color: #ffd88a; text-decoration: underline; cursor: pointer; white-space: nowrap; }

@media (max-width: 700px) {
  #hud { flex-wrap: nowrap; gap: 4px; align-items: center; }
  #btn-profile { width: 40px; height: 40px; } #btn-profile .ava { --s: 36px; }
  #res-tags { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) 30px; gap: 3px; flex: 1; min-width: 0; width: auto; }
  .tag .r { display: none; } .tag, .tag.energy { padding: 3px 5px 3px 2px; min-height: 30px; }
  .tag img { width: 20px; height: 20px; flex: 0 0 20px; padding: 2px; } .tag .v { font-size: 12px; }
  .tag.allres { padding: 0; justify-content: center; } .tag.allres img { display: none; } .tag.allres .v { font-size: 15px; }
  #hud-right { top: calc(100% + 6px); grid-template-columns: repeat(2, 46px); gap: 6px 5px; width: auto; justify-content: end; }
  #hud-right .icon-btn { width: 46px; min-height: 46px; padding: 4px 1px 3px; border-radius: 12px; } #hud-right .icon-btn img { width: 22px; height: 22px; }
  #hud-right .icon-btn > span { font-size: 9px; }
  .ava.big { --s: 76px; } .pf-head { gap: 12px; }
}
@media (max-height: 480px) { #hud-right { grid-template-columns: repeat(4, 42px); } #hud-right .icon-btn { width: 42px; min-height: 42px; } #hud-right .icon-btn > span { display: none; } }
.tag.allres { min-width: 0 !important; width: auto; flex: none; }
.vipt th:not(:first-child), .vipt td:not(:first-child) { text-align: right; white-space: nowrap; }
.vipt td:first-child { color: var(--bone-dim); }
#armies .map-tools button { display: block; grid-template-columns: none; padding: 6px 4px; }
@media (max-width: 700px) { #armies { right: auto; max-width: calc(100vw - 120px); top: calc(56px + var(--safe-t, 0px)); } #armies button { min-width: 140px; }
  .tag .v { font-size: 11.5px; letter-spacing: -.01em; } .tag, .tag.energy { padding: 3px 4px 3px 2px; gap: 2px; } .tag img { width: 18px; height: 18px; flex-basis: 18px; padding: 1px; }
  #res-tags { grid-template-columns: repeat(5, minmax(0, 1fr)) 24px; } }
.nr { grid-template-columns: 1fr auto; } .nr b { grid-column: 1; grid-row: 1; } .nr span { grid-column: 1; grid-row: 2; } .nr .coord { grid-column: 2; grid-row: 1; } .nr .btn { grid-column: 2; grid-row: 2; }
@media (max-width: 700px) { .tag .mx { display: none; } }
.tag.allres { display: flex !important; grid-template-columns: none; width: auto !important; padding: 4px 9px 4px 4px; }

/* ===== 6.6: объёмные рамки, иконки и металлические плашки (рендер из моделей KayKit/Quaternius CC0 и эмблем game-icons.net) ===== */
.ava::after, .fr-vip15::before { display: none !important; content: none; }
.ava .frm { position: absolute; inset: -26%; background: center / contain no-repeat; pointer-events: none; z-index: 1; }
.ava { --s: 40px; }
#btn-profile { width: 58px; height: 58px; margin: -4px -2px -4px -4px; }
#btn-profile .ava { --s: 38px; margin: 10px; }
#btn-profile .vipb { bottom: 0; z-index: 2; }
.fr-opt .ava { --s: 44px; margin: 14px 0 12px; }
.ava.big { --s: 88px; margin: 22px; }
.pf-head { gap: 6px; }
/* металлические кнопки */
.btn { border: 8px solid transparent; border-image: url(/assets/ui/btn.webp) 24 fill / 8px stretch; background: none !important; box-shadow: none !important; padding: 4px 9px; border-radius: 0; text-shadow: 0 1px 1px rgba(0,0,0,.6); }
.btn.primary { border-image-source: url(/assets/ui/btn_primary.webp); color: #2a1c04; text-shadow: 0 1px 0 rgba(255,240,200,.5); }
.btn.danger { border-image-source: url(/assets/ui/btn_danger.webp); color: #fff3ec; }
.btn.small { border-width: 6px; border-image-width: 6px; padding: 2px 6px; }
.btn.buy { padding: 6px 12px; }
.btn:active:not(:disabled) { transform: translateY(1px); filter: brightness(.95); }
.btn.ghost, .btn.invited { border-image: none; border: 1px solid #4a545b; }
#hud-right .icon-btn { border: 10px solid transparent; border-image: url(/assets/ui/sq.webp) 28 fill / 10px stretch; background: none; box-shadow: none; border-radius: 0; padding: 0 0 2px; gap: 0; }
#hud-right .icon-btn img { width: 34px; height: 34px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); margin-top: -4px; }
#btn-vip { border-image-source: url(/assets/ui/sq_gold.webp) !important; } #btn-events { border-image-source: url(/assets/ui/sq_red.webp) !important; }
#btn-vip > span { color: #2a1c04 !important; text-shadow: 0 1px 0 rgba(255,240,200,.5) !important; }
.icon-btn .badge { top: -9px !important; right: -9px !important; z-index: 2; }
/* плашки ресурсов */
.tag { border: 9px solid transparent; border-image: url(/assets/ui/tag.webp) 24 fill / 9px stretch; background: none !important; box-shadow: none !important; border-radius: 0; padding: 0 8px 0 0 !important; }
.tag.caps { border-image-source: url(/assets/ui/tag_caps.webp); }
.tag img { width: 30px !important; height: 30px !important; padding: 0 !important; background: none !important; box-shadow: none !important; margin: -6px 0 -6px -4px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.55)); flex: 0 0 auto; }
.tag.allres { padding: 0 6px 0 0 !important; }
.tag.full { box-shadow: none !important; } .tag.full .v { color: var(--gold); }
/* иконки в наградах, ценах и магазине — с тенью */
.lt img, .cost img, .si-ico, .cc-ico img, .ev-row img, .allres .ar img, .pf-pow img { filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.si-ico { width: 64px !important; height: 64px !important; }
.cc-ico img { width: 72px; height: 72px; }
#nav button img { width: 34px; height: 34px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); }
#nav button:not(.active) img { filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)) saturate(.55) brightness(.85); }
/* профиль: табличка с ником */
.pf-info h3 { display: inline-block; padding: 6px 16px 7px; border: 10px solid transparent; border-image: url(/assets/ui/name.webp) 26 fill / 10px stretch; margin: 0 0 6px -6px; }
@media (max-width: 700px) {
  .tag { border-width: 7px; border-image-width: 7px; padding: 0 4px 0 0 !important; } .tag img { width: 24px !important; height: 24px !important; margin: -4px 0 -4px -3px; }
  #btn-profile { width: 50px; height: 50px; } #btn-profile .ava { --s: 32px; margin: 9px; }
  #hud-right .icon-btn { border-width: 8px; border-image-width: 8px; } #hud-right .icon-btn img { width: 28px; height: 28px; }
  #nav button img { width: 28px; height: 28px; }
}
.pf-head { padding: 4px 14px 4px 0; border: 14px solid transparent; border-image: url(/assets/ui/card.webp) 40 fill / 14px stretch; margin: 4px 0 10px; }
.fr-opt { border: 10px solid transparent; border-image: url(/assets/ui/card.webp) 40 fill / 10px stretch; background: none; border-radius: 0; padding: 0 2px 4px; }
.fr-opt.on { border-image-source: url(/assets/ui/card_gold.webp); background: none; }
.fr-opt .ava { --s: 56px; margin: 18px 0 16px; }
.fr-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.ava.big { --s: 100px; margin: 26px; }
.vipt td:first-child { width: 55%; }
.credits { font-size: 11px; color: var(--bone-dim); margin-top: 10px; }
#btn-vip > span { color: #ffe9a8 !important; text-shadow: 0 1px 1px #000 !important; }
@media (max-width: 700px) {
  .tag, .tag.energy { border-width: 5px; border-image-width: 5px; padding: 0 3px 0 0 !important; gap: 2px; }
  .tag img { width: 20px !important; height: 20px !important; margin: -3px 0 -3px -2px; }
  .tag.allres { padding: 0 !important; }
}

/* ===== 6.7: чат с аватарами, карточка игрока, личные сообщения, мировой босс ===== */
.ava.mini { --s: 24px; margin: 6px; flex: none; }
#chat-log .cmsg { display: flex; align-items: flex-start; gap: 2px; margin: 2px 0; }
#chat-log .cm-b { flex: 1; min-width: 0; padding-top: 5px; line-height: 1.3; }
#chat-log .cm-b b { cursor: pointer; } #chat-log .cm-b b:hover { color: var(--gold); }
#chat-log .cm-t { cursor: pointer; word-break: break-word; }
#chat-log .vipb { margin-left: 4px; font-size: 9px; padding: 1px 4px; vertical-align: 1px; }
#chat-log .sysmsg { color: #ffb08a; font-weight: 700; padding: 4px 6px; margin: 3px 0; background: rgba(160,40,20,.18); border-left: 3px solid #d0502a; }
#chat-dm { position: relative; color: #ffd88a !important; }
#chat-dm .badge { position: absolute; top: -6px; right: -6px; }
.online { color: #7ad05a; font-style: normal; font-weight: 700; }
.pl-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 8px 0; }
.pl-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pl-stats div { background: rgba(24,28,31,.7); border-radius: 8px; padding: 8px 4px; text-align: center; } .pl-stats b { display: block; font: 18px/1 var(--display); color: var(--bone); } .pl-stats span { font: 11px/1.2 var(--narrow); color: var(--bone-dim); }
.pl-heroes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.plh { display: flex; flex-direction: column; align-items: center; background: rgba(24,28,31,.7); border-radius: 8px; padding: 4px; text-align: center; }
.plh img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; } .plh b { font: 700 11px/1.1 var(--narrow); margin-top: 3px; } .plh span { font-size: 10px; color: var(--gold); } .plh em { font-style: normal; font-size: 10px; color: var(--bone-dim); }
.rep-r { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 8px 0; } .rep-q, .msg-q p { background: rgba(0,0,0,.3); padding: 8px 10px; border-radius: 8px; font-style: italic; word-break: break-word; }
.msg-q { display: flex; gap: 6px; align-items: flex-start; margin-bottom: 10px; } .msg-q p { margin: 4px 0 0; font-style: normal; }
.act-list { display: grid; gap: 6px; }
.dm-list { display: grid; gap: 6px; }
.dm-row { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; background: rgba(24,28,31,.75); border: 1px solid #2c3338; border-radius: 10px; padding: 4px 10px 4px 2px; color: var(--bone); text-align: left; cursor: pointer; }
.dm-row span { min-width: 0; } .dm-row b { display: block; font: 14px/1.2 var(--display); } .dm-row em { display: block; font-style: normal; font-size: 12px; color: var(--bone-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-row small { font-size: 11px; color: var(--bone-dim); } .dm-row.new { border-color: var(--gold); } .dm-row .badge { position: absolute; top: -5px; right: -5px; }
.dm-head { display: flex; align-items: center; gap: 4px; margin: -4px 40px 6px 0; } .dm-head b { font: 17px/1 var(--display); cursor: pointer; } .dm-head .online { font-size: 12px; margin-left: 6px; }
.dm-log { height: min(52vh, 460px); overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: rgba(0,0,0,.25); border-radius: 10px; }
.dmm { max-width: 80%; align-self: flex-start; } .dmm p { margin: 0; padding: 7px 11px; background: #343c42; border-radius: 12px 12px 12px 3px; word-break: break-word; }
.dmm.mine { align-self: flex-end; text-align: right; } .dmm.mine p { background: #5a4a1e; border-radius: 12px 12px 3px 12px; text-align: left; }
.dmm small { font-size: 10px; color: var(--bone-dim); } .dmm small a { color: #c86a4a; cursor: pointer; margin-left: 6px; }
.dm-f { display: flex; gap: 6px; margin-top: 8px; } .dm-f input { flex: 1; }
.wb-head { display: flex; gap: 12px; align-items: center; } .wb-head img { width: 96px; height: 96px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.6)); } .wb-head h2 { margin: 2px 0; text-align: left; color: #ff9a7a; } .wb-head p { margin: 0; color: var(--bone-dim); }
.wb-hp { position: relative; height: 26px; background: #1a0d0b; border: 2px solid #5a1a10; border-radius: 13px; overflow: hidden; margin: 10px 0; }
.wb-hp u { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#ff5a3a, #a01a0a); } .wb-hp b { position: relative; display: block; text-align: center; font: 13px/22px var(--display); text-shadow: 0 1px 2px #000; }
.wb-me { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; } .wb-me div { background: rgba(24,28,31,.7); border-radius: 8px; padding: 8px; text-align: center; } .wb-me b { display: block; font: 20px/1 var(--display); color: var(--gold); } .wb-me span { font-size: 11px; color: var(--bone-dim); }
.wb-top { display: grid; gap: 4px; } .wbt { display: grid; grid-template-columns: 22px auto 1fr auto; align-items: center; gap: 4px; background: rgba(24,28,31,.7); border-radius: 8px; padding: 0 10px 0 6px; cursor: pointer; }
.wbt i { font-style: normal; font: 15px var(--display); color: var(--gold); } .wbt b { font: 13px/1.1 var(--narrow); font-weight: 700; } .wbt em { font-style: normal; color: #ff9a7a; font-weight: 700; } .wbt.me { outline: 1px solid var(--gold); }
.wb-banner { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; width: 100%; margin-bottom: 10px; padding: 6px 12px 6px 6px; text-align: left; border: 1px solid #a0301a; border-radius: 12px; background: linear-gradient(90deg, rgba(160,40,20,.5), rgba(40,20,16,.6)); color: var(--bone); cursor: pointer; animation: wbpulse 2s ease-in-out infinite; }
.wb-banner img { width: 56px; height: 56px; } .wb-banner b { display: block; font: 16px/1.1 var(--display); color: #ffb08a; } .wb-banner em { font-style: normal; font-size: 12px; color: var(--bone-dim); } .wb-banner i { font-style: normal; font-size: 24px; color: #ffb08a; }
@keyframes wbpulse { 50% { box-shadow: 0 0 14px rgba(255,80,40,.45); } }
#btn-boss { border-image-source: url(/assets/ui/sq_red.webp) !important; animation: wbpulse 2s ease-in-out infinite; }
.c-lbl.wboss { background: rgba(120,20,10,.9) !important; color: #ffe0d0 !important; border-color: #ff5030 !important; font-weight: 700; }
.wbl-hp { display: block; width: 90px; height: 5px; background: #2a0a06; margin: 3px auto 0; border-radius: 3px; overflow: hidden; } .wbl-hp u { display: block; height: 100%; background: #ff4a2a; }
@media (max-width: 700px) { .pl-stats { grid-template-columns: repeat(2, 1fr); } .pl-heroes { grid-template-columns: repeat(3, 1fr); } .wb-head img { width: 72px; height: 72px; } }

/* ===== 6.8: война районов, опорные пункты, подсказки ===== */
.war-st { margin: 6px 0 10px; padding: 8px 12px; border-radius: 10px; background: rgba(24,28,31,.75); border: 1px solid #3a4248; color: var(--bone-dim); font-weight: 700; text-align: center; }
.war-st.on { background: linear-gradient(90deg, rgba(160,40,20,.55), rgba(60,20,14,.6)); border-color: #c0402a; color: #ffd0b8; animation: wbpulse 2s ease-in-out infinite; }
.war-me { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0; } .war-me div { background: rgba(24,28,31,.7); border-radius: 8px; padding: 8px 4px; text-align: center; } .war-me b { display: block; font: 19px/1 var(--display); color: var(--gold); } .war-me span { font-size: 11px; color: var(--bone-dim); }
.op-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.op { display: grid; grid-template-rows: auto auto auto; gap: 3px; background: rgba(24,28,31,.75); border: 1px solid #2c3338; border-left: 4px solid #6a6a6a; border-radius: 8px; padding: 7px 9px; }
.op b { font: 14px/1.1 var(--display); color: var(--bone); } .op span { font-size: 12px; color: var(--bone-dim); } .op .coord { justify-self: start; padding: 4px 7px; font-size: 12px; }
.op.taken { border-left-color: #d8503a; } .op.mine { border-left-color: #4f8fe0; background: rgba(40,70,110,.35); }
.war-help p { margin: 0 0 10px; line-height: 1.45; }
.c-lbl.outpost { border-color: #9a9a9a !important; } .c-lbl.outpost.me { border-color: #4f8fe0 !important; color: #cfe2ff !important; } .c-lbl.outpost.other { border-color: #d8503a !important; }
.tip-bubble { position: relative; margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: linear-gradient(180deg, rgba(90,70,20,.85), rgba(50,40,14,.85)); border: 1px solid var(--gold); }
.tip-bubble b { color: var(--gold); } .tip-bubble p { margin: 4px 0 8px; font-size: 13px; }
@media (max-width: 700px) { .war-me { grid-template-columns: repeat(2, 1fr); } .op-list { grid-template-columns: 1fr 1fr; } }

/* ===== 6.9: предложения, цвет ника ===== */
.offers-list { display: grid; gap: 10px; }
.offer-card { position: relative; padding: 12px 14px 14px; border: 12px solid transparent; border-image: url(/assets/ui/card_gold.webp) 40 fill / 12px stretch; }
.offer-card .of-x { position: absolute; top: -10px; right: 6px; background: linear-gradient(#ff6a3a, #c0301a); color: #fff; font: 800 12px/1 var(--narrow); padding: 5px 9px; border-radius: 10px; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.offer-card .of-t { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; } .offer-card .of-t b { font: 18px/1.1 var(--display); color: #ffd88a; } .offer-card .of-t span { font-size: 12px; color: #ffb08a; white-space: nowrap; }
.offer-card .of-f { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 8px; } .offer-card .of-f s { color: var(--bone-dim); font-size: 14px; }
.offer-card .of-heal { color: #8cd06a; font-weight: 700; margin: 6px 0 0; }
.offer-card.big .of-t b { font-size: 22px; }
.nick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.nick-opt { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 8px; border: 1px solid #2c3338; background: rgba(24,28,31,.75); color: var(--bone); cursor: pointer; text-align: left; }
.nick-opt b { font: 15px/1.1 var(--display); } .nick-opt span { font-size: 11px; color: var(--bone-dim); } .nick-opt.on { border-color: var(--gold); }

/* 6.11: предложение скачать Android-приложение на экране входа */
.app-offer { position: relative; display: grid; gap: 6px; margin-top: 14px; padding: 12px 34px 12px 14px; border: 1px solid rgba(240,166,58,.45); border-radius: 10px; background: rgba(240,166,58,.08); text-align: left; }
.app-offer b { color: #ffd060; }
.app-offer span { font-size: 13px; opacity: .85; }
.app-offer .btn { justify-self: start; text-decoration: none; }
.app-offer .x { position: absolute; top: 6px; right: 6px; background: none; border: 0; color: inherit; opacity: .6; font-size: 16px; cursor: pointer; }
