/* ============================================
   DESIGN TOKENS — БЭКДОР БОТ DESIGN SYSTEM
   ============================================ */
:root {
  --bg: #08090c;
  --bg-gradient-top: #142042;
  --bg-elevated: rgba(255, 255, 255, 0.03);
  --bg-elevated-hover: rgba(255, 255, 255, 0.05);
  --bg-input: rgba(255, 255, 255, 0.04);
  --bg-sticky: rgba(8, 9, 12, 0.85);

  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-blue: rgba(74, 124, 255, 0.4);
  --border-gold: rgba(212, 175, 106, 0.4);

  --text: #f5f6f8;
  --text-muted: #8a92a8;
  --text-dim: #4f6080;

  --gold: #d4af6a;
  --gold-bright: #e8c47e;
  --gold-dim: rgba(212, 175, 106, 0.15);
  --blue: #4a7cff;
  --blue-bright: #6b94ff;
  --blue-dim: rgba(74, 124, 255, 0.15);
  --red: #ff5a5a;
  --red-bright: #ff7878;
  --orange: #ff9a3c;
  --orange-bright: #ffb05c;
  --green-bright: #5ed4a3;
  --purple-bright: #a877ff;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --container: 1320px;
  --header-h: 72px;

  --game-card-aspect: 4 / 5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Geist', sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "ss02";
}
body {
  min-height: 100vh;
  background: radial-gradient(ellipse 1200px 800px at 50% -200px, var(--bg-gradient-top) 0%, var(--bg) 70%);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }
input, textarea { font-family: inherit; color: inherit; }

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.25;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  z-index: 1;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-sticky);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.brand {
  display: flex; align-items: center;
  font-weight: 800; font-size: 22px;
  letter-spacing: -0.02em; flex-shrink: 0;
}
.brand .gold { color: var(--gold); }
.brand .light { color: var(--text); }

.h-search {
  flex: 1;
  max-width: 340px;
  display: flex; align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-top-color: rgba(255,255,255,0.12);
  border-radius: 11px;
  transition: border-color .2s, background .2s;
  cursor: text;
}
.h-search:hover, .h-search:focus-within {
  border-color: var(--border-blue);
  background: rgba(255,255,255,0.05);
}
.h-search svg { width: 16px; height: 16px; color: var(--text-dim); flex-shrink: 0; }
.h-search input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 14px; }
.h-search input::placeholder { color: var(--text-dim); }
.h-search[aria-disabled="true"] { cursor: default; opacity: 0.75; }
.h-search[aria-disabled="true"]:hover,
.h-search[aria-disabled="true"]:focus-within { border-color: var(--border); background: var(--bg-input); }
.h-search[aria-disabled="true"] input { cursor: default; }

.region-switcher {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}
.region-trigger {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-top-color: rgba(255,255,255,0.18);
  border-radius: 12px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  color: var(--text);
  font-family: inherit;
}
.region-trigger:hover { background: var(--bg-elevated-hover); border-color: var(--border-blue); }
.region-trigger .rt-flag {
  width: 24px; height: 16px;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center;
  background: #1a1a1a;
}
.region-trigger .rt-flag img { width: 100%; height: 100%; object-fit: cover; }
.region-trigger .rt-flag.steam img { width: 16px; height: 16px; object-fit: contain; }
.region-trigger .rt-label { color: var(--text); white-space: nowrap; }
.region-trigger .rt-chev {
  width: 14px; height: 14px;
  color: var(--text-muted);
  transition: transform .2s;
}
.region-switcher.open .rt-chev { transform: rotate(180deg); }

.region-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  min-width: 280px;
  background: rgba(14,18,30,0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 6px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.region-switcher.open .region-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.region-option {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}
.region-option:hover { background: var(--bg-elevated-hover); }
.region-option.active { background: rgba(74,124,255,0.12); }
.region-option .ro-flag {
  width: 32px; height: 22px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #1a1a1a;
}
.region-option .ro-flag img { width: 100%; height: 100%; object-fit: cover; }
.region-option .ro-flag.steam img { width: 22px; height: 22px; object-fit: contain; }
.region-option .ro-text { flex: 1; }
.region-option .ro-name { font-size: 14px; font-weight: 600; color: var(--text); }
.region-option .ro-desc { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.region-option .ro-check {
  width: 16px; height: 16px;
  color: var(--blue-bright);
  opacity: 0;
}
.region-option.active .ro-check { opacity: 1; }
.region-divider { height: 1px; background: var(--border); margin: 4px 8px; }

.spacer-1 { flex: 1; }
.h-actions {
  display: flex; align-items: center;
  gap: 8px; flex-shrink: 0;
}
.action-btn {
  position: relative;
  display: inline-flex; align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color .2s, background .2s, border-color .2s;
}
.action-btn:hover { color: var(--text); background: var(--bg-elevated-hover); border-color: var(--border-strong); }
.action-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.action-btn .label { white-space: nowrap; }

.action-btn.balance {
  background: linear-gradient(135deg, rgba(212,175,106,0.10) 0%, rgba(212,175,106,0.03) 100%);
  border-color: rgba(212,175,106,0.25);
  border-top-color: rgba(212,175,106,0.4);
  color: var(--gold-bright);
  font-weight: 600;
}
.action-btn.balance:hover { border-color: rgba(212,175,106,0.5); }
.action-btn.balance .coin {
  width: 16px; height: 16px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold), #8a6d30);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
  flex-shrink: 0;
}
.action-btn.balance .coin::after {
  content: '₽'; font-size: 10px; font-weight: 800; color: #5a4520; line-height: 1;
}
.action-btn.balance .amount { font-feature-settings: "tnum"; }

.action-btn .h-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--blue);
  color: #fff;
  border-radius: 9px;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}

/* Hanging tooltip "Завершите заказ" on Profile action-btn (beta parity). */
.action-notify {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  padding: 5px 10px;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(74,124,255,0.35);
  animation: action-notify-bounce 1.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}
.action-notify::before {
  content: '';
  position: absolute; top: -4px; right: 12px;
  width: 8px; height: 8px;
  background: var(--blue);
  transform: rotate(45deg);
}
@keyframes action-notify-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

/* ===== FOOTER ===== */
.site-footer {
  margin-top: 80px;
  padding: 32px 0 22px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(20,32,66,0.3));
}
.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.site-footer .brand { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.site-footer .brand .gold { color: var(--gold); }
.site-footer .brand .light { color: var(--text); }

.f-nav { display: flex; gap: 28px; flex-wrap: wrap; }
.f-nav a {
  font-size: 14px; font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: color .15s;
}
.f-nav a:hover { color: var(--gold-bright); }

.f-social { display: inline-flex; gap: 10px; }
.f-soc {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  text-decoration: none;
  transition: transform .15s, background .15s, border-color .15s, color .15s;
}
.f-soc:hover { transform: translateY(-2px); }
.f-soc.tg:hover { background: rgba(34,158,217,0.18); border-color: rgba(34,158,217,0.5); color: #fff; }
.f-soc.vk:hover { background: rgba(70,118,193,0.18); border-color: rgba(70,118,193,0.5); color: #fff; }
.f-soc svg { width: 20px; height: 20px; fill: currentColor; }

.f-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 18px;
  font-size: 11px;
  color: var(--text-dim);
}
.f-bottom .legal-links { display: flex; gap: 16px; }
.f-bottom a { color: var(--text-dim); text-decoration: none; transition: color .15s; }
.f-bottom a:hover { color: var(--text-muted); }

/* ===== UTILITIES ===== */
.section { padding: 48px 0; position: relative; z-index: 2; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}
.section-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }

.tag {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tag-red    { background: rgba(255,90,90,0.12);   color: var(--red-bright);    border: 1px solid rgba(255,90,90,0.25); }
.tag-blue   { background: rgba(74,124,255,0.12);  color: var(--blue-bright);   border: 1px solid rgba(74,124,255,0.25); }
.tag-orange { background: rgba(255,154,60,0.12);  color: var(--orange-bright); border: 1px solid rgba(255,154,60,0.25); }
.tag-gold   { background: var(--gold-dim);        color: var(--gold-bright);   border: 1px solid var(--border-gold); }

/* ===== BREADCRUMBS (base look — page CSS supplies padding/margin) ===== */
.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-muted);
  position: relative;
  z-index: 2;
}
.crumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
}
.crumbs a:hover { color: var(--gold-bright); }
.crumbs span { color: rgba(255,255,255,0.25); }
.crumbs svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1280px) {
  .action-btn .label { display: none; }
  .action-btn { padding: 0 10px; }
}
@media (max-width: 1100px) {
  .container { padding: 0 20px; }
  .h-search { max-width: none; }
  .region-switcher { position: static; transform: none; }
}
@media (max-width: 820px) {
  .site-header-inner { flex-wrap: wrap; gap: 12px; height: auto; padding: 10px 0; }
  .brand { font-size: 18px; }
  .action-btn.balance .amount { display: none; }
  .site-footer-inner { justify-content: flex-start; }
  .f-bottom { flex-direction: column; align-items: flex-start; }
}

/* ===== AUTH MODAL ===== */
.auth-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(8, 9, 12, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  z-index: 1000;
  opacity: 0;
  transition: opacity .18s ease;
}
.auth-modal-backdrop[hidden] { display: none; }
.auth-modal-backdrop.open { opacity: 1; }
.auth-modal {
  width: 100%;
  max-width: 420px;
  background: #11141b;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-xl);
  padding: 24px 24px 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
  color: var(--text);
  transform: translateY(8px) scale(0.98);
  transition: transform .22s cubic-bezier(0.22, 1, 0.36, 1);
}
.auth-modal-backdrop.open .auth-modal { transform: translateY(0) scale(1); }
.auth-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.auth-modal-title {
  font-size: 20px; font-weight: 800; letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}
.auth-modal-close {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s, border-color .15s;
}
.auth-modal-close:hover { color: var(--text); background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.16); }
.auth-modal-close svg { width: 16px; height: 16px; }
.auth-modal-text {
  font-size: 13.5px; line-height: 1.55;
  color: rgba(245,246,248,0.78);
  margin: 0 0 18px;
}
.auth-provider-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.auth-provider-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px; font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: transform .2s, border-color .2s, background .2s;
}
.auth-provider-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.04);
}
.auth-provider-btn:disabled,
.auth-provider-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}
.auth-provider-btn:disabled:hover,
.auth-provider-btn[aria-disabled="true"]:hover {
  transform: none;
  border-color: rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.025);
}
.auth-provider-logo {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 11px;
  flex-shrink: 0;
  overflow: hidden;
}
.auth-provider-logo.bg-google { background: #fff; color: #444; }
.auth-provider-logo.bg-vk     { background: #0077ff; color: #fff; }
.auth-provider-logo.bg-tg     { background: #229ED9; color: #fff; }
.auth-provider-logo img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
}
.auth-provider-logo.bg-tg img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

.auth-provider-btn--tg-widget {
  padding: 0;
  cursor: default;
  overflow: hidden;
}
.auth-provider-btn--tg-widget:hover {
  transform: none;
  background: rgba(255,255,255,0.025);
  border-color: rgba(255,255,255,0.08);
}
.auth-provider-btn--tg-widget iframe { display: block !important; }

.auth-modal-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(244, 67, 54, 0.10);
  border: 1px solid rgba(244, 67, 54, 0.35);
  color: #ffb4ad;
  font-size: 13px; line-height: 1.45;
}

.cab-accs-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(244, 67, 54, 0.10);
  border: 1px solid rgba(244, 67, 54, 0.35);
  color: #ffb4ad;
  font-size: 13px; line-height: 1.45;
}

/* ===== MOBILE HEADER (B11)
   Single-row layout: [burger] [search]  ··  [BRAND]  ··  [region] [cart]
   Brand floats absolutely over the centre of the header. Profile/Favorites/
   Balance/desktop search live in the right-side drawer panel. */

/* Mobile-only nodes hidden on desktop by default */
.h-mobile-search,
.h-mobile-burger,
.h-mobile-drawer,
.h-mobile-backdrop { display: none; }

@media (max-width: 600px) {
  /* ===== B14 — UNIFY MOBILE CONTAINER PADDING
     Before B14 the cascade was: 32px (default) → 20px (@1100) → 16px (@480).
     That left 481-600 viewports on 20px while phones (≤480) sat on 16px, which
     made tablet-portrait/large-phone widths feel a step wider than 360/390/430.
     Pull the whole 0-600 band onto a single 16px rhythm so every page section
     (catalog cards, cabinet cards, cart blocks, hero region grid) anchors to
     the same screen-edge x-coordinate. Header inner has its own padding shorthand
     (8px 12px below) and is not affected. */
  .container { padding: 0 16px; }

  /* Slight horizontal padding on the header itself so the buttons don't kiss
     the screen edges (B0's .container padding is overridden by the shorthand
     padding declaration below — keep them stylistically consistent here). */
  .site-header-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    height: auto;
    min-height: 56px;
    padding: 8px 12px;
    gap: 6px;
    position: relative;
  }

  /* Brand visually centered over the header */
  .brand {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 17px;
    z-index: 1;
  }

  /* Desktop-only nodes hidden on mobile */
  .h-search { display: none; }
  .spacer-1 { display: none; }

  /* Left group */
  .h-mobile-burger { order: 1; display: inline-flex; flex-shrink: 0; }
  .h-mobile-search { order: 2; display: inline-flex; flex-shrink: 0; }

  /* Right group — margin-left:auto on first right-group item pushes the rest
     of the row to the trailing edge, leaving the centre clear for the brand. */
  .region-switcher { order: 3; flex-shrink: 0; margin-left: auto; }
  .h-actions { order: 4; flex-shrink: 0; gap: 6px; margin-left: 0; }

  /* Cart is the only visible action-btn; force 40x40 square so h-badge sits
     consistently and the row layout stays stable. */
  .h-actions .action-btn[title="Профиль"],
  .h-actions .action-btn[title="Избранное"],
  .h-actions .action-btn.balance { display: none; }
  .h-actions .action-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    flex-shrink: 0;
  }

  /* Region trigger collapses to flag-only 40x40 chip on mobile */
  .region-trigger {
    width: 40px;
    height: 40px;
    padding: 0;
    gap: 0;
    justify-content: center;
  }
  .region-trigger .rt-label,
  .region-trigger .rt-chev { display: none; }
  .region-trigger .rt-flag { width: 22px; height: 16px; }

  /* Region dropdown anchored to header-inner edges (its non-static ancestor) */
  .region-menu {
    left: 0;
    right: 0;
    min-width: 0;
    transform: translateY(-4px);
  }
  .region-switcher.open .region-menu {
    transform: translateY(0);
  }
}

/* Mobile-only header buttons (search icon + burger) */
.h-mobile-search {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: color .15s, background .15s, border-color .15s;
  flex-shrink: 0;
}
.h-mobile-search:hover {
  color: var(--text);
  background: var(--bg-elevated-hover);
  border-color: var(--border-strong);
}
.h-mobile-search svg { width: 18px; height: 18px; }

.h-mobile-burger {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
.h-mobile-burger:hover {
  background: var(--bg-elevated-hover);
  border-color: var(--border-strong);
}
.h-mobile-burger svg { width: 20px; height: 20px; }
.h-mobile-burger[aria-expanded="true"] {
  background: var(--bg-elevated-hover);
  border-color: var(--border-blue);
}
.h-mobile-burger-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px rgba(74,124,255,0.6);
}

/* Backdrop and drawer
   NOTE: display: block here is load-bearing. The shared "hidden by default"
   selector above (`.h-mobile-search, .h-mobile-burger, .h-mobile-drawer,
   .h-mobile-backdrop { display: none; }`) would otherwise win on cascade
   even after JS removes the [hidden] attribute, because nothing else in
   this file declares `display` on .h-mobile-backdrop. The drawer escapes
   this because it declares `display: flex` below; the backdrop does not. */
.h-mobile-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  transition: opacity .2s ease;
}
.h-mobile-backdrop.open { opacity: 1; }

.h-mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, calc(100vw - 48px));
  z-index: 1001;
  background: linear-gradient(180deg, rgba(20,32,66,0.65) 0%, var(--bg) 80%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--border-strong);
  box-shadow: -16px 0 48px rgba(0,0,0,0.5);
  padding: 18px;
  padding-top: max(18px, env(safe-area-inset-top));
  padding-bottom: max(18px, env(safe-area-inset-bottom));
  padding-right: max(18px, env(safe-area-inset-right));
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.h-mobile-drawer.open { transform: translateX(0); }
.h-mobile-drawer[hidden],
.h-mobile-backdrop[hidden] { display: none; }

/* Drawer items */
.h-mobile-drawer-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #2d62ff 0%, #4a7cff 100%);
  color: #fff;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  box-shadow: 0 8px 20px rgba(74,124,255,0.32);
  transition: transform .15s;
}
.h-mobile-drawer-cta:hover { transform: translateY(-1px); }
.h-mobile-drawer-cta svg { width: 16px; height: 16px; flex-shrink: 0; }

.h-mobile-drawer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 11px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s, border-color .15s;
}
.h-mobile-drawer-item:hover {
  background: var(--bg-elevated-hover);
  border-color: var(--border-strong);
}
.h-mobile-drawer-item > svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.h-mobile-drawer-balance {
  background: linear-gradient(135deg, rgba(212,175,106,0.10) 0%, rgba(212,175,106,0.03) 100%);
  border-color: rgba(212,175,106,0.3);
}
.h-mobile-drawer-balance .coin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold), #8a6d30);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
  flex-shrink: 0;
  position: relative;
}
.h-mobile-drawer-balance .coin::after {
  content: '₽';
  font-size: 13px;
  font-weight: 800;
  color: #5a4520;
  line-height: 1;
}
.h-mobile-drawer-balance-label { flex: 1; }
.h-mobile-drawer-balance-value {
  font-weight: 700;
  color: var(--gold-bright);
  font-feature-settings: "tnum";
}
.h-mobile-drawer-balance-value .currency {
  margin-left: 2px;
  font-weight: 700;
  opacity: 0.85;
}

.h-mobile-drawer-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 4px;
}

.h-mobile-drawer-sec {
  background: transparent;
  border: none;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.h-mobile-drawer-sec:hover {
  background: rgba(255,255,255,0.03);
  border: none;
}

/* Lock body scroll while drawer is open */
html.h-menu-open,
html.h-menu-open body { overflow: hidden; }


/* ===== MOBILE FOUNDATION (B0 — surviving non-header rules) ===== */
@media (max-width: 480px) {
  .container { padding: 0 16px; }

  .brand { font-size: 17px; }

  /* Auth modal */
  .auth-modal-backdrop { padding: 16px; }
  .auth-modal { padding: 18px 16px 16px; }
  .auth-modal-title { font-size: 18px; }
  .auth-modal-text { font-size: 13px; margin: 0 0 14px; }
  .auth-provider-grid { grid-template-columns: 1fr; }
  .auth-provider-btn { height: 48px; justify-content: flex-start; padding: 0 14px; }
  .auth-modal-error,
  .cab-accs-error { font-size: 12.5px; padding: 9px 11px; }
  .auth-provider-btn--tg-widget iframe { max-width: 100% !important; }

  /* Breadcrumbs */
  .crumbs { font-size: 12px; gap: 6px; }
  .crumbs svg { width: 12px; height: 12px; }

  /* Footer */
  .site-footer { margin-top: 60px; padding: 28px 0 18px; }
  .site-footer-inner { gap: 18px; padding-bottom: 18px; }
  .f-nav { gap: 14px; }
  .f-bottom { gap: 10px; padding-top: 14px; }
  .f-bottom .legal-links { flex-wrap: wrap; gap: 10px 14px; }
}

/* ===== B9 — REDUCED MOTION
   Single global override. Continuous loops (heart float/pulse, action-notify
   bounce, sub-banner glow, deadline pulse, success-check pulse, home-bg
   scroll) collapse to ~0s; one-shot transitions also dampened. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
  }
}

/* ===== B9 — SAFE AREA on fixed overlays
   Requires viewport-fit=cover in <meta name="viewport"> (added in B9). */
.auth-modal-backdrop {
  padding-top: max(24px, env(safe-area-inset-top));
  padding-right: max(24px, env(safe-area-inset-right));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  padding-left: max(24px, env(safe-area-inset-left));
}
@media (max-width: 480px) {
  .auth-modal-backdrop {
    padding-top: max(16px, env(safe-area-inset-top));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
  }
}
