

/* =========================
   0. БАЗА + ФОН ДЛЯ ДЕСКТОПА
   ========================= */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: #0a0d13;
  overflow-x: hidden;
}

/* Десктопный фон (статичный, без проблем для десктопа) */
body {
  position: relative;
  overflow-y: auto;
  background-image: url("https://static.tildacdn.com/tild3666-3335-4665-a339-306463623237/UniversalUpscaler_68.jpg");
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: center top;
  background-size: cover;
}

.t-records {
  position: relative;
  z-index: 1;
}

/* =========================
   1. МОБИЛЬНЫЕ — ФОН БЕЗ ЧЕРНЫХ ПОЛОС
   ========================= */
@media (max-width: 980px) {

  html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background-color: #0a0d13;
  }

  /* Убираем фон с body, оставляем только цвет */
  body {
    background: #0a0d13 !important;
    background-image: none !important;
  }

  /* Фон через фиксированную подложку */
  body::before {
    content: "";
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;

    /* ВАЖНО:
       - min-height: 1200px — твой желаемый минимум
       - height: 100vh / 100dvh — чтобы на высоких экранах не было черных полос
    */
    height: 100vh;
    min-height: 1200px;

    z-index: 0;
    pointer-events: none;

    background-image: url("https://static.tildacdn.com/tild3666-3335-4665-a339-306463623237/UniversalUpscaler_68.jpg");
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover; /* тянем картинку, чтобы всегда закрывала весь экран */
  }

  /* Для новых iOS / современных браузеров — используем 100dvh */
  @supports (height: 100dvh) {
    body::before {
      height: 100dvh;
    }
  }

  .t-records {
    position: relative;
    z-index: 1;
  }
}

/* =========================
   2. ОТКЛЮЧАЕМ ТУМАН 
   ========================= */
[class*="fog"],
[class*="Fog"],
[class*="smoke"]{
  display: none !important;
  pointer-events: none !important;
}

/* =========================
   3. МОБИЛЬНЫЙ СКРОЛЛ + ГАЛЕРЕЯ
   ========================= */
@media (max-width: 1024px) {

  html,
  body {
    position: static !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    touch-action: auto !important;
    overscroll-behavior: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Убираем магическую палочку */
  .mw-wand{
    pointer-events: none !important;
    display: none !important;
  }
  .mw-lamp, .mw-spark, .mw-sparks {
    pointer-events: none !important;
  }

  /* Горизонтальная галерея */
  #h3-505.h3-wrap{
    position: relative !important;
    overflow: visible !important;
  }

  .h3-row{
    display: flex;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    gap: 10px;
    padding-bottom: 10px;
    touch-action: pan-x pan-y !important;
    -webkit-overflow-scrolling: touch;
  }

  .h3-item{
    flex: 0 0 auto;
    width: 300px;
    scroll-snap-align: start;
  }

  .h3-item img{
    width: 100%;
    height: auto;
  }

  .h3-row::-webkit-scrollbar{
    height: 0;
  }
}

/* =========================
   4. ДЕСКТОП-СТИЛИ ГАЛЕРЕИ
   ========================= */
@media (min-width: 1025px){
  .h3-item{
    width: 505px;
  }
  .h3-row{
    overflow-x: auto;
    overflow-y: visible;
  }
  .h3-row::-webkit-scrollbar{
    height: 0;
  }
}



  (function(){
    window.addEventListener('load', function(){
      var isFinePointer = matchMedia('(pointer: fine)').matches;
      if (!isFinePointer) return;

      if (typeof window.initSnitch === 'function') window.initSnitch();
      if (typeof window.initMagicWand === 'function') window.initMagicWand();
    });
  })();

