/* ── ТЕМА «ПЕПЕЛЬНОГО КРАЯ» ─────────────────────────────────────────────────
   Тёмные тёплые панели, золотая рамка и акценты, пергаментный текст,
   Philosopher в заголовках — как в «Пепельном крае». Прежняя сине-стальная
   гамма переведена в эту автоматически (оттенок синих: тёмные фоны — в
   тёплый тёмный, серо-голубой текст — в пергамент, яркие акценты — в
   золото), а токены ниже выставлены по палитре той игры.
   Имена токенов — роли: --gold — рамка и акцент, --leather — тело панели,
   --void — фон. Тёплые --ember, --blood, --moss — добыча, опасность, действие. */
/* ── Шрифты «Пепельного края» ─────────────────────────────────────────────
   Philosopher — заголовки, Fira Sans Condensed — текст. Лежат в /fonts (OFL),
   а не на Google Fonts: CSP пускает шрифты только со своего домена. */
@font-face{font-family:'Philosopher';font-style:normal;font-weight:400;font-display:swap;src:url('/fonts/philosopher-cyrillic-400-normal.woff2') format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Philosopher';font-style:normal;font-weight:400;font-display:swap;src:url('/fonts/philosopher-latin-400-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Philosopher';font-style:normal;font-weight:700;font-display:swap;src:url('/fonts/philosopher-cyrillic-700-normal.woff2') format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Philosopher';font-style:normal;font-weight:700;font-display:swap;src:url('/fonts/philosopher-latin-700-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Fira Sans Condensed';font-style:normal;font-weight:400;font-display:swap;src:url('/fonts/fira-sans-condensed-cyrillic-400-normal.woff2') format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Fira Sans Condensed';font-style:normal;font-weight:400;font-display:swap;src:url('/fonts/fira-sans-condensed-latin-400-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Fira Sans Condensed';font-style:normal;font-weight:500;font-display:swap;src:url('/fonts/fira-sans-condensed-cyrillic-500-normal.woff2') format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Fira Sans Condensed';font-style:normal;font-weight:500;font-display:swap;src:url('/fonts/fira-sans-condensed-latin-500-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Fira Sans Condensed';font-style:normal;font-weight:700;font-display:swap;src:url('/fonts/fira-sans-condensed-cyrillic-700-normal.woff2') format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Fira Sans Condensed';font-style:normal;font-weight:700;font-display:swap;src:url('/fonts/fira-sans-condensed-latin-700-normal.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

:root {
  --void:#0e0c10;
  --void-2:#18141b;
  --leather:#18141b;
  --leather-hi:#241d26;
  --leather-lo:#120f14;
  --iron:#8a6a2f;
  --iron-dim:#5a4630;
  --gold:#e2b75e;
  --gold-hi:#f3d892;
  --gold-dim:#8a6a2f;
  --blood:#9c2a3a;
  --blood-hi:#d2495a;
  --ember:#d97f3f;
  --ember-hi:#f4a662;
  --moss:#6f9c4a;
  --parchment:#f1e8d3;
  --parchment-dim:#a99c88;
  --panel-line:#43363f;
  --ink:#0e0c10;
  --font-display:'Philosopher',Georgia,"Iowan Old Style","Palatino Linotype",serif;
  --font-body:'Fira Sans Condensed','Arial Narrow',system-ui,-apple-system,'Segoe UI',Roboto,Arial,sans-serif;

  /* ── высота нижней навигации ─────────────────────────────────────────────
     Одно число на всё. Раньше их было четыре: три `62px` здесь (сама полоса,
     верх выдвижных панелей и их высота) и NAV_H в js/constants.js — а от
     NAV_H отсчитывается ВСЯ нижняя половина игры: веер действий, джойстик,
     дуга бафов, нижняя граница мира. Разъехались бы они молча: полоса стала
     бы ниже, а веер продолжал бы держаться от старой высоты, оставив под
     собой пустую ленту.

     JS читает именно её (NAV_H, js/constants.js), поэтому расходиться им
     теперь нечем. Уменьшить навигацию — это правка вот этой строки.

     56 → 50: снова просили на 10% ниже (56 сама уже была таким же шагом от
     62). Иконки и подписи уменьшены во столько же — ниже по файлу и в
     разметке вкладок. */
  --nav-h:50px;
}

* {
  margin:0; padding:0; box-sizing:border-box;
  touch-action:none;
  -webkit-tap-highlight-color:transparent;
  user-select:none;
  -webkit-user-select:none;
  -webkit-touch-callout:none;
}
a, img { -webkit-touch-callout:none; pointer-events:none; }
a[href] { pointer-events:auto; }
input, textarea { user-select:text; -webkit-user-select:text; }
html, body { height:100%; overflow:hidden; }
body {
  background:#19111a;
  font-family:var(--font-body);
  display:flex; justify-content:center; align-items:center;
}
#app {
  position:relative;
  width:min(430px, 100%);
  height:100vh; height:100dvh;         /* мобильный: весь экран */
  max-height:932px;                    /* десктоп: не выше телефона */
  overflow:hidden; background:#000000;
  flex-shrink:0;
}
canvas { display:block; width:100%; height:100%; }

/* ── SPLASH / LOADING SCREEN ─────────────── */
#login-screen {
  position:absolute; inset:0;
  background:#0e0a0f;
  display:flex; align-items:center; justify-content:center;
  color:#d8cfbe; z-index:200; overflow:hidden;
}
.splash-bg {
  position:absolute; inset:0;
  width:100%; height:100%;
  /* contain, а не cover: на узких телефонах cover срезал края логотипа
     LIBERTY. Поля по краям — под тёмный фон самой картинки. */
  object-fit:contain; object-position:center;
  /* Поля по краям — в тон тёмно-синего неба заставки 6 сезона. */
  background:radial-gradient(ellipse at 50% 40%, #2a3366 0%, #0b1230 55%, #050a1c 100%);
  pointer-events:none;
}

.splash-content {
  position:absolute; left:0; right:0;
  bottom:9%;
  z-index:1;
  display:flex; flex-direction:column; align-items:center;
  gap:0; text-align:center;
  animation:splash-fadein 0.8s ease both;
}
@keyframes splash-fadein { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:translateY(0)} }

.splash-dots {
  display: flex; gap: 10px; align-items: center;
}
.splash-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #d8a54c;
  animation: splash-dot 1.4s ease-in-out infinite;
}
.splash-dots span:nth-child(2) { animation-delay: 0.22s; }
.splash-dots span:nth-child(3) { animation-delay: 0.44s; }
@keyframes splash-dot {
  0%,80%,100%{transform:scale(0.7);opacity:0.3}
  40%        {transform:scale(1.2);opacity:1}
}

.auth-error { color:#ee6676; font-size:12px; min-height:16px; text-align:center; margin-top:16px; }
.auth-chat-link {
  display:inline-block;
  margin-top:14px;
  padding:10px 22px;
  border-radius:10px;
  background:linear-gradient(180deg,#daa02d,#b5831f);
  color:#fff;
  font-size:13px;
  font-weight:600;
  text-decoration:none;
  box-shadow:0 2px 6px rgba(0,0,0,.35);
}
.auth-chat-link:active { filter:brightness(0.92); }
/* Заставка техработ (index.html, #maint-screen). Картинка целиком, по высоте
   экрана или по ширине — что меньше; поля вокруг — в тон её ночного неба.
   Ссылка в чат лежит поверх нарисованной кнопки в долях картинки, поэтому
   совпадает с ней на любом экране. */
#maint-screen {
  position:fixed; inset:0; z-index:100000;
  display:flex; align-items:center; justify-content:center;
  background:radial-gradient(ellipse at 50% 35%, #1a2140 0%, #070912 70%);
}
.maint-frame { position:relative; height:min(100vh, calc(100vw * 1672 / 941)); aspect-ratio:941 / 1672; }
.maint-frame img { display:block; width:100%; height:100%; }
.maint-frame::after {
  content:''; position:absolute; left:0; right:0; bottom:0; height:46%; pointer-events:none;
  background:linear-gradient(180deg, transparent 0%, rgba(4,8,22,.55) 35%, rgba(4,8,22,.82) 100%);
}
.maint-title {
  position:absolute; left:4%; right:4%; top:66%; z-index:1; text-align:center;
  font-family:var(--font-display),'Philosopher',serif; font-weight:700; text-transform:uppercase;
  font-size:min(9.5vw, 5.2vh); line-height:1.05; letter-spacing:.04em;
  color:#eaf4ff; text-shadow:0 0 18px rgba(120,190,255,.85), 0 3px 0 #0b1b3a, 0 6px 14px rgba(0,0,0,.8);
}
.maint-chat {
  position:absolute; left:12%; top:81.5%; width:76%; height:9%; z-index:1;
  display:flex; align-items:center; justify-content:center; gap:4%;
  border-radius:999px; text-decoration:none; color:#fff3dc;
  background:linear-gradient(180deg, rgba(150,40,40,.95), rgba(90,18,22,.95));
  border:2px solid #e9c37a; box-shadow:0 0 18px rgba(233,195,122,.45), inset 0 1px 0 rgba(255,255,255,.25);
  -webkit-tap-highlight-color:transparent;
}
.maint-chat svg { width:min(7vw,4vh); height:min(7vw,4vh); color:#ffd98a; flex:none; }
.maint-chat span { display:flex; flex-direction:column; line-height:1.15; text-align:left; }
.maint-chat b { font-size:min(5vw,2.8vh); font-weight:800; text-transform:uppercase; letter-spacing:.03em; }
.maint-chat small { font-size:min(3.3vw,1.8vh); opacity:.85; text-transform:uppercase; letter-spacing:.06em; }
.maint-chat:active { filter:brightness(1.15); }
#login-screen.splash-out {
  animation: splash-out 0.4s ease both;
  pointer-events: none;
}
@keyframes splash-out { to { opacity:0; transform:scale(1.04); } }

/* ── CHARACTER SELECT ─────────────────── */
#char-select {
  position:absolute; inset:0;
  background:radial-gradient(ellipse at 50% 20%,#231824 0%,#100b11 100%);
  display:flex; flex-direction:column;
  align-items:center; color:#d8cfbe; z-index:100;
  overflow-y:auto; -webkit-overflow-scrolling:touch;
  touch-action:pan-y; padding-bottom:24px;
}

/* Class dots — replaces the old wide tab row; the carousel below is the nav */
.cs-dots {
  display:flex; justify-content:center; gap:9px;
  width:100%; flex-shrink:0; padding:14px 0 0;
}
.cs-dot {
  width:22px; height:22px; padding:0; border:none; background:none;
  cursor:pointer; touch-action:manipulation;
  display:flex; align-items:center; justify-content:center;
}
.cs-dot::after {
  content:''; width:8px; height:8px; border-radius:50%;
  background:rgba(216,207,190,.18); transition:all .25s ease;
}
.cs-dot:hover::after { background:rgba(216,207,190,.32); }
.cs-dot.active::after { width:22px; border-radius:5px; }
.cs-dot-lev.active::after         { background:#bbab8a; }
.cs-dot-deathknight.active::after { background:#a077c9; }
.cs-dot-ranger.active::after      { background:#7fa855; }
.cs-dot-mage.active::after        { background:#d6b26a; }
.cs-dot-warlock.active::after     { background:#c05a70; }
.cs-dot-runefighter.active::after { background:#c98a4a; }
.cs-dot-assassin.active::after    { background:#6a5578; }

/* Character carousel: active class centered, neighbors peeking at the edges */
.cs-stage {
  position:relative; width:100%; height:220px;
  margin:14px 0 0; flex-shrink:0;
  overflow:hidden; touch-action:pan-y;
}
.cs-track { position:absolute; inset:0; }
.cs-card {
  position:absolute; top:50%; left:50%; width:220px; height:220px;
  /* No negative margin here — the JS-driven transform below already carries
     the translate(-50%,-50%) half-size centering offset, on top of which it
     adds the carousel's translateX/scale per card. */
  transition:transform .38s cubic-bezier(.22,.9,.32,1), opacity .38s ease;
  will-change:transform;
}
.cs-card.cs-peek { cursor:pointer; }
.cs-canvas {
  position:absolute; inset:0;
  width:220px; height:220px;
  display:block;
  image-rendering:pixelated; image-rendering:crisp-edges;
  pointer-events:none;
}
.cs-nav {
  position:absolute; top:50%; transform:translateY(-50%);
  width:32px; height:32px; border-radius:50%; z-index:20;
  background:rgba(23,16,23,.5); border:1px solid rgba(216,207,190,.12);
  color:#b19f7b; font-size:16px; line-height:1; font-family:var(--font-display);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; transition:background .15s,color .15s;
  touch-action:manipulation;
}
.cs-nav:hover { background:rgba(23,16,23,.75); color:#e4dbc9; }
.cs-nav-prev { left:2px; }
.cs-nav-next { right:2px; }

/* Name + type badge */
.cs-charinfo {
  display:flex; flex-direction:column; align-items:center;
  gap:4px; margin:6px 0 10px; flex-shrink:0;
}
.cs-name { font-family:var(--font-display); font-size:22px; font-weight:700; letter-spacing:1px; color:var(--parchment); text-shadow:0 2px 0 rgba(0,0,0,0.6); }
.cs-badge {
  font-size:11px; color:#b19f7b; letter-spacing:.8px;
  background:rgba(216,207,190,.05);
  border:1px solid rgba(216,207,190,.08);
  border-radius:20px; padding:3px 10px;
}

/* Stat bars */
.cs-statbars {
  display:flex; flex-direction:column; gap:6px;
  width:100%; padding:0 16px; box-sizing:border-box; flex-shrink:0;
}
.cs-sbar { display:flex; align-items:center; gap:8px; }
.cs-sbl { font-size:10px; font-weight:700; color:#b19f7b; letter-spacing:.5px; width:36px; text-align:right; flex-shrink:0; }
.cs-sbtrack {
  flex:1; height:6px; border-radius:3px;
  background:rgba(216,207,190,.06);
  overflow:hidden;
}
.cs-sbfill { height:100%; border-radius:3px; transition:width .35s ease; }
.cs-sbv { font-size:11px; font-weight:700; color:#c6b89c; width:36px; flex-shrink:0; }
.cs-bar-hp  { background:linear-gradient(90deg,#597d3a,#85b957); }
.cs-bar-atk { background:linear-gradient(90deg,#84333c,#e15868); }
.cs-bar-def { background:linear-gradient(90deg,#554556,#c0a97c); }
.cs-bar-spd { background:linear-gradient(90deg,#69486c,#e3a649); }
.cs-bar-as  { background:linear-gradient(90deg,#5c4270,#9a78bf); }

/* Skills section */
.cs-skills-section {
  width:100%; padding:12px 16px 0; box-sizing:border-box; flex-shrink:0;
}
.cs-skills-hdr {
  font-size:9px; font-weight:700; color:#bf9b54; letter-spacing:2px;
  text-transform:uppercase; margin-bottom:8px;
}
.cs-skills-list { display:flex; flex-direction:column; gap:6px; }
.cs-skill {
  display:flex; align-items:flex-start; gap:8px;
  background:rgba(216,207,190,.03);
  border:1px solid rgba(216,207,190,.06);
  border-radius:10px; padding:8px 10px;
}
.cs-skill-key {
  width:20px; height:20px; border-radius:50%; flex-shrink:0;
  background:radial-gradient(circle at 35% 28%, var(--leather-hi), var(--leather-lo) 80%);
  border:1px solid var(--gold-dim);
  font-size:11px; font-weight:700; color:var(--gold-hi);
  display:flex; align-items:center; justify-content:center;
  margin-top:1px;
}
.cs-skill-body { display:flex; flex-direction:column; gap:2px; flex:1; min-width:0; }
.cs-skill-name { font-size:13px; font-weight:700; color:#cfc4ad; }
.cs-skill-desc { font-size:11px; color:#b19f7b; }
.cs-skill-cd   { font-size:10px; color:#553b58; margin-top:1px; }

/* Select button */
.cs-btn {
  display:block; margin:14px 16px 0; width:calc(100% - 32px);
  padding:13px 8px; border:1px solid var(--gold-dim); border-radius:3px;
  font-family:var(--font-display); text-transform:uppercase;
  font-size:13px; font-weight:700; cursor:pointer;
  transition:all .15s; user-select:none; touch-action:manipulation;
  letter-spacing:1.5px; flex-shrink:0;
}
.cs-btn-lev         { background:linear-gradient(135deg,#443945,#9a8355); color:#ebe6db; box-shadow:0 4px 18px rgba(154,131,85,.35); }
.cs-btn-deathknight { background:linear-gradient(135deg,#382a4a,#6d4d8f); color:#e2d3f2; box-shadow:0 4px 18px rgba(109,77,143,.35); }
.cs-btn-ranger      { background:linear-gradient(135deg,#2c3f1e,#527a3a); color:#d3e8b8; box-shadow:0 4px 18px rgba(82,122,58,.35); }
.cs-btn-mage        { background:linear-gradient(135deg,#39283b,#987a3e); color:#f1e3c5; box-shadow:0 4px 18px rgba(152,122,62,.35); }
.cs-btn-warlock     { background:linear-gradient(135deg,#3a1a28,#8a3a4a); color:#f0cdd9; box-shadow:0 4px 18px rgba(138,58,74,.35); }
.cs-btn-runefighter { background:linear-gradient(135deg,#3a2712,#a86b3f); color:#f2ddc4; box-shadow:0 4px 18px rgba(168,107,63,.35); }
.cs-btn-assassin    { background:linear-gradient(135deg,#18131c,#4a3a52); color:#d9cfe0; box-shadow:0 4px 18px rgba(74,58,82,.35); }
.cs-btn:hover  { opacity:.88; transform:translateY(-1px); }
.cs-btn:active { transform:scale(.98); opacity:.75; }
/* Row holding cs-btn-active and its "Опробовать персонажа" sibling
   (js/charselect.js's _csSwitchChar) — the row supplies the width/margin
   .cs-btn normally carries on its own, so both buttons share it evenly. */
.cs-btn-row { display:flex; gap:8px; margin:14px 16px 0; }
.cs-btn-row .cs-btn { flex:1.4; margin:0; width:auto; }
.cs-btn-trial {
  flex:1; margin:0; padding:13px 8px; border-radius:3px;
  border:1px solid rgba(216,207,190,.35); background:rgba(216,207,190,.08);
  color:#d8cfbe; font-family:var(--font-display); text-transform:uppercase;
  font-size:11px; font-weight:700; letter-spacing:1px; cursor:pointer;
  transition:all .15s; user-select:none; touch-action:manipulation;
}
.cs-btn-trial:hover  { opacity:.88; background:rgba(216,207,190,.14); }
.cs-btn-trial:active { transform:scale(.98); opacity:.75; }
.cs-btn.cs-resume {
  background:linear-gradient(135deg,#2a1d2b,#3f2b41) !important;
  color:#e69419 !important;
  border:1px solid rgba(230,148,25,.3);
  box-shadow:0 4px 18px rgba(230,148,25,.18) !important;
}

/* Loading overlay */
#cs-loading {
  position:absolute; inset:0;
  background:radial-gradient(ellipse at 50% 40%,#231824 0%,#0e0a0f 100%);
  display:flex; align-items:center; justify-content:center; z-index:110;
}
.csl-box  {
  position:absolute; left:0; right:0; bottom:9%;
  display:flex; flex-direction:column; align-items:center; gap:10px;
  padding:0 24px; z-index:1;
}
.csl-emoji {
  font-size:80px; line-height:1; display:block;
  animation:csl-float 2.4s ease-in-out infinite;
}
@keyframes csl-float {
  0%,100% { transform:translateY(0) scale(1); }
  50%      { transform:translateY(-10px) scale(1.05); }
}
.csl-name {
  font-size:24px; font-weight:900; color:#e69419; letter-spacing:3px;
  text-shadow:0 0 20px rgba(230,148,25,.4);
}
/* ── экран загрузки ──────────────────────────────────────────────────────
   Арт во весь экран, полоса внизу. Полоса показывает НАСТОЯЩИЙ прогресс:
   сколько листов спрайтов и файлов орнамента уже разобрано, плюс ответ
   сервера — см. csLoadProgress (js/charselect.js). Раньше здесь крутились три
   точки, которые не значили ничего: они анимировались одинаково и на быстрой
   сети, и на зависшей загрузке. */
.csl-art {
  position:absolute; inset:0; width:100%; height:100%;
  object-fit:contain; object-position:center;
  background:radial-gradient(ellipse at 50% 40%, #2a3366 0%, #0b1230 55%, #050a1c 100%);
  /* Никаких pointer-events: под ним нет ничего, что можно нажать, а перехват
     касания на экране загрузки читается как зависание. */
  pointer-events:none; user-select:none;
}
/* Затемнение снизу, чтобы полоса и текст читались поверх любой части арта:
   картинка внизу светлеет (лава), и белый процент на ней терялся. */
#cs-loading::after {
  content:''; position:absolute; left:0; right:0; bottom:0; height:42%;
  background:linear-gradient(to bottom, rgba(8,6,4,0) 0%, rgba(8,6,4,0.86) 62%, rgba(8,6,4,0.97) 100%);
  pointer-events:none;
}
.csl-bar {
  position:relative; width:min(280px, 68vw); height:8px;
  background:rgba(10,8,5,0.85);
  border:1px solid rgba(203,161,89,0.45); border-radius:999px;
  overflow:hidden;
  box-shadow:inset 0 1px 3px rgba(0,0,0,0.6);
}
.csl-fill {
  height:100%; width:0%;
  background:linear-gradient(90deg,#6b4a17,#e5aa52 60%,#f4d8a7);
  border-radius:999px;
  /* Плавно, но не настолько, чтобы полоса врала: 180мс догоняют шаг, а не
     рисуют движение там, где ничего не грузится. */
  transition:width .18s linear;
}
.csl-pct {
  font-size:13px; font-weight:800; color:#f0d8a8; letter-spacing:.5px;
  text-shadow:0 1px 3px rgba(0,0,0,.9);
}
.csl-dots { display:flex; gap:10px; margin-top:-4px; }
.csl-dot {
  width:9px; height:9px; border-radius:50%;
  background:#453047; animation:csl-blink 1.4s ease-in-out infinite;
}
.csl-dot:nth-child(2) { animation-delay:.25s; }
.csl-dot:nth-child(3) { animation-delay:.5s; }
@keyframes csl-blink {
  0%,70%,100% { background:#453047; transform:scale(.85); }
  35%          { background:#e69419; transform:scale(1.25); box-shadow:0 0 8px #e6941944; }
}
.csl-status { font-size:12px; color:#553a57; letter-spacing:2px; text-transform:uppercase; }

/* ── MONSTER LIST (flat, accordion) ────── */
.mon-list { display:flex; flex-direction:column; gap:5px; }
.mon-item {
  border:1px solid rgba(216,207,190,.07); border-radius:12px;
  background:rgba(216,207,190,.03); overflow:hidden;
}
.mon-item.open { border-color:rgba(230,148,25,.25); }
.mon-hdr {
  display:flex; align-items:center; gap:8px;
  padding:11px 12px; cursor:pointer; touch-action:manipulation; user-select:none;
}
.mon-hdr:active { background:rgba(216,207,190,.05); }
.mon-hdr .dot {
  display:inline-block; width:9px; height:9px; border-radius:50%;
  flex-shrink:0; box-shadow:0 0 0 1px rgba(0,0,0,.35) inset;
}
.mon-titles { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.mon-lvl {
  font-size:9px; color:#a38b5b; letter-spacing:.4px; text-transform:uppercase;
}
.mon-name-row { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.mon-name { font-size:14px; font-weight:700; color:#d8cfbe; }
.mon-chevron {
  font-size:16px; color:#b19f7b; transition:transform .15s; flex-shrink:0;
}
.mon-item.open .mon-chevron { transform:rotate(90deg); color:#e69419; }
.mon-body {
  display:none; padding:0 12px 14px;
}
.mon-variant + .mon-variant {
  margin-top:12px; padding-top:12px; border-top:1px solid rgba(216,207,190,.07);
}
.mon-variant-hdr {
  display:flex; align-items:center; gap:6px;
  font-size:12px; font-weight:700; color:#cfc4ad; margin-bottom:6px;
}
.mon-variant-hdr .dot {
  width:8px; height:8px; border-radius:50%; flex-shrink:0;
  box-shadow:0 0 0 1px rgba(0,0,0,.35) inset;
}
.fi-boss-tag {
  font-size:9px; font-weight:700; color:#ed5a6b; letter-spacing:1px;
  background:rgba(235,73,92,.15); border:1px solid rgba(235,73,92,.3);
  border-radius:4px; padding:2px 6px;
}
.fi-mstats {
  display:flex; gap:8px; flex-wrap:wrap; margin-bottom:8px;
}
.fi-mstats span {
  font-size:11px; color:#b19f7b;
  background:rgba(216,207,190,.04); border-radius:6px; padding:3px 7px;
}
.fi-mstats b { color:#d8cfbe; }
.fi-drops-hdr { font-size:9px; color:#bf9b54; letter-spacing:1.5px; text-transform:uppercase; margin-bottom:5px; }
.fi-drops { display:flex; flex-direction:column; gap:3px; }
.fi-drop {
  display:flex; justify-content:space-between; align-items:center;
  font-size:11px; padding:3px 0; border-bottom:1px solid rgba(216,207,190,.04);
}
.fi-drop:last-child { border-bottom:none; }
.fi-drop-lbl { color:#bcac8b; flex:1; }
.fi-drop-val { color:#cfc4ad; font-weight:600; }
.fi-drop-icon { width:20px; flex-shrink:0; display:flex; align-items:center; margin-right:4px; }

/* ── NPC TALK BUTTON ──────────────────── */
/* Sits above the joystick (its top edge is at H-250, see updateJoyCenter in
   js/input.js) rather than on the bottom strip: the action fan now owns that
   strip out to x = W-182, and a centred prompt is ~134px wide, so on any
   phone width it would have covered — and, being a DOM button, swallowed
   taps on — the fan's lowest skill button. */
#npc-talk-btn {
  position:absolute; bottom:256px; left:50%; transform:translateX(-50%);
  background:rgba(53,36,55,0.95); border:1px solid #bf9b54;
  border-radius:20px; padding:10px 22px;
  color:#e69419; font-size:14px; font-weight:bold;
  /* Above the chat widgets (#chat-preview 61, #chat-btn 62, index.html): the
     preview bubble sits on the same bottom strip and is wide enough to cover
     most of this button, so at the old z-index:30 walking up to an NPC left
     the "Поговорить" prompt hidden behind a chat message. The button is
     hidden outright while the chat panel is open (see the display rule in
     js/game.js), so winning here never means covering the chat input. */
  z-index:63; cursor:pointer; user-select:none;
  box-shadow:0 4px 20px rgba(193,158,89,0.4);
  transition:opacity 0.15s;
  touch-action:manipulation;
}
#npc-talk-btn:active { opacity:0.7; }

/* ── DEATH MODAL ──────────────────────── */
#death-modal {
  position:absolute; inset:0;
  background:rgba(0,0,0,0.88);
  display:flex; align-items:center; justify-content:center; z-index:200;
  backdrop-filter:blur(4px);
}
.death-panel {
  position:relative;
  background:
    radial-gradient(ellipse 200px 140px at 50% -10%, rgba(156,42,58,0.18), transparent 65%),
    linear-gradient(175deg,var(--leather-hi),var(--leather-lo) 85%);
  border:1px solid var(--gold-dim);
  border-radius:2px;
  padding:32px 24px 24px;
  text-align:center;
  width:min(88%, 290px);
  box-shadow:0 0 0 1px #000, 0 30px 50px -15px rgba(0,0,0,0.8), 0 0 40px rgba(156,42,58,0.15);
}
.death-panel::before, .death-panel::after {
  content:""; position:absolute; width:14px; height:14px;
  border:1.5px solid var(--gold);
}
.death-panel::before { top:8px; left:8px; border-right:none; border-bottom:none; }
.death-panel::after  { bottom:8px; right:8px; border-left:none; border-top:none; }
.death-skull {
  font-size:44px; margin-bottom:8px;
  filter:grayscale(0.2) drop-shadow(0 0 10px rgba(156,42,58,0.6));
  animation:deathSkullPulse 2s ease-in-out infinite;
}
@keyframes deathSkullPulse {
  0%,100% { opacity:1; transform:scale(1); }
  50% { opacity:0.75; transform:scale(0.95); }
}
.death-title {
  font-family:var(--font-display); font-size:20px; font-weight:700; color:var(--blood-hi);
  text-transform:uppercase;
  margin-bottom:16px; letter-spacing:3px;
  text-shadow:0 2px 0 rgba(0,0,0,0.7);
}
.death-info {
  margin-bottom:16px; line-height:2;
  display:flex; flex-direction:column; gap:2px;
}
.death-stat {
  display:block; font-size:13px; color:var(--parchment-dim);
}
.death-lbl { color:#755179; }
.death-penalty {
  background:rgba(156,42,58,0.22);
  border:1px solid var(--blood);
  border-radius:2px;
  color:#e08a94; font-size:12px; font-weight:600;
  padding:7px 12px; margin-bottom:18px;
  display:none;
}
.death-btn-respawn {
  width:100%; padding:13px; margin-bottom:10px;
  background:linear-gradient(180deg,var(--blood-hi),var(--blood) 75%);
  border:1.5px solid var(--gold); border-radius:2px;
  clip-path:polygon(10px 0,100% 0,100% 100%,10px 100%,0 50%);
  padding-left:20px;
  font-family:var(--font-display); text-transform:uppercase;
  color:var(--parchment); font-size:14px; font-weight:700; cursor:pointer;
  letter-spacing:1.2px;
  transition:opacity .15s, filter .15s;
}
.death-btn-respawn:active { opacity:.7; }
.death-btn-respawn:hover { filter:brightness(1.1); }

/* ── NPC OVERLAY & DIALOG ─────────────── */
#npc-overlay {
  position:absolute; inset:0;
  background:rgba(0,0,0,0.82);
  z-index:160; align-items:flex-end; justify-content:center;
  padding-bottom:70px;
}
#npc-dialog {
  background:#1d141e;
  border:1px solid rgba(188,150,75,0.5);
  border-radius:18px;
  width:min(380px,96vw);
  max-height:74vh; overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}
.npc-hdr {
  display:flex; align-items:center; gap:12px;
  padding:14px 16px 12px;
  border-bottom:1px solid #2f2030;
  position:sticky; top:0; background:#1d141e; z-index:2;
}
.npc-name { font-size:17px; font-weight:bold; color:#e69419; }
.npc-subdesc { font-size:11px; color:#b19f7b; margin-top:3px; }
.npc-close {
  margin-left:auto; background:none; border:none;
  color:#af8a41; font-size:22px; cursor:pointer; padding:0 4px;
  line-height:1;
}
.npc-close:hover { color:#c6b89c; }
.npc-body { padding:12px 14px 20px; }

/* ── SHOP STYLES ─────────────────────── */
.shop-gold {
  font-size:13px; color:#c6b89c; padding:6px 0 10px;
}
.shop-gold b { color:#ebab4b; }
.shop-sec {
  font-size:10px; text-transform:uppercase; letter-spacing:1px;
  color:#604263; margin:8px 0 8px;
}
.shop-list { display:flex; flex-direction:column; gap:7px; }
.shop-row {
  display:flex; align-items:center; gap:10px;
  background:rgba(216,207,190,0.03);
  border:1px solid #332334; border-radius:10px;
  padding:9px 12px;
}
.shop-item-icon { font-size:22px; width:28px; text-align:center; flex-shrink:0; }
.shop-item-info { flex:1; min-width:0; }
.shop-item-name { font-size:13px; font-weight:600; color:#d8cfbe; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-shadow:-1px -1px 0 #000000aa,1px -1px 0 #000000aa,-1px 1px 0 #000000aa,1px 1px 0 #000000aa; }
.shop-item-stat { font-size:11px; color:#b19f7b; margin-top:2px; }
.shop-btn {
  padding:7px 12px; border:none; border-radius:8px;
  background:linear-gradient(135deg,#6f4c72,#b18c42);
  color:#d8cfbe; font-size:12px; font-weight:bold; cursor:pointer;
  white-space:nowrap; flex-shrink:0;
  transition:transform 0.1s, box-shadow 0.1s, background 0.1s;
  touch-action:manipulation;
  box-shadow:0 3px 8px rgba(111,76,114,0.5);
}
.shop-btn:active {
  transform:scale(0.88);
  box-shadow:0 1px 3px rgba(111,76,114,0.3);
  background:linear-gradient(135deg,#4f3652,#6f4c72);
}
.shop-btn.disabled { background:#2f2030; color:#463048; pointer-events:none; box-shadow:none; }
.shop-btn-qty { color:#f0dcb0; }
/* Quantity picker at the merchant — how many potions one tap buys. */
.shop-qty { display:flex; gap:6px; flex-wrap:wrap; }
.shop-qty-btn {
  flex:1; min-width:44px;
  padding:7px 4px; border-radius:8px;
  background:rgba(216,207,190,0.03);
  border:1px solid #332334;
  color:#b19f7b; font-size:12px; font-weight:600; cursor:pointer;
  touch-action:manipulation;
  transition:background 0.1s, color 0.1s, border-color 0.1s;
}
.shop-qty-btn.on {
  background:rgba(235,171,75,0.15);
  border-color:#6f4c72;
  color:#ebab4b;
}
.shop-qty-btn:active { transform:scale(0.94); }
.shop-msg {
  background:rgba(236,87,104,0.15); border:1px solid #eb4e61;
  border-radius:8px; padding:8px 12px;
  color:#f17e8b; font-size:12px; text-align:center;
  margin-bottom:10px;
}
.shop-msg-ok {
  background:rgba(144,214,83,0.12); border:1px solid #90d653;
  border-radius:8px; padding:8px 12px;
  color:#90d653; font-size:12px; text-align:center;
  margin-bottom:10px;
  animation:shopMsgPop 0.2s ease;
}
@keyframes shopMsgPop { from{transform:scale(0.9);opacity:0} to{transform:scale(1);opacity:1} }
.inv-msg-err {
  position:absolute; bottom:70px; left:50%; transform:translateX(-50%);
  background:rgba(235,73,92,0.92); border:1px solid #eb4e61;
  border-radius:10px; padding:8px 18px;
  color:#d8cfbe; font-size:13px; font-weight:600;
  white-space:nowrap; pointer-events:none; z-index:20;
  animation:shopMsgPop 0.2s ease;
}
.craft-mats-info {
  font-size:11px; color:#604263; padding:4px 0 10px;
}
.craft-tabs {
  display:flex; gap:6px; margin:8px 0 10px;
}
.craft-tab {
  flex:1; padding:7px 0; border:1px solid #4a334c; border-radius:8px;
  background:#1d141e; color:#af8a41; font-size:12px; font-weight:600;
  cursor:pointer; transition:all 0.15s; touch-action:manipulation;
}
.craft-tab.active {
  background:linear-gradient(135deg,#6f4c72,#b18c42);
  color:#d8cfbe; border-color:#b18c42;
}
.craft-group-hdr {
  font-size:10px; text-transform:uppercase; letter-spacing:1px;
  color:#604263; margin:10px 0 5px; padding-left:2px;
}

/* ── Craft item grid ─────────────────────────── */
.craft-items-grid {
  display:grid; grid-template-columns:repeat(4,1fr); gap:6px; margin-bottom:4px;
}
.craft-item-cell {
  display:flex; flex-direction:column; align-items:center; gap:3px;
  padding:6px 4px; border-radius:8px; border:1px solid #342436;
  background:rgba(216,207,190,0.03); cursor:pointer;
  transition:background 0.15s;
  touch-action:manipulation;
}
.craft-item-cell:active { background:rgba(216,207,190,0.08); }
.craft-item-cell.craftable { background:rgba(127,181,79,0.07); }
.craft-item-cell-icon { line-height:1; }
.craft-item-cell-name {
  font-size:8px; font-weight:600; text-align:center;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  width:100%; max-width:60px;
}

/* ── Craft detail modal (inside npc-body) ────── */
.craft-back-btn {
  display:inline-flex; align-items:center; gap:4px;
  padding:5px 10px; margin-bottom:12px;
  border:1px solid #4a334c; border-radius:7px;
  background:#1d141e; color:#bf9b54; font-size:12px;
  cursor:pointer; touch-action:manipulation;
}
.craft-back-btn:active { opacity:0.7; }
.craft-detail-header {
  display:flex; align-items:center; gap:12px; margin-bottom:14px;
}
.craft-detail-icon { flex-shrink:0; }
.craft-detail-name { font-size:15px; font-weight:700; margin-bottom:4px; }
.craft-detail-stats { font-size:11px; color:#bf9b54; }
.craft-reqs-title {
  font-size:10px; text-transform:uppercase; letter-spacing:1px;
  color:#604263; margin-bottom:8px;
}
/* Pet candidates in the craft modal — tapping one opens the same item card
   the inventory uses (openPetStatsModal, js/npc.js). */
.pet-pick {
  flex:1; text-align:center; padding:6px 2px; border-radius:10px;
  cursor:pointer; touch-action:manipulation;
}
.pet-pick:active { opacity:0.75; }
.pet-preview-hint { font-size:11px; color:#604263; text-align:center; margin-bottom:12px; }
.craft-reqs-list { display:flex; flex-direction:column; gap:6px; margin-bottom:12px; }
.craft-req-row {
  display:flex; align-items:center; gap:8px;
  padding:5px 8px; background:rgba(216,207,190,0.03);
  border:1px solid #342436; border-radius:7px;
}
.craft-req-icon { flex-shrink:0; line-height:1; }
.craft-req-name { flex:1; font-size:11px; color:#c6b89c; }
.craft-req-count { font-size:12px; font-weight:700; flex-shrink:0; }
.craft-chance-row {
  font-size:12px; color:#b19f7b; text-align:center; margin-bottom:10px;
}
.craft-do-btn { width:100%; text-align:center; padding:10px; font-size:13px; }

/* ── INVENTORY ITEM MODAL ──────────────────── */
.imod-overlay {
  position:absolute; inset:0; z-index:170;
  background:rgba(0,0,0,0.65);
  display:flex; align-items:center; justify-content:center;
}
.imod-box {
  /* Цвет текста по умолчанию. Его тут не было вовсе, а ни body, ни #app его
     не задают — то есть всё, что не покрашено явно, наследовало ЧЁРНЫЙ на
     тёмно-синем фоне и было попросту невидимым. Заметили это на пояснении
     под характеристиками руны, но касалось оно любого текста в любой
     карточке, который забыли покрасить. Дочерние блоки со своим color
     (.imod-sub, .imod-stats) перебивают это как и раньше. */
  color:#cfc4ad;
  background:#1d141e;
  border:1px solid rgba(188,150,75,0.5);
  border-radius:16px;
  width:min(310px,92vw);
  padding:16px;
  display:flex; flex-direction:column; gap:12px;
}
.imod-hdr { display:flex; align-items:center; gap:12px; }
.imod-big-icon { flex-shrink:0; }
.imod-title-block { flex:1; min-width:0; }
.imod-name { font-size:15px; font-weight:bold; line-height:1.2; }
.imod-sub { font-size:11px; color:#b19f7b; margin-top:3px; }
.imod-stats {
  font-size:13px; color:#cfc4ad; line-height:1.8;
  background:rgba(216,207,190,0.04);
  border-radius:8px; padding:8px 12px;
}
.imod-enh-block {
  background:rgba(230,148,25,0.06);
  border:1px solid rgba(230,148,25,0.15);
  border-radius:8px; padding:10px 12px;
  display:flex; flex-direction:column; gap:4px;
}
.imod-enh-title { font-size:12px; font-weight:bold; color:#e69419; }
.imod-enh-preview { font-size:11px; color:#cfc4ad; }
.imod-enh-chance { font-size:11px; color:#c6b89c; }
.imod-btns { display:flex; gap:8px; }
.imod-btn {
  flex:1; padding:10px; border:none; border-radius:10px;
  font-size:14px; font-weight:bold; cursor:pointer;
  touch-action:manipulation;
}
.imod-equip { background:linear-gradient(135deg,#503752,#68476b); color:#eec276; }
.imod-equip:active { opacity:0.8; }
.imod-sell { background:linear-gradient(135deg,#3a1f1f,#5e3232); color:#e5a546; }
.imod-sell:active { opacity:0.8; }
.imod-enhance-btn { background:linear-gradient(135deg,#3a2a12,#5e4520); color:#e69419; }
.imod-enhance-btn:active { opacity:0.8; }

/* ── ЗАТОЧКА: выбор камня, анимация попытки, результат ─────────────────── */
/* Two option cards — обычная/безопасная — replacing what used to be a pair
   of small buttons whose only difference was a title= tooltip nobody on a
   touch screen ever sees (see the comment this replaced, git blame). Each
   card carries its own always-visible explanation instead. */
.enh-opt-card {
  background:rgba(209,204,197,0.04); border:1px solid rgba(209,204,197,0.12);
  border-radius:10px; padding:10px 12px;
  display:flex; flex-direction:column; gap:6px;
}
.enh-opt-card.enh-opt-safe { background:rgba(188,150,75,0.07); border-color:rgba(188,150,75,0.25); }
.enh-opt-hdr { display:flex; align-items:center; gap:8px; }
.enh-opt-title { font-size:13px; font-weight:bold; color:#e69419; flex:1; }
.enh-opt-safe .enh-opt-title { color:#dbbb79; }
.enh-opt-qty { font-size:11px; color:#a3957c; }
.enh-opt-desc { font-size:11px; color:#a3957c; line-height:1.4; }
.enh-opt-btn { padding:8px; font-size:13px; background:linear-gradient(135deg,#503752,#68476b); color:#eec276; }
.enh-opt-safe .enh-opt-btn { background:linear-gradient(135deg,#302131,#553a57); color:#efc680; }
/* Шкала звёздных осколков у безопасной заточки: +10% за 100 осколков, до 90%. */
.enh-boost { display:flex; flex-direction:column; gap:7px; padding:9px 10px; border-radius:9px;
  background:rgba(226,179,84,0.06); border:1px solid rgba(226,179,84,0.25); }
.enh-boost-hdr { display:flex; align-items:center; gap:6px; font-size:12px; font-weight:700; color:#eac67f; }
.enh-boost-have { margin-left:auto; font-weight:600; color:#b8a98a; }
.enh-boost-bar { display:grid; grid-template-columns:repeat(9, 1fr); gap:3px; }
.enh-boost-cell { height:9px; border-radius:3px; background:rgba(216,207,190,.10); }
.enh-boost-cell.is-base { background:#e69419; }
.enh-boost-cell.is-boost { background:#e5ba65; box-shadow:0 0 6px rgba(229,186,101,.55); }
.enh-boost-ctl { display:flex; align-items:center; gap:10px; }
.enh-boost-btn { width:34px; height:30px; border-radius:8px; border:1px solid rgba(229,186,101,.4);
  background:rgba(229,186,101,.12); color:#f4e1bd; font-size:18px; font-weight:800; cursor:pointer; touch-action:manipulation; }
.enh-boost-btn.disabled { opacity:.35; pointer-events:none; }
.enh-boost-val { flex:1; display:flex; flex-direction:column; align-items:center; line-height:1.25; }
.enh-boost-val b { font-size:18px; color:#eac67f; }
.enh-boost-val span { font-size:10.5px; color:#b8a98a; text-align:center; }
.enh-opt-btn:active { opacity:0.8; }
.enh-opt-btn.disabled { opacity:0.4; pointer-events:none; }

.enh-anim-wrap { display:flex; flex-direction:column; align-items:center; gap:14px; padding:22px 10px; }
.enh-anim-ring {
  position:relative; width:72px; height:72px;
  display:flex; align-items:center; justify-content:center;
}
.enh-anim-ring::before {
  content:''; position:absolute; inset:-6px; border-radius:50%;
  border:3px solid rgba(230,148,25,0.2); border-top-color:#e69419;
  animation: enh-spin 0.9s linear infinite;
}
@keyframes enh-spin { to { transform:rotate(360deg); } }
.enh-anim-lbl { font-size:13px; color:#e69419; font-weight:bold; }

.enh-result-wrap { display:flex; flex-direction:column; align-items:center; gap:10px; padding:18px 10px 6px; }
.enh-result-icon { line-height:1; animation:enh-result-pop 0.35s ease; }
@keyframes enh-result-pop { from { transform:scale(0.4); opacity:0; } to { transform:scale(1); opacity:1; } }
.enh-result-lbl { font-size:15px; font-weight:800; }
.enh-result-lbl.success { color:#98e456; }
.enh-result-lbl.fail { color:#f17e8b; }
.enh-result-lbl.burn { color:#eb4e61; }

/* ── LOOT BOX ODDS ──────────────────────── */
.box-odds-list { display:flex; flex-direction:column; gap:8px; }
.box-odds-row {
  background:rgba(216,207,190,0.03); border:1px solid #342436;
  border-radius:9px; padding:8px 10px;
}
.box-odds-hdr { font-size:12px; font-weight:700; margin-bottom:5px; }
.box-odds-icons { display:flex; flex-wrap:wrap; gap:2px; }

/* ── BOTTOM PANELS ─────────────────────── */
.bpanel {
  position:absolute; left:0; right:0; bottom:var(--nav-h);
  height:0; overflow:hidden;
  background:linear-gradient(175deg,var(--void-2),var(--void) 60%);
  border-top:2px solid var(--gold-dim);
  z-index:40;
  transition:height 0.28s cubic-bezier(.4,0,.2,1);
  display:none;
}
.bpanel.open { height:calc(100% - var(--nav-h)); overflow-y:auto; -webkit-overflow-scrolling:touch; }
.bpanel.open *, #npc-dialog *, #char-select * { touch-action:pan-y; }
.bpanel.open, #npc-dialog, #char-select { touch-action:pan-y; }
/* ── оверлеи поверх игры, которым нужна прокрутка ──────────────────────────
   Правило `* { touch-action:none }` в начале файла выключает прокрутку
   пальцем ВЕЗДЕ — иначе палец, ведущий джойстик, таскал бы страницу. Всё,
   что должно прокручиваться, выведено из него поимённо, строкой выше.

   Новый оверлей об этом правиле не знает, и узнаёт о нём от игрока. Список
   наград «Письма» открывался, показывал обе награды и не прокручивался ни на
   миллиметр; кнопка «Забрать» при этом работала — то есть со стороны это
   выглядело как зависшая панель, а не как забытая строчка в CSS.

   Класс, а не ещё один id: следующему оверлею достаточно его повесить, и он
   не станет третьим случаем той же истории. */
.ov-scroll { touch-action:pan-y; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; }
.ov-scroll * { touch-action:pan-y; }
.panel-hdr {
  padding:13px 16px 11px; border-bottom:1px solid var(--panel-line, #402c42);
  font-family:var(--font-display); text-transform:uppercase;
  font-size:15px; font-weight:700; letter-spacing:0.06em; color:var(--parchment);
  position:sticky; top:0; background:var(--void-2); z-index:2;
  display:flex; align-items:center; justify-content:space-between;
}
.panel-body { padding:14px 16px 24px; }
.sec-title  { font-size:10px; text-transform:uppercase; letter-spacing:1.5px; color:var(--gold-dim); margin-bottom:8px; }

/* disable button styling inside modal when disabled */
#pt-modal-use:disabled, #pt-modal-hud:disabled { opacity:0.4; pointer-events:none; }

/* ── INVENTORY (redesigned) ─────────────── */
.inv-char-row {
  display:flex; align-items:center; gap:12px;
  padding:10px 16px 10px;
  border-bottom:1px solid #2f2030;
  background:rgba(216,207,190,0.02);
}
.eq-grid-5col {
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:5px;
}
/* ── Кольцо снаряжения (вкладка «Персонаж») ──────────────────────────────
   Квадрат, в центре портрет, одиннадцать слотов по окружности —
   updateInvUI ставит каждому left/top в процентах, здесь только центровка. */
#panel-inv #inv-tab-content-0 {
  background:radial-gradient(ellipse 110% 520px at 50% 260px, #2a2214 0%, #14100b 55%, transparent 100%);
}
.eq-ring-head { text-align:center; padding:14px 16px 0; }
.eq-ring-name { font-family:var(--font-display); font-size:26px; color:#f1e3c2; line-height:1.05; }
.eq-ring-sub  {
  display:flex; align-items:center; justify-content:center; gap:6px; margin-top:5px;
  font-size:11px; color:#a89a7c; letter-spacing:.14em; text-transform:uppercase;
}
.eq-ring-hint { text-align:center; color:#7a6a4a; font-size:9px; margin:6px 0 0; }
.eq-ring {
  position:relative; width:100%; max-width:380px; aspect-ratio:1; margin:0 auto;
}
.eq-ring-line {
  position:absolute; inset:10%; border-radius:50%; border:1px solid rgba(201,160,78,.35);
}
.eq-ring-line.inner { inset:18%; border:1px dashed rgba(201,160,78,.18); }
.eq-ring-glow {
  position:absolute; inset:22%; border-radius:50%;
  background:radial-gradient(circle, rgba(243,207,114,.20), transparent 70%);
}
.eq-ring-pedestal {
  position:absolute; left:32%; right:32%; top:66%; height:5%; border-radius:50%;
  background:radial-gradient(ellipse, rgba(243,207,114,.30), transparent 70%);
}
.eq-ring canvas {
  position:absolute; left:24%; top:20%; width:52%; height:52%;
  image-rendering:pixelated; image-rendering:crisp-edges; pointer-events:none;
}
.eq-rslot {
  position:absolute; width:15%; aspect-ratio:1; transform:translate(-50%,-50%);
  border-radius:50%; border:1.5px solid #3a3222; background:#151016;
  display:flex; align-items:center; justify-content:center; box-sizing:border-box;
  cursor:default; user-select:none;
}
.eq-rslot.filled {
  cursor:pointer; border:2px solid var(--rc);
  background:radial-gradient(circle, color-mix(in srgb, var(--rc) 35%, transparent), #191119 70%);
  box-shadow:0 0 14px color-mix(in srgb, var(--rc) 45%, transparent);
}
.eq-rslot.filled:active { transform:translate(-50%,-50%) scale(.94); }
.eq-rslot-enh {
  position:absolute; bottom:-7px; left:50%; transform:translateX(-50%);
  background:#130e13; border:1px solid #f3cf72; border-radius:8px; padding:0 5px;
  font-size:10px; font-weight:700; color:#f3cf72; line-height:14px; white-space:nowrap;
}
#eq-ring-info { padding:0 12px 14px; text-align:center; }
.eq-ring-orn { height:1px; margin:0 14px; background:linear-gradient(90deg, transparent, #c9a04e, transparent); }
.eq-ring-bm-lbl { margin-top:9px; font-size:10px; color:#a88b4e; letter-spacing:.3em; }
.eq-ring-bm {
  font-family:var(--font-display); font-size:38px; line-height:1.05; color:#f3cf72;
  text-shadow:0 0 18px rgba(243,207,114,.35); margin-bottom:8px;
}
.gsb {
  margin:0 12px 6px; padding:10px 10px 9px; border-radius:12px;
  border:1px solid color-mix(in srgb, var(--rc) 45%, #2a2418);
  background:linear-gradient(180deg, color-mix(in srgb, var(--rc) 12%, #191119), #130e13 75%);
  transition:box-shadow .3s, border-color .3s;
}
.gsb.active { border-color:var(--rc); box-shadow:0 0 16px color-mix(in srgb, var(--rc) 40%, transparent), inset 0 0 18px color-mix(in srgb, var(--rc) 14%, transparent); }
.gsb-head { display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.gsb-title { font-family:var(--font-display); font-size:15px; white-space:nowrap; color:#f3cf72; letter-spacing:.04em; }
.gsb-sub { font-size:10px; color:#a88b4e; white-space:nowrap; display:inline-flex; align-items:center; gap:3px; }
.gsb-tabs { display:flex; gap:5px; margin:8px 0 9px; }
.gsb-tab {
  flex:1; min-width:0; padding:4px 2px; border-radius:7px; font-size:9.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-weight:700; cursor:pointer;
  color:color-mix(in srgb, var(--rc) 70%, #8a7f70); background:#130e13;
  border:1px solid color-mix(in srgb, var(--rc) 30%, #1d1a14); position:relative;
}
.gsb-tab.on { color:#130e13; background:var(--rc); border-color:var(--rc); }
.gsb-tab.live::after {
  content:''; position:absolute; top:3px; right:4px; width:5px; height:5px; border-radius:50%;
  background:#7dff9a; box-shadow:0 0 6px #7dff9a;
}
.gsb-pips { display:grid; grid-template-columns:repeat(6, 1fr); gap:5px; margin-bottom:9px; }
.gsb-pip {
  position:relative; aspect-ratio:1; border-radius:8px; display:flex; align-items:center; justify-content:center;
  border:1px dashed #2f2a20; background:#100c10;
}
.gsb-pip.on { border:1px solid var(--rc); background:radial-gradient(circle, color-mix(in srgb, var(--rc) 28%, transparent), #100c10 72%); }
.gsb-pip-enh {
  position:absolute; bottom:-5px; left:50%; transform:translateX(-50%);
  font-size:8px; font-weight:700; color:#f3cf72; background:#130e13; border-radius:6px; padding:0 3px; line-height:11px;
}
.gsb-tiers { display:grid; grid-template-columns:repeat(6, 1fr); gap:4px; }
.gsb-tier {
  text-align:center; padding:5px 0 4px; border-radius:8px; background:#100c10;
  border:1px solid #1f1c16; opacity:.55; transition:opacity .3s, box-shadow .3s;
}
.gsb-tier-lamp {
  width:8px; height:8px; margin:0 auto 4px; border-radius:50%;
  background:#2a261e; border:1px solid #3a3428;
}
.gsb-tier-enh { font-size:12px; font-weight:700; color:#cfc0ad; }
.gsb-tier-pct { font-size:9px; color:#8a7f70; margin-top:1px; }
.gsb-tier.on { opacity:1; border-color:color-mix(in srgb, var(--rc) 55%, transparent); }
.gsb-tier.on .gsb-tier-lamp { background:var(--rc); border-color:#fff8; box-shadow:0 0 8px var(--rc); }
.gsb-tier.on .gsb-tier-pct { color:var(--rc); }
.gsb-tier.cur { box-shadow:0 0 10px color-mix(in srgb, var(--rc) 55%, transparent); }
.gsb-tier.cur .gsb-tier-lamp { animation:gsbPulse 1.6s ease-in-out infinite; }
@keyframes gsbPulse { 0%,100% { box-shadow:0 0 6px var(--rc); } 50% { box-shadow:0 0 14px var(--rc), 0 0 4px #fff; } }
.gsb-status { margin-top:8px; font-size:10px; text-align:center; color:#a89a86; }
.gsb.active .gsb-status { color:var(--rc); font-weight:700; }
.eq-cell {
  aspect-ratio:1; border:2px solid #332334; border-radius:8px;
  background:rgba(216,207,190,0.02);
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  cursor:pointer; transition:border-color 0.15s;
  user-select:none; padding:2px;
  /* Without this, a label too long to fit at this width (e.g. two-line
     wraps in a narrow cell) grows the box past its
     aspect-ratio-derived height instead of being clipped — a flex item's
     default min-height:auto lets content override aspect-ratio unless
     overflow isn't visible. */
  overflow:hidden;
}
.eq-cell:active { opacity:0.7; }
.eq-cell.filled { border-color:#553a57; background:rgba(216,207,190,0.05); }
.eq-cell .cell-icon { font-size:18px; line-height:1.1; }
.eq-cell .cell-lbl  {
  font-size:7px; color:#553a57; margin-top:2px; text-align:center;
  line-height:1.2; max-width:100%; overflow:hidden;
  white-space:normal; word-break:break-word; padding:0 1px;
}
.eq-cell.filled .cell-lbl { color:#b1986e; }

.inv-grid {
  display:grid; grid-template-columns:repeat(5,1fr); gap:5px;
}
.inv-cell {
  aspect-ratio:1; border:2px solid #332334; border-radius:7px;
  background:rgba(216,207,190,0.02);
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  cursor:pointer; transition:border-color 0.15s;
  user-select:none; padding:2px;
}
.inv-cell:active { opacity:0.7; }
.inv-cell.filled { border-color:#553a57; background:rgba(216,207,190,0.04); }

/* ── PROFILE ──────────────────────────── */
.prof-hero  { display:flex; align-items:center; gap:14px; margin-bottom:18px; }
.prof-emoji { font-size:52px; line-height:1; }
.prof-cls   { font-size:20px; font-weight:bold; }
.prof-lvl   { font-size:13px; color:#bcac8b; margin-top:3px; }
.xp-lbl     { font-size:11px; color:#b19f7b; margin-bottom:5px; }
.xp-bg      { height:8px; background:#140e15; border-radius:4px; overflow:hidden; margin-bottom:18px; }
.xp-fill    { height:100%; background:linear-gradient(90deg,#e9b151,#efc680); border-radius:4px; }
.stat-grid  { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:18px; }
.stat-card  { background:rgba(216,207,190,0.03); border:1px solid #2f2030; border-radius:10px; padding:12px 8px; text-align:center; }
.stat-ic    { font-size:18px; margin-bottom:4px; }
.stat-vl    { font-size:18px; font-weight:bold; color:#d8cfbe; }
.stat-nm    { font-size:10px; color:#604263; margin-top:3px; }

/* ── QUESTS ───────────────────────────── */
.quest-item       { border-radius:10px; padding:12px 14px; margin-bottom:10px; border:1px solid #332334; }
.quest-done       { background:rgba(50,57,43,0.35); border-color:#2b3622; }
.quest-current    { background:rgba(59,41,61,0.7); border-color:#6b496e; }
.quest-locked     { background:rgba(29,20,30,0.4); opacity:0.5; }
.quest-header     { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; margin-bottom:4px; }
.quest-title      { font-size:13px; font-weight:700; color:#d8cfbe; }
.quest-current .quest-title { color:#f3d5a1; }
.quest-done .quest-title    { color:#b19f7b; }
.quest-reward     { font-size:10px; color:#e69419; white-space:nowrap; }
.quest-desc       { font-size:11px; color:#bcac8b; margin-bottom:6px; }
.quest-current .quest-desc  { color:#c6b89c; }
.quest-prog       { font-size:10px; color:#cfc4ad; margin-top:2px; }
.quest-bar-bg     { height:4px; background:#332334; border-radius:2px; margin-top:3px; overflow:hidden; }
.quest-bar-fill   { height:100%; background:linear-gradient(90deg,#d8a54c,#e8c481); border-radius:2px; transition:width .3s; }
.quest-claim-btn  { margin-top:10px; width:100%; padding:10px 0; border:none; border-radius:10px; background:linear-gradient(135deg,#d8a54c,#dfb362); color:#d8cfbe; font-size:14px; font-weight:700; cursor:pointer; letter-spacing:0.02em; }
.quest-claim-btn:active { opacity:0.8; }
.quest-floor-hdr    { font-size:12px; font-weight:700; color:#b6a281; padding:8px 0 4px; margin-bottom:4px; border-bottom:1px solid #332334; }

/* ── CLAN PANEL ───────────────────────── */
/* Хранилище клана — pooled Осколки and the leader's allocations */
.clan-storage-gate {
  margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; font-size: 12px; line-height: 1.35;
  background: rgba(230,148,25,.10); border: 1px solid rgba(230,148,25,.28); color: #e6af5e;
}
.clan-storage-list { display: flex; flex-direction: column; gap: 6px; }
.clan-treasury {
  display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 10px 12px; border-radius: 10px;
  background: linear-gradient(90deg, rgba(230,188,105,.16), rgba(24,17,25,.6));
  border: 1px solid rgba(233,196,121,.35); box-shadow: 0 0 18px -8px rgba(233,196,121,.7);
}
.clan-treasury-coin { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 0 6px rgba(233,196,121,.6)); }
.clan-treasury-body { flex: 1; min-width: 0; }
.clan-treasury-sum { font-size: 18px; font-weight: 800; color: #efd6a2; }
.clan-treasury-sum small { font-size: 11px; color: #d3b579; font-weight: 700; }
.clan-treasury-note { font-size: 10.5px; color: #beac88; line-height: 1.35; }
.clan-tr-row { padding: 5px 9px; }
.clan-storage-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px;
  background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.06);
}
.clan-storage-img  { width: 22px; height: 22px; image-rendering: pixelated; flex: 0 0 auto; }
.clan-storage-name { flex: 1 1 auto; font-size: 12.5px; color: #ded2bb; min-width: 0;
                     overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clan-storage-who  { color: #8fbf7a; }
.clan-storage-qty  { font-size: 13px; font-weight: 700; color: #e6c88a; flex: 0 0 auto; }
/* Unlock button while the leader can't afford it — still readable, clearly
   inert, and it carries no onclick either (see _clanStorageHTML). */
.clan-btn-disabled { opacity: .45; cursor: default; }

.clan-empty        { display:flex; flex-direction:column; align-items:center; padding:28px 16px; gap:10px; }
.clan-empty-icon   { opacity:0.6; margin-bottom:4px; }
.clan-empty-title  { font-size:17px; font-weight:800; color:#eece94; }
.clan-empty-sub    { font-size:12px; color:#624365; text-align:center; max-width:220px; }
.clan-btn          { display:block; width:100%; padding:11px 0; border:none; border-radius:10px; font-size:14px; font-weight:700; cursor:pointer; touch-action:manipulation; margin-top:4px; }
.clan-btn-create   { background:linear-gradient(135deg,#9d7d3b,#d8a54c); color:#d8cfbe; }
.clan-btn-search   { background:rgba(216,207,190,0.06); border:1px solid rgba(216,207,190,0.1); color:#bcac8b; }
.clan-btn-leave    { background:rgba(173,67,80,0.18); border:1px solid rgba(193,87,100,0.3); color:#ee6676; width:100%; padding:11px 0; border-radius:10px; font-size:13px; font-weight:700; cursor:pointer; }
.clan-btn-danger   { background:rgba(169,41,56,0.25); border:1px solid rgba(209,71,87,0.4); color:#ed5a6b; width:100%; padding:11px 0; border-radius:10px; font-size:13px; font-weight:700; cursor:pointer; }
.clan-btn-sm       { padding:5px 10px; border:none; border-radius:7px; background:rgba(188,150,75,0.3); border:1px solid rgba(234,181,89,0.4); color:#eece94; font-size:11px; font-weight:700; cursor:pointer; white-space:nowrap; touch-action:manipulation; }
.clan-btn-sm.clan-btn-danger { background:rgba(171,49,64,0.25); border-color:rgba(209,79,94,0.4); color:#f17e8b; }
.clan-btn-sm:disabled { opacity:.6; cursor:default; }
.clan-form         { padding:0 0 16px; }
.clan-back         { background:none; border:none; color:#be9f68; font-size:13px; cursor:pointer; padding:0 0 12px; touch-action:manipulation; }
.clan-form-title   { font-size:16px; font-weight:800; color:#eece94; margin-bottom:14px; }
.clan-form-label   { font-size:11px; color:#755179; margin-bottom:6px; }
.clan-input        { width:100%; padding:10px 14px; border:1px solid rgba(188,150,75,0.4); border-radius:10px; background:rgba(216,207,190,0.05); color:#dcd4c3; font-size:14px; outline:none; box-sizing:border-box; }
.clan-input:focus  { border-color:rgba(234,181,89,0.7); }
.clan-icon-preview { display:flex; align-items:center; gap:12px; cursor:pointer; padding:10px 12px; border:1px solid rgba(188,150,75,0.3); border-radius:10px; background:rgba(216,207,190,0.04); }
.clan-icon-change  { font-size:12px; color:#be9f68; }
.clan-icon-grid    { display:grid; grid-template-columns:repeat(6,1fr); gap:6px; margin-top:10px; }
.clan-icon-cell    { display:flex; align-items:center; justify-content:center; padding:6px; border-radius:8px; border:1px solid rgba(216,207,190,0.06); background:rgba(216,207,190,0.03); cursor:pointer; touch-action:manipulation; }
.clan-icon-cell.clan-icon-sel { border-color:#d8a54c; background:rgba(216,165,76,0.25); }
.clan-err          { color:#ee6676; font-size:12px; margin-top:8px; min-height:16px; }
.clan-search-row   { display:flex; gap:8px; margin-bottom:12px; }
.clan-result       { display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid rgba(216,207,190,0.05); }
.clan-result-icon  { flex-shrink:0; }
.clan-result-info  { flex:1; min-width:0; }
.clan-result-name  { font-size:13px; font-weight:700; color:#d8cfbe; }
.clan-result-meta  { font-size:11px; color:#755179; margin-top:2px; }
.clan-nores        { color:#553a57; font-size:13px; text-align:center; padding:20px 0; }
.clan-home         { padding-bottom:20px; }
.clan-hdr          { display:flex; align-items:center; gap:12px; padding:4px 0 14px; border-bottom:1px solid rgba(216,207,190,0.06); margin-bottom:12px; }
.clan-hdr-icon     { flex-shrink:0; }
.clan-hdr-name     { font-size:18px; font-weight:900; color:#d8cfbe; }
.clan-hdr-level    { font-size:11px; color:#bf9b54; margin-top:2px; }
.clan-bonus-row    { display:flex; flex-wrap:wrap; gap:4px; margin-top:5px; }
.clan-bonus-tag    { font-size:10px; padding:2px 7px; border-radius:12px; background:rgba(216,165,76,0.25); border:1px solid rgba(234,181,89,0.35); color:#e8c481; }
.clan-bonus-none   { color:#553a57; background:none; border-color:rgba(216,207,190,0.06); }
.clan-xp-block     { margin-bottom:14px; }
.clan-xp-label     { font-size:11px; color:#bf9b54; margin-bottom:5px; }
.clan-xp-bar-bg    { height:6px; background:#332334; border-radius:3px; overflow:hidden; }
.clan-xp-bar-fill  { height:100%; background:linear-gradient(90deg,#d8a54c,#e69419); border-radius:3px; transition:width .5s; }
.clan-desc         { display:flex; align-items:flex-start; gap:8px; padding:10px 12px; margin-bottom:14px; border:1px solid rgba(216,207,190,0.08); border-radius:10px; background:rgba(216,207,190,0.03); }
.clan-desc-empty   { color:#553a57; }
.clan-desc-text    { flex:1; font-size:13px; line-height:1.5; color:#cfc4ad; white-space:pre-wrap; word-break:break-word; }
.clan-desc-empty .clan-desc-text { color:#624365; font-style:italic; }
.clan-desc-edit-btn { flex-shrink:0; background:none; border:none; color:#bf9b54; font-size:14px; cursor:pointer; padding:0 2px; touch-action:manipulation; }
.clan-desc-edit-btn:active { color:#e8c481; }
.clan-desc-edit    { margin-bottom:14px; }
.clan-desc-input   { resize:vertical; min-height:64px; font-family:inherit; }
.clan-desc-actions { display:flex; gap:8px; margin-top:8px; }
.clan-section-hdr  { font-size:11px; font-weight:700; color:#624365; letter-spacing:1px; text-transform:uppercase; margin-bottom:7px; }
.clan-member       { display:flex; align-items:center; gap:8px; padding:7px 0; border-bottom:1px solid rgba(216,207,190,0.04); }
.clan-member-me    { background:rgba(234,181,89,0.08); border-radius:6px; padding-left:6px; }
.clan-member-role  { flex-shrink:0; font-size:14px; }
.clan-member-name  { flex:1; font-size:13px; color:#cfc4ad; }
.inv-tabs          { display:flex; border-bottom:1px solid rgba(216,207,190,0.07); margin-bottom:4px; }
.inv-tab           { flex:1; text-align:center; padding:8px 0; font-size:12px; font-weight:700; color:#624365; cursor:pointer; border-bottom:2px solid transparent; touch-action:manipulation; transition:color .15s; }
.inv-tab.active    { color:#e7b765; border-bottom-color:#e0aa4b; }
.clan-tabs         { display:flex; border-bottom:1px solid rgba(216,207,190,0.07); margin-bottom:12px; }
.clan-tab          { flex:1; text-align:center; padding:8px 0; font-size:12px; font-weight:700; color:#624365; cursor:pointer; border-bottom:2px solid transparent; touch-action:manipulation; transition:color .15s; }
.clan-tab.active   { color:#e8c481; border-bottom-color:#d8a54c; }
.clan-member-bm    { font-size:10px; color:#eaa742; font-weight:700; white-space:nowrap; margin-right:4px; }
.clan-my-bm        { font-size:13px; color:#bf9b54; padding:6px 0; }
.clan-my-bm span   { color:#eaa742; font-weight:800; }
.clan-perks        { display:flex; flex-direction:column; gap:6px; }
.clan-perk         { display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:10px; }
.clan-perk.unlocked{ background:rgba(161,127,60,0.2); border:1px solid rgba(234,181,89,0.3); }
.clan-perk.locked  { background:rgba(39,27,40,0.25); border:1px solid rgba(216,207,190,0.04); opacity:0.45; }
.clan-perk-icon    { font-size:20px; width:28px; text-align:center; flex-shrink:0; }
.clan-perk-body    { flex:1; min-width:0; }
.clan-perk-name    { font-size:13px; font-weight:700; color:#d8cfbe; }
.clan-perk-lvl     { font-size:10px; color:#be9f68; font-weight:700; margin-left:4px; }
.clan-perk-desc    { font-size:11px; color:#bf9b54; margin-top:2px; }

/* ── MAP PANEL ────────────────────────── */
#map-canvas { display:block; margin:0 auto; }
.map-legend { display:flex; justify-content:center; gap:18px; padding:8px 16px 4px; font-size:12px; color:#604263; }
.floor-section { padding:0 10px 16px; }
.floor-section .sec-title { padding:8px 0 8px; }

/* ── BOTTOM NAV ────────────────────────── */
/* Нижняя навигация «Пепельного края»: ровная тёмная полоса без рамки,
   приглушённые значки, активная вкладка — золотом на мягкой «таблетке». */
#bottom-nav {
  position:absolute; bottom:0; left:0; right:0; height:var(--nav-h);
  background:#120d10;
  box-shadow:0 -1px 0 #2e2428, 0 -8px 24px rgba(0,0,0,.45);
  z-index:50; display:none;
}
.nav-tabs { display:flex; height:100%; padding:4px 6px 0; box-sizing:border-box; }
.nav-tab  {
  flex:1; display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  cursor:pointer; color:var(--parchment-dim); gap:2px;
  position:relative;
  transition:color 0.18s;
  user-select:none;
}
.nav-tab:active { transform:scale(.96); }
.nav-tab.active { color:var(--gold); }
.nav-tab::before {
  content:""; position:absolute; inset:2px 4px 6px 4px; border-radius:14px;
  background:rgba(226,183,94,.13); box-shadow:inset 0 0 0 1px rgba(226,183,94,.2);
  opacity:0; transform:scale(.85); transition:opacity .2s, transform .2s;
}
.nav-tab.active::before { opacity:1; transform:none; }
.nav-tab .ni, .nav-tab .nl { position:relative; }
.nav-tab .ni { font-size:15.3px; line-height:1; }
.nav-tab .ni svg { width:20px; height:20px; stroke-width:1.8; }
.nav-tab .nl { font-size:9.5px; font-weight:500; letter-spacing:.02em; }

/* ── UPGRADE PANEL ────────────────────── */
.upg-section-hdr {
  font-size:10px; text-transform:uppercase; letter-spacing:1px;
  color:#604263; padding:10px 16px 8px;
  border-top:1px solid #2f2030;
}
.upg-section-hdr span { color:#ebab4b; font-size:12px; text-transform:none; letter-spacing:0; }
.upg-grid {
  display:flex; flex-direction:column; gap:6px;
  padding:0 16px 24px;
}
.upg-row {
  display:flex; align-items:center; gap:10px;
  background:rgba(216,207,190,0.03);
  border:1px solid #332334; border-radius:10px;
  padding:9px 12px;
}
.upg-info { flex:1; min-width:0; }
.upg-label { display:block; font-size:13px; font-weight:600; color:#d8cfbe; }
.upg-meta  { display:block; font-size:10px; color:#604263; margin-top:2px; }
.upg-btn {
  padding:7px 12px; border:none; border-radius:8px;
  background:linear-gradient(135deg,#6f4c72,#b18c42);
  color:#d8cfbe; font-size:12px; font-weight:bold; cursor:pointer;
  white-space:nowrap; flex-shrink:0;
  transition:opacity 0.15s;
  touch-action:manipulation;
}
.upg-btn:active { opacity:0.7; }
.upg-btn.disabled { background:#2f2030; color:#463048; pointer-events:none; }

/* Reset-upgrades button — deliberately quieter than .upg-btn: it undoes
   progress and costs Liberty, so it shouldn't compete with the buy buttons. */
.upg-reset-btn {
  width:100%; padding:11px; border:1px solid rgba(229,170,82,0.35);
  border-radius:10px; background:rgba(229,170,82,0.07);
  color:#e5aa52; font-size:13px; font-weight:700; cursor:pointer;
  transition:opacity 0.15s; touch-action:manipulation;
}
.upg-reset-btn:active { opacity:0.7; }
.upg-reset-btn.disabled { border-color:#2f2030; background:#201621; color:#553a57; pointer-events:none; }
.upg-reset-hint { margin-top:6px; font-size:11px; color:#755179; text-align:center; }

/* ── SKILL UPGRADE PANEL ────────────────── */
#skill-upgrade-panel {
  display:flex; flex-direction:column; gap:10px;
  padding:12px 14px 28px;
  overflow-y:auto; max-height:calc(100vh - 120px);
}
.skill-upg-header {
  display:flex; justify-content:space-between; align-items:center;
  font-size:11px; color:#605062; padding:0 2px 4px;
  border-bottom:1px solid #2f2030;
}
.skill-upg-header span:first-child { color:#ebab4b; font-size:13px; font-weight:700; }
.skill-upg-hint { font-size:10px; color:#604263; }
.skill-upg-card {
  background:rgba(216,207,190,0.03);
  border:1px solid #332334; border-radius:12px;
  padding:12px 13px 10px;
  display:flex; flex-direction:column; gap:7px;
}
.skill-upg-top { display:flex; align-items:flex-start; gap:11px; }
.skill-upg-icon { flex-shrink:0; padding-top:2px; }
.skill-upg-info { flex:1; min-width:0; }
.skill-upg-name {
  font-size:14px; font-weight:700; color:#e2d7c2;
}
.skill-upg-lvl {
  font-size:11px; font-weight:600; color:#e3941d; margin-left:4px;
}
.skill-upg-desc { font-size:11px; color:#a2803d; margin-top:2px; }
.skill-upg-type { font-size:10px; color:#c19c5d; margin-top:3px; font-weight:600; letter-spacing:0.3px; }
.sk-dots {
  display:flex; gap:4px; flex-wrap:wrap;
}
.sk-dot {
  width:14px; height:6px; border-radius:3px;
  background:#332334; border:1px solid #48314a;
  transition:background 0.2s;
}
.sk-dot.filled {
  background:linear-gradient(90deg,#b18c42,#e3941d);
  border-color:#e3941d44;
}
.sk-bonus-row {
  display:flex; gap:8px; align-items:center; min-height:16px;
}
.sk-bonus-now {
  font-size:11px; font-weight:700; color:#90d653;
  background:rgba(144,214,83,0.1); border-radius:5px;
  padding:1px 6px;
}
.sk-bonus-next {
  font-size:11px; color:#bf9b54;
}
.skill-upg-btn {
  width:100%; padding:9px; border:none; border-radius:9px;
  background:linear-gradient(135deg,#654668,#b18c42);
  color:#d8cfbe; font-size:13px; font-weight:700; cursor:pointer;
  touch-action:manipulation; transition:opacity 0.15s;
}
.skill-upg-btn:active { opacity:0.7; }
.skill-upg-btn.disabled {
  background:#2f2030; color:#463048; pointer-events:none;
}

/* ── Advanced skills ("вторая профессия") — nested inside .skill-upg-card,
   only rendered once that slot is maxed (level 10) ────────────────────── */
.adv-skill-box {
  margin-top:2px; padding:10px 11px 9px;
  background:rgba(245,197,66,0.05);
  border:1px solid rgba(245,197,66,0.25); border-radius:10px;
  display:flex; flex-direction:column; gap:8px;
}
.adv-skill-box.active {
  background:rgba(245,197,66,0.1);
  border-color:rgba(245,197,66,0.5);
}
.adv-skill-hdr {
  display:flex; align-items:center; gap:5px;
  font-size:10px; font-weight:700; color:#f5c542;
  letter-spacing:0.3px; text-transform:uppercase;
}
.adv-skill-active-badge {
  margin-left:auto; font-size:9px; font-weight:700;
  color:#1b161b; background:#f5c542;
  border-radius:5px; padding:1px 6px; text-transform:none;
}
.adv-btn { background:linear-gradient(135deg,#593d5c,#f5c542); color:#1b161b; }

/* ── пятый слот: заимствованная способность (джекпот переработки
   ОРУЖЕЙНОЙ легендарной руны, RUNE_REROLL_BONUS_SKILL_CHANCE) ────────────
   .foreign-skill-card is its own .skill-upg-card, appended after the four
   real slots — never nested inside one of them, since it never occupies
   Q/W/E/R. Only ever drawn once a bonusSkill is actually attached — no
   "book available" state, since acquiring it is never a player choice. */
.foreign-skill-card {
  border-color: rgba(192,132,252,0.3);
  background: rgba(192,132,252,0.04);
}
.foreign-btn { background: linear-gradient(135deg,#6b3fa0,#c084fc); color: #1a1024; }
.sk-foreign-note {
  margin-top: 2px; font-size: 10px; line-height: 1.4; color: #8a7fa3;
}

/* ── GRAM Wallet (Profile tab) ──────────────────────────────── */
.gram-balance-card {
  position: relative;
  background: linear-gradient(135deg, #1d141e, #342436);
  border: 1px solid rgba(236,187,103,0.2);
  border-radius: 18px;
  padding: 20px 20px 22px;
  text-align: center;
  margin-bottom: 14px;
  overflow: hidden;
}
/* A soft bloom behind the mark, so the card reads as the one thing on the tab
   worth looking at first. Pointer-events off — it covers the whole card. */
.gram-balance-card::before {
  content: '';
  position: absolute; inset: -40% 20% auto 20%; height: 120px;
  background: radial-gradient(ellipse at center, rgba(223,169,62,.22), transparent 70%);
  pointer-events: none;
}
.gram-balance-chip {
  position: relative;
  width: 46px; height: 46px; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(223,169,62,0.12);
  border: 1px solid rgba(223,169,62,0.28);
}
.gram-balance-label {
  font-size: 12px;
  color: #a4823e;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.gram-balance-amount {
  position: relative;
  font-size: 34px;
  font-weight: 800;
  color: #d8cfbe;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.gram-bal-whole { color: #f5dbae; }
/* Seven decimals of GRAM is real money (per-kill drops are tiny) and is never
   dropped — it is just made quiet, so the eye lands on the whole number. */
.gram-bal-frac { font-size: 19px; font-weight: 700; color: #96876c; }
.gram-unit {
  font-size: 16px;
  font-weight: 600;
  color: #eab559;
  vertical-align: middle;
}
.gram-section {
  background: rgba(216,207,190,0.03);
  border: 1px solid rgba(216,207,190,0.07);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.gram-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #f4d7a7;
  margin-bottom: 12px;
}
.lang-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.lang-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(216,207,190,0.1);
  background: rgba(216,207,190,0.03);
  color: #d8cfbe;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  position: relative;
}
.lang-card.active { border-color: #90d653; background: rgba(144,214,83,0.1); color: #90d653; }
.lang-card-flag { font-size: 20px; line-height: 1; }
.lang-card-name { flex: 1; text-align: left; }
.lang-card-check { color: #90d653; font-weight: 700; }

/* First-launch language prompt — see index.html for when this shows */
#first-lang-select {
  position: absolute; inset: 0; z-index: 150;
  background: radial-gradient(ellipse at 50% 20%,#231824 0%,#100b11 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 18px;
}
.fls-card {
  width: 100%; max-width: 360px;
  background: rgba(216,207,190,0.04);
  border: 1px solid rgba(216,207,190,0.12);
  border-radius: 16px;
  padding: 22px 18px;
}
.fls-title {
  font-size: 15px; font-weight: 700; color: #f4d7a7;
  text-align: center; margin-bottom: 16px;
}
.gram-input {
  flex: 1;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(216,207,190,0.1);
  border-radius: 10px;
  padding: 10px 13px;
  color: #f4d9aa;
  font-size: 14px;
  outline: none;
  -webkit-appearance: none;
}
.gram-input:focus { border-color: rgba(234,181,89,0.5); }
.gram-input-addr { font-size: 12px; font-family: monospace; letter-spacing: 0.3px; }
.gram-btn {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  transition: opacity 0.15s;
}
.gram-btn:active { opacity: 0.7; }
/* Anything full-width in a sheet is a primary action and gets a real
   target: these were 41px. */
.gram-dep-panel .gram-btn { min-height: 46px; }
.gram-dep-again { min-height: 40px; }
.gram-btn-green {
  background: linear-gradient(135deg, #29361e, #486133);
  color: #90d653;
}
.gram-btn-orange {
  background: linear-gradient(135deg, #2a1d2b, #4a334c);
  color: #e5a546;
}
.gram-hint {
  font-size: 11px;
  color: #5c3f5f;
  margin-top: 8px;
}
.gram-msg {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-top: 6px;
}
.gram-msg-err { background: rgba(189,51,67,0.15); color: #f17e8b; border: 1px solid rgba(189,51,67,0.3); }
.gram-msg-ok  { background: rgba(116,178,62,0.12);  color: #98e456; border: 1px solid rgba(116,178,62,0.3); }

/* ── GRAM tx history & modals ───────────────────────────── */
.gram-tx-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid rgba(216,207,190,0.05);
}
.gram-tx-row:last-child { border-bottom: none; }
.gram-tx-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; flex-shrink: 0;
}
.gram-tx-dep { color: #90d653; background: rgba(144,214,83,0.12); }
.gram-tx-wd  { color: #e5a546; background: rgba(229,165,70,0.12); }
/* min-width:0 is load-bearing: a flex child defaults to min-width:auto, so the
   date+code line refuses to shrink below its text and shoves the amount out of
   the row entirely. The code is the part that gives — the amount and its
   status are what the row is for. */
.gram-tx-info { flex: 1; min-width: 0; }
.gram-tx-type { font-size: 13px; font-weight: 600; color: #f5dbae; }
.gram-tx-date {
  font-size: 11px; color: #6f4c72; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gram-tx-amount { font-size: 13px; font-weight: 700; }
.gram-tx-status { font-size: 10px; margin-top: 3px; font-weight: 600; }
/* Per-row status, ported from the Rewardix wallet's rowStatus. The row is
   tinted as a whole rather than labelled in one corner, so a list of six can
   be read without reading it. .gram-tx-dim is the case the old two-way test
   had no answer for: an intent that expired, or a withdrawal that was
   forfeited, both used to render identically to one still being processed. */
.gram-tx-right { text-align: right; flex-shrink: 0; white-space: nowrap; }
.gram-tx-icon svg { display: block; }
.gram-tx-dim { opacity: .5; }
.gram-tx-ok .gram-tx-icon.gram-tx-dep { background: rgba(144,214,83,0.16); }
.gram-st-ok   { color: #90d653; }
.gram-st-no   { color: #e46070; }
.gram-st-wait { color: #e5a546; }
.gram-st-dim  { color: #7c7364; }
.gram-copy-box {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(0,0,0,0.5); border: 1px solid rgba(216,207,190,0.1);
  border-radius: 10px; padding: 10px 14px; cursor: pointer;
  word-break: break-all; gap: 8px;
  font-size: 12px; color: #d2c1a4; font-family: monospace;
  transition: border-color 0.15s;
}
.gram-copy-box:active { border-color: rgba(199,166,124,0.4); }
.gram-copy-icon { color: #eab559; flex-shrink: 0; font-size: 16px; }
.gram-warn {
  background: rgba(216,139,24,0.1); border: 1px solid rgba(216,139,24,0.25);
  border-radius: 8px; padding: 8px 12px; font-size: 12px;
  color: #bf9b54; margin-top: 10px;
}

/* ── GRAM wallet: actions, wallet card, credited moment ──────────────────── */
.gram-actions { display: flex; gap: 10px; margin-bottom: 14px; }
.gram-action {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 10px; border-radius: 13px; border: 1px solid transparent;
  font-size: 13px; font-weight: 700; cursor: pointer;
  touch-action: manipulation; transition: filter .15s, border-color .15s;
}
.gram-action:active { filter: brightness(1.25); }
.gram-action-ico { display: flex; align-items: center; }
.gram-action-dep {
  background: linear-gradient(135deg, #29361e, #486133);
  border-color: rgba(144,214,83,0.3); color: #90d653;
}
.gram-action-wd {
  background: linear-gradient(135deg, #342206, #5f3d0b);
  border-color: rgba(229,165,70,0.28); color: #e5a546;
}

.gram-wallet-card {
  background: rgba(209,204,197,0.035);
  border: 1px solid rgba(209,204,197,0.1);
  border-radius: 14px;
  padding: 14px;
}
.gram-wallet-card-off { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.gram-wallet-head { display: flex; align-items: center; gap: 11px; }
.gram-wallet-head-txt { min-width: 0; flex: 1; }
.gram-wallet-chip {
  width: 38px; height: 38px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(209,204,197,0.07); color: #a3957c;
}
.gram-wallet-chip-on {
  background: rgba(144,214,83,0.13); color: #90d653;
  border: 1px solid rgba(144,214,83,0.28);
}
.gram-wallet-status { font-size: 13px; font-weight: 700; color: #90d653; }
.gram-wallet-short {
  font-size: 12px; color: #a3957c; font-family: monospace;
  margin-top: 2px; letter-spacing: .2px;
}
.gram-wallet-off-txt { flex: 1; min-width: 140px; font-size: 12px; color: #b2a288; line-height: 1.45; }
.gram-wallet-addr { margin-top: 12px; }

.gram-connect-btn {
  width: 100%; padding: 12px; border-radius: 11px;
  background: rgba(223,169,62,0.12); border: 1px solid rgba(223,169,62,0.35);
  color: #ecce91; font-size: 13px; font-weight: 700;
  cursor: pointer; touch-action: manipulation;
}
.gram-connect-btn:active { background: rgba(223,169,62,0.2); }

/* «Отвязать». A real bordered control, not the underlined word it used to be:
   unbinding a wallet is a deliberate, irreversible-feeling action and it has
   to look like a button you decide to press, while staying visibly quieter
   than the two things above it that move money.

   Word only — the broken-chain glyph is gone (see _gramIconUnlink's epitaph in
   js/ui.js). With nothing beside it the label has to hold the button on its
   own, so it is centred, tracked out slightly and given the same 12px of
   breathing room top and bottom that the two action buttons have. */
.gram-unlink-btn {
  width: 100%; margin-top: 12px; padding: 12px;
  display: block; text-align: center;
  border-radius: 11px; cursor: pointer; touch-action: manipulation;
  background: rgba(238,102,118,0.06);
  border: 1px solid rgba(238,102,118,0.28);
  color: #ee8b97; font-size: 13px; font-weight: 600; letter-spacing: .3px;
  font-family: inherit;
  transition: background .15s;
}
.gram-unlink-btn:active { background: rgba(238,102,118,0.16); }

/* Copy rows — label above, value on its own line so a 48-character address can
   wrap without shoving the copy control off the row. */
.gram-copy-row { margin-bottom: 10px; }
.gram-copy-row-lbl {
  font-size: 10px; letter-spacing: .8px; text-transform: uppercase;
  color: #82745b; margin-bottom: 5px;
}
.gram-copy-row-body {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,0.42);
  border: 1px solid rgba(209,204,197,0.1);
  border-radius: 11px; padding: 10px 10px 10px 13px;
}
.gram-copy-row-val {
  flex: 1; min-width: 0; word-break: break-all;
  font-family: monospace; font-size: 12.5px; line-height: 1.45;
  color: #d2c1a4; transition: color .2s;
}
.gram-copy-chip {
  flex-shrink: 0; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; cursor: pointer; touch-action: manipulation;
  background: rgba(209,204,197,0.08); border: none; color: #d2c1a4;
}
.gram-copy-chip:active { background: rgba(234,181,89,0.24); color: #f4d9aa; }

/* Deposit sheet */
.gram-sheet {
  width: 100%; max-width: 500px; background: #16120a;
  border-radius: 18px 18px 0 0; border-top: 1px solid rgba(209,204,197,.1);
  padding: 20px 18px 34px; max-height: 88vh; overflow-y: auto;
}
.gram-sheet-hdr { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.gram-sheet-ico {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; border-radius: 9px;
}
.gram-sheet-ico-dep { background: rgba(144,214,83,0.13); color: #90d653; }
.gram-sheet-ico-wd  { background: rgba(229,165,70,0.13); color: #e5a546; }
.gram-sheet-title { flex: 1; font-size: 16px; font-weight: 800; color: #f5dbae; }
.gram-sheet-close {
  position: relative;
  width: 32px; height: 32px; flex-shrink: 0; border: none; border-radius: 50%;
  background: rgba(209,204,197,.08); color: #968a7a; cursor: pointer;
  touch-action: manipulation;
}
/* The circle stays small; the TARGET is 46×46. A thumb is about 45px wide
   and none of these controls were half that. */
.gram-sheet-close::after { content: ''; position: absolute; inset: -7px; }
.gram-sheet-close:active { background: rgba(234,181,89,.22); color: #f4d9aa; }

/* The deposit code's deadline. It was the last line of the sheet in the
   dimmest colour on the panel; it is now a card of its own, directly under
   the code, in the amber this interface uses for «mind this». */
.gram-dep-deadline {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding: 10px 12px;
  background: rgba(229,165,70,0.07);
  border: 1px solid rgba(229,165,70,0.26);
  border-radius: 12px;
}
.gram-dep-deadline:empty { display: none; }
.gram-dep-deadline-ico { flex-shrink: 0; color: #e5a546; }
.gram-dep-deadline-txt { flex: 1; min-width: 0; }
.gram-dep-deadline-main {
  font-size: 13.5px; font-weight: 700; color: #f0c98a;
}
.gram-dep-deadline-left {
  font-size: 11.5px; color: #a3957c; margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
/* Ran out: red-brown rather than amber, and it grows a button. */
.gram-dep-deadline-out {
  align-items: flex-start;
  background: rgba(196,86,72,0.08); border-color: rgba(196,86,72,0.3);
}
.gram-dep-deadline-out .gram-dep-deadline-ico { color: #d9705f; }
.gram-dep-deadline-out .gram-dep-deadline-main { color: #e8a396; }
.gram-dep-deadline-out .gram-dep-deadline-left { line-height: 1.5; }
.gram-dep-refresh {
  margin-top: 9px; width: 100%; min-height: 42px; padding: 10px 14px;
  border: 1px solid rgba(229,165,70,0.4); border-radius: 10px;
  background: rgba(229,165,70,0.12); color: #f0c98a;
  font-size: 13px; font-weight: 700; cursor: pointer; touch-action: manipulation;
}
.gram-dep-refresh:active { background: rgba(229,165,70,0.24); }

.gram-dep-panel {
  background: rgba(209,204,197,0.035);
  border: 1px solid rgba(209,204,197,0.09);
  border-radius: 14px; padding: 18px 16px; margin-top: 10px;
}
.gram-dep-panel-center { text-align: center; }
.gram-dep-panel-sub { font-size: 12px; color: #a3957c; margin-top: 6px; line-height: 1.5; }

/* The waiting state. It says the window can be closed on purpose: the credit
   arrives on a socket push that does not care whether anyone is looking, and a
   player who thinks they must stand here is a player who reads a two-minute
   chain confirmation as a hang. */
.gram-dep-watch {
  display: flex; align-items: flex-start; gap: 11px;
  background: rgba(223,169,62,0.07);
  border: 1px solid rgba(223,169,62,0.2);
  border-radius: 12px; padding: 12px 14px; margin-top: 12px;
}
.gram-dep-watch-title { font-size: 13px; font-weight: 700; color: #ecce91; }
.gram-dep-watch-sub { font-size: 11.5px; color: #a3957c; margin-top: 3px; line-height: 1.45; }

.gram-spinner {
  display: block; width: 26px; height: 26px; margin: 0 auto;
  border-radius: 50%; border: 2.5px solid rgba(209,204,197,.18);
  border-top-color: #eab559; animation: gram-spin .8s linear infinite;
}
.gram-spinner-sm { width: 17px; height: 17px; border-width: 2px; margin: 2px 0 0; flex-shrink: 0; border-top-color: #ecce91; }
@keyframes gram-spin { to { transform: rotate(360deg); } }

/* Signed, not yet credited — the panel between the wallet and the money. It
   is deliberately BLUE and not green: green is what the credited state owns,
   and a player who has just sent real money must not be able to mistake one
   for the other at a glance. Same chip/title/amount rhythm as the success
   panel so the flip from this to that reads as one thing progressing. */
.gram-dep-wait { border-color: rgba(223,169,62,0.24); background: rgba(223,169,62,0.05); }
.gram-wait-chip {
  width: 58px; height: 58px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(223,169,62,0.13); color: #ecce91;
  border: 1px solid rgba(223,169,62,0.3);
}
/* Past GRAM_DEPOSIT_SLOW_MS the panel stops promising "any second now". Amber,
   not red: nothing is wrong, it is late — and the copy says the code stays
   good for days. Red here would send a player looking for someone to blame. */
.gram-dep-wait-slow { border-color: rgba(229,165,70,0.26); background: rgba(229,165,70,0.05); }
.gram-wait-chip-slow {
  background: rgba(229,165,70,0.13); color: #e5a546;
  border-color: rgba(229,165,70,0.32);
}
.gram-dep-sent-amount { font-size: 24px; font-weight: 800; color: #f5dbae; margin-top: 4px; line-height: 1.1; }
.gram-dep-sent-memo {
  font-family: monospace; font-size: 12px; color: #a3957c;
  margin-top: 4px; word-break: break-all;
}

/* The credited moment — the whole point of the redesign. Green, large, and
   carrying the number, because it is the only confirmation there is. */
.gram-dep-ok { border-color: rgba(144,214,83,0.28); background: rgba(144,214,83,0.06); }
.gram-dep-ok-title { font-size: 15px; font-weight: 800; color: #f5dbae; margin-top: 10px; }
.gram-dep-ok-amount { font-size: 26px; font-weight: 800; color: #98e456; margin-top: 4px; line-height: 1.1; }
.gram-dep-ok-hash { font-size: 11px; color: #6c6354; font-family: monospace; margin-top: 8px; word-break: break-all; }
.gram-dep-again {
  width: 100%; margin-top: 10px; padding: 9px; background: none; border: none;
  color: #a3957c; font-size: 12.5px; font-weight: 600; cursor: pointer;
  text-decoration: underline; touch-action: manipulation;
}

.gram-credit-chip {
  width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(144,214,83,0.15); color: #98e456;
  border: 1px solid rgba(144,214,83,0.3);
}
.gram-credit-chip-lg { width: 58px; height: 58px; margin: 0 auto; }

/* In-tab banner: what a player sees when they open the wallet after a deposit
   landed while they were somewhere else. */
.gram-credit-card {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(144,214,83,0.14), rgba(144,214,83,0.05));
  border: 1px solid rgba(144,214,83,0.32);
  border-radius: 15px; padding: 14px; margin-bottom: 14px;
  animation: gram-credit-in .32s ease-out;
}
.gram-credit-txt { flex: 1; min-width: 0; }
.gram-credit-title { font-size: 12px; font-weight: 700; color: #b7d69a; letter-spacing: .2px; }
.gram-credit-amount { font-size: 22px; font-weight: 800; color: #98e456; line-height: 1.15; margin-top: 1px; word-break: break-all; }
.gram-credit-sub { font-size: 11.5px; color: #a3957c; margin-top: 2px; }
.gram-credit-card { cursor: pointer; }
.gram-credit-close {
  position: relative; flex-shrink: 0; align-self: flex-start;
  width: 30px; height: 30px; border: none; border-radius: 50%;
  background: rgba(0,0,0,0.3); color: #b7a98c; cursor: pointer; font-size: 13px;
  touch-action: manipulation;
}
.gram-credit-close::after { content: ''; position: absolute; inset: -8px; }
.gram-credit-close:active { background: rgba(234,181,89,.24); color: #f4d9aa; }
.gram-credit-mark { flex-shrink: 0; opacity: .85; }
/* The toast's own cross. Same target, on a card that is floating over the
   world and had no way off the screen but waiting eight seconds. */
.gram-credit-x {
  position: relative; flex-shrink: 0; align-self: center;
  width: 30px; height: 30px; border: none; border-radius: 50%;
  background: rgba(0,0,0,0.34); color: #b7a98c; cursor: pointer; font-size: 13px;
  touch-action: manipulation;
}
.gram-credit-x::after { content: ''; position: absolute; inset: -8px; }
.gram-credit-x:active { background: rgba(234,181,89,.24); color: #f4d9aa; }

/* Floating confirmation, for a credit that lands while the player is in the
   world. z-index sits above the panels (400) and below nothing that matters —
   this is the one message in the tab that must never be missed. */
.gram-credit-toast {
  position: fixed; top: 74px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: 88vw;
  background: rgba(22,18,10,.97);
  border: 1px solid rgba(144,214,83,0.45);
  border-radius: 15px; padding: 12px 15px;
  box-shadow: 0 6px 26px rgba(0,0,0,.6);
  z-index: 500; cursor: pointer;
  /* Its own keyframes, not the card's: this one is centred with
     translateX(-50%), and an animation that sets transform: translateY() would
     drop that and slam the toast to the left edge for its first frames. */
  animation: gram-credit-toast-in .32s ease-out;
}
@keyframes gram-credit-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes gram-credit-toast-in {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Airdrop promo — a real card with the artwork, no longer a parachute emoji.
   images/airdrop.png is a 192px cut; 60px here keeps it inside the 2x budget
   the coordinator sized it for. */
.gram-airdrop-card {
  display: flex; align-items: center; gap: 13px;
  background: linear-gradient(135deg, rgba(230,148,25,0.14), rgba(230,148,25,0.04));
  border: 1px solid rgba(230,148,25,0.28);
  border-radius: 15px; padding: 12px 14px; margin-bottom: 14px;
}
.gram-airdrop-img { width: 60px; height: 60px; flex-shrink: 0; object-fit: contain; }
.gram-airdrop-txt { min-width: 0; }
.gram-airdrop-title {
  font-size: 15px; font-weight: 800; color: #e6ac19;
  letter-spacing: .03em; display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.gram-airdrop-soon {
  font-size: 9px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: #1a1a1a; background: #e6ac19; border-radius: 5px; padding: 2px 6px;
}
.gram-airdrop-sub { font-size: 11.5px; color: #b2a288; margin-top: 3px; line-height: 1.45; }

/* ── Profile tabs ─────────────────────────────────────────────────────────── */
.profile-tabs {
  display: flex;
  gap: 0;
  background: rgba(0,0,0,.18);
  border-bottom: 1px solid rgba(216,207,190,.07);
  flex-shrink: 0;
}
.profile-tab {
  flex: 1;
  background: none;
  border: none;
  color: #b7a683;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.profile-tab.active {
  color: #eec379;
  border-bottom-color: #eec379;
}

/* ── Friends tab ──────────────────────────────────────────────────────────── */
.ref-card {
  background: rgba(238,195,121,.08);
  border: 1px solid rgba(238,195,121,.18);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}
.ref-card-title { font-size: 11px; color: #b7a683; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.ref-link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,.25);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: #f4daac;
  word-break: break-all;
}
.ref-copy-btn {
  background: rgba(238,195,121,.18);
  border: none;
  border-radius: 6px;
  color: #eec379;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}
.ref-copy-btn:active { background: rgba(238,195,121,.35); }
.ref-stats-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.ref-stat-box {
  flex: 1;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(216,207,190,.07);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.ref-stat-num { font-size: 22px; font-weight: 700; color: #eec379; }
.ref-stat-lbl { font-size: 11px; color: #b7a683; margin-top: 2px; }
.ref-friend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(216,207,190,.05);
}
.ref-friend-row:last-child { border-bottom: none; }
.ref-friend-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg,#714e74,#553a57);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #eec379; flex-shrink: 0;
}
.ref-friend-name { flex: 1; font-size: 14px; color: #f5dbae; }
.ref-friend-bonus { font-size: 12px; color: #89ba5f; font-weight: 600; }
.ref-friend-lvl {
  font-size: 11px; font-weight: 700; color: #f3cf72; white-space: nowrap;
  padding: 2px 7px; border-radius: 8px; border: 1px solid rgba(243,207,114,.45); background: rgba(243,207,114,.08);
}
.ref-empty { text-align: center; padding: 30px 0; color: #a2803d; font-size: 13px; }

.pvp-hist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(216,207,190,.05);
}
.pvp-hist-row:last-child { border-bottom: none; }
.pvp-hist-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(216,207,190,.06);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.pvp-hist-info { flex: 1; min-width: 0; }
.pvp-hist-text { font-size: 14px; font-weight: 600; }
.pvp-hist-meta { font-size: 11px; color: #a2803d; margin-top: 2px; }
.pvp-hist-kill { color: #89ba5f; }
.pvp-hist-death { color: #ee6676; }
.pvp-hist-win { color: #e6ac19; }
.pvp-hist-lose { color: #a3957c; }

/* ── Tournament button — solid gold pill inline in the player plate's own
   name row, right-aligned (see _positionTournamentBtn, js/ui.js). Not a
   column entry and not a bare corner badge: a live daily event gets a
   legible label, the one clearly-different-colour thing on the plate. ── */
#tournament-hud-btn {
  position: absolute;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 7px;
  background: linear-gradient(180deg, #ffd54a, #f0b400);
  border: 1px solid #a97600;
  color: #241a03;
  font-family: system-ui, -apple-system, sans-serif;
  font-weight: 800;
  letter-spacing: .2px;
  white-space: nowrap;
  cursor: pointer;
  z-index: 53;
  box-shadow: 0 2px 6px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.55);
}
#tournament-hud-btn:active { background: linear-gradient(180deg, #f0b400, #d99e00); }

/* ── HUD menu toggle — folds the Рейтинг/VIP/.../Кодекс column away ────────── */
#hud-menu-btn {
  position: absolute;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  background: rgba(18,12,18,.90);
  border: 1px solid rgba(216,207,190,.08);
  border-left: 3px solid #bf9b54;
  border-radius: 6px;
  color: #cfc4ad;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .4px;
  cursor: pointer;
  z-index: 51;
  box-shadow: 0 2px 12px rgba(0,0,0,.55), inset 0 1px 0 rgba(216,207,190,.04);
}
#hud-menu-btn:active { background: rgba(37,25,38,.96); }
#hud-menu-btn.expanded { border-left-color: #ebaa49; color: #e5a546; }
.hud-menu-icon { transition: transform .18s ease; }
#hud-menu-btn.expanded .hud-menu-icon { transform: rotate(90deg); }

/* ── Rating button ────────────────────────────────────────────────────────── */
#rating-btn {
  position: absolute;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  background: rgba(18,12,18,.90);
  border: 1px solid rgba(216,207,190,.08);
  border-left: 3px solid #d18717;
  border-radius: 6px;
  color: #e5a546;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .4px;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0,0,0,.55), inset 0 1px 0 rgba(216,207,190,.04);
}
#rating-btn:active { background: rgba(37,25,38,.96); border-left-color: #ebaa49; }

/* ── Rating panel overlay ─────────────────────────────────────────────────── */
#rating-panel {
  position: absolute;
  inset: 0;
  z-index: 120;
  background: rgba(15,11,16,.97);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.rating-header {
  display: flex;
  align-items: center;
  padding: 14px 16px 0;
  flex-shrink: 0;
}
.rating-title {
  flex: 1;
  font-size: 16px;
  font-weight: 800;
  color: #ebaa49;
}
.rating-close {
  background: rgba(216,207,190,.08);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  color: #bf9b54;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rating-tabs {
  display: flex;
  gap: 0;
  margin: 12px 16px 0;
  background: rgba(0,0,0,.3);
  border-radius: 10px;
  padding: 3px;
  flex-shrink: 0;
}
.rating-tab {
  flex: 1;
  background: none;
  border: none;
  color: #b7a683;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.rating-tab.active {
  background: rgba(235,170,73,.15);
  color: #ebaa49;
}
.rating-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 16px 20px;
}
/* Allow touch scroll over all child elements — without this they inherit
   the global touch-action:none reset and silently block scroll gestures. */
#rating-panel, #rating-panel * { touch-action: pan-y; pointer-events: auto; }
.rating-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  background: rgba(216,207,190,.04);
  border: 1px solid rgba(216,207,190,.05);
}
.rating-row.rating-me {
  background: rgba(235,170,73,.08);
  border-color: rgba(235,170,73,.25);
}
.rating-rank {
  font-size: 13px;
  font-weight: 800;
  color: #a2803d;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.rating-rank-1 { color: #e69419; }
.rating-rank-2 { color: #c7bba2; }
.rating-rank-3 { color: #ba9447; }
.rating-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg,#553a57,#453047);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #eec379;
  flex-shrink: 0;
}
.rating-clan-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg,#453047,#302131);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rating-name {
  flex: 1;
  font-size: 14px;
  color: #f5dbae;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rating-sub {
  font-size: 11px;
  color: #bf9b54;
  margin-top: 2px;
}
.rating-bm {
  text-align: right;
  flex-shrink: 0;
}
.rating-bm-val {
  font-size: 14px;
  font-weight: 700;
  color: #ebaa49;
}
.rating-bm-lbl {
  font-size: 10px;
  color: #bf9b54;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.rating-empty {
  text-align: center;
  color: #624365;
  padding: 40px 0;
  font-size: 13px;
}
.rating-loading {
  text-align: center;
  color: #605062;
  padding: 40px 0;
  font-size: 13px;
}

.rating-gap {
  text-align: center;
  color: #523854;
  font-size: 16px;
  letter-spacing: 4px;
  padding: 6px 0;
}

/* ── Турнир panel — same shell as #rating-panel, own id so both can exist ─── */
#tournament-panel {
  position: absolute;
  inset: 0;
  z-index: 120;
  background: rgba(15,11,16,.97);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#tournament-panel, #tournament-panel * { touch-action: pan-y; pointer-events: auto; }

/* ── Турнир · Сетка tab — real bracket columns, one per round, each match
   showing the two actual players (see _tournamentBracketBodyHTML, js/ui.js).
   Only rounds that have actually been dealt appear — a round nobody has
   reached yet has no real pairing to show. Horizontal scroll rather than
   shrinking to fit: ten rounds of real names do not fit one phone width at
   any readable size. ──────────────────────────────────────────────────── */
.tour-cols { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; }
/* Same fix, and same reason, as .market-cat-tabs below: touch-action is
   resolved from the EXACT element a touch starts on, not inherited from a
   scrolling ancestor. A swipe on this strip almost always starts on a
   .tour-match card (they fill the whole column), not on the bare .tour-cols
   flex container — so the first attempt at this fix, which only overrode
   .tour-cols itself, left every card underneath it at the blanket
   touch-action:pan-y from #tournament-panel's rule above, and horizontal
   swipe stayed dead. The override has to cover the actual touch targets. */
#tournament-panel .tour-cols,
#tournament-panel .tour-cols * { touch-action: pan-x pan-y; }
.tour-col { flex: 0 0 138px; display: flex; flex-direction: column; gap: 8px; }
.tour-col-hd {
  font-size: 12px; font-weight: 800; color: #bf9b54; text-align: center;
  padding-bottom: 4px; border-bottom: 1px solid rgba(216,207,190,.12);
}
.tour-col.live .tour-col-hd { color: #ffb020; border-bottom-color: rgba(255,176,32,.35); }
.tour-match {
  display: flex; flex-direction: column; gap: 3px; padding: 8px 9px;
  border-radius: 10px; background: rgba(216,207,190,.04);
  border: 1px solid rgba(216,207,190,.05);
}
.tour-tag {
  display: inline-flex; align-items: center; width: fit-content;
  font-size: 9.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px;
  margin-bottom: 2px;
}
.tour-tag-ub { background: rgba(230,190,109,.14); color: #e6be6d; }
.tour-tag-lb { background: rgba(255,146,87,.14); color: #ff9257; }
.tour-tag-gf { background: rgba(255,176,32,.16); color: #ffb020; }
.tour-side {
  font-size: 12.5px; color: #d1c6af; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.tour-side.win { color: #f5dbae; font-weight: 700; }
.tour-side.lose { color: #5b6472; text-decoration: line-through; }
.tour-vs { font-size: 9px; color: #5b475d; text-align: center; text-transform: uppercase; letter-spacing: .06em; }

/* ── VIP button ───────────────────────────────────────────────────────────── */
#vip-btn {
  position: absolute;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  background: rgba(18,12,18,.90);
  border: 1px solid rgba(216,207,190,.08);
  border-left: 3px solid #d0a24c;
  border-radius: 6px;
  color: #e8c481;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .4px;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0,0,0,.55), inset 0 1px 0 rgba(216,207,190,.04);
}
#vip-btn:active { background: rgba(37,25,38,.96); border-left-color: #eac47e; }

/* ── VIP panel overlay ────────────────────────────────────────────────────── */
#vip-panel {
  position: absolute;
  inset: 0;
  z-index: 120;
  background: rgba(15,11,16,.97);
  overflow: hidden;
}
.vip-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: rgba(15,11,16,.97);
  z-index: 1;
}
.vip-title {
  flex: 1;
  font-size: 16px;
  font-weight: 800;
  color: #eac47e;
}
.vip-close {
  background: rgba(216,207,190,.08);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  color: #bf9b54;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vip-body {
  position: absolute;
  top: 50px; left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 16px 24px;
}
/* Allow touch scroll over all child elements (including images) */
#vip-panel, #vip-panel * { touch-action: pan-y; pointer-events: auto; }
.vip-level-badge {
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(135deg, #eac47e, #e69419);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}
.vip-progress-wrap { margin-bottom: 14px; }
.vip-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #b7a683;
  margin-bottom: 5px;
}
.vip-progress-bar {
  height: 6px;
  background: rgba(216,207,190,.08);
  border-radius: 3px;
  overflow: hidden;
}
.vip-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #be9a51, #eac47e);
  border-radius: 3px;
  transition: width .4s ease;
}
.vip-max-badge {
  text-align: center;
  font-size: 13px;
  color: #e69419;
  font-weight: 700;
  padding: 8px 0 14px;
}
.vip-bonuses {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.vip-bonus-item {
  flex: 1;
  min-width: 80px;
  background: rgba(229,182,94,.1);
  border: 1px solid rgba(229,182,94,.2);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #eac47e;
}
.vip-bonus-dim {
  color: #4f4250;
  background: rgba(216,207,190,.03);
  border-color: rgba(216,207,190,.06);
}
.vip-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #a2803d;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
}
.vip-levels { display: flex; flex-direction: column; gap: 8px; }
.vip-card {
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(216,207,190,.06);
  background: rgba(216,207,190,.03);
}
.vip-card-done {
  border-color: rgba(229,182,94,.2);
  background: rgba(229,182,94,.06);
}
.vip-card-pending {
  border-color: rgba(235,170,73,.35);
  background: rgba(235,170,73,.08);
  animation: vip-pulse 2s ease-in-out infinite;
}
.vip-card-locked { opacity: .5; }
@keyframes vip-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(235,170,73,0); }
  50%      { box-shadow: 0 0 8px 2px rgba(235,170,73,.2); }
}
.vip-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.vip-card-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(229,182,94,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #eac47e;
  flex-shrink: 0;
  text-align: center;
  line-height: 24px;
}
.vip-card-title { font-size: 13px; font-weight: 800; color: #eece94; flex: 1; }
.vip-card-gram  { font-size: 11px; font-weight: 700; color: #bf9b54; }
.vip-card-bonuses {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}
.vip-card-bonuses span {
  font-size: 11px;
  background: rgba(229,182,94,.1);
  border-radius: 5px;
  padding: 2px 7px;
  color: #eac47e;
}
.vip-items-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.vip-ri {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: rgba(216,207,190,.05);
  border: 1px solid rgba(216,207,190,.1);
  border-radius: 8px;
  padding: 6px 7px 5px;
  min-width: 44px;
}
.vip-ri-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
}
.vip-ri-label {
  font-size: 9px;
  color: #bcac8b;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1;
}
.vip-ri-uncommon { border-color: rgba(144,214,83,.35);  background: rgba(144,214,83,.07);  }
.vip-ri-rare     { border-color: rgba(227,181,90,.35);  background: rgba(227,181,90,.07);  }
/* #8a5cc2 — RARITY_COLOR.epic (js/definitions.js), not the gold this used
   to share with the VIP panel's own accent: an epic pet/wings/rune/weapon
   reads purple everywhere else in the game, and a shop card is not the
   place to teach players a second color for the same rarity. Currency/
   bonus reward rows (bonusSP, nexum, skill books, gold) moved to the
   dedicated 'gold' class instead of leaning on this one — see
   _shopExtraRewardRows/_gramShopPkgHtml, js/ui.js. */
.vip-ri-epic     { border-color: rgba(138,92,194,.4);   background: rgba(138,92,194,.08);   }
.vip-ri-legendary{ border-color: rgba(230,148,25,.4);    background: rgba(230,148,25,.08);   }
.vip-ri-gold     { border-color: rgba(230,148,25,.35);   background: rgba(230,148,25,.07);   }
.vip-claim-btn {
  width: 100%;
  padding: 9px 0;
  background: linear-gradient(135deg, #be9a51, #d9b36a);
  border: none;
  border-radius: 8px;
  color: #d8cfbe;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: .3px;
  margin-top: 4px;
}
.vip-claim-btn:active { opacity: .85; }

/* ── Market button ────────────────────────────────────────────────────────── */
#market-btn {
  position: absolute;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  background: rgba(18,12,18,.90);
  border: 1px solid rgba(216,207,190,.08);
  border-left: 3px solid #598f2a;
  border-radius: 6px;
  color: #8fc95c;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .4px;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0,0,0,.55), inset 0 1px 0 rgba(216,207,190,.04);
}
#market-btn:active { background: rgba(37,25,38,.96); border-left-color: #8fc95c; }

/* ── Market panel overlay (reuses .vip-header / .vip-body / .rating-tab*) ──── */
#market-panel {
  position: absolute;
  inset: 0;
  z-index: 120;
  background: rgba(15,11,16,.97);
  overflow: hidden;
}
#market-panel, #market-panel * { touch-action: pan-y; pointer-events: auto; }
/* Category tab strip scrolls horizontally — the blanket pan-y above blocks
   that gesture on touch devices. A touch on the strip almost always starts
   on one of the tab buttons (they fill nearly the whole row), so the
   override has to cover the buttons themselves too, not just their
   container — touch-action is resolved from the exact element the touch
   started on, not inherited from an ancestor. */
#market-panel .market-cat-tabs,
#market-panel .market-cat-tabs * { touch-action: pan-x; }

.market-add-btn {
  width: 100%;
  padding: 11px 0;
  background: linear-gradient(135deg, #5a8b30, #90d653);
  border: none;
  border-radius: 10px;
  color: #131d0a;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: .2px;
  margin-bottom: 12px;
}
.market-add-btn:active { opacity: .85; }

.market-cat-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(216,207,190,.08);
}
.market-cat-tabs::-webkit-scrollbar { display: none; }
/* A mouse has no flick gesture and no horizontal wheel, and the hidden
   scrollbar above left nothing to grab — so on a PC every category past the
   visible width was unreachable. Give fine-pointer devices a slim scrollbar
   back (the wheel/drag handling that goes with it is in
   _ensureMarketStripScroll, js/ui.js). */
@media (hover: hover) and (pointer: fine) {
  .market-cat-tabs {
    scrollbar-width: thin;
    scrollbar-color: rgba(216,207,190,.22) transparent;
    padding-bottom: 6px;
    cursor: grab;
  }
  .market-cat-tabs:active { cursor: grabbing; }
  .market-cat-tabs::-webkit-scrollbar { display: block; height: 6px; }
  .market-cat-tabs::-webkit-scrollbar-track { background: transparent; }
  .market-cat-tabs::-webkit-scrollbar-thumb {
    background: rgba(216,207,190,.22);
    border-radius: 3px;
  }
  .market-cat-tabs::-webkit-scrollbar-thumb:hover { background: rgba(216,207,190,.35); }
}

/* «Показано перші N лотів» — стоїть НАД пошуком, а не під списком, бо це
   попередження про те, чому пошук і лічильники категорій нижче можуть
   збрехати: вони рахуються по завантаженому шматку ринку. Приглушене й
   некликабельне: це стан, а не дія. Показується тільки коли видача справді
   уперлася в стелю (_renderMarketLots, js/ui.js). */
.market-truncated {
  margin-bottom: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(235,170,73,.22);
  border-radius: 8px;
  background: rgba(235,170,73,.06);
  color: #b2a288;
  font-size: 11.5px;
  text-align: center;
}

/* Search + rarity/sort selects above the category strip. The input takes a
   full row of its own: at 430px the three side by side left it too narrow to
   read a query in. */
.market-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.market-search {
  flex: 1 1 100%;
  min-width: 0;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(216,207,190,.12);
  border-radius: 8px;
  color: #d8cfbe;
  font-family: inherit;
  font-size: 12.5px;
  padding: 8px 10px;
}
.market-search::placeholder { color: #6d4a70; }
.market-search:focus { outline: none; border-color: rgba(235,170,73,.35); }
.market-select {
  flex: 1 1 0;
  min-width: 0;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(216,207,190,.12);
  border-radius: 8px;
  color: #b7a683;
  font-family: inherit;
  font-size: 12px;
  padding: 8px 6px;
  cursor: pointer;
}
.market-cat-tab {
  flex-shrink: 0;
  background: rgba(216,207,190,.05);
  border: 1px solid rgba(216,207,190,.08);
  color: #b7a683;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.market-cat-tab.active {
  background: rgba(235,170,73,.15);
  border-color: rgba(235,170,73,.35);
  color: #ebaa49;
}
.market-cat-count {
  font-weight: 700;
  opacity: .7;
  margin-left: 2px;
}
.market-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  margin-bottom: 6px;
  background: rgba(216,207,190,.04);
  border: 1px solid rgba(216,207,190,.05);
}
.market-row-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: rgba(0,0,0,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.market-row-info { flex: 1; min-width: 0; }
.market-row-name {
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.market-row-sub {
  font-size: 10.5px;
  color: #a3957c;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.market-row-price {
  font-size: 13px;
  font-weight: 800;
  color: #90d653;
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
}
.market-buy-btn {
  margin-top: 4px;
  padding: 5px 12px;
  background: rgba(144,214,83,.15);
  border: 1px solid rgba(144,214,83,.4);
  border-radius: 7px;
  color: #90d653;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.market-buy-btn:active { background: rgba(144,214,83,.3); }
/* Свой лот. Не прячем, а гасим: строка остаётся на своём месте в списке, и
   видно, что это твой товар, а не что он куда-то делся. */
.market-buy-btn.disabled,
.market-buy-btn[disabled] {
  opacity:.42; cursor:default; pointer-events:none;
  border-color:rgba(174,165,153,.25); color:#8d8579;
  background:rgba(174,165,153,.06);
}
.market-cancel-btn {
  margin-top: 4px;
  padding: 5px 12px;
  background: rgba(227,84,101,.12);
  border: 1px solid rgba(227,84,101,.35);
  border-radius: 7px;
  color: #ee6676;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.market-cancel-btn:active { background: rgba(227,84,101,.25); }
.market-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.market-share-btn {
  margin-top: 4px;
  padding: 5px 12px;
  background: rgba(226,179,83,.12);
  border: 1px solid rgba(226,179,83,.38);
  border-radius: 7px;
  color: #e6bd6b;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.market-share-btn:active { background: rgba(226,179,83,.25); }
.market-share-btn.disabled { opacity: .45; }
.market-compare-btn {
  margin-top: 4px;
  padding: 5px 12px;
  background: rgba(216,207,190,.08);
  border: 1px solid rgba(216,207,190,.25);
  border-radius: 7px;
  color: #c9bfab;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.market-compare-btn:active { background: rgba(216,207,190,.16); }

.market-hist-status {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  display: inline-block;
}
.market-hist-buy  { background: rgba(234,182,93,.15); color: #eec379; }
.market-hist-sell { background: rgba(144,214,83,.15); color: #90d653; }
.market-hist-cancelled { background: rgba(178,160,125,.15); color: #b7a683; }

/* ── Market: sell picker & buy confirm modals ───────────────────────────────── */
.market-modal-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
}
/* These modals are appended straight to <body>, outside #market-panel, so
   they miss that panel's touch-action override and inherit the global
   touch-action:none reset — which silently blocks scroll gestures. */
.market-modal-overlay, .market-modal-overlay * { touch-action: pan-y; pointer-events: auto; }
.market-modal-sheet {
  width: 100%; max-width: 500px;
  max-height: 82vh;
  background: #181119;
  border-radius: 18px 18px 0 0;
  border-top: 1px solid rgba(216,207,190,.1);
  padding: 18px 16px 28px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Market: item compare modal (two cards — the equipped item vs the lot) ─── */
.compare-grid {
  display: grid;
  /* minmax(0, 1fr), not bare 1fr: a grid item's default min-width is auto,
     i.e. its content's min-content size — so the two cards would size
     unevenly by name length and, when both names were long enough, overflow
     the sheet, clipping the losing card's stat values off the right edge
     of the screen with no scrollbar to reveal them. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
@media (max-width: 420px) {
  .compare-grid { grid-template-columns: 1fr; }
}
.compare-card {
  background: rgba(216,207,190,.04);
  border: 1px solid rgba(216,207,190,.08);
  border-radius: 12px;
  padding: 12px;
}
.compare-card-hdr {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #a3957c;
  margin-bottom: 8px;
}
.compare-card-name {
  font-size: 13px;
  font-weight: 700;
  margin-top: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compare-card-empty {
  font-size: 12px;
  color: #776d5d;
  padding: 10px 0;
  text-align: center;
}
.compare-stat-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  padding: 4px 0;
  border-top: 1px solid rgba(216,207,190,.06);
}
.compare-stat-row:first-of-type { border-top: none; margin-top: 8px; }
.compare-stat-lbl { color: #a3957c; }
/* Base color, overridden by .better/.worse below when there's something to
   diff against (the two-card compare modal). openPeerItemModal — a single
   card, nothing to compare — never adds either class, and neither this rule
   nor any ancestor set a color before this: the value fell through to the
   browser default (black) on the dark sheet, unreadable — "характеристики
   питомца написаны чёрным" (reported on a peer's equipped pet, but this hits
   every stat value shown through this one-card path, pets included only
   because that's the equipment slot that was open when it was noticed). */
.compare-stat-val { font-weight: 700; white-space: nowrap; color: #cfc4ad; }
.compare-stat-val.better { color: #90d653; }
.compare-stat-val.worse  { color: #ee6676; }

/* ── Peer profile / item-detail modal (clicking an equipped item) ──────────── */
.item-detail-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: rgba(216,207,190,.04);
  border-radius: 10px;
  margin-bottom: 14px;
}

/* ── "What's new" login modal — centered dialog, not a bottom sheet ────────── */
.whatsnew-modal-overlay { align-items: center; z-index: 401; }
.whatsnew-modal-sheet {
  width: calc(100% - 32px); max-width: 400px; max-height: 78vh;
  border-radius: 18px;
  border-top: none;
  border: 1px solid rgba(216,207,190,.1);
  padding: 0;
  overflow: hidden;
}
.whatsnew-hero {
  position: relative;
  padding: 30px 24px 4px;
  text-align: center;
  background: radial-gradient(120% 90% at 50% -15%, rgba(139,92,246,.20), transparent 60%);
}
.whatsnew-close {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: rgba(216,207,190,.08); color: #bf9b54; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.whatsnew-badge {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px;
  background: linear-gradient(150deg, rgba(139,92,246,.22), rgba(12,8,12,.55));
  border: 1px solid rgba(139,92,246,.5);
  box-shadow: 0 0 22px rgba(139,92,246,.32), inset 0 1px 0 rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: center;
}
.whatsnew-eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: #a684f2; margin-bottom: 6px;
}
.whatsnew-title {
  font-family: var(--font-display); font-size: 20px; font-weight: 700;
  color: var(--parchment); line-height: 1.3;
}
.whatsnew-body { padding: 14px 22px 22px; }
.whatsnew-desc { font-size: 13px; line-height: 1.65; color: #a3957c; text-align: center; margin-bottom: 20px; }
.whatsnew-cta {
  width: 100%; padding: 13px 0; border: none; border-radius: 11px;
  background: linear-gradient(135deg, #8b5cf6, #c9a6f0);
  color: #160f17; font-size: 14px; font-weight: 800; cursor: pointer;
}
.whatsnew-cta:active { filter: brightness(1.08); }
.whatsnew-cta.ghost { margin-top: 8px; background: rgba(216,207,190,.07); color: #a3957c; border: 1px solid rgba(216,207,190,.12); }
/* Золотой вариант окна — для достижений и турнира. */
.whatsnew-modal-sheet.gold .whatsnew-hero { background: radial-gradient(120% 90% at 50% -15%, rgba(255,190,80,.24), transparent 60%); }
.whatsnew-modal-sheet.gold .whatsnew-badge {
  background: linear-gradient(150deg, rgba(255,190,80,.25), rgba(12,8,12,.55));
  border-color: rgba(255,207,92,.6); box-shadow: 0 0 22px rgba(255,190,80,.4), inset 0 1px 0 rgba(255,255,255,.08);
}
.whatsnew-modal-sheet.gold .whatsnew-eyebrow { color: #e3a53a; }
.whatsnew-modal-sheet.gold .whatsnew-cta:not(.ghost) { background: linear-gradient(135deg, #f0b84a, #ffe08a); }
.whatsnew-chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 14px 0 6px; }
.whatsnew-chips span {
  display: flex; flex-direction: column; align-items: center; min-width: 84px; padding: 7px 10px; border-radius: 12px;
  font-size: 10.5px; color: #a3957c; background: rgba(255,207,92,.07); border: 1px solid rgba(255,207,92,.28);
  animation: achPop .5s cubic-bezier(.2,.9,.3,1.25) both;
}
.whatsnew-chips span:nth-child(2) { animation-delay: .1s; } .whatsnew-chips span:nth-child(3) { animation-delay: .2s; }
.whatsnew-chips b { font-family: var(--font-display); font-size: 19px; line-height: 1.1; color: #ffcf5c; }
.whatsnew-medals { display: flex; justify-content: center; gap: 8px; margin: 14px 0 6px; }
.whatsnew-medals img {
  width: 34px; height: 34px; object-fit: contain; image-rendering: pixelated; padding: 4px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,207,92,.18), rgba(0,0,0,.4) 70%); border: 1px solid rgba(255,207,92,.35);
  animation: achPop .5s cubic-bezier(.2,.9,.3,1.25) both;
}
.whatsnew-medals img:nth-child(2) { animation-delay: .08s; } .whatsnew-medals img:nth-child(3) { animation-delay: .16s; }
.whatsnew-medals img:nth-child(4) { animation-delay: .24s; } .whatsnew-medals img:nth-child(5) { animation-delay: .32s; }

.market-pick-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 12px 0;
}
.market-pick-cell {
  aspect-ratio: 1;
  border-radius: 9px;
  background: rgba(216,207,190,.04);
  border: 1px solid rgba(216,207,190,.08);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative;
}
.market-pick-cell.selected { border-color: #90d653; background: rgba(144,214,83,.12); }

/* ── GRAM Shop ─────────────────────────────────────────────── */
#gram-shop-btn {
  position: absolute;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  background: rgba(18,12,18,.90);
  border: 1px solid rgba(216,207,190,.08);
  border-left: 3px solid #6d4a70;
  border-radius: 6px;
  color: #e9a135;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .4px;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0,0,0,.55), inset 0 1px 0 rgba(216,207,190,.04);
}
#gram-shop-btn:active { background: rgba(37,25,38,.96); border-left-color: #ecae52; }

/* ── Events button (События) ──────────────────────────────── */
#events-btn {
  position: absolute;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  background: rgba(18,12,18,.90);
  border: 1px solid rgba(216,207,190,.08);
  border-left: 3px solid #e14c5d;
  border-radius: 6px;
  color: #f07886;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .4px;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0,0,0,.55), inset 0 1px 0 rgba(216,207,190,.04);
}

#events-panel {
  position: absolute;
  inset: 0;
  z-index: 120;
  background: rgba(15,11,16,.97);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#events-panel, #events-panel * { touch-action: pan-y; pointer-events: auto; }
/* The panel reuses .vip-header/.vip-body, both of which are absolutely
   positioned — so the tab list has to be placed under the 50px header
   explicitly, rather than relying on flex order (which would just put it
   behind the header).
   Two views, toggled by the .events-detail class on #events-panel (see
   openEventDetail/showEventsList, js/ui.js):
     • list (default) — .event-tab-list is the whole panel: one row per
       event, each with its own SVG icon and a tint of that location's
       actual world colour (--cc, set inline per button — race10's is its
       corridor's blood red, coop's its grass green, etc.) via the same
       --cc + color-mix() pattern .profp-card/.profp-banner-icon already use
       for the profession codex. Replaced a plain row of .rating-tab buttons
       (the pattern every other panel with 2-3 tabs uses) that stopped
       fitting once this panel grew to 7 events — labels clipped or wrapped.
     • detail — tapping a row navigates to that event's own page instead of
       swapping content in place under a still-visible tab strip: the list
       hides, the header grows a back arrow and swaps its title/icon to the
       open event's (via the matching #etitle-<tab> span), and .vip-body
       takes the full area below the header. */
.event-tab-list {
  position: absolute;
  top: 54px; left: 16px; right: 16px; bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  z-index: 1;
  padding-bottom: 8px;
}
/* Each card's own themed art (images/events/<key>.jpg — a crop of just the
   hexagon-icon + scene, no text baked in, see the upload that prompted this)
   sits under a left-to-right fade via mask-image on ::before, so real DOM
   text (translatable, i18n'd, reflows with content) always renders on top
   of it rather than the art carrying baked-in copy. --art is set inline per
   button (style="--cc:#4caf6b; --art:url('/images/events/coop.jpg')"),
   same convention --cc already uses for per-tab theming. */
.event-tab-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  flex-shrink: 0;
  min-height: 86px;
  padding: 10px 14px 10px 132px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--cc) 38%, rgba(216,207,190,.12));
  background: #0e0a0f;
  color: #d9d0bf;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.event-tab-item::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 140px;   /* art stays in its own column — never under the title */
  background-image: var(--art);
  background-repeat: no-repeat;
  background-position: left center;
  background-size: cover;
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 55%, transparent 100%);
          mask-image: linear-gradient(to right, #000 0%, #000 55%, transparent 100%);
  z-index: 0;
}
.event-tab-item.active {
  border-color: var(--cc);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cc) 35%, transparent), 0 4px 14px rgba(0,0,0,.4);
}
.event-tab-text { position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.event-tab-label { font-size: 15px; font-weight: 700; color: var(--cc); text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.event-tab-sub { font-size: 11px; font-weight: 500; line-height: 1.35; color: #c9bda5; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.event-tab-sched { display: flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 500; color: #bb9548; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.event-tab-sched svg { flex-shrink: 0; opacity: .85; }
.event-tab-arrow { position: relative; z-index: 1; flex-shrink: 0; color: var(--cc); opacity: .6; }
.event-tab-item.active .event-tab-arrow { opacity: 1; }
/* Cards the player can't use right now fade back so the playable ones lead. */
.event-tab-item.evt-off { opacity: .62; }
.event-tab-item.evt-live, .event-tab-item.evt-mine, .event-tab-item.evt-open { border-color: color-mix(in srgb, var(--cc) 70%, transparent); }

/* List sections: «Доступно сейчас» / «Скоро» / «Пока недоступно». */
.evt-sec-hdr {
  flex-shrink: 0;
  margin: 6px 2px 0;
  font-size: 10.5px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
  color: #9d8c69;
}
.evt-sec-hdr:first-child { margin-top: 0; }
.evt-sec-now { color: #8fd65c; }

/* Status pill — one colour per state, same on the card and on the page. */
.evt-pill {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 1.3;
  background: rgba(125,138,150,.16); color: #cdc4b2;
  border: 1px solid rgba(125,138,150,.3);
  white-space: nowrap;
}
.evt-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.evt-pill-open { background: rgba(143,214,92,.14); color: #a6e57a; border-color: rgba(143,214,92,.4); }
.evt-pill-mine { background: rgba(255,207,138,.14); color: #ffcf8a; border-color: rgba(255,207,138,.45); }
.evt-pill-live { background: rgba(255,107,94,.16); color: #ff8c80; border-color: rgba(255,107,94,.5); }
.evt-pill-live i { animation: evtPulse 1.2s ease-in-out infinite; }
.evt-pill-soon { background: rgba(209,175,106,.13); color: #e6c688; border-color: rgba(209,175,106,.35); }
.evt-pill-off  { background: rgba(125,138,150,.12); color: #8e9aa5; border-color: rgba(125,138,150,.28); }
@keyframes evtPulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .evt-pill-live i { animation: none; } }

/* ── Логово боссов: one card per boss (_lairBossCardsHTML, js/ui.js) ── */
.lair-list { display: flex; flex-direction: column; gap: 8px; }
.lair-boss {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 8px 8px; border-radius: 12px;
  background: color-mix(in srgb, var(--bc) 7%, rgba(0,0,0,.25));
  border: 1px solid color-mix(in srgb, var(--bc) 32%, rgba(216,207,190,.08));
}
.lair-boss.is-locked { opacity: .55; }
.lair-boss.is-fighting { border-color: #ffcf8a; box-shadow: 0 0 0 1px rgba(255,207,138,.35); }
.lair-ico {
  position: relative; flex-shrink: 0;
  width: 60px; height: 60px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--bc) 30%, transparent), rgba(0,0,0,.35) 70%);
  border: 1px solid color-mix(in srgb, var(--bc) 40%, transparent);
  overflow: hidden;
}
.lair-sprite { display: block; background-repeat: no-repeat; image-rendering: pixelated; }
.lair-badge {
  position: absolute; right: 2px; bottom: 2px;
  min-width: 20px; padding: 1px 4px; border-radius: 6px;
  font-size: 10.5px; font-weight: 800; text-align: center;
  color: #1a0c0c; background: #ffcf8a;
}
.lair-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lair-name { font-size: 13.5px; font-weight: 800; color: var(--bc); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.lair-lvl { font-size: 11px; font-weight: 700; color: #d0c1a3; }
.lair-stats { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: #b8a98a; }
.lair-stats b { color: #f0ebe1; }
.lair-rew { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 11.5px; font-weight: 700; color: #ffcf8a; }
.lair-rew-lbl { font-weight: 600; color: #b8a98a; }
.lair-rew-it { display: inline-flex; align-items: center; gap: 2px; }
.lair-rew-it img, .lair-rew-it svg { width: 18px; height: 18px; }
.lair-act { flex-shrink: 0; }
.lair-go {
  padding: 8px 12px; border-radius: 9px;
  border: 1px solid rgba(229,72,77,.55);
  background: linear-gradient(180deg, rgba(229,72,77,.28), rgba(229,72,77,.12));
  color: #ffc2b8; font-size: 12px; font-weight: 800;
  cursor: pointer; touch-action: manipulation; white-space: nowrap;
}
.lair-go:disabled { opacity: .45; cursor: default; }
.lair-lock {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 66px; text-align: center; line-height: 1.2;
  font-size: 10.5px; font-weight: 700; color: #8e9aa5;
}

/* ── Event page (_evtPageHTML, js/ui.js) ── */
.evp { display: flex; flex-direction: column; gap: 12px; }
.evp-hero {
  position: relative;
  min-height: 112px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--cc) 45%, rgba(216,207,190,.12));
  background: #0e0a0f;
  overflow: hidden;
  display: flex; align-items: flex-end;
  padding: 12px 14px 12px 136px;
}
.evp-hero::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 150px;
  background-image: var(--art); background-repeat: no-repeat;
  background-position: left center; background-size: cover;
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 55%, transparent 100%);
          mask-image: linear-gradient(to right, #000 0%, #000 55%, transparent 100%);
}
.evp-hero-text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.evp-title { font-size: 18px; font-weight: 800; color: var(--cc); text-shadow: 0 1px 4px rgba(0,0,0,.7); }
.evp-sub { font-size: 12px; line-height: 1.35; color: #d4c9b4; text-shadow: 0 1px 4px rgba(0,0,0,.7); }
.evp-pill-row { display: flex; justify-content: center; }
.evp-pill-row .evt-pill { align-self: auto; }

.evp-status {
  text-align: center;
  padding: 12px 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--cc) 9%, rgba(0,0,0,.25));
  border: 1px solid color-mix(in srgb, var(--cc) 25%, rgba(216,207,190,.08));
}
.evp-stat-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #b19f7b; }
.evp-stat-value {
  margin-top: 2px;
  font-size: 32px; font-weight: 800; letter-spacing: 1px;
  color: #ffcf8a; font-variant-numeric: tabular-nums;
}
.evp-stat-value.is-text { font-size: 19px; letter-spacing: 0; line-height: 1.3; margin-top: 4px; }
.evp-stat-note { margin-top: 3px; font-size: 12.5px; color: #d0c1a3; }

.evp-action { display: flex; flex-direction: column; gap: 8px; }
.evp-action .coop-grp-box { margin-bottom: 0; }
.evp-sub-hdr { margin-top: 6px; font-size: 11px; font-weight: 700; color: #b19f7b; letter-spacing: .05em; text-transform: uppercase; }
.evp-action .coop-open-list { margin-top: 0; }
.evp-hint {
  font-size: 12px; line-height: 1.45; color: #d0c1a3;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(209,175,106,.08); border: 1px solid rgba(209,175,106,.2);
}

.evp-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.evp-fact {
  min-width: 0;
  padding: 8px 10px; border-radius: 10px;
  background: rgba(216,207,190,.04); border: 1px solid rgba(216,207,190,.09);
}
.evp-fact-k { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #9d8c69; }
.evp-fact-v { margin-top: 2px; font-size: 13px; font-weight: 700; color: #f0ebe1; line-height: 1.3; overflow-wrap: anywhere; }

.evp-section { margin-top: 4px; }
.evp-sec-hdr { font-size: 13px; font-weight: 800; color: #ffcf8a; margin-bottom: 8px; }
.evp-section .db-rewards { margin-bottom: 0; }
.evp-steps { margin: 0; padding: 0; list-style: none; counter-reset: evp; display: flex; flex-direction: column; gap: 7px; }
.evp-steps li {
  counter-increment: evp;
  position: relative;
  padding-left: 28px;
  font-size: 12.5px; line-height: 1.45; color: #d1c6af;
}
.evp-steps li::before {
  content: counter(evp);
  position: absolute; left: 0; top: 0;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  color: var(--cc); background: color-mix(in srgb, var(--cc) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--cc) 40%, transparent);
}

.vip-back {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  margin-right: 8px;
  background: rgba(216,207,190,.08);
  border: none;
  border-radius: 50%;
  color: #bf9b54;
  cursor: pointer;
}
#events-panel.events-detail .vip-back { display: flex; }
#events-panel.events-detail .event-tab-list { display: none; }
#events-panel:not(.events-detail) .vip-body { display: none; }
#events-panel.events-detail .vip-body { display: block; top: 50px; }

#gram-shop-panel {
  position: absolute;
  inset: 0;
  z-index: 120;
  background: rgba(15,11,16,.97);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#gram-shop-panel, #gram-shop-panel * { touch-action: pan-y; pointer-events: auto; }

#gram-shop-body {
  position: absolute;
  top: 50px;
  bottom: 0;
  left: 0;
  right: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px 20px;
}

.gram-shop-card {
  background: rgba(230,148,25,0.04);
  border: 1px solid rgba(230,148,25,0.15);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.gram-shop-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.gram-shop-title {
  font-size: 14px;
  font-weight: 800;
}
.gram-shop-price {
  font-size: 11px;
  color: #a3957c;
  margin-top: 2px;
  font-weight: 600;
}
.gram-shop-buy-btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.gram-shop-buy-btn.disabled {
  opacity: 0.4;
  cursor: default;
}

/* ── DEATH BATTLE (Битва на смерть) ───────────────────── */
/* Lives inside the Events panel now; only the shared bits below are left.
   Battle registration being open highlights the Events button itself. */
/* ── Season button (Сезон) ─────────────────────────────────── */
#season-btn {
  position: absolute;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  background: rgba(18,12,18,.90);
  border: 1px solid rgba(216,207,190,.08);
  border-left: 3px solid #50af95;
  border-radius: 6px;
  color: #7ee0c0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .4px;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0,0,0,.55), inset 0 1px 0 rgba(216,207,190,.04);
}
#season-btn:active { background: rgba(16,35,28,.96); border-left-color: #7ee0c0; }

/* Season panel — same overlay geometry as the events panel it sits under. */
#season-panel {
  position: absolute;
  inset: 0;
  z-index: 120;
  background: rgba(15,11,16,.97);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#season-panel, #season-panel * { touch-action: pan-y; pointer-events: auto; }
/* Same reasoning as #season-panel above. */
#gram-shop-panel .rating-tabs {
  position: absolute;
  top: 54px; left: 16px; right: 16px;
  margin: 0;
  z-index: 1;
}
#gram-shop-panel .vip-body { top: 100px; }
/* Season panel's own 3-way tab strip (Сезон / Задания / Рейтинг) — same
   "tabs float over the header, body pushed below" geometry as the gram shop
   above, just with 3 buttons instead of 2. */
#season-panel .rating-tabs {
  position: absolute;
  top: 54px; left: 16px; right: 16px;
  margin: 0;
  z-index: 1;
}
#season-panel .vip-body { top: 100px; }

/* "Сезон" tab: description + rewards, framed like the old victory-card
   parchment (.db-win-panel) but sized to sit inline in the scroll body. */
.season-card {
  position: relative;
  margin: 8px auto 0;
  max-width: 320px;
  background:
    radial-gradient(ellipse 200px 140px at 50% -10%, rgba(255,180,84,0.16), transparent 65%),
    linear-gradient(175deg, var(--leather-hi), var(--leather-lo) 85%);
  border: 1px solid var(--gold-dim);
  border-radius: 2px;
  padding: 26px 20px 22px;
  text-align: center;
  box-shadow: 0 0 0 1px #000, 0 20px 40px -15px rgba(0,0,0,0.7);
}
.season-card::before, .season-card::after {
  content: ""; position: absolute; width: 14px; height: 14px;
  border: 1.5px solid var(--gold);
}
.season-card::before { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.season-card::after  { bottom: 8px; right: 8px; border-left: none; border-top: none; }
.season-card-title { font-size: 20px; font-weight: 800; letter-spacing: .5px; color: #f5dbae; margin-bottom: 4px; }
.season-card-sub { font-size: 12.5px; color: #b19f7b; margin-bottom: 6px; }
.season-card-rule {
  display: flex; align-items: center; gap: 10px;
  color: #ffcf8a; font-size: 12px; font-weight: 700; letter-spacing: 1px;
  margin: 18px 0 10px;
}
.season-card-rule:first-child { margin-top: 0; }
.season-card-rule::before, .season-card-rule::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

/* "Рейтинг" tab rows — place/name/points, top-3 places colored gold/silver/
   bronze, the current player's own row highlighted green. */
.season-row {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 8px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(216,207,190,.07);
  margin-bottom: 6px;
}
.season-row.me { border-color: rgba(80,175,149,.55); background: rgba(80,175,149,.10); }
.season-place { width: 30px; font-weight: 800; color: #d8cfbe; font-size: 13px; }
.season-place.p1 { color: #ffd35c; } .season-place.p2 { color: #e0d9cc; } .season-place.p3 { color: #d99a5c; }
.season-name { flex: 1; color: #d8cfbe; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Round class portrait badge (classBadgeHTML, js/icons.js) — a compact
   "whose class is this" marker next to a username. Shared by the season
   rating list, the regular BM rating list and the clan member list; each
   caller sets its own width/height inline (default 20px), this only fixes
   the shape. */
.class-icon-badge {
  border-radius: 50%; flex-shrink: 0; vertical-align: middle;
  object-fit: contain; padding: 3px; box-sizing: border-box;
  border: 1px solid rgba(0,0,0,.35);
}
.season-pts { color: #7ee0c0; font-weight: 800; font-size: 12.5px; }
.season-prize { color: #ffd35c; font-weight: 800; font-size: 12.5px; white-space: nowrap; }

/* "Задания" tab — one row per book stack the player is holding. */
.season-book-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(216,207,190,.07);
  margin-bottom: 6px;
  font-size: 12.5px;
}
.season-book-row .season-book-name { flex: 1; color: #d8cfbe; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.season-book-row .season-book-qty { color: #a3957c; }

#events-btn.db-open {
  color: #ffd18a;
  border-left-color: #ffb454;
  animation: dbPulse 1.6s ease-in-out infinite;
}
@keyframes dbPulse {
  0%, 100% { box-shadow: 0 2px 12px rgba(0,0,0,.55), inset 0 1px 0 rgba(216,207,190,.04); }
  50%      { box-shadow: 0 2px 12px rgba(0,0,0,.55), 0 0 12px rgba(255,180,84,.55), inset 0 1px 0 rgba(216,207,190,.04); }
}
@media (prefers-reduced-motion: reduce) {
  #events-btn.db-open { animation: none; }
}

.db-countdown {
  font-size: 30px;
  font-weight: 800;
  color: #ffcf8a;
  text-align: center;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  margin: 4px 0 2px;
}
.db-phase {
  text-align: center;
  font-size: 12px;
  color: #b19f7b;
  margin-bottom: 14px;
}
.db-count {
  text-align: center;
  font-size: 13px;
  color: #8fc95c;
  font-weight: 700;
  margin-bottom: 14px;
}
.db-action {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: 1px solid rgba(232,87,79,.5);
  background: linear-gradient(180deg, rgba(232,87,79,.24), rgba(232,87,79,.10));
  color: #ffb9a6;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.db-action:disabled { opacity: .45; cursor: default; }
.db-action.db-leave {
  border-color: rgba(216,207,190,.22);
  background: rgba(216,207,190,.05);
  color: #d1c6af;
}
.db-rules {
  margin-top: 16px;
  font-size: 11.5px;
  line-height: 1.7;
  color: #a2803d;
}
.db-rules li { margin-left: 14px; }

/* Сотрудничество (Coop) group lobby — the leader/member panel and the
   joinable-groups list shown in place of the plain single db-action button. */
.coop-grp-box {
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(216,207,190,.08);
  border-radius: 10px;
  padding: 4px 12px;
  margin-bottom: 10px;
}
.coop-grp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(216,207,190,.05);
}
.coop-grp-row:last-child { border-bottom: none; }
.coop-grp-empty .coop-grp-name { color: #a2803d; font-style: italic; }
.coop-grp-name { font-size: 13.5px; color: #f5dbae; }
.coop-grp-tag {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #8fc95c;
  font-weight: 700;
}
.coop-grp-kick {
  border: 1px solid rgba(232,87,79,.4);
  background: rgba(232,87,79,.12);
  color: #ffb9a6;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  touch-action: manipulation;
}
.coop-open-list { margin-top: 10px; }
.coop-open-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(216,207,190,.07);
  border-radius: 10px;
  margin-bottom: 6px;
}
.coop-join-btn {
  border: 1px solid rgba(237,208,149,.4);
  background: rgba(237,208,149,.12);
  color: #edd095;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  touch-action: manipulation;
}
.coop-open-empty {
  text-align: center;
  font-size: 12px;
  color: #a2803d;
  margin-top: 10px;
  padding: 10px 0;
}

/* Victory modal — same framing as the death modal, gold instead of blood. */
/* The 3v3 and race10 result modals reuse .db-win-panel and its children
   wholesale — only the icon/title/subtitle text differ between outcomes. */
#a3-result-modal, #race10-result-modal, #lair-result-modal, #coop-result-modal {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex; align-items: center; justify-content: center; z-index: 260;
  backdrop-filter: blur(4px);
}
.db-win-panel {
  position: relative;
  background:
    radial-gradient(ellipse 200px 140px at 50% -10%, rgba(255,180,84,0.20), transparent 65%),
    linear-gradient(175deg, var(--leather-hi), var(--leather-lo) 85%);
  border: 1px solid var(--gold-dim);
  border-radius: 2px;
  padding: 28px 22px 22px;
  text-align: center;
  width: min(90%, 320px);
  box-shadow: 0 0 0 1px #000, 0 30px 50px -15px rgba(0,0,0,0.8), 0 0 40px rgba(255,180,84,0.15);
}
.db-win-panel::before, .db-win-panel::after {
  content: ""; position: absolute; width: 14px; height: 14px;
  border: 1.5px solid var(--gold);
}
.db-win-panel::before { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.db-win-panel::after  { bottom: 8px; right: 8px; border-left: none; border-top: none; }
.db-win-crown { font-size: 42px; margin-bottom: 6px; }
.db-win-title {
  font-size: 21px; font-weight: 800; letter-spacing: 3px;
  color: #ffcf8a; margin-bottom: 4px;
}
.db-win-sub { font-size: 12px; color: #b19f7b; margin-bottom: 16px; }
/* Prize list — shared by the panel's preview and the winner's modal, so the
   two always show the same thing (see _dbRewardRows in js/ui.js). */
.db-rewards {
  display: flex; flex-direction: column; gap: 7px;
  margin-bottom: 18px; text-align: left;
}
.db-rewards-hdr {
  margin-top: 16px; margin-bottom: 8px;
  font-size: 12px; font-weight: 700;
  color: #ffcf8a;
}
.db-reward-row {
  display: flex; align-items: center; gap: 9px;
  background: rgba(216,207,190,.04);
  border: 1px solid rgba(216,207,190,.09);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  color: #dad1bf;
}
.db-reward-row img { width: 22px; height: 22px; object-fit: contain; flex: 0 0 auto; image-rendering: pixelated; }
.db-reward-fallback { font-size: 18px; width: 22px; text-align: center; flex: 0 0 auto; }
.db-reward-row .db-reward-qty { margin-left: auto; color: #ffcf8a; font-weight: 700; font-variant-numeric: tabular-nums; }
.db-win-btn {
  width: 100%; padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,180,84,.5);
  background: linear-gradient(180deg, rgba(255,180,84,.24), rgba(255,180,84,.10));
  color: #ffcf8a; font-size: 13.5px; font-weight: 700;
  cursor: pointer; touch-action: manipulation;
}

/* Death-battle pre-fight countdown. pointer-events:none matters: it covers the
   joystick area, and the freeze lifts mid-touch. */
#db-freeze {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 240;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, rgba(232,87,79,.16), transparent 60%);
}
.db-freeze-num {
  font-size: 92px;
  font-weight: 800;
  line-height: 1;
  color: #ffcf8a;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(232,87,79,.65), 0 4px 18px rgba(0,0,0,.8);
}
.db-freeze-lbl {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #f0937e;
  text-shadow: 0 2px 8px rgba(0,0,0,.9);
}

/* 3v3 match round clock — small, out of the way of the joystick/skill buttons,
   just under the header. Text-only, doesn't intercept touches. */
#a3-match-timer {
  position: fixed;
  top: 68px; left: 50%;
  transform: translateX(-50%);
  display: none;
  z-index: 235;
  pointer-events: none;
  padding: 3px 12px;
  border-radius: 8px;
  background: rgba(19,13,19,.72);
  border: 1px solid rgba(203,161,89,.4);
  color: #ffcf8a;
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 6px rgba(0,0,0,.8);
}

/* ── Профессия panel — second-profession codex ──────────────────────────────
   Same overlay geometry as the other HUD panels (rating/vip/events/season),
   reached instead from the canvas-drawn button under Мир/ПК (drawProfession-
   Button, js/ui.js) rather than a top-right DOM button. */
#profession-panel {
  position: absolute;
  inset: 0;
  z-index: 120;
  background: radial-gradient(ellipse 640px 420px at 50% -6%, rgba(165,143,196,.08), transparent 60%), rgba(15,11,16,.97);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#profession-panel, #profession-panel * { touch-action: pan-y; pointer-events: auto; }

.profp-body { padding: 14px 14px 26px; }

.profp-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; margin-bottom: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--cc) 14%, transparent), rgba(216,207,190,.03));
  border: 1px solid color-mix(in srgb, var(--cc) 40%, rgba(216,207,190,.12));
  border-radius: 14px;
}
.profp-banner-icon {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px;
  background: rgba(12,8,12,.6);
  border: 1px solid color-mix(in srgb, var(--cc) 55%, transparent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--cc) 35%, transparent);
  display: flex; align-items: center; justify-content: center;
}
.profp-banner-cls { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--parchment); }
.profp-banner-sub { font-size: 11.5px; color: #bf9b54; margin-top: 2px; }

.profp-cards { display: flex; flex-direction: column; gap: 10px; }
.profp-card {
  background: rgba(216,207,190,.03);
  border: 1px solid rgba(216,207,190,.1);
  border-radius: 14px;
  padding: 14px 14px 12px;
  position: relative;
}
.profp-card.learned {
  border-color: color-mix(in srgb, var(--cc) 55%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--cc) 8%, transparent), rgba(216,207,190,.03));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cc) 18%, transparent), 0 4px 18px rgba(0,0,0,.35);
}
.profp-card-key {
  position: absolute; top: 12px; right: 14px;
  width: 20px; height: 20px; border-radius: 5px;
  background: rgba(12,8,12,.7); border: 1px solid rgba(216,207,190,.15);
  color: #b5a684; font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.profp-flow { display: flex; align-items: center; gap: 4px; padding-right: 26px; }
.profp-node { flex: 1; min-width: 0; text-align: center; }
.profp-node-icon {
  width: 44px; height: 44px; margin: 0 auto 6px;
  border-radius: 11px;
  background: rgba(12,8,12,.55);
  border: 1px solid rgba(216,207,190,.14);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.profp-card.learned .profp-node.adv .profp-node-icon {
  border-color: color-mix(in srgb, var(--cc) 60%, transparent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--cc) 45%, transparent);
}
.profp-node-icon.dim { opacity: .38; filter: grayscale(.6); }
.profp-node-lockbadge {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12,8,12,.35); border-radius: 11px;
}
.profp-icon-img { width: 24px; height: 24px; image-rendering: pixelated; border-radius: 4px; }
.profp-node-name { font-size: 11px; font-weight: 600; color: #cfc4ad; line-height: 1.25; min-height: 28px; display: flex; align-items: center; justify-content: center; }
.profp-bar { height: 4px; border-radius: 2px; background: rgba(12,8,12,.6); overflow: hidden; margin-top: 2px; }
.profp-bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold-hi)); border-radius: 2px; }

.profp-connector { flex-shrink: 0; width: 30px; height: 44px; display: flex; align-items: center; justify-content: center; }
.profp-fx { position: relative; width: 22px; height: 22px; display: block; }
.profp-fx::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: 100%; height: 2px;
  background: color-mix(in srgb, var(--fx) 70%, transparent);
  transform: translate(-50%, -50%);
}
.profp-fx::after { content: '▸'; position: absolute; right: -2px; top: 50%; transform: translateY(-50%); color: var(--fx); font-size: 11px; }
.profp-fx-classic::before { opacity: .5; }
.profp-fx-pulse::before { animation: profpPulseLine 1.6s ease-in-out infinite; }
@keyframes profpPulseLine {
  0%, 100% { opacity: .55; transform: translate(-50%, -50%) scaleX(.9); }
  50% { opacity: 1; transform: translate(-50%, -50%) scaleX(1.08); }
}

.profp-descs { margin: 9px 0 10px; display: flex; flex-direction: column; gap: 5px; }
.profp-desc-row {
  font-size: 12px; color: #bf9b54; line-height: 1.5;
  padding-left: 8px; border-left: 2px solid rgba(216,207,190,.14);
  transition: opacity .15s, color .15s;
}
.profp-desc-row.dim { opacity: .5; }
.profp-desc-row.lit { color: #cfc4ad; border-left-color: var(--cc); }
.profp-desc-tag {
  display: inline-block; min-width: 46px; margin-right: 6px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #6d4a70;
}
.profp-desc-row.lit .profp-desc-tag { color: var(--cc); }

.profp-lockrow { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: #b89145; }
.profp-learn-btn {
  width: 100%; padding: 9px 0; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--cc), color-mix(in srgb, var(--cc) 70%, #2a1030));
  color: #160f17; font-size: 13px; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.profp-learn-btn:active { filter: brightness(1.1); }

.profp-toggle {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
}
.profp-toggle-opt { flex: 1; font-size: 11.5px; font-weight: 600; color: #987839; text-align: center; transition: color .15s; }
.profp-toggle-opt.on { color: #d8cfbe; }
.profp-toggle-opt.on[style*="--cc"] { color: var(--cc); }
.profp-toggle-switch {
  flex-shrink: 0; width: 40px; height: 22px; border-radius: 11px;
  background: rgba(12,8,12,.7); border: 1px solid rgba(216,207,190,.18);
  position: relative;
}
.profp-toggle-knob {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #cfc4ad; transition: left .16s ease, background .16s ease;
}
.profp-toggle-switch.adv { border-color: color-mix(in srgb, var(--cc) 60%, transparent); }
.profp-toggle-switch.adv .profp-toggle-knob { left: 20px; background: var(--cc); box-shadow: 0 0 8px var(--cc); }

.profp-hint { margin-top: 16px; font-size: 11px; color: #6d4a70; text-align: center; line-height: 1.5; }

/* ── Codex button ──────────────────────────────────────────────────────────── */
#codex-btn {
  position: absolute;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  background: rgba(18,12,18,.90);
  border: 1px solid rgba(216,207,190,.08);
  border-left: 3px solid #8b5cf6;
  border-radius: 6px;
  color: #c9a6f0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .4px;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0,0,0,.55), inset 0 1px 0 rgba(216,207,190,.04);
}
#codex-btn:active { background: rgba(28,16,35,.96); border-left-color: #c9a6f0; }

/* ── Codex panel overlay ───────────────────────────────────────────────────── */
#codex-panel {
  position: absolute;
  inset: 0;
  z-index: 120;
  background: rgba(15,11,16,.97);
  overflow: hidden;
}
#codex-panel, #codex-panel * { touch-action: pan-y; pointer-events: auto; }
.codex-hint { font-size: 11.5px; color: #bf9b54; line-height: 1.5; margin-bottom: 12px; }
.codex-total {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 10px; margin-bottom: 12px;
  background: rgba(139,92,246,.10); border: 1px solid rgba(139,92,246,.30);
}
.codex-total-label { font-size: 12px; font-weight: 700; color: #c9a6f0; }
.codex-total-stats { font-size: 13px; font-weight: 800; color: #d8cfbe; text-align: right; }

/* ── Бонусы за число наборов ───────────────────────────────────────────────── */
.codex-ms {
  padding: 12px 14px; border-radius: 10px; margin-bottom: 12px;
  background: rgba(139,92,246,.08); border: 1px solid rgba(139,92,246,.30);
}
.codex-ms-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.codex-ms-title { font-size: 12px; font-weight: 700; color: #c9a6f0; }
.codex-ms-count { font-size: 11px; font-weight: 800; color: #9d8cc0; }
.codex-ms-next { font-size: 12.5px; color: #e2d6f5; line-height: 1.35; }
.codex-ms-next b { color: #fff; }
.codex-ms-bar { height: 6px; border-radius: 4px; background: rgba(0,0,0,.35); margin-top: 8px; overflow: hidden; }
.codex-ms-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #8b5cf6, #c084fc); }
.codex-ms-prog { font-size: 10.5px; color: #9d8cc0; text-align: right; margin-top: 3px; }
.codex-ms-toggle {
  display: block; width: 100%; margin-top: 8px; padding: 6px 0; border-radius: 8px; cursor: pointer;
  background: rgba(139,92,246,.12); border: 1px solid rgba(139,92,246,.25);
  color: #c9a6f0; font-size: 11.5px; font-weight: 700;
}
.codex-ms-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.codex-ms-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px;
  background: rgba(0,0,0,.22); font-size: 12px; color: #a99fbd;
}
.codex-ms-n {
  flex: 0 0 40px; text-align: center; padding: 3px 0; border-radius: 6px;
  font-weight: 800; font-size: 11.5px; background: rgba(255,255,255,.06); color: #9d8cc0;
}
.codex-ms-txt { flex: 1; min-width: 0; line-height: 1.3; }
.codex-ms-row.done { color: #b8f0d2; }
.codex-ms-row.done .codex-ms-n { background: rgba(80,175,149,.25); color: #7ee0c0; }
.codex-ms-row.next { background: rgba(139,92,246,.18); color: #f0e8ff; border: 1px solid rgba(192,132,252,.45); }
.codex-ms-row.next .codex-ms-n { background: rgba(192,132,252,.30); color: #fff; }
.codex-ms-row.locked { opacity: .65; }

/* ── Offline farm: panel ─────────────────────────────────────────── */
#offline-farm-panel {
  position: absolute;
  inset: 0;
  z-index: 120;
  background: rgba(15,11,16,.97);
  overflow: hidden;
}
#offline-farm-panel, #offline-farm-panel * { touch-action: pan-y; pointer-events: auto; }
.ofarm-hint { font-size: 11.5px; color: #bf9b54; line-height: 1.5; margin-bottom: 12px; }
.ofarm-err {
  font-size: 12px; color: #f17e8b; background: rgba(241,126,139,.08);
  border: 1px solid rgba(241,126,139,.3); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px;
}
.ofarm-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; margin-top: 8px; }
.ofarm-items.lost .ofarm-tile { opacity: .55; }
.ofarm-tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0;
  padding: 6px 4px 5px; border-radius: 8px; border: 1px solid rgba(216,207,190,.15);
  background: rgba(216,207,190,.06);
}
.ofarm-tile-ico { position: relative; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }
.ofarm-tile-qty {
  position: absolute; right: -10px; bottom: -4px; font-size: 10px; font-weight: 700; line-height: 1;
  padding: 2px 4px; border-radius: 6px; background: rgba(21,14,22,.9); color: #f7eddb;
}
.ofarm-tile-name {
  width: 100%; font-size: 9.5px; line-height: 1.2; color: #cabea5; text-align: center;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ofarm-drop {
  margin: -4px 0 10px; padding: 10px 10px 4px; border-radius: 0 0 10px 10px;
  background: rgba(0,0,0,.22); border: 1px solid rgba(207,161,71,.2); border-top: none;
}
.ofarm-drop-note { font-size: 11px; color: #b7a683; line-height: 1.45; margin-bottom: 8px; }

/* Карточки, шкалы и итог — оформление окна оффлайн-фарма. */
#offline-farm-panel .vip-body { padding-bottom: 24px; }
.of-svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.of-hero {
  position: relative; display: flex; align-items: center; gap: 14px; overflow: hidden;
  padding: 14px; border-radius: 14px; margin-bottom: 10px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(207,161,71,.28), rgba(37,26,38,.6) 55%, rgba(22,16,22,.8));
  border: 1px solid rgba(228,192,121,.25);
}
.of-hero-moon {
  position: relative; flex: none; width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #f4e4c5;
  background: radial-gradient(circle at 35% 35%, rgba(228,192,121,.35), rgba(84,57,86,.5));
  box-shadow: 0 0 22px rgba(228,192,121,.35), inset 0 0 0 1px rgba(244,228,197,.25);
  animation: ofGlow 3.2s ease-in-out infinite;
}
.of-hero-moon i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #f7eddb;
  animation: ofTwinkle 2.4s ease-in-out infinite;
}
.of-hero-moon i:nth-of-type(1) { top: 4px; right: 2px; }
.of-hero-moon i:nth-of-type(2) { bottom: 6px; left: -2px; animation-delay: .8s; }
.of-hero-moon i:nth-of-type(3) { top: 16px; left: -6px; width: 2px; height: 2px; animation-delay: 1.6s; }
@keyframes ofGlow { 50% { box-shadow: 0 0 32px rgba(228,192,121,.55), inset 0 0 0 1px rgba(244,228,197,.35); } }
@keyframes ofTwinkle { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
.of-hero-t { font-size: 14px; font-weight: 800; color: #f7eddb; }
.of-hero-s { font-size: 11.5px; color: #cab589; line-height: 1.45; margin-top: 3px; }

.of-limit {
  padding: 12px 12px 10px; border-radius: 12px; margin-bottom: 10px;
  background: rgba(26,19,27,.85); border: 1px solid rgba(207,161,71,.25);
}
.of-limit-head { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: #d8cfbe; }
.of-limit-head span { display: flex; align-items: center; gap: 6px; }
.of-limit-head b { font-size: 15px; color: #e4c079; }
.of-segs { display: flex; gap: 4px; margin-top: 10px; }
.of-seg {
  flex: 1; height: 22px; border-radius: 5px; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
}
.of-seg.on {
  color: #f7eddb; background: linear-gradient(180deg, #cfa147, #6c4a6f);
  box-shadow: 0 0 10px rgba(207,161,71,.45), inset 0 1px 0 rgba(255,255,255,.2);
}
.of-seg.tk { color: rgba(232,193,90,.55); background: rgba(232,193,90,.05); border: 1px dashed rgba(232,193,90,.35); }
.of-seg.used { color: rgba(247,237,219,.35); background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); text-decoration: line-through; }
.of-limit-legend { display: flex; gap: 14px; margin-top: 8px; font-size: 11px; color: #b7a683; }
.of-limit-legend span { display: flex; align-items: center; gap: 5px; }
.of-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; flex: none; }
.of-dot.on { background: #cfa147; box-shadow: 0 0 6px rgba(207,161,71,.6); }
.of-dot.tk { border: 1px dashed rgba(232,193,90,.7); }
.of-dot.rest { background: rgba(216,207,190,.25); }
.of-dot.lim { background: transparent; border: 1px solid #e4c079; }
.of-dot.over { background: #e0a35a; }
.of-ticket {
  display: flex; align-items: center; gap: 7px; margin-top: 10px; padding: 7px 9px; border-radius: 8px;
  font-size: 11.5px; line-height: 1.35;
}
.of-ticket.yes { color: #b4eb84; background: rgba(144,214,83,.08); border: 1px solid rgba(144,214,83,.3); }
.of-ticket.no { color: #efc680; background: rgba(232,193,90,.07); border: 1px solid rgba(232,193,90,.3); }

.of-steps { display: flex; gap: 6px; margin-bottom: 4px; }
.of-steps div {
  flex: 1; display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 9px;
  font-size: 10.5px; line-height: 1.2; color: #cabea5; background: rgba(216,207,190,.04); border: 1px solid rgba(216,207,190,.08);
}
.of-steps b {
  flex: none; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #f7eddb; background: rgba(207,161,71,.35);
}
.of-group {
  display: flex; align-items: center; gap: 8px; font-size: 10.5px; font-weight: 800; color: #e4c079;
  letter-spacing: 1.2px; text-transform: uppercase; margin: 16px 2px 8px;
}
.of-group::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(228,192,121,.35), transparent); }
.of-group span { color: #f7eddb; background: rgba(207,161,71,.25); border-radius: 8px; padding: 1px 7px; letter-spacing: 0; }
.of-group.lost { color: #e0a35a; }

.of-card {
  position: relative; padding: 12px; border-radius: 14px; margin-bottom: 10px;
  background: linear-gradient(180deg, rgba(41,30,42,.9), rgba(26,19,27,.9));
  border: 1px solid rgba(216,207,190,.1);
}
.of-card.best {
  border-color: rgba(228,192,121,.6);
  box-shadow: 0 0 0 1px rgba(228,192,121,.15), 0 6px 22px rgba(207,161,71,.18);
}
.of-card.locked { opacity: .62; }
.of-card.tough { border-color: rgba(241,126,139,.25); }
.of-card-top { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.of-ico {
  flex: none; width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
}
.of-ico.k-zone { color: #efd6a2; background: linear-gradient(135deg, rgba(207,161,71,.45), rgba(84,57,86,.35)); }
.of-ico.k-high { color: #d9b8ff; background: linear-gradient(135deg, rgba(150,100,220,.45), rgba(70,40,120,.35)); }
.of-ico.k-corr { color: #a9e0b9; background: linear-gradient(135deg, rgba(80,170,120,.4), rgba(30,80,60,.35)); }
.of-card.locked .of-ico { color: #b7a683; background: rgba(216,207,190,.08); }
.of-card.tough .of-ico { color: #f17e8b; background: rgba(241,126,139,.12); }
.of-card-info { flex: 1; min-width: 0; }
.of-card-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 14px; font-weight: 800; color: #f7eddb; }
.of-card-sub { font-size: 11.5px; color: #d1af6a; margin-top: 2px; }
.of-badge {
  display: inline-flex; align-items: center; gap: 3px; font-size: 9.5px; font-weight: 800; letter-spacing: .3px;
  color: #2f2230; background: linear-gradient(180deg, #f5d27a, #d9a63a); border-radius: 6px; padding: 2px 6px;
}
.of-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 11px; }
.of-stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 4px; border-radius: 9px;
  background: rgba(0,0,0,.22); border: 1px solid rgba(216,207,190,.07);
}
.of-stat b { font-size: 13px; color: #f7eddb; white-space: nowrap; }
.of-stat span { font-size: 9.5px; color: #a89877; }
.of-stat.s-kill .of-svg { color: #f17e8b; }
.of-stat.s-xp .of-svg { color: #b4eb84; }
.of-stat.s-gold .of-svg { color: #e8c15a; }
.of-meter { margin-top: 9px; }
.of-meter-lbl { display: flex; justify-content: space-between; align-items: center; font-size: 10.5px; color: #b7a683; }
.of-meter-lbl span { display: flex; align-items: center; gap: 5px; }
.of-meter-lbl b { color: #d8cfbe; }
.of-meter-bar { height: 5px; border-radius: 3px; background: rgba(216,207,190,.1); margin-top: 4px; overflow: hidden; }
.of-meter-bar > div { height: 100%; border-radius: 3px; transition: width .4s; }
.of-meter.m-xp .of-meter-bar > div { background: linear-gradient(90deg, #5fae3a, #b4eb84); }
.of-meter.m-ok .of-meter-bar > div { background: linear-gradient(90deg, #a07b31, #e4c079); }
.of-meter.m-warn .of-meter-bar > div { background: linear-gradient(90deg, #b8742a, #efc680); }
.of-meter.m-lock .of-meter-bar > div { background: linear-gradient(90deg, #695b6a, #bcab89); }
.of-warn {
  display: flex; align-items: center; gap: 7px; margin-top: 10px; padding: 8px 10px; border-radius: 9px;
  font-size: 11.5px; color: #f17e8b; background: rgba(241,126,139,.07); border: 1px solid rgba(241,126,139,.2);
}
.of-card-foot { display: flex; gap: 8px; margin-top: 11px; }
.of-btn-ghost, .of-btn-go {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; font-family: inherit; font-size: 12px; font-weight: 800; padding: 9px 12px; cursor: pointer;
}
.of-btn-ghost { flex: none; color: #e8cd97; background: rgba(207,161,71,.08); border: 1px solid rgba(228,192,121,.28); }
.of-btn-ghost.open { color: #f7eddb; background: rgba(207,161,71,.22); }
.of-btn-go {
  flex: 1; color: #fff; border: 1px solid rgba(238,210,155,.5);
  background: linear-gradient(180deg, #c3963b, #614264);
  box-shadow: 0 3px 12px rgba(160,123,49,.35), inset 0 1px 0 rgba(255,255,255,.18);
}
.of-btn-go:active { transform: translateY(1px); }
.of-btn-go.confirm {
  background: linear-gradient(180deg, #d08a35, #93581a); border-color: rgba(245,200,120,.6);
  box-shadow: 0 3px 14px rgba(208,138,53,.4); animation: ofPulse 1s ease-in-out infinite;
}
@keyframes ofPulse { 50% { box-shadow: 0 3px 22px rgba(208,138,53,.7); } }
.of-card .ofarm-drop { margin: 10px -4px -2px; border-radius: 10px; border-top: 1px solid rgba(207,161,71,.2); }
.of-foot-note { font-size: 10.5px; color: #907f5e; line-height: 1.5; margin-top: 6px; text-align: center; }

.of-sum-head {
  display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; margin-bottom: 10px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(207,161,71,.22), rgba(26,19,27,.9) 60%);
  border: 1px solid rgba(228,192,121,.25);
}
.of-ring { position: relative; flex: none; width: 132px; height: 132px; }
.of-ring svg { transform: rotate(-90deg); }
.of-ring-bg { fill: none; stroke: rgba(216,207,190,.1); stroke-width: 10; }
.of-ring-fg { fill: none; stroke-width: 10; stroke-linecap: round; filter: drop-shadow(0 0 5px rgba(228,192,121,.55)); animation: ofRing 1.1s ease-out; }
@keyframes ofRing { from { stroke-dashoffset: 327; } }
.of-ring-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.of-ring-c b { font-size: 17px; color: #f7eddb; }
.of-ring-c span { font-size: 11px; color: #a89877; margin-top: 2px; }
.of-time-list { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.of-time-row { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #cabea5; }
.of-time-row span { flex: 1; }
.of-time-row b { color: #f7eddb; }
.of-time-row.over b { color: #e0a35a; }
.of-time-where { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: #d1af6a; line-height: 1.35; margin-top: 2px; }
.of-capped {
  display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 9px; margin-bottom: 10px;
  font-size: 11.5px; color: #efc680; background: rgba(232,193,90,.07); border: 1px solid rgba(232,193,90,.28);
}
.of-res-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.of-res {
  position: relative; overflow: hidden; padding: 9px 10px; border-radius: 12px;
  display: grid; grid-template-columns: 32px 1fr; grid-template-rows: auto auto; column-gap: 9px; align-items: center;
  background: linear-gradient(180deg, rgba(41,30,42,.9), rgba(26,19,27,.9)); border: 1px solid rgba(216,207,190,.1);
}
.of-res-ico {
  grid-row: 1 / 3; width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
}
.of-res-v { font-size: 15.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 800; color: #f7eddb; white-space: nowrap; }
.of-res-l { font-size: 10.5px; color: #a89877; margin-top: 1px; }
.of-res.r-kill .of-res-ico { color: #f17e8b; background: rgba(241,126,139,.14); }
.of-res.r-xp   .of-res-ico { color: #b4eb84; background: rgba(144,214,83,.14); }
.of-res.r-xp   .of-res-v { color: #c9f3a3; }
.of-res.r-gold .of-res-ico { color: #e8c15a; background: rgba(232,193,90,.14); }
.of-res.r-gold .of-res-v { color: #f5d98a; }
.of-res.r-lib  .of-res-ico { background: rgba(232,193,90,.14); }
.of-res.r-gram .of-res-ico { color: #e4c079; background: rgba(228,192,121,.14); }
.of-res.r-lvl  .of-res-ico { color: #c9a6f0; background: rgba(201,166,240,.14); }
.of-res.r-lvl  .of-res-v { color: #dcc4f7; }
.of-ok { width: 100%; margin-top: 16px; padding: 12px; font-size: 14px; }

/* ── Filter toolbar ────────────────────────────────────────────────────────── */
.codex-toolbar { display: flex; gap: 6px; margin-bottom: 8px; }
.codex-search {
  flex: 1; min-width: 0;
  background: rgba(0,0,0,.3); border: 1px solid rgba(216,207,190,.12); border-radius: 8px;
  color: #d8cfbe; font-family: inherit; font-size: 12.5px; padding: 8px 10px;
}
.codex-search::placeholder { color: #6d4a70; }
.codex-select {
  background: rgba(0,0,0,.3); border: 1px solid rgba(216,207,190,.12); border-radius: 8px;
  color: #b7a683; font-family: inherit; font-size: 12px; padding: 8px 6px; max-width: 96px;
}
.codex-status-tabs { display: flex; gap: 6px; margin-bottom: 4px; }
.codex-status-tab {
  flex: 1; background: rgba(216,207,190,.05); border: 1px solid rgba(216,207,190,.08);
  color: #b7a683; font-size: 11.5px; font-weight: 600; padding: 7px 0; border-radius: 8px; cursor: pointer;
}
.codex-status-tab.active { background: rgba(139,92,246,.16); border-color: #8b5cf6; color: #c9a6f0; }
.codex-set-list-meta { font-size: 10.5px; color: #6d4a70; margin: 8px 2px 6px; }

/* ── Set rows ──────────────────────────────────────────────────────────────── */
.codex-set-list { display: flex; flex-direction: column; gap: 6px; }
.codex-set-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 10px;
  background: rgba(216,207,190,.04); border: 1px solid rgba(216,207,190,.05);
}
.codex-set-row.done { background: rgba(232,185,62,.06); border-color: rgba(232,185,62,.2); }
.codex-set-star { flex-shrink: 0; }
.codex-set-main { flex-shrink: 0; width: 108px; min-width: 0; }
.codex-set-name { font-size: 11.5px; font-weight: 700; color: #d8cfbe; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.codex-set-bonus { font-size: 10px; color: #90d653; font-weight: 700; margin-top: 3px; }
.codex-set-slots { flex: 1; display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.codexslot {
  position: relative; width: 32px; height: 32px; border-radius: 7px;
  background: rgba(0,0,0,.35); border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.codexslot.filled { border-color: #90d653; background: rgba(144,214,83,.12); cursor: default; }
.codexslot:not(.filled) { opacity: .68; }
.codexslot:not(.filled):active { opacity: 1; }
/* Ready = the inventory already holds a matching item for this slot —
   pulses gold so it reads as "tap this" at a glance among the dimmed rest. */
.codexslot.ready {
  opacity: 1;
  border-color: #e69419;
  box-shadow: 0 0 0 1px rgba(230,148,25,.35), 0 0 9px rgba(230,148,25,.55);
  animation: codexReadyPulse 1.6s ease-in-out infinite;
}
@keyframes codexReadyPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(230,148,25,.35), 0 0 9px rgba(230,148,25,.55); }
  50%      { box-shadow: 0 0 0 1px rgba(230,148,25,.6), 0 0 15px rgba(230,148,25,.85); }
}
@media (prefers-reduced-motion: reduce) {
  .codexslot.ready { animation: none; }
}
.codexslot-enh {
  position: absolute; left: -2px; bottom: -3px; font-size: 8px; font-weight: 800;
  color: #e69419; background: rgba(13,9,13,.9); border-radius: 4px; padding: 0 2px; line-height: 1.3;
}
.codexslot-check {
  position: absolute; right: -3px; top: -3px; width: 13px; height: 13px; border-radius: 50%;
  background: #90d653; color: #12210a; font-size: 9px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.codex-set-frac {
  flex-shrink: 0; font-size: 12px; font-weight: 800; color: #a3957c;
  background: rgba(0,0,0,.3); border-radius: 8px; padding: 4px 8px; min-width: 30px; text-align: center;
}
.codex-set-frac.done { color: #12210a; background: #90d653; }
.codex-more-btn {
  width: 100%; margin-top: 10px; padding: 10px 0;
  background: rgba(216,207,190,.06); border: 1px solid rgba(216,207,190,.1); border-radius: 10px;
  color: #b7a683; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.codex-more-btn:active { background: rgba(216,207,190,.12); }


/* ── HUD SIDE COLUMN ───────────────────────────────────────────────────────
   Меню + Рейтинг/VIP/Маркет/Магазин/События/Сезон/Кодекс. One shell for the
   whole column: each button's own rule above still owns its accent (the left
   edge and the text colour), this restyles only the plate they sit on —
   glass-navy with a lit frame, the same language as the canvas HUD. The
   left border is deliberately not touched, and the height stays 28px: the
   column is laid out top-down from _positionHudMenuBtn (js/ui.js), which
   chains each button off the one above it in steps of that height. */
#hud-menu-btn, #rating-btn, #vip-btn, #market-btn,
#gram-shop-btn, #events-btn, #season-btn, #codex-btn, #ach-btn, #helpers-btn, #skins-btn {
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(52,35,53,.93), rgba(24,16,25,.95));
  border-top: 1px solid rgba(230,189,107,.34);
  border-right: 1px solid rgba(230,189,107,.34);
  border-bottom: 1px solid rgba(230,189,107,.34);
  box-shadow: 0 2px 12px rgba(0,0,0,.5), inset 0 1px 0 rgba(238,210,155,.12);
  letter-spacing: .3px;
}
#hud-menu-btn:active, #rating-btn:active, #vip-btn:active, #market-btn:active,
#gram-shop-btn:active, #events-btn:active, #season-btn:active, #codex-btn:active, #ach-btn:active, #helpers-btn:active, #skins-btn:active {
  background: linear-gradient(180deg, rgba(88,60,90,.95), rgba(38,26,39,.96));
}
/* Ползунок прозрачности джойстика (Профиль → Звук). Дорожка тёмная, а
   заполнение синее — чтобы значение читалось без числа рядом. */
.joy-alpha-row { display: flex; align-items: center; gap: 12px; padding: 4px 2px; }
.joy-alpha-row input[type="range"] {
  flex: 1; -webkit-appearance: none; appearance: none; height: 26px;
  background: transparent; touch-action: manipulation;
}
.joy-alpha-row input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, #3b293d, #c19e58);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.8);
}
.joy-alpha-row input[type="range"]::-moz-range-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, #3b293d, #c19e58);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.8);
}
/* 26px, а не 14: пальцем по шестнадцати попадают через раз. */
.joy-alpha-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; margin-top: -10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f7ebd2, #a08040);
  box-shadow: 0 0 0 1.5px #2d1f2f, 0 2px 6px rgba(0,0,0,.7); cursor: pointer;
}
.joy-alpha-row input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px; border: none; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f7ebd2, #a08040);
  box-shadow: 0 0 0 1.5px #2d1f2f, 0 2px 6px rgba(0,0,0,.7); cursor: pointer;
}
.joy-alpha-row input[type="range"]:focus-visible { outline: 2px solid #f1d9aa; outline-offset: 2px; }
.joy-alpha-val {
  font-family: ui-monospace, Consolas, monospace; font-size: 13px; font-weight: 700;
  color: #f1d9aa; min-width: 44px; text-align: right; font-variant-numeric: tabular-nums;
}

/* ── Хранилище: сортировка и окно количества (js/npc.js) ─────────────── */
.storage-sort-bar { align-items: center; margin: 0 0 6px; }
.storage-sort-lbl { font-size: 12px; color: #b7a683; flex: 0 0 auto; }
#storage-qty-modal {
  position: fixed; inset: 0; z-index: 520;
  background: rgba(0,0,0,0.72); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center;
}
.stq-panel {
  width: min(90%, 320px); padding: 18px 16px 16px;
  background: linear-gradient(175deg, var(--leather-hi), var(--leather-lo) 85%);
  border: 1px solid var(--gold-dim); border-radius: 10px;
  box-shadow: 0 0 0 1px #000, 0 30px 50px -15px rgba(0,0,0,0.8);
  color: #d8cfbe;
}
.stq-title { font-size: 16px; font-weight: 800; color: #ffcf8a; text-align: center; margin-bottom: 12px; letter-spacing: 1px; }
.stq-item { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.stq-icon { width: 48px; height: 48px; border: 1px solid; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.3); flex: 0 0 auto; }
.stq-name { font-size: 13px; font-weight: 700; }
.stq-have { font-size: 12px; color: #b7a683; margin-top: 2px; }
.stq-row { display: flex; gap: 8px; align-items: center; }
.stq-step {
  width: 44px; height: 40px; flex: 0 0 auto; font-size: 20px; font-weight: 700;
  background: #1d141e; color: #d8cfbe; border: 1px solid #4a334c; border-radius: 8px; cursor: pointer;
  touch-action: manipulation;
}
.stq-input {
  flex: 1 1 auto; min-width: 0; height: 40px; text-align: center; font-size: 17px; font-weight: 700;
  background: rgba(0,0,0,.35); color: #ffcf8a; border: 1px solid rgba(216,207,190,.15); border-radius: 8px;
  font-family: inherit;
}
.stq-input:focus { outline: none; border-color: rgba(235,170,73,.5); }
.stq-range { width: 100%; margin: 14px 0 10px; accent-color: #ebab4b; }
.stq-quick { display: flex; gap: 6px; margin-bottom: 14px; }
.stq-quick button {
  flex: 1; padding: 7px 0; font-size: 12px; font-weight: 600; cursor: pointer;
  background: rgba(216,207,190,.05); color: #b7a683; border: 1px solid rgba(216,207,190,.12); border-radius: 8px;
  touch-action: manipulation;
}
.stq-actions { display: flex; gap: 8px; }
.stq-actions button { flex: 1; padding: 11px 0; font-size: 13px; font-weight: 700; border-radius: 8px; cursor: pointer; touch-action: manipulation; }
.stq-cancel { background: #1d141e; color: #b7a683; border: 1px solid #4a334c; }
.stq-ok { background: linear-gradient(135deg, #b8782c, #ebab4b); color: #1a1208; border: 1px solid #ebab4b; }

/* ── Сезон 4: вкладки «Сезон», «Задания», «Рейтинг» ─────────────────────── */
.s4-wrap { padding: 14px 14px 24px; max-width: 460px; margin: 0 auto; }
.s4-empty { text-align: center; color: #b19f7b; font-size: 13px; padding: 24px 0; }
.s4-sec-hdr {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 20px 2px 10px; padding-bottom: 6px;
  color: #ffcf8a; font-size: 13px; font-weight: 800; letter-spacing: .4px;
  border-bottom: 1px solid rgba(201,162,92,.28);
}
.s4-sec-meta { color: #b19f7b; font-size: 11px; font-weight: 700; letter-spacing: 0; white-space: nowrap; }

/* очки сезона */
.s4-hero {
  position: relative; text-align: center; padding: 18px 12px 14px; margin-top: 2px;
  border: 1px solid rgba(201,162,92,.45); border-radius: 14px;
  background:
    radial-gradient(ellipse 220px 120px at 50% 0%, rgba(255,190,90,.22), transparent 70%),
    linear-gradient(175deg, rgba(48,36,22,.95), rgba(20,16,12,.95));
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.6), 0 10px 26px -14px rgba(0,0,0,.8);
}
.s4-hero-num {
  font-size: 38px; font-weight: 900; line-height: 1; color: #ffd36b;
  text-shadow: 0 0 18px rgba(255,190,80,.45), 0 2px 0 #3a2508;
}
.s4-hero-lbl { margin-top: 6px; color: #c9b48d; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }

/* карточка задания */
.s4-task {
  display: flex; gap: 11px; align-items: center;
  padding: 10px 12px; margin-bottom: 8px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(41,36,42,.92), rgba(26,22,26,.92));
  border: 1px solid rgba(216,207,190,.09);
}
.s4-task.perm { border-color: rgba(80,175,149,.35); }
.s4-ico {
  flex: 0 0 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
  background: radial-gradient(circle at 35% 30%, rgba(255,207,138,.18), rgba(0,0,0,.25));
  border: 1px solid rgba(201,162,92,.35);
}
.s4-task-body { flex: 1; min-width: 0; }
.s4-task-top { display: flex; align-items: flex-start; gap: 8px; }
.s4-task-name { flex: 1; color: #e2d6c1; font-size: 12.5px; line-height: 1.3; }
.s4-reward {
  flex-shrink: 0; padding: 2px 8px; border-radius: 20px;
  background: rgba(255,207,86,.13); border: 1px solid rgba(255,207,86,.45);
  color: #ffd35c; font-size: 11.5px; font-weight: 800;
}
.s4-bar { margin-top: 7px; height: 7px; border-radius: 6px; background: rgba(0,0,0,.45); overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.s4-bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #2f8f74, #6fe0bd); }
.s4-task-prog { margin-top: 4px; color: #b19f7b; font-size: 10.5px; font-weight: 700; text-align: right; }
.s4-task.done { border-color: rgba(126,224,192,.45); background: linear-gradient(180deg, rgba(24,52,44,.9), rgba(16,32,28,.9)); }
.s4-task.done .s4-ico { color: #7ee0c0; font-size: 20px; font-weight: 900; border-color: rgba(126,224,192,.55); }
.s4-task.done .s4-bar-fill { background: linear-gradient(90deg, #7ee0c0, #c8ffe9); }
.s4-task.done .s4-task-prog { color: #7ee0c0; }

/* строки списков (победители, рейтинг) */
.s4-row {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; margin-bottom: 6px; border-radius: 10px;
  background: rgba(255,255,255,.035); border: 1px solid rgba(216,207,190,.08);
}
.s4-row.top { background: linear-gradient(90deg, rgba(255,200,90,.10), rgba(255,255,255,.03)); border-color: rgba(201,162,92,.35); }
.s4-row.me { border-color: rgba(80,175,149,.7); background: rgba(80,175,149,.13); }
.s4-place { width: 28px; text-align: center; font-weight: 900; font-size: 14px; color: #d8cfbe; flex-shrink: 0; }
.s4-place.p4 { font-size: 12.5px; color: #b7a88a; }
.s4-name { flex: 1; min-width: 0; color: #e5dfd3; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s4-gram, .s4-pts { color: #ffd35c; font-weight: 800; font-size: 12.5px; white-space: nowrap; }
.s4-pts { color: #7ee0c0; }
.s4-claim {
  margin-left: 4px; padding: 5px 11px; border-radius: 8px; cursor: pointer;
  border: 1px solid #ffcf56; background: linear-gradient(180deg, #f2b84b, #b97a1f);
  color: #2a1a05; font-size: 11.5px; font-weight: 900;
}
.s4-claim:disabled { opacity: .5; }
.s4-me-sep { text-align: center; color: #6a5f6b; letter-spacing: 4px; margin: 2px 0 6px; }

/* пьедестал топ-3 */
.s4-podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; margin: 6px 0 14px; }
.s4-pod {
  flex: 1; max-width: 132px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px 0; border-radius: 12px 12px 0 0; overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid rgba(216,207,190,.12); border-bottom: none;
}
.s4-pod.p1 { border-color: rgba(255,211,92,.6); background: linear-gradient(180deg, rgba(255,205,90,.20), rgba(255,205,90,.04)); }
.s4-pod.p2 { border-color: rgba(224,217,204,.45); }
.s4-pod.p3 { border-color: rgba(217,154,92,.5); }
.s4-pod.me { box-shadow: 0 0 0 2px rgba(80,175,149,.7); }
.s4-pod.empty { opacity: .35; min-height: 60px; justify-content: flex-end; }
.s4-pod-medal { font-size: 24px; line-height: 1; }
.s4-pod.p1 .s4-pod-medal { font-size: 30px; }
.s4-pod-name { max-width: 100%; color: #e2d6c1; font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s4-pod-pts { color: #7ee0c0; font-size: 12px; font-weight: 800; }
.s4-pod-base {
  align-self: stretch; margin-top: 6px; text-align: center; font-weight: 900; color: rgba(0,0,0,.55);
  font-size: 18px; padding: 6px 0;
  background: linear-gradient(180deg, #b6ab96, #6a5f6b);
}
.s4-pod.p1 .s4-pod-base { padding: 16px 0; background: linear-gradient(180deg, #ffd96b, #b98a22); }
.s4-pod.p2 .s4-pod-base { padding: 10px 0; background: linear-gradient(180deg, #f0ebe1, #8f9ba5); }
.s4-pod.p3 .s4-pod-base { padding: 4px 0; background: linear-gradient(180deg, #e8ab70, #9c6331); }

.s4-ends { margin-top: 10px; color: #7ee0c0; font-size: 12px; font-weight: 800; letter-spacing: .3px; }

/* ── Элитный монстр: панель (openElitePanel, js/ui.js) ───────────────────── */
.elp-ov { position: fixed; inset: 0; z-index: 240; background: rgba(0,0,0,.78); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px; touch-action: pan-y; pointer-events: auto; }
.elp-ov * { pointer-events: auto; }
.elp-card { position: relative; width: 100%; max-width: 400px; max-height: 88vh; display: flex; flex-direction: column;
  background: radial-gradient(120% 60% at 50% 0%, #3a0d10 0%, #160a0e 45%, #130f14 100%);
  border: 1px solid rgba(255,70,60,.35); border-radius: 18px;
  box-shadow: 0 0 0 1px rgba(255,90,70,.08), 0 10px 40px rgba(255,40,30,.18), inset 0 1px 0 rgba(255,140,120,.12); overflow: hidden; }
.elp-x { position: absolute; top: 10px; right: 10px; z-index: 2; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.35); color: #e8c9c5; font-size: 14px; cursor: pointer; }
.elp-scroll { overflow-y: auto; padding: 0 16px 18px; -webkit-overflow-scrolling: touch; }

.elp-hero { position: relative; display: flex; flex-direction: column; align-items: center; padding: 18px 0 6px; }
.elp-hero-aura { position: absolute; top: 22px; width: 150px; height: 70px; left: 50%; transform: translateX(-50%) translateY(46px);
  border-radius: 50%; background: radial-gradient(closest-side, rgba(255,40,30,.75), rgba(255,40,30,.25) 55%, transparent);
  filter: blur(2px); animation: elpPulse 2.2s ease-in-out infinite; }
.elp-hero .elp-mon-img { position: relative; filter: drop-shadow(0 0 10px rgba(255,50,40,.7)); }
.elp-title { margin-top: 2px; font-size: 21px; font-weight: 900; letter-spacing: .5px; color: #ff5a4a;
  text-shadow: 0 0 14px rgba(255,60,40,.55), 0 2px 0 #3a0806; text-transform: uppercase; }
.elp-timer-box { margin-top: 10px; width: 100%; text-align: center; padding: 12px 10px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,70,60,.12), rgba(255,70,60,.04)); border: 1px solid rgba(255,90,70,.25); }
.elp-timer-lbl { font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: #d79a92; }
.elp-timer-lbl.elp-on { color: #7ef08a; }
.elp-timer { margin-top: 4px; font: 900 32px/1.1 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: #fff;
  letter-spacing: 1px; text-shadow: 0 0 16px rgba(255,80,60,.6); font-variant-numeric: tabular-nums; }
.elp-timer-sub { margin-top: 4px; font-size: 12px; color: #a98e8a; }
.elp-live { margin-top: 8px; font-size: 12.5px; color: #f2d6d2; }
.elp-live b { color: #ffb4a8; }
.elp-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #ff3b30;
  box-shadow: 0 0 8px #ff3b30; vertical-align: 1px; animation: elpPulse 1s ease-in-out infinite; }

.elp-sec-hdr { margin: 18px 0 8px; font-size: 11px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase;
  color: #e07a6e; display: flex; align-items: center; gap: 8px; }
.elp-sec-hdr::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255,90,70,.35), transparent); }

.elp-rews { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.elp-rew { display: flex; flex-direction: column; align-items: center; padding: 12px 6px 10px; border-radius: 12px;
  background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.07); text-align: center; }
.elp-rew-img { width: 34px; height: 34px; filter: drop-shadow(0 0 8px rgba(228,184,97,.6)); }
.elp-rew-emo { font-size: 28px; line-height: 34px; }
.elp-rew-val { margin-top: 6px; font-size: 17px; font-weight: 900; color: #fff; }
.elp-rew-lbl { margin-top: 2px; font-size: 11px; color: #b7ac96; }
.elp-rew-gram { background: linear-gradient(160deg, rgba(223,169,62,.18), rgba(223,169,62,.04)); border-color: rgba(228,184,97,.35); }
.elp-rew-gram .elp-rew-val { color: #edd095; }
.elp-rew-drop .elp-rew-val { color: #ffd76a; }
.elp-rew-hp .elp-rew-val { color: #ff7a6e; }
.elp-rew-size .elp-rew-val { color: #e6a8ff; }

.elp-mons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.elp-mon { position: relative; display: flex; flex-direction: column; align-items: center; padding: 6px 2px 8px;
  border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,80,70,.14); overflow: hidden; }
.elp-mon-glow { position: absolute; top: 52px; left: 50%; width: 60px; height: 20px; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(closest-side, rgba(255,40,30,.55), transparent); }
.elp-mon .elp-mon-img { position: relative; }
.elp-mon-name { margin-top: 2px; font-size: 11px; font-weight: 700; color: #e9d3cf; text-align: center; }
.elp-mon-img { background-repeat: no-repeat; background-position: 0 0; image-rendering: auto; }
.elp-anim { animation: elpFrames .9s steps(var(--cols)) infinite; }
@keyframes elpFrames { to { background-position-x: calc(var(--w) * var(--cols) * -1); } }
@keyframes elpPulse { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }

.elp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.elp-chip { padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #f1d9d5;
  background: rgba(255,70,60,.10); border: 1px solid rgba(255,90,70,.25); }

.elp-rules { margin: 0; padding: 0 0 0 18px; color: #d9d1c2; font-size: 12.5px; line-height: 1.6; }
.elp-rules li::marker { color: #ff5a4a; }

.elp-me { margin-bottom: 8px; padding: 9px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; color: #ffd9d3;
  background: rgba(255,70,60,.08); border: 1px solid rgba(255,90,70,.2); }

/* ── Война гильдий: панель вышек (updateGuildWarHpBar, js/ui.js) ─────────── */
.gwp { position: fixed; top: 108px; left: 8px; width: 118px; z-index: 340;
  pointer-events: none; display: none; padding: 5px 6px 6px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(25,18,26,.82), rgba(14,10,14,.76)); border: 1px solid rgba(237,207,146,.22);
  box-shadow: 0 4px 14px rgba(0,0,0,.45); font-family: system-ui, -apple-system, Arial; }
.gwp-top { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin-bottom: 4px; }
.gwp-title { font-size: 10px; font-weight: 900; letter-spacing: .3px; color: #f3dfb8; white-space: nowrap; }
.gwp-left { font-size: 10px; font-weight: 800; color: #ffe0b8; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gwp-towers { display: flex; flex-direction: column; gap: 4px; }
.gwp-t { display: flex; align-items: center; gap: 5px; min-width: 0; }
.gwp-gem { flex: 0 0 auto; width: 16px; height: 19px; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 900; color: #fff;
  background: var(--c); clip-path: polygon(50% 0, 100% 35%, 80% 100%, 20% 100%, 0 35%); filter: drop-shadow(0 0 4px var(--c)); text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.gwp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gwp-own { max-width: 100%; font-size: 10px; line-height: 1.1; font-weight: 700; color: #e5ddcc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gwp-mine .gwp-own { color: #7dffb0; } .gwp-enemy .gwp-own { color: #ff8a80; }
.gwp-bar { width: 100%; height: 3px; border-radius: 2px; background: rgba(0,0,0,.55); overflow: hidden; }
.gwp-bar i { display: block; height: 100%; border-radius: 2px; transition: width .18s linear; }
.gwp-hold { margin-top: 5px; padding: 3px 4px; border-radius: 6px; font-size: 9.5px; line-height: 1.2; font-weight: 800; text-align: center;
  color: #e3d9c5; background: rgba(255,255,255,.05); font-variant-numeric: tabular-nums; }
.gwp-hold-mine { color: #0b2a17; background: linear-gradient(90deg, #4fe08e, #2fbf6b); animation: gwpPulse 1s ease-in-out infinite; }
.gwp-hold-enemy { color: #fff; background: linear-gradient(90deg, #e2483d, #a8261d); animation: gwpPulse 1s ease-in-out infinite; }
@keyframes gwpPulse { 0%, 100% { opacity: .85; } 50% { opacity: 1; } }
.gwp-banner { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 350; pointer-events: none; display: none;
  max-width: 88vw; padding: 9px 16px; border-radius: 12px; font: 800 13px system-ui, -apple-system, Arial; text-align: center;
  background: rgba(25,18,26,.95); border: 1px solid rgba(240,214,163,.4); color: #f9f0dd; box-shadow: 0 6px 22px rgba(0,0,0,.55); }
.gwp-banner-mine { border-color: #40c878; color: #b9ffd6; }
.gwp-banner-enemy { border-color: #eb463c; color: #ffc2bc; }
.gwp-banner-win { border-color: #ffd37a; color: #ffe7b0; font-size: 14px; }

/* ── Война гильдий: страница события (_guildWarModel, js/ui.js) ──────────── */
.gwf { display: flex; gap: 12px; align-items: center; }
.gwf-map { width: 54%; max-width: 220px; flex: 0 0 auto; display: block; filter: drop-shadow(0 6px 18px rgba(0,0,0,.45)); }
.gwf-bg { fill: #191119; stroke: rgba(237,207,146,.25); stroke-width: 1.5; }
.gwf-room { fill: #322a33; stroke: #4b3f4c; stroke-width: 1.2; }
.gwf-hall { stroke: #3d323e; stroke-width: 7; stroke-linecap: square; fill: none; }
.gwf-entry { fill: #e4b75d; opacity: .85; }
.gwf-castle { font-size: 20px; text-anchor: middle; dominant-baseline: middle; }
.gwf-num { font: 900 10px system-ui, Arial; fill: #fff; text-anchor: middle; paint-order: stroke; stroke: rgba(0,0,0,.7); stroke-width: 3px; }
.gwf-mine polygon:first-of-type { filter: drop-shadow(0 0 4px #40c878); }
.gwf-enemy polygon:first-of-type { filter: drop-shadow(0 0 4px #eb463c); }
.gwf-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.gwf-leg { display: flex; align-items: center; gap: 7px; padding: 6px 9px; border-radius: 9px; background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06); font-size: 12px; min-width: 0; }
.gwf-leg i { width: 10px; height: 12px; flex: 0 0 auto; clip-path: polygon(50% 0, 100% 35%, 80% 100%, 20% 100%, 0 35%); }
.gwf-leg b { color: #c9b58e; font-weight: 900; }
.gwf-leg span { color: #dfd7c6; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gwf-leg-mine { border-color: rgba(64,200,120,.4); background: rgba(64,200,120,.08); } .gwf-leg-mine span { color: #7dffb0; }
.gwf-leg-enemy { border-color: rgba(235,70,60,.4); background: rgba(235,70,60,.08); } .gwf-leg-enemy span { color: #ff8a80; }

.gwh { margin-top: 10px; padding: 9px 11px; border-radius: 10px; font-size: 12.5px; font-weight: 800; text-align: center; }
.gwh-idle { color: #cabea6; background: rgba(255,255,255,.04); border: 1px dashed rgba(255,255,255,.12); font-weight: 700; }
.gwh-mine { color: #b9ffd6; background: rgba(64,200,120,.12); border: 1px solid rgba(64,200,120,.45); }
.gwh-enemy { color: #ffc2bc; background: rgba(235,70,60,.12); border: 1px solid rgba(235,70,60,.45); }
.gwh-bar { margin-top: 7px; height: 7px; border-radius: 4px; background: rgba(0,0,0,.45); overflow: hidden; }
.gwh-bar i { display: block; height: 100%; border-radius: 4px; background: currentColor; transition: width .9s linear; }

.gwo { margin-top: 10px; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(138,92,246,.16), rgba(255,255,255,.03)); border: 1px solid rgba(138,92,246,.35); }
.gwo-mine { background: linear-gradient(135deg, rgba(64,200,120,.18), rgba(255,255,255,.03)); border-color: rgba(64,200,120,.45); }
.gwo-ico { width: 42px; height: 42px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; font-size: 26px;
  border-radius: 10px; background: rgba(0,0,0,.3); }
.gwo-k { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #a79bd6; }
.gwo-v { margin-top: 2px; font-size: 15px; font-weight: 900; color: #fff; overflow-wrap: anywhere; }
.gwo-note { margin-top: 2px; font-size: 11.5px; color: #c6b8ef; }

.gwr { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
  background: rgba(255,207,138,.06); border: 1px solid rgba(255,207,138,.22); }
.gwr-shards { display: grid; grid-template-columns: repeat(3, 22px); gap: 3px; flex: 0 0 auto; }
.gwr-shards img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 0 4px rgba(255,200,120,.35)); }
.gwr-shards img[src*="nexum-coin"] { width: 40px; height: 40px; image-rendering: auto; grid-column: 1 / -1; filter: drop-shadow(0 0 8px rgba(233,196,121,.6)); }
.gwo-hdr { margin-top: 12px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #cfc4f0; }
.gwo + .gwo { margin-top: 6px; }
.gwr-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gwr-txt b { color: #ffcf8a; font-size: 13px; }
.gwr-txt span { color: #b9a990; font-size: 11.5px; line-height: 1.35; }

/* ── Кодекс самоцветов (_gemCodexHtml, js/ui.js) ─────────────────────────── */
.gemcx {
  padding: 12px 14px; border-radius: 10px; margin-bottom: 12px;
  background: rgba(46,190,120,.07); border: 1px solid rgba(46,190,120,.28);
}
.gemcx .codex-ms-title { color: #8fe8b8; }
.gemcx-hint { font-size: 11px; color: #8fae9c; line-height: 1.4; margin-bottom: 10px; }
.gemcx-card { padding: 10px; border-radius: 9px; background: rgba(0,0,0,.24); margin-top: 8px; }
.gemcx-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.gemcx-img { width: 38px; height: 38px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.gemcx-main { flex: 1; min-width: 0; }
.gemcx-name { font-size: 13px; font-weight: 800; color: #e6f5ec; }
.gemcx-bonus { font-size: 11.5px; color: #9fe0bb; margin-top: 2px; }
.gemcx-count { font-size: 11px; color: #8fae9c; white-space: nowrap; }
.gemcx-count b { font-size: 15px; color: #fff; }
.gemcx-actions { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.gemcx-have { flex: 1; font-size: 11px; color: #8fae9c; min-width: 70px; }
.gemcx-btn {
  padding: 6px 10px; border-radius: 7px; cursor: pointer; font-size: 11.5px; font-weight: 800;
  background: linear-gradient(180deg, #34c27e, #23935c); border: 1px solid #1d7a4c; color: #fff;
}
.gemcx-btn.all { background: linear-gradient(180deg, #8b5cf6, #6d3fd8); border-color: #5631b0; }
.gemcx-btn:disabled { opacity: .4; cursor: default; }
.gemcx-actions .codex-ms-toggle { display: inline-block; width: auto; margin-top: 0; padding: 6px 10px; }

/* ── Обновления: кнопка слева от «Турнира» и панель с patches.html ───────── */
#updates-hud-btn {
  position: absolute; display: none; align-items: center; justify-content: center; gap: 5px; padding: 0 6px;
  border-radius: 6px; cursor: pointer; z-index: 51; white-space: nowrap;
  font-family: system-ui, -apple-system, sans-serif; font-size: 11px; font-weight: 800; letter-spacing: .3px;
  background: linear-gradient(180deg, #dba53a, #af8125); border: 1px solid #5e4161; color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.3);
  text-shadow: 0 1px 1px rgba(0,0,0,.35);
}
#updates-hud-btn:active { background: linear-gradient(180deg, #af8125, #624365); }
#updates-hud-btn .upd-dot {
  display: none; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%;
  background: #ff4d4d; box-shadow: 0 0 0 2px rgba(15,11,16,.9);
}
#updates-hud-btn.has-new .upd-dot { display: block; }
#updates-panel {
  position: absolute; inset: 0; z-index: 120; background: rgba(15,11,16,.98);
  display: flex; flex-direction: column; overflow: hidden;
}
#updates-panel, #updates-panel * { touch-action: pan-y; pointer-events: auto; }
#updates-frame { flex: 1; width: 100%; border: 0; background: #0b0805; }

/* ── Достижения ───────────────────────────────────────────────────────────────
   Кнопка — в колонке под «Кодексом» (_positionAchBtn, js/ui.js); точка —
   «есть что забрать». Окно повторяет геометрию окна сезона: вкладки поверх
   шапки, список ниже. Строки — те же .s4-task, что у заданий сезона. */
#ach-btn {
  position: absolute;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  border-left: 3px solid #e0a63a;
  color: #ffcf8a;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  z-index: 50;
}
#ach-btn .upd-dot {
  display: none; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%;
  background: #ff4d4d; box-shadow: 0 0 0 2px rgba(15,11,16,.9);
}
#ach-btn.has-ready .upd-dot { display: block; }
#ach-panel {
  position: absolute; inset: 0; z-index: 120;
  background: rgba(15,11,16,.97);
  display: flex; flex-direction: column; overflow: hidden;
}
#ach-panel, #ach-panel * { touch-action: pan-y; pointer-events: auto; }
/* Пять вкладок на узком телефоне не помещаются — лента прокручивается
   вбок, а не сжимает подписи до нечитаемых. */
#ach-panel .rating-tabs {
  position: absolute; top: 54px; left: 16px; right: 16px; margin: 0; z-index: 1;
  overflow-x: auto; scrollbar-width: none; touch-action: pan-x;
}
#ach-panel .rating-tabs::-webkit-scrollbar { display: none; }
#ach-panel .rating-tab {
  flex: 1 0 auto; font-size: 11.5px; padding: 7px 9px; white-space: nowrap;
  touch-action: pan-x;
}
#ach-panel .vip-body { top: 100px; }
.ach-badge {
  display: inline-block; margin-left: 4px; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 8px; background: #e8574f; color: #fff; font-style: normal; vertical-align: 1px;
  font-size: 10px; font-weight: 800; line-height: 15px; text-align: center;
}
.ach-wrap { padding-top: 12px; }

/* шапка: кольцо общего прогресса + раздел */
.ach-hero {
  display: flex; align-items: center; gap: 16px; padding: 16px; margin-bottom: 14px; border-radius: 16px;
  background:
    radial-gradient(ellipse 220px 140px at 0% 0%, color-mix(in srgb, var(--cc) 26%, transparent), transparent 70%),
    linear-gradient(180deg, rgba(40,32,20,.95), rgba(20,16,10,.95));
  border: 1px solid rgba(201,162,92,.35);
  box-shadow: 0 14px 30px -18px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,220,150,.08);
}
.ach-ring {
  --p: 0; flex: 0 0 86px; height: 86px; border-radius: 50%; position: relative;
  background: conic-gradient(#ffcf5c calc(var(--p) * 1%), rgba(255,255,255,.07) 0);
  box-shadow: 0 0 22px -6px rgba(255,190,80,.6);
}
.ach-ring-in {
  position: absolute; inset: 7px; border-radius: 50%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; background: radial-gradient(circle at 40% 30%, #2b2214, #120d07);
}
.ach-ring-in b { font-size: 24px; font-weight: 900; color: #ffd98a; line-height: 1; }
.ach-ring-in span { font-size: 10.5px; color: #9a8e7a; font-weight: 700; }
.ach-hero-txt { flex: 1; min-width: 0; }
.ach-hero-title { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #c9a45c; }
.ach-hero-cat { margin-top: 6px; font-size: 13.5px; color: #e2d6c1; }
.ach-hero-cat b { color: #ffd98a; }
.ach-hero-bar { margin-top: 6px; height: 6px; border-radius: 4px; background: rgba(0,0,0,.45); overflow: hidden; }
.ach-hero-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--cc), #ffe08a); }
.ach-hero-ready {
  display: inline-block; margin-top: 9px; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 800;
  color: #1a1206; background: linear-gradient(180deg, #ffd56b, #e0a63a); animation: achPulse 1.8s ease-in-out infinite;
}

/* карточка цели */
.ach-card {
  --ac: #c4a276; position: relative; display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 12px 11px; margin-bottom: 10px; border-radius: 14px; overflow: hidden;
  background:
    radial-gradient(ellipse 160px 100px at 0% 0%, color-mix(in srgb, var(--ac) 16%, transparent), transparent 70%),
    linear-gradient(180deg, rgba(34,30,24,.95), rgba(18,16,12,.95));
  border: 1px solid color-mix(in srgb, var(--ac) 28%, rgba(255,255,255,.04));
  border-left: 3px solid var(--ac);
}
.ach-card.ready {
  border-color: rgba(255,207,86,.7); border-left-color: #ffcf56;
  box-shadow: 0 0 0 1px rgba(255,207,86,.15), 0 0 22px -6px rgba(255,190,80,.55);
  animation: achGlow 2.4s ease-in-out infinite;
}
.ach-card.ready::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255,230,160,.10) 50%, transparent 60%);
  background-size: 250% 100%; animation: achSheen 3.2s linear infinite;
}
.ach-card.done { opacity: .78; border-left-color: #7ee0c0; }
.ach-card.idle .ach-medal { filter: grayscale(.65) brightness(.8); }

/* медаль-значок: металл = ступень */
.ach-medal {
  --m1: #e0a46e; --m2: #7a4a26; position: relative; flex: 0 0 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #2c241a, #0e0a06 75%);
  border: 2px solid var(--m1);
  box-shadow: 0 0 0 2px rgba(0,0,0,.55), 0 0 14px -4px var(--m1), inset 0 0 10px rgba(0,0,0,.6);
}
.ach-medal.silver  { --m1: #e8e1d4; --m2: #6d7a86; }
.ach-medal.gold    { --m1: #ffcf56; --m2: #9a6a12; }
.ach-medal.emerald { --m1: #6fe0b4; --m2: #1f6e52; }
.ach-medal.legend  { --m1: #d29bff; --m2: #6a2fa0; box-shadow: 0 0 0 2px rgba(0,0,0,.55), 0 0 18px -2px #d29bff, inset 0 0 10px rgba(0,0,0,.6); }
.ach-ico-img { width: 30px; height: 30px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.ach-ico-emo { font-size: 21px; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.ach-step {
  position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%);
  min-width: 18px; padding: 0 5px; height: 15px; border-radius: 8px; font-style: normal;
  font-size: 9.5px; font-weight: 900; line-height: 15px; text-align: center; letter-spacing: .02em;
  color: #120c05; background: linear-gradient(180deg, var(--m1), var(--m2)); box-shadow: 0 1px 3px rgba(0,0,0,.7);
}
.ach-body { flex: 1; min-width: 0; }
.ach-top { display: flex; align-items: flex-start; gap: 8px; }
.ach-titles { flex: 1; min-width: 0; }
.ach-title { color: #f1e6d0; font-size: 13px; font-weight: 700; line-height: 1.3; }
.ach-sub { margin-top: 2px; color: #8f8370; font-size: 10.5px; font-weight: 700; }
.ach-pct { flex-shrink: 0; color: var(--ac); font-size: 12px; font-weight: 900; padding-top: 1px; }
.ach-stamp {
  flex-shrink: 0; padding: 2px 8px; border-radius: 6px; transform: rotate(-4deg);
  color: #7ee0c0; border: 1.5px solid rgba(126,224,192,.6); font-size: 10.5px; font-weight: 900; letter-spacing: .04em;
}
.ach-claim {
  position: relative; overflow: hidden; flex-shrink: 0; padding: 6px 14px; border-radius: 9px; cursor: pointer;
  background: linear-gradient(180deg, #ffd56b, #d98f22); border: 1px solid #8d5c17;
  color: #1a1206; font-size: 12px; font-weight: 900; letter-spacing: .02em;
  box-shadow: 0 4px 14px -4px rgba(255,180,60,.75), inset 0 1px 0 rgba(255,255,255,.45);
}
.ach-claim::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: achBtnSheen 2.2s ease-in-out infinite;
}
.ach-claim:disabled { opacity: .5; cursor: default; }
.ach-bar { margin-top: 8px; height: 7px; border-radius: 6px; background: rgba(0,0,0,.5); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.ach-bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, color-mix(in srgb, var(--ac) 70%, #000), var(--ac)); transition: width .5s ease; }
.ach-card.ready .ach-bar-fill { background: linear-gradient(90deg, #e0a63a, #ffe08a); }
.ach-card.done .ach-bar-fill { background: linear-gradient(90deg, #3aa883, #7ee0c0); }
.ach-rws { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.ach-rw {
  --rc: #c4a276; display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 3px;
  border-radius: 8px; border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 14%, rgba(0,0,0,.3)), rgba(0,0,0,.3));
  color: var(--rc); font-size: 10.5px; font-weight: 800;
}
.ach-rw-img { width: 18px; height: 18px; object-fit: contain; image-rendering: pixelated; }
.ach-rw-ico { width: 18px; text-align: center; }

/* окно «Достижение выполнено!» */
.ach-win-ov {
  position: fixed; inset: 0; z-index: 420; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(8,5,8,.78); animation: achFade .25s ease;
}
.ach-win {
  width: 100%; max-width: 360px; overflow: hidden; text-align: center; animation: achPop .45s cubic-bezier(.2,.9,.3,1.25);
  background:
    radial-gradient(ellipse 260px 200px at 50% 0%, rgba(255,190,80,.22), transparent 70%),
    linear-gradient(180deg, #241c10, #120d07);
  border: 1px solid rgba(255,207,92,.45);
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.95), 0 0 50px -12px rgba(255,180,60,.45);
}
.ach-win-rays {
  position: absolute; left: 50%; top: 58px; width: 260px; height: 260px; margin: -130px 0 0 -130px; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255,207,110,.16) 0 10deg, transparent 10deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%); mask: radial-gradient(circle, #000 20%, transparent 68%);
  animation: enh-spin 18s linear infinite;
}
.ach-medal.big { flex: none; width: 84px; height: 84px; margin: 4px auto 14px; border-width: 3px; }
.ach-ico-img.big { width: 54px; height: 54px; }
.ach-ico-emo.big { font-size: 40px; }
.ach-medal.big .ach-step { height: 19px; line-height: 19px; font-size: 11px; bottom: -8px; }
.ach-win .db-win-title { position: relative; letter-spacing: 1px; }
.ach-win .db-win-sub { position: relative; color: #e2d6c1; font-size: 13px; }
.ach-win-list { position: relative; display: flex; flex-direction: column; gap: 8px; margin: 4px 0 18px; text-align: left; }
.ach-win-rw {
  --rc: #c4a276; display: flex; gap: 10px; align-items: center; padding: 9px 11px; border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 14%, rgba(0,0,0,.35)), rgba(0,0,0,.35));
  border: 1px solid color-mix(in srgb, var(--rc) 50%, transparent);
  animation: achPop .5s cubic-bezier(.2,.9,.3,1.25) both;
}
.ach-win-rw:nth-child(2) { animation-delay: .12s; } .ach-win-rw:nth-child(3) { animation-delay: .24s; }
.ach-win-pic {
  flex: 0 0 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: radial-gradient(circle, color-mix(in srgb, var(--rc) 35%, transparent), rgba(0,0,0,.4) 70%);
}
.ach-win-pic img { width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; }
.ach-win-name { color: var(--rc); font-size: 13px; font-weight: 800; }
.ach-win-stats { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.ach-win-stats span { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: #d8d2c8; }
.ach-win-stats i { width: 8px; height: 8px; border-radius: 50%; background: var(--qc); box-shadow: 0 0 6px var(--qc); }
.ach-win-stats b { color: var(--qc); }

@keyframes achGlow { 50% { box-shadow: 0 0 0 1px rgba(255,207,86,.25), 0 0 30px -4px rgba(255,190,80,.75); } }
@keyframes achSheen { from { background-position: 150% 0; } to { background-position: -100% 0; } }
@keyframes achBtnSheen { 0% { left: -60%; } 60%, 100% { left: 130%; } }
@keyframes achPulse { 50% { transform: scale(1.05); filter: brightness(1.1); } }
@keyframes achPop { from { opacity: 0; transform: scale(.85) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes achFade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .ach-card.ready, .ach-card.ready::after, .ach-claim::after, .ach-hero-ready, .ach-win, .ach-win-rays, .ach-win-rw { animation: none !important; }
}

/* ── Кузнец ───────────────────────────────────────────────────────────────────
   Только окно кузнеца (data-npc ставит openNpc, js/npc.js); лавка и хранилище
   остаются как были. Цвет редкости приходит переменной --rc с каждой ячейки
   и карточки рецепта — из неё рамка, свечение и фон. */
#npc-dialog[data-npc="craftsman"] {
  width: min(420px, 96vw); max-height: 82vh;
  background:
    radial-gradient(ellipse 320px 180px at 50% -40px, rgba(255,170,70,.16), transparent 70%),
    linear-gradient(180deg, #17120c, #0d0a07);
  border: 1px solid rgba(201,162,92,.45);
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.95), 0 0 40px -16px rgba(255,170,70,.45);
}
#npc-dialog[data-npc="craftsman"] .npc-hdr {
  background: linear-gradient(180deg, rgba(40,30,18,.98), rgba(23,18,12,.98));
  border-bottom: 1px solid rgba(201,162,92,.3);
}
#npc-dialog[data-npc="craftsman"] .npc-name { color: #ffcf8a; letter-spacing: .5px; }
#npc-dialog[data-npc="craftsman"] .npc-subdesc { color: #9a8e7a; }
#npc-dialog[data-npc="craftsman"] .npc-close { color: #c9a45c; }

.craft-wallet { display: flex; gap: 8px; padding: 2px 0 10px; }
.craft-coin {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 6px; border-radius: 20px;
  background: rgba(0,0,0,.35); border: 1px solid rgba(201,162,92,.3);
}
.craft-coin b { color: #ffd98a; font-size: 13px; }
.craft-coin small { color: #9a8e7a; font-size: 10px; font-weight: 700; }

#npc-dialog[data-npc="craftsman"] .craft-tabs {
  gap: 4px; padding: 4px; margin: 2px 0 12px; border-radius: 12px;
  background: rgba(0,0,0,.4); border: 1px solid rgba(201,162,92,.18);
}
#npc-dialog[data-npc="craftsman"] .craft-tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 5px;
  border: 1px solid transparent; border-radius: 9px; background: none;
  color: #9a8e7a; font-size: 11px; font-weight: 700;
}
.craft-tab-ico { font-size: 17px; line-height: 1; filter: grayscale(.6) brightness(.85); transition: filter .15s, transform .15s; }
#npc-dialog[data-npc="craftsman"] .craft-tab.active {
  color: #ffd98a; border-color: rgba(255,207,86,.45);
  background: linear-gradient(180deg, rgba(255,190,80,.22), rgba(255,190,80,.06));
  box-shadow: 0 0 14px -6px rgba(255,190,80,.8), inset 0 1px 0 rgba(255,230,170,.12);
}
#npc-dialog[data-npc="craftsman"] .craft-tab.active .craft-tab-ico { filter: none; transform: scale(1.12); }

#npc-dialog[data-npc="craftsman"] .craft-group-hdr {
  display: flex; align-items: center; gap: 8px; margin: 14px 0 8px;
  font-size: 11px; font-weight: 800; letter-spacing: 1.2px;
}
#npc-dialog[data-npc="craftsman"] .craft-group-hdr::after {
  content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, currentColor, transparent); opacity: .35;
}
#npc-dialog[data-npc="craftsman"] .craft-mats-info { color: #8f8370; }

#npc-dialog[data-npc="craftsman"] .craft-items-grid { gap: 8px; }
.craft-item-cell {
  --rc: #aea599; position: relative;
  border-color: color-mix(in srgb, var(--rc) 40%, transparent);
}
#npc-dialog[data-npc="craftsman"] .craft-item-cell {
  gap: 5px; padding: 9px 4px 7px; border-radius: 12px;
  background:
    radial-gradient(circle at 50% 32%, color-mix(in srgb, var(--rc) 24%, transparent), transparent 62%),
    linear-gradient(180deg, rgba(36,30,22,.95), rgba(18,15,11,.95));
  transition: transform .12s, box-shadow .15s;
}
#npc-dialog[data-npc="craftsman"] .craft-item-cell:active { transform: scale(.94); }
#npc-dialog[data-npc="craftsman"] .craft-item-cell-icon { filter: drop-shadow(0 3px 5px rgba(0,0,0,.65)); }
#npc-dialog[data-npc="craftsman"] .craft-item-cell-name { font-size: 9px; font-weight: 800; max-width: 72px; }
/* хватает на крафт — зелёная галочка в углу и мягкое свечение рамки */
#npc-dialog[data-npc="craftsman"] .craft-item-cell.craftable {
  box-shadow: 0 0 12px -5px var(--rc), inset 0 0 0 1px color-mix(in srgb, var(--rc) 30%, transparent);
}
#npc-dialog[data-npc="craftsman"] .craft-item-cell.craftable::after {
  content: '✓'; position: absolute; top: 3px; right: 4px; width: 14px; height: 14px; border-radius: 50%;
  font-size: 9px; font-weight: 900; line-height: 14px; text-align: center;
  color: #0d1a08; background: #8fd65a; box-shadow: 0 0 6px rgba(143,214,90,.7);
}

/* карточка рецепта */
#npc-dialog[data-npc="craftsman"] .craft-back-btn {
  border-color: rgba(201,162,92,.3); background: rgba(0,0,0,.3); color: #c9a45c; border-radius: 9px;
}
.craft-detail-header { --rc: #aea599; }
#npc-dialog[data-npc="craftsman"] .craft-detail-header {
  gap: 14px; padding: 14px; margin-bottom: 14px; border-radius: 14px;
  background:
    radial-gradient(ellipse 200px 120px at 0% 50%, color-mix(in srgb, var(--rc) 22%, transparent), transparent 70%),
    linear-gradient(180deg, rgba(36,30,22,.95), rgba(18,15,11,.95));
  border: 1px solid color-mix(in srgb, var(--rc) 40%, transparent);
}
#npc-dialog[data-npc="craftsman"] .craft-detail-icon {
  width: 72px; height: 72px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, color-mix(in srgb, var(--rc) 35%, transparent), rgba(0,0,0,.45) 70%);
  border: 1px solid color-mix(in srgb, var(--rc) 55%, transparent);
  box-shadow: 0 0 20px -6px var(--rc);
}
#npc-dialog[data-npc="craftsman"] .craft-detail-icon > * { animation: craftBob 3.2s ease-in-out infinite; }
#npc-dialog[data-npc="craftsman"] .craft-detail-name { font-size: 16px; }
#npc-dialog[data-npc="craftsman"] .craft-detail-stats { color: #a3957c; line-height: 1.45; }
#npc-dialog[data-npc="craftsman"] .craft-reqs-title { color: #c9a45c; font-weight: 800; }
#npc-dialog[data-npc="craftsman"] .craft-req-row {
  padding: 7px 10px; border-radius: 10px; background: rgba(0,0,0,.3); border-color: rgba(201,162,92,.16);
}
#npc-dialog[data-npc="craftsman"] .craft-req-name { color: #d8d2c8; font-size: 12px; }
#npc-dialog[data-npc="craftsman"] .craft-req-count { font-size: 13px; }
#npc-dialog[data-npc="craftsman"] .craft-chance-row { color: #a3957c; }

/* шанс успеха — полоской */
.craft-chance { margin: 2px 0 12px; }
.craft-chance-top { display: flex; justify-content: space-between; font-size: 12px; color: #a3957c; margin-bottom: 5px; }
.craft-chance-top b { font-size: 14px; }
.craft-chance-bar { height: 8px; border-radius: 6px; background: rgba(0,0,0,.5); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); }
.craft-chance-bar i { display: block; height: 100%; border-radius: 6px; }
.craft-chance.hi b { color: #8fd65a; } .craft-chance.hi .craft-chance-bar i { background: linear-gradient(90deg, #4f9a2e, #9fe46a); }
.craft-chance.mid b { color: #ffcf56; } .craft-chance.mid .craft-chance-bar i { background: linear-gradient(90deg, #c4821f, #ffd56b); }
.craft-chance.lo b { color: #f17e6b; } .craft-chance.lo .craft-chance-bar i { background: linear-gradient(90deg, #a8322a, #f17e6b); }

#npc-dialog[data-npc="craftsman"] .craft-do-btn {
  position: relative; overflow: hidden; padding: 13px; border-radius: 12px; font-size: 14px; font-weight: 900;
  letter-spacing: .5px; color: #1a1206;
  background: linear-gradient(180deg, #ffd56b, #d98f22); border: 1px solid #8d5c17;
  box-shadow: 0 6px 18px -6px rgba(255,180,60,.75), inset 0 1px 0 rgba(255,255,255,.45);
}
#npc-dialog[data-npc="craftsman"] .craft-do-btn::before { content: '⚒ '; }
#npc-dialog[data-npc="craftsman"] .craft-do-btn::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 35%; left: -50%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent); animation: achBtnSheen 2.6s ease-in-out infinite;
}
#npc-dialog[data-npc="craftsman"] .craft-do-btn.disabled {
  color: #6d6252; background: linear-gradient(180deg, #2a241b, #1b1712); border-color: rgba(201,162,92,.15); box-shadow: none;
}
#npc-dialog[data-npc="craftsman"] .craft-do-btn.disabled::after { display: none; }
@keyframes craftBob { 50% { transform: translateY(-3px); } }

/* ── Окно результата крафта (showCraftResult, js/npc.js) ─────────────────── */
.craft-res-ov {
  position: fixed; inset: 0; z-index: 430; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(8,5,8,.8); animation: achFade .2s ease;
}
.craft-res {
  --rc: #ffcf56; position: relative; overflow: hidden; width: 100%; max-width: 340px;
  padding: 26px 20px 18px; border-radius: 20px; text-align: center;
  animation: achPop .45s cubic-bezier(.2,.9,.3,1.25);
}
.craft-res-ov.ok .craft-res {
  background: radial-gradient(ellipse 260px 200px at 50% 0%, rgba(255,190,80,.25), transparent 70%), linear-gradient(180deg, #241c10, #120d07);
  border: 1px solid rgba(255,207,92,.5);
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.95), 0 0 50px -12px rgba(255,180,60,.5);
}
.craft-res-ov.fail .craft-res {
  background: radial-gradient(ellipse 260px 200px at 50% 0%, rgba(220,60,50,.25), transparent 70%), linear-gradient(180deg, #1f1010, #0f0808);
  border: 1px solid rgba(235,78,97,.5);
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.95), 0 0 50px -12px rgba(235,60,60,.45);
  animation: achPop .4s cubic-bezier(.2,.9,.3,1.25), craftShake .45s .35s ease-in-out;
}
.craft-res-rays {
  position: absolute; left: 50%; top: 70px; width: 280px; height: 280px; margin: -140px 0 0 -140px; pointer-events: none;
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 66%); mask: radial-gradient(circle, #000 18%, transparent 66%);
}
.craft-res-ov.ok .craft-res-rays {
  background: repeating-conic-gradient(from 0deg, rgba(255,207,110,.2) 0 10deg, transparent 10deg 30deg);
  animation: enh-spin 16s linear infinite;
}
.craft-res-ov.fail .craft-res-rays { background: radial-gradient(circle, rgba(235,60,60,.3), transparent 65%); animation: craftPulse 1.6s ease-in-out infinite; }
.craft-res-art { position: relative; width: 104px; height: 104px; margin: 0 auto 14px; }
.craft-res-icon {
  width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, color-mix(in srgb, var(--rc) 38%, transparent), rgba(0,0,0,.55) 70%);
  border: 3px solid var(--rc); box-shadow: 0 0 0 3px rgba(0,0,0,.55), 0 0 28px -4px var(--rc);
}
.craft-res-icon img { image-rendering: pixelated; }
.craft-res-ov.ok .craft-res-icon > * { animation: craftBob 2.6s ease-in-out infinite; }
.craft-res-ov.fail .craft-res-icon { border-color: #6b3434; box-shadow: 0 0 0 3px rgba(0,0,0,.55), 0 0 24px -6px #eb4e61; }
.craft-res-ov.fail .craft-res-icon > * { filter: grayscale(1) brightness(.55) sepia(.4) hue-rotate(-30deg); opacity: .8; }
/* трещина поверх потускневшего предмета */
.craft-res-crack {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(118deg, transparent 47%, rgba(255,90,80,.95) 48%, rgba(255,200,180,.9) 49%, transparent 50.5%) 18% 0 / 70% 60% no-repeat,
    linear-gradient(62deg, transparent 47%, rgba(255,90,80,.95) 48.5%, transparent 50.5%) 60% 100% / 55% 55% no-repeat,
    linear-gradient(160deg, transparent 47%, rgba(255,90,80,.9) 48.5%, transparent 50.5%) 20% 85% / 40% 40% no-repeat;
  filter: drop-shadow(0 0 4px rgba(255,60,50,.9));
  animation: craftCrack .35s .25s ease-out both;
}
.craft-res-spark { position: absolute; font-style: normal; color: #ffe7a0; text-shadow: 0 0 10px #ffcf56; animation: craftTwinkle 1.8s ease-in-out infinite; }
.craft-res-spark.s1 { top: -4px; right: 2px; font-size: 18px; }
.craft-res-spark.s2 { bottom: 6px; left: -8px; font-size: 13px; animation-delay: .6s; }
.craft-res-spark.s3 { top: 30px; left: -14px; font-size: 10px; animation-delay: 1.1s; }
.craft-res-title { position: relative; font-size: 24px; font-weight: 900; letter-spacing: 1px; }
.craft-res-ov.ok .craft-res-title { color: #ffd56b; text-shadow: 0 0 18px rgba(255,190,80,.6); }
.craft-res-ov.fail .craft-res-title { color: #f17e6b; text-shadow: 0 0 18px rgba(235,60,60,.55); }
.craft-res-name { position: relative; margin-top: 4px; color: var(--rc); font-size: 14px; font-weight: 800; }
.craft-res-ov.fail .craft-res-name { color: #b8a59a; text-decoration: line-through; text-decoration-color: rgba(241,126,107,.7); }
.craft-res-extra { position: relative; margin-top: 8px; font-size: 11.5px; color: #c9bfae; line-height: 1.45; }
.craft-res-stats { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 8px 12px; border-radius: 10px; background: rgba(0,0,0,.35); }
.craft-res-stats span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #d8d2c8; }
.craft-res-stats i { width: 8px; height: 8px; border-radius: 50%; background: var(--qc); box-shadow: 0 0 6px var(--qc); }
.craft-res-stats b { color: var(--qc); }
.craft-res-sub { position: relative; margin-top: 8px; font-size: 12px; color: #9a8e7a; }
.craft-res-ov.fail .craft-res-sub { color: #d07a6c; }
.craft-res-btns { position: relative; display: flex; gap: 8px; margin-top: 18px; }
.craft-res-btn {
  flex: 1; padding: 12px 0; border-radius: 11px; cursor: pointer; font-size: 13.5px; font-weight: 900;
  color: #e2d6c1; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
}
.craft-res-btn.again { color: #1a1206; background: linear-gradient(180deg, #ffd56b, #d98f22); border-color: #8d5c17; box-shadow: 0 4px 14px -4px rgba(255,180,60,.7); }
.craft-res-ov.fail .craft-res-btn.again { color: #fff; background: linear-gradient(180deg, #e0574a, #9c2a22); border-color: #6b1a14; box-shadow: 0 4px 14px -4px rgba(235,60,60,.6); }
@keyframes craftShake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px) rotate(-1deg); } 40% { transform: translateX(6px) rotate(1deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes craftCrack { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes craftTwinkle { 50% { opacity: .2; transform: scale(.6) rotate(45deg); } }
@keyframes craftPulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) {
  .craft-res, .craft-res-rays, .craft-res-icon > *, .craft-res-spark, .craft-res-crack,
  #npc-dialog[data-npc="craftsman"] .craft-detail-icon > *, #npc-dialog[data-npc="craftsman"] .craft-do-btn::after { animation: none !important; }
}

/* ── Эмодзи → иконки (emojifyDom, js/icons.js) ───────────────────────────────
   Сам эмодзи остаётся внутри невидимым текстом: textContent не меняется, а
   экранный диктор его прочтёт. */
.emo-ico { display: inline-flex; align-items: center; vertical-align: middle; line-height: 1; }
.emo-ico + .emo-ico { margin-left: 1px; }
.emo-t {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Пожертвования в клан ──────────────────────────────────────────────────────
   Две карточки во вкладке «Клан» (_clanDonateHTML, js/clans.js): обычное —
   осколки, большое — Liberty. Точки — сколько из трёх сделано сегодня. */
.clan-don-note { font-size: 11px; color: #beac88; margin: -2px 0 8px; }
.clan-don-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.clan-don {
  display: flex; flex-direction: column; gap: 5px; padding: 10px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(232,185,62,.12), rgba(19,13,19,.6));
  border: 1px solid rgba(232,185,62,.35);
}
.clan-don-big {
  background: linear-gradient(180deg, rgba(233,196,121,.16), rgba(19,13,19,.6));
  border-color: rgba(233,196,121,.45); box-shadow: 0 0 16px -8px rgba(233,196,121,.8);
}
.clan-don.off { opacity: .65; }
.clan-don-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.clan-don-top b { font-size: 13px; color: #fff; }
.clan-don-left { font-size: 10px; color: #beac88; white-space: nowrap; }
.clan-don-cost { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #e5ddcc; line-height: 1.25; }
.clan-don-cost img { width: 20px; height: 20px; object-fit: contain; flex: none; }
.clan-don-pts { font-size: 12px; font-weight: 800; color: #8fe08a; }
.clan-don-dots { display: flex; gap: 4px; }
.clan-don-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.15); }
.clan-don-dots i.on { background: #e8b93e; box-shadow: 0 0 6px #e8b93e; }
.clan-don .clan-btn-sm { margin-top: 2px; }
.clan-don .clan-btn-sm:disabled { opacity: .45; cursor: default; }

/* ── Гильдийский босс (вкладка «Босс» в клане, js/clans.js) ─────────────────── */
.gb-note { font-size: 11.5px; color: #c4b69a; line-height: 1.45; margin: -2px 0 10px; }
.gb-active {
  display: flex; gap: 12px; align-items: center; padding: 12px; margin-bottom: 10px; border-radius: 12px;
  background: radial-gradient(circle at 40px 50%, color-mix(in srgb, var(--bc) 35%, transparent), transparent 70%),
              linear-gradient(180deg, rgba(40,14,18,.9), rgba(14,8,10,.95));
  border: 1px solid color-mix(in srgb, var(--bc) 60%, transparent);
  box-shadow: 0 0 22px -8px var(--bc); animation: hlpGbPulse 2.4s ease-in-out infinite;
}
@keyframes hlpGbPulse { 50% { box-shadow: 0 0 30px -4px var(--bc); } }
.gb-active-body { flex: 1; min-width: 0; }
.gb-active-name { font-size: 15px; font-weight: 800; color: #fff; margin-bottom: 6px; }
.gb-hp { position: relative; height: 16px; border-radius: 8px; overflow: hidden; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.1); }
.gb-hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #8a1020, #e5484d, #ff8a7a); transition: width .6s; }
.gb-hp span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; }
.gb-active-meta { font-size: 11px; color: #c9a8a8; margin-top: 5px; }
.gb-enter { background: linear-gradient(180deg, #b0283a, #6d1420) !important; border-color: #ff6a7a !important; color: #fff !important; font-weight: 800; margin-bottom: 12px; }
.gb-drop { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.gb-drop-row { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 8px; background: rgba(255,255,255,.04); font-size: 12px; color: #e5ddcc; }
.gb-drop-row span { flex: 1; }
.gb-drop-row b { color: #ffd27a; }
.gb-drop-note { font-size: 10.5px; color: #ae9c77; line-height: 1.4; margin-top: 2px; }
.gb-win-list { position: relative; display: flex; flex-direction: column; gap: 6px; margin: 6px 0 16px; text-align: left; max-height: 50vh; overflow-y: auto; }

/* ══ Клан (оформление «clx», js/clans.js _renderClanHome) ════════════════════
   Минимализм: тёмные поверхности одного тона, тонкие рамки, один акцент —
   золото. Цвет несут только бонусы (у каждого свой) и состояния. */
.clx { --gold: #f0c75e; --line: rgba(215,195,153,.10); --surf: rgba(255,255,255,.035); --muted: #ac9b79; --text: #ede7da;
  display: flex; flex-direction: column; gap: 10px; padding-bottom: 18px; color: var(--text); }
.clx-hero { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 16px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(240,199,94,.10), transparent 55%), linear-gradient(180deg, rgba(37,27,37,.9), rgba(21,15,22,.9));
  border: 1px solid var(--line); }
.clx-emblem { position: relative; flex: none; width: 64px; height: 64px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.28); border: 1px solid rgba(240,199,94,.25); box-shadow: inset 0 0 18px rgba(240,199,94,.08); }
.clx-lvl { position: absolute; right: -6px; bottom: -6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  background: var(--gold); color: #1d1405; font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 3px #1b131b; }
.clx-hero-main { flex: 1; min-width: 0; }
.clx-name { font-size: 19px; font-weight: 800; color: #fff; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clx-sub { font-size: 11.5px; color: var(--muted); margin: 2px 0 9px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.clx-xp { height: 6px; border-radius: 3px; background: rgba(255,255,255,.07); overflow: hidden; }
.clx-xp i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #b8862a, var(--gold)); box-shadow: 0 0 10px rgba(240,199,94,.5); }
.clx-xp-txt { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; font-size: 10.5px; color: var(--muted); }
.clx-xp-txt span:first-child { color: #e1d8c6; }

.clx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.clx-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
  color: var(--cc, #e1d8c6); background: color-mix(in srgb, var(--cc, #a5977b) 12%, transparent); border: 1px solid color-mix(in srgb, var(--cc, #a5977b) 28%, transparent); }
.clx-chip em { font-style: normal; font-weight: 600; opacity: .85; }
.clx-chip-none { --cc: #ac9b79; font-weight: 600; }

.clx-tabs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: rgba(0,0,0,.25); border: 1px solid var(--line); }
.clx-tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px 6px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); font-size: 9.5px; font-weight: 700; cursor: pointer; min-width: 0; }
.clx-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clx-tab.on { background: rgba(240,199,94,.12); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(240,199,94,.28); }
.clx-tab:active { transform: scale(.97); }
.clx-body { display: flex; flex-direction: column; gap: 10px; }

.clx-hdr { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin: 6px 2px 0; font-size: 11px; font-weight: 800;
  letter-spacing: .9px; text-transform: uppercase; color: #ccbb99; }
.clx-hdr b { color: var(--gold); letter-spacing: 0; }
.clx-hdr-note { flex-basis: 100%; font-size: 10.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.clx-empty { padding: 14px; border-radius: 12px; text-align: center; font-size: 12px; color: var(--muted); background: var(--surf); border: 1px dashed var(--line); }
.clx-note { padding: 9px 11px; border-radius: 10px; font-size: 11.5px; line-height: 1.45; color: #d2c3a4; background: var(--surf); border: 1px solid var(--line); }
.clx-note.warn { color: #e6b45e; background: rgba(230,148,25,.08); border-color: rgba(230,148,25,.25); display: flex; gap: 6px; align-items: flex-start; }
.clx-card { padding: 12px; border-radius: 12px; background: var(--surf); border: 1px solid var(--line); }
.clx-hint { font-size: 10.5px; color: var(--muted); text-align: center; margin-top: -2px; }
.clx-row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

.clx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 14px; border-radius: 10px; cursor: pointer;
  font-size: 12px; font-weight: 800; color: #1d1405; background: var(--gold); border: 0; box-shadow: 0 4px 14px -6px rgba(240,199,94,.7); }
.clx-btn.sm { padding: 6px 10px; font-size: 11px; }
.clx-btn.wide { width: 100%; padding: 11px; }
.clx-btn.ghost { background: rgba(255,255,255,.06); color: #e1d8c6; box-shadow: none; border: 1px solid var(--line); }
.clx-btn.danger { background: rgba(235,78,97,.14); color: #ff8a98; box-shadow: none; border: 1px solid rgba(235,78,97,.35); }
.clx-btn:disabled, .clx-btn.off { opacity: .4; cursor: default; }
.clx-icon-btn { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: #ccbb99; cursor: pointer; }
.clx-link { background: none; border: 0; color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px; }
.clx-link.danger { color: #c56b77; }
.clx-foot { display: flex; justify-content: center; margin-top: 4px; }

.clx-desc { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--surf); border: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.5; color: #e1d8c6; }
.clx-desc span { flex: 1; }
.clx-desc.empty span { color: var(--muted); font-style: italic; }
.clx-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.clx-stat { padding: 10px 12px; border-radius: 12px; background: var(--surf); border: 1px solid var(--line); min-width: 0; }
.clx-stat-k { font-size: 10.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.clx-stat-v { margin-top: 3px; font-size: 15px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.clx-don-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.clx-don { display: flex; flex-direction: column; gap: 6px; padding: 11px; border-radius: 12px; text-align: left; cursor: pointer; color: var(--text);
  background: var(--surf); border: 1px solid var(--line); font: inherit; }
.clx-don.big { background: linear-gradient(180deg, rgba(233,196,121,.08), var(--surf)); border-color: rgba(233,196,121,.22); }
.clx-don:not(:disabled):active { transform: scale(.98); }
.clx-don:disabled { cursor: default; opacity: .55; }
.clx-don-top { display: flex; justify-content: space-between; align-items: baseline; }
.clx-don-top b { font-size: 13px; color: #fff; }
.clx-don-pts { font-size: 15px; font-weight: 900; color: #7ee0b0; }
.clx-don-cost { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #d2c3a4; }
.clx-don-cost img { width: 18px; height: 18px; object-fit: contain; }
.clx-don-dots { display: flex; align-items: center; gap: 4px; }
.clx-don-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.13); }
.clx-don-dots i.on { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.clx-don-dots em { margin-left: auto; font-style: normal; font-size: 10px; color: var(--muted); }

.clx-list { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surf); }
.clx-member { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); }
.clx-member:first-child { border-top: 0; }
.clx-member.tap { cursor: pointer; }
.clx-member.me { background: rgba(240,199,94,.06); }
.clx-member-cls { flex: none; width: 24px; display: flex; justify-content: center; }
.clx-member-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.clx-member-name { font-size: 13px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; }
.clx-member-name em { font-style: normal; font-size: 10px; font-weight: 700; color: var(--gold); }
.clx-member-meta { font-size: 10.5px; color: var(--muted); }
.clx-member-bm { flex: none; text-align: right; font-size: 13px; font-weight: 800; color: #ede7da; display: flex; flex-direction: column; line-height: 1.1; }
.clx-member-bm small { font-size: 9px; font-weight: 600; color: var(--muted); }
.clx-member-more { flex: none; width: 18px; text-align: center; color: var(--muted); }
.clx-member-acts { display: flex; gap: 8px; padding: 0 12px 10px 46px; background: rgba(0,0,0,.15); }
.clx-member-acts .clx-btn { flex: 1; }

.clx-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 10.5px; color: var(--muted); }
.clx-legend span { display: inline-flex; align-items: center; gap: 4px; }
.clx-levels { display: flex; flex-direction: column; gap: 6px; }
.clx-lv { display: flex; gap: 10px; align-items: center; padding: 9px 11px; border-radius: 12px; background: var(--surf); border: 1px solid var(--line); }
.clx-lv-n { flex: none; width: 28px; height: 28px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900; color: #ccbb99; background: rgba(255,255,255,.06); }
.clx-lv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.clx-lv-name { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 700; color: #ede7da; }
.clx-lv-name span { font-size: 10.5px; font-weight: 600; color: var(--muted); }
.clx-lv-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.clx-lv-chips .clx-chip { padding: 1px 6px; font-size: 10px; }
.clx-lv.done { opacity: .62; }
.clx-lv.cur { background: linear-gradient(90deg, rgba(240,199,94,.12), var(--surf)); border-color: rgba(240,199,94,.4); }
.clx-lv.cur .clx-lv-n { background: var(--gold); color: #1d1405; }
.clx-lv.next .clx-lv-n { background: transparent; border: 1px dashed rgba(215,195,153,.25); }
.clx-lv-now { flex: none; font-size: 10px; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: .6px; }
.clx-lv-ok { flex: none; }

.clx-treasury { border-radius: 14px; padding: 12px; background: linear-gradient(180deg, rgba(230,188,105,.10), rgba(21,15,22,.6)); border: 1px solid rgba(233,196,121,.25); }
.clx-treasury-top { display: flex; align-items: center; gap: 12px; }
.clx-treasury-top img { width: 38px; height: 38px; filter: drop-shadow(0 0 8px rgba(233,196,121,.55)); }
.clx-treasury-main { flex: 1; }
.clx-treasury-k { font-size: 10.5px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #e4c588; }
.clx-treasury-v { font-size: 22px; font-weight: 900; color: #fff; line-height: 1.1; }
.clx-treasury-v small { font-size: 11px; color: #e4c588; font-weight: 700; }
.clx-tr-log { margin-top: 10px; border-top: 1px solid rgba(233,196,121,.15); padding-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.clx-tr-row { display: flex; align-items: baseline; gap: 8px; font-size: 11.5px; color: #d2c3a4; padding: 3px 0; }
.clx-tr-row span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clx-tr-row small { color: var(--muted); font-size: 10px; }
.clx-tr-row b.in { color: #7ee0b0; } .clx-tr-row b.out { color: #e8a35a; }
.clx-tr-empty { margin-top: 8px; font-size: 11px; color: var(--muted); }

.clx-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.clx-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 7px; border-radius: 12px;
  background: var(--surf); border: 1px solid var(--line); color: var(--text); font: inherit; cursor: pointer; min-width: 0; }
.clx-item.ro { cursor: default; }
.clx-item img { width: 30px; height: 30px; object-fit: contain; }
.clx-item b { font-size: 12px; font-weight: 900; color: #fff; }
.clx-item span { font-size: 9.5px; color: var(--muted); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clx-item:not(.ro):active { transform: scale(.97); border-color: rgba(240,199,94,.4); }
.clx-alloc { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12px; }
.clx-alloc:first-child { border-top: 0; }
.clx-alloc img { width: 22px; height: 22px; object-fit: contain; }
.clx-alloc-name { flex: 1; min-width: 0; display: flex; flex-direction: column; color: #ede7da; }
.clx-alloc-name small { color: var(--muted); font-size: 10.5px; }
.clx-alloc b { color: #fff; }
.clx-locked { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; font-size: 12px; color: #d2c3a4; }
.clx-locked small { color: var(--muted); }

.clx-rank { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); }
.clx-rank:first-child { border-top: 0; }
.clx-rank.me { background: rgba(240,199,94,.06); }
.clx-rank-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; color: var(--mc, #ccbb99); background: color-mix(in srgb, var(--mc, #ccbb99) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--mc, #ccbb99) 35%, transparent); }
.clx-rank-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.clx-rank-name { font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clx-rank-name small { color: var(--muted); font-weight: 500; }
.clx-rank-bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,.06); overflow: hidden; display: flex; }
.clx-rank-bar i { display: block; height: 100%; background: linear-gradient(90deg, #4f9a76, #7ee0b0); }
.clx-rank-bar i.tour { background: linear-gradient(90deg, #c8962e, #f0c75e); }
.clx-rank-bar i.boss { background: linear-gradient(90deg, #8a4fc4, #d08cff); }
.clx-rank-tour { display: flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 10.5px; font-weight: 700; color: #f0c75e; }
.clx-rank-tour.boss { color: #d08cff; }
.clx-rank-tour.war { color: #ff8a8a; }
.clx-rank-v { flex: none; text-align: right; font-size: 13px; font-weight: 900; color: #7ee0b0; display: flex; flex-direction: column; line-height: 1.1; }
.clx-rank-v small { font-size: 9.5px; font-weight: 600; color: var(--muted); }
.clx .lair-list { margin: 0; }
.clx .gb-active { margin-bottom: 0; }
.clx-stat-n { font-size: 10px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clx > .clx-body > .clx-link { align-self: center; }
.clx-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.clx-fact { padding: 8px 9px; border-radius: 10px; background: var(--surf); border: 1px solid var(--line); min-width: 0; }
.clx-fact span { display: block; font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.clx-fact b { display: block; margin-top: 2px; font-size: 12px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clx .lair-boss { background: var(--surf); border: 1px solid var(--line); box-shadow: none; }
.clx .lair-boss .lair-name { color: #fff; }
.clx .lair-boss .lair-ico { background: rgba(0,0,0,.25); border-color: color-mix(in srgb, var(--bc) 40%, transparent); }
.clx .lair-go { background: rgba(240,199,94,.12); color: var(--gold); border: 1px solid rgba(240,199,94,.35); box-shadow: none; }
.clx .lair-go:disabled { opacity: .4; }
.clx .gb-active { background: linear-gradient(180deg, rgba(229,72,77,.12), var(--surf)); border-color: rgba(229,72,77,.35); animation: none; box-shadow: none; }
.clx .gb-enter { width: 100%; border-radius: 10px; padding: 11px; }
.clx .gb-drop-row { background: var(--surf); border: 1px solid var(--line); }
.clx-hero-empty .clx-sub { margin-bottom: 0; }
.clx-perks { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surf); }
.clx-perk { display: flex; gap: 12px; align-items: center; padding: 11px 13px; border-top: 1px solid var(--line); }
.clx-perk:first-child { border-top: 0; }
.clx-perk b { display: block; font-size: 13px; color: #fff; }
.clx-perk span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }

/* ══ Турнир (оформление «trx», js/ui.js _trxRegHTML/_trxBracketHTML/_trxRatingHTML) ══ */
#tournament-panel { background: radial-gradient(120% 60% at 50% 0%, rgba(240,184,74,.10), transparent 60%), rgba(15,10,15,.98); }
#tournament-panel .rating-tabs { margin: 0 16px; padding: 4px; border-radius: 12px; background: rgba(0,0,0,.3); border: 1px solid rgba(240,184,74,.14); }
#tournament-panel .rating-tab { border-radius: 9px; border: 0; background: transparent; color: #aca086; font-weight: 800; }
#tournament-panel .rating-tab.active { background: rgba(240,184,74,.15); color: #f6cf72; box-shadow: inset 0 0 0 1px rgba(240,184,74,.35); }
.trx { --g: #f0b84a; --line: rgba(200,170,110,.13); --surf: rgba(255,255,255,.035); --muted: #a69a80;
  display: flex; flex-direction: column; gap: 10px; padding-bottom: 20px; color: #eee8dd; }
.trx-hdr { margin: 8px 2px 0; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #c9a86a; }
.trx-note { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.trx-note.center { text-align: center; }
.trx-note b { color: #f6cf72; }

.trx-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 18px 16px 16px; border-radius: 18px; border: 1px solid rgba(240,184,74,.3);
  background: radial-gradient(90% 70% at 50% 0%, rgba(240,184,74,.22), transparent 70%), linear-gradient(180deg, #1b1a16, #151115); }
/* Центр лучей — центр кубка: 18px отступа сверху + половина его 56px = 46px,
   минус половина 260px круга. Было -60px, и лучи вращались вокруг точки на
   24px ниже кубка. will-change выносит круг в свой слой: маска и конический
   градиент рисуются один раз, дальше видеокарта только поворачивает его. */
.trx-hero-glow { position: absolute; left: 50%; top: -84px; width: 260px; height: 260px; margin-left: -130px; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255,214,120,.10) 0 8deg, transparent 8deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 70%); mask: radial-gradient(circle, #000 25%, transparent 70%);
  will-change: transform; backface-visibility: hidden;
  animation: enh-spin 30s linear infinite; }
@media (prefers-reduced-motion: reduce) { .trx-hero-glow { animation: none; } }
.trx-trophy { position: relative; filter: drop-shadow(0 6px 18px rgba(240,184,74,.45)); }
.trx-hero-title { position: relative; margin-top: 4px; font-size: 24px; font-weight: 900; letter-spacing: 1px; color: #ffe2a0; text-shadow: 0 2px 14px rgba(240,184,74,.35); }
.trx-hero-sub { position: relative; font-size: 11.5px; color: #b6a888; margin-top: 2px; }
.trx-pill-row { position: relative; margin-top: 10px; }
.trx-status { position: relative; margin-top: 10px; display: flex; flex-direction: column; }
.trx-status b { font-size: 22px; font-weight: 900; color: #fff; }
.trx-status span { font-size: 11px; color: var(--muted); }
.trx-slots { position: relative; display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; width: 100%; max-width: 260px; margin-top: 12px; }
.trx-slots i { height: 8px; border-radius: 4px; background: rgba(255,255,255,.08); }
.trx-slots i.on { background: linear-gradient(90deg, #d79a2c, #ffd77a); box-shadow: 0 0 6px rgba(240,184,74,.6); }
.trx-hero .trx-note { position: relative; margin-top: 8px; }
.trx-action { position: relative; width: 100%; margin-top: 14px; }
.trx-action .db-action { width: 100%; }

.trx-prizes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.trx-prize { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 12px; background: var(--surf); border: 1px solid var(--line); min-width: 0; }
.trx-prize-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: rgba(240,184,74,.10); font-size: 16px; }
.trx-prize > div { flex: 1; min-width: 0; }
.trx-prize b { display: block; font-size: 11.5px; color: #fff; line-height: 1.2; }
.trx-prize small { display: block; font-size: 10px; color: var(--muted); }
.trx-prize em { flex: none; display: flex; align-items: center; gap: 3px; font-style: normal; font-weight: 900; font-size: 13px; color: #efd6a2; }
.trx-prize em img { width: 16px; height: 16px; }
.trx-prize:first-child { border-color: rgba(240,184,74,.4); background: linear-gradient(135deg, rgba(240,184,74,.12), var(--surf)); }

.trx-format { display: flex; flex-direction: column; gap: 6px; }
.trx-fmt { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surf); border-left: 3px solid var(--c); }
.trx-fmt b { display: block; font-size: 12.5px; color: var(--c); }
.trx-fmt span { font-size: 11px; color: var(--muted); }
.trx-fmt.ub { --c: #e6be6d; } .trx-fmt.lb { --c: #ff9257; } .trx-fmt.gf { --c: #f6cf72; }
.trx-fmt-arrow { font-size: 10px; color: var(--muted); text-align: center; margin: -2px 0; }
.trx-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.trx-facts div { padding: 8px 6px; border-radius: 10px; background: var(--surf); border: 1px solid var(--line); text-align: center; }
.trx-facts span { display: block; font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.trx-facts b { display: block; margin-top: 2px; font-size: 12px; color: #fff; }

.trx-steps { display: flex; gap: 4px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.trx-steps::-webkit-scrollbar { display: none; }
#tournament-panel .trx-steps, #tournament-panel .trx-steps * { touch-action: pan-x pan-y; }
.trx-step { flex: 1 0 58px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.trx-step i { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-style: normal;
  font-size: 11px; font-weight: 900; color: #8e8268; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); }
.trx-step span { font-size: 9px; color: #8e8268; text-align: center; line-height: 1.15; }
.trx-step.done i { color: #1b1405; background: #c99a3e; border-color: #c99a3e; }
.trx-step.cur i { color: #1b1405; background: #ffd77a; border-color: #ffd77a; box-shadow: 0 0 0 4px rgba(255,215,122,.18); }
.trx-step.cur span { color: #ffd77a; font-weight: 800; }
.trx-cols { gap: 10px; }
.trx-col { flex: 0 0 150px; display: flex; flex-direction: column; gap: 6px; }
.trx-col-hd { display: flex; flex-direction: column; padding: 6px 8px; border-radius: 10px; background: var(--surf); border: 1px solid var(--line); }
.trx-col-hd b { font-size: 12px; color: #eee8dd; } .trx-col-hd span { font-size: 9.5px; color: var(--muted); }
.trx-col.live .trx-col-hd { border-color: rgba(255,215,122,.5); background: rgba(255,215,122,.08); }
.trx-col.live .trx-col-hd b { color: #ffd77a; }
.trx-grp { margin-top: 2px; font-size: 9.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
.trx-grp.ub { color: #e6be6d; } .trx-grp.lb { color: #ff9257; } .trx-grp.gf { color: #f6cf72; }
.trx-match { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: rgba(0,0,0,.22); border-left: 3px solid var(--c, #e6be6d); }
.trx-match.ub { --c: #e6be6d; } .trx-match.lb { --c: #ff9257; } .trx-match.gf { --c: #f6cf72; border-color: rgba(246,207,114,.45); }
.trx-match.mine { box-shadow: 0 0 0 1px rgba(126,224,176,.55); }
.trx-match.open { border-style: dashed; border-left-style: solid; }
.trx-side { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 12px; color: #d1c6af; }
.trx-side + .trx-side { border-top: 1px solid rgba(255,255,255,.05); }
.trx-side span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trx-side em { font-style: normal; font-size: 11px; color: #7ee0b0; font-weight: 900; }
.trx-side.win { color: #fff; font-weight: 800; background: linear-gradient(90deg, rgba(240,184,74,.14), transparent); }
.trx-side.lose { color: #5f6a78; }
.trx-side.me span { color: #7ee0b0; }
.trx-legend { display: flex; justify-content: center; gap: 12px; font-size: 10px; color: var(--muted); }
.trx-legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; background: var(--c); }
.trx-legend .ub { --c: #e6be6d; } .trx-legend .lb { --c: #ff9257; } .trx-legend .me { --c: #7ee0b0; }
.trx-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px; border-radius: 16px; background: var(--surf); border: 1px dashed var(--line); text-align: center; }
.trx-empty svg { opacity: .55; filter: grayscale(.4); }
.trx-empty b { font-size: 14px; color: #eee8dd; } .trx-empty span { font-size: 11.5px; color: var(--muted); }
.trx-champ { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(240,184,74,.45);
  background: radial-gradient(80% 120% at 0% 50%, rgba(240,184,74,.22), transparent 70%), #15130f; }
.trx-champ svg { width: 44px; height: 44px; flex: none; }
.trx-champ span { display: block; font-size: 10.5px; color: #c9a86a; text-transform: uppercase; letter-spacing: .8px; font-weight: 800; }
.trx-champ b { display: block; font-size: 18px; color: #ffe2a0; font-weight: 900; }

.trx-mecard { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(126,224,176,.35);
  background: linear-gradient(90deg, rgba(126,224,176,.10), rgba(255,255,255,.02)); }
.trx-mecard-rank { flex: none; min-width: 46px; height: 46px; padding: 0 6px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 900; color: #7ee0b0; background: rgba(126,224,176,.12); }
.trx-mecard-main { flex: 1; min-width: 0; }
.trx-mecard-main b { display: block; font-size: 13px; color: #fff; } .trx-mecard-main span { font-size: 10.5px; color: var(--muted); }
.trx-mecard-pts { flex: none; text-align: right; font-size: 22px; font-weight: 900; color: #fff; line-height: 1; display: flex; flex-direction: column; }
.trx-mecard-pts small { font-size: 9.5px; color: var(--muted); font-weight: 600; }
.trx-podium { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; gap: 8px; margin-top: 4px; }
.trx-pod { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.trx-pod-name { font-size: 12px; font-weight: 800; color: #fff; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trx-pod-pts { font-size: 15px; font-weight: 900; color: var(--pc); } .trx-pod-pts small { font-size: 9.5px; color: var(--muted); margin-left: 2px; }
.trx-pod-base { width: 100%; border-radius: 10px 10px 4px 4px; display: flex; justify-content: center; padding-top: 6px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 35%, transparent), color-mix(in srgb, var(--pc) 8%, transparent));
  border: 1px solid color-mix(in srgb, var(--pc) 45%, transparent); border-bottom: 0; }
.trx-pod-base span { font-size: 18px; font-weight: 900; color: var(--pc); }
.trx-pod.p1 { --pc: #ffd77a; } .trx-pod.p1 .trx-pod-base { height: 62px; }
.trx-pod.p2 { --pc: #e1d8c5; } .trx-pod.p2 .trx-pod-base { height: 44px; }
.trx-pod.p3 { --pc: #d99a6a; } .trx-pod.p3 .trx-pod-base { height: 32px; }
.trx-list { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surf); }
.trx-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid rgba(255,255,255,.05); }
.trx-row:first-child { border-top: 0; }
.trx-row.me { background: rgba(126,224,176,.08); }
.trx-row-n { flex: none; width: 24px; text-align: center; font-size: 12px; font-weight: 900; color: #8e8268; }
.trx-row-n.top1 { color: #ffd77a; } .trx-row-n.top2 { color: #e1d8c5; } .trx-row-n.top3 { color: #d99a6a; }
.trx-row-cls { flex: none; width: 22px; display: flex; justify-content: center; }
.trx-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.trx-row-main b { font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trx-row-main span { font-size: 10.5px; color: var(--muted); }
.trx-row-pts { flex: none; font-size: 15px; font-weight: 900; color: #ffd77a; }
.trx-prizes { grid-template-columns: 1fr; gap: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surf); }
.trx-prizes .trx-prize { border: 0; border-radius: 0; background: transparent; border-top: 1px solid rgba(255,255,255,.05); padding: 9px 12px; }
.trx-prizes .trx-prize:first-child { border-top: 0; background: linear-gradient(90deg, rgba(240,184,74,.14), transparent); }
.trx-prize b { font-size: 12.5px; }
.trx-prize em { font-size: 14px; }

/* ── Паки до конца сезона: окно при входе (showShopPacksModal) ── */
.shop-sale-overlay {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; box-sizing: border-box;
  background: radial-gradient(circle at 50% 45%, rgba(120,20,30,.35), rgba(0,0,0,.82) 70%);
  backdrop-filter: blur(4px);
  animation: shopSaleFade .22s ease-out;
}
.shop-sale-overlay, .shop-sale-overlay * { pointer-events: auto; touch-action: manipulation; }
.shop-sale-overlay.closing { animation: shopSaleFadeOut .18s ease-in forwards; }
.shop-sale-card {
  position: relative; overflow: hidden;
  width: 100%; max-width: 340px; box-sizing: border-box;
  padding: 26px 20px 20px; text-align: center; color: #e8ddc9;
  border-radius: 20px;
  background: linear-gradient(165deg, #231019 0%, #140c14 45%, #181119 100%);
  border: 1px solid rgba(255,207,86,.45);
  box-shadow: 0 0 0 1px rgba(229,72,77,.25) inset, 0 18px 50px rgba(0,0,0,.7), 0 0 40px rgba(229,72,77,.28);
  animation: shopSalePop .34s cubic-bezier(.2,1.4,.4,1);
}
.shop-sale-glow {
  position: absolute; left: 50%; top: -90px; width: 280px; height: 220px;
  transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(229,72,77,.45), transparent 65%);
  animation: shopSalePulse 2.4s ease-in-out infinite;
}
.shop-sale-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 30px; height: 30px; border: none; border-radius: 50%;
  background: rgba(255,255,255,.08); color: #b9ad9c; font-size: 14px; cursor: pointer;
}
.shop-sale-ribbon {
  position: relative; display: inline-block;
  padding: 5px 16px; border-radius: 999px;
  background: linear-gradient(90deg, #e5484d, #ff7a45);
  color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .4px;
  box-shadow: 0 4px 14px rgba(229,72,77,.45);
}
.shop-sale-big {
  position: relative; margin: 8px 0 4px;
  font-size: 72px; font-weight: 900; line-height: 1; letter-spacing: -2px;
  background: linear-gradient(180deg, #fff3c4 0%, #ffcf56 45%, #e5923a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #7a2a1c) drop-shadow(0 0 18px rgba(255,160,70,.45));
}
.shop-sale-big small { font-size: 40px; margin-left: 2px; }
.shop-sale-shelf { display: flex; justify-content: center; gap: 10px; margin: 10px 0 14px; }
.shop-sale-item {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, rgba(255,207,86,.22), rgba(255,255,255,.03) 70%);
  border: 1px solid rgba(255,207,86,.3);
  animation: shopSaleItem .4s ease-out both;
}
.shop-sale-item img { max-width: 40px; max-height: 40px; object-fit: contain; }
.shop-sale-text { font-size: 13px; line-height: 1.55; color: #cfc4b4; margin: 0 4px 14px; }
.shop-sale-left { font-size: 12px; color: #f3b7b9; margin-bottom: 8px; letter-spacing: .3px; }
.shop-sale-segs { display: flex; justify-content: center; gap: 8px; margin-bottom: 18px; }
.shop-sale-seg {
  min-width: 52px; padding: 7px 0 5px; border-radius: 10px;
  background: rgba(0,0,0,.35); border: 1px solid rgba(229,72,77,.35);
}
.shop-sale-seg b { display: block; font-size: 22px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.shop-sale-seg span { font-size: 10px; color: #b9ad9c; text-transform: uppercase; }
.shop-sale-go {
  width: 100%; padding: 14px; border: none; border-radius: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 16px; font-weight: 800; letter-spacing: .5px; color: #2b1606;
  background: linear-gradient(180deg, #ffe08a 0%, #ffb53d 55%, #e8892a 100%);
  box-shadow: 0 5px 0 #9a4f16, 0 10px 22px rgba(255,160,60,.35);
  animation: shopSaleBtn 1.8s ease-in-out infinite;
}
.shop-sale-go:active { transform: translateY(3px); box-shadow: 0 2px 0 #9a4f16; }
@keyframes shopSaleFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes shopSaleFadeOut { to { opacity: 0; } }
@keyframes shopSalePop { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: scale(1); } }
@keyframes shopSalePulse { 0%,100% { opacity: .75; } 50% { opacity: 1; } }
@keyframes shopSaleItem { from { opacity: 0; transform: translateY(10px) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes shopSaleBtn { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.12); } }

.shop-sale-left b { color: #fff; font-variant-numeric: tabular-nums; }
.shop-packs-big { font-size: 40px; letter-spacing: -1px; margin: 12px 0 6px; }
.shop-packs-banner {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px;
  background: rgba(229,72,77,.10); border: 1px solid rgba(229,72,77,.35);
  border-radius: 10px; padding: 9px 12px; margin-bottom: 14px;
  font-size: 13px; color: #f3b7b9; text-align: center;
}
.shop-packs-banner b { color: #fff; font-variant-numeric: tabular-nums; }
/* ── Помощники ─────────────────────────────────────────────────────────────────
   Кнопка — в колонке меню под «Достижениями» (_positionHelpersBtn,
   js/helpers.js). Окно: витрина выбранного помощника с кормлением, крафт по
   редкости, коллекция. Чем выше редкость, тем богаче рамка: у эпических —
   медленное свечение, у легендарных — бегущий по кругу золотой отблеск. */
#helpers-btn {
  position: absolute; display: none; align-items: center; justify-content: center; gap: 4px;
  height: 28px; border-left: 3px solid #e6be6d; color: #efd6a2;
  font-size: 10.5px; font-weight: 700; cursor: pointer; z-index: 50;
}
#helpers-panel {
  position: absolute; inset: 0; z-index: 120;
  background:
    radial-gradient(ellipse 420px 260px at 50% 0%, rgba(228,184,97,.10), transparent 70%),
    rgba(15,11,16,.97);
  display: flex; flex-direction: column; overflow: hidden;
}
#helpers-panel, #helpers-panel * { touch-action: pan-y; pointer-events: auto; }
.hlp-wrap canvas { display: block; }

.hlp-hero {
  --rc: #9c9086; position: relative; overflow: hidden;
  display: grid; grid-template-columns: 150px 1fr; gap: 10px 12px; align-items: center;
  padding: 12px; border-radius: 16px; margin-bottom: 6px;
  background:
    radial-gradient(circle at 75px 80px, color-mix(in srgb, var(--rc) 30%, transparent), transparent 62%),
    linear-gradient(180deg, rgba(38,28,39,.95), rgba(19,13,19,.96));
  border: 1px solid color-mix(in srgb, var(--rc) 55%, transparent);
  box-shadow: 0 10px 30px -14px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.05);
}
.hlp-hero.r-epic { animation: hlpEpicGlow 3s ease-in-out infinite; }
.hlp-hero.r-legendary::before {
  content: ''; position: absolute; inset: -50%; z-index: 0; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 70%, rgba(255,226,140,.55) 80%, transparent 90%);
  animation: enh-spin 5s linear infinite;
}
.hlp-hero.r-legendary::after {
  content: ''; position: absolute; inset: 2px; z-index: 0; border-radius: 14px; pointer-events: none;
  background:
    radial-gradient(circle at 75px 80px, color-mix(in srgb, var(--rc) 32%, transparent), transparent 62%),
    linear-gradient(180deg, rgba(30,26,14,.97), rgba(12,10,6,.98));
}
.hlp-hero > * { position: relative; z-index: 1; }
.hlp-win.r-legendary, .hlp-win.r-epic { animation: achPop .45s cubic-bezier(.2,.9,.3,1.25), hlpEpicGlow 2.4s ease-in-out .45s infinite; }
.hlp-hero-stage { width: 150px; height: 150px; display: flex; align-items: center; justify-content: center; }
.hlp-hero-rar { font-size: 10.5px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--rc); }
.hlp-hero-name { font-size: 18px; font-weight: 800; color: #fff; text-shadow: 0 0 12px color-mix(in srgb, var(--rc) 70%, transparent); margin: 2px 0 4px; }
.hlp-hero-lvl { font-size: 12px; color: #d2c3a4; margin-bottom: 6px; }
.hlp-hero-lvl b { color: #fff; font-size: 14px; }
.hlp-xp {
  position: relative; height: 16px; border-radius: 8px; overflow: hidden; margin-bottom: 8px;
  background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.08);
}
.hlp-xp-fill {
  height: 100%; border-radius: 8px; transition: width .5s cubic-bezier(.2,.9,.3,1.1);
  background: linear-gradient(90deg, color-mix(in srgb, var(--rc) 70%, #000), var(--rc), #fff);
  box-shadow: 0 0 12px var(--rc);
}
.hlp-xp span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000;
}
.hlp-stats { display: flex; flex-direction: column; gap: 3px; }
.hlp-hero-stats {
  grid-column: 1 / -1; display: grid; grid-template-columns: 1fr; gap: 4px;
  padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.05);
}
.hlp-hero-stats .hlp-stat span { white-space: nowrap; }
.hlp-stat { display: flex; align-items: baseline; gap: 6px; font-size: 11.5px; color: #d8ccb5; }
.hlp-stat span { flex: 1; }
.hlp-stat b { color: #fff; }
.hlp-stat i { font-style: normal; color: #7dff9b; font-size: 10.5px; }
.hlp-hero-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hlp-feed-btn, .hlp-summon-btn, .hlp-craft-btn {
  border-radius: 10px; cursor: pointer; font-weight: 800; color: #fff;
  border: 1px solid color-mix(in srgb, var(--rc) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 45%, #221823), color-mix(in srgb, var(--rc) 18%, #130d13));
  box-shadow: 0 4px 12px -6px var(--rc), inset 0 1px 0 rgba(255,255,255,.15);
}
.hlp-feed-btn { display: flex; flex-direction: column; align-items: center; padding: 7px 4px; font-size: 12px; }
.hlp-feed-btn small { font-size: 9.5px; font-weight: 600; color: #eadec6; margin-top: 2px; }
.hlp-summon-btn { grid-column: 1 / -1; padding: 10px; font-size: 13px; }
.hlp-summon-btn.on { background: linear-gradient(180deg, rgba(60,140,80,.55), rgba(20,50,30,.8)); border-color: rgba(120,230,150,.6); }
.hlp-feed-btn:disabled, .hlp-summon-btn:disabled, .hlp-craft-btn:disabled { opacity: .4; cursor: default; filter: grayscale(.6); }
.hlp-feed-btn:not(:disabled):active, .hlp-summon-btn:not(:disabled):active, .hlp-craft-btn:not(:disabled):active { transform: scale(.97); }
.hlp-maxed { grid-column: 1 / -1; text-align: center; padding: 8px; color: #ffe08a; font-weight: 800; font-size: 13px; text-shadow: 0 0 10px rgba(255,200,80,.7); }
.hlp-hero-note { grid-column: 1 / -1; font-size: 10.5px; color: #ae9c77; line-height: 1.45; }
.hlp-hero-empty { display: block; text-align: center; padding: 26px 14px; }
.hlp-hero-empty-txt { color: #d2c3a4; font-size: 13px; line-height: 1.6; }

.hlp-sec-hdr { margin: 18px 2px 8px; padding-bottom: 6px; font-size: 13px; font-weight: 800; color: #f6e7ca; border-bottom: 1px solid rgba(232,194,117,.15); }
.hlp-shards { font-size: 11px; color: #beac88; line-height: 1.5; margin: 0 2px 8px; }
.hlp-shards b { color: #fff; }
.hlp-craft {
  --rc: #9c9086; display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 6px; border-radius: 12px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--rc) 20%, rgba(0,0,0,.4)), rgba(0,0,0,.3));
  border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent);
}
.hlp-craft.r-legendary { box-shadow: 0 0 18px -6px var(--rc); }
.hlp-craft-pics { display: flex; flex-wrap: wrap; width: 102px; flex: none; }
.hlp-craft-txt { flex: 1; min-width: 0; }
.hlp-craft-name { font-size: 13px; font-weight: 800; color: var(--rc); }
.hlp-craft-name small { color: #beac88; font-weight: 600; }
.hlp-craft-cost { font-size: 11px; color: #d8ccb5; }
.hlp-craft-btn { flex: none; padding: 8px 12px; font-size: 12px; }

.hlp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin-bottom: 6px; }
.hlp-cell {
  --rc: #9c9086; position: relative; display: flex; flex-direction: column; align-items: center; padding: 6px 4px 7px;
  border-radius: 12px; cursor: pointer;
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--rc) 30%, transparent), rgba(0,0,0,.35) 70%);
  border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent);
}
.hlp-cell.sel { border-color: #fff; box-shadow: 0 0 0 1px var(--rc), 0 0 16px -2px var(--rc); }
.hlp-cell.locked { cursor: default; filter: saturate(.3); opacity: .7; }
.hlp-cell.r-legendary:not(.locked) { animation: hlpEpicGlow 2.4s ease-in-out infinite; }
.hlp-cell-name { font-size: 11px; font-weight: 800; color: var(--rc); text-align: center; line-height: 1.15; margin-top: 2px; }
.hlp-cell-lvl { font-size: 10px; color: #beac88; }
.hlp-cell-act {
  position: absolute; top: 4px; right: 5px; font-style: normal; font-size: 10px; font-weight: 900; color: #0b2a14;
  background: #7dff9b; border-radius: 8px; padding: 0 5px; box-shadow: 0 0 8px #7dff9b;
}

.hlp-win {
  --rc: #9c9086; width: 100%; max-width: 360px; overflow: hidden; text-align: center;
  animation: achPop .45s cubic-bezier(.2,.9,.3,1.25);
  background:
    radial-gradient(ellipse 260px 220px at 50% 0%, color-mix(in srgb, var(--rc) 30%, transparent), transparent 70%),
    linear-gradient(180deg, #211922, #110d12);
  border: 1px solid color-mix(in srgb, var(--rc) 60%, transparent);
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.95), 0 0 50px -12px var(--rc);
}
.hlp-win-stage { width: 180px; height: 180px; margin: -6px auto 0; }
.hlp-win .db-win-title { letter-spacing: 1px; color: #fff; }
.hlp-win-rar { font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--rc); }
.hlp-win-name { font-size: 20px; font-weight: 900; color: #fff; text-shadow: 0 0 14px var(--rc); margin: 2px 0 4px; }
.hlp-win .db-win-sub { color: #eadec6; font-size: 12.5px; margin-bottom: 10px; }
.hlp-win-stats { text-align: left; margin: 0 8px 16px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.35); }
@keyframes hlpEpicGlow {
  50% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--rc) 50%, transparent), 0 0 26px -4px var(--rc); }
}
@media (max-width: 380px) {
  .hlp-hero { grid-template-columns: 120px 1fr; }
  .hlp-hero-stage { width: 120px; height: 120px; }
  .hlp-hero-stage canvas { width: 120px !important; height: 120px !important; }
}

/* ── Окно помощника-предмета (js/helpers.js, openHelperItemModal) ──────────
   Та же карточка, что была в окне «Помощники», внутри обычного окна
   предмета. Кнопка закрытия — поверх карточки, в её углу. */
.imod-box.hlp-imod { padding: 0; background: none; border: none; box-shadow: none; max-width: 420px; }
.hlp-imod .hlp-hero { margin: 0; }
.hlp-imod-close { position: absolute; top: 8px; right: 8px; z-index: 2; }
/* Живой холст — в свой слой: перерисовка кадра не тянет за собой карточку. */
.hlp-hero-stage canvas, .hlp-win-stage canvas { will-change: contents; transform: translateZ(0); }
/* Иконки помощников в кузнице — кнопки: тап открывает карточку (helperPreview). */
.hlp-craft-pic { padding: 0; margin: 0; border: none; background: none; cursor: pointer; touch-action: manipulation; border-radius: 8px; line-height: 0; }
.hlp-craft-pic:active { transform: scale(.92); }
.hlp-prev-ov { z-index: 2000; }

/* ── Войны кланов (js/clans.js, _clanWarsHTML) ───────────────────────────── */
.clx-tabs { grid-template-columns: repeat(7, 1fr); }
.clx-war-about { font-size: 11.5px; color: #e1d8c6; line-height: 1.45; border-color: rgba(255,90,90,.3); background: linear-gradient(180deg, rgba(255,60,60,.08), rgba(255,255,255,.02)); }
.clx-war-h { font-size: 12px; font-weight: 800; color: #ff9a9a; margin-bottom: 8px; }
.clx-war-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); }
.clx-war-row:first-of-type { border-top: 0; }
.clx-war-name { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: #fff; }
.clx-war-acts { display: inline-flex; gap: 6px; }
.clx-war-form { display: flex; gap: 8px; }
.clx-war-form .clan-input { flex: 1; min-width: 0; }

/* «Дружба» — вкладки окна (openFriendPanel, js/ui.js) */
.friend-tab {
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid rgba(110,230,170,.25);
  background: rgba(255,255,255,.03);
  color: #8fb3a2;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.friend-tab.active { background: rgba(110,230,170,.16); border-color: #6ee6aa; color: #c8ffe2; }

/* Хранилище — разделы (_storageSectionBar, js/npc.js) */
.storage-sections { display: flex; gap: 5px; margin: 6px 0 4px; }
.storage-sec {
  flex: 1; padding: 6px 2px; border-radius: 8px;
  border: 1px solid rgba(216,207,190,.14); background: rgba(255,255,255,.03);
  color: #a3957c; font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.storage-sec.active { border-color: rgba(238,194,118,.6); background: rgba(238,194,118,.12); color: #eec276; }
.storage-sec-n { font-weight: 600; opacity: .7; font-size: 10px; }

/* Вкладка «Навыки» — «Профессия» и «Смена класса» (раньше кнопки на экране) */
.skill-extra-btns { display: flex; gap: 8px; margin: 4px 0 8px; }
.skill-extra-btn {
  flex: 1; padding: 9px 6px; border-radius: 10px;
  border: 1px solid rgba(193,158,89,.4); background: rgba(32,22,33,.9);
  color: #e0bc7f; font-size: 13px; font-weight: 700; cursor: pointer;
}
.skill-extra-btn.ready {
  border-color: rgba(205,184,236,.85); color: #cdb8ec;
  background: linear-gradient(180deg, rgba(44,30,66,.97), rgba(21,13,32,.99));
  box-shadow: 0 0 10px rgba(165,143,196,.35);
}

/* ── Скины и гача (js/skins.js) ─────────────────────────────────────────────── */
#skins-btn {
  position: absolute; display: none; align-items: center; justify-content: center; gap: 4px;
  height: 28px; border-left: 3px solid #ffb83a; color: #ffd98a;
  font-size: 10.5px; font-weight: 700; cursor: pointer; z-index: 50;
}
#skins-panel { position: absolute; inset: 0; z-index: 120; background: rgba(15,11,16,.97); overflow: hidden; }
#skins-panel, #skins-panel * { touch-action: pan-y; pointer-events: auto; }
#skins-panel .rating-tabs { position: absolute; top: 52px; left: 0; right: 0; padding: 0 12px; }
#skins-panel .vip-body { top: 96px; }
.skn-info { font-size: 11.5px; color: #bfa98a; line-height: 1.45; margin-bottom: 12px; }
.skn-banner {
  border-radius: 12px; padding: 14px; margin-bottom: 14px;
  background: linear-gradient(160deg, rgba(60,44,30,.55), rgba(20,15,20,.9));
  border: 1px solid rgba(230,189,107,.25);
}
.skn-banner.gram { background: linear-gradient(160deg, rgba(90,52,20,.65), rgba(28,14,30,.92)); border-color: rgba(255,170,60,.45); }
.skn-banner-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.skn-banner-name { font-size: 15px; font-weight: 800; color: #ffe2a8; }
.skn-banner-cost { font-size: 12px; font-weight: 700; color: #d8cfbe; }
.skn-showcase { display: flex; gap: 4px; justify-content: center; margin: 6px 0 10px; overflow: hidden; }
.skn-odds { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 11.5px; margin-bottom: 6px; color: #cfc4ad; }
.skn-odds b { font-weight: 800; }
.skn-sub { font-size: 11px; color: #a3957c; margin-bottom: 10px; }
.skn-btns { display: flex; gap: 8px; }
.skn-btn {
  flex: 1; padding: 10px 6px; border-radius: 9px; border: 1px solid rgba(230,189,107,.4);
  background: linear-gradient(180deg, #7a5320, #4a2f12); color: #ffe7b8; font-weight: 800; font-size: 12.5px; line-height: 1.25;
}
.skn-btn small { display: block; font-size: 10.5px; font-weight: 600; opacity: .85; }
.skn-btn.disabled, .skn-btn:disabled { opacity: .45; filter: grayscale(.4); }
.skn-pv {
  flex: none; background-repeat: no-repeat; image-rendering: auto;
  border-radius: 10px; background-color: rgba(0,0,0,.25);
}
.skn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.skn-card {
  position: relative; border-radius: 10px; padding: 6px 6px 8px; text-align: center;
  background: rgba(209,204,197,.04); border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent);
}
.skn-card.locked .skn-pv { filter: grayscale(1) brightness(.35); }
.skn-card.active { box-shadow: 0 0 0 2px var(--rc), 0 0 14px color-mix(in srgb, var(--rc) 50%, transparent); }
.skn-card .skn-pv { margin: 0 auto 4px; }
.skn-name { font-size: 11px; font-weight: 800; color: var(--rc); line-height: 1.2; min-height: 26px; }
.skn-stars { font-size: 11px; color: #ffcf4a; letter-spacing: 1px; }
.skn-stats { font-size: 9.5px; color: #b9ad98; line-height: 1.35; margin: 3px 0 6px; min-height: 26px; }
.skn-card button {
  width: 100%; padding: 6px 2px; border-radius: 7px; border: 1px solid rgba(230,189,107,.35);
  background: rgba(230,189,107,.12); color: #ffd98a; font-size: 11px; font-weight: 700;
}
.skn-card button.on { background: rgba(80,175,149,.18); border-color: rgba(80,175,149,.5); color: #8fe0c4; }
.skn-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.skn-filter button {
  padding: 5px 9px; border-radius: 14px; font-size: 11px; font-weight: 700;
  border: 1px solid rgba(209,204,197,.15); background: rgba(209,204,197,.05); color: #cfc4ad;
}
.skn-filter button.active { border-color: #e6bd6b; color: #ffd98a; background: rgba(230,189,107,.12); }
.skn-credit { font-size: 10px; color: #6f6455; text-align: center; margin: 14px 0 4px; }
/* итог призыва */
#skn-result-ov {
  position: absolute; inset: 0; z-index: 200; background: rgba(5,3,8,.88);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px;
}
.skn-res-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 560px; }
.skn-res {
  position: relative; width: 96px; border-radius: 10px; padding: 4px 4px 6px; text-align: center;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--rc) 35%, transparent), rgba(15,11,16,.95) 70%);
  border: 1px solid var(--rc); opacity: 0; transform: scale(.6) rotateY(90deg);
  animation: sknFlip .45s ease forwards;
}
.skn-res.legendary, .skn-res.epic { box-shadow: 0 0 18px var(--rc); }
.skn-res-badge {
  position: absolute; top: 4px; left: 4px; font-size: 9px; font-weight: 900; padding: 1px 5px; border-radius: 5px;
  background: #e5484d; color: #fff;
}
.skn-res-ref { font-size: 9px; color: #ffe9a8; }
@keyframes sknFlip { to { opacity: 1; transform: scale(1) rotateY(0); } }
#skn-result-ov .skn-btn { flex: none; margin-top: 16px; min-width: 160px; }

/* ── Разбор: фильтры, выбор пачкой, итог снизу ─────────────────────────── */
.dis-wrap { padding: 12px 12px 0; display: flex; flex-direction: column; gap: 8px; min-height: 100%; box-sizing: border-box; }
.dis-rules summary { cursor: pointer; list-style: none; }
.dis-rules summary::-webkit-details-marker { display: none; }
.dis-rules-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; margin-top: 6px; }
.dis-rules-cols ul { margin: 2px 0 0; padding: 0; }
.dis-tabs { display: flex; gap: 6px; overflow-x: auto; }
.dis-tab { flex: 1 0 auto; padding: 7px 10px; border-radius: 8px; border: 1px solid #4a4236; background: #1d1913; color: #b8ad9a; font-size: 12px; cursor: pointer; touch-action: manipulation; }
.dis-tab span { color: #7d7262; margin-left: 2px; }
.dis-tab.on { border-color: #50af95; color: #7ee0c0; background: #14261f; }
.dis-tab.on span { color: #7ee0c0; }
.dis-rars { display: flex; flex-wrap: wrap; gap: 6px; }
.dis-rar { padding: 5px 9px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--rc) 55%, transparent); background: transparent; color: var(--rc); font-size: 11px; cursor: pointer; touch-action: manipulation; }
.dis-rar.on { background: color-mix(in srgb, var(--rc) 22%, transparent); border-color: var(--rc); }
.dis-list { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.dis-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; border: 1px solid #3a342b; background: #17140f; cursor: pointer; touch-action: manipulation; user-select: none; }
.dis-row.sel { border-color: #50af95; background: #12221c; }
.dis-chk { width: 18px; height: 18px; flex: 0 0 18px; border-radius: 4px; border: 1px solid #6b604f; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #0d1a15; font-weight: 800; }
.dis-row.sel .dis-chk { background: #50af95; border-color: #50af95; }
.dis-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.dis-val { color: #7ee0c0; font-size: 11px; white-space: nowrap; display: flex; align-items: center; gap: 2px; }
.dis-one { padding: 4px 8px; border-radius: 6px; border: 1px solid #50af9566; background: transparent; color: #7ee0c0; font-size: 11px; cursor: pointer; touch-action: manipulation; }
.dis-bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 2px 12px; background: linear-gradient(to top, #120f0b 75%, transparent); font-size: 12px; color: #d8cfbe; }
.dis-go { padding: 9px 14px; border-radius: 8px; border: 1px solid #50af95; background: #1d4a3b; color: #dffcef; font-weight: 700; font-size: 12px; cursor: pointer; touch-action: manipulation; }
.dis-go:disabled { opacity: .4; cursor: default; }

/* ── Магазин GRAM: баланс, карточки, «Редкое» ──────────────────────────── */
.gs-balance { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(111,199,255,.14), rgba(230,148,25,.10)); border: 1px solid rgba(111,199,255,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.gs-balance img { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(111,199,255,.5)); }
.gs-balance-lbl { font-size: 11px; color: #9fb4c4; letter-spacing: .04em; text-transform: uppercase; }
.gs-balance-val { font-size: 20px; font-weight: 800; color: #e8f6ff; line-height: 1.1; }
.gs-balance-val span { font-size: 12px; color: #6fc7ff; font-weight: 700; }

.gram-shop-card { position: relative; overflow: hidden; border-radius: 14px; padding: 14px 14px 12px; margin-bottom: 12px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--cc, #e69419) 12%, #15110c) 0%, #120f0b 70%);
  border: 1px solid color-mix(in srgb, var(--cc, #e69419) 35%, transparent) !important;
  box-shadow: 0 8px 22px -14px color-mix(in srgb, var(--cc, #e69419) 70%, transparent); }
.gram-shop-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--cc, #e69419); opacity: .8; }
.gram-shop-title { font-size: 15px; font-weight: 800; letter-spacing: .01em; }
.gram-shop-price { font-size: 13px; margin-top: 3px; font-weight: 800; }
.gram-shop-buy-btn { padding: 9px 16px; border-radius: 10px; font-size: 13px; font-weight: 800;
  background: color-mix(in srgb, var(--cc, #e69419) 16%, transparent); transition: transform .12s ease, background .12s ease; }
.gram-shop-buy-btn:not(.disabled):active { transform: scale(.96); }

.rs-intro { font-size: 12px; line-height: 1.5; color: #b9a98e; margin: -4px 2px 12px; }
.rs-card { position: relative; display: flex; gap: 14px; padding: 14px; margin-bottom: 12px; border-radius: 16px; overflow: hidden;
  background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--cc) 22%, transparent) 0%, transparent 60%), linear-gradient(160deg, #1a1410, #100d0a);
  border: 1px solid color-mix(in srgb, var(--cc) 45%, transparent);
  box-shadow: 0 10px 26px -16px color-mix(in srgb, var(--cc) 80%, transparent), inset 0 1px 0 rgba(255,255,255,.04); }
.rs-card.sold { filter: grayscale(.7); opacity: .65; }
.rs-art { position: relative; flex: 0 0 84px; height: 84px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, color-mix(in srgb, var(--cc) 30%, transparent) 0%, rgba(0,0,0,.35) 70%);
  border: 1px solid color-mix(in srgb, var(--cc) 40%, transparent); }
.rs-art img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--cc) 70%, transparent)); animation: rsFloat 3.6s ease-in-out infinite; }
.rs-qty { position: absolute; bottom: 4px; right: 6px; font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 0 4px #000; }
@keyframes rsFloat { 50% { transform: translateY(-3px); } }
.rs-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rs-title { font-size: 15px; font-weight: 800; color: var(--cc); }
.rs-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.rs-tag { font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px;
  color: #ffd98a; background: rgba(255,207,86,.12); border: 1px solid rgba(255,207,86,.3); }
.rs-tag.epic { color: #d7b4ff; background: rgba(192,132,252,.14); border-color: rgba(192,132,252,.35); }
.rs-desc { font-size: 12px; line-height: 1.55; color: #c9bfae; }
.rs-desc b { color: #f3e6cc; }
.rs-limit { font-size: 11px; color: #b9a98e; }
.rs-limit-top { display: flex; justify-content: space-between; margin-bottom: 4px; }
.rs-limit-top b { color: #f3e6cc; }
.rs-bar { height: 6px; border-radius: 4px; background: rgba(255,255,255,.07); overflow: hidden; }
.rs-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--cc), #ffd98a); }
.rs-weekly { color: #7ee0c0; } .rs-weekly.used { color: #e8a06a; }
.rs-buy-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
.rs-price { display: inline-flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 900; color: #e8f6ff; }
.rs-price img { width: 20px; height: 20px; object-fit: contain; }
.rs-buy { padding: 9px 18px; border-radius: 10px; border: none; font-size: 13px; font-weight: 800; cursor: pointer; color: #1a1006;
  background: linear-gradient(135deg, #ffd98a, var(--cc)); box-shadow: 0 4px 14px -6px var(--cc); transition: transform .12s ease; }
.rs-buy:active { transform: scale(.96); }
.rs-buy.off { background: rgba(255,255,255,.08); color: #8a7e6c; box-shadow: none; cursor: default; }

/* ── Игровые окна вместо системных (gameConfirm/gamePrompt/gamePick) ────── */
.game-dialog-ov { z-index: 10050; }
.game-dialog { max-width: 330px; width: calc(100% - 40px); padding: 18px 16px 14px; animation: gdIn .16s ease-out; }
@keyframes gdIn { from { transform: translateY(8px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.game-dialog-title { font-size: 15px; font-weight: 800; color: #f2cf86; text-align: center; margin-bottom: 8px; }
.game-dialog-text { font-size: 14px; line-height: 1.5; color: #e2d8c6; text-align: center; white-space: pre-line; margin-bottom: 12px; max-height: 45vh; overflow-y: auto; }
.game-dialog-input { width: 100%; box-sizing: border-box; padding: 11px 12px; margin-bottom: 8px; border-radius: 10px; border: 1px solid rgba(230,148,25,.4);
  background: rgba(0,0,0,.35); color: #f5e6c8; font-size: 16px; font-weight: 700; text-align: center; outline: none; }
.game-dialog-input:focus { border-color: #e69419; box-shadow: 0 0 0 2px rgba(230,148,25,.2); }
.game-dialog-quick { display: flex; gap: 6px; margin-bottom: 10px; }
.game-dialog-quick button { flex: 1; padding: 7px 0; border-radius: 8px; border: 1px solid rgba(230,148,25,.3); background: rgba(230,148,25,.08); color: #e6af5e; font-weight: 800; font-size: 12px; cursor: pointer; }
.game-dialog-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; margin-bottom: 10px; }
.game-dialog-opt { padding: 11px 12px; border-radius: 10px; border: 1px solid rgba(216,207,190,.14); background: rgba(255,255,255,.04); color: #e8dcc6; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; }
.game-dialog-opt:active { background: rgba(230,148,25,.16); border-color: rgba(230,148,25,.45); }
.game-dialog-ok { background: linear-gradient(135deg, #2f5a3b, #3f7a4f); color: #d9ffe3; }
.game-dialog .imod-btns { margin-top: 2px; }
