/* ZALP: уровень персонажа и окно достижений */
#za-root, .za-lvpill, .za-btn {
  --za-ink: #1a1340;
  --za-out-sm: 0 1px 0 #1a1340, 1px 0 0 #1a1340, -1px 0 0 #1a1340, 0 -1px 0 #1a1340;
  --za-out: 0 2px 0 #1a1340, 2px 0 0 #1a1340, -2px 0 0 #1a1340, 0 -2px 0 #1a1340;
}

/* ---------- кнопки в верхней панели ---------- */
:root:not(#zz#zz) #vw-bar .za-btn {
  padding-left: 34px !important;
  background-image: url(/img/zalp-ach/ach-win.webp), linear-gradient(180deg, var(--z-panel-top, #4b3cc4), var(--z-panel-bot, #2a1e84)) !important;
  background-size: 24px 24px, auto !important;
  background-position: 6px 50%, 0 0 !important;
  background-repeat: no-repeat !important;
}
:root:not(#zz#zz) #vw-bar .za-lvpill {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 2px 12px 2px 4px !important;
}
:root:not(#zz#zz) #vw-bar .za-lvpill[hidden] { display: none !important; }
.za-lvtxt { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; line-height: 1; }
.za-lvtxt i { font-style: normal; font-weight: 900; }
.za-lvbar, .za-lvbar > s { display: block; height: 6px; border-radius: 999px; text-decoration: none; }
.za-lvbar { width: 64px; background: rgba(10, 6, 40, .6); border: 2px solid var(--za-ink); overflow: hidden; }
.za-lvbar > s { background: linear-gradient(90deg, #9cf58c, #3fd13a); }

/* шестиугольный значок уровня (цвета ранга в --t1..--t3) */
.za-hex {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 30px;
  background: var(--za-ink);
  clip-path: polygon(25% 2%, 75% 2%, 99% 50%, 75% 98%, 25% 98%, 1% 50%);
}
.za-hex::before {
  content: "";
  position: absolute;
  inset: 3px;
  clip-path: inherit;
  background: radial-gradient(circle at 50% 35%, var(--t1) 0, var(--t2) 55%, var(--t3) 100%);
}
.za-hex b { position: relative; font-weight: 900; font-size: 14px; color: #fff; text-shadow: var(--za-out-sm); }
.za-hex-sm { width: 30px; height: 26px; }
.za-hex-sm b { font-size: 12px; }
.za-hex-lg { width: 96px; height: 84px; filter: drop-shadow(0 4px 0 var(--za-ink)) drop-shadow(0 0 14px var(--t2)); }
.za-hex-lg::before { inset: 5px; }
.za-hex-lg b { font-size: 36px; text-shadow: var(--za-out); }

/* ---------- окно ---------- */
#za-root {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 4, 30, .6);
  opacity: 0;
  transition: opacity .18s ease;
  font-family: var(--z-font, "Rubik", "Montserrat", system-ui, sans-serif);
  color: #fff;
}
#za-root[hidden] { display: none; }
#za-root.za-open { opacity: 1; }
.za-scope .za-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(980px, 100%);
  height: min(720px, 100%);
  border: 4px solid var(--za-ink);
  border-radius: 28px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .035) 0 14px, transparent 14px 28px),
    linear-gradient(180deg, var(--z-panel-top, #4b3cc4) 0%, var(--z-panel-mid, #3527a0) 55%, var(--z-panel-bot, #2a1e84) 100%);
  box-shadow: 0 6px 0 var(--za-ink), 0 18px 40px rgba(10, 4, 40, .55), inset 0 3px 0 rgba(255, 255, 255, .16);
  overflow: hidden;
  transform: scale(.94);
  transition: transform .22s cubic-bezier(.2, 1.4, .4, 1);
}
#za-root.za-open .za-modal { transform: none; }
.za-scope .za-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px 8px; }
.za-scope .za-head-art { width: 64px; height: 64px; margin: -6px 0; filter: drop-shadow(0 3px 0 rgba(26, 19, 64, .7)); animation: za-bob 3s ease-in-out infinite; }
@keyframes za-bob { 50% { transform: translateY(-4px) rotate(-4deg); } }
.za-scope .za-titles { flex: 1; min-width: 0; }
.za-scope .za-title { font-weight: 900; font-size: 32px; line-height: 1; color: var(--z-yellow, #ffd21f); text-shadow: var(--za-out), 0 4px 0 var(--za-ink); letter-spacing: .5px; text-transform: uppercase; }
.za-scope .za-sub { margin-top: 4px; font-weight: 700; font-size: 13px; color: #d9d2ff; text-shadow: var(--za-out-sm); }
.za-scope .za-pts-total { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px 0 8px; border: 3px solid var(--za-ink); border-radius: 999px; background: rgba(10, 6, 40, .55); }
.za-scope .za-pts-total .za-shield { width: 34px; height: 38px; }
.za-scope .za-pts-n { font-weight: 900; font-size: 20px; text-shadow: var(--za-out-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.za-scope .za-x { flex: none; width: 46px; height: 46px; padding: 8px; border: 3px solid var(--za-ink); border-radius: 50%; background: linear-gradient(180deg, #ff9aa8, var(--z-red, #ff4d63) 55%, var(--z-red-dk, #d4213d)); box-shadow: 0 3px 0 var(--za-ink); cursor: pointer; }
.za-scope .za-x svg { width: 100%; height: 100%; }

/* щит с очками (как в WoW) */
.za-shield {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 44px;
  background: linear-gradient(180deg, #fff6c2 0%, #ffd21f 50%, #ff9a00 100%);
  clip-path: polygon(50% 0, 100% 14%, 100% 62%, 50% 100%, 0 62%, 0 14%);
  filter: drop-shadow(0 2px 0 #1a1340);
}
.za-shield b { position: relative; margin-top: -3px; font-weight: 900; font-size: 15px; color: #1a1340; }

/* карточка уровня */
.za-scope .za-level { display: flex; align-items: center; gap: 16px; margin: 4px 18px 10px; padding: 10px 16px; border: 3px solid var(--za-ink); border-radius: 20px; background: rgba(10, 6, 40, .38); min-height: 84px; }
.za-scope .za-lvinfo { flex: 1; min-width: 0; }
.za-scope .za-lvname { font-weight: 900; font-size: 22px; text-shadow: var(--za-out-sm); }
.za-scope .za-tier { display: inline-block; margin-left: 6px; padding: 2px 10px; border: 2px solid var(--za-ink); border-radius: 999px; font-size: 13px; vertical-align: 3px; color: var(--za-ink); text-shadow: none; }
.za-scope .za-tier-bronze { background: #e3a06a; }
.za-scope .za-tier-silver { background: #dfe6f2; }
.za-scope .za-tier-gold { background: #ffd21f; }
.za-scope .za-tier-platinum { background: #7ff0e6; }
.za-scope .za-tier-diamond { background: #c9a8ff; }
.za-scope .za-tier-legend { background: linear-gradient(90deg, #ffd21f, #ff7a2f, #ff4d63); }
.za-scope .za-bar { position: relative; height: 22px; margin-top: 6px; border: 3px solid var(--za-ink); border-radius: 999px; background: rgba(10, 6, 40, .65); overflow: hidden; }
.za-scope .za-bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(180deg, #9cf58c 0%, var(--z-green, #3fd13a) 55%, var(--z-green-dk, #1f9a22) 100%); }
.za-scope .za-bar-gold > i { background: linear-gradient(180deg, #fff6c2 0%, #ffd21f 55%, #ff9a00 100%); }
.za-scope .za-bar > span { position: relative; display: block; text-align: center; font-weight: 900; font-size: 12px; line-height: 16px; text-shadow: var(--za-out-sm); }
.za-scope .za-lvnote { margin-top: 5px; font-weight: 700; font-size: 12.5px; color: #d9d2ff; text-shadow: var(--za-out-sm); }
.za-scope .za-lvnote b { color: #ffe970; }
.za-scope .za-guest { display: flex; align-items: center; gap: 12px; width: 100%; font-weight: 700; font-size: 14px; text-shadow: var(--za-out-sm); }
.za-scope .za-guest img { width: 56px; height: 56px; }
.za-scope .za-guest > div { flex: 1; }
.za-scope .za-btn-login { height: 42px; padding: 0 20px; border: 3px solid var(--za-ink); border-radius: 14px; background: linear-gradient(180deg, #ffe970, #ffd21f 55%, #ff9a00); color: var(--za-ink); font: 900 16px/1 inherit; box-shadow: 0 3px 0 var(--za-ink); cursor: pointer; }
.za-scope .za-skel { width: 100%; height: 60px; border-radius: 14px; background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.14), rgba(255,255,255,.06)); background-size: 200% 100%; animation: za-sk 1.2s linear infinite; }
@keyframes za-sk { to { background-position: -200% 0; } }

/* тело: категории + список */
.za-scope .za-body { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 0 18px 18px; }
.za-scope .za-cats { flex: none; width: 220px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; padding-right: 2px; }
.za-scope .za-cat { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px 6px 6px; border: 3px solid var(--za-ink); border-radius: 14px; background: rgba(10, 6, 40, .4); color: #fff; text-align: left; cursor: pointer; font: inherit; }
.za-scope .za-cat:hover { background: rgba(255, 255, 255, .08); }
.za-scope .za-cat.za-on { background: linear-gradient(180deg, #ffe970, #ffd21f 55%, #ff9a00); color: var(--za-ink); }
.za-scope .za-cat img { width: 36px; height: 36px; flex: none; filter: drop-shadow(0 2px 0 rgba(26, 19, 64, .6)); }
.za-scope .za-cat-t { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 6px; }
.za-scope .za-cat-t b { font-weight: 900; font-size: 14px; text-shadow: var(--za-out-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.za-scope .za-cat.za-on .za-cat-t b { text-shadow: none; }
.za-scope .za-cat-t i { font-style: normal; font-weight: 800; font-size: 11px; opacity: .85; }
.za-scope .za-cat-bar, .za-scope .za-cat-bar > s { display: block; height: 6px; border-radius: 999px; text-decoration: none; }
.za-scope .za-cat-bar { grid-column: 1 / -1; background: rgba(10, 6, 40, .55); border: 2px solid var(--za-ink); overflow: hidden; }
.za-scope .za-cat-bar > s { background: linear-gradient(90deg, #ffe970, #ff9a00); }
.za-scope .za-list { flex: 1; min-width: 0; overflow-y: auto; padding: 2px 6px 6px 2px; display: flex; flex-direction: column; gap: 8px; }
.za-scope .za-list::-webkit-scrollbar, .za-scope .za-cats::-webkit-scrollbar { width: 10px; }
.za-scope .za-list::-webkit-scrollbar-thumb, .za-scope .za-cats::-webkit-scrollbar-thumb { background: var(--z-yellow, #ffd21f); border: 2px solid var(--za-ink); border-radius: 999px; }

/* строка достижения */
.za-scope .za-ach { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border: 3px solid var(--za-ink); border-radius: 16px; background: rgba(10, 6, 40, .45); }
.za-scope .za-ach.za-done { background: linear-gradient(90deg, rgba(255, 210, 31, .28), rgba(255, 154, 0, .12) 60%, rgba(10, 6, 40, .4)); box-shadow: inset 0 0 0 2px rgba(255, 233, 112, .35); }
.za-scope .za-ach.za-done.za-epic { animation: za-glow 2.6s ease-in-out infinite; }
@keyframes za-glow { 50% { box-shadow: inset 0 0 0 2px rgba(255, 233, 112, .7), 0 0 14px rgba(255, 210, 31, .45); } }
.za-scope .za-ico { position: relative; flex: none; width: 60px; height: 60px; border: 3px solid var(--za-ink); border-radius: 14px; background: radial-gradient(circle at 50% 40%, #6d5fc9, #2a1e84); }
.za-scope .za-done .za-ico { background: radial-gradient(circle at 50% 40%, #fff6c2 0, #ffd21f 45%, #e08a00 100%); box-shadow: 0 0 0 2px #fff3b0, 0 0 10px rgba(255, 210, 31, .6); }
.za-scope .za-ico img { position: absolute; inset: 5px; width: calc(100% - 10px); height: calc(100% - 10px); object-fit: contain; }
.za-scope .za-ach:not(.za-done) .za-ico img { filter: grayscale(.9) brightness(.75); opacity: .75; }
.za-scope .za-ok { position: absolute; right: -8px; bottom: -8px; width: 24px; height: 24px; padding: 3px; border: 2px solid var(--za-ink); border-radius: 50%; background: var(--z-green, #3fd13a); color: #fff; }
.za-scope .za-ok svg { width: 100%; height: 100%; }
.za-scope .za-txt { flex: 1; min-width: 0; }
.za-scope .za-name { font-weight: 900; font-size: 16.5px; text-shadow: var(--za-out-sm); }
.za-scope .za-done .za-name { color: #ffe970; }
.za-scope .za-desc { margin-top: 2px; font-weight: 700; font-size: 13px; color: #d9d2ff; text-shadow: var(--za-out-sm); }
.za-scope .za-hidden .za-name, .za-scope .za-hidden .za-desc { color: #a99fe0; font-style: italic; }
.za-scope .za-prog { position: relative; height: 18px; margin-top: 6px; max-width: 360px; border: 2px solid var(--za-ink); border-radius: 999px; background: rgba(10, 6, 40, .65); overflow: hidden; }
.za-scope .za-prog > i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #8fd0ff, #31a8ff 55%, #1b63e0); border-radius: 999px; }
.za-scope .za-prog > span { position: relative; display: block; text-align: center; font-weight: 900; font-size: 11px; line-height: 14px; text-shadow: var(--za-out-sm); }
.za-scope .za-note { margin-top: 4px; font-weight: 800; font-size: 11.5px; color: #ffb3d9; text-shadow: var(--za-out-sm); }
.za-scope .za-side { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.za-scope .za-ach:not(.za-done) .za-shield { filter: drop-shadow(0 2px 0 #1a1340) grayscale(.8) brightness(.8); }
.za-scope .za-date { font-weight: 800; font-size: 11px; color: #ffe970; text-shadow: var(--za-out-sm); }

/* сводка */
.za-scope .za-sum-top { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border: 3px solid var(--za-ink); border-radius: 18px; background: rgba(10, 6, 40, .4); }
.za-scope .za-sum-top > div:last-child { flex: 1; font-weight: 900; text-shadow: var(--za-out-sm); }
.za-scope .za-sum-big { font-weight: 900; font-size: 40px; color: var(--z-yellow, #ffd21f); text-shadow: var(--za-out), 0 3px 0 var(--za-ink); }
.za-scope .za-sec { margin: 8px 2px 0; font-weight: 900; font-size: 15px; color: var(--z-yellow, #ffd21f); text-transform: uppercase; letter-spacing: .4px; text-shadow: var(--za-out-sm); }
.za-scope .za-empty { padding: 14px; border: 3px dashed rgba(255, 255, 255, .25); border-radius: 16px; font-weight: 700; color: #d9d2ff; text-align: center; }
.za-scope .za-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.za-scope .za-tile { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 8px; padding: 8px 10px; border: 3px solid var(--za-ink); border-radius: 14px; background: rgba(10, 6, 40, .45); color: #fff; font: inherit; text-align: left; cursor: pointer; }
.za-scope .za-tile:hover { background: rgba(255, 255, 255, .1); }
.za-scope .za-tile img { grid-row: span 2; width: 40px; height: 40px; }
.za-scope .za-tile b { font-weight: 900; font-size: 14px; text-shadow: var(--za-out-sm); }
.za-scope .za-tile i { font-style: normal; font-weight: 800; font-size: 11px; opacity: .85; }
.za-scope .za-tile .za-cat-bar { grid-column: 1 / -1; margin-top: 4px; }

@media (max-width: 760px) {
  #za-root { padding: 6px; }
  .za-scope .za-modal { border-radius: 20px; }
  .za-scope .za-head-art { width: 44px; height: 44px; }
  .za-scope .za-title { font-size: 22px; }
  .za-scope .za-sub { display: none; }
  .za-scope .za-pts-total { height: 38px; padding-right: 10px; }
  .za-scope .za-pts-n { font-size: 15px; }
  .za-scope .za-level { margin: 2px 10px 8px; padding: 8px 10px; gap: 10px; }
  .za-scope .za-hex-lg { width: 64px; height: 56px; }
  .za-scope .za-hex-lg b { font-size: 24px; }
  .za-scope .za-body { flex-direction: column; padding: 0 10px 10px; gap: 8px; }
  .za-scope .za-cats { width: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
  .za-scope .za-cat { width: auto; flex: none; }
  .za-scope .za-cat-t { grid-template-columns: auto; }
  .za-scope .za-cat-bar { display: none; }
  .za-scope .za-ico { width: 48px; height: 48px; }
  .za-scope .za-name { font-size: 14.5px; }
}
.za-scope .za-title-rank { color: var(--z-yellow, #ffd21f); }
/* встраиваемый список (профиль) */
.za-scope .za-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.za-scope .za-chip { height: 30px; padding: 0 12px; border: 3px solid var(--za-ink, #1a1340); border-radius: 999px; background: rgba(10, 6, 40, .45); color: #fff; font: 900 12.5px/1 var(--z-font, sans-serif); cursor: pointer; }
.za-scope .za-chip i { font-style: normal; opacity: .8; }
.za-scope .za-chip.za-on { background: linear-gradient(180deg, #ffe970, #ffd21f 55%, #ff9a00); color: var(--za-ink, #1a1340); }
.za-scope .za-embed-list { display: flex; flex-direction: column; gap: 8px; }
.za-scope { --za-ink: #1a1340; --za-out-sm: 0 1px 0 #1a1340, 1px 0 0 #1a1340, -1px 0 0 #1a1340, 0 -1px 0 #1a1340; --za-out: 0 2px 0 #1a1340, 2px 0 0 #1a1340, -2px 0 0 #1a1340, 0 -2px 0 #1a1340; }
