/* =============================================================
   AFFPAPA EXPO '26 — conf.css
   Тактикульный HUD: тёмные полупрозрачные плашки с тонкими рамками
   и лаймовыми уголками-скобками (.cui-panel), моно считает всё.
   Зелёный #5be49b — живое (онлайн, свой ник, другие игроки),
   лайм #d8e84a — акценты панелей и курс, жёлтый — цель и патроны,
   красный — урон, таймер забега, сброс бейджа. Анимации:
   transform/opacity, ease-out, всё короче 300ms, выходы быстрее
   входов. CRT-слой (сканлайны, виньетка, pixelated) удалён.
   ============================================================= */

/* ---------- шрифты (self-hosted, те же файлы, что на сайте) ---------- */
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(/fonts/site/golos-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(/fonts/site/golos-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/site/jbmono-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/site/jbmono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- токены ---------- */
:root {
  --c-bg: #07080a;                    /* фон зала */
  --c-panel: rgba(10, 14, 16, .78);   /* плашки HUD */
  --c-panel-solid: #0c0f12;           /* карточка входа */
  --c-border: #2c343a;                /* тонкие рамки */
  --c-border-lit: #3d4750;            /* рамка под фокусом/ховером */
  --c-text: #e8eaed;                  /* основной текст */
  --c-dim: #8a929b;                   /* вторичный текст */
  --c-green: #5be49b;                 /* живое: онлайн, свой ник, игроки */
  --c-tg: #2aabee;                    /* синий — только Telegram-действия */
  --c-lime: #d8e84a;                  /* уголки панелей, курс, ресепшен */
  --c-yellow: #ffd24a;                /* текущая цель, патроны */
  --c-orange: #ff9f43;                /* вторые цифры патронов */
  --c-amber: #ffb020;                 /* внимание: HP 30–60 */
  --c-red: #ff5c5c;                   /* ошибки, урон, таймер забега */
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-text: 'Golos Text', system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1); /* сильный ease-out для входов */
}

/* ---------- база ---------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-text);
  overflow: hidden; /* страница — игра, скроллить нечего */
}

/* hidden должен побеждать наши display:flex */
[hidden] { display: none !important; }

/* Канвас движка */
#conf-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: var(--c-bg);
}

/* HUD прозрачен для мыши; интерактив включает pointer-events сам */
#conf-ui {
  font-family: var(--font-mono);
  pointer-events: none;
}

/* ---------- тактикульная плашка: тёмный фон, тонкая рамка,
   лаймовые уголки-скобки (TL и BR — псевдоэлементами) ---------- */
.cui-panel {
  position: relative;
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  padding: 6px 10px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--c-text);
}

.cui-panel::before,
.cui-panel::after {
  content: '';
  position: absolute;
  width: 7px;
  height: 7px;
  pointer-events: none;
}

.cui-panel::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--c-lime);
  border-left: 2px solid var(--c-lime);
}

.cui-panel::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--c-lime);
  border-right: 2px solid var(--c-lime);
}

/* те же уголки на больших карточках (join, инвентарь, результат) */
.cui-corners::before,
.cui-corners::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  pointer-events: none;
}

.cui-corners::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--c-lime);
  border-left: 2px solid var(--c-lime);
}

.cui-corners::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--c-lime);
  border-right: 2px solid var(--c-lime);
}

/* тусклая подпись внутри плашки: «СЕКТОР:», «ФРАГИ», «ЗАБЕГ»… */
.cui-p-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--c-dim);
}

/* ---------- прицел, хитмаркер ---------- */
.cui-crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 30;
  width: 3px;
  height: 3px;
  margin: -1.5px 0 0 -1.5px; /* transform не занимаем — он для анимаций */
  background: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  transition: opacity 120ms var(--ease-out);
}

/* на экране входа прицел ни к чему */
.is-join .cui-crosshair { opacity: 0; }

/* хитмаркер: 4 диагональных штриха-крестик вокруг прицела.
   Один узел, вспышку 120ms (opacity+scale) запускает WAAPI из ui.js */
.cui-hitmarker {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 31;
  width: 0;
  height: 0;
  opacity: 0; /* виден только на время вспышки */
  pointer-events: none;
}

.cui-hitmarker span {
  position: absolute;
  width: 8px;
  height: 2px;
  background: #fff;
  mix-blend-mode: difference; /* как прицел — читается на любом фоне */
}

.cui-hitmarker span:nth-child(1) { transform: translate(-11px, -10px) rotate(45deg); }
.cui-hitmarker span:nth-child(2) { transform: translate(3px, -10px) rotate(-45deg); }
.cui-hitmarker span:nth-child(3) { transform: translate(-11px, 8px) rotate(-45deg); }
.cui-hitmarker span:nth-child(4) { transform: translate(3px, 8px) rotate(45deg); }

/* вспышка урона: красная виньетка по краям. Один узел, вспышку 180ms
   (opacity ease-out) запускает WAAPI из ui.js — тут только фон */
.cui-dmg {
  position: fixed;
  inset: 0;
  z-index: 96; /* поверх всего HUD: урон должен читаться всегда */
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(255, 60, 60, .5) 100%);
}

/* ---------- верх-лево: два ряда компактных панелей ---------- */
.cui-tl {
  position: fixed;
  top: 14px;
  left: 18px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none;
  /* не наезжать на компас по центру — лишнее переносится вниз */
  max-width: max(300px, calc(50vw - 150px));
}

.cui-tl-row {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 6px;
}

.cui-tl .cui-panel {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: opacity 160ms var(--ease-out);
}

@starting-style {
  .cui-tl .cui-panel { opacity: 0; }
}

.cui-brand {
  font-weight: 700;
  letter-spacing: .06em;
}

.cui-brand-sub {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--c-dim);
}

.cui-badge-nick {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.cui-badge.is-guest .cui-badge-nick { color: var(--c-dim); }

.cui-sector-val {
  font-weight: 700;
  letter-spacing: .04em;
}

/* таймер забега: красный моно с миллисекундами */
.cui-runpanel .cui-run-time {
  font-weight: 700;
  color: var(--c-red);
}

/* маршрут «0/6», при 6/6 — зелёным */
.cui-progress-num { font-weight: 700; }

.cui-route.is-done .cui-progress-num { color: var(--c-green); }

.cui-gun-num,
.cui-acc-val,
.cui-streak-val { font-weight: 700; }

.cui-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-green);
  animation: cui-pulse 2s ease-in-out infinite;
}

.cui-online-num {
  color: var(--c-green);
  font-weight: 700;
}

.cui-online-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--c-dim);
}

@keyframes cui-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .3; }
}

/* ---------- верх-центр: компас + текущая цель ---------- */
.cui-topcenter {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%); /* позиционный, не анимируем */
  z-index: 41;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.cui-compass-wrap {
  padding: 2px 8px 0;
  line-height: 0;
}

.cui-compass { display: block; }

.cui-objective {
  transition: opacity 160ms var(--ease-out);
}

@starting-style {
  .cui-objective { opacity: 0; }
}

.cui-objective-text {
  font-weight: 700;
  color: var(--c-yellow);
  margin-left: 6px;
}

/* ---------- верх-право: миникарта ---------- */
.cui-map {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 40;
  padding: 4px;
  line-height: 0;
  pointer-events: none;
  transition: opacity 160ms var(--ease-out);
}

@starting-style {
  .cui-map { opacity: 0; }
}

.cui-map-canvas { display: block; }

/* ---------- HP-бар (в колонке чата, над логом) ---------- */
.cui-hp {
  width: 190px;
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-radius: 3px;
  padding: 7px 10px 9px;
  transition: opacity 160ms var(--ease-out);
}

@starting-style {
  .cui-hp { opacity: 0; }
}

.cui-hp-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--c-dim);
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
}

.cui-hp-num {
  color: var(--c-text);
  transition: color 120ms ease;
}

.cui-hp-track {
  height: 6px;
  background: #101216;
  border: 1px solid var(--c-border);
  border-radius: 2px;
  overflow: hidden;
}

/* ширина полоски — scaleX из ui.js: transform, не width */
.cui-hp-fill {
  height: 100%;
  background: var(--c-green);
  transform-origin: 0 50%;
  transform: scaleX(1);
  transition: transform 160ms var(--ease-out), background-color 120ms ease;
}

.cui-hp.is-mid .cui-hp-fill { background: var(--c-amber); }
.cui-hp.is-mid .cui-hp-num  { color: var(--c-amber); }

.cui-hp.is-low .cui-hp-fill {
  background: var(--c-red);
  animation: cui-hp-crit 1s ease-in-out infinite;
}

.cui-hp.is-low .cui-hp-num { color: var(--c-red); }

@keyframes cui-hp-crit {
  0%, 100% { opacity: 1; }
  50%      { opacity: .45; }
}

/* ---------- чат (низ-лево, над рядом подсказок-клавиш) ---------- */
.cui-chat {
  position: fixed;
  left: 18px;
  bottom: 52px;
  z-index: 40;
  width: min(400px, calc(100vw - 36px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.cui-chat-log {
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* свежие прижаты к низу, старое уходит вверх */
  align-items: flex-start;   /* плашки по ширине контента */
  gap: 4px;
  max-height: 276px;         /* ~9 строк */
  overflow: hidden;
  /* верх лога растворяется — маска, не цветной градиент */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 40px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 40px);
}

.cui-line {
  max-width: 100%;
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-radius: 2px;
  padding: 3px 8px;
  font-size: 12.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}

/* вход строки: лёгкий подъём + фейд */
@starting-style {
  .cui-line {
    opacity: 0;
    transform: translateY(4px);
  }
}

.cui-line-time {
  color: var(--c-dim);
  font-size: 11px;
  margin-right: 6px;
}

.cui-line-nick {
  font-weight: 700;
  margin-right: 6px;
}

/* свой ник — единственное зелёное в логе */
.cui-line-nick.is-self { color: var(--c-green); }

.cui-line.is-system { color: var(--c-dim); }

/* анонсы от EXPO: зелёный ник + лёгкий зелёный оттенок строки */
.cui-line.is-expo {
  background: rgba(10, 24, 17, .78);
  border-color: rgba(91, 228, 155, .3);
}

.cui-line.is-expo .cui-line-nick { color: var(--c-green); }

/* инпут чата — появляется мгновенно: действие клавиатурное и частое */
.cui-chat-inputwrap {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  background: rgba(7, 8, 10, .86);
  border: 1px solid var(--c-border);
  border-radius: 3px;
  padding: 8px 10px;
  transition: border-color 120ms ease;
}

.cui-chat-inputwrap:focus-within { border-color: var(--c-border-lit); }

.cui-chat-prompt {
  color: var(--c-dim);
  font-size: 13px;
  user-select: none;
}

.cui-chat-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text);
  caret-color: var(--c-green);
}

/* ---------- подсказки-клавиши (низ-лево) ---------- */
.cui-keys {
  position: fixed;
  left: 18px;
  bottom: 16px;
  z-index: 39;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  pointer-events: none;
  max-width: calc(100vw - 240px); /* не наезжать на патроны */
}

.cui-key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--c-dim);
  white-space: nowrap;
}

.cui-key kbd {
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--c-text);
}

/* ---------- подсказка (низ-центр, над рядом клавиш) ---------- */
.cui-hint {
  position: fixed;
  left: 50%;
  bottom: 52px;
  transform: translateX(-50%);
  z-index: 39;
  pointer-events: none;
  max-width: min(560px, calc(100vw - 420px)); /* не наезжать на чат */
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-radius: 3px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--c-dim);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cui-hint b { color: var(--c-text); font-weight: 700; }

.cui-hint kbd {
  font-family: inherit;
  font-size: 11px;
  color: var(--c-text);
  background: #101216;
  border: 1px solid var(--c-border);
  border-radius: 2px;
  padding: 1px 5px;
}

/* ---------- гостевая подсказка (низ-центр, режим без бейджа) ---------- */
.cui-guest {
  position: fixed;
  left: 50%;
  bottom: 52px;
  transform: translateX(-50%);
  z-index: 39;
  pointer-events: none;
  max-width: calc(100vw - 40px);
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-radius: 3px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--c-text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* мягкий «дыхательный» пульс: ambient-луп, не UI-транзишен */
  animation: cui-guest-pulse 2.6s ease-in-out infinite;
}

@keyframes cui-guest-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

/* ---------- тосты (верх-центр, под компасом и целью) ---------- */
.cui-toasts {
  position: fixed;
  top: 92px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.cui-toast {
  background: rgba(7, 8, 10, .86);
  border: 1px solid var(--c-border);
  border-radius: 3px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--c-text);
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}

/* вход тоста: слайд-даун */
@starting-style {
  .cui-toast {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* выход — короче входа */
.cui-toast.is-out {
  opacity: 0;
  transform: translateY(-6px);
  transition-duration: 140ms;
}

/* ---------- медаль за серию (верх-центр, под тостами) ---------- */
.cui-medal-wrap {
  position: fixed;
  top: 148px; /* ниже стека тостов — не толкаются */
  left: 0;
  right: 0;
  z-index: 69;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

/* появление/уход гоняет WAAPI из ui.js: вход 150ms, выход 120ms */
.cui-medal {
  font-family: var(--font-mono);
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1;
  /* пиксельная тень — как у заголовков входа/победы */
  text-shadow: 0 2px 10px rgba(0, 0, 0, .65);
}

/* уровни серии: жёлтый → оранжевый → красный → зелёный (godlike = живое) */
.cui-medal.is-click      { color: #e8e8f2; }
.cui-medal.is-conversion { color: #ffd25e; }
.cui-medal.is-deposit    { color: #ff9f43; }
.cui-medal.is-whale      { color: var(--c-green); }
.cui-medal.is-overflow   { color: var(--c-green); text-shadow: 0 0 20px rgba(91, 228, 155, 0.6); }

/* ---------- патроны (низ-право): плашка «AP-47 // EXPO» ---------- */
.cui-ammo {
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 40;
  padding: 8px 14px 10px;
  text-align: right;
  pointer-events: none;
  font-variant-numeric: tabular-nums; /* цифры не прыгают при стрельбе */
  transition: opacity 160ms var(--ease-out);
}

@starting-style {
  .cui-ammo { opacity: 0; }
}

.cui-ammo-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--c-dim);
  margin-bottom: 4px;
}

.cui-ammo-tag { font-weight: 500; }

.cui-ammo-nums {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  color: var(--c-yellow);
}

.cui-ammo-sep,
.cui-ammo-max {
  color: var(--c-orange);
  font-weight: 700;
}

.cui-ammo-sep { margin: 0 5px; }

.cui-ammo.is-empty .cui-ammo-cur { color: var(--c-red); }

/* «R — ПЕРЕЗАРЯДКА» при пустом магазине — мигает тем же steps-блинком */
.cui-ammo-hint {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--c-red);
  animation: cui-blink 1s steps(1) infinite;
}

/* перезарядка: «···» — точки пульсируют волной (только opacity) */
.cui-ammo-dot {
  display: inline-block;
  animation: cui-ammo-dot 900ms ease-in-out infinite;
}

.cui-ammo-dot:nth-child(2) { animation-delay: 150ms; }
.cui-ammo-dot:nth-child(3) { animation-delay: 300ms; }

@keyframes cui-ammo-dot {
  0%, 100% { opacity: .25; }
  30%      { opacity: 1; }
}

/* ---------- попапы ачивок (справа-верх, под миникартой) ---------- */
.cui-achv-stack {
  position: fixed;
  top: 172px;
  right: 18px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.cui-achv {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(7, 8, 10, .86);
  border: 1px solid var(--c-border);
  border-radius: 3px;
  padding: 8px 12px 8px 8px;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}

/* вход: slide-in справа */
@starting-style {
  .cui-achv {
    opacity: 0;
    transform: translateX(12px);
  }
}

/* выход — короче входа */
.cui-achv.is-out {
  opacity: 0;
  transform: translateX(8px);
  transition-duration: 140ms;
}

.cui-achv-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: #101216;
  border: 1px solid var(--c-border);
  border-radius: 2px;
  font-size: 15px;
  line-height: 1;
}

.cui-achv-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cui-achv-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--c-dim);
}

.cui-achv-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--c-text);
}

/* ---------- экран входа ---------- */
.cui-join {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(7, 8, 10, .88);
  pointer-events: auto;
  transition: opacity 140ms var(--ease-out);
}

@starting-style {
  .cui-join { opacity: 0; }
}

.cui-join.is-out { opacity: 0; }

.cui-join-card {
  position: relative; /* якорь для крестика закрытия */
  width: min(440px, 100%);
  background: var(--c-panel-solid);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 26px 28px 24px;
  box-shadow: 0 0 0 1px #000, 0 24px 64px rgba(0, 0, 0, .5);
  /* модалка — единственный случай, когда origin по центру */
  transform-origin: 50% 50%;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}

/* вход карточки: scale(0.98→1) + фейд, 200ms ease-out */
@starting-style {
  .cui-join-card {
    opacity: 0;
    transform: scale(0.98);
  }
}

.cui-join-conn {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--c-dim);
  margin-bottom: 16px;
  user-select: none;
}

@keyframes cui-blink {
  50% { opacity: 0; }
}

.cui-join-title {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: clamp(24px, 5vw, 30px);
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.1;
  color: #fff;
  /* пиксельная двойная тень-глитч, монохром */
  text-shadow: 0 2px 12px rgba(0, 0, 0, .65);
}

.cui-join-sub {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--c-dim);
}

.cui-join-sep {
  height: 1px;
  background: var(--c-border);
  margin: 20px 0;
}

.cui-join-field + .cui-join-field { margin-top: 14px; }

.cui-join-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-dim);
  margin-bottom: 8px;
}

.cui-join-input {
  display: block;
  width: 100%;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 3px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--c-text);
  caret-color: var(--c-green);
  transition: border-color 120ms ease;
}

.cui-join-input::placeholder { color: #565b64; }

.cui-join-input:hover { border-color: var(--c-border-lit); }

.cui-join-input:focus {
  outline: 2px solid var(--c-green);
  outline-offset: -1px;
  border-color: transparent;
}

.cui-join-note {
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--c-dim);
}

.cui-join-error {
  margin: 10px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--c-red);
}

.cui-join-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  background: var(--c-green);
  color: #07110b;
  border: 0;
  border-radius: 3px;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .12em;
  cursor: pointer;
  transition: transform 120ms var(--ease-out), background-color 120ms ease;
}

.cui-join-btn:active { transform: scale(0.97); }

.cui-join-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.cui-join-btn:disabled {
  opacity: .55;
  cursor: default;
  transform: none;
}

@media (hover: hover) and (pointer: fine) {
  .cui-join-btn:hover:not(:disabled) { background-color: #6ef0a9; }
}

/* форма необязательная — крестик «отойти от стойки» */
.cui-join-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

/* ---------- вход через Telegram (синий = TG-действие) ---------- */
/* базовая TG-кнопка: ресепшен, ссылка-переоткрытие, оффер стенда */
.cui-tg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--c-tg);
  color: #04121b;
  border: 0;
  border-radius: 3px;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms var(--ease-out), background-color 120ms ease;
}

.cui-tg-btn:active { transform: scale(0.97); }

.cui-tg-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.cui-tg-btn:disabled {
  opacity: .55;
  cursor: default;
  transform: none;
}

@media (hover: hover) and (pointer: fine) {
  .cui-tg-btn:hover:not(:disabled) { background-color: #3bb8f5; }
}

.cui-tg-ico { font-size: 15px; line-height: 1; }

/* блок TG над ручной формой */
.cui-tglogin { margin-bottom: 4px; }

.cui-tglogin-pending { margin-top: 10px; }

.cui-tglogin-open { margin-bottom: 10px; }

.cui-tglogin-wait {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--c-dim);
}

/* спиннер ожидания — постоянное вращение, потому linear */
.cui-tg-spinner {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--c-border);
  border-top-color: var(--c-tg);
  animation: cui-tg-spin 700ms linear infinite;
}

@keyframes cui-tg-spin { to { transform: rotate(360deg); } }

/* разделитель «— или вручную —» между TG и ручным вводом */
.cui-join-or {
  margin: 16px 0 2px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  color: #565b64;
}

/* лейбл Telegram с бейджем «✓ подтверждён» */
.cui-join-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cui-tg-verified {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: none;
  color: var(--c-tg);
}

/* подтверждённое поле Telegram — синяя рамка, не редактируется */
.cui-join-input[readonly] {
  border-color: var(--c-tg);
  background: rgba(42, 171, 238, .06);
  caret-color: transparent;
  cursor: default;
}

.cui-join-input[readonly]:focus { outline-color: var(--c-tg); }

.cui-join-keys {
  margin-top: 16px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.8;
  color: var(--c-dim);
}

.cui-join-keys b {
  color: var(--c-text);
  font-weight: 700;
}

/* ---------- общий крестик закрытия ---------- */
.cui-x {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: transparent;
  border: 1px solid var(--c-border);
  border-radius: 3px;
  color: var(--c-dim);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 120ms var(--ease-out), border-color 120ms ease, color 120ms ease;
}

.cui-x:active { transform: scale(0.97); }

.cui-x:focus-visible {
  outline: 2px solid var(--c-green);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .cui-x:hover {
    border-color: var(--c-border-lit);
    color: var(--c-text);
  }
}

/* ---------- инвентарь ---------- */
.cui-inv {
  position: fixed;
  inset: 0;
  z-index: 75; /* поверх победы и тостов, под экраном входа */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(7, 8, 10, .8);
  pointer-events: auto;
  transition: opacity 140ms var(--ease-out);
}

@starting-style {
  .cui-inv { opacity: 0; }
}

.cui-inv.is-out { opacity: 0; }

.cui-inv-card {
  width: min(520px, 100%);
  max-height: min(680px, calc(100vh - 40px));
  overflow-y: auto;
  background: var(--c-panel-solid);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 20px 22px 22px;
  box-shadow: 0 0 0 1px #000, 0 24px 64px rgba(0, 0, 0, .5);
  outline: 0;
  /* модалка — origin по центру */
  transform-origin: 50% 50%;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}

/* вход панели: scale(0.98→1) + фейд, 180ms ease-out */
@starting-style {
  .cui-inv-card {
    opacity: 0;
    transform: scale(0.98);
  }
}

.cui-inv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cui-inv-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .12em;
  color: #fff;
}

.cui-inv-sechead {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 18px 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--c-dim);
}

.cui-inv-count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--c-text);
}

.cui-inv-count.is-done { color: var(--c-green); }

.cui-inv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cui-inv-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px 10px;
  background: #0d0f13;
  border: 1px solid var(--c-border);
  border-radius: 3px;
  text-align: center;
}

.cui-inv-cell-icon {
  font-size: 20px;
  line-height: 1.2;
  color: var(--c-text);
}

.cui-inv-cell-name {
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--c-dim);
}

/* несобранный стенд — тусклый силуэт со знаком «?» */
.cui-inv-cell:not(.is-got) { opacity: .45; }

.cui-inv-cell.is-got { border-color: var(--c-border-lit); }

.cui-inv-cell.is-got .cui-inv-cell-name { color: var(--c-text); }

.cui-inv-check {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-green); /* собрано = живое */
}

.cui-inv-secrets {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cui-inv-secret {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: #0d0f13;
  border: 1px solid var(--c-border);
  border-radius: 3px;
  font-size: 12px;
  color: var(--c-dim);
}

.cui-inv-secret-icon {
  width: 18px;
  text-align: center;
  line-height: 1.2;
}

.cui-inv-secret.is-got { color: var(--c-text); }

.cui-inv-secret:not(.is-got) { opacity: .55; }

/* --- секция «ТИР» --- */
.cui-inv-subhead {
  margin: 12px 0 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--c-dim);
}

/* «Мои фраги: N · Лучшая серия: M» */
.cui-inv-mygun {
  padding: 7px 10px;
  background: #0d0f13;
  border: 1px solid var(--c-border);
  border-radius: 3px;
  font-size: 12.5px;
  color: var(--c-dim);
  font-variant-numeric: tabular-nums;
}

.cui-inv-mygun b {
  color: var(--c-text);
  font-weight: 700;
}

.cui-inv-statlabel { color: var(--c-dim); }

/* правая колонка строк тира: «42 ☠ · серия 7», «12 345 попаданий» */
.cui-inv-gunstat {
  color: var(--c-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cui-inv-gunstat b {
  color: var(--c-text);
  font-weight: 700;
}

.cui-inv-toplist,
.cui-inv-battlelist {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cui-inv-toprow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: #0d0f13;
  border: 1px solid var(--c-border);
  border-radius: 3px;
  font-size: 12.5px;
}

.cui-inv-toprow.is-first { border-color: var(--c-border-lit); }

.cui-inv-place {
  min-width: 26px;
  color: var(--c-dim);
  font-variant-numeric: tabular-nums;
}

.cui-inv-nick {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.cui-inv-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.cui-inv-empty {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--c-dim);
}

/* --- сброс бейджа (низ инвентаря) --- */
.cui-logout-btn {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255, 92, 92, .5);
  border-radius: 3px;
  color: var(--c-red);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 120ms var(--ease-out), border-color 120ms ease, background-color 120ms ease;
}

.cui-logout-btn:active { transform: scale(0.97); }

.cui-logout-btn:focus-visible {
  outline: 2px solid var(--c-red);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .cui-logout-btn:hover {
    border-color: var(--c-red);
    background-color: rgba(255, 92, 92, .08);
  }
}

.cui-logout-confirm {
  padding: 10px 12px;
  background: #0d0f13;
  border: 1px solid rgba(255, 92, 92, .5);
  border-radius: 3px;
  transition: opacity 160ms var(--ease-out);
}

@starting-style {
  .cui-logout-confirm { opacity: 0; }
}

.cui-logout-q {
  font-size: 12px;
  line-height: 1.5;
  color: var(--c-text);
}

.cui-logout-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.cui-logout-yes,
.cui-logout-no {
  border-radius: 3px;
  padding: 7px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 120ms var(--ease-out), border-color 120ms ease;
}

.cui-logout-yes {
  background: var(--c-red);
  border: 1px solid var(--c-red);
  color: #140707;
}

.cui-logout-no {
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c-dim);
}

.cui-logout-yes:active,
.cui-logout-no:active { transform: scale(0.97); }

.cui-logout-yes:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.cui-logout-no:focus-visible {
  outline: 2px solid var(--c-green);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .cui-logout-no:hover {
    border-color: var(--c-border-lit);
    color: var(--c-text);
  }
}

/* ---------- победа ---------- */
.cui-victory {
  position: fixed;
  inset: 0;
  z-index: 60; /* под инвентарём: кнопка «топ» открывает его поверх */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none; /* движение не блокируем — кликабельны только кнопки */
  transition: opacity 140ms var(--ease-out);
}

@starting-style {
  .cui-victory { opacity: 0; }
}

.cui-victory.is-out { opacity: 0; }

.cui-victory-card {
  position: relative;
  width: min(360px, 100%);
  background: rgba(7, 8, 10, .9);
  border: 1px solid rgba(91, 228, 155, .45);
  border-radius: 4px;
  padding: 26px 28px 24px;
  text-align: center;
  transform-origin: 50% 50%;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}

@starting-style {
  .cui-victory-card {
    opacity: 0;
    transform: scale(0.98);
  }
}

/* лёгкий glow-пульс рамки: анимируется только opacity псевдоэлемента */
.cui-victory-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border: 1px solid var(--c-green);
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(91, 228, 155, .28), inset 0 0 12px rgba(91, 228, 155, .1);
  opacity: .5;
  pointer-events: none;
  animation: cui-victory-glow 2.4s ease-in-out infinite;
}

@keyframes cui-victory-glow {
  0%, 100% { opacity: .25; }
  50%      { opacity: .8; }
}

.cui-victory-close {
  position: absolute;
  top: 10px;
  right: 10px;
}

.cui-victory-head {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--c-text);
}

.cui-victory-time {
  margin-top: 10px;
  font-size: clamp(44px, 8vw, 64px);
  font-weight: 800;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .65);
}

.cui-victory-place {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--c-dim);
  font-variant-numeric: tabular-nums;
}

.cui-victory-topbtn {
  margin-top: 16px;
  background: #101216;
  border: 1px solid var(--c-border);
  border-radius: 3px;
  color: var(--c-text);
  padding: 9px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 120ms var(--ease-out), border-color 120ms ease;
}

.cui-victory-topbtn:active { transform: scale(0.97); }

.cui-victory-topbtn:focus-visible {
  outline: 2px solid var(--c-green);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .cui-victory-topbtn:hover { border-color: var(--c-border-lit); }
}

/* ---------- результат battle run'а: WASTED / RUN COMPLETE ---------- */
.cui-runres {
  position: fixed;
  inset: 0;
  z-index: 61; /* над победой, под инвентарём */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none; /* движение не блокируем — кликабельны кнопка и крестик */
  transition: opacity 140ms var(--ease-out);
}

@starting-style {
  .cui-runres { opacity: 0; }
}

.cui-runres.is-out { opacity: 0; }

.cui-runres-card {
  position: relative;
  width: min(400px, 100%);
  background: rgba(7, 8, 10, .9);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 26px 28px 24px;
  text-align: center;
  transform-origin: 50% 50%; /* модалка — origin по центру */
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}

@starting-style {
  .cui-runres-card {
    opacity: 0;
    transform: scale(0.98);
  }
}

/* смерть — красная рамка, выживание — зелёная (как у победы) */
.cui-runres-card.is-dead  { border-color: rgba(255, 92, 92, .45); }
.cui-runres-card.is-alive { border-color: rgba(91, 228, 155, .45); }

.cui-runres-close {
  position: absolute;
  top: 10px;
  right: 10px;
}

/* WASTED: огромный красный моно с пиксель-тенью */
.is-dead .cui-runres-head {
  font-size: clamp(48px, 10vw, 84px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: .04em;
  color: var(--c-red);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .65);
}

/* RUN COMPLETE: скромная зелёная шапка, главным станет время */
.is-alive .cui-runres-head {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--c-green);
}

/* НОВЫЙ РЕКОРД: крупная зелёная шапка + свечение, короткий поп времени (после is-alive — перебивает) */
.cui-runres-card.is-record {
  border-color: rgba(91, 228, 155, .7);
  box-shadow: 0 0 40px rgba(91, 228, 155, .28);
}
.is-record .cui-runres-head {
  font-size: clamp(26px, 5.5vw, 44px);
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--c-green);
  text-shadow: 0 0 22px rgba(91, 228, 155, .55);
}
.is-record .cui-runres-time {
  color: var(--c-green);
  text-shadow: 0 0 26px rgba(91, 228, 155, .5);
}
@media (prefers-reduced-motion: no-preference) {
  .is-record .cui-runres-time { animation: cui-rec-pop 260ms ease-out; }
}
@keyframes cui-rec-pop { from { transform: scale(1.12); } to { transform: scale(1); } }

.cui-runres-time {
  margin-top: 10px;
  font-size: clamp(44px, 8vw, 64px);
  font-weight: 800;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .65);
}

.cui-runres-note {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--c-dim);
  font-variant-numeric: tabular-nums; /* «Ты продержался 1:23» */
}

.cui-runres-btn {
  margin-top: 16px;
  background: #101216;
  border: 1px solid var(--c-border);
  border-radius: 3px;
  color: var(--c-text);
  padding: 9px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 120ms var(--ease-out), border-color 120ms ease;
}

.cui-runres-btn:active { transform: scale(0.97); }

.cui-runres-btn:focus-visible {
  outline: 2px solid var(--c-green);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .cui-runres-btn:hover { border-color: var(--c-border-lit); }
}

/* ---------- маркетплейс слотов: форма занятия ---------- */
.cui-slotform {
  position: fixed;
  inset: 0;
  z-index: 78; /* над инвентарём и оверлеями забега, под экраном входа */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(7, 8, 10, .88);
  pointer-events: auto;
  transition: opacity 140ms var(--ease-out);
}

@starting-style {
  .cui-slotform { opacity: 0; }
}

.cui-slotform.is-out { opacity: 0; }

/* под модалкой формы прицел ни к чему — как на экране входа */
.is-slotform .cui-crosshair { opacity: 0; }

.cui-slotform-card {
  position: relative; /* якорь для крестика закрытия */
  width: min(460px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--c-panel-solid);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 26px 28px 24px;
  box-shadow: 0 0 0 1px #000, 0 24px 64px rgba(0, 0, 0, .5);
  /* модалка — origin по центру */
  transform-origin: 50% 50%;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}

/* вход карточки: scale(0.98→1) + фейд, 200ms ease-out — как у ресепшена */
@starting-style {
  .cui-slotform-card {
    opacity: 0;
    transform: scale(0.98);
  }
}

.cui-slotform-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.cui-x:disabled {
  opacity: .4;
  cursor: default;
  transform: none;
}

.cui-slotform-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.cui-slotform-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(20px, 4.5vw, 26px);
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .65);
}

.cui-slotform-code { color: var(--c-lime); }

/* бейдж типа слота: БОЛЬШОЙ / МАЛЫЙ / БАННЕР */
.cui-slot-type {
  flex-shrink: 0;
  padding: 3px 8px;
  border: 1px solid var(--c-lime);
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--c-lime);
  white-space: nowrap;
}

/* лейбл со счётчиком: подпись слева, «N/120» справа */
.cui-slot-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.cui-slot-count {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--c-dim);
  font-variant-numeric: tabular-nums;
}

.cui-slot-count.is-full { color: var(--c-amber); }

.cui-slot-opt {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: #565b64;
}

.cui-slot-ta {
  resize: none;
  line-height: 1.5;
}

/* подпись под полем канала */
.cui-slot-subnote {
  margin: 6px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--c-dim);
}

/* прогресс генерации: жёлтая строка, точки пульсируют волной */
.cui-slot-progress {
  margin: 12px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--c-yellow);
  font-variant-numeric: tabular-nums;
}

.cui-slot-progress .cui-slot-dot {
  display: inline-block;
  animation: cui-ammo-dot 900ms ease-in-out infinite;
}

.cui-slot-progress .cui-slot-dot:nth-child(2) { animation-delay: 150ms; }
.cui-slot-progress .cui-slot-dot:nth-child(3) { animation-delay: 300ms; }

/* главная кнопка — лаймовая (акцент маркетплейса, не «деньги») */
.cui-slotform-btn {
  background: var(--c-lime);
  color: #14150a;
}

@media (hover: hover) and (pointer: fine) {
  .cui-slotform-btn:hover:not(:disabled) { background-color: #e6f463; }
}

.cui-slotform-cancel {
  display: block;
  width: 100%;
  margin-top: 8px;
  background: transparent;
  border: 1px solid var(--c-border);
  border-radius: 3px;
  color: var(--c-dim);
  padding: 9px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  cursor: pointer;
  transition: transform 120ms var(--ease-out), border-color 120ms ease, color 120ms ease;
}

.cui-slotform-cancel:active:not(:disabled) { transform: scale(0.97); }

.cui-slotform-cancel:disabled {
  opacity: .5;
  cursor: default;
}

.cui-slotform-cancel:focus-visible {
  outline: 2px solid var(--c-green);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .cui-slotform-cancel:hover:not(:disabled) {
    border-color: var(--c-border-lit);
    color: var(--c-text);
  }
}

/* ---------- карточка стенда (низ-центр, движение не блокирует) ---------- */
.cui-booth {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%); /* позиционный, не анимируем */
  z-index: 45;
  width: min(340px, calc(100vw - 36px));
  pointer-events: none; /* кликабельны только ссылка, кнопки и крестик */
  transition: opacity 140ms var(--ease-out);
}

@starting-style {
  .cui-booth { opacity: 0; }
}

.cui-booth.is-out { opacity: 0; }

.cui-booth-card {
  position: relative;
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  padding: 14px 16px;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}

/* вход карточки: подъём + фейд (не модалка — лёгкий slide-up) */
@starting-style {
  .cui-booth-card {
    opacity: 0;
    transform: translateY(8px);
  }
}

.cui-booth-close {
  position: absolute;
  top: 8px;
  right: 8px;
}

.cui-booth-brand {
  padding-right: 30px; /* не заезжать под крестик */
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.2;
  color: #fff;
  overflow-wrap: anywhere;
}

.cui-booth-text {
  margin-top: 6px;
  font-family: var(--font-text);
  font-size: 13px;
  line-height: 1.55;
  color: #c7cbd1;
  overflow-wrap: anywhere;
}

.cui-booth-linkrow {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.cui-booth-link {
  display: inline-block;
  background: #101216;
  border: 1px solid var(--c-border);
  border-radius: 3px;
  color: var(--c-text);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 120ms var(--ease-out), border-color 120ms ease;
}

.cui-booth-link:active { transform: scale(0.97); }

.cui-booth-link:focus-visible {
  outline: 2px solid var(--c-green);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .cui-booth-link:hover { border-color: var(--c-border-lit); }
}

/* домен рядом с кнопкой — юзер видит, куда пойдёт */
.cui-booth-domain {
  min-width: 0;
  font-size: 11px;
  color: var(--c-dim);
  overflow-wrap: anywhere;
}

/* ---------- оффер стенда в Telegram ---------- */
.cui-booth-offerrow {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* кнопка оффера — TG-синяя, кликабельна (карточка pointer-events:none) */
.cui-booth-offer {
  pointer-events: auto;
  padding: 10px 14px;
  font-size: 13px;
  letter-spacing: .06em;
}

/* прямая ссылка на канал — вторичная, монохром, всегда доступна */
.cui-booth-channel {
  align-self: flex-start;
  pointer-events: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--c-tg);
  text-decoration: none;
  transition: opacity 120ms ease;
}

.cui-booth-channel:focus-visible {
  outline: 2px solid var(--c-tg);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .cui-booth-channel:hover { opacity: .8; }
}

/* статус после клика: sent — зелёный, already — серый, need — янтарь */
.cui-booth-offerstatus {
  font-family: var(--font-text);
  font-size: 12px;
  line-height: 1.4;
  color: var(--c-dim);
  transition: opacity 160ms var(--ease-out);
}

@starting-style {
  .cui-booth-offerstatus { opacity: 0; }
}

.cui-booth-offerstatus.is-sent { color: var(--c-green); font-weight: 600; }
.cui-booth-offerstatus.is-already { color: var(--c-dim); }
.cui-booth-offerstatus.is-need { color: var(--c-amber); }

.cui-booth-ownrow { margin-top: 10px; }

.cui-booth-release {
  background: transparent;
  border: 1px solid rgba(255, 92, 92, .5);
  border-radius: 3px;
  color: var(--c-red);
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 120ms var(--ease-out), border-color 120ms ease, background-color 120ms ease;
}

.cui-booth-release:active { transform: scale(0.97); }

.cui-booth-release:focus-visible {
  outline: 2px solid var(--c-red);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .cui-booth-release:hover {
    border-color: var(--c-red);
    background-color: rgba(255, 92, 92, .08);
  }
}

.cui-booth-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #0d0f13;
  border: 1px solid rgba(255, 92, 92, .5);
  border-radius: 3px;
  transition: opacity 160ms var(--ease-out);
}

@starting-style {
  .cui-booth-confirm { opacity: 0; }
}

.cui-booth-q {
  flex: 1;
  min-width: 0;
  font-family: var(--font-text);
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--c-text);
}

/* ---------- мобильная заглушка ---------- */
#conf-mobile {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-text);
}

.cm-card {
  width: 100%;
  max-width: 480px;
}

.cm-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--c-dim);
  margin-bottom: 18px;
}

.cm-title {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: clamp(30px, 9vw, 40px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: .01em;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .65);
}

.cm-text {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.6;
  color: #c7cbd1;
}

.cm-url {
  font-family: var(--font-mono);
  font-size: 14px;
  color: #fff;
}

.cm-copy {
  display: inline-block;
  background: #101216;
  border: 1px solid var(--c-border);
  border-radius: 3px;
  color: var(--c-text);
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  cursor: pointer;
  transition: transform 120ms var(--ease-out), border-color 120ms ease;
}

.cm-copy:active { transform: scale(0.97); }

.cm-copy:focus-visible {
  outline: 2px solid var(--c-green);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .cm-copy:hover { border-color: var(--c-border-lit); }
}

.cm-footer {
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--c-dim);
}

/* тост заглушки: тот же слайд-даун, что и в HUD */
.cm-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 110;
  transform: translate(-50%, -10px);
  opacity: 0;
  background: rgba(7, 8, 10, .86);
  border: 1px solid var(--c-border);
  border-radius: 3px;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--c-text);
  pointer-events: none;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.cm-toast.is-in {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- голосовой чат (proximity voice, voice.js) ---------- */
/* Иконка микрофона тускла в OFF, оживает в эфире; talking = зелёный (живое). */
.cui-voice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--c-dim);
}

.cui-voice-ico {
  font-size: 12px;
  filter: grayscale(1);
  opacity: .55;
}

.cui-voice-state {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

.cui-voice.is-on { color: var(--c-text); }
.cui-voice.is-on .cui-voice-ico { filter: none; opacity: 1; }

/* реально передаём микрофон — зелёная рамка и текст */
.cui-voice.is-talk { color: var(--c-green); border-color: var(--c-green); }
.cui-voice.is-talk .cui-voice-state { color: var(--c-green); }
.cui-voice.is-talk .cui-voice-ico { filter: none; opacity: 1; }

.cui-voice.has-speakers { border-color: var(--c-border-lit); }

.cui-voice-speakers {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cui-voice-speaker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--c-green);
}

.cui-voice-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-green);
  animation: cui-pulse 1.2s ease-in-out infinite;
}

/* ---------- меньше движения ---------- */
@media (prefers-reduced-motion: reduce) {
  .cui-online-dot,
  .cui-voice-dot,
  .cui-guest,
  .cui-ammo-hint,
  .cui-ammo-dot,
  .cui-slot-progress .cui-slot-dot,
  .cui-tg-spinner,
  .cui-hp.is-low .cui-hp-fill { animation: none; }

  /* glow победы не пульсирует — стоит на месте */
  .cui-victory-card::after {
    animation: none;
    opacity: .45;
  }

  /* движение убираем, короткие фейды оставляем */
  .cui-line,
  .cui-toast,
  .cui-achv,
  .cui-inv,
  .cui-inv-card,
  .cui-victory,
  .cui-victory-card,
  .cui-join,
  .cui-join-card,
  .cui-runres,
  .cui-runres-card,
  .cui-slotform,
  .cui-slotform-card,
  .cui-booth,
  .cui-booth-card,
  .cui-booth-confirm,
  .cm-toast {
    transition-property: opacity;
  }

  /* полоска HP не едет — прыгает сразу, цвет остаётся */
  .cui-hp-fill { transition-property: background-color; }

  /* и не даём слайдам прыгать скачком */
  .cui-achv.is-out { transform: none; }

  .cm-toast { transform: translate(-50%, 0); }
}
