/*
 * polish.css — global, additive "make it feel crisp" layer for Tamper Market.
 *
 * Intentionally conservative: it only smooths typography, adds a keyboard
 * focus ring, unifies scrollbars and selection colour, and tames the mobile
 * tap flash. It does NOT change layout, colours or component structure, so it
 * is safe to drop on every page without visual regressions. Page-specific
 * rules (e.g. .bm-body scrollbars) keep overriding it via higher specificity.
 */

/* Smoother text everywhere */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Smooth in-page anchor scrolling (respecting reduced-motion below) */
html { scroll-behavior: smooth; }

/* Accent text selection */
::selection { background: rgba(96, 165, 250, .32); color: #fff; }

/* Кольцо фокуса для того, у чего нет другого признака: ссылки, кнопки,
   списки, элементы с tabindex.
   Текстовые поля и textarea сюда НЕ входят намеренно. Задумывалось, что
   правило сработает только при переходе с клавиатуры, но у полей ввода
   браузер считает и клик мышью «видимым фокусом» — за ним обычно следует
   набор текста. Из-за этого при нажатии на поиск вокруг поля вспыхивало
   синее кольцо со скруглением 8px и отступом 2px: оно висело отдельно от
   поля и не совпадало с его формой. Поля показывают фокус сами — рамкой
   или подчёркиванием, плюс в них стоит курсор. */
a:focus-visible,
button:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible,
input:where([type="checkbox"], [type="radio"], [type="range"], [type="file"],
             [type="color"], [type="button"], [type="submit"], [type="reset"]):focus-visible {
  outline: 2px solid rgba(96, 165, 250, .75);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Softer, on-brand tap highlight on touch devices */
* { -webkit-tap-highlight-color: rgba(96, 165, 250, .18); }

/* Thin, dark, consistent scrollbars (Firefox + WebKit). Page-level custom
   scrollbars still win on their own containers via higher specificity. */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .12);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, .22);
  background-clip: content-box;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ── Header favorite/cart icons REMOVED (2026-07-15) ────────────────────────
   ♥ / cart live only inside the signed-in userpod dropdown. Standalone
   header clusters (.hd-actions / .hd-icons / .hd-iconlink) were duplicates
   and caused flash + visual clutter. Hard-hide any leftover markup. */
.hd-actions,
.hd-icons,
.hd-r > a.hd-iconlink,
.hd-r > a.hd-iconbtn,
.hd-r > a.hd-ic {
  display: none !important;
}

/* Unify header control order: lang → user pod */
.hd-r { display: flex !important; align-items: center !important; }
.hd-r .lang { order: 1 !important; }
.hd-r [data-tm-userpod] { order: 2 !important; }

/* Legacy button styles kept inert (markup removed); safe if a page regresses. */
.hd-iconlink, .hd-iconbtn, .hd-ic {
  width: 40px !important; height: 40px !important; flex-shrink: 0;
  display: none !important;
  border-radius: 50% !important;
}
.hd-iconlink svg, .hd-iconbtn svg, .hd-ic svg {
  width: 18px !important; height: 18px !important;
  stroke-width: 2 !important; stroke-linejoin: round !important; stroke-linecap: round !important;
  transition: transform .2s ease;
}
.hd-iconlink:hover, .hd-iconbtn:hover, .hd-ic:hover {
  color: #fff !important;
  border-color: rgba(96,165,250,.42) !important;
  box-shadow: 0 6px 22px rgba(0,0,0,.5), 0 0 24px rgba(96,165,250,.18), 0 1px 0 rgba(255,255,255,.05) inset !important;
  transform: translateY(-1px) !important;
}
.hd-iconlink:hover svg, .hd-iconbtn:hover svg, .hd-ic:hover svg { transform: scale(1.08); }
.hd-iconlink:active, .hd-iconbtn:active, .hd-ic:active { transform: translateY(0) scale(.95) !important; }

/* Active page (on /favorites or /cart) — soft accent fill */
.hd-iconlink.on, .hd-iconlink[aria-current="page"],
.hd-iconbtn.on, .hd-iconbtn[aria-current="page"],
.hd-ic.on, .hd-ic[aria-current="page"] {
  color: #fff !important;
  border-color: rgba(96,165,250,.45) !important;
  background:
    linear-gradient(180deg, rgba(96,165,250,.16) 0%, rgba(96,165,250,.02) 60%),
    rgba(12,16,13,.6) !important;
}

/* Count badge — brand-blue, cut out from the header with a dark ring */
.hd-ic-badge, .hd-iconbtn-cnt {
  background: linear-gradient(135deg, #60a5fa, #3b82f6) !important;
  color: #fff !important;
  border: 2px solid #0b0e0a !important;
  box-shadow: 0 2px 8px rgba(59,130,246,.5) !important;
  top: -5px !important; right: -5px !important;
  min-width: 18px !important; height: 18px !important;
  font-weight: 800 !important;
  animation: tmBadgePop .3s cubic-bezier(.16,1,.3,1);
}
@keyframes tmBadgePop { 0% { transform: scale(.2); opacity: 0 } 60% { transform: scale(1.15) } 100% { transform: scale(1); opacity: 1 } }
@media (max-width: 680px) {
  .hd-iconlink, .hd-iconbtn, .hd-ic { width: 36px !important; height: 36px !important; border-radius: 50% !important; }
  .hd-iconlink svg, .hd-iconbtn svg, .hd-ic svg { width: 16px !important; height: 16px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .hd-ic-badge, .hd-iconbtn-cnt { animation: none !important; }
}

/* ── Product card header (.acc-card on market + favorites) ───────────────────
   The favorite heart is absolute top-right; the header row holds the
   game+chips block (left) and the price (right). On narrow cards the long
   chip row (hours, $inventory, Prime, ELO…) shoved the price under the heart,
   so only a stray "₽" peeked out past the edge. Fix: pin the price, give the
   row clearance for the heart, and let the game/chips block shrink instead.
   Centralised here so it can never drift apart between pages again. */
.acc-card-head { padding-right: 56px !important; gap: 10px !important; }
.acc-game-badge-top { flex: 1 1 auto !important; min-width: 0 !important; overflow: hidden !important; white-space: nowrap !important; }
.acc-price, .acc-price-stack { flex-shrink: 0 !important; }
.acc-price-old, .acc-price-new, .acc-price { white-space: nowrap !important; }

/* ── Brand logo: Tamper.Market ──────────────────────────────────────────────
   Real period glyph — baseline, tight, azure + soft glow. Not a square,
   not a fake spacer box. Markup: Tamper<span class="lo-sq">.</span>Market */
.lo-t {
  font-family: Inter, system-ui, -apple-system, sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: -.02em !important;
  color: #fff !important;
  white-space: nowrap !important;
}
.lo-t span,
.lo-t .lo-sq {
  display: inline !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  color: #60a5fa !important;
  -webkit-text-fill-color: #60a5fa !important;
  text-shadow: 0 0 10px rgba(96,165,250,.55) !important;
  font-size: 1em !important;
  font-weight: inherit !important;
  font-style: normal !important;
  line-height: inherit !important;
  letter-spacing: 0 !important;
  vertical-align: baseline !important;
  position: static !important;
  top: auto !important;
  left: auto !important;
  overflow: visible !important;
  transform: none !important;
}
.lo-t span::before,
.lo-t span::after,
.lo-t .lo-sq::before,
.lo-t .lo-sq::after {
  content: none !important;
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: none !important;
  box-shadow: none !important;
}
.pager button.on {
  background: linear-gradient(180deg, #60a5fa, #3b82f6) !important;
  box-shadow: 0 4px 14px rgba(59,130,246,.32) !important;
}

/* ── Site-wide header nav ──────────────────────────────────────────────────
   2026-08-22: капсула с белой таблеткой на активном пункте заменена на
   текст с подчёркиванием. Пункты перестают выглядеть кнопками — в шапке
   нечего «нажимать как кнопку», это навигация, и белая плашка спорила с
   единственной по-настоящему белой кнопкой на странице («Купить»).

   Разметку это не трогает: тот же <nav class="nv"> с классом .act на
   активном пункте, поэтому правило работает на всех страницах разом,
   включая те, где шапку дорисовывает userpod.js. Мобильный бургер
   (mobile-nav.js) строит меню из этих же ссылок и ничего не замечает. */
.hd::after { display: none !important; }
.nv {
  border-radius: 0 !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  gap: 26px !important;
}
.nv a {
  position: relative;
  border-radius: 0 !important;
  padding: 6px 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: rgba(255,255,255,.44) !important;
  font-weight: 500 !important;
}
.nv a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px;
  background: currentColor; border-radius: 2px;
  transform: scaleX(0); transform-origin: 50% 100%; opacity: 0;
  transition: transform .3s cubic-bezier(.16,1,.3,1), opacity .2s;
}
.nv a:hover { color: rgba(255,255,255,.78) !important; }
.nv a:hover::after { transform: scaleX(1); opacity: .4; }
.nv a.act { color: #fff !important; font-weight: 650 !important; }
.nv a.act::after { transform: scaleX(1); opacity: 1; }
/* ── Переключатель языка ────────────────────────────────────────────
   Вид задаёт userpod.js: там же живёт бегунок .tm-lang-thumb, который
   измеряет активную кнопку и едет под неё подчёркиванием.

   Прежняя капсула с рамкой и подложкой описывалась здесь через
   !important и переживала любые правки в userpod.js — от неё на тёмной
   шапке оставался призрачный овал. Собственный индикатор сюда добавлять
   тоже нельзя: он станет вторым и разъедется с настоящим. */
.hd-r .lang {
  background: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Subtle motion polish — deliberately low-key.
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes tmCardReveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.acc-card, .fav-card, .cart-row {
  animation: tmCardReveal .38s cubic-bezier(.16,1,.3,1) both;
}
.acc-card:nth-child(1),  .fav-card:nth-child(1),  .cart-row:nth-child(1)  { animation-delay: 0ms; }
.acc-card:nth-child(2),  .fav-card:nth-child(2),  .cart-row:nth-child(2)  { animation-delay: 35ms; }
.acc-card:nth-child(3),  .fav-card:nth-child(3),  .cart-row:nth-child(3)  { animation-delay: 70ms; }
.acc-card:nth-child(4),  .fav-card:nth-child(4),  .cart-row:nth-child(4)  { animation-delay: 105ms; }
.acc-card:nth-child(5),  .fav-card:nth-child(5),  .cart-row:nth-child(5)  { animation-delay: 140ms; }
.acc-card:nth-child(6),  .fav-card:nth-child(6),  .cart-row:nth-child(6)  { animation-delay: 175ms; }
.acc-card:nth-child(7),  .fav-card:nth-child(7),  .cart-row:nth-child(7)  { animation-delay: 210ms; }
.acc-card:nth-child(8),  .fav-card:nth-child(8),  .cart-row:nth-child(8)  { animation-delay: 245ms; }
.acc-card:nth-child(9),  .fav-card:nth-child(9),  .cart-row:nth-child(9)  { animation-delay: 280ms; }
.acc-card:nth-child(10), .fav-card:nth-child(10), .cart-row:nth-child(10) { animation-delay: 315ms; }
.acc-card:nth-child(11), .fav-card:nth-child(11), .cart-row:nth-child(11) { animation-delay: 350ms; }
.acc-card:nth-child(12), .fav-card:nth-child(12), .cart-row:nth-child(12) { animation-delay: 385ms; }
.acc-card:nth-child(n+13),
.fav-card:nth-child(n+13),
.cart-row:nth-child(n+13) { animation-delay: 420ms; }

@keyframes tmHeartPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.18); }
  60%  { transform: scale(.94); }
  100% { transform: scale(1); }
}
.acc-fav-btn.just-liked,
.fav-btn.just-liked {
  animation: tmHeartPop .32s cubic-bezier(.16,1,.3,1);
}

@keyframes tmCartBump {
  0%, 100% { transform: scale(1); }
  40%      { transform: scale(1.12); }
}
.hd-ic.bumping,
.hd-iconlink.bumping,
.hd-iconbtn.bumping {
  animation: tmCartBump .28s cubic-bezier(.4,0,.2,1);
}

.tm-skel {
  background: linear-gradient(90deg,
    rgba(255,255,255,.04) 0%,
    rgba(255,255,255,.08) 50%,
    rgba(255,255,255,.04) 100%);
  background-size: 200% 100%;
  animation: tmSkelShimmer 1.2s ease-in-out infinite;
  border-radius: 10px;
}
@keyframes tmSkelShimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

@view-transition { navigation: auto; }
::view-transition-old(root) { animation-duration: .22s; }
::view-transition-new(root) { animation-duration: .22s; }

:where(h1, h2, h3, h4, [id]) { scroll-margin-top: 84px; }
@media (max-width: 760px) {
  :where(h1, h2, h3, h4, [id]) { scroll-margin-top: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  .acc-card, .fav-card, .cart-row,
  .acc-fav-btn.just-liked, .fav-btn.just-liked,
  .hd-ic.bumping, .hd-iconlink.bumping, .hd-iconbtn.bumping,
  .tm-skel {
    animation: none !important;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

/* ════════════════════════════════════════════════════════════════════
   Подвал сайта (.tmf)
   --------------------------------------------------------------------
   Четыре колонки: знак с одной фразой и тремя словами о связи, затем
   каталог, поддержка и документы. Внизу за линией копирайт и короткая
   строка справа.

   Что здесь намеренно отсутствует. Кнопок нет: подвал — это конец
   страницы, а не второе место для призыва, и синяя плашка внизу тянула
   на себя взгляд с того, ради чего человек пришёл. Индикатора «работает»
   с зелёной точкой нет: точка читается как мигающая лампочка и добавляет
   в спокойный низ страницы лишнее беспокойство. Движения нет вообще —
   ни сдвигов при наведении, ни анимаций; меняется только цвет ссылки,
   и то за 160 мс.

   Палитра маркета: фон страницы, волосяные линии, текст 55/28% белого.

   Разметка — templates/partials/footer.html, один файл на все страницы.
   Стили лежат в polish.css, потому что он подключён везде: и на маркете,
   и в профиле, и в корзине, и на правовых.
   ════════════════════════════════════════════════════════════════════ */
.tmf{
  /* margin-top:auto нужен правовым страницам: тело там — колонка флекса,
     и без этого подвал повисал бы сразу под коротким текстом, а не внизу. */
  margin-top:auto;flex-shrink:0;
  width:100%;box-sizing:border-box;
  border-top:1px solid rgba(255,255,255,.06);
  font-family:Inter,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}
.tmf-in{
  max-width:1240px;margin:0 auto;
  padding:54px clamp(16px,3vw,48px) 0;
}
.tmf-top{
  display:grid;
  grid-template-columns:minmax(240px,1fr) minmax(0,1.9fr);
  gap:48px;
}
.tmf-cols{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:40px 28px;
}

/* ── Знак и фраза ────────────────────────────────────────────────── */
.tmf-mark{
  display:inline-block;
  font-size:16.5px;font-weight:800;letter-spacing:-.3px;color:#fff;
  text-decoration:none;white-space:nowrap;
}
/* Синяя точка ровно та же, что в шапке, — знак должен читаться как один
   и тот же, а не как похожая надпись. */
.tmf-mark .tmf-dot-b{
  color:#60a5fa;-webkit-text-fill-color:#60a5fa;
  text-shadow:0 0 10px rgba(96,165,250,.55);
}
.tmf-about{
  margin:14px 0 0;max-width:280px;
  font-size:12.5px;line-height:1.66;color:rgba(255,255,255,.45);
}
.tmf-ds{
  margin-top:16px;display:inline-flex;align-items:center;gap:8px;
  font-size:12.5px;font-weight:500;color:rgba(255,255,255,.55);
  text-decoration:none;transition:color .16s ease;
}
.tmf-ds svg{width:15px;height:15px;flex:0 0 auto;display:block;color:#5865f2}
.tmf-ds:hover{color:#fff}
/* Столбец соцссылок. align-items:flex-start держит кликабельную зону по
   ширине текста — растянутая на всю колонку ссылка ловила бы промахи по
   пустому месту справа. Отступ живёт на контейнере, поэтому у самих
   ссылок он снимается. */
.tmf-soc{
  margin-top:16px;display:flex;flex-direction:column;
  align-items:flex-start;gap:10px;
}
.tmf-soc .tmf-ds{margin-top:0}
.tmf-ds--tg svg{color:#2aabee}

/* ── Колонки ─────────────────────────────────────────────────────── */
.tmf-h{
  margin:0 0 17px;
  font-size:10.5px;font-weight:600;letter-spacing:.13em;text-transform:uppercase;
  color:rgba(255,255,255,.42);
}
.tmf-col ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:13px}
.tmf-col a{
  font-size:13px;line-height:1.35;color:rgba(255,255,255,.55);text-decoration:none;
  transition:color .16s ease;
}
.tmf-col a:hover{color:#fff}

/* ── Нижняя строка ───────────────────────────────────────────────── */
.tmf-bot{
  margin-top:52px;border-top:1px solid rgba(255,255,255,.06);
  padding:20px 0 26px;
  display:flex;align-items:center;justify-content:space-between;gap:8px 16px;
  font-size:11.5px;color:rgba(255,255,255,.28);
}
.tmf-note{text-align:right}

.tmf a:focus-visible{
  outline:2px solid rgba(96,165,250,.75);outline-offset:3px;border-radius:4px;
}

/* ── Узкие экраны ────────────────────────────────────────────────── */
@media(max-width:1000px){
  .tmf-top{grid-template-columns:1fr;gap:38px}
  .tmf-about{max-width:520px}
}
@media(max-width:640px){
  .tmf-in{padding:38px 16px 0}
  .tmf-cols{grid-template-columns:1fr 1fr;gap:30px 20px}
  /* Третья колонка в сетке из двух уходит на свою строку и оставляет
     справа пустое поле в половину экрана. Растягиваем её на всю ширину
     и раскладываем ссылки в две дорожки — дыры нет. */
  .tmf-col:last-child{grid-column:1/-1}
  .tmf-col:last-child ul{display:grid;grid-template-columns:1fr 1fr;gap:13px 20px}
  .tmf-bot{
    flex-direction:column;align-items:flex-start;gap:8px;
    margin-top:38px;padding:18px 0 24px;
  }
  .tmf-note{text-align:left}
}
@media(max-width:380px){
  .tmf-cols{grid-template-columns:1fr}
  .tmf-col:last-child ul{grid-template-columns:1fr}
}

@media (prefers-reduced-motion:reduce){
  .tmf-col a,.tmf-ds,.tmf-soc .tmf-ds{transition:none}
}
