/* ═══════════════════════════════════════════════════════════════
   profile.css — v1.1.3.724 (theme-aware refactor)

   v724 changes:
     - Local tokens (--bg, --cell, --text…) тепер слідують global --n-* tokens
     - Light theme підтримка через [data-theme="light"] override block
     - Battle history list — replaced inline rendering на arena/battle_card widget
     - Dead .kp-profile-h-row* CSS видалено

   IMPORTANT: @import must be first @-rule before any other CSS.
   profile-widget-overrides.css applies aesthetic adjustments to widgets
   (profile_header, profile_view_switcher, profile_section_nav, etc.)
   when they render inside .kp-profile scope.

   Покриває:
     1) /u/{login}              — social profile (default view)
     2) /u/{login}?view=game    — arena/game profile
   ═══════════════════════════════════════════════════════════════ */

@import url('profile-widget-overrides.css');

/* ═══ 0. TOKENS — theme-aware (slid global --n-* tokens) ═══════════════
   Default tokens — use global --n-* with sensible fallbacks. These work
   for BOTH dark і light themes through tokens.css [data-theme="*"] rules.
   Semantic colors (win/lose/hp/xp/gold) — same for both themes (з brightness
   tweaks via [data-theme="dark"] selectors below).
   ════════════════════════════════════════════════════════════════════ */
.kp-profile {
  /* Surface */
  --bg:        var(--n-bg, #f6f3ee);
  --panel:     var(--n-bg-2, #ffffff);
  --cell:      var(--n-bg-soft, rgba(0, 0, 0, .025));
  --cell-h:    var(--n-bg-hover, rgba(0, 0, 0, .05));
  --cell-eq:   var(--n-accent-soft, rgba(196, 105, 74, .08));

  /* Lines */
  --border:    var(--n-line, rgba(0, 0, 0, .07));
  --border-h:  var(--n-line-strong, rgba(0, 0, 0, .13));

  /* Text */
  --text:      var(--n-text, #1a1714);
  --text-2:    var(--n-text-soft, #4a4540);
  --text-3:    var(--n-text-mute, #6b6660);

  /* Accent (clay/orange — KoloPlus brand) */
  --accent:    var(--n-accent, #c4694a);
  --accent-g:  var(--n-accent-glow, rgba(196, 105, 74, .25));

  /* Semantic — viewer indicator (blue), HP (green), XP (blue), gold */
  --viewer:    #2563eb;
  --hp:        #16a34a;
  --hp-bg:     rgba(22, 163, 74, .12);
  --xp:        #2563eb;
  --xp-bg:     rgba(37, 99, 235, .12);
  --gold:      #d97706;

  /* Decorative */
  --lav:       #8b5cf6;
  --cyan:      #0891b2;
  --pink:      #db2777;
  --win:       #16a34a;
  --lose:      #dc2626;

  /* Typography + motion */
  --font:      'Chakra Petch', 'Inter', system-ui, sans-serif;
  --mono:      'JetBrains Mono', ui-monospace, monospace;
  --ease:      cubic-bezier(.16, 1, .3, 1);

  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Dark theme — brighter semantic colors для better contrast on dark bg */
[data-theme="dark"] .kp-profile {
  --viewer:    #3b82f6;
  --hp:        #22c55e;
  --hp-bg:     rgba(34, 197, 94, .12);
  --xp:        #3b82f6;
  --xp-bg:     rgba(59, 130, 246, .12);
  --gold:      #f5c366;
  --lav:       #a78bfa;
  --cyan:      #22d3ee;
  --pink:      #f472b6;
  --win:       #22c55e;
  --lose:      #ef4444;
}

.kp-profile,
.kp-profile *,
.kp-profile *::before,
.kp-profile *::after { box-sizing: border-box; }

/* ═══ 1. BG EFFECTS — accent radial + scanlines + grid ═══
   v724: scoped to dark theme only (на light cream paper це viglядає harsh) */
.kp-profile-bg-fx { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.kp-profile-bg-fx__v {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 50% 60% at 50% 30%, var(--accent-g, rgba(196, 105, 74, .06)), transparent 70%);
  opacity: .4;
}
[data-theme="dark"] .kp-profile-bg-fx__v {
  opacity: 1;
  background: radial-gradient(ellipse 50% 60% at 50% 30%, rgba(239, 100, 67, .06), transparent 70%);
}

.kp-profile-bg-fx__scan {
  position: absolute; inset: 0;
}
[data-theme="dark"] .kp-profile-bg-fx__scan {
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255, 255, 255, .006) 2px, rgba(255, 255, 255, .006) 4px);
}

.kp-profile-bg-fx__grid {
  position: absolute; inset: 0;
}
[data-theme="dark"] .kp-profile-bg-fx__grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, .015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .015) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 40%, black 20%, transparent 70%);
}

/* ═══ 2. SHELL + INSPECT ═══ */
.kp-profile-shell {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  /* v1.1.3.848: top 24→10 (стандарт KP як user_strip area), side 12, bottom 80
     щоб дати простір під mobile bottom-nav. Раніше 24/12/60 — top забагато,
     bottom мало → контент чіплявся за nav. */
  padding: 10px 12px 80px;
}

.kp-profile-inspect {
  /* v1.1.3.878: рамку видалено — Vasyl: "Прибери у профілі рамку, яка обгортає
     цілий профіль і пости". Раніше тут була card-style обгортка (background +
     border + radius) що візуально подвоювала card-feel: hero вже card,
     composer вже card, posts вже cards — outer wrapper з border був redundant
     і створював nested-card look як на акаунт-сторінці до v870.
     Тепер kp-profile-inspect — transparent passthrough container. */
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  position: relative;
  overflow: visible;
}
/* v1.1.3.878: accent gradient risochku зверху видалено разом з рамкою. */

/* Inspect header (used by ARENA mode) */
.kp-profile-inspect__header { text-align: center; margin-bottom: 14px; }
.kp-profile-inspect__login { font-family: var(--mono); font-size: 1.15rem; font-weight: 700; letter-spacing: .02em; }
.kp-profile-inspect__login span { color: var(--accent); }
.kp-profile-inspect__lvl {
  display: inline-block; margin-left: 10px; padding: 2px 10px; border-radius: 6px;
  background: var(--accent); color: #fff;
  font-family: var(--mono); font-size: .72rem; font-weight: 800; letter-spacing: .06em;
  vertical-align: middle; box-shadow: 0 2px 10px var(--accent-g);
}
.kp-profile-inspect__subtitle { font-size: .76rem; color: var(--text-2); margin-top: 4px; font-weight: 500; }

/* ═══ 3. SOCIAL HERO ═══ */
.kp-profile-hero-top { display: flex; flex-direction: column; align-items: center; text-align: center; }

.kp-profile-avatar-wrap { position: relative; margin-bottom: 14px; }
.kp-profile-avatar {
  width: 120px; height: 120px; border-radius: 28px;
  border: 2px solid var(--border-h); background: var(--cell); overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .1);
  display: flex; align-items: center; justify-content: center; font-size: 3.4rem;
  position: relative;
}
[data-theme="dark"] .kp-profile-avatar {
  box-shadow: 0 8px 36px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .03);
}
.kp-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.kp-profile-avatar__glow { position: absolute; inset: 0; pointer-events: none; }
[data-theme="dark"] .kp-profile-avatar__glow {
  background: radial-gradient(circle at 50% 30%, rgba(239, 100, 67, .12), transparent 60%);
}
.kp-profile-avatar__corner { position: absolute; width: 10px; height: 10px; border: 2px solid var(--accent); opacity: .35; }
.kp-profile-avatar__corner--tl { top: 5px; left: 5px; border-right: none; border-bottom: none; border-radius: 3px 0 0 0; }
.kp-profile-avatar__corner--tr { top: 5px; right: 5px; border-left: none; border-bottom: none; border-radius: 0 3px 0 0; }
.kp-profile-avatar__corner--bl { bottom: 5px; left: 5px; border-right: none; border-top: none; border-radius: 0 0 0 3px; }
.kp-profile-avatar__corner--br { bottom: 5px; right: 5px; border-left: none; border-top: none; border-radius: 0 0 3px 0; }
.kp-profile-avatar__online {
  position: absolute; bottom: 4px; right: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--hp); border: 3px solid var(--bg);
  box-shadow: 0 0 8px rgba(34, 197, 94, .5);
}
.kp-profile-avatar__vip {
  position: absolute; top: -6px; right: -8px;
  padding: 2px 8px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  font-family: var(--mono); font-size: .56rem; font-weight: 800; color: #fff;
  box-shadow: 0 2px 10px var(--accent-g);
}

.kp-profile-hero__login { font-family: var(--mono); font-size: 1.15rem; font-weight: 700; letter-spacing: .02em; }
.kp-profile-hero__login span { color: var(--accent); }
.kp-profile-hero__lvl {
  display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 6px;
  background: var(--accent); color: #fff;
  font-family: var(--mono); font-size: .72rem; font-weight: 800; letter-spacing: .06em;
  vertical-align: middle; box-shadow: 0 2px 10px var(--accent-g);
}
.kp-profile-hero__title { font-size: .78rem; color: var(--text-2); margin-top: 4px; font-weight: 500; }
.kp-profile-hero__bio { font-size: .86rem; color: var(--text-2); margin-top: 10px; line-height: 1.6; max-width: 480px; }

.kp-profile-hero__tags { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-top: 12px; }
.kp-profile-hero__tag {
  padding: 4px 12px; border-radius: 8px;
  font-size: .7rem; font-weight: 600;
  background: var(--cell); border: 1px solid var(--border); color: var(--text-2);
  transition: all .2s var(--ease);
}
.kp-profile-hero__tag:hover { border-color: var(--accent); color: var(--accent); background: rgba(239, 100, 67, .06); }

/* ═══ METRICS RAIL ═══ */
.kp-profile-metrics {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
  margin-top: 18px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border);
}
.kp-profile-metric {
  padding: 14px 8px; text-align: center; background: var(--cell);
  cursor: pointer; transition: all .2s var(--ease); position: relative;
  text-decoration: none; color: inherit;
}
.kp-profile-metric:hover { background: var(--cell-h); }
.kp-profile-metric::after {
  content: ''; position: absolute; bottom: 0; left: 20%; right: 20%;
  height: 2px; background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transition: transform .25s var(--ease);
}
.kp-profile-metric:hover::after { transform: scaleX(1); }
.kp-profile-metric__val { font-family: var(--mono); font-size: 1.2rem; font-weight: 800; display: block; }
.kp-profile-metric__lbl { font-size: .58rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }

/* ═══ ACTIONS ═══ */
.kp-profile-actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.kp-profile-btn {
  padding: 10px 22px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--cell); color: var(--text);
  font-family: var(--font); font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: all .25s var(--ease);
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
}
.kp-profile-btn:hover { border-color: var(--border-h); background: var(--cell-h); transform: translateY(-1px); }
.kp-profile-btn--fill { background: var(--accent); border-color: var(--accent); color: #fff; }
.kp-profile-btn--fill:hover { background: #ff7a5c; box-shadow: 0 6px 24px var(--accent-g); transform: translateY(-2px); }
.kp-profile-btn svg { width: 15px; height: 15px; }
.kp-profile-btn--icon { padding: 10px 12px; }

/* ═══ MODE SWITCH ═══ */
.kp-profile-mode-sw-wrap { text-align: center; }
.kp-profile-mode-sw {
  display: inline-flex; gap: 3px; margin-top: 16px; padding: 3px;
  border-radius: 12px; background: var(--cell); border: 1px solid var(--border);
}
.kp-profile-mode-sw__btn {
  padding: 8px 20px; border-radius: 9px; border: none; background: transparent;
  color: var(--text-3); font-family: var(--font); font-size: .8rem; font-weight: 600;
  cursor: pointer; transition: all .25s var(--ease); text-decoration: none; display: inline-block;
}
.kp-profile-mode-sw__btn.is-active { background: var(--accent); color: #fff; box-shadow: 0 2px 12px var(--accent-g); }
.kp-profile-mode-sw__btn:not(.is-active):hover { color: var(--text); background: rgba(255, 255, 255, .04); }

/* ═══ 4. ARENA-SPECIFIC ═══ */

/* XP bar */
.kp-profile-xp-bar { max-width: 360px; margin: 10px auto 18px; }
.kp-profile-xp-bar__head { display: flex; justify-content: space-between; margin-bottom: 4px; }
.kp-profile-xp-bar__lbl { font-family: var(--mono); font-size: .64rem; font-weight: 700; color: var(--xp); letter-spacing: .1em; }
.kp-profile-xp-bar__val { font-family: var(--mono); font-size: .64rem; font-weight: 600; color: var(--text-3); }
.kp-profile-xp-bar__track { height: 8px; border-radius: 8px; background: var(--xp-bg); overflow: hidden; }
.kp-profile-xp-bar__fill { height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--xp), #60a5fa); box-shadow: 0 0 10px rgba(59, 130, 246, .3); transition: width 1s var(--ease); }

/* Loadout layout */
.kp-profile-loadout-wrap { position: relative; max-width: 460px; margin: 0 auto; }
.kp-profile-loadout { display: grid; grid-template-columns: 64px 1fr 64px; gap: 12px; align-items: center; }
.kp-profile-eq-col { display: grid; gap: 6px; }

/* equipment cells */
.kp-profile-eq-cell {
  width: 58px; height: 58px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--cell);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
  position: relative; cursor: default; transition: all .25s var(--ease); overflow: hidden;
}
.kp-profile-eq-cell.has-item { border-color: rgba(239, 100, 67, .15); background: var(--cell-eq); }
.kp-profile-eq-cell.has-item::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; border-radius: 0 0 14px 14px; }
.kp-profile-eq-cell.r-leg::after { background: var(--gold); }
.kp-profile-eq-cell.r-epic::after { background: var(--lav); }
.kp-profile-eq-cell.r-rare::after { background: var(--cyan); }
.kp-profile-eq-cell.r-com::after { background: var(--text-3); }
.kp-profile-eq-cell__empty { color: var(--text-3); font-size: .56rem; font-weight: 600; text-align: center; line-height: 1.2; }

.kp-profile[data-viewer="owner"] .kp-profile-eq-cell { cursor: pointer; }
.kp-profile[data-viewer="owner"] .kp-profile-eq-cell:hover { border-color: var(--border-h); background: var(--cell-h); transform: scale(1.06); }
.kp-profile[data-viewer="owner"] .kp-profile-eq-cell.has-item:hover { border-color: rgba(239, 68, 68, .35); box-shadow: 0 0 12px rgba(239, 68, 68, .15); }
.kp-profile[data-viewer="owner"] .kp-profile-eq-cell.has-item:hover .kp-profile-eq-unequip { opacity: 1; }

.kp-profile-eq-unequip {
  position: absolute; top: -1px; right: -1px;
  width: 18px; height: 18px; border-radius: 0 14px 0 8px;
  background: rgba(239, 68, 68, .85); color: #fff;
  font-size: .6rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}

.kp-profile-eq-cell__upgrade {
  position: absolute; top: 2px; left: 2px;
  font-family: var(--mono); font-size: .5rem; font-weight: 800;
  padding: 1px 3px; border-radius: 4px; line-height: 1.2;
  background: rgba(167, 139, 250, .75); color: #fff;
  pointer-events: none; z-index: 1;
}
.kp-profile-eq-cell__upgrade.lv-0 { background: rgba(255, 255, 255, .10); color: var(--text-3); }
.kp-profile-eq-cell__resales {
  position: absolute; bottom: 4px; left: 2px;
  font-family: var(--mono); font-size: .46rem; font-weight: 800;
  padding: 1px 3px; border-radius: 3px; line-height: 1.2;
  background: rgba(245, 195, 102, .65); color: #1a1520;
  pointer-events: none; z-index: 1;
}
.kp-profile-eq-cell__resales.rs-0 { display: none; }

.kp-profile-eq-cell[data-tip]:hover::before {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  padding: 5px 10px; border-radius: 8px;
  /* v724: theme-aware tooltip — dark bg на light, dark bg darker на dark */
  background: var(--n-text, #1a1714); color: var(--n-bg-2, #fff); border: 1px solid var(--border-h);
  font-size: .66rem; font-weight: 600; font-family: var(--font);
  white-space: nowrap; z-index: 20; pointer-events: none;
  max-width: 200px; text-align: center;
}

/* avatar zone (arena) */
.kp-profile-avatar-zone { display: flex; flex-direction: column; align-items: center; }
.kp-profile-avatar-frame {
  position: relative; width: 180px; height: 220px; border-radius: 22px;
  border: 2px solid var(--border-h); background: var(--cell); overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}
[data-theme="dark"] .kp-profile-avatar-frame {
  box-shadow: 0 8px 40px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .03);
}
.kp-profile-avatar-frame__img {
  width: 100%; height: 100%; object-fit: cover;
  display: flex; align-items: center; justify-content: center; font-size: 5rem;
  background: linear-gradient(180deg, var(--accent-g, rgba(196, 105, 74, .06)) 0%, var(--cell) 100%);
}
[data-theme="dark"] .kp-profile-avatar-frame__img {
  background: linear-gradient(180deg, rgba(239, 100, 67, .06) 0%, rgba(14, 15, 22, 1) 100%);
}
.kp-profile-avatar-frame__glow { position: absolute; inset: 0; pointer-events: none; }
[data-theme="dark"] .kp-profile-avatar-frame__glow {
  background: radial-gradient(circle at 50% 30%, rgba(239, 100, 67, .12), transparent 60%);
}
.kp-profile-avatar-frame__corner { position: absolute; width: 12px; height: 12px; border: 2px solid var(--accent); opacity: .35; }
.kp-profile-avatar-frame__corner--tl { top: 6px; left: 6px; border-right: none; border-bottom: none; border-radius: 4px 0 0 0; }
.kp-profile-avatar-frame__corner--tr { top: 6px; right: 6px; border-left: none; border-bottom: none; border-radius: 0 4px 0 0; }
.kp-profile-avatar-frame__corner--bl { bottom: 6px; left: 6px; border-right: none; border-top: none; border-radius: 0 0 0 4px; }
.kp-profile-avatar-frame__corner--br { bottom: 6px; right: 6px; border-left: none; border-top: none; border-radius: 0 0 4px 0; }

.kp-profile-hp-bar { width: 100%; max-width: 180px; margin-top: 10px; }
.kp-profile-hp-bar__head { display: flex; justify-content: space-between; margin-bottom: 3px; }
.kp-profile-hp-bar__lbl { font-family: var(--mono); font-size: .64rem; font-weight: 700; color: var(--hp); letter-spacing: .1em; }
.kp-profile-hp-bar__val { font-family: var(--mono); font-size: .64rem; font-weight: 600; color: var(--text-3); }
.kp-profile-hp-bar__track { height: 10px; border-radius: 10px; background: var(--hp-bg); overflow: hidden; position: relative; }
.kp-profile-hp-bar__fill { height: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--hp), #4ade80); box-shadow: 0 0 12px rgba(34, 197, 94, .3); transition: width 1s var(--ease); }
.kp-profile-hp-bar__pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: .56rem; font-weight: 800; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

/* INVENTORY toggle + drawer (arena, owner-only) */
.kp-profile-inv-toggle {
  display: none; margin: 14px auto 0; width: fit-content;
  padding: 10px 28px; border-radius: 12px;
  border: 1px solid rgba(167, 139, 250, .20); background: rgba(167, 139, 250, .08);
  color: var(--lav); font-family: var(--font); font-size: .84rem; font-weight: 600;
  cursor: pointer; transition: all .25s var(--ease);
  gap: 8px; align-items: center; justify-content: center;
}
.kp-profile-inv-toggle svg { width: 18px; height: 18px; }
.kp-profile[data-viewer="owner"] .kp-profile-inv-toggle { display: inline-flex; }
.kp-profile-inv-toggle:hover { background: rgba(167, 139, 250, .14); border-color: rgba(167, 139, 250, .35); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(167, 139, 250, .15); }
.kp-profile-inv-toggle.is-open { background: var(--lav); color: #fff; border-color: var(--lav); }

.kp-profile-inv-drawer { max-height: 0; overflow: hidden; transition: max-height .45s var(--ease), margin .3s var(--ease), opacity .3s; opacity: 0; margin-top: 0; }
.kp-profile-inv-drawer.is-open { max-height: 600px; opacity: 1; margin-top: 16px; }
.kp-profile-inv-drawer__inner { padding: 20px; border-radius: 18px; background: rgba(167, 139, 250, .03); border: 1px solid rgba(167, 139, 250, .10); }
.kp-profile-inv-drawer__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.kp-profile-inv-drawer__head h3 { font-size: .9rem; font-weight: 700; color: var(--lav); }
.kp-profile-inv-drawer__head span { font-family: var(--mono); font-size: .68rem; color: var(--text-3); }

.kp-profile-inv-filters { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.kp-profile-inv-filter {
  padding: 5px 12px; border-radius: 8px; border: none;
  background: var(--cell); color: var(--text-3);
  font-family: var(--font); font-size: .72rem; font-weight: 600;
  cursor: pointer; transition: all .2s var(--ease);
}
.kp-profile-inv-filter.is-active { background: rgba(167, 139, 250, .15); color: var(--lav); }
.kp-profile-inv-filter:hover:not(.is-active) { color: var(--text-2); background: var(--cell-h); }

.kp-profile-inv-grid { display: grid; grid-template-columns: repeat(auto-fill, 62px); gap: 5px; justify-content: center; }
.kp-profile-inv-cell {
  width: 62px; height: 62px; border-radius: 12px;
  background: var(--cell); border: 1px solid var(--border);
  position: relative; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
  transition: all .2s var(--ease);
}
.kp-profile-inv-cell:hover { border-color: var(--border-h); background: var(--cell-h); transform: scale(1.08); z-index: 2; }
.kp-profile-inv-cell.is-active { border-color: rgba(167, 139, 250, .45); background: rgba(167, 139, 250, .10); box-shadow: 0 0 14px rgba(167, 139, 250, .18); }
.kp-profile-inv-cell::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; border-radius: 0 0 12px 12px; }
.kp-profile-inv-cell.r-leg::after { background: var(--gold); }
.kp-profile-inv-cell.r-epic::after { background: var(--lav); }
.kp-profile-inv-cell.r-rare::after { background: var(--cyan); }
.kp-profile-inv-cell.r-com::after { background: var(--text-3); }

.kp-profile-inv-cell__upgrade,
.kp-profile-inv-cell__resales {
  position: absolute; font-family: var(--mono); font-size: .52rem; font-weight: 800;
  padding: 1px 4px; border-radius: 4px; line-height: 1.2;
  pointer-events: none; z-index: 1;
}
.kp-profile-inv-cell__upgrade { top: 3px; left: 3px; background: rgba(167, 139, 250, .75); color: #fff; }
.kp-profile-inv-cell__upgrade.lv-0 { background: rgba(255, 255, 255, .12); color: var(--text-3); }
.kp-profile-inv-cell__resales { top: 3px; right: 3px; background: rgba(245, 195, 102, .7); color: #1a1520; }
.kp-profile-inv-cell__resales.rs-0 { display: none; }

.kp-profile-inv-empty { text-align: center; padding: 24px; color: var(--text-3); font-size: .84rem; }

/* ═══ 5. INFO TABS ═══ */
.kp-profile-info-tabs {
  display: flex; gap: 4px; padding: 3px; border-radius: 14px;
  background: var(--cell); border: 1px solid var(--border);
  margin-top: 20px; margin-bottom: 16px;
}
.kp-profile-info-tab {
  flex: 1; padding: 10px 8px; border-radius: 10px; border: none;
  background: transparent; color: var(--text-3);
  font-family: var(--font); font-size: .78rem; font-weight: 600;
  cursor: pointer; transition: all .25s var(--ease);
  text-align: center; white-space: nowrap; text-decoration: none; display: inline-block;
}
.kp-profile-info-tab.is-active { background: var(--accent); color: #fff; box-shadow: 0 2px 14px var(--accent-g); }
.kp-profile-info-tab:not(.is-active):hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.kp-profile-tab-pane { display: none; }
.kp-profile-tab-pane.is-active { display: block; animation: kpProfilePaneIn .35s var(--ease); }
@keyframes kpProfilePaneIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ═══ 6. CONTENT GRID + CARDS ═══ */
.kp-profile-content-grid { display: grid; grid-template-columns: 1fr 300px; gap: 14px; }
.kp-profile-side-stack { display: grid; gap: 14px; }
/* v1.1.3.848: компактні картки — padding 20→12, radius 18→14, gap між картками 14→8.
   Mobile-rhythm близький до user_strip (10-14px padding). */
.kp-profile-card { border-radius: 14px; padding: 12px; background: var(--cell); border: 1px solid var(--border); transition: border-color .25s var(--ease); }
.kp-profile-card:hover { border-color: var(--border-h); }
.kp-profile-card + .kp-profile-card { margin-top: 8px; }
.kp-profile-card__h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.kp-profile-card__h h3 { font-size: .8rem; font-weight: 800; letter-spacing: -0.01em; }
.kp-profile-card__h a { font-family: var(--mono); font-size: .62rem; font-weight: 700; color: var(--text-3); text-decoration: none; letter-spacing: .04em; transition: color .2s; }
.kp-profile-card__h a:hover { color: var(--accent); }

/* POSTS */
.kp-profile-post { padding: 16px 0; border-bottom: 1px solid rgba(255, 255, 255, .04); }
.kp-profile-post:last-child { border: none; }
.kp-profile-post__top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.kp-profile-post__ava { width: 36px; height: 36px; border-radius: 10px; background: var(--cell-h); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; overflow: hidden; }
.kp-profile-post__ava img { width: 100%; height: 100%; object-fit: cover; }
.kp-profile-post__name { font-size: .82rem; font-weight: 700; }
.kp-profile-post__time { font-size: .66rem; color: var(--text-3); }
.kp-profile-post__body { font-size: .86rem; color: var(--text-2); line-height: 1.65; }
.kp-profile-post__media { margin-top: 10px; border-radius: 14px; overflow: hidden; background: var(--cell-h); height: 160px; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; }
.kp-profile-post__media img { width: 100%; height: 100%; object-fit: cover; }
.kp-profile-post__foot { display: flex; gap: 12px; margin-top: 10px; }
.kp-profile-post__react {
  display: flex; align-items: center; gap: 4px;
  font-size: .74rem; color: var(--text-3);
  background: none; border: none; font-family: var(--font);
  cursor: pointer; padding: 4px 8px; border-radius: 8px;
  transition: all .2s var(--ease);
}
.kp-profile-post__react:hover { background: var(--cell-h); color: var(--text); }
.kp-profile-post__react svg { width: 14px; height: 14px; }

/* PEOPLE */
/* v1.1.3.848: people-grid + person — компактніше (avatar 38→32, padding/font знижено) */
.kp-profile-people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.kp-profile-person {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  background: var(--cell); border: 1px solid var(--border); border-radius: 10px;
  text-decoration: none; color: inherit; transition: background .2s, border-color .2s;
}
.kp-profile-person:hover { border-color: var(--border-h); background: var(--cell-h); }
.kp-profile-person__ava { width: 32px; height: 32px; border-radius: 9px; background: var(--cell-h); display: flex; align-items: center; justify-content: center; font-size: .95rem; flex-shrink: 0; overflow: hidden; }
.kp-profile-person__ava img { width: 100%; height: 100%; object-fit: cover; }
.kp-profile-person__body { flex: 1; min-width: 0; }
.kp-profile-person__name { font-size: .76rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp-profile-person__meta { font-size: .62rem; color: var(--text-3); }
.kp-profile-person__online { width: 6px; height: 6px; border-radius: 50%; background: var(--hp); flex-shrink: 0; box-shadow: 0 0 4px rgba(34, 197, 94, .5); margin-left: auto; }

/* MEDIA GRID */
.kp-profile-media-grid { display: grid; grid-template-columns: repeat(auto-fill, 72px); gap: 5px; justify-content: center; }
.kp-profile-media-grid--lg { grid-template-columns: repeat(auto-fill, 80px); }
.kp-profile-media-cell {
  width: 72px; height: 72px; border-radius: 12px; overflow: hidden;
  background: var(--cell-h); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
  position: relative; transition: all .2s var(--ease); text-decoration: none; color: inherit;
}
.kp-profile-media-cell--lg { width: 80px; height: 80px; }
.kp-profile-media-cell:hover { transform: scale(1.06); z-index: 1; box-shadow: 0 4px 16px rgba(0, 0, 0, .3); }
.kp-profile-media-cell img { width: 100%; height: 100%; object-fit: cover; }

/* INFO BLOCK (sidebar) */
/* v1.1.3.848: info-list/row компактніше — icon 32→26, padding 10/12→6/8, font label .6→.58 val .82→.78 */
.kp-profile-info-list { display: grid; gap: 1px; }
.kp-profile-info-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; transition: background .2s; }
.kp-profile-info-row:hover { background: var(--cell); }
.kp-profile-info-row__icon { font-size: .95rem; width: 26px; height: 26px; border-radius: 7px; background: var(--cell-h); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kp-profile-info-row__label { font-size: .58rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.kp-profile-info-row__val { font-size: .78rem; font-weight: 600; color: var(--text-2); line-height: 1.3; }
.kp-profile-info-row__val a { color: var(--cyan); text-decoration: none; }
.kp-profile-info-row__val a:hover { text-decoration: underline; }

/* v1.1.3.848: about-prose — компактний body для bio */
.kp-profile-about-prose { font-size: .8rem; color: var(--text-2); line-height: 1.55; }
.kp-profile-about-prose p + p { margin-top: 8px; }

/* social icons */
.kp-profile-social-row { display: flex; gap: 6px; margin-top: 8px; justify-content: center; }
.kp-profile-social-ic {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--cell); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
  text-decoration: none; transition: all .25s var(--ease); color: inherit;
}
.kp-profile-social-ic:hover { border-color: var(--accent); background: rgba(239, 100, 67, .06); transform: translateY(-2px); box-shadow: 0 4px 14px var(--accent-g); }

/* v1.1.3.848: about-prose canonical вище (видалено дублі з більшими розмірами .86/1.7) */

/* ═══ 7. ARENA: Spider Chart + Stats ═══ */
.kp-profile-stats-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.kp-profile-cmp-toggle { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--cell); border: 1px solid var(--border); }
.kp-profile-cmp-toggle__btn { padding: 6px 14px; border-radius: 8px; border: none; background: transparent; color: var(--text-3); font-family: var(--font); font-size: .72rem; font-weight: 600; cursor: pointer; transition: all .25s var(--ease); white-space: nowrap; }
.kp-profile-cmp-toggle__btn.is-active { background: var(--accent); color: #fff; box-shadow: 0 1px 8px var(--accent-g); }
.kp-profile-cmp-toggle__btn:not(.is-active):hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.kp-profile[data-viewer="guest"] .kp-profile-cmp-toggle { display: none; }

.kp-profile-spider-legend { display: flex; gap: 16px; flex-wrap: wrap; }
.kp-profile-spider-legend__item { display: flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; }
.kp-profile-spider-legend__dot { width: 10px; height: 10px; border-radius: 3px; }
.kp-profile-spider-legend__dot--opp { background: var(--accent); }
.kp-profile-spider-legend__dot--you { background: var(--viewer); }
.kp-profile[data-viewer="guest"] .kp-profile-spider-legend__item--you { display: none; }

.kp-profile-stats-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: start; }
.kp-profile-spider-wrap { width: 280px; height: 280px; margin: 0 auto; }
.kp-profile-spider-wrap svg { width: 100%; height: 100%; }
.kp-profile-sp-grid { stroke: rgba(255, 255, 255, .05); stroke-width: .6; fill: none; }
.kp-profile-sp-axis { stroke: rgba(255, 255, 255, .03); stroke-width: .5; }
.kp-profile-sp-shape { stroke-width: 2; transition: all .5s var(--ease); }
.kp-profile-sp-shape--opp { fill: rgba(239, 100, 67, .10); stroke: var(--accent); filter: drop-shadow(0 0 8px rgba(239, 100, 67, .25)); }
.kp-profile-sp-shape--you { fill: rgba(59, 130, 246, .08); stroke: var(--viewer); filter: drop-shadow(0 0 8px rgba(59, 130, 246, .2)); opacity: 0; transition: opacity .5s var(--ease); }
.kp-profile-sp-shape--you.is-visible { opacity: 1; }
.kp-profile-sp-dot--opp { fill: var(--accent); filter: drop-shadow(0 0 4px rgba(239, 100, 67, .5)); }
.kp-profile-sp-dot--you { fill: var(--viewer); filter: drop-shadow(0 0 4px rgba(59, 130, 246, .5)); opacity: 0; transition: opacity .5s var(--ease); }
.kp-profile-sp-dot--you.is-visible { opacity: 1; }
.kp-profile-sp-lbl { fill: var(--text-2); font-size: 9.5px; font-weight: 600; font-family: var(--font); text-anchor: middle; }
.kp-profile-sp-val { font-size: 8px; font-weight: 700; font-family: var(--mono); text-anchor: middle; }
.kp-profile-sp-val--opp { fill: var(--accent); }
.kp-profile-sp-val--you { fill: var(--viewer); opacity: 0; transition: opacity .5s var(--ease); }
.kp-profile-sp-val--you.is-visible { opacity: 1; }

/* v697: stat-row CSS видалено — refactored to warriors.stats_grid widget.
   Кольори/glow/bonus overlay тепер у widgets/warriors/stat_bar/stat_bar.css
   (--cyber-dark variant). Reusable у feed/communities/arena. */

/* v696: hero name (showed below @login замість level chip) */
.kp-profile-hero__name {
  font-size: .9rem;
  color: var(--text);
  margin-top: 2px;
  font-weight: 600;
}

/* v696: spacing for top-mounted mode switch */
.kp-profile-mode-sw-wrap--top {
  margin: 0 0 14px;
}

/* ═══ 8. ARENA: Battle Grid, History, Action Bar ═══ */
.kp-profile-battle-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kp-profile-b-card { padding: 18px 16px; border-radius: 16px; text-align: center; background: var(--cell); border: 1px solid var(--border); transition: all .25s var(--ease); position: relative; overflow: hidden; }
.kp-profile-b-card:hover { border-color: var(--border-h); transform: translateY(-2px); }
.kp-profile-b-card__glow { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); width: 50px; height: 50px; border-radius: 50%; filter: blur(25px); opacity: .25; pointer-events: none; }
.kp-profile-b-card__icon { font-size: 1.6rem; margin-bottom: 6px; position: relative; }
.kp-profile-b-card__val { font-family: var(--mono); font-size: 1.3rem; font-weight: 800; position: relative; }
.kp-profile-b-card__lbl { font-size: .68rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; position: relative; }

/* v1.1.3.724: .kp-profile-history-list / .kp-profile-h-row styles removed —
   replaced by unified arena/battle_card widget (compact mode). */

.kp-profile-action-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 20px; }
.kp-profile[data-viewer="owner"] .kp-profile-action-bar { display: none; }
.kp-profile[data-viewer="guest"] .kp-profile-action-bar { display: none; }
.kp-profile-act-btn {
  padding: 14px 12px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--cell); color: var(--text);
  font-family: var(--font); font-size: .84rem; font-weight: 600;
  cursor: pointer; transition: all .25s var(--ease);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
}
.kp-profile-act-btn:hover { border-color: var(--border-h); background: var(--cell-h); transform: translateY(-1px); }
.kp-profile-act-btn--attack { background: rgba(239, 68, 68, .10); border-color: rgba(239, 68, 68, .20); color: #f87171; }
.kp-profile-act-btn--attack:hover { background: rgba(239, 68, 68, .18); border-color: rgba(239, 68, 68, .35); box-shadow: 0 4px 20px rgba(239, 68, 68, .2); }
.kp-profile-act-btn--invite { background: rgba(34, 197, 94, .08); border-color: rgba(34, 197, 94, .18); color: #4ade80; }
.kp-profile-act-btn--invite:hover { background: rgba(34, 197, 94, .15); border-color: rgba(34, 197, 94, .30); box-shadow: 0 4px 20px rgba(34, 197, 94, .15); }
.kp-profile-act-btn__icon { font-size: 1.2rem; }

/* ═══ 9. TOAST + ANIMATIONS ═══ */
.kp-profile-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  padding: 10px 24px; border-radius: 12px;
  background: rgba(14, 15, 22, .95); border: 1px solid var(--border-h);
  backdrop-filter: blur(12px);
  font-size: .82rem; font-weight: 600; color: var(--text);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .4);
  z-index: 100; opacity: 0; transition: all .35s var(--ease); pointer-events: none;
}
.kp-profile-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.kp-profile-toast--equip { border-color: rgba(34, 197, 94, .25); color: #4ade80; }
.kp-profile-toast--unequip { border-color: rgba(239, 68, 68, .25); color: #f87171; }

@keyframes kpProfileInspectIn { from { opacity: 0; transform: scale(.97) translateY(12px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes kpProfileBarGrow { from { width: 0; } }
.kp-profile-inspect { animation: kpProfileInspectIn .5s var(--ease) .05s both; }
.kp-profile-content-grid { animation: kpProfileInspectIn .4s var(--ease) .2s both; }
.kp-profile-xp-bar__fill,
.kp-profile-hp-bar__fill { animation: kpProfileBarGrow 1s var(--ease) .3s both; }

.kp-profile-eq-cell { animation: kpProfileInspectIn .3s var(--ease) both; }
.kp-profile-eq-col:first-child .kp-profile-eq-cell:nth-child(1) { animation-delay: .10s; }
.kp-profile-eq-col:first-child .kp-profile-eq-cell:nth-child(2) { animation-delay: .15s; }
.kp-profile-eq-col:first-child .kp-profile-eq-cell:nth-child(3) { animation-delay: .20s; }
.kp-profile-eq-col:first-child .kp-profile-eq-cell:nth-child(4) { animation-delay: .25s; }
.kp-profile-eq-col:first-child .kp-profile-eq-cell:nth-child(5) { animation-delay: .30s; }
.kp-profile-eq-col:last-child .kp-profile-eq-cell:nth-child(1) { animation-delay: .12s; }
.kp-profile-eq-col:last-child .kp-profile-eq-cell:nth-child(2) { animation-delay: .17s; }
.kp-profile-eq-col:last-child .kp-profile-eq-cell:nth-child(3) { animation-delay: .22s; }
.kp-profile-eq-col:last-child .kp-profile-eq-cell:nth-child(4) { animation-delay: .27s; }
.kp-profile-eq-col:last-child .kp-profile-eq-cell:nth-child(5) { animation-delay: .32s; }

/* ═══ 10. RESPONSIVE ═══ */
@media (max-width: 768px) {
  .kp-profile-content-grid { grid-template-columns: 1fr; }
  .kp-profile-metrics { grid-template-columns: repeat(3, 1fr); }
  .kp-profile-people-grid { grid-template-columns: 1fr; }
  .kp-profile-media-grid { grid-template-columns: repeat(auto-fill, 64px); }
  .kp-profile-media-cell { width: 64px; height: 64px; }
  .kp-profile-stats-layout { grid-template-columns: 1fr; }
  .kp-profile-spider-wrap { width: 240px; height: 240px; }
  .kp-profile-battle-grid { grid-template-columns: repeat(2, 1fr); }
  .kp-profile-action-bar { grid-template-columns: 1fr; }
  .kp-profile-stats-header { flex-direction: column; align-items: flex-start; }
  .kp-profile-inv-grid { grid-template-columns: repeat(auto-fill, 56px); }
}

@media (max-width: 520px) {
  /* v1.1.3.848: compact mobile overrides — shell/inspect/card дрібніші */
  .kp-profile-shell { padding: 8px 8px 80px; }
  .kp-profile-inspect { padding: 10px 8px; border-radius: 14px; }
  .kp-profile-avatar { width: 96px; height: 96px; border-radius: 22px; font-size: 2.6rem; }
  .kp-profile-metrics { grid-template-columns: repeat(2, 1fr); }
  .kp-profile-card { padding: 10px; border-radius: 12px; }
  .kp-profile-actions { gap: 6px; }
  .kp-profile-btn { padding: 9px 16px; font-size: .78rem; }
  .kp-profile-media-grid { grid-template-columns: repeat(auto-fill, 56px); }
  .kp-profile-media-cell { width: 56px; height: 56px; border-radius: 10px; font-size: 1.3rem; }
  .kp-profile-loadout { grid-template-columns: 50px 1fr 50px; gap: 8px; }
  .kp-profile-eq-cell { width: 46px; height: 46px; border-radius: 10px; font-size: 1.1rem; }
  .kp-profile-avatar-frame { width: 140px; height: 172px; border-radius: 16px; }
  .kp-profile-avatar-frame__img { font-size: 3.5rem; }
  .kp-profile-hp-bar { max-width: 140px; }
  .kp-profile-xp-bar { max-width: 280px; }
  .kp-profile-spider-wrap { width: 220px; height: 220px; }
  .kp-profile-b-card { padding: 14px 10px; }
  .kp-profile-inv-grid { grid-template-columns: repeat(auto-fill, 52px); }
  .kp-profile-inv-cell { width: 52px; height: 52px; font-size: 1.3rem; border-radius: 10px; }
}

/* ============================================================
 * v1.1.3.873 — Posts header card (без body, тільки <h3> + link)
 *
 * `.kp-profile-card--posts-header` — modifier що скорочує padding
 * під заголовком "Останні пости" / "Всі пости" і прибирає margin-bottom,
 * щоб post_card-и (винесені поза wrapper) одразу примикали до header-у.
 * ============================================================ */
.kp-profile-card--posts-header {
  margin-block-end: 0;
  padding-block: 12px;
}
.kp-profile-card--posts-header + .kp-post-card,
.kp-profile-card--posts-header + .post-card {
  margin-block-start: 8px;
}

/* v1.1.3.922 — Home location mini-map на profile */
.kp-profile-home-section {
  margin: 16px 0;
  padding: 14px;
  background: var(--n-bg-2);
  border: 1px solid var(--n-line);
  border-radius: var(--n-r-md);
}
.kp-profile-home-section__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: var(--n-text);
  font-weight: 500;
}
.kp-profile-home-section__header span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kp-profile-home-section__priv-chip {
  flex: 0 0 auto;
  padding: 3px 9px;
  background: color-mix(in oklab, var(--n-accent) 12%, transparent);
  border-radius: var(--n-r-pill, 999px);
  font-size: 0.75rem;
  color: var(--n-text-mute);
}
.kp-profile-home-map {
  width: 100%;
  height: 220px;
  border-radius: var(--n-r-md);
  background: var(--n-bg-1);
  overflow: hidden;
}
