/* ============================================================
   MOOD HEADER — шапка сайта, написана с нуля на mood-base.css.
   Три зоны: бренд · навигация-таблетки · действия.
   ============================================================ */

.casino-header.mood-header-v2 {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  width: 100%;
  background: var(--glass);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  transition: box-shadow var(--transition), background var(--transition);
}
.casino-header.mood-header-v2.casino-header--scrolled { box-shadow: var(--shadow-md); }

.mood-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: var(--mood-header-h);
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 0 var(--gutter);
}

/* Логотип в шапке — только мобильный; на десктопе бренд в rail */
.mood-header__brand {
  display: none;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.mood-header__brand-logo {
  display: flex;
  align-items: center;
  line-height: 0;
}

.mood-header__brand .logo-img,
.mood-header__logo-img {
  display: block;
  height: 28px;
  width: auto;
  max-width: min(148px, 42vw);
  object-fit: contain;
  object-position: left center;
}

/* Логотип бренда живёт только в боковом меню, в шапке его нет —
   поэтому навигация начинает ряд слева. */

/* ——— Верхняя навигация: таблетки ——— */
.mood-top-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: auto;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.mood-top-nav__link {
  position: relative;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
}
.mood-top-nav__link:hover { color: var(--text); background: var(--surface-3); }
.mood-top-nav__link.active {
  color: var(--btn-primary-text);
  background: var(--grad-brand);
  box-shadow: var(--shadow-cta);
}

/* ——— Зона действий ——— */
.mood-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  margin-left: auto;
}

.header-utils { display: flex; align-items: center; gap: 8px; }

/* ——— Переключатель темы (segment pill) ——— */
.mood-hd-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}
.mood-hd-theme__track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 72px;
  height: 36px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.mood-hd-theme:hover .mood-hd-theme__track {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.mood-hd-theme__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  border-radius: var(--radius-pill);
  background: var(--grad-brand);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform 0.28s var(--ease-out);
  pointer-events: none;
}
html[data-theme="light"] .mood-hd-theme__thumb { transform: translateX(100%); }
.mood-hd-theme__icon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text-dim);
  transition: color var(--transition);
}
.mood-hd-theme__icon svg { width: 15px; height: 15px; }
html[data-theme="dark"] .mood-hd-theme__icon--moon,
html[data-theme="light"] .mood-hd-theme__icon--sun { color: var(--btn-primary-text); }
html[data-theme="dark"] .mood-hd-theme__icon--sun,
html[data-theme="light"] .mood-hd-theme__icon--moon { color: var(--text-dim); }

/* ——— Язык ——— */
.mood-hd-lang__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border-color var(--transition), background var(--transition), transform var(--dur-1) var(--ease-out);
}
.mood-hd-lang__btn:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--accent-dim);
  transform: translateY(-1px);
}
.mood-hd-lang__flag-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--border) 80%, transparent);
}
.mood-hd-lang__flag-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 16px;
  line-height: 1;
}
.mood-hd-lang-popup { border-radius: 16px; }
.mood-hd-lang-popup__head { padding: 12px 16px; }
.mood-hd-lang-popup__close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}
.mood-hd-lang-popup__body { padding: 8px 10px 12px; }
.sidebar-lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.sidebar-lang-option:hover { background: var(--surface-2); color: var(--text); }
.sidebar-lang-option.selected {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
  color: var(--text);
}
.sidebar-lang-option .lang-code-badge { display: none; }
.sidebar-lang-option .lang-name { flex: 1; min-width: 0; }
.sidebar-lang-option .lang-check {
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
}

/* ——— Центральный док (гость / авторизован) ——— */
.header-center-dock { display: flex; align-items: center; gap: var(--space-3); }
.header-buttons { display: flex; align-items: center; gap: var(--space-2); }
.header-buttons.hidden { display: none !important; }

.header-guest-btn { padding: 9px 18px; font-size: 14px; }

/* ——— Баланс (premium chip) ——— */
.mood-hd-balance {
  position: relative;
  flex-shrink: 0;
  min-width: 0;
  max-width: min(168px, 40vw);
}

.mood-hd-balance__chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  position: relative;
  overflow: visible;
  max-width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 11px 8px 13px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface-2)) 0%, var(--surface-2) 58%);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 6%, transparent) inset;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.mood-hd-balance__chip::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(105deg, transparent 35%, color-mix(in srgb, var(--accent) 18%, transparent) 50%, transparent 65%);
  transition: opacity var(--transition);
}

.mood-hd-balance__chip:hover::before {
  opacity: 1;
}

.mood-hd-balance__chip:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  box-shadow: 0 4px 20px color-mix(in srgb, var(--accent) 14%, transparent);
}

.mood-hd-balance__chip[aria-expanded="true"],
.mood-hd-balance__chip--open {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
}

.mood-hd-balance__amount {
  flex: 0 1 auto;
  min-width: 0;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  font-family: var(--font-display, var(--font-sans));
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
}

.mood-hd-balance__currency {
  flex: 0 0 auto;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  color: color-mix(in srgb, var(--text) 78%, var(--text-dim));
}

.mood-hd-balance__chevron {
  display: inline-flex;
  flex: 0 0 auto;
  margin-left: 0;
  color: var(--text-dim);
  transition: transform var(--transition);
}

.mood-hd-balance--has-bonus .mood-hd-balance__chip::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 2px var(--surface-2);
  pointer-events: none;
}
.mood-hd-balance__chevron.hidden { display: none !important; }
.mood-hd-balance__chip[aria-expanded="true"] .mood-hd-balance__chevron { transform: rotate(180deg); }

html[data-theme="light"] .mood-hd-balance__chip {
  background: var(--surface);
  border-color: var(--border);
}
html[data-theme="light"] .mood-hd-balance__chip:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.header-center-dock .mood-hd-balance {
  min-width: 0;
  flex-shrink: 0;
}

/* ——— Кнопка уведомлений ——— */
.mood-hd-notify {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color var(--transition), border-color var(--transition), background var(--transition), transform var(--dur-1) var(--ease-out);
}
.mood-hd-notify:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--accent-dim);
  transform: translateY(-1px);
}
.mood-hd-notify__icon { display: inline-flex; line-height: 0; }
.mood-hd-notify__icon svg { width: 18px; height: 18px; }
.mood-hd-notify__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--accent-2);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg-elevated);
}
.mood-hd-notify__badge.hidden { display: none !important; }

/* Legacy hooks (chat removed from header) */
.header-btn-notify, .header-btn-chat { position: relative; }

/* Буст-индикатор */
.header-boost-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  background: var(--warning-dim);
  color: var(--warning);
  font-size: 12px;
  font-weight: 700;
}
.header-boost-timer { font-family: var(--font-mono); }

/* ——— Бургер (мобильный) ——— */
.mood-header__menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}
.mood-header__menu-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   Выпадающие панели шапки (баланс, уведомления)
   ============================================================ */
.mood-hd-balance-panel,
.mood-hd-notify-panel {
  position: fixed;
  top: calc(var(--mood-header-h) + 8px);
  right: var(--gutter);
  z-index: var(--z-dropdown);
  width: min(360px, calc(100vw - 2 * var(--gutter)));
  max-height: min(560px, calc(100vh - var(--mood-header-h) - 32px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: var(--bg-elevated);
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border));
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  animation: mood-dropdown-in var(--dur-2) var(--ease-out);
}
.mood-hd-balance-panel.hidden,
.mood-hd-notify-panel.hidden { display: none !important; }

/* Legacy class aliases for JS */
.header-balance-dropdown,
.header-notify-dropdown { /* positioned via mood-hd-* above */ }

.mood-hd-sheet-backdrop,
.header-balance-sheet-backdrop,
.header-notify-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-dropdown) - 1);
  background: rgba(5, 8, 13, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.mood-hd-sheet-backdrop.hidden,
.header-balance-sheet-backdrop.hidden,
.header-notify-sheet-backdrop.hidden { display: none !important; }

.mood-hd-sheet-top,
.header-balance-sheet-top,
.header-notify-sheet-top { display: none; }

/* ——— Панель баланса (read-only) ——— */
.mood-hd-balance-panel__inner { padding: 16px 16px 14px; }
.mood-hd-balance-panel__title {
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.mood-hd-balance-panel__rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.mood-hd-balance-panel__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.mood-hd-balance-panel__row--bonus {
  border-color: color-mix(in srgb, var(--accent-2) 28%, var(--border));
  background: color-mix(in srgb, var(--accent-2) 6%, var(--surface-2));
}
.mood-hd-balance-panel__lbl {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.mood-hd-balance-panel__val {
  font-family: var(--font-display, var(--font-sans));
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}

.mood-hd-balance-panel__val--hero {
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.mood-hd-balance-panel__sym {
  font-size: 0.92em;
  font-weight: 700;
  color: color-mix(in srgb, var(--text) 72%, var(--text-dim));
}

.mood-hd-balance-panel__code {
  margin: -6px 0 10px;
  padding-right: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: right;
}

.mood-hd-balance-panel__row--hero {
  align-items: flex-end;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, var(--surface-2)), var(--surface-2));
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
}

.mood-hd-balance-panel__row--bonus .mood-hd-balance-panel__val { color: var(--accent-2); }
.mood-hd-balance-panel__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.mood-hd-balance-panel__link:hover {
  background: var(--accent-dim);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  color: var(--accent);
}

/* ——— Панель уведомлений ——— */
.mood-hd-notify-panel__head,
.header-notify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  margin: 0;
  border-bottom: 1px solid var(--border);
}
.mood-hd-notify-panel__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.mood-hd-notify-panel__mark,
.header-notify-readall {
  padding: 6px 10px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
}
.mood-hd-notify-panel__mark:hover,
.header-notify-readall:hover {
  background: var(--accent-dim);
  text-decoration: none;
}

.mood-hd-notify-panel__list,
.header-notify-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mood-hd-notify-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.mood-hd-notify-card:hover { background: color-mix(in srgb, var(--accent) 6%, var(--surface-2)); }
.mood-hd-notify-card--unread {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
}
.mood-hd-notify-card__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text-muted);
}
.mood-hd-notify-card__icon svg { width: 18px; height: 18px; }
.mood-hd-notify-card__icon--bonus {
  background: color-mix(in srgb, var(--accent-2) 18%, transparent);
  color: var(--accent-2);
}
.mood-hd-notify-card__icon--finance {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}
.mood-hd-notify-card__icon--security {
  background: color-mix(in srgb, var(--warning) 18%, transparent);
  color: var(--warning);
}
.mood-hd-notify-card__body { flex: 1; min-width: 0; }
.mood-hd-notify-card__title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}
.mood-hd-notify-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.mood-hd-notify-card__more {
  display: inline-block;
  margin-top: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: right;
  flex-shrink: 0;
  transition: color var(--transition);
}
.mood-hd-notify-card__more:hover {
  color: color-mix(in srgb, var(--accent) 80%, var(--text));
  text-decoration: underline;
}
.mood-hd-notify-card__body-text {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}
.mood-hd-notify-card__time {
  display: block;
  margin-top: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  min-width: 0;
}
.mood-hd-notify-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.mood-hd-notify-panel__foot,
.header-notify-footer {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
}
.mood-hd-notify-panel__all,
.header-notify-viewall {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.mood-hd-notify-panel__all:hover,
.header-notify-viewall:hover {
  background: var(--accent-dim);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  color: var(--accent);
}

@keyframes mood-dropdown-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* Попап языков */
.sidebar-lang-popup {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: var(--z-dropdown);
  width: 280px;
  max-height: 420px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: mood-dropdown-in var(--dur-2) var(--ease-out);
}
.sidebar-lang-popup.hidden { display: none !important; }
.header-lang-wrapper { position: relative; }

.sidebar-lang-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}
.sidebar-lang-popup-title { font-weight: 800; font-size: 14px; }
.sidebar-lang-popup-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
}
.sidebar-lang-popup-close:hover { background: var(--surface-2); color: var(--text); }
.sidebar-lang-popup-body { overflow-y: auto; padding: var(--space-3); }
.sidebar-lang-popup-section + .sidebar-lang-popup-section { margin-top: var(--space-4); }
.sidebar-lang-popup-section-title {
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.sidebar-lang-list { display: flex; flex-direction: column; gap: 2px; }
.sidebar-lang-list > * {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.sidebar-lang-list > *:hover { background: var(--surface-2); color: var(--text); }

/* Слот историй под шапкой */
.home-stories-top-slot { padding: var(--space-3) var(--gutter) 0; }
.home-stories-top-slot.hidden { display: none !important; }

/* ============================================================
   Смещение под левую панель. Шапка — сосед .casino-layout,
   поэтому отступ ей нужен свой, иначе панель накрывает логотип.
   ============================================================ */
@media (min-width: 1024px) {
  .casino-header.mood-header-v2,
  .home-stories-top-slot {
    margin-left: var(--mood-rail-w);
    width: calc(100% - var(--mood-rail-w));
    transition: margin-left var(--dur-3) var(--ease-out), width var(--dur-3) var(--ease-out);
  }
}

/* ============================================================
   Планшет и мобильный
   ============================================================ */
@media (max-width: 1279px) {
  .mood-top-nav__link { padding: 8px 12px; font-size: 13px; }
  .header-btn-profile--desktop { display: none; }
}

@media (max-width: 1023px) {
  .mood-top-nav { display: none; }
  .mood-header__brand { display: flex; }
  .mood-header__menu-btn { display: inline-flex; }
  .mood-header__inner { gap: var(--space-3); }
  .header-utils { display: none; }

  /* Гость: вход только в нижней панели */
  body.mood-mobile-v3.mood-guest-active #headerGuest,
  body.mood-mobile-v3.mood-guest-active .header-center-dock {
    display: none !important;
  }

  body.mood-mobile-v3.mood-guest-active .mood-header__actions {
    display: none !important;
  }

  body.mood-mobile-v3.mood-guest-active .mood-header__inner {
    justify-content: flex-start;
  }

  body.mood-mobile-v3.mood-guest-active .mood-header__menu-btn {
    margin-left: auto;
  }

  .mood-header__menu-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: var(--radius-md, 14px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    flex-shrink: 0;
    box-shadow: none;
  }

  .mood-header__menu-btn .svg-icon {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  html[data-theme="light"] .mood-header__menu-btn {
    background: #fff;
    border-color: rgba(16, 24, 40, 0.1);
  }

  .header-guest-btn { padding: 8px 14px; font-size: 13px; }
}

@media (max-width: 640px) {
  .header-brand-logo .logo-img { height: 28px; }
  .mood-hd-balance {
    max-width: min(152px, 42vw);
  }
  .mood-hd-balance__chip {
    min-height: var(--mob-touch-min, 44px);
    padding: 8px 10px 8px 12px;
    gap: 4px;
  }
  .mood-hd-balance__amount { font-size: 14px; }
  .mood-hd-balance__currency { font-size: 13px; }
  .mood-hd-balance__chevron svg { width: 12px; height: 12px; }

  /* Панели превращаются в нижние шиты */
  .mood-hd-balance-panel,
  .mood-hd-notify-panel {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: 82vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    animation: mood-sheet-in var(--dur-3) var(--ease-out);
  }
  .mood-hd-sheet-top,
  .header-balance-sheet-top,
  .header-notify-sheet-top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: var(--space-3) var(--space-4) 0;
  }
  .mood-hd-sheet-handle,
  .header-balance-sheet-handle,
  .header-notify-sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: var(--radius-pill);
    background: var(--border-strong);
  }
  .mood-hd-sheet-close,
  .header-balance-sheet-close,
  .header-notify-sheet-close {
    position: absolute;
    top: var(--space-2);
    right: var(--space-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-muted);
    border: none;
    padding: 0;
  }
}

@keyframes mood-sheet-in {
  from { transform: translateY(100%); }
  to { transform: none; }
}

/* ——— Уведомление о зачислении депозита (боковой toast сверху) ——— */
.mood-deposit-credited-stack {
  position: fixed;
  top: calc(var(--mood-header-h) + 12px);
  right: max(12px, env(safe-area-inset-right, 0));
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}

.mood-deposit-credited {
  position: relative;
  width: 100%;
  padding: 14px 44px 14px 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid color-mix(in srgb, var(--success) 42%, var(--border));
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.38),
    0 0 0 1px color-mix(in srgb, var(--success) 8%, transparent) inset;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(24px);
  transition:
    opacity 0.28s var(--ease-out),
    transform 0.28s var(--ease-out);
}

.mood-deposit-credited--visible {
  opacity: 1;
  transform: none;
}

.mood-deposit-credited__body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mood-deposit-credited__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 35%, var(--border));
}

.mood-deposit-credited__text {
  min-width: 0;
}

.mood-deposit-credited__amount {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--success);
}

.mood-deposit-credited__label {
  margin-top: 2px;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.mood-deposit-credited__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.mood-deposit-credited__close:hover {
  background: var(--surface-2);
  color: var(--text);
}

@media (max-width: 640px) {
  .mood-deposit-credited-stack {
    top: calc(var(--mood-header-h) + 8px);
    right: max(8px, env(safe-area-inset-right, 0));
    width: min(340px, calc(100vw - 16px));
  }
}
