/* «Лёд и Пламя» — стили по docs/design/SYSTEM.md (v2.3).
   Основа дебильника (отступы, тексты, статусы) + слой R2 (тёплая тьма, бронза, золото, антиква).
   ПРАВИЛО ВНУТРЕННЕГО И ВНЕШНЕГО: отступ внутри группы всегда меньше, чем между группами.
   Отступы — только ступени лестницы: 4 · 8 · 12 · 16 · 24 · 32. Других чисел для промежутков нет. */

:root {
  /* нейтральные — тёплая тьма */
  --bg: #110C09; --surface: #1C1511; --surface-raised: #2A2019; --border: #3A2C20;
  --text: #F2EBDD; --text-2: #A7A196;
  /* золото и бронза */
  --gold-text: #EDD78A; --gold-pale: #F4E3B2; --gold-bg: rgba(232, 185, 74, .12);
  --bronze: #8E5F32; --bronze-line: rgba(192, 151, 64, .35);
  --btn-gold: linear-gradient(180deg, #FFD978 0%, #F2A93B 55%, #C9711F 100%); --btn-gold-text: #3A1E05;
  /* статусы */
  --success: #2FD567; --success-bg: rgba(47, 213, 103, .12); --success-soft: rgba(47, 213, 103, .20);
  --heal: #B8F04A; /* лечение — салатовый */
  --buff: #A98BFF; /* усиление — фиолетовый */
  --atk: #FF3B30;  /* атака — красный */
  --error: #FF6A3D;
  /* стороны — только цвет команды */
  --fire: #FFA23A; --fire-bg: rgba(255, 162, 58, .12); --fire-line: rgba(255, 162, 58, .40);
  --ice: #3FA0FF; --ice-text: #8CC8FF; --ice-bg: rgba(63, 160, 255, .12); --ice-line: rgba(63, 160, 255, .40);
  /* лестница отступов */
  --s4: 4px; --s8: 8px; --s12: 12px; --s16: 16px; --s24: 24px; --s32: 32px;
  /* радиусы и шрифты */
  --r-ctrl: 16px; --r-card: 24px;
  --display: Forum, "Times New Roman", serif;
  --hud: rgba(17, 12, 9, .84);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; -webkit-tap-highlight-color: transparent;
  font: 500 16px/22px Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-feature-settings: "tnum" 1; }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
p, h1, h2, ul { margin: 0; }

/* ---------- Отступы: только лестница ---------- */
.mt-4 { margin-top: var(--s4); } .mt-8 { margin-top: var(--s8); } .mt-12 { margin-top: var(--s12); }
.mt-16 { margin-top: var(--s16); } .mt-24 { margin-top: var(--s24); } .mt-32 { margin-top: var(--s32); }
.stack-8 > * + * { margin-top: var(--s8); } .stack-12 > * + * { margin-top: var(--s12); } .stack-16 > * + * { margin-top: var(--s16); }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; gap: var(--s16); }
.gap-8 { gap: var(--s8); } .gap-12 { gap: var(--s12); } .gap-16 { gap: var(--s16); }

/* ---------- Типографика ---------- */
.display { font: 400 32px/38px var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--gold-pale); }
.title { font: 400 24px/28px var(--display); letter-spacing: .02em; color: var(--gold-pale); }
.body { font-size: 16px; line-height: 22px; font-weight: 400; }
.body-strong { font-size: 16px; line-height: 22px; font-weight: 600; }
.caption { font-size: 13px; line-height: 16px; font-weight: 500; }
.secondary { color: var(--text-2); }
.err { color: var(--error); }
/* надзаголовок и подпись секции — антиква заглавными */
.over, .label, .field > span { font: 400 13px/16px var(--display); text-transform: uppercase; letter-spacing: .12em; color: var(--gold-text); }
.label { opacity: .85; padding-left: var(--s4); margin-bottom: var(--s12); } /* подпись секции → 12 → содержимое: больше, чем подпись поля → 8 → поле */
.field > span { opacity: .85; padding-left: var(--s4); }

/* ---------- Меню-экраны ---------- */
.screen { position: fixed; inset: 0; overflow-y: auto; background:
  radial-gradient(60% 50% at 0% 100%, rgba(255, 140, 50, .14), transparent 70%),
  radial-gradient(60% 50% at 100% 0%, rgba(63, 160, 255, .12), transparent 70%), var(--bg); }
.col { width: 100%; max-width: 440px; margin: 0 auto; padding: var(--s32) var(--s16); min-height: 100%; display: flex; flex-direction: column; }
.col.wide { max-width: 760px; }
.col.hub { max-width: 1200px; }
.col.center { justify-content: center; }

.logo { font: 400 44px/48px var(--display); text-transform: uppercase; letter-spacing: .06em; }
.logo.small { font-size: 24px; line-height: 28px; }
.logo .ice { color: var(--ice-text); text-shadow: 0 0 24px rgba(63, 160, 255, .55); }
.logo .fire { color: var(--fire); text-shadow: 0 0 24px rgba(255, 140, 50, .6); }
.logo .amp { color: var(--gold-text); }
.ornament { height: 1px; background: linear-gradient(90deg, transparent, var(--bronze), transparent); }

/* ---------- Кнопки: 52, одна главная на экран ---------- */
.btn { height: 52px; width: 100%; padding: 0 var(--s16); border-radius: var(--r-ctrl); border: 1px solid var(--bronze-line); background: transparent; color: var(--text);
  font-size: 16px; line-height: 20px; font-weight: 600; cursor: pointer; transition: background .15s; white-space: nowrap; }
.btn:hover { background: rgba(192, 151, 64, .08); }
.btn.primary { border: 0; border-radius: 4px; background: var(--btn-gold); color: var(--btn-gold-text);
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%);
  font: 400 20px/20px var(--display); letter-spacing: .08em; text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 240, 200, .6); filter: drop-shadow(0 0 12px rgba(242, 169, 59, .35)); }
.btn.primary:hover { filter: brightness(1.08) drop-shadow(0 0 16px rgba(242, 169, 59, .5)); }
.btn.primary:active { filter: brightness(.92); }
.btn.text { width: auto; height: 44px; border: 0; padding: 0 var(--s8); color: var(--gold-text); }
.btn.text:hover { background: transparent; opacity: .8; }
.btn.small { width: auto; height: 40px; padding: 0 var(--s12); font-size: 14px; line-height: 18px; }
.btn.fit { width: auto; min-width: 200px; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.fire { border-color: var(--fire-line); color: var(--fire); }
.btn.ice { border-color: var(--ice-line); color: var(--ice-text); }
.btn.yandex { display: flex; align-items: center; justify-content: center; gap: var(--s8); }
.ya { width: 24px; height: 24px; border-radius: 50%; background: #FC3F1D; color: #fff; font: 700 15px/24px Inter, sans-serif; text-align: center; } /* цвет чужого бренда — только в его знаке */
@media (min-width: 768px) { .btn.fit { min-width: 280px; } }

/* ---------- Поля ---------- */
.field { display: flex; flex-direction: column; gap: var(--s8); }
input, select, textarea { height: 52px; width: 100%; padding: 0 var(--s16); border-radius: var(--r-ctrl); border: 1px solid var(--bronze-line); background: var(--surface);
  font-size: 16px; font-weight: 400; outline: none; -webkit-appearance: none; appearance: none; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 22px) 23px, calc(100% - 16px) 23px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
textarea { display: block; height: 96px; padding: var(--s12) var(--s16); resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold-text); }
input::placeholder, textarea::placeholder { color: var(--text-2); }
.check { display: flex; align-items: center; gap: var(--s12); min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; padding: 0; border-radius: 6px; accent-color: #F2A93B; -webkit-appearance: auto; appearance: auto; }

/* ---------- Карточка, плитка, пилюля ---------- */
/* Поле карточки 16 (24 с 768 px) всегда меньше зазора между карточками 24 (32 с 768 px) */
.card { background: var(--surface); border: 1px solid var(--bronze-line); border-radius: var(--r-card); padding: var(--s16); }
@media (min-width: 768px) { .card { padding: var(--s24); } }
.card.fire { background: var(--fire-bg); border-color: var(--fire-line); }
.card.ice { background: var(--ice-bg); border-color: var(--ice-line); }
.tile { display: flex; align-items: center; gap: var(--s12); min-height: 56px; padding: var(--s12) var(--s16); background: var(--surface-raised); border: 1px solid transparent; border-radius: var(--r-ctrl); }
.tile.link { cursor: pointer; } .tile.link:hover { border-color: var(--bronze-line); }
.tile .t { flex: 1; min-width: 0; } .tile .t > * { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .t > .caption { margin-top: var(--s4); color: var(--text-2); }
.tile.ok { background: var(--success-bg); }
.chev { color: var(--text-2); font-size: 20px; }
.ok-ico { width: 40px; height: 40px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: grid; place-items: center; font-weight: 700; flex: none; }
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 var(--s8); border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--success-bg); color: var(--success); }
.pill.new { background: var(--gold-bg); color: var(--gold-text); }

/* ================= Главная ================= */
/* шапка → 32 → сетка; зазор сетки 24 (32 с 768) больше поля карточки 16 (24) */
.hub-grid { display: grid; gap: var(--s24); grid-template-columns: 1fr; grid-template-areas: "play" "profile" "friends" "news" "info"; }
@media (min-width: 768px) { .hub-grid { gap: var(--s32); } }
@media (min-width: 960px) {
  .hub-grid { grid-template-columns: 1fr 1fr 1.5fr; grid-template-areas: "profile friends play" "news info play"; align-items: start; }
  .w-play { grid-row: span 2; }
}
.w-play { grid-area: play; background: linear-gradient(160deg, rgba(255, 162, 58, .10), transparent 45%), linear-gradient(340deg, rgba(63, 160, 255, .10), transparent 45%), var(--surface); }
.w-play .display { font-size: 40px; line-height: 44px; }
.w-profile { grid-area: profile; } .w-friends { grid-area: friends; } .w-news { grid-area: news; } .w-info { grid-area: info; }
.play-forms { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s12); }
@media (max-width: 520px) { .play-forms { grid-template-columns: 1fr; gap: var(--s16); } }
.csat-card { border-color: var(--gold-text); }
.csat { display: flex; gap: var(--s8); }
.csat button { flex: 1; height: 52px; border-radius: var(--r-ctrl); border: 1px solid var(--bronze-line); background: transparent; font-size: 16px; font-weight: 600; cursor: pointer; }
.csat button.sel { background: rgba(242, 169, 59, .2); border-color: var(--gold-text); }

/* профиль: ник → 12 → сетка цифр (строки 16, колонки 12; число → 4 → подпись) → 16 → напарник */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s16) var(--s12); }
.stats-grid b { display: block; font: 600 22px/28px Inter, sans-serif; color: var(--gold-pale); }
.stats-grid span { display: block; margin-top: var(--s4); font-size: 13px; line-height: 16px; color: var(--text-2); }
.warn { display: flex; gap: var(--s12); align-items: flex-start; padding: var(--s12) var(--s16); border-radius: var(--r-ctrl); background: var(--gold-bg); }
.warn .ico { color: var(--gold-text); font: 400 18px/22px var(--display); }

/* друзья: строки 52 через разделитель */
.search-row { display: flex; gap: var(--s8); }
.search-row input { flex: 1; min-width: 0; }
.search-row .btn { width: auto; }
.friend { display: flex; align-items: center; gap: var(--s12); min-height: 52px; }
.friend + .friend { border-top: 1px solid var(--border); }
.friend .t { flex: 1; min-width: 0; }
.friend .t > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend .t > .caption { margin-top: var(--s4); }
.friend .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); flex: none; }
.friend .dot.on { background: var(--success); }

/* новости: запись (поле 12 сверху и снизу) — дата → 4 → заголовок → 4 → текст */
.news-item { padding: var(--s12) 0; }
.news-item + .news-item { border-top: 1px solid var(--border); }
.news-item .meta { display: flex; gap: var(--s8); align-items: center; }
.news-item .body { margin-top: var(--s4); color: var(--text-2); }

/* информация */
.online { display: flex; align-items: baseline; gap: var(--s8); }
.stat { font: 400 40px/44px var(--display); color: var(--gold-pale); }
.rules { padding-left: 18px; display: flex; flex-direction: column; gap: var(--s8); color: var(--text-2); font-size: 14px; line-height: 20px; }
.rules li::marker { color: var(--gold-text); }

/* ================= Лобби ================= */
/* карточки команд: поле 16 (24) меньше зазора 24 (32) */
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s24); }
@media (min-width: 768px) { .teams { gap: var(--s32); } }
.card.fire .over { color: var(--fire); } .card.ice .over { color: var(--ice-text); }
.team ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--s4); min-height: 92px; }
.team li { display: flex; justify-content: space-between; align-items: center; gap: var(--s8); height: 44px; padding: 0 var(--s12); background: var(--surface); border-radius: 12px; }
.team li .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team li.bots { background: transparent; color: var(--text-2); font-size: 13px; height: 28px; }
.team li.off { opacity: .5; }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s12); }

/* ================= Итоги ================= */
.pairs { display: flex; flex-direction: column; gap: var(--s8); }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) 120px 40px; align-items: center; gap: var(--s12); }
.pair .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pair .track { height: 8px; border-radius: 4px; background: var(--surface-raised); overflow: hidden; }
.pair .bar { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #C9711F, #FFD978); }
.pair .v { text-align: right; color: var(--text-2); font-size: 13px; }
.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--bronze-line); border-radius: var(--r-card); padding: var(--s8) var(--s16); }
table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 16px; }
th { color: var(--text-2); font-weight: 600; }
th, td { padding: var(--s12) var(--s8); text-align: right; white-space: nowrap; }
tr + tr td { border-top: 1px solid var(--border); }
th:first-child, td:first-child { text-align: left; padding-left: 0; }
td .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: var(--s8); }
tr.me td { color: var(--text); font-weight: 600; }
.gold { color: var(--gold-text); }

/* ================= Бой: поле на весь экран, HUD у краёв (отступ от края 12) ================= */
#scr-game { overflow: hidden; background: var(--bg); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#cv, #ov { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#ov { pointer-events: none; }
body.orbiting #cv { cursor: grabbing; }
.hud { background: var(--hud); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid var(--bronze-line); }
kbd { font: 600 11px/16px Inter, system-ui, sans-serif; color: var(--text); background: var(--surface-raised); border: 1px solid var(--border); border-radius: 6px; padding: 0 var(--s4); }

/* верх: пилюли (зазор 8) → 8 → роль */
#hud-top { position: absolute; top: var(--s12); left: 50%; transform: translateX(-50%); display: flex; gap: var(--s8); pointer-events: none; }
.hpill { height: 36px; padding: 0 var(--s12); border-radius: 18px; display: inline-flex; align-items: center; gap: var(--s8); font: 400 16px/18px var(--display); letter-spacing: .04em; white-space: nowrap; }
.hpill .secondary { font: 500 13px/16px Inter, sans-serif; letter-spacing: 0; }
.score .a { color: var(--fire); } .score .b { color: var(--ice-text); }
.timer { min-width: 44px; color: var(--gold-pale); }
#h-role { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); pointer-events: none; text-align: center; white-space: nowrap; text-shadow: 0 1px 4px #000; }
#h-role .side { font-weight: 600; }

/* выход — левый верхний угол */
.tl { position: absolute; top: var(--s12); left: var(--s12); display: flex; gap: var(--s8); align-items: flex-start; }
.exit { position: relative; height: 36px; padding: 0 var(--s12); border-radius: 18px; display: inline-flex; align-items: center; gap: var(--s8);
  font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.exit:hover { border-color: var(--gold-text); }

/* лента убийств — правый верхний угол, записи через 4 */
#feed { position: absolute; top: var(--s12); right: var(--s12); display: flex; flex-direction: column; gap: var(--s4); align-items: flex-end; pointer-events: none; }
#feed div { height: 28px; padding: 0 var(--s12); border-radius: 14px; display: flex; align-items: center; gap: var(--s8); font-size: 13px; font-weight: 500; animation: fade 6s forwards; }
#feed .x { color: var(--text-2); }
@keyframes fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

.banner { position: absolute; top: 24%; left: 50%; transform: translateX(-50%); text-align: center; pointer-events: none; padding: 0 var(--s16); width: 100%; max-width: 720px; }
.banner .display { font-size: 40px; line-height: 44px; text-shadow: 0 2px 24px rgba(0, 0, 0, .9), 0 0 28px rgba(242, 169, 59, .35); }
.banner .body { color: var(--text-2); text-shadow: 0 1px 8px #000; }

/* Панель игрока — одна строка 36, ширина ПОСТОЯННАЯ: каждая ячейка фиксированной ширины,
   цифры моноширинные, бонус урона занимает своё место всегда. Новые состояния панель не двигают:
   «подойди ближе» — отдельной строкой над панелью. Поле 12, между ячейками 12, число → 4 → подпись. */
#hud-me { position: absolute; left: 50%; bottom: var(--s12); transform: translateX(-50%); height: 36px; padding: 0 var(--s12); border-radius: 18px;
  display: flex; align-items: center; gap: var(--s12); white-space: nowrap; pointer-events: none; font-size: 13px; line-height: 16px; font-variant-numeric: tabular-nums; }
.slot { display: inline-flex; align-items: baseline; gap: var(--s4); flex: none; overflow: hidden; }
.slot b { font-weight: 600; text-align: right; display: inline-block; }
.slot > span { color: var(--text-2); font-size: 12px; }
.s-mode { width: 76px; font: 400 15px/18px var(--display); letter-spacing: .04em; color: var(--gold-pale); }
.s-hp { width: 132px; align-items: center; gap: var(--s8); }
.hp { display: block; width: 96px; height: 6px; border-radius: 3px; background: var(--surface-raised); overflow: hidden; }
#h-hp { display: block; height: 100%; width: 100%; background: var(--success); border-radius: 3px; transition: width .15s; }
#h-hpt { width: 28px; }
.s-atk { width: 112px; } .s-atk b { width: 44px; }
#h-bonus { width: 32px; font-style: normal; font-weight: 600; color: var(--buff); }
.s-heal { width: 104px; } .s-heal b { width: 44px; color: var(--heal); }
.s-pen { width: 72px; } .s-pen b { width: 36px; }
.hudwarn { position: absolute; left: 50%; bottom: 56px; transform: translateX(-50%); font-size: 13px; line-height: 16px; font-weight: 600; color: var(--error); text-shadow: 0 1px 4px #000; pointer-events: none; }

/* подсказка управления — левый нижний угол, строки через 4 */
.hint { position: absolute; left: var(--s12); bottom: var(--s12); list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--s4);
  color: var(--text-2); font-size: 12px; line-height: 16px; pointer-events: none; text-shadow: 0 1px 4px #000; opacity: .85; }
.hint li { display: flex; align-items: center; gap: var(--s4); white-space: nowrap; }

/* миникарта — правый нижний угол, повёрнута как камера */
#minimap { position: absolute; right: var(--s12); bottom: var(--s12); width: 127px; height: 200px; border-radius: var(--r-ctrl); }
#dead { position: absolute; top: 58%; left: 50%; transform: translateX(-50%); padding: var(--s12) var(--s24); border-radius: var(--r-ctrl); pointer-events: none; text-align: center; }

/* подтверждение выхода: карточка 360, поле 24, заголовок → 8 → текст → 24 → кнопки (12) */
.modal { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: var(--s16); background: rgba(17, 12, 9, .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal-card { width: 100%; max-width: 360px; padding: var(--s24); background: var(--surface); }

.toast { position: fixed; bottom: var(--s24); left: 50%; transform: translateX(-50%); background: var(--surface-raised); border: 1px solid var(--bronze-line); padding: var(--s12) var(--s16); border-radius: var(--r-ctrl); z-index: 30; font-size: 14px; max-width: calc(100% - 32px); }
.invite { position: fixed; left: 50%; bottom: var(--s24); transform: translateX(-50%); z-index: 25; display: flex; align-items: center; gap: var(--s12);
  padding: var(--s12) var(--s16); border-radius: var(--r-ctrl); width: min(520px, calc(100% - 32px)); }
.invite .t { flex: 1; min-width: 0; } .invite .t > * { display: block; }

/* ---------- Тач ---------- */
#joy { position: absolute; left: var(--s24); bottom: 120px; width: 128px; height: 128px; border-radius: 50%; }
#joy-knob { position: absolute; left: 39px; top: 39px; width: 48px; height: 48px; border-radius: 50%; background: var(--surface-raised); border: 1px solid var(--border); }
.tbtn { position: absolute; right: var(--s16); height: 52px; min-width: 140px; border-radius: var(--r-ctrl); font-size: 16px; font-weight: 600; color: var(--text); padding: 0 var(--s16); }
#t-mode { bottom: 196px; } #t-ping { bottom: 132px; }
.tbtn.on { background: var(--btn-gold); color: var(--btn-gold-text); border: 0; }
body.touch .desk { display: none; }
body.touch #minimap { top: 96px; bottom: auto; width: 84px; height: 132px; }
body.touch #hud-me { gap: var(--s8); }
body.touch .slot > span:not(.hp) { display: none; } /* на телефоне подписи прячем — строка остаётся одной и не меняет ширину */
/* телефон: 60 + 84 + 64 + 40 + 36 + 4 × 8 + 24 = 340 — помещается в 375 с полями 12 */
body.touch .s-mode { width: 60px; font-size: 13px; } body.touch .s-hp { width: 84px; } body.touch .hp { width: 52px; }
body.touch .s-atk { width: 64px; } body.touch .s-atk b { width: 40px; } body.touch #h-bonus { width: 20px; font-size: 11px; }
body.touch .s-heal { width: 40px; } body.touch .s-heal b { width: 40px; } body.touch .s-pen { width: 36px; }

/* ---------- Узкие экраны ---------- */
@media (max-width: 640px) {
  .teams, .settings { grid-template-columns: 1fr; }
  #hud-top { top: var(--s8); gap: var(--s4); }
  .hpill { height: 32px; padding: 0 var(--s8); font-size: 14px; }
  #h-role { top: 48px; white-space: normal; width: calc(100% - 24px); }
  #feed { top: 240px; } /* ниже миникарты (96 + 132 + 12) */
  .tl { top: 96px; } /* под ролью, слева — не спорит с пилюлями */
  .logo { font-size: 34px; line-height: 40px; }
  .banner .display { font-size: 28px; line-height: 32px; }
  .pair { grid-template-columns: minmax(0, 1fr) 72px 36px; }
}
body.touch .exit kbd { display: none; } /* на телефоне клавиатуры нет */


/* ---------- Громкость музыки: значок → 8 → ползунок ---------- */
.vol { display: inline-flex; align-items: center; gap: var(--s8); cursor: pointer; }
.vol-ico { color: var(--gold-text); font-size: 16px; line-height: 16px; }
.vol-range { width: 96px; height: 20px; padding: 0; border: 0; background: transparent; -webkit-appearance: none; appearance: none; }
.vol-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--surface-raised); }
.vol-range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--surface-raised); }
.vol-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--gold-text); }
.vol-range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--gold-text); }
.corner { position: absolute; top: var(--s16); right: var(--s16); }
.music-pop { position: absolute; top: 44px; left: 0; padding: var(--s8) var(--s12); border-radius: var(--r-ctrl); }


/* ================= Главная в один экран (с 960 px) =================
   Колонка на всю высоту окна: шапка 40 → 24 → сетка 2 ряда по 1fr (зазор 24).
   Карточки не растягивают страницу — длинное содержимое (лобби, новости, правила) прокручивается внутри.
   Поле карточки 16 < зазора 24. */
@media (min-width: 960px) {
  #scr-hub { overflow: hidden; }
  .col.hub { height: 100vh; min-height: 0; padding: var(--s24) var(--s24); }
  .col.hub > header { flex: none; height: 40px; }
  .col.hub > .csat-card { margin-top: var(--s16); flex: none; }
  .col.hub > .hub-grid { margin-top: var(--s24); flex: 1; min-height: 0; gap: var(--s24); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
  .hub-grid > .card { padding: var(--s16); min-height: 0; display: flex; flex-direction: column; }
  .hub-grid .title { font-size: 20px; line-height: 24px; }
  .w-play .display { font-size: 32px; line-height: 36px; }
  .scroll-y { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
  .scroll-y::-webkit-scrollbar { width: 6px; } .scroll-y::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
  .stats-grid b { font-size: 18px; line-height: 22px; }
  .rules { font-size: 13px; line-height: 18px; }
}
/* формы «Создать» и «Найти» — поле и кнопка в одну строку */
.inline-form { display: flex; gap: var(--s8); }
.inline-form input { flex: 1; min-width: 0; }
.inline-form .btn { width: auto; flex: none; }
.warn.compact { padding: var(--s8) var(--s12); }
.warn.compact .body { font-size: 14px; line-height: 20px; }

/* вход: вторичные способы — текстовые кнопки в строку через точку-разделитель */
.auth-alt { display: flex; align-items: center; justify-content: center; gap: var(--s8); flex-wrap: wrap; }
.dot-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--text-2); }
.btn.text.yandex { gap: var(--s8); color: var(--text); }
