/* ===== Базовая разметка ===== */
html,body,#root{height:100%}
html, body {
  width:100%;
  overflow-x:clip;
  overscroll-behavior-x:none;
  /* scrollbar-gutter: stable both-edges; */
  touch-action:pan-y;
  background:#0e0a05;
}
* { box-sizing:border-box; }

/* 📱 Мобильный фон по умолчанию */
.site-bg {
  background: url('/assets/decore/bg-mobile.webp') center/cover no-repeat;
}

/* 💻 ПК фон */
@media (min-width: 1024px) {
  .site-bg {
    background: url('/assets/decore/bg-desktop.webp') center/cover no-repeat;

  }
  html, body { overflow: hidden; }

}


/* блокируем скролл */
html.scroll-locked { overflow: hidden; height: 100%; }
body.scroll-locked {
  position: fixed;
  width: 100%;
  top: var(--scroll-lock-y, 0px); /* сюда положим -scrollY */
}

/* чтобы жесты прокрутки не «пробивались» через оверлей */
#winWrap { overscroll-behavior: contain; }


/* 1) добавим переменную — можно крутить интенсивность затемнения */
:root { --bg-dim: .65; }   /* 0..1: 0 — нет затемнения, 1 — полностью чёрный */

/* 2) на <main> уже есть class="relative" — используем псевдо-элемент-оверлей */
main::before{
  content:"";
  position:absolute;
  inset:0;
  background: rgba(0,0,0,var(--bg-dim)); /* вот он — «тёмный стекло» */
  pointer-events:none;  /* не перехватывает клики */
  z-index:0;
}

/* 3) поднимем содержимое над оверлеем */
main > *{
  position:relative;
  z-index:1;
}


/* ===== Колесо ===== */
.wheel-wrap{position:relative}
.wheel-label{ display:none !important; }
.wheel-label{position:absolute; left:50%; top:50%; transform-origin:left; white-space:nowrap}

#wheel{
  -webkit-mask-image: radial-gradient(circle closest-side, #000 99%, transparent 100%);
          mask-image: radial-gradient(circle closest-side, #000 99%, transparent 100%);
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: 50% 50%;
          mask-position: 50% 50%;
  -webkit-mask-size: 100% 100%;
          mask-size: 100% 100%;
}
#wheelHit{position:absolute;inset:0;background:transparent;border:0;z-index:15;cursor:pointer}

/* ===== Карусель ===== */
.carousel{
  width:100%;
  max-width:1160px;
  margin:0 auto 12px;
  border-radius:14px;
  background:rgba(0,0,0,.25);
  box-shadow:0 2px 10px rgba(0,0,0,.35) inset;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  scroll-snap-type:x mandatory;
  touch-action:pan-x pinch-zoom;
  cursor:grab;
}
.carousel::-webkit-scrollbar{ display:none }
.carousel.no-snap{scroll-snap-type:none!important}

#carouselTrack{
  display:flex;
  gap:16px;
  padding:12px;
  width:max-content;
  scroll-behavior:smooth;
  will-change:transform;
}
#carouselTrack.dragging{cursor:grabbing;}
.slide{
  flex:0 0 auto;
  width:clamp(160px,26vw,260px);
  aspect-ratio:5/3;
  position:relative;border-radius:10px;overflow:hidden;
  box-shadow:0 2px 8px rgba(0,0,0,.35);
  background:#222;
  scroll-snap-align:center;
  user-select:none;-webkit-user-drag:none;cursor:pointer
}
.slide img{width:100%;height:100%;object-fit:cover;display:block;pointer-events:none}
.slide .label{position:absolute;left:8px;bottom:8px;background:rgba(0,0,0,.5);border-radius:8px;padding:6px 10px;font-weight:700;letter-spacing:.3px}

/* ===== Пергамент (модалка) ===== */
#winWrap{
  position:fixed;         /* перекрывает экран */
  inset:0;
  pointer-events:none;    /* по умолчанию кликов нет */
  z-index:200;
}
/* Тёмный оверлей */
#winWrap::before{
  content:"";
  position:fixed; inset:0;
  background:rgba(0,0,0,.55);
  opacity:0;
  transition:opacity .28s ease;
  pointer-events:none;
  z-index:10;
}
#winWrap.active { pointer-events:auto; }
#winWrap.active::before{ opacity:1; pointer-events:auto; }

/* Карточка пергамента */
#winCard{
    /* весь контент пергамента сдвинуть вверх на 6% его высоты */
  --paper-shift-y: 0%;
  /* почтовую кнопку поднять от низа на 18% */
  --mail-btn-bottom: 25%;
  position:absolute;
  z-index:210;                  /* над затемнением */
  left:50%; top:55%;
  transform:translate3d(-50%,-50%, 0) scale(.95);
  opacity:0;
  transition:transform .28s ease,opacity .28s ease;
  filter:none;
  pointer-events:none;

  width:min(86vw,360px);
  aspect-ratio:360/511;

  /* Делаем карточку контейнером для container queries */
  container-type:size;
}
#winWrap.active #winCard{
  opacity:1;
  transform:translate(-50%,-50%) scale(1);
  pointer-events:auto;
}


#winCard::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  box-shadow: 0 18px 38px rgba(0,0,0,.55);
  border-radius: 0; /* если нужно — подгони */
}

@media (min-width: 1024px) {
  #winCard{
    width: min(80vw, 720px);  /* подбери под макет: 640–800px обычно ок */
    top: 45%;
  }
}


@media (min-width: 1024px) {
  img[alt="Сундук"] {
    width: 24rem; /* ~192px */
  }

  img[alt="Шапка"] {
    width: 20rem; /* ~160px */
    transform: translateX(-120px);
  }

  #goldStack img[alt="Золото"] {
    width: 400px;
  }

  #goldStack img[alt="Золото2"] {
    width: 500px;
    transform: translateX(120px);
  }

  #goldStack img[alt="свеча"] {
    width: 90px;
    transform: translateX(220px);

    position: absolute;        /* на всякий случай зафиксируем */
    left: 405px;               /* твое значение или новое */
    bottom: 0;
    transform: translateX(0);  /* если где-то был translate */
    z-index: 130;

  }

  /* Вторая свеча — по классу */
  #goldStack .candle_pc {
    display: block;   /* включаем на ПК */
    left: 380px;      /* ставь свои координаты */
    bottom: 0;
  }


  #goldStack .skull {
    display: block;   /* включаем на ПК */
    left: 0;      /* ставь свои координаты */
    bottom: 10;
  }

  #wheelBox { 
    transform: translateY(40px); 

  } /* подбери значение */

}



/* Внутренности пергамента */
.paper{position:relative;width:100%;height:100%}
.paper > img{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:contain;
  display:block; pointer-events:none;
}

/* === Центрирование ТЕКСТА ===
   Сетка 1fr auto auto 1fr — 2-й ряд строго в геометрическом центре */
/* Центрируем текстовый блок точно по центру пергамента */
.paper-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center; /* <-- ключевое */
  align-items: center;
  padding-inline: 10%;
  padding-block: 0;
  text-align: center;
  color: #2b2100;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
  transform: translateY(var(--paper-shift-y, 0));
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

/* убери grid, оставь только flex — это устранит отличия между браузерами */

/* чтобы текст не прыгал в зависимости от шрифта */
.paper .brand,
.paper .bonus,
.paper .subtitle {
  display: block;
  width: 100%;
  line-height: 1.1;
}

/* немного уменьшим текст на очень узких экранах */
@media (max-width: 420px) {
  .paper .brand {
    font-size: 25px;
  }
  .paper .bonus {
    font-size: 14px;
  }
  .paper .subtitle {
    font-size: 35px;
  }
}

.paper-content > * { max-width:100%; }

/* Текстовый блок — во 2-й ряд: ВИЗУАЛЬНЫЙ ЦЕНТР */
.paper-center{
  grid-row:2;
  display:grid;
  gap: clamp(6px, 1.8cqh, 12px);
}

/* Кнопки — в 3-й ряд, ниже центра; сетка даёт одинаковые отступы */
.paper-actions{
  grid-row:3;
  display:grid;
  gap:10px;
  width:100%;
  place-items:center;
}

/* Нормализация отображения шрифтов в разных браузерах */
.paper,
.paper *{
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;     /* WebKit */
  -moz-osx-font-smoothing: grayscale;      /* Firefox macOS */
  font-size-adjust: 0.5;                    /* выравнивает x-height */
}

/* Типографика от размеров карточки (контейнера), а не экрана */
.paper .brand{
  font-family:'Noto Serif', serif;
  font-weight:800;
  line-height:1.1;
  font-size: clamp(25px, 6.2cqw, 30px);
  text-wrap: balance;
  letter-spacing:.01em;
}
.paper .bonus{
  font-weight:800;
  line-height:1.05;
  font-size: clamp(13px, 10cqw, 60px);
  color:#bd8e00;
    text-shadow: 
    -1px -1px 0 #383838,  
    1px -1px 0 #383838,
    -1px 1px 0 #383838,
    1px 1px 0 #383838 !important;
}
.paper .subtitle{
  font-weight:800;
  line-height:1.15;
  font-size: clamp(25px, 4.2cqw, 20px);
  color:#bd8e00 !important;
    text-shadow: 
    -1px -1px 0 #383838,  
    1px -1px 0 #383838,
    -1px 1px 0 #383838,
    1px 1px 0 #383838 !important;
}

.paper-title{color:#5a4300;letter-spacing:.04em}
.paper-small{color:#6d5400}
.paper .close{
  position:absolute; right:8px; top:8px;
  background:transparent; border:0;
  font-size:22px; line-height:1;
  cursor:pointer; color:#5a4300; z-index:3;
}
.paper .close:hover{color:#2b2100}

/* Кнопки внутри пергамента */
.paper .btn{
  width:min(320px, 100%);
  margin:0;                 /* управляем отступами через .paper-actions (gap) */
  padding:10px 14px;
  border-radius:12px; border:0;
  background:#1b1b1b; color:#fff; font-weight:700; cursor:pointer;
}
.paper .btn:hover{ opacity:.95; }

/* Гарантируем, что элементы формы вписываются в карточку */
.paper .input,
.paper .btn,
.paper .btn.ghost {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Сообщение под полем */
.paper .hint {
  margin-top: 4px;
  font-size: clamp(12px, 3.4cqw, 14px);
  line-height: 1.2;
  color: #6d5400;
  text-align: center; /* при желании можно left */
  word-break: break-word;
}

/* Состояния сообщений */
.paper .hint.error   { color: #9b2c2c; }
.paper .hint.success { color: #2d7a2d; }
.paper .hint.info    { color: #5a4300; }

/* На очень узких карточках — чуточку меньше боковых полей */
@container (max-width: 280px){
  .paper-content { padding: 0 6%; }
}




/* «Призрачная» кнопка (в потоке, без absolute) */
.paper .btn.ghost{
  background: rgba(32,32,32,.08);
  -webkit-backdrop-filter: blur(4.9px);
  backdrop-filter: blur(4.9px);
  border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  font-family:'Noto Serif', serif;
  font-weight:800;
  font-size: clamp(14px, 3.8cqw, 18px);
  color:#5a4300;
  transition: background .2s ease;
}
.paper .btn.ghost:hover{ background: rgba(90,67,0,.12); }

/* Узкие карточки — ещё компактнее */
@container (max-width: 280px){
  .paper-content{
    /* было: padding: clamp(4px, 1.2cqh, 8px); или вообще переопределялось */
    padding-inline: 6%;
    /* если нужно — и вертикальные */
    padding-block: clamp(6px, 1.6cqh, 12px);
  }
}

/* Низкие карточки — экономим вертикаль */
@container (max-height: 360px){
  .paper-content{
    /* было: padding: clamp(8px, 2cqh, 16px); */
    padding-block: clamp(8px, 2cqh, 16px);
  }
}

/* Поле ввода (кейс с email) */
.paper .input{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,.25);
  background:rgba(255,255,255,.85);
  color:#1b1500; font-weight:600; outline:none;
}
.paper .input:focus{
  border-color:#6b3a16;
  box-shadow:0 0 0 2px rgba(107,58,22,.25);
}


/* Кнопка «получить бонус на почту» — в потоке, по центру */
.paper .mail-btn{
  position: static;                 /* в потоке, без absolute */
  display: inline-flex;
  flex-direction: column;       /* <-- если хотим перенос на 2 строки влево */
  align-items: flex-start; 
  justify-content: center;

  /* геометрия в духе макета */
  width: 10px;
  height: 65px;
  margin-top: 12px;                 /* отступ от бонус-кнопки */
  align-self: center;               /* центрируем во flex-контейнере .paper-content */

  background: rgba(32, 32, 32, 0.40);
  -webkit-backdrop-filter: blur(4.9px);
  backdrop-filter: blur(4.9px);
  border-radius: 10px;
  border: 0;
  cursor: pointer;

  font-family: 'Noto Serif', serif;
  font-weight: 800;
  font-size: 12px !important;
  inline-size: 155px;  
  line-height: 1;
  color: #ffffff;
  white-space: normal;
  text-align: left;
  text-wrap: balance;           /* где поддерживается — даст ровно 2 “равных” строки */
  line-height: 1.15;
  letter-spacing: .01em;

  padding: 10px 40px 10px 12px;     /* место под иконку справа */
}

.paper .mail-btn:hover{
  background: rgba(90, 67, 0, 0.08);
}
.paper .mail-btn:active{
  transform: translateY(1px);
}

/* Иконка подарка справа */
.paper .mail-btn::after{
  content: "";
  position: absolute;               /* привязываем к самой кнопке */
  width: 28px; height: 28px;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: url("/assets/decore/gift.webp") no-repeat center/contain;
  pointer-events: none;
}

/* fallback, если нет backdrop-filter */
@supports not ((-webkit-backdrop-filter: blur(4.9px)) or (backdrop-filter: blur(4.9px))){
  .paper .mail-btn{
    background: rgba(32,32,32,0.65);
    box-shadow: 0 1px 0 rgba(255,255,255,.15) inset;
  }
}

/* мелкие экраны — чуть компактнее текст/иконку */
@media (max-width: 420px){
  .paper .mail-btn{ font-size: 16px; height: 45px; width: 200px }
  .paper .mail-btn::after{ width: 24px; height: 24px; }
}


/* ===== PNG-кнопка (поверх всего) ===== */
.spinBtn{
  position:absolute;
  z-index:180; /* выше overlay и пергамента */
  left:50%; top:100%;
  transform:translate(-50%, 30%);
  width:220px; height:80px;
  border:0; padding:0; background:transparent; cursor:pointer; display:block;
  -webkit-tap-highlight-color:transparent;
}
.spinBtn img{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:contain; display:block;
  pointer-events:none; user-select:none;
  transition: transform .1s ease, filter .15s ease, box-shadow .15s ease;
  filter: drop-shadow(0 6px 0 #2a1806) drop-shadow(0 12px 18px rgba(0,0,0,.35));
}
.spinBtn span{
  position:relative; z-index:1;
  font-family:'Noto Serif', serif;
  font-weight:800; font-size:21px; line-height:1;
  color:#fff; text-shadow:0 1px 0 rgba(0,0,0,.4);
  pointer-events:none; user-select:none;
}
.spinBtn:hover img{ filter: brightness(1.05) drop-shadow(0 6px 0 #2a1806) drop-shadow(0 12px 18px rgba(0,0,0,.35)); }
.spinBtn:active img{ transform: translateY(3px); filter: brightness(.95) drop-shadow(0 4px 0 #2a1806) drop-shadow(0 12px 18px rgba(0,0,0,.45)); }
.spinBtn:active span{ transform: translateY(2px); }

/* База для PNG-кнопок (те же эффекты, что у spin) */
.pngBtn{
  display:inline-grid;
  place-items:center;
  width:150px;
  height:30px;
  border:0; padding:0;
  background:transparent;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.pngBtn img{
  width:100%; height:100%;
  object-fit:contain; display:block;
  pointer-events:none; user-select:none;
  transition: transform .1s ease, filter .15s ease, box-shadow .15s ease;
  filter: drop-shadow(0 6px 0 #2a1806) drop-shadow(0 12px 18px rgba(0,0,0,.35));
}
.pngBtn:hover img{
  filter: brightness(1.05) drop-shadow(0 6px 0 #2a1806) drop-shadow(0 12px 18px rgba(0,0,0,.35));
}
.pngBtn:active img{
  transform: translateY(3px);
  filter: brightness(.95) drop-shadow(0 4px 0 #2a1806) drop-shadow(0 12px 18px rgba(0,0,0,.45));
}

/* Бонус-кнопка внутри пергамента — в потоке, по центру */
.paper .bonusBtn,
.paper .bonusbtn{               /* оба варианта класса на всякий */
  position: static;             /* ВАЖНО: НЕ absolute */
  display:block;
  margin-top:12px;
  width:180px; height:40px;
  align-self:center;            /* центр в flex-контейнере .paper-content */
  z-index:1;
}

.left_palm {
  position: absolute;
  bottom: 0;
  left: 0; /* или где тебе нужно */
  width: 220px;
  height: auto;
  display: none; /* по умолчанию скрыта */
  pointer-events: none;
  user-select: none;
  z-index: 5; /* чтобы была под контентом или над ним */
}

.right_palm {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 220px;
  height: auto;
  display: none; /* по умолчанию скрыта */
  pointer-events: none;
  user-select: none;
  z-index: 5; /* чтобы была под контентом или над ним */
}

.candle_pc {
  position: absolute;
  left: 0px;     /* px ОБЯЗАТЕЛЬНО */
  bottom: 0;
  width: 100px;
  height: auto;
  display: none;   /* скрыта на мобилке */
  pointer-events: none;
  user-select: none;
  z-index: 130;    /* выше, чем z-[121] у сундука/золота */
}

.skull {
  position: absolute;
  left: 0px;     /* px ОБЯЗАТЕЛЬНО */
  bottom: 50;
  width: 100px;
  height: auto;
  display: none;   /* скрыта на мобилке */
  pointer-events: none;
  user-select: none;
  z-index: 130;    /* выше, чем z-[121] у сундука/золота */
}


/* 💻 показываем только на десктопе */
@media (min-width: 1024px) {
  .left_palm,
  .right_palm,
  .candle_pc {
    display: block;
  }
}



.stars-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
}

.star {
  position: absolute;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 1.5s ease, transform 1.5s ease;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.7));
}

.star.active {
  opacity: 1;
  transform: scale(1);
}




/* ===== Оверлей-осьминог ===== */
#wheelOverlay{
  --overlay-scale: 2.0;
  position:absolute;
  left:49%; top:50%;
  width:100%; height:100%;
  transform:translate(-49.5%,-58.5%) scale(var(--overlay-scale));
  transform-origin:center;
  object-fit:contain;
  pointer-events:none;
  z-index:20;
  user-select:none;
}

/* Маленькие экраны */
@media (max-width:420px){
  #wheelOverlay{ --overlay-scale: 1.2; }
}



/* Ужимаем инпут и кнопки внутри пергамента */
.paper .input,
.paper .btn,
.paper .btn.ghost,
.paper-title {
  width: 90%;              /* было 100% — теперь они уже и точно не вылезут */
  max-width: 400px;        /* ограничим максимум, чтобы не растягивались слишком */
  margin-inline: auto;     /* центрируем горизонтально */
  box-sizing: border-box;
}

/* Можно чуть уменьшить шрифт и паддинги для гармонии */
.paper .input {
  padding: 8px 10px;
  font-size: clamp(13px, 3.5cqw, 15px);
}

.paper .btn,
.paper .btn.ghost {
  padding: 8px 12px;
  font-size: clamp(12px, 3.8cqw, 16px);
}




/* Показываем декоративки на ПК (исправили запятую и добавили .skull) */
@media (min-width: 1024px) {
  .left_palm,
  .right_palm,
  .candle_pc,
  .skull {
    display: block;
  }
}

/* Череп: базовые стили + валидные единицы */
.skull {
  position: absolute;
  left: 120px;        /* подбери нужную позицию */
  bottom: 130px;       /* px ОБЯЗАТЕЛЬНО */
  width: 150px;
  height: auto;
  pointer-events: none;
  user-select: none;
  z-index: 130;       /* внутри #goldStack будет выше золота/свеч */
}

/* Если нужно поверх сундука/шапки — подними родителя (#goldStack) выше сундука */
#goldStack { z-index: 130 !important; }  /* или измени класс на z-[130] в HTML */



@media (min-width: 1024px) {
  .paper .input,
  .paper .btn,
  .paper .btn.ghost,
  .paper-title{
    width: 100%;
    max-width: 600px;   /* было 240px */
    margin-inline: auto;
    font-size: 23px;

  }

  .paper .brand {
    font-size: 55px !important;
  }

  .paper .hint {
    margin-top: 0px !important;
    font-size: 25px;
  }


  /* Кнопка «на почту»: у тебя стоит font-size: 12px !important — перекрываем */
  .paper .mail-btn{
    width: 600px;
    height: 75px;
    font-size: clamp(12px, 3.8cqw, 18px) !important;
    padding: 12px 44px 12px 14px;
    margin-top: 40px;
  }
  .paper .bonusBtn{
    display:block;
    width: 400px;
    height: 90px;
    margin: 12px auto 0;     /* центр по блочной модели */
    align-self: center;       /* если родитель flex */
    justify-self: center;     /* если родитель grid */
    margin-top: 50px !important; 
  }
  /* на всякий — чтобы внутренняя картинка не добавляла «случайных» инлайновых отступов */
  .paper .bonusBtn img{ display:block; margin:0 auto; }
}



/* держим PNG-кнопку в пределах карточки */
.paper .bonusBtn { 
  display:block;
  width: min(90%, 340px);   /* вместо фикс 650px */
  height: auto;
  margin: 12px auto 0;
}
.paper .bonusBtn img{
  display:block;
  width:30%;
  height:auto;
}

/* кнопка-почта не раздвигает карточку */
.paper .mail-btn{
  max-width: min(90%, 620px);
  margin-inline: auto;
}

/* на ПК сам пергамент чуть шире, но безопасно */
@media (min-width: 1024px){
  #winCard{ width: min(80vw, 720px);} /* под себя подберёшь 680–800px */
}











/* 1) На ПК увеличиваем карточку РАЗМЕРОМ, а не scale() */
@media (min-width: 1024px) {
  #winCard{
    width: min(80vw, 720px);           /* подгони 680–820px при желании */
    transform: translate(-50%, -50%);  /* без scale — чтобы типографика не «ломалась» */
  }
  #winWrap.active #winCard{
    transform: translate(-50%, -50%);
  }

  .close-btn,
  #winClose {
    position: absolute;
    top: 150px !important;
    right: 0px !important;
  }

}

/* 2) Задаём «безопасную область» внутри пергамента (куда можно класть контент) */
#winCard{
  --padX: 9%;        /* внутренние поля слева/справа */
  --padTop: 11%;     /* сверху */
  --padBottom: 18%;  /* снизу (под кнопки/печати) */
}

.paper{ position: relative; width: 100%; height: 100%; }

.paper > img{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  display: block; pointer-events: none;
}

/* ВОТ ТУТ мы ограничиваем текст рамками пергамента */
.paper-content{
  position: absolute;
  left: var(--padX);
  right: var(--padX);
  top: var(--padTop);
  bottom: var(--padBottom);

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  overflow: hidden;          /* ничего не вылезет за края */
  overflow-wrap: anywhere;   /* перенос длинных слов */
  word-break: normal;
  hyphens: auto;
}

/* 3) Типографика — аккуратные клампы от контейнера (cqw/cqh работают с #winCard) */
.paper .brand{
  font-size: clamp(25px, 6cqw, 32px);
  line-height: 1.1;
  text-wrap: balance;
}
.paper .bonus{
  font-size: clamp(20px, 4cqw, 20px);
  line-height: 1.05;
}
.paper .subtitle{
  font-size: clamp(20px, 6cqw, 20px);
  line-height: 1.15;
}

/* 4) Кнопки внутрь «безопасной области» и без вываливания по ширине */
.paper .bonusBtn{
  display: block;
  width: min(85%, 520px);   /* не шире safe-области */
  margin: 12px auto 0;
}
.paper .bonusBtn img{
  display: block;
  width: 100%;
  height: auto;
}
.paper .mail-btn{
  width: min(85%, 450px);
  margin-inline: auto;
}

/* 5) (опционально) Включить визуальный контур safe-области для проверки */
#winCard.debug .paper-content{
  outline: 1px dashed rgba(255,0,0,.35);
}



.wheel-rotor{
  position:absolute; inset:0;
  will-change: transform;
  /* Точная настройка центра изображения, если PNG не идеально обрезан */
  --dx: 0px;   /* смещение центра вправо(+) / влево(-) */
  --dy: -2px;   /* смещение центра вниз(+) / вверх(-)  */
  transform-origin: calc(50% + var(--dx)) calc(50% + var(--dy));
  z-index:10;
}

/* Само изображение заполняет box без лишних сдвигов */
#wheelImg{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:contain; display:block; pointer-events:none;
  /* маска оставляем, если нужна, она не изменяет transform-origin */
  -webkit-mask-image: radial-gradient(circle closest-side, #000 99%, transparent 100%);
          mask-image: radial-gradient(circle closest-side, #000 99%, transparent 100%);
  -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
  -webkit-mask-position:50% 50%; mask-position:50% 50%;
  -webkit-mask-size:100% 100%; mask-size:100% 100%;
}



/* Кнопка-крестик */
.close-btn,
#winClose {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  z-index: 10;
  pointer-events: auto;    /* важно */
  background: transparent; /* если иконка как background-image */
  border: 0;
}

/* если у вас иконка внутри, тоже убедитесь, что она кликабельна */
#winClose img, #winClose svg {
  pointer-events: none;    /* чтобы клики шли на кнопку, а не на содержимое */
}

чтобы не «тащились» картинки и не выделялся текст при драге
.no-select { user-select: none; }
#carousel img { pointer-events: none; }

/* отключение snap на автопрокрутке */
#carousel.no-snap { scroll-snap-type: none; }

/* курсор при драге */
#carousel .dragging { cursor: grabbing; }












/* === Два «пергаментных» окошка с бонусами === */
.parchment-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  max-width: 860px;
  margin: 8px auto 0;
}

@media (min-width: 1024px){
  .parchment-grid{
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

.parchment-card{
  position: relative;
  padding: 14px 14px 52px 14px; /* место под CTA снизу */
  border-radius: 14px;
  background:
    linear-gradient(0deg, rgba(255,255,255,.6), rgba(255,255,255,.6)),
    url('/assets/decore/parchment-tile.jpg') center/cover no-repeat;
  box-shadow:
    0 2px 10px rgba(0,0,0,.25) inset,
    0 8px 24px rgba(0,0,0,.25);
  color:#2b2100;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
  overflow: hidden;
  min-height: 180px;
}

.parchment-card::before{
  content:"";
  position:absolute; inset:0;
  background:
    url('/assets/decore/parchment-edge.png') center/100% 100% no-repeat;
  opacity:.25;
  pointer-events:none;
}

.parchment-h{
  font-family:'Noto Serif', serif;
  font-weight: 800;
  font-size: clamp(16px, 4.4cqw, 22px);
  line-height:1.15;
  letter-spacing:.01em;
}

.parchment-bonus{
  margin-top: 6px;
  font-weight: 900;
  font-size: clamp(22px, 7.2cqw, 36px);
  line-height:1.08;
}

.parchment-sub{
  margin-top: 6px;
  color:#5a4300;
  font-weight: 600;
  font-size: clamp(12px, 3.6cqw, 15px);
  line-height:1.15;
}

/* CTA внутри карточки (кнопка-картинка или обычная) */
.parchment-cta{
  position: absolute;
  left: 14px; right: 14px; bottom: 12px;
  display:flex; gap:8px; align-items:center; justify-content:center;
}

.parchment-cta .pngBtn{
  width: 100%;
  max-width: 260px;
  height: 44px;
}

.parchment-cta .btn{
  width: 100%;
  max-width: 260px;
  height: 44px;
  background:#1b1b1b; color:#fff; border-radius:12px; border:0;
  font-weight:800; cursor:pointer;
}

/* компактнее на очень узких карточках внутри модалки */
@container (max-width: 360px){
  .parchment-card{ padding: 12px 12px 48px 12px; }
  .parchment-cta .pngBtn, .parchment-cta .btn{ height: 40px; }
}


@media (min-width: 1024px) {
  .paper .bonus {
    font-size: 50px !important;   /* или clamp, если хочешь адаптивно */
    line-height: 1.05;
  }

  .paper .subtitle {
    font-size: 50px !important;   /* подбери комфортное значение */
    line-height: 1.15;
  }
  .paper .plus{
    font-size: 40px !important;   /* подбери комфортное значение */
    line-height: 1.15;
  }
}
