/* ==========================================================================
   AUTO L2 — RETRO LINEAGE II UI
   Полный редизайн мобильного интерфейса в стиле классической Lineage 2 MMO.
   Единый стиль: тёмный металл, кованое золото, заклёпки, serif-типографика.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700;900&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

/* ==========================================================================
   1. ДИЗАЙН-ТОКЕНЫ
   ========================================================================== */
:root {
  /* ── Компактный режим ──────────────────────────────────── */
  --l2-icon-size: 16px;
  --l2-cell-size: 44px;
  --l2-font-xs: 6px;
  --l2-font-sm: 7px;
  --l2-font-md: 9px;
  --l2-gap: 2px;
  --l2-radius-sm: 2px;

  /* Фон и поверхности */
  --l2-bg-deep:   #05070d;
  --l2-bg:        #0a0f1c;
  --l2-panel-1:   #17223c;
  --l2-panel-2:   #0c1424;
  --l2-panel-3:   #1d2b4a;
  --l2-slot:      #111b31;
  --l2-slot-dark: #0a1120;

  /* Рамки */
  --l2-border:       #2b3a5c;
  --l2-border-light: #47608f;
  --l2-gold:         #d4af37;
  --l2-gold-bright:  #f4d477;
  --l2-gold-dim:     #8a6f22;
  --l2-gold-dark:    #5c4a15;

  /* Текст */
  --l2-text:      #d3dcef;
  --l2-text-dim:  #8593b3;
  --l2-text-muted:#5c6885;
  --l2-text-bright:#ffffff;

  /* Полосы */
  --l2-hp-1: #e24a4a;
  --l2-hp-2: #7f1414;
  --l2-mp-1: #4a8ae2;
  --l2-mp-2: #14337f;
  --l2-xp-1: #f4d477;
  --l2-xp-2: #b07a12;

  /* Смысловые */
  --l2-green: #4ade80;
  --l2-red:   #ef4444;
  --l2-blue:  #3b82f6;
  --l2-purple:#a855f7;

  /* Грейды */
  --grade-ng: #94a3b8;
  --grade-d:  #22c55e;
  --grade-c:  #3b82f6;
  --grade-b:  #a855f7;
  --grade-a:  #f59e0b;
  --grade-s:  #ef4444;

  /* Геометрия */
  --r-xs: 3px;
  --r-sm: 5px;
  --r-md: 8px;
  --r-lg: 12px;

  --font-title: 'Cinzel', 'Georgia', 'Times New Roman', serif;
  --font-body:  'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  --shadow-panel: 0 6px 28px rgba(0, 0, 0, 0.65);
  --shadow-gold:  0 0 14px rgba(212, 175, 55, 0.35);

  /* Текстура тёмного металла */
  --metal: repeating-linear-gradient(
      115deg,
      rgba(255, 255, 255, 0.025) 0px,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 3px
    ),
    linear-gradient(180deg, var(--l2-panel-3) 0%, var(--l2-panel-1) 45%, var(--l2-panel-2) 100%);
}

/* ==========================================================================
   2. БАЗА
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--l2-bg-deep);
  color: var(--l2-text);
  font-family: var(--font-body);
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(ellipse at 50% -20%, #1a2542 0%, var(--l2-bg) 45%, var(--l2-bg-deep) 100%);
}

canvas#game {
  display: block;
  width: 100vw;
  height: 100vh;
  touch-action: none;
}

/* Универсальная утилита */
.hidden { display: none !important; }
.muted { color: var(--l2-text-dim); font-size: 11px; }
.text-gold { color: var(--l2-gold); }
.text-green { color: var(--l2-green); }
.text-red { color: var(--l2-red); }

/* Заголовки секций */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--l2-gold);
  margin: 10px 0 6px;
  text-shadow: 0 1px 2px #000;
}
.section-title::before,
.section-title::after {
  content: '';
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--l2-gold-dim), transparent);
}

/* ==========================================================================
   3. SVG-ИКОНКИ (маска + currentColor)
   Использование: <span class="l2i l2i-gold"></span>
   ========================================================================== */
.l2i {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: -0.14em;
  background-color: currentColor;
  -webkit-mask: var(--l2i) no-repeat center / contain;
  mask: var(--l2i) no-repeat center / contain;
}
.l2i-lg { width: 1.4em; height: 1.4em; }
.l2i-xl { width: 1.9em; height: 1.9em; }

/* Ресурсы */
.l2i-gold  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v10M9.5 9.5h5M9.5 14.5h5'/%3E%3C/svg%3E"); color: var(--l2-gold-bright); }
.l2i-xp    { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M12 2l2.9 6.3 6.9.7-5.2 4.6 1.5 6.8L12 17.8 5.9 20.4l1.5-6.8L2.2 9l6.9-.7z'/%3E%3C/svg%3E"); color: var(--l2-gold-bright); }
.l2i-hp    { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M12 21s-7-4.5-9.3-9C1 9 2.5 5.5 6 5.5c2 0 3.2 1.2 4 2.3.8-1.1 2-2.3 4-2.3 3.5 0 5 3.5 3.3 6.5C19 16.5 12 21 12 21z'/%3E%3C/svg%3E"); color: var(--l2-hp-1); }
.l2i-mana  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M12 2l6 6-6 14-6-14z'/%3E%3C/svg%3E"); color: var(--l2-mp-1); }
.l2i-kill  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 8l8 8M16 8l-8 8'/%3E%3C/svg%3E"); color: #cbd5e1; }

/* Статы */
.l2i-attack    { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 3.5l6 6M4 20l3-1 10-10-2-2L5 17z'/%3E%3C/svg%3E"); color: #fbbf24; }
.l2i-defense   { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M12 2l8 3v6c0 5-3.5 8.5-8 11-4.5-2.5-8-6-8-11V5z'/%3E%3C/svg%3E"); color: #6ba3e8; }
.l2i-range     { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M3 8h18v8H3z'/%3E%3Cpath d='M7 8v4M11 8v4M15 8v4M19 8v4'/%3E%3C/svg%3E"); color: #7fc97f; }
.l2i-crit      { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M12 2l1.8 5.4L19 6l-3.4 4.6L21 13l-5.4 1.8L17 20l-5-3.4L7 20l1.4-5.2L3 13l5.4-2.4L5 6l5.2 1.4z'/%3E%3C/svg%3E"); color: #ff9a3c; }
.l2i-dodge     { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 8h11a3 3 0 1 0-3-3M3 12h15a3 3 0 1 1-3 3M3 16h8'/%3E%3C/svg%3E"); color: #80d4e0; }
.l2i-lifesteal { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M12 3s6 6.5 6 11a6 6 0 0 1-12 0c0-4.5 6-11 6-11z'/%3E%3C/svg%3E"); color: #e07878; }
.l2i-speed     { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M13 2L4 14h7l-1 8 9-12h-7z'/%3E%3C/svg%3E"); color: #fde047; }

/* Оружие */
.l2i-weapon_bow   { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 3v18M6 3c8 0 12 4 12 9s-4 9-12 9'/%3E%3Cpath d='M4 12h12m-3-3l3 3-3 3'/%3E%3C/svg%3E"); color: #4ade80; }
.l2i-weapon_staff { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M12 6v16'/%3E%3Ccircle cx='12' cy='5' r='3' fill='%23000'/%3E%3C/svg%3E"); color: #c084fc; }

/* Слоты экипировки */
.l2i-weapon  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 3.5l6 6M4 20l3-1 10-10-2-2L5 17z'/%3E%3C/svg%3E"); color: #cbd5e1; }
.l2i-helmet  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M5 13a7 7 0 0 1 14 0v5H5z'/%3E%3Cpath d='M9 13h6'/%3E%3C/svg%3E"); color: #cbd5e1; }
.l2i-armor   { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M8 3l4 2 4-2 4 3-2 5v9H6v-9L4 6z'/%3E%3C/svg%3E"); color: #cbd5e1; }
.l2i-gloves  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 11V6a2 2 0 1 1 4 0v4m0-4a2 2 0 1 1 4 0v4m0-3a2 2 0 1 1 4 0v6c0 4-2 7-6 7s-6-3-6-7v-2'/%3E%3C/svg%3E"); color: #cbd5e1; }
.l2i-boots   { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M6 4v9l-2 4v3h9v-3l-3-3V4z'/%3E%3C/svg%3E"); color: #cbd5e1; }
.l2i-cloak   { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M12 3l7 4v14H5V7z'/%3E%3Cpath d='M12 3v18'/%3E%3C/svg%3E"); color: #cbd5e1; }
.l2i-ring    { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='12' cy='14' r='6'/%3E%3Cpath d='M9 6l3-4 3 4z' fill='%23000'/%3E%3C/svg%3E"); color: #fbbf24; }
.l2i-amulet  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='12' cy='15' r='5'/%3E%3Cpath d='M8 6a6 6 0 0 1 8 0'/%3E%3C/svg%3E"); color: #fbbf24; }

/* Расходники */
.l2i-potion    { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M10 3h4v3l4 8a5 5 0 1 1-12 0l4-8z'/%3E%3C/svg%3E"); color: #ef4444; }
.l2i-scroll    { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M6 4h12v16H6z'/%3E%3Cpath d='M9 8h6M9 12h6M9 16h4'/%3E%3C/svg%3E"); color: #d4af37; }
.l2i-blessed   { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M12 2l1.5 5.5L19 9l-5.5 1.5L12 16l-1.5-5.5L5 9l5.5-1.5z'/%3E%3C/svg%3E"); color: #f4d477; }
.l2i-soulshot  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M13 2L4 14h7l-1 8 9-12h-7z'/%3E%3C/svg%3E"); color: #fbbf24; }
.l2i-skillbook { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M4 5a2 2 0 0 1 2-2h13v18H6a2 2 0 0 1-2-2z'/%3E%3Cpath d='M8 3v18'/%3E%3C/svg%3E"); color: #60a5fa; }
.l2i-arenapass { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M3 7h18v4a2 2 0 0 0 0 4v2H3v-2a2 2 0 0 0 0-4z'/%3E%3C/svg%3E"); color: #fbbf24; }
.l2i-chest     { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M3 10l2-5h14l2 5v10H3z'/%3E%3Cpath d='M3 10h18M10 14h4'/%3E%3C/svg%3E"); color: #d4af37; }

/* Бафф-свитки */
.l2i-buff_attack { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 3.5l6 6M4 20l3-1 10-10-2-2L5 17z'/%3E%3C/svg%3E"); color: #ff6b6b; }
.l2i-buff_crit   { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M12 2l1.8 5.4L19 6l-3.4 4.6L21 13l-5.4 1.8L17 20l-5-3.4L7 20l1.4-5.2L3 13l5.4-2.4L5 6l5.2 1.4z'/%3E%3C/svg%3E"); color: #ff9a3c; }
.l2i-buff_speed  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M13 2L4 14h7l-1 8 9-12h-7z'/%3E%3C/svg%3E"); color: #fde047; }
.l2i-buff_range  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M3 8h18v8H3z'/%3E%3Cpath d='M7 8v4M11 8v4M15 8v4M19 8v4'/%3E%3C/svg%3E"); color: #a3e635; }

/* Скиллы */
.l2i-skill_multishot  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 20L20 4M20 4h-6M20 4v6'/%3E%3C/svg%3E"); color: #4ade80; }
.l2i-skill_fireball   { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M12 2s4 5 4 9a4 4 0 0 1-8 0c0-1.5.7-2.7 1.5-3.5C9 9 12 6 12 2z'/%3E%3C/svg%3E"); color: #f97316; }
.l2i-skill_poison     { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M12 2a8 8 0 0 0-8 8c0 3 1.5 4.5 2.5 5.5V20h11v-4.5c1-1 2.5-2.5 2.5-5.5a8 8 0 0 0-8-8z'/%3E%3Ccircle cx='9' cy='10' r='1.4' fill='%23000'/%3E%3Ccircle cx='15' cy='10' r='1.4' fill='%23000'/%3E%3C/svg%3E"); color: #84cc16; }
.l2i-skill_stun       { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M12 3l2 6 6 1-4.5 4 1 6-4.5-3-4.5 3 1-6L4 10l6-1z'/%3E%3C/svg%3E"); color: #fde047; }
.l2i-skill_frost      { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 2v20M4 7l16 10M20 7L4 17'/%3E%3C/svg%3E"); color: #7dd3fc; }
.l2i-skill_silence    { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M11 5L6 9H3v6h3l5 4z'/%3E%3Cpath d='M4 4l16 16'/%3E%3C/svg%3E"); color: #a855f7; }
.l2i-skill_heal       { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); color: #4ade80; }
.l2i-skill_dodge      { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 8h11a3 3 0 1 0-3-3M3 12h15a3 3 0 1 1-3 3M3 16h8'/%3E%3C/svg%3E"); color: #80d4e0; }
.l2i-skill_cleanse    { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M12 2l1.5 5.5L19 9l-5.5 1.5L12 16l-1.5-5.5L5 9l5.5-1.5z'/%3E%3C/svg%3E"); color: #f4d477; }
.l2i-skill_summon_shadow { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0z'/%3E%3C/svg%3E"); color: #c084fc; }

/* UI */
.l2i-ui_close     { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E"); }
.l2i-ui_back      { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5l-7 7 7 7'/%3E%3C/svg%3E"); }
.l2i-ui_city      { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M4 21V9l5-3v15M9 21V6l6-3v18M15 21V10l5-2v13z'/%3E%3C/svg%3E"); }
.l2i-ui_inventory { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M5 8h14l-1 12H6z'/%3E%3Cpath d='M9 8a3 3 0 0 1 6 0'/%3E%3C/svg%3E"); }
.l2i-ui_shop      { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M4 9l1-5h14l1 5M4 9h16v11H4z'/%3E%3C/svg%3E"); }
.l2i-ui_auction   { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M12 3v18M5 7h14M7 7l-3 6a3 3 0 0 0 6 0zM17 7l-3 6a3 3 0 0 0 6 0z'/%3E%3C/svg%3E"); }
.l2i-ui_arena     { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M5 21V4h14v17M5 4h14M9 21V9h6v12'/%3E%3C/svg%3E"); }
.l2i-ui_enhance   { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M6 20h12M8 20l1-6h6l1 6M10 14V9h4v5M12 9V4'/%3E%3C/svg%3E"); }
.l2i-ui_teleport  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18'/%3E%3C/svg%3E"); }
.l2i-ui_loading   { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 3'/%3E%3C/svg%3E"); }
.l2i-ui_logout    { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M15 4h4v16h-4M10 12H3m0 0l3-3m-3 3l3 3'/%3E%3C/svg%3E"); }
.l2i-ui_reward    { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M3 8h18v4H3zM5 12h14v9H5zM12 8v13'/%3E%3C/svg%3E"); }

/* Зоны */
.l2i-zone_easy   { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='7' fill='%23000'/%3E%3C/svg%3E"); color: #4ade80; }
.l2i-zone_medium { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='7' fill='%23000'/%3E%3C/svg%3E"); color: #fbbf24; }
.l2i-zone_hard   { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='7' fill='%23000'/%3E%3C/svg%3E"); color: #ef4444; }

/* Грейды — квадратные бейджи */
.l2i-grade_ng { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='3' width='18' height='18' rx='4' fill='%23000'/%3E%3C/svg%3E"); color: var(--grade-ng); }
.l2i-grade_d  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='3' width='18' height='18' rx='4' fill='%23000'/%3E%3C/svg%3E"); color: var(--grade-d); }
.l2i-grade_c  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='3' width='18' height='18' rx='4' fill='%23000'/%3E%3C/svg%3E"); color: var(--grade-c); }
.l2i-grade_b  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='3' width='18' height='18' rx='4' fill='%23000'/%3E%3C/svg%3E"); color: var(--grade-b); }
.l2i-grade_a  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='3' width='18' height='18' rx='4' fill='%23000'/%3E%3C/svg%3E"); color: var(--grade-a); }
.l2i-grade_s  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='3' width='18' height='18' rx='4' fill='%23000'/%3E%3C/svg%3E"); color: var(--grade-s); }

/* Арена / тиры */
.l2i-tier_bronze    { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M6 3h12v5a6 6 0 0 1-12 0zM6 5H3v2a3 3 0 0 0 3 3M18 5h3v2a3 3 0 0 1-3 3M9 20h6M12 14v6'/%3E%3C/svg%3E"); color: #cd7f32; }
.l2i-tier_silver    { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M6 3h12v5a6 6 0 0 1-12 0zM6 5H3v2a3 3 0 0 0 3 3M18 5h3v2a3 3 0 0 1-3 3M9 20h6M12 14v6'/%3E%3C/svg%3E"); color: #cbd5e1; }
.l2i-tier_gold      { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M6 3h12v5a6 6 0 0 1-12 0zM6 5H3v2a3 3 0 0 0 3 3M18 5h3v2a3 3 0 0 1-3 3M9 20h6M12 14v6'/%3E%3C/svg%3E"); color: #fbbf24; }
.l2i-tier_platinum  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M12 2l3 6 6 1-4.5 4 1 6-5.5-3-5.5 3 1-6L3 9l6-1z'/%3E%3C/svg%3E"); color: #67e8f9; }
.l2i-tier_legendary { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M3 7l4 3 5-6 5 6 4-3-2 12H5z'/%3E%3C/svg%3E"); color: #f4d477; }

/* Классы */
.l2i-class_archer { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 3v18M6 3c8 0 12 4 12 9s-4 9-12 9'/%3E%3Cpath d='M4 12h12m-3-3l3 3-3 3'/%3E%3C/svg%3E"); color: #4ade80; }
.l2i-class_mage   { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M12 6v16'/%3E%3Ccircle cx='12' cy='5' r='3' fill='%23000'/%3E%3C/svg%3E"); color: #c084fc; }

/* ==========================================================================
   4. ОБЩИЕ КОМПОНЕНТЫ
   ========================================================================== */

/* --- Панель L2: металлическая поверхность с золотой рамкой --- */
.l2-window,
.modal-window,
.popup-window,
.offline-panel,
.aro-panel-large,
.auth-box {
  position: relative;
  background: var(--metal);
  border: 2px solid var(--l2-gold-dark);
  border-radius: var(--r-md);
  box-shadow:
    var(--shadow-panel),
    inset 0 0 0 1px rgba(212, 175, 55, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Угловые заклёпки для крупных панелей */
.modal-window::before,
.modal-window::after,
.popup-window::before,
.popup-window::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--l2-gold-bright), var(--l2-gold-dim) 60%, #3a2d0a);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  z-index: 3;
  pointer-events: none;
}
.modal-window::before, .popup-window::before { top: 6px; left: 6px; }
.modal-window::after,  .popup-window::after  { top: 6px; right: 6px; }

/* --- Модальные окна: открываются как окно над нижней панелью --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 58px;
  background: rgba(3, 6, 12, 0.7);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 260;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  animation: l2-fade 0.18s ease-out;
}
.modal-window {
  width: 100%;
  max-width: 420px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-md);
  animation: l2-pop 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  min-height: 30px;
  border-radius: var(--r-md) var(--r-md) 0 0;
  background:
    linear-gradient(180deg, rgba(212, 175, 55, 0.14) 0%, transparent 60%),
    linear-gradient(180deg, #1f2d4e 0%, #101a30 100%);
  border-bottom: 1px solid var(--l2-gold-dark);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 10px rgba(0, 0, 0, 0.4);
  position: sticky;
  top: 0;
  z-index: 2;
  flex-shrink: 0;
}
.modal-header h2 {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--l2-gold-bright);
  text-shadow: 0 1px 2px #000, 0 0 10px rgba(212, 175, 55, 0.4);
}
.modal-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #3a1a1a 0%, #1a0808 100%);
  border: 1px solid #7f1d1d;
  border-radius: var(--r-sm);
  color: #ff8f8f;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s;
}
.modal-close:hover,
.modal-close:active { background: var(--l2-red); color: #fff; box-shadow: 0 0 12px rgba(239, 68, 68, 0.7); }
.modal-body {
  padding: 6px 8px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

/* --- Кнопки общего назначения --- */
.btn,
.city-btn,
.class-btn,
.tab-btn,
.ar-btn,
.ac-btn,
.enhance-btn,
.battle-btn,
.offline-btn,
.auth-btn,
.popup-close,
.cmp-btn {
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:active,
.city-btn:active,
.class-btn:active,
.ar-btn:active,
.ac-btn:active,
.enhance-btn:active,
.battle-btn:active,
.offline-btn:active,
.auth-btn:active,
.popup-close:active,
.cmp-btn:active { transform: scale(0.96); }

/* Золотая «кованая» кнопка */
.city-btn,
.ar-spin-btn {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, transparent 40%),
    linear-gradient(180deg, #b9932f 0%, #7c611a 55%, #4c3b0f 100%);
  border: 1px solid var(--l2-gold-bright);
  color: #1a1206;
  border-radius: var(--r-sm);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 0 #2c2208, 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.city-btn:active,
.ar-spin-btn:active { box-shadow: 0 1px 0 #2c2208, 0 0 16px rgba(212, 175, 55, 0.7); }

/* Зелёная кнопка действия (купить/бой) */
.ar-btn,
.ac-btn,
.enhance-btn,
.cmp-btn-fight {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 45%),
    linear-gradient(180deg, #2f6a3a 0%, #1c4023 60%, #10280f 100%);
  border: 1px solid #4ade80;
  color: #b9f5c8;
  border-radius: var(--r-sm);
  box-shadow: 0 2px 0 #0a1a0a, inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.ar-btn:disabled,
.ac-btn:disabled,
.enhance-btn:disabled,
.cmp-btn-fight:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.6); }
.ar-btn:active:not(:disabled),
.ac-btn:active:not(:disabled),
.enhance-btn:active:not(:disabled),
.cmp-btn-fight:active:not(:disabled) { background: #2f6a3a; color: #fff; box-shadow: 0 0 14px rgba(74, 222, 128, 0.6); }

/* --- Табы --- */
.tab-bar,
.l2-tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  padding: 4px;
  background: linear-gradient(180deg, var(--l2-slot-dark) 0%, #060a12 100%);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
}
.tab-btn {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--l2-text-dim);
  padding: 7px 4px;
  border-radius: var(--r-xs);
  font-size: 11px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.tab-btn.active {
  background: linear-gradient(180deg, #2c3c60 0%, #17223c 100%);
  border-color: var(--l2-gold-dark);
  color: var(--l2-gold-bright);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 10px rgba(212, 175, 55, 0.25);
}

/* --- Инпуты --- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: linear-gradient(180deg, #060a12 0%, var(--l2-slot) 100%);
  border: 1px solid var(--l2-border);
  color: var(--l2-text);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--l2-gold);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(212, 175, 55, 0.2);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 30px;
}

/* --- Скроллбары --- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.35); border-radius: 4px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--l2-gold-dim), var(--l2-border-light));
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.4);
}
::-webkit-scrollbar-thumb:hover { background: var(--l2-gold); }
* { scrollbar-width: thin; scrollbar-color: var(--l2-gold-dim) transparent; }

/* --- Вспомогательные «пустые» состояния --- */
.empty-state,
.bp-empty,
.hb-empty,
.skills-empty,
.arl-empty {
  text-align: center;
  color: var(--l2-text-muted);
  font-size: 11px;
  font-style: italic;
  padding: 18px 10px;
  letter-spacing: 0.3px;
}

/* --- Цвета статов --- */
.stat-attack { color: #fbbf24; }
.stat-defense { color: #6ba3e8; }
.stat-hp { color: #e07878; }
.stat-mana { color: #60a5fa; }
.stat-manaRegen { color: #3b82f6; }
.stat-critChance { color: #ff9a3c; }
.stat-critDamage { color: #ffb366; }
.stat-dodge { color: #80d4e0; }
.stat-attackSpeed { color: #fde047; }
.stat-lifesteal { color: #e07878; }
.stat-range { color: #a3e635; }
.stat-accuracy { color: #67e8f9; }
.stat-critResist { color: #a5b4fc; }
.stat-armorPen { color: #fca5a5; }
.stat-antiHeal { color: #86efac; }
.stat-berserk { color: #ef4444; }
.stat-thorns { color: #c084fc; }
.stat-moveSpeed { color: #fef08a; }

/* ==========================================================================
   5. АНИМАЦИИ (общие)
   ========================================================================== */
@keyframes l2-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes l2-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes l2-pop {
  0% { opacity: 0; transform: scale(0.4); }
  60% { opacity: 1; transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes l2-spin { to { transform: rotate(360deg); } }
@keyframes l2-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }
@keyframes l2-glow {
  0%, 100% { box-shadow: 0 0 6px rgba(212, 175, 55, 0.4); }
  50% { box-shadow: 0 0 18px rgba(244, 212, 119, 0.9); }
}
@keyframes l2-glow-green {
  0%, 100% { box-shadow: 0 0 5px rgba(74, 222, 128, 0.4); }
  50% { box-shadow: 0 0 16px rgba(74, 222, 128, 0.9); }
}
@keyframes l2-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
@keyframes l2-rise {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes l2-damage-float {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -140%) scale(0.7); opacity: 0; }
}
@keyframes l2-toast-in {
  0% { opacity: 0; transform: translateY(-12px); }
  12% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-12px); }
}
@keyframes l2-ring-expand {
  0% { transform: scale(0.4); opacity: 0.9; }
  100% { transform: scale(1.9); opacity: 0; }
}
@keyframes l2-bar-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==========================================================================
   6. ЭКРАН ЗАГРУЗКИ
   ========================================================================== */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #16223e 0%, var(--l2-bg) 55%, var(--l2-bg-deep) 100%);
}
.loading-screen.hidden { display: none !important; }
.loading-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.loading-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--l2-gold-bright);
  animation: l2-spin 1.6s linear infinite;
  filter: drop-shadow(0 0 16px rgba(212, 175, 55, 0.7));
}
.loading-text {
  font-family: var(--font-title);
  color: var(--l2-gold-bright);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow: 0 0 16px rgba(212, 175, 55, 0.6);
}
.loading-timer,
.load-timer { color: var(--l2-text-dim); font-family: var(--font-mono); font-size: 13px; }

/* ==========================================================================
   7. HUD — ВЕРХНЯЯ ПАНЕЛЬ
   ========================================================================== */
#hud-top {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  padding-top: calc(4px + env(safe-area-inset-top, 0px));
  height: 48px;
  z-index: 220;
  background:
    linear-gradient(180deg, rgba(212, 175, 55, 0.1) 0%, transparent 45%),
    linear-gradient(180deg, #1a2540 0%, #0a1120 100%);
  border-bottom: 2px solid var(--l2-gold-dark);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.65), inset 0 -1px 0 rgba(212, 175, 55, 0.2);
  font-size: 11px;
  font-weight: 700;
}

.hud-bars { display: flex; flex-direction: column; gap: 4px; width: 138px; flex-shrink: 0; }
.hud-bar {
  position: relative;
  height: 14px;
  background: #05070d;
  border: 1px solid var(--l2-border);
  border-radius: var(--r-xs);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}
.hud-bar-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 100%;
  transition: width 0.18s linear;
}
.hp-bar .hud-bar-fill {
  background: linear-gradient(180deg, var(--l2-hp-1) 0%, var(--l2-hp-2) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 8px rgba(226, 74, 74, 0.5);
}
.mana-bar .hud-bar-fill {
  background: linear-gradient(180deg, var(--l2-mp-1) 0%, var(--l2-mp-2) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 8px rgba(74, 138, 226, 0.5);
}
.hud-bar-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
  z-index: 1;
  pointer-events: none;
}
/* Низкое HP — пульсация */
.hp-bar.low .hud-bar-fill { animation: l2-bar-pulse 0.8s ease-in-out infinite; filter: saturate(1.5) brightness(1.2); }
.hp-bar.low { border-color: var(--l2-hp-1); box-shadow: 0 0 10px rgba(226, 74, 74, 0.7); }

.hud-res { display: flex; gap: 10px; align-items: center; flex-shrink: 0; font-size: 12px; }
.hud-res .hud-item { display: flex; align-items: center; gap: 4px; }
.hud-res .icon { font-size: 13px; line-height: 1; display: inline-flex; }
#gold {
  color: var(--l2-gold-bright);
  font-family: var(--font-mono);
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}
#level {
  color: var(--l2-gold-bright);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 13px;
}
.xp-bar {
  width: 56px;
  height: 7px;
  margin-left: 6px;
  background: #05070d;
  border: 1px solid var(--l2-border);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
}
#xp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--l2-xp-2), var(--l2-xp-1));
  box-shadow: 0 0 8px rgba(244, 212, 119, 0.6);
  transition: width 0.35s;
}

/* Аккаунт */
.account-info {
  position: fixed;
  top: 4px;
  right: 8px;
  display: none;
  gap: 5px;
  align-items: center;
  height: 28px;
  padding: 2px 7px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
  font-size: 10px;
  color: var(--l2-text);
  z-index: 100000;
  pointer-events: auto;
}
.account-info.visible { display: flex; }
.acc-email {
  color: var(--l2-text-dim);
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acc-logout {
  background: linear-gradient(180deg, #3a1a1a 0%, #1a0808 100%);
  border: 1px solid #7f1d1d;
  color: #ff8f8f;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  font-family: inherit;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}
.acc-logout:active { background: var(--l2-red); color: #fff; }

/* Статы под HUD */
.hud-stats {
  position: fixed;
  top: 50px;
  left: 0; right: 0;
  display: none;
  gap: 4px;
  padding: 3px 8px;
  z-index: 219;
  background: linear-gradient(180deg, rgba(10, 17, 32, 0.9) 0%, rgba(10, 17, 32, 0.55) 100%);
  border-bottom: 1px solid var(--l2-border);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow-x: auto;
}
.hud-stats .hs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--l2-text);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  padding: 1px 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-xs);
}
.hud-stats .hs b { font-family: var(--font-mono); }
.hs-atk b   { color: #fbbf24; }
.hs-def b   { color: #6ba3e8; }
.hs-range b { color: #7fc97f; }
.hs-crit b  { color: #ff9a3c; }
.hs-dodge b { color: #80d4e0; }
.hs-ls b    { color: #e07878; }

/* Плашка зоны */
#hud-zone {
  position: fixed;
  top: 82px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 14px;
  z-index: 9;
  pointer-events: none;
  white-space: nowrap;
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--l2-gold-bright);
  background: linear-gradient(180deg, rgba(23, 34, 60, 0.95), rgba(10, 17, 32, 0.95));
  border: 1px solid var(--l2-gold-dark);
  border-radius: var(--r-sm);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   8. ДЖОЙСТИК
   ========================================================================== */
#joystick { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#joystick-base {
  position: absolute;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 50% 40%, rgba(212, 175, 55, 0.12) 0%, transparent 65%),
    radial-gradient(circle, rgba(16, 24, 46, 0.55) 0%, rgba(5, 8, 16, 0.7) 100%);
  border: 2px solid var(--l2-gold-dark);
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.3), inset 0 0 20px rgba(0, 0, 0, 0.6);
}
#joystick-stick {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 40% 30%, var(--l2-gold-bright), var(--l2-gold) 45%, #6b5214 100%);
  border: 2px solid #f4d477;
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.8), inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

/* ==========================================================================
   9. КНОПКА АВТО
   ========================================================================== */
#btn-auto {
  position: fixed;
  left: 10px;
  bottom: 122px;
  min-width: 74px;
  padding: 7px 12px;
  z-index: 30;
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
  color: var(--l2-text-dim);
  background: var(--metal);
  border: 2px solid var(--l2-border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-panel);
}
#btn-auto:active { transform: scale(0.95); }
#btn-auto.on {
  color: var(--l2-green);
  border-color: var(--l2-green);
  background: linear-gradient(180deg, #1c3a24 0%, #0a1a0f 100%);
  box-shadow: 0 0 16px rgba(74, 222, 128, 0.6);
  animation: l2-glow-green 1.8s ease-in-out infinite;
}

/* ==========================================================================
   10. СКИЛЛ-БАР
   ========================================================================== */
#skill-bar {
  position: fixed;
  left: 10px;
  bottom: 62px;
  display: flex;
  gap: 7px;
  z-index: 30;
}
.skill-btn {
  position: relative;
  width: 56px;
  height: 56px;
  padding: 0;
  background: var(--metal);
  border: 2px solid var(--l2-border);
  border-radius: var(--r-sm);
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-panel), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.1s, border-color 0.15s, box-shadow 0.15s;
}
.skill-btn:active:not(:disabled) { transform: scale(0.92); border-color: var(--l2-gold); }
.skill-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.skill-btn.ready {
  border-color: var(--l2-gold);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.skill-btn.empty { opacity: 0.28; border-style: dashed; }
.skill-icon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  line-height: 1;
  pointer-events: none;
}
.skill-mana {
  position: absolute;
  bottom: 1px; left: 0; right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: #8fc0ff;
  text-shadow: 0 0 3px #000, 0 0 5px #000;
  pointer-events: none;
}
.skill-cd-overlay {
  position: absolute; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.78) 100%);
}
.skill-btn.on-cd .skill-cd-overlay { display: flex; }
.skill-cd-num {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--l2-gold-bright);
  text-shadow: 0 0 6px #000, 0 0 12px rgba(244, 212, 119, 0.6);
}

/* ==========================================================================
   11. HUD-ДЕЙСТВИЯ (зелья, баффы, соски)
   ========================================================================== */
#hud-actions {
  position: fixed;
  right: 8px;
  bottom: 62px;
  display: flex;
  flex-direction: column-reverse;
  gap: 5px;
  z-index: 30;
}
.hud-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  min-width: 54px;
  padding: 5px 8px;
  background: var(--metal);
  border: 2px solid var(--l2-border);
  border-radius: var(--r-sm);
  color: var(--l2-text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0.82;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.hud-stat:active { transform: scale(0.95); }
.hud-stat .hud-icon { font-size: 15px; line-height: 1; display: inline-flex; }
.hud-stat .hud-count { color: var(--l2-gold-bright); font-family: var(--font-mono); font-size: 11px; }
.hud-stat.active {
  opacity: 1;
  background: linear-gradient(180deg, #3a2c10 0%, #1a1208 100%);
  border-color: var(--l2-gold);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.6);
}
.hud-potion[data-potion="small"]  { border-color: #8b3a3a; }
.hud-potion[data-potion="medium"] { border-color: #b86520; }
.hud-potion[data-potion="large"]  { border-color: #6b3a8b; }
.hud-potion[data-potion="epic"]   { border-color: #b8941a; }
#hud-soulshot { border-color: #b8941a; }
.hud-buff.active { border-color: var(--l2-gold); box-shadow: 0 0 14px rgba(212, 175, 55, 0.7); opacity: 1; }
#hud-offline { border-color: #6366f1; background: linear-gradient(180deg, #1e1b4b 0%, #0a0515 100%); }
#hud-offline .hud-icon { color: #a5b4fc; }

/* ==========================================================================
   12. НИЖНЯЯ ПАНЕЛЬ
   ========================================================================== */
#bottom-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-around;
  padding: 3px;
  padding-bottom: calc(3px + env(safe-area-inset-bottom, 0px));
  height: 56px;
  z-index: 45;
  background:
    linear-gradient(0deg, rgba(212, 175, 55, 0.08) 0%, transparent 55%),
    linear-gradient(180deg, #131d34 0%, #070b14 100%);
  border-top: 2px solid var(--l2-gold-dark);
  box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(212, 175, 55, 0.18);
}
#bottom-panel button {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  color: var(--l2-text-dim);
  font-family: inherit;
  cursor: pointer;
  padding: 3px;
  transition: all 0.15s;
}
#bottom-panel button:active { background: rgba(212, 175, 55, 0.12); color: var(--l2-gold-bright); transform: scale(0.95); }
#bottom-panel button.active { color: var(--l2-gold-bright); }
.bp-icon { font-size: 20px; line-height: 1; display: inline-flex; filter: drop-shadow(0 1px 1px #000); }
.bp-label { font-size: 9px; color: inherit; letter-spacing: 0.3px; }
.bp-badge {
  position: absolute;
  top: 2px;
  right: 22%;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #e24a4a, #7f1414);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  border: 1px solid #fff;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(226, 74, 74, 0.7);
}
.bp-badge.show { display: flex; }

/* ==========================================================================
   13. ЭКРАН ГОРОДА
   ========================================================================== */
#city-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 66px 12px 64px;
  overflow-y: auto;
  touch-action: pan-y;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.08) 0%, transparent 45%),
    radial-gradient(ellipse at top, #1a2547 0%, var(--l2-bg) 55%, var(--l2-bg-deep) 100%);
}
.city-header { text-align: center; margin-bottom: 14px; }
#city-name {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--l2-gold-bright);
  text-shadow: 0 0 24px rgba(212, 175, 55, 0.6), 0 2px 4px #000;
}
#city-sub { color: var(--l2-text-dim); font-size: 11px; margin-top: 2px; font-style: italic; letter-spacing: 0.5px; }
#city-grade {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 16px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--l2-gold-bright);
  background: linear-gradient(180deg, #2c3c60 0%, #101a30 100%);
  border: 1px solid var(--l2-gold);
  border-radius: var(--r-sm);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Последняя сессия */
.last-session {
  width: 100%;
  max-width: 420px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--metal);
  border: 1px solid var(--l2-gold-dark);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-panel);
}
.ls-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--l2-green);
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.ls-title span { color: var(--l2-gold-bright); }
.ls-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ls-cell {
  padding: 7px 4px;
  text-align: center;
  background: linear-gradient(180deg, var(--l2-slot) 0%, var(--l2-slot-dark) 100%);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.ls-ico { font-size: 16px; line-height: 1; display: inline-flex; }
.ls-val { color: var(--l2-gold-bright); font-family: var(--font-mono); font-weight: 700; font-size: 12px; margin-top: 3px; }

/* Карточки зон */
#city-zones { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 420px; margin-bottom: 14px; }
.zone-card {
  position: relative;
  padding: 11px 14px 11px 18px;
  cursor: pointer;
  background: var(--metal);
  border: 1px solid var(--l2-border);
  border-left: 4px solid var(--l2-border-light);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-panel), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}
.zone-card:active { transform: scale(0.98); border-color: var(--l2-gold); box-shadow: 0 0 16px rgba(212, 175, 55, 0.4); }
.zone-card.zone-easy   { border-left-color: var(--l2-green); }
.zone-card.zone-medium { border-left-color: #fbbf24; }
.zone-card.zone-hard   { border-left-color: var(--l2-red); }
.zone-name { font-family: var(--font-title); font-size: 14px; font-weight: 700; color: var(--l2-text-bright); letter-spacing: 0.5px; }
.zone-diff { font-size: 10px; color: var(--l2-text-dim); margin-top: 3px; }
.zone-cost { font-size: 11px; color: var(--l2-gold-bright); margin-top: 3px; font-weight: 700; font-family: var(--font-mono); }

/* Dev-коды */
#dev-codes { display: flex; gap: 6px; width: 100%; max-width: 420px; margin-top: 12px; }
#dev-code-input { flex: 1; }
#dev-code-apply {
  background: linear-gradient(180deg, #3a2a5a 0%, #1a102a 100%);
  border: 1px solid var(--l2-purple);
  color: #d4a5ff;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
#dev-code-apply:active { background: var(--l2-purple); color: #fff; }

/* ==========================================================================
   14. ОВЕРЛЕИ (авторизация / выбор класса / смерть)
   ========================================================================== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: var(--l2-text);
  background:
    radial-gradient(ellipse at center, rgba(23, 34, 60, 0.98) 0%, rgba(5, 7, 13, 0.99) 100%);
}
.overlay h1 {
  font-family: var(--font-title);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 5px;
  color: var(--l2-gold-bright);
  text-shadow: 0 0 34px rgba(212, 175, 55, 0.7), 0 2px 4px #000;
  margin-bottom: 8px;
}
.overlay h2 {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--l2-red);
  text-shadow: 0 0 24px rgba(239, 68, 68, 0.7);
  margin-bottom: 14px;
}
.overlay p { color: var(--l2-text-dim); font-size: 12px; margin-bottom: 14px; }

/* Выбор класса */
.class-buttons { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.class-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 128px;
  padding: 18px 16px;
  background: var(--metal);
  border: 2px solid var(--l2-border);
  border-radius: var(--r-md);
  color: var(--l2-text);
  box-shadow: var(--shadow-panel);
}
.class-btn:active { border-color: var(--l2-gold); box-shadow: 0 0 26px rgba(212, 175, 55, 0.5); }
.class-icon {
  width: 58px; height: 58px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #2c3c60, #0c1424);
  border: 2px solid var(--l2-gold-dark);
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.6);
}
.class-name { font-family: var(--font-title); font-size: 16px; font-weight: 700; color: var(--l2-gold-bright); letter-spacing: 1px; }
.class-desc { font-size: 10px; color: var(--l2-text-dim); }

/* Авторизация */
.auth-box {
  width: 100%;
  max-width: 340px;
  padding: 24px 20px;
  text-align: center;
  border: 2px solid var(--l2-gold-dark);
  border-radius: var(--r-md);
}
.auth-title {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--l2-gold-bright);
  text-shadow: 0 0 24px rgba(212, 175, 55, 0.6);
  margin-bottom: 6px;
}
.auth-sub { color: var(--l2-text-dim); font-size: 11px; margin-bottom: 18px; letter-spacing: 0.5px; }
.auth-box input { margin-bottom: 10px; }
.auth-buttons { display: flex; gap: 8px; margin-top: 10px; }
.auth-btn {
  flex: 1;
  padding: 11px;
  background: linear-gradient(180deg, #2c3c60 0%, #101a30 100%);
  border: 1px solid var(--l2-border-light);
  color: var(--l2-text);
  border-radius: var(--r-sm);
  font-size: 12px;
  letter-spacing: 0.5px;
}
.auth-btn-primary {
  background: linear-gradient(180deg, #2f6a3a 0%, #10280f 100%);
  border-color: var(--l2-green);
  color: #b9f5c8;
}
.auth-error { color: var(--l2-red); font-size: 10px; margin-top: 10px; min-height: 14px; }

/* Смерть */
#death-screen .session-report {
  width: 100%;
  max-width: 320px;
  padding: 14px 16px;
  margin: 12px 0;
  background: var(--metal);
  border: 1px solid var(--l2-gold-dark);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-panel);
}
#death-screen #lost-xp { color: var(--l2-red); font-weight: 700; }
.session-title {
  font-family: var(--font-title);
  color: var(--l2-gold-bright);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 10px;
}
.sr-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--l2-text);
  padding: 3px 0;
  border-bottom: 1px solid rgba(43, 58, 92, 0.4);
}
.sr-row:last-child { border-bottom: none; }
.sr-row span:last-child { color: var(--l2-gold-bright); font-weight: 700; font-family: var(--font-mono); }

/* ==========================================================================
   15. ТЕЛЕПОРТ
   ========================================================================== */
.teleport-anim {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: radial-gradient(circle, rgba(23, 34, 60, 0.95), rgba(5, 7, 13, 0.98));
  animation: l2-fade 0.9s ease-in-out forwards;
}
.tp-icon {
  font-size: 80px;
  color: var(--l2-gold-bright);
  filter: drop-shadow(0 0 30px var(--l2-gold));
  animation: l2-spin 0.9s ease-in-out;
}
.tp-ring {
  position: absolute;
  width: 70px; height: 70px;
  border: 4px solid var(--l2-gold);
  border-radius: 50%;
  box-shadow: 0 0 40px var(--l2-gold);
  animation: l2-ring-expand 0.9s ease-out;
}
.teleport-list { display: flex; flex-direction: column; gap: 6px; }
.map-item {
  padding: 11px 14px;
  cursor: pointer;
  background: var(--metal);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.12s, border-color 0.15s;
}
.map-item:active { transform: scale(0.98); border-color: var(--l2-gold); }
.map-item.current { border-color: var(--l2-gold); background: linear-gradient(180deg, #3a2c10 0%, #1a1208 100%); cursor: default; }
.map-item-name { font-family: var(--font-title); color: var(--l2-text-bright); font-size: 14px; font-weight: 700; letter-spacing: 0.5px; }
.map-item-sub { color: var(--l2-text-dim); font-size: 10px; margin-top: 2px; font-style: italic; }
.map-item-level { color: var(--l2-gold-bright); font-size: 11px; margin-top: 3px; font-weight: 700; font-family: var(--font-mono); }

/* ==========================================================================
   16. ГЕРОЙ — ИНВЕНТАРЬ, МАНЕКЕН, СТАТЫ
   ========================================================================== */
.l2-tab-bar { flex-wrap: wrap; }
.l2-inv-counter {
  align-self: center;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--l2-text-dim);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-xs);
  white-space: nowrap;
}

.l2-hero-body { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.l2-pd-wrap { flex-shrink: 0; }
.l2-content-wrap { flex: 1; min-width: 0; }
.hero-tab-content { min-height: 90px; }

/* Манекен — сетка слотов экипировки */
.mannequin {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 4px;
  background: linear-gradient(180deg, var(--l2-slot-dark) 0%, #05070d 100%);
  border: 1px solid var(--l2-gold-dark);
  border-radius: var(--r-md);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}
.eq-slot {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 1px;
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(180deg, var(--l2-slot) 0%, var(--l2-slot-dark) 100%);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 -3px 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}
.eq-slot:active { transform: scale(0.94); }
.eq-slot.empty {
  color: var(--l2-text-muted);
  font-size: 6px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-style: dashed;
  border-color: var(--l2-border);
  opacity: 0.75;
}
.eq-slot .eq-icon { font-size: 16px; line-height: 1; }
.eq-slot .eq-grade {
  position: absolute;
  top: 1px; left: 2px;
  font-size: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-shadow: 0 0 3px #000;
}
.eq-slot .enh {
  position: absolute; top: 1px; right: 2px;
  font-size: 10px;
  color: var(--gold-bright);
  font-weight: bold;
  text-shadow: 0 0 3px #000, 1px 1px 0 #000;
  line-height: 1;
  z-index: 3;
  font-family: monospace;
}
.eq-slot .slot-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 1px 0;
  text-align: center;
  font-size: 6px;
  color: var(--l2-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.2px;
  background: rgba(0, 0, 0, 0.55);
}
.eq-slot .eq-dur { position: absolute; bottom: 9px; left: 50%; transform: translateX(-50%); font-size: 7px; font-weight: 700; }
.eq-slot .eq-tier-badge {
  position: absolute;
  top: 1px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 900;
  padding: 0 3px;
  border-radius: 3px;
  color: #fff;
  text-shadow: 0 0 2px #000, 0 0 4px #000;
  z-index: 5;
  line-height: 10px;
  letter-spacing: -1px;
  pointer-events: none;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
}
/* Статы героя */
.hero-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 10px;
  min-width: 0;
}
.hs-group {
  padding: 7px 9px;
  background: linear-gradient(180deg, var(--l2-slot-dark) 0%, #05070d 100%);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.hs-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-title);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--l2-gold);
  margin-bottom: 5px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
}
/* Ровная таблица статов: 2 колонки на широких экранах */
.hs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 10px;
  row-gap: 0;
}
.hs-cell {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: 4px;
  padding: 2px 1px;
  font-size: 8px;
  line-height: 1.2;
  white-space: nowrap;
  border-bottom: 1px solid rgba(43, 58, 92, 0.3);
}
.hs-ico { width: 12px; text-align: center; flex-shrink: 0; display: inline-flex; justify-content: center; font-size: 9px; }
.hs-label { color: var(--l2-text-dim); font-size: 7px; overflow: hidden; text-overflow: ellipsis; }
.hs-base { color: var(--l2-text-dim); font-size: 7px; }
.hs-add { color: var(--l2-green); font-size: 7px; font-weight: 700; text-align: right; }
.hs-total { color: var(--l2-gold-bright); font-family: var(--font-mono); font-weight: 700; font-size: 8px; text-align: right; min-width: 28px; }
.hs-total.mana-total { color: #8fc0ff; }

/* Бонусы заточки */
.hero-bonuses,
.l2-hero-bonuses {
  margin-top: 6px;
  padding: 7px 9px;
  background: linear-gradient(180deg, var(--l2-slot-dark) 0%, #05070d 100%);
  border: 1px solid var(--l2-gold-dark);
  border-radius: var(--r-sm);
}
.hb-title {
  font-family: var(--font-title);
  color: var(--l2-gold);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.hb-list { display: flex; flex-direction: column; gap: 2px; }
.hb-row { display: flex; align-items: center; gap: 4px; font-size: 8px; padding: 1px 0; }
.hb-icon { width: 12px; text-align: center; display: inline-flex; justify-content: center; }
.hb-name { color: var(--l2-gold-bright); font-weight: 700; flex: 1; }
.hb-desc { color: var(--l2-text-dim); font-size: 7px; }
.hb-val { color: var(--l2-gold-bright); font-family: var(--font-mono); font-weight: 700; }
.hb-time { color: var(--l2-green); font-family: var(--font-mono); font-weight: 700; font-size: 8px; }

/* Подвал инвентаря */
.l2-hero-footer {
  margin-top: 5px;
  padding: 5px 8px;
  background: linear-gradient(180deg, var(--l2-slot-dark) 0%, #05070d 100%);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
}
.l2-footer-row { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
.l2-coin, .l2-weight-ico { display: inline-flex; font-size: 11px; }
.l2-adena { color: var(--l2-gold-bright); font-family: var(--font-mono); font-weight: 700; font-size: 10px; }
.l2-weight-bar {
  flex: 1;
  height: 7px;
  background: #05070d;
  border: 1px solid var(--l2-border);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7);
}
.l2-weight-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--l2-green), var(--l2-gold));
  transition: width 0.3s;
}
.l2-weight-val { color: var(--l2-text-dim); font-family: var(--font-mono); font-size: 10px; min-width: 42px; text-align: right; }

/* Рюкзак — сетка предметов */
.backpack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 2px;
  padding: 3px;
  min-height: 40px;
  max-height: 40vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--l2-slot-dark) 0%, #05070d 100%);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.6);
}
.bp-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 44px;
  padding: 2px 1px;
  cursor: pointer;
  background: linear-gradient(180deg, var(--l2-slot) 0%, var(--l2-slot-dark) 100%);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 -3px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}
.bp-item:active { transform: scale(0.94); border-color: var(--l2-gold); box-shadow: 0 0 12px rgba(212, 175, 55, 0.45); }
.bp-item .bp-icon { font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center; min-height: 16px; }
.bp-item .bp-grade {
  font-size: 9px;
  font-weight: bold;
  margin-top: 1px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 0 3px #000;
}.bp-item .bp-name {
  font-size: 6px;
  color: var(--l2-text-dim);
  text-align: center;
  margin-top: 1px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.bp-item .bp-stats { display: flex; flex-wrap: wrap; gap: 0 2px; justify-content: center; margin-top: 1px; }
.bp-item .bp-stats span { font-size: 6px; font-weight: 700; }
.bp-item .enh {
  position: absolute; top: 1px; right: 2px;
  font-size: 10px;
  color: var(--gold-bright);
  font-weight: bold;
  text-shadow: 0 0 3px #000, 1px 1px 0 #000;
  line-height: 1;
  z-index: 3;
  font-family: monospace;
}
.bp-count {
  position: absolute; top: 1px; right: 2px;
  font-size: 10px; font-weight: bold;
  color: var(--gold-bright);
  text-shadow: 0 0 3px #000, 1px 1px 0 #000;
  line-height: 1;
  font-family: monospace;
  z-index: 3;
}
.bp-item .bp-book-lvl { font-size: 6px; font-weight: 700; color: #60a5fa; margin-top: 1px; }

/* Рамки по грейду */
.bp-item[data-grade="ng"] { border-color: var(--grade-ng); }
.bp-item[data-grade="d"]  { border-color: var(--grade-d); }
.bp-item[data-grade="c"]  { border-color: var(--grade-c); }
.bp-item[data-grade="b"]  { border-color: var(--grade-b); }
.bp-item[data-grade="a"]  { border-color: var(--grade-a); }
.bp-item[data-grade="s"]  { border-color: var(--grade-s); box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 0 10px rgba(239, 68, 68, 0.35); }

/* Списки свитков / зелий / сосок */
.scrolls-list,
.potions-list,
.soulshots-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 2px;
  padding: 3px;
  min-height: 40px;
  max-height: 44vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--l2-slot-dark) 0%, #05070d 100%);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.6);
}
.scroll-item,
.potion-item,
.soulshot-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 44px;
  padding: 2px 1px;
  cursor: pointer;
  background: linear-gradient(180deg, var(--l2-slot) 0%, var(--l2-slot-dark) 100%);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 -3px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}
.scroll-item:active,
.potion-item:active,
.soulshot-item:active { transform: scale(0.94); border-color: var(--l2-gold); box-shadow: 0 0 12px rgba(212, 175, 55, 0.45); }
.scroll-item .scroll-icon,
.potion-item .potion-icon,
.soulshot-item .soulshot-icon { font-size: 15px; line-height: 1; min-height: 16px; display: flex; align-items: center; justify-content: center; }
.scroll-item .scroll-name,
.potion-item .scroll-name,
.soulshot-item .scroll-name {
  font-size: 6px;
  font-weight: 700;
  text-align: center;
  line-height: 1.1;
  margin-top: 1px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scroll-item .scroll-count,
.potion-item .potion-count,
.soulshot-item .soulshot-count {
  position: absolute;
  top: 1px;
  right: 2px;
  font-family: var(--font-mono);
  font-size: 6px;
  font-weight: 700;
  color: var(--l2-gold-bright);
  text-shadow: 0 0 4px #000;
}

/* ==========================================================================
   17. СКИЛЛЫ
   ========================================================================== */
.skill-slots-row {
  display: flex;
  gap: 4px;
  justify-content: center;
  padding: 5px;
  margin-bottom: 4px;
  background: linear-gradient(180deg, var(--l2-slot-dark) 0%, #05070d 100%);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.6);
}
.skill-slot {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--metal);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}
.skill-slot:active { transform: scale(0.95); }
.skill-slot.empty { border-style: dashed; opacity: 0.5; }
.skill-slot.filled { border-color: var(--l2-gold); box-shadow: 0 0 10px rgba(212, 175, 55, 0.5); }
.skill-slot .slot-num { position: absolute; top: 1px; left: 3px; font-family: var(--font-mono); font-size: 7px; font-weight: 700; color: var(--l2-text-dim); }
.skill-slot .slot-icon { font-size: 22px; line-height: 1; }
.skill-slot .slot-lvl { position: absolute; bottom: 1px; right: 3px; font-family: var(--font-mono); font-size: 8px; font-weight: 700; color: var(--l2-gold-bright); text-shadow: 0 0 3px #000; }
.skill-slot .slot-empty-label { font-size: 6px; color: var(--l2-text-dim); text-align: center; text-transform: uppercase; letter-spacing: 0.3px; }

.learned-skills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 2px;
  padding: 3px;
  min-height: 40px;
  max-height: 38vh;
  overflow-y: auto;
  margin-bottom: 4px;
  background: linear-gradient(180deg, var(--l2-slot-dark) 0%, #05070d 100%);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.6);
}
.skill-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
  min-height: 44px;
  padding: 2px 1px;
  cursor: pointer;
  background: linear-gradient(180deg, var(--l2-slot) 0%, var(--l2-slot-dark) 100%);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 -3px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}
.skill-card:active { transform: scale(0.94); border-color: var(--l2-gold); }
.skill-card.in-slot { border-color: var(--l2-green); box-shadow: 0 0 10px rgba(74, 222, 128, 0.45); }
.skill-card .sc-icon { font-size: 15px; line-height: 1; min-height: 16px; display: flex; align-items: center; justify-content: center; }
.skill-card .sc-name {
  font-size: 6px;
  font-weight: 700;
  color: var(--l2-text-bright);
  text-align: center;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.skill-card .sc-meta { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; font-size: 5px; color: var(--l2-text-dim); margin-top: 1px; }
.skill-card .sc-meta b { color: #8fc0ff; font-weight: 700; }
.skill-card .sc-lvl { position: absolute; top: 1px; right: 2px; font-family: var(--font-mono); font-size: 6px; font-weight: 700; color: var(--l2-gold-bright); text-shadow: 0 0 3px #000; }
.skill-card .sc-in-slot { position: absolute; top: 1px; left: 2px; font-size: 5px; color: var(--l2-green); font-weight: 700; }
.skills-hint {
  margin-top: 8px;
  padding: 8px 10px;
  font-size: 10px;
  line-height: 1.4;
  font-style: italic;
  color: #93c5fd;
  background: rgba(96, 165, 250, 0.08);
  border-left: 3px solid #60a5fa;
  border-radius: var(--r-xs);
}


/* ==========================================================================
   19. АРЕНА — ОКНО
   ========================================================================== */
.arena-window { max-width: 600px !important; }
.arena-header { display: flex; align-items: center; gap: 10px; }
.arena-header h2 { font-size: 15px; }
.arena-profile { flex: 1; display: flex; gap: 10px; align-items: center; font-size: 11px; }
.ap-rating { color: var(--l2-gold-bright); font-family: var(--font-mono); font-weight: 700; }
.ap-tier { font-weight: 700; }
.ap-record { color: var(--l2-text-dim); font-size: 10px; }
.arena-body { padding: 10px 12px !important; }
.arena-tab-content { min-height: 110px; }
.arena-list { display: flex; flex-direction: column; gap: 4px; }
.arena-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 9px;
  font-size: 11px;
  background: linear-gradient(180deg, var(--l2-slot) 0%, var(--l2-slot-dark) 100%);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.arena-row-me {
  background: linear-gradient(180deg, #3a2c10 0%, #1a1208 100%);
  border-color: var(--l2-gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.45);
}
.arena-row-bot { border-left: 3px solid var(--l2-border-light); }
.ar-place { color: var(--l2-text-dim); font-family: var(--font-mono); min-width: 26px; font-weight: 700; font-size: 10px; }
.ar-class { min-width: 18px; text-align: center; display: inline-flex; justify-content: center; font-size: 14px; }
.ar-name { flex: 1; color: var(--l2-text); font-weight: 700; min-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.ar-level { color: var(--l2-text-dim); font-family: var(--font-mono); font-size: 10px; min-width: 36px; text-align: center; }
.ar-dur { font-size: 10px; min-width: 42px; text-align: center; font-weight: 700; }
.ar-rating { color: var(--l2-gold-bright); font-family: var(--font-mono); font-weight: 700; min-width: 40px; text-align: right; font-size: 11px; }
.ar-chance { min-width: 50px; text-align: center; font-weight: 700; font-size: 11px; }
.chance-high { color: var(--l2-green); }
.chance-mid { color: #fbbf24; }
.chance-low { color: var(--l2-red); }
.ar-change { color: var(--l2-text-dim); font-size: 10px; min-width: 58px; text-align: center; font-family: var(--font-mono); }
.ar-res { color: var(--l2-text-dim); font-size: 10px; min-width: 66px; text-align: center; }
.ar-rest { color: var(--l2-gold-bright); font-family: var(--font-mono); font-size: 11px; font-weight: 700; }
.ar-btn { padding: 5px 10px; border-radius: var(--r-sm); font-size: 10px; }

/* Сундуки арены */
.arena-chests { display: flex; flex-direction: column; gap: 6px; }
.ac-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  font-size: 11px;
  background: linear-gradient(180deg, var(--l2-slot-dark) 0%, #05070d 100%);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
}
.ac-row.ac-ready {
  border-color: var(--l2-gold);
  background: linear-gradient(180deg, #3a2c10 0%, #1a1208 100%);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.45);
  animation: l2-glow 2.2s ease-in-out infinite;
}
.ac-icon { font-size: 22px; display: inline-flex; }
.ac-name { font-family: var(--font-title); font-weight: 700; color: var(--l2-gold-bright); min-width: 90px; letter-spacing: 0.5px; }
.ac-info { flex: 1; color: var(--l2-text-dim); font-size: 10px; }
.ac-claimed { color: var(--l2-green); font-weight: 700; font-size: 11px; }
.ac-locked { color: var(--l2-text-muted); font-weight: 700; font-size: 11px; }
.ac-btn { padding: 6px 12px; border-radius: var(--r-sm); font-size: 10px; }

.arena-history { display: flex; flex-direction: column; gap: 4px; }
.ah-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 9px;
  font-size: 11px;
  background: linear-gradient(180deg, var(--l2-slot-dark) 0%, #05070d 100%);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
}
.ah-row > span:nth-child(2) { flex: 1; color: var(--l2-text-dim); }

.arena-result {
  padding: 12px 14px;
  background: linear-gradient(180deg, var(--l2-slot-dark) 0%, #05070d 100%);
  border: 1px solid var(--l2-gold-dark);
  border-radius: var(--r-md);
}
.ar-result-title { font-family: var(--font-title); font-size: 18px; font-weight: 900; text-align: center; letter-spacing: 2px; margin-bottom: 10px; text-shadow: 0 0 16px currentColor; }
.ar-result-info { font-size: 11px; line-height: 1.6; margin-bottom: 12px; }
.ar-result-info > div { margin-bottom: 2px; }
.ar-roulette {
  text-align: center;
  margin: 12px 0;
  padding: 12px;
  background: var(--purple-bg);
  border: 1px solid var(--purple-dark);
  border-radius: var(--r-sm);
}
.ar-roulette-title { color: var(--purple-text); font-family: var(--font-title); font-size: 12px; font-weight: 700; letter-spacing: 1px; margin-bottom: 8px; }
.ar-spin-btn { padding: 10px 28px; border-radius: var(--r-sm); font-family: var(--font-title); font-size: 13px; letter-spacing: 1px; }
.ar-spin-btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.6); }
.ar-roulette-result { margin-top: 8px; font-size: 12px; font-weight: 700; min-height: 20px; }
.ar-back-btn {
  width: 100%;
  margin-top: 10px;
  padding: 9px;
  background: linear-gradient(180deg, #2c3c60 0%, #101a30 100%);
  border: 1px solid var(--l2-border-light);
  color: var(--l2-text);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.ar-back-btn:active { background: var(--l2-panel-3); }

/* ==========================================================================
   20. АРЕНА — БОЕВОЙ HUD
   ========================================================================== */
#arena-hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 38px;
  z-index: 219;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(168, 85, 247, 0.16) 0%, transparent 55%),
    linear-gradient(180deg, #241030 0%, #0a0512 100%);
  border-bottom: 2px solid var(--l2-purple);
  box-shadow: 0 3px 14px rgba(168, 85, 247, 0.5);
}
.arena-hud-inner { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 100%; padding: 0 12px; }
.ah-vs { flex: 1; color: var(--purple-text); font-family: var(--font-title); font-size: 13px; font-weight: 700; letter-spacing: 0.5px; text-shadow: 0 0 8px rgba(168, 85, 247, 0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ah-timer { color: var(--l2-gold-bright); font-family: var(--font-mono); font-size: 15px; font-weight: 700; min-width: 56px; text-align: center; text-shadow: 0 0 8px rgba(244, 212, 119, 0.6); }
.ah-exit {
  pointer-events: auto;
  padding: 5px 14px;
  background: linear-gradient(180deg, #4a1a1a 0%, #1a0808 100%);
  border: 1px solid #7f1d1d;
  color: #ff8f8f;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.ah-exit:active { background: var(--l2-red); color: #fff; }

/* Боковые панели арены */
.arena-side {
  position: fixed;
  top: 42px;
  width: 42vw;
  max-width: 230px;
  min-width: 146px;
  z-index: 218;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px 8px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(23, 34, 60, 0.98) 0%, rgba(10, 17, 32, 0.94) 100%);
  border: 1px solid var(--l2-gold-dark);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-panel);
}
#arena-side-me  { left: 8px !important;  border-color: #4ade80 !important; }
#arena-side-opp { right: 8px !important; border-color: #c084fc !important; }
.arena-side.hidden { display: none !important; }
.as-name { font-family: var(--font-title); font-size: 11px; font-weight: 700; text-align: center; color: var(--l2-gold-bright); letter-spacing: 0.5px; }
#arena-side-opp .as-name { color: var(--purple-text); }
.as-bar {
  position: relative;
  height: 14px;
  background: #05070d;
  border: 1px solid var(--l2-border);
  border-radius: var(--r-xs);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7);
}
.as-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transition: width 0.16s linear; }
.as-hp .as-bar-fill { background: linear-gradient(180deg, var(--l2-hp-1), var(--l2-hp-2)); box-shadow: inset 0 1px 0 rgba(255,255,255,0.3); }
.as-mana .as-bar-fill { background: linear-gradient(180deg, var(--l2-mp-1), var(--l2-mp-2)); box-shadow: inset 0 1px 0 rgba(255,255,255,0.3); }
.as-bar-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
  z-index: 1;
  pointer-events: none;
}
.as-skills { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; margin-top: 1px; }
.as-skill {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  background: var(--metal);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-xs);
}
.as-skill.ready { border-color: var(--l2-gold); box-shadow: 0 0 8px rgba(212, 175, 55, 0.5); }
.as-skill.empty { opacity: 0.3; }
.as-skill-icon { font-size: 11px; line-height: 1; }
.as-skill-cd {
  position: absolute; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--l2-gold-bright);
  background: rgba(0, 0, 0, 0.75);
  text-shadow: 0 0 6px #000;
}
.as-skill.on-cd .as-skill-cd { display: flex; }
.as-buffs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; min-height: 18px; }
.as-buff {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-height: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  line-height: 1;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-xs);
}
.as-buff.expiring { border-color: var(--l2-red); animation: l2-pulse 0.5s infinite alternate; }
.as-buff-time {
  position: absolute;
  bottom: -1px; right: 1px;
  font-family: var(--font-mono);
  font-size: 6px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 2px #000, 0 0 3px #000;
  pointer-events: none;
}

/* Мобильная плашка арены */
#arena-mobile-hud {
  position: fixed;
  top: 38px; left: 0; right: 0;
  z-index: 219;
  display: flex;
  gap: 8px;
  padding: 4px 8px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(23, 34, 60, 0.98) 0%, rgba(10, 17, 32, 0.92) 100%);
  border-bottom: 1px solid var(--l2-gold-dark);
}
.amh-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.amh-side-opp { align-items: flex-end; }
.amh-name { font-family: var(--font-title); font-size: 10px; font-weight: 700; color: var(--l2-gold-bright); }
.amh-bar { position: relative; height: 7px; width: 100%; background: #05070d; border: 1px solid var(--l2-border); border-radius: 3px; overflow: hidden; }
.amh-bar-fill { height: 100%; width: 100%; transition: width 0.16s linear; }
.amh-hp .amh-bar-fill { background: linear-gradient(180deg, var(--l2-hp-1), var(--l2-hp-2)); }
.amh-mana .amh-bar-fill { background: linear-gradient(180deg, var(--l2-mp-1), var(--l2-mp-2)); }
.amh-skills { display: flex; gap: 3px; margin-top: 1px; justify-content: flex-start; }
.amh-side-opp .amh-skills { justify-content: flex-end; }
.amh-skill {
  position: relative;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  background: var(--metal);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-xs);
}
.amh-skill.on-cd::after {
  content: attr(data-cd);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--l2-gold-bright);
  background: rgba(0, 0, 0, 0.72);
}

/* Оверлей результата арены */
.arena-result-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 6, 12, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: l2-fade 0.25s ease-out;
}
.aro-panel { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; max-width: 520px; width: 100%; }
.aro-panel-large {
  max-width: 580px;
  width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 18px;
  background: var(--metal);
  border: 2px solid var(--l2-purple);
  border-radius: var(--r-lg);
  box-shadow: 0 0 44px rgba(168, 85, 247, 0.5);
}
.aro-title { font-family: var(--font-title); font-size: 24px; font-weight: 900; letter-spacing: 2px; text-shadow: 0 0 18px currentColor; }
.aro-sub { color: var(--purple-text); font-size: 14px; font-weight: 700; }
.aro-rating { color: var(--l2-text); font-size: 12px; margin-bottom: 6px; }
.aro-rating b { color: var(--l2-gold-bright); font-family: var(--font-mono); }
.aro-cards { display: flex; gap: 10px; justify-content: center; padding: 6px 0; perspective: 1000px; }
.aro-hint { color: var(--l2-text-dim); font-size: 10px; font-style: italic; animation: l2-pulse 1.6s ease-in-out infinite; }
.aro-hp-row { display: flex; align-items: center; gap: 8px; margin: 5px 0; font-size: 11px; }
.aro-hp-label { min-width: 36px; font-weight: 700; }
.aro-hp-bar { flex: 1; height: 11px; background: #05070d; border: 1px solid var(--l2-border); border-radius: 6px; overflow: hidden; }
.aro-hp-fill { height: 100%; transition: width 0.3s; }
.aro-hp-fill.arl-me  { background: linear-gradient(90deg, #166534, #4ade80); }
.aro-hp-fill.arl-opp { background: linear-gradient(90deg, #7f1d1d, #ef4444); }
.aro-hp-num { min-width: 72px; text-align: right; color: var(--l2-text-dim); font-family: var(--font-mono); }
.aro-log-title { font-family: var(--font-title); color: var(--l2-gold-bright); font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin: 10px 0 5px; }
.arl-body {
  max-height: 190px;
  overflow-y: auto;
  padding: 7px 9px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.55;
  background: #05070d;
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
}
.arl-row { padding: 1px 0; }
.arl-t { color: var(--l2-text-muted); margin-right: 6px; }
.arl-who { font-weight: 700; }
.arl-who.arl-me  { color: #4ade80; }
.arl-who.arl-opp { color: #ef4444; }
.arl-tgt { color: var(--l2-text-dim); }
.arl-dmg { color: #f97316; }
.arl-crit { color: #ef4444; font-weight: 700; text-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }
.arl-skill { color: #a855f7; font-weight: 700; }
.arl-row-crit { background: rgba(239, 68, 68, 0.08); }
.arl-miss { color: #a5f3fc; }
.arl-potion { color: #4ade80; }
.arl-death { color: #dc2626; font-weight: 700; }
.arl-debuff { color: #fbbf24; }
.arl-empty { color: var(--l2-text-muted); text-align: center; font-style: italic; padding: 12px; }

/* ==========================================================================
   21. ЗАТОЧКА
   ========================================================================== */
#modal-enhance .modal-window { max-height: 100%; }
#modal-enhance .modal-body { display: flex; flex-direction: column; gap: 4px; }
.enhance-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  padding: 4px 8px;
  font-size: 8px;
  background: linear-gradient(180deg, var(--l2-slot-dark) 0%, #05070d 100%);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
}
.enhance-hero-stats .ehs { font-weight: 700; white-space: nowrap; }
.enhance-hero-stats .ehs span { color: var(--l2-gold-bright); font-family: var(--font-mono); }
.enhance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 2px;
  padding: 3px;
  min-height: 40px;
  max-height: 32vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--l2-slot-dark) 0%, #05070d 100%);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
}
.enhance-grid:empty::before {
  content: "Пусто";
  grid-column: 1 / -1;
  padding: 8px;
  text-align: center;
  color: var(--l2-text-muted);
  font-size: 8px;
  font-style: italic;
}
.enhance-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 44px;
  padding: 2px 1px;
  cursor: pointer;
  background: linear-gradient(180deg, var(--l2-slot) 0%, var(--l2-slot-dark) 100%);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}
.enhance-item:active { transform: scale(0.94); }
.enhance-item.selected {
  outline: 3px solid #fbbf24;
  outline-offset: -1px;
  background: linear-gradient(180deg, #4a3a12 0%, #2a1a08 100%);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.9), inset 0 0 8px rgba(251, 191, 36, 0.3);
  z-index: 2;
}

@keyframes selectedPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(251, 191, 36, 1), 0 0 40px rgba(251, 191, 36, 0.5); }
  50% { box-shadow: 0 0 30px rgba(251, 191, 36, 1), 0 0 60px rgba(251, 191, 36, 0.8); }
}
.enhance-item .ei-icon { font-size: 15px; line-height: 1; margin-top: 1px; }
.enhance-item .ei-enh { font-family: var(--font-mono); font-size: 7px; color: var(--l2-gold-bright); font-weight: 700; margin-top: 1px; text-shadow: 0 0 4px #000; }
.enhance-item .ei-grade { font-size: 6px; font-weight: 700; letter-spacing: 0.3px; margin-top: 0; text-transform: uppercase; }
.enhance-item .ei-stats { display: flex; gap: 2px; justify-content: center; flex-wrap: wrap; margin-top: 1px; }
.enhance-item .ei-stats span { font-size: 6px; font-weight: 700; }
.enhance-item .ei-bonus { margin-top: 1px; }
.enhance-detail {
  padding: 8px 10px;
  background: linear-gradient(180deg, #2a1a08 0%, #1a1208 100%);
  border: 2px solid var(--gold);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
  border-radius: var(--radius);
  font-size: 11px;
  flex-shrink: 0;
  min-height: 180px;
  display: flex; flex-direction: column;
  max-height: 38vh;
  overflow-y: auto;
}
.enhance-detail .eh-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.enhance-detail .eh-icon { font-size: 18px; display: inline-flex; }
.enhance-detail .eh-name { font-family: var(--font-title); color: var(--l2-gold-bright); font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.enhance-detail .eh-body { flex: 1; }
.enhance-detail .row {
  display: flex;
  justify-content: space-between;
  padding: 1px 0;
  margin-bottom: 1px;
  font-size: 9px;
  border-bottom: 1px solid rgba(43, 58, 92, 0.4);
}
.enhance-detail .val { color: var(--l2-gold-bright); font-family: var(--font-mono); font-weight: 700; }
.enhance-detail .val.good { color: var(--l2-green); }
.enhance-detail .val.bad { color: var(--l2-red); }
.enhance-buttons { display: flex; gap: 4px; margin-top: 4px; position: sticky; bottom: 0; padding-top: 4px; background: var(--l2-panel-2); }
.enhance-btn { flex: 1; padding: 6px; border-radius: var(--r-sm); font-size: 10px; }
.enhance-btn.blessed-btn {
  background: linear-gradient(180deg, #3a2a5a 0%, #1a102a 100%);
  border-color: var(--l2-purple);
  color: #d4a5ff;
}
.enhance-btn:disabled { background: var(--l2-slot-dark); border-color: var(--l2-border); color: var(--l2-text-muted); opacity: 0.5; cursor: not-allowed; }

/* Анимации заточки */
.enhance-anim {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  pointer-events: none;
  font-size: 22px;
  font-weight: 900;
  font-family: monospace;
  padding: 6px 16px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid currentColor;
  box-shadow: 0 0 20px currentColor;
  animation: enhFloat 0.7s ease-out forwards;
}
.enhance-anim.success { color: #4ade80; }
.enhance-anim.fail { color: #ef4444; }
.enhance-anim.destroyed { color: #8b0000; }
@keyframes enhFloat {
  0% { opacity: 0; transform: translateX(-50%) translateY(-15px) scale(0.8); }
  20% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  80% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(0.95); }
}
.enhance-anim.success { color: var(--l2-green); text-shadow: 0 0 44px var(--l2-green); }
.enhance-anim.fail { color: var(--l2-red); text-shadow: 0 0 44px var(--l2-red); }
.enhance-anim.destroyed { color: #8b0000; text-shadow: 0 0 44px #8b0000; }
.enhance-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.98));
}
.enhance-big-card {
  width: 210px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--metal);
  border: 3px solid var(--l2-gold);
  border-radius: var(--r-md);
  box-shadow: 0 0 60px rgba(212, 175, 55, 0.6);
}
.enhance-big-card.glow-success { border-color: var(--l2-green); box-shadow: 0 0 80px rgba(74, 222, 128, 0.9); animation: l2-glow-green 1s ease-out; }
.enhance-big-card.glow-fail { border-color: var(--l2-red); box-shadow: 0 0 80px rgba(220, 38, 38, 0.9); }
.enhance-big-card.glow-destroyed { border-color: #8b0000; box-shadow: 0 0 80px rgba(139, 0, 0, 0.9); }
.ebc-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ebc-icon { font-size: 64px; line-height: 1; }
.ebc-enh { font-family: var(--font-mono); font-size: 30px; font-weight: 700; color: var(--l2-gold-bright); text-shadow: 0 0 20px currentColor; }
.ebc-grade { font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }

/* ==========================================================================
   22. МАГАЗИН / АУКЦИОН
   ========================================================================== */
.shop-row,
.auction-row,
.my-listing,
.sell-item-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  margin-bottom: 4px;
  background: linear-gradient(180deg, var(--l2-slot) 0%, var(--l2-slot-dark) 100%);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.sell-item-row { cursor: pointer; }
.sell-item-row:active { border-color: var(--l2-gold); background: var(--l2-slot-dark); }
.auction-icon { font-size: 17px; flex-shrink: 0; display: inline-flex; }
.auction-info, .sell-info { flex: 1; min-width: 0; }
.auction-name, .sell-name { font-size: 10px; font-weight: 700; color: var(--l2-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auction-grade { font-size: 7px; font-weight: 700; letter-spacing: 1px; margin-top: 1px; }
.auction-stats { display: flex; gap: 5px; flex-wrap: wrap; font-size: 8px; color: var(--l2-text-dim); margin-top: 2px; }
.auction-stats span { color: var(--l2-gold-bright); font-weight: 700; }
.auction-bonus { font-size: 8px; color: var(--l2-gold); margin-top: 1px; font-weight: 700; opacity: 0.9; }
.auction-seller { font-size: 7px; color: var(--l2-text-dim); margin-top: 1px; }
.auction-price { min-width: 48px; text-align: right; font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--l2-gold-bright); white-space: nowrap; }
.sell-prices { font-size: 9px; color: var(--l2-text-dim); margin-top: 2px; }
.auction-row button, .shop-row button {
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  background: linear-gradient(180deg, #2f6a3a 0%, #10280f 100%);
  border: 1px solid var(--l2-green);
  color: #b9f5c8;
}
.auction-row button:disabled, .shop-row button:disabled { background: var(--l2-slot-dark); border-color: var(--l2-border); color: var(--l2-text-muted); opacity: 0.5; cursor: not-allowed; }
.my-listing .progress-bar { flex: 1; height: 4px; background: var(--l2-slot-dark); border: 1px solid var(--l2-border); border-radius: 3px; overflow: hidden; }
.my-listing .progress-fill { height: 100%; background: linear-gradient(90deg, var(--l2-green), var(--l2-gold)); }
.sell-input-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.sell-label { min-width: 74px; font-size: 11px; color: var(--l2-text-dim); }
.sell-input { flex: 1; text-align: center; }
.sell-total { flex: 1; text-align: center; font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--l2-gold-bright); }
.ml-cancel {
  flex-shrink: 0;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #4a1a1a 0%, #1a0808 100%);
  border: 1px solid #7f1d1d;
  color: #ff8f8f;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.ml-cancel:active { background: var(--l2-red); color: #fff; }

/* ==========================================================================
   23. POPUP ПРЕДМЕТА
   ========================================================================== */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 58px;
  z-index: 280;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(3, 6, 12, 0.8);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: l2-fade 0.18s ease-out;
}
.popup-window {
  width: 100%;
  max-width: 280px;
  max-height: 100%;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--l2-gold);
  border-radius: var(--r-md);
  animation: l2-pop 0.22s ease-out;
}
.popup-window h3 { font-family: var(--font-title); color: var(--l2-gold-bright); font-size: 12px; margin-bottom: 6px; letter-spacing: 0.5px; }
.popup-window .item-icon-big { font-size: 32px; text-align: center; margin-bottom: 6px; display: flex; justify-content: center; }
.popup-window .stat-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  margin-bottom: 1px;
  font-size: 9px;
  border-bottom: 1px solid rgba(43, 58, 92, 0.4);
}
.popup-window .stat-name { color: var(--l2-text-dim); }
.popup-window .stat-val { color: var(--l2-gold-bright); font-family: var(--font-mono); font-weight: 700; }
.popup-close {
  width: 100%;
  margin-top: 6px;
  padding: 6px;
  border-radius: var(--r-sm);
  font-family: var(--font-title);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(180deg, #2c3c60 0%, #101a30 100%);
  border: 1px solid var(--l2-gold-dark);
  color: var(--l2-gold-bright);
  cursor: pointer;
}
.popup-close:active { background: var(--l2-gold); color: #1a1206; }
.popup-close:disabled { opacity: 0.4; cursor: not-allowed; }
/* Кнопки действий в попапе (pp-*) */
.pp-equip, .pp-sell, .pp-learn, .pp-unequip, .pp-close {
  width: 100%;
  margin-top: 4px;
  padding: 6px;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(180deg, #2f6a3a 0%, #10280f 100%);
  border: 1px solid var(--l2-green);
  color: #b9f5c8;
}
.pp-sell { background: linear-gradient(180deg, #3a2c10 0%, #1a1208 100%); border-color: var(--l2-gold); color: var(--l2-gold-bright); }
.pp-unequip { background: linear-gradient(180deg, #4a1a1a 0%, #1a0808 100%); border-color: #7f1d1d; color: #ff8f8f; }
.pp-close { background: linear-gradient(180deg, #2c3c60 0%, #101a30 100%); border-color: var(--l2-border-light); color: var(--l2-text); }
.pp-auction-list { margin-top: 6px; }
.pp-equip:active, .pp-sell:active, .pp-learn:active, .pp-unequip:active, .pp-close:active { transform: scale(0.97); filter: brightness(1.15); }

/* ==========================================================================
   24. ВИЗУАЛЬНЫЙ БОЙ
   ========================================================================== */
.battle-arena {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 140px;
  padding: 14px 10px;
  margin-bottom: 10px;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #1a0f2a 0%, #0a0510 100%);
  border: 2px solid var(--purple-dark);
  border-radius: var(--r-md);
}
.battle-arena::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 100%, rgba(168, 85, 247, 0.16) 0%, transparent 60%),
    repeating-linear-gradient(90deg, transparent 0, transparent 20px, rgba(168, 85, 247, 0.05) 20px, rgba(168, 85, 247, 0.05) 21px);
}
.battle-side { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.battle-hero {
  position: relative;
  width: 58px; height: 58px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #2a1a3a 0%, #150a1f 100%);
  border: 2px solid var(--l2-purple);
  transition: transform 0.15s;
}
.battle-hero.battle-archer { border-color: #4ade80; box-shadow: 0 0 16px rgba(74, 222, 128, 0.5); }
.battle-hero.battle-mage { border-color: #c084fc; box-shadow: 0 0 16px rgba(192, 132, 252, 0.5); }
.battle-hero.battle-attack-right { animation: l2-atk-right 0.22s ease-out; }
.battle-hero.battle-attack-left { animation: l2-atk-left 0.22s ease-out; }
.battle-hero.battle-hit { animation: l2-shake 0.22s ease-out; }
.battle-hero.battle-dead { opacity: 0.3; filter: grayscale(1); transform: rotate(90deg); }
.battle-hero.battle-win { border-color: var(--l2-gold-bright); box-shadow: 0 0 26px rgba(244, 212, 119, 0.9); }
.battle-emoji { font-size: 30px; line-height: 1; }
.battle-name { max-width: 84px; margin-top: 2px; text-align: center; font-size: 10px; font-weight: 700; color: var(--purple-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.battle-hp-bar {
  position: relative;
  width: 100%;
  height: 15px;
  overflow: hidden;
  background: #0a0510;
  border: 1px solid var(--purple-dark);
  border-radius: var(--r-xs);
}
.battle-hp-fill { height: 100%; transition: width 0.3s ease-out, background 0.3s; }
.battle-hp-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
}
.battle-vs { padding: 0 4px; align-self: center; font-family: var(--font-title); font-size: 17px; font-weight: 900; color: var(--l2-gold-bright); letter-spacing: 2px; text-shadow: 0 0 12px rgba(244, 212, 119, 0.8); }
.battle-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.battle-btn { flex: 1; padding: 8px 12px; border-radius: var(--r-sm); font-size: 11px; background: linear-gradient(180deg, #2a1a3a 0%, #150a1f 100%); border: 1px solid var(--l2-purple); color: var(--purple-text); }
.battle-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.battle-btn:active:not(:disabled) { background: var(--l2-purple); color: #fff; }
.battle-timer { min-width: 84px; text-align: right; font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--l2-gold-bright); }
.battle-log {
  height: 124px;
  overflow-y: auto;
  padding: 5px 7px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.35;
  background: #0a0510;
  border: 1px solid var(--purple-dark);
  border-radius: var(--r-sm);
}
.battle-log > div { display: flex; align-items: center; gap: 4px; padding: 1px 0; animation: l2-rise 0.2s ease-out; }
.bl-time { color: var(--l2-text-muted); min-width: 34px; font-size: 9px; }
.bl-who { color: #fbbf24; font-weight: 700; }
.bl-target { color: var(--l2-text-dim); }
.bl-dmg, .bl-dmg-text { color: #f97316; }
.bl-miss, .bl-miss-text { color: #a5f3fc; font-style: italic; }
.bl-potion, .bl-potion-text { color: #4ade80; font-weight: 700; }
.bl-crit { background: rgba(239, 68, 68, 0.1); }
.bl-crit-mark { color: #ef4444; font-weight: 700; text-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }
.bl-soulshot { color: #fbbf24; }
.battle-flash { position: absolute; top: -8px; font-size: 26px; pointer-events: none; animation: l2-flash 0.4s ease-out forwards; }
@keyframes l2-flash {
  0% { transform: scale(0.5); opacity: 0; }
  40% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}
@keyframes l2-atk-right { 0% { transform: translateX(0); } 50% { transform: translateX(15px) scale(1.1); } 100% { transform: translateX(0); } }
@keyframes l2-atk-left { 0% { transform: translateX(0); } 50% { transform: translateX(-15px) scale(1.1); } 100% { transform: translateX(0); } }

/* ==========================================================================
   25. КАРТОЧКИ НАГРАД
   ========================================================================== */
.reward-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 6, 12, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: l2-fade 0.3s ease-out;
}
.reward-overlay.reward-closing { animation: l2-fade-out 0.3s ease-out forwards; }
@keyframes l2-fade-out { from { opacity: 1; } to { opacity: 0; } }
.reward-panel { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 520px; width: 100%; padding: 18px; }
.reward-title {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--l2-gold-bright);
  text-shadow: 0 0 20px rgba(244, 212, 119, 0.7), 0 2px 4px #000;
  animation: l2-pop 0.5s ease-out;
}
.reward-hint { color: var(--l2-text-dim); font-size: 10px; font-style: italic; animation: l2-pulse 1.6s ease-in-out infinite; }
.reward-cards { display: flex; gap: 12px; justify-content: center; padding: 6px 0; perspective: 1000px; }
.reward-card {
  position: relative;
  width: 112px; height: 164px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 10px 6px;
  cursor: pointer;
  overflow: hidden;
  background: linear-gradient(180deg, #1a0f2a 0%, #0a0510 100%);
  border: 2px solid var(--purple-dark);
  border-radius: var(--r-md);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: l2-card-appear 0.6s ease-out backwards;
}
@keyframes l2-card-appear {
  0% { opacity: 0; transform: rotateY(180deg) scale(0.3); }
  60% { opacity: 1; transform: rotateY(0) scale(1.15); }
  80% { transform: rotateY(0) scale(0.95); }
  100% { transform: rotateY(0) scale(1); }
}
.reward-card:hover:not(.card-dimmed):not(.card-picked) { transform: translateY(-4px) scale(1.03); }
.reward-card.card-common { border-color: #4a5568; }
.reward-card.card-rare { border-color: var(--rarity-rare); box-shadow: 0 0 16px rgba(59, 130, 246, 0.5); }
.reward-card.card-epic { border-color: var(--rarity-epic); box-shadow: 0 0 20px rgba(168, 85, 247, 0.6); }
.reward-card.card-legendary { border-color: var(--rarity-legendary); box-shadow: 0 0 26px rgba(251, 191, 36, 0.7); animation: l2-card-appear 0.6s ease-out backwards, l2-glow 1.6s ease-in-out infinite; }
.card-glow { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s; background: radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.25) 0%, transparent 70%); }
.reward-card:hover .card-glow { opacity: 1; }
.card-icon { font-size: 44px; line-height: 1; margin-bottom: 8px; text-shadow: 0 0 14px currentColor; }
.card-name { font-size: 10px; font-weight: 700; color: var(--l2-text-bright); text-align: center; line-height: 1.2; margin-bottom: 6px; min-height: 24px; }
.card-rarity { padding: 2px 8px; font-size: 8px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; background: rgba(0, 0, 0, 0.5); border-radius: 8px; }
.card-common .card-rarity { color: #94a3b8; }
.card-rare .card-rarity { color: #60a5fa; }
.card-epic .card-rarity { color: #c084fc; }
.card-legendary .card-rarity { color: var(--l2-gold-bright); }
.reward-card.card-picked {
  border-color: var(--l2-gold-bright);
  box-shadow: 0 0 44px rgba(244, 212, 119, 1), 0 0 90px rgba(244, 212, 119, 0.5);
  animation: l2-card-pick 0.6s ease-out forwards;
  pointer-events: none;
  z-index: 2;
}
@keyframes l2-card-pick { 0% { transform: scale(1); } 30% { transform: scale(1.2); } 50% { transform: scale(1.1); } 100% { transform: scale(1.3) translateY(-20px); opacity: 0.9; } }
.reward-card.card-dimmed { opacity: 0.15; filter: grayscale(1); pointer-events: none; transform: scale(0.85); transition: all 0.4s; }

/* ==========================================================================
   26. СРАВНЕНИЕ
   ========================================================================== */
.compare-window { max-width: 540px !important; }
.cmp-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 10px 8px; margin-bottom: 8px; background: linear-gradient(180deg, #1a0f2a 0%, #0a0510 100%); border: 1px solid var(--purple-dark); border-radius: var(--r-sm); }
.cmp-side { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cmp-avatar {
  width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  font-size: 27px;
  border-radius: 50%;
  background: linear-gradient(180deg, #2a1a3a 0%, #150a1f 100%);
  border: 2px solid var(--l2-purple);
}
.cmp-avatar.battle-archer { border-color: #4ade80; box-shadow: 0 0 14px rgba(74, 222, 128, 0.5); }
.cmp-avatar.battle-mage { border-color: #c084fc; box-shadow: 0 0 14px rgba(192, 132, 252, 0.5); }
.cmp-name { font-size: 11px; font-weight: 700; color: var(--l2-gold-bright); text-align: center; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-level { font-size: 9px; color: var(--l2-text-dim); }
.cmp-dur { font-size: 11px; margin-top: 2px; }
.cmp-vs { align-self: center; padding: 0 4px; font-family: var(--font-title); font-size: 19px; font-weight: 900; color: var(--l2-gold-bright); letter-spacing: 2px; text-shadow: 0 0 12px rgba(244, 212, 119, 0.8); }
.cmp-section { padding: 6px 9px; margin-bottom: 7px; background: linear-gradient(180deg, var(--l2-slot-dark) 0%, #05070d 100%); border: 1px solid var(--l2-border); border-radius: var(--r-sm); }
.cmp-title { font-family: var(--font-title); font-size: 9px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--l2-text-dim); margin-bottom: 5px; }
.cmp-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  font-size: 10px;
  border-bottom: 1px solid rgba(43, 58, 92, 0.3);
}
.cmp-row:last-child { border-bottom: none; }
.cmp-val { flex: 1; text-align: center; font-family: var(--font-mono); font-weight: 700; font-size: 11px; }
.cmp-val.cmp-good { color: var(--l2-green); text-shadow: 0 0 5px rgba(74, 222, 128, 0.4); }
.cmp-val.cmp-bad { color: var(--l2-red); text-shadow: 0 0 5px rgba(239, 68, 68, 0.4); }
.cmp-label { flex: 1; text-align: center; color: var(--l2-text-dim); font-size: 9px; }
.cmp-reward { display: flex; gap: 8px; padding: 7px 9px; margin-bottom: 8px; background: var(--l2-slot-dark); border: 1px solid var(--l2-border); border-radius: var(--r-sm); }
.cmp-reward-win, .cmp-reward-lose { flex: 1; text-align: center; font-size: 10px; }
.cmp-reward-win { color: var(--l2-green); }
.cmp-reward-lose { color: var(--l2-red); }
.cmp-reward-win b, .cmp-reward-lose b { font-size: 12px; font-family: var(--font-mono); }
.cmp-buttons { display: flex; gap: 8px; }
.cmp-btn { flex: 1; padding: 10px; border-radius: var(--r-sm); font-size: 12px; }
.cmp-btn-back { background: linear-gradient(180deg, #2c3c60 0%, #101a30 100%); border: 1px solid var(--l2-border-light); color: var(--l2-text); }
.cmp-btn-back:active { background: var(--l2-panel-3); }

/* ==========================================================================
   27. ОФЛАЙН-ФАРМ
   ========================================================================== */
.offline-overlay {
  position: fixed;
  left: 50%; top: 42%;
  transform: translate(-50%, -50%);
  z-index: 190;
  pointer-events: none;
}
.offline-overlay.hidden { display: none !important; }
.offline-panel {
  pointer-events: auto;
  width: min(360px, 92vw);
  max-height: 64vh;
  overflow-y: auto;
  padding: 12px;
  border: 2px solid #6366f1;
  border-radius: var(--r-md);
  box-shadow: 0 0 32px rgba(99, 102, 241, 0.6);
}
#offline-report {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 4, 10, 0.72);
  pointer-events: auto;
}
#offline-report.hidden { display: none !important; }
#offline-report .offline-panel {
  width: 100%;
  max-width: 400px;
  padding: 16px;
  border-radius: var(--r-lg);
  box-shadow: 0 0 64px rgba(99, 102, 241, 0.7);
}
.offline-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.offline-icon { font-size: 26px; color: #a5b4fc; display: inline-flex; animation: l2-pulse 2s infinite; }
.offline-title { font-family: var(--font-title); color: #a5b4fc; font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.offline-zone { text-align: center; color: var(--l2-text-dim); font-size: 11px; margin-bottom: 8px; }
.offline-timer { text-align: center; font-family: var(--font-mono); font-size: 26px; font-weight: 700; color: var(--l2-gold-bright); margin-bottom: 8px; text-shadow: 0 0 14px rgba(244, 212, 119, 0.5); }
.offline-progress { height: 7px; margin-bottom: 12px; background: #0a0510; border: 1px solid #312e81; border-radius: 4px; overflow: hidden; }
.offline-progress-fill { height: 100%; background: linear-gradient(90deg, #6366f1, #a855f7); transition: width 0.3s; }
.offline-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.offline-stat { display: flex; justify-content: space-between; padding: 5px 9px; font-size: 11px; background: #0a0510; border: 1px solid #312e81; border-radius: var(--r-xs); }
.os-label { color: var(--l2-text-dim); }
.os-val { color: var(--l2-gold-bright); font-family: var(--font-mono); font-weight: 700; }
.offline-res { padding: 7px 9px; margin-bottom: 8px; background: #0a0510; border: 1px solid #312e81; border-radius: var(--r-xs); }
.or-row { display: flex; justify-content: space-between; font-size: 11px; padding: 2px 0; }
.or-row span:first-child { color: var(--l2-text-dim); }
.or-row span:last-child { color: #a5b4fc; font-weight: 700; font-family: var(--font-mono); }
.offline-forecast { text-align: center; font-size: 10px; color: #a5b4fc; padding: 7px; margin-bottom: 10px; background: rgba(99, 102, 241, 0.1); border-radius: var(--r-xs); }
.of-rate { color: var(--l2-gold-bright); font-size: 9px; }
.offline-log { height: 104px; overflow-y: auto; padding: 7px 9px; margin-bottom: 12px; font-family: var(--font-mono); font-size: 10px; line-height: 1.45; background: #050810; border: 1px solid #312e81; border-radius: var(--r-xs); }
.offline-log > div { padding: 1px 0; }
.offline-log .log-death { color: var(--l2-red); font-weight: 700; }
.offline-log .log-progress { color: var(--l2-text-dim); }
.offline-btn {
  width: 100%;
  padding: 11px;
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #c7d2fe;
  background: linear-gradient(180deg, #312e81 0%, #1e1b4b 100%);
  border: 2px solid #6366f1;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.offline-btn:active { background: #6366f1; color: #fff; }
#report-body { padding: 10px 0; font-size: 12px; }
.report-row { display: flex; justify-content: space-between; padding: 3px 0; }
.report-row span { color: var(--l2-text-dim); }
.report-row b { color: var(--l2-gold-bright); font-family: var(--font-mono); }
.report-divider { height: 1px; background: #312e81; margin: 8px 0; }
#report-icon { animation: l2-pop 0.5s ease-out; }

/* ==========================================================================
   28. БОЕВОЙ ЛОГ
   ========================================================================== */
#combat-log {
  position: fixed;
  right: 8px;
  bottom: 60px;
  z-index: 9;
  pointer-events: none;
  max-width: 62vw;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.35;
  color: var(--l2-text-dim);
  text-shadow: 0 1px 3px #000;
}
#combat-log div { animation: l2-fade-out 3s forwards; }

/* ==========================================================================
   29. ТОСТЫ
   ========================================================================== */
#toast-container {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 230;
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
}
.toast {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--l2-text);
  background: var(--metal);
  border: 1px solid var(--l2-gold);
  border-left: 3px solid var(--l2-gold);
  border-radius: var(--r-sm);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65);
  animation: l2-toast-in 2.6s forwards;
}
.toast.rare { border-color: var(--rarity-rare); color: var(--rarity-rare); }
.toast.epic { border-color: var(--rarity-epic); color: var(--rarity-epic); }
.toast.legendary { border-color: var(--rarity-legendary); color: var(--rarity-legendary); }
.toast.unique { border-color: var(--rarity-unique); color: var(--rarity-unique); }

/* ==========================================================================
   30. DAMAGE NUMBERS (HTML-оверлей поверх канваса)
   ========================================================================== */
#damage-numbers {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 15;
}
.damage-num {
  position: absolute;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  color: #f8fafc;
  text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  animation: l2-damage-float 0.9s ease-out forwards;
  will-change: transform, opacity;
}
.damage-num.dmg-crit { font-size: 21px; color: #fca5a5; text-shadow: 0 1px 2px #000, 0 0 12px rgba(239, 68, 68, 0.95); }
.damage-num.dmg-heal { color: #86efac; }
.damage-num.dmg-miss { color: #a5f3fc; font-style: italic; }
.damage-num.dmg-player { color: #fca5a5; }

/* ==========================================================================
   31. ДОПОЛНИТЕЛЬНЫЕ ЭФФЕКТЫ (оверлеи)
   ========================================================================== */
.float-popup {
  position: fixed;
  left: 50%; top: 40%;
  transform: translateX(-50%);
  z-index: 260;
  pointer-events: none;
  font-weight: 800;
  letter-spacing: 1px;
  animation: l2-rise-fade 1.4s ease-out forwards;
}
@keyframes l2-rise-fade {
  0% { opacity: 0; transform: translate(-50%, 6px); }
  15% { opacity: 1; transform: translate(-50%, 0); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -10px); }
}
.level-up-banner {
  position: fixed;
  left: 50%; top: 30%;
  transform: translateX(-50%);
  z-index: 270;
  pointer-events: none;
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--l2-gold-bright);
  text-shadow: 0 0 26px rgba(244, 212, 119, 0.9), 0 2px 4px #000;
  animation: l2-level-up 1.8s ease-out forwards;
}
@keyframes l2-level-up {
  0% { opacity: 0; transform: translate(-50%, 20px) scale(0.6); }
  35% { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  70% { transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -30px) scale(0.9); }
}
.screen-shake { animation: l2-shake 0.3s ease-in-out; }

/* ==========================================================================
   32. МОБИЛЬНАЯ АДАПТАЦИЯ И БЕЗОПАСНЫЕ ЗОНЫ
   ========================================================================== */
@supports (padding: env(safe-area-inset-top)) {
  #hud-top { padding-top: calc(4px + env(safe-area-inset-top)); }
  #bottom-panel { padding-bottom: calc(3px + env(safe-area-inset-bottom)); }
}

@media (max-width: 720px) {
  #hud-top { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .hud-bars { width: 116px; }
  .hud-res { font-size: 11px; gap: 7px; }
  .xp-bar { width: 40px; }
  .hud-stats { gap: 3px; }
  .hud-stats .hs { font-size: 9px; padding: 1px 5px; }
  .modal-header h2 { font-size: 14px; }
  .tab-btn { min-height: 36px; }
  .reward-card { width: 100px; height: 150px; }
  .card-icon { font-size: 38px; }
}

@media (max-width: 520px) {
  .hud-stats .hs-range,
  .hud-stats .hs-ls { display: none; }
  .skill-btn { width: 50px; height: 50px; }
  .skill-icon { font-size: 23px; }
  #skill-bar { gap: 5px; bottom: 60px; }
  .hud-stat { min-width: 48px; padding: 4px 6px; }
  .l2-hero-body { flex-direction: column; align-items: center; }
  .mannequin { grid-template-columns: repeat(4, 1fr); }
  .hs-grid { grid-template-columns: 1fr; }
  .reward-cards { gap: 6px; }
  .reward-card { width: 88px; height: 136px; }
  .card-name { font-size: 9px; }
  .class-btn { min-width: 118px; padding: 14px 12px; }
  #city-name { font-size: 22px; }
  .overlay h1 { font-size: 28px; }
}

/* Горизонтальная прокрутка стат-полосы без видимого скроллбара */
.hud-stats::-webkit-scrollbar { height: 0; }

/* ==========================================================================
   33. СЛУЖЕБНЫЕ СОСТОЯНИЯ
   ========================================================================== */
/* Контейнер статов героя */
.l2-hero-stats { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }

/* Стороны визуального боя */
.battle-side-me  { align-items: flex-start; }
.battle-side-opp { align-items: flex-end; }

/* Контент табов */
.tab-content { min-height: 100px; }

/* Кнопка офлайн-фарма на карточке зоны */
.zone-offline-check {
  margin-top: 6px;
  width: 100%;
  padding: 6px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  color: #a5b4fc;
  background: linear-gradient(180deg, #312e81, #1e1b4b);
  border: 1px solid #6366f1;
  border-radius: var(--r-xs);
  cursor: pointer;
}
.zone-offline-check:active { background: #6366f1; color: #fff; }

/* Зажатая кнопка (long-press) */
.holding {
  border-color: var(--l2-gold) !important;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.7) !important;
  filter: brightness(1.15);
}

/* Классы персонажей (на случай прямого использования) */
.archer { color: #4ade80; }
.mage { color: #c084fc; }

/* ==========================================================================
   34. ДОПОЛНИТЕЛЬНЫЕ SVG-ИКОНКИ (статы и служебные)
   ========================================================================== */
.l2i-accuracy   { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 1v4M12 19v4M1 12h4M19 12h4'/%3E%3C/svg%3E"); color: #67e8f9; }
.l2i-armorpen   { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 20L18 6M14 4l6 6-3 3-6-6z'/%3E%3C/svg%3E"); color: #fca5a5; }
.l2i-antiheal   { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M6 6l12 12'/%3E%3C/svg%3E"); color: #86efac; }
.l2i-berserk    { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M4 6l6 2 2-4 2 4 6-2-2 7 2 3H6l2-3z'/%3E%3C/svg%3E"); color: #ef4444; }
.l2i-thorns     { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 3v18M4 8l16 8M20 8L4 16'/%3E%3C/svg%3E"); color: #c084fc; }
.l2i-manaregen  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 4v16M12 4a8 8 0 0 1 8 8M12 4a8 8 0 0 0-8 8'/%3E%3C/svg%3E"); color: #3b82f6; }
.l2i-critdamage { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 3v18M8 7l4-4 4 4M8 17l4 4 4-4'/%3E%3C/svg%3E"); color: #ffb366; }
.l2i-moveSpeed  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M6 4v9l-2 4v3h9v-3l-3-3V4z'/%3E%3C/svg%3E"); color: #fef08a; }

/* Служебные */
.l2i-box      { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M3 7l9-4 9 4-9 4zM3 7v10l9 4 9-4V7'/%3E%3C/svg%3E"); color: #d4af37; }
.l2i-run      { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='14' cy='5' r='2'/%3E%3Cpath d='M12 21l-2-6-3-2 3-5 3 3 4 1M7 12l-3 3'/%3E%3C/svg%3E"); color: #a5b4fc; }
.l2i-offline  { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M12 3a7 7 0 0 1 7 7c0 2-1 3-2 4v3H7v-3c-1-1-2-2-2-4a7 7 0 0 1 7-7zM9 21h6'/%3E%3C/svg%3E"); color: #a5b4fc; }
.l2i-mob      { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M5 9l-2-4 4 2M19 9l2-4-4 2'/%3E%3Ccircle cx='12' cy='13' r='6'/%3E%3Cpath d='M9 12h.01M15 12h.01M9.5 16c1.5 1 3.5 1 5 0'/%3E%3C/svg%3E"); color: #cbd5e1; }
.l2i-trophy   { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M6 3h12v5a6 6 0 0 1-12 0zM6 5H3v2a3 3 0 0 0 3 3M18 5h3v2a3 3 0 0 1-3 3M9 20h6M12 14v6'/%3E%3C/svg%3E"); color: #f4d477; }
.l2i-death    { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M12 2a8 8 0 0 0-8 8c0 3 1.5 4.5 2.5 5.5V20h11v-4.5c1-1 2.5-2.5 2.5-5.5a8 8 0 0 0-8-8z'/%3E%3Ccircle cx='9' cy='10' r='1.6' fill='%23000'/%3E%3Ccircle cx='15' cy='10' r='1.6' fill='%23000'/%3E%3Cpath d='M10 16h4'/%3E%3C/svg%3E"); color: #cbd5e1; }
.l2i-star     { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M12 2l2.9 6.3 6.9.7-5.2 4.6 1.5 6.8L12 17.8 5.9 20.4l1.5-6.8L2.2 9l6.9-.7z'/%3E%3C/svg%3E"); color: #f4d477; }
.l2i-shield   { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M12 2l8 3v6c0 5-3.5 8.5-8 11-4.5-2.5-8-6-8-11V5z'/%3E%3C/svg%3E"); color: #6ba3e8; }
.l2i-weight   { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 3v4M6 21h12l-2-8H8zM8 13a4 4 0 1 1 8 0'/%3E%3C/svg%3E"); color: #d4af37; }
.l2i-user     { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E"); color: #d4af37; }
.l2i-cooldown { --l2i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='13' r='8'/%3E%3Cpath d='M12 9v4l3 2M9 2h6'/%3E%3C/svg%3E"); color: #93c5fd; }

/* ==========================================================================
   35. АРЕНА — СКРЫТИЕ ОБЫЧНОГО HUD
   ========================================================================== */
body.arena-active #hud-top,
body.arena-active #hud-stats,
body.arena-active #hud-zone,
body.arena-active #hud-actions,
body.arena-active #combat-log,
body.arena-active #hud-offline,
body.arena-active #bottom-panel { display: none !important; }
/* ==========================================================================
   HERO v6 — консолидированный финал
   Заменяет HERO FIX v1–v5. Не трогает секции 1–35.
   ========================================================================== */

:root { --cell: 40px; --cell-gap: 3px; }
@media (min-width: 480px) { :root { --cell: 44px; --cell-gap: 4px; } }
@media (max-width: 380px) { :root { --cell: 36px; --cell-gap: 2px; } }

/* ── 1. Все ячейки одного размера ────────────────────────── */
.eq-slot, .bp-item, .skill-slot, .enhance-item, .sb-item, .slot-item,
.scroll-item, .potion-item, .soulshot-item, .skill-card {
  width: var(--cell) !important;
  height: var(--cell) !important;
  min-width: var(--cell) !important;
  min-height: var(--cell) !important;
  max-width: var(--cell) !important;
  max-height: var(--cell) !important;
  padding: 1px !important;
  border-radius: 3px !important;
  position: relative;
  overflow: hidden;
  background: var(--l2-slot) !important;
  box-shadow: inset 0 0 2px rgba(0,0,0,0.6) !important;
}

.eq-slot .eq-icon, .bp-item .bp-icon, .skill-slot .slot-icon,
.enhance-item .ei-icon, .sb-item .sb-icon, .slot-item .slot-icon,
.scroll-item .scroll-icon, .potion-item .potion-icon,
.soulshot-item .soulshot-icon, .skill-card .sc-icon {
  font-size: calc(var(--cell) * 0.5) !important;
  line-height: 1 !important;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  filter: none !important;
  text-shadow: none !important;
}

/* ── 2. Инфа внутри ячейки: имя, грейд, количество ─────── */
.bp-item .bp-name, .scroll-item .scroll-name, .potion-item .scroll-name,
.soulshot-item .scroll-name {
  display: block !important;
  position: absolute !important;
  bottom: 0; left: 0; right: 0;
  height: 8px;
  line-height: 8px;
  text-align: center;
  font-size: 5px;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(0,0,0,0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 1px;
}

.bp-item .bp-grade, .sb-item .sb-grade, .enhance-item .ei-grade, .eq-slot .eq-grade {
  display: block !important;
  position: absolute !important;
  top: 0; left: 2px;
  font-size: 5px;
  font-weight: 700;
  line-height: 8px;
  text-shadow: 0 0 3px #000;
  z-index: 2;
}
.eq-slot .eq-grade {
  font-size: 8px;
  font-weight: bold;
  position: absolute; top: 1px; left: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 0 3px #000;
}
.eq-slot .enh, .bp-item .enh, .enhance-item .ei-enh, .sb-item .sb-enh,
.bp-count, .scroll-item .scroll-count, .potion-item .potion-count,
.soulshot-item .soulshot-count, .slot-item .slot-count,
.skill-card .sc-lvl, .skill-slot .slot-lvl {
  display: block !important;
  position: absolute !important;
  top: 0; right: 2px;
  font-family: var(--font-mono);
  font-size: 6px;
  font-weight: 700;
  line-height: 8px;
  color: #f4d477;
  text-shadow: 0 0 3px #000;
  z-index: 2;
}

.skill-slot .slot-num,
.skill-card .sc-in-slot {
  position: absolute;
  top: 1px; left: 3px;
  font-family: var(--font-mono);
  font-size: 6px;
  line-height: 1;
  color: var(--l2-text-dim);
}
.skill-card .sc-in-slot { color: var(--l2-green); font-weight: 700; }

.bp-item .bp-book-lvl {
  display: block !important;
  position: absolute;
  bottom: 0; left: 0; right: 0;
  text-align: center;
  font-size: 5px;
  font-weight: 700;
  color: #60a5fa;
  background: rgba(0,0,0,.6);
  line-height: 8px;
}

/* Скрыть мусор */
.bp-item .bp-stats, .sb-item .sb-stats, .sb-item .sb-name,
.skill-card .sc-name, .skill-card .sc-meta,
.enhance-item .ei-stats, .enhance-item .ei-bonus,
.eq-slot .slot-label, .slot-item .slot-label { display: none !important; }

.eq-slot.empty {
  color: rgba(154,138,104,0.5) !important;
  font-size: 5px !important;
  line-height: 1;
  padding: 2px;
  border-style: dashed !important;
  text-transform: uppercase;
  text-align: center;
}

/* Рамки грейда */
.bp-item[data-grade="ng"] { border-color: var(--grade-ng); }
.bp-item[data-grade="d"]  { border-color: var(--grade-d); }
.bp-item[data-grade="c"]  { border-color: var(--grade-c); }
.bp-item[data-grade="b"]  { border-color: var(--grade-b); }
.bp-item[data-grade="a"]  { border-color: var(--grade-a); }
.bp-item[data-grade="s"]  { border-color: var(--grade-s); box-shadow: 0 0 8px rgba(239,68,68,.4) !important; }

/* ── 3. HERO — layout ───────────────────────────────────── */
#modal-hero .modal-window {
  max-width: 480px;
  height: auto !important;
  max-height: 84vh !important;
  display: flex;
  flex-direction: column;
}
#modal-hero .modal-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 6px 8px !important;
}
#hero-block { display: flex; flex-direction: column; gap: 6px; }

.l2-hero-body {
  display: grid !important;
  grid-template-columns: auto 1fr !important;
  gap: 8px !important;
  align-items: start !important;
}

.l2-pd-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
  width: calc(var(--cell) * 3 + 12px);
  max-width: calc(var(--cell) * 3 + 12px);
}

/* ── 4. Mannequin 3 колонки × 4 ряда ───────────────────── */
.mannequin {
  display: grid !important;
  grid-template-columns: var(--cell) var(--cell) var(--cell) !important;
  grid-template-rows: repeat(4, var(--cell)) !important;
  gap: var(--cell-gap) !important;
  padding: 3px;
  flex-shrink: 0;
  position: relative;
  background: linear-gradient(180deg, #05070d 0%, #02040a 100%);
  border: 1px solid var(--l2-border);
  border-radius: 3px;
  box-shadow: inset 0 0 18px rgba(0,0,0,.7);
}
.mannequin::before {
  content: "";
  grid-area: 1 / 2 / 5 / 3;
  z-index: 0;
  background:
    radial-gradient(ellipse 55% 16% at 50% 12%, rgba(212,175,55,.35) 0%, transparent 70%),
    radial-gradient(ellipse 75% 28% at 50% 40%, rgba(71,96,143,.5) 0%, transparent 75%),
    radial-gradient(ellipse 90% 32% at 50% 90%, rgba(30,42,70,.65) 0%, transparent 80%),
    #05070d;
  border: 1px solid rgba(212,175,55,.18);
  pointer-events: none;
}
.mannequin .eq-slot { position: relative; z-index: 1; }

.mannequin .eq-slot[data-slot="helmet"] { grid-area: 1 / 1; }
.mannequin .eq-slot[data-slot="armor"]  { grid-area: 2 / 1; }
.mannequin .eq-slot[data-slot="gloves"] { grid-area: 3 / 1; }
.mannequin .eq-slot[data-slot="boots"]  { grid-area: 4 / 1; }
.mannequin .eq-slot[data-slot="amulet"] { grid-area: 1 / 3; }
.mannequin .eq-slot[data-slot="cloak"]  { grid-area: 2 / 3; }
.mannequin .eq-slot[data-slot="ring"]   { grid-area: 3 / 3; }
.mannequin .eq-slot[data-slot="weapon"] { grid-area: 4 / 3; }

/* ── 5. Статы под манекеном — ВСЕ, с названиями, компактно ─ */
.l2-hero-stats {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  padding: 3px 5px !important;
  margin-top: 0 !important;
  background: #05070d !important;
  border: 1px solid var(--l2-border) !important;
  border-radius: 3px !important;
  font-size: 7px !important;
  line-height: 1.1 !important;
}

.l2-hero-stats .hs-group,
.l2-hero-stats .hs-grid { display: contents !important; }

.l2-hero-stats .hs-title {
  display: block !important;
  font-family: var(--font-title);
  font-size: 7px !important;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--l2-gold) !important;
  margin: 4px 0 1px !important;
  padding-bottom: 1px;
  border-bottom: 1px solid rgba(212,175,55,.2);
  text-align: center;
}
.l2-hero-stats .hs-group:first-child .hs-title { margin-top: 0 !important; }

.l2-hero-stats .hs-cell {
  display: grid !important;
  grid-template-columns: 11px 1fr auto !important;
  gap: 3px !important;
  align-items: center;
  padding: 0.5px 0;
  font-size: 7px;
  line-height: 1.15;
  white-space: nowrap;
  width: 100%;
}
.l2-hero-stats .hs-ico { width: 11px; text-align: center; font-size: 8px; }
.l2-hero-stats .hs-label {
  display: block !important;
  font-size: 6.5px !important;
  color: var(--l2-text-dim) !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.l2-hero-stats .hs-base { display: none !important; }
.l2-hero-stats .hs-add {
  display: none !important;
}
.l2-hero-stats .hs-total {
  font-family: var(--font-mono) !important;
  font-weight: 700 !important;
  font-size: 7px !important;
  text-align: right;
  color: var(--l2-gold-bright) !important;
  min-width: 0 !important;
}

/* ── 6. Бонусы заточки ──────────────────────────────────── */
.l2-hero-bonuses {
  margin-top: 0;
  padding: 3px 5px;
  flex-shrink: 0;
  background: #05070d;
  border: 1px solid var(--l2-border);
  border-radius: 3px;
}
.l2-hero-bonuses .hb-title {
  font-size: 7px;
  margin-bottom: 2px;
  letter-spacing: 0.4px;
  color: var(--l2-gold);
}
.l2-hero-bonuses .hb-list { display: flex !important; flex-direction: column !important; gap: 1px; }
.l2-hero-bonuses .hb-row {
  display: grid;
  grid-template-columns: 11px 1fr auto;
  gap: 3px;
  align-items: center;
  font-size: 7px;
  padding: 0.5px 0;
}
.l2-hero-bonuses .hb-icon { width: 11px; text-align: center; font-size: 8px; }
.l2-hero-bonuses .hb-name {
  color: var(--l2-gold-bright);
  font-weight: 700;
  font-size: 6.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.l2-hero-bonuses .hb-val {
  color: var(--l2-gold-bright);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 6.5px;
  text-align: right;
}
.l2-hero-bonuses .hb-empty { display: none; }

/* ── 7. Правая колонка: табы + сетки ────────────────────── */
.l2-content-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
}

/* Табы — одной строкой */
.tab-bar, .l2-tab-bar, #hero-tabs, #arena-tabs, #shop-cat-tabs {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: none;
  min-height: 28px !important;
  padding: 3px !important;
}
.tab-bar::-webkit-scrollbar, .l2-tab-bar::-webkit-scrollbar,
#hero-tabs::-webkit-scrollbar, #arena-tabs::-webkit-scrollbar,
#shop-cat-tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 0 0 auto !important;
  min-width: fit-content !important;
  padding: 6px 10px !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
  min-height: 22px !important;
  white-space: nowrap !important;
}

/* Кнопка сортировки */
.tab-tools { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.tool-btn {
  padding: 4px 10px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  color: var(--l2-gold-bright);
  background: linear-gradient(180deg, #2c3c60 0%, #101a30 100%);
  border: 1px solid var(--l2-gold-dark);
  border-radius: 3px;
  cursor: pointer;
}
.tool-btn:active { background: var(--l2-gold); color: #1a1206; }

/* Сетки — auto-fill var(--cell) */
.backpack-grid, .scrolls-list, .potions-list, .soulshots-list,
.learned-skills, .enhance-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, var(--cell)) !important;
  grid-auto-rows: var(--cell) !important;
  gap: var(--cell-gap) !important;
  padding: 4px !important;
  justify-content: start !important;
  align-content: start !important;
  min-height: calc(var(--cell) * 2) !important;
  max-height: 46vh !important;
  overflow-y: auto !important;
  background: #05070d !important;
  border: 1px solid var(--l2-border) !important;
  border-radius: 3px !important;
  box-shadow: inset 0 0 16px rgba(0,0,0,.7) !important;
}
.backpack-grid::-webkit-scrollbar,
.scrolls-list::-webkit-scrollbar,
.potions-list::-webkit-scrollbar,
.soulshots-list::-webkit-scrollbar,
.learned-skills::-webkit-scrollbar,
.enhance-grid::-webkit-scrollbar { width: 6px; }
.backpack-grid::-webkit-scrollbar-thumb,
.scrolls-list::-webkit-scrollbar-thumb,
.potions-list::-webkit-scrollbar-thumb,
.soulshots-list::-webkit-scrollbar-thumb,
.learned-skills::-webkit-scrollbar-thumb,
.enhance-grid::-webkit-scrollbar-thumb {
  background: var(--l2-gold-dim);
  border-radius: 3px;
}

/* Скилл-слоты — flex */
.skill-slots-row {
  display: flex !important;
  flex-wrap: wrap;
  gap: var(--cell-gap) !important;
  padding: 4px !important;
  margin-bottom: 4px;
  flex-shrink: 0;
  background: #05070d !important;
  border: 1px solid var(--l2-border) !important;
  border-radius: 3px !important;
}

/* Подвал */
.l2-hero-footer {
  margin-top: 6px;
  padding: 5px 8px;
  flex-shrink: 0;
  background: #05070d;
  border: 1px solid var(--l2-border);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.l2-footer-row { display: flex; align-items: center; gap: 6px; }
.l2-adena { margin-left: auto; font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--l2-gold-bright); }
.l2-weight-val { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--l2-gold-bright); min-width: 46px; text-align: right; }
.l2-weight-bar { flex: 1; height: 6px; background: #05070d; border: 1px solid var(--l2-border); border-radius: 3px; overflow: hidden; }
.l2-weight-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--l2-green), var(--l2-gold)); }

/* ── 8. Магазин — строки (не сетка) ─────────────────────── */
#shop-content, .shop-content {
  display: block !important;
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  min-height: 0 !important;
  padding: 2px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.shop-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 7px 9px !important;
  margin-bottom: 4px !important;
  background: linear-gradient(180deg, var(--l2-slot) 0%, var(--l2-slot-dark) 100%) !important;
  border: 1px solid var(--l2-border) !important;
  border-radius: var(--r-sm) !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 52px !important;
}
.shop-row > * { visibility: visible !important; opacity: 1 !important; }
.shop-row .auction-icon {
  width: 40px !important; height: 40px !important;
  min-width: 40px !important; flex-shrink: 0 !important;
}
.shop-row .auction-info { flex: 1 1 auto !important; min-width: 0 !important; }
.shop-row button {
  flex-shrink: 0 !important;
  min-width: 70px !important;
  display: inline-block !important;
}

/* ── 9. Облегчение — убираем тяжёлое ───────────────────── */
.modal, .popup, .reward-overlay, .arena-result-overlay {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.modal-window, .popup-window, .offline-panel, .aro-panel-large, .auth-box {
  box-shadow: 0 4px 16px rgba(0,0,0,0.7) !important;
}
.modal-window, .popup-window { background: #0d1524 !important; }
.modal-header {
  background: linear-gradient(180deg, #1a2440 0%, #0e1628 100%) !important;
  box-shadow: none !important;
}
.modal-window::before, .modal-window::after,
.popup-window::before, .popup-window::after { display: none !important; }

#btn-auto.on, .ac-row.ac-ready, .reward-card.card-legendary { animation: none !important; }

.bp-item, .eq-slot, .skill-slot, .skill-btn, .tab-btn, .hud-stat,
.scroll-item, .potion-item, .soulshot-item, .enhance-item, .skill-card,
#bottom-panel button, .modal-close, .city-btn, .zone-card, .ar-btn,
.ac-btn, .enhance-btn, .popup-close, .auth-btn, .class-btn {
  transition: border-color 0.1s ease, background 0.1s ease !important;
}
* {
  transition-property: border-color, background, color, opacity !important;
  transition-duration: 0.1s !important;
}
.hud-bar, .hud-stat, .skill-btn { box-shadow: inset 0 0 3px rgba(0,0,0,0.5) !important; }
.hud-top, #bottom-panel { box-shadow: none !important; }

/* ── 10. Скилл-попап ────────────────────────────────────── */
#skill-popup.popup {
  position: fixed; inset: 0;
  z-index: 290;
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
  background: rgba(3,6,12,.82);
}
.skill-popup-window {
  width: 100%; max-width: 300px;
  padding: 12px;
  background: #0d1524;
  border: 1px solid var(--l2-gold);
  border-radius: 6px;
  box-shadow: 0 6px 28px rgba(0,0,0,.7);
}
.sp-header { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid rgba(212,175,55,.2); }
.sp-icon { font-size: 32px; line-height: 1; }
.sp-title { flex: 1; }
.sp-name { font-family: var(--font-title); font-size: 15px; font-weight: 700; color: var(--l2-gold-bright); }
.sp-lvl { font-size: 10px; color: var(--l2-text-dim); margin-top: 2px; font-family: var(--font-mono); }
.sp-section { margin-bottom: 8px; }
.sp-section-title { font-family: var(--font-title); font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--l2-gold); margin-bottom: 4px; }
.sp-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 11px; border-bottom: 1px solid rgba(43,58,92,.4); }
.sp-row span { color: var(--l2-text-dim); }
.sp-row b { color: var(--l2-gold-bright); font-family: var(--font-mono); font-weight: 700; }
.sp-effect { font-size: 11px; line-height: 1.4; color: var(--l2-text); padding: 6px 8px; background: rgba(96,165,250,.08); border-left: 3px solid #60a5fa; border-radius: 3px; }
.sp-next { font-size: 10px; line-height: 1.4; color: #86efac; padding: 6px 8px; background: rgba(74,222,128,.08); border-left: 3px solid #4ade80; border-radius: 3px; margin-top: 4px; }
.sp-actions { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.sp-btn { width: 100%; padding: 8px; border-radius: 4px; font-family: inherit; font-size: 11px; font-weight: 700; cursor: pointer; border: 1px solid; }
.sp-btn-primary { background: linear-gradient(180deg, #2f6a3a 0%, #10280f 100%); border-color: #4ade80; color: #b9f5c8; }
.sp-btn-primary:active { background: #2f6a3a; color: #fff; }
.sp-btn-secondary { background: linear-gradient(180deg, #3a2c10 0%, #1a1208 100%); border-color: var(--l2-gold); color: var(--l2-gold-bright); }
.sp-btn-secondary:active { background: var(--l2-gold); color: #1a1206; }
.sp-btn-cancel { background: linear-gradient(180deg, #2c3c60 0%, #101a30 100%); border-color: var(--l2-border-light); color: var(--l2-text); }
.sp-btn-cancel:active { background: var(--l2-panel-3); }
.sp-btn:disabled { opacity: .4; cursor: not-allowed; }

/* Попап предмета — шире для бонусов */
.popup-window { max-width: 320px !important; }
.popup-window .stat-row { padding: 3px 0 !important; font-size: 10px !important; }
.popup-window .stat-row .stat-val { font-size: 10px !important; }
.popup-window .sp-effect { font-size: 10px !important; margin-top: 6px !important; }
/* ============================================================
   HERO v7 — ячейки 4×5 (+20%), бонусы справа, резерв места
   ============================================================ */

:root { --cell: 48px; --cell-gap: 4px; }
@media (min-width: 480px) { :root { --cell: 52px; --cell-gap: 5px; } }
@media (max-width: 380px) { :root { --cell: 42px; --cell-gap: 3px; } }

/* Ячейки пересчитываются автоматически через var(--cell).
   Проверяем совместимость с грейд-рамками, чтобы не поехало */
.eq-slot, .bp-item, .skill-slot, .enhance-item, .sb-item, .slot-item,
.scroll-item, .potion-item, .soulshot-item, .skill-card {
  width: var(--cell) !important;
  height: var(--cell) !important;
  min-width: var(--cell) !important;
  min-height: var(--cell) !important;
  max-width: var(--cell) !important;
  max-height: var(--cell) !important;
}



/* Манекен 3 колонки — пересчитывается через var(--cell) автоматически */

/* ── Бонусы заточки: под рюкзаком, справа, резерв 8 строк ── */
.l2-hero-bonuses {
  margin-top: 6px !important;
  padding: 5px 7px !important;
  min-height: 104px !important; /* ≈ 8 строк × 11px + title + padding */
  flex-shrink: 0 !important;
  background: #05070d !important;
  border: 1px solid var(--l2-border) !important;
  border-radius: 3px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}
.l2-hero-bonuses:empty,
.l2-hero-bonuses .hb-empty { display: none !important; }
/* Пустая плашка-подсказка, если бонусов нет — не даёт прыгать layout */
.l2-hero-bonuses::before {
  content: "";
  flex: 1 1 auto;
  min-height: 0;
}

/* Правая колонка — не прыгает: flex column фиксирует порядок */
.l2-content-wrap {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  min-width: 0 !important;
}

/* Левая и правая части — выравниваем верх */
.l2-hero-body {
  align-items: start !important;
}
.l2-pd-wrap {
  align-self: start !important;
}

/* ── Мелочи под размер 48px ───────────────────────────────── */
/* Иконка в ячейке — 50% от --cell, подстроится сама */
/* Бейджи в ячейке — увеличим чуть-чуть под крупный размер */
.bp-item .bp-grade, .bp-item .bp-name, .scroll-item .scroll-name,
.potion-item .scroll-name, .soulshot-item .scroll-name {
  font-size: 6px !important;
  line-height: 9px !important;
  height: 9px !important;
}
.bp-item .enh, .bp-count,
.scroll-item .scroll-count, .potion-item .potion-count,
.soulshot-item .soulshot-count,
.enhance-item .ei-enh {
  font-size: 11px;
  color: var(--gold-bright);
  font-weight: bold;
  margin-top: 1px;
  text-shadow: 0 0 3px #000, 1px 1px 0 #000;
  line-height: 1;
  font-family: monospace;
}
/* ============================================================
   HERO v8 — сетка 4×6, бонусы без title, placeholder +15
   ============================================================ */

/* ── Сетка: 4 колонки × 6 рядов (было 5, стало 6) ─────── */
.backpack-grid,
.scrolls-list,
.potions-list,
.soulshots-list,
.learned-skills,
.enhance-grid {
  grid-template-columns: repeat(4, var(--cell)) !important;
  grid-template-rows: repeat(6, var(--cell)) !important;
  grid-auto-rows: var(--cell) !important;
  justify-content: start !important;
  align-content: start !important;
  max-height: calc(var(--cell) * 6 + var(--cell-gap) * 5 + 8px) !important;
  overflow-y: auto !important;
}

/* ── Бонусы: убираем заголовок «Бонусы заточки» ────────── */
.l2-hero-bonuses .hb-title {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

/* ── Бонусы: резерв 8 строк, чтобы модалка не прыгала ──── */
.l2-hero-bonuses {
  min-height: calc(8 * 11px + 12px) !important; /* ~100px */
  padding: 4px 6px !important;
  margin-top: 6px !important;
  background: #05070d !important;
  border: 1px solid var(--l2-border) !important;
  border-radius: 3px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1px !important;
}

/* ── Плейсхолдер когда бонусов нет ─────────────────────── */
/* JS вставляет <div class="hb-empty">Нет бонусов...</div> —
   скрываем оригинальный текст и подменяем своим через ::before */
.l2-hero-bonuses .hb-empty {
  display: block !important;
  font-size: 0 !important;        /* прячем оригинальный текст */
  color: transparent !important;
  flex: 1 1 auto !important;
  position: relative;
  min-height: 0;
}
.l2-hero-bonuses .hb-empty::before {
  content: "⚔ Заточи экипировку до +15 — откроется бонус";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  font-style: italic;
  color: var(--l2-text-dim);
  letter-spacing: 0.3px;
  line-height: 1.4;
  padding: 8px;
  border: 1px dashed rgba(212, 175, 55, 0.25);
  border-radius: 3px;
  background: rgba(212, 175, 55, 0.03);
}

/* Когда есть хотя бы один бонус — .hb-empty отсутствует,
   ничего не показываем, контейнер работает как обычно */
.l2-hero-bonuses .hb-list { flex: 1 1 auto !important; }
/* ============================================================
   HUD-PLATE — универсальные плашки игрока и таргета
   (фарм + арена, скрыты в городе)
   ============================================================ */

.hud-plate {
  position: fixed;
  top: 60px;                 /* прижата к hud-top + hud-stats */
  z-index: 218;
  width: 128px;              /* было 152, стало меньше */
  max-width: 40vw;
  padding: 4px 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(23,34,60,0.98), rgba(10,17,32,0.94));
  border: 1px solid var(--l2-gold-dark);
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.7);
}

/* Позиции: своя слева, таргет справа */
.hud-plate-me     { left: 6px;  border-color: #4ade80; }
.hud-plate-target { right: 6px; border-color: #c084fc; }

.hud-plate.hidden { display: none !important; }

/* Полоски HP/MP */
.hud-plate .hud-bar { height: 10px; }

.hud-plate .hud-bar-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 100%;
  transition: width 0.15s linear;
}
.hud-plate .hp-bar .hud-bar-fill {
  background: linear-gradient(180deg, var(--l2-hp-1) 0%, var(--l2-hp-2) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}
.hud-plate .mana-bar .hud-bar-fill {
  background: linear-gradient(180deg, var(--l2-mp-1) 0%, var(--l2-mp-2) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}
.hud-plate .hud-bar-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
  z-index: 1;
  pointer-events: none;
}

/* Баффы / дебаффы под полосками */
.hud-plate .as-buffs {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: none;
}
.hud-plate-me .as-buffs     { justify-content: flex-start; }
.hud-plate-target .as-buffs { justify-content: flex-end; }
.hud-plate .as-buff {
  width: 18px; height: 18px;
  font-size: 11px;
  background: rgba(0,0,0,0.7);
  border: 1px solid var(--l2-border);
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.6);
}
.hud-plate .as-buff.expiring {
  border-color: var(--l2-red);
  animation: l2-pulse 0.5s infinite alternate;
}
.hud-plate .as-buff-time {
  position: absolute;
  bottom: -1px; right: 1px;
  font-family: var(--font-mono);
  font-size: 6px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 2px #000;
  pointer-events: none;
}

/* В городе скрыты */
body.city-open .hud-plate { display: none !important; }
/* Кнопки «В слот 1..8» в попапе предмета */
.sp-slot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 4px;
}
.sp-slot-btn {
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--l2-gold-bright);
  background: linear-gradient(180deg, #2c3c60 0%, #101a30 100%);
  border: 1px solid var(--l2-gold-dark);
  border-radius: 4px;
  cursor: pointer;
}
.sp-slot-btn:active {
  background: var(--l2-gold);
  color: #1a1206;
}
/* ============================================================
   Уместить 8 слотов на мобильном экране (375px)
   ============================================================ */

/* Кнопки скилл-бара внизу слева */
#skill-bar {
  gap: 3px !important;
  left: 6px !important;
  bottom: 60px !important;
}
.skill-btn {
  width: 38px !important;
  height: 38px !important;
}
.skill-btn .skill-icon {
  font-size: 18px !important;
}
.skill-btn .skill-cd-num {
  font-size: 14px !important;
}
.skill-btn .skill-mana {
  font-size: 8px !important;
}

/* Кнопка АВТО над скилл-баром */
#btn-auto {
  left: 6px !important;
  bottom: 104px !important;
  min-width: 62px !important;
  padding: 4px 10px !important;
  font-size: 10px !important;
  letter-spacing: 1.5px !important;
}

/* Слоты в hero (в модалке инвентаря) */
.skill-slots-row {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 3px !important;
  padding: 4px !important;
  overflow-x: auto !important;
  scrollbar-width: none;
}
.skill-slots-row::-webkit-scrollbar { display: none; }

.skill-slot {
  width: 38px !important;
  height: 38px !important;
  flex-shrink: 0 !important;
}
.skill-slot .slot-icon {
  font-size: 18px !important;
}
.skill-slot .slot-lvl {
  font-size: 7px !important;
}

/* Слоты — ещё чуть меньше, чтобы влезли в 375px без прокрутки */
@media (max-width: 420px) {
  .skill-btn {
    width: 36px !important;
    height: 36px !important;
  }
  .skill-btn .skill-icon { font-size: 17px !important; }
  .skill-btn .skill-cd-num { font-size: 13px !important; }
  .skill-btn .skill-mana { font-size: 7px !important; }
  #skill-bar { gap: 2px !important; left: 5px !important; }

  .skill-slot {
    width: 36px !important;
    height: 36px !important;
  }
  .skill-slot .slot-icon { font-size: 17px !important; }
  .skill-slots-row { gap: 2px !important; padding: 3px !important; }
}

@media (max-width: 360px) {
  .skill-btn { width: 33px !important; height: 33px !important; }
  .skill-btn .skill-icon { font-size: 15px !important; }
  .skill-slot { width: 33px !important; height: 33px !important; }
  .skill-slot .slot-icon { font-size: 15px !important; }
}
/* Заточка: сетка заполняет всю ширину — предметы растягиваются */
.enhance-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr)) !important;
  grid-auto-rows: minmax(52px, auto) !important;
  gap: 4px !important;
  padding: 5px !important;
  align-content: start !important;
  justify-content: stretch !important;
}

/* Сами предметы становятся чуть крупнее, чтобы заполнить ячейку */
.enhance-grid .enhance-item {
  width: 100% !important;
  height: auto !important;
  min-height: 52px !important;
  max-height: none !important;
  max-width: none !important;
  aspect-ratio: 1;
}
/* ============================================================
   Заточка — финальный вид ячейки (как .bp-item в рюкзаке)
   ============================================================ */

/* Ячейка */
.enhance-grid .enhance-item {
  position: relative !important;
  width: var(--cell) !important;
  height: var(--cell) !important;
  min-width: var(--cell) !important;
  max-width: var(--cell) !important;
  min-height: var(--cell) !important;
  max-height: var(--cell) !important;
  padding: 1px !important;
  border-radius: 3px !important;
  background: var(--l2-slot) !important;
  border: 1px solid var(--l2-border) !important;
  display: block !important;   /* отключаем flex — как у bp-item */
  overflow: hidden !important;
  cursor: pointer !important;
}

/* Иконка — центр */
.enhance-grid .enhance-item .ei-icon {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  font-size: calc(var(--cell) * 0.5) !important;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
}

/* Грейд — слева сверху */
.enhance-item .ei-grade {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
  margin-top: 2px;
  text-transform: uppercase;
  text-shadow: 0 0 3px #000, 1px 1px 0 #000;
}

/* Заточка — справа сверху */
.enhance-item .ei-enh {
  font-size: 15px;
  color: var(--gold-bright);
  font-weight: 900;
  margin-top: 2px;
  text-shadow: 0 0 4px #000, 1px 1px 0 #000, 0 0 6px #fbbf24;
  line-height: 1;
  font-family: monospace;
}

/* НАЗВАНИЕ — снизу, крупнее и точно видно */
.enhance-grid .enhance-item .ei-name {
  display: block !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 10px !important;
  line-height: 10px !important;
  text-align: center !important;
  font-size: 6px !important;
  font-weight: 700 !important;
  letter-spacing: 0.2px !important;
  color: #e2e8f0 !important;
  background: rgba(0,0,0,0.72) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  padding: 0 2px !important;
  z-index: 3 !important;
  font-family: var(--font-body) !important;
  text-shadow: 0 0 2px #000 !important;
}

/* Прячем легаси */
.enhance-grid .enhance-item .ei-stats,
.enhance-grid .enhance-item .ei-bonus { display: none !important; }

/* Сетка — как backpack-grid */
.enhance-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, var(--cell)) !important;
  grid-auto-rows: var(--cell) !important;
  gap: var(--cell-gap) !important;
  padding: 4px !important;
  justify-content: start !important;
  align-content: start !important;
  min-height: calc(var(--cell) * 2) !important;
  max-height: 32vh !important;
  overflow-y: auto !important;
  background: #05070d !important;
  border: 1px solid var(--l2-border) !important;
  border-radius: 3px !important;
}
/* Скилл-бар в бою — крупнее на мобилке */
@media (max-width: 480px) {
  #skill-bar .skill-btn {
    width: 42px !important;
    height: 42px !important;
  }
  #skill-bar .skill-btn .skill-icon {
    font-size: 22px !important;
  }
  #skill-bar .skill-btn .skill-cd-num {
    font-size: 15px !important;
  }
  #skill-bar .skill-btn .skill-mana {
    font-size: 8px !important;
  }
  #skill-bar {
    gap: 2px !important;
    left: 5px !important;
    bottom: 58px !important;
  }
  #btn-auto {
    bottom: 104px !important;
    min-width: 66px !important;
    padding: 5px 10px !important;
    font-size: 10px !important;
  }
}

@media (max-width: 360px) {
  #skill-bar .skill-btn {
    width: 38px !important;
    height: 38px !important;
  }
  #skill-bar .skill-btn .skill-icon { font-size: 19px !important; }
}

/* ============================================================
   Скилл-попап: прогресс уровня + milestones
   ============================================================ */
.sp-progress-wrap {
  padding: 0 0 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}
.sp-progress-bar {
  height: 6px;
  background: #05070d;
  border: 1px solid var(--l2-border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}
.sp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2f6a3a, #4ade80, #f4d477);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
  transition: width 0.3s;
}

.sp-milestones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 6px;
  padding: 4px 0;
  margin-bottom: 8px;
}
.sp-ms {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 3px;
  opacity: 0.45;
  transition: opacity 0.2s;
}
.sp-ms.active {
  opacity: 1;
  background: rgba(74, 222, 128, 0.10);
  border-left: 2px solid #4ade80;
}
.sp-ms-lvl {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--l2-gold-bright);
  min-width: 24px;
  text-align: right;
  font-size: 10px;
}
.sp-ms.active .sp-ms-lvl { color: #4ade80; }
.sp-ms-desc {
  color: var(--l2-text);
  font-size: 10px;
}
.sp-ms.active .sp-ms-desc {
  color: #d1fae5;
  font-weight: 700;
}
/* Кнопки количества в диалоге покупки */
.qty-btn {
  width: 32px; height: 32px;
  font-size: 18px; font-weight: 900;
  background: linear-gradient(180deg, #1a2340 0%, #0d1526 100%);
  border: 1px solid #4ade80;
  color: #4ade80;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
  transition: all 0.1s;
}
.qty-btn:active { transform: scale(0.9); background: #4ade80; color: #000; }

input#qty-input {
  width: 74px;
  text-align: center;
  background: #0d1526;
  border: 1px solid #2a3a5c;
  color: #c8d1e6;
  padding: 6px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 15px;
  font-weight: bold;
  outline: none;
}
input#qty-input:focus { border-color: #d4af37; }

/* Убираем стрелочки у number input */
input#qty-input::-webkit-inner-spin-button,
input#qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input#qty-input { -moz-appearance: textfield; }
/* ===== СПРАВОЧНИК (WIKI) ===== */
/* ===== СПРАВОЧНИК (WIKI) ===== */
/* ===== СПРАВОЧНИК (WIKI) ===== */
.wiki-window {
  max-width: 720px !important;
  width: 100%;
  max-height: calc(100vh - 40px) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.wiki-window .modal-header {
  flex-shrink: 0 !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
}

.wiki-body {
  display: flex !important;
  flex-direction: column !important;
  padding: 8px !important;
  gap: 8px !important;
  overflow: hidden !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

.wiki-tabs {
  display: flex !important;
  gap: 4px !important;
  flex-shrink: 0 !important;
}

.wiki-tab {
  flex: 1;
  background: linear-gradient(180deg, #1a2340 0%, #0d1526 100%);
  border: 1px solid #2a3a5c;
  color: #7a8aa8;
  padding: 8px 4px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s;
}
.wiki-tab.active {
  background: linear-gradient(180deg, #3a2a10 0%, #1a1208 100%);
  border-color: #d4af37;
  color: #d4af37;
}

.wiki-search-wrap {
  flex-shrink: 0 !important;
}

.wiki-search {
  width: 100%;
  background: #0d1526;
  border: 1px solid #2a3a5c;
  color: #c8d1e6;
  padding: 8px 10px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
  outline: none;
}
.wiki-search:focus { border-color: #d4af37; }

.wiki-content {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  min-height: 0 !important;
  padding-right: 4px;
}

/* далее — твои старые стили .wiki-city, .wiki-zone, .wiki-mob-card и т.д. без изменений */
.wiki-tabs { display: flex; gap: 4px; flex-shrink: 0; }
.wiki-tab { flex: 1; background: linear-gradient(180deg, #1a2340 0%, #0d1526 100%); border: 1px solid #2a3a5c; color: #7a8aa8; padding: 8px 4px; border-radius: 4px; font-family: inherit; font-size: 11px; font-weight: bold; cursor: pointer; transition: all 0.15s; }
.wiki-tab.active { background: linear-gradient(180deg, #3a2a10 0%, #1a1208 100%); border-color: #d4af37; color: #d4af37; }
.wiki-search-wrap { flex-shrink: 0; }
.wiki-search { width: 100%; background: #0d1526; border: 1px solid #2a3a5c; color: #c8d1e6; padding: 8px 10px; border-radius: 4px; font-family: inherit; font-size: 12px; outline: none; }
.wiki-search:focus { border-color: #d4af37; }
.wiki-content { flex: 1 1 auto; overflow-y: auto; min-height: 0; padding-right: 4px; }
.wiki-city { margin-bottom: 10px; background: #0a1428; border: 1px solid #2a3a5c; border-radius: 4px; overflow: hidden; }
.wiki-city-header { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: rgba(0,0,0,0.4); border-bottom: 2px solid #2a3a5c; font-weight: bold; }
.wiki-city-name { color: #d4af37; font-size: 13px; }
.wiki-city-grade { font-size: 11px; font-weight: 900; letter-spacing: 1px; }
.wiki-zone { padding: 6px 8px; border-bottom: 1px solid #1a2340; }
.wiki-zone:last-child { border-bottom: none; }
.wiki-zone-header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.wiki-zone-diff { font-size: 14px; }
.wiki-zone-name { font-weight: bold; color: #c8d1e6; font-size: 11px; flex: 1; }
.wiki-zone-cost { color: #fbbf24; font-size: 10px; }
.wiki-zone-mobs { display: flex; flex-direction: column; gap: 2px; }
.wiki-mob-line { display: flex; align-items: center; gap: 6px; padding: 3px 6px; background: rgba(26, 35, 64, 0.5); border-radius: 3px; font-size: 10px; }
.wiki-mob-icon { font-size: 12px; min-width: 16px; }
.wiki-mob-name { flex: 1; color: #c8d1e6; }
.wiki-mob-lvl { color: #94a3b8; min-width: 42px; text-align: right; }
.wiki-mob-spots { color: #64748b; font-size: 9px; font-style: italic; max-width: 40%; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiki-mob-card { margin-bottom: 4px; background: #0a1428; border: 1px solid #2a3a5c; border-radius: 4px; overflow: hidden; }
.wiki-mob-card > summary { display: flex; align-items: center; gap: 6px; padding: 6px 8px; cursor: pointer; list-style: none; font-size: 11px; background: rgba(0,0,0,0.2); }
.wiki-mob-card > summary::-webkit-details-marker { display: none; }
.wiki-mob-card[open] > summary { border-bottom: 1px solid #2a3a5c; background: rgba(212, 175, 55, 0.08); }
.wiki-mob-hp { color: #e07878; font-size: 10px; }
.wiki-mob-xp { color: #a3e635; font-size: 10px; }
.wiki-mob-expand { color: #64748b; margin-left: auto; font-size: 10px; }
.wiki-mob-body { padding: 8px 10px; }
.wiki-mob-spawn { font-size: 10px; color: #94a3b8; margin-bottom: 6px; }
.wiki-mob-drops-title { color: #d4af37; font-size: 10px; font-weight: bold; text-transform: uppercase; margin-bottom: 4px; }
.wiki-mob-drops { display: flex; flex-direction: column; gap: 2px; }
.wiki-drop {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  background: rgba(26, 35, 64, 0.6);
  border-radius: 3px;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
}
.wiki-drop-name {
  flex: 1;
  color: #c8d1e6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.wiki-drop-qty {
  color: #94a3b8;
  min-width: 50px;
  text-align: right;
  font-size: 9px;
  flex-shrink: 0;
}
.wiki-drop-chance {
  color: #fbbf24;
  font-weight: bold;
  min-width: 55px;
  text-align: right;
  flex-shrink: 0;
}
.wiki-champ { color: #fbbf24; }
.wiki-empty-drops { color: #64748b; font-style: italic; font-size: 10px; padding: 4px; }
.wiki-item-card { margin-bottom: 4px; background: #0a1428; border: 1px solid #2a3a5c; border-radius: 4px; overflow: hidden; }
.wiki-item-card > summary { display: flex; align-items: center; gap: 8px; padding: 7px 10px; cursor: pointer; list-style: none; font-size: 11px; background: rgba(0,0,0,0.2); }
.wiki-item-card > summary::-webkit-details-marker { display: none; }
.wiki-item-card[open] > summary { border-bottom: 1px solid #2a3a5c; background: rgba(212, 175, 55, 0.08); }
.wiki-item-name { flex: 1; color: #c8d1e6; font-weight: bold; }
.wiki-item-count { color: #64748b; font-size: 10px; }
.wiki-item-body { padding: 6px 8px; }
.wiki-source-list { display: flex; flex-direction: column; gap: 2px; }
.wiki-source {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  background: rgba(26, 35, 64, 0.6);
  border-radius: 3px;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
}
.wiki-source-mob {
  flex: 1;
  color: #c8d1e6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.wiki-source-lvl,
.wiki-source-qty,
.wiki-source-chance {
  flex-shrink: 0;
}
.wiki-source-qty { color: #94a3b8; min-width: 50px; text-align: right; font-size: 9px; }
.wiki-source-chance { color: #fbbf24; font-weight: bold; min-width: 55px; text-align: right; }
.wiki-empty { text-align: center; color: #64748b; font-size: 11px; font-style: italic; padding: 30px; }
.wiki-mob-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  min-width: 16px;
  max-width: 20px;
  height: 16px;
}
.wiki-mob-icon img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  image-rendering: pixelated;
}
/* Боссы в вики */
.wiki-section-title {
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--l2-gold-bright);
  margin: 10px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}
.wiki-bosses-title {
  font-family: var(--font-title);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--l2-gold-bright);
  margin: 6px 0 4px;
}
.wiki-boss-line {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.12), rgba(212, 175, 55, 0.03));
  border-left: 2px solid var(--l2-gold);
  border-radius: 3px;
  font-size: 10px;
  margin-bottom: 2px;
}
.wiki-boss-icon { font-size: 14px; min-width: 18px; }
.wiki-boss-name { flex: 1; color: var(--l2-gold-bright); font-weight: 700; }
.wiki-boss-lvl { color: #94a3b8; min-width: 42px; text-align: right; }
.wiki-boss-respawn { color: #a5b4fc; font-family: var(--font-mono); font-size: 9px; min-width: 50px; text-align: right; }
.wiki-boss-card > summary { border-left: 3px solid var(--l2-gold); }
.wiki-boss-card[open] > summary { background: rgba(212, 175, 55, 0.10); }
.wiki-source-boss {
  background: rgba(212, 175, 55, 0.08);
  border-left: 2px solid var(--l2-gold);
}


.plate-buffs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 3px;
  min-height: 0;
}
.plate-buffs:empty { display: none; }
/* ⚠️ Бейдж тира поверх иконки */
.bp-item .bp-icon {
  position: relative;
  z-index: 1;
}
.bp-item .bp-tier-badge {
  position: absolute;
  top: 1px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 900;
  padding: 0 3px;
  border-radius: 3px;
  color: #fff;
  text-shadow: 0 0 2px #000, 0 0 4px #000;
  z-index: 5;
  line-height: 11px;
  letter-spacing: -1px;
  pointer-events: none;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
}

/* Цвета фона по тиру (ярче) */
/* Дивизионы арены */
.arena-divisions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.arena-division-card {
  padding: 10px 12px;
  background: linear-gradient(180deg, var(--l2-slot) 0%, var(--l2-slot-dark) 100%);
  border: 1px solid var(--l2-border);
  border-radius: var(--r-sm);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.arena-division-card.active {
  border-color: var(--l2-gold);
  background: linear-gradient(180deg, #3a2c10 0%, #1a1208 100%);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.45);
}
.adc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.adc-icon { font-size: 20px; }
.adc-name {
  flex: 1;
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 700;
  color: var(--l2-gold-bright);
  letter-spacing: 0.5px;
}
.adc-rating {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--l2-gold-bright);
}
.adc-sub {
  font-size: 10px;
  color: var(--l2-text-dim);
  margin-bottom: 3px;
}
.adc-stats {
  font-size: 10px;
  color: var(--l2-text);
  margin-bottom: 5px;
  font-family: var(--font-mono);
}
.adc-active {
  font-size: 10px;
  font-weight: 700;
  color: var(--l2-green);
  margin-bottom: 5px;
}
.adc-action {
  margin-top: 5px;
}
.adc-action .ar-btn {
  width: 100%;
  padding: 8px;
  font-size: 11px;
  font-weight: 700;
}
.chests-header {
  padding: 6px 8px;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--l2-text-dim);
  background: rgba(0,0,0,0.3);
  border-radius: var(--r-xs);
}
/* ============================================================
   Рейтинг дивизиона — список игроков
   ============================================================ */
.adc-leaderboard {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
}
.adc-lb-title {
  font-size: 10px;
  color: var(--l2-gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.adc-lb-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.adc-lb-row {
  display: grid;
  grid-template-columns: 24px 20px 1fr 44px 54px 80px;
  gap: 4px;
  align-items: center;
  padding: 3px 6px;
  font-size: 10px;
  background: rgba(0,0,0,0.25);
  border-radius: 3px;
}
.adc-lb-row.me {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--l2-gold);
}
.adc-lb-place {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--l2-text-dim);
  text-align: right;
  font-size: 9px;
}
.adc-lb-class { text-align: center; font-size: 12px; }
.adc-lb-name {
  color: var(--l2-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.adc-lb-row.me .adc-lb-name { color: var(--l2-gold-bright); }
.adc-lb-level {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--l2-text-dim);
  text-align: right;
}
.adc-lb-rating {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--l2-gold-bright);
  text-align: right;
  font-size: 10px;
}
.adc-lb-fight {
  padding: 4px 10px;
  min-width: 70px;
  border-radius: 3px;
  background: linear-gradient(180deg, #2f6a3a 0%, #10280f 100%);
  border: 1px solid #4ade80;
  color: #b9f5c8;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  font-family: inherit;
  white-space: nowrap;
}
.adc-lb-fight:active {
  background: #2f6a3a;
  color: #fff;
}
/* ============================================================
   Блок «Срез под дивизион» (модалка сравнения)
   ============================================================ */
.cmp-cap-block {
  margin: 8px 0;
  padding: 8px 10px;
  background: rgba(212, 175, 55, 0.08);
  border-left: 3px solid #d4af37;
  border-radius: 3px;
}
.cmp-cap-title {
  font-size: 11px;
  font-weight: 700;
  color: #f4d477;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cmp-cap-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 10px;
  line-height: 1.5;
  color: #d3dcef;
}
.cmp-cap-list > div {
  padding: 1px 0;
}
/* Модалка сравнения — «было → стало» */
.cmp-before {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  color: var(--l2-text-dim);
  text-decoration: line-through;
  opacity: 0.65;
}
.cmp-arrow {
  flex: 0 0 auto;
  padding: 0 4px;
  color: var(--l2-text-dim);
  font-size: 12px;
  opacity: 0.7;
}
/* Кнопка «Полный экран» */
#hud-fullscreen {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #2c3c60 0%, #101a30 100%);
  border: 1px solid var(--l2-gold-dark);
  border-radius: var(--r-sm);
  color: var(--l2-gold-bright);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
#hud-fullscreen:active {
  background: var(--l2-gold);
  color: #1a1206;
}
#hud-fullscreen .hud-icon {
  font-size: 18px;
}