/* CS Rabbits — site chrome v2 */

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Unbounded', var(--font);
  --container: 1280px;
  --page-gutter: 24px;
  --header-h: 72px;
  --section-gap: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --orange: #f59e0b;
  --gold: #f59e0b;
  --mint: #34d399;
  --red: #ef4444;
  --purple: #7c3aed;
  --cyan: #22d3ee;
  --glass: rgba(255, 255, 255, 0.06);
  --site-bg-image: url('/assets/img/bg.png');
  --bg: #0f131a;
  --surface: rgba(255, 255, 255, 0.06);
  --panel: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.11);
  --text: #eef0f6;
  --muted: #9aa3b8;
  --input-bg: #1a2029;
  --modal-bg: #1a2029;
  --modal-backdrop: rgba(0, 0, 0, 0.78);
  --glow-bg: rgba(124, 58, 237, 0.1);
  --header-bg: rgba(15, 19, 26, 0.88);
  --header-border: rgba(255, 255, 255, 0.1);
}

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

body {
  font-family: var(--font);
  background-color: var(--bg);
  background-image: var(--site-bg-image);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  position: relative;
  transition: background-color 0.3s, color 0.3s;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

html.i18n-pending body {
  visibility: hidden;
}

body {
  overflow-x: clip;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(15, 19, 26, 0.12);
  pointer-events: none;
  z-index: 0;
}

body::after {
  display: none;
}

.deco-line { display: none; }

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--header-border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  transition: background 0.3s, border-color 0.3s;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.header-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: var(--header-h);
  padding: 0 24px;
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
}

.header-left {
  justify-self: start;
  display: flex;
  align-items: center;
}

.header-center {
  justify-self: center;
  display: flex;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  outline: none;
}

.logo-link:focus-visible {
  box-shadow: 0 0 0 2px var(--orange);
}

.logo-link:hover .logo-img {
  opacity: 0.92;
}

.logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
}

.xp-chip {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--gold);
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
  white-space: nowrap;
}

.header-currency-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 1;
  min-width: 0;
  max-width: 100%;
}

.header-hop-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--orange, #f0a030);
  border: 1px solid rgba(240, 160, 48, 0.35);
  background: rgba(240, 160, 48, 0.1);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.15;
  transition: background 0.2s, border-color 0.2s;
}

.header-hop-chip:hover {
  background: rgba(240, 160, 48, 0.18);
  border-color: rgba(240, 160, 48, 0.5);
}

.header-hop-chip__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.88;
}

.header-hop-chip__value {
  font-variant-numeric: tabular-nums;
}

.header-hop-chip__delta {
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted, #7b8597);
}

.header-hop-chip__delta.mint {
  color: var(--mint, #30e8a0);
}

.header-hop-chip__delta.red {
  color: var(--red, #f04848);
}

body.is-guest .header-hop-chip {
  display: none !important;
}

.guest-free-tag {
  display: none;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  font-size: 12px;
  font-weight: 700;
  color: var(--mint);
}

.header-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

body.is-guest .header-left {
  display: none;
}

body.is-guest #openSetupModal,
body.is-guest #mobileOpenSetupModal,
body.is-guest [data-mobile-nav-logged-in-only] {
  display: none !important;
}

.theme-btn {
  width: 32px;
  height: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: all 0.2s;
}

.theme-btn:hover {
  border-color: var(--muted);
}

.lang-code {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
}

.lang-flag {
  display: block;
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

.lang-btn-main .lang-flag {
  width: 22px;
  height: 15px;
}

.lang-option .lang-flag {
  width: 22px;
  height: 15px;
}

.lang-wrap {
  position: relative;
  flex-shrink: 0;
}

.lang-btn-main {
  gap: 4px;
  width: auto;
  min-width: 52px;
  height: 36px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 600;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.lang-btn-main:hover {
  background: #222a35;
  border-color: var(--muted);
}

.lang-caret {
  font-size: 10px;
  color: var(--muted);
  line-height: 1;
  margin-top: 1px;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 176px;
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  z-index: 300;
}

.lang-menu.open {
  display: block;
}

.lang-option {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
}

.lang-option.active {
  background: rgba(124, 58, 237, 0.16);
  border-color: rgba(124, 58, 237, 0.38);
  color: var(--text);
  padding: 8px 9px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip--link {
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background 0.2s ease;
}

.user-chip--link:hover {
  background: rgba(255, 255, 255, 0.06);
}

.user-chip--link:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.45);
  outline-offset: 2px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--orange), #c06010);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

a.lb-row {
  text-decoration: none;
  color: inherit;
}

.lb-row--link {
  cursor: pointer;
}

.lb-player {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.lb-player .lb-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-avatar {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--orange), #c06010);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.lb-avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lb-avatar__initial {
  line-height: 1;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

button {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple), #6d28d9);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #d97706);
  color: #1a1200;
  border: none;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-outline:hover {
  color: var(--text);
  border-color: var(--muted);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(240, 72, 72, 0.3);
}

.btn-danger:hover {
  background: rgba(240, 72, 72, 0.08);
  border-color: var(--red);
}

input[type='text'],
input[type='email'] {
  padding: 7px 12px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  font-family: var(--font);
  font-size: 13px;
  transition: all 0.2s;
}

input[type='text']:focus,
input[type='email']:focus {
  outline: none;
  border-color: var(--orange);
}

input[type='text']::placeholder,
input[type='email']::placeholder {
  color: var(--muted);
}

.header-nav,
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.header-nav {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px 12px;
  width: 100%;
}

.guest-nav {
  display: none;
  flex: 1;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
}

.guest-nav a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: transparent;
  transition: color 0.2s, background 0.2s;
}

.guest-nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.header-nav a,
.header-nav .nav-link,
.site-nav a,
.site-nav .nav-link {
  font-size: 13px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  background: var(--glass);
  backdrop-filter: blur(8px);
  border-radius: 8px;
  padding: 8px 14px;
  transition: border-color 0.2s, transform 0.2s;
}

.header-nav a:hover,
.header-nav .nav-link:hover,
.site-nav a:hover,
.site-nav .nav-link:hover {
  border-color: var(--muted);
}

.header-nav a.nav-active,
.header-nav .nav-link.nav-active,
.site-nav a.nav-active,
.site-nav .nav-link.nav-active {
  border-color: rgba(124, 58, 237, 0.45);
  color: var(--cyan);
}

/* Public content pages */
.page-wrap {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}

.page-card h1 {
  font-family: var(--font-display);
  font-size: 28px;
  margin-bottom: 12px;
  color: var(--text);
}

.page-card h2 {
  font-family: var(--font-display);
  font-size: 17px;
  margin: 20px 0 8px;
  color: var(--text);
}

.page-card p {
  color: var(--muted);
  line-height: 1.65;
}

@media (max-width: 640px) {
  .page-wrap {
    padding: 20px 16px 48px;
  }

  .page-card {
    padding: 20px;
  }
}

.header-nav .btn-outline:hover,
.site-nav .btn-outline:hover {
  color: var(--text);
  border-color: var(--muted);
}

.header-nav .btn-outline,
.site-nav .btn-outline {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

/* Гамбургер — все ширины; пункты меню в выезжающей панели */
.header-menu-toggle {
  display: inline-flex;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-menu-toggle__bars,
.header-menu-toggle__bars::before,
.header-menu-toggle__bars::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  position: relative;
}

.header-menu-toggle__bars::before,
.header-menu-toggle__bars::after {
  content: '';
  position: absolute;
  left: 0;
}

.header-menu-toggle__bars::before { top: -5px; }
.header-menu-toggle__bars::after { top: 5px; }

body.mobile-nav-open .header-menu-toggle__bars {
  background: transparent;
}

body.mobile-nav-open .header-menu-toggle__bars::before {
  top: 0;
  transform: rotate(45deg);
}

body.mobile-nav-open .header-menu-toggle__bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.header-mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 140;
  background: var(--modal-backdrop);
}

body.mobile-nav-open .header-mobile-backdrop {
  display: block;
}

.header-mobile-panel {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 150;
  width: min(320px, 88vw);
  height: 100%;
  background: var(--modal-bg);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.mobile-nav-open .header-mobile-panel {
  display: flex;
  flex-direction: column;
}

.header-mobile-panel__inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  flex: 1;
}

.header-mobile-panel__section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
}

.header-mobile-panel__section + .header-mobile-panel__section {
  border-top: 1px solid var(--border);
}

.header-mobile-panel__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.header-mobile-panel__link,
.header-mobile-panel__btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.header-mobile-panel__link:hover,
.header-mobile-panel__btn:hover {
  background: var(--surface);
  color: var(--text);
}

.header-mobile-panel__foot {
  padding: 16px;
  margin-top: auto;
  border-top: 1px solid var(--border);
}

.header-mobile-panel__foot .btn-primary {
  width: 100%;
  justify-content: center;
}

body.is-logged-in [data-mobile-nav-guest-only] {
  display: none !important;
}

/* Inline-навигация в хедере скрыта — ссылки в панели гамбургера */
header .header-nav,
header .site-nav,
.home-header .home-nav {
  display: none !important;
}

@media (max-width: 768px) {
  :root {
    --page-gutter: 16px;
  }

  body.is-guest #guestArea #loginSteam {
    display: none;
  }

  .page-wrap {
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
  }
}

@media (max-width: 640px) {
  .header-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      'logo actions'
      'balance balance';
    min-height: auto;
    padding: 10px 12px 6px;
    gap: 8px;
    align-items: center;
  }

  .header-left {
    grid-area: balance;
    margin-top: 0;
    width: 100%;
    justify-self: stretch;
  }

  .header-center {
    grid-area: logo;
    margin-right: 0;
    justify-self: start;
  }

  .header-right {
    grid-area: actions;
    margin-top: 0;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 62%;
  }

  .logo-img {
    width: 40px;
    height: 40px;
  }

  .xp-chip {
    font-size: 11px;
    padding: 6px 10px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-hop-chip {
    padding: 6px 8px;
    font-size: 10px;
    max-width: 46vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-hop-chip__delta {
    font-size: 9px;
  }

  .header-currency-group {
    gap: 5px;
    max-width: 100%;
  }

  .user-name {
    display: none;
  }

  #userArea {
    gap: 6px !important;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  #userArea .btn-outline,
  #userArea .btn-danger {
    padding: 5px 8px;
    font-size: 11px;
  }

  body.is-guest .header-row {
    grid-template-areas: 'logo actions';
    grid-template-columns: 1fr auto;
  }

  body.is-guest .header-right {
    max-width: none;
  }

  #guestArea {
    display: flex;
    align-items: center;
  }

  #guestArea #loginSteam {
    font-size: 11px;
    padding: 6px 10px;
    white-space: nowrap;
  }
}

.modal-root {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  padding: 24px 16px;
  overflow-y: auto;
}

.modal-root.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  border: 0;
  padding: 0;
  cursor: pointer;
}

.modal-dialog {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 100%;
  max-width: 520px;
  margin: auto;
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}

.modal-close:hover {
  color: var(--text);
  background: var(--surface);
}

.modal-body {
  padding: 16px;
  max-height: min(70vh, 560px);
  overflow-y: auto;
}

body.modal-open,
body.mobile-nav-open {
  overflow: hidden;
}

/* Баннер «Доступна новая версия» (pwa-register.js) */
.csrabbits-update-banner {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 10050;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--header-bg, rgba(15, 19, 26, 0.96));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
}

.csrabbits-update-banner__text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.csrabbits-update-banner__btn {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--purple, #7c3aed), var(--gold, #f59e0b));
}

.csrabbits-update-banner__btn:hover {
  filter: brightness(1.08);
}
