/* ═══════════════════════════════════════════════════════════════
   BR GEO — стили. Тёмная тема в духе GeoGuessr: глубокий фиолетовый
   фон, зелёные кнопки действия, жёлтые очки, жирные курсивные заголовки.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg-0: #0b0622;
  --bg-1: #140b33;
  --bg-2: #1d1147;
  --panel: rgba(30, 18, 74, 0.72);
  --panel-solid: #1c1145;
  --panel-2: rgba(49, 32, 112, 0.55);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.17);
  --text: #ffffff;
  --text-2: #cdc4f0;
  --text-3: #9a8dcc;
  --green: #6cc12a;
  --green-hi: #8ee043;
  --green-lo: #4d9416;
  --purple: #7b5cff;
  --purple-hi: #9a82ff;
  --purple-lo: #5536d8;
  --yellow: #ffd23f;
  --orange: #ff8a1f;
  --red: #ff4d61;
  --blue: #3fb4ff;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 14px 40px rgba(4, 0, 20, 0.45);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --nav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: #4a3a8c transparent;
  /* Без синей подсветки при нажатии на телефоне */
  -webkit-tap-highlight-color: transparent;
}

a,
button,
label,
input,
[role='button'] {
  -webkit-tap-highlight-color: transparent;
}

:focus:not(:focus-visible) {
  outline: none;
}

body {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.5 var(--font);
  color: var(--text);
  background: var(--bg-0);
  background-image:
    radial-gradient(1200px 700px at 12% -10%, rgba(123, 92, 255, 0.33), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(255, 138, 31, 0.12), transparent 60%),
    radial-gradient(1000px 800px at 50% 110%, rgba(63, 180, 255, 0.1), transparent 60%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
}

a {
  color: var(--purple-hi);
  text-decoration: none;
}

a:hover {
  color: #fff;
}

button {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0 0 12px;
  line-height: 1.15;
}

p {
  margin: 0 0 12px;
}

::selection {
  background: rgba(123, 92, 255, 0.55);
}

.ico {
  flex: 0 0 auto;
  vertical-align: middle;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--text-3);
}

.nowrap {
  white-space: nowrap;
}

.display {
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.yellow {
  color: var(--yellow);
}

.green {
  color: var(--green-hi);
}

.red {
  color: var(--red);
}

.boot {
  min-height: 60vh;
  display: grid;
  place-items: center;
}

.spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--yellow);
  animation: spin 0.8s linear infinite;
}

.spinner.sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

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

.noscript {
  padding: 40px;
  text-align: center;
}

/* ─── Навигация ─── */

#nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 8, 38, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 900;
  font-style: italic;
  font-size: 22px;
  letter-spacing: -0.02em;
  flex: 0 0 auto;
}

.brand b {
  color: var(--yellow);
  margin-left: 3px;
}

.brand:hover {
  color: #fff;
}

.brand:hover .logo-mark {
  transform: translateY(-2px) rotate(-6deg);
}

.logo-mark {
  transition: transform 0.25s;
  filter: drop-shadow(0 4px 10px rgba(255, 170, 40, 0.35));
}

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: 12px;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-2);
  font-weight: 700;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}

.nav-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-links a.active {
  color: #fff;
  background: rgba(123, 92, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(154, 130, 255, 0.35);
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.nav-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-burger {
  display: none;
}

.nav-user-wrap {
  position: relative;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  max-width: 230px;
}

.nav-user:hover {
  background: rgba(255, 255, 255, 0.09);
}

.nav-user-name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-chev {
  color: var(--text-3);
  transition: transform 0.2s;
}

.menu-open .nav-chev {
  transform: rotate(180deg);
}

.nav-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 250px;
  padding: 8px;
  border-radius: 16px;
  background: #1f1450;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.16s, transform 0.16s;
}

.menu-open .nav-menu {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.nav-menu-head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 8px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.nav-menu-head b {
  display: block;
}

.nav-menu-head span {
  font-size: 12px;
  color: var(--text-3);
}

.nav-menu a,
.nav-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.nav-menu a:hover,
.nav-menu button:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.nav-menu .nav-admin {
  color: var(--yellow);
}

.nav-drawer {
  display: none;
}

/* ─── Раскладка страниц ─── */

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  /* backwards, а не both: после появления у страницы не должно оставаться
     transform — иначе position: fixed внутри неё считается от страницы */
  animation: pageIn 0.35s ease backwards;
}

.page-narrow {
  max-width: 900px;
}

.page-xs {
  max-width: 520px;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-title {
  font-size: clamp(30px, 4.6vw, 46px);
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin: 0;
}

.page-sub {
  color: var(--text-2);
  margin: 6px 0 0;
  max-width: 620px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--yellow);
}

.section-title {
  font-size: 22px;
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
  margin: 40px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Колонки сеток могут сужаться: иначе одна длинная строка без пробелов
   (например, ссылка-приглашение) раздвигает страницу шире экрана телефона */
.grid-2 > *,
.grid-3 > *,
.home-grid > *,
.setup-grid > *,
.room-grid > *,
.stack > * {
  min-width: 0;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.spacer {
  flex: 1;
}

/* ─── Карточки ─── */

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(4, 0, 20, 0.25);
}

.card-title {
  font-size: 18px;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.card-title .ico {
  color: var(--yellow);
}

.card-sub {
  color: var(--text-2);
  font-size: 14px;
  margin: -8px 0 16px;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state h2 {
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
}

.empty-state p {
  color: var(--text-2);
}

.empty-state .ico-big {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  background: rgba(123, 92, 255, 0.2);
  color: var(--purple-hi);
}

/* ─── Кнопки ─── */

.btn {
  --b1: rgba(255, 255, 255, 0.1);
  --b2: rgba(255, 255, 255, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--b1), var(--b2));
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-style: italic;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -3px 0 rgba(0, 0, 0, 0.22);
  transition: transform 0.12s, filter 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.btn:hover {
  filter: brightness(1.12);
  color: #fff;
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn:focus-visible {
  outline: 3px solid rgba(255, 210, 63, 0.7);
  outline-offset: 2px;
}

.btn[disabled],
.btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.4);
  transform: none;
}

.btn-primary {
  --b1: var(--green-hi);
  --b2: var(--green-lo);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -3px 0 rgba(0, 0, 0, 0.22), 0 8px 22px rgba(108, 193, 42, 0.32);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.btn-secondary {
  --b1: var(--purple-hi);
  --b2: var(--purple-lo);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 -3px 0 rgba(0, 0, 0, 0.22), 0 8px 22px rgba(123, 92, 255, 0.3);
}

.btn-yellow {
  --b1: #ffe066;
  --b2: #f5a91b;
  color: #2a1a00;
  text-shadow: none;
}

.btn-yellow:hover {
  color: #2a1a00;
}

.btn-danger {
  --b1: #ff6b7d;
  --b2: #d92c43;
}

.btn-ghost {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line-2);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.07);
}

.btn-sm {
  min-height: 36px;
  padding: 7px 15px;
  font-size: 12.5px;
}

.btn-lg {
  min-height: 52px;
  padding: 13px 30px;
  font-size: 16px;
}

.btn-xl {
  min-height: 62px;
  padding: 16px 40px;
  font-size: 19px;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 44px;
  padding: 0;
}

.btn-icon.btn-sm {
  width: 36px;
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--purple-hi);
  cursor: pointer;
  font-weight: 700;
}

.link-btn:hover {
  color: #fff;
}

/* ─── Формы ─── */

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.field > span,
.label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.input,
select.input,
textarea.input {
  width: 100%;
  min-height: 46px;
  padding: 11px 15px;
  border-radius: 12px;
  border: 1.5px solid var(--line-2);
  background: rgba(8, 4, 26, 0.45);
  color: #fff;
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input::placeholder {
  color: #7a6fa8;
}

.input:focus {
  border-color: var(--purple-hi);
  box-shadow: 0 0 0 4px rgba(123, 92, 255, 0.22);
}

.input.big {
  min-height: 60px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.3em;
  text-align: center;
  text-transform: uppercase;
}

.form-error {
  color: #ffb3bd;
  background: rgba(255, 77, 97, 0.14);
  border: 1px solid rgba(255, 77, 97, 0.35);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 14px;
}

.form-ok {
  color: #c8f7a4;
  background: rgba(108, 193, 42, 0.14);
  border: 1px solid rgba(108, 193, 42, 0.35);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 14px;
}

.hint {
  font-size: 13px;
  color: var(--text-3);
}

/* Сегментированный выбор */
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(8, 4, 26, 0.45);
  border: 1px solid var(--line);
}

.seg button {
  flex: 1 1 auto;
  min-height: 40px;
  padding: 8px 10px;
  font-size: 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.seg button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.seg button.on {
  color: #fff;
  background: linear-gradient(180deg, var(--purple-hi), var(--purple-lo));
  box-shadow: 0 4px 14px rgba(123, 92, 255, 0.35);
}

.seg[aria-disabled='true'] {
  opacity: 0.6;
  pointer-events: none;
}

/* Переключатель */
.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  padding: 6px 0;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch .track {
  flex: 0 0 auto;
  width: 46px;
  height: 27px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  position: relative;
  transition: background 0.2s;
}

.switch .track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.switch input:checked + .track {
  background: var(--green);
}

.switch input:checked + .track::after {
  transform: translateX(19px);
}

.switch input:focus-visible + .track {
  outline: 3px solid rgba(255, 210, 63, 0.7);
  outline-offset: 2px;
}

.switch .sw-text b {
  display: block;
  font-weight: 700;
}

.switch .sw-text span {
  font-size: 13px;
  color: var(--text-3);
}

/* Вкладки */
.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 18px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs button,
.tabs a {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
}

.tabs button:hover,
.tabs a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.tabs .on {
  color: #1a0f3d;
  background: var(--yellow);
  border-color: var(--yellow);
}

/* ─── Мелкие элементы ─── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-2);
  white-space: nowrap;
}

.badge-yellow {
  background: rgba(255, 210, 63, 0.16);
  color: var(--yellow);
}

.badge-green {
  background: rgba(108, 193, 42, 0.18);
  color: var(--green-hi);
}

.badge-purple {
  background: rgba(123, 92, 255, 0.24);
  color: #cfc3ff;
}

.badge-red {
  background: rgba(255, 77, 97, 0.18);
  color: #ff9aa7;
}

.avatar {
  --av: 36px;
  --avc: var(--purple);
  width: var(--av);
  height: var(--av);
  flex: 0 0 var(--av);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  background: var(--avc);
  color: #fff;
  font-weight: 900;
  font-size: calc(var(--av) * 0.44);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar span {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.lvl-badge {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 22px;
  padding: 0 6px;
  border-radius: 7px;
  background: linear-gradient(180deg, #ffe066, #f5a91b);
  color: #2a1a00;
  font-weight: 900;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.progress {
  height: 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.progress > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--yellow));
  transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.progress.green > i {
  background: linear-gradient(90deg, var(--green-lo), var(--green-hi));
}

.progress.purple > i {
  background: linear-gradient(90deg, var(--purple-lo), var(--purple-hi));
}

.kbd {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}

/* ─── Таблицы лидеров ─── */

.lb {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lb-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid transparent;
  color: #fff;
  transition: background 0.15s;
}

a.lb-row:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.lb-row.me {
  background: rgba(123, 92, 255, 0.2);
  border-color: rgba(154, 130, 255, 0.45);
}

.lb-place {
  font-weight: 900;
  font-style: italic;
  font-size: 18px;
  color: var(--text-3);
  text-align: center;
}

.lb-row.p1 .lb-place {
  color: #ffd23f;
}

.lb-row.p2 .lb-place {
  color: #d9e2f2;
}

.lb-row.p3 .lb-place {
  color: #ff9f5a;
}

.lb-row.p1 {
  background: linear-gradient(90deg, rgba(255, 210, 63, 0.16), rgba(255, 255, 255, 0.03));
}

.lb-who {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.lb-name {
  min-width: 0;
}

.lb-name b {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-name span {
  font-size: 12.5px;
  color: var(--text-3);
}

.lb-val {
  font-weight: 900;
  font-style: italic;
  font-size: 18px;
  color: var(--yellow);
  text-align: right;
  white-space: nowrap;
}

.lb-val small {
  display: block;
  font-size: 11.5px;
  font-style: normal;
  font-weight: 600;
  color: var(--text-3);
}

.lb-empty {
  padding: 30px 10px;
  text-align: center;
  color: var(--text-3);
}

/* ─── Модальные окна и уведомления ─── */

.modal-back {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 2, 20, 0.66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.2s;
}

.modal-back.show {
  opacity: 1;
}

.modal {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px;
  border-radius: 22px;
  background: linear-gradient(180deg, #25185c, #1a1046);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  transform: translateY(10px) scale(0.97);
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.modal-wide {
  width: min(680px, 100%);
}

.modal-back.show .modal {
  transform: none;
}

.modal-title {
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 22px;
  padding-right: 30px;
}

.modal-body {
  color: var(--text-2);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.modal-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-2);
  cursor: pointer;
}

.modal-x:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

#toasts {
  position: fixed;
  left: 50%;
  bottom: calc(22px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(460px, calc(100vw - 32px));
}

.toast {
  padding: 12px 18px;
  border-radius: 14px;
  background: #2a1d66;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast-error {
  background: #5a1426;
  border-color: rgba(255, 77, 97, 0.5);
}

.toast-ok {
  background: #214d12;
  border-color: rgba(108, 193, 42, 0.5);
}

/* ═══════════════ Главная ═══════════════ */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  padding: clamp(28px, 5vw, 64px);
  min-height: 440px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 30px;
  align-items: center;
  background: linear-gradient(135deg, #2b1a73 0%, #1a0f48 55%, #120a33 100%);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.18;
  filter: blur(2px) saturate(120%);
  mask-image: radial-gradient(ellipse at 75% 50%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 75% 50%, #000 20%, transparent 75%);
}

.hero::after {
  content: '';
  position: absolute;
  width: 520px;
  height: 520px;
  right: -140px;
  top: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 210, 63, 0.22), transparent 65%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: clamp(38px, 6.4vw, 76px);
  line-height: 0.98;
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  margin: 14px 0 18px;
}

.hero-title span {
  /* Курсив «выносит» правый край последней буквы за рамку строки, а
     градиент красит только её — поэтому даём запас справа и снизу,
     иначе у «о» в «место» срезается хвостик */
  display: inline-block;
  padding: 0 0.16em 0.08em 0.02em;
  margin: 0 -0.16em -0.08em -0.02em;
  background: linear-gradient(90deg, var(--yellow), var(--orange), var(--yellow));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: titleShine 7s linear infinite;
}

@keyframes titleShine {
  to {
    background-position: -200% 0;
  }
}

.hero-sub {
  font-size: 17px;
  color: var(--text-2);
  max-width: 520px;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 28px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.hero-stats div b {
  display: block;
  font-size: 26px;
  font-weight: 900;
  font-style: italic;
}

.hero-stats div span {
  font-size: 12.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.hero-art {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: min(420px, 100%);
  aspect-ratio: 1;
  perspective: 900px;
}

.hero-map {
  position: absolute;
  inset: 6%;
  border-radius: 26px;
  overflow: hidden;
  background: #221655 center / cover no-repeat;
  border: 3px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 0 10px rgba(123, 92, 255, 0.12);
  transform: rotateX(18deg) rotateZ(-8deg);
  animation: floaty 6s ease-in-out infinite;
}

@keyframes floaty {
  50% {
    transform: rotateX(18deg) rotateZ(-8deg) translateY(-10px);
  }
}

.hero-map .hero-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-pin {
  position: absolute;
  width: 34px;
  height: 44px;
  transform: translate(-50%, -100%);
  animation: pinDrop 0.7s cubic-bezier(0.3, 1.6, 0.5, 1) both;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.5));
}

.hero-photo {
  position: absolute;
  width: 46%;
  aspect-ratio: 16 / 10;
  right: -4%;
  bottom: 2%;
  border-radius: 16px;
  border: 4px solid #fff;
  background: #333 center / cover;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  transform: rotate(6deg);
  animation: floaty2 7s ease-in-out infinite;
}

@keyframes floaty2 {
  50% {
    transform: rotate(4deg) translateY(-8px);
  }
}

@keyframes pinDrop {
  from {
    opacity: 0;
    transform: translate(-50%, -160%);
  }
}

.resume-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 18px;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(108, 193, 42, 0.22), rgba(108, 193, 42, 0.06));
  border: 1px solid rgba(142, 224, 67, 0.35);
}

.resume-bar b {
  display: block;
}

.resume-bar span {
  font-size: 13px;
  color: var(--text-2);
}

.me-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 16px 20px;
}

.me-strip .me-level {
  flex: 1 1 220px;
  min-width: 200px;
}

.me-strip .me-level .row-between {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
}

.me-strip .me-stats {
  display: flex;
  gap: 24px;
}

.me-strip .me-stats div b {
  display: block;
  font-size: 18px;
  font-weight: 900;
  font-style: italic;
}

.me-strip .me-stats div span {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  font-weight: 700;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.mode-card {
  --mc1: #5536d8;
  --mc2: #2b1a73;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  padding: 22px;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(160deg, var(--mc1), var(--mc2));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.mode-card:hover {
  color: #fff;
  transform: translateY(-5px);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.45);
}

.mode-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 12%, rgba(255, 255, 255, 0.22), transparent 45%);
  pointer-events: none;
}

.mode-card .mc-ico {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  margin-bottom: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.mode-card h3 {
  font-size: 22px;
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.mode-card p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  margin: 0;
}

.mode-card .mc-foot {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mode-card .mc-go {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.95);
  color: #1a0f3d;
  transition: transform 0.2s;
}

.mode-card:hover .mc-go {
  transform: translateX(4px);
}

.mode-classic {
  --mc1: #4a9a1a;
  --mc2: #1f4a0c;
}

.mode-daily {
  --mc1: #f5a91b;
  --mc2: #8a4b06;
}

.mode-friends {
  --mc1: #7b5cff;
  --mc2: #2f1b85;
}

.mode-duel {
  --mc1: #ff4d61;
  --mc2: #7a1024;
}

.home-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.how-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.how-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.how-step .n {
  flex: 0 0 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-style: italic;
  font-size: 18px;
  background: rgba(255, 210, 63, 0.16);
  color: var(--yellow);
}

.how-step b {
  display: block;
  margin-bottom: 2px;
}

.how-step span {
  color: var(--text-2);
  font-size: 14px;
}

.footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--text-3);
  font-size: 13px;
  border-top: 1px solid var(--line);
}

.footer a {
  color: var(--text-2);
}

/* ═══════════════ Настройки игры, задание дня, вызов ═══════════════ */

.setup-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  align-items: start;
}

.set-row {
  margin-bottom: 22px;
}

.set-row .label {
  display: block;
  margin-bottom: 9px;
}

.set-hint {
  display: block;
  margin-top: 8px;
  line-height: 1.45;
}

.set-group {
  margin: 4px 0 22px;
  padding: 16px 16px 14px;
  border-radius: 16px;
  background: rgba(255, 138, 31, 0.06);
  border: 1px solid rgba(255, 138, 31, 0.22);
}

.set-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--orange);
}

.set-group-head b {
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #fff;
}

.set-group .set-row {
  margin-bottom: 16px;
}

.set-note {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  margin: 0;
  line-height: 1.45;
}

.set-note .ico {
  margin-top: 2px;
  color: var(--green-hi);
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.info-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--text-2);
  font-size: 14px;
}

.info-list .ico {
  color: var(--yellow);
  margin-top: 1px;
}

.map-preview {
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #1a1045 center / cover no-repeat;
  border: 1px solid var(--line-2);
  margin-bottom: 18px;
}

.note-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 13.5px;
  margin-bottom: 18px;
}

.note-box .ico {
  color: var(--purple-hi);
  margin-top: 1px;
}

.note-box.warn .ico {
  color: var(--yellow);
}

.daily-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  background: linear-gradient(135deg, rgba(245, 169, 27, 0.28), rgba(49, 32, 112, 0.6));
  border-color: rgba(255, 210, 63, 0.3);
}

.daily-cal {
  width: 92px;
  border-radius: 18px;
  overflow: hidden;
  text-align: center;
  background: #fff;
  color: #1a0f3d;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.daily-cal .m {
  background: var(--red);
  color: #fff;
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
  padding: 5px 0;
  letter-spacing: 0.08em;
}

.daily-cal .d {
  font-size: 42px;
  font-weight: 900;
  line-height: 1.2;
  padding: 4px 0 8px;
}

.daily-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 10px;
  color: var(--text-2);
  font-size: 14px;
}

.daily-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.countdown {
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  font-style: italic;
  font-size: 22px;
  color: var(--yellow);
}

.result-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 22px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line-2);
}

.result-pill b {
  font-size: 28px;
  font-weight: 900;
  font-style: italic;
  color: var(--yellow);
  line-height: 1.1;
}

.result-pill span {
  font-size: 12px;
  color: var(--text-3);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* ═══════════════ Вход и регистрация ═══════════════ */

.auth-wrap {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  place-items: center;
  padding: 30px 16px 60px;
}

.auth-card {
  width: min(440px, 100%);
  padding: 32px;
}

.auth-card .brand {
  justify-content: center;
  margin-bottom: 14px;
  font-size: 26px;
}

.auth-card h1 {
  text-align: center;
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 26px;
  margin-bottom: 6px;
}

.auth-card .auth-sub {
  text-align: center;
  color: var(--text-2);
  margin-bottom: 22px;
  font-size: 14px;
}

.auth-switch {
  text-align: center;
  margin-top: 18px;
  color: var(--text-2);
  font-size: 14px;
}

.pw-wrap {
  position: relative;
}

.pw-wrap .input {
  padding-right: 48px;
}

.pw-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}

.pw-eye:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

/* ═══════════════ Профиль ═══════════════ */

.profile-head {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(123, 92, 255, 0.35), rgba(29, 17, 71, 0.8));
}

.profile-head .avatar {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2), 0 10px 30px rgba(0, 0, 0, 0.4);
}

.profile-name {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 900;
  font-style: italic;
  margin: 0;
  word-break: break-word;
}

.profile-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 14px;
}

.profile-level {
  flex: 1 1 280px;
  min-width: 240px;
}

.level-ring {
  position: relative;
  width: 108px;
  height: 108px;
  flex: 0 0 108px;
}

.level-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.level-ring .lv {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  line-height: 1;
}

.level-ring .lv b {
  display: block;
  font-size: 34px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.level-ring .lv span {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat-card {
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
}

.stat-card .ico {
  color: var(--yellow);
  margin-bottom: 8px;
}

.stat-card b {
  display: block;
  font-size: 24px;
  font-weight: 900;
  font-style: italic;
  line-height: 1.2;
}

.stat-card span {
  font-size: 12px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.ach {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.ach .ach-ico {
  flex: 0 0 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffe066, #f5a91b);
  color: #2a1a00;
  box-shadow: 0 6px 14px rgba(245, 169, 27, 0.3);
}

.ach.locked {
  opacity: 0.45;
}

.ach.locked .ach-ico {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-3);
  box-shadow: none;
}

.ach b {
  display: block;
  font-size: 14px;
}

.ach span {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.35;
  display: block;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recent-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: #fff;
}

a.recent-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.recent-item .ri-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(123, 92, 255, 0.22);
  color: var(--purple-hi);
}

.recent-item b {
  display: block;
  font-size: 14px;
}

.recent-item span {
  font-size: 12px;
  color: var(--text-3);
}

.recent-item .ri-score {
  font-weight: 900;
  font-style: italic;
  color: var(--yellow);
}

/* ═══════════════ Мультиплеер ═══════════════ */

.mode-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.mode-pick button {
  text-align: left;
  padding: 16px;
  border-radius: 16px;
  border: 2px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.mode-pick button:hover {
  background: rgba(255, 255, 255, 0.07);
}

.mode-pick button.on {
  border-color: var(--yellow);
  background: rgba(255, 210, 63, 0.1);
}

.mode-pick b {
  display: flex;
  align-items: center;
  gap: 8px;
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 16px;
  margin-bottom: 4px;
}

.mode-pick span {
  font-size: 13px;
  color: var(--text-2);
}

.join-code-row {
  display: flex;
  gap: 10px;
}

.join-code-row .input {
  flex: 1;
}

/* Комната: лобби */

.room-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 20px;
  align-items: start;
}

.invite-code {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.invite-code .code {
  font-size: 40px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.14em;
  color: var(--yellow);
  font-variant-numeric: tabular-nums;
  transition: filter 0.2s;
}

.stream-safe .code,
.stream-safe .invite-link {
  filter: blur(9px);
  user-select: none;
}

.invite-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 6px 6px 14px;
  border-radius: 14px;
  background: rgba(8, 4, 26, 0.45);
  border: 1px solid var(--line-2);
  margin-bottom: 14px;
}

.invite-link {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  color: var(--text-2);
  transition: filter 0.2s;
}

.invite-qr-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.qr-box {
  width: 116px;
  height: 116px;
  flex: 0 0 116px;
  padding: 6px;
  border-radius: 14px;
  background: #fff;
  cursor: zoom-in;
  transition: filter 0.2s;
}

.stream-safe .qr-box {
  filter: blur(6px);
}

.qr-full {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  background: rgba(6, 2, 20, 0.85);
  cursor: zoom-out;
  animation: fadeIn 0.2s;
}

.qr-full > div {
  width: min(80vmin, 520px);
  aspect-ratio: 1;
  padding: 18px;
  border-radius: 24px;
  background: #fff;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

.warn-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 210, 63, 0.1);
  border: 1px solid rgba(255, 210, 63, 0.35);
  font-size: 13.5px;
  color: #ffe7a1;
  margin-bottom: 14px;
}

.warn-banner .ico {
  color: var(--yellow);
  margin-top: 1px;
}

.warn-banner > div {
  min-width: 0;
}

.warn-banner .btn {
  max-width: 100%;
  white-space: normal;
  text-align: left;
}

.players {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.player.new {
  animation: pageIn 0.35s both;
}

.player-name a {
  color: #fff;
}

.player .avatar {
  box-shadow: 0 0 0 3px var(--pc, rgba(255, 255, 255, 0.2));
}

.player-name {
  flex: 1;
  min-width: 0;
}

.player-name b {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-name span {
  font-size: 12px;
  color: var(--text-3);
}

.player.offline {
  opacity: 0.5;
}

.player .kick {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}

.player .kick:hover {
  background: rgba(255, 77, 97, 0.2);
  color: #ff9aa7;
}

.dot-online {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green-hi);
  box-shadow: 0 0 0 3px rgba(142, 224, 67, 0.2);
  flex: 0 0 auto;
}

.player.offline .dot-online {
  background: #6b6190;
  box-shadow: none;
}

.settings-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.settings-view div {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.settings-view span {
  display: block;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  font-weight: 700;
}

.settings-view b {
  font-size: 16px;
}

.settings-view .wide {
  grid-column: 1 / -1;
}

/* Комната: проверка присутствия */

.ready-card {
  text-align: center;
  padding: 28px 24px 26px;
  animation: pageIn 0.35s both;
}

.ready-card .page-title {
  margin: 6px 0 20px;
}

.ready-ring {
  position: relative;
  width: 132px;
  height: 132px;
  margin: 0 auto 14px;
}

.ready-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ready-ring circle {
  fill: none;
  stroke-width: 8;
}

.ready-ring .bg {
  stroke: rgba(255, 255, 255, 0.1);
}

.ready-ring .fg {
  stroke: var(--yellow);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.2s linear, stroke 0.3s;
}

.ready-ring.urgent .fg {
  stroke: var(--red);
}

.ready-ring b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 46px;
  font-weight: 900;
  font-style: italic;
  font-variant-numeric: tabular-nums;
}

.ready-ring.urgent b {
  color: #ff9aa7;
}

.ready-count {
  color: var(--text-2);
  margin-bottom: 18px;
}

.ready-count b {
  color: #fff;
}

.ready-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.rslot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 0 116px;
  min-width: 0;
  padding: 14px 8px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  opacity: 0.62;
  transition: opacity 0.25s, background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.rslot b {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.rslot > span {
  font-size: 12px;
  color: var(--text-3);
}

.rslot-av {
  position: relative;
}

.rslot-av .avatar {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14);
  transition: box-shadow 0.25s;
}

.rslot-check {
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  transform: scale(0);
  transition: transform 0.28s cubic-bezier(0.2, 1.6, 0.4, 1);
}

.rslot-crown {
  position: absolute;
  left: 50%;
  top: -13px;
  display: flex;
  line-height: 0;
  transform: translateX(-50%);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
}

.rslot-crown .ico {
  fill: var(--yellow);
}

.rslot.ok {
  opacity: 1;
  background: rgba(108, 193, 42, 0.12);
  border-color: rgba(142, 224, 67, 0.55);
  box-shadow: 0 0 22px rgba(108, 193, 42, 0.22);
}

.rslot.ok .avatar {
  box-shadow: 0 0 0 3px var(--green-hi), 0 0 18px rgba(142, 224, 67, 0.5);
}

.rslot.ok .rslot-check {
  transform: scale(1);
}

.rslot.ok > span {
  color: var(--green-hi);
  font-weight: 800;
}

.rslot:not(.ok):not(.host-only) .avatar {
  animation: readyPulse 1.4s ease-in-out infinite;
}

.rslot.host-only {
  opacity: 1;
}

.rslot.off {
  opacity: 0.35;
}

@keyframes readyPulse {
  50% {
    box-shadow: 0 0 0 3px rgba(255, 210, 63, 0.7), 0 0 14px rgba(255, 210, 63, 0.35);
  }
}

.ready-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ready-btn {
  min-width: min(320px, 100%);
}

.ready-done {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green-hi);
  font-weight: 800;
  font-size: 18px;
}

.you-tag {
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 210, 63, 0.18);
  color: var(--yellow);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.alt-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.alt-links > span {
  margin-right: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* Комната: финал */

.podium {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  align-items: end;
  gap: 14px;
  max-width: 640px;
  margin: 10px auto 26px;
}

.podium-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: podiumUp 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.podium-col:nth-child(1) {
  animation-delay: 0.35s;
}

.podium-col:nth-child(2) {
  animation-delay: 0.7s;
}

.podium-col:nth-child(3) {
  animation-delay: 0.1s;
}

@keyframes podiumUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
}

.podium-name {
  font-weight: 900;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-score {
  font-weight: 900;
  font-style: italic;
  color: var(--yellow);
}

.podium-block {
  width: 100%;
  border-radius: 16px 16px 6px 6px;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 900;
  font-style: italic;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.podium-col.p1 .podium-block {
  height: 150px;
  background: linear-gradient(180deg, #ffe066, #d98f0b);
  color: #3a2400;
}

.podium-col.p2 .podium-block {
  height: 110px;
  background: linear-gradient(180deg, #eef3fb, #9aa7bd);
  color: #262f3f;
}

.podium-col.p3 .podium-block {
  height: 84px;
  background: linear-gradient(180deg, #ffb27a, #b8601e);
  color: #3a1800;
}

.podium-col .crown {
  color: var(--yellow);
  filter: drop-shadow(0 4px 10px rgba(255, 210, 63, 0.6));
}

/* ═══════════════ Карта (MapView) ═══════════════ */

.mv {
  position: relative;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background: #1d1a33;
  cursor: crosshair;
}

.mv.pz-drag {
  cursor: grabbing;
}

.mv-inner {
  will-change: transform;
}

.mv-img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-user-drag: none;
}

.mv-lines {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  overflow: visible;
}

.mv-lines .ln-shadow {
  stroke: rgba(0, 0, 0, 0.55);
  stroke-width: 6;
  stroke-linecap: round;
}

.mv-lines .ln-main {
  stroke: var(--lc, #fff);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 9 7;
  animation: ants 0.9s linear infinite;
}

.mv-lines .thin .ln-shadow {
  stroke-width: 4.5;
}

.mv-lines .thin .ln-main {
  stroke-width: 2;
  stroke-dasharray: 6 5;
}

@keyframes ants {
  to {
    stroke-dashoffset: -16;
  }
}

.mv-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pin-wrap {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
}

.pin-wrap.dim {
  opacity: 0.35;
}

.pin {
  position: absolute;
  left: 0;
  top: 0;
}

.pin-place {
  width: 30px;
  height: 40px;
  transform: translate(-50%, -100%);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45));
}

.pin-place svg {
  display: block;
}

.pin-player {
  width: 38px;
  height: 38px;
  transform: translate(-50%, -50%);
}

.pin-player.big {
  width: 46px;
  height: 46px;
}

.pin-face {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--c);
  background: var(--c);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(0, 0, 0, 0.35);
}

.pin-face img,
.pin-face b {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  object-fit: cover;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.pin-actual {
  width: 42px;
  height: 42px;
  transform: translate(-50%, -50%);
}

.pin-actual span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
  color: #d61f3a;
  border: 3px solid #1a0f3d;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.55);
}

.pin-actual::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.8);
  animation: ring 1.6s ease-out infinite;
}

@keyframes ring {
  from {
    transform: scale(0.6);
    opacity: 1;
  }
  to {
    transform: scale(1.7);
    opacity: 0;
  }
}

.pin-dot {
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--c);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.pin-label {
  position: absolute;
  left: 0;
  top: 22px;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 7px;
  background: rgba(10, 5, 30, 0.85);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.pin-wrap.pop .pin {
  animation: pinPop 0.45s cubic-bezier(0.3, 1.8, 0.5, 1);
}

.pin-wrap.pop .pin-place {
  animation: pinPopTear 0.45s cubic-bezier(0.3, 1.8, 0.5, 1);
}

@keyframes pinPop {
  from {
    transform: translate(-50%, -50%) scale(0.2);
  }
}

@keyframes pinPopTear {
  from {
    transform: translate(-50%, -140%) scale(0.5);
  }
}

.mv-zoom {
  position: absolute;
  right: 10px;
  top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}

.mv-zoom button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(14, 8, 38, 0.82);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.mv-zoom button:hover {
  background: #2d1f6e;
}

/* ═══════════════ Экран игры ═══════════════ */

body.in-game {
  overflow: hidden;
  overscroll-behavior: none;
}

body.in-game #nav,
body.in-game .footer {
  display: none;
}

.gs {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #05030d;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.gs-photo-bg {
  position: absolute;
  inset: -40px;
  background: center / cover no-repeat;
  filter: blur(34px) brightness(0.55) saturate(1.2);
}

.gs-photo {
  position: absolute;
  inset: 0;
  touch-action: none;
  cursor: grab;
}

.gs-photo.nozoom {
  cursor: default;
}

.gs-photo.pz-drag {
  cursor: grabbing;
}

.gs-photo-inner img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-user-drag: none;
  transition: filter 0.9s ease, opacity 0.3s;
}

.gs-photo-inner img.blur {
  filter: blur(26px) brightness(0.7);
}

.gs-photo-inner img.loading {
  opacity: 0;
}

.gs-photo[class*='soft-'] .gs-photo-inner {
  container-type: size;
}

.gs-photo.soft-1 .gs-photo-inner img:not(.blur),
.gs-photo.soft-1 .gs-peek-canvas {
  filter: blur(0.14cqw);
}

.gs-photo.soft-2 .gs-photo-inner img:not(.blur),
.gs-photo.soft-2 .gs-peek-canvas {
  filter: blur(0.28cqw);
}

.gs-photo.soft-3 .gs-photo-inner img:not(.blur),
.gs-photo.soft-3 .gs-peek-canvas {
  filter: blur(0.55cqw);
}

/* Фото «на N секунд» рисуется в холст поверх пустого <img> */
.gs-peek-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  animation: fadeIn 0.2s;
}

.gs-peek {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 90px 20px 110px;
  pointer-events: none;
}

.gs-peek-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 360px;
  padding: 24px 26px;
  border-radius: 20px;
  background: rgba(14, 8, 38, 0.86);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  text-align: center;
  pointer-events: auto;
  animation: fadeIn 0.25s;
}

.gs-peek-card b {
  font-size: 18px;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  line-height: 1.2;
}

.gs-peek-card span {
  color: var(--text-2);
  font-size: 14px;
}

.gs-peek-card .ico {
  color: var(--text-3);
}

.gs-peek-card .btn {
  margin-top: 6px;
}

.gs-peek [data-peek-map] {
  display: none;
}

.gs-peek-chip {
  position: absolute;
  left: 50%;
  bottom: calc(22px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
  padding: 10px 16px 14px;
  border-radius: 14px;
  background: rgba(14, 8, 38, 0.88);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  font-weight: 900;
  font-style: italic;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  pointer-events: none;
}

.gs-peek-chip .ico {
  color: var(--yellow);
}

.gs-peek-chip .progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  border-radius: 0;
}

.gs-peek-chip .progress > i {
  width: 100%;
  transition: none;
  background: linear-gradient(90deg, var(--orange), var(--yellow));
}

.gs-shade-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 130px;
  background: linear-gradient(180deg, rgba(5, 3, 13, 0.7), transparent);
  pointer-events: none;
}

.gs-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  z-index: 5;
  pointer-events: none;
}

.gs-top > *,
.gs-bar > * {
  pointer-events: auto;
}

.gs-bar {
  display: contents;
}

.gs-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.gs-exit {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px 0 10px;
  border: 0;
  border-radius: 12px;
  background: rgba(14, 8, 38, 0.78);
  backdrop-filter: blur(8px);
  color: #fff;
  font-weight: 900;
  font-style: italic;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.gs-exit:hover {
  background: rgba(45, 31, 110, 0.9);
}

.gs-exit .brand-mini b {
  color: var(--yellow);
}

.gs-center {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.gs-timer {
  min-width: 128px;
  padding: 8px 16px 10px;
  border-radius: 14px;
  background: rgba(14, 8, 38, 0.82);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.gs-timer b {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 24px;
  font-weight: 900;
  font-style: italic;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.gs-timer .progress {
  height: 5px;
  margin-top: 6px;
}

.gs-timer .progress > i {
  transition: width 0.25s linear;
  background: linear-gradient(90deg, var(--green-lo), var(--green-hi));
}

.gs-timer.low b {
  color: #ff6b7d;
  animation: pulse 0.5s ease-in-out infinite alternate;
}

.gs-timer.low .progress > i {
  background: var(--red);
}

@keyframes pulse {
  to {
    transform: scale(1.08);
  }
}

.gs-hud {
  margin-left: auto;
  display: flex;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(14, 8, 38, 0.82);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.hud-cell {
  padding: 8px 18px 9px;
  text-align: center;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.hud-cell:first-child {
  border-left: 0;
}

.hud-cell span {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.hud-cell b {
  display: block;
  font-size: 19px;
  font-weight: 900;
  font-style: italic;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hud-cell.accent b {
  color: var(--yellow);
}

.gs-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 250px;
}

.gs-pl {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
  background: rgba(14, 8, 38, 0.75);
  backdrop-filter: blur(6px);
  font-size: 13px;
  font-weight: 700;
  transition: background 0.3s;
}

.gs-pl .avatar {
  box-shadow: 0 0 0 2px var(--pc);
}

.gs-pl .nm {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gs-pl .st {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-3);
}

.gs-pl.done .st {
  background: var(--green);
  color: #fff;
}

.gs-pl.done {
  background: rgba(40, 80, 20, 0.8);
}

.gs-pl.out {
  opacity: 0.45;
}

.gs-pl .hp {
  flex: 0 0 64px;
}

.hpbar {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.hpbar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff4d61, #ff8a1f 40%, #8ee043);
  background-size: 200% 100%;
  transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hp-num {
  font-size: 11px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.gs-photo-tools {
  position: absolute;
  left: 16px;
  bottom: calc(18px + var(--safe-b));
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gs-tool {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(14, 8, 38, 0.8);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.gs-tool:hover {
  background: rgba(45, 31, 110, 0.95);
}

.gs-tool.on {
  background: var(--purple);
}

/* Мини-карта: в углу, раскрывается при наведении */
.gs-guess {
  --gw: 300px;
  --gh: 300px;
  --gw-big: 560px;
  --gh-big: 560px;
  position: absolute;
  right: 16px;
  bottom: calc(16px + var(--safe-b));
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: var(--gw);
  opacity: 0.72;
  transition: width 0.22s ease, opacity 0.2s;
}

.gs-guess.size-2 {
  --gw: 360px;
  --gh: 300px;
  --gw-big: 720px;
  --gh-big: 620px;
}

.gs-guess.size-3 {
  --gw: 440px;
  --gh: 360px;
  --gw-big: 900px;
  --gh-big: 720px;
}

.gs-guess:hover,
.gs-guess.active,
.gs-guess.pinned {
  width: min(var(--gw-big), calc(100vw - 32px));
  opacity: 1;
}

.gs-map {
  height: var(--gh);
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  transition: height 0.22s ease;
}

.gs-guess:hover .gs-map,
.gs-guess.active .gs-map,
.gs-guess.pinned .gs-map {
  height: min(var(--gh-big), calc(100vh - 170px));
}

.gs-map-tools {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s;
}

.gs-guess:hover .gs-map-tools,
.gs-guess.pinned .gs-map-tools,
.gs-guess.active .gs-map-tools {
  opacity: 1;
}

.gs-map-tools button {
  width: 34px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: rgba(14, 8, 38, 0.85);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.gs-map-tools button:hover {
  background: #2d1f6e;
}

.gs-map-tools button.on {
  background: var(--purple);
}

.gs-map-head {
  display: none;
}

.gs-guess-btn {
  width: 100%;
  min-height: 52px;
  font-size: 17px;
}

.gs-guess-btn[disabled] {
  opacity: 0.85;
  filter: none;
  --b1: #3b3166;
  --b2: #2a2250;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: var(--text-2);
  font-size: 13px;
}

.gs-map-fab {
  display: none;
}

.gs-wait {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(14, 8, 38, 0.88);
  text-align: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--text-2);
}

.gs-wait b {
  color: var(--green-hi);
}

.gs-actions {
  position: absolute;
  right: 16px;
  bottom: calc(16px + var(--safe-b));
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.gs.spectator .gs-guess,
.gs.spectator .gs-map-fab {
  display: none !important;
}

/* Заставка раунда */
.gs-splash {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.gs-splash .inner {
  text-align: center;
  animation: splash 1.5s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.gs-splash .r {
  font-size: clamp(48px, 10vw, 110px);
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  line-height: 1;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.gs-splash .r span {
  color: var(--yellow);
}

.gs-splash .of {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-2);
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

.gs-splash .mult {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 14px;
  border-radius: 99px;
  background: var(--red);
  font-weight: 900;
  font-style: italic;
}

@keyframes splash {
  0% {
    opacity: 0;
    transform: scale(1.5);
  }
  18% {
    opacity: 1;
    transform: scale(1);
  }
  75% {
    opacity: 1;
    transform: scale(0.98);
  }
  100% {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* Результат раунда */
.gs-result {
  position: absolute;
  inset: 0;
  z-index: 15;
  background: #0b0622;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}

.gs-result.show {
  opacity: 1;
  pointer-events: auto;
}

.gs-result-map {
  position: absolute;
  inset: 0;
}

.gs-result-panel {
  position: absolute;
  left: 50%;
  bottom: calc(18px + var(--safe-b));
  transform: translate(-50%, 30px);
  width: min(720px, calc(100vw - 24px));
  max-height: 58vh;
  overflow: auto;
  padding: 22px 24px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(37, 24, 92, 0.96), rgba(22, 13, 60, 0.97));
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.1), opacity 0.35s;
}

.gs-result.show .gs-result-panel.in {
  transform: translate(-50%, 0);
  opacity: 1;
}

.rp-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.rp-score {
  font-size: 44px;
  line-height: 1;
  font-weight: 900;
  font-style: italic;
  color: var(--yellow);
  font-variant-numeric: tabular-nums;
}

.rp-score small {
  font-size: 18px;
  color: var(--text-2);
  margin-left: 6px;
}

.rp-text {
  color: var(--text-2);
  font-size: 15px;
  text-align: right;
}

.rp-text b {
  color: #fff;
}

.rp-bar {
  margin: 14px 0 16px;
  height: 12px;
}

.rp-perfect {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 12px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--yellow), var(--orange));
  color: #2a1a00;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  font-size: 13px;
  animation: perfectIn 0.6s cubic-bezier(0.3, 1.8, 0.5, 1);
}

@keyframes perfectIn {
  from {
    transform: scale(0.3) rotate(-8deg);
    opacity: 0;
  }
}

.rp-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  align-items: center;
}

.rp-actions .hint {
  margin-right: auto;
}

.rp-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}

.rp-row {
  display: grid;
  grid-template-columns: 28px 30px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 14px;
  animation: pageIn 0.35s both;
}

.rp-row.me {
  background: rgba(123, 92, 255, 0.25);
}

.rp-row .pl {
  font-weight: 900;
  font-style: italic;
  color: var(--text-3);
  text-align: center;
}

.rp-row .nm {
  font-weight: 700;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-row .ds {
  color: var(--text-3);
  font-size: 13px;
  white-space: nowrap;
}

.rp-row .sc {
  font-weight: 900;
  font-style: italic;
  color: var(--yellow);
  min-width: 64px;
  text-align: right;
  white-space: nowrap;
}

.rp-row .dmg {
  color: #ff8a98;
  font-size: 12px;
  font-weight: 800;
}

.gs-net {
  position: absolute;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 99px;
  background: rgba(90, 20, 38, 0.92);
  font-weight: 700;
  font-size: 13px;
}

/* ═══════════════ Итоги игры ═══════════════ */

.sum {
  min-height: 100vh;
}

.sum-map {
  position: relative;
  height: min(58vh, 620px);
  border-bottom: 1px solid var(--line-2);
}

.sum-map .mv {
  position: absolute;
  inset: 0;
}

.sum-map-top {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 3;
}

.sum-body {
  max-width: 1000px;
  margin: -70px auto 0;
  position: relative;
  z-index: 5;
  padding: 0 16px 60px;
}

.sum-card {
  padding: 28px;
}

.sum-total {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.sum-total .big {
  font-size: clamp(44px, 8vw, 72px);
  font-weight: 900;
  font-style: italic;
  color: var(--yellow);
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.sum-total .big small {
  font-size: 0.35em;
  color: var(--text-2);
  margin-left: 8px;
}

.sum-total .verdict {
  font-size: 20px;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
}

.sum-bar {
  height: 14px;
  margin: 18px 0 22px;
}

.sum-rounds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.sum-round {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.sum-round:hover,
.sum-round.on {
  background: rgba(123, 92, 255, 0.2);
  border-color: rgba(154, 130, 255, 0.5);
}

.sum-round .n {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.sum-round .s {
  display: block;
  font-size: 22px;
  font-weight: 900;
  font-style: italic;
  color: var(--yellow);
  line-height: 1.25;
}

.sum-round .d {
  font-size: 12.5px;
  color: var(--text-2);
}

.sum-round .mini {
  height: 4px;
  margin-top: 8px;
}

.xp-box {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 210, 63, 0.08);
  border: 1px solid rgba(255, 210, 63, 0.25);
  margin-bottom: 20px;
}

.xp-box .xp-gain {
  font-size: 26px;
  font-weight: 900;
  font-style: italic;
  color: var(--yellow);
}

.xp-box .xp-level {
  flex: 1 1 240px;
}

.xp-box .xp-level .row-between {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
}

.new-ach {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.new-ach .ach {
  animation: perfectIn 0.6s cubic-bezier(0.3, 1.8, 0.5, 1) both;
  border-color: rgba(255, 210, 63, 0.4);
  background: rgba(255, 210, 63, 0.08);
}

.sum-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ═══════════════ Конфетти ═══════════════ */

.confetti {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  overflow: hidden;
}

.confetti i {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  animation: fall linear forwards;
}

@keyframes fall {
  to {
    transform: translate(var(--lx), 110vh) rotate(var(--rx));
  }
}

/* ═══════════════ Адаптив ═══════════════ */

@media (max-width: 1100px) {
  .mode-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .nav-links,
  .nav-login,
  .nav-user-name,
  .nav-chev {
    display: none;
  }
  .nav-burger {
    display: grid;
  }
  .nav-user {
    padding: 3px;
  }
  .nav-drawer {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 0;
    overflow: hidden;
    padding: 0 12px;
    transition: max-height 0.3s ease, padding 0.3s;
  }
  .drawer-open .nav-drawer {
    max-height: 520px;
    padding: 8px 12px 14px;
  }
  .nav-drawer a,
  .nav-drawer button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-2);
    font-weight: 800;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
  }
  .nav-drawer a.active {
    background: rgba(123, 92, 255, 0.25);
    color: #fff;
  }
  .nav-drawer-sep {
    height: 1px;
    background: var(--line);
    margin: 6px 0;
  }
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .hero-art {
    display: none;
  }
  .grid-2,
  .grid-3,
  .home-grid,
  .setup-grid,
  .room-grid {
    grid-template-columns: 1fr;
  }
  .daily-hero {
    grid-template-columns: auto 1fr;
  }
  .daily-hero .daily-action {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  :root {
    --nav-h: 58px;
  }
  .nav-inner {
    padding: 0 12px;
    gap: 10px;
  }
  .nav-right {
    gap: 6px;
  }
  .nav-reg {
    padding: 7px 13px;
  }
  body {
    font-size: 14.5px;
  }
  .page {
    padding: 22px 14px 48px;
  }
  .card {
    padding: 18px;
    border-radius: 16px;
  }
  .brand {
    font-size: 20px;
  }
  .mode-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .mode-card {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 16px;
  }
  .mode-card .mc-ico {
    margin: 0;
    flex: 0 0 52px;
    height: 52px;
  }
  .mode-card h3 {
    font-size: 18px;
    margin-bottom: 2px;
  }
  .mode-card p {
    font-size: 13px;
  }
  .mode-card .mc-foot {
    display: none;
  }
  .mode-card .mc-body {
    flex: 1;
  }
  .mode-card .mc-arrow {
    display: grid !important;
  }
  .hero {
    border-radius: 20px;
    padding: 26px 20px;
  }
  .hero-sub {
    font-size: 15px;
  }
  .hero-actions .btn {
    flex: 1 1 auto;
  }
  .btn-xl {
    min-height: 56px;
    padding: 14px 26px;
    font-size: 17px;
  }
  .hero-stats {
    gap: 18px;
  }
  .stats-grid {
    gap: 10px;
  }
  .stat-card {
    padding: 14px;
  }
  .stat-card b {
    font-size: 20px;
  }
  .settings-view {
    grid-template-columns: 1fr 1fr;
  }
  .set-group {
    padding: 14px 12px 12px;
  }
  .set-group .seg[data-seg$='blur'] {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .set-group .seg[data-seg$='peek'] {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .invite-code .code {
    font-size: 32px;
  }
  .mode-pick {
    grid-template-columns: 1fr;
  }
  .lb-row {
    grid-template-columns: 34px 1fr auto;
    padding: 9px 10px;
    gap: 10px;
  }
  .lb-val {
    font-size: 16px;
  }
  .profile-head {
    flex-direction: column;
    text-align: center;
  }
  .profile-head > * {
    flex: none !important;
    min-width: 0 !important;
  }
  .profile-meta,
  .profile-head #rel {
    justify-content: center;
  }
  .me-strip .me-stats {
    width: 100%;
    justify-content: space-between;
  }
  .podium-block {
    font-size: 26px;
  }
  .podium-col.p1 .podium-block {
    height: 120px;
  }
  .podium-col.p2 .podium-block {
    height: 90px;
  }
  .podium-col.p3 .podium-block {
    height: 66px;
  }
  .daily-cal {
    width: 72px;
  }
  .daily-cal .d {
    font-size: 32px;
  }
  .sum-body {
    margin-top: -40px;
  }
  .sum-card {
    padding: 20px;
  }
  .sum-rounds {
    grid-template-columns: repeat(2, 1fr);
  }
  .sum-actions .btn {
    flex: 1 1 auto;
  }
}

/* Игра на телефоне: фото на весь экран, карта — отдельным слоем */
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) {
  .gs-top {
    padding: 10px;
    padding-top: max(10px, env(safe-area-inset-top));
    gap: 8px;
  }
  .gs-left {
    position: relative;
    flex: 0 0 auto;
  }
  .gs-bar {
    position: relative;
    display: flex;
    align-items: stretch;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 460px;
    margin-left: auto;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(14, 8, 38, 0.84);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  }
  .gs-center {
    position: static;
    transform: none;
    display: flex;
    flex: 0 0 auto;
  }
  .gs-hud {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
  }
  .gs-timer:not(.hidden) {
    display: flex;
    align-items: center;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
  }
  .gs-timer .progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    margin: 0;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.06);
  }
  .gs-peek {
    padding: 70px 16px 100px;
  }
  .gs-peek [data-peek-map] {
    display: inline-flex;
  }
  .gs-peek-chip {
    top: calc(66px + env(safe-area-inset-top, 0px));
    bottom: auto;
    min-width: 120px;
    font-size: 18px;
  }
  .gs.duel .gs-peek-chip {
    top: calc(124px + env(safe-area-inset-top, 0px));
  }
  .gs-exit {
    height: 38px;
    padding: 0 10px;
  }
  .gs-exit .brand-mini {
    display: none;
  }
  .gs-center {
    top: 10px;
  }
  .gs-timer {
    min-width: 0;
    padding: 6px 11px 8px 10px;
    border-radius: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
  }
  .gs-timer b {
    font-size: 18px;
    gap: 5px;
  }
  .gs-timer b .ico {
    width: 15px;
    height: 15px;
  }
  .hud-cell {
    flex: 1 1 0;
    min-width: 0;
    padding: 6px 4px 8px;
  }
  .hud-cell span {
    font-size: 9px;
    letter-spacing: 0.06em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hud-cell b {
    font-size: 15px;
  }
  .hud-cell.hide-sm {
    display: none;
  }
  .gs-side {
    position: absolute;
    top: 58px;
    left: 0;
    width: min(210px, 56vw);
    max-width: none;
  }
  .gs-side .btn {
    align-self: flex-start;
  }
  .gs-pl {
    font-size: 12px;
    padding: 3px 8px 3px 3px;
  }
  .gs-pl .hp {
    flex-basis: 40px;
  }
  .gs-photo-tools {
    display: none;
  }
  .gs-guess,
  .gs-guess:hover,
  .gs-guess.pinned,
  .gs-guess.active {
    position: absolute;
    inset: 0;
    width: auto;
    opacity: 1;
    z-index: 12;
    padding: 0;
    gap: 0;
    background: #0b0622;
    transform: translateY(102%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .gs.map-open .gs-guess {
    transform: none;
  }
  .gs-map-tools {
    display: none;
  }
  .gs-map-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top));
    background: rgba(14, 8, 38, 0.95);
    border-bottom: 1px solid var(--line);
  }
  .gs-map-head b {
    flex: 1;
    font-style: italic;
    font-weight: 900;
    text-transform: uppercase;
  }
  .gs-map,
  .gs-guess:hover .gs-map,
  .gs-guess.pinned .gs-map,
  .gs-guess.active .gs-map {
    flex: 1;
    height: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .gs-guess-btn {
    border-radius: 0;
    min-height: 60px;
    padding-bottom: var(--safe-b);
    box-sizing: content-box;
  }
  .gs-map-fab {
    display: flex;
    position: absolute;
    right: 14px;
    bottom: calc(16px + var(--safe-b));
    z-index: 8;
    align-items: center;
    gap: 8px;
    min-height: 58px;
    padding: 10px 22px 10px 16px;
    font-size: 16px;
  }
  .gs-map-fab .fab-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--yellow);
    box-shadow: 0 0 0 3px rgba(255, 210, 63, 0.3);
  }
  .gs-actions {
    right: 12px;
    left: 12px;
    align-items: stretch;
  }
  .gs-result-panel {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    transform: translateY(40px);
    border-radius: 22px 22px 0 0;
    padding: 18px 16px calc(16px + var(--safe-b));
    max-height: 62vh;
  }
  .gs-result.show .gs-result-panel.in {
    transform: none;
  }
  .rp-score {
    font-size: 36px;
  }
  .rp-text {
    text-align: left;
    font-size: 14px;
  }
  .rp-actions .btn {
    flex: 1 1 auto;
  }
  .rp-row {
    grid-template-columns: 22px 26px 1fr auto;
    font-size: 13px;
  }
  .rp-row .ds {
    display: none;
  }
}

@media (max-width: 360px) {
  .gs-timer b {
    font-size: 16px;
  }
  .hud-cell b {
    font-size: 13.5px;
  }
  .hud-cell span {
    font-size: 8px;
    letter-spacing: 0.03em;
  }
}

/* Регистрация есть и в выпадающем меню — на самых узких экранах кнопку
   в шапке убираем, чтобы шапка не вылезала за край */
@media (max-width: 340px) {
  .nav-reg {
    display: none;
  }
}

@media (pointer: coarse), (max-width: 760px) {
  .desk-only {
    display: none !important;
  }
  .input,
  select.input,
  textarea.input {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Обновление 2026-10: рамки, эмодзи, чат, друзья, дуэли, анимации
   ═══════════════════════════════════════════════════════════════ */

.page-wide {
  max-width: 1400px;
}

.hide-xs {
  display: inline;
}

/* ─── Появление при прокрутке ─── */

.rv {
  opacity: 0;
}

.rv.rv-in {
  opacity: 1;
  animation: rvIn 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) var(--rv-d, 0ms) backwards;
}

@keyframes rvIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.985);
  }
}

/* ─── Рамки аватарок ─── */

.avf {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--av);
  height: var(--av);
  flex: 0 0 var(--av);
  isolation: isolate;
  vertical-align: middle;
}

.avf > .avatar {
  position: relative;
  z-index: 0;
}

.avf-svg {
  position: absolute;
  left: -16%;
  top: -16%;
  width: 132%;
  height: 132%;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}

.avf-svg .avf-shine,
.avf-svg .avf-spin {
  transform-origin: 0 0;
  animation: avfSpin 3.8s linear infinite;
}

.avf-svg .avf-spin {
  animation-duration: 9s;
}

.avf-diamond,
.avf-mythic {
  filter: drop-shadow(0 0 3px rgba(190, 240, 255, 0.55));
}

.avf-obsidian {
  filter: drop-shadow(0 0 4px rgba(150, 70, 255, 0.75));
  animation: avfGlow 2.8s ease-in-out infinite;
}

@keyframes avfSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes avfGlow {
  50% {
    filter: drop-shadow(0 0 9px rgba(255, 45, 111, 0.8));
  }
}

/* ─── Свои эмодзи ─── */

.emo {
  display: inline-block;
  overflow: visible;
  vertical-align: middle;
}

.emo g,
.emo path,
.emo circle,
.emo ellipse,
.emo rect,
.emo text {
  transform-box: fill-box;
  transform-origin: center;
}

.emo.anim .e-b {
  animation: eB 0.55s ease-in-out infinite alternate;
}

.emo.anim .e-shake {
  animation: eShake 0.32s linear infinite;
}

.emo.anim .e-tear {
  animation: eTear 1.1s ease-in infinite;
}

.emo.anim .e-d2 {
  animation-delay: 0.35s;
}

.emo.anim .e-pulse {
  animation: ePulse 0.6s ease-in-out infinite alternate;
}

.emo.anim .e-flick {
  transform-origin: 50% 100%;
  animation: eFlick 0.45s ease-in-out infinite alternate;
}

.emo.anim .e-steam {
  animation: eSteam 0.9s ease-out infinite;
}

.emo.anim .e-shift {
  animation: eShift 1.4s ease-in-out infinite;
}

.emo.anim .e-stream {
  stroke-dasharray: 5 4;
  animation: eStream 0.45s linear infinite;
}

.emo.anim .e-wig {
  animation: eWig 0.45s ease-in-out infinite alternate;
}

.emo.anim .e-z {
  animation: eZ 1.6s ease-out infinite;
}

.emo.anim .e-spin {
  animation: eSpin 2.4s linear infinite;
}

.emo.anim .e-shine {
  animation: eShine 1.4s ease-in-out infinite;
}

@keyframes eB {
  to {
    transform: translateY(-3px) scale(1.04);
  }
}

@keyframes eShake {
  25% {
    transform: translateX(-1.6px) rotate(-2deg);
  }
  75% {
    transform: translateX(1.6px) rotate(2deg);
  }
}

@keyframes eTear {
  0% {
    transform: translateY(-2px);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: translateY(10px);
    opacity: 0;
  }
}

@keyframes ePulse {
  to {
    transform: scale(1.18);
  }
}

@keyframes eFlick {
  to {
    transform: scaleY(1.07) scaleX(0.96);
  }
}

@keyframes eSteam {
  from {
    transform: translateY(2px) scale(0.6);
    opacity: 0.9;
  }
  to {
    transform: translateY(-8px) scale(1.2);
    opacity: 0;
  }
}

@keyframes eShift {
  0%,
  100% {
    transform: translateX(0);
  }
  30%,
  60% {
    transform: translateX(-4px);
  }
}

@keyframes eStream {
  to {
    stroke-dashoffset: -9;
  }
}

@keyframes eWig {
  from {
    transform: rotate(-6deg);
  }
  to {
    transform: rotate(6deg);
  }
}

@keyframes eZ {
  from {
    transform: translate(0, 4px);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  to {
    transform: translate(4px, -8px);
    opacity: 0;
  }
}

@keyframes eSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes eShine {
  0%,
  100% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
}

/* Эмодзи в тексте — по центру строки, а не ниже букв */
.emo-in {
  display: inline-flex;
  line-height: 0;
  vertical-align: -0.34em;
  margin: 0 1px;
}

.emo-in .emo {
  display: block;
}

/* ─── Шапка: друзья, техработы ─── */

.nav-friends {
  position: relative;
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  font-style: normal;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px #140b33;
  animation: badgeIn 0.35s cubic-bezier(0.2, 1.6, 0.4, 1);
}

.nav-badge.inline {
  position: static;
  margin-left: auto;
  box-shadow: none;
}

@keyframes badgeIn {
  from {
    transform: scale(0.3);
  }
}

.nav-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 16px;
  background: linear-gradient(90deg, rgba(255, 138, 31, 0.28), rgba(255, 77, 97, 0.28));
  border-top: 1px solid rgba(255, 210, 63, 0.25);
  color: #ffe3b8;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.nav-banner .ico {
  color: var(--yellow);
}

/* ─── Подвал ─── */

.footer-top,
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
}

.footer .brand {
  font-size: 19px;
}

.footer-links,
.footer-legal {
  display: flex;
  gap: 8px 18px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-2);
  font-weight: 700;
}

.footer-legal a {
  color: var(--text-3);
}

.footer a:hover {
  color: #fff;
}

/* ─── Главная ─── */

.hero-art {
  transform: translate3d(calc(var(--mx, 0) * 22px), calc(var(--my, 0) * 16px), 0);
  transition: transform 0.35s ease-out;
}

.hero-bg {
  transform: translate3d(calc(var(--mx, 0) * -12px), calc(var(--my, 0) * -8px), 0) scale(1.04);
  transition: transform 0.4s ease-out;
}

.mode-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(280px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.2), transparent 62%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.mode-card:hover::after {
  opacity: 1;
}

.mode-card .mc-ico {
  transition: transform 0.3s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.mode-card:hover .mc-ico {
  transform: rotate(-8deg) scale(1.08);
}

.mode-card.locked {
  filter: grayscale(0.8) brightness(0.75);
}

.mode-card.locked:hover {
  transform: none;
}

/* Блик по зелёной кнопке при наведении — вторым слоем фона, без
   позиционирования (кнопка «Карта» и другие стоят абсолютно) */
.btn-primary:not([disabled]):hover {
  background-image: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.32) 50%, transparent 65%), linear-gradient(180deg, var(--b1), var(--b2));
  background-size: 250% 100%, 100% 100%;
  background-repeat: no-repeat;
  animation: btnShine 0.9s ease;
}

@keyframes btnShine {
  from {
    background-position: 130% 0, 0 0;
  }
  to {
    background-position: -30% 0, 0 0;
  }
}

/* ─── Уведомления с кнопками ─── */

#notifs {
  position: fixed;
  top: calc(var(--nav-h) + 12px);
  right: 16px;
  z-index: 320;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(370px, calc(100vw - 24px));
  pointer-events: none;
}

body.in-game #notifs {
  top: 70px;
}

.notif {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 40px 14px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #2c1e70, #1d1350);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.3s, transform 0.35s cubic-bezier(0.2, 1, 0.3, 1);
  pointer-events: auto;
}

.notif.show {
  opacity: 1;
  transform: none;
}

.notif-invite {
  background: linear-gradient(160deg, #5a1a44, #251660);
  border-color: rgba(255, 77, 97, 0.55);
}

.notif-lead {
  flex: 0 0 auto;
  padding: 4px;
}

.notif-body {
  min-width: 0;
  flex: 1;
}

.notif-body b {
  display: block;
  font-weight: 900;
}

.notif-body > span {
  display: block;
  font-size: 13.5px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.notif-acts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.notif-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-3);
  cursor: pointer;
}

/* ─── «Ты в комнате — вернуться» ─── */

.room-pill {
  position: fixed;
  left: 16px;
  bottom: calc(16px + var(--safe-b));
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 9px 16px 9px 9px;
  border-radius: 18px;
  background: linear-gradient(135deg, #3d2b95, #22155a);
  border: 1px solid rgba(154, 130, 255, 0.5);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  color: #fff;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.3s, transform 0.35s cubic-bezier(0.2, 1, 0.3, 1);
}

.room-pill.show {
  opacity: 1;
  transform: none;
}

.room-pill:hover {
  color: #fff;
  filter: brightness(1.1);
}

.room-pill .rp-ico {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
}

.rp-txt {
  min-width: 0;
}

.rp-txt b {
  display: block;
  font-size: 14px;
  white-space: nowrap;
}

.rp-txt span {
  font-size: 12px;
  color: var(--text-2);
}

.room-pill.urgent {
  background: linear-gradient(135deg, #6cc12a, #2f6b0d);
  border-color: rgba(142, 224, 67, 0.7);
  animation: pillPulse 0.9s ease-in-out infinite alternate;
}

@keyframes pillPulse {
  to {
    box-shadow: 0 0 0 6px rgba(142, 224, 67, 0.25), 0 14px 34px rgba(0, 0, 0, 0.45);
  }
}

body.in-game .room-pill {
  display: none;
}

/* ─── Плашки усложнений и параметры игры ─── */

.hchips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.hchips.center {
  justify-content: center;
}

.hchip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255, 138, 31, 0.16);
  border: 1px solid rgba(255, 138, 31, 0.38);
  color: #ffc38a;
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
}

.hchip.calm {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line);
  color: var(--text-2);
}

.hchip-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.daily-chips {
  margin-top: 12px;
}

.ready-chips {
  margin: -8px 0 18px;
}

.specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.spec {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 11px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
}

.spec .ico {
  grid-row: 1 / 3;
  width: 22px;
  height: 22px;
  color: var(--purple-hi);
}

.spec span {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
}

.spec b {
  padding-right: 0.15em;
  font-size: 17px;
  font-weight: 900;
  font-style: italic;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Нечётная последняя плитка — на всю строку, чтобы не было дырки */
.specs:not(.specs-hard .specs) > .spec:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.spec.purple {
  background: linear-gradient(135deg, rgba(123, 92, 255, 0.3), rgba(123, 92, 255, 0.06));
  border-color: rgba(154, 130, 255, 0.45);
}

.spec.red {
  background: linear-gradient(135deg, rgba(255, 77, 97, 0.28), rgba(255, 77, 97, 0.06));
  border-color: rgba(255, 77, 97, 0.45);
}

.spec.red .ico {
  color: #ff8a98;
}

.spec.hard {
  background: rgba(255, 138, 31, 0.14);
  border-color: rgba(255, 138, 31, 0.5);
}

.spec.hard .ico,
.spec.hard b {
  color: #ffb266;
}

.spec.changed {
  animation: specFlash 1.8s ease;
}

@keyframes specFlash {
  0%,
  45% {
    box-shadow: 0 0 0 3px rgba(255, 210, 63, 0.85), 0 0 26px rgba(255, 210, 63, 0.4);
    transform: scale(1.03);
  }
}

.specs-hard {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.specs-hard.on {
  border-color: rgba(255, 138, 31, 0.45);
  background: rgba(255, 138, 31, 0.07);
}

.specs-hard-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--text-3);
}

.specs-hard.on .specs-hard-head {
  color: var(--orange);
}

.specs-hard-head b {
  color: #fff;
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
}

.specs-hard-head span {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  text-align: right;
}

.specs-hard .specs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.set-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 22px;
  align-items: start;
}

.set-cols .set-group {
  margin-top: 0;
}

/* Две колонки настроек — только если карточке хватает ширины,
   иначе переключатели переносятся на вторую строку */
.multi-create,
.lp-settings,
.play-grid > .card {
  container-type: inline-size;
}

@container (max-width: 740px) {
  .set-cols {
    grid-template-columns: minmax(0, 1fr);
  }
}

.set-cols .seg button {
  padding: 8px 7px;
  font-size: 13.5px;
}

.mode-pick button.locked {
  opacity: 0.5;
}

/* ─── Лобби ───
   Слева — приглашение, игроки и «Начать», в центре — режим игры,
   справа — чат. На планшете чат уходит вниз, на телефоне — вкладки. */

.lobby-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr);
  grid-template-areas: 'left settings chat';
  gap: 16px;
  align-items: start;
}

.lobby-left {
  grid-area: left;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.lp-settings {
  grid-area: settings;
}

.lp-chat {
  grid-area: chat;
}

.lobby-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 16px;
  align-items: start;
  padding: 18px 18px 16px;
  background: linear-gradient(135deg, rgba(123, 92, 255, 0.34), rgba(29, 17, 71, 0.8));
  border-color: rgba(154, 130, 255, 0.32);
}

.lb-code {
  min-width: 0;
}

.lb-code .invite-code {
  margin: 4px 0 0;
}

.lb-code .code {
  font-size: 42px;
  line-height: 1.05;
}

.lb-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-2);
}

.lb-invite {
  grid-column: 1 / -1;
  min-width: 0;
}

.lb-invite .invite-link-row {
  margin-bottom: 10px;
}

.lb-invite .warn-banner {
  margin: 12px 0 0 !important;
}

.lb-acts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lb-acts .lb-leave {
  margin-left: auto;
}

.lobby-bar .qr-box {
  width: 100px;
  height: 100px;
  flex-basis: 100px;
}

.lobby-tabs {
  display: none;
}

.lobby-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-n {
  font-size: 12px;
  opacity: 0.75;
}

.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.lp {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.lp-players .players {
  max-height: 420px;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 2px 4px;
}

.lp-chat {
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  height: clamp(460px, calc(100vh - var(--nav-h) - 64px), 780px);
}

.lobby-chat {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.lobby-wait {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text-2);
  text-align: center;
}

.final-actions .lobby-wait {
  padding: 18px;
}

/* ─── Чат ─── */

.cx {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.cx-list {
  flex: 1;
  min-height: 140px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 2px 2px 10px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.cx-empty {
  margin: auto;
  padding: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--text-3);
}

.cx-sys {
  align-self: center;
  margin: 5px 0;
  padding: 3px 11px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-3);
  font-size: 12px;
  text-align: center;
}

.cx-sys b {
  color: var(--text-2);
}

.cx-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 92%;
  margin-top: 6px;
}

.cx-msg.grp {
  margin-top: 0;
}

/* Аватарка — у последнего сообщения серии, ник — над первым */
.cx-msg.has-next .cx-av > * {
  visibility: hidden;
}

.cx-msg.has-next .cx-bubble {
  border-bottom-left-radius: 16px;
}

.cx-msg.mine.has-next .cx-bubble {
  border-bottom-right-radius: 16px;
}

.cx-av {
  flex: 0 0 32px;
  width: 32px;
  display: flex;
}

.cx-msg.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.cx-msg.mine .cx-av,
.cx-msg.dm .cx-av {
  display: none;
}

.cx-msg.dm:not(.mine) {
  align-self: flex-start;
}

.cx-bubble {
  position: relative;
  min-width: 0;
  padding: 7px 12px 6px;
  border-radius: 16px 16px 16px 6px;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid var(--line);
}

.cx-msg.mine .cx-bubble {
  border-radius: 16px 16px 6px 16px;
  background: linear-gradient(180deg, rgba(141, 114, 255, 0.6), rgba(85, 54, 216, 0.6));
  border-color: rgba(154, 130, 255, 0.45);
}

.cx-name {
  display: block;
  margin-bottom: 1px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--pc, var(--yellow));
  filter: brightness(1.25);
}

.cx-name a {
  color: inherit;
}

.cx-msg.mine .cx-name {
  display: none;
}

.cx-text {
  display: inline;
  font-size: 14.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.cx-time {
  float: right;
  margin: 6px 0 -3px 10px;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.45);
}

.cx-bubble.jumbo {
  padding: 0;
  background: none;
  border-color: transparent;
}

.cx-bubble.jumbo .cx-name {
  margin-bottom: 2px;
}

.cx-bubble.jumbo .cx-time {
  float: none;
  display: block;
  margin: 0;
  text-align: right;
}

.cx-new {
  animation: cxIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

@keyframes cxIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
}

.cx-more {
  position: absolute;
  left: 50%;
  bottom: 74px;
  z-index: 3;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 0;
  border-radius: 99px;
  background: var(--purple);
  color: #fff;
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.cx-foot {
  position: relative;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.cx-compose {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(8, 4, 26, 0.5);
  border: 1.5px solid var(--line-2);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.cx-compose:focus-within {
  border-color: var(--purple-hi);
  box-shadow: 0 0 0 3px rgba(123, 92, 255, 0.2);
}

.cx-input {
  position: relative;
  flex: 1;
  min-width: 0;
  max-height: 120px;
  overflow-y: auto;
  padding: 9px 4px;
  font-size: 15px;
  line-height: 1.35;
  outline: none;
  cursor: text;
  overflow-wrap: anywhere;
  -webkit-user-select: text;
  user-select: text;
}

.cx-input.empty::before {
  content: attr(data-ph);
  position: absolute;
  color: #7a6fa8;
  pointer-events: none;
  white-space: nowrap;
}

.cx-emo {
  width: 22px;
  height: 22px;
  margin: 0 1px;
  vertical-align: -0.3em;
}

.cx-emo-btn,
.cx-send {
  flex: 0 0 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}

.cx-emo-btn:hover {
  color: var(--yellow);
  background: rgba(255, 255, 255, 0.07);
}

.cx-send {
  background: linear-gradient(180deg, var(--green-hi), var(--green-lo));
  color: #fff;
}

.cx-send:not([disabled]):active {
  transform: scale(0.94);
}

.cx-send[disabled] {
  opacity: 0.35;
  filter: grayscale(0.6);
  cursor: default;
}

.cx-pick {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 18px;
  background: #24175f;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.18s, transform 0.18s;
}

.cx-pick.show {
  opacity: 1;
  transform: none;
}

.cx-pick button {
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.12s, background 0.12s;
}

.cx-pick button:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.14) rotate(-4deg);
}

.cx-locked {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--line-2);
  color: var(--text-2);
  font-size: 13.5px;
}

.cx-locked .ico {
  color: var(--yellow);
}

.cx-locked .btn {
  margin-left: auto;
}

.cx-invite {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 94%;
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 77, 97, 0.28), rgba(123, 92, 255, 0.22));
  border: 1px solid rgba(255, 77, 97, 0.5);
}

.cx-invite.mine {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line-2);
}

.cxi-ico {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
}

.cx-invite b {
  display: block;
}

.cx-invite span {
  font-size: 12px;
  color: var(--text-2);
}

/* ─── Реакции в игре ─── */

.gs-react {
  position: absolute;
  left: 16px;
  bottom: calc(172px + var(--safe-b));
  z-index: 22;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  pointer-events: none;
}

.rx-pop {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: rgba(14, 8, 38, 0.84);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateX(-30px) scale(0.8);
  transition: opacity 0.35s, transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

.rx-pop.show {
  opacity: 1;
  transform: none;
}

.rx-pop.out {
  opacity: 0;
  transform: translateX(-16px) scale(0.92);
}

.rx-pop.mine {
  border-color: rgba(255, 210, 63, 0.5);
}

.rx-who {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rx-who .avatar {
  box-shadow: 0 0 0 2px var(--pc);
}

.rx-who b {
  max-width: 130px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rx-emo {
  display: block;
  width: 58px;
  height: 58px;
  margin: -14px -2px -14px 2px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

/* Кнопка реакций: на ПК — над кнопкой «+» (колонка инструментов фото),
   без приближения фото — в самом низу */
.gs-react-slot {
  position: absolute;
  left: 16px;
  bottom: calc(164px + var(--safe-b));
  z-index: 24;
}

.gs-photo.nozoom ~ .gs-react-slot {
  bottom: calc(18px + var(--safe-b));
}

.rx {
  position: relative;
}

.rx-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(14, 8, 38, 0.8);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: color 0.15s, background 0.15s, transform 0.15s;
}

.rx-btn:hover,
.rx.open .rx-btn {
  color: var(--yellow);
  background: rgba(45, 31, 110, 0.95);
}

/* Пауза между реакциями: кнопка «заряжается» 3 секунды */
.rx.cool .rx-btn {
  color: var(--text-3);
  pointer-events: none;
}

.rx.cool .rx-btn::after {
  content: '';
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 4px;
  height: 3px;
  border-radius: 99px;
  background: var(--yellow);
  transform-origin: left;
  animation: rxCool 3s linear forwards;
}

@keyframes rxCool {
  from {
    transform: scaleX(0);
  }
}

.rx-tray {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  display: grid;
  grid-template-columns: repeat(4, 52px);
  gap: 4px;
  padding: 8px;
  border-radius: 18px;
  background: #1a1042;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.95);
  transform-origin: bottom left;
  transition: opacity 0.18s, transform 0.2s;
}

.rx.open .rx-tray {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.rx-tray button {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: transparent;
  cursor: pointer;
  transition: transform 0.12s, background 0.12s;
}

.rx-tray button:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.16) rotate(-4deg);
}

[data-rx-pid] {
  position: relative;
}

.rx-burst {
  position: absolute;
  left: 50%;
  top: -6px;
  z-index: 6;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  pointer-events: none;
  animation: rxBurst 2.2s ease-out forwards;
}

@keyframes rxBurst {
  0% {
    transform: translateY(0) scale(0.3);
    opacity: 0;
  }
  15% {
    transform: translateY(-16px) scale(1.2);
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    transform: translateY(-64px) scale(0.9);
    opacity: 0;
  }
}

/* ─── Заставка раунда: подложка и усложнения ─── */

.gs-splash .inner {
  position: relative;
  padding: 26px 44px;
}

.gs-splash .inner::before {
  content: '';
  position: absolute;
  inset: -50px -110px;
  z-index: -1;
  background: radial-gradient(ellipse at center, rgba(5, 3, 13, 0.78), rgba(5, 3, 13, 0.45) 45%, transparent 72%);
}

.gs-splash-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.gs-splash-chips .hchip {
  padding: 6px 14px;
  font-size: 14px;
  background: rgba(255, 138, 31, 0.9);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.gs-peek {
  transition: opacity 0.25s;
}

.gs.splashing .gs-peek {
  opacity: 0;
  visibility: hidden;
}

.gs-force {
  background: rgba(14, 8, 38, 0.78) !important;
}

/* ─── Дуэль: полоски здоровья ─── */

/* Полоски на всю ширину экрана, чтобы «Раунд N» стоял ровно под таймером;
   слева место под кнопку выхода */
.gs-duelhud {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  z-index: 5;
  pointer-events: none;
}

.gs-duelhud .dh-left {
  padding-left: 54px;
}

.gs:not(.duel) .gs-duelhud {
  display: none;
}

.gs.duel .gs-hud {
  display: none;
}

.gs.duel .gs-side {
  margin-top: 64px;
}

.gs.duel .gs-exit .brand-mini {
  display: none;
}

.dh {
  display: grid;
  grid-template-columns: minmax(0, 380px) 1fr minmax(0, 380px);
  align-items: start;
  gap: 16px;
}

.dh-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
}

.dh-right {
  align-items: stretch;
}

.dh-mid {
  justify-self: center;
  margin-top: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.dh-round {
  font-size: 13px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.dh-mult,
.dr-mult {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 99px;
  background: linear-gradient(90deg, #ff4d61, #ff8a1f);
  font-size: 13px;
  font-weight: 900;
  font-style: italic;
  box-shadow: 0 4px 14px rgba(255, 77, 97, 0.45);
}

.dh-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 12px 8px 7px;
  border-radius: 16px;
  background: rgba(14, 8, 38, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.dh-card.right {
  flex-direction: row-reverse;
  padding: 7px 7px 8px 12px;
}

.dh-card .avatar {
  box-shadow: 0 0 0 2.5px var(--pc);
}

.dh-info {
  flex: 1;
  min-width: 0;
}

.dh-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.dh-card.right .dh-top {
  flex-direction: row-reverse;
}

.dh-name {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dh-num {
  font-size: 15px;
  font-weight: 900;
  font-style: italic;
  font-variant-numeric: tabular-nums;
}

.dh-bar {
  height: 12px;
  margin-top: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
}

.dh-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(180deg, #b0f577, #5fae1f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dh-card.right .dh-bar i {
  margin-left: auto;
}

.dh-card.mid .dh-bar i {
  background: linear-gradient(180deg, #ffe066, #f5a91b);
}

.dh-card.low .dh-bar i {
  background: linear-gradient(180deg, #ff8a98, #d92c43);
  animation: lowHp 1s ease-in-out infinite alternate;
}

@keyframes lowHp {
  to {
    filter: brightness(1.35);
  }
}

.dh-card.big {
  padding-top: 9px;
  padding-bottom: 10px;
}

.dh-card.big .dh-bar {
  height: 16px;
}

.dh-card.big .dh-name {
  font-size: 16px;
}

.dh-card.big .dh-num {
  font-size: 19px;
}

.dh-card.dead,
.dh-card.off {
  opacity: 0.5;
  filter: grayscale(0.8);
}

.dh-check {
  position: absolute;
  top: -7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  box-shadow: 0 0 0 2px #140b33;
  transform: scale(0);
  transition: transform 0.25s cubic-bezier(0.2, 1.6, 0.4, 1);
}

.dh-card.left .dh-check {
  left: 34px;
}

.dh-card.right .dh-check {
  right: 34px;
}

.dh-card.guessed .dh-check {
  transform: scale(1);
}

.dh-more {
  align-self: flex-end;
  padding: 2px 10px;
  border-radius: 99px;
  background: rgba(14, 8, 38, 0.72);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 800;
}

/* ─── Дуэль: результаты раунда ─── */

.gs-over {
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
}

.gs.over-on .gs-over {
  pointer-events: auto;
}

.gs.over-on .gs-top,
.gs.over-on .gs-duelhud,
.gs.over-on .gs-guess,
.gs.over-on .gs-map-fab,
.gs.over-on .gs-photo-tools {
  visibility: hidden;
}

.dr {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 16px calc(24px + var(--safe-b));
  background: #0b0622;
}

.dr-bg {
  position: absolute;
  inset: -70px;
  background: #1a1040 center / cover no-repeat;
  filter: blur(26px) brightness(0.34) saturate(1.25);
}

.dr::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, transparent 25%, rgba(5, 3, 13, 0.65) 100%);
  pointer-events: none;
}

.dr.flash::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  background: radial-gradient(circle at 50% 72%, rgba(255, 77, 97, 0.4), transparent 60%);
  animation: fadeOut 0.7s ease-out forwards;
  pointer-events: none;
}

@keyframes fadeOut {
  to {
    opacity: 0;
  }
}

.dr-stage {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity 0.5s, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dr.in .dr-stage,
.dr.scored .dr-stage {
  opacity: 1;
  transform: none;
}

.dr.leaving .dr-stage {
  opacity: 0;
  transform: scale(0.96);
}

.dr-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.dr-title {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.dr-card {
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  border: 3px solid rgba(255, 255, 255, 0.85);
  background: #1d1a33;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55);
}

.dr-map {
  position: relative;
  height: min(40vh, 400px);
}

/* Игроки — под картой (ники не залезают на неё), VS ровно посередине;
   строки с расстоянием и очками — в тех же колонках, что и полоски */
.dr-duo,
.dr-rows {
  width: min(780px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
  align-items: center;
}

.dr-duo {
  position: relative;
  z-index: 2;
  margin-top: 4px;
}

.dr-p {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dr-p.right {
  flex-direction: row-reverse;
  text-align: right;
}

.dr-p .avatar {
  box-shadow: 0 0 0 3px var(--pc), 0 8px 18px rgba(0, 0, 0, 0.5);
}

.dr-p-info {
  flex: 1;
  min-width: 0;
}

.dr-name {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.dr-hp {
  position: relative;
  height: 24px;
  border-radius: 8px;
  background: rgba(10, 6, 28, 0.88);
  border: 2px solid rgba(255, 255, 255, 0.28);
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  transition: border-color 0.3s;
}

.dr-hp i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: 5px;
}

.dr-p.right .dr-hp i {
  left: auto;
  right: 0;
}

.dr-hp .ghost {
  background: #fff;
  opacity: 0.85;
  transition: width 0.7s cubic-bezier(0.3, 0.7, 0.3, 1);
}

.dr-hp .fill {
  background: linear-gradient(180deg, #b0f577, #5fae1f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dr-hp-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 900;
  font-style: italic;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.dr-hp.sm {
  height: 16px;
  border-width: 1.5px;
}

.dr-hp.sm .dr-hp-num {
  font-size: 11px;
}

.dr-vs {
  justify-self: center;
  align-self: center;
  margin-top: 18px;
  padding-right: 0.1em;
  font-size: 20px;
  font-weight: 900;
  font-style: italic;
  line-height: 24px;
  color: var(--text-3);
}

.dr-p.hurt .dr-hp,
.dr-li.hurt .dr-hp {
  border-color: rgba(255, 77, 97, 0.85);
}

.dr-p.shake,
.dr-li.shake {
  animation: drShake 0.5s;
}

@keyframes drShake {
  15% {
    transform: translateX(-9px) rotate(-1.5deg);
  }
  35% {
    transform: translateX(8px) rotate(1deg);
  }
  55% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(3px);
  }
}

.dr-ko {
  position: absolute;
  top: -22px;
  left: 50%;
  z-index: 3;
  padding: 3px 12px;
  border-radius: 8px;
  background: var(--red);
  font-size: 13px;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateX(-50%) rotate(-8deg);
  box-shadow: 0 6px 16px rgba(217, 44, 67, 0.5);
  animation: koIn 0.5s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes koIn {
  from {
    transform: translateX(-50%) rotate(-8deg) scale(2.4);
    opacity: 0;
  }
}

.dr-rows {
  grid-template-columns: 1fr;
  margin-top: 6px;
}

.dr-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.dr-row span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-3);
}

.dr-row .l,
.dr-row .r {
  text-align: center;
}

.dr-row span {
  white-space: nowrap;
}

.dr-row.dist b {
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.4s;
}

.dr.dists .dr-row.dist b,
.dr.scored .dr-row.dist b {
  opacity: 1;
}

.dr-sc {
  /* Курсив + градиент по тексту: запас справа, чтобы не срезать последнюю цифру */
  padding-right: 0.16em;
  font-weight: 900;
  font-style: italic;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff6b8 8%, #ffb020 52%, #ff5a1f 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(255, 120, 30, 0.55)) drop-shadow(0 2px 0 rgba(110, 30, 0, 0.85));
}

.dr-row.score .dr-sc {
  display: inline-block;
  font-size: clamp(32px, 5.4vw, 48px);
  line-height: 1.05;
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 0.3s, transform 0.4s cubic-bezier(0.2, 1.5, 0.4, 1), filter 0.4s;
}

.dr-row.score .dr-sc.launched {
  opacity: 0.25 !important;
}

.dr-row.score .dr-sc.hidden-num {
  opacity: 0 !important;
  transition: none;
}

/* Летящее число очков победителя */
.dr-ball {
  position: absolute;
  padding: 0 0.16em 0 0.04em;
  font-size: clamp(32px, 5.4vw, 48px);
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  background: linear-gradient(180deg, #fff6b8 8%, #ffb020 52%, #ff5a1f 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(255, 140, 40, 0.9));
}

.dr.scoring .dr-row.score .dr-sc,
.dr.scored .dr-row.score .dr-sc {
  opacity: 1;
  transform: none;
}

.dr.scored .dr-sc:not(.win) {
  filter: grayscale(0.75) brightness(0.65);
}

.dr-sc.win {
  animation: winPulse 0.6s ease;
}

@keyframes winPulse {
  40% {
    transform: scale(1.14);
  }
}

.dr-fly {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.dr-dmg {
  position: absolute;
  padding: 0 0.16em 0.06em 0.04em;
  font-size: clamp(50px, 8vw, 84px);
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  background: linear-gradient(180deg, #ffffff 0%, #ffd23f 30%, #ff5a1f 68%, #c8102e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 16px rgba(255, 90, 31, 0.95)) drop-shadow(0 3px 0 #4a0710);
}

.dr-spark {
  position: absolute;
  width: 8px;
  height: 8px;
  margin: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, #ffb020 50%, #ff3d2e);
  animation: spark 0.7s ease-out forwards;
}

@keyframes spark {
  to {
    transform: translate(var(--dx), var(--dy)) scale(0.2);
    opacity: 0;
  }
}

.dr-list {
  width: min(640px, 100%);
  max-height: 34vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding-top: 10px;
}

.dr-li {
  display: grid;
  grid-template-columns: 22px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(14, 8, 38, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: pageIn 0.35s both;
  animation-delay: calc(var(--i) * 70ms);
}

.dr-pl {
  font-weight: 900;
  font-style: italic;
  color: var(--text-3);
  text-align: center;
}

.dr-li-main {
  min-width: 0;
}

.dr-li-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 13.5px;
}

.dr-li-top b {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dr-li-d {
  color: var(--text-3);
  white-space: nowrap;
}

.dr-li .dr-sc {
  min-width: 72px;
  font-size: 26px;
  text-align: right;
}

.dr-dmg-tag {
  position: absolute;
  top: -9px;
  right: 12px;
  color: #ff6b7d;
  font-size: 14px;
  font-weight: 900;
  font-style: italic;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.dr-li.ko {
  opacity: 0.75;
}

.dr-foot {
  display: flex;
  justify-content: center;
  min-height: 8px;
}

.dr-next {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  animation: fadeIn 0.45s;
}

.dr-next-in {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dr-next-t {
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  animation: splash 4.6s cubic-bezier(0.2, 0.9, 0.3, 1) both;
  animation-name: nextIn;
}

@keyframes nextIn {
  from {
    opacity: 0;
    transform: scale(1.3);
  }
  20% {
    opacity: 1;
    transform: none;
  }
}

.dr-next-s {
  margin-top: 16vh;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-2);
}

.dr-next-n {
  font-size: 58px;
  font-weight: 900;
  font-style: italic;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--yellow);
  text-shadow: 0 0 22px rgba(255, 210, 63, 0.5);
}

.dr-next-n.pop {
  animation: numPop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes numPop {
  from {
    transform: scale(1.5);
    opacity: 0.4;
  }
}

/* ─── Итоги раунда в комнате: таблица сбоку ─── */

.rp-handle {
  display: none;
}

.rp-head {
  margin-bottom: 8px;
}

.rp-row {
  position: relative;
}

.rp-row .nm small,
.rp-row .sc small {
  display: block;
  font-size: 11.5px;
  font-style: normal;
  font-weight: 600;
  color: var(--text-3);
}

.gs-result.side .gs-result-panel {
  left: auto;
  right: 16px;
  top: 16px;
  bottom: calc(16px + var(--safe-b));
  width: 390px;
  max-height: none;
  display: flex;
  flex-direction: column;
  padding: 18px 18px 16px;
  transform: translateX(40px);
}

.gs-result.show.side .gs-result-panel.in {
  transform: none;
}

.gs-result.side .rp-top {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.gs-result.side .rp-text {
  text-align: left;
}

.gs-result.side .rp-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -6px 14px;
  padding: 0 6px;
}

.gs-result.side .rp-row {
  grid-template-columns: 22px 26px minmax(0, 1fr) auto;
  /* Панель сама выезжает с задержкой — строкам ждать ещё раз не нужно
     (и при разворачивании шторки на телефоне они видны сразу) */
  animation-delay: 0.05s !important;
}

.gs-result.side .rp-row .ds {
  display: none;
}

.gs-result.side .mv-zoom {
  right: 422px;
}

/* ─── Разбор раундов на итогах ─── */

.xpl {
  position: relative;
  overflow: hidden;
}

.xpl .mv-host,
.xpl .mv {
  position: absolute;
  inset: 0;
}

.sum-xp {
  position: absolute;
  inset: 0;
}

/* Панель итогов наезжает на низ карты на 70px — карточку фото ставим выше */
.sum-xp .xp-photo {
  bottom: 86px;
}

.sum-xp .mv-zoom {
  top: 60px;
}

.line-label {
  position: absolute;
  left: 0;
  top: 0;
  translate: -50% -50%;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(10, 5, 30, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.line-label.on {
  opacity: 1;
}

.line-label.big {
  padding: 5px 13px;
  font-size: 15px;
  background: var(--yellow);
  border-color: transparent;
  color: #2a1a00;
}

.pin-wrap.dim {
  opacity: 0.25;
}

.pin-wrap.focus {
  z-index: 3;
}

.pin-wrap.focus .pin-actual span {
  transform: scale(1.18);
  transition: transform 0.3s;
}

.mv-lines .dim {
  opacity: 0.22;
}

.xp-photo {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 80px);
  padding: 8px 10px 8px 8px;
  border-radius: 18px;
  background: rgba(14, 8, 38, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
}

.xp-photo.pop {
  animation: xpIn 0.45s cubic-bezier(0.2, 1.3, 0.4, 1);
}

@keyframes xpIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.95);
  }
}

.xp-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 180px;
  aspect-ratio: 16 / 10;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #221655;
  color: var(--text-3);
  cursor: zoom-in;
}

.xp-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.xp-thumb:hover img {
  transform: scale(1.06);
}

.xp-zoom {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
}

.xp-meta {
  min-width: 0;
}

.xp-meta b {
  display: block;
  font-size: 13px;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  color: var(--text-2);
}

.xp-meta .xp-score {
  display: block;
  font-size: 28px;
  font-weight: 900;
  font-style: italic;
  line-height: 1.1;
  color: var(--yellow);
}

.xp-meta span {
  font-size: 13px;
  color: var(--text-2);
}

.xp-close {
  align-self: flex-start;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-2);
  cursor: pointer;
}

.xp-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background: rgba(4, 2, 14, 0.92);
  opacity: 0;
  transition: opacity 0.2s;
  cursor: zoom-out;
}

.lightbox.show {
  opacity: 1;
}

.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 100px);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.lb-cap {
  font-weight: 800;
  color: var(--text-2);
}

.lb-x {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
}

.sum-round .n {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sum-round .n .ico {
  opacity: 0.5;
}

.sum-round.on .n .ico,
.sum-round:hover .n .ico {
  opacity: 1;
  color: var(--yellow);
}

.sum-round.tone-great {
  box-shadow: inset 3px 0 0 var(--green-hi);
}

.sum-round.tone-bad {
  box-shadow: inset 3px 0 0 var(--red);
}

/* ─── Финал комнаты ─── */

.final-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.final-side {
  position: sticky;
  top: calc(var(--nav-h) + 16px);
}

.final-chat {
  display: flex;
  flex-direction: column;
  height: clamp(380px, calc(100vh - var(--nav-h) - 150px), 660px);
}

.round-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.rchip {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 58px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.rchip b {
  font-weight: 900;
  font-style: italic;
}

.rchip span {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--yellow);
}

.rchip:hover,
.rchip.on {
  background: rgba(123, 92, 255, 0.26);
  border-color: rgba(154, 130, 255, 0.6);
}

.final-map {
  height: min(52vh, 480px);
  border-radius: 14px;
  border: 1px solid var(--line-2);
}

.duel-win {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin-bottom: 20px;
  padding: 34px 24px 26px;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 210, 63, 0.22), transparent 62%), var(--panel);
}

.dw-p {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(250px, 38vw);
}

.dw-p .avatar {
  box-shadow: 0 0 0 4px var(--pc), 0 12px 30px rgba(0, 0, 0, 0.5);
}

.dw-p b {
  max-width: 100%;
  font-size: 19px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dw-p .dr-hp {
  width: 100%;
}

.dw-p.lose {
  opacity: 0.6;
  filter: grayscale(0.5);
}

.dw-p.win {
  animation: podiumUp 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.dw-crown {
  position: absolute;
  top: -30px;
  z-index: 2;
  color: var(--yellow);
  filter: drop-shadow(0 4px 12px rgba(255, 210, 63, 0.7));
  animation: floaty2 3s ease-in-out infinite;
}

.dw-crown .ico {
  fill: var(--yellow);
}

.dw-vs {
  font-size: 30px;
  font-weight: 900;
  font-style: italic;
  color: var(--text-3);
}

/* ─── С друзьями ─── */

.multi-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.multi-grid {
  align-items: stretch;
}

.multi-friends {
  flex: 1;
}

.guest-name {
  max-width: 380px;
}

.mf-list,
.inv-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inv-list {
  max-height: 52vh;
  overflow-y: auto;
}

.mf-row,
.inv-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.mf-name,
.inv-name {
  flex: 1;
  min-width: 0;
}

.mf-name b,
.inv-name b {
  display: block;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mf-name span,
.inv-name span {
  font-size: 12px;
  color: var(--text-3);
}

.mf-row.on .mf-name span,
.inv-row.on .inv-name span {
  color: var(--green-hi);
}

.fr-av {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.fr-av .dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  z-index: 3;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #6b6190;
  box-shadow: 0 0 0 2.5px #1c1145;
}

.online .fr-av .dot,
.fr-av.online .dot,
.mf-row.on .dot,
.inv-row.on .dot {
  background: var(--green-hi);
}

.mf-guest p {
  color: var(--text-2);
  font-size: 14px;
}

.empty-mini {
  padding: 18px 8px;
  text-align: center;
  color: var(--text-3);
}

.empty-mini > .ico {
  color: var(--purple-hi);
  margin-bottom: 6px;
}

.empty-mini p {
  font-size: 13.5px;
}

.closed-state .ico-big {
  background: rgba(255, 138, 31, 0.2);
  color: var(--orange);
}

.join-card .hchips {
  margin-top: 12px;
}

.join-acc {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 14px auto 0;
}

/* ─── Одиночная игра ─── */

.play-grid {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}

.play-map .map-preview {
  position: relative;
  margin-bottom: 14px;
}

.play-map .map-preview .badge {
  position: absolute;
  left: 12px;
  top: 12px;
  background: rgba(14, 8, 38, 0.86);
  color: #fff;
}

.play-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.play-stats div {
  padding: 10px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  text-align: center;
}

.play-stats b {
  display: block;
  font-size: 20px;
  font-weight: 900;
  font-style: italic;
  color: var(--yellow);
}

.play-stats span {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.play-daily {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  background: linear-gradient(135deg, rgba(245, 169, 27, 0.3), rgba(49, 32, 112, 0.62));
  border-color: rgba(255, 210, 63, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.play-daily:hover {
  color: #fff;
  transform: translateY(-3px);
}

.pd-ico {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.15);
}

.pd-body {
  flex: 1;
  min-width: 0;
}

.pd-body b {
  display: block;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
}

.pd-body > span {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-2);
}

.gate {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 26px;
  align-items: center;
}

.gate-art {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 20px;
  background: #221655 center / cover;
  border: 1px solid var(--line-2);
}

.gate-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(14, 8, 38, 0.55);
}

.gate-art span {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: var(--yellow);
}

.gate-body h2 {
  font-size: 24px;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
}

.gate-body p {
  color: var(--text-2);
}

/* ─── Друзья ─── */

.fr-grid {
  display: grid;
  grid-template-columns: 370px minmax(0, 1fr);
  gap: 16px;
  height: calc(100vh - var(--nav-h) - 180px);
  min-height: 520px;
}

.fr-side,
.fr-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px;
}

.fr-add {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.fr-add-in {
  position: relative;
  flex: 1;
  min-width: 0;
}

.fr-add-in .ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
}

.fr-add-in .input {
  min-height: 40px;
  padding: 8px 12px 8px 38px;
}

.fr-tabs {
  margin-bottom: 10px;
}

.fr-tabs button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.fr-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0 -8px;
  padding: 0 8px;
}

.fr-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 14px;
  color: #fff;
  transition: background 0.15s;
}

a.fr-row:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.fr-row.on {
  background: rgba(123, 92, 255, 0.24);
}

.fr-main {
  flex: 1;
  min-width: 0;
}

.fr-main b,
.fr-main > span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fr-main > span {
  font-size: 12.5px;
  color: var(--text-3);
}

.fr-row.online .fr-main > span {
  color: var(--text-2);
}

.fr-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.fr-meta small {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}

.fr-unread {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  background: var(--red);
  font-size: 11px;
  font-weight: 900;
}

.fr-acts {
  display: flex;
  gap: 6px;
}

.fr-acts .btn {
  padding: 6px 12px;
}

.fr-sep {
  padding: 10px 10px 4px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.fr-chat {
  padding: 0;
  overflow: hidden;
}

.fr-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.fr-back {
  display: none;
}

.fr-who {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.fr-who:hover {
  color: #fff;
}

.fr-who b {
  display: block;
}

.fr-who span span {
  font-size: 12.5px;
  color: var(--text-3);
}

.fr-head-acts {
  display: flex;
  gap: 6px;
}

.fr-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 14px 14px;
}

.fr-empty {
  max-width: 400px;
  margin: auto;
  padding: 30px;
  text-align: center;
}

.fr-empty h2 {
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
}

.fr-empty p {
  color: var(--text-2);
}

.fr-empty .ico-big {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: rgba(123, 92, 255, 0.2);
  color: var(--purple-hi);
}

/* ─── Документы ─── */

.legal-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  max-width: 1120px;
  margin: 0 auto;
}

.legal-nav {
  position: sticky;
  top: calc(var(--nav-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
}

.legal-nav .label {
  padding: 4px 10px 8px;
}

.legal-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 700;
}

.legal-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.legal-nav a.on {
  background: rgba(123, 92, 255, 0.26);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--yellow);
}

.legal-body .page-title {
  margin: 6px 0 8px;
  font-size: clamp(26px, 3.6vw, 40px);
}

.legal-body .page-sub {
  margin-bottom: 22px;
}

.legal-sec {
  margin-bottom: 14px;
}

.legal-sec h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
}

.legal-sec h2 span {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 210, 63, 0.16);
  color: var(--yellow);
  font-size: 15px;
}

.legal-sec p {
  margin: 0 0 8px;
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.6;
}

.legal-sec p:last-child {
  margin: 0;
}

/* ─── Вход в окне, согласие ─── */

.auth-modal .modal {
  width: min(420px, 100%);
}

.am-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  font-style: italic;
}

.am-brand b {
  margin-left: 3px;
  color: var(--yellow);
}

.am-reason {
  text-align: center;
  font-size: 14px;
  color: var(--text-2);
}

.am-tabs {
  margin: 8px 0 16px;
}

.am-tabs button {
  flex: 1;
}

.check {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0 16px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
  cursor: pointer;
}

.check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-box {
  flex: 0 0 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 7px;
  border: 2px solid var(--line-2);
  display: grid;
  place-items: center;
  color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.check input:checked + .check-box {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.check input:focus-visible + .check-box {
  outline: 3px solid rgba(255, 210, 63, 0.7);
  outline-offset: 2px;
}

/* ─── Своя аватарка ─── */

.av-edit {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.av-cur {
  padding: 14px;
}

.av-info {
  flex: 1 1 240px;
  min-width: 0;
}

.av-info > b {
  display: block;
  font-size: 16px;
  font-weight: 900;
}

.av-info > span {
  font-size: 13px;
}

.av-pending {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 210, 63, 0.08);
  border: 1px solid rgba(255, 210, 63, 0.3);
}

.av-pending img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.av-pending b {
  display: block;
  font-size: 14px;
}

.av-pending span {
  font-size: 12.5px;
  color: var(--text-2);
}

.av-pending .link-btn {
  margin-left: auto;
}

.crop-modal .modal {
  width: min(400px, 100%);
}

.crop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.crop-view {
  position: relative;
  width: min(280px, 72vw);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 18px;
  background: #0b0622;
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.crop-img {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  transform-origin: 0 0;
  pointer-events: none;
}

.crop-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle closest-side, transparent 98.5%, rgba(8, 4, 26, 0.74) 100%);
}

.crop-mask::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.crop-zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(280px, 72vw);
  color: var(--text-3);
}

.crop-zoom input {
  flex: 1;
  accent-color: var(--yellow);
}

.profile-av {
  position: relative;
  padding: 16px;
}

.profile-online {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 3;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green-hi);
  box-shadow: 0 0 0 4px #2b1b6c;
}

/* ─── Адаптив новых блоков ─── */

@media (max-width: 1280px) {
  .lobby-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      'left settings'
      'chat chat';
  }
  .lp-chat {
    position: relative;
    top: 0;
    height: 480px;
  }
  .gs-result.side .gs-result-panel {
    width: 350px;
  }
  .gs-result.side .mv-zoom {
    right: 382px;
  }
}

@media (max-width: 1100px) {
  .multi-grid,
  .final-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .final-side {
    position: static;
  }
  .dh {
    grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .lobby-tabs {
    display: flex;
  }
  .lobby-grid {
    display: block;
  }
  .lobby-grid .lp {
    display: none;
    margin-top: 14px;
  }
  .lobby-left {
    gap: 14px;
  }
  .lobby-grid[data-tab='players'] .lp-players,
  .lobby-grid[data-tab='settings'] .lp-settings,
  .lobby-grid[data-tab='chat'] .lp-chat {
    display: flex;
  }
  .lp-chat {
    height: calc(100dvh - var(--nav-h) - 330px);
    min-height: 380px;
  }
  .lp-players .players {
    max-height: none;
  }
  .lobby {
    padding-bottom: 120px;
  }
  .lobby-start {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: 10px 14px calc(10px + var(--safe-b));
    background: rgba(14, 8, 38, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line-2);
  }
  .lobby-start .btn-xl {
    min-height: 54px;
  }
  .lobby-start .hint {
    margin-top: 6px !important;
  }
  .lobby-start .lobby-wait {
    padding: 10px;
    background: none;
    border: 0;
  }
  .fr-grid {
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .legal-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .legal-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .legal-nav .label {
    display: none;
  }
  .legal-nav a {
    flex: 0 0 auto;
  }
  .legal-nav a.on {
    box-shadow: inset 0 -3px 0 var(--yellow);
  }
  .set-cols {
    grid-template-columns: minmax(0, 1fr);
  }
  .duel-win {
    gap: 14px;
  }
}

@media (max-width: 760px) {
  .page-wide {
    padding-left: 12px;
    padding-right: 12px;
  }
  .lobby-bar {
    padding: 14px 14px 12px;
    gap: 12px;
  }
  .lb-code .code {
    font-size: 34px;
  }
  .lobby-bar .qr-box {
    width: 78px;
    height: 78px;
    flex-basis: 78px;
  }
  .specs {
    gap: 8px;
  }
  .spec {
    padding: 10px 11px;
  }
  .spec b {
    font-size: 15px;
  }
  .specs-hard .specs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .specs-hard .spec {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
    justify-items: center;
    row-gap: 2px;
  }
  .specs-hard .spec .ico {
    grid-row: auto;
  }
  .specs-hard .spec span {
    font-size: 9.5px;
  }
  .specs-hard .spec b {
    font-size: 14px;
  }
  .footer-top,
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  #notifs {
    top: calc(var(--nav-h) + 8px);
    right: 12px;
    left: 12px;
    width: auto;
  }
  .room-pill {
    left: 12px;
    right: 12px;
    bottom: calc(12px + var(--safe-b));
  }
  .room-pill > .ico {
    margin-left: auto;
  }
  .gate {
    grid-template-columns: minmax(0, 1fr);
  }
  .gate-art {
    aspect-ratio: 16 / 8;
  }
  .play-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .fr-grid {
    grid-template-columns: minmax(0, 1fr);
    height: calc(100dvh - var(--nav-h) - 130px);
    min-height: 440px;
  }
  .fr-grid.chat-open .fr-side,
  .fr-grid:not(.chat-open) .fr-chat {
    display: none;
  }
  .fr-back {
    display: inline-flex;
  }
  .fr-head {
    padding: 10px;
    gap: 6px;
  }
  .fr-head-acts .btn-icon:last-child {
    display: none;
  }
  .friends-page .page-head {
    margin-bottom: 12px;
  }
  .fr-side {
    padding: 12px;
  }
  .dw-p {
    width: 42vw;
  }
  .dw-p b {
    font-size: 15px;
  }
  .duel-win {
    padding: 30px 12px 20px;
  }
  .dw-vs {
    font-size: 20px;
  }
  .xp-photo {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-width: none;
  }
  .sum-xp .xp-photo {
    bottom: 52px;
  }
  .xp-thumb {
    width: 120px;
  }
  .xp-meta .xp-score {
    font-size: 22px;
  }
  .final-map {
    height: 58vh;
  }
  .cx-msg {
    max-width: 96%;
  }
}

@media (max-width: 420px) {
  .hide-xs {
    display: none;
  }
  .lb-acts .btn {
    padding: 7px 11px;
  }
}

/* Игра на телефоне: дуэль, реакции, таблица-шторка */
@media (max-width: 760px), (pointer: coarse) and (max-height: 520px) {
  .gs-duelhud {
    top: calc(58px + env(safe-area-inset-top, 0px));
    left: 10px;
    right: 10px;
  }
  .gs.duel .gs-hud {
    display: flex;
  }
  .gs.duel .gs-side {
    top: 128px;
    margin-top: 0;
  }
  .dh,
  .dh.many {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }
  .dh-mid {
    display: none;
  }
  .dh-card,
  .dh-card.big,
  .dh-card.right {
    gap: 7px;
    padding: 5px 9px 6px 5px;
    border-radius: 13px;
  }
  .dh-card.right,
  .dh-card.right.big {
    padding: 5px 5px 6px 9px;
  }
  .dh-card .avf,
  .dh-card .avatar {
    --av: 30px !important;
  }
  .dh-card .dh-name,
  .dh-card.big .dh-name {
    font-size: 12.5px;
  }
  .dh-card .dh-num,
  .dh-card.big .dh-num {
    font-size: 13px;
  }
  .dh-card .dh-bar,
  .dh-card.big .dh-bar {
    height: 9px;
    margin-top: 3px;
  }
  .dh-card.left .dh-check {
    left: 22px;
  }
  .dh-card.right .dh-check {
    right: 22px;
  }
  .dh.many .dh-right .dh-card:nth-child(n + 2) {
    display: none;
  }
  .gs-react {
    bottom: calc(76px + var(--safe-b));
    left: 10px;
  }
  .gs-react-slot,
  .gs-photo.nozoom ~ .gs-react-slot {
    left: 12px;
    bottom: calc(16px + var(--safe-b));
  }
  .rx-btn {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }
  .rx-tray {
    grid-template-columns: repeat(4, 48px);
  }
  /* Реакции всегда слева внизу — под большой палец; кнопки итогов
     сдвигаются вправо, чтобы не перекрываться */
  .gs-result.side .rp-actions {
    padding-left: 60px;
  }
  .dr {
    padding-bottom: calc(76px + var(--safe-b));
  }
  .gs.map-open .gs-react-slot,
  .gs.map-open .gs-react {
    display: none;
  }
  .gs-duelhud .dh-left {
    padding-left: 0;
  }
  .rx-tray button {
    width: 48px;
    height: 48px;
  }
  .gs-splash .inner {
    padding: 20px;
  }
  .gs-splash .inner::before {
    inset: -40px -40px;
  }
  .gs-result.side .gs-result-panel {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 64vh;
    padding: 6px 16px calc(14px + var(--safe-b));
    border-radius: 22px 22px 0 0;
    transform: translateY(40px);
  }
  .gs-result.show.side .gs-result-panel.in {
    transform: none;
  }
  .gs-result.side .rp-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% + 32px);
    margin: 0 -16px 8px;
    padding: 8px 0 6px;
    border: 0;
    background: none;
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
  }
  .gs-result.side .rp-handle i {
    position: absolute;
    top: 6px;
    left: 50%;
    width: 44px;
    height: 4px;
    margin-left: -22px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.25);
  }
  .gs-result.side .rp-handle span {
    margin-top: 6px;
  }
  .gs-result.side .rp-handle .ico {
    margin-top: 6px;
    transition: transform 0.2s;
  }
  .gs-result.side .gs-result-panel.collapsed .rp-list {
    display: none;
  }
  .gs-result.side .gs-result-panel.collapsed .rp-handle .ico {
    transform: rotate(180deg);
  }
  .gs-result.side .mv-zoom {
    right: 10px;
  }
  .dr {
    padding: 58px 10px calc(16px + var(--safe-b));
    justify-content: flex-start;
  }
  .dr-stage {
    gap: 10px;
  }
  .dr-map {
    height: 34vh;
  }
  .dr-card {
    border-width: 2px;
    border-radius: 14px;
  }
  .dr-duo,
  .dr-row {
    grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr);
  }
  .dr-duo {
    margin-top: 2px;
  }
  /* Подпись строки — сверху, значения — под своими игроками */
  .dr-row > span {
    grid-column: 1 / -1;
    grid-row: 1;
    font-size: 9.5px;
    letter-spacing: 0.1em;
  }
  .dr-row .l {
    grid-column: 1;
    grid-row: 2;
  }
  .dr-row .r {
    grid-column: 3;
    grid-row: 2;
  }
  .dr-p {
    gap: 7px;
  }
  .dr-p .avf,
  .dr-p .avatar {
    --av: 38px !important;
  }
  .dr-name {
    font-size: 13px;
  }
  .dr-hp {
    height: 20px;
  }
  .dr-hp-num {
    font-size: 12px;
  }
  .dr-vs {
    font-size: 13px;
    padding: 0;
  }
  .dr-row.score .dr-sc {
    font-size: 32px;
  }
  .dr-list {
    max-height: 40vh;
  }
  .dr-li .dr-sc {
    font-size: 20px;
    min-width: 56px;
  }
  .dr-next-n {
    font-size: 48px;
  }
}


/* ═══════════════ Вторая волна: лобби, заявки, достижения, друзья ═══════════════ */

.lb-top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  margin: -4px 0 -4px;
}

.lb-top .lb-leave {
  min-height: 32px;
  padding: 5px 12px 5px 9px;
  font-size: 12px;
  color: var(--text-2);
}

.lb-top .lb-leave:hover {
  color: #fff;
}

.lock-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  cursor: pointer;
}

.lock-row.ro {
  cursor: default;
}

.lock-row.on {
  background: rgba(255, 138, 31, 0.1);
  border-color: rgba(255, 138, 31, 0.45);
}

.lock-ico {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(123, 92, 255, 0.22);
  color: var(--purple-hi);
}

.lock-row.on .lock-ico {
  background: rgba(255, 138, 31, 0.22);
  color: var(--orange);
}

.lock-txt {
  flex: 1;
  min-width: 0;
}

.lock-txt b {
  display: block;
  font-size: 14px;
}

.lock-txt span {
  font-size: 12px;
  color: var(--text-3);
}

.lock-row .switch {
  padding: 0;
}

.req-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 210, 63, 0.07);
  border: 1px solid rgba(255, 210, 63, 0.35);
  animation: pageIn 0.3s both;
}

.req-list .label {
  margin: 0 2px 2px;
  color: var(--yellow);
}

.req-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.req-row .player-name {
  flex: 1;
}

.join-wait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 0 4px;
  text-align: center;
}

.join-wait b {
  font-size: 17px;
}

.join-wait span {
  font-size: 13px;
  color: var(--text-2);
}

.join-acc-row {
  justify-content: center;
}

.create-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 26px 10px 18px;
  text-align: center;
}

.create-gate .ico-big {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(123, 92, 255, 0.2);
  color: var(--purple-hi);
}

.create-gate b {
  display: block;
  font-size: 18px;
}

.create-gate span {
  color: var(--text-2);
  font-size: 14px;
}

.forfeit-note {
  margin-bottom: 18px;
}

/* ─── Достижения ─── */

.ach-card,
.recent-card {
  display: flex;
  flex-direction: column;
}

.ach-progress {
  height: 8px;
}

.ach-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.ach-mini {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
}

.ach-open,
.recent-open {
  align-self: flex-start;
  margin-top: auto;
}

.ach-card .ach-open {
  margin-top: 18px;
}

.ach-next {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.ach-next-title {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.recent-card .recent-open {
  margin-top: 12px;
}

/* Цвет по сложности: бронза, серебро, золото, легенда */
.ach.t1 .ach-ico,
.ach-mini.t1 {
  background: linear-gradient(180deg, #ffc58f, #c97a3a);
  color: #3a1800;
}

.ach.t2 .ach-ico,
.ach-mini.t2 {
  background: linear-gradient(180deg, #ffffff, #a9b4c8);
  color: #232c3c;
}

.ach.t3 .ach-ico,
.ach-mini.t3 {
  background: linear-gradient(180deg, #ffe066, #f5a91b);
  color: #2a1a00;
}

.ach.t4 .ach-ico,
.ach-mini.t4 {
  background: linear-gradient(180deg, #d8a8ff, #7a2fd0);
  color: #fff;
  box-shadow: 0 0 14px rgba(176, 97, 255, 0.55);
}

.ach.locked .ach-ico {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-3);
  box-shadow: none;
}

.ach-modal .modal {
  width: min(860px, 100%);
}

.ach-group {
  margin-bottom: 18px;
}

.ach-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ach-group-head b {
  font-size: 14px;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  padding-right: 0.1em;
  color: #fff;
}

.ach-group-head span {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-3);
}

.ach-group-head::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #c97a3a;
}

.ach-group-head.t2::before {
  background: #a9b4c8;
}

.ach-group-head.t3::before {
  background: #f5a91b;
}

.ach-group-head.t4::before {
  background: #b061ff;
}

.recent-modal .recent-list {
  max-height: 60vh;
  overflow-y: auto;
}

/* ─── Друзья: каждая строка — отдельная плашка ─── */

.fr-row {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
}

a.fr-row:hover {
  background: rgba(255, 255, 255, 0.085);
}

.fr-row.on {
  border-color: rgba(154, 130, 255, 0.55);
}

.fr-list {
  gap: 6px;
}

.mf-row,
.inv-row {
  border: 1px solid var(--line);
}

/* ─── Телефон: чат лобби — часть страницы ─── */

@media (max-width: 900px) {
  .lobby {
    --start-h: 76px;
  }
  .lobby .lp-chat,
  .final .final-chat {
    height: auto;
    min-height: 0;
    position: static;
  }
  .lobby .lp-chat .cx-list,
  .final .final-chat .cx-list {
    overflow: visible;
    min-height: 120px;
    padding-bottom: 6px;
  }
  .lobby .lp-chat .cx-foot,
  .final .final-chat .cx-foot {
    position: sticky;
    bottom: calc(var(--start-h, 0px) + var(--safe-b));
    z-index: 5;
    margin: 0 -18px -18px;
    padding: 10px 14px 12px;
    background: rgba(24, 14, 60, 0.97);
    border-radius: 0 0 16px 16px;
  }
  .final {
    --start-h: 0px;
  }
  .lobby .cx-more,
  .final .cx-more {
    display: none !important;
  }
}

@media (max-width: 760px) {
  .ach-strip {
    gap: 6px;
  }
  .ach-mini {
    width: 38px;
    height: 38px;
  }
}
