:root {
  --bg: #06070a;
  --panel: rgba(20, 23, 29, .72);
  --panel2: #1b1f26;
  --line: rgba(255, 255, 255, .09);
  --line2: rgba(255, 255, 255, .16);
  --text: #dce3ee;
  --dim: #7b8494;
  --accent: #7fd6ff;
  --accent2: #4aa8d8;
  --danger: #ff4d4d;
  --warn: #ffca3a;
  --ok: #7bd88f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  user-select: none; -webkit-user-select: none;
}

/* мышь в игре не нужна: прячем курсор над полем боя */
canvas#game { display: block; width: 100vw; height: 100vh; cursor: none; }
.hidden { display: none !important; }

/* ================= HUD ================= */
#hud { position: fixed; inset: 0; pointer-events: none; }

#vignette {
  position: absolute; inset: 0;
  box-shadow: inset 0 0 170px 18px rgba(20,8,10,.5);
  transition: box-shadow .12s linear;
}
/* КРОВАВАЯ ПЕЛЕНА. Раньше это было ровное красное кольцо по краям -
   аккуратное и неживое. Теперь по краям расплываются несколько разных
   пятен: слой выглядит как кровь на стекле, а не как виньетка. */
#hurt {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background:
    radial-gradient(closest-side at 6% 18%, rgba(168,16,22,.62), rgba(120,8,12,0) 72%),
    radial-gradient(closest-side at 94% 26%, rgba(150,12,18,.58), rgba(120,8,12,0) 70%),
    radial-gradient(closest-side at 14% 82%, rgba(140,10,16,.52), rgba(120,8,12,0) 74%),
    radial-gradient(closest-side at 86% 76%, rgba(176,18,24,.55), rgba(120,8,12,0) 70%),
    radial-gradient(closest-side at 48% 4%, rgba(150,12,18,.5), rgba(120,8,12,0) 76%),
    radial-gradient(closest-side at 52% 98%, rgba(150,12,18,.5), rgba(120,8,12,0) 76%),
    radial-gradient(circle at 50% 50%, rgba(255,0,0,0) 38%, rgba(126,8,14,.72) 100%);
  transition: opacity .18s linear;
  animation: hurtPulse 2.6s ease-in-out infinite;
}
@keyframes hurtPulse {
  0%, 100% { filter: saturate(1) blur(0px); transform: scale(1); }
  50%      { filter: saturate(1.15) blur(.4px); transform: scale(1.012); }
}
/* маньяку то же пятно светится теплее: это не боль, а удовольствие от удара */
#hurt.kill {
  background:
    radial-gradient(closest-side at 10% 20%, rgba(206,44,38,.5), rgba(150,10,14,0) 70%),
    radial-gradient(closest-side at 90% 24%, rgba(206,44,38,.5), rgba(150,10,14,0) 70%),
    radial-gradient(closest-side at 50% 96%, rgba(190,26,26,.45), rgba(150,10,14,0) 74%),
    radial-gradient(circle at 50% 55%, rgba(255,60,40,0) 30%, rgba(168,16,18,.6) 100%);
}

/* ЯРОСТЬ ПОСЛЕ ВЫХОДА. Сущность только что выпустила его в мир: по краям
   экрана бьётся тёмная кровь, кадр едва заметно дышит. Всё это гаснет
   вместе с прибавкой к скорости - к седьмой секунде экран чист. */
#rage {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,0,0,0) 34%, rgba(96,4,10,.85) 100%),
    radial-gradient(closest-side at 50% 0%, rgba(180,18,22,.5), rgba(120,8,12,0) 70%),
    radial-gradient(closest-side at 50% 100%, rgba(180,18,22,.5), rgba(120,8,12,0) 70%);
  mix-blend-mode: screen;
  transition: opacity .2s linear;
  animation: ragePulse 1.15s ease-in-out infinite;
}
@keyframes ragePulse {
  0%, 100% { transform: scale(1); filter: saturate(1.1); }
  50%      { transform: scale(1.02); filter: saturate(1.45) brightness(1.12); }
}

/* отходняк Легиона: в глазах плывёт */
#daze {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 50%, rgba(150,90,220,.10) 30%, rgba(90,40,140,.45) 100%);
  backdrop-filter: blur(3px);
  transition: opacity .2s linear;
}

#topbar {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 9px; align-items: center;
}
.pill {
  background: rgba(12,14,18,.7); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; letter-spacing: .05em;
  display: flex; gap: 8px; align-items: center;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.pill .lbl { color: var(--dim); font-size: 10px; letter-spacing: .14em; }
.pill.danger { border-color: var(--danger); color: #ffb3b3; animation: pulse 1s infinite; }
.ghostpill { color: var(--dim); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .55 } }

#genPips { display: inline-flex; gap: 4px; }
.gp { width: 12px; height: 12px; border-radius: 3px; border: 1px solid #4a5160; background: #1b1f27; position: relative; overflow: hidden; }
.gp i { position: absolute; left: 0; bottom: 0; width: 100%; background: var(--warn); display: block; transition: height .2s; }
.gp.done { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 8px rgba(123,216,143,.5); }

#roster { position: absolute; top: 14px; left: 14px; display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.rname {
  background: rgba(12,14,18,.66); border: 1px solid var(--line); border-left-width: 3px;
  border-radius: 6px; padding: 4px 9px; min-width: 178px;
  display: flex; justify-content: space-between; gap: 8px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
/* ИМЯ СЖИМАЕТСЯ, СОСТОЯНИЕ - НЕТ. Длинное имя раньше распирало строку и
   подъезжало вплотную к «крюк I · 1/3»: на узком экране это читалось как
   каша. Теперь имя ужимается с многоточием, а состояние всегда целое. */
.rname > span:first-child {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rname > span.tag { flex: 0 0 auto; white-space: nowrap; }
.rname.h2 { border-left-color: var(--ok); }
.rname.h1 { border-left-color: var(--warn); }
.rname.h0 { border-left-color: var(--danger); }
.rname.gone { opacity: .35; border-left-color: #555; }
.cue.haste { color: #d3aaff; border-color: rgba(196,127,255,.5); }
.rname .tag { color: var(--dim); font-size: 10px; }
/* полоса времени на крюке: тикает прямо в списке игроков */
.rname.hooked { position: relative; padding-bottom: 7px; border-left-color: #ff8a8a; }
.rname .rhook {
  position: absolute; left: 6px; right: 6px; bottom: 3px; height: 3px;
  background: rgba(255,255,255,.10); border-radius: 2px; overflow: hidden;
}
.rname .rhook b {
  display: block; height: 100%; background: linear-gradient(90deg, #ff8a8a, #ff5a5a);
  transition: width .2s linear;
}
.rname.hookLow { border-left-color: #ff5a5a; animation: pulse 1s infinite; }
.rname.hookLow .rhook b { background: #ff3b3b; }
/* цветная точка персонажа - та же, что на карточке в меню */
.rname .rdot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
  box-shadow: 0 0 6px currentColor;
}
/* разряд Доктора: экран трещит электричеством */
#zap {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background:
    repeating-linear-gradient(105deg, rgba(150,205,255,.16) 0 2px, rgba(0,0,0,0) 2px 9px),
    radial-gradient(circle at 50% 50%, rgba(120,190,255,0) 35%, rgba(90,160,255,.5) 100%);
  mix-blend-mode: screen;
}
#zap.on { animation: zapFlick .75s steps(2, end) 1; }
@keyframes zapFlick {
  0%   { opacity: .95; filter: hue-rotate(0deg); }
  18%  { opacity: .35; }
  34%  { opacity: .85; filter: hue-rotate(-20deg); }
  52%  { opacity: .25; }
  70%  { opacity: .6; }
  100% { opacity: 0; }
}

/* ================= НАХОДКА В ШКАФЧИКЕ ================= */
#supplyBox {
  /* z-index 19: выше сенсорного слоя (15), иначе на телефоне по карточкам
     нельзя ткнуть - палец попадает в невидимую зону джойстика */
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 19; width: min(560px, 92vw);
  padding: 16px 18px; border-radius: 16px;
  background: rgba(12,15,20,.92);
  border: 1px solid rgba(140,220,255,.35);
  box-shadow: 0 20px 60px rgba(0,0,0,.7), 0 0 40px -10px rgba(140,220,255,.35);
  backdrop-filter: blur(14px);
  animation: supIn .28s cubic-bezier(.2,.9,.3,1.3) both;
}
#supplyBox.hidden { display: none; }
@keyframes supIn { from { opacity: 0; transform: translate(-50%,-46%) scale(.96); } to { opacity: 1; transform: translate(-50%,-50%); } }
.supTitle {
  font-size: 11px; letter-spacing: .22em; color: #8fd6ff; text-align: center; margin-bottom: 12px;
}
.supRow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.supCard {
  position: relative; text-align: left; cursor: pointer; color: var(--text);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.16); border-radius: 12px; padding: 12px 14px 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 6px 16px rgba(0,0,0,.4);
  transition: transform .14s cubic-bezier(.2,.9,.3,1.2), border-color .2s, box-shadow .2s, background .2s;
}
.supCard:hover {
  transform: translateY(-3px); border-color: rgba(140,220,255,.6);
  box-shadow: 0 14px 30px rgba(0,0,0,.5), 0 0 22px -8px rgba(140,220,255,.7);
}
.supCard > b { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 5px; }
/* ВЫБРАННЫЙ ВАРИАНТ ВИДНО. Раньше оба лежали одинаково, и было непонятно,
   что выбрано и чем подтверждать. */
.supCard.sel {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(127,214,255,.18), rgba(127,214,255,.05));
  box-shadow: 0 0 20px -4px rgba(127,214,255,.55);
  transform: translateY(-2px);
}
.supCard.sel em { color: var(--accent); border-color: rgba(127,214,255,.6); }
/* патроны обреза цифрой рядом с названием предмета */
#itemCharges { margin-left: auto; font-size: 11px; color: var(--accent); letter-spacing: .04em; }
#itemCharges.low { color: var(--warn); }

.supHint { margin-top: 10px; font-size: 11px; color: var(--dim); text-align: center; letter-spacing: .04em; }
body.touchOn .supHint { font-size: 12px; }
.supCard span { display: block; font-size: 11.5px; color: var(--dim); line-height: 1.45; }
.supCard em {
  position: absolute; top: 8px; right: 10px; font-style: normal;
  font-size: 10.5px; color: #8fd6ff; border: 1px solid rgba(140,220,255,.45);
  border-radius: 5px; padding: 1px 6px;
}

/* ================= НАБЛЮДАТЕЛЬ ================= */
#specBar {
  position: fixed; left: 50%; bottom: 74px; transform: translateX(-50%);
  z-index: 19; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 14px;
  background: rgba(14,16,21,.86);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 14px 40px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
  animation: specIn .3s cubic-bezier(.2,.9,.3,1.2) both;
}
#specBar.hidden { display: none; }
/* на телефоне полоса наблюдателя уходит наверх: внизу кнопки */
body.touchOn #specBar {
  bottom: auto; top: max(56px, calc(env(safe-area-inset-top) + 50px));
}
#specBar .specTag {
  font-size: 10.5px; letter-spacing: .2em; color: #8e97a6; padding-right: 4px;
}
#specBar .btn { padding: 9px 16px; font-size: 13px; }
@keyframes specIn { from { opacity: 0; transform: translateX(-50%) translateY(14px); } to { opacity: 1; transform: translateX(-50%); } }

/* ================= МЕМЕНТО: ролик из папки video ================= */
#mementoBox {
  position: fixed; inset: 0; z-index: 60;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  animation: memFade .35s ease-out 1;
}
#mementoBox.hidden { display: none; }
#mementoVid {
  width: 100%; height: 100%; object-fit: cover;
  background: #000;
}
/* киношные полосы поверх ролика - как в рисованной сцене */
#mementoBox::before, #mementoBox::after {
  content: ''; position: absolute; left: 0; right: 0; height: 8vh;
  background: #000; pointer-events: none;
}
#mementoBox::before { top: 0; }
#mementoBox::after { bottom: 0; }
#mementoCaption {
  position: absolute; left: 0; right: 0; top: 10vh;
  text-align: center; pointer-events: none;
  text-shadow: 0 2px 14px rgba(0,0,0,.9);
  animation: memCap .8s ease-out .9s both;
}
#mementoCaption b {
  display: block; font-size: 30px; font-weight: 600; letter-spacing: .12em;
  color: #f2f5fa;
}
#mementoCaption span { display: block; margin-top: 6px; font-size: 15px; color: rgba(214,222,235,.85); }
@keyframes memFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes memCap { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ульта маньяка: по экрану проходит волна ярости - у всех на карте */
#ultWave {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 50%, rgba(196,127,255,0) 30%, rgba(150,40,190,.55) 100%);
}
#ultWave.on { animation: ultPulse 1.5s ease-out 1; }
@keyframes ultPulse {
  0%   { opacity: 0; transform: scale(1.35); }
  12%  { opacity: 1; transform: scale(1); }
  55%  { opacity: .5; }
  100% { opacity: 0; transform: scale(1.05); }
}

/* маньяк в шапке: имя и архетип, цветом персонажа */
#topbar .pill { white-space: nowrap; }
#killerPill .kdot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px;
}

#cues { position: absolute; top: 58px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.cue {
  background: rgba(12,14,18,.8); border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 10px; font-size: 11px; letter-spacing: .16em; color: #9fd0ff; animation: pulse 1.4s infinite;
}
.cue.warn { color: var(--warn); border-color: #5c4a1c; }
.cue.blood { color: #ff6b6b; border-color: #6b1f22; background: rgba(60,10,12,.55); letter-spacing: .12em; }

#centerMsg {
  position: absolute; top: 20%; left: 50%; transform: translateX(-50%) scale(.96);
  font-size: 23px; letter-spacing: .12em; text-align: center; text-shadow: 0 2px 16px #000;
  opacity: 0; transition: opacity .25s, transform .25s;
}
#centerMsg.show { opacity: 1; transform: translateX(-50%) scale(1); }

#bottom { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); width: min(520px, 44vw); text-align: center; z-index: 5; }
#prompt {
  display: inline-block; font-size: 17px; font-weight: 600; color: #eaf6ff;
  text-shadow: 0 2px 10px #000; min-height: 24px; letter-spacing: .02em;
  padding: 5px 16px; border-radius: 999px;
}
#prompt:not(:empty) {
  background: rgba(10,14,20,.78); border: 1px solid rgba(127,214,255,.45);
  box-shadow: 0 6px 24px rgba(0,0,0,.5), 0 0 18px -6px var(--accent);
  animation: promptPulse 1.6s ease-in-out infinite;
}
@keyframes promptPulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(0,0,0,.5), 0 0 12px -6px var(--accent); }
  50% { box-shadow: 0 6px 24px rgba(0,0,0,.5), 0 0 26px -4px var(--accent); }
}
#stateLine { font-size: 13.5px; color: #aeb6c4; margin-top: 8px; min-height: 18px; text-shadow: 0 2px 6px #000; }
#actionBar {
  position: relative; height: 30px; margin: 10px auto 0; border: 1px solid rgba(127,214,255,.5);
  border-radius: 15px; overflow: hidden; background: rgba(8,10,14,.9);
  width: min(420px, 40vw);
  box-shadow: 0 8px 30px rgba(0,0,0,.55), 0 0 22px -8px var(--accent);
}
#actionFill {
  position: absolute; inset: 0; width: 0%;
  background: linear-gradient(90deg, #2f6f96, var(--accent));
  transition: width .06s linear;
}
#actionFill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.28), transparent 55%);
}
#actionBar span {
  position: relative; font-size: 13px; font-weight: 700; line-height: 28px;
  letter-spacing: .14em; color: #f2f8ff; text-shadow: 0 1px 4px #000;
}
#actionBar.warn { border-color: rgba(255,202,58,.6); box-shadow: 0 8px 30px rgba(0,0,0,.55), 0 0 22px -8px var(--warn); }
#actionBar.warn #actionFill { background: linear-gradient(90deg, #8a6a14, var(--warn)); }
#actionBar.danger {
  border-color: rgba(255,90,90,.65);
  box-shadow: 0 8px 30px rgba(0,0,0,.55), 0 0 26px -6px var(--danger);
  animation: pulse 0.9s infinite;
}
#actionBar.danger #actionFill { background: linear-gradient(90deg, #7d1418, var(--danger)); }

#minimap {
  position: absolute; right: 14px; bottom: 14px; width: 200px; height: 200px;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(6,7,10,.8);
}
/* ---- крюк / вырывание ---- */
#hookPanel {
  position: absolute; left: 50%; bottom: 128px; transform: translateX(-50%);
  width: min(460px, 62vw); padding: 10px 14px 8px;
  background: rgba(12,14,18,.86); border: 1px solid rgba(255,120,110,.45);
  border-radius: 12px; backdrop-filter: blur(6px);
  box-shadow: 0 10px 34px rgba(0,0,0,.55);
}
#hookPanel .hpHead {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; letter-spacing: .18em; color: #ffb0a4; margin-bottom: 8px;
}
#hookPanel .hpHead #hpStage { color: var(--dim); letter-spacing: .1em; }
#hookPanel .hpRow { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
#hookPanel .hpLbl { font-size: 10px; letter-spacing: .1em; color: var(--dim); width: 176px; flex: none; }
#hookPanel .hpVal { font-size: 11px; color: #e6ecf5; width: 46px; text-align: right; flex: none; font-variant-numeric: tabular-nums; }
#hookPanel .hpTrack {
  flex: 1; height: 8px; background: rgba(20,22,28,.9);
  border: 1px solid var(--line); border-radius: 5px; overflow: hidden;
}
#hookPanel .hpTrack i { display: block; height: 100%; width: 0%; transition: width .12s linear; }
#hpMainFill { background: linear-gradient(90deg, #7d1418, #ff6b6b); }
#hpEscFill { background: linear-gradient(90deg, #8a6a2a, #ffd166); }
#hpStrFill { background: linear-gradient(90deg, #2f6f96, #7fd6ff); }
#hpStrRow.low #hpStrFill { background: linear-gradient(90deg, #7d1418, #ff4d4d); }
#hpStrRow.low .hpLbl { color: #ff8686; }
/* метка середины: там кончается первая стадия */
#hookPanel .hpRow:first-of-type .hpTrack { position: relative; }
#hookPanel .hpRow:first-of-type .hpTrack::after {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px;
  background: rgba(255,255,255,.35);
}
#hookPanel.stage2 { border-color: rgba(255,90,90,.75); }
#hookPanel.ready { border-color: rgba(255,209,102,.9); animation: pulse 1s infinite; }
#hookPanel.ready #hpEscFill { background: linear-gradient(90deg, #ffd166, #fff2b0); }
#hookPanel .hpHint { font-size: 11px; color: #cfd8e6; text-align: center; margin-top: 4px; min-height: 14px; }
#hookPanel.ready .hpHint { color: #ffe08a; font-weight: 700; letter-spacing: .06em; }
/* мигание рамки перед скилл-чеком */
#scWarn {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  box-shadow: inset 0 0 90px rgba(255,255,255,.5);
  transition: opacity .12s;
}

#skillcheck { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); text-align: center; }
#skillcheck .scHint {
  margin-top: 2px; font-size: 13px; color: #cfd8e6; text-shadow: 0 2px 8px #000;
  background: rgba(8,10,14,.72); border: 1px solid var(--line); border-radius: 999px;
  display: inline-block; padding: 3px 12px;
}
#skillcheck .scHint b { color: #fff; }
#help, #helpTouch { position: absolute; bottom: 6px; left: 14px; right: 14px; font-size: 11px; color: #464c56; transition: opacity .25s; }
#help b, #helpTouch b { color: #737b88; }
#hud.acting #help, #hud.acting #helpTouch { opacity: 0; }
/* памятка стоит НАД строкой действия, а по бокам её отодвигает JS: от
   миникарты, полосок предмета и большой кнопки ДЕЙСТВИЕ */
#helpTouch { line-height: 1.4; font-size: 10px; text-align: center; pointer-events: none; }
body.touchOn #helpTouch { bottom: calc(max(8px, env(safe-area-inset-bottom)) + 46px); }
/* через полминуты подсказка не нужна: она гаснет сама */
#helpTouch { animation: helpFade 1s ease 40s forwards; }
@keyframes helpFade { to { opacity: 0; visibility: hidden; } }
@media (max-width: 1100px) {
  #minimap { width: 150px; height: 150px; }
  #itemBox, #powerBox { width: 160px; }
  #bottom { width: min(440px, 52vw); }
}

/* ---------- score panel ---------- */
#scorePanel {
  position: absolute; right: 14px; top: 14px; width: 210px;
  background: rgba(10,12,16,.62); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
#scorePanel .spTotal { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
#scorePanel .spNum { font-size: 24px; font-weight: 700; color: #fff; text-shadow: 0 2px 10px #000; }
#scorePanel .spLbl { font-size: 10px; letter-spacing: .22em; color: var(--dim); }
.spRow { display: flex; align-items: center; gap: 7px; font-size: 11px; margin-top: 5px; }
.spRow .spName { flex: 1; letter-spacing: .08em; color: var(--dim); }
.spRow .spVal { color: var(--text); font-variant-numeric: tabular-nums; }
.spRow .spBar { width: 46px; height: 3px; border-radius: 2px; background: #23272f; overflow: hidden; }
.spRow .spBar i { display: block; height: 100%; width: 0%; transition: width .35s; }
#spPops { position: relative; margin-top: 6px; min-height: 4px; }
.spPop {
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  animation: spPop 2.2s ease forwards; text-shadow: 0 2px 8px #000;
}
.spPop small { color: var(--dim); font-weight: 400; margin-left: 5px; letter-spacing: 0; }
@keyframes spPop {
  0% { opacity: 0; transform: translateX(14px) }
  12% { opacity: 1; transform: translateX(0) }
  75% { opacity: 1 }
  100% { opacity: 0; transform: translateY(-10px) }
}

/* ---------- comeback ---------- */
#wrathBar {
  position: absolute; top: 92px; left: 50%; transform: translateX(-50%);
  width: 240px; text-align: center;
}
#wrathBar .wbLabel { font-size: 10px; letter-spacing: .22em; color: #ffb37a; margin-bottom: 4px; text-shadow: 0 2px 8px #000; }
#wrathBar .wbTrack { height: 4px; background: rgba(20,22,28,.8); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
#wrathBar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #8a4a2a, #ffb37a); transition: width .4s; }
#wrathBar.help i { background: linear-gradient(90deg, #2a6a52, #7bd88f); }
#wrathBar.help .wbLabel { color: #7bd88f; }
#altarCue {
  position: absolute; top: 120px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  background: rgba(12,14,18,.8); border: 1px solid rgba(123,216,143,.55); border-radius: 999px;
  padding: 5px 14px; font-size: 12px; letter-spacing: .16em; color: #a8e8ba;
  animation: pulse 1.6s infinite;
}
#altarCue .acDot { width: 8px; height: 8px; border-radius: 50%; background: #7bd88f; box-shadow: 0 0 10px #7bd88f; }
#altarCue.foe { border-color: rgba(255,123,107,.55); color: #ffb0a4; }
#altarCue.foe .acDot { background: #ff7b6b; box-shadow: 0 0 10px #ff7b6b; }

#taskPill.ok { border-color: rgba(123,216,143,.6); color: #9fe8b0; }
#loadoutHud { position: absolute; left: 14px; bottom: 30px; display: flex; flex-direction: column; gap: 6px; }
#itemBox, #powerBox {
  background: rgba(12,14,18,.75); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; width: 215px; backdrop-filter: blur(6px);
}
.ikey { margin-top: 5px; font-size: 10px; color: var(--dim); display: flex; align-items: center; gap: 5px; }
.ikey kbd {
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.18); border-radius: 4px;
  padding: 0 5px; font: inherit; font-weight: 700; color: #e6ecf5; line-height: 15px;
}
#powerBox .ikey { color: #ffb0a4; }
#powerBox { border-color: rgba(255,110,110,.35); }
#itemBox, #powerBox, #ultBox {
  background: rgba(12,14,18,.75); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; width: 215px; backdrop-filter: blur(6px);
}
#ultBox { border-color: rgba(196,127,255,.35); }
#ultFill { background: linear-gradient(90deg, #6a4ab0, #c47fff); }
#ultBox.ready {
  border-color: rgba(196,127,255,.9);
  box-shadow: 0 0 16px rgba(196,127,255,.45);
  animation: pulse 1.2s infinite;
}
#ultBox.ready .iname, #ultBox.ready .ikey { color: #e3c8ff; }
#ultBox.active { border-color: rgba(255,209,102,.8); box-shadow: 0 0 14px rgba(255,209,102,.35); }
#ultBox.active #ultFill { background: linear-gradient(90deg, #b08a2a, #ffd166); }
.iname { font-size: 11px; color: var(--text); letter-spacing: .04em; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* название тянется, а счётчик прижат вправо - значок не должен их сдвигать */
.iname > span:nth-child(2) { flex: 1; }
.ibar { height: 4px; background: #23272f; border-radius: 3px; margin-top: 5px; overflow: hidden; }
.ibar i { display: block; height: 100%; width: 100%; background: var(--accent); transition: width .1s; }
#powerFill { background: linear-gradient(90deg, #b04a4a, #ff8f6b); }
.charCard .cu { color: #c9a0ec; margin-top: 4px; border-top: 1px dashed rgba(196,127,255,.25); padding-top: 4px; }
/* Перки в бою: три фишки в столбик под ультой. Раньше это была строка из
   трёх обрезанных подписей - и название читалось до первого слога. Теперь
   у каждой фишки крупный значок и место под полное имя. */
#perkChips { display: flex; flex-direction: column; gap: 5px; width: 215px; }
.pchip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(12,14,18,.75); border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 9px; font-size: 11px; color: var(--dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color .18s, border-color .18s, box-shadow .18s, filter .3s, opacity .3s;
}
.pchip.on { color: var(--ok); border-color: rgba(123,216,143,.4); box-shadow: 0 0 10px rgba(123,216,143,.15); }
.pchip.cd { color: #5f6774; opacity: .55; }
/* положил картинку перка - она встаёт слева отдельным значком */
.pchip .pcIcon {
  width: 30px; height: 30px; flex: none;
  background-repeat: no-repeat; background-position: center; background-size: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.7));
  transition: filter .3s ease, transform .2s ease;
}
.pchip.on .pcIcon { filter: drop-shadow(0 0 6px rgba(123,216,143,.6)) saturate(1.15); }
.pchip.cd .pcIcon { filter: grayscale(1) brightness(.55); }
/* перк сработал - значок коротко подпрыгивает */
.pchip.on .pcIcon { animation: perkPop .45s cubic-bezier(.2,.9,.3,1.5) 1; }
@keyframes perkPop { 0% { transform: scale(1); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }
@media (max-height: 780px) {
  .pchip .pcIcon { width: 24px; height: 24px; }
  .pchip { padding: 4px 8px; font-size: 10.5px; }
}

/* значок перка в карточке меню */
.perkCard.withIcon { display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: start; }
.perkCard .pkIcon {
  width: 58px; height: 58px; object-fit: contain; grid-row: span 2;
  filter: drop-shadow(0 2px 7px rgba(0,0,0,.75));
  transition: transform .18s ease;
}
.perkCard.withIcon:hover .pkIcon { transform: scale(1.08); }

/* ================= map splash ================= */
#mapSplash {
  position: fixed; inset: 0; z-index: 16; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: #05060a;
  animation: splashFade 2.8s ease forwards;
}
#mapSplash .msImg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: .55; transform: scale(1.06); animation: splashZoom 2.8s ease forwards;
}
/* ролик заставки вместо картинки: тот же слой, та же яркость */
#mapSplash #msVid {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: .55;
  animation: splashZoom 2.8s ease forwards;
}
#mapSplash #msVid.hidden { display: none; }
#mapSplash .msText { position: relative; text-align: center; text-shadow: 0 4px 26px #000; }
#mapSplash .msKicker { font-size: 12px; letter-spacing: .5em; color: var(--dim); margin-bottom: 8px; }
#mapSplash .msName {
  font-size: 54px; font-weight: 700; letter-spacing: .12em; color: #fff;
  animation: riseIn .6s ease both;
}
#mapSplash .msRole { margin-top: 10px; font-size: 15px; letter-spacing: .22em; color: var(--accent); }
#mapSplash .msGoal { margin-top: 16px; font-size: 13px; letter-spacing: .1em; color: #aeb6c4; }
#mapSplash::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(0,0,0,0) 30%, rgba(0,0,0,.85) 100%);
}
#mapSplash .msRole.killer { color: #ff8a7a; }
@keyframes splashFade {
  0% { opacity: 1 } 65% { opacity: 1 } 100% { opacity: 0 }
}
@keyframes splashZoom { from { transform: scale(1.12) } to { transform: scale(1.0) } }

/* ================= shared chrome ================= */
.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  box-shadow: 0 24px 70px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.05);
}

/* ================= КНОПКИ =================
   Фон в меню почти чёрный, и прежние кнопки на нём терялись: тонкая рамка
   да четыре процента белого. Теперь у каждой кнопки есть собственное тело
   (заливка + верхний блик + тень), а на наведение и нажатие она отвечает
   движением, светом и бегущим по краю отблеском. */
.btn {
  position: relative; overflow: hidden;
  border: 1px solid rgba(255,255,255,.22); border-radius: 11px;
  padding: 12px 22px; font-size: 14px; letter-spacing: .06em; font-weight: 500;
  cursor: pointer; color: #eef3fb;
  background:
    linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.03) 55%, rgba(0,0,0,.18)),
    #1b2029;
  box-shadow:
    0 6px 18px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.16),
    inset 0 -1px 0 rgba(0,0,0,.35);
  transition: transform .13s cubic-bezier(.2,.9,.3,1.2), box-shadow .22s, background .22s,
              color .22s, border-color .22s, filter .22s;
}
/* ==================================================================
   СВОИ КНОПКИ (папка art: ui-btn.png и компания).
   Картинка растягивается на всю кнопку (background-size: 100% 100%),
   поэтому арт должен быть с мягкими краями и без тонкой рамки по самому
   периметру - её растянет неравномерно. Родную оправу мы при этом
   убираем: две рамки друг на друге выглядят грязно.
   Чего в art/ нет - остаётся встроенный вид, класс просто не ставится.
   ================================================================== */
/* КАРТИНКА - ЭТО ТЕКСТУРА, А НЕ ГОТОВАЯ ПЛАШКА.
   Раньше арт растягивался на кнопку целиком (100% 100%), и от него
   требовались точные пропорции: нарисованная плашка 1:1 внутри длинной
   кнопки превращалась в сплющенный овал внутри чужой рамки. Теперь
   картинка кадрируется по КОРОТКОЙ стороне (cover) и обрезается формой
   самой кнопки, а сверху ложится затемнение под подпись. Годится любой
   квадрат, любой размер, хоть кусок ржавого железа - форму и скругления
   даёт игра, а не файл. */
body.skinBtn .btn {
  background:
    linear-gradient(180deg, rgba(6,8,11,.34), rgba(6,8,11,.52)),
    var(--uiBtn) center / cover no-repeat,
    #1b2029;
  border-color: rgba(255,255,255,.16);
  box-shadow:
    0 6px 18px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.10),
    inset 0 -1px 0 rgba(0,0,0,.35);
}
body.skinBtn .btn:hover {
  background-image:
    linear-gradient(180deg, rgba(6,8,11,.22), rgba(6,8,11,.42)),
    var(--uiBtnOn, var(--uiBtn));
}
/* Главная кнопка одевается ОТДЕЛЬНО: положил одну ui-btn-primary.png -
   оделась только она, остальные кнопки остались прежними. Красное свечение
   вокруг оставляем: оно и делает её главной. */
body.skinBtnPrimary .btn.primary {
  background:
    linear-gradient(180deg, rgba(6,8,11,.34), rgba(6,8,11,.58)),
    var(--uiBtnPrimary, var(--uiBtn)) center / cover no-repeat,
    #2a1113;
  border-color: rgba(255,122,114,.75);
}
/* У главной кнопки может быть СВОЯ пара «спокойная / проснувшаяся»:
   ui-btn-primary.png и ui-btn-primary-on.png. Нет второй - подойдёт общая
   ui-btn-on, нет и её - остаётся первая, просто чуть светлее от затемнения. */
body.skinBtnPrimary .btn.primary:hover {
  background-image:
    linear-gradient(180deg, rgba(6,8,11,.16), rgba(6,8,11,.40)),
    var(--uiBtnPrimaryOn, var(--uiBtnOn, var(--uiBtnPrimary, var(--uiBtn))));
}

body.skinTab .tab {
  background:
    linear-gradient(180deg, rgba(6,8,11,.38), rgba(6,8,11,.56)),
    var(--uiTab) center / cover no-repeat,
    #12161d;
  border-color: rgba(255,255,255,.14);
}
body.skinTab .tab.active {
  background-image:
    linear-gradient(180deg, rgba(6,8,11,.20), rgba(6,8,11,.40)),
    var(--uiTabOn, var(--uiTab));
}

body.skinSeg .segBtn {
  background:
    linear-gradient(180deg, rgba(6,8,11,.38), rgba(6,8,11,.56)),
    var(--uiSeg) center / cover no-repeat,
    #12161d;
  border-color: rgba(255,255,255,.14);
}
body.skinSeg .segBtn.active {
  background-image:
    linear-gradient(180deg, rgba(6,8,11,.20), rgba(6,8,11,.40)),
    var(--uiSegOn, var(--uiSeg));
}

body.skinPanel .glass.card {
  background-image:
    linear-gradient(180deg, rgba(9,11,15,.72), rgba(9,11,15,.82)),
    var(--uiPanel);
  background-size: auto, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}

/* блик, пробегающий по кнопке при наведении */
.btn::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.30) 48%, transparent 66%);
  transform: translateX(-130%);
  opacity: 0;
}
.btn:hover::after { animation: btnSweep .62s ease-out 1; opacity: 1; }
@keyframes btnSweep {
  from { transform: translateX(-130%); }
  to   { transform: translateX(130%); }
}
.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.42);
  box-shadow:
    0 12px 28px rgba(0,0,0,.55),
    0 0 0 1px rgba(255,255,255,.06),
    inset 0 1px 0 rgba(255,255,255,.24);
  filter: brightness(1.12);
}
.btn:active { transform: translateY(1px) scale(.985); box-shadow: 0 4px 12px rgba(0,0,0,.5), inset 0 2px 6px rgba(0,0,0,.45); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* главная кнопка: красная, живая, с собственным дыханием */
.btn.primary {
  background: linear-gradient(180deg, #e04a45 0%, #b52f2f 52%, #7f1f1f 100%);
  border-color: #ff7a72; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.45);
  box-shadow:
    0 10px 26px rgba(190,45,45,.42),
    inset 0 1px 0 rgba(255,255,255,.34),
    inset 0 -2px 0 rgba(0,0,0,.3);
}
.btn.primary:hover {
  box-shadow:
    0 16px 40px rgba(225,70,60,.55),
    0 0 0 1px rgba(255,140,130,.35),
    inset 0 1px 0 rgba(255,255,255,.4);
}
.btn.primary:disabled {
  background: linear-gradient(180deg, #2f333b, #23272e);
  border-color: #3a3f48; color: #737a87; cursor: not-allowed;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05); transform: none; filter: none;
  animation: none;
}
.btn.primary:disabled::after { display: none; }

/* призрачная кнопка - тише, но всё же видна на чёрном */
.btn.ghost {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.16);
  color: var(--dim);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
}
.btn.ghost:hover { color: #fff; background: rgba(255,255,255,.11); }

.btn.big {
  padding: 17px 30px; font-size: 16.5px; letter-spacing: .16em; font-weight: 600;
  border-radius: 13px;
}
/* «НАЧАТЬ МАТЧ» медленно пульсирует - взгляд сам её находит */
.btn.primary.big:not(:disabled) { animation: btnBreathe 2.8s ease-in-out infinite; }
@keyframes btnBreathe {
  0%, 100% { box-shadow: 0 10px 26px rgba(190,45,45,.38), inset 0 1px 0 rgba(255,255,255,.34), inset 0 -2px 0 rgba(0,0,0,.3); }
  50%      { box-shadow: 0 14px 38px rgba(230,70,60,.62), inset 0 1px 0 rgba(255,255,255,.44), inset 0 -2px 0 rgba(0,0,0,.3); }
}
.btn.primary.big:hover { animation: none; }

.btnGlow {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.28) 45%, transparent 70%);
  transform: translateX(-120%);
  animation: sheen 4.5s ease-in-out infinite;
}
@keyframes sheen { 0%, 65% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }

.overlay {
  position: fixed; inset: 0; z-index: 22;   /* above the menu: a finished match must not hide behind it */
  display: flex; align-items: center; justify-content: center;
  background: rgba(4,5,7,.72);
  animation: fadeIn .22s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px) scale(.98) } to { opacity: 1; transform: none } }

/* ================= MENU ================= */
#menu { position: fixed; inset: 0; z-index: 20; overflow: auto; }
#menuBg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.menuWrap {
  position: relative; z-index: 1;
  min-height: 100%; padding: 0 20px 40px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
/* крюки логотипа уходят цепями за верхний край экрана */
.brand { margin-top: 0; }

.brand.artLogo .logo { display: none; }
.logoImg { display: block; max-width: min(520px, 74vw); margin: 0 auto 6px; filter: drop-shadow(0 10px 30px rgba(0,0,0,.6)); }
.brand { animation: riseIn .5s ease both; }
.logo { width: min(420px, 82vw); height: auto; display: block; }
.logoText { font-size: 64px; font-weight: 300; letter-spacing: .13em; font-family: "Segoe UI", Arial, sans-serif; }
.logoSub { fill: #6d7684; font-size: 10.5px; letter-spacing: .42em; }
.logoHook { animation: hookSway 6s ease-in-out infinite; transform-origin: 0 0; transform-box: fill-box; }
.logoHook2 { animation-delay: -3s; }
@keyframes hookSway { 0%,100% { transform: rotate(-1.6deg) } 50% { transform: rotate(1.6deg) } }

.tabs { display: flex; gap: 6px; animation: riseIn .5s .05s ease both; }
.tab {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.16); color: #9aa4b4;
  padding: 10px 22px; border-radius: 999px; cursor: pointer; font-size: 13px; letter-spacing: .06em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 3px 10px rgba(0,0,0,.35);
  transition: color .2s, border-color .2s, background .2s, transform .13s, box-shadow .2s;
}
.tab:hover { color: #fff; border-color: rgba(255,255,255,.34); transform: translateY(-1px); }
.tab.active {
  background: linear-gradient(180deg, rgba(127,214,255,.26), rgba(127,214,255,.10));
  border-color: rgba(127,214,255,.75); color: #d6f2ff;
  box-shadow: 0 0 18px rgba(127,214,255,.28), inset 0 1px 0 rgba(255,255,255,.28);
}
/* подчёркивание активной вкладки уезжает на место */
.tab.active::before {
  content: ''; position: absolute; left: 18%; right: 18%; bottom: 4px; height: 2px;
  border-radius: 2px; background: var(--accent);
  animation: tabUnderline .32s cubic-bezier(.2,.9,.3,1.2) both;
}
@keyframes tabUnderline { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }

.card { width: min(760px, 94vw); padding: 22px 24px; animation: riseIn .45s .1s ease both; }
.secTitle {
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim);
  margin: 4px 0 12px; display: flex; align-items: center; gap: 10px;
  /* НА УЗКОМ ЭКРАНЕ КНОПКИ ПЕРЕНОСЯТСЯ, А НЕ СПЛЮЩИВАЮТСЯ. В портретном
     телефоне «Проверить» и «Скопировать» в шапке окна ужимались до
     тридцати шести пикселей, и подписи обрезались на середине слова. */
  flex-wrap: wrap;
}
.secTitle > .btn { flex: 0 0 auto; white-space: nowrap; }
.secTitle::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 620px) { .grid2 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 7px; }
/* блок хоста остался с одной настройкой - держим тот же ритм, что у .grid2 */
#hostBox { margin-bottom: 14px; }
.field > label { font-size: 11px; color: var(--dim); letter-spacing: .12em; text-transform: uppercase; }
.hintdot { color: var(--accent); }

input {
  background: rgba(0,0,0,.28); border: 1px solid var(--line); color: var(--text);
  padding: 10px 12px; border-radius: 9px; font-size: 14px; outline: none; transition: .15s;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(127,214,255,.12); }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.segBtn {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.025));
  border: 1px solid rgba(255,255,255,.17); color: #96a0b0;
  padding: 10px 16px; border-radius: 10px; cursor: pointer; font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 3px 9px rgba(0,0,0,.32);
  transition: color .18s, border-color .18s, background .18s, transform .13s, box-shadow .18s;
}
.segBtn:hover { border-color: rgba(255,255,255,.36); color: #fff; transform: translateY(-1px); }
.segBtn:active { transform: translateY(1px) scale(.98); }
.segBtn.active {
  background: linear-gradient(180deg, rgba(127,214,255,.30), rgba(127,214,255,.11));
  border-color: rgba(127,214,255,.78); color: #ddf4ff;
  box-shadow: 0 0 16px rgba(127,214,255,.30), inset 0 1px 0 rgba(255,255,255,.26);
  animation: segPop .26s cubic-bezier(.2,.9,.3,1.4) 1;
}
@keyframes segPop { 0% { transform: scale(.94); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
/* «Маньяк» подсвечивается красным, а не голубым: роль читается с одного взгляда */
.segBtn[data-role="killer"].active {
  background: linear-gradient(180deg, rgba(255,90,80,.32), rgba(255,90,80,.10));
  border-color: rgba(255,120,105,.8); color: #ffd8d2;
  box-shadow: 0 0 16px rgba(255,90,80,.32), inset 0 1px 0 rgba(255,255,255,.24);
}

.players { display: flex; flex-direction: column; gap: 6px; }
.pl {
  display: flex; align-items: center; gap: 10px; font-size: 13px;
  background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
  animation: riseIn .3s ease both;
}
.pl .av {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #0d1014;
}
.pl .av.avGlyph { color: var(--gc, var(--text)); }
.pl .av.avImg { object-fit: cover; }
.pl .nm { flex: 1; }
.pl .r { color: var(--dim); font-size: 11px; }
.pl .tag {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line2);
  color: var(--dim); background: rgba(255,255,255,.03);
}
.pl .tag.s { color: #9fe6c0; border-color: rgba(123,216,143,.35); background: rgba(123,216,143,.08); }
.pl .tag.k { color: #ff9b8a; border-color: rgba(224,58,58,.4);  background: rgba(224,58,58,.10); }
.pl .r.k { color: #ff9c9c; }

.actions { display: flex; gap: 10px; margin-top: 18px; }
.actions.wide > .btn { flex: 1; }

.netinfo { margin-top: 12px; font-size: 11px; color: #545b66; text-align: center; }

/* ---------------- character picker ---------------- */
/* Карточки стали шире: в них теперь крупный значок способности и строка
   о её сути - в 160 пикселей это не помещалось без лесенки из двух слов. */
.chars { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 10px; margin-bottom: 18px; }
.charCard {
  /* Карточка - это <button>, а браузер центрирует содержимое кнопки по
     вертикали. Из-за этого в одном ряду один персонаж начинался на
     полсотни пикселей ниже другого. Делаем явную колонку сверху вниз. */
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
  position: relative; text-align: left; cursor: pointer; overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.14); border-radius: 12px;
  padding: 14px 14px 12px; color: var(--text);
  box-shadow: 0 4px 14px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.07);
  transition: transform .16s cubic-bezier(.2,.9,.3,1.2), box-shadow .22s, border-color .22s, background .22s;
}
.charCard:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,.34);
  box-shadow: 0 16px 34px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.14);
}
.charCard.active {
  border-color: var(--cc);
  box-shadow: 0 0 0 1px var(--cc), 0 0 26px -6px var(--cc), 0 16px 34px rgba(0,0,0,.45);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.03));
  animation: cardPick .3s cubic-bezier(.2,.9,.3,1.4) 1;
}
@keyframes cardPick { 0% { transform: scale(.97); } 55% { transform: scale(1.02) translateY(-4px); } 100% { transform: translateY(-4px); } }
/* выбранная карточка светится по краю - её видно даже краем глаза */
.charCard.active::after {
  content: ''; position: absolute; inset: -1px; border-radius: 12px; pointer-events: none;
  box-shadow: inset 0 0 22px -8px var(--cc);
  animation: cardHalo 2.6s ease-in-out infinite;
}
@keyframes cardHalo { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
/* ПОРТРЕТ ВО ВСЮ ШИРИНУ КАРТОЧКИ И В СВОИХ ПРОПОРЦИЯХ.
   Было: коробка ровно 148 пикселей высотой и object-fit: contain. Головы не
   срезались, но квадратный портрет 512x512 ужимался до 148x148 и болтался
   посреди широкой карточки с пустыми полями по бокам - картинка выглядела
   маленькой и «сплюснутой» рядом с соседями. Теперь высота считается по
   самой картинке (height: auto), то есть портрет занимает всю ширину и
   сохраняет свои пропорции. Очень высокие картинки упираются в потолок и
   там уже вписываются целиком - но не искажаются никогда. */
.charCard .portrait {
  display: block; width: 100%; height: auto; max-height: 320px; object-fit: contain;
  background: radial-gradient(120% 90% at 50% 25%, rgba(255,255,255,.05), rgba(0,0,0,.35));
  border-radius: 9px; margin: -4px 0 10px; border: 1px solid var(--line);
  filter: saturate(1.05) contrast(1.03);
}
/* Ряд карточек тянется по самой высокой: портреты стоят в один уровень,
   а подписи под ними не разъезжаются лесенкой. */
.chars > .charCard { align-self: stretch; }
.charCard.active .portrait { border-color: var(--cc); box-shadow: 0 0 18px -8px var(--cc); }
/* Свой портрет заменяет букву-заглушку на ЛЮБОЙ карточке, а не только на
   выбранной: иначе под картинкой болтался лишний кружок с буквой. */
/* ЖИВОЙ ПОРТРЕТ: ролик ложится ровно на картинку и плавно проявляется.
   Пока он не начал играть - прозрачный, поэтому чёрным не мигает. */
.charLive {
  position: absolute; z-index: 3; pointer-events: none;
  object-fit: cover; border-radius: 9px;
  border: 1px solid var(--line);
  opacity: 0; transition: opacity .35s ease;
  filter: saturate(1.05) contrast(1.03);
}
.charLive.on { opacity: 1; }

.charCard .portrait + .ring { display: none; }
.charCard .ring {
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--cc);
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
  font-size: 17px; font-weight: 600; color: var(--cc);
  box-shadow: 0 0 18px -4px var(--cc);
}
.charCard.active .ring { animation: ringPulse 2.4s ease-in-out infinite; }
@keyframes ringPulse { 0%,100% { box-shadow: 0 0 16px -6px var(--cc) } 50% { box-shadow: 0 0 26px 0 var(--cc) } }
.charCard .cn { font-size: 15px; font-weight: 500; }
.charCard .ct { font-size: 11px; color: var(--cc); letter-spacing: .12em; text-transform: uppercase; margin-top: 2px; }
/* пометка про тотемы: своя строка сразу под ролью персонажа */
.charCard .tBadge {
  display: inline-block; margin-top: 7px; padding: 3px 8px; border-radius: 6px;
  font-size: 9.5px; letter-spacing: .1em; white-space: nowrap;
  border: 1px solid transparent;
}
.charCard .tBadge.bless { color: #9fe6b4; background: rgba(123,216,143,.12); border-color: rgba(123,216,143,.4); }
.charCard .tBadge.hex { color: #d8b3ff; background: rgba(196,127,255,.12); border-color: rgba(196,127,255,.4); }
.charCard .tBadge.none { color: #6f7784; background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.09); }
.charCard .cd { font-size: 11px; color: var(--dim); line-height: 1.45; margin-top: 8px; }
/* Способность внизу карточки: крупный значок слева, название и одна строка
   о сути справа. Раньше здесь было только название - значок терялся, а по
   одному «Бензопила» было не понять, чем этот маньяк вообще играет. */
.charCard .pw {
  font-size: 11px; color: var(--text); margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--line);
}
.charCard .pwText { display: contents; }
.charCard .pw b { color: var(--cc); }
.charCard .pw i {
  display: block; margin-top: 4px; font-style: normal;
  font-size: 10.5px; color: var(--dim); line-height: 1.45;
}

.perkList { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; margin-bottom: 18px; }
.perkCard {
  background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  animation: riseIn .3s ease both;
}
.perkCard > b { display: block; font-size: 12.5px; font-weight: 500; color: var(--text); margin-bottom: 3px; }
.perkCard span { font-size: 11px; color: var(--dim); line-height: 1.45; }

.items { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 8px; }
/* «Случайный предмет» - вместо бывшей карточки «без предмета» */
.btn.tiny {
  float: right; font-size: 11px; padding: 3px 10px; border-radius: 7px;
  font-weight: 500; letter-spacing: .02em;
}
/* значок способности/ульты внутри карточки персонажа */
.charCard .abIcon {
  width: 46px; height: 46px; object-fit: contain; flex: none;
  vertical-align: -14px; margin-right: 9px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.75));
  transition: transform .18s ease, filter .18s ease;
}
/* Значок ОБТЕКАЕТСЯ текстом, а не отжимает его в узкую колонку: карточка
   всего полтораста пикселей шириной, и при флексе описание превращалось
   в лесенку по два слова в строке. */
.charCard .cu .abIcon,
.charCard .pw .abIcon {
  float: left; margin: 1px 9px 4px 0; vertical-align: 0;
  shape-outside: circle(50%);
}
.charCard .cu::after, .charCard .pw::after { content: ''; display: block; clear: both; }
.charCard:hover .abIcon { transform: scale(1.12); filter: drop-shadow(0 3px 8px rgba(0,0,0,.8)) saturate(1.15); }
.charCard.active .abIcon { filter: drop-shadow(0 0 8px var(--cc)) saturate(1.2); }
/* и в HUD рядом с названием способности и ульты */
#powerBox .hudIcon, #ultBox .hudIcon, #itemBox .hudIcon {
  width: 16px; height: 16px; object-fit: contain; vertical-align: -3px; margin-right: 5px;
}

/* ================= ЖИВЫЕ ЗНАЧКИ В HUD =================
   Значок способности, ульты и предмета показывает состояние сам, без
   чтения цифр: пока не готово - он серый и притушен, поверх лежит тёмный
   круговой сектор отката; готово - краска возвращается и значок дышит
   светом; работает прямо сейчас - разгорается и слегка пульсирует. */
.iconWrap {
  position: relative; display: inline-block;
  width: 30px; height: 30px; vertical-align: -9px; margin-right: 8px;
  flex: none;
}
.iconWrap.empty { display: none; }
.iconWrap img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  filter: none; opacity: 1;
  transition: filter .45s ease, opacity .45s ease, transform .25s ease;
  will-change: filter;
}
/* совсем пусто / нечем пользоваться - цвет ушёл */
.iconWrap.dim img { filter: grayscale(1) brightness(.42) contrast(.85); opacity: .7; }
/* копится или тратится - цвет частично вымыт */
.iconWrap.part img { filter: grayscale(.6) brightness(.78); opacity: .92; }
/* готово - полный цвет и мягкое дыхание */
.iconWrap.ready img {
  filter: drop-shadow(0 0 6px rgba(255,214,120,.75)) saturate(1.15);
  animation: iconReady 1.9s ease-in-out infinite;
}
/* работает - разгорелось */
.iconWrap.hot img {
  filter: brightness(1.3) saturate(1.4) drop-shadow(0 0 9px rgba(255,120,90,.9));
  animation: iconHot .8s ease-in-out infinite;
}
@keyframes iconReady {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(255,214,120,.55)) saturate(1.1); }
  50%      { transform: scale(1.07); filter: drop-shadow(0 0 11px rgba(255,214,120,.95)) saturate(1.25); }
}
@keyframes iconHot {
  0%, 100% { transform: scale(1.02); }
  50%      { transform: scale(1.12); }
}
/* тёмный сектор отката поверх значка */
.iconWrap .cdmask {
  position: absolute; inset: -3px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from -90deg, rgba(6,8,12,.78) calc(var(--p, 0) * 360deg), rgba(0,0,0,0) 0);
  transition: opacity .3s ease;
}
.iconWrap.ready .cdmask, .iconWrap.hot .cdmask { opacity: 0; }
/* короткая вспышка в момент, когда стало готово */
.iconWrap.flash::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(255,214,120,.9); pointer-events: none;
  animation: iconFlash .55s ease-out 1 forwards;
}
@keyframes iconFlash {
  from { transform: scale(.7); opacity: 1; }
  to   { transform: scale(1.6); opacity: 0; }
}

.itemCard .icon {
  display: block; width: 100%; height: 92px; object-fit: contain;
  margin-bottom: 8px; filter: drop-shadow(0 3px 9px rgba(0,0,0,.55));
  transition: transform .18s ease, filter .18s ease;
}
.itemCard:hover .icon { transform: scale(1.06) translateY(-2px); filter: drop-shadow(0 6px 14px rgba(0,0,0,.6)); }
.itemCard.active .icon { filter: drop-shadow(0 0 10px rgba(127,214,255,.55)) saturate(1.15); }
.itemCard {
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
  text-align: left; cursor: pointer; color: var(--text);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.07);
  transition: transform .15s cubic-bezier(.2,.9,.3,1.2), box-shadow .2s, border-color .2s, background .2s;
}
.itemCard:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.34); box-shadow: 0 12px 24px rgba(0,0,0,.45); }
.itemCard.active {
  background: linear-gradient(180deg, rgba(127,214,255,.24), rgba(127,214,255,.08));
  border-color: rgba(127,214,255,.7);
  box-shadow: 0 0 18px rgba(127,214,255,.28), inset 0 1px 0 rgba(255,255,255,.22);
  animation: segPop .26s cubic-bezier(.2,.9,.3,1.4) 1;
}
.itemCard > b { display: block; font-size: 12.5px; font-weight: 500; margin-bottom: 3px; }
.itemCard.active b { color: var(--accent); }
.itemCard span { font-size: 11px; color: var(--dim); line-height: 1.4; }

.rulesList { margin: 0 0 18px; padding-left: 18px; font-size: 13px; line-height: 1.8; color: var(--dim); }
.rulesList b { color: var(--text); }
.keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 7px; font-size: 12px; color: var(--dim); }
kbd {
  display: inline-block; background: rgba(255,255,255,.07); border: 1px solid var(--line2);
  border-bottom-width: 2px; border-radius: 5px; padding: 1px 7px; font-family: inherit; font-size: 11px; color: var(--text);
}

.hostonly.disabled { opacity: .35; pointer-events: none; }

/* ================= death / results ================= */
.dpanel { width: min(480px, 94vw); padding: 30px; text-align: center; animation: riseIn .3s ease both; }
/* три кнопки в ряд: подписи не должны ломаться на две строки */
.dpanel .actions { justify-content: center; }
.dpanel .actions .btn { white-space: nowrap; padding-left: 16px; padding-right: 16px; }
.dmark { font-size: 34px; color: #ff7676; margin-bottom: 6px; animation: ringPulse 2s infinite; }
.dmark.good { color: var(--ok); }
.dpanel h2 { margin: 0 0 8px; font-size: 27px; letter-spacing: .2em; font-weight: 300; color: #ff8080; }
.dpanel h2.good { color: var(--ok); }
.dpanel p { margin: 0 0 16px; color: var(--dim); font-size: 13px; }
#deathStats { font-size: 13px; line-height: 1.9; color: var(--text); margin-bottom: 20px; }

/* Итоги матча обязаны влезать в экран целиком: шапка и кнопки закреплены,
   прокручивается только список игроков. На низких экранах всё ужимается. */
.rpanel {
  width: min(620px, 94vw); padding: 22px 24px; animation: riseIn .35s ease both;
  max-height: 92vh; display: flex; flex-direction: column; min-height: 0;
}
.rhead { text-align: center; margin-bottom: 14px; flex: none; }
.rpanel .actions { flex: none; margin-top: 14px; }
.rtitle { font-size: 28px; letter-spacing: .18em; font-weight: 300; animation: rTitleIn .5s ease both; }
@keyframes rTitleIn {
  from { opacity: 0; transform: translateY(-8px) scale(.97); letter-spacing: .34em; }
  to   { opacity: 1; transform: none; letter-spacing: .18em; }
}
.rtitle.surv { color: var(--ok); text-shadow: 0 0 26px rgba(123,216,143,.45); }
.rtitle.kill { color: #ff7676; text-shadow: 0 0 26px rgba(255,90,90,.5); }
/* тонкая линия под заголовком - как в шапках карточек */
.rhead::after { content: ''; display: block; height: 1px; margin-top: 12px;
  background: linear-gradient(90deg, transparent, var(--line2), transparent); }
.rsub { font-size: 12px; color: var(--dim); letter-spacing: .1em; margin-top: 6px; }
.rrows {
  display: flex; flex-direction: column; gap: 7px;
  overflow-y: auto; overflow-x: hidden; min-height: 0; flex: 1 1 auto;
  padding-right: 4px; scrollbar-width: thin;
}
.rrows::-webkit-scrollbar { width: 6px; }
.rrows::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }
.rrow {
  display: flex; align-items: center; gap: 12px; font-size: 13px;
  background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px;
  opacity: 0; animation: riseIn .35s ease forwards;
  border-left: 3px solid var(--pc, var(--line));
  transition: background .15s ease;
}
.rrow:hover { background: rgba(255,255,255,.06); }
/* СВОЯ СТРОКА. Игрок должен узнать себя в списке с первого взгляда:
   светлая рамка, лёгкое свечение и подпись «ты» у имени. */
.rrow.rMe {
  background: rgba(143,227,255,.07);
  border-color: rgba(143,227,255,.45);
  box-shadow: 0 0 0 1px rgba(143,227,255,.18), 0 8px 26px -14px rgba(143,227,255,.75);
}
.rrow.rMe .nm { color: #eaf6ff; }
.rrow .meTag {
  display: inline-block; width: auto; font-size: 9.5px; letter-spacing: .12em;
  color: #8fe3ff; border: 1px solid rgba(143,227,255,.5); border-radius: 5px;
  padding: 0 5px; margin-left: 5px; vertical-align: 1px; text-transform: uppercase;
}
/* число очков в момент, когда счётчик докрутил */
.rrow .sc .scNum.pop { animation: scorePop .42s ease-out; }
@keyframes scorePop {
  0%   { transform: scale(1); text-shadow: none; }
  35%  { transform: scale(1.16); text-shadow: 0 0 18px rgba(255,209,102,.85); }
  100% { transform: scale(1); text-shadow: none; }
}
.rrow .sc .scNum { display: inline-block; transition: color .2s ease; }
/* итог каждого - виден с порога: зелёная кромка сбежавшим, красная погибшим */
.rrow.rEsc { border-left-color: var(--ok); background: rgba(123,216,143,.05); }
.rrow.rDead { border-left-color: #ff6e6e; background: rgba(255,110,110,.045); }
.rrow.rKiller { border-left-color: #ff5a5a; background: rgba(255,90,90,.05); }
.rrow .av { width: 34px; height: 34px; border-radius: 9px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: #0d1014; }
.rrow .avImg { object-fit: cover; border: 1px solid var(--line2); background: #10131a; }
/* векторный знак персонажа: он же вместо буквы-заглушки везде, где есть .av */
.av.avGlyph {
  color: var(--gc, var(--text));
  background: radial-gradient(120% 120% at 50% 20%, rgba(255,255,255,.10), rgba(0,0,0,.35));
  border: 1px solid color-mix(in srgb, var(--gc, #888) 45%, transparent);
  box-shadow: inset 0 0 12px -6px var(--gc, #888);
}
.av.avGlyph svg { width: 74%; height: 74%; display: block; }
/* карточка персонажа: знак вместо буквы в кружке */
.charCard .ring svg { width: 26px; height: 26px; }
.rrow .mvp { color: #ffd166; text-shadow: 0 0 8px rgba(255,209,102,.7); font-size: 13px; }
.rrow .nm small.botTag { display: inline-block; width: auto; color: var(--dim); font-size: 10px;
  border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; margin-left: 4px; vertical-align: 1px; }
/* предмет, с которым выживший вышел в матч */
.rItem {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 10.5px; color: #cfd8e6; letter-spacing: .03em;
  background: rgba(127,214,255,.06); border: 1px solid rgba(127,214,255,.22);
  border-radius: 999px; padding: 3px 10px;
}
.rItem img { width: 16px; height: 16px; object-fit: contain; }
.rItem i { width: 7px; height: 7px; border-radius: 50%; }
.rItem.none { color: var(--dim); background: rgba(255,255,255,.03); border-color: var(--line); }
.rrow .nm { flex: 1; }
.rrow .nm > small:last-child { display: block; color: var(--dim); font-size: 10.5px; }
.rrow .st { font-size: 11px; letter-spacing: .08em; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); }
.rrow .st.esc { color: var(--ok); border-color: rgba(123,216,143,.4); }
.rrow .st.dead { color: #ff8686; border-color: rgba(255,110,110,.35); }
.rrow .sc .scNum { color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .02em; }
.rrow .sc { font-size: 11px; color: var(--dim); min-width: 74px; text-align: right; }
.rrow .sc small { display: block; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }
.rrow .st.kil { color: #ff8686; border-color: rgba(255,110,110,.35); }
/* строка результата стала двухэтажной: сверху игрок, снизу разбор очков */
.rrow { flex-direction: column; align-items: stretch; gap: 7px; }
.rrow .rmain { display: flex; align-items: center; gap: 12px; }
.rrow .rcats { display: flex; flex-wrap: wrap; gap: 6px; }
.rcat {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10px;
  letter-spacing: .08em; color: var(--dim);
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 8px 2px 5px;
}
.rcat i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.rcat b { color: #e6ecf5; font-size: 11px; }
.rbreak { display: flex; flex-wrap: wrap; gap: 5px; }
.ritem {
  font-size: 10.5px; color: #b9c3d2;
  background: rgba(255,255,255,.03); border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 7px;
}
.ritem u { text-decoration: none; color: var(--dim); }
.ritem b { margin-left: 5px; font-weight: 700; }

/* невысокий экран (ноутбук 768p и ниже) - ужимаем итоги, чтобы влезли */
@media (max-height: 780px) {
  .rpanel { padding: 16px 18px; max-height: 94vh; }
  .rtitle { font-size: 21px; }
  .rhead { margin-bottom: 10px; }
  .rrows { gap: 5px; }
  .rrow { padding: 7px 10px; gap: 5px; font-size: 12px; }
  .rrow .av { width: 22px; height: 22px; }
  .rcat { font-size: 9.5px; padding: 1px 7px 1px 4px; }
  .ritem { font-size: 9.5px; padding: 1px 6px; }
  .rpanel .actions { margin-top: 10px; }
}

.sb { width: min(520px, 92vw); }
#scoreBody table { width: 100%; border-collapse: collapse; font-size: 13px; }
#scoreBody th { text-align: left; color: var(--dim); font-weight: 400; font-size: 11px; letter-spacing: .1em; padding: 5px 8px; }
#scoreBody td { padding: 7px 8px; border-top: 1px solid var(--line); }

/* ================= НАСТРОЙКИ ЗВУКА ================= */
.tab.tabIcon { display: inline-flex; align-items: center; gap: 6px; }
.tab.tabIcon .spk { display: inline-flex; opacity: .85; }
.tab.tabIcon:hover .wave1 { animation: spkWave .9s ease-in-out infinite; }
.tab.tabIcon:hover .wave2 { animation: spkWave .9s ease-in-out .12s infinite; }
.tab.tabIcon.muted .spk { opacity: .35; }
.tab.tabIcon.muted .wave1, .tab.tabIcon.muted .wave2 { display: none; }
@keyframes spkWave { 0%, 100% { opacity: .35 } 50% { opacity: 1 } }

.mixCard { width: min(460px, 92vw); animation: riseIn .25s ease both; }
/* «Закрыть» уезжает в правый край заголовка, а не липнет к слову «Звук» */
.mixCard .secTitle #mixClose { float: none; order: 3; margin-left: 0; }
.mixCard .secTitle::after { order: 2; }
.mixRows { display: flex; flex-direction: column; gap: 13px; margin: 4px 0 14px; }
.mixRow { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.mixRow label { font-size: 12.5px; color: var(--text); letter-spacing: .01em; }
.mixRow .val { font-size: 11.5px; color: var(--dim); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }
.mixRow .sub { grid-column: 1 / -1; font-size: 10.5px; color: var(--dim); margin-top: -3px; }
.mixRow input[type=range] { grid-column: 1 / -1; width: 100%; }

input[type=range] {
  -webkit-appearance: none; appearance: none; height: 20px; background: transparent; cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 5px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent2) 0%, var(--accent2) var(--fill, 60%), rgba(255,255,255,.10) var(--fill, 60%), rgba(255,255,255,.10) 100%);
}
input[type=range]::-moz-range-track { height: 5px; border-radius: 4px; background: rgba(255,255,255,.10); }
input[type=range]::-moz-range-progress { height: 5px; border-radius: 4px; background: var(--accent2); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; margin-top: -5px; border-radius: 50%;
  background: var(--text); border: 2px solid var(--accent2);
  box-shadow: 0 2px 8px rgba(0,0,0,.6);
  transition: transform .12s ease, box-shadow .12s ease;
}
input[type=range]::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--text); border: 2px solid var(--accent2);
}
input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.18); box-shadow: 0 0 12px rgba(127,214,255,.55); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.05); }
.mixRow.off label, .mixRow.off .val { color: var(--dim); opacity: .65; }

.mixFoot { display: flex; gap: 8px; }
.mixFoot .btn { flex: 1; }
.mixHint { margin-top: 10px; font-size: 10.5px; color: var(--dim); line-height: 1.5; }

/* ================= СЕНСОРНОЕ УПРАВЛЕНИЕ =================
   Телефон подключается к серверу на ПК и играет в браузере. Мыши и
   клавиатуры там нет, поэтому весь ввод - большие пальцы: слева джойстик,
   справа кнопки. Слой лежит поверх игры (z-index 15) и ниже меню (20).   */
#touch {
  position: fixed; inset: 0; z-index: 15;
  pointer-events: none;                 /* ловят только сами элементы */
  touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#touch.hidden { display: none; }
body.touchOn { overscroll-behavior: none; }

/* левая половина экрана - зона джойстика: палец опускается где угодно */
#tStickZone {
  position: absolute; left: 0; top: 0; bottom: 0; width: 46%;
  pointer-events: auto;
}
#tStick {
  position: absolute; width: 34vmin; height: 34vmin; max-width: 210px; max-height: 210px;
  margin-left: -17vmin; margin-top: -17vmin;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.16);
  background: radial-gradient(circle at 50% 50%, rgba(127,214,255,.10), rgba(0,0,0,.28));
  box-shadow: 0 0 30px -10px rgba(0,0,0,.9);
}
#tStick.hidden { display: none; }
#tStickKnob {
  position: absolute; left: 50%; top: 50%;
  width: 13vmin; height: 13vmin; max-width: 82px; max-height: 82px;
  margin-left: -6.5vmin; margin-top: -6.5vmin;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(230,238,250,.95), rgba(120,132,150,.85));
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 4px 16px rgba(0,0,0,.7);
}
#tStick.running { border-color: rgba(255,120,120,.55); }

/* правый блок кнопок */
#tRight {
  position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.tRow { display: flex; gap: 10px; align-items: flex-end; }
.tBtn {
  pointer-events: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.20);
  background: rgba(18,21,27,.72);
  color: #dbe4f0; font: 600 10px/1 'Segoe UI', system-ui, sans-serif;
  letter-spacing: .06em; text-transform: uppercase;
  backdrop-filter: blur(3px);
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
}
.tBtn svg { width: 44%; height: 44%; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }
.tBtn i { font-style: normal; font-size: 9px; opacity: .75; white-space: nowrap; }
/* подпись у кнопок без значка («ОТКЛИК», «ВЫРЫВАТЬСЯ») не переносится и не
   вылезает за круг: её размер подгоняет fitTouchLabels() */
.tBtn { white-space: nowrap; overflow: hidden; }
.tBtn.big { width: 22vmin; height: 22vmin; max-width: 132px; max-height: 132px;
  border-color: rgba(127,214,255,.4); background: rgba(24,42,56,.75); }
.tBtn.mid { width: 15vmin; height: 15vmin; max-width: 92px; max-height: 92px; }
.tBtn.small { width: 12vmin; height: 12vmin; max-width: 74px; max-height: 74px; }
.tBtn.tiny { width: 10vmin; height: 10vmin; max-width: 54px; max-height: 54px; }
.tBtn.down { transform: scale(.93); background: rgba(127,214,255,.28); border-color: rgba(127,214,255,.75); }
.tBtn.on { background: rgba(255,202,58,.22); border-color: rgba(255,202,58,.7); color: #ffe08a; }
.tBtn.hidden { display: none; }
.tBtn.ready { animation: tPulse 1.1s ease-in-out infinite; }
@keyframes tPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(127,214,255,.0) } 50% { box-shadow: 0 0 0 8px rgba(127,214,255,.16) } }

/* отклик на проверку навыка - крупно и под большим пальцем */
#tSkill {
  position: absolute; right: max(12px, env(safe-area-inset-right));
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 26vmin);
  width: 20vmin; height: 20vmin; max-width: 124px; max-height: 124px;
  font-size: 11px; color: #fff;
  border-color: rgba(255,209,102,.75); background: rgba(90,66,20,.82);
  animation: tPulse .7s ease-in-out infinite;
}
#tWiggle {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: max(14px, env(safe-area-inset-bottom));
  width: 34vmin; height: 12vmin; max-width: 220px; max-height: 76px;
  border-radius: 999px; font-size: 12px;
  border-color: rgba(255,120,120,.6); background: rgba(70,24,24,.8); color: #ffd9d9;
}
/* «ОТКЛИК» стоит там же, где «ВЫРЫВАТЬСЯ»: вместе они не появляются, зато
   в углу с кнопками места нет - там столбец */
#tSkill {
  position: absolute; right: auto; left: 50%;
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 13vmin);
  width: 26vmin; height: 11vmin; max-width: 170px; max-height: 70px;
  border-radius: 999px;
}
#tMem { font-size: 9px; border-color: rgba(255,90,90,.7); background: rgba(60,18,18,.8); color: #ffc9c9; }
#tDash { font-size: 9px; border-color: rgba(120,200,255,.7); background: rgba(18,40,60,.8); color: #cfe9ff; }
/* пустая строка редких кнопок не занимает места в столбце (класс ставит JS) */
#tRowRare.hidden { display: none; }
#tTop {
  position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right));
  display: flex; gap: 8px;
}

/* На телефоне меню и итоги должны читаться: крупнее шрифт, одна колонка. */
@media (pointer: coarse) and (max-width: 900px) {
  .menuWrap { padding-bottom: 24px; gap: 12px; }
  .logo { width: min(300px, 70vw); }
  .charCard { min-width: 0; }
  .rpanel { padding: 16px 14px; }
  .rrow { font-size: 12px; }
  .tabs { flex-wrap: wrap; justify-content: center; }
}

/* ================= HUD НА ТЕЛЕФОНЕ =================
   Экран телефона в альбомной ориентации - это ~850x390 CSS-пикселей: на нём
   «настольный» HUD занимает половину поля. Поэтому в сенсорном режиме всё
   лишнее убирается, остальное ужимается, а правый нижний угол оставлен
   кнопкам.                                                                */
body.touchOn #help { display: none; }              /* подсказка по клавишам не нужна */
body.touchOn #helpTouch.hidden { display: none; }
body:not(.touchOn) #helpTouch { display: none; }   /* а на клавиатуре не нужна сенсорная */
/* подпись под кольцом («держи ПРОБЕЛ · жми ENTER») на телефоне не нужна -
   и селектор должен быть сильнее того, что задаёт её вид */
body.touchOn #skillcheck .scHint { display: none; }
body.touchOn #roster {
  font-size: 10px; gap: 3px; transform: scale(.82); transform-origin: top left;
  max-height: 34vh; overflow: hidden;
}
/* пока висит окно сделки, список игроков не нужен: он и так на крюке */
body.touchOn.dealOpen #roster { display: none; }
body.touchOn .rname { min-width: 130px; padding: 3px 7px; }
/* счёт уходит под верхнюю панель и под кнопки-иконки, чтобы ничего не
   перекрывать: сверху остаются только пилюли с генераторами и временем */
/* панель очков на телефоне не показываем совсем: угол нужен кнопкам ☰ и
   «счёт», а разбор очков и так открывается по кнопке счёта */
body.touchOn #scorePanel { display: none; }
body.touchOn #topbar { transform: translateX(-50%) scale(.78); transform-origin: top center; top: 8px; }
/* на узком экране пилюли ужимаются сильнее: справа кнопки, слева список */
@media (max-width: 720px) {
  body.touchOn #topbar { transform: translateX(-50%) scale(.6); }
}
body.touchOn #loadoutHud { transform: scale(.72); transform-origin: bottom left; bottom: 108px; }
body.touchOn #minimap { width: 118px; height: 118px; opacity: .85; }
body.touchOn #bottom { bottom: 8px; width: min(420px, 52vw); left: 42%; }
body.touchOn #prompt { font-size: 12px; }
body.touchOn #stateLine { font-size: 11px; }
/* всплывающая надпись садится ровно в середину: выше неё - подсказка
   обучения, ниже - полоски предмета и кнопки, и ни с чем она не спорит */
body.touchOn #centerMsg {
  font-size: 17px; top: 44%; width: min(56vw, 460px);
  left: 50%; transform: translateX(-50%) scale(.96);
}
body.touchOn #centerMsg.show { transform: translateX(-50%) scale(1); }
/* пока крутится проверка реакции, всплывающая надпись уходит вниз: она не
   имеет права закрывать стрелку */
/* пока крутится стрелка проверки, всплывающая надпись молчит: на телефоне
   между кольцом и кнопками нет полосы, где она никому не мешала бы, а
   закрывать собой проверку она права не имеет */
body.touchOn #centerMsg.lowered { opacity: 0 !important; transition: none; }
#centerMsg { pointer-events: none; }
body.touchOn .msName { font-size: 26px; }
body.touchOn .msGoal { font-size: 13px; }
body.touchOn .msRole { font-size: 12px; }
body.touchOn #skillcheck {
  top: var(--scTop, 50%);
  transform: translate(-50%, -50%) scale(var(--scScale, .78));
}
body.touchOn #hookPanel { transform: scale(.8); transform-origin: bottom center; }
/* миникарта уходит в левый нижний угол: справа кнопки, сверху счёт */
body.touchOn #minimap {
  right: auto; left: max(8px, env(safe-area-inset-left)); bottom: max(8px, env(safe-area-inset-bottom));
  width: 96px; height: 96px; opacity: .8;
}
body.touchOn.lefty #minimap { left: auto; right: max(8px, env(safe-area-inset-right)); }
body.touchOn.lefty #loadoutHud {
  left: auto; right: max(10px, env(safe-area-inset-right)); align-items: flex-end;
  transform-origin: bottom right;
}
body.touchOn.lefty #roster { transform-origin: top left; }
/* ...а панель предмета и ульты стоит НАД ней с честным зазором: раньше они
   сходились впритык и миникарта наползала на значок ульты */
body.touchOn #loadoutHud { bottom: calc(96px + max(8px, env(safe-area-inset-bottom)) + 14px); }
/* на совсем низких экранах миникарта ещё меньше, иначе места не остаётся */
@media (max-height: 420px) {
  body.touchOn #minimap { width: 78px; height: 78px; }
  body.touchOn #loadoutHud { bottom: calc(78px + max(8px, env(safe-area-inset-bottom)) + 12px); }
}
/* на телефоне подсказки клавиш ни к чему: клавиатуры нет */
body.touchOn .ikey kbd { display: none; }
body.touchOn .ikey { gap: 0; }
body.touchOn #tTop { top: max(6px, env(safe-area-inset-top)); }
body.touchOn #perkChips { display: none; }        /* перки видно в меню, в бою не до них */
body.touchOn #cues { transform: scale(.8); transform-origin: top center; }

/* ЧИСЛА В ОПИСАНИЯХ: цвет по смыслу, чтобы взгляд цеплялся за цифру, а не
   вычитывал строку целиком. Оттенки приглушённые - это подсветка, а не
   гирлянда. */
/* ЧИСЛО ВСЕГДА В СТРОКЕ. Подсветка чисел пользуется <b>, а карточки делали
   блочными ВСЕ <b> внутри себя - и описание рассыпалось в столбик. */
.nv { font-weight: 600; font-variant-numeric: tabular-nums; display: inline !important; margin: 0 !important; }
.n-sec { color: #8fd6ff; }      /* секунды */
.n-pct { color: #ffcf6b; }      /* проценты */
.n-m   { color: #8fe0a4; }      /* метры */
.n-x   { color: #d3aaff; }      /* во столько раз */
.n-n   { color: #e8eef7; }      /* просто количество */

/* ---------- обучение ---------- */
.tutCard { width: min(880px, 94vw); }
.tutHint { font-size: 11px; color: var(--dim); margin: 2px 0 12px; line-height: 1.5; }
.tutHint kbd { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 4px; padding: 0 4px; }
.tutPick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tutCard1 {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px; text-align: left;
  background: rgba(18,20,26,.75); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; cursor: pointer; color: var(--text); transition: border-color .15s, transform .15s;
}
.tutCard1:hover { border-color: var(--accent); transform: translateY(-2px); }
.tutCard1 b { font-size: 15px; }
.tutCard1 i { font-style: normal; font-size: 11px; color: var(--dim); line-height: 1.5; }
/* место под твою картинку: пока её нет - аккуратная заглушка */
.tutArt {
  display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden;
  background: linear-gradient(160deg, rgba(60,66,80,.5), rgba(20,22,28,.7));
  border: 1px dashed rgba(255,255,255,.14);
  position: relative;
}
.tutArt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tutCard1 .tutPay { font-style: normal; font-size: 11px; color: #ffca3a; letter-spacing: .04em; }
.tutCard1.tutPaid .tutPay { color: #7bd88f; }
.tutArt.empty::after {
  content: attr(data-slot); position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; font-size: 11px; color: rgba(200,210,225,.45);
  letter-spacing: .06em;
}
@media (max-width: 720px) { .tutPick { grid-template-columns: 1fr; } }

/* подсказки поверх игры */
#tutHud {
  position: absolute; left: 50%; top: 54px; transform: translateX(-50%);
  z-index: 18; width: min(760px, 92vw); text-align: center; pointer-events: none;
}
#tutHud.hidden { display: none; }
#tutHud .thStep {
  display: inline-flex; align-items: baseline; gap: 10px; max-width: 100%;
  background: rgba(12,14,18,.92); border: 1px solid rgba(127,214,255,.45); border-radius: 10px;
  padding: 9px 14px; font-size: 14px; line-height: 1.45; box-shadow: 0 8px 26px rgba(0,0,0,.5);
}
#tutHud .thStep b { color: var(--accent); font-size: 12px; letter-spacing: .08em; flex: none; }
#tutHud.ok .thStep { border-color: rgba(123,216,143,.8); }
#tutHud.ok .thStep b::after { content: ' ✓'; color: #7bd88f; }
#tutHud .thHint { margin-top: 6px; font-size: 11px; color: var(--dim); }
#tutHud #thExit { pointer-events: auto; margin-top: 8px; }
body.touchOn #tutHud { top: 46px; width: min(520px, 66vw); }
body.touchOn #tutHud .thStep { font-size: 12px; padding: 7px 10px; }
/* НА ТЕЛЕФОНЕ ПОЯСНЕНИЕ НЕ ПРОПАДАЕТ СОВСЕМ. Раньше оно просто скрывалось -
   и половина обучения (зачем бежать шагом, почему взрывается генератор,
   как работает обрез) до телефона не доходила вообще. Теперь оно само
   всплывает на несколько секунд при смене шага, а вернуть его можно
   кнопкой «?» в самой плашке. */
body.touchOn #tutHud .thHint { display: none; }
body.touchOn #tutHud.tip .thHint {
  display: block; max-width: 100%; margin: 5px auto 0; padding: 6px 10px;
  border-radius: 8px; background: rgba(12,14,18,.92);
  border: 1px solid rgba(127,214,255,.22); font-size: 11px; line-height: 1.45;
  /* даже самое длинное пояснение не выдавит плашку за нижний край */
  max-height: 30vh; overflow-y: auto; overscroll-behavior: contain;
  animation: tipIn .22s ease-out;
}
/* В ЛАНДШАФТЕ СПРАВА СТОИТ СТОЛБИК КНОПОК. Плашка обучения не должна
   заезжать на него краем: на коротком экране (568x320) её правый угол
   ложился поверх кнопки «ДЕЙСТВИЕ». */
@media (orientation: landscape) {
  body.touchOn #tutHud { width: min(520px, calc(100vw - 300px)); }
}
@keyframes tipIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
/* кнопка «?» есть только на сенсоре: на компьютере пояснение и так видно */
.thTip { display: none; }
body.touchOn .thTip {
  display: inline-flex; align-items: center; justify-content: center;
  pointer-events: auto; flex: none; width: 18px; height: 18px; margin-left: 2px;
  border-radius: 50%; border: 1px solid rgba(127,214,255,.5);
  background: rgba(127,214,255,.12); color: var(--accent);
  font: 700 11px/1 system-ui, sans-serif; padding: 0; cursor: pointer;
}
body.touchOn #tutHud.tip .thTip { background: rgba(127,214,255,.3); }

/* ---------- сделка с Сущностью ---------- */
#dealBox {
  position: fixed; left: 50%; top: 22%; transform: translateX(-50%);
  z-index: 19; pointer-events: auto;
}
#dealBox.hidden { display: none; }
.dlCard {
  width: min(520px, 92vw); padding: 16px 18px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(26,10,28,.96), rgba(12,8,14,.96));
  border: 1px solid rgba(196,127,255,.55);
  box-shadow: 0 14px 44px rgba(0,0,0,.6), 0 0 26px rgba(150,40,190,.25);
  animation: dealIn .35s ease-out 1;
}
@keyframes dealIn { from { opacity: 0; transform: translateY(-10px) scale(.97); } to { opacity: 1; } }
.dlTitle {
  font-size: 13px; letter-spacing: .18em; color: #d9b3ff; margin-bottom: 8px;
  text-align: center; animation: pulse 1.6s infinite;
}
.dlText { font-size: 13px; line-height: 1.6; color: var(--text); }
.dlText b { color: #e9d0ff; }
.dlNote { margin-top: 8px; font-size: 11px; color: var(--dim); }
.dlBtns { display: flex; gap: 10px; margin-top: 12px; }
.dlBtns .btn { flex: 1; }
.dlBtns kbd {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  border-radius: 4px; padding: 0 4px; margin-left: 6px; font: inherit; font-size: 10px;
}
.cue.deal { color: #d9b3ff; border-color: rgba(196,127,255,.6); }
/* СДЕЛКА НА ТЕЛЕФОНЕ уходит в свободную половину экрана - ту, где стик, а
   не туда, где кнопки: иначе «принять» оказывалось ровно под «УЛЬТА» */
body.touchOn #dealBox {
  top: 50%; left: max(10px, env(safe-area-inset-left)); right: auto;
  transform: translateY(-50%);
}
body.touchOn.lefty #dealBox {
  left: auto; right: max(10px, env(safe-area-inset-right));
}
body.touchOn .dlCard { width: min(420px, 50vw); padding: 12px 14px; }
body.touchOn.dealOpen #loadoutHud, body.touchOn.dealOpen #minimap,
body.touchOn.dealOpen #helpTouch { display: none; }
body.touchOn .dlText { font-size: 12px; }
body.touchOn .dlBtns .btn { padding: 12px 10px; font-size: 14px; }

/* примерка сенсорных кнопок прямо в окне «Телефон» */
.pcPrev {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 92px; margin: 6px 0 10px; padding: 8px;
  border: 1px dashed var(--line); border-radius: 12px;
  background: radial-gradient(circle at 50% 60%, rgba(127,214,255,.05), transparent 70%);
}
.pcDemo {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid rgba(127,214,255,.5);
  background: rgba(20,26,34,.9); color: #cfe0f0;
  font-size: 8px; letter-spacing: .04em; text-align: center;
  opacity: var(--tAlpha, .85);
  transition: width .12s, height .12s, opacity .12s;
}
.pcDemo.big { width: calc(46px * var(--tScale, 1)); height: calc(46px * var(--tScale, 1)); }
.pcDemo.mid { width: calc(34px * var(--tScale, 1)); height: calc(34px * var(--tScale, 1)); font-size: 7px; }
.pcDemo.small { width: calc(26px * var(--tScale, 1)); height: calc(26px * var(--tScale, 1)); font-size: 6px; }

/* ---------- проверка целостности ---------- */
.checkCard { width: min(820px, 94vw); max-height: 88vh; display: flex; flex-direction: column; }
.chkVerdict { font-size: 11px; letter-spacing: .06em; margin-left: auto; padding: 2px 8px; border-radius: 6px; flex: 0 0 auto; }
.chkVerdict.ok { color: #7bd88f; background: rgba(123,216,143,.12); }
.chkVerdict.warn { color: #ffca3a; background: rgba(255,202,58,.12); }
.chkVerdict.bad { color: #ff7b6b; background: rgba(255,123,107,.14); }
.chkHint { font-size: 11px; color: var(--dim); margin: 2px 0 10px; line-height: 1.5; }
.chkBody { overflow-y: auto; padding-right: 4px; }
.chkSec { margin-bottom: 12px; }
.chkSec > h4 {
  margin: 0 0 5px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim);
}
.chkRow {
  display: flex; gap: 8px; align-items: baseline; font-size: 12px; line-height: 1.5;
  padding: 3px 8px; border-radius: 6px; background: rgba(255,255,255,.02);
  margin-bottom: 3px;
}
.chkRow i { font-style: normal; width: 14px; flex: none; text-align: center; }
.chkRow.ok i { color: #7bd88f; }
.chkRow.warn i { color: #ffca3a; }
.chkRow.bad i { color: #ff7b6b; }
.chkRow.bad { background: rgba(255,123,107,.08); }
.chkRow b { font-weight: 500; color: var(--text); }
.chkRow em { font-style: normal; color: var(--dim); font-size: 11px; }
.chkWait { font-size: 12px; color: var(--dim); padding: 14px 0; }

/* выжившим уже играет другой: карточку видно, но взять нельзя */
.charCard.busy { opacity: .42; filter: grayscale(.7); cursor: not-allowed; }
.charCard .cBusy {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  background: rgba(12,14,18,.9); border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 6px; font-size: 9px; letter-spacing: .04em; color: #ffb37a;
}
body.touchOn #mapName { display: none; }   /* на телефоне шапке не до карты */

/* зона отклика на проверку навыка: весь экран - одна кнопка */
#tScZone {
  position: absolute; inset: 0; pointer-events: auto; z-index: 2;
  background: radial-gradient(circle at 50% 50%, rgba(255,209,102,0) 55%, rgba(255,209,102,.09) 100%);
}
#tScZone.hidden { display: none; }

/* СООБЩЕНИЯ ПОВЕРХ МЕНЮ. Обычная всплывающая надпись живёт в HUD, а он в
   меню спрятан - и «не хватает очков» или «+10 000 за обучение» человек
   просто не видел. */
#menuToast {
  position: fixed; z-index: 45; left: 50%; bottom: 26px; transform: translateX(-50%);
  max-width: min(560px, 86vw); padding: 10px 16px; border-radius: 10px;
  background: rgba(12,14,18,.96); border: 1px solid rgba(127,214,255,.4);
  color: #dbe6f2; font-size: 13px; letter-spacing: .04em; text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.55); animation: toastIn .2s ease-out 1;
  pointer-events: none;
}
#menuToast.hidden { display: none; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; } }

/* предложение развернуть игру на весь экран */
#fsHint {
  position: fixed; z-index: 40; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  background: rgba(12,14,18,.94); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font-size: 12px; color: var(--text);
  box-shadow: 0 8px 26px rgba(0,0,0,.5);
}
#fsHint.hidden { display: none; }
/* на телефоне уводим её наверх: внизу кнопки, там ей не место */
body.touchOn #fsHint { bottom: auto; top: max(52px, calc(env(safe-area-inset-top) + 46px)); }

/* переключатель адреса под QR */
#pjSwap { margin-top: 6px; }
#pjSwap.hidden, #jsSwap.hidden { display: none; }
#jsSwap { margin-top: 12px; }
.pjNet { margin-top: 6px; font-size: 11px; color: var(--dim); }
.pjOther.on { border-color: var(--accent); color: var(--text); }

/* просьба повернуть телефон: только в сенсорном режиме и только в портрете */
#rotateHint {
  position: fixed; inset: 0; z-index: 30; display: none;
  align-items: center; justify-content: center; background: rgba(4,5,7,.93);
  /* просьба повернуть - НАДПИСЬ, а не заслонка: пальцы проходят сквозь неё.
     Иначе она перехватывала нажатия на кнопки, которые под ней (например,
     «Управлять ботом» у наблюдателя, зашедшего в идущий матч). */
  pointer-events: none;
}
body.touchOn.portrait #rotateHint { display: flex; }
/* но не поверх меню, итогов и окон: там свои кнопки, и до них надо дотянуться */
body.uiOpen #rotateHint, body.uiOpen #fsHint { display: none !important; }
/* и нижняя памятка не лезет под открытое окно */
body.uiOpen #helpTouch { opacity: 0; }
.rhBox {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--text); text-align: center; padding: 24px;
}
.rhBox b { letter-spacing: .16em; font-weight: 400; font-size: 15px; }
.rhBox span { color: var(--dim); font-size: 12px; }
.rhBox svg { color: var(--accent); animation: rhTurn 2.2s ease-in-out infinite; }
@keyframes rhTurn { 0%,60%,100% { transform: rotate(0) } 80% { transform: rotate(-90deg) } }

/* короткий экран (телефон в альбомной): шапка меню не должна съедать всё */
@media (max-height: 560px) {
  .logo { width: min(210px, 40vw); }
  .logoSub { display: none; }
  .menuWrap { gap: 8px; padding-bottom: 20px; }
  .tabs { gap: 6px; }
  .tab { padding: 6px 12px; font-size: 12px; }
  .glass.card { padding: 12px 14px; }
  .rulesList li { font-size: 11px; }
  .charCard .portrait { height: 96px; }
}

/* ================= ОКНО «ТЕЛЕФОН И УПРАВЛЕНИЕ» ================= */
.phoneCard { width: min(760px, 94vw); animation: riseIn .25s ease both; }
.phoneCard .secTitle #phoneClose { float: none; order: 3; }
.phoneCard .secTitle::after { order: 2; }
.phoneCols { display: grid; grid-template-columns: 258px 1fr; gap: 18px; }
@media (max-width: 700px) { .phoneCols { grid-template-columns: 1fr; } }

.phoneJoin { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.pjQr { width: 208px; height: 208px; border-radius: 12px; overflow: hidden; background: #e9eef7;
  box-shadow: 0 8px 26px -12px rgba(0,0,0,.9); }
.pjQr svg { display: block; width: 100%; height: 100%; }
.pjUrl { font-size: 13px; color: var(--accent); letter-spacing: .02em; word-break: break-all; text-align: center; }
.pjHint { font-size: 11px; color: var(--dim); text-align: center; line-height: 1.5; }
.pjAlt { font-size: 10.5px; color: var(--dim); text-align: center; }
.pjAlt b { color: #b9c3d2; font-weight: 500; }
.phoneJoin .btn { width: 100%; }

.phoneCtl { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pcRow { display: flex; gap: 8px; }
.pcRow .btn { flex: 1; }
.btn.active { border-color: var(--accent2); color: var(--accent); background: rgba(127,214,255,.10); }

/* ================= ЭКРАН «ПОДКЛЮЧАЙТЕСЬ» (на телевизор) ================= */
#joinScreen {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 90% at 50% 20%, #12161f, #05060a 70%);
  animation: fadeIn .25s ease;
}
#joinScreen.hidden { display: none; }
.jsWrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px; }
.jsTitle { font-size: clamp(34px, 7vh, 78px); letter-spacing: .18em; font-weight: 300; color: #dfe7f2; }
.jsTitle span { color: #ff5a5a; }
.jsSub { font-size: clamp(11px, 1.6vh, 16px); letter-spacing: .34em; color: var(--dim); text-transform: uppercase; }
.jsQr {
  width: min(46vh, 46vw); height: min(46vh, 46vw); background: #e9eef7;
  border-radius: 16px; padding: 10px; box-shadow: 0 20px 60px -20px #000;
}
.jsQr svg { display: block; width: 100%; height: 100%; }
.jsUrl { font-size: clamp(16px, 2.8vh, 30px); color: var(--accent); letter-spacing: .04em; }
.jsPlayers { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 80vw; }
.jsP {
  font-size: clamp(11px, 1.7vh, 16px); color: var(--text);
  background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px;
}
.jsP.k { color: #ff9c9c; border-color: rgba(255,90,90,.35); }
.jsWait { color: var(--dim); font-size: 13px; letter-spacing: .1em; }
.jsFoot { font-size: 11px; color: var(--dim); letter-spacing: .1em; }

/* размер и заметность сенсорных кнопок настраиваются игроком */
#touch .tBtn, #touch #tStick { opacity: var(--tAlpha, .85); }
#tRight { transform: scale(var(--tScale, 1)); transform-origin: bottom right; }
#tWiggle, #tSkill { transform: translateX(-50%) scale(var(--tScale, 1)); transform-origin: bottom center; }
/* левша: джойстик справа, кнопки слева */
#touch.lefty #tStickZone { left: auto; right: 0; }
#touch.lefty #tRight {
  right: auto; left: max(12px, env(safe-area-inset-left));
  align-items: flex-start; transform-origin: bottom left;
}
#touch.lefty .tRow { flex-direction: row-reverse; }
/* «ОТКЛИК» и «ВЫРЫВАТЬСЯ» стоят по центру - зеркалить их не нужно */
/* ...а вот верхние кнопки НЕ зеркалим: слева сверху висит список игроков */
body.touchOn #touch.lefty ~ #hud #minimap, body.touchOn.lefty #minimap { left: auto; right: 10px; }

/* адреса подключения: подпись сети и предупреждение про VPN */
.pjWarn { color: var(--warn); display: block; line-height: 1.5; }
.pjMore { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.pjOther {
  cursor: pointer; color: #b9c3d2; border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 7px; transition: border-color .15s ease, color .15s ease;
}
.pjOther:hover { border-color: var(--accent2); color: var(--accent); }
.pjOther i { color: var(--dim); font-style: normal; }
.pjOther.vpn { opacity: .65; }

/* ================= ВКЛАДКА «ПРОГРЕСС» ================= */
.progHead { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.phLevel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 76px; height: 76px; flex: none; border-radius: 16px;
  background: radial-gradient(120% 120% at 50% 20%, rgba(127,214,255,.14), rgba(0,0,0,.35));
  border: 1px solid rgba(127,214,255,.32);
}
.phLevel b { font-size: 30px; font-weight: 300; color: #eaf3ff; line-height: 1; }
.phLevel span { font-size: 9px; letter-spacing: .18em; color: var(--dim); text-transform: uppercase; margin-top: 3px; }
.phMain { flex: 1; min-width: 0; }
.phRank { font-size: 16px; color: var(--accent); letter-spacing: .04em; margin-bottom: 7px; }
.phTrack { height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.phTrack i { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent2), var(--accent)); transition: width .4s ease; }
.phNums { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); margin-top: 6px; }
.progStats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.progStats span {
  font-size: 11px; color: var(--dim); background: rgba(255,255,255,.04);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
}
.progStats b { color: var(--text); font-weight: 600; margin-right: 4px; }

/* расклад ролей под переключателем «выживший / маньяк» */
/* ГДЕ ИГРАЕМ: адрес для друзей и код комнаты. Блок тихий - это справка,
   а не кнопка; код, наоборот, крупный: его диктуют голосом. */
.netBox { margin-top: 2px; margin-bottom: 12px; font-size: 11.5px; color: var(--dim); line-height: 1.55; }
.netLine b { color: var(--text); font-weight: 600; word-break: break-all; }
.netCode {
  display: flex; align-items: center; gap: 10px; margin-top: 8px;
  background: rgba(127,214,255,.08); border: 1px solid rgba(127,214,255,.28);
  border-radius: 10px; padding: 8px 12px;
}
.netCodeLabel { font-size: 10px; letter-spacing: .14em; color: var(--dim); }
.netCode b {
  font-size: 22px; letter-spacing: .22em; color: #d6f2ff; font-weight: 700;
  text-shadow: 0 0 18px rgba(127,214,255,.35);
}
.netCode .btn.tiny { margin-left: auto; }

/* Окно ввода кода: показывается вместо меню, пока комната закрыта */
#codeScreen {
  position: fixed; inset: 0; z-index: 60; display: flex;
  align-items: center; justify-content: center;
  background: rgba(4,5,8,.82); backdrop-filter: blur(6px);
}
#codeScreen.hidden { display: none; }
.codeCard { width: min(420px, calc(100vw - 32px)); text-align: center; padding: 22px; }
.codeCard h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: .08em; }
.codeSub { color: var(--dim); font-size: 12.5px; margin: 0 0 14px; line-height: 1.5; }
#codeInput {
  width: 100%; text-align: center; font-size: 30px; letter-spacing: .3em;
  text-transform: uppercase; padding: 12px; margin-bottom: 14px;
}

/* Расшифровка уровня сложности: что именно меняется в правилах.
   Список узкий и тихий - он объясняет, а не спорит с кнопками. */
.diffList {
  margin: 8px 0 0; padding: 0; list-style: none;
  font-size: 11.5px; color: var(--dim); line-height: 1.55;
}
.diffList li { position: relative; padding-left: 12px; }
.diffList li::before {
  content: ''; position: absolute; left: 2px; top: 7px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: .55;
}

.rolePlan { margin-top: 8px; font-size: 11.5px; color: var(--dim); line-height: 1.6; }
.rolePlan b { color: var(--text); font-weight: 600; }
.rolePlan .kk { color: #ff8e7f; }
.rolePlan .ss { color: var(--accent); }
.rolePlan .ww { color: var(--warn); }
.segBtn.locked { opacity: .5; }

.offNote { font-size: 11.5px; color: var(--dim); margin-bottom: 10px; }
.offNote.warn { color: var(--warn); }
.offNote b { color: var(--accent); }
.offList { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 9px; }
.offCard {
  background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 11px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
  transition: border-color .15s ease, background .15s ease;
}
.offCard.foreign { opacity: .5; }
.offCard.owned { border-color: rgba(127,214,255,.3); }
.offCard.picked { border-color: var(--accent); background: rgba(127,214,255,.09); }
.ocHead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ocHead b { font-size: 13px; font-weight: 500; color: var(--text); }
.ocSide { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.ocDesc { font-size: 11px; color: var(--dim); line-height: 1.5; }
.ocFoot { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 2px; }
.ocHave { font-size: 10.5px; color: var(--ok); }
.ocHave.none { color: var(--dim); }
.ocFoot .btn.tiny { float: none; margin-left: auto; }
.ocFoot .ocUse { margin-left: 0; border-color: rgba(127,214,255,.4); color: var(--accent); }
/* уровень игрока рядом с именем в лобби */
.pl .lvl {
  font-size: 10px; color: var(--accent); border: 1px solid rgba(127,214,255,.3);
  border-radius: 6px; padding: 1px 6px; margin-left: 6px;
}

/* ================= КАРТОЧКИ ПОДНОШЕНИЙ ================= */
.offCard { border-left: 3px solid var(--oc, var(--line)); }
.offCard.picked { border-color: var(--oc); box-shadow: inset 0 0 22px -14px var(--oc); }
.ocTop { display: flex; align-items: center; gap: 9px; }
.ocIcon {
  width: 40px; height: 40px; flex: none; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--oc, var(--text));
  background: radial-gradient(120% 120% at 50% 20%, rgba(255,255,255,.08), rgba(0,0,0,.35));
  border: 1px solid color-mix(in srgb, var(--oc, #888) 45%, transparent);
}
.ocIcon svg { width: 72%; height: 72%; }
.ocIcon img { width: 100%; height: 100%; object-fit: contain; border-radius: 9px; }
.ocName { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ocName b { font-size: 13px; font-weight: 500; color: var(--text); }
.ocName i { font-style: normal; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--oc); }
.ocCount { font-size: 12px; color: var(--ok); font-weight: 600; }
/* ЦЕНА - ЭТО КНОПКА. Раньше она выглядела как подпись, и было непонятно,
   можно ли купить: теперь по карману - подсвечена, не по карману - тускло
   и с честной подписью, сколько не хватает. */
.ocFoot .ocBuy {
  min-width: 96px; text-align: center; font-weight: 600;
  border-color: rgba(127,214,255,.55); color: var(--accent);
  background: linear-gradient(180deg, rgba(127,214,255,.16), rgba(127,214,255,.05));
  box-shadow: 0 0 0 0 rgba(127,214,255,.35);
  transition: box-shadow .18s, transform .1s, background .18s;
}
.ocFoot .ocBuy:hover { box-shadow: 0 0 16px -2px rgba(127,214,255,.5); transform: translateY(-1px); }
.ocFoot .ocBuy:active { transform: translateY(0); }
.ocFoot .ocBuy.poor {
  opacity: .55; border-color: var(--line); color: var(--dim);
  background: rgba(255,255,255,.03); box-shadow: none;
}
.ocFoot .ocBuy.poor:hover { box-shadow: none; transform: none; }
/* уходящие очки: короткая вспышка «−6 000» у банка */
.spend {
  display: inline-block; margin-left: 8px; color: var(--warn); font-weight: 600;
  animation: spendUp 1.1s ease-out forwards;
}
@keyframes spendUp {
  0% { opacity: 0; transform: translateY(4px); }
  25% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-8px); }
}

/* подношения на заставке карты */
.msOff { margin-top: 16px; }
.msOffTitle { font-size: 10px; letter-spacing: .3em; color: var(--dim); margin-bottom: 8px; }
.msOffRow { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.msOffCard {
  display: flex; flex-direction: column; align-items: center; gap: 3px; width: 92px;
  color: var(--oc, var(--text));
}
.msOffCard svg { width: 34px; height: 34px; }
.msOffCard img { width: 34px; height: 34px; object-fit: contain; }
.msOffCard b { font-size: 10.5px; font-weight: 500; color: #e8eefa; text-align: center; line-height: 1.2; }
.msOffCard i { font-style: normal; font-size: 9px; color: var(--dim); }

/* на кого работает подношение - видно раньше описания */
.ocScope {
  display: flex; align-items: baseline; gap: 7px;
  font-size: 9.5px; letter-spacing: .12em; color: var(--sc, var(--dim));
  border-left: 2px solid var(--sc, var(--line)); padding-left: 7px;
}
.ocScope em { font-style: normal; letter-spacing: 0; font-size: 10.5px; color: var(--dim); }
.msOffCard u { text-decoration: none; font-size: 8px; letter-spacing: .12em; }

/* ================= ОЧЕНЬ НИЗКИЙ ЭКРАН (телефон в альбомной) =================
   293 CSS-пикселя высоты - это меньше, чем шапка меню на компьютере. Всё,
   что можно ужать без потери смысла, ужимаем; окна получают прокрутку,
   иначе их края уезжают за экран.                                          */
@media (max-height: 430px) {
  .logo { width: min(150px, 30vw); }
  .menuWrap { gap: 6px; padding-bottom: 14px; }
  .tab { padding: 4px 10px; font-size: 11px; }
  .glass.card { padding: 9px 11px; }
  .secTitle { margin: 2px 0 8px; font-size: 10px; }
  .field label { font-size: 10px; }
  /* прогресс */
  .phLevel { width: 54px; height: 54px; }
  .phLevel b { font-size: 21px; }
  .progHead { gap: 10px; margin-bottom: 9px; }
  .phRank { font-size: 13px; margin-bottom: 5px; }
  .progStats { gap: 5px; margin-bottom: 10px; }
  .progStats span { font-size: 10px; padding: 2px 7px; }
  .offList { grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); gap: 6px; }
  .offCard { padding: 7px 9px; gap: 4px; }
  .ocIcon { width: 30px; height: 30px; border-radius: 8px; }
  .ocName b { font-size: 12px; }
  .ocDesc { font-size: 10px; line-height: 1.4; }
  .ocScope em { display: none; }
  /* карточки персонажей и перков */
  .charCard .portrait { height: 78px; }
  .chars { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  /* итоги матча */
  .rrow { padding: 7px 9px; }
  .rrow .av { width: 26px; height: 26px; }
}

/* Любое окно поверх игры обязано влезать в экран и прокручиваться внутри:
   на телефоне в альбомной высота меньше, чем сама карточка. */
.overlay .card, .overlay .glass { max-height: 92vh; overflow-y: auto; scrollbar-width: thin; }
.overlay .card::-webkit-scrollbar, .overlay .glass::-webkit-scrollbar { width: 5px; }
.overlay .card::-webkit-scrollbar-thumb, .overlay .glass::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.18); border-radius: 3px;
}
@media (max-height: 430px) {
  .phoneCols { grid-template-columns: 1fr; gap: 10px; }
  .pjQr { width: 132px; height: 132px; }
  .mixCard, .phoneCard { padding: 10px 12px; }
  .mixRows { gap: 8px; margin: 2px 0 8px; }
  .mixRow .sub { display: none; }
  .jsQr { width: min(40vh, 40vw); height: min(40vh, 40vw); }
}


/* ---- окно «поставь на экран Домой» ---- */
.instCard { width: min(560px, 94vw); }
.instWhy { font-size: 12px; color: var(--dim); line-height: 1.6; margin: 4px 0 10px; }
.instSteps { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.instStep {
  display: flex; align-items: flex-start; gap: 9px;
  background: rgba(18,20,26,.7); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; font-size: 12.5px; line-height: 1.5;
}
.instStep u { font-style: normal; text-decoration: none; color: #ffca3a; font-weight: 600; }
.instStep i {
  font-style: normal; flex: 0 0 20px; height: 20px; border-radius: 50%;
  background: rgba(255,202,58,.16); color: #ffca3a; font-size: 11px;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.instRow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-height: 430px) {
  .instWhy { margin: 2px 0 6px; }
  .instStep { padding: 6px 9px; font-size: 12px; }
  .instSteps { gap: 6px; margin-bottom: 8px; }
}


/* ---- узкие экраны: длинным словам разрешено переноситься внутри слова ----
   Иначе одно слово вроде «взаимопомощь» распирает карточку и выталкивает
   соседний текст на чужое место. */
@media (max-width: 900px) {
  .itemCard span, .cd, .rulesList li, .instStep, .tutCard1 i, .mixHint, .chkHint, .tutHint {
    overflow-wrap: anywhere;
  }
}


/* ---- подпись автора внизу правил ---- */
.madeBy {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 16px; padding: 5px 11px 5px 8px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.03);
  color: var(--dim); font-size: 11px; letter-spacing: .06em; text-decoration: none;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.madeBy svg { width: 13px; height: 13px; fill: #4aa8e0; flex: none; }
.madeBy:hover { color: var(--text); border-color: rgba(74,168,224,.55); background: rgba(74,168,224,.10); }
.madeBy:hover svg { fill: #6cc3f5; }


/* ================= ЭКРАННАЯ СЦЕНА УЛЬТЫ =================
   Одна и та же разметка, два характера. У маньяка это удар по глазам:
   экран темнеет к краям цветом персонажа, из центра расходятся два кольца
   ударной волны, картинку ведёт. У выжившего наоборот - выдох: тёплая
   вспышка из центра, светлые лучи и мягкое свечение по краям.
   Всё на CSS-анимациях: они не стоят кадров даже на слабом телефоне. */
#ultScreen {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  --uc: #c47fff;
  overflow: hidden;
}
#ultScreen .uRing {
  position: absolute; left: 50%; top: 50%; width: 40vmax; height: 40vmax;
  margin: -20vmax 0 0 -20vmax; border-radius: 50%;
  border: 2px solid var(--uc); opacity: 0; transform: scale(.05);
}
#ultScreen .uName {
  position: absolute; left: 50%; top: 22%; transform: translateX(-50%);
  font-size: 13px; letter-spacing: .34em; text-transform: uppercase;
  color: var(--uc); text-shadow: 0 0 22px var(--uc); opacity: 0; white-space: nowrap;
}
/* --- маньяк --- */
#ultScreen.k {
  background:
    radial-gradient(circle at 50% 50%, rgba(0,0,0,0) 34%, color-mix(in srgb, var(--uc) 55%, #120010) 100%),
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--uc) 30%, transparent) 0%, rgba(0,0,0,0) 46%);
}
#ultScreen.k.on { animation: ultK 1.15s cubic-bezier(.16,.9,.3,1) 1; }
#ultScreen.k.on .uRing { animation: ultRing .95s cubic-bezier(.15,.85,.25,1) 1; }
#ultScreen.k.on .uRing.r2 { animation-delay: .16s; animation-duration: 1.1s; }
#ultScreen.k.on .uName { animation: ultName 1.5s ease-out 1; }
@keyframes ultK {
  0%   { opacity: 0; transform: scale(1.18); filter: saturate(2.2) contrast(1.2); }
  10%  { opacity: 1; transform: scale(1); }
  55%  { opacity: .55; }
  100% { opacity: 0; transform: scale(1.03); filter: none; }
}
/* --- выживший --- */
#ultScreen.s {
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--uc) 42%, transparent) 0%, rgba(0,0,0,0) 40%),
    radial-gradient(circle at 50% 50%, rgba(0,0,0,0) 55%, color-mix(in srgb, var(--uc) 26%, transparent) 100%);
  mix-blend-mode: screen;
}
#ultScreen.s.on { animation: ultS 1.1s ease-out 1; }
#ultScreen.s.on .uRing { animation: ultRing 1.05s ease-out 1; }
#ultScreen.s.on .uRing.r2 { animation-delay: .2s; }
#ultScreen.s.on .uName { animation: ultName 1.4s ease-out 1; }
@keyframes ultS {
  0%   { opacity: 0; transform: scale(.9); }
  14%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.06); }
}
@keyframes ultRing {
  0%   { opacity: .9; transform: scale(.05); border-width: 3px; }
  70%  { opacity: .35; }
  100% { opacity: 0; transform: scale(1.9); border-width: 1px; }
}
@keyframes ultName {
  0%   { opacity: 0; transform: translateX(-50%) translateY(8px); letter-spacing: .6em; }
  18%  { opacity: 1; transform: translateX(-50%) translateY(0); letter-spacing: .34em; }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}


/* тонкая настройка графики в окне «Телефон» */
.secSub {
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--dim); margin: 12px 0 6px;
}
.pcGfx { flex-wrap: wrap; gap: 6px; }
.pcGfx .btn { font-size: 11px; padding: 5px 9px; }
.pcGfx .btn.off { opacity: .55; text-decoration: line-through; }


/* ================= ШКАЛА СИДЕНИЯ В ШКАФЧИКЕ ================= */
#lockerPanel {
  position: absolute; left: 50%; bottom: 128px; transform: translateX(-50%);
  width: min(320px, 54vw); padding: 8px 12px 9px;
  background: rgba(12,14,18,.86); border: 1px solid rgba(140,220,255,.4);
  border-radius: 12px; backdrop-filter: blur(6px);
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
#lockerPanel.hidden { display: none; }
#lockerPanel .lpHead {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; letter-spacing: .18em; color: #9cd8f5; margin-bottom: 6px;
}
#lockerPanel .lpVal { color: #e6ecf5; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
#lockerPanel .lpTrack {
  height: 8px; background: rgba(20,22,28,.9); border: 1px solid var(--line);
  border-radius: 5px; overflow: hidden;
}
#lockerPanel .lpTrack i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, #6fc9ef, #9be7ff);
  transition: width .12s linear;
}
#lockerPanel.low { border-color: rgba(255,120,110,.65); animation: lpShake .35s linear infinite; }
#lockerPanel.low .lpTrack i { background: linear-gradient(90deg, #ff6b5e, #ffb4a0); }
#lockerPanel.low .lpHead { color: #ffb0a4; }
#lockerPanel .lpHint { font-size: 10px; color: var(--dim); margin-top: 6px; line-height: 1.4; }
@keyframes lpShake {
  0%,100% { transform: translateX(-50%) translateY(0); }
  25% { transform: translateX(calc(-50% - 2px)) translateY(1px); }
  75% { transform: translateX(calc(-50% + 2px)) translateY(-1px); }
}

/* ================= СУНДУК СУЩНОСТИ ================= */
#chestBox {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 19; width: min(320px, 86vw); padding: 14px 16px 16px;
  background: rgba(12,15,20,.94); border: 1px solid rgba(255,202,58,.5);
  border-radius: 16px; text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,.6), 0 0 34px rgba(255,180,60,.16);
  animation: supIn .22s ease-out 1;
}
#chestBox.hidden { display: none; }
#chestBox .chTitle {
  font-size: 11px; letter-spacing: .22em; color: #ffca3a; margin-bottom: 10px;
}
#chestBox canvas { width: 220px; height: 220px; max-width: 62vw; max-height: 62vw; display: block; margin: 0 auto; }
#chestBox .chPins { display: flex; justify-content: center; margin: 10px 0 6px; }
/* полоса удержания: сколько секунд отмычка уже стоит в живой полосе */
#chestBox .chPins .chBar {
  display: block; width: 100%; height: 8px; border-radius: 5px;
  background: rgba(20,22,28,.9); border: 1px solid var(--line); overflow: hidden;
}
#chestBox .chPins .chBar u {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #6fa8d0, #9fd7ff);
  transition: width .08s linear;
}
#chestBox .chPins .chBar.hot u { background: linear-gradient(90deg, #ffca3a, #ffe08a); }

/* ПОЛОВИНКИ ЭКРАНА ПОД БОЛЬШОЙ ПАЛЕЦ.
   На телефоне отмычку крутят нажатием на левую или правую сторону: две
   широкие зоны поверх игры, с подсказкой-стрелкой. */
#pickZones { position: fixed; inset: 0; z-index: 18; pointer-events: none; }
#pickZones.hidden { display: none; }
#pickZones i {
  /* сверху оставляем полосу под кнопки «меню» и «счёт», снизу справа - под
     ДЕЙСТВИЕ: из вскрытия надо уметь выйти и заглянуть в меню */
  position: absolute; top: min(96px, 22%); bottom: 0; width: 34%;
  pointer-events: auto; display: flex; align-items: center;
  font-style: normal; font-size: 34px; color: rgba(255,224,138,.30);
  transition: background .12s ease, color .12s ease;
}
#pickZones i.l { left: 0; justify-content: flex-start; padding-left: 4vw;
  background: linear-gradient(90deg, rgba(255,202,58,.10), rgba(255,202,58,0)); }
/* правая зона НЕ достаёт до кнопки ДЕЙСТВИЕ: ею из вскрытия выходят */
#pickZones i.r { right: 0; justify-content: flex-end; padding-right: 4vw;
  bottom: min(190px, 46%);
  background: linear-gradient(270deg, rgba(255,202,58,.10), rgba(255,202,58,0)); }
#pickZones i.down { color: rgba(255,240,190,.85); }
#pickZones i.l.down { background: linear-gradient(90deg, rgba(255,202,58,.28), rgba(255,202,58,0)); }
#pickZones i.r.down { background: linear-gradient(270deg, rgba(255,202,58,.28), rgba(255,202,58,0)); }
#chestBox .chHint { font-size: 11px; color: var(--dim); line-height: 1.5; }
#chestBox .chHint b { color: var(--text); }
#chestBox .chPrize {
  font-size: 30px; font-weight: 700; color: #ffe08a; letter-spacing: .04em;
  text-shadow: 0 0 26px rgba(255,202,58,.8); margin-top: 4px;
  animation: scorePop .5s ease-out;
}
#chestBox .chPrize.hidden { display: none; }
/* НА ТЕЛЕФОНЕ окно уходит в свободную половину - ту, где джойстик, а не
   туда, где кнопки: иначе «ДАВИ» оказывалась ровно под окном. */
body.touchOn #chestBox {
  width: min(280px, 46vw); padding: 10px 12px 12px;
  left: max(10px, env(safe-area-inset-left)); top: 50%;
  transform: translateY(-50%);
}
body.touchOn.lefty #chestBox {
  left: auto; right: max(10px, env(safe-area-inset-right));
}
body.touchOn #chestBox canvas { width: 168px; height: 168px; }
body.touchOn #chestBox .chHint { font-size: 10px; }
@media (max-height: 430px) {
  #chestBox { padding: 8px 10px 10px; }
  #chestBox canvas { width: 150px; height: 150px; }
  #chestBox .chTitle { margin-bottom: 6px; }
  #chestBox .chPins { margin: 6px 0 4px; }
}


/* пока крутим отмычку, лишние сенсорные кнопки не нужны: остаётся только
   ДЕЙСТВИЕ (им выходят) - остальное лишь мешало бы под пальцем */
body.picking #touch .tBtn[data-t="ult"],
body.picking #touch .tBtn[data-t="power"],
body.picking #touch .tBtn[data-t="crouch"],
body.picking #touch #tRowRare,
body.picking #touch #tSkill { display: none !important; }
body.picking #helpTouch { opacity: 0; }

/* ================= РЕКЛАМНАЯ ПОЛОСА В МЕНЮ =================
   Одна широкая карточка под меню. Ведёт себя тихо: без анимаций,
   отвлекающих от кнопки «начать матч», с честной пометкой «реклама» и
   плавной сменой картинки. Если баннеров нет - блока нет вовсе
   (класс .hidden ставит клиент, увидев пустой список). */
.adBox {
  width: min(760px, 94vw);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: riseIn .5s .2s ease both;
}
.adSlot {
  position: relative; display: block; width: 100%;
  aspect-ratio: 728 / 120;
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(12, 14, 19, .72);
  box-shadow: 0 16px 40px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.04);
  text-decoration: none; color: var(--text);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.adSlot:hover { transform: translateY(-2px); border-color: var(--line2); box-shadow: 0 22px 52px rgba(0,0,0,.6); }
/* без ссылки баннер не кликается и курсор об этом честно говорит */
.adSlot.noLink { cursor: default; }
.adSlot.noLink:hover { transform: none; }
.adSlot img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: 1; transition: opacity .35s ease;
}
.adSlot.fade img { opacity: 0; }
/* подпись поверх картинки: читается на любом фоне за счёт градиента */
.adTitle {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 20px 14px 9px; font-size: 13.5px; font-weight: 600; letter-spacing: .02em;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.72));
  text-shadow: 0 2px 6px rgba(0,0,0,.7);
}
.adTitle:empty { display: none; }
.adMark {
  position: absolute; top: 7px; right: 8px;
  font-size: 9px; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(255,255,255,.62);
  background: rgba(0,0,0,.42); border-radius: 5px; padding: 3px 6px;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.adDots { display: flex; gap: 6px; }
.adDots:empty { display: none; }
.adDots i {
  width: 18px; height: 3px; border-radius: 2px; cursor: pointer;
  background: rgba(255,255,255,.18); transition: background .2s ease;
}
.adDots i:hover { background: rgba(255,255,255,.34); }
.adDots i.on { background: var(--accent2); }
@media (max-width: 620px) {
  .adSlot { aspect-ratio: 480 / 110; }
  .adTitle { font-size: 12px; padding: 16px 11px 7px; }
}
/* НИЗКИЙ АЛЬБОМНЫЙ ЭКРАН ТЕЛЕФОНА. Там всего 390 точек по высоте, и полоса
   в 136 из них съедает треть меню. Делаем её узкой лентой. */
@media (max-height: 560px) {
  .adBox { width: min(560px, 92vw); }
  .adSlot { aspect-ratio: 970 / 90; }
  .adTitle { font-size: 11.5px; padding: 14px 10px 6px; }
}

/* ссылки на правовые страницы сайта: мелко, в подвале «Правил» */
.legalLinks {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex; gap: 7px; flex-wrap: wrap; align-items: center;
  font-size: 12px; color: var(--dim);
}
.legalLinks a { color: var(--dim); text-decoration: none; }
.legalLinks a:hover { color: var(--accent); text-decoration: underline; }

/* строка «в какой ты комнате» и кнопки перехода (только в онлайне) */
.roomBox {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px;
}
.roomBox.hidden { display: none; }
.roomWhere { flex: 1 1 200px; font-size: 11.5px; color: var(--dim); }
.roomWhere b { color: var(--text); font-weight: 600; }
