/* ============================================
   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"; }

/* Кнопка "Войти" в шапке для анонимов — стоит на месте бонусного баланса,
   подчёркнуто синяя чтобы стать естественной CTA-точкой. */
.action-btn.h-login-btn {
  background: linear-gradient(135deg, rgba(74,124,255,0.18) 0%, rgba(74,124,255,0.06) 100%);
  border-color: rgba(74,124,255,0.4);
  border-top-color: rgba(107,148,255,0.65);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(107,148,255,0.35), 0 0 18px rgba(74,124,255,0.12);
}
.action-btn.h-login-btn:hover {
  background: linear-gradient(135deg, rgba(74,124,255,0.28) 0%, rgba(74,124,255,0.1) 100%);
  border-color: rgba(74,124,255,0.7);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(107,148,255,0.5), 0 0 22px rgba(74,124,255,0.22);
}
.action-btn.h-login-btn svg { color: #b9cbff; }

.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; }

/* Email-секция auth-модалки — стилизована под mobile/login.html.
   Divider с линиями по бокам, потом вертикальный стек двух кнопок:
   primary (золотая, регистрация) + ghost (войти). */
.auth-email-row {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-email-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 600 11px/1 'Geist', sans-serif;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.auth-email-divider::before,
.auth-email-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}
.auth-email-row-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-email-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  font: 700 14px/1 'Geist', sans-serif;
  text-decoration: none;
  background: linear-gradient(160deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.015) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  transition: background .18s, border-color .18s, transform .12s, box-shadow .18s;
}
.auth-email-link svg {
  width: 16px;
  height: 16px;
  opacity: 0.85;
}
.auth-email-link:hover {
  background: linear-gradient(160deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
  border-color: rgba(255,255,255,0.16);
}
.auth-email-link:active { transform: scale(.985); }
.auth-email-link--primary {
  background: linear-gradient(135deg, #f29c2a 0%, #e8821a 100%);
  border-color: transparent;
  color: #1a1108;
  box-shadow: 0 6px 18px rgba(242,156,42,0.28);
}
.auth-email-link--primary svg { opacity: 1; color: #1a1108; }
.auth-email-link--primary:hover {
  background: linear-gradient(135deg, #ffaa3a 0%, #f29028 100%);
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(242,156,42,0.38);
}

/* =========================================================
   .am-* — auth-modal mobile-style layout (повторяет дизайн
   /site/m/login.html, чтобы десктоп-модалка и мобильная
   страница входа выглядели одинаково). Префикс .am- чтобы
   не конфликтовать с глобальными .login-* классами и старыми
   .auth-provider-* (последние мы убираем из шаблонов вместе
   с этим обновлением).
   ========================================================= */
.am-hero { text-align: center; margin: 4px 0 18px; }
.am-hero h2 {
  font: 800 22px/1.2 'Geist', sans-serif;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 8px;
}
.am-hero p {
  font: 500 13px/1.5 'Geist', sans-serif;
  color: var(--text-muted);
  margin: 0;
}

.am-error-banner {
  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;
}

.am-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 14px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.am-tab {
  padding: 12px;
  background: none; border: 0;
  color: var(--text-muted);
  font: 600 13px/1 'Geist', sans-serif;
  font-family: inherit;
  cursor: pointer;
  transition: background .18s, color .18s;
}
.am-tab:hover { color: var(--text); }
.am-tab.active {
  background: rgba(255,180,80,0.16);
  color: var(--gold-bright);
}

.am-form { display: none; flex-direction: column; gap: 10px; }
.am-form.active { display: flex; }
.am-field label {
  font: 600 12px/1 'Geist', sans-serif;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}
.am-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font: 500 14px/1 'Geist', sans-serif;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color .18s, background .18s;
}
.am-field input:focus {
  outline: none;
  border-color: rgba(255,180,80,0.4);
  background: rgba(255,255,255,0.06);
}

.am-form-error {
  color: #ff8898;
  font: 500 12px/1.4 'Geist', sans-serif;
  padding: 8px 0;
  display: none;
}
.am-form-error.show { display: block; }

.am-submit {
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f29c2a, #e8821a);
  color: #fff;
  font: 700 14px/1 'Geist', sans-serif;
  font-family: inherit;
  border: 0;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(242,156,42,0.28);
  margin-top: 4px;
  transition: filter .15s, transform .12s, box-shadow .18s;
}
.am-submit:hover { filter: brightness(1.05); box-shadow: 0 8px 22px rgba(242,156,42,0.38); }
.am-submit:active { transform: scale(0.985); }
.am-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.am-divider {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 0 14px;
  color: var(--text-muted);
  font: 500 11px/1 'Geist', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.am-divider::before,
.am-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

.am-oauth { display: flex; flex-direction: column; gap: 10px; }
.am-oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(160deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.015) 100%);
  color: var(--text);
  font: 600 14px/1 'Geist', sans-serif;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: filter .15s, transform .12s, border-color .18s, background .18s;
}
.am-oauth-btn:hover { filter: brightness(1.08); border-color: rgba(255,255,255,0.18); }
.am-oauth-btn:active { transform: scale(0.985); }
.am-oauth-btn svg { width: 18px; height: 18px; }
.am-oauth-btn--tg {
  background: linear-gradient(135deg, #2aabee, #229ed9);
  color: #fff;
  border-color: transparent;
}
.am-oauth-btn--tg:hover { background: linear-gradient(135deg, #3cb5f0, #2aabee); }
.am-oauth-btn--google {
  background: #fff;
  color: #1f1f1f;
  border-color: transparent;
}
.am-oauth-btn--google:hover { background: #f5f5f5; }
.am-oauth-btn--vk {
  background: #4A76A8;
  color: #fff;
  border-color: transparent;
}
.am-oauth-btn--vk:hover { background: #5588bd; }
.am-oauth-btn:disabled,
.am-oauth-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

.am-tg-hint {
  display: none;
  text-align: center;
  padding: 4px 4px 0;
  font: 500 12px/1.45 'Geist', sans-serif;
  color: var(--text-muted);
}
.am-tg-hint.show { display: block; }
.am-tg-hint .retry { color: var(--gold-bright); text-decoration: underline; cursor: pointer; margin-left: 4px; }
.am-tg-hint .err { color: #ff8898; }

.am-footer {
  margin-top: 18px;
  text-align: center;
  font: 500 11px/1.5 'Geist', sans-serif;
  color: rgba(245,246,248,0.45);
}
.am-footer a { color: #6b94ff; text-decoration: none; }
.am-footer a:hover { text-decoration: underline; }

.am-success {
  text-align: center;
  padding: 12px 0;
}
.am-success-icon { font-size: 42px; line-height: 1; margin-bottom: 14px; }
.am-success-title {
  font-size: 16px; font-weight: 600;
  color: rgba(255,255,255,0.95);
  margin-bottom: 10px;
}
.am-success-text {
  font-size: 13px; line-height: 1.55;
  color: rgba(255,255,255,0.65);
  margin-bottom: 20px;
}

/* Скрываем старый .auth-modal-head — теперь только close в углу */
.auth-modal { padding-top: 18px; position: relative; }
.auth-modal .auth-modal-close {
  position: absolute;
  top: 14px; right: 14px;
}

.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 (B10)
   Single-row layout: [brand] [region-flag] (spacer) [search-icon] [cart] [burger]
   Profile/Favorites/Balance/desktop search move into 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) {
  .site-header-inner {
    flex-wrap: nowrap;
    height: auto;
    gap: 8px;
    padding: 10px 0;
    align-items: center;
  }
  .brand { order: 1; flex-shrink: 0; }
  .region-switcher { order: 2; flex-shrink: 0; }
  .spacer-1 { display: block; order: 3; flex: 1 1 auto; min-width: 0; }
  .h-search { display: none; }
  .h-mobile-search { order: 4; display: inline-flex; }
  .h-actions { order: 5; margin-left: 0; flex-shrink: 0; gap: 6px; }
  .h-mobile-burger { order: 6; display: inline-flex; }

  /* Hide all action-btns EXCEPT the cart one; cart keeps its h-badge */
  .h-actions .action-btn[title="Профиль"],
  .h-actions .action-btn[title="Избранное"],
  .h-actions .action-btn.balance { display: none; }
  .h-actions .action-btn { padding: 0 10px; height: 40px; }

  /* Region trigger collapses to flag-only chip on mobile */
  .region-trigger { padding: 8px 9px; gap: 0; height: 40px; }
  .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 (left:0, right:0) */
  .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 */
.h-mobile-backdrop {
  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));
  }
}
