@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/montserrat-v31-cyrillic_latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/montserrat-v31-cyrillic_latin-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/montserrat-v31-cyrillic_latin-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/montserrat-v31-cyrillic_latin-800.woff2') format('woff2');
}

:root {
  /* Единая «мягкая» анимация появления по всему приложению.
     ease-out-cubic: элемент плавно тормозит, без рывка в начале. */
  --ease-soft: cubic-bezier(.33, 1, .68, 1);
  --enter-dur: .55s;
  --enter-shift: 10px;
  --primary: #ff6a61;
  --accent: #ff6a61;
  --fire: #ff5252;
  --gold: #d4af37;
  --neon: #00f2fe;
  --glass-bg: rgba(10, 14, 26, 0.95);
  --glass-card: hsla(0, 0%, 100%, 0.15);
  --glass-border: hsla(0, 0%, 100%, 0.2);
  --text-light: #fff;
  --text-dim: hsla(0, 0%, 100%, 0.85);
  --text-primary: rgba(255, 106, 97, 0.95);
  --matte-bg: #0a0e1a;
  --blur-intensity: 8px;
  --rarity-rgb: 255, 106, 97;
  --font-main: "Montserrat", sans-serif;
  --base-font-size: clamp(12px, 3vw, 16px);
  --h1-size: clamp(18px, 5vw, 24px);
  --h2-size: clamp(16px, 4vw, 20px);
  --small-text: clamp(10px, 2.5vw, 14px);
  --btn-height: clamp(44px, 12vw, 56px);
  --btn-padding: clamp(10px, 3vw, 14px);
  --btn-font-size: clamp(12px, 3vw, 14px);
  --icon-size: clamp(20px, 6vw, 32px);
  --avatar-size: clamp(40px, 10vw, 56px);
  --dock-height: clamp(60px, 15vw, 80px);
  --screen-padding: clamp(10px, 3vw, 25px);
  --card-radius: clamp(12px, 4vw, 20px);
  --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 10px 25px rgba(0, 0, 0, 0.3);
  --shadow-heavy: 0 20px 40px rgba(0, 0, 0, 0.5);
  --glow-primary: 0 0 20px rgba(255, 106, 97, 0.3);
  --vh: 1vh;
  --safe-bottom: 0px;
  --hud-height: 70px
}

* {
  font-family: var(--font-main);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%
}

.gift,
.hero-stage,
.modal-overlay,
.stage-card {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden
}

#gifts-grid,
#rank-content,
#tree-list,
.modal-body,
.screen {
  -webkit-overflow-scrolling: touch
}

@keyframes invItemIn {
  0% {
    opacity: 0;
    transform: translateY(var(--enter-shift))
  }

  to {
    opacity: 1;
    transform: none
  }
}

.gift-card {
  opacity: 0;
  animation: invItemIn var(--enter-dur) var(--ease-soft) forwards;
  animation-delay: calc(min(var(--i, 0) * 40ms, .6s))
}

.inv-anim-reset .gift-card {
  animation: none !important
}

.inv-anim-static .gift-card {
  animation: none !important;
  opacity: 1 !important
}

@media (prefers-reduced-motion:reduce) {

  .gift-card {
    animation: none;
    opacity: 1;
    transform: none
  }
}

@keyframes newsItemIn {
  0% {
    opacity: 0;
    transform: translateY(var(--enter-shift))
  }

  to {
    opacity: 1;
    transform: none
  }
}

/* [2026-07-20] will-change убран — та же причина, что у строк рейтинга:
   он делает подъём элемента на композитор постоянным, хотя браузер и так
   поднимает его на время анимации и сам опускает после. Элементов тут
   меньше десятка, выигрыш скромный, но и смысла держать хинт нет. */
#scr-news>#polls-list,
#scr-news>.card-title,
#scr-news>.stage-card {
  opacity: 0;
  animation: newsItemIn var(--enter-dur) var(--ease-soft) forwards;
  animation-delay: calc(min(var(--i, 0) * 55ms, .7s))
}

.news-anim-reset>#polls-list,
.news-anim-reset>.card-title,
.news-anim-reset>.stage-card {
  animation: none !important
}

/* [2026-07-20] Показать блоки «Ещё» СРАЗУ, без выезда — при повторном
   открытии экрана за сессию. Отличие от news-anim-reset: тот только глушит
   animation, оставляя элемент на opacity:0 (для reflow-сброса в том же
   кадре), а здесь блок именно виден. */
.news-anim-static>#polls-list,
.news-anim-static>.card-title,
.news-anim-static>.stage-card {
  animation: none !important;
  opacity: 1 !important
}

@media (prefers-reduced-motion:reduce) {

  #scr-news>#polls-list,
  #scr-news>.card-title,
  #scr-news>.stage-card {
    animation: none;
    opacity: 1;
    transform: none
  }
}

.glass-btn,
.stage-card {
  box-shadow: 0 4px 12px rgba(0, 0, 0, .2) !important;
  background: hsla(0, 0%, 100%, .12) !important
}



















.gift {
  /* [2026-08-19] Свечение эмодзи-заглушки, когда у подарка нет картинки.
     Было 10px, приведено к тому же масштабу, что и у картинок. */
  text-shadow: 0 0 5px currentColor
}

.gift:hover {
  transform: scale(1.2) !important;}



.modal-close-top {
  top: max(clamp(15px, 6vw, 25px), env(safe-area-inset-top, 15px));
  will-change: transform, opacity;}





@media (max-height:700px) {
  .hero-stage {
    transform: translate(-50%, -50%) scale(.9)
  }

  .gift {
    transform: scale(.8)
  }
}

@media (max-height:600px) {
  .hero-stage {
    transform: translate(-50%, -50%) scale(.8)
  }

  .gift {
    transform: scale(.7)
  }
}


#modal-swipe *,
#modal-swipe :after,
#modal-swipe :before {
  color-scheme: light !important;
  -webkit-color-scheme: light !important
}

#modal-swipe {
  background: rgba(10, 14, 26, .75) !important;
  background: rgba(10, 14, 26, .95) !important
}




@keyframes fly {
  0% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-5px)
  }

  to {
    transform: translateY(0)
  }
}

.gift-position-fix {
  position: absolute;
  z-index: 100
}

/* Картинка-шапка модалки вопроса.
   Вставляется из game.js (_setMissionHero) первым элементом внутрь
   .modal-window, выше .modal-body — поэтому встык к краям карточки.
   Скругление верхних углов НЕ задаётся здесь: его обрезает сама
   .modal-window через overflow:hidden. */
.mission-hero {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  line-height: 0;
  background: hsla(0, 0%, 100%, .04)
}

.mission-hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  /* cover — картинка подстраивается под рамку, не растягиваясь:
     сохраняет пропорции, лишнее по длинной стороне обрезается */
  object-fit: cover;
  object-position: center;
  border-radius: 0
}

/* Safari < 15 не знает aspect-ratio — там держим рамку фиксированной высотой */
@supports not (aspect-ratio: 16/9) {
  .mission-hero img {
    height: clamp(150px, 52vw, 225px)
  }
}



.form-field textarea {
  font-family: Montserrat, sans-serif;
  will-change: transform, opacity
}




.skin-item {
  transition: all .3s ease;
  will-change: transform, opacity
}

.skin-item.available:hover {
  transform: translateY(-5px);
  background: hsla(0, 0%, 100%, .08) !important;
  border-color: hsla(0, 0%, 100%, .2) !important
}

.skin-item.selected {
  background: rgba(255, 106, 97, .1) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 15px rgba(255, 106, 97, .2)
}

.skin-item.available:active {
  transform: scale(.95)
}

.skin-item img {
  border-radius: 8px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .3))
}

.skin-item.selected img {
  filter: drop-shadow(0 4px 12px rgba(255, 106, 97, .4))
}

#main-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--matte-bg);
  justify-content: center;
  z-index: 99999;
  overflow: hidden
}

#main-loader,
.loader-stage {
  display: flex;
  align-items: center
}

.loader-stage {
  text-align: center;
  position: relative;
  flex-direction: column;
  gap: 28px
}

.loader-dots {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center
}

.loader-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  animation: dotBounce 1.2s ease-in-out infinite
}

.loader-dot:first-child {
  background: #ff6a61;
  animation-delay: 0s
}

.loader-dot:nth-child(2) {
  background: #c0392b;
  animation-delay: .15s
}

.loader-dot:nth-child(3) {
  background: #00f2fe;
  animation-delay: .3s
}

@keyframes dotBounce {

  0%,
  80%,
  to {
    transform: translateY(0);
    opacity: .5
  }

  40% {
    transform: translateY(-14px);
    opacity: 1
  }
}

.loader-tip {
  font-family: Montserrat, sans-serif;
  font-size: clamp(12px, 3.2vw, 15px);
  font-weight: 500;
  color: hsla(0, 0%, 100%, .65);
  max-width: 280px;
  line-height: 1.5;
  text-align: center;
  animation: tipFadeIn .6s ease forwards;
  padding: 0 16px
}

@keyframes tipFadeIn {
  0% {
    opacity: 0;
    transform: translateY(6px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.loader-tip-label {
  font-family: Montserrat, sans-serif;
  font-size: clamp(9px, 2.2vw, 11px);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 106, 97, .6);
  margin-bottom: 8px
}

#main-loader.loader-fade-out {
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none
}


.loader-fade-out {
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none
}

body,
html {
  height: calc(var(--vh, 1vh)*100);
  min-height: calc(var(--vh, 1vh)*100);
  width: 100vw;
  overflow: hidden;
  background: var(--matte-bg);
  color: var(--text-light);
  font-size: var(--base-font-size);
  touch-action: manipulation;
  margin: 0;
  padding: 0
}

@media (prefers-reduced-motion:reduce) {

  *,
  :after,
  :before {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important
  }
}

.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  background: radial-gradient(circle at 50% 50%, #111827 0, #0a0e1a 100%);
  z-index: 0
}

/* [оптимизация] Фоновое «сияние» ОТКЛЮЧЕНО — внешне ничего не меняется.
   Пятна (.aurora-blob) — это div, а в этом файле есть общее правило
   div{background:transparent!important}, поэтому их градиенты никогда не
   отображались: на экране был пустой фон. При этом три пустых слоя по 480px
   с размытием blur(48px) бесконечно анимировались видеокартой. */
.aurora {
  display: none !important;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  contain: strict
}

.aurora-blob {
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(48px);
  will-change: transform, opacity;
  transform: translateZ(0)
}

.aurora-blob--coral {
  background: radial-gradient(circle, rgba(255, 106, 97, .85) 0, transparent 70%);
  top: -10%;
  left: -10%;
  animation: auroraDrift1 24s ease-in-out infinite alternate
}

.aurora-blob--teal {
  background: radial-gradient(circle, rgba(0, 242, 254, .7) 0, transparent 70%);
  top: 30%;
  right: -15%;
  animation: auroraDrift2 28s ease-in-out infinite alternate
}

.aurora-blob--purple {
  background: radial-gradient(circle, rgba(162, 89, 255, .7) 0, transparent 70%);
  bottom: -15%;
  left: 25%;
  animation: auroraDrift3 32s ease-in-out infinite alternate
}

@keyframes auroraDrift1 {
  0% {
    transform: translateZ(0) scale(1);
    opacity: .28
  }

  50% {
    transform: translate3d(40px, 60px, 0) scale(1.1);
    opacity: .38
  }

  to {
    transform: translate3d(-30px, 40px, 0) scale(.95);
    opacity: .24
  }
}

@keyframes auroraDrift2 {
  0% {
    transform: translateZ(0) scale(1);
    opacity: .22
  }

  50% {
    transform: translate3d(-50px, -40px, 0) scale(1.05);
    opacity: .32
  }

  to {
    transform: translate3d(-20px, 50px, 0) scale(1.1);
    opacity: .26
  }
}

@keyframes auroraDrift3 {
  0% {
    transform: translateZ(0) scale(1);
    opacity: .22
  }

  50% {
    transform: translate3d(60px, -50px, 0) scale(1.15);
    opacity: .32
  }

  to {
    transform: translate3d(30px, -20px, 0) scale(.9);
    opacity: .24
  }
}

@media (max-width:600px) {
  .aurora-blob {
    width: 360px;
    height: 360px;
    filter: blur(36px)
  }
}

.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: .06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='200' height='200' filter='url(%23n)' opacity='0.7'/></svg>");
  background-size: 200px 200px;
  background-repeat: repeat
}

.ui-wrapper {
  z-index: 10;
  width: 100vw;
  overflow: hidden
}

.content-limit,
.ui-wrapper {
  position: relative;
  height: calc(var(--vh, 1vh)*100);
  display: flex;
  flex-direction: column
}

.content-limit {
  width: 100%;
  max-width: min(500px, 100vw);
  margin: 0 auto;
  padding: max(var(--screen-padding), env(safe-area-inset-top)) max(var(--screen-padding), env(safe-area-inset-right)) max(var(--screen-padding), env(safe-area-inset-bottom)) max(var(--screen-padding), env(safe-area-inset-left))
}

.hud {
  padding: var(--screen-padding);
  justify-content: space-between;
  gap: clamp(8px, 2vw, 16px);
  z-index: 200;
  background: linear-gradient(180deg, rgba(10, 14, 26, .95), transparent);
  min-height: 70px
}

.hud,
.user-info {
  display: flex;
  align-items: center
}

.user-info {
  gap: clamp(8px, 2vw, 12px);
  flex: 1;
  min-width: 0
}

.avatar-btn {
  width: var(--avatar-size);
  height: var(--avatar-size);
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  background: hsla(0, 0%, 100%, .15);
  border: 2px solid var(--primary);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--glow-primary);
  flex-shrink: 0;
  overflow: visible;
  transition: transform .2s ease
}

/* [оптимизация] Пульсирующее свечение аватара. Раньше анимировалась сама
   тень (box-shadow) — браузер перерисовывал аватар в каждом кадре, всегда.
   Теперь тень нарисована один раз на псевдоэлементе, а анимируется только
   его прозрачность — это делает видеокарта, без перерисовки. */
.avatar-btn::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  box-shadow: 0 0 25px rgba(255, 106, 97, .4);
  opacity: .35;
  pointer-events: none;
  /* steps(60): ~10 шагов в секунду. Свечение медленное (6 с), разницы с
     плавной анимацией не видно, а шапка есть на всех экранах — анимация шла
     главным потоком и постоянно держала ~5% процессора (замер: 5,8% → 0,7%) */
  animation: avatarGlow 6s steps(60) infinite alternate
}

@keyframes avatarGlow {
  0% {
    opacity: .35
  }

  to {
    opacity: 1
  }
}

.avatar-btn:active {
  transform: scale(.95)
}

.avatar-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover
}

.avatar-badge {
  position: absolute;
  bottom: -8px;
  right: -8px;
  background: linear-gradient(135deg, var(--gold), #ff5252) !important;
  color: #000 !important;
  font-size: clamp(9px, 2.5vw, 11px);
  font-weight: 800;
  padding: clamp(4px, 1vw, 4px) clamp(4px, 1.5vw, 8px);
  border-radius: clamp(8px, 2vw, 10px);
  box-shadow: 0 3px 10px rgba(255, 106, 97, .3);
  z-index: 20;
  min-width: clamp(20px, 5vw, 22px);
  text-align: center;
  line-height: 1;
  border: 2px solid var(--matte-bg)
}

.user-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1
}

.user-name {
  font-weight: 700;
  font-size: clamp(12px, 3vw, 14px);
  color: var(--text-light)
}

.user-class,
.user-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.user-class {
  font-weight: 500;
  font-size: clamp(10px, 2.5vw, 12px);
  color: var(--gold);
  opacity: .9;}

.xp-display {
  background: hsla(0, 0%, 100%, .15);
  border: 1px solid rgba(255, 215, 0, .3);
  padding: clamp(8px, 2vw, 8px) clamp(8px, 2.5vw, 12px);
  border-radius: clamp(8px, 3vw, 12px);
  font-weight: 800;
  color: var(--gold);
  font-size: clamp(14px, 2.5vw, 12px);
  white-space: nowrap;
  backdrop-filter: blur(10px);
  flex-shrink: 0
}

.hero-stage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 400px);
  max-width: 400px;
  z-index: 5;
  pointer-events: auto;
  transition: .5s;
  overflow: visible;
  cursor: grab
}













.hero-stage > img {
  width: 100%;
  height: auto;
  max-height: 50vh;
  object-fit: contain;
  filter: drop-shadow(0 0 40px rgba(255, 106, 97, .25))
}

#hero-chat-button {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 6px);
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent !important;
  color: var(--text-light);
  cursor: pointer;
  z-index: 1;
}

#hero-chat-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

#hero-chat-button picture,
#hero-chat-button img {
  display: block;
  pointer-events: none;
}

/* [оптимизация] Свечение за героем ОТКЛЮЧЕНО — внешне ничего не меняется.
   Это div, и его градиент гасит общее правило div{background:transparent
   !important}: на экране свечения никогда не было. А слой 500×500 с
   filter: blur(40px) всё равно создавался и размывался. */
.hero-glow {
  display: none !important;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(120vw, 500px);
  height: min(120dvh, 500px);
  background: radial-gradient(circle, var(--hero-glow-color, rgba(255, 106, 97, .15)) 0, transparent 70%);
  filter: blur(40px);
  z-index: 4;
  transition: background .8s ease
}

.hero-blur {
  transition: all .3s ease
}

.gift {
  position: absolute;
  z-index: 1000;
  font-size: 14px;
  /* [2026-08-19] Белый ореол контейнера ложится поверх свечения картинки.
     Было 5px, уменьшено до 2px вместе с ним. */
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, .75)) brightness(1.1);
  cursor: pointer;
  pointer-events: auto;
  transform-origin: center;
  user-select: none;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  width: 36px;
  height: 36px;
  text-align: center;
  line-height: 36px;
  color: var(--primary);
  background: transparent !important
}


.gift:active,
.gift:hover {
  transform: scale(1.2)
}



.gift:hover:before {
  opacity: .8;
  background: radial-gradient(circle at center, rgba(255, 106, 97, .5) 0, rgba(255, 106, 97, .4) 20%, rgba(255, 106, 97, .3) 40%, rgba(0, 0, 0, .6) 60%, transparent 70%)
}



.gift-small {
  font-size: 16px;
  width: 30px;
  height: 30px;
  line-height: 30px
}

.gift-medium {
  font-size: 24px;
  width: 40px;
  height: 40px;
  line-height: 40px
}

.gift-large {
  font-size: 32px;
  width: 50px;
  height: 50px;
  line-height: 50px
}

.gift:before {
  content: "";
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: radial-gradient(circle at center, color-mix(in srgb, currentColor, transparent 10%) 0, color-mix(in srgb, currentColor, transparent 50%) 35%, color-mix(in srgb, currentColor, transparent 80%) 60%, transparent 75%);
  filter: blur(8px);
  opacity: .05;
  z-index: -1
}

.gift:after,
.gift:before {
  position: absolute;
  pointer-events: none
}

.gift:after {
  content: "\2726";
  top: -10px;
  right: -12px;
  font-size: 10px;
  color: currentColor;
  opacity: .7;
  animation: sparkle 2s ease-in-out infinite;
  z-index: 1;
  text-shadow: -18px 28px 0 currentColor, 22px 20px 0 currentColor;
  font-style: normal
}

@keyframes sparkle {

  0%,
  to {
    opacity: .7;
    transform: scale(1)
  }

  50% {
    opacity: .2;
    transform: scale(.6)
  }
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: clamp(70px, 20vw, 100px) var(--screen-padding) 0;
  display: none;
  overflow-y: auto;
  z-index: 20;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain
}

.screen.active {
  opacity: 1;
  display: block;
  /* Экран при переключении плавно проявляется, а не возникает мгновенно.
     Только прозрачность: она не меняет раскладку и не создаёт новую систему
     координат для fixed-элементов внутри экрана. */
  animation: screenFadeIn .3s ease-out both
}

@keyframes screenFadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@media (prefers-reduced-motion:reduce) {
  .screen.active {
    animation: none
  }
}

#scr-home.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: clamp(150px, 40vw, 200px)
}

#scr-home.screen {
  padding-bottom: 180px !important
}

.screen:not(#scr-home) {
  padding-bottom: 120px !important
}


#scr-rank,
#scr-news {
  padding-top: clamp(52px, 15vw, 74px) !important;
}


/* [2026-07-20] Заголовки экранов приведены к ритму .branch-header со
   второго экрана: по левому краю, мельче, капсом. Раньше были крупные
   по центру и жили по своим правилам. */
.screen-title {
  text-align: left;
  font-weight: 800;
  font-size: clamp(18px, 5.3vw, 23px);
  color: var(--text-light);
  padding: 0 0 0 clamp(8px, 2vw, 8px);
  background: transparent !important;}

.screen-sub {
  text-align: left;
  font-size: clamp(11px, 3.1vw, 13px);
  color: var(--text-dim);
  padding: 0 clamp(8px, 2vw, 8px) 0 clamp(8px, 2vw, 8px);
  margin: 0 0 clamp(14px, 4vw, 18px);
  background: transparent !important
}








.stage-card {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  backdrop-filter: blur(var(--blur-intensity));
  -webkit-backdrop-filter: blur(var(--blur-intensity));
  box-shadow: var(--shadow-light), 0 1px 3px hsla(0, 0%, 100%, .05), inset 0 1px 0 hsla(0, 0%, 100%, .05);
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
  padding: clamp(12px, 3vw, 16px);
  margin-bottom: clamp(8px, 2vw, 12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  min-height: clamp(56px, 15vw, 70px)
}

.stage-card:active {
  transform: scale(.95);
  background: hsla(0, 0%, 100%, .2)
}




.card-number {
  font-size: clamp(12px, 3vw, 14px);
  font-weight: 800;
  color: var(--text-light);
  margin-right: clamp(12px, 3vw, 16px);
  width: clamp(20px, 6vw, 30px);
  text-align: center;
  flex-shrink: 0;
  background: transparent !important;
  text-shadow: 0 0 8px rgba(255, 106, 97, .3)
}

.card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0
}

.card-title {
  font-weight: 700;
  font-size: clamp(12px, 3vw, 14px);
  margin-bottom: 2px;
  color: var(--text-light)
}

.card-sub,
.card-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: transparent !important
}

.card-sub {
  font-size: clamp(10px, 2.5vw, 12px);
  color: var(--text-dim);
  font-weight: 500
}

/* [2026-08-19] Плашка под подарком убрана: остаются иконка и её подцветка.
   Отдельного правила с рамкой тут никогда не было — квадрат рисовала сама
   подложка, а бирюзовый край ей добавляло свечение иконок сверху.
   Меняется только цвет фона. padding, border-radius и aspect-ratio
   оставлены как были: от них зависит положение иконки в ячейке. */
.gift-card {
  background: transparent;
  border-radius: 10px;
  padding: clamp(16px, 4vw, 20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all .3s ease;
  cursor: pointer;
  aspect-ratio: 1;
  width: 100%;
  overflow: hidden
}

.gift-card:active {
  transform: scale(.95)
}

.gift-card:hover {
  transform: translateY(-5px)
}

.gift-card-icon {
  font-size: clamp(32px, 8vw, 42px);
  margin: 0;
  line-height: 1;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 8px rgba(var(--gc-rgb, 255, 106, 97), .3));
  transition: all .3s ease;
  color: var(--primary);
  background: transparent !important
}

.gift-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  transition: transform .3s ease
}

.gift-card-desc,
.gift-card-name {
  display: none !important
}

.empty-inventory {
  grid-column: 1/-1;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim)
}

.branch-header {
  color: var(--text-light);
  margin: clamp(16px, 5vw, 24px) 0 clamp(8px, 2.5vw, 12px);
  font-size: clamp(12px, 3.5vw, 14px);
  padding-left: clamp(8px, 2vw, 8px);
  background: transparent !important;
  text-shadow: 0 0 8px rgba(255, 106, 97, .2)
}

.stages-container {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2vw, 12px)
}

.dock {
  position: fixed;
  bottom: clamp(12px, 3vh, 20px);
  left: 50%;
  transform: translateX(-50%);
  height: 60px;
  padding: 0 clamp(20px, 6vw, 32px);
  border-radius: clamp(30px, 10vw, 50px);
  gap: clamp(20px, 6vw, 32px);
  width: auto;
  min-width: min(280px, 90vw);
  max-width: 90vw;
  backdrop-filter: blur(var(--blur-intensity));
  -webkit-backdrop-filter: blur(var(--blur-intensity));
  box-sizing: border-box
}

.dock,
.dock-item {
  display: flex;
  justify-content: center;
  align-items: center
}

.dock-item {
  font-size: var(--icon-size);
  cursor: pointer;
  opacity: .5;
  transition: opacity .18s ease-out, transform .18s cubic-bezier(.4, 0, .2, 1);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .3));
  color: var(--text-light);
  width: var(--icon-size);
  height: var(--icon-size);
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto
}

.dock-item,
.dock-item.active {
  background: transparent !important
}

.dock-item.active {
  opacity: 1;
  color: var(--primary) !important;
  transform: scale(1.2) translateY(-2px);
  text-shadow: 0 0 20px rgba(255, 106, 97, .7)
}

@media (hover:hover) and (pointer:fine) {
  .dock-item:hover {
    opacity: .8;
    transform: scale(1.1)
  }
}

.dock-item:active {
  transform: scale(.95)
}

.glass-btn {
  border: 1px solid var(--glass-border);
  color: var(--text-light);
  padding: var(--btn-padding);
  border-radius: var(--card-radius);
  font-weight: 600;
  text-align: center;
  width: 100%;
  cursor: pointer;
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: var(--btn-font-size);
  height: var(--btn-height);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center
}

.glass-btn:active {
  transform: scale(.95);
  background: hsla(0, 0%, 100%, .2)
}

.btn-primary {
  color: #fff;
  font-weight: 700;
  transition: transform .15s cubic-bezier(.4, 0, .2, 1)
}

.btn-primary:active {
  transform: scale(.95)
}

input[type=number],
input[type=text],
textarea {
  font-size: clamp(14px, 4vw, 16px);
  height: var(--btn-height);
  min-height: 44px;
  width: 100%;
  padding: 0 clamp(12px, 3vw, 16px);
  background: hsla(0, 0%, 100%, .15);
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  color: var(--text-light);
  font-family: var(--font-main)
}

#auth-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  z-index: 99999;
  background: radial-gradient(circle at 50% 50%, #111827 0, #0a0e1a 100%);
  padding: var(--screen-padding);
  backdrop-filter: blur(10px)
}




.auth-title {
  font-size: clamp(20px, 6vw, 24px);
  font-weight: 700;
  color: var(--text-light)
}

.auth-sub {
  font-size: clamp(12px, 3vw, 14px);}

.auth-toggle {
  font-size: clamp(13px, 3.5vw, 15px);
  color: var(--primary);
  margin-top: clamp(16px, 4vw, 20px);
  opacity: .9;
  text-decoration: none;
  cursor: pointer;
  transition: all .3s ease;
  background: rgba(255, 106, 97, .2);
  border: 1px solid rgba(255, 106, 97, .3);
  border-radius: clamp(10px, 3vw, 12px);
  padding: clamp(12px, 3vw, 12px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  text-align: center;
  display: block;
  width: 100%;
  box-shadow: 0 4px 12px rgba(255, 106, 97, .2);
  backdrop-filter: blur(10px)
}

.auth-toggle:active {
  transform: translateY(0) scale(.95);
  opacity: 1
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  z-index: 5000;
  display: none;
  padding: var(--screen-padding);
  background: rgba(0, 0, 0, .8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fadeIn .3s cubic-bezier(.4, 0, .2, 1);
  overflow-y: auto
}

.modal-window {
  background: rgba(10, 14, 26, .48);
  border: 1px solid hsla(0, 0%, 100%, .2);
  border-radius: var(--card-radius);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  box-shadow: var(--shadow-medium), 0 2px 8px hsla(0, 0%, 100%, .05), inset 0 1px 0 hsla(0, 0%, 100%, .05);
  border-radius: clamp(16px, 6vw, 24px);
  width: 100%;
  max-width: min(400px, 95vw);
  overflow: hidden;
  transform: scale(.95);
  animation: popIn .4s cubic-bezier(.34, 1.56, .64, 1) forwards;
  position: relative;
  max-height: 90vh;
  overflow-y: auto
}

.modal-header {
  padding: clamp(16px, 5vw, 20px) clamp(16px, 5vw, 20px) clamp(12px, 4vw, 16px);
  text-align: center;
  background: linear-gradient(180deg, hsla(0, 0%, 100%, .05), transparent)
}

#mission-window .modal-header:has(h2:empty) {
  display: none
}

#mission-window .modal-header h2:empty {
  display: none
}

.modal-header h2 {
  font-weight: 800;
  font-size: clamp(16px, 4vw, 18px);
  color: var(--text-light);
  letter-spacing: .5px;
  background: transparent !important;
  text-shadow: 0 0 10px rgba(255, 106, 97, .2)
}

.modal-body {
  padding: clamp(16px, 5vw, 20px)
}



.modal-close-top {
  position: absolute;
  top: clamp(15px, 6vw, 25px);
  right: clamp(15px, 6vw, 25px);
  color: #fff;
  padding: clamp(12px, 3vw, 16px) clamp(16px, 4vw, 20px);
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: clamp(14px, 4vw, 16px);
  transition: all .3s ease;
  z-index: 10001;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  min-width: 20px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, .4)
}

.modal-close-top:hover {
  background: hsla(0, 0%, 100%, .3);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5)
}

.modal-close-top:active {
  transform: translateY(0) scale(.95)
}

.gift-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, .85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--screen-padding);
  animation: fadeIn .3s ease
}

.gift-popup-content {
  background: rgba(10, 14, 26, .98);
  border: 1px solid hsla(0, 0%, 100%, .2);
  border-radius: clamp(20px, 6vw, 24px);
  width: 100%;
  max-width: min(380px, 90vw);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-heavy);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px)
}


.gift-popup-pattern {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.gift-popup-pattern span {
  position: absolute;
  left: var(--tile-x);
  top: var(--tile-y);
  width: var(--tile-size);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: var(--tile-size);
  line-height: 1;
  opacity: .17;
  filter: grayscale(.7);
  transform: translate(-50%, -50%) rotate(var(--tile-angle));
}

.gift-popup-pattern img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gift-popup-content > .gift-popup-header,
.gift-popup-content > .gift-popup-body {
  position: relative;
}

.gift-popup-pattern span:nth-child(1) { --tile-x: 7%; --tile-y: 13%; --tile-size: 34px; --tile-angle: -23deg }
.gift-popup-pattern span:nth-child(2) { --tile-x: 33%; --tile-y: 8%; --tile-size: 23px; --tile-angle: 17deg }
.gift-popup-pattern span:nth-child(3) { --tile-x: 68%; --tile-y: 13%; --tile-size: 30px; --tile-angle: -13deg }
.gift-popup-pattern span:nth-child(4) { --tile-x: 93%; --tile-y: 22%; --tile-size: 37px; --tile-angle: 24deg }
.gift-popup-pattern span:nth-child(5) { --tile-x: 21%; --tile-y: 32%; --tile-size: 27px; --tile-angle: 21deg }
.gift-popup-pattern span:nth-child(6) { --tile-x: 77%; --tile-y: 45%; --tile-size: 25px; --tile-angle: -26deg }
.gift-popup-pattern span:nth-child(7) { --tile-x: 8%; --tile-y: 58%; --tile-size: 35px; --tile-angle: -15deg }
.gift-popup-pattern span:nth-child(8) { --tile-x: 92%; --tile-y: 68%; --tile-size: 33px; --tile-angle: 19deg }
.gift-popup-pattern span:nth-child(9) { --tile-x: 29%; --tile-y: 83%; --tile-size: 29px; --tile-angle: -24deg }
.gift-popup-pattern span:nth-child(10) { --tile-x: 65%; --tile-y: 92%; --tile-size: 27px; --tile-angle: 22deg }

.gift-popup-header {
  padding: clamp(24px, 8vw, 35px) clamp(20px, 6vw, 32px) clamp(16px, 5vw, 20px);
  text-align: center;
  background: linear-gradient(180deg, hsla(0, 0%, 100%, .05), transparent)
}

/* [2026-08-19] Свечение подарков теперь берёт цвет из админки.
   JS кладёт его в --gc-rgb компонентами (245, 158, 11), потому что
   currentColor непрозрачен, а тут нужна альфа. Значение по умолчанию
   в var() — прежний коралловый, так что подарки без цвета выглядят
   как раньше. */
.gift-popup-icon {
  font-size: clamp(60px, 15vw, 80px);
  margin: 0 auto clamp(12px, 3vw, 16px);
  display: inline-block;
  filter: drop-shadow(0 10px 20px rgba(var(--gc-rgb, 255, 106, 97), .3));
  color: var(--primary);
  background: transparent !important
}

/* Анимация giftGlow нигде не подключена — ни в CSS, ни в JS, ни в разметке.
   Оставлена как есть, но цвет приведён к --gc-rgb, чтобы при подключении
   она не вернула жёстко зашитый коралловый. */
@keyframes giftGlow {

  0%,
  to {
    filter: drop-shadow(0 10px 20px rgba(var(--gc-rgb, 255, 106, 97), .3));
    transform: scale(1)
  }

  50% {
    filter: drop-shadow(0 15px 30px rgba(var(--gc-rgb, 255, 106, 97), .5));
    transform: scale(1.05)
  }
}

.gift-popup-body {
  padding: 0 clamp(20px, 6vw, 32px) clamp(20px, 6vw, 32px);
  text-align: center;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto
}

.gift-popup-body h2 {
  color: var(--texl-light);
  font-weight: 800;
  font-size: clamp(18px, 5vw, 22px);
  margin-bottom: clamp(12px, 3vw, 16px);
  line-height: 1.3;
  background: transparent !important;
  text-shadow: 0 0 10px rgba(255, 106, 97, .2)
}

.gift-popup-body p {
  color: var(--text-dim);
  font-size: clamp(14px, 4vw, 16px);
  line-height: 1.5;
  margin-bottom: clamp(20px, 6vw, 24px);
  padding: 0 clamp(4px, 2vw, 12px);
  opacity: .9;
  background: transparent !important
}

.gift-rarity-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(34, 197, 94, .15), rgba(16, 185, 129, .1));
  border: 1px solid rgba(34, 197, 94, .3);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: clamp(16px, 5vw, 20px)
}

.gift-rarity-label {
  font-size: clamp(12px, 3.5vw, 14px);
  color: rgba(134, 239, 172, .9);
  font-weight: 600
}

.gift-rarity-value {
  font-size: clamp(14px, 4vw, 16px);
  color: #4ade80;
  font-weight: 600;
  letter-spacing: .5px
}


.gift-popup-footer {
  margin-top: clamp(16px, 5vw, 20px)
}

.gift-popup-footer .glass-btn {
  height: clamp(44px, 12vw, 52px);
  font-size: clamp(14px, 4vw, 16px);
  font-weight: 700;
  letter-spacing: .5px;
  background: hsla(0, 0%, 100%, .15);
  border: 1px solid hsla(0, 0%, 100%, .2)
}

.quiz-progress {
  position: relative;
  margin: 0 auto clamp(16px, 5vw, 20px);
  width: 100%;
  --progress: 0%
}

.mission-step {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: hsla(0, 0%, 100%, .08) !important;
  width: 100%;
  overflow: hidden;
  font-size: 0;
  letter-spacing: 0;
  text-transform: none;
  margin: 0
}

.mission-step:after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  right: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff5252, #ff9800 22%, #ffd600 44%, #66bb6a 66%, #29b6f6 84%, #ab47bc);
  box-shadow: 0 0 12px hsla(0, 0%, 100%, .25);
  clip-path: inset(0 calc(100% - var(--progress, 0%)) 0 0 round 999px);
  transition: clip-path .45s cubic-bezier(.2, .9, .3, 1)
}


.mission-question {
  padding: 0;
  text-align: center;
  font-size: clamp(15px, 4.3vw, 18px);
  font-weight: 700;
  letter-spacing: .2px;
  margin-bottom: clamp(16px, 5vw, 24px);
  line-height: 1.35;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  color: #fff
}

.mission-question img {
  display: block;
  margin: 0 auto 16px;
  max-height: 200px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 8px;
  animation: fadeIn .3s ease-out
}

.mission-answer {
  background: hsla(0, 0%, 100%, .07);
  border: 1.5px solid hsla(0, 0%, 100%, .16);
  border-radius: clamp(12px, 4vw, 16px);
  padding: clamp(16px, 3.6vw, 16px);
  text-align: left;
  font-size: clamp(13px, 3.6vw, 15px);
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, background .2s, border-color .2s, box-shadow .2s;
  min-height: 56px;
  display: flex;
  align-items: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .18);
  position: relative
}

.mission-answer:hover {
  background: hsla(0, 0%, 100%, .11);
  border-color: rgba(var(--rarity-rgb), .45);
  box-shadow: 0 4px 16px rgba(var(--rarity-rgb), .18)
}

.mission-answer:active {
  transform: scale(.97);
  background: rgba(var(--rarity-rgb), .12);
  border-color: rgba(var(--rarity-rgb), .5)
}

.mission-answers {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2.5vw, 12px)
}

.player-profile {
  text-align: center
}

.player-avatar {
  width: clamp(56px, 15vw, 72px);
  height: clamp(56px, 15vw, 72px);
  border-radius: 50%;
  background: hsla(0, 0%, 100%, .15);
  border: 2px solid var(--primary);
  margin: 0 auto clamp(8px, 2.5vw, 12px);
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(255, 106, 97, .2)
}

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

.player-name {
  font-weight: 800;
  font-size: clamp(16px, 4.5vw, 18px);
  margin-bottom: 2px
}

.player-name {
  color: var(--text-light);
  background: transparent !important
}


.player-stats {
  display: flex;
  justify-content: space-around;
  margin: clamp(12px, 4vw, 16px) 0;
  padding: clamp(12px, 3vw, 12px);
  background: hsla(0, 0%, 100%, .1);
  border-radius: clamp(12px, 4vw, 16px);
  border: 1px solid hsla(0, 0%, 100%, .12);
  backdrop-filter: blur(10px)
}

.stat-item {
  text-align: center;
  flex: 1;
  min-width: 0;
  padding: 0 4px
}

.stat-value {
  font-weight: 800;
  font-size: clamp(16px, 4.5vw, 18px);
  color: var(--text-light);
  text-shadow: 0 0 8px rgba(255, 106, 97, .2)
}

.stat-label,
.stat-value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: transparent !important
}

.stat-label {
  font-size: clamp(12px, 2.7vw, 11px);
  color: var(--text-dim);
  margin-top: 2px
}

.progress-section {
  margin: clamp(16px, 4vw, 20px) 0
}

.progress-title {
  font-weight: 600;
  font-size: clamp(10px, 2.8vw, 12px);
  color: var(--text-dim);
  margin-bottom: clamp(8px, 2vw, 8px);
  text-align: left;
  background: transparent !important
}

.progress-bar {
  height: clamp(6px, 2vw, 11px);
  background: hsla(0, 0%, 100%, .15);
  border-radius: clamp(3px, 1.2vw, 5px);
  overflow: hidden;
  margin-bottom: clamp(8px, 2.5vw, 12px);
  backdrop-filter: blur(5px)
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #ff5252);
  border-radius: inherit;
  transition: width .5s ease
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: clamp(9px, 2.5vw, 11px);
  color: var(--text-dim);
  background: transparent !important
}

.tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 20px
}

.tab {
  padding: 12px 20px;
  border-radius: 10px;
  background: hsla(0, 0%, 100%, .1);
  cursor: pointer;
  transition: all .3s ease;
  font-size: clamp(12px, 3vw, 14px);
  border: 1px solid hsla(0, 0%, 100%, .12);
  text-align: center;
  flex: 1
}

.tab.active {
  background: rgba(255, 106, 97, .2);
  border-color: rgba(255, 106, 97, .35);
  color: #fff;
  font-weight: 600
}

.tab:active {
  transform: scale(.95)
}

#gifts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 2.5vw, 12px);
  margin-bottom: clamp(12px, 4vw, 16px)
}






#toast {
  position: fixed;
  top: clamp(70px, 20vw, 100px);
  left: 0;
  right: 0;
  text-align: center;
  z-index: 10000;
  display: none;
  pointer-events: none;
  padding: 0 var(--screen-padding)
}

.toast-content {
  display: inline-block;
  background: hsla(0, 0%, 100%, .15);
  color: #fff;
  padding: clamp(12px, 3vw, 12px) clamp(16px, 5vw, 24px);
  border-radius: clamp(20px, 8vw, 24px);
  font-weight: 700;
  font-size: clamp(11px, 3vw, 13px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  animation: toastSlideIn .3s cubic-bezier(.4, 0, .2, 1) forwards;
  white-space: normal;
  max-width: 82vw;
  overflow: visible;
  word-break: break-word;
  text-align: center;
  line-height: 1.5;
  border: 1px solid hsla(0, 0%, 100%, .2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .3)
}

.toast-content.toast-success {
  background: rgba(34, 197, 94, .35);
  border-color: rgba(34, 197, 94, .4);
  box-shadow: 0 8px 24px rgba(34, 197, 94, .2)
}

.toast-content.toast-error {
  background: rgba(239, 68, 68, .35);
  border-color: rgba(239, 68, 68, .4);
  box-shadow: 0 8px 24px rgba(239, 68, 68, .2)
}

.toast-content.toast-hiding {
  animation: toastSlideOut .35s cubic-bezier(.4, 0, .2, 1) forwards
}





.story-text {
  background: transparent !important;
  backdrop-filter: none;
  border: none;
  box-shadow: none;
  padding: 0;
  max-width: 100%;
  margin: 0
}

.story-text h1 {
  margin-bottom: clamp(4px, 1.5vw, 8px);
  font-size: clamp(17px, 5vw, 22px);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .8)
}

.story-text p {
  font-size: clamp(13px, 3.5vw, 16px);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .7)
}








.form-field {
  margin-bottom: clamp(12px, 3vw, 16px);
  text-align: left
}

.form-field label {
  display: block;
  color: var(--text-dim);
  font-size: clamp(11px, 2.8vw, 13px);
  margin-bottom: 8px;
  font-weight: 600;
  background: transparent !important
}


.form-field textarea {
  background: hsla(0, 0%, 100%, .1);
  border: 1px solid hsla(0, 0%, 100%, .15);
  border-radius: 12px;
  padding: clamp(12px, 3vw, 12px);
  font-size: clamp(12px, 3vw, 14px)
}

.form-field textarea {
  width: 100%;
  color: #fff;
  font-family: var(--font-main);
  resize: vertical;
  min-height: 120px;
  transition: all .3s ease
}

.form-field textarea:focus {
  outline: none;
  border-color: var(--text-light);
  background: hsla(0, 0%, 100%, .15)
}


.no-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none
}




.text-center {
  text-align: center
}

.hidden {
  display: none !important
}

.visible {
  display: block !important
}

* {
  scrollbar-width: none;
  -ms-overflow-style: none
}

::-webkit-scrollbar {
  display: none
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 77, 77, .3)
  }

  70% {
    box-shadow: 0 0 0 12px rgba(255, 77, 77, 0)
  }

  to {
    box-shadow: 0 0 0 0 rgba(255, 77, 77, 0)
  }
}

@keyframes challengeGlow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(229, 57, 53, .28), 0 0 0 1px rgba(229, 57, 53, .35);
  }
  50% {
    box-shadow: 0 0 24px rgba(229, 57, 53, .55), 0 0 0 1px rgba(229, 57, 53, .6);
  }
}




/* Пауза всех CSS-анимаций, когда вкладка/приложение свёрнуты (Page Visibility).
   Замораживает без сброса — при возврате анимации продолжаются плавно.
   Экономит батарею и снижает нагрев, когда экран не виден пользователю. */
body.anim-paused *,
body.anim-paused *::before,
body.anim-paused *::after {
  animation-play-state: paused !important;
}

@keyframes scan {
  0% {
    transform: translateY(0);
    opacity: 0
  }

  10% {
    opacity: 1
  }

  90% {
    opacity: 1
  }

  to {
    transform: translateY(100%);
    opacity: 0
  }
}

@keyframes popIn {
  to {
    transform: scale(1);
    opacity: 1
  }
}

@keyframes toastSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-30px) scale(.9)
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1)
  }
}

@keyframes toastSlideOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1)
  }

  to {
    opacity: 0;
    transform: translateY(-30px) scale(.9)
  }
}

.gift-float {
  animation: float-gentle 4s ease-in-out infinite;
  will-change: transform
}

@keyframes float-gentle {

  0%,
  to {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-8px)
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg) translateY(0)
  }

  50% {
    transform: rotate(180deg) translateY(-8px)
  }

  to {
    transform: rotate(1turn) translateY(0)
  }
}

@media (max-width:320px) {
  :root {
    --base-font-size: 11px;
    --icon-size: 18px;
    --avatar-size: 36px
  }

  .avatar-btn {
    width: 36px;
    height: 36px
  }

  .gift {
    font-size: 14px;
    width: 30px;
    height: 30px
  }

  #gifts-grid {
    grid-template-columns: repeat(2, 1fr)
  }
}

@media (max-width:480px) {
  .mission-question img {
    max-height: 150px;
    margin-bottom: 12px
  }

  .gift-popup-content {
    max-width: 95vw
  }

  .gift-popup-body h2 {
    font-size: 18px
  }

  .gift-popup-body p {
    font-size: 14px
  }

  #gifts-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px
  }

  .gift-card {
    padding: 12px
  }

  .gift-card-icon {
    font-size: 28px
  }







  .gift {
    font-size: 22px !important
  }

  .gift-large {
    font-size: 20px
  }

  .gift-medium {
    font-size: 18px
  }

  .gift-small {
    font-size: 14px
  }

  @media (max-height:700px) {
    .hero-stage {
      transform: translate(-50%, -50%) scale(.9)
    }

    .gift {
      transform: scale(.8)
    }
  }

  @media (max-height:600px) {
    .hero-stage {
      transform: translate(-50%, -50%) scale(.8)
    }

    .gift {
      transform: scale(.7)
    }
  }
}

@media (min-width:768px) {
  .gift-card-icon {
    font-size: 48px
  }

  .auth-toggle {
    font-size: 15px;
    padding: 16px
  }
}

@media (min-height:800px) {
  .hero-stage > img {
    max-height: 60vh
  }

  #scr-home.active {
    padding-bottom: 180px
  }
}

@media (min-height:900px) {
  .hero-stage > img {
    max-height: 65vh
  }
}

@media (orientation:landscape) and (max-height:500px) {
  .hud {
    padding: 8px 16px;
    min-height: 50px
  }

  .avatar-btn {
    width: 36px;
    height: 36px
  }

  .hero-stage {
    width: 40%;
    top: 40%
  }

  .hero-stage > img {
    max-height: 40vh
  }

  .screen {
    padding: 64px 16px 80px
  }

  #scr-home.active {
    padding-bottom: 100px
  }

  .gift,
.stage-card {
    font-size: 14px
  }

  #gifts-grid {
    grid-template-columns: repeat(3, 1fr)
  }
}

@supports (padding:max(0px)) {
  .hud {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right))
  }

  .screen {
    padding-top: max(70px, calc(env(safe-area-inset-top) + 64px));
    padding-bottom: max(100px, calc(env(safe-area-inset-bottom) + 80px))
  }
}

@supports (-webkit-touch-callout:none) {
  .modal-window {
    max-height: 85vh
  }

  input,
  select,
  textarea {
    font-size: 16px !important
  }

  .screen:not(#scr-home) {
    padding-bottom: calc(var(--dock-height) + var(--safe-bottom, 34px) + 20px) !important
  }
}

@media (prefers-reduced-data:reduce) {

  .gift,
.hero-glow {
    display: none !important
  }

  .glass-btn {
    backdrop-filter: none;
    -webkit-backdrop-filter: none
  }
}

@media (prefers-contrast:high) {
  :root {
    --primary: red;
    --text-light: #000;
    --matte-bg: #fff
  }

  }

.modal-overlay {
  align-items: center !important;
  justify-content: center !important
}

@media (max-width:768px) {
  .modal-overlay {
    align-items: center !important
  }

  .modal-window {
    margin-top: 90px !important;
    margin-bottom: 20px !important
  }
}











/* [2026-07-20] Старое правило .current-user-card удалено. Оно давало
   border:2px!important и background!important — из-за рамки 2px против
   1px у остальных строк бокс своей строки был выше, отступы сверху/снизу
   разъезжались и она налезала на нижнюю. Теперь своя строка geometrically
   идентична обычным, отличается лишь зелёным акцентом ниже. */

/* [2026-07-20] Бейдж переехал из правого угла в центр верхней грани.
   В углу он налезал на скруглённую рамку и требовал отключения contain у
   #rank-content; по центру он садится в промежуток между строками, ничем
   не обрезается и одинаково работает во вкладках «Игроки» и «Классы». */
/* [2026-07-20] Inline-бейдж «ТЫ» — в потоке рядом с именем, не absolute.
   Прежний .current-user-badge был position:absolute; top:-9px и постоянно
   съезжал относительно строки. Этот просто стоит перед именем как маленькая
   пилюля и съехать не может в принципе. */
.you-tag {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;              /* имя не должно поджимать плашку */
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 8px;
  margin-left: 2px;           /* стоит в КОНЦЕ строки, отступ слева */
  letter-spacing: .4px;
  box-shadow: 0 1px 4px rgba(5, 150, 105, .35);
}


.my-position-card {
  border: 2px solid var(--primary) !important;
  background: rgba(255, 106, 97, .1) !important;
  border-radius: var(--card-radius);
  box-shadow: 0 0 15px rgba(255, 106, 97, .25);
  /* [2026-07-20] animation: myPosGlow 6s infinite alternate — СНЯТА.
     Она анимировала box-shadow, то есть заставляла движок пересчитывать
     размытие тени каждый кадр всё время, пока открыт экран рейтинга.
     Фактически она и не играла: карточка носила класс .fl-rank-row, чей
     animation перебивал её при равной специфичности. Класс убран (карточка
     приходит вторым запросом и не должна выезжать отдельно от списка) —
     и без явного отключения вечная анимация ожила бы. Вид не меняется. */
  animation: none;
  position: relative
}

@keyframes myPosGlow {
  0% {
    box-shadow: 0 0 15px rgba(255, 106, 97, .2)
  }

  to {
    box-shadow: 0 0 25px rgba(255, 106, 97, .4)
  }
}

.my-position-card--king {
  border-color: rgba(255, 215, 0, .6) !important;
  background: rgba(255, 215, 0, .08) !important
  /* [оптимизация] animation: myPosKingGlow убрана — та же история, что
     у challengeGlow: тень у .stage-card выключена через !important, анимация
     ничего не показывала, но работала каждый кадр. */
}

@keyframes myPosKingGlow {
  0% {
    box-shadow: 0 0 15px rgba(255, 215, 0, .3)
  }

  to {
    box-shadow: 0 0 25px rgba(255, 215, 0, .55)
  }
}

#inv-gifts-container {
  display: none
}

#inv-gifts-container.active {
  display: block
}

@media (max-width:600px) {

  .dock,
.hero-stage,
.hud {
    opacity: 1 !important;
    visibility: visible !important
  }
}

#profile-gifts-section .gifts-title,
.auth-sub,
.auth-title,
.auth-toggle,
.branch-header,
.card-number,
.card-sub,
.card-title,
.dock-item,
.dock-item.active,
.gift-popup-body h2,
.gift-popup-body p,
.mission-question,
.mission-step,
.modal-header h2,
.player-name,
.screen-title,
.stat-label,
.stat-value,
.story-text h1,
.story-text p,
.tab,
.tab.active,
.user-class,
.user-name,
div,
h1,
h2,
h3,
h4,
h5,
h6,
p,
span {
  background: transparent !important;
  background-image: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  -webkit-text-fill-color: initial !important
}

#auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow-y: auto;
  padding: 20px
}


.auth-title {
  font-size: clamp(20px, 6vw, 24px) !important;
  margin-bottom: 4px !important;
  line-height: 1.2 !important
}

.auth-sub {
  font-size: clamp(12px, 3vw, 14px) !important;
  margin-bottom: 24px !important;
  line-height: 1.3 !important;
  padding: 0 12px !important;
  color: hsla(0, 0%, 100%, .8) !important
}

#inp-code,
#reg-name {
  height: 50px !important;
  min-height: 50px !important;
  font-size: clamp(16px, 4.5vw, 18px) !important;
  padding: 0 20px !important;
  margin-bottom: 16px !important;
  border-radius: 12px !important;
  background: hsla(0, 0%, 100%, .15) !important;
  border: 1px solid hsla(0, 0%, 100%, .2) !important
}


#auth-view-login,
#auth-view-reg {
  display: flex;
  flex-direction: column;
  gap: 16px
}

.auth-toggle {
  margin-top: auto !important;
  padding-top: 16px !important;
  border-top: 1px solid hsla(0, 0%, 100%, .15) !important
}

@media (max-width:480px) {
  
  #auth-view-login,
  #auth-view-reg {
    gap: 12px
  }

  .auth-sub {
    margin-bottom: 20px !important
  }
}

@media (max-height:700px) {
  
  #inp-code,
#reg-name {
    margin-bottom: 12px !important
  }

  #inp-code,
#reg-name {
    height: 45px !important;
    min-height: 45px !important
  }

  .auth-sub {
    margin-bottom: 16px !important
  }
}

/* [2026-08-19] Свечение подарков на первом экране было слишком широким.
   Две тени по 6px подряд дают не 6px: вторая накладывается на результат
   первой, и ореол расползается примерно вдвое. Радиусы уменьшены вдвое,
   цвет и альфа не тронуты. Двойной стек оставлен намеренно — он держит
   плотность у самого края иконки, поэтому свечение стало компактнее,
   а не бледнее. */
.gift img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 3px currentColor) drop-shadow(0 0 3px currentColor) drop-shadow(0 0 4px rgba(0, 0, 0, .3));
  border-radius: 8px
}

.gift:hover img {
  filter: drop-shadow(0 0 15px rgba(var(--gc-rgb, 255, 106, 97), .5))
}

.gift-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  transition: transform .3s ease
}

.gift-card:hover .gift-card-icon img {
  transform: scale(1.1)
}

.gift-popup-header img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 20px rgba(var(--gc-rgb, 255, 106, 97), .4));
  animation: float 3s ease-in-out infinite;
  border-radius: 16px
}

@media (max-width:480px) {
  .gift img {
    max-width: 40px;
    max-height: 40px
  }

  .gift-card-icon img {
    max-width: 48px;
    max-height: 48px
  }

  .gift-popup-header img {
    width: 80px;
    height: 80px
  }
}

.gift-card-icon img:not([src]),
.gift-card-icon img[src=""] {
  display: none
}



#stories-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  background: #000;
  display: none
}

#story-bars {
  position: absolute !important;
  top: 10px !important;
  left: 10px !important;
  right: 10px !important;
  width: calc(100% - 20px) !important;
  height: 3px !important;
  display: none;
  flex-direction: row !important;
  gap: 4px !important;
  z-index: 100 !important;
  pointer-events: none !important;
  box-sizing: border-box
}

#story-bars.visible {
  display: flex !important
}

.story-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  background-size: cover !important;
  background-position: 50% !important;
  background-repeat: no-repeat !important;
  user-select: none;
  -webkit-user-select: none
}

.story-page.active {
  display: block
}

.story-gradient-overlay {
  top: 0;
  height: 100%;
  background: linear-gradient(0deg, rgba(0, 0, 0, .82) 0, rgba(0, 0, 0, .55) 25%, rgba(0, 0, 0, .18) 55%, transparent);
  z-index: 1
}

.story-gradient-overlay,
.story-text {
  position: absolute;
  left: 0;
  width: 100%;
  pointer-events: none
}

.story-text {
  bottom: 0;
  z-index: 2;
  padding: clamp(40px, 12vw, 64px) clamp(16px, 4vw, 24px) clamp(28px, 9vw, 40px);
  text-align: left
}

.story-text h1 {
  font-weight: 800;
  color: #fff;
  font-size: clamp(15px, 4.5vw, 20px);
  margin-bottom: 8px;
  line-height: 1.2
}

.story-text h1,
.story-text p {
  background: transparent !important
}

.story-text p {
  font-size: clamp(11px, 3vw, 14px);
  color: hsla(0, 0%, 100%, .82);
  line-height: 1.45
}






.reaction-btn {
  transition: all .3s ease
}

.reaction-btn:hover {
  background: hsla(0, 0%, 100%, .2) !important;
  transform: scale(1.2)
}

.reaction-btn:active {
  transform: scale(.95)
}

.reaction-item {
  transition: all .3s ease;
  animation: fadeIn .5s ease
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(10px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.content-limit {
  padding-top: 0 !important
}

.hud {
  padding-top: 12px !important;
  margin-top: 0 !important;
  position: relative;
  top: 0
}

@supports (-webkit-touch-callout:none) {
  .hud {
    padding-top: max(12px, env(safe-area-inset-top, 12px)) !important
  }

  .content-limit {
    padding-top: env(safe-area-inset-top, 0) !important
  }
}








.avatar-max {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary)
}

/* [2026-07-20] Оформление топ-1/2/3 переведено на общий --acc-rgb
   (см. блок .rank-row.stage-card ниже по файлу). Отсюда убраны:
     - conic-gradient обводки в :before с mask-composite — самый дорогой
       эффект на экране. Он и не рисовался: ниже по файлу стоит
       .stage-card:before{display:none!important}, а !important бьёт
       специфичность;
     - box-shadow 0 0 20px — свечение вокруг каждой из трёх строк;
     - transition:all .3s.
   Цвет места теперь приходит из game.js переменной --acc-rgb. */
@keyframes glow {
  0% {
    opacity: .8;
    filter: brightness(1)
  }

  to {
    opacity: 1;
    filter: brightness(1.3)
  }
}

#scr-city {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 9999;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
  display: none
}

#scr-city.active {
  display: block !important
}






:root {
  --modal-bg: rgba(18, 22, 36, 0.85);
  --card-bg: rgba(22, 26, 40, 0.8);
  --overlay-bg: rgba(0, 0, 0, 0.75)
}

.dock,
.gift-popup-content,
.glass-btn,
.modal-close-top,
.modal-overlay,
.modal-window,
.player-stats,
.stage-card,
.tab {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important
}

.modal-overlay {
  background: var(--overlay-bg) !important
}

.modal-window {
  background: rgba(14, 19, 33, .82) !important;
  border: 1px solid hsla(0, 0%, 100%, .1) !important;
  box-shadow: 0 25px 50px rgba(0, 0, 0, .6), inset 0 1px 0 hsla(0, 0%, 100%, .08) !important
}

.stage-card {
  position: relative;
  background: var(--card-bg) !important;
  border: 1px solid hsla(0, 0%, 100%, .1) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .3), inset 0 1px 0 hsla(0, 0%, 100%, .05) !important
}


.dock {
  background: rgba(15, 20, 40, .75) !important;
  box-shadow: 0 -5px 25px rgba(0, 0, 0, .5) !important
}

.dock {
  border: 1px solid hsla(0, 0%, 100%, .15) !important
}


.gift-popup-content {
  background: rgba(14, 19, 33, .82) !important;
  border: 1px solid hsla(0, 0%, 100%, .1) !important;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .7), inset 0 1px 0 hsla(0, 0%, 100%, .08) !important
}



.modal-close-top {
  background: rgba(0, 0, 0, .5) !important;
  border: 1px solid hsla(0, 0%, 100%, .2) !important
}

.modal-window:after,
.stage-card:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, hsla(0, 0%, 100%, .1), transparent);
  pointer-events: none
}


.glass-btn {
  background: hsla(0, 0%, 100%, .12) !important;
  border: 1px solid hsla(0, 0%, 100%, .15) !important
}

.btn-primary {
  background: #922d25 !important;
  border: none !important
}

.branch-header,
.stage-card {
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important
}

.branch-header:after,
.branch-header:before,
.stage-card:after,
.stage-card:before {
  display: none !important;
  content: none !important
}

.hero-blur {
  opacity: 1 !important;
  filter: none !important
}

.hero-blur,
.screen:not(#scr-home) {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important
}

.screen:not(#scr-home) {
  background: rgba(10, 14, 26, .9) !important;
  padding-top: calc(var(--hud-height) + 16px) !important
}

#scr-home {
  background: transparent !important
}

.dock {
  z-index: 1000
}

.screen:not(#scr-home) .branch-header,
.screen:not(#scr-home) .screen-title {
  text-shadow: 0 2px 5px rgba(0, 0, 0, .5)
}


#daily-challenge-container {
  display: none !important
}

.gift {
  animation: none !important;
  transition: none !important;
  will-change: auto !important
}

.gift,
.gift:hover {
  transform: none !important
}

.gift:hover {
  filter: none !important
}

.gift:after,
.gift:before {
  display: none !important
}

.gift img {
  transition: none !important;
  transform: none !important
}

.gift:hover img {
  transform: none !important;
  filter: none !important
}


@keyframes bounce {

  0%,
  to {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-20px)
  }
}


.stories-bar-wrapper {
  overflow: hidden;
  width: 100%;}

.stories-bar {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 12px 4px 16px;
  scrollbar-width: none
}

.stories-bar::-webkit-scrollbar {
  display: none
}

.story-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
  scroll-snap-align: start;
  transition: transform .15s ease;
  width: 68px
}

.story-bubble:active {
  transform: scale(.93)
}

.story-bubble-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0e1a;
  border: 3px solid transparent;
  background-clip: padding-box;}

.story-bubble-ring.seen {
  box-shadow: 0 0 0 2px hsla(0, 0%, 100%, .2)
}

.story-bubble-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #0a0e1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  overflow: hidden
}

/* Короткие подписи помещаются в две строки. */
.story-bubble-label {
  color: var(--text-dim, hsla(0, 0%, 100%, .6));
  text-align: center;
  width: 76px;
  overflow: hidden;
  white-space: normal;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  hyphens: auto;
  letter-spacing: 0
}

.story-bubble.has-new .story-bubble-label {
  color: #fff
}

#poll-reactions button:active,
#polls-list .stage-card:active {
  transform: scale(.95)
}

#poll-modal .modal-window {
  scrollbar-width: none
}

#poll-modal .modal-window::-webkit-scrollbar {
  display: none
}


.gifts-carousel-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 0 28px;
  box-sizing: border-box
}

.gifts-carousel-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 12px 0;
  scrollbar-width: none;
  width: 100%;
  scroll-snap-type: x mandatory
}

.gifts-carousel-track::-webkit-scrollbar {
  display: none
}

.gifts-carousel-track .gift-card {
  flex: 0 0 calc(25% - 7.5px);
  scroll-snap-align: start;
  padding: 8px;
  aspect-ratio: 1;
  box-sizing: border-box
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: hsla(0, 0%, 100%, .12);
  backdrop-filter: blur(6px);
  color: hsla(0, 0%, 100%, .75);
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background .18s, color .18s, transform .18s;
  flex-shrink: 0
}

.carousel-arrow:active {
  background: rgba(255, 106, 97, .35);
  color: #fff;
  transform: translateY(-50%) scale(.92)
}

.carousel-arrow.left {
  left: 0
}

.carousel-arrow.right {
  right: 0
}

.carousel-arrow.hidden {
  opacity: 0;
  pointer-events: none
}

.activity-carousel {
  container-type: inline-size;
}

#special-carousel,
#duel-cards-bar {
  --activity-gap: 12px;
  position: relative;
  display: flex;
  gap: var(--activity-gap);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 0 2px;
  scroll-padding-inline: 2px;
}

#special-carousel::-webkit-scrollbar,
#duel-cards-bar::-webkit-scrollbar {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  #special-carousel, #duel-cards-bar { scroll-behavior: auto }
}

/* === [2026-07-20] Карточки-активности ===
   Два уровня, намеренно разной стоимости отрисовки.

   .act-card — малые карточки каруселей (Актуально / Дуэли / Мини-игры).
   Заливка и одно цветное свечение приходят инлайном из game.js. Ровно один
   градиентный слой, никакого блендинга и фильтров: этих карточек на экране
   до восьми, они живут в горизонтальных каруселях, и каждый лишний слой —
   перерисовка на каждом кадре скролла. На бюджетном Android это первое, что
   начинает дёргаться. Огранка (радиус, рамка, тень) — общая с .glass-card /
   .stage-card, то есть с блоками ТОПа и кнопками; цвет рамки задаётся
   инлайном и кодирует тип активности.

   .act-card--hero — крупная карточка «Прохождение». Одна на экран, не
   скроллится вбок, занимает достаточную площадь, чтобы mesh-градиент
   действительно читался перетеканием двух тонов. Только здесь есть смысл
   платить за пять слоёв фона и плёнку шума. */
.act-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;

  /* Край один в один как у .glass-card / .stage-card. Цвет рамки
     переопределяется инлайном из game.js — он кодирует состояние
     (todo / live / idle), см. _ACT_STATES. */
  border-radius: var(--card-radius);
  border: 1px solid hsla(0, 0%, 100%, .1);
  box-shadow:
    0 10px 25px rgba(0, 0, 0, .3),
    inset 0 1px 0 hsla(0, 0%, 100%, .05);

  transition: transform .18s cubic-bezier(.22, 1, .36, 1);
}

.act-card:active {
  transform: scale(.985);
}

/* --- Крупная карточка --- */
/* [2026-07-20] isolation: isolate убран вместе с mix-blend-mode: отдельный
   контекст наложения был нужен только ради смешивания. */

/* Зерно поверх mesh. Крупные мягкие градиенты на 8-битной матрице телефона
   дают полосы (banding); плёнка шума их разбивает. Псевдоэлемент, а не
   отдельный div: не раздувает DOM и не попадает под глобальный сброс
   div{background-image:none}.
   [2026-07-20] mix-blend-mode: overlay убран. Две причины. Смешивание
   требует от движка читать пиксели подложки и считать их попиксельно, и на
   старых Android WebView это местами роняло весь слой на программную
   отрисовку — самый рискованный путь из всех, что тут были. При этом на
   подложке #0a0e1a режим overlay работает почти как умножение: шум едва
   темнил и был на пределе различимости, то есть риск брался впустую.
   Обычное наложение слегка высветляет — зерно видно лучше, стоит дешевле. */
.act-card--hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

/* Контент должен лежать выше плёнки шума */
.act-card--hero > * {
  position: relative;
  z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
  .act-card { transition: none; }
  .act-card:active { transform: none; }
}

/* === [2026-07-20] Строки ТОПа и блоки меню в стиле карточек-активностей ===

   Цвет приходит ОДНОЙ инлайновой переменной --acc-rgb (три числа, без
   rgb()). Так на сотню строк рейтинга уезжает по 20 байт стиля вместо
   собранной в JS градиентной строки на каждую, и всё оформление правится
   здесь, а не в разметке.

   Специфичность двойная (.rank-row.stage-card), чтобы перебить
   .stage-card{...!important} из блока оверрайдов выше по файлу, и глобальный
   сброс div{background-image:none!important} — при равном !important решает
   специфичность, у одиночного div она ниже.

   Тени здесь НЕТ намеренно. Это единственное, что реально просаживает
   скролл длинного списка: тень требует прохода размытия за границами
   элемента, а строк до сотни. Строки идут вплотную, тень между ними всё
   равно не читается — роль разделителя выполняет рамка. */
/* Класс rank-row — ТОЛЬКО у строк рейтинга (игроки и классы). Раньше здесь
   стоял .fl-rank-row, но это класс АНИМАЦИИ появления, и его же носят сетка
   достижений, карточка «твоё место» и блок значка в профиле — они получали
   чужое оформление, а их собственные инлайновые градиенты перебивались
   правилом с !important. Плюс анимацию теперь получают только первые
   двенадцать строк, и остальные остались бы вообще без стиля. */
.rank-row.stage-card,
.menu-card.stage-card {
  --acc-rgb: 143, 163, 184;          /* нейтральный сталь-синий по умолчанию */
  --acc-glow: .17;                   /* сила свечения */
  --acc-brd: .30;                    /* прозрачность рамки */

  /* Блоки меню на последнем экране берут отсюда всё: нейтральную рамку и
     плоскую заливку, без своего цвета и без градиента. Цвет там ничего не
     различал — на служебном экране нет типов активности.

     [2026-07-20] Свечение здесь СНЯТО. Обычная строка рейтинга — просто
     плотная заливка и рамка, без градиентного слоя вообще. Раньше слой
     был у всех ста строк, а различал он ровно три из них.
     Градиент теперь объявлен ниже — только там, где он что-то значит:
     призовые места, своя строка, фазы царя горы и блоки меню.
     Отдельно объявлять background-image:none не нужно: в styles.css выше
     стоит глобальный сброс div{background-image:none!important}, а он как
     раз и оставляет обычные строки чистыми. */
  background: var(--card-bg) !important;
  /* Иначе свечение затекает под полупрозрачную рамку и вместо чёткой
     линии выходит размытый ореол. */
  background-clip: padding-box !important;
  -webkit-background-clip: padding-box !important;

  border: 1px solid rgba(var(--acc-rgb), var(--acc-brd)) !important;
  border-radius: var(--card-radius) !important;
  box-shadow: none !important;

  /* Было transition:all .3s — all заставляет браузер сверять все
     анимируемые свойства при каждом пересчёте стилей, на сотне строк это
     заметно. Сужаем до того, что действительно меняется. */
  transition: transform .18s cubic-bezier(.22, 1, .36, 1),
              border-color .18s ease !important;
}

/* Свечение. Селекторы перечислены явно, чтобы обычные строки рейтинга
   (а их до сотни) не получали градиентный слой вообще. Специфичность у
   каждого не ниже .menu-card.stage-card — этого хватает, чтобы перебить
   глобальный сброс div{background-image:none!important}. */
.rank-row.stage-card.rank-t1,
.rank-row.stage-card.rank-t2,
.rank-row.stage-card.rank-t3,
.rank-row.stage-card.current-user-card,
.rank-row.stage-card.rank-king-purple,
.rank-row.stage-card.rank-king-gold {
  background-image: radial-gradient(
      72% 190% at 0% 50%,
      rgba(var(--acc-rgb), var(--acc-glow)) 0%,
      rgba(var(--acc-rgb), 0) 68%) !important;
}

/* [2026-07-20] БАГ: здесь стояло background: var(--card-bg) !important —
   сокращённое свойство, которое заодно сбрасывает background-image в none.
   Из-за этого при нажатии на строку подцветка призового места исчезала на
   долю секунды перед открытием профиля. Правило нужно только чтобы погасить
   белую вспышку от .stage-card:active{background:hsla(0,0%,100%,.2)},
   поэтому трогаем ровно цвет — background-color, не shorthand. */
.rank-row.stage-card:active,
.menu-card.stage-card:active {
  transform: scale(.985);
  background-color: var(--card-bg) !important;
}

/* [2026-07-20] Призовые места. Прежняя версия ставила цвет инлайновой
   переменной каждой строке и держала ту же слабую прозрачность, что у
   остальных, — золото на тёмном фоне при .17 было практически не видно.
   Здесь свечение и рамка заметно плотнее, а обычные строки не несут
   инлайновых стилей совсем: им хватает значений по умолчанию выше. */
.rank-row.stage-card.rank-t1 {
  --acc-rgb: 232, 193, 90;
  --acc-glow: .34;
  --acc-brd: .52;
}

.rank-row.stage-card.rank-t2 {
  --acc-rgb: 196, 205, 214;
  --acc-glow: .27;
  --acc-brd: .44;
}

.rank-row.stage-card.rank-t3 {
  --acc-rgb: 205, 139, 82;
  --acc-glow: .27;
  --acc-brd: .44;
}

/* Своя строка — тот же зелёный, что у бейджа «ТЫ», только плотнее.
   Свойство animation здесь НЕ трогаем: .fl-rank-row ниже по файлу уже
   выигрывает у .current-user-card при равной специфичности, то есть
   currentUserBorderCycle не проигрывался и раньше. Своё animation
   сбросило бы animation-delay и сломало ступенчатое появление. */
.rank-row.stage-card.current-user-card {
  --acc-rgb: 62, 207, 142;
  --acc-glow: .34;
  --acc-brd: .6;
  /* [2026-07-20] Только цвет. Ни animation:none, ни opacity:1, ни position —
     они мешали своей строке выезжать в общей анимации и были нужны лишь под
     старый absolute-бейдж (его больше нет, бейдж inline .you-tag в потоке).
     Выезд flRankRowIn играет как у всех; статику даёт общий fl-rank-static. */
}


/* === Слайд карусели активностей ===
   [2026-07-20] Стало шире и ниже: метка над заголовком убрана, картинка
   переехала влево в строку с заголовком. На широкой карточке заголовок
   вроде «Безопасность на железной дороге» укладывается в две строки, а не
   в четыре, — карточка перестала тянуться вверх. Видно ~1.4 карточки,
   край следующей всё ещё торчит и намекает, что можно листать. */
.act-slide {
  flex: 0 0 clamp(232px, 68vw, 268px);
  scroll-snap-align: start;
  display: flex;
  align-items: stretch;
}
.act-slide > div {
  width: 100%;
}

/* === Карусель мини-игр (Шаг 2) === */
#minigames-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding: 0 2px;
  margin-bottom: 4px;
}
#minigames-carousel::-webkit-scrollbar {
  display: none;
}
/* Игровая карточка — компактнее, чем в «Актуально» */
.mg-slide {
  flex: 0 0 clamp(186px, 54vw, 212px);
  scroll-snap-align: start;
  display: flex;
  align-items: stretch;
}
.mg-slide > div {
  width: 100%;
}

.king-gold-border {
  border-radius: 50% !important;
  position: relative !important;
  overflow: visible !important;
  border: none !important;
  padding: 2px !important;
  background: transparent !important;
  box-shadow: 0 0 12px rgba(255, 215, 0, .6) !important;
  isolation: isolate
}

/* [оптимизация] Переливающаяся золотая рамка «царя горы». Раньше двигался
   background-position — это перерисовка в каждом кадре. Теперь вращается
   слой с коническим градиентом — это делает видеокарта. */
.king-gold-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(gold, orange, #ffec6e, #ff8c00, gold);
  animation: kingSpin 3s linear infinite;
  z-index: -1;
  pointer-events: none
}

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

.king-gold-border img {
  border-radius: 50%;
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  background: #0a0e1a
}


.rank-king-purple,
/* [2026-07-20] Фазы «царя горы» задают только цвет — геометрия и свечение
   общие с остальными строками. Свои border/box-shadow убраны. */
.rank-row.stage-card.rank-king-purple {
  --acc-rgb: 168, 85, 247;
  --acc-glow: .34;
  --acc-brd: .52
}

.rank-row.stage-card.rank-king-gold {
  --acc-rgb: 232, 193, 90;
  --acc-glow: .34;
  --acc-brd: .52
}

#missions-progress-fill {
  height: 11px !important;
  border-radius: 4px !important;
  background: linear-gradient(90deg, #00f2fe, #a259ff, #ff6a61) !important;
  min-width: 0
}

#ach-overall-fill,
#missions-progress-fill {
  box-shadow: none !important;
  display: block !important
}

#ach-overall-fill {
  background: linear-gradient(90deg, gold, #ff6a61, #c850c0) !important;
  transition: width 1.2s cubic-bezier(.22, 1, .36, 1) !important
}

[role=button]:active,
button:not([class]):active {
  transform: scale(.95);
  transition: transform .12s cubic-bezier(.4, 0, .2, 1)
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(8px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

/* [2026-08-18] Было margin-top:-40px !important. Это компенсировало три <br>
   после контейнера предметов в index.html: они всегда оставались в потоке и
   давали ~60px пустоты сверху. Предметы удалены вместе с крафтом, <br> ушли —
   и минус 40 стал наезжать заголовком «Достижения» прямо на вкладки. */
#inv-achievements-container {
  margin-top: 0
}

.fl-msg {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: hsla(0, 0%, 100%, .3);
  padding: 32px 20px;
  line-height: 1.4
}

.fl-msg--lg {
  padding: 40px 20px
}

.fl-msg--md {
  padding: 20px
}

.fl-msg--sm {
  padding: 12px;
  font-size: 12px
}


.fl-msg--dim {
  color: var(--text-dim)
}

.fl-msg--error {
  color: var(--fire)
}

.fl-msg--error-soft {
  color: rgba(244, 67, 54, .6)
}


.fl-msg--loading {
  color: hsla(0, 0%, 100%, .4);
  font-weight: 600
}

.fl-msg__emoji {
  font-size: 28px;
  margin-bottom: 8px;
  line-height: 1
}










.mission-answer--locked {
  pointer-events: none
}

.mission-answer--dim {
  opacity: .4
}

.mission-answer--correct {
  background: rgba(76, 175, 80, .3);
  border-color: #4caf50;
  color: #fff
}

.mission-answer--wrong {
  background: rgba(244, 67, 54, .3);
  border-color: #ff5252;
  color: #fff
}



/* ============================================================
   ПАНЕЛЬ УВЕДОМЛЕНИЙ  [2026-08-17, ред. 2]
   Вариант «живые баннеры»: каждое уведомление — самостоятельная
   карточка со свечением по типу события; у тех, где есть что
   сделать, кнопка действия прямо в карточке.
   Окно модалки прозрачное, шапки нет — карточки лежат прямо
   поверх затемнённого фона.
   ============================================================ */

/* --- Фон панели: тон интерфейса, а не чёрный ---------------------
   .bg-gradient рисует экраны радиальным градиентом #111827 -> #0a0e1a.
   Повторяем его же, чтобы панель садилась на свой фон, а не на чёрную
   заливку. Ниже по файлу есть
   .modal-overlay { background: var(--overlay-bg) !important } —
   селектор по id вместе с !important перебивает его, остальные
   модалки продолжают затемняться как раньше.

   [2026-08-19] Было .82 и .93 по альфе. Задумка держалась на размытии
   карточек, но backdrop-filter у .fl-notif-row так и не появился, и
   сквозь панель просвечивал весь экран: заголовки, кнопки, карусель.
   Читать уведомления было невозможно. Градиент тот же, альфа убрана. */
#modal-envelope {
  background: radial-gradient(circle at 50% 42%,
      rgb(17, 24, 39) 0,
      rgb(10, 14, 26) 100%) !important;
}

/* Полосы сверху и снизу — это HUD и док, просвечивавшие сквозь
   полупрозрачное затемнение. Пока панель открыта, прячем их.
   Класс body.notif-open ставит и снимает game.js. */
/* Только прозрачность. pointer-events здесь СОЗНАТЕЛЬНО не трогаем:
   пока панель открыта, клики всё равно перехватывает оверлей поверх,
   а если класс по какой-то причине не снимется, интерфейс останется
   рабочим, а не превратится в мёртвый. */
body.notif-open .hud,
body.notif-open .dock {
  opacity: 0;
  transition: opacity .22s ease;
}

/* Волосяная линия у верхнего края окна: её рисует общее правило
   .glass-card:after, .modal-window:after, .stage-card:after.
   Для прозрачной панели она не нужна. */
#modal-envelope .modal-window--bare:after,
#modal-envelope .modal-window--bare:before {
  content: none !important;
}

/* --- Прозрачное окно ТОЛЬКО для панели уведомлений ---------------
   Ниже по файлу есть глобальное .modal-window { background: ... !important }
   для системы редкостей. Селектор по id перебивает его по
   специфичности, остальные модалки не затрагиваются. */
#modal-envelope .modal-window--bare {
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: visible;
}

/* --- Раскладка панели во всю высоту -----------------------------
   [2026-08-19] Панель наследовала общую раскладку модалок: оверлей
   центрирует окно по вертикали, на мобильных сверху добавляется
   margin-top:90px, а у .modal-body стоит инлайновый max-height:74vh.
   В сумме список висел посередине с широкой пустой полосой под
   кнопкой «Закрыть» и не занимал доступную высоту.

   Здесь окно растягивается на всю высоту оверлея, а верхний отступ
   считается от высоты самой кнопки, а не задан числом. Кнопка
   собрана из clamp'ов, поэтому те же clamp'ы повторены в расчёте:
   на узком экране отступ уменьшается вместе с кнопкой, на широком
   упирается в тот же потолок. Правки действуют только на
   #modal-envelope, остальные модалки не затрагиваются. */
#modal-envelope {
  /* высота кнопки: паддинги сверху и снизу + строка + рамки */
  --nz-close-h: calc(2 * clamp(12px, 3vw, 16px) + clamp(14px, 4vw, 16px) * 1.25 + 4px);
  /* её отступ от верха, с учётом выреза */
  --nz-close-top: max(clamp(15px, 6vw, 25px), env(safe-area-inset-top, 15px));

  align-items: stretch !important;
  justify-content: center !important;
  padding-top: calc(var(--nz-close-top) + var(--nz-close-h) + clamp(8px, 2.5vw, 14px));
  padding-bottom: max(var(--screen-padding), env(safe-area-inset-bottom, 12px));
  /* скроллит внутренний список, а не оверлей — иначе две полосы сразу */
  overflow: hidden;
}

#modal-envelope .modal-window--bare {
  /* перебивает .modal-window{max-height:90vh} и мобильный margin-top:90px */
  margin: 0 !important;
  max-height: none !important;
  height: 100%;
  display: flex;
  flex-direction: column;
  animation: none;
  transform: none;
}

#modal-envelope .modal-window--bare .modal-body {
  /* инлайновый max-height:74vh из index.html снимается только !important */
  max-height: none !important;
  flex: 1 1 auto;
  min-height: 0;
  /* Скролл без видимой полосы — карточки не должны упираться в рамку */
  scrollbar-width: none;
}

#modal-envelope .modal-window--bare .modal-body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* --- Заголовок окна и счётчик одинаковых уведомлений (2026-10-18) --- */
.fl-notif-head-title {
  font-size: clamp(18px, 5vw, 21px);
  font-weight: 800;
  color: #fff;
  margin: 0 6px 14px;
}
.fl-notif-count {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12) !important;
  font-size: .8em;
  font-weight: 800;
  vertical-align: 1px;
}

/* --- Заголовок дня --- */
.fl-notif-day {
  font-weight: 700;
  margin: 16px 6px 9px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

.fl-notif-head-title + .fl-notif-day,
.fl-notif-day:first-child {
  margin-top: 0;
}

/* --- Карточка --- */
.fl-notif-row {
  position: relative;
  border-radius: 18px;
  margin-bottom: 10px;

  /* Подложка: карточка читается отдельным слоем поверх фона панели,
     а не сливается с ним. Размытия тут нет и не нужно — фон панели
     непрозрачный, десять процентов белого дают достаточный край. */
  background: hsla(0, 0%, 100%, .1);
  border: 1px solid hsla(0, 0%, 100%, .15);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, .34),
    inset 0 1px 0 hsla(0, 0%, 100%, .1);

  transition: transform .16s cubic-bezier(.22, 1, .36, 1), background .18s ease;

  opacity: 0;
  transform: translateY(10px);
  animation: flNotifIn var(--enter-dur) var(--ease-soft) forwards;
  animation-delay: calc(var(--i, 0) * 48ms);
}

@keyframes flNotifIn {
  to { opacity: 1; transform: none }
}

/* Цвет типа события. Ключ ставит game.js в data-kind. */
.fl-notif-row[data-kind="duel"]   { --k-rgb: 139, 92, 246 }
.fl-notif-row[data-kind="gift"]   { --k-rgb: 244, 114, 182 }
.fl-notif-row[data-kind="award"]  { --k-rgb: 251, 191, 36 }
.fl-notif-row[data-kind="friend"] { --k-rgb: 52, 211, 153 }
.fl-notif-row[data-kind="learn"]  { --k-rgb: 56, 189, 248 }
.fl-notif-row[data-kind="system"] { --k-rgb: 148, 163, 184 }

/* Непрочитанное — карточка «живая»: тон и свечение по типу */
.fl-notif-row--unread {
  /* Два слоя: цвет типа поверх той же стеклянной подложки, что и у
     прочитанных. Так непрочитанное выделяется тоном, но остаётся
     в одном материале с остальными карточками. */
  background:
    linear-gradient(0deg,
      rgba(var(--k-rgb, 148, 163, 184), .17),
      rgba(var(--k-rgb, 148, 163, 184), .17)),
    hsla(0, 0%, 100%, .1);
  border-color: rgba(var(--k-rgb, 148, 163, 184), .4);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, .34),
    0 0 28px rgba(var(--k-rgb, 148, 163, 184), .18),
    inset 0 1px 0 hsla(0, 0%, 100%, .13);
}

/* --- Шапка карточки: заголовок со значком, время --- */
.fl-notif-head {
  display: flex;
  align-items: center;
}

/* Значок — в строке заголовка, сразу после текста, размером с текст, без подложки */
.fl-notif-ico {
  font-size: 1em;
  line-height: 1;
  margin-left: 4px;
  white-space: nowrap
}

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

.fl-notif-title {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -.01em;
  color: #fff;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fl-notif-row:not(.fl-notif-row--unread) .fl-notif-title {
  color: hsla(0, 0%, 100%, .85);
}

/* [2026-08-19] Было .32 — контраст 2.8, дата почти не читалась. */
.fl-notif-time {
  font-size: 11px;
  color: hsla(0, 0%, 100%, .42);
  margin-top: 2px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* [2026-08-19] Было .55 — на непрозрачном фоне это 5.2 по контрасту,
   но на мелком кегле 12.5px читается тяжело. .62 даёт 6.2. */
.fl-notif-text {
  font-size: 12.5px;
  color: hsla(0, 0%, 100%, .62);
  line-height: 1.4;
  margin-top: 10px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.fl-notif-row--unread .fl-notif-text {
  color: hsla(0, 0%, 100%, .72);
}

/* --- Компактная карточка (без действия) --- */
.fl-notif-row--plain .fl-notif-text {
  margin-top: 2px;
}

.fl-notif-row--plain .fl-notif-time {
  position: absolute;
  top: 15px;
  right: 14px;
  margin-top: 0;
}

.fl-notif-row--plain .fl-notif-title {
  padding-right: 52px;
}

/* --- Кнопки действия --- */
.fl-notif-actions {
  display: flex;
  gap: 8px;
  margin-top: 11px;
}

.fl-notif-btn {
  flex: 1;
  text-align: center;
  padding: 9px 10px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgb(var(--k-rgb, 148, 163, 184));
  border: 0;
  cursor: pointer;
  font-family: inherit;
  transition: transform .14s cubic-bezier(.22, 1, .36, 1), filter .14s ease;
}

.fl-notif-btn:active {
  transform: scale(.97);
  filter: brightness(1.12);
}

.fl-notif-btn--ghost {
  flex: 0 0 auto;
  padding: 9px 16px;
  background: hsla(0, 0%, 100%, .08);
  color: hsla(0, 0%, 100%, .6);
  font-weight: 500;
}

/* --- Пустое состояние --- */
.fl-notif-empty {
  text-align: center;
  padding: 52px 20px 46px;
}

.fl-notif-empty__glyph {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: hsla(0, 0%, 100%, .09);
  border: 1px solid hsla(0, 0%, 100%, .14);
  box-shadow: inset 0 1px 0 hsla(0, 0%, 100%, .1);
}

.fl-notif-empty__title {
  font-size: 15px;
  font-weight: 600;
  color: hsla(0, 0%, 100%, .82);
  margin-bottom: 5px;
}

.fl-notif-empty__sub {
  font-size: 13px;
  color: hsla(0, 0%, 100%, .42);
  line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
  .fl-notif-row {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

































.fl-dp-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px
}

.fl-dp-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: hsla(0, 0%, 100%, .1);
  border: 2px solid var(--primary);
  overflow: hidden
}

.fl-dp-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover
}

.fl-dp-info {
  flex: 1;
  min-width: 0;
  margin-left: 12px
}

.fl-dp-name {
  font-weight: 800;
  color: var(--text-light);
  font-size: clamp(12px, 3.5vw, 14px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.fl-dp-meta {
  font-size: 11px;
  color: hsla(0, 0%, 100%, .4);
  margin-top: 2px
}

.fl-dp-rank-wrap {
  text-align: right;
  flex-shrink: 0
}

.fl-dp-rank {
  color: var(--gold);
  font-weight: 800;
  font-size: 14px
}

.fl-duel-step-meta {
  font-size: 11px;
  color: hsla(0, 0%, 100%, .4);
  margin-top: 4px;
  font-weight: 600
}

.fl-duel-step-meta__theme {
  color: rgba(0, 210, 255, .8)
}

.fl-duel-step-meta__change {
  cursor: pointer;
  text-decoration: underline;
  color: hsla(0, 0%, 100%, .4)
}

.fl-duel-players-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 55vh;
  overflow-y: auto
}

.fl-modal-body-padded {
  padding: 0 16px 20px
}

.fl-modal-header-tight {
  padding-bottom: 8px
}

.duel-player-row {
  cursor: pointer;
  margin-bottom: 0
}





/* [2026-07-20] will-change: transform, opacity — УБРАН.

   Он просил браузер держать каждую строку отдельным слоем композитора.
   На списке в сотню строк это давало сотню слоёв, которые жили всё время,
   пока открыт экран, и каждый из них надо было растеризовать отдельно.

   Управлять этим вручную (навешивать класс-освободитель после анимации)
   оказалось хуже, чем не создавать слои вовсе: строки с задержкой свыше
   1500мс доигрывают одновременно, и снятие will-change сносило десятки
   слоёв в одном кадре — заметный провал, во время которого терялись касания.

   Хинт здесь и не нужен. Браузер сам поднимает элемент на композитор на
   время работающей анимации transform/opacity и сам опускает после неё.
   will-change отличается только тем, что делает подъём постоянным. */
.fl-rank-row {
  opacity: 0;
  --final-opacity: 1;
  transform: translateY(var(--enter-shift));
  /* Мягкое появление: без увеличения, плавное торможение, прозрачность
     нарастает всё время анимации. Раньше строка проходила почти весь путь
     за первую десятую секунды и «выпрыгивала». */
  animation: flRankRowIn .6s var(--ease-soft) forwards;
  animation-delay: calc(min(var(--i, 0) * 45, 450)*1ms);
}

@keyframes flRankRowIn {
  0% {
    opacity: 0;
    transform: translateY(var(--enter-shift))
  }

  to {
    opacity: var(--final-opacity);
    transform: none
  }
}

/* [2026-07-20] Показать список СРАЗУ, без анимации появления.

   Нужен, чтобы убрать двойную отрисовку экрана рейтинга. При переходе на
   экран его контейнер меняет display:none на block, и браузер по этому
   поводу перезапускает CSS-анимации у всего, что внутри. То есть сначала
   красиво выезжал СТАРЫЙ список, оставшийся с прошлого захода, а через
   пару сотен миллисекунд приходил ответ сервера, innerHTML заменялся — и
   ровно та же анимация играла второй раз уже на новых данных.

   Отличается от .fl-rank-anim-reset: тот только глушит animation, а при
   выключенной анимации строка остаётся на opacity:0, то есть невидимой —
   он рассчитан на снятие в том же кадре. Здесь строка именно ПОКАЗЫВАЕТСЯ.

   Селектор потомка, а не прямого ребёнка: строка текущего игрока обёрнута
   в дополнительный div ради бейджа «ТЫ» и прямым ребёнком контейнера не
   является. */
.fl-rank-static .fl-rank-row {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important
}

.fl-rank-anim-reset .fl-rank-row {
  animation: none !important
}

@media (prefers-reduced-motion:reduce) {
  .fl-rank-row {
    animation: none;
    opacity: 1;
    transform: none
  }
}

.gift-popup-footer .gift-action-btn {
  width: 100%;
  height: clamp(48px, 13vw, 56px);
  font-size: clamp(14px, 4vw, 16px);
  font-weight: 700;
  border-radius: 14px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(0, 242, 254, .18), rgba(67, 134, 245, .1));
  border: 1px solid rgba(0, 242, 254, .35);
  color: #fff;
  cursor: pointer;
  transition: transform .15s ease, background .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px
}

.gift-popup-footer .gift-action-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(0, 242, 254, .28), rgba(67, 134, 245, .14))
}

.gift-popup-footer .gift-action-btn:active {
  transform: scale(.97)
}

.gift-popup-footer .gift-action-btn--merge {
  background: linear-gradient(135deg, rgba(168, 85, 247, .22), rgba(244, 114, 182, .14));
  border-color: rgba(168, 85, 247, .45)
}

.gift-popup-footer .gift-action-btn--merge:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, .32), rgba(244, 114, 182, .2))
}

.gift-card {
  position: relative
}

.gift-count-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, rgba(16, 185, 129, .95), rgba(5, 150, 105, .95));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 12px;
  z-index: 5;
  box-shadow: 0 0 16px rgba(16, 185, 129, .7), 0 0 32px rgba(16, 185, 129, .4), inset 0 1px 0 hsla(0, 0%, 100%, .2);
  letter-spacing: .5px;
  pointer-events: none;
  border: 1px solid rgba(74, 222, 128, .4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px)
}

.gift-send-summary {
  background: hsla(0, 0%, 100%, .04);
  border: 1px solid hsla(0, 0%, 100%, .08);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px
}

.gift-send-summary__gift {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px
}

.gift-send-summary__icon {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0
}

.gift-send-summary__name {
  font-weight: 700;
  color: var(--text-light, #fff);
  font-size: 15px
}

.gift-send-summary__sub {
  font-size: 11px;
  opacity: .6;
  margin-top: 2px
}

.gift-send-summary__stats {
  display: flex;
  gap: 12px
}

.gift-send-stat {
  flex: 1;
  background: rgba(0, 0, 0, .2);
  border: 1px solid hsla(0, 0%, 100%, .06);
  border-radius: 10px;
  padding: 8px 12px;
  text-align: center
}

.gift-send-stat__label {
  font-size: 10px;
  opacity: .65;
  text-transform: uppercase;
  letter-spacing: .4px
}

.gift-send-stat__value {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-light, #fff);
  margin-top: 2px
}

.gift-send-stat--bad {
  background: rgba(244, 67, 54, .12);
  border-color: rgba(244, 67, 54, .3)
}

.gift-send-stat--bad .gift-send-stat__value {
  color: #f87171
}

.gift-send-warning {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(244, 67, 54, .1);
  border: 1px solid rgba(244, 67, 54, .25);
  border-radius: 10px;
  font-size: 12px;
  color: #fca5a5;
  text-align: center
}

.gift-search-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  background: hsla(0, 0%, 100%, .08);
  border: 1px solid hsla(0, 0%, 100%, .15);
  color: var(--text-light, #fff);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  margin-bottom: 12px;
  transition: border-color .2s, background .2s
}

.gift-search-input:focus {
  border-color: rgba(0, 242, 254, .5);
  background: hsla(0, 0%, 100%, .1)
}

.gift-search-input:disabled {
  opacity: .4;
  cursor: not-allowed
}

.gift-search-results {
  max-height: 320px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch
}

.gift-search-hint {
  text-align: center;
  padding: 20px;
  opacity: .55;
  font-size: 13px;
  font-style: italic
}

.gift-recipient {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: hsla(0, 0%, 100%, .04);
  border: 1px solid hsla(0, 0%, 100%, .06);
  border-radius: 12px;
  margin-bottom: 8px
}

.gift-recipient__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: hsla(0, 0%, 100%, .05)
}

.gift-recipient__info {
  flex: 1;
  min-width: 0
}

.gift-recipient__name {
  font-weight: 600;
  color: var(--text-light, #fff);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.gift-recipient__verified {
  width: 14px;
  height: 11px;
  flex-shrink: 0
}

.gift-recipient__id {
  font-size: 11px;
  opacity: .6;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.gift-recipient__pick {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, #00f2fe, #4386f5);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  border: none;
  cursor: pointer;
  transition: transform .15s
}

.gift-recipient__pick:hover {
  transform: scale(1.04)
}

.gift-recipient__pick:active {
  transform: scale(.96)
}

.gift-recipient__pick:disabled {
  opacity: .5;
  cursor: not-allowed
}

.gift-picker-header-text {
  text-align: center;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-dim, hsla(0, 0%, 100%, .7))
}

.gift-picker-header-text small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  opacity: .6
}

.gift-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 12px;
  max-height: 360px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px
}

.gift-picker-card {
  position: relative;
  background: hsla(0, 0%, 100%, .05);
  border: 1px solid hsla(0, 0%, 100%, .08);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: transform .15s, background .2s, border-color .2s
}

.gift-picker-card:hover {
  transform: translateY(-2px);
  background: rgba(0, 242, 254, .08);
  border-color: rgba(0, 242, 254, .3)
}

.gift-picker-card:active {
  transform: scale(.96)
}

.gift-picker-card__visual {
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center
}

.gift-picker-card__visual img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain
}

.gift-picker-card__name {
  font-size: 10px;
  line-height: 1.2;
  opacity: .85;
  max-height: 2.4em;
  overflow: hidden
}

.merge-from {
  text-align: center;
  margin-bottom: 12px;
  font-size: 13px;
  opacity: .75
}

.merge-preview {
  text-align: center;
  padding: 12px 0
}

.merge-pair {
  gap: 16px;
  margin-bottom: 16px
}

.merge-gift,
.merge-pair {
  display: flex;
  align-items: center;
  justify-content: center
}

.merge-gift {
  width: 70px;
  height: 70px;
  background: rgba(168, 85, 247, .1);
  border: 2px solid rgba(168, 85, 247, .35);
  border-radius: 16px;
  overflow: hidden;
  animation: mergeBob 2.2s ease-in-out infinite
}

.merge-gift img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain
}

.merge-gift:nth-child(3) {
  animation-delay: .5s
}

.merge-plus {
  font-size: 28px;
  font-weight: 800;
  color: rgba(168, 85, 247, .9);
  text-shadow: 0 0 10px rgba(168, 85, 247, .5)
}

.merge-arrow {
  font-size: 28px;
  color: rgba(168, 85, 247, .7);
  margin: 8px 0;
  animation: mergeArrowPulse 1.4s ease-in-out infinite
}

.merge-mystery {
  margin-bottom: 16px
}

.merge-box {
  width: 90px;
  height: 90px;
  margin: 0 auto;
  background: linear-gradient(135deg, gold, orange);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .4);
  box-shadow: 0 0 28px rgba(255, 215, 0, .55), inset 0 2px 8px hsla(0, 0%, 100%, .3), inset 0 -2px 8px rgba(0, 0, 0, .2);
  animation: mergeBoxFloat 2.5s ease-in-out infinite
}

.merge-box--shake {
  animation: mergeBoxShake .5s ease-in-out infinite !important
}

.merge-mystery__caption {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 700;
  color: gold;
  text-shadow: 0 0 10px rgba(255, 215, 0, .4)
}

.merge-mystery__hint {
  font-size: 11px;
  opacity: .6;
  margin-top: 2px
}

.merge-explain {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim, hsla(0, 0%, 100%, .75));
  margin: 16px 0;
  padding: 0 8px
}

.merge-explain b {
  color: var(--text-light, #fff)
}

.merge-confirm-btn {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .5px;
  border: none;
  cursor: pointer;
  transition: transform .15s;
  box-shadow: 0 4px 18px rgba(168, 85, 247, .4)
}

.merge-confirm-btn:hover {
  transform: translateY(-1px)
}

.merge-confirm-btn:active {
  transform: scale(.97)
}

.merge-confirm-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none
}

.merge-empty {
  text-align: center;
  padding: 32px 12px;
  opacity: .8
}

.merge-result {
  text-align: center;
  padding: 12px 4px;
  position: relative;
  overflow: hidden;
  animation: mergeResultIn .6s cubic-bezier(.34, 1.56, .64, 1)
}

.merge-result__flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, hsla(0, 0%, 100%, .6) 0, transparent 65%);
  animation: mergeFlash .8s ease-out forwards;
  pointer-events: none;
  z-index: 1
}

.merge-result__visual {
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 24px var(--result-color, #d4af37));
  animation: mergeResultSpin 1s ease-out;
  position: relative;
  z-index: 2
}

.merge-result__visual img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain
}

.merge-result__name {
  font-size: 20px;
  font-weight: 800;
  color: var(--result-color, gold);
  text-shadow: 0 0 14px var(--result-color, gold);
  margin-bottom: 8px;
  position: relative;
  z-index: 2
}

.merge-result__desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim, hsla(0, 0%, 100%, .75));
  margin-bottom: 20px;
  padding: 0 12px;
  position: relative;
  z-index: 2
}

.merge-result__btn {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #00f2fe, #4386f5);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 1px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 242, 254, .45);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  position: relative;
  z-index: 2
}

.merge-result__btn:active {
  transform: scale(.97)
}


@keyframes mergeBob {

  0%,
  to {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-6px)
  }
}

@keyframes mergeArrowPulse {

  0%,
  to {
    opacity: .5;
    transform: scale(1)
  }

  50% {
    opacity: 1;
    transform: scale(1.15)
  }
}

@keyframes mergeBoxFloat {

  0%,
  to {
    transform: translateY(0) rotate(-2deg)
  }

  50% {
    transform: translateY(-8px) rotate(2deg)
  }
}

@keyframes mergeBoxShake {

  0%,
  to {
    transform: translate(0) rotate(0deg)
  }

  20% {
    transform: translate(-3px, -2px) rotate(-3deg)
  }

  40% {
    transform: translate(3px, -1px) rotate(3deg)
  }

  60% {
    transform: translate(-2px, 2px) rotate(-2deg)
  }

  80% {
    transform: translate(2px, 1px) rotate(2deg)
  }
}

@keyframes mergeResultIn {
  0% {
    transform: scale(.5);
    opacity: 0
  }

  to {
    transform: scale(1);
    opacity: 1
  }
}

@keyframes mergeResultSpin {
  0% {
    transform: scale(0) rotate(-180deg)
  }

  60% {
    transform: scale(1.2) rotate(20deg)
  }

  to {
    transform: scale(1) rotate(0deg)
  }
}

@keyframes mergeFlash {
  0% {
    opacity: 1
  }

  to {
    opacity: 0
  }
}

.gift-confirm {
  text-align: center;
  padding: 16px 8px;
  animation: mergeResultIn .35s ease-out
}

.gift-confirm__visual {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 242, 254, .08);
  border: 2px solid rgba(0, 242, 254, .3);
  border-radius: 16px
}

.gift-confirm__text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-light, #fff);
  margin-bottom: 12px
}

.gift-confirm__text b {
  color: #00f2fe
}

.gift-confirm__warn {
  font-size: 12px;
  line-height: 1.5;
  color: #fca5a5;
  background: rgba(244, 67, 54, .1);
  border: 1px solid rgba(244, 67, 54, .22);
  border-radius: 10px;
  padding: 12px 12px;
  margin-bottom: 16px
}

.gift-confirm__warn b {
  color: #fcd34d
}

.gift-confirm__buttons {
  display: flex;
  gap: 12px
}

.gift-confirm__btn {
  flex: 1;
  height: 50px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: transform .15s
}

.gift-confirm__btn:active {
  transform: scale(.96)
}

.gift-confirm__btn--back {
  background: hsla(0, 0%, 100%, .1);
  border: 1px solid hsla(0, 0%, 100%, .18);
  color: var(--text-light, #fff)
}

.gift-confirm__btn--go {
  background: linear-gradient(135deg, #00f2fe, #4386f5);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 242, 254, .35)
}

.gift-confirm__btn--go:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none
}

#skins-grid {
  display: block !important;
  padding: 0 !important;
  margin: 0 !important
}

.fc-track {
  position: relative;
  width: 100%;
  height: clamp(330px, 92vw, 400px);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  margin-bottom: 8px;
  overflow: visible
}

.fc-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(210px, 62vw, 240px);
  height: clamp(300px, 86vw, 340px);
  margin-left: calc(clamp(210px, 62vw, 240px)/-2);
  margin-top: calc(clamp(300px, 86vw, 340px)/-2);
  border-radius: 20px;
  border: 2px solid hsla(0, 0%, 100%, .1);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: grab;
  overflow: hidden;
  isolation: isolate;
  contain: layout paint;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden
}

.fc-card:active {
  cursor: grabbing
}

.fc-card.fc-paused,
.fc-card.fc-paused:after,
.fc-card.fc-paused:before {
  animation-play-state: paused !important
}

.fc-r1 {
  --rc: 156, 163, 175
}

.fc-r2 {
  --rc: 16, 185, 129
}

.fc-r3 {
  --rc: 59, 130, 246
}

.fc-r4 {
  --rc: 168, 85, 247
}

.fc-r5 {
  --rc: 245, 158, 11
}

.fc-r1,
.fc-r2,
.fc-r3,
.fc-r4,
.fc-r5 {
  background: radial-gradient(ellipse 80% 50% at 50% 0, rgba(var(--rc), .7), transparent 55%), radial-gradient(ellipse 80% 50% at 50% 100%, rgba(var(--rc), .48), transparent 55%), linear-gradient(135deg, rgba(var(--rc), .2), rgba(var(--rc), .06));
  box-shadow: 0 0 32px rgba(var(--rc), .38), inset 0 0 30px rgba(var(--rc), .16)
}

.fc-r1:before,
.fc-r2:before,
.fc-r3:before,
.fc-r4:before,
.fc-r5:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 90% 70% at 50% 50%, rgba(var(--rc), .32), transparent 65%);
  animation: fc-glow-pulse 2.8s ease-in-out infinite
}

@keyframes fc-glow-pulse {

  0%,
  to {
    opacity: .35
  }

  50% {
    opacity: 1
  }
}

.fc-r1:after,
.fc-r2:after,
.fc-r3:after,
.fc-r4:after,
.fc-r5:after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(1.5px 1.5px at 20% 30%, hsla(0, 0%, 100%, .95), transparent), radial-gradient(1.5px 1.5px at 75% 20%, rgba(var(--rc), .95), transparent), radial-gradient(1.5px 1.5px at 50% 70%, hsla(0, 0%, 100%, .85), transparent), radial-gradient(2px 2px at 85% 75%, rgba(var(--rc), .95), transparent), radial-gradient(1.5px 1.5px at 15% 65%, hsla(0, 0%, 100%, .8), transparent), radial-gradient(1.5px 1.5px at 65% 45%, rgba(var(--rc), .85), transparent);
  animation: fc-glow-sparkle 2.4s ease-in-out infinite
}

@keyframes fc-glow-sparkle {

  0%,
  to {
    opacity: .35
  }

  50% {
    opacity: 1
  }
}

@media (prefers-reduced-motion:reduce) {

  .fc-r1:after,
  .fc-r1:before,
  .fc-r2:after,
  .fc-r2:before,
  .fc-r3:after,
  .fc-r3:before,
  .fc-r4:after,
  .fc-r4:before,
  .fc-r5:after,
  .fc-r5:before {
    animation: none !important
  }
}

.fc-equipped-badge {
  left: 12px;
  color: #fff;
  border-radius: 6px
}

.fc-equipped-badge,
.fc-rarity-badge {
  position: absolute;
  top: 12px;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  letter-spacing: .5px;
  z-index: 2
}

.fc-rarity-badge {
  right: 12px;
  background: rgba(0, 0, 0, .5);
  border-radius: 6px;
  border: 1px solid
}

.fc-portrait {
  margin-top: 24px;
  width: clamp(150px, 46vw, 180px);
  height: clamp(150px, 46vw, 180px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative
}

.fc-portrait img {
  width: 122%;
  height: 122%;
  object-fit: contain;
  pointer-events: none;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .4))
}

.fc-portrait .fc-fallback {
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: clamp(54px, 16vw, 66px);
  font-weight: 800
}

.fc-portrait-locked {
  background: hsla(0, 0%, 100%, .04);
  border: 3px dashed hsla(0, 0%, 100%, .12)
}

.fc-stars {
  display: flex;
  gap: 4px;
  margin-top: 16px;
  font-size: clamp(15px, 4vw, 17px);
  line-height: 1
}

.fc-name {
  margin-top: 12px;
  font-size: clamp(17px, 4.6vw, 20px);
  font-weight: 800;
  line-height: 1.1
}

.fc-name,
.fc-sub {
  text-align: center
}

.fc-sub {
  margin-top: 4px;
  font-size: clamp(9px, 2.4vw, 10px);
  color: hsla(0, 0%, 100%, .4);
  letter-spacing: .5px
}




.fc-equip {
  background: var(--primary)
}

.fc-equip {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  color: #fff;
  border: none;
  font-size: clamp(12px, 3.2vw, 13px);
  font-weight: 600;
  letter-spacing: .5px;
  cursor: pointer;
  transition: transform .15s, opacity .2s;
  font-family: inherit
}

.fc-equip:disabled {
  cursor: default
}

.fc-equip:not(:disabled):active {
  transform: scale(.98)
}

#my-profile-modal .modal-window {
  overflow: visible !important
}

#my-profile-xp-bar-fill {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  height: 100% !important;
  width: 0;
  border-radius: 4px !important;
  background: linear-gradient(90deg, #00f2fe, #a259ff, #ff6a61) !important;
  transition: width .6s ease !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important
}


html.low-end .aurora-blob {
  animation: none !important
}

/* [оптимизация] На главном экране под шапкой ничего не прокручивается и не
   движется — размытие фона (backdrop-filter) там ничего не меняло, но
   держало под шапкой отдельный слой с пересчётом размытия. На остальных
   экранах под шапкой прокручивается содержимое — там размытие оставлено. */
/* Remove the whole hero layer and its animated image from inactive screens. */
#hero-img[hidden],
html[data-screen]:not([data-screen=home]) #hero-img {
  display: none !important;
}

#ach-unlock-toast[hidden] {
  display: none !important;
}

/* Give the achievement a row above the scrolling area on every tab. */
.content-limit.has-achievement-notice > .screen:not(#scr-home) {
  top: var(--achievement-bottom);
  padding-top: 6px !important;
}

html:not([data-screen]) .hud,
html[data-screen=home] .hud,
html:not([data-screen]) .hud:before,
html[data-screen=home] .hud:before {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important
}

/* Размытие шапки — на всю ширину экрана. Сама .hud стоит внутри
   .content-limit с боковыми отступами, поэтому размытие у неё было
   с щелями по краям. Переносим его в подложку шириной 100vw,
   содержимое шапки остаётся на прежнем месте. */
.hud {
  backdrop-filter: none;
  -webkit-backdrop-filter: none
}

.hud:before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px)
}

html.low-end .gift,
html.low-end .gift-float,
html.low-end [class*=-glow] {
  animation: none !important
}

.fl-acc-item {
  background: rgba(244, 67, 54, .05);
  border: 1px solid rgba(244, 67, 54, .15);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: background .2s ease, border-color .2s ease
}

.fl-acc-item.is-open {
  background: rgba(244, 67, 54, .08);
  border-color: rgba(244, 67, 54, .28)
}



















#stage-results-modal .modal-window {
  width: 100% !important;
  max-width: min(400px, 95vw) !important;
  overflow: hidden !important;
  display: flex;
  flex-direction: column
}

#stage-results-modal .modal-header {
  flex-shrink: 0
}

#stage-results-modal .modal-header h2 {
  font-size: 14px;
  font-weight: 700;}

#stage-results-modal #stage-results-score {
  margin-top: 4px
}






#stage-results-modal .modal-body {
  padding: 8px 16px 16px !important;
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain
}

#stage-results-modal .modal-body::-webkit-scrollbar {
  width: 4px
}

#stage-results-modal .modal-body::-webkit-scrollbar-thumb {
  background: hsla(0, 0%, 100%, .18);
  border-radius: 2px
}

#stage-results-modal .modal-body::-webkit-scrollbar-track {
  background: transparent
}
/* ===== Единый верхний отступ первого элемента на всех экранах (аудит) =====
   Раньше главный экран начинался с .branch-header (margin-top ~20px),
   а рейтинг/инвентарь — с .screen-title (padding-top 12px), из-за чего
   пустая полоса под шапкой профиля была разной высоты.
   Приводим к ритму .branch-header. Главный экран не меняется. */
/* Верхний отступ первого элемента экрана. Само вертикальное расстояние до
   шапки задаёт padding-top у .screen (и переопределения для конкретных
   экранов выше); здесь только обнуляем собственный отступ первого элемента,
   чтобы он не складывался с padding. */
.screen > .screen-title:first-child,
.screen > .stories-bar-wrapper:first-child,
.screen > .branch-header:first-child {
  margin-top: 0;
  padding-top: 0;
}

/* ===== Простое появление блоков главного экрана (scr-tree) =====
   Другие экраны анимируются, т.к. их карточки JS пересоздаёт при заходе.
   Блоки этого экрана статичны в HTML, поэтому добавляем лёгкий stagger,
   который перезапускается при каждом показе (display:none -> block).
   Используем существующий keyframe fadeInUp (сдвиг 8px + fade). */
@media (prefers-reduced-motion: no-preference) {
  #scr-tree.active > * {
    animation: fadeInUp var(--enter-dur) var(--ease-soft) both;
  }
  #scr-tree.active > *:nth-child(2)  { animation-delay: .04s }
  #scr-tree.active > *:nth-child(3)  { animation-delay: .08s }
  #scr-tree.active > *:nth-child(4)  { animation-delay: .12s }
  #scr-tree.active > *:nth-child(5)  { animation-delay: .16s }
  #scr-tree.active > *:nth-child(6)  { animation-delay: .20s }
  #scr-tree.active > *:nth-child(7)  { animation-delay: .24s }
  #scr-tree.active > *:nth-child(8)  { animation-delay: .28s }
  #scr-tree.active > *:nth-child(n+9){ animation-delay: .32s }
}

.screen.screen-shown .fl-rank-row,
.screen.screen-shown .gift-card,
.screen.screen-shown > #polls-list,
.screen.screen-shown > .card-title,
.screen.screen-shown > .stage-card,
.screen.screen-shown .act-slide,
.screen.screen-shown .mg-slide,
#scr-tree.screen-shown.active > * {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

/* ── Ползунок-перемотка скинов ─────────────────────────────────────
   Полоса прокручивает всю ленту за один жест: не нужно свайпать
   карточку за карточкой. Засечки покрашены по редкости — сразу
   видно, где в ленте лежат эпики и легендарки.
   Высота 44px — это зона захвата под палец, сама полоса тоньше. */
.fc-scrub {
  position: relative;
  height: 44px;
  margin: 16px 2px 4px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.fc-scrub-rail {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 50%;
  height: 12px;
  margin-top: -6px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .06);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5);
  overflow: hidden;
}

.fc-scrub-ticks {
  display: flex;
  align-items: center;
  gap: 1px;
  height: 100%;
  padding: 0 3px;
}

.fc-tick {
  flex: 1 1 0;
  min-width: 1px;
  height: 12px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .3);
  opacity: .5;
  /* Меняем масштаб, а не высоту: height пересчитывает раскладку всех
     сорока засечек на каждое переключение скина, transform — нет */
  transform: scaleY(.34);
  transition: transform .18s, opacity .18s;
}

.fc-tick.locked {
  background: rgba(255, 255, 255, .16);
  opacity: .3;
}

.fc-tick.worn {
  transform: scaleY(.67);
  opacity: .9;
}

.fc-tick.active {
  transform: scaleY(1);
  opacity: 1;
}

.fc-scrub-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid rgba(255, 255, 255, .9);
  pointer-events: none;
  will-change: transform;
  transition: transform .18s cubic-bezier(.2, .9, .3, 1), background .25s, box-shadow .25s;
}

/* Пока палец на полосе — ползунок обязан стоять под ним, без догоняния */
/* Под пальцем ползунок обязан стоять ровно там, где палец */
.fc-scrub.dragging .fc-scrub-thumb {
  transition: background .25s, box-shadow .25s;
}

.fc-scrub-label {
  margin: 0 0 14px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  color: rgba(255, 255, 255, .42);
}

/* ── Лента в движении ──────────────────────────────────────────────
   Пульсация свечения и блёстки анимируют opacity — это перерисовка
   карточки каждый кадр. На время жеста ставим анимацию на паузу:
   свечение остаётся на месте, просто перестаёт мигать, а перерисовка
   прекращается. Ничего не скрываем и не удаляем — иначе карта дважды
   за жест перерисовывается целиком, и подсветка заметно моргает. */
.fc-track.fc-moving .fc-card:before,
.fc-track.fc-moving .fc-card:after {
  animation-play-state: paused;
}

/* Карты вне окна показа: снимаем с отрисовки целиком.
   visibility:hidden оставляет раскладку и слой, content-visibility —
   нет. Размеры карточки фиксированы и заданы в .fc-card, поэтому
   ничего не схлопывается. Браузеры без поддержки просто игнорируют. */
.fc-card.fc-far {
  content-visibility: hidden;
  visibility: hidden;
}

/* Накладка замера кадров. Включается долгим нажатием на счётчик
   скинов, в обычной жизни её не существует. */
.fc-perf {
  position: fixed;
  left: 10px;
  bottom: 10px;
  z-index: 6000;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(0, 0, 0, .72);
  border: 1px solid hsla(0, 0%, 100%, .16);
  color: #7CFFB2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  pointer-events: none;
}

html.low-end .avatar-btn::after,
html.low-end .king-gold-border::before {
  animation: none !important
}



/* ВАЖНО: у всех фонов ниже стоит !important. Выше в этом файле есть
   глобальный сброс `div { background: transparent !important;
   background-image: none !important }` — без !important штампы, оверлей
   и столб света оказались бы прозрачными. */

/* ================= ШТАМПЫ ЭТАПОВ И НАГРАДА ЗА ТЕМУ (2026-08-17) =================
   .wt-stamp занял место полосы прогресса 4px внутри .act-card--hero.
   Цвет берётся из --sc-a, которую game.js ставит инлайном на карточку:
   это тот же _sc.a, что и у метки «МИССИЯ · ЭТАП N», поэтому штампы
   всегда в цвете темы и не требуют отдельной палитры. */

.wt-stamps {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wt-stamp {
  flex: 1;
  height: 14px;
  border-radius: 7px;
  background: hsla(0, 0%, 100%, .1) !important;
  transition: background .25s, transform .3s cubic-bezier(.34, 1.56, .64, 1);
}

.wt-stamp.is-done { background: var(--sc-a, #fff) !important }

.wt-stamp.is-now {
  background: transparent !important;
  box-shadow: inset 0 0 0 2px var(--sc-a, #fff)
}

.wt-stamp.pop { transform: scaleY(1.9) scaleX(1.06) }





/* Счётчик тем: каждая третья закрытая тема даёт скин */
.wt-themes {
  display: flex;
  align-items: center;
  gap: 4px;
}

.wt-themes i {
  display: block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: hsla(0, 0%, 100%, .13) !important;
  transition: background .3s, transform .3s cubic-bezier(.34, 1.56, .64, 1);
}

.wt-themes i.on { background: var(--sc-a, #fff) !important }

@keyframes wtShake {
  0%, 100% { transform: translateX(0) }
  15% { transform: translateX(-7px) }
  30% { transform: translateX(6px) }
  45% { transform: translateX(-4px) }
  60% { transform: translateX(3px) }
  80% { transform: translateX(-2px) }
}

.wt-shake { animation: wtShake .42s cubic-bezier(.36, .07, .19, .97) }

/* --- Окно выдачи награды --- */
/* z-index 10050: строго выше #toast (10000) — иначе тост «Миссия
   выполнена! +XXX XP» перекрывал модалку награды поверх неё. */
.wt-ov {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  /* Фон в духе окна вопросов (.modal-overlay): тёмный, с мягким
     фиолетовым градиентом сверху — не сплошная заливка. */
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(139, 61, 255, .22), transparent 60%),
    radial-gradient(100% 80% at 100% 110%, rgba(0, 160, 255, .10), transparent 55%),
    rgba(6, 9, 18, .88) !important;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.wt-ov.show { display: flex }

/* --- Окно награды: один ящик, три тапа (game._showNextThemeReward) ---
   Экран целиком: шапка с темой, ящик по центру, внизу точки-счётчик тапов.
   Тап 1 — ящик вздрагивает, тап 2 — трясётся сильнее и светится цветом
   редкости (--lc / --lcr), тап 3 — вспышка, ящик уходит, на его месте
   вырастает предмет в лучах, снизу редкость, название и «Забрать».
   Анимируются только transform и opacity. */
.wt-ov.lc-ov {
  padding: 0;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  background: rgba(6, 8, 14, .98) !important;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
}
.lc-head {
  padding: calc(env(safe-area-inset-top, 0px) + 64px) 16px 0;
  text-align: center;
  transition: opacity .3s ease;
}
.lc-kicker { font-size: 11px; font-weight: 800; letter-spacing: .14em; color: #8d96aa }
.lc-title { font-size: 22px; font-weight: 800; color: #fff; margin-top: 6px; line-height: 1.2 }
.lc-sub { font-size: 13px; font-weight: 600; color: #8d96aa; margin-top: 4px }
.lc-ov.is-open .lc-head { opacity: 0 }

.lc-stage { position: relative; flex: 1; min-height: 240px }
.lc-pool, .lc-crate, .lc-shadow, .lc-item { position: absolute; left: 50%; top: 50% }

/* Ящик: на втором тапе загорается ореолом цвета редкости по контуру */
.lc-crate {
  width: 230px; height: 214px; margin: -120px 0 0 -115px;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(-5deg);
  transition: transform .35s cubic-bezier(.5, -0.4, .7, 1), opacity .3s ease;
}
.lc-crate__img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .6)); pointer-events: none; transition: filter .4s ease }
.lc-ov.lc-t2 .lc-crate__img { filter: drop-shadow(0 0 28px rgba(var(--lcr), .7)) drop-shadow(0 20px 30px rgba(0, 0, 0, .5)) }
.lc-crate__css { --tr: 217, 154, 90; transform: scale(4); position: relative; left: auto; top: auto; margin: 0 }
.lc-crate.is-shake { animation: lcShake1 .4s cubic-bezier(.36, .07, .19, .97) }
.lc-ov.lc-t2 .lc-crate.is-shake { animation: lcShake2 .55s cubic-bezier(.36, .07, .19, .97) }
@keyframes lcShake1 {
  0%, 100% { transform: rotate(-5deg) }
  25% { transform: rotate(-10deg) translateY(-6px) }
  50% { transform: rotate(1deg) }
  75% { transform: rotate(-8deg) translateY(-3px) }
}
@keyframes lcShake2 {
  0%, 100% { transform: rotate(-5deg) scale(1.04) }
  15% { transform: rotate(-14deg) translateY(-14px) scale(1.06) }
  35% { transform: rotate(5deg) translateY(-6px) scale(1.06) }
  55% { transform: rotate(-12deg) translateY(-10px) scale(1.05) }
  75% { transform: rotate(2deg) scale(1.05) }
}
.lc-ov.lc-t2 .lc-crate { transform: rotate(-5deg) scale(1.04) }
.lc-ov.is-open .lc-crate { transform: scale(1.35); opacity: 0; animation: none }
.lc-shadow {
  width: 200px; height: 24px; margin: 92px 0 0 -100px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .6), transparent) !important;
  transition: opacity .3s ease;
}
.lc-ov.is-open .lc-shadow { opacity: 0 }

/* Пятно света под предметом цветом редкости */
.lc-pool {
  width: 220px; height: 34px; margin: 104px 0 0 -110px; border-radius: 50%; opacity: 0;
  background: radial-gradient(closest-side, rgba(var(--lcr), .45), transparent) !important;
  transition: opacity .5s ease .3s;
}
.lc-ov.is-open .lc-pool { opacity: 1 }

/* Предмет: вырастает, потом парит. Ореол — как у героя на главной
   (drop-shadow по контуру картинки), плюс копия под ней с сильным
   свечением, у которой «дышит» только opacity — фильтр не пересчитывается. */
.lc-item {
  width: 200px; height: 200px; margin: -100px 0 0 -100px;
  opacity: 0; transform: scale(.3);
  transition: opacity .3s ease .15s, transform .6s cubic-bezier(.34, 1.56, .64, 1) .15s;
}
.lc-ov.is-open .lc-item { opacity: 1; transform: none; animation: lcFloat 3.2s ease-in-out .9s infinite }
@keyframes lcFloat { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
.lc-item__img, .lc-item__halo {
  position: absolute; left: 5px; top: 5px; width: 190px; height: 190px; object-fit: contain;
  display: flex; align-items: center; justify-content: center;
}
.lc-item__img { filter: drop-shadow(0 0 40px rgba(var(--lcr), .4)) }
.lc-item__halo { filter: drop-shadow(0 0 14px rgba(var(--lcr), 1)) drop-shadow(0 0 36px rgba(var(--lcr), .9)); opacity: .35 }
.lc-ov.is-open .lc-item__halo { animation: lcBreath 2.4s ease-in-out .8s infinite }
@keyframes lcBreath { 0%, 100% { opacity: .3 } 50% { opacity: .85 } }

/* Искорки: медленно кружат вокруг предмета и мерцают */
.lc-sparks { position: absolute; left: 50%; top: 50%; width: 0; height: 0 }
.lc-ov.is-open .lc-sparks { animation: lcSpin 18s linear infinite }
@keyframes lcSpin { from { transform: rotate(0) } to { transform: rotate(360deg) } }
.lc-sparks i {
  position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%;
  background: #fff !important; box-shadow: 0 0 8px 2px rgba(var(--lcr), .9);
  transform: rotate(var(--a)) translateY(calc(var(--d) * -1)); opacity: 0;
}
.lc-ov.is-open .lc-sparks i { animation: lcTwinkle 2.2s ease-in-out var(--t) infinite }
@keyframes lcTwinkle { 0%, 100% { opacity: .15 } 50% { opacity: 1 } }

.lc-foot { position: relative; padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 40px); text-align: center; min-height: 190px }
.lc-tapzone { position: absolute; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 56px); transition: opacity .25s ease }
.lc-dots { display: flex; gap: 10px; justify-content: center; margin-bottom: 14px }
.lc-dots i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, .18) !important; transition: transform .25s cubic-bezier(.34, 1.56, .64, 1) }
.lc-dots i.on { background: #ff6b5b !important; transform: scale(1.15) }
.lc-hint { font-size: 14px; font-weight: 700; color: #8d96aa }
.lc-ov.is-open .lc-tapzone { opacity: 0; pointer-events: none }

.lc-info { opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .35s ease .35s, transform .45s cubic-bezier(.2, .9, .3, 1) .35s }
.lc-ov.is-open .lc-info { opacity: 1; transform: none; pointer-events: auto }
.lc-tag {
  display: inline-block; padding: 5px 12px; border-radius: 10px;
  background: rgba(var(--lcr), .18) !important; border: 1px solid rgba(var(--lcr), .55);
  color: var(--lc); font-size: 11px; font-weight: 800; letter-spacing: .12em;
}
.lc-name { font-size: 28px; font-weight: 800; color: #fff; margin-top: 10px; line-height: 1.15 }
.lc-who { font-size: 13px; font-weight: 600; color: #8d96aa; margin-top: 6px }
.lc-btn {
  display: block; width: 100%; height: 52px; margin-top: 22px; border: 0; border-radius: 16px;
  background: linear-gradient(135deg, #ff9a5b, #ff6b5b) !important; color: #fff;
  font: 800 16px/1 var(--font-main, Montserrat, sans-serif); cursor: pointer;
}
.lc-btn:active { transform: scale(.98) }

/* Запасной вариант, пока файла коробки нет: корпус, крышка, лента
   крест-накрест — целиком на CSS, без единого запроса. */
.lb-crate {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 40px;
  margin: -16px 0 0 -23px;
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(var(--tr), .85), rgba(var(--tr), .42));
  box-shadow:
    inset 0 -9px 12px rgba(0, 0, 0, .30),
    inset 0 1px 0 hsla(0, 0%, 100%, .30);
}

.lb-crate::before {
  content: '';
  position: absolute;
  left: -4px;
  right: -4px;
  top: -9px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(180deg, hsla(0, 0%, 100%, .34), rgba(var(--tr), .80));
  box-shadow: inset 0 1px 0 hsla(0, 0%, 100%, .40);
}

.lb-crate i {
  position: absolute;
  left: 50%;
  top: -9px;
  bottom: 0;
  width: 9px;
  margin-left: -4.5px;
  background: hsla(0, 0%, 100%, .26);
}

@media (prefers-reduced-motion: reduce) {
  .wt-stamp,
.wt-themes i { transition: none }
  .wt-shake { animation: none }
  .lc-ov.is-open .lc-item, .lc-ov.is-open .lc-item__halo, .lc-ov.is-open .lc-sparks, .lc-ov.is-open .lc-sparks i { animation: none }
  .lc-ov.is-open .lc-sparks i { opacity: .7 }
}

/* Дешёвый Android: без копии-ореола и кружения искорок */
html.low-end .lc-item__halo { display: none }
html.low-end .lc-ov.is-open .lc-sparks { animation: none }

/* ===== Подсказка на второй экран (док, вторая иконка) =====
   Класс .dock-hint ставит game._initTreeHint() при входе и снимает
   game._markTreeSeen() при первом открытии экрана (флаг на пользователя).
   Анимируем только псевдоэлементы и img, чтобы не ломать transform у .dock-item. */
.dock-item {
  position: relative
}

.dock-item.dock-hint {
  opacity: .9
}

/* Пульсирующее кольцо */
.dock-item.dock-hint::after {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 2px solid rgba(255, 213, 79, .9);
  opacity: 0;
  pointer-events: none;
  animation: dockHintRing 2s ease-out 1.5s infinite
}

/* Иконка подсвечена ровным свечением. [оптимизация] Раньше свечение
   пульсировало через filter — это перерисовка иконки каждый кадр. Пульсацию
   теперь даёт только кольцо выше (прозрачность + масштаб, видеокарта). */
.dock-item.dock-hint img {
  filter: drop-shadow(0 0 4px rgba(255, 213, 79, .6))
}

@keyframes dockHintRing {
  0%   { transform: scale(.7); opacity: .9 }
  70%  { opacity: 0 }
  100% { transform: scale(1.35); opacity: 0 }
}


@media (prefers-reduced-motion: reduce) {
  .dock-item.dock-hint::after { animation: none }
}

/* drop-shadow в анимации тяжёлый для слабых Android, там остаётся только кольцо */
html.low-end .dock-item.dock-hint img { animation: none }
/* ===== Нижнее меню «с подписями» (по умолчанию, 2026-10-23) =====
   Как в кабинете учителя: у каждого пункта значок-контур и подпись под ним,
   выбранный пункт - коралловый на мягкой подложке. Значки - SVG (.dock-ic) в index.html,
   цвет берут из currentColor. «Компактное» меню (html.dock-classic, выбор на
   странице «Другое») - прежние картинки без подписей, эти правила его не трогают. */
html:not(.dock-classic) .dock {
  display: flex !important;
  justify-content: center !important;
  height: auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: calc(100vw - 24px) !important;
  gap: 0 !important;
  background: rgba(20, 26, 40, .92) !important;
  border: 1px solid rgba(255, 255, 255, .12) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4) !important;
  box-sizing: border-box
}

html:not(.dock-classic) .dock > .dock-item {
  flex: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center;
  align-content: center;
  justify-content: center !important;
  box-sizing: border-box;
  opacity: 1 !important;
  transform: none !important;
  filter: none;
  text-shadow: none !important;
  color: rgba(255, 255, 255, .5) !important;
  background: transparent !important;
  transition: background-color .25s ease, color .25s ease, transform .15s ease
}


html:not(.dock-classic) .dock-ic { width: 22px; height: 22px }
html.dock-classic .dock-ic { display: none }

html:not(.dock-classic) .dock-lbl {
  display: block;
  font: 800 10.5px/1 Montserrat, system-ui, sans-serif;
  letter-spacing: .1px;
  white-space: nowrap;
  color: inherit
}

html:not(.dock-classic) .dock > .dock-item.active {
  color: #ff8a83 !important;
  background: rgba(255, 106, 97, .16) !important
}

html:not(.dock-classic) .dock > .dock-item:active {
  transform: scale(.94) !important
}

@media (hover: hover) and (pointer: fine) {
  html:not(.dock-classic) .dock > .dock-item:not(.active):hover { color: rgba(255, 255, 255, .8) !important }
}

/* Сетка по 8: поле меню 6 + рамка 1 вокруг пунктов 64×48, радиусы вложены (22 = 16 + 6).
   Четыре пункта занимают 270px; у самой длинной подписи «Главная» по 7px воздуха
   с каждой стороны подложки — столько же, сколько сверху и снизу. */

/* Подсказка на «Темы» (.dock-hint): кольцо по форме пункта, значок светится */
html:not(.dock-classic) .dock-item.dock-hint::after { inset: -3px;}
html:not(.dock-classic) .dock-item.dock-hint { color: #ffd54f !important }

@media (prefers-reduced-motion: reduce) {
  html:not(.dock-classic) .dock > .dock-item { transition: none }
}

html.dock-classic .dock-lbl { display: none }

/* Переключатель вида меню на странице «Другое» */
.dock-style-card { cursor: default; flex-wrap: wrap; row-gap: 10px }
/* переключатель — отдельной строкой во всю ширину, чтобы заголовок не обрезался */
.dock-style-card .dock-style-seg { flex: 1 0 100%; box-sizing: border-box }
.dock-style-card .dock-style-seg button { flex: 1 }
.dock-style-seg {
  flex: none;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08) !important
}
.dock-style-seg button {
  border: 0;
  padding: 7px 11px;
  border-radius: 999px;
  background: transparent !important;
  color: rgba(255, 255, 255, .6);
  font: 700 12px/1 Montserrat, system-ui, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .2s ease, color .2s ease
}
.dock-style-seg button.on {
  background: rgba(255, 255, 255, .16) !important;
  color: #fff
}

/* ===== Свой профиль — экран #scr-me (me_screen.js) =====
   Фоны с !important: общие правила для div внутри экранов их перебивают. */
.me-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px 0 10px;
  border-radius: 19px;
  border: 1px solid rgba(255, 255, 255, .12);
  font: 700 13px 'Montserrat', sans-serif;
  color: rgba(255, 255, 255, .85);
  cursor: pointer
}


.me-hero {
  position: relative;
  height: clamp(220px, 62vw, 270px);
  margin: 4px -4px 0;
  display: flex;
  justify-content: center;
  border-radius: 28px;
  /* closest-side: свечение гаснет внутри блока и не обрезается его краем */
  background: radial-gradient(closest-side at 50% 55%, rgba(255, 106, 97, .36), rgba(255, 106, 97, .12) 55%, rgba(255, 106, 97, 0)) !important
}

.me-skin {
  height: 100%;
  cursor: pointer;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .55))
}

.me-gifts {
  position: absolute;
  inset: 0 0 56px;
  pointer-events: none;
  z-index: 1;
}

.me-gifts[hidden] { display: none }

.me-gift {
  position: absolute;
  left: var(--gift-x);
  top: var(--gift-y);
  width: calc(clamp(32px, 9.4vw, 42px) * var(--gift-scale, 1));
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent !important;
  font-size: 22px;
  filter: drop-shadow(0 0 10px rgba(255, 178, 112, .32));
  pointer-events: auto;
  cursor: pointer;
}

.me-gift img { width: 100%; height: 100%; object-fit: contain }
.me-gift:hover, .me-gift:focus-visible { filter: drop-shadow(0 0 12px rgba(255, 178, 112, .65)) }
.me-gift:nth-child(1) { --gift-x: 23%; --gift-y: 24% }
.me-gift:nth-child(2) { --gift-x: 77%; --gift-y: 30% }
.me-gift:nth-child(3) { --gift-x: 15%; --gift-y: 48% }
.me-gift:nth-child(4) { --gift-x: 83%; --gift-y: 52% }
.me-gift:nth-child(5) { --gift-x: 28%; --gift-y: 61% }
.me-gift:nth-child(6) { --gift-x: 70%; --gift-y: 63% }
.me-gift:nth-child(7) { --gift-x: 35%; --gift-y: 7% }
.me-gift:nth-child(8) { --gift-x: 65%; --gift-y: 11% }

.me-floor {
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 200px;
  height: 26px;
  margin-left: -100px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 106, 97, .45), rgba(255, 106, 97, 0)) !important
}

.me-skins {
  position: absolute;
  right: 4px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 18px;
  background: rgba(10, 14, 26, .72) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 138, 131, .5);
  font: 800 12px 'Montserrat', sans-serif;
  color: #ff8a83;
  cursor: pointer
}

.me-name {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff
}

.me-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px
}

.me-chip {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, .07) !important;
  color: rgba(255, 255, 255, .75)
}



/* Уровень — скромной строкой: подпись и тонкая полоска */
.me-lv {
  border-radius: 18px
}

.me-lv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px
}

.me-lv-row b {
  color: #fff
}

.me-lv-row span {
  font-weight: 600;
  white-space: nowrap
}

.me-bar {
  border-radius: 2px;
  background: rgba(255, 255, 255, .08) !important;
  overflow: hidden
}

.me-bar i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #ff8a83, #ff6a61) !important;
  transition: width .6s ease
}

.me-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;}

.me-st {
  border-radius: 20px;
  min-width: 0
}

.me-st .k {
  display: flex;
  align-items: center;
  gap: 6px;}



.me-st .k svg {
  flex: none
}

.me-st .v {
  font-weight: 800;
  letter-spacing: -.01em;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.me-st .s {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, .45);
  margin-top: 2px
}








/* ===== Профиль: «Достижения» — заголовок как на экране тем, ниже карточки
   как на экране «Все достижения» (game._achCardHtml) и кнопка «Все достижения» ===== */
#me-root .me-ach-h { margin: 24px 0 12px }
#me-root .me-ach-list .stage-card:last-child { margin-bottom: 0 }
#me-root .me-ach-empty { padding: 0 8px; font-size: 13px; line-height: 1.45; color: rgba(255, 255, 255, .55) }
#me-root .me-ach-all { width: 100%; margin: 12px 0 0 }

/* ===== Чужой профиль — окно #player-profile (me_screen.js) ===== */
#player-profile .modal-body.pp-body {
  text-align: left;
  font-family: 'Montserrat', sans-serif;
  color: #fff
}

.pp-head {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px
}

.pp-showcase {
  inset: -19px 0 -20px;
  z-index: 0;
}

.pp-head > .pp-ava,
.pp-head > .pp-who {
  position: relative;
  z-index: 1;
}

.pp-head > .pp-who { pointer-events: none }

.pp-showcase .me-gift {
  top: var(--pattern-y);
  left: var(--pattern-x);
  width: clamp(30px, 10vw, 46px);
  font-size: 28px;
  opacity: .4;
  filter: saturate(.7);
  transform: translate(-50%, -50%) rotate(var(--pattern-angle));
}

.pp-showcase .me-gift:nth-child(n+5) { width: clamp(20px, 6.5vw, 30px); font-size: 19px }

.pp-showcase .me-gift:nth-child(1) { --pattern-x: 64%; --pattern-y: 19%; --pattern-angle: -23deg }
.pp-showcase .me-gift:nth-child(2) { --pattern-x: 84%; --pattern-y: 32%; --pattern-angle: 17deg }
.pp-showcase .me-gift:nth-child(3) { --pattern-x: 73%; --pattern-y: 63%; --pattern-angle: -12deg }
.pp-showcase .me-gift:nth-child(4) { --pattern-x: 91%; --pattern-y: 84%; --pattern-angle: 26deg }
.pp-showcase .me-gift:nth-child(5) { --pattern-x: 16%; --pattern-y: 13%; --pattern-angle: 23deg }
.pp-showcase .me-gift:nth-child(6) { --pattern-x: 43%; --pattern-y: 28%; --pattern-angle: -18deg }
.pp-showcase .me-gift:nth-child(7) { --pattern-x: 26%; --pattern-y: 88%; --pattern-angle: 15deg }
.pp-showcase .me-gift:nth-child(8) { --pattern-x: 52%; --pattern-y: 77%; --pattern-angle: -26deg }

.pp-showcase .me-gift:hover,
.pp-showcase .me-gift:focus-visible {
  opacity: .55;
  filter: none;
}

.pp-ava {
  position: relative;
  width: 72px;
  height: 72px;
  flex: none;
  border-radius: 50%
}

.pp-ava img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #ff6a61;
  display: block
}

.pp-ava b {
  position: absolute;
  z-index: 2;
  right: -4px;
  bottom: -2px;
  min-width: 26px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #ff6a61, #d4473d) !important;
  border: 2px solid #121722
}

.pp-who {
  flex: 1;
  min-width: 0
}

.pp-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px
}

.pp-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.pp-who .me-chips {
  justify-content: flex-start;
  margin-top: 0
}

.pp-rx {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px
}

.pp-r {
  height: 40px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .75);
  font: 800 12px 'Montserrat', sans-serif;
  cursor: pointer
}

.pp-r span:empty {
  display: none
}

.pp-r.on {
  color: #ff8a83;
  border-color: rgba(255, 106, 97, .4);}

.pp-r:active,
.pp-btn:active {
  transform: scale(.96)
}

.pp-btns {
  display: flex;
  gap: 8px;
  margin-top: 14px
}

.pp-btn {
  flex: 1;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  font: 800 14px 'Montserrat', sans-serif;
  color: #fff;
  cursor: pointer;
  transition: transform .15s ease
}

.pp-btn.pri {
  flex: 1.45;
  border: 0;
  background: linear-gradient(135deg, #ff6a61, #d4473d) !important;
  box-shadow: 0 8px 22px rgba(255, 106, 97, .35)
}

.pp-btn.sec {
  border: 1px solid rgba(255, 255, 255, .14)
}

/* Узкие телефоны (меньше 360px): кнопки окна игрока — друг под другом,
   подписи плиток — без переноса */
@media (max-width: 359px) {
  .pp-btns {
    flex-direction: column
  }

  .pp-btn.pri,
  .pp-btn {
    flex: none
  }

  .me-st .k {
    white-space: nowrap;
    font-size: 10.5px
  }
}

/* Карандаш в профиле: в старом окне — только правка города/школы/класса */
#my-profile-modal.me-edit-only .modal-body.player-profile > *:not(:first-child):not(#my-profile-class-edit) {
  display: none !important
}

/* Компактное меню из 4 значков: минимальная ширина дока была под 5 значков
   и растягивала его. Без неё поле по краям равно промежутку между значками */
html.dock-classic .dock {
  min-width: 0
}

/* ===== Окна «шторкой снизу» (modal_sheets.js ставит .sheet окну-подложке и .sheet-win самому окну) =====
   Окна с заданиями, вопросами и ответами класс не получают и остаются по центру. */
.sheet {
  /* без проявления слоя: иначе шторка в первые кадры полупрозрачная */
  animation: none !important;
  align-items: flex-end !important;
  justify-content: center !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: rgba(5, 8, 16, .72) !important
}

.sheet > .modal-close-top {
  display: none !important
}

.sheet > .sheet-win {
  width: 100% !important;
  max-width: 500px !important;
  max-height: 88vh !important;
  max-height: 88dvh !important;
  margin: 0 !important;
  /* только сверху и снизу: боковые поля у окон свои (например, у бонуса за вход) */
  padding-top: 14px !important;
  padding-bottom: env(safe-area-inset-bottom) !important;
  overflow-y: auto !important;
  scrollbar-width: none;
  overscroll-behavior: contain;
  border-radius: 30px 30px 0 0 !important;
  background: #121722 !important;
  border: 0 !important;
  border-top: 1px solid rgba(255, 255, 255, .1) !important;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .5) !important;
  transform: none;
  /* backwards, не both: иначе анимация держит transform и шторка не едет за пальцем */
  /* выезд делает modal_sheets.js (ждёт отрисовки окна, потом едет) */
  animation: none !important;
  will-change: transform;
  touch-action: pan-y
}

.sheet > .sheet-win::-webkit-scrollbar {
  display: none
}

.sheet > .sheet-win:after {
  display: none !important
}

/* Только сдвиг, без прозрачности: полупрозрачная шторка показывала экран
   сквозь себя, и тяжёлые окна (выбор скина) будто моргали */

/* Ручка сверху: за неё (и за заголовок) шторку можно смахнуть вниз.
   Шторка ровного цвета, без оттенка редкости скина. Ручка поверх картинки-шапки вопроса. */
.sh-grab {
  /* невидимая полоса во всю ширину: за неё тянут шторку; браузер тут не
     прокручивает (touch-action:none), иначе на телефоне жест обрывался.
     Крестик (.sh-x, z-index 5) лежит поверх и нажимается как раньше */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  z-index: 4;
  touch-action: none;
  cursor: grab
}

/* сама серая палочка */
.sh-grab::after {
  content: '';
  position: absolute;
  top: 9px;
  left: 50%;
  width: 44px;
  height: 5px;
  margin-left: -22px;
  border-radius: 3px;
  /* всегда серая, без цвета редкости */
  background: rgba(255, 255, 255, .22)
}

.sheet > .sheet-win {
  background: #121722 !important
}

.sh-x {
  position: absolute;
  top: 13px;
  right: 16px;
  z-index: 5;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .08) !important;
  cursor: pointer
}

.sh-x svg {
  width: 16px;
  height: 16px;
  stroke: rgba(255, 255, 255, .8);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round
}

.sh-x:active {
  background: rgba(255, 255, 255, .16) !important
}

/* Заголовок не заезжает под крестик и стоит с ним на одной линии:
   верхний отступ шторки уже есть, второй, от шапки, опускал заголовок ниже крестика */
.sheet > .sheet-win .modal-header {
  padding-top: 8px !important;
  padding-left: 52px !important;
  padding-right: 52px !important;
  background: none !important
}

@media (prefers-reduced-motion: reduce) {
  .sheet > .sheet-win { animation: none !important }
}

/* ===== Вопрос в шторке: кольцо прогресса, вопрос в карточке, ответы-пилюли ===== */
.sheet #m-progress {
  display: none !important
}

/* Вопрос: тема и этап в строке с крестиком, под ними радужная полоса прогресса (modal_sheets.js quizRing) */
.q-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin: 0;
  text-align: left
}

/* Окно вопроса: строка «тема · этап» встаёт вровень с крестиком —
   верхний отступ тела окна её опускал. Старые браузеры без :has() — как раньше */
.sheet .modal-body:has(> .q-head) { padding-top: 0 !important }
.sheet .modal-body:has(> .q-head) .q-meta { min-height: 36px }
/* В вопросах без подписи оставляем строку под крестик. */
#mission-window.sheet .q-head:has(> .q-meta:empty) { padding-top: 36px }
/* В дуэли вопрос начинается ниже крестика даже без полосы прогресса. */
#mission-window.sheet:has(#duel-ans-0) > .sheet-win { padding-top: 56px !important }

/* тема и этап — в одной строке с крестиком, справа место под него */
.q-meta {
  order: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  margin: 0 56px 0 0;
  font: 500 13px 'Montserrat', sans-serif;
  color: #9aa3b4
}

/* полоса прогресса — над вопросом, во всю ширину, как варианты ответа */
.q-line {
  order: 1;
  position: relative;
  width: 100%;
  height: 6px;
  margin: 12px 0 20px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, .08) !important
}

.q-line i {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, #ff5252, #ff9800 22%, #ffd600 44%, #66bb6a 66%, #29b6f6 84%, #ab47bc) !important;
  clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0 round 3px);
  transition: clip-path .45s cubic-bezier(.2, .9, .3, 1)
}

/* сам вопрос — крупным текстом, без подложки */
.sheet .mission-question {
  padding: 0 !important;
  text-align: left;
  font-size: clamp(19px, 5.6vw, 22px);
  font-weight: 800;
  line-height: 1.25;
  border-radius: 0 !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  margin: 0 0 22px
}

/* ответы — карточки с буквами А, Б, В; текст слева.
   Подсветка верного/неверного — цвет рамки, его ставит game.checkAnswer */
.sheet .mission-answer {
  justify-content: flex-start;
  text-align: left;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 2px solid transparent;
  background: #1a2130 !important;
  box-shadow: none;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3
}

.sheet .mission-answer::before {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: #9aa3b4
}

.sheet .mission-answer:nth-child(1)::before { content: 'А' }
.sheet .mission-answer:nth-child(2)::before { content: 'Б' }
.sheet .mission-answer:nth-child(3)::before { content: 'В' }
.sheet .mission-answer:nth-child(4)::before { content: 'Г' }
.sheet .mission-answer:nth-child(5)::before { content: 'Д' }

/* Итоги этапа: у окна своя ширина и прокрутка внутри — в шторке на всю ширину */
#stage-results-modal.sheet > .sheet-win {
  max-width: 500px !important;
  max-height: 88vh !important;
  max-height: 88dvh !important
}

/* Ответы в шторке — чуть больше воздуха между кнопками и под ними */
.sheet .mission-answers {
  gap: 12px;
  padding-bottom: 8px
}

/* Карточка подарка в шторке: без своей рамки и тени, иконка не под ручкой */
.gift-popup.sheet {
  padding: 0 !important;
  /* как у остальных окон: затемнение без размытия (размытие дорогое для слабых телефонов) */
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important
}

.gift-popup.sheet > .sheet-win {
  border-radius: 30px 30px 0 0 !important
}

.gift-popup.sheet .gift-popup-header {
  padding-top: 18px;
  background: none !important
}

/* Уведомления шторкой: у панели свои правила по id (во всю высоту, прозрачная),
   здесь они перебиваются тем же id + .sheet */
#modal-envelope.sheet {
  align-items: flex-end !important;
  padding: 0 !important;
  background: rgba(5, 8, 16, .72) !important
}

#modal-envelope.sheet > .sheet-win {
  height: auto;
  max-height: 88vh !important;
  max-height: 88dvh !important;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  background: linear-gradient(180deg, rgba(var(--rarity-rgb), .07), rgba(var(--rarity-rgb), 0) 120px), #121722 !important;
  border-top: 1px solid rgba(255, 255, 255, .1) !important;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .5) !important
}

#modal-envelope.sheet .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto !important;
  padding: 6px 16px 16px !important
}

/* Заголовок «Уведомления» не заезжает под крестик */
#modal-envelope.sheet .fl-notif-head-title {
  margin-right: 52px
}

/* Кнопки в шторках — как в новых окнах: главная коралловая, вторая — стеклянная */
.sheet .btn-primary,
.sheet .glass-btn {
  font-size: 15px !important
}

.sheet .btn-primary {
  min-height: 48px;
  border-radius: 16px !important;
  background: linear-gradient(135deg, #ff6a61, #d4473d) !important;
  box-shadow: 0 8px 22px rgba(255, 106, 97, .3) !important;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none
}

.sheet .glass-btn:not(.btn-primary) {
  min-height: 48px;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, .07) !important;
  border: 1px solid rgba(255, 255, 255, .14) !important;
  letter-spacing: 0;
  text-transform: none
}

/* =====================================================================
   Отступы по правилам Apple (HIG), 2026-10-23
   • Одно поле от края экрана — 16px: у экранов, шапки и шторок.
   • Заголовки экранов и разделов начинаются ровно по краю карточек
     (как в App Store), без лишнего сдвига внутрь.
   • Вертикальный ритм по сетке 4/8: внутри группы меньше, между
     группами больше — заголовок → подзаголовок 4, подзаголовок →
     контент 16, между разделами 24, заголовок раздела → карточки 12.
   • Зона нажатия у кнопок — не меньше 44px, даже если значок меньше.
   ===================================================================== */
:root {
  --screen-padding: 16px
}

/* шапка: поле даёт .content-limit (16px), своё поле дублировало его */
.hud {
  padding-left: 0 !important;
  padding-right: 0 !important
}

.screen-title,
.screen-sub,
.branch-header {
  padding-left: 0 !important;
  padding-right: 0 !important
}

.screen-title {
  margin: 0 0 4px !important
}

.screen-sub {
  margin: 0 0 16px !important
}

.branch-header {
  margin: 24px 0 12px !important
}

.screen > .screen-title:first-child,
.screen > .branch-header:first-child {
  margin-top: 0 !important
}

/* кнопки шапки: значок 28–30px, а нажимать можно по 44px */
#hud-settings,
.hud button {
  position: relative
}

#hud-settings::before,
.hud button::before {
  content: '';
  position: absolute;
  inset: -8px
}

/* переключатель вида меню: 26px → 36px, как сегменты в iOS */
.dock-style-seg button {
  min-height: 36px
}

.ach-badge-toggle {
  position: relative;
  padding: 11px 0;
  margin: -11px 0
}

/* профиль: кнопки по сетке 8 (40px), группы разделены 24px */
.me-pill,
.me-skins {
  height: 40px
}


.me-name {
  margin-top: 12px
}



/* крестик шторки 36px, зона нажатия 44px */
.sh-x::before {
  content: '';
  position: absolute;
  inset: -4px
}



/* шторки: то же поле 16px, что у экранов и у крестика */
.sheet .modal-body,
.sheet > .lb-window,
.sheet .gift-popup-body,
.sheet .gift-popup-header {
  padding-left: 16px !important;
  padding-right: 16px !important
}

/* Во время выезда шторки анимации внутри окна на паузе (см. modal_sheets.js):
   свечение карточек скинов иначе перерисовывалось каждый кадр */
/* только карточки скинов: правило на все элементы окна само вызывало
   пересчёт стилей у сотен элементов при каждом открытии */
.sh-in .fc-card::before,
.sh-in .fc-card::after {
  animation-play-state: paused !important
}

/* Выбор скина: закрытое окно не выкидываем из раскладки (display:none),
   а прячем. Тяжёлую ленту из 49 карточек браузер раскладывает один раз
   заранее, и открытие — это только показ и выезд шторки. Код по-прежнему
   пишет style.display = 'none' / 'flex', правило ловит это значение. */
#skin-selector.sh-keep[style*="display: none"] {
  display: flex !important;
  /* уводим за экран: visibility:hidden не годится — карточки ставят себе
     visibility явно и просвечивали; opacity:0 перерисовывает всё при показе */
  transform: translateX(-300vw) !important;
  pointer-events: none !important
}

/* Подложка под шторкой, пока её тянут вверх за ручку (modal_sheets.js):
   того же цвета, что низ шторки, чтобы снизу не было щели */
.sh-fill {
  display: none;
  position: absolute;
  bottom: 0;
  background: #121722;
  pointer-events: none;
  will-change: transform
}

/* Пункты только для ВКонтакте (vk_bridge.js ставит html.in-vk) */
html:not(.in-vk) .vk-only { display: none !important; }
/* И наоборот: ссылки на MAX, RuStore и перенос прогресса — не для ВКонтакте (правила VK Mini Apps п. 4.1.8) */
html.in-vk .no-vk { display: none !important; }
/* «Написать»: если получатель один (нет школы и класса) — без стрелки выбора */
.fb-dd-single .fb-dd-arrow { display: none !important; }
.fb-dd-single .fb-dd-trigger, .fb-dd-single > button { cursor: default; }

/* ===== Иерархия и аккуратность (2026-10) =====
   Единая шкала текста: заголовок экрана 28, раздела 20, карточки 15–16,
   подписи 13 серым. Обычный регистр вместо капса, без неоновых теней. */
.screen-title {
  font-size: 28px;
  text-transform: none;
  letter-spacing: -.01em;
  line-height: 1.15;
  text-shadow: none
}

.screen-sub {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: #9aa3b4
}

.screen-title + .screen-sub {
  margin-top: 6px !important
}

.branch-header {
  font-size: 20px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: #f3f5f9
}

/* шапка */
.user-name {
  font-size: 17px
}

.user-class {
  font-size: 13px;
  color: #9aa3b4;
  text-shadow: none
}

.hero-glow {
  opacity: .55
}

/* кружки тем: тонкий ободок без свечения, подписи серым */
.story-bubble-ring,
#duel-cards-bar [data-duel-id] > .act-card {
  --attention-border: 2px solid #ff6b5e
}

.story-bubble-ring {
  outline: var(--attention-border)
}

.story-bubble-ring.seen {
  outline: none
}

#duel-cards-bar [data-duel-id] > .act-card {
  outline: var(--attention-border);
  outline-offset: -2px
}

.story-bubble-label {
  font-size: 12px;
  font-weight: 600;
  color: #9aa3b4
}

/* «Другое» */
.menu-card .card-title {
  font-size: 15px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0
}

.menu-card .card-sub {
  font-size: 13px;
  color: #9aa3b4;
  margin-top: 3px
}

/* «Игры» */
.gs-chip {
  font-size: 12px !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: 0 !important
}

.gs-hero b {
  font-size: 24px !important
}

.gs-tile b {
  font-size: 15px !important
}

.gs-s {
  font-size: 13px !important;
  font-weight: 500 !important
}

.gs-btn {
  font-size: 14px !important;
  border-radius: 12px !important
}


.me-lv,
.me-st {
  border: 0;
  background: #161c28 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22)
}

.me-lv {
  padding: 14px 16px;
  margin-top: 20px
}

.me-lv-row b {
  font-size: 16px;
  font-weight: 700
}

.me-lv-row span {
  font-size: 13px;
  color: #9aa3b4
}

.me-bar {
  height: 6px;
  margin-top: 12px
}

.me-grid {
  gap: 12px;
  margin-top: 12px
}

.me-st {
  padding: 16px
}

.me-st .k {
  font-size: 13px;
  font-weight: 600
}

.me-st .k span {
  color: #9aa3b4
}

.me-st .v {
  font-size: 24px;
  margin-top: 10px
}


.me-hero {
  background: radial-gradient(closest-side at 50% 55%, rgba(255, 106, 97, .18), rgba(255, 106, 97, 0)) !important
}

.me-floor {
  opacity: .5
}

.me-chip {
  font-size: 13px;
  font-weight: 600;
  height: 28px;
  padding: 0 12px;
  border-radius: 14px
}

/* профиль: место под нижним меню, чтобы «Инвентарь» не уходил под него */
#me-root {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 72px)
}

/* ===== Без лишних рамок (2026-10) =====
   Обводки убраны там, где они ничего не значат: карточки отделяются заливкой.
   Выделение осталось только у выбранного/текущего (день бонуса, тема дуэли,
   своя реакция, активная вкладка). Подписи — обычным регистром. */
.sheet .modal-header h2 {
  text-transform: none !important;
  letter-spacing: 0 !important
}

/* «Другое» */
.menu-card.stage-card {
  border-color: transparent !important
}

/* ежедневный бонус */
.lb-day {
  border-color: transparent !important;
  background: rgba(255, 255, 255, .05) !important
}

.lb-day.is-past {
  background: rgba(54, 212, 138, .12) !important
}

.lb-day.is-today {
  background: rgba(54, 212, 138, .2) !important;
  box-shadow: inset 0 0 0 2px #36d48a !important
}

.lb-hero {
  border-color: transparent !important;
  background: rgba(255, 255, 255, .05) !important
}

.lb-hero__label {
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 13px !important;
  color: #9aa3b4 !important
}

/* уведомления */
.fl-notif-day {
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 13px !important;
  color: #9aa3b4 !important
}

.fl-notif-row {
  border-color: transparent !important;
  box-shadow: none !important;
  background: #1a2130 !important
}



/* чужой профиль: реакции и вторая кнопка */
.pp-r,
.pp-btn.sec {
  border-color: transparent !important
}

.pp-r {
  background: rgba(255, 255, 255, .06) !important
}

.pp-r.on {
  background: rgba(255, 107, 94, .16) !important
}

.pp-btn.sec {
  background: rgba(255, 255, 255, .08) !important
}

.me-pill {
  border-color: transparent !important
}



.me-pill {
  background: rgba(255, 255, 255, .08) !important
}

/* редактирование профиля */
#my-profile-school-display,
#my-profile-class-display,
.fb-dd-trigger,
#my-profile-modal button {
  border-color: transparent !important
}

.fb-dd-trigger {
  background: rgba(255, 255, 255, .06) !important
}

.act-card,
.gs-card,
.me-lv,
.me-st,
.sit-fin-card { border-radius: 20px !important }
.menu-card.stage-card,
.fl-notif-row,
.fl-rank-row,
.ai-sugg-btn,
.pp-r,
.lb-hero { border-radius: 16px !important }
.gs-btn,
.lb-day,
.me-chip { border-radius: 12px !important }

.act-card { padding: 16px !important }
.act-card + .act-card { margin-top: 12px !important }
.menu-card.stage-card {
  padding: 12px 16px !important;
  min-height: 64px !important;
  margin-bottom: 8px !important;
  gap: 12px !important;
  box-sizing: border-box
}
.fl-notif-row { padding: 12px 16px !important }
.fl-notif-head { gap: 12px }

#scr-news .menu-card .card-number {
  display: flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 !important
}


/* «Другое» в масштабе «Топа» (текст 14/12, строка 56): значок у левого края
   без плашки, все значки одного размера; голосования и карточка разработчика
   в том же виде, счётчики — коралловой капсулой */
#scr-news .menu-card.stage-card { min-height: 56px !important; padding: 10px 16px 10px 12px !important; gap: 12px !important; border-color: transparent !important }
#scr-news .menu-card .card-number { width: 28px !important; min-width: 28px !important; height: 28px !important; background: transparent !important; border: 0 !important; box-shadow: none !important }
#scr-news .menu-card .card-number img { width: 24px !important; height: 24px !important; border-radius: 6px; object-fit: contain }
#scr-news .menu-card .card-number svg { width: 22px; height: 22px }
#scr-news .menu-card .card-title { font-size: 14px; font-weight: 800 }
#scr-news .menu-card .card-sub { font-size: 12px; margin-top: 2px }
#scr-news .menu-count { flex-shrink: 0; font-size: 12px; font-weight: 800; line-height: 1; color: var(--primary); padding: 5px 9px; border-radius: 999px; background: rgba(255, 107, 94, .14) !important }
#scr-news .dev-card.stage-card { min-height: 56px; padding: 10px 16px 10px 12px !important }
#scr-news .dev-card .avatar-btn img { width: 100% !important; height: 100% !important; object-fit: cover; border-radius: 50% }

/* «Темы»: от историй до «Прохождения» 24, а не 48 */
.stories-bar-wrapper { margin-bottom: 0 !important }
.stories-bar { padding-bottom: 8px !important }
#walkthrough-header { margin-top: 16px !important }
/* заголовок уведомления переносится на вторую строку, а не обрезается */
.fl-notif-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical }

/* Нижнее меню «с подписями»: картинки из компактного меню вместо контуров.
   Невыбранные пункты приглушены, выбранный — яркий на коралловой подложке. */
html:not(.dock-classic) .dock { padding: 6px !important; border-radius: 24px !important }
html:not(.dock-classic) .dock > .dock-item { width: 68px !important; height: 56px !important; border-radius: 18px !important; gap: 4px }
html:not(.dock-classic) .dock > .dock-item > img {
  display: block !important;
  width: 28px !important;
  height: 28px !important;
  opacity: .55;
  filter: saturate(.6);
  transition: opacity .25s ease, filter .25s ease
}
html:not(.dock-classic) .dock > .dock-item.active > img,
html:not(.dock-classic) .dock > .dock-item.dock-hint > img { opacity: 1; filter: none }
html:not(.dock-classic) .dock-ic { display: none !important }
html:not(.dock-classic) .dock-lbl { font-size: 11px !important }
html:not(.dock-classic) .dock-item.dock-hint::after { border-radius: 21px }

/* ===== Цвета: у каждого одна задача (2026-10-24) =====
   Коралл — действия и «это ты», жёлтый — награды, зелёный/красный — зоны лиги.
   Карточки ровные, без цветных свечений; цвет остаётся у карточки «Прохождение». */
.act-card:not(.act-card--hero) { box-shadow: none !important }

/* «Топ»: строки без рамок, зона и призовые места — мягким фоном */
.rank-row.stage-card { border-color: transparent !important }
.rank-row.stage-card.rank-t1,
.rank-row.stage-card.rank-t2,
.rank-row.stage-card.rank-t3,
.rank-row.stage-card.current-user-card {
  background-image: none !important;
  background-color: rgba(var(--acc-rgb), .10) !important
}
.rank-row.stage-card.rank-me { box-shadow: inset 0 0 0 1.5px #ff6b5e !important }

/* Карточка разработчика — как строка «Топа» */
.dev-card.stage-card { padding: 12px !important; min-height: 64px; border-color: transparent !important; box-sizing: border-box }
.dev-card .user-info { gap: 10px }
.dev-card .avatar-btn { width: 40px !important; height: 40px !important; min-width: 40px; border: 2px solid var(--primary) !important; box-sizing: border-box }
.dev-card .user-name { font-size: 14px !important; font-weight: 800 !important; display: flex; align-items: center; gap: 4px }
.dev-card .user-class { font-size: 12px !important; color: #9aa3b4 !important; margin-top: 2px }

/* ===== Экран входа v2: мозаика тем + имя (2026-10) ===== */
#auth-wrapper.auth2 {
  /* 100vh в мобильном Chrome выше видимой области — низ уезжал под навигацию */
  height: 100vh;
  height: calc(var(--vh, 1vh) * 100);
  min-height: 0 !important;
  padding: 0 !important;
  background: #0b0f17 !important;
  flex-direction: column;
  align-items: stretch !important;
  justify-content: flex-end !important;
  overflow-x: hidden;
  overflow-y: auto;
  backdrop-filter: none
}
#auth-wrapper.auth2 .auth2-backdrop {
  position: absolute;
  inset: 0 0 40%;
  overflow: hidden;
  pointer-events: none
}
#auth-wrapper.auth2 .auth2-mosaic {
  position: absolute;
  left: -64px;
  right: -64px;
  top: -40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  transform: rotate(-8deg);
  pointer-events: none
}
#auth-wrapper.auth2 .auth2-mosaic img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 16px;
  display: block;
  background: #161c28
}
#auth-wrapper.auth2 .auth2-mosaic img:nth-child(even) { transform: translateY(40px) }
#auth-wrapper.auth2::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 100%;
  min-height: 100dvh;
  background: linear-gradient(rgba(11, 15, 23, 0) 18%, rgba(11, 15, 23, .85) 46%, #0b0f17 60%);
  pointer-events: none
}
#auth-wrapper.auth2 .auth2-panel {
  position: relative;
  z-index: 1;
  margin-top: auto;
  width: 100%;
  max-width: 480px;
  align-self: center;
  padding: 160px 16px max(40px, calc(24px + env(safe-area-inset-bottom, 0px)));
  text-align: left;
  font-family: var(--font-main)
}
#auth-wrapper.auth2 .auth2-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  color: #f3f5f9;
  margin-bottom: 16px
}
#auth-wrapper.auth2 .auth2-brand img { width: 32px; height: 32px; border-radius: 10px }
#auth-wrapper.auth2 #auth-view-login,
#auth-wrapper.auth2 #auth-view-reg { gap: 0 }
#auth-wrapper.auth2 .auth-title {
  font-size: 28px !important;
  font-weight: 800;
  line-height: 1.15 !important;
  margin: 0 0 8px !important;
  color: #f3f5f9;
  text-align: left
}
#auth-wrapper.auth2 .auth-sub {
  font-size: 15px !important;
  line-height: 1.45 !important;
  color: #8d95a6 !important;
  padding: 0 !important;
  margin: 0 0 24px !important;
  text-align: left
}
#reg-flow-status:empty { display: none }
#auth-wrapper.auth2 .auth2-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #8d95a6;
  margin: 0 0 8px 4px
}
#auth-wrapper.auth2 #inp-code,
#auth-wrapper.auth2 #reg-name {
  width: 100%;
  height: 56px !important;
  min-height: 56px !important;
  padding: 0 16px !important;
  margin: 0 0 12px !important;
  border-radius: 16px !important;
  background: #161c28 !important;
  border: 1.5px solid rgba(255, 255, 255, .08) !important;
  color: #f3f5f9 !important;
  -webkit-text-fill-color: #f3f5f9 !important;
  caret-color: #ff6b5e;
  font: 600 16px var(--font-main) !important;
  text-align: left;
  letter-spacing: 0;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none
}
#auth-wrapper.auth2 #inp-code:focus,
#auth-wrapper.auth2 #reg-name:focus { border-color: rgba(255, 107, 94, .7) !important }
#auth-wrapper.auth2 #inp-code::placeholder,
#auth-wrapper.auth2 #reg-name::placeholder { color: #6b7385; font-weight: 500 }
#auth-wrapper.auth2 .auth2-btn {
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 16px;
  background: #ff6b5e !important;
  color: #fff;
  font: 800 16px var(--font-main);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, opacity .12s ease
}
#auth-wrapper.auth2 .auth2-btn:active { transform: scale(.98) }
#auth-wrapper.auth2 .auth2-btn:disabled { opacity: .6 }
#auth-wrapper.auth2 .auth-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  margin: 8px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-top: 0 !important;
  background: transparent !important;
  box-shadow: none;
  backdrop-filter: none;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  font-weight: 700;
  color: #f3f5f9;
  opacity: 1
}
#auth-wrapper.auth2 .auth-toggle b { color: #ff6b5e; font-weight: 800 }
#auth-wrapper.auth2 .auth2-secondary {
  border: 1px solid rgba(255, 255, 255, .18) !important;
  background: #161c28 !important;
  border-radius: 16px;
  margin-top: 12px !important;
  font: 800 15px var(--font-main);
}
#auth-wrapper.auth2 .auth-toggle:focus-visible {
  outline: 2px solid #ff6b5e;
  outline-offset: 2px;
}
@media (min-height: 760px) {
  #auth-wrapper.auth2 .auth2-panel { padding-top: 240px }
}
/* телефон боком: картинки слева, форма справа, всё видно без прокрутки */
@media (orientation: landscape) and (min-width: 550px) and (max-height: 520px) {
  #auth-wrapper.auth2 { justify-content: flex-start !important }
  #auth-wrapper.auth2::after { background: linear-gradient(90deg, rgba(11, 15, 23, 0) 18%, rgba(11, 15, 23, .88) 46%, #0b0f17 58%) }
  #auth-wrapper.auth2 .auth2-backdrop { bottom: 0 }
  #auth-wrapper.auth2 .auth2-mosaic { right: 40%; top: -60px }
  #auth-wrapper.auth2 .auth2-panel { margin: auto 0; align-self: flex-end; max-width: min(420px, 50vw); padding: 16px 24px max(16px, env(safe-area-inset-bottom, 0px)) 0 }
  #auth-wrapper.auth2 .auth2-brand { margin-bottom: 8px }
}
@media (orientation: landscape) and (min-width: 550px) and (max-height: 380px) {
  #auth-wrapper.auth2 .auth-sub:not([role="status"]) { display: none }
  #auth-wrapper.auth2 .auth-title { font-size: 22px !important }
  #auth-wrapper.auth2 .auth2-brand { display: none }
}

/* Кружок с иконкой в плашке достижения / бонуса за вход: общий сброс
   div{background:transparent!important} иначе делает его пустым */
#ach-unlock-toast .ach-ic { background: var(--ach-c, #f5a524) !important }

/* ===== Дуэль: выбор темы списком, как достижения ===== */
.duel-theme-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 2px 4px
}
.duel-theme-list .duel-theme-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 !important;
  min-height: 56px;
  padding: 10px 16px 10px 12px !important;
  border: 0 !important;
  border-radius: 16px !important;
  cursor: pointer;
  text-align: left;
  transition: transform .12s ease, box-shadow .15s ease
}
.duel-theme-list .duel-theme-row:active { transform: scale(.98) }
.duel-theme-list .duel-theme-row .card-number {
  width: 32px !important;
  min-width: 32px !important;
  height: 32px !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  display: flex;
  align-items: center;
  justify-content: center
}
.duel-theme-list .duel-theme-row .card-number img { width: 28px; height: 28px; object-fit: contain }
.duel-theme-list .duel-theme-row .card-title { font-size: 14px; font-weight: 800 }
.duel-theme-list .duel-theme-row .card-sub { font-size: 12px; margin-top: 2px }
.duel-theme-radio {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .22);
  transition: box-shadow .15s ease
}
.duel-theme-row.is-selected { box-shadow: inset 0 0 0 1.5px rgba(255, 107, 94, .75) !important }
.duel-theme-row.is-selected .duel-theme-radio { box-shadow: inset 0 0 0 7px #ff6b5e }
html.theme-light .duel-theme-radio { box-shadow: inset 0 0 0 2px rgba(20, 24, 31, .22) }
html.theme-light .duel-theme-row.is-selected .duel-theme-radio { box-shadow: inset 0 0 0 7px #ff6b5e }

/* ===== Дарение и объединение подарков: общий стиль игры (2026-10) =====
   Карточки как строки «Топа», главная кнопка коралловая, обычный регистр */
#gift-popup .gift-rarity-block {
  background: rgba(255, 255, 255, .05) !important;
  border: 0 !important;
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 16px
}
#gift-popup .gift-rarity-label { color: #9aa3b4 !important; font-size: 13px; font-weight: 600 }
#gift-popup .gift-rarity-value { font-size: 16px; font-weight: 800; letter-spacing: 0 }
#gift-popup .gift-popup-footer { display: flex; flex-direction: column; gap: 8px }
#gift-popup .gift-popup-footer .gift-action-btn {
  height: 52px;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, .07) !important;
  color: #f3f5f9 !important;
  font: 800 15px var(--font-main) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  box-shadow: none !important
}
#gift-popup .gift-popup-footer .gift-action-btn--send { background: #ff6b5e !important; color: #fff !important }
#gift-popup .gift-popup-footer .gift-action-btn small { font-size: 13px; font-weight: 700; opacity: .7; margin-left: 4px }

#gift-send-modal .gift-send-summary {
  background: rgba(255, 255, 255, .05) !important;
  border: 0 !important;
  border-radius: 16px;
  padding: 12px 16px 12px 12px;
  margin-bottom: 12px
}
#gift-send-modal .gift-send-summary__gift { margin: 0; gap: 12px }
#gift-send-modal .gift-send-summary__icon { width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 0 }
#gift-send-modal .gift-send-summary__name { font-size: 15px; font-weight: 800; color: #f3f5f9 }
#gift-send-modal .gift-send-summary__sub { font-size: 12px; color: #9aa3b4; margin-top: 2px; text-transform: none; letter-spacing: 0 }
#gift-send-modal .gift-send-warning {
  margin-top: 12px;
  padding: 10px 12px;
  border: 0 !important;
  border-radius: 12px;
  background: rgba(255, 107, 94, .12) !important;
  color: #ff8a83;
  font-size: 13px;
  font-weight: 600;
  text-align: left
}
#gift-send-modal .gift-search-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  margin: 0 0 12px;
  border-radius: 16px;
  border: 1.5px solid rgba(255, 255, 255, .08) !important;
  background: rgba(255, 255, 255, .05) !important;
  color: #f3f5f9;
  font: 600 15px var(--font-main);
  box-shadow: none !important;
  outline: none
}
#gift-send-modal .gift-search-input:focus { border-color: rgba(255, 107, 94, .7) !important }
#gift-send-modal .gift-search-input::placeholder { color: #6b7385; font-weight: 500 }
#gift-send-modal .gift-search-hint { font-style: normal; font-size: 13px; color: #8d95a6; padding: 16px 8px }
#gift-send-modal .gift-search-results { display: flex; flex-direction: column; gap: 8px }
#gift-send-modal .gift-recipient {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin: 0 !important;
  padding: 8px 8px 8px 12px;
  border: 0 !important;
  border-radius: 16px;
  background: rgba(255, 255, 255, .05) !important
}
#gift-send-modal .gift-recipient__avatar { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 0 0 2px #ff6b5e; object-fit: cover }
#gift-send-modal .gift-recipient__name { font-size: 14px; font-weight: 800; color: #f3f5f9 }
#gift-send-modal .gift-recipient__id {
  margin-top: 2px;
  color: var(--text-dim, #9aa3b4);
  font-size: 12px;
  opacity: 1;
  white-space: normal;
  overflow-wrap: anywhere
}
.gift-confirm__id { display: block; margin-top: 4px; color: var(--text-dim, #9aa3b4); font-size: 13px; font-weight: 600 }
:is(.gift-recipient__id, .gift-confirm__id, .me-public-id, .pp-public-id) bdi {
  font-variant-numeric: tabular-nums;
  letter-spacing: .035em
}
.me-public-id, .pp-public-id { color: var(--text-dim, #9aa3b4); font: 600 12px var(--font-main); line-height: 1.4 }
.me-public-id {
  display: block; margin: 4px auto; padding: 5px 10px; background: transparent;
  border: 1px solid currentColor; border-radius: 8px; cursor: pointer
}
.pp-public-id { margin-top: 4px }
#gift-send-modal .gift-recipient__pick {
  flex: none;
  height: 40px;
  padding: 0 16px;
  border: 0 !important;
  border-radius: 12px;
  background: #ff6b5e !important;
  color: #fff !important;
  font: 800 13px var(--font-main);
  text-transform: none;
  letter-spacing: 0;
  box-shadow: none !important
}
@media (max-width: 360px) {
  #gift-send-modal .gift-recipient { gap: 8px }
  #gift-send-modal .gift-recipient__avatar { width: 32px; height: 32px }
  #gift-send-modal .gift-recipient__id { font-size: 11px }
  #gift-send-modal .gift-recipient__pick { padding-inline: 9px; font-size: 12px }
}

#gift-send-modal .gift-confirm { text-align: center; padding: 4px 0 0 }
#gift-send-modal .gift-confirm__visual {
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
  border: 0 !important;
  border-radius: 24px;
  background: rgba(255, 255, 255, .05) !important;
  box-shadow: none !important;
  display: flex;
  align-items: center;
  justify-content: center
}
#gift-send-modal .gift-confirm__text { font-size: 17px; line-height: 1.4; font-weight: 600; color: #f3f5f9 }
#gift-send-modal .gift-confirm__text b { color: #f3f5f9 !important; font-weight: 800 }
#gift-send-modal .gift-confirm__warn {
  margin: 12px 0 20px;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  color: #9aa3b4 !important;
  font-size: 13px;
  line-height: 1.45
}
#gift-send-modal .gift-confirm__buttons { display: flex; gap: 8px }
#gift-send-modal .gift-confirm__btn {
  flex: 1;
  height: 52px;
  border: 0 !important;
  border-radius: 16px;
  font: 800 15px var(--font-main);
  text-transform: none;
  letter-spacing: 0;
  box-shadow: none !important
}
#gift-send-modal .gift-confirm__btn--back { background: rgba(255, 255, 255, .07) !important; color: #f3f5f9 !important }
#gift-send-modal .gift-confirm__btn--go { background: #ff6b5e !important; color: #fff !important }

#gift-picker-modal .gift-picker-header-text { font-size: 15px; font-weight: 600; color: #f3f5f9; line-height: 1.4; margin: 0 0 16px; text-align: center }
#gift-picker-modal .gift-picker-header-text b { font-weight: 800 }
#gift-picker-modal .gift-picker-header-text small { display: block; margin-top: 4px; font-size: 12px; font-weight: 500; color: #9aa3b4; text-transform: none; letter-spacing: 0 }
#gift-picker-modal .gift-picker-grid { gap: 8px }
#gift-picker-modal .gift-picker-card {
  position: relative;
  border: 0 !important;
  border-radius: 16px;
  background: rgba(255, 255, 255, .05) !important;
  box-shadow: none !important
}
#gift-picker-modal .gift-picker-card__name { font-weight: 700; color: #f3f5f9; margin-top: 8px }
#gift-picker-modal .gift-count-badge,
#gift-popup .gift-count-badge {
  background: #ff6b5e !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: none !important;
  font-weight: 800
}

#gift-merge-modal .merge-pair { gap: 12px; align-items: center }
#gift-merge-modal .merge-gift {
  width: 80px;
  height: 80px;
  border: 0 !important;
  border-radius: 20px;
  background: rgba(255, 255, 255, .05) !important;
  box-shadow: none !important;
  animation: none !important;
  transform: none !important
}
#gift-merge-modal .merge-plus { color: #8d95a6 !important; font-size: 22px; font-weight: 800; text-shadow: none !important }
#gift-merge-modal .merge-arrow { color: #8d95a6 !important; margin: 12px 0; display: flex; justify-content: center }
#gift-merge-modal .merge-box {
  width: 88px;
  height: 88px;
  border: 0 !important;
  border-radius: 24px;
  background: rgba(255, 107, 94, .14) !important;
  box-shadow: none !important;
  color: #ff6b5e !important;
  font-size: 40px;
  font-weight: 800;
  text-shadow: none !important
}
#gift-merge-modal .merge-mystery__caption { color: #f3f5f9 !important; font-size: 15px; font-weight: 800; text-transform: none; letter-spacing: 0; text-shadow: none !important; margin-top: 12px }
#gift-merge-modal .merge-mystery__hint { color: #9aa3b4 !important; font-size: 12px; text-transform: none; letter-spacing: 0 }
#gift-merge-modal .merge-explain { color: #9aa3b4 !important; font-size: 13px; line-height: 1.45; margin: 16px 0 }
#gift-merge-modal .merge-explain b { color: #f3f5f9 !important }
#gift-merge-modal .merge-confirm-btn,
#gift-merge-modal .merge-result__btn {
  width: 100%;
  height: 52px;
  border: 0 !important;
  border-radius: 16px !important;
  background: #ff6b5e !important;
  color: #fff !important;
  font: 800 15px var(--font-main) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  box-shadow: none !important
}
#gift-merge-modal .merge-empty { text-align: center; color: #f3f5f9; font-size: 15px; font-weight: 600; padding: 8px 0 }
#gift-merge-modal .merge-empty__ic { width: 80px; height: 80px; margin: 0 auto 12px; border-radius: 20px; background: rgba(255, 255, 255, .05) !important; display: flex; align-items: center; justify-content: center }
#gift-merge-modal .merge-empty__sub { margin-top: 6px; font-size: 13px; color: #9aa3b4 }
#gift-merge-modal .merge-from { color: #9aa3b4; font-size: 13px; text-align: center }
#gift-merge-modal .merge-result__name { text-transform: none !important; letter-spacing: 0 !important; font-size: 20px; font-weight: 800 }
#gift-merge-modal .merge-result__desc { color: #9aa3b4 }
#gift-picker-modal .gift-count-badge { position: absolute; top: 6px; right: 6px; left: auto; bottom: auto; transform: none; margin: 0; padding: 2px 7px; border-radius: 999px; font-size: 11px; line-height: 1.3; z-index: 1 }
#gift-picker-modal .gift-picker-card { padding: 12px 4px !important }
#gift-picker-modal .gift-picker-card__name { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: normal; word-break: normal; padding: 0; line-height: 1.2; font-size: 11px; letter-spacing: -.1px }
.pp-lv { margin-top: 4px; font-size: 13px; font-weight: 600; color: #9aa3b4 }

/* ===== Адаптивность: узкий телефон и телефон боком (2026-10-26) ===== */
/* «Игры» на 320-360px: заголовок большой карточки не выталкивает метку за верх */
@media (max-width: 360px) {
  .gs-hero { height: 196px }
  .gs-hero b { font-size: 20px !important }
  .gs-hero .gs-t { max-width: 66% }
  .gs-hero .gs-s { font-size: 12px !important }
  .gs-hero .gs-btn { margin-top: 10px; padding: 8px 16px }
}
/* Вопрос этапа боком: окно шире, ответы в три колонки — все видны без прокрутки */
@media (orientation: landscape) and (max-height: 520px) {
  #mission-window .modal-window { max-width: min(780px, calc(100vw - 32px)) !important; width: min(780px, calc(100vw - 32px)) !important }
  #mission-window .mission-question { font-size: 18px !important; margin-bottom: 10px !important }
  #mission-window .mission-answers { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 8px !important }
  #mission-window .mission-answer { margin: 0 !important; min-height: 56px; align-items: center }
  #mission-window .quiz-progress { margin-top: 6px !important; margin-bottom: 12px !important }
}
@media (orientation: landscape) and (max-height: 360px) {
  #mission-window .modal-window { padding-top: 22px !important }
  #mission-window .modal-header { display: none !important }
  #mission-window .mission-question { font-size: 15.5px !important; line-height: 1.3 !important }
  #mission-window .mission-answer { min-height: 48px; padding: 8px 10px !important; font-size: 13px !important }
}
/* Лутбокс на низком телефоне: шапка и сцена компактнее, «Забрать» не прилипает к краю */
@media (orientation: portrait) and (max-height: 680px) {
  .lc-head { padding-top: calc(env(safe-area-inset-top, 0px) + 28px) }
  .lc-stage { min-height: 200px }
  .lc-foot { min-height: 170px; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px) }
  .lc-name { font-size: 24px }
  .lc-btn { margin-top: 16px }
}
/* Лутбокс боком: ящик и предмет слева, шапка, точки, редкость и «Забрать» — справа */
@media (orientation: landscape) and (max-height: 520px) {
  .wt-ov.lc-ov { flex-direction: row; align-items: stretch }
  .lc-stage { flex: 1 1 auto; min-height: 0 }
  .lc-foot { flex: 0 0 min(46vw, 380px); min-height: 0; padding: 0 calc(20px + env(safe-area-inset-right, 0px)) 0 8px; display: flex; flex-direction: column; justify-content: center; text-align: left }
  .lc-head { position: absolute; right: calc(20px + env(safe-area-inset-right, 0px)); top: calc(18px + env(safe-area-inset-top, 0px)); width: calc(min(46vw, 380px) - 28px); padding: 0; text-align: left; z-index: 1 }
  .lc-tapzone { left: 8px; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); text-align: left }
  .lc-dots { justify-content: flex-start }
  .lc-name { font-size: 24px }
  .lc-btn { margin-top: 16px; height: 48px }
  .lc-crate { width: 170px; height: 158px; margin: -84px 0 0 -85px }
  .lc-shadow { margin-top: 64px }
  .lc-item { width: 160px; height: 160px; margin: -80px 0 0 -80px }
  .lc-item__img, .lc-item__halo { width: 150px; height: 150px }
  .lc-pool { margin-top: 82px }
}
/* телефон боком: меню ниже и плотнее, герой профиля не во весь экран */
@media (orientation: landscape) and (max-height: 520px) {
  .dock { bottom: 8px !important }
  html:not(.dock-classic) .dock > .dock-item { height: 48px !important }
  .me-hero { height: min(240px, 56vh) }
}

/* Колокольчик уведомлений: есть непрочитанные — покачивается, как будто звенит */
#notif-mail-icon.ring { transform-origin: 50% 6%; animation: notifRing 2.6s ease-in-out infinite; }
@keyframes notifRing {
    0%, 42%, 100% { transform: rotate(0); }
    6% { transform: rotate(14deg); }
    13% { transform: rotate(-12deg); }
    20% { transform: rotate(9deg); }
    27% { transform: rotate(-6deg); }
    34% { transform: rotate(3deg); }
}
@media (prefers-reduced-motion: reduce) { #notif-mail-icon.ring { animation: none; } }

/* ── Разбор ошибок этапа (2026-10-31): в стиле «Вопроса дня» ── */
#stage-results-modal .modal-window { max-height: 86vh }
#stage-results-modal .modal-header { text-align: left }
#stage-results-modal .modal-header h2 { font: 800 19px/1.25 var(--font-main, Montserrat), sans-serif; letter-spacing: 0; text-transform: none; color: #fff; padding-right: 48px }
.fl-mx-score { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.05) !important; --tone: #49d995 }
.fl-mx--mid { --tone: #ffb547 } .fl-mx--bad { --tone: #ff6a61 }
.fl-mx-ring { position: relative; width: 72px; height: 72px; flex: none }
.fl-mx-ring svg { width: 100%; height: 100%; transform: rotate(-90deg) }
.fl-mx-ring circle { fill: none; stroke-width: 7 }
.fl-mx-ring__bg { stroke: rgba(255,255,255,.1) }
.fl-mx-ring__fg { stroke: var(--tone); stroke-linecap: round; transition: stroke-dasharray .6s ease }
.fl-mx-ring__num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1 }
.fl-mx-ring__num b { font: 800 22px var(--font-main, Montserrat), sans-serif; color: #fff }
.fl-mx-ring__num span { font: 700 10px var(--font-main, Montserrat), sans-serif; color: #8d96aa; margin-top: 3px }
.fl-mx-score__txt { min-width: 0 }
.fl-mx-score__txt b { display: block; font: 800 16px var(--font-main, Montserrat), sans-serif; color: var(--tone) }
.fl-mx-score__txt span { display: block; margin-top: 4px; font: 600 13px/1.4 var(--font-main, Montserrat), sans-serif; color: #c9d0de }
.fl-mx-head { display: flex; align-items: center; gap: 8px; margin: 6px 2px 10px; font: 800 11px var(--font-main, Montserrat), sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #ffb547 }
.fl-mx-head span { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: rgba(255,181,71,.15) !important; display: inline-grid; place-items: center; letter-spacing: 0 }
.fl-mx-card { padding: 14px; border-radius: 16px; background: rgba(255,255,255,.05) !important; border: 1px solid rgba(255,255,255,.06); margin-bottom: 10px }
.fl-mx-q { font: 800 15px/1.35 var(--font-main, Montserrat), sans-serif; color: #fff; margin-bottom: 10px }
.fl-mx-ans { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 2px solid transparent; margin-top: 8px; font: 700 14px/1.35 var(--font-main, Montserrat), sans-serif; color: #fff }
.fl-mx-ans i { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font: 900 12px var(--font-main, Montserrat), sans-serif; font-style: normal }
.fl-mx-ans small { display: block; font: 700 10px var(--font-main, Montserrat), sans-serif; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 2px; opacity: .8 }
.fl-mx-ans--bad { border-color: rgba(255,106,97,.55); background: rgba(255,106,97,.1) !important }
.fl-mx-ans--bad i { background: #ff6a61 !important; color: #fff }
.fl-mx-ans--bad small { color: #ff8a83 }
.fl-mx-ans--ok { border-color: rgba(73,217,149,.55); background: rgba(73,217,149,.1) !important }
.fl-mx-ans--ok i { background: #49d995 !important; color: #0b2a1b }
.fl-mx-ans--ok small { color: #49d995 }
.fl-mx-why { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.04) !important; font: 600 13px/1.45 var(--font-main, Montserrat), sans-serif; color: #c9d0de }
.fl-mx-why small { display: block; font: 800 10px var(--font-main, Montserrat), sans-serif; letter-spacing: .1em; text-transform: uppercase; color: #8d96aa; margin-bottom: 4px }
.fl-mx-done { margin-top: 6px; padding: 16px; border-radius: 16px; background: rgba(73,217,149,.1) !important; border: 1px solid rgba(73,217,149,.3); font: 600 13px/1.45 var(--font-main, Montserrat), sans-serif; color: #c9d0de; text-align: center }
.fl-mx-done--plain { padding: 10px 0 0; background: none !important; border: 0 }
.fl-mx-done b { display: block; font: 800 17px var(--font-main, Montserrat), sans-serif; color: #49d995; margin-bottom: 4px }
.fl-mx-btn { display: block; width: 100%; height: 50px; margin-top: 6px; border: 0; border-radius: 15px; background: linear-gradient(135deg, #ff6a61, #d4473d) !important; color: #fff; font: 800 16px var(--font-main, Montserrat), sans-serif; cursor: pointer }
.fl-mx-btn:active { transform: scale(.98) }
html.theme-light #stage-results-modal .modal-header h2 { color: #14181f }
html.theme-light .fl-mx-score, html.theme-light .fl-mx-card { background: #f3f5f9 !important; border-color: #e3e7ee }
html.theme-light .fl-mx-ring__bg { stroke: #e3e7ee !important }
html.theme-light .fl-mx-ring__num b, html.theme-light .fl-mx-q, html.theme-light .fl-mx-ans { color: #14181f }
html.theme-light .fl-mx-score__txt span, html.theme-light .fl-mx-why, html.theme-light .fl-mx-done { color: #4b5563 }
html.theme-light .fl-mx-why { background: #fff !important }
html.theme-light .fl-mx-ans--bad small { color: #dc3b33 } html.theme-light .fl-mx-ans--ok small, html.theme-light .fl-mx-done b { color: #16a34a }
html.theme-light .fl-mx--ok { --tone: #16a34a } html.theme-light .fl-mx--mid { --tone: #d97706 }
#stage-results-modal .modal-header { display: block !important; width: 100%; box-sizing: border-box; padding: 18px 16px 4px !important }
#stage-results-modal .modal-header h2 { text-align: left; margin: 0 !important }
#stage-results-modal .fl-mx-score { width: 100%; box-sizing: border-box }

/* ── Аватарки: фон лиги под прозрачной мордочкой скина (inc/avatars.php, init.js avaUrl) ── */
img[src$="#t0-svc"]{background:url(avatars/bg/bronze_svc.webp) center/cover no-repeat}
img[src$="#t0-pro"]{background:url(avatars/bg/bronze_pro.webp) center/cover no-repeat}
img[src$="#t0-nat"]{background:url(avatars/bg/bronze_nat.webp) center/cover no-repeat}
img[src$="#t0-fest"]{background:url(avatars/bg/bronze_fest.webp) center/cover no-repeat}
img[src$="#t1-svc"]{background:url(avatars/bg/silver_svc.webp) center/cover no-repeat}
img[src$="#t1-pro"]{background:url(avatars/bg/silver_pro.webp) center/cover no-repeat}
img[src$="#t1-nat"]{background:url(avatars/bg/silver_nat.webp) center/cover no-repeat}
img[src$="#t1-fest"]{background:url(avatars/bg/silver_fest.webp) center/cover no-repeat}
img[src$="#t2-svc"]{background:url(avatars/bg/gold_svc.webp) center/cover no-repeat}
img[src$="#t2-pro"]{background:url(avatars/bg/gold_pro.webp) center/cover no-repeat}
img[src$="#t2-nat"]{background:url(avatars/bg/gold_nat.webp) center/cover no-repeat}
img[src$="#t2-fest"]{background:url(avatars/bg/gold_fest.webp) center/cover no-repeat}
img[src$="#t3-svc"]{background:url(avatars/bg/diamond_svc.webp) center/cover no-repeat}
img[src$="#t3-pro"]{background:url(avatars/bg/diamond_pro.webp) center/cover no-repeat}
img[src$="#t3-nat"]{background:url(avatars/bg/diamond_nat.webp) center/cover no-repeat}
img[src$="#t3-fest"]{background:url(avatars/bg/diamond_fest.webp) center/cover no-repeat}
img[src$="#t4-svc"]{background:url(avatars/bg/legend_svc.webp) center/cover no-repeat}
img[src$="#t4-pro"]{background:url(avatars/bg/legend_pro.webp) center/cover no-repeat}
img[src$="#t4-nat"]{background:url(avatars/bg/legend_nat.webp) center/cover no-repeat}
img[src$="#t4-fest"]{background:url(avatars/bg/legend_fest.webp) center/cover no-repeat}

/* профиль: «Инвентарь» слева от героя — зеркально кнопке «Скины» справа */
.me-skins.me-invb { right: auto; left: 4px }

/* чужой профиль: реакция, за которую уже голосовали, — своим цветом */
.pp-r.has { color: #fff }
.pp-r.has[data-r="thumbsup"] svg { color: #5b9dff }
.pp-r.has[data-r="heart"] svg { color: #ff5c7a }
.pp-r.has[data-r="fire"] svg { color: #ff8a3d }
.pp-r.has[data-r="star"] svg { color: #ffd23f }
.pp-r.has[data-r="crown"] svg { color: #f2b84b }
.pp-r.has svg { fill: currentColor; fill-opacity: .25 }
html.theme-light .pp-r.has { color: #14181f }

/* ── Чужой профиль: единая система отступов (как в iOS) ──
   поля окна 16px · шаг между плитками 12px · между шапкой и карточками 24px */
#player-profile .modal-body.pp-body { padding: 24px 16px 24px !important }
#player-profile .pp-head { margin-bottom: 0 }
#player-profile .me-grid { margin-top: 24px; gap: 12px }
#player-profile .pp-rx { margin-top: 12px; gap: 12px }   /* карточки → реакции → кнопки: один ритм 12px */
#player-profile .pp-btns { margin-top: 12px; gap: 12px }


/* Шторки на слабых телефонах (класс .low-end ставит detectLowEnd() в init.js).
   Тень и цветной отлив сверху на тёмном затемнении почти не видны, а большой
   размытой тени шторка требует при каждом выезде. На обычных телефонах всё как раньше. */
html.low-end .sheet > .sheet-win { box-shadow: none !important }
html.low-end:not(.theme-light) .sheet > .sheet-win { background: #121722 !important }

/* Подарки и достижения — окна-шторки: подпись под заголовком и поля как у остальных окон */
.sheet-list-body { padding-top: 0 !important }
.sheet-sub { margin: 0 0 16px; font-size: 13px; line-height: 1.4; color: rgba(var(--ink), .55); text-align: center }

/* Голосование: варианты-эмодзи и текстовые варианты */
.poll-opts{display:flex;flex-direction:column;gap:10px;width:100%}
.poll-opt{position:relative;border-radius:12px;padding:10px 14px;display:flex;align-items:center;gap:12px;cursor:pointer;transition:background .2s,box-shadow .2s}
.poll-opt.on{box-shadow:0 0 0 1.5px var(--primary)}
.poll-opt-t{background:rgba(var(--ink),.07)!important}
.poll-opt-t.on{background:rgba(255,106,97,.16)!important}
.poll-opt:active{transform:scale(.98)}
.poll-emo{font-size:26px;line-height:1;flex-shrink:0}
.poll-body{flex:1;min-width:0}
.poll-n{display:block;font-size:13px;font-weight:700;color:rgb(var(--ink))}
.poll-none{font-size:12px;color:var(--text-dim)}
.poll-who{display:flex;align-items:center;gap:5px;margin-top:5px;font-size:11px;color:var(--text-dim);min-width:0}
.poll-who img{width:18px;height:18px;border-radius:50%;object-fit:cover;flex-shrink:0}
.poll-who span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.poll-who i{font-style:normal;opacity:.6}
.poll-opt-t{flex-direction:column;align-items:stretch;gap:8px;padding:12px 14px}
.poll-row{display:flex;align-items:flex-start;gap:10px}
.poll-txt{flex:1;min-width:0;font-size:15px;font-weight:700;line-height:1.3;color:rgb(var(--ink));overflow-wrap:anywhere}
.poll-pct{font-size:14px;font-weight:800;color:var(--text-dim);flex-shrink:0}
.poll-opt-t.on .poll-pct{color:var(--primary)}
.poll-bar{height:5px;border-radius:3px;background:rgba(var(--ink),.1)!important;overflow:hidden}
.poll-bar i{display:block;height:100%;border-radius:3px;background:rgba(var(--ink),.35);transition:width .3s}
.poll-opt-t.on .poll-bar i{background:var(--primary)}
.poll-opt-t .poll-body{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.poll-opt-t .poll-n{display:inline;font-size:12px;color:var(--text-dim)}
.poll-opt-t .poll-who{margin-top:0}


/* В VK на ПК прокручивается содержимое между шапкой и меню. */
html.in-vk-desktop .screen:not(#scr-home) {
  top: var(--hud-height);
  bottom: calc(var(--dock-height) + 12px);
  padding-top: 16px !important;
  padding-bottom: 16px !important;
}
html.in-vk-desktop #scr-home.active {
  justify-content: safe flex-end;
}
.stories-bar {
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
}
#gifts-inventory-hint[hidden] {
  display: none !important;
}

#scr-news .account-delete-card {
  width: 100%;
  margin-top: 20px;
  font-family: inherit;
  text-align: left;
  color: var(--text-light);
}
#scr-news .account-delete-card .card-number {
  color: #ff938d;
}
html.theme-light #scr-news .account-delete-card .card-number {
  color: #aa413b;
}
#scr-news .account-delete-card:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

#mission-window {
  --diag-ink: #fff;
  --diag-copy: #dcd0ff;
  --diag-muted: #a8a0c8;
  --diag-reward: #ffd76b;
}
html.theme-light #mission-window {
  --diag-ink: #182135;
  --diag-copy: #33415b;
  --diag-muted: #515778;
  --diag-reward: #765209;
}
#mission-window .diag-action {
  width: 100%;
  font-family: inherit;
}
#mission-window .diag-action::before {
  content: none;
}
#account-delete .modal-body {
  display: grid;
  gap: 12px;
}
#account-delete .modal-body p {
  margin: 0;
}
#account-delete [role="status"]:empty {
  display: none;
}

.stories-bar-wrapper { position: relative }
.story-scroll-arrow { display: none }
@media (any-pointer: fine), (hover: hover), (min-width: 760px) {
  .story-scroll-arrow:not(:disabled) {
    display: grid;
    place-items: center;
    position: absolute;
    top: 41%;
    z-index: 1;
    width: 36px;
    height: 36px;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    background: var(--modal-bg, #161f31);
    color: var(--text-light);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
  }
  .story-scroll-arrow[data-direction="left"] { left: 2px }
  .story-scroll-arrow[data-direction="right"] { right: 2px }
}

@media (max-width: 549px) {
  #auth-wrapper.auth2:focus-within .auth2-panel {
    flex-shrink: 0;
    padding-top: 20px;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  }
}

:is(#special-carousel, #duel-cards-bar) > .act-slide {
  flex-basis: min(100%, clamp(232px, 68vw, 268px));
  min-width: 0;
}

@media (min-width: 550px) and (hover: hover) and (pointer: fine) {
  @container (min-width: 436px) {
    :is(#special-carousel, #duel-cards-bar) > .act-slide {
      flex-basis: calc((100% - var(--activity-gap)) / 2);
    }

    :is(#special-carousel, #duel-cards-bar) > .act-slide:only-child {
      flex-basis: 100%;
    }
  }
}

:is(#special-carousel, #duel-cards-bar) .act-ttl { overflow-wrap: anywhere }

#duel-cards-bar > .act-slide { flex-direction: column }
#duel-cards-bar > .act-slide > .act-card { flex: 1 }

.duel-section-heading {
  display: flex;
  align-items: center;
  gap: 6px;
}

.duel-history-button {
  display: grid;
  flex: 0 0 36px;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-block: -6px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: rgba(var(--ink), .65);
  background: transparent !important;
  cursor: pointer;
}

.duel-history-button:active { background: rgba(var(--ink), .08) !important }

.activity-carousel-pages {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

.activity-carousel-pages[hidden] { display: none }

.activity-carousel-pages .special-dot {
  --dot-opacity: .28;
  display: grid;
  place-items: center;
  width: 14px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent !important;
  color: rgb(var(--ink));
  cursor: pointer;
}

.activity-carousel-pages .special-dot::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: var(--dot-opacity);
}

.activity-carousel-pages .special-dot[aria-current="true"] { --dot-opacity: .58 }

.duel-history-button:focus-visible,
.feedback-view-link:focus-visible,
.activity-carousel-pages .special-dot:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

/* The duel title has its own space alongside the sheet close control. */
#modal-duel-create .modal-header {
  padding: 18px 58px 8px;
}

.ach-badge-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0 5px 4px;
  border: 0;
  background: transparent !important;
  color: rgba(var(--ink), .68);
  font: 700 11px/1 Montserrat, sans-serif;
  cursor: pointer;
}
.ach-badge-toggle:disabled { cursor: wait }
.ach-badge-toggle[aria-checked="true"] { color: var(--text-light) }
.ach-badge-track {
  box-sizing: border-box;
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: rgba(var(--ink), .22) !important;
  border: 1px solid rgba(var(--ink), .35);
}
.ach-badge-toggle[aria-checked="true"] .ach-badge-track {
  border-color: #b83730;
  background: #d54d43 !important;
}
.ach-badge-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.ach-badge-toggle[aria-checked="true"] .ach-badge-track::after {
  transform: translateX(16px);
}

.field-error {
  margin: 4px 0 0;
  color: #ff8a83;
  font: 700 12px/1.4 Montserrat, sans-serif;
  text-align: left;
}
.field-error[hidden], .ach-dismiss[hidden] { display: none !important }
#reg-name[aria-invalid="true"],
#account-delete-confirm[aria-invalid="true"],
#feedback-message[aria-invalid="true"] {
  border-color: #ef6b62 !important;
  box-shadow: 0 0 0 1px #ef6b62;
}
#account-delete [type="submit"][aria-disabled="true"] {
  opacity: .63;
}

#ach-unlock-toast .ach-dismiss {
  flex: 0 0 34px;
  min-height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: rgb(var(--ink));
  background: rgba(var(--ink), .10) !important;
  pointer-events: auto;
  cursor: pointer;
}
.ach-dismiss svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

#feedback-modal .modal-header { padding-inline: 56px }
#feedback-modal .modal-body[hidden] { display: none !important }
.feedback-history-body { padding-top: 0 }

.feedback-view-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: rgba(var(--ink), .06) !important;
  color: rgb(var(--ink));
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.feedback-message-field { margin-bottom: 0 }
.feedback-message-field textarea { display: block }
#feedback-error:not(:empty) { margin-top: clamp(8px, 2.5vw, 12px) }

.feedback-actions,
#feedback-history-open { margin-block: 12px 0 }

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

#reg-flow-status:empty { display: none }
#reg-flow-status { margin-top: 12px }

.embedded-game-load {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--modal-bg) !important;
  color: var(--text-light);
  text-align: center;
  z-index: 1;
}

.embedded-game-load > div {
  display: grid;
  gap: 12px;
  width: min(100%, 300px);
}

.embedded-game-load p { margin: 0 0 4px }
.embedded-game-load button[hidden] { display: none !important }

#feedback-history-back { margin-top: 12px }
#feedback-history-list { display: grid; gap: 10px }
.feedback-history-card {
  padding: 0 14px;
  border: 1px solid rgba(var(--ink), .10);
  border-radius: 16px;
  background: rgba(var(--ink), .05) !important;
  overflow-wrap: anywhere;
}
.feedback-history-summary {
  display: block;
  list-style: none;
  padding-block: 12px;
  color: rgb(var(--ink));
  cursor: pointer;
}
.feedback-history-summary::-webkit-details-marker { display: none }
.feedback-history-summary:focus-visible, .feedback-view-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.feedback-history-recipient { font-size: 14px }
.feedback-history-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 5px;
  color: rgba(var(--ink), .74);
  font-size: 12px;
}
.feedback-history-state {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(var(--ink), .08);
  font-weight: 700;
}
.feedback-history-state.has-reply { color: rgb(var(--ink)); background: rgba(var(--ink), .14) }
.feedback-history-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin-top: 9px;
  overflow: hidden;
  color: rgba(var(--ink), .85);
  font-size: 13px;
  line-height: 1.4;
}
.feedback-history-expand { display: block; margin-top: 8px; font-size: 12px; font-weight: 800 }
.feedback-history-card:not([open]) .feedback-history-expand > :last-child,
.feedback-history-card[open] .feedback-history-expand > :first-child,
.feedback-history-card[open] .feedback-history-preview { display: none }
.feedback-history-text {
  margin: 0 0 12px;
  color: rgb(var(--ink));
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.feedback-history-reply { border-top: 1px solid rgba(var(--ink), .12); padding-top: 6px }
.feedback-history-reply .feedback-history-text { margin-top: 6px }
#feedback-history-status, #feedback-history-more { margin-top: 12px }
#feedback-history-status:empty, #feedback-history-more[hidden] { display: none !important }
