/* ═══════════════════════════════════════════════════════════════
   BR GEO — обновление 2026-11: новые режимы (Прогулка, Угадай город,
   Мастерская, Охота), страница режимов, нижнее меню на телефоне,
   анимации и общий визуальный слой поверх app.css.
   Цвета — те же переменные, что и в app.css (сезонные темы меняют их).
   ═══════════════════════════════════════════════════════════════ */

/* ─── Слои карты: «синие линии», города, точки ─── */

/* Размером с окно карты (не с картой): рисуется только то, что в кадре */
.mv-ov {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.mv-ov path {
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* Издалека «синие линии» тоньше 2 px: квадратные концы и срезанные углы
   выглядят так же, а рисуются вдвое быстрее (точки-одиночки остаются) */
.mv-ov.lo .cov path,
.mv-ov.lo .cov-soft path {
  stroke-linecap: square;
  stroke-linejoin: bevel;
}

.cov .cov-glow {
  stroke: rgba(63, 180, 255, 0.28);
  stroke-width: 7px;
}

.cov .cov-line {
  stroke: #45b8ff;
  stroke-width: 2.4px;
}

.cov-soft .cov-glow {
  stroke: rgba(63, 180, 255, 0.16);
  stroke-width: 5px;
}

.cov-soft .cov-line {
  stroke: rgba(69, 184, 255, 0.75);
  stroke-width: 1.6px;
}

.cities-faint .city-poly {
  fill: rgba(255, 255, 255, 0.025);
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 1.2px;
  stroke-dasharray: 5 5;
}

/* Города в «Угадай город»: на ПК подсвечиваются под курсором */
.cities-pick .city-poly {
  fill: rgba(var(--accent-rgb), 0.07);
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 1.6px;
  transition: fill 0.18s, stroke 0.18s;
}

.cities-pick .city-poly.hover {
  fill: rgba(255, 210, 63, 0.16);
  stroke: rgba(255, 210, 63, 0.85);
}

.cities-pick .city-poly.on {
  fill: rgba(255, 210, 63, 0.32);
  stroke: #ffd23f;
  stroke-width: 3px;
  animation: cityOn 0.5s ease;
}

.city-res .city-poly {
  stroke-width: 3px;
}

.city-res .city-poly.ok {
  fill: rgba(50, 215, 75, 0.3);
  stroke: #32d74b;
  animation: cityOn 0.6s ease;
}

.city-res .city-poly.bad {
  fill: rgba(255, 77, 97, 0.28);
  stroke: #ff4d61;
}

@keyframes cityOn {
  0% {
    fill-opacity: 0;
    stroke-opacity: 0;
  }
  50% {
    fill-opacity: 1.6;
  }
}

/* Подпись города на карте */
.city-tag {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(10, 6, 30, 0.88);
  border: 1.5px solid rgba(255, 210, 63, 0.7);
  color: #ffd23f;
  font-weight: 900;
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.city-tag.ok {
  color: #7dff92;
  border-color: rgba(50, 215, 75, 0.85);
}

.city-tag.bad {
  color: #ff8a97;
  border-color: rgba(255, 77, 97, 0.85);
}

/* Точки Мастерской */
.ws-dots path {
  stroke: #ffd23f;
  stroke-width: 8px;
}

.ws-dots .ws-dots-ring {
  stroke: rgba(10, 6, 30, 0.85);
  stroke-width: 11px;
}

.ws-dots .ws-dots-sel {
  stroke: #ff4d61;
  stroke-width: 13px;
}

.ws-rect rect {
  fill: rgba(255, 210, 63, 0.14);
  stroke: #ffd23f;
  stroke-width: 2px;
  stroke-dasharray: 6 4;
  vector-effect: non-scaling-stroke;
}

/* «Ты здесь» на карте прогулки: точка и конус взгляда */
.pin-me {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
}

.pin-me b {
  position: absolute;
  left: -9px;
  top: -9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffd23f;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55), 0 0 0 0 rgba(255, 210, 63, 0.6);
  animation: meBeat 2s ease-out infinite;
}

.pin-me .pm-cone {
  position: absolute;
  left: -34px;
  top: -34px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: conic-gradient(from -30deg, rgba(255, 210, 63, 0.55), rgba(255, 210, 63, 0) 60deg, transparent 300deg, rgba(255, 210, 63, 0) 300deg);
  -webkit-mask: radial-gradient(circle, #000 35%, transparent 70%);
  mask: radial-gradient(circle, #000 35%, transparent 70%);
  transform-origin: 50% 50%;
}

@keyframes meBeat {
  0% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55), 0 0 0 0 rgba(255, 210, 63, 0.55);
  }
  70% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55), 0 0 0 14px rgba(255, 210, 63, 0);
  }
  100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55), 0 0 0 0 rgba(255, 210, 63, 0);
  }
}

/* ─── Экран прогулки / поиска (RoamScreen) ─── */

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

.rm-pano .pano-cv {
  transition: opacity 0.35s ease, filter 0.6s ease;
}

.rm-pano.jumping .pano-cv {
  opacity: 0.15;
  filter: blur(8px);
}

.rm-shade {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 120px;
  background: linear-gradient(180deg, rgba(5, 3, 13, 0.55), transparent);
  pointer-events: none;
  z-index: 2;
}

.rm-top {
  position: absolute;
  left: 14px;
  right: 14px;
  top: calc(12px + env(safe-area-inset-top, 0px));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.rm-top > * {
  pointer-events: auto;
}

.rm-where {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px 0 11px;
  border-radius: 999px;
  background: rgba(var(--deep-rgb), 0.78);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1.5px rgba(255, 210, 63, 0.35);
  color: #ffd23f;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 13px;
  animation: popIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.rm-hud {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rm-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(var(--deep-rgb), 0.78);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.14);
  font-weight: 800;
  font-size: 13px;
}

.rm-pill b {
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rm-bl {
  position: absolute;
  left: 16px;
  bottom: calc(18px + var(--safe-b));
  z-index: 24;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.rm-bl .gs-snd {
  position: static;
}

.rm-tools {
  display: flex;
  gap: 8px;
}

.rm-tool {
  transition: transform 0.15s, background 0.15s;
}

.rm-tool:hover {
  transform: translateY(-2px);
  background: rgba(var(--surf-rgb), 0.95);
}

.rm-tool.on {
  background: #ffd23f;
  color: #1a0f3d;
}

.rm.selecting .rm-nav,
.rm.selecting .rm-map,
.rm.selecting .rm-map-fab {
  display: none;
}

/* Карта: справа внизу, три размера */
.rm-map {
  position: absolute;
  right: 16px;
  bottom: calc(18px + var(--safe-b));
  z-index: 22;
  width: 330px;
  height: 290px;
  border-radius: 18px;
  overflow: hidden;
  background: #0b0718;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14), 0 14px 40px rgba(0, 0, 0, 0.55);
  transition: width 0.25s ease, height 0.25s ease, box-shadow 0.2s;
}

.rm-map:hover {
  box-shadow: 0 0 0 2px rgba(69, 184, 255, 0.55), 0 14px 40px rgba(0, 0, 0, 0.55);
}

.rm-map.size-2 {
  width: 470px;
  height: 410px;
}

.rm-map.size-3 {
  width: min(680px, calc(100vw - 32px));
  height: min(600px, calc(100vh - 110px));
}

.rm-map.compact {
  width: 280px;
  height: 240px;
}

.rm-map-box {
  position: absolute;
  inset: 0;
  cursor: crosshair;
}

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

.rm-map-tools {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 3;
  display: flex;
  gap: 6px;
}

.rm-map-tools button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: rgba(10, 6, 30, 0.82);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.rm-map-tools button:hover {
  background: rgba(var(--surf-rgb), 1);
}

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

/* Сбоку справа — список (Охота); карта тогда под ним */
.rm-side {
  position: absolute;
  right: 16px;
  top: calc(66px + env(safe-area-inset-top, 0px));
  z-index: 21;
  width: 330px;
  max-height: calc(100% - 66px - 290px - 50px - var(--safe-b));
  display: flex;
  flex-direction: column;
}

.rm-side:empty {
  display: none;
}

.rm-bottom {
  position: absolute;
  left: 50%;
  bottom: calc(22px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  justify-content: center;
}

.rm-bottom:empty {
  display: none;
}

.rm-over {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 3, 13, 0.72);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.25s ease;
}

/* Рамка выделения */
.rm-sel {
  position: absolute;
  inset: 0;
  z-index: 15;
  cursor: crosshair;
  touch-action: none;
  background: rgba(5, 3, 13, 0.12);
}

.rm-sel-box {
  position: absolute;
  border: 2.5px solid #ffd23f;
  border-radius: 6px;
  box-shadow: 0 0 0 9999px rgba(5, 3, 13, 0.5), 0 0 22px rgba(255, 210, 63, 0.5) inset;
  pointer-events: none;
}

.rm-sel-box i {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 3px solid #fff;
}

.rm-sel-box i:nth-child(1) {
  left: -7px;
  top: -7px;
  border-right: 0;
  border-bottom: 0;
}

.rm-sel-box i:nth-child(2) {
  right: -7px;
  top: -7px;
  border-left: 0;
  border-bottom: 0;
}

.rm-sel-box i:nth-child(3) {
  left: -7px;
  bottom: -7px;
  border-right: 0;
  border-top: 0;
}

.rm-sel-box i:nth-child(4) {
  right: -7px;
  bottom: -7px;
  border-left: 0;
  border-top: 0;
}

.rm-sel-hint {
  position: absolute;
  left: 50%;
  top: calc(70px + env(safe-area-inset-top, 0px));
  transform: translateX(-50%);
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(10, 6, 30, 0.88);
  color: #ffd23f;
  font-weight: 800;
  font-size: 14px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.rm-sel-hint:empty {
  display: none;
}

@media (max-width: 760px) {
  .rm-map {
    display: none;
    inset: 0;
    width: auto !important;
    height: auto !important;
    border-radius: 0;
    z-index: 60;
  }

  .rm.map-open .rm-map {
    display: block;
    animation: sheetUp 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
  }

  .rm-map-head {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 12px 16px;
    background: linear-gradient(180deg, rgba(10, 6, 30, 0.96), rgba(10, 6, 30, 0.7));
  }

  .rm-map-head b {
    display: flex;
    align-items: center;
    gap: 6px;
    font-style: italic;
    text-transform: uppercase;
    flex: 0 0 auto;
  }

  .rm-map-head span {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.25;
  }

  .rm-map-x {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    display: grid;
    place-items: center;
  }

  /* «+» и «−» — под шапкой карты, а не под крестиком */
  .rm-map .mv-zoom {
    top: calc(74px + env(safe-area-inset-top, 0px));
  }

  .rm-map-tools {
    display: none;
  }

  .rm-map-fab {
    display: flex;
    position: absolute;
    right: 14px;
    bottom: calc(16px + var(--safe-b));
    z-index: 24;
    gap: 8px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  }

  .rm-side {
    left: 10px;
    right: 10px;
    width: auto;
    top: auto;
    bottom: calc(76px + var(--safe-b));
    max-height: 46vh;
  }

  .rm .gs-nav {
    bottom: calc(40px + var(--safe-b));
  }

  .rm-where {
    font-size: 12px;
    height: 34px;
  }

  .rm-pill {
    height: 34px;
    padding: 0 11px;
  }

  .rm-bl {
    bottom: calc(16px + var(--safe-b));
  }
}

@media (max-width: 429px) {
  .rm-top .gs-exit {
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  .rm-top .gs-exit-t {
    display: none;
  }
}

/* ─── Общие анимации ─── */

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

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

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ─── Шапка страницы режима (Угадай город, Мастерская, Прогулка) ─── */

.mode-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 26px;
  margin: 6px 0 22px;
  padding: 26px 30px;
  border-radius: 26px;
  overflow: hidden;
  background:
    radial-gradient(600px 300px at 15% 0%, rgba(255, 138, 31, 0.28), transparent 70%),
    linear-gradient(135deg, rgba(var(--surf-rgb), 0.9), rgba(var(--panel-rgb), 0.85));
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.08), 0 20px 50px rgba(4, 0, 20, 0.45);
  animation: riseIn 0.5s ease both;
}

.mode-hero .mh-art {
  order: 2;
  min-height: 190px;
  display: grid;
  place-items: center;
}

.mode-hero .mh-art svg {
  width: 100%;
  max-width: 440px;
  height: auto;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.4));
}

.mode-hero .page-title {
  margin: 6px 0 8px;
}

.mh-sub {
  color: var(--text-2);
  font-size: 16px;
  max-width: 520px;
}

.mh-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.hchip.gold {
  background: rgba(255, 210, 63, 0.16);
  color: #ffd23f;
  box-shadow: inset 0 0 0 1.5px rgba(255, 210, 63, 0.4);
}

.mh-city {
  background:
    radial-gradient(520px 280px at 85% 30%, rgba(255, 138, 31, 0.3), transparent 70%),
    linear-gradient(135deg, #2c1a5e, #1a1040);
}

.city-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* Картинка «Угадай город» живёт: окна мигают, метка падает, площадь мерцает */
.art-city .ac-pin {
  animation: acPin 3.6s cubic-bezier(0.3, 1.4, 0.5, 1) infinite;
}

.art-city .ac-area {
  animation: acArea 3.6s ease-in-out infinite;
}

.art-city .ac-win rect {
  animation: acWin 2.8s steps(1) infinite;
}

.art-city .ac-win rect:nth-child(3n) {
  animation-delay: 0.9s;
}

.art-city .ac-win rect:nth-child(3n + 1) {
  animation-delay: 1.7s;
}

@keyframes acPin {
  0%,
  12% {
    transform: translate(160px, 40px);
    opacity: 0;
  }
  28%,
  85% {
    transform: translate(160px, 118px);
    opacity: 1;
  }
  100% {
    transform: translate(160px, 118px);
    opacity: 0;
  }
}

@keyframes acArea {
  0%,
  25% {
    fill-opacity: 0;
    stroke-opacity: 0.3;
  }
  40%,
  85% {
    fill-opacity: 1;
    stroke-opacity: 1;
  }
  100% {
    fill-opacity: 0;
    stroke-opacity: 0.3;
  }
}

@keyframes acWin {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 0.15;
  }
}

/* Итог раунда «Угадай город» */
.cs-res {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cs-res .cs-fire {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.cs-res.ok .cs-fire {
  background: linear-gradient(135deg, #ffd23f, #ff8a1f);
  color: #2a1400;
  animation: firePop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1);
  box-shadow: 0 8px 24px rgba(255, 138, 31, 0.45);
}

.cs-res.bad .cs-fire {
  background: rgba(255, 77, 97, 0.18);
  color: #ff6b7d;
  box-shadow: inset 0 0 0 2px rgba(255, 77, 97, 0.5);
}

.cs-res b {
  display: block;
  font-size: 24px;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  line-height: 1.05;
}

.cs-res.ok b {
  color: #7dff92;
}

.cs-res.bad b {
  color: #ff8a97;
}

.cs-res span {
  color: var(--text-2);
  font-weight: 700;
}

.cs-res em {
  font-style: normal;
  color: #ffd23f;
  font-weight: 900;
}

@keyframes firePop {
  0% {
    transform: scale(0.3) rotate(-20deg);
  }
  100% {
    transform: none;
  }
}

/* Итоги серии */
.cs-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
  align-items: stretch;
  padding: 24px;
  margin-bottom: 18px;
}

.cs-big {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 12px 0 6px;
}

.cs-big-n {
  font-size: clamp(64px, 11vw, 110px);
  font-weight: 900;
  font-style: italic;
  line-height: 0.9;
  background: linear-gradient(180deg, #fff3b0, #ffd23f 45%, #ff8a1f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 18px rgba(255, 138, 31, 0.35));
}

.cs-big-t {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-2);
}

.cs-record {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd23f, #ff8a1f);
  color: #2a1400;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  font-size: 13px;
  animation: popIn 0.5s 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

.cs-xp {
  margin-top: 10px;
  font-weight: 900;
  color: #8ee043;
  font-size: 18px;
}

.cs-actions {
  margin-top: 18px;
}

.cs-map {
  position: relative;
  min-height: 320px;
  border-radius: 18px;
  overflow: hidden;
  background: #0b0718;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.1);
}

.cs-rounds {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.cs-round {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  animation: riseIn 0.35s ease both;
}

.cs-round .n {
  width: 24px;
  color: var(--text-3);
  font-weight: 800;
  font-size: 13px;
}

.cs-round .ic {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.cs-round.ok .ic {
  background: rgba(50, 215, 75, 0.18);
  color: #5ce67a;
}

.cs-round.bad .ic {
  background: rgba(255, 77, 97, 0.18);
  color: #ff6b7d;
}

.cs-round b {
  flex: 1;
  min-width: 0;
}

.cs-round .g {
  color: var(--text-3);
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .mode-hero,
  .cs-hero,
  .city-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .mode-hero {
    padding: 20px 18px;
    gap: 6px;
  }

  .mode-hero .mh-art {
    order: 0;
    min-height: 0;
  }

  .mode-hero .mh-art svg {
    max-width: 320px;
  }

  .mh-sub {
    font-size: 15px;
  }

  .cs-map {
    min-height: 260px;
  }
}

/* ─── Мастерская ─── */

.mh-ws {
  background:
    radial-gradient(520px 280px at 85% 30%, rgba(63, 180, 255, 0.28), transparent 70%),
    linear-gradient(135deg, #1f2a66, #161038);
}

.art-ws .aw-road {
  stroke-dasharray: 420;
  stroke-dashoffset: 420;
  animation: awRoad 4s ease-in-out infinite;
}

.art-ws .aw-dots circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: awDot 4s ease-in-out infinite;
}

.art-ws .aw-dots circle:nth-child(2) {
  animation-delay: 0.25s;
}

.art-ws .aw-dots circle:nth-child(3) {
  animation-delay: 0.5s;
}

.art-ws .aw-dots circle:nth-child(4) {
  animation-delay: 0.75s;
}

.art-ws .aw-dots circle:nth-child(5) {
  animation-delay: 1s;
}

.art-ws .aw-hammer {
  transform-origin: 236px 178px;
  animation: awHammer 2s ease-in-out infinite;
}

@keyframes awRoad {
  0% {
    stroke-dashoffset: 420;
  }
  45%,
  80% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: -420;
  }
}

@keyframes awDot {
  0%,
  20% {
    transform: scale(0);
  }
  35%,
  80% {
    transform: scale(1);
  }
  100% {
    transform: scale(0);
  }
}

@keyframes awHammer {
  0%,
  60%,
  100% {
    transform: translate(236px, 118px) rotate(0deg);
  }
  75% {
    transform: translate(236px, 118px) rotate(-28deg);
  }
  85% {
    transform: translate(236px, 118px) rotate(6deg);
  }
}

.ws-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.ws-tabs {
  flex-wrap: wrap;
}

.ws-tabs .tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ws-search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 240px;
}

.ws-search .ico {
  position: absolute;
  left: 13px;
  color: var(--text-3);
  pointer-events: none;
}

.ws-search .input {
  padding-left: 38px;
  height: 42px;
}

.ws-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.ws-card {
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  color: inherit;
  background: rgba(var(--panel-rgb), 0.72);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.07), 0 10px 26px rgba(4, 0, 20, 0.35);
  transition: transform 0.2s cubic-bezier(0.2, 1.2, 0.4, 1), box-shadow 0.2s;
  animation: riseIn 0.4s ease both;
}

.ws-card:hover {
  color: inherit;
  transform: translateY(-5px);
  box-shadow: inset 0 0 0 1.5px rgba(69, 184, 255, 0.45), 0 18px 36px rgba(4, 0, 20, 0.5);
}

.ws-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #120c2a center / cover no-repeat;
  overflow: hidden;
}

.ws-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 6, 30, 0.25), rgba(10, 6, 30, 0.55));
}

.ws-thumb svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  mix-blend-mode: screen;
}

.ws-thumb rect {
  fill: #ffd23f;
  filter: drop-shadow(0 0 2px #ffb000);
}

.ws-card-b {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ws-name {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-by {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: 13px;
  min-height: 20px;
}

.ws-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
}

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

.ws-meta .liked {
  color: #ff6b8a;
}

.ws-draft {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-3);
  font-size: 11px;
  text-transform: uppercase;
}

.ws-draft.red {
  background: rgba(255, 77, 97, 0.2);
  color: #ff8a97;
}

.ws-empty {
  grid-column: 1 / -1;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 12px;
  color: var(--text-3);
  font-weight: 700;
  font-size: 14px;
}

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

.ws-head {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
  align-items: center;
  margin-bottom: 18px;
  padding: 20px;
}

.ws-head-art .ws-thumb {
  border-radius: 16px;
  aspect-ratio: 1;
}

.ws-desc {
  color: var(--text-2);
  font-size: 15px;
}

.ws-author {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  margin: 4px 0 12px;
}

.ws-author small {
  display: block;
  color: var(--text-3);
  font-size: 12px;
}

.ws-stats {
  display: flex;
  gap: 22px;
  margin-bottom: 14px;
}

.ws-stats b {
  display: block;
  font-size: 24px;
  font-weight: 900;
  font-style: italic;
}

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

.ws-head-acts {
  flex-wrap: wrap;
}

.btn.liked {
  color: #ff6b8a;
  box-shadow: inset 0 0 0 1.5px rgba(255, 107, 138, 0.6);
}

.btn.pulse .ico {
  animation: heartPulse 0.6s cubic-bezier(0.2, 1.8, 0.4, 1);
}

@keyframes heartPulse {
  0% {
    transform: scale(0.5);
  }
  60% {
    transform: scale(1.5);
  }
  100% {
    transform: none;
  }
}

.ws-friends {
  display: flex;
  flex-direction: column;
}

.ws-friends .btn {
  margin-top: auto;
}

/* Редактор */
body.ws-editing .footer {
  display: none;
}

.me-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  padding: 12px 14px 14px;
  height: calc(100vh - var(--nav-h));
  height: calc(100dvh - var(--nav-h));
}

.me-map {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #0b0718;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.1), 0 14px 40px rgba(4, 0, 20, 0.45);
}

.me-mapbox {
  position: absolute;
  inset: 0;
  cursor: crosshair;
}

.me-map.rect-mode .me-mapbox {
  cursor: cell;
}

.me-tools {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 3;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.me-tools .seg {
  background: rgba(10, 6, 30, 0.88);
  backdrop-filter: blur(8px);
}

.seg-ico button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.me-hint {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  max-width: calc(100% - 90px);
  padding: 8px 13px;
  border-radius: 12px;
  background: rgba(10, 6, 30, 0.82);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
}

.me-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: 16px;
  border-radius: 20px;
  background: rgba(var(--panel-rgb), 0.78);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.07);
}

.me-side .field {
  margin: 0;
}

.me-side textarea {
  resize: vertical;
  min-height: 56px;
}

.me-side-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.me-side-head .back-link {
  margin: 0;
}

.me-count {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.me-count b {
  font-size: 30px;
  font-weight: 900;
  font-style: italic;
  margin-right: 8px;
}

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

.me-count .progress {
  margin-top: 8px;
}

.me-count.ok .progress i {
  background: linear-gradient(90deg, #6cc12a, #8ee043);
}

.me-sel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: riseIn 0.3s ease;
}

.me-pano {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background: #05030d;
}

.me-pano.loading .pano-cv {
  opacity: 0.2;
}

.me-edit {
  gap: 8px;
}

@media (max-width: 860px) {
  .ws-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .ws-head-art .ws-thumb {
    aspect-ratio: 16 / 9;
  }

  .me-wrap {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    padding: 8px;
  }

  .me-map {
    height: 62vh;
    height: 62dvh;
  }

  .me-tools .seg-ico span {
    display: none;
  }

  .ws-search {
    min-width: 0;
    flex: 1;
  }
}

/* ─── Охота: поиск ─── */

.hn-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(14, 9, 34, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.1), 0 14px 34px rgba(0, 0, 0, 0.45);
  animation: riseIn 0.4s ease both;
}

.hn-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  background: linear-gradient(135deg, rgba(255, 210, 63, 0.16), rgba(255, 138, 31, 0.08));
  color: #fff;
  cursor: pointer;
  text-align: left;
}

.hn-head-l {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #ffd23f;
}

.hn-head-l b {
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hn-cnt {
  margin-left: auto;
  font-weight: 800;
  color: var(--text-2);
}

.hn-cnt em {
  font-style: normal;
  color: #8ee043;
  font-size: 18px;
}

.hn-cur {
  display: none;
}

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

.hn-list.open .hn-chev {
  transform: rotate(180deg);
}

.hn-words {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  display: none;
}

.hn-list.open .hn-words {
  display: block;
}

.hn-w {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.15s;
}

.hn-w:hover {
  background: rgba(255, 255, 255, 0.06);
}

.hn-w .n {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 900;
}

.hn-w .w {
  flex: 1;
  min-width: 0;
}

.hn-w .re {
  color: var(--text-3);
  opacity: 0;
  transition: opacity 0.15s;
}

.hn-w:hover .re {
  opacity: 1;
}

.hn-w.on {
  background: rgba(255, 210, 63, 0.14);
  box-shadow: inset 0 0 0 1.5px rgba(255, 210, 63, 0.55);
}

.hn-w.on .n {
  background: #ffd23f;
  color: #1a0f3d;
}

.hn-w.done {
  color: var(--text-3);
}

.hn-w.done .w {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.35);
}

.hn-w.done .n {
  background: rgba(50, 215, 75, 0.2);
  color: #5ce67a;
}

.hn-w.done.on .n {
  background: #32d74b;
  color: #062b10;
}

.hn-timer {
  font-variant-numeric: tabular-nums;
}

.hn-timer .hn-t {
  font-size: 17px;
  font-style: normal;
  letter-spacing: 0.02em;
}

.hn-timer.low {
  color: #ff6b7d;
  box-shadow: inset 0 0 0 1.5px rgba(255, 77, 97, 0.6);
  animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
  50% {
    transform: scale(1.06);
  }
}

.hn-done {
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
}

.hn-done-n {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 12px;
  font-style: normal;
}

.hn-sel {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  max-width: min(560px, calc(100vw - 28px));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hn-sel b {
  overflow: hidden;
  text-overflow: ellipsis;
}

.hn-confirm {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.hn-confirm .btn {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.rm-hunt .rm-bottom {
  bottom: calc(26px + var(--safe-b));
}

.rm-hunt.selecting .rm-bl {
  display: none;
}

/* «Найдено!» — вспышка в центре */
.hn-flash {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 50;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 26px;
  border-radius: 22px;
  background: rgba(10, 6, 30, 0.9);
  box-shadow: 0 0 0 2px rgba(50, 215, 75, 0.6), 0 20px 50px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  animation: flashIn 1.7s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.hn-flash span {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #32d74b;
  color: #062b10;
}

.hn-flash b {
  font-size: 18px;
  font-weight: 900;
}

.hn-flash em {
  font-style: italic;
  font-weight: 900;
  color: #5ce67a;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.06em;
}

@keyframes flashIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6);
  }
  15%,
  75% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.95);
  }
}

.hn-wait {
  width: min(460px, 100%);
  text-align: center;
  padding: 26px 22px;
  animation: popIn 0.35s cubic-bezier(0.2, 1.3, 0.4, 1);
}

.hn-wait .ico-big {
  margin: 0 auto 12px;
}

.hn-wait .ico-big.ok {
  background: rgba(50, 215, 75, 0.18);
  color: #5ce67a;
}

.hn-wait p {
  color: var(--text-2);
}

.hn-prog {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 14px 0;
}

.hn-p {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 74px;
  padding: 10px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.hn-p b {
  font-size: 12px;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hn-p span {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 700;
}

.hn-p.done {
  box-shadow: inset 0 0 0 1.5px rgba(50, 215, 75, 0.5);
}

.hn-p.done span {
  color: #5ce67a;
}

@media (max-width: 760px) {
  .hn-cur {
    display: block;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    font-weight: 800;
  }

  .hn-list.open .hn-cur {
    display: none;
  }

  .hn-cnt {
    margin-left: 0;
    order: 3;
  }

  .hn-head .hn-chev {
    order: 4;
  }

  .rm-hunt .rm-side {
    bottom: calc(80px + var(--safe-b));
  }

  .rm-hunt .rm-bottom {
    left: 12px;
    right: 84px;
    transform: none;
    bottom: calc(16px + var(--safe-b));
    justify-content: flex-start;
  }

  .rm-hunt.selecting .rm-bottom {
    right: 12px;
  }

  .hn-sel {
    width: 100%;
    justify-content: center;
    padding: 0 14px;
  }

  .hn-confirm {
    width: 100%;
    flex-wrap: nowrap;
  }

  .hn-confirm .btn {
    flex: 1;
    padding: 0 10px;
    min-width: 0;
  }

  .hn-confirm [data-cancel] {
    flex: 0 0 auto;
  }

  .rm-hunt .rm-hud .hn-done {
    padding: 0 10px;
  }

  .rm-hunt .rm-nav {
    bottom: calc(110px + var(--safe-b));
  }
}

/* ─── Охота: голосование ─── */

.hv {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(800px 400px at 50% -10%, rgba(var(--accent-rgb), 0.3), transparent 70%),
    linear-gradient(180deg, #120a2c, #07040f);
  overflow: hidden;
}

.hv-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 0;
}

.hv-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffd23f;
}

.hv-title b {
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hv-n {
  color: var(--text-2);
  font-weight: 800;
}

.hv-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 10px 16px calc(14px + var(--safe-b));
}

.hv-q {
  font-size: clamp(22px, 3.4vw, 34px);
  font-weight: 900;
  font-style: italic;
  text-align: center;
  line-height: 1.1;
}

.hv-q.in {
  animation: popIn 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.hv-stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: grid;
  place-items: center;
}

.hv-frame {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #05030d;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12), 0 24px 60px rgba(0, 0, 0, 0.55);
}

.hv-pano {
  position: absolute;
  inset: 0;
}

.hv-pano .pano-cv {
  pointer-events: none;
}

.hv-rect {
  position: absolute;
  border: 3px solid #ffd23f;
  border-radius: 6px;
  box-shadow: 0 0 0 9999px rgba(5, 3, 13, 0.45), 0 0 24px rgba(255, 210, 63, 0.6);
  animation: rectIn 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes rectIn {
  from {
    transform: scale(1.35);
    opacity: 0;
  }
}

.hv-load {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.hv-bar {
  width: min(720px, 100%);
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.hv-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8ee043, #ffd23f);
  transition: width 0.1s linear;
}

.hv-bar.low i {
  background: linear-gradient(90deg, #ff4d61, #ff8a1f);
}

.hv-btns {
  display: flex;
  gap: 14px;
  width: min(720px, 100%);
}

.hv-btn {
  flex: 1;
  height: 70px;
  border: 0;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.12s, filter 0.15s, opacity 0.2s;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4), inset 0 -4px 0 rgba(0, 0, 0, 0.2);
}

.hv-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

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

.hv-btn.yes {
  background: linear-gradient(180deg, #8ee043, #4d9416);
}

.hv-btn.no {
  background: linear-gradient(180deg, #ff6b7d, #c92a3f);
}

.hv-btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.hv-btn.picked {
  opacity: 1;
  box-shadow: 0 0 0 4px #fff, 0 10px 26px rgba(0, 0, 0, 0.4);
}

.hv-btn .kbd {
  font-size: 12px;
  font-style: normal;
  opacity: 0.8;
}

.hv-voters {
  display: flex;
  gap: 14px;
  width: min(720px, 100%);
  min-height: 34px;
}

.hv-voters > div {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  min-width: 0;
}

.hv-voters span:first-child {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hv-voters .yes span:first-child {
  color: #8ee043;
}

.hv-voters .no span:first-child {
  color: #ff6b7d;
}

.hv-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.hv-av {
  display: inline-flex;
  animation: popIn 0.3s cubic-bezier(0.2, 1.6, 0.4, 1);
}

.hv-wait {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 20px;
}

@media (max-width: 760px) {
  .hv-btn {
    height: 62px;
    font-size: 19px;
  }

  .hv-voters {
    flex-direction: column;
    gap: 6px;
  }
}

/* ─── Охота: находки в итогах ─── */

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

.hf-item {
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.06);
  animation: riseIn 0.4s ease both;
}

.hf-item.ok {
  box-shadow: inset 0 0 0 1.5px rgba(50, 215, 75, 0.45);
}

.hf-img {
  position: relative;
  background: #05030d;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hf-img canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: var(--loc-fx);
}

.hf-rect {
  position: absolute;
  z-index: 1;
  border: 2px solid #ffd23f;
  border-radius: 4px;
  box-shadow: 0 0 0 9999px rgba(5, 3, 13, 0.35);
}

.hf-cap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 9px 11px 4px;
}

.hf-cap b {
  flex: 1 1 100%;
  font-size: 14px;
}

.hf-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.hf-item.ok .hf-badge {
  background: rgba(50, 215, 75, 0.18);
  color: #5ce67a;
}

.hf-item.bad .hf-badge {
  background: rgba(255, 77, 97, 0.16);
  color: #ff8a97;
}

.hf-mine {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 210, 63, 0.18);
  color: #ffd23f;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.hf-votes {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 11px 11px;
  font-size: 12px;
  font-weight: 800;
}

.hf-votes .y {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #8ee043;
}

.hf-votes .n {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #ff6b7d;
  margin-left: 8px;
}

/* ─── Настройки комнаты: охота, карта ─── */

.mode-pick.modes-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .mode-pick.modes-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .mode-pick.modes-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mode-pick.modes-5 > button:last-child {
    grid-column: 1 / -1;
  }
}

.set-cols.one {
  grid-template-columns: minmax(0, 1fr) !important;
}

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

.stepper button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.stepper button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.stepper b {
  min-width: 40px;
  text-align: center;
  font-size: 24px;
  font-weight: 900;
  font-style: italic;
  color: #ffd23f;
}

.stepper input[type='range'] {
  flex: 1;
  min-width: 140px;
  accent-color: #ffd23f;
}

.map-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  text-align: left;
}

.map-pick b {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-pick:hover {
  box-shadow: inset 0 0 0 1.5px rgba(69, 184, 255, 0.5);
}

.mp-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.mp-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
}

.mp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  text-align: left;
}

.mp-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.mp-row.on {
  box-shadow: inset 0 0 0 1.5px #ffd23f;
}

.mp-all {
  margin-bottom: 8px;
}

.mp-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(69, 184, 255, 0.14);
  color: #45b8ff;
  flex: 0 0 auto;
}

.mp-t {
  flex: 1;
  min-width: 0;
}

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

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

.hv-flat {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: var(--loc-fx);
}

/* ═══ Визуальное обновление: фон, переходы, плитки режимов ═══ */

/* Медленное «северное сияние» за страницами (в игре — нет) */
#app::before {
  content: '';
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38% 32% at 18% 22%, rgba(var(--accent-rgb), 0.22), transparent 70%),
    radial-gradient(30% 26% at 82% 16%, rgba(255, 138, 31, 0.13), transparent 70%),
    radial-gradient(42% 36% at 62% 88%, rgba(63, 180, 255, 0.12), transparent 70%),
    radial-gradient(26% 22% at 8% 80%, rgba(255, 77, 97, 0.08), transparent 70%);
  animation: aurora 28s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes aurora {
  to {
    transform: translate3d(5%, -4%, 0) rotate(9deg) scale(1.06);
  }
}

body.in-game #app::before {
  display: none;
}

/* Страница появляется мягко, плитки — по очереди */
#view > .page {
  animation: pageIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

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

.mt-grid > * {
  animation: riseIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.mt-grid > :nth-child(2) {
  animation-delay: 0.05s;
}

.mt-grid > :nth-child(3) {
  animation-delay: 0.1s;
}

.mt-grid > :nth-child(4) {
  animation-delay: 0.15s;
}

.mt-grid > :nth-child(5) {
  animation-delay: 0.2s;
}

.mt-grid > :nth-child(6) {
  animation-delay: 0.25s;
}

.mt-grid > :nth-child(7) {
  animation-delay: 0.3s;
}

.mt-grid > :nth-child(8) {
  animation-delay: 0.35s;
}

.sec-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 30px 0 14px;
}

.sec-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 24px;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.sec-head h2 .ico {
  color: var(--yellow);
}

.sec-head .btn {
  margin-left: auto;
}

.sec-sub {
  color: var(--text-3);
  font-size: 14px;
  font-weight: 600;
}

/* ─── Плитки режимов ─── */

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

.home-modes .mtile.big {
  grid-column: span 2;
  grid-row: span 2;
}

.mtile {
  --tg: linear-gradient(145deg, #5b3cf0, #2c1a8a);
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 214px;
  padding: 16px 16px 15px;
  border: 0;
  border-radius: 24px;
  overflow: hidden;
  background: var(--tg);
  color: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
  isolation: isolate;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.25s cubic-bezier(0.2, 1.2, 0.4, 1), box-shadow 0.25s, filter 0.2s;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.14), inset 0 -60px 80px -40px rgba(0, 0, 0, 0.35), 0 14px 30px rgba(4, 0, 20, 0.35);
}

.mtile:hover {
  color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.3), inset 0 -60px 80px -40px rgba(0, 0, 0, 0.35), 0 22px 44px rgba(4, 0, 20, 0.5);
}

.mtile:active {
  filter: brightness(0.95);
}

.mtile.busy {
  pointer-events: none;
  filter: brightness(0.8) saturate(0.8);
}

/* Блик под курсором и диагональный отсвет */
.mtile::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(260px circle at var(--gx, 70%) var(--gy, 0%), rgba(255, 255, 255, 0.22), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s;
}

.mtile:hover::before {
  opacity: 1;
}

.mtile::after {
  content: '';
  position: absolute;
  top: -60%;
  left: -40%;
  width: 40%;
  height: 220%;
  z-index: 2;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transform: rotate(20deg) translateX(-150%);
  pointer-events: none;
}

.mtile:hover::after {
  animation: shine 0.9s ease;
}

@keyframes shine {
  to {
    transform: rotate(20deg) translateX(520%);
  }
}

.mt-art {
  position: absolute;
  right: -8px;
  top: -6px;
  width: 66%;
  max-width: 260px;
  z-index: -1;
  transition: transform 0.35s cubic-bezier(0.2, 1.3, 0.4, 1);
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.25));
}

.mtile:hover .mt-art {
  transform: translate(-4px, 4px) scale(1.05) rotate(-2deg);
}

.mtile.big .mt-art {
  width: 74%;
  max-width: 470px;
  right: -10px;
  top: 10px;
}

.mt-art svg {
  display: block;
  width: 100%;
  height: auto;
}

.mt-body {
  position: relative;
  z-index: 1;
}

.mt-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.mt-top > .ico {
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  box-sizing: border-box;
}

.mt-new {
  padding: 3px 9px;
  border-radius: 999px;
  background: #ffd23f;
  color: #2a1400;
  font-size: 11px;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 0 0 0 rgba(255, 210, 63, 0.7);
  animation: newPulse 2.4s ease-out infinite;
}

@keyframes newPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 210, 63, 0.65);
  }
  70%,
  100% {
    box-shadow: 0 0 0 10px rgba(255, 210, 63, 0);
  }
}

.mt-done {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.mtile h3 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.02;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.mtile.big h3 {
  font-size: clamp(30px, 3.4vw, 44px);
}

.mtile p {
  margin: 0;
  max-width: 92%;
  font-size: 13.5px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.9);
}

.mtile.big p {
  font-size: 15.5px;
  max-width: 70%;
}

.mt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.mt-tag {
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.mt-go {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: #1a0f3d;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s cubic-bezier(0.2, 1.6, 0.4, 1);
}

.mtile:hover .mt-go {
  transform: translateX(3px) scale(1.08);
}

.mtile.locked {
  filter: grayscale(0.85) brightness(0.7);
  cursor: not-allowed;
}

/* Цвета плиток */
.mtile.c-green {
  --tg: radial-gradient(120% 90% at 85% 0%, #9be15d, transparent 55%), linear-gradient(150deg, #48b02c, #1d6b2a);
}

.mtile.c-orange {
  --tg: radial-gradient(120% 90% at 85% 0%, #ffb35c, transparent 55%), linear-gradient(150deg, #ff7a1a, #b8381c);
}

.mtile.c-gold {
  --tg: radial-gradient(120% 90% at 85% 0%, #ffe58a, transparent 55%), linear-gradient(150deg, #f0a91e, #b5620e);
}

.mtile.c-teal {
  --tg: radial-gradient(120% 90% at 85% 0%, #5ee6d6, transparent 55%), linear-gradient(150deg, #13a99b, #0d4f73);
}

.mtile.c-yellow {
  --tg: radial-gradient(120% 90% at 85% 0%, #fff07a, transparent 55%), linear-gradient(150deg, #f2b705, #c96a00);
}

.mtile.c-blue {
  --tg: radial-gradient(120% 90% at 85% 0%, #7cc4ff, transparent 55%), linear-gradient(150deg, #2f7cf6, #2232a8);
}

.mtile.c-purple {
  --tg: radial-gradient(120% 90% at 85% 0%, #b9a4ff, transparent 55%), linear-gradient(150deg, #7b5cff, #3a1fb0);
}

.mtile.c-pink {
  --tg: radial-gradient(120% 90% at 85% 0%, #ffa6e1, transparent 55%), linear-gradient(150deg, #f04fb0, #8a2bd6);
}

.mtile.c-red {
  --tg: radial-gradient(120% 90% at 85% 0%, #ff9aa6, transparent 55%), linear-gradient(150deg, #f0384f, #8f1233);
}

.mtile.c-slate {
  --tg: radial-gradient(120% 90% at 85% 0%, #aab6d3, transparent 55%), linear-gradient(150deg, #66739a, #2e3550);
}

.mtile.c-lime {
  --tg: radial-gradient(120% 90% at 85% 0%, #d4ff7a, transparent 55%), linear-gradient(150deg, #5cc23a, #137a5a);
}

/* Быстрые режимы — плитки поменьше */
.mt-grid.g-fun {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.g-fun .mtile {
  min-height: 168px;
  padding: 13px 13px 12px;
  border-radius: 20px;
}

.g-fun .mtile h3 {
  font-size: 18px;
}

.g-fun .mtile p {
  font-size: 12.5px;
}

.g-fun .mt-art {
  width: 78%;
  right: -10px;
  top: -10px;
}

.g-fun .mt-go {
  width: 32px;
  height: 32px;
}

.g-fun .mt-tag {
  font-size: 11px;
  padding: 4px 9px;
}

/* Страница режимов */
.mode-sec {
  margin-bottom: 30px;
}

.mode-sec-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.mode-sec-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
}

.mode-sec-head span {
  color: var(--text-3);
  font-size: 14px;
  font-weight: 600;
}

.mt-grid.g-solo .mtile.big {
  grid-column: span 2;
}

.mt-grid.g-multi {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.mt-grid.g-community {
  grid-template-columns: minmax(0, 1fr);
}

.g-community .mtile {
  min-height: 170px;
}

.g-community .mt-art {
  width: 40%;
  max-width: 330px;
}

/* Анимации картинок режимов */
.mtile:hover .ma-pin,
.mtile:focus-visible .ma-pin {
  animation: pinHop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.ma-pin {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

@keyframes pinHop {
  40% {
    translate: 0 -10px;
  }
}

.ma-flag {
  animation: flagBob 3s ease-in-out infinite;
}

@keyframes flagBob {
  50% {
    translate: 0 -4px;
  }
}

.ma-dash {
  stroke-dashoffset: 0;
  animation: dashMove 1.2s linear infinite;
}

@keyframes dashMove {
  to {
    stroke-dashoffset: -24;
  }
}

.ma-win rect {
  animation: acWin 2.6s steps(1) infinite;
}

.ma-win rect:nth-child(odd) {
  animation-delay: 1.1s;
}

.ma-area {
  animation: acArea 4s ease-in-out infinite;
}

.ma-needle {
  transform-box: view-box;
  transform-origin: 100px 74px;
  animation: needle 5s ease-in-out infinite;
}

@keyframes needle {
  0%,
  100% {
    rotate: -18deg;
  }
  50% {
    rotate: 24deg;
  }
}

.ma-route {
  animation: dashMove 1.4s linear infinite;
}

.ma-hand {
  transform-box: view-box;
  transform-origin: 100px 80px;
  animation: hand 2s steps(8) infinite;
}

@keyframes hand {
  to {
    rotate: 360deg;
  }
}

.ma-bolt {
  animation: boltFlash 2.2s ease-in-out infinite;
}

@keyframes boltFlash {
  0%,
  70%,
  100% {
    opacity: 1;
  }
  80% {
    opacity: 0.3;
  }
}

.ma-run {
  animation: dashMove 1s linear infinite;
}

.ma-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 3.4s ease-in-out infinite;
}

@keyframes blink {
  0%,
  92%,
  100% {
    scale: 1 1;
  }
  95% {
    scale: 1 0.1;
  }
}

.ma-fogs {
  animation: fogDrift 6s ease-in-out infinite alternate;
}

@keyframes fogDrift {
  to {
    translate: 14px 0;
  }
}

.ma-bubble {
  animation: flagBob 2.6s ease-in-out infinite;
}

.ma-frame {
  animation: framePulse 1.8s ease-in-out infinite;
}

@keyframes framePulse {
  50% {
    opacity: 0.45;
  }
}

.ma-glass {
  animation: glass 3.2s ease-in-out infinite;
}

@keyframes glass {
  50% {
    translate: -16px -8px;
  }
}

.ma-sw1,
.ma-sw2 {
  transform-box: view-box;
}

.mtile:hover .ma-sw1 {
  animation: clashL 0.5s ease;
}

.mtile:hover .ma-sw2 {
  animation: clashR 0.5s ease;
}

@keyframes clashL {
  50% {
    translate: -6px 0;
  }
}

@keyframes clashR {
  50% {
    translate: 6px 0;
  }
}

.ma-hp {
  animation: hpDrain 3s ease-in-out infinite;
}

@keyframes hpDrain {
  0%,
  100% {
    width: 30px;
  }
  50% {
    width: 12px;
  }
}

.ma-flame {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: flame 1.2s ease-in-out infinite alternate;
}

@keyframes flame {
  to {
    scale: 1.04 0.95;
  }
}

.ma-cup {
  animation: flagBob 3s ease-in-out infinite;
}

.ma-hammer {
  transform-box: view-box;
  transform-origin: 162px 140px;
  animation: hammerHit 2.2s ease-in-out infinite;
}

@keyframes hammerHit {
  0%,
  60%,
  100% {
    rotate: 0deg;
  }
  75% {
    rotate: -24deg;
  }
  85% {
    rotate: 5deg;
  }
}

.ma-dots circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: awDot 4s ease-in-out infinite;
}

.ma-dots circle:nth-child(2) {
  animation-delay: 0.3s;
}

.ma-dots circle:nth-child(3) {
  animation-delay: 0.6s;
}

.ma-dots circle:nth-child(4) {
  animation-delay: 0.9s;
}

.ma-cal {
  animation: flagBob 3.4s ease-in-out infinite;
}

.ma-spark path {
  transform-box: fill-box;
  transform-origin: center;
  animation: maSpark 2s ease-in-out infinite;
}

.ma-spark path:nth-child(2) {
  animation-delay: 1s;
}

@keyframes maSpark {
  50% {
    scale: 0.4;
    opacity: 0.4;
  }
}

.ma-glint path {
  transform-box: fill-box;
  transform-origin: center;
  animation: maSpark 1.6s ease-in-out infinite;
}

/* Главная: Мастерская и «как играть» */
.hws-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hws-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 14px;
  color: inherit;
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.15s, transform 0.15s;
}

.hws-row:hover {
  color: inherit;
  background: rgba(255, 255, 255, 0.07);
  transform: translateX(3px);
}

.hws-row .ws-thumb {
  width: 84px;
  flex: 0 0 auto;
  border-radius: 10px;
  aspect-ratio: 4 / 3;
}

.hws-t {
  flex: 1;
  min-width: 0;
}

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

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

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

.how-card {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
}

.how-card .how-steps {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

/* ─── Шапка: пункты меню всегда в одну строку ───
   На ширине ~900–1200 px подписи переносились («С / друзьями»). Теперь
   шапка сжимается по шагам: плотнее отступы → кнопка профиля без ника →
   пункты без иконок; уже 900 px — бургер (app.css) */
.nav-links a {
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-fit-1 .nav-inner {
  gap: 12px;
}

.nav-fit-1 .nav-links {
  margin-left: 2px;
  gap: 2px;
}

.nav-fit-1 .nav-links a {
  padding: 8px 10px;
  gap: 6px;
}

.nav-fit-1 .nav-right {
  gap: 6px;
}

.nav-fit-1 .nav-online span,
.nav-fit-2 .nav-user-name,
.nav-fit-2 .nav-chev,
.nav-fit-3 .nav-links a .ico {
  display: none;
}

.nav-fit-2 .nav-user {
  gap: 0;
  padding: 3px;
}

.nav-fit-3 .nav-links a {
  padding: 8px 9px;
}

/* ─── Нижнее меню на телефоне ───
   Плавающая «капсула» из стекла над контентом. Активный раздел — жёлтая
   иконка на подсвеченной плашке, плашка переезжает между разделами
   (--i — номер активного, ставит app.js). Профиль — круглая аватарка
   без рамки уровня: на 26 px рамка превращалась в мутное кольцо */

#tabbar {
  display: none;
}

@media (max-width: 760px) {
  #tabbar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(8px + var(--safe-b));
    z-index: 55;
    display: flex;
    height: 64px;
    padding: 0 4px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(var(--deep-rgb), 0.9), rgba(var(--deep-rgb), 0.97));
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  }

  #tabbar a {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    padding-top: 8px;
    color: var(--text-3);
    font-size: 10.5px;
    font-weight: 800;
    line-height: 14px;
    letter-spacing: -0.01em;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s;
  }

  #tabbar .tb-ic {
    position: relative;
    display: grid;
    place-items: center;
    width: 52px;
    height: 30px;
    transition: transform 0.3s cubic-bezier(0.2, 1.5, 0.4, 1);
  }

  #tabbar a:active .tb-ic {
    transform: scale(0.88);
  }

  #tabbar .tb-l {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #tabbar a.active {
    color: #fff;
  }

  #tabbar a.active .ico {
    color: var(--yellow);
    filter: drop-shadow(0 2px 8px rgba(255, 200, 50, 0.45));
  }

  #tabbar .tb-ind {
    position: absolute;
    left: 4px;
    top: 8px;
    width: calc((100% - 8px) / 5);
    height: 30px;
    opacity: 0;
    transform: translateX(calc(var(--i, 0) * 100%));
    transition: transform 0.42s cubic-bezier(0.3, 1.3, 0.5, 1), opacity 0.2s;
    pointer-events: none;
  }

  #tabbar.has-active .tb-ind {
    opacity: 1;
  }

  #tabbar .tb-ind::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 56px;
    height: 30px;
    margin-left: -28px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 210, 63, 0.26), rgba(255, 160, 40, 0.12));
    box-shadow: inset 0 0 0 1px rgba(255, 210, 63, 0.38), 0 4px 16px rgba(255, 180, 40, 0.22);
  }

  #tabbar .tb-me .avatar {
    --av: 26px;
    font-size: 11px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
    transition: box-shadow 0.2s;
  }

  #tabbar a.active .tb-me .avatar {
    box-shadow: 0 0 0 2px var(--yellow), 0 0 14px rgba(255, 210, 63, 0.5);
  }

  .tb-badge {
    position: absolute;
    top: -3px;
    right: 6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px rgba(var(--deep-rgb), 0.95);
  }

  body:not(.in-game) #app {
    padding-bottom: calc(82px + var(--safe-b));
  }

  body.in-game #tabbar,
  body.ws-editing #tabbar {
    display: none;
  }

  .toast-wrap,
  #toasts {
    bottom: calc(84px + var(--safe-b));
  }

  body:not(.in-game) .room-pill.tour-call.show {
    bottom: calc(84px + var(--safe-b));
  }
}

/* Узкие телефоны (360–400 px): «С друзьями» и «Мастерская» не слипаются */
@media (max-width: 400px) {
  #tabbar {
    left: 8px;
    right: 8px;
    padding: 0 2px;
  }

  #tabbar a {
    font-size: 9.8px;
  }

  #tabbar .tb-ind {
    left: 2px;
    width: calc((100% - 4px) / 5);
  }
}

/* ─── Адаптив плиток ─── */

@media (max-width: 1180px) {
  .mt-grid.g-fun {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mt-grid.g-multi {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .mt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-modes .mtile.big {
    grid-row: auto;
  }

  .how-card {
    flex-direction: column;
    align-items: stretch;
  }

  .how-card .how-steps {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .mt-grid {
    gap: 10px;
  }

  .mtile {
    min-height: 178px;
    padding: 13px;
    border-radius: 20px;
  }

  .mtile h3 {
    font-size: 18px;
  }

  .mtile p {
    font-size: 12.5px;
    max-width: 100%;
  }

  .mtile.big {
    min-height: 220px;
  }

  .mtile.big h3 {
    font-size: 30px;
  }

  .mtile.big p {
    max-width: 85%;
    font-size: 14px;
  }

  .mt-go {
    width: 32px;
    height: 32px;
  }

  .mt-tag {
    font-size: 10.5px;
    padding: 4px 8px;
  }

  .mt-grid.g-fun,
  .mt-grid.g-multi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .g-fun .mtile {
    min-height: 140px;
  }

  .g-multi .mtile:last-child:nth-child(odd) {
    grid-column: span 2;
  }

  .sec-head {
    margin: 22px 0 10px;
  }

  .sec-head h2 {
    font-size: 20px;
  }

  .sec-sub {
    display: none;
  }

  .g-community .mt-art {
    width: 56%;
  }
}

@media (prefers-reduced-motion: reduce) {
  #app::before,
  #view > .page,
  .mt-grid > *,
  .ma,
  .ma * {
    animation: none !important;
  }
}

/* Картинка плитки уходит в прозрачность к тексту — подпись всегда читается */
.mt-art {
  -webkit-mask-image: linear-gradient(180deg, #000 52%, rgba(0, 0, 0, 0.15) 82%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 52%, rgba(0, 0, 0, 0.15) 82%, transparent 100%);
}

.mtile:not(.big) .mt-art {
  width: 58%;
  top: -10px;
}

.g-fun .mtile .mt-art {
  width: 66%;
  top: -14px;
}

.mtile.big .mt-art {
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
}

.mtile h3,
.mtile p {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 14px rgba(0, 0, 0, 0.3);
}

.home-ws {
  display: flex;
  flex-direction: column;
}

.home-ws #home-ws {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hws-new {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding: 14px;
  border-radius: 16px;
  color: inherit;
  background: linear-gradient(135deg, rgba(63, 180, 255, 0.16), rgba(var(--accent-rgb), 0.16));
  box-shadow: inset 0 0 0 1.5px rgba(63, 180, 255, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.hws-new:hover {
  color: inherit;
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1.5px rgba(63, 180, 255, 0.7);
}

.hws-new-ico {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #45b8ff;
  color: #06203a;
  flex: 0 0 auto;
}

.hws-new b {
  display: block;
}

.hws-new small {
  color: var(--text-2);
  font-size: 13px;
}

/* Одиночные на странице режимов: Классика шире, остальное — в один ряд */
.mt-grid.g-solo {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.g-solo .mtile.big .mt-art {
  width: 50%;
  top: -14px;
}

@media (max-width: 1180px) {
  .mt-grid.g-solo {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mt-grid.g-solo .mtile.big {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .mt-grid.g-solo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .g-solo .mtile.big .mt-art {
    width: 62%;
  }
}

/* ─── Стикеры ─── */

.stk {
  display: inline-block;
  line-height: 0;
}

.stk-svg {
  overflow: visible;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}

/* Сообщение-стикер: без «пузыря», крупно, с пружинкой при появлении */
.cx-bubble.jumbo:has(.stk) {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  padding: 0 4px !important;
}

.cx-bubble.jumbo:has(.stk) .cx-time {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(10, 6, 30, 0.6);
}

/* Только эмодзи — крупно и без «пузыря» с обеих сторон: у своих
   сообщений фиолетовый фон перебивал .jumbo (правило .mine сильнее) */
.cx-msg.mine .cx-bubble.jumbo {
  background: none;
  border-color: transparent;
}

.cx-bubble.jumbo:not(:has(.stk)) .cx-time {
  display: table;
  margin: 3px 0 0 auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(10, 6, 30, 0.6);
}

.cx-new .stk-svg {
  animation: stkIn 0.55s cubic-bezier(0.2, 1.6, 0.4, 1);
}

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

/* Выбор: вкладки «Эмодзи / Стикеры» */
.cx-pick {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  max-height: 320px !important;
  overflow: hidden !important;
}

.cx-pick-tabs {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.cx-pick-tabs button {
  flex: 1;
  height: 34px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--text-2);
  font-weight: 800;
  font-size: 13px;
}

.cx-pick-tabs button.on {
  background: rgba(255, 210, 63, 0.18) !important;
  color: #ffd23f;
  box-shadow: inset 0 0 0 1.5px rgba(255, 210, 63, 0.5);
}

.cx-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 4px;
  overflow-y: auto;
  min-height: 0;
}

.cx-pick-grid.stk-grid {
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
}

.stk-grid button {
  height: 82px !important;
}

.stk-grid button:hover .stk-svg {
  transform: scale(1.08) rotate(-4deg);
}

.stk-grid .stk-svg {
  transition: transform 0.2s cubic-bezier(0.2, 1.6, 0.4, 1);
}

/* Реакции в игре: ряд эмодзи и ряд стикеров */
.rx-tray {
  display: flex !important;
  flex-direction: column;
  gap: 6px;
  max-width: min(440px, calc(100vw - 30px));
}

.rx-row {
  display: grid;
  grid-template-columns: repeat(6, 52px);
  gap: 4px;
}

.rx-row.rx-stk {
  grid-template-columns: repeat(6, 64px);
  max-height: 150px;
  overflow-y: auto;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.rx-stk button {
  width: 64px !important;
  height: 64px !important;
}

@media (max-width: 560px) {
  .rx-row {
    grid-template-columns: repeat(6, 44px);
  }

  .rx-row button {
    width: 44px !important;
    height: 44px !important;
  }

  .rx-row.rx-stk {
    grid-template-columns: repeat(5, 56px);
  }

  .rx-stk button {
    width: 56px !important;
    height: 56px !important;
  }
}

/* Летящая реакция-стикер — крупнее и с пружинкой */
.rx-emo .stk-svg {
  width: 84px;
  height: 84px;
  margin: -24px -10px -20px -6px;
  animation: stkIn 0.6s cubic-bezier(0.2, 1.6, 0.4, 1);
}

/* Анимации стикеров */
.stk-svg.anim .st-body {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.st-bob .st-body {
  animation: stBob 1.6s ease-in-out infinite;
}

@keyframes stBob {
  50% {
    transform: translateY(-4px) scale(1.02, 0.98);
  }
}

.st-shake .st-body {
  animation: stShake 0.9s ease-in-out infinite;
}

@keyframes stShake {
  25% {
    transform: rotate(-6deg);
  }
  75% {
    transform: rotate(6deg);
  }
}

.st-zoom .st-cross {
  transform-box: fill-box;
  transform-origin: center;
  animation: stZoom 1.4s ease-in-out infinite;
}

@keyframes stZoom {
  50% {
    transform: scale(0.82) rotate(45deg);
  }
}

.st-tilt .st-body {
  animation: stTilt 2.2s ease-in-out infinite;
}

@keyframes stTilt {
  30% {
    transform: rotate(-9deg);
  }
  70% {
    transform: rotate(7deg);
  }
}

.st-sob .st-tear,
.st-laugh .st-tear {
  animation: stTear 0.9s ease-in infinite;
}

.st-sob .st-d2,
.st-laugh .st-d2 {
  animation-delay: 0.45s;
}

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

.st-laugh .st-body {
  animation: stLaugh 0.5s ease-in-out infinite;
}

@keyframes stLaugh {
  50% {
    transform: translateY(-3px) rotate(-3deg);
  }
}

.st-cringe .st-body {
  animation: stCringe 1.8s ease-in-out infinite;
}

@keyframes stCringe {
  40%,
  60% {
    transform: scale(0.92, 1.04) translateX(-2px);
  }
}

.st-tap .st-hand {
  transform-box: view-box;
  transform-origin: 92px 20px;
  animation: hand 2s steps(8) infinite;
}

.st-pop .st-star {
  transform-box: fill-box;
  transform-origin: center;
  animation: maSpark 0.9s ease-in-out infinite;
}

.st-pop .st-d2 {
  animation-delay: 0.45s;
}

.st-wave .st-hand2 {
  transform-box: fill-box;
  transform-origin: 30% 100%;
  animation: stWave 0.9s ease-in-out infinite;
}

@keyframes stWave {
  50% {
    transform: rotate(18deg);
  }
}

.st-scream .st-body {
  animation: stShake 0.25s linear infinite;
}

.st-crown {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: stBob 1.2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .stk-svg *,
  .stk-svg {
    animation: none !important;
  }
}

/* Итоги игры: «Попробуй ещё» */
.sum-next {
  margin-top: 16px;
}

.sum-next-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--yellow);
}

.sum-next-head b {
  color: #fff;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.mt-grid.g-fun.sum-next-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 560px) {
  .mt-grid.g-fun.sum-next-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sum-next-grid .mtile {
    min-height: 120px;
  }
}

/* Узкий телефон: шапка режима без картинки — кнопки сразу на первом экране */
@media (max-width: 560px) {
  .mode-hero .mh-art {
    display: none;
  }

  .mode-hero {
    padding: 18px 16px;
    margin-bottom: 14px;
  }

  .mh-chips {
    gap: 6px;
  }

  .mh-chips .hchip {
    font-size: 12px;
  }
}

/* Значок в карточках ожидания (охота) — круг, как в пустых состояниях */
.hn-wait .ico-big {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: rgba(var(--accent-rgb), 0.2);
  color: var(--purple-hi);
}

@media (max-width: 760px) {
  /* Верхняя строка охоты: город не показываем, «Я всё» — компактно */
  .rm-hunt .rm-where {
    display: none;
  }

  .rm-hunt .rm-top {
    gap: 8px;
  }

  .rm-hunt .hn-done {
    height: 36px;
    padding: 0 11px;
    gap: 6px;
  }

  /* «Карта» в охоте — круглой кнопкой, чтобы не мешать «Выделить» */
  .rm-hunt .rm-map-fab {
    width: 52px;
    height: 52px;
    padding: 0;
    justify-content: center;
    border-radius: 16px;
  }

  .rm-hunt .rm-map-fab span {
    display: none;
  }

  .rm-hunt .rm-bottom {
    right: 76px;
  }

  .rm-hunt .rm-bottom > * {
    max-width: 100%;
    min-width: 0;
  }

  .hn-sel,
  .hn-confirm [data-accept] {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
  }

  .hn-sel .ico,
  .hn-confirm [data-accept] .ico {
    vertical-align: -4px;
    margin-right: 4px;
  }
}

.hf-img {
  aspect-ratio: 3 / 2;
}

/* ─── Задания дня ─── */

.home-me {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.home-me > .me-strip {
  margin: 0;
}

.quests {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background:
    radial-gradient(420px 160px at 100% 0%, rgba(255, 210, 63, 0.14), transparent 70%),
    rgba(var(--panel-rgb), 0.72);
}

.quests.all {
  box-shadow: inset 0 0 0 1.5px rgba(50, 215, 75, 0.45);
}

.q-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.q-head .card-title {
  margin: 0;
}

.q-cnt {
  font-weight: 800;
  color: var(--text-2);
}

.q-cnt em {
  font-style: normal;
  color: #8ee043;
  font-size: 17px;
}

.q-reset {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

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

.q-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.q-ico {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(255, 210, 63, 0.14);
  color: #ffd23f;
}

.q-row.done .q-ico {
  background: #32d74b;
  color: #062b10;
  animation: popIn 0.4s cubic-bezier(0.2, 1.6, 0.4, 1);
}

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

.q-body b {
  display: block;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.q-row.done .q-body b {
  color: var(--text-3);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.3);
}

.q-bar {
  height: 5px;
  margin-top: 5px;
}

.q-row.done .q-bar i {
  background: linear-gradient(90deg, #32d74b, #8ee043);
}

.q-xp {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  color: #ffd23f;
  font-variant-numeric: tabular-nums;
}

.q-row.done .q-xp {
  color: #5ce67a;
}

.q-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: 12.5px;
}

.q-foot b {
  color: #ffd23f;
}

.q-notify .q-n-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #32d74b;
  color: #062b10;
}

.q-notify.all .q-n-ico {
  background: linear-gradient(135deg, #ffd23f, #ff8a1f);
  color: #2a1400;
}

.q-notify b + span b {
  color: #ffd23f;
}

@media (max-width: 980px) {
  .home-me {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Профиль — на всю ширину, задания под ним в три колонки */
.home-me {
  grid-template-columns: minmax(0, 1fr);
}

.quests .q-head {
  flex-wrap: wrap;
}

.quests .q-foot {
  margin-left: auto;
}

@media (min-width: 900px) {
  .quests {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: 'head foot' 'list list';
    align-items: center;
  }

  .quests .q-head {
    grid-area: head;
  }

  .quests .q-foot {
    grid-area: foot;
  }

  .quests .q-list {
    grid-area: list;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* «Синие линии» тоньше на всей карте и толще при приближении */
.cov .cov-glow {
  stroke-width: min(7px, calc(1.6px + 0.9px * var(--z, 1)));
  stroke: rgba(63, 180, 255, calc(0.12 + 0.03 * var(--z, 1)));
}

.cov .cov-line {
  stroke-width: min(2.6px, calc(0.7px + 0.32px * var(--z, 1)));
}

.cov-soft .cov-glow {
  stroke-width: min(5px, calc(1.2px + 0.7px * var(--z, 1)));
}

.cov-soft .cov-line {
  stroke-width: min(1.8px, calc(0.6px + 0.22px * var(--z, 1)));
}

/* Реакции в голосовании Охоты: кнопка — слева вверху, стикеры — слева */
.hv .hv-react-slot {
  left: 14px;
  top: calc(66px + env(safe-area-inset-top, 0px));
  bottom: auto;
}

.hv .hv-react-slot .rx-tray {
  top: calc(100% + 10px);
  bottom: auto;
  transform-origin: top left;
}

.hv .hv-react-pops {
  left: 14px;
  top: calc(130px + env(safe-area-inset-top, 0px));
  bottom: auto;
}

@media (max-width: 760px) {
  .hv .hv-react-slot {
    top: auto;
    bottom: calc(150px + var(--safe-b));
  }

  .hv .hv-react-slot .rx-tray {
    top: auto;
    bottom: calc(100% + 10px);
    transform-origin: bottom left;
  }

  .hv .hv-react-pops {
    top: auto;
    bottom: calc(210px + var(--safe-b));
  }
}

/* Пять режимов комнаты — в ряд (старое правило растягивало последнюю карточку) */
.mode-pick.modes-5 > button:last-child:nth-child(odd) {
  grid-column: auto;
}

.mode-pick.modes-5 button {
  padding: 13px 14px;
}

@media (max-width: 1100px) {
  .mode-pick.modes-5 > button:last-child {
    grid-column: span 1;
  }
}

@media (max-width: 560px) {
  .mode-pick.modes-5 > button:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .mode-pick.modes-5 button {
    padding: 11px 12px;
  }

  .mode-pick.modes-5 b {
    font-size: 13.5px;
    gap: 6px;
  }

  .mode-pick.modes-5 span {
    font-size: 12px;
  }
}

/* Соперники в охоте: аватарки и сколько нашли */
.hn-rivals {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(var(--deep-rgb), 0.7);
  backdrop-filter: blur(8px);
}

.hn-rv {
  position: relative;
  display: inline-flex;
}

.hn-rv b {
  position: absolute;
  right: -5px;
  bottom: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ffd23f;
  color: #1a0f3d;
  font-size: 11px;
  font-weight: 900;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(10, 6, 30, 0.9);
}

.hn-rv.done b {
  background: #32d74b;
  color: #062b10;
}

@media (max-width: 760px) {
  .hn-rivals {
    display: none;
  }
}

/* Режимы комнаты: перенос по ширине карточки (в лобби колонка уже, чем при
   создании) — плитки растягиваются и заполняют строки без дыр */
.mode-pick.modes-5 {
  display: flex !important;
  flex-wrap: wrap;
}

.mode-pick.modes-5 > button {
  flex: 1 1 150px;
  min-width: 0;
}

.mode-pick.modes-5 > button:last-child:nth-child(odd) {
  grid-column: auto;
}

@media (max-width: 560px) {
  .mode-pick.modes-5 > button {
    flex-basis: 40%;
  }
}

/* «Угадай город», итоги: название сверху, подробность — под ним */
.cs-round .t {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.cs-round .t b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-round .t .g {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Страница режимов на планшете/телефоне: последняя одиночная плитка — на всю строку */
@media (max-width: 980px) {
  .mt-grid.g-solo .mtile:last-child:nth-child(even) {
    grid-column: 1 / -1;
  }
}

/* Стикер, выпрыгивающий из карточки игрока, — небольшой (не закрывает ник) */
.rx-burst .stk-svg {
  width: 40px;
  height: 40px;
}

/* Телефон: главные кнопки «Начать» — всегда под рукой, над нижним меню */
@media (max-width: 760px) {
  .play-grid #go,
  .city-grid #go,
  #ws-play,
  #start-card #start {
    position: sticky;
    bottom: calc(72px + var(--safe-b));
    z-index: 8;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 0 0 0 4px rgba(var(--deep-rgb), 0.6);
  }

  #start-card {
    position: sticky;
    bottom: calc(66px + var(--safe-b));
    z-index: 8;
  }

  #start-card #start {
    position: static;
  }
}

/* Лобби на телефоне: QR не нужен (им наводят с ПК), код и ссылка остаются */
@media (max-width: 560px) {
  .lobby-bar .qr-box {
    display: none;
  }
}

/* Голосование: крупные секунды в углу кадра */
.hv-sec {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(10, 6, 30, 0.82);
  box-shadow: 0 0 0 2.5px rgba(255, 255, 255, 0.25);
}

.hv-sec b {
  font-size: 20px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.hv-sec.low {
  box-shadow: 0 0 0 2.5px #ff4d61;
  animation: timerPulse 0.5s ease-in-out infinite;
}

.hv-sec.low b {
  color: #ff6b7d;
}

/* Мелкие подписи зон в «Угадай город» */
.city-tag.mini {
  padding: 2px 7px;
  font-size: 10px;
  letter-spacing: 0.04em;
  border-width: 1px;
  border-color: rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.92);
  background: rgba(10, 6, 30, 0.72);
  box-shadow: none;
}

.pin-wrap.hidden {
  display: none;
}

/* После раунда: средний результат других на этой точке */
.rp-avg {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--text-3);
  font-size: 13px;
}

.rp-avg b {
  color: var(--text-2);
}

/* «Угадай город»: жизни */
.cs-hearts {
  display: inline-flex;
  gap: 2px;
}

.cs-hearts i {
  display: inline-flex;
  color: rgba(255, 255, 255, 0.22);
}

.cs-hearts i.on {
  color: #ff4d61;
  filter: drop-shadow(0 0 6px rgba(255, 77, 97, 0.6));
}

.cs-hearts .ico {
  fill: currentColor;
}

.cs-run {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--text-2);
  font-weight: 700;
}

.cs-run b {
  color: #ffd23f;
  font-size: 18px;
}

/* ─── Недельные топы ─── */

/* Рамка недели у аватарки (frames.js → weekFrameSvg) */
.avw-w1 {
  filter: drop-shadow(0 0 4px rgba(255, 196, 40, 0.75));
}

.avw-w2 {
  filter: drop-shadow(0 0 3px rgba(220, 232, 255, 0.6));
}

.avw-w3 {
  filter: drop-shadow(0 0 3px rgba(255, 150, 80, 0.6));
}

.avw-wx {
  filter: drop-shadow(0 0 3px rgba(63, 211, 234, 0.6));
}

/* Значок у ника: место прошлой недели */
.wk-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 0 7px 0 5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  font-style: normal;
  line-height: 18px;
  vertical-align: 2px;
  color: #03303d;
  background: linear-gradient(135deg, #c8fbff, #3fd3ea);
}

.wk-chip.p1 {
  color: #3a2200;
  background: linear-gradient(135deg, #fff1a8, #ffc229);
}

.wk-chip.p2 {
  color: #232b38;
  background: linear-gradient(135deg, #ffffff, #b9c4d8);
}

.wk-chip.p3 {
  color: #3a1a05;
  background: linear-gradient(135deg, #ffd9b0, #e0904f);
}

.profile-meta .wk-chip {
  margin-left: 0;
  padding: 3px 10px 3px 8px;
  font-size: 11.5px;
  line-height: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 0;
}

/* /top → «Неделя»: таблицы и отсчёт до сброса */
.wk-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 14px;
}

.wk-bar[hidden] {
  display: none;
}

.wk-seg {
  flex: 1 1 auto;
  flex-wrap: nowrap;
}

.wk-seg button {
  justify-content: center;
  min-width: 0;
}

.wk-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.wk-reset b {
  color: #fff;
  font-weight: 900;
}

.wk-cut {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 4px;
  color: #8fe9f5;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.wk-cut::before,
.wk-cut::after {
  content: '';
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(63, 211, 234, 0.6) 0 6px, transparent 6px 11px);
}

.wk-past {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.wk-past-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 900;
}

.wk-past-h span {
  color: var(--text-3);
  font-size: 13px;
  font-weight: 700;
}

.wk-past-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.wk-pp {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

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

.wk-pp > i {
  flex: 0 0 auto;
  width: 14px;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  color: var(--text-3);
}

.wk-pp.p1 > i {
  color: #ffd23f;
}

.wk-pp.p2 > i {
  color: #d9e2f2;
}

.wk-pp.p3 > i {
  color: #ff9f5a;
}

.wk-pp > div {
  min-width: 0;
}

.wk-pp > div > b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.wk-pp > div > span {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}

/* Главная: «Ты #57 на неделе — до #50 осталось 1 200 XP» */
.wk-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  color: var(--text-2);
  font-size: 14px;
}

a.wk-line:hover {
  color: var(--text-2);
  border-color: rgba(63, 211, 234, 0.45);
}

.wk-line-ico {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(63, 211, 234, 0.16);
  color: #6fe3f3;
}

.wk-line.in .wk-line-ico {
  background: linear-gradient(135deg, #ffd23f, #ff8a1f);
  color: #2a1400;
}

.wk-line-t {
  flex: 0 1 auto;
  min-width: 0;
}

.wk-line-t b {
  color: #fff;
  font-weight: 900;
}

.wk-line-bar {
  flex: 1 1 80px;
  height: 6px;
  margin: 0 8px;
}

.wk-line-bar:not(.progress) {
  background: none;
}

.wk-line-t em {
  font-style: normal;
  font-weight: 900;
  color: #ffd23f;
  white-space: nowrap;
}

.wk-line .wk-reset {
  margin-left: 0;
  font-size: 12px;
}

.wk-line-go {
  flex: 0 0 auto;
  color: var(--text-3);
}

/* Уведомление о награде недели */
.wk-notify.p1 {
  border-color: rgba(255, 210, 63, 0.6);
}

.wk-notify .notif-body em {
  font-style: normal;
  font-weight: 800;
  color: #ffd23f;
}

@media (max-width: 560px) {
  .wk-seg {
    flex: 1 1 100%;
  }

  .wk-seg button {
    padding: 8px 4px;
    font-size: 13px;
  }

  .wk-seg button .ico {
    display: none;
  }

  .wk-bar .wk-reset {
    margin-left: 0;
  }

  .wk-pp {
    position: relative;
    flex-direction: column;
    gap: 6px;
    padding: 10px 6px 9px;
    text-align: center;
  }

  .wk-pp > i {
    position: absolute;
    left: 8px;
    top: 6px;
    font-size: 15px;
  }

  .wk-pp > div {
    width: 100%;
  }

  .wk-line {
    gap: 10px;
    padding: 10px 12px;
    font-size: 13.5px;
  }

  .wk-line-go {
    display: none;
  }
}

@media (max-width: 760px) {
  .wk-line-t {
    flex: 1 1 auto;
  }

  .wk-line-bar {
    display: none;
  }
}

/* Профиль и задания на главной — с отступом от шапки (раньше стояли впритык) */
.home-me {
  margin-top: 20px;
}

@media (max-width: 560px) {
  .home-me {
    margin-top: 14px;
    gap: 12px;
  }
}
