/* Shell: reset, header with search, left rail, brand row, mobile tab bar, shared controls. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-m);
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(198, 242, 78, 0.06), transparent 62%),
    radial-gradient(900px 640px at 100% -4%, rgba(107, 149, 255, 0.08), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 0;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, dl, dd { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 6px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico { width: 20px; height: 20px; flex: none; }
.skip {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  padding: 10px 16px; border-radius: var(--r-s);
  background: var(--lime); color: var(--lime-ink); font-weight: 700;
  transition: top var(--dur) var(--ease);
}
.skip:focus { top: 12px; }

/* ---------- header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(8, 9, 13, 0.82);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--line);
  transition: transform var(--dur) var(--ease);
}
.topbar__row {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 var(--gutter) 0 18px;
  max-width: 1720px;
  margin: 0 auto;
}
.logo { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.logo__mark {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--lime-hi), var(--lime) 55%, #9BD12A);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset, 0 8px 22px -8px rgba(198, 242, 78, 0.6);
  transform: rotate(-6deg);
  transition: transform var(--dur) var(--ease);
}
.logo:hover .logo__mark { transform: rotate(0deg) scale(1.04); }
.logo__mark svg { width: 26px; height: 26px; stroke: var(--lime-ink); stroke-width: 3.4; }
.logo__word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.03em;
}
.logo__word b { color: var(--lime); font-weight: 700; }
/* Логотип «Монетка» (logo/l2/c1) */
.logo__img { display: block; height: 30px; width: auto; transition: transform var(--dur) var(--ease); }
.logo:hover .logo__img { transform: translateX(2px); }
@media (prefers-reduced-motion: reduce) { .logo:hover .logo__img { transform: none; } }

.topbar .logo { width: calc(var(--rail-w) + 96px); }

.catalog-menu { position: relative; flex: none; }
.btn-catalog {
  height: 48px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0 18px 0 14px;
  border-radius: var(--r-m);
  background: var(--lime);
  color: var(--lime-ink);
  font-weight: 700;
  box-shadow: 0 10px 26px -14px rgba(198, 242, 78, 0.7);
  transition: background var(--dur-fast), transform var(--dur-fast) var(--ease);
}
.btn-catalog:hover { background: var(--lime-hi); }
.btn-catalog:active { transform: scale(0.97); }
.btn-catalog .ico { stroke-width: 2.2; }
.btn-catalog[aria-expanded="true"] .ico { transform: rotate(45deg); transition: transform var(--dur) var(--ease); }

.catalog-panel {
  position: absolute; top: calc(100% + 10px); left: 0;
  width: 440px;
  padding: 8px;
  border-radius: var(--r-l);
  background: var(--s2);
  border: 1px solid var(--line-2);
  box-shadow: var(--sh-2), 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  animation: pop var(--dur) var(--ease-expo);
}
.catalog-panel__list a {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  padding: 10px; border-radius: var(--r-m);
  transition: background var(--dur-fast);
}
.catalog-panel__list a:hover, .catalog-panel__list a:focus-visible { background: var(--s3); }
.catalog-panel__ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c, var(--lime)) 16%, var(--s1));
  color: var(--c, var(--lime));
}
.catalog-panel__ico svg, .catalog-panel__ico img { width: 22px; height: 22px; }
.catalog-panel__list strong { display: block; font-size: var(--fs-m); }
.catalog-panel__list small { display: block; color: var(--text-2); font-size: var(--fs-xs); line-height: 1.35; }
.catalog-panel__count { color: var(--text-3); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }

/* search */
.search { position: relative; flex: 1 1 auto; min-width: 0; max-width: 760px; }
.search__box {
  height: 48px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 10px 0 16px;
  border-radius: var(--r-m);
  background: var(--s2);
  border: 1px solid var(--line-2);
  color: var(--text-3);
  transition: border-color var(--dur-fast), box-shadow var(--dur), background var(--dur-fast);
}
.search__box:hover { border-color: var(--line-3); }
.search__box:focus-within {
  border-color: var(--lime-a40);
  background: var(--s1);
  box-shadow: 0 0 0 4px var(--lime-a10);
  color: var(--lime);
}
.search input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; outline: 0; background: transparent;
  font-size: var(--fs-m); color: var(--text);
}
.search input::placeholder { color: var(--text-3); }
.search input::-webkit-search-cancel-button { display: none; }
.search__kbd {
  font: 600 12px/1 var(--font-body);
  padding: 5px 8px; border-radius: 7px;
  color: var(--text-3); background: var(--s3); border: 1px solid var(--line-2);
}
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  max-height: min(70vh, 560px); overflow: auto;
  padding: 8px;
  border-radius: var(--r-l);
  background: var(--s2);
  border: 1px solid var(--line-2);
  box-shadow: var(--sh-2), 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  animation: pop var(--dur) var(--ease-expo);
}
.suggest__label { padding: 8px 10px 6px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.suggest__quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 6px 8px; }
.suggest__opt {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  padding: 7px 10px 7px 7px; border-radius: var(--r-m); cursor: pointer;
}
.suggest__opt[aria-selected="true"], .suggest__opt:hover { background: var(--s3); }
.suggest__opt img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--s3); }
.suggest__opt strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.suggest__opt small { color: var(--text-2); font-size: var(--fs-xs); }
.suggest__price { font-weight: 700; font-size: 14px; white-space: nowrap; }
.suggest__empty { padding: 18px 12px; color: var(--text-2); text-align: center; }

.topbar__actions { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: none; }
.hdr-link {
  height: 48px; display: inline-flex; align-items: center; gap: 8px;
  padding: 0 12px; border-radius: var(--r-m);
  color: var(--text-2); font-weight: 600; font-size: 14px;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.hdr-link:hover { color: var(--text); background: var(--s2); }
.hdr-link em {
  font-style: normal; font-size: 11px; font-weight: 700;
  padding: 2px 6px; margin-left: 2px; border-radius: 6px;
  color: var(--lime); background: var(--lime-a10);
}
.icon-btn {
  width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: var(--r-m); background: var(--s2); border: 1px solid var(--line-2);
  color: var(--text-2);
  transition: color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-3); }
.icon-btn:active { transform: scale(0.95); }

/* ---------- layout + rail ---------- */
.layout {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  max-width: 1720px;
  margin: 0 auto;
}
.rail {
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h));
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 0 18px;
  border-right: 1px solid var(--line);
}
.rail__item {
  position: relative;
  width: 68px; min-height: 58px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 2px 7px;
  border-radius: var(--r-m);
  color: var(--text-3);
  font-size: 11px; font-weight: 600; line-height: 1.15; text-align: center;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.rail__item svg { width: 22px; height: 22px; }
.rail__item img { width: 22px; height: 22px; opacity: 0.6; transition: opacity var(--dur-fast); }
.rail__item:hover { color: var(--text); background: var(--s2); }
.rail__item:hover img, .rail__item.is-active img { opacity: 1; }
.rail__item.is-active { color: var(--text); background: var(--s2); }
.rail__item.is-active::before {
  content: ""; position: absolute; left: -8px; top: 50%;
  width: 4px; height: 24px; margin-top: -12px; border-radius: 0 4px 4px 0;
  background: var(--lime);
  box-shadow: 0 0 14px rgba(198, 242, 78, 0.7);
}
.rail__item.is-active svg { color: var(--lime); }
.rail__sep { width: 32px; height: 1px; margin: 8px 0; background: var(--line-2); }
.rail__item--end { margin-top: auto; }

.page { min-width: 0; padding: 18px var(--gutter) 0; }

/* ---------- brand / game icon row ---------- */
.brands { margin: 0 calc(var(--gutter) * -1); }
.brands__list {
  display: flex; gap: 6px;
  overflow-x: auto; overscroll-behavior-x: contain;
  padding: 4px var(--gutter) 10px;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - 64px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - 64px), transparent);
}
.brands__list::-webkit-scrollbar { display: none; }
.brand {
  flex: none; width: 80px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 4px 0 2px; border-radius: var(--r-m);
  color: var(--text-2);
}
.brand__tile {
  position: relative; width: 60px; height: 60px; border-radius: 18px; overflow: hidden;
  display: grid; place-items: center;
  background: var(--s3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.09) inset, 0 10px 22px -12px rgba(0, 0, 0, 0.9);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur);
}
.brand__tile::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 42%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}
.brand__tile--logo {
  background:
    radial-gradient(120% 100% at 25% 10%, color-mix(in srgb, var(--c) 70%, white 30%), transparent 60%),
    linear-gradient(160deg, var(--c), color-mix(in srgb, var(--c) 55%, black));
}
.brand__tile--logo img { width: 30px; height: 30px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35)); }
.brand__tile--dark img { filter: brightness(0); }
.brand__tile > img.art { width: 100%; height: 100%; object-fit: cover; }
.brand__label {
  max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; font-weight: 600;
  transition: color var(--dur-fast);
}
.brand:hover .brand__tile, .brand:focus-visible .brand__tile {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset, 0 16px 30px -12px rgba(0, 0, 0, 0.9), 0 0 0 3px var(--lime-a20);
}
.brand:hover .brand__label { color: var(--text); }

/* ---------- shared controls ---------- */
.round-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(16, 18, 24, 0.6); border: 1px solid var(--line-3);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast), opacity var(--dur-fast);
}
.round-btn svg { width: 20px; height: 20px; stroke-width: 2.2; }
.round-btn:hover { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.round-btn:active { transform: scale(0.92); }
.round-btn:disabled { opacity: 0.35; pointer-events: none; }
.round-btn--s { width: 40px; height: 40px; background: var(--s2); border-color: var(--line-2); }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 38px; padding: 0 14px;
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 999px;
  background: var(--s2); border: 1px solid var(--line);
  color: var(--text-2); font-size: var(--fs-s); font-weight: 600; white-space: nowrap;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.chip:hover { color: var(--text); border-color: var(--line-3); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip small { font-size: 11px; font-weight: 700; opacity: 0.6; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--text-3)); }

.btn-ghost {
  height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 18px; border-radius: var(--r-m);
  border: 1px solid var(--line-3); color: var(--text); font-weight: 600;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.btn-ghost svg { width: 18px; height: 18px; }
.btn-ghost:hover { background: var(--s3); border-color: rgba(255, 255, 255, 0.28); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 120;
  max-width: min(520px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: var(--r-m);
  background: var(--s3); border: 1px solid var(--line-3);
  box-shadow: var(--sh-2);
  font-size: 14px; color: var(--text);
  transform: translateX(-50%);
  animation: toast-in var(--dur) var(--ease-expo);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ---------- mobile tab bar ---------- */
.tabbar { display: none; }

@media (max-width: 1023px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .topbar .logo { width: auto; }
  .topbar__row {
    height: auto; flex-wrap: wrap; row-gap: 8px; column-gap: 8px;
    padding: 8px var(--gutter) 10px;
  }
  .topbar .logo { height: 44px; }
  .logo__mark { width: 34px; height: 34px; border-radius: 11px; }
  .logo__mark svg { width: 23px; height: 23px; }
  .logo__word { font-size: 18px; }
  .logo__img { height: 26px; }
  .catalog-menu { display: none; }
  .search { order: 5; flex: 1 0 100%; max-width: none; }
  .search__box { height: 46px; }
  .search__kbd { display: none; }
  .hdr-link { display: none; }
  .hdr-link--support { display: inline-flex; width: 44px; height: 44px; padding: 0; justify-content: center; background: var(--s2); border: 1px solid var(--line-2); }
  .hdr-link--support span { display: none; }
  .icon-btn { width: 44px; height: 44px; }
  .topbar.is-condensed { transform: translateY(calc(-52px - 8px)); }
  html { scroll-padding-top: 76px; }
  .page { padding-top: 12px; padding-bottom: calc(88px + env(safe-area-inset-bottom)); }

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(10, 11, 16, 0.9);
    backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%);
    border-top: 1px solid var(--line-2);
  }
  .tabbar__item {
    min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--text-3); font-size: 11px; font-weight: 600; border-radius: 12px;
  }
  .tabbar__item svg { width: 22px; height: 22px; }
  .tabbar__item:active { background: var(--s2); }
  .tabbar__bubble {
    width: 46px; height: 34px; border-radius: 12px; display: grid; place-items: center;
    background: linear-gradient(160deg, #2a475e, #1b2838); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 0 0 2px var(--lime-a40);
  }
  .tabbar__bubble img { width: 20px; height: 20px; }
  .tabbar__item--main { color: var(--text); }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .brand { width: 66px; gap: 6px; }
  .brands__list { gap: 4px; padding-bottom: 6px; }
  .brand__tile { width: 52px; height: 52px; border-radius: 16px; }
  .brand__tile--logo img { width: 26px; height: 26px; }
  .brand__label { font-size: 11px; max-width: 64px; }
}

@media (max-width: 1023px) and (pointer: coarse) {
  .chip { height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
