/*
 * CaseDays — каркас: шапка с меню, контент, правая лента «Пруд сейчас», подвал с гусем.
 * Композиция по макету design/mockup/c823…webp. Только токены из tokens.css.
 */

:root {
  --header-h: 76px;
  --feed-w: 324px;
  --sidebar-w: 88px;
  --tabbar-h: 64px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--sp-4);
  z-index: var(--z-toast);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: var(--fw-semibold);
}

.skip-link:focus {
  top: var(--sp-2);
}

/* ---------- Шапка ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  height: var(--header-h);
  padding: 0 var(--sp-6);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
}

.header__logo {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.header__logo img {
  width: auto;
  height: 30px;
}

.header__logo .header__logo-mark {
  height: 52px;
  border-radius: var(--radius-control);
  transition: transform var(--dur-base) var(--ease);
}

.header__logo:hover .header__logo-mark {
  transform: rotate(-6deg) scale(1.06);
}

.header__nav {
  min-width: 0;
}

.header__menu {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.header__link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: var(--control-h);
  padding: 0 var(--sp-3);
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--dur-micro) var(--ease), background-color var(--dur-micro) var(--ease);
}

.header__link:hover,
.header__link.is-active {
  color: var(--text);
  background: var(--surface-2);
}

.header__link.is-active .icon {
  color: var(--accent);
}

.header__link-icon {
  width: 20px;
  height: 20px;
}

/* «Ещё»: редкие разделы + пункты, которые на узкой шапке переезжают из строки меню */
.header__more {
  position: relative;
}

.dropdown__item.header__more-dup {
  display: none;
}

.header__more-menu {
  min-width: 280px;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
}

.header__bell {
  position: relative;
}

.header__counter {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 var(--sp-1);
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--fs-xs);
  line-height: 18px;
  font-weight: var(--fw-bold);
  text-align: center;
}

/* Поиск: иконка → поле */
.header-search {
  position: relative;
  display: flex;
  align-items: center;
}

.header-search__input {
  width: 0;
  padding: 0;
  border-color: transparent;
  opacity: 0;
  transition: width var(--dur-base) var(--ease), opacity var(--dur-base) var(--ease), padding var(--dur-base) var(--ease);
}

.header-search.is-open .header-search__input {
  width: 220px;
  padding: 0 var(--sp-4);
  border-color: var(--line);
  opacity: 1;
}

.header-search.is-open .header-search__toggle {
  color: var(--text);
}

/* Кошелёк */
.wallet {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: var(--control-h);
  padding: 0 var(--sp-4);
  border-radius: var(--radius-control);
  background: var(--surface-2);
  font-weight: var(--fw-bold);
  transition: background-color var(--dur-micro) var(--ease);
}

.wallet:hover {
  background: var(--surface-3);
}

.wallet__icon {
  color: var(--accent);
}

/* Сумма по центру плашки по высоте: без строчного бокса вокруг inline-flex */
.wallet__amount {
  display: inline-flex;
  align-items: center;
  line-height: var(--lh-body);
}

.avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px var(--sp-1) 2px 2px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
}

.avatar-btn:hover,
.avatar-btn[aria-expanded="true"] {
  background: var(--surface-2);
  color: var(--text);
}

/* Выпадающие меню */
.dropdown {
  position: relative;
}

.dropdown__menu {
  position: absolute;
  top: calc(100% + var(--sp-2));
  right: 0;
  z-index: var(--z-dropdown);
  display: flex;
  flex-direction: column;
  min-width: 220px;
  padding: var(--sp-2);
  border: var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-2);
  animation: modal-in var(--dur-micro) var(--ease);
}

.dropdown__menu--wide {
  width: 320px;
}

.dropdown__head {
  padding: var(--sp-2) var(--sp-3);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dropdown__menu--wide.notif {
  width: 360px;
  max-width: calc(100vw - 2 * var(--sp-4));
}

/* Центр уведомлений */
.notif__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.notif__all {
  height: 28px;
  padding: 0 var(--sp-2);
  text-transform: none;
  letter-spacing: 0;
}

.notif__list {
  display: flex;
  flex-direction: column;
  max-height: min(420px, 60vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.notif__link {
  position: relative;
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--radius-control);
  color: var(--text-muted);
  transition: background-color var(--dur-micro) var(--ease);
}

a.notif__link:hover {
  background: var(--surface-3);
}

.notif__item.is-unread .notif__link {
  color: var(--text);
}

.notif__item.is-unread .notif__link::after {
  content: "";
  position: absolute;
  top: calc(var(--sp-3) + 6px);
  right: var(--sp-3);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.notif__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-control);
  background: var(--surface-3);
  color: var(--text-muted);
}

.notif__icon--drop { color: var(--rarity-covert); }
.notif__icon--deposit,
.notif__icon--bonus { color: var(--success); }
.notif__icon--promotion { color: var(--accent); }
.notif__icon--support { color: var(--info); }

.notif__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding-right: var(--sp-4);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.dropdown__empty {
  padding: var(--sp-2) var(--sp-3) var(--sp-3);
}

.dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  height: 40px;
  padding: 0 var(--sp-3);
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  text-align: left;
}

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

/* Пункт «Ещё» с пояснением, что это за раздел */
.dropdown__item:has(.dropdown__hint) {
  height: auto;
  min-height: 52px;
  padding-block: var(--sp-2);
}

.dropdown__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dropdown__hint {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  font-weight: var(--fw-medium);
}

.dropdown__item:hover,
.dropdown__item.is-active {
  background: var(--surface-3);
}

.dropdown__item--danger,
.dropdown__item--danger .icon {
  color: var(--danger);
}

/* ---------- Тело: колонка меню + контент + лента ---------- */
.app__body {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - var(--header-h));
}

.app__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-h));
}

.app__content {
  flex: 1;
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--sp-6));
  margin-inline: auto;
  padding: var(--sp-6);
}

.app__content:focus {
  outline: none;
}

/* ---------- Левая колонка меню (≥ 1280): плавающая панель-док (Правки 4) ---------- */
.sidebar {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-3));
  flex: none;
  display: flex;
  width: var(--sidebar-w);
  height: calc(100vh - var(--header-h) - var(--sp-6));
  margin: var(--sp-3) 0 var(--sp-3) var(--sp-3);
  padding: var(--sp-3) var(--sp-2);
  /* Фон и скругление — как у правой ленты «Пруд сейчас» (.feed__list), без обводки */
  border-radius: 24px;
  background: var(--surface-1);
  overflow-y: auto;
  scrollbar-width: none;
}

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

.sidebar__list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Разделитель групп: тонкая хромовая черта */
.sidebar__item--group {
  margin-top: var(--sp-1);
  padding-top: var(--sp-2);
  background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent) top / 100% 1px no-repeat;
}

.sidebar__item--bottom {
  margin-top: auto;
  padding-top: var(--sp-3);
}

.sidebar__link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) 0;
  border-radius: var(--radius-control);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  font-weight: var(--fw-semibold);
  text-align: center;
  transition: color var(--dur-micro) var(--ease);
}

.sidebar__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: transparent;
  color: var(--chrome-mid);
  transition: background-color var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease), transform var(--dur-micro) var(--ease);
}

.sidebar__icon .icon {
  width: 22px;
  height: 22px;
}

.sidebar__label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__link:hover {
  color: var(--text);
}

.sidebar__link:hover .sidebar__icon {
  background: var(--surface-3);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Активный: золотая плитка с кромкой и метка у левого края панели */
.sidebar__link.is-active {
  color: var(--accent);
}

.sidebar__link.is-active .sidebar__icon {
  background: var(--grad-gold);
  color: var(--accent-ink);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--chrome-hi) 70%, transparent);
}

.sidebar__link.is-active::before {
  content: "";
  position: absolute;
  top: 10px;
  left: calc(-1 * var(--sp-2));
  width: 3px;
  height: 28px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.sidebar__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar__icon {
    transition: none;
  }
}

/* Подсказка «что это» при наведении (js/layout.js initHints): заметная плашка с золотой кромкой и стрелкой */
.hint-tip {
  --arrow: 50%;
  position: fixed;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 280px;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: var(--radius-control);
  background: var(--surface-3);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--chrome-hi) 14%, transparent);
  color: var(--chrome-hi);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: var(--fw-medium);
  pointer-events: none;
  animation: hint-in var(--dur-micro) var(--ease);
}

.hint-tip__title {
  color: var(--accent);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: var(--fw-bold);
}

.hint-tip::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: inherit;
  background: inherit;
  transform: rotate(45deg);
}

.hint-tip[data-side="right"]::before {
  top: calc(var(--arrow) - 6px);
  left: -6px;
  border-top-color: transparent;
  border-right-color: transparent;
}

.hint-tip[data-side="bottom"]::before {
  top: -6px;
  left: calc(var(--arrow) - 6px);
  border-right-color: transparent;
  border-bottom-color: transparent;
}

.hint-tip[data-side="top"]::before {
  bottom: -6px;
  left: calc(var(--arrow) - 6px);
  border-top-color: transparent;
  border-left-color: transparent;
}

.hint-tip[hidden] {
  display: none;
}

@keyframes hint-in {
  from { opacity: 0; }
}


/* ---------- Правая колонка «Лента» ---------- */
.feed {
  position: sticky;
  top: var(--header-h);
  flex: none;
  display: flex;
  flex-direction: column;
  width: var(--feed-w);
  height: calc(100vh - var(--header-h));
  padding: 0 var(--sp-3) var(--sp-3) 0;
  background: var(--bg);
}

.feed__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
}

.feed__title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-bold);
}

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

.feed__online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 36px;
  color: var(--text-muted);
}

.feed__online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.feed__online[hidden],
.feed-strip[hidden] {
  display: none;
}

/* Новое событие ленты — короткое появление сверху */
.feed__list > li.is-new,
.feed-strip__list > li.is-new {
  animation: feed-in var(--dur-slow) var(--ease);
}

@keyframes feed-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .feed__list > li.is-new,
  .feed-strip__list > li.is-new {
    animation: none;
  }
}

.feed__title-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
}

.feed__tools {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.feed__lang {
  gap: var(--sp-1);
  padding: 0 var(--sp-2);
}

.feed__sound-on,
[data-sound-toggle][aria-pressed="true"] .feed__sound-off {
  display: none;
}

[data-sound-toggle][aria-pressed="true"] .feed__sound-on {
  display: block;
  color: var(--accent);
}

.feed__close {
  display: none;
}

/* Последние выпадения — карточки по 2 в ряд (как в эталоне владельца), лишние уходят в прокрутку */
.feed__list {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border-radius: 24px;
  background: var(--surface-1);
  overflow-y: auto;
}

.feed__list:not(:has(li)) {
  display: none;
}

.feed__empty {
  padding: 0 var(--sp-4) var(--sp-4);
}

/* Обычное выпадение */
.feed-drop {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-2);
  border-radius: var(--radius-control);
  transition: background-color var(--dur-micro) var(--ease);
}

.feed-drop:hover {
  background: var(--surface-1);
}

.feed-drop__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.feed-drop__name {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  font-weight: var(--fw-semibold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-drop__item,
.feed-ann__item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: var(--fw-semibold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-drop__item .rarity-tag,
.feed-ann__item .rarity-tag {
  flex: none;
}

.feed-item__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-drop__price {
  flex: none;
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: var(--fw-bold);
}

/* Объявление: золотая рамка слева и угол (макет «Announcement») */
.feed-ann {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4) var(--sp-3);
  border-left: 3px solid var(--accent);
  border-radius: 4px var(--radius-control) var(--radius-control) 4px;
  background: linear-gradient(90deg, var(--accent-soft) 0%, var(--surface-1) 60%);
  transition: background-color var(--dur-micro) var(--ease);
}

.feed-ann::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 14px;
  height: 14px;
  border-top: 3px solid var(--accent);
  border-right: 3px solid var(--accent);
  border-top-right-radius: var(--radius-control);
}

.feed-ann__label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--accent);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.feed-ann__row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}

.feed-ann__text {
  min-width: 0;
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  color: var(--text-muted);
}

.feed-ann__text b {
  color: var(--text);
  font-weight: var(--fw-bold);
}

.feed-ann__text b.text-accent {
  color: var(--accent);
}

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

.feed-backdrop {
  display: none;
}

/* ---------- Подвал: счётчики, карточка с гусем, копирайт ---------- */
.footer {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--sp-6));
  margin: var(--sp-12) auto 0;
  padding: 0 var(--sp-6) var(--sp-6);
}

.footer__stats {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-6);
  border-radius: var(--radius-pill);
  background: var(--surface-1);
}

.footer__stat-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-8);
  margin: 0;
}

/* В <dl> внутри группы — только <dt>/<dd>: значок лежит в <dt> и вынесен влево позиционированием. */
.footer__stat {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 40px;
  padding-left: calc(40px + var(--sp-3));
}

.footer__stat-icon {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}

.footer__stat-label {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  font-weight: var(--fw-semibold);
}

.footer__stat-value {
  margin: 0;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-black);
}

.footer__up {
  display: grid;
  flex: none;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-left: auto;
  border-radius: var(--radius-control);
  background: var(--surface-3);
  color: var(--text);
  transition: background-color var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease);
}

.footer__up:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Карточка: справа — гусь, выглядывает поверх верхнего края */
.footer__card {
  position: relative;
  min-height: 240px;
  margin-top: var(--sp-12);
  padding: var(--sp-8) min(400px, 34%) var(--sp-8) var(--sp-8);
  border-radius: 24px;
  background:
    radial-gradient(60% 120% at 88% 100%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    var(--surface-1);
}

.footer__goose {
  position: absolute;
  right: var(--sp-10);
  bottom: 0;
  width: 280px;
  pointer-events: none;
}

.footer__goose img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 -8px 24px color-mix(in srgb, var(--bg) 60%, transparent));
}

.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 2fr) auto auto; /* колонки ссылок — по содержимому, длинные слова не вылезают */
  gap: var(--sp-8);
}

/* С левым меню и лентой подвал уже: описание — строкой сверху, ссылки — двумя колонками под ним */
@media (max-width: 1679px) {
  .footer__top {
    grid-template-columns: auto auto;
    justify-content: start;
    gap: var(--sp-6) var(--sp-10);
  }

  .footer__brand {
    grid-column: 1 / -1;
  }
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  max-width: 460px;
}

/* Telegram: поддержка и канал — пилюли под текстом бренда */
.footer__social {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.footer__tg {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--control-h-sm);
  padding: 0 var(--sp-3);
  border-radius: var(--radius-control);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  transition: background-color var(--dur-micro) var(--ease);
}

.footer__tg:hover {
  background: var(--surface-3);
}

.footer__tg .icon {
  color: var(--info);
}

.footer__brand img {
  align-self: flex-start;
  width: 179px; /* 212×38 → высота 32: размер известен до загрузки, без сдвига */
  height: 32px;
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.footer__link {
  color: var(--text-muted);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: var(--fw-semibold);
  transition: color var(--dur-micro) var(--ease);
}

.footer__link:hover {
  color: var(--text);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
  padding-top: var(--sp-6);
}

.footer__age {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--danger);
  border-radius: 50%;
  color: var(--text);
  font-size: var(--fs-small);
  font-weight: var(--fw-black);
}

.footer__lang {
  margin-left: auto;
}


/* ---------- Нижняя панель (< 1280) ---------- */
.tabbar {
  display: none;
}

/* ---------- Bottom sheet «Игры» ---------- */
.sheet {
  width: min(480px, calc(100vw - 2 * var(--sp-4)));
}

.sheet__grip {
  display: none;
}

.sheet__list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.sheet__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 64px;
  padding: var(--sp-3);
  border-radius: var(--radius-control);
  background: var(--surface-1);
  transition: background-color var(--dur-micro) var(--ease);
}

a.sheet__item:hover,
.sheet__item.is-active {
  background: var(--surface-3);
}

.sheet__item.is-disabled {
  color: var(--text-muted);
}

.sheet__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: var(--radius-control);
  background: var(--surface-3);
}

a.sheet__item .sheet__icon {
  color: var(--accent);
}

.sheet__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sheet__label {
  font-weight: var(--fw-bold);
}

.sheet__hint {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

/* ---------- Горизонтальная лента (< 768) ---------- */
.feed-strip {
  display: none;
}

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

/* Узкая шапка: «Подарки» и «По льду», затем «Схемы» переезжают в «Ещё» (без наезда на кошелёк) */
@media (max-width: 1799px) {
  .header__menu > [data-nav="rewards"],
  .header__menu > [data-nav="mines"] {
    display: none;
  }

  .dropdown__item.header__more-dup[data-nav-dup="rewards"],
  .dropdown__item.header__more-dup[data-nav-dup="mines"] {
    display: flex;
  }
}

@media (max-width: 1599px) {

  .header {
    gap: var(--sp-5);
  }

  .header__link {
    padding: 0 var(--sp-2);
  }
}

@media (max-width: 1439px) {
  .header__menu > [data-nav="contracts"] {
    display: none;
  }

  .dropdown__item.header__more-dup[data-nav-dup="contracts"] {
    display: flex;
  }
}

/* < 1440: правая колонка спрятана — сверху полоса тех же карточек выпадений */
@media (max-width: 1439px) {
  .feed-strip {
    display: block;
  }

  .feed-strip__list {
    display: flex;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-4);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .feed-strip__list::-webkit-scrollbar {
    display: none;
  }

  .feed-strip__list > li {
    flex: none;
    width: 140px;
    scroll-snap-align: start;
  }
}

@media (max-width: 767px) {
  .feed-strip__list > li {
    width: 128px;
  }
}

/* < 1440: лента — выезжающая панель по кнопке в шапке */

@media (max-width: 1439px) {
  .feed {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-modal);
    height: 100dvh;
    width: min(var(--feed-w), 88vw);
    display: none;
  }

  /* Закрытая панель не рендерится: смещённый fixed-блок расширял бы страницу на мобильном */
  .feed.is-open {
    display: flex;
    animation: feed-in var(--dur-slow) var(--ease);
  }

  .feed__close {
    display: inline-flex;
  }

  .feed-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-modal) - 1);
    background: var(--overlay);
  }
}

@media (min-width: 1440px) {
  .header__feed-toggle {
    display: none;
  }
}

/* < 1280: левая колонка скрыта, навигация — нижняя панель */
@media (max-width: 1279px) {
  .sidebar {
    display: none;
  }

  body.app {
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-header);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding: 0 var(--sp-2) env(safe-area-inset-bottom);
    background: var(--surface-1);
  }

  .tabbar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: var(--tabbar-h);
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: var(--fs-xs);
    line-height: var(--lh-xs);
    font-weight: var(--fw-semibold);
    transition: color var(--dur-micro) var(--ease);
  }

  .tabbar__item:hover,
  .tabbar__item.is-active {
    color: var(--text);
  }

  .tabbar__item.is-active .tabbar__icon {
    color: var(--accent);
  }

  .tabbar__icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 28px;
  }

  /* «Кейсы» — центральная круглая кнопка акцентного цвета */
  .tabbar__item--center .tabbar__icon,
  .tabbar__item--center.is-active .tabbar__icon {
    width: 56px;
    height: 56px;
    margin-top: -24px;
    border: 4px solid var(--bg);
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    transition: background-color var(--dur-micro) var(--ease);
  }

  .tabbar__item--center .icon {
    width: 24px;
    height: 24px;
  }

  .tabbar__item--center:hover .tabbar__icon {
    background: var(--accent-hover);
  }

  .tabbar__item--center {
    color: var(--text);
  }

  .toast-stack {
    bottom: calc(var(--tabbar-h) + var(--sp-4) + env(safe-area-inset-bottom));
  }

  .header {
    gap: var(--sp-4);
  }
}

/* < 1280 навигация — нижняя панель и «Движ» */
@media (max-width: 1279px) {
  .header__nav,
  .header__secondary {
    display: none;
  }
}

/* Планшет: «Подсыпать» — иконкой, поиск скрыт, как на телефоне; шапка не шире экрана */
@media (min-width: 768px) and (max-width: 1023px) {
  .header__deposit-text,
  .header-search {
    display: none;
  }

  .header__deposit {
    width: var(--control-h);
    padding: 0;
  }
}

.header__short {
  display: none;
}

@media (max-width: 767px) {
  .header {
    gap: var(--sp-2);
    padding: 0 var(--sp-4);
  }

  .header__logo img {
    height: 20px;
  }

  .header__logo .header__logo-mark {
    height: 36px;
  }

  .header__actions {
    gap: var(--sp-1);
  }

  /* Мобильная шапка: логотип, баланс, «Пополнить», аватар (поиск, уведомления и лента — этап 12) */
  .header-search,
  .header__notif,
  .header__feed-toggle,
  .avatar-btn > .icon,
  .header__long {
    display: none;
  }

  .header__short {
    display: inline;
  }

  .sheet {
    width: 100vw;
  }

  .sheet__grip {
    display: block;
    width: 40px;
    height: 4px;
    margin: calc(-1 * var(--sp-2)) auto 0;
    border-radius: var(--radius-pill);
    background: var(--surface-3);
  }

  .wallet {
    height: 40px;
    padding: 0 var(--sp-3);
    font-size: var(--fs-small);
  }

  .wallet__icon {
    display: none;
  }

  .header__deposit {
    width: 40px;
    height: 40px;
    padding: 0;
  }

  .header__deposit-text {
    display: none;
  }

  .app__content {
    padding: var(--sp-4);
  }

  .footer {
    padding: 0 var(--sp-4) var(--sp-6);
  }

  .footer__stats {
    align-items: flex-start;
    padding: var(--sp-4);
    border-radius: 24px;
  }

  .footer__stat-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-3);
  }

  .footer__stat {
    min-height: 32px;
    padding-left: calc(32px + var(--sp-3));
  }

  .footer__stat-icon {
    width: 32px;
    height: 32px;
  }

  .footer__up {
    width: 44px;
    height: 44px;
  }

  /* Гусь — над карточкой справа, ссылки под ним во всю ширину */
  /* Гусь стоит на верхнем крае карточки (заходит на 24 px) и не наезжает ни на логотип, ни на счётчики выше */
  .footer__card {
    margin-top: 144px;
    padding: var(--sp-6) var(--sp-4);
  }

  .footer__goose {
    right: var(--sp-4);
    top: auto;
    bottom: calc(100% - 24px);
    width: 112px;
  }

  .footer__top {
    grid-template-columns: 1fr 1fr;
  }

  .footer__brand {
    grid-column: 1 / -1;
  }
}

@media (min-width: 768px) and (max-width: 1100px) {
  .footer__card {
    padding-right: 240px;
  }

  .footer__goose {
    right: var(--sp-4);
    width: 220px;
  }

  .footer__top {
    grid-template-columns: 1fr 1fr;
  }

  .footer__brand {
    grid-column: 1 / -1;
  }
}

@keyframes feed-in {
  from { transform: translateX(100%); }
  to { transform: none; }
}

/* Узкие телефоны: значок вместо полного логотипа */
@media (max-width: 399px) {
  .header {
    padding: 0 var(--sp-3);
  }

  /* Семки на узком телефоне — на странице «Подарки»; в шапке остаётся баланс крошек */
  .header .crumbs-pill {
    display: none;
  }

  .header__logo-full {
    display: none;
  }

  .header__logo .header__logo-mark {
    height: 36px;
  }
}

/* Бренд «Гусь»: микроюмор рядом с документами и в нижней строке подвала */
.footer__aside {
  font-style: italic;
}

.footer__humor {
  font-style: italic;
}

/* Десктоп до 1600: шапка с крошками и кошельком — плотнее меню */
@media (min-width: 1280px) and (max-width: 1599px) {
  .header {
    gap: var(--sp-4);
  }

  .header__link {
    padding: 0 var(--sp-2);
  }
}

@media (min-width: 1280px) and (max-width: 1439px) {
  .header__deposit-text {
    display: none;
  }

  .header__deposit {
    width: var(--control-h);
    padding: 0;
  }
}

/* «Ещё» открывается вправо от кнопки, а не уходит за левый край */
.header__more-menu {
  left: 0;
  right: auto;
}

/* 1280–1599: поиск уступает место меню (он есть в каталоге гнёзд) */
@media (min-width: 1280px) and (max-width: 1599px) {
  .header-search {
    display: none;
  }
}
