@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@200..900&display=swap');

:root{
  --font-display: "Unbounded", sans-serif;
  --font-body: "Unbounded", sans-serif;

  --white: #fff;
  --text: rgba(255,255,255,.92);

  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --radius: 22px;

  --violet: #7b1fa2;
  --violet-2: #6a0e8f;
  --pink: #ff3ecb;

  /* подгоняй под lights.png */
  --lights-border: 22px;
  --lights-slice: 48;

  /* tree border высота (под tree.png) */
  --tree-h: 18px;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }

body{
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: #2a0733 url("../img/background.webp") center / cover no-repeat fixed;
  position: relative;
}

body::before{
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(#7a2c9161, #7a2c91d4);
  pointer-events: none;
  z-index: 0;
}

.wrap{
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 40px;
  position: relative;
  z-index: 1;

  /* чтобы по высоте контент уверенно влезал */
  min-height: 100dvh;
}

/* ===== LEFT FEATURES (fixed so they don't shift center) ===== */
.features{
  position: fixed;
  z-index: 2;
  top: 120px;

  /* держим слева от центрального блока, но НЕ уезжаем за экран */
  left: max(10px, calc(50% - 490px - 250px));

  display: grid;
  gap: 14px;
  width: 220px;
  pointer-events: none;
}

/* твоя доработка размеров фичей (оставил, но заскоупил, чтобы не ломать другие .feature) */
.features img.feature{
  width: 300px;
  max-width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 28px rgba(0,0,0,.25));
}

/* ===== Screens ===== */
.screen{ display: block; }
body[data-state="final"] .screen--game{ display: none; }
body[data-state="final"] .screen--final{
  height: 100vh;
  display: flex;
  align-items: center;
}
.screen--final[hidden]{ display:none !important; }

/* ===== HERO ===== */
.hero{
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: 14px 10px 6px;
}

/* фикс: было (max-width:991) без px */
@media (max-width: 991px){
  .hero{ padding: 0; }
}

.hero__inner{
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.hero__logo{
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 12px 20px rgba(0,0,0,.35));
}

.hero__title{
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  font-size: clamp(22px, 3vw, 34px);
  text-shadow: 0 18px 40px rgba(0,0,0,.45);
}

.hero__accent{
  background: linear-gradient(180deg, #ff9719, #ff9719 40%, #ff9719);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.balancePill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgb(163 58 193);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16), 0 14px 35px rgba(0,0,0,.22);
  font-weight: 900;
  letter-spacing: .2px;
}

/* ===== SLOT AREA ===== */
.slotArea{
  margin-top: 12px;
  display: grid;
  justify-items: center;
  gap: 12px;
}

/* outer border with lights.png repeat */
.lightsFrame{
  width: 100%;
  max-width: 700px;
  border-radius: calc(var(--radius) + 8px);
  border: var(--lights-border) solid transparent;
  border-image: url("../img/lights.png") var(--lights-slice) round;
  filter: drop-shadow(0 28px 60px rgba(0,0,0,.35));
  position: relative; /* нужно для псевдоэлементов */
}

.slotPanel{
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(123, 31, 162, .80), rgba(90, 10, 106, .72));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
  overflow: hidden;
}

/* ===== SLOT GRID BACKGROUND (оставил твои красивые подложки) ===== */
.slotGrid{
  --cols: 6;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: 8px;
  padding: 14px 14px 10px;
  position: relative;
  isolation: isolate;
}

.slotGrid::before{
  content:"";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(700px 420px at 30% 0%, rgba(255,255,255,.10), transparent 60%),
    radial-gradient(600px 420px at 70% 0%, rgba(255,255,255,.07), transparent 60%),
    linear-gradient(to bottom, rgba(255,255,255,.10), rgba(0,0,0,.10));
  pointer-events: none;
  z-index: 0;
}

/* vertical separators (like reels) */
.slotGrid::after{
  content:"";
  position: absolute;
  inset: 12px 14px 54px 14px;
  background:
    linear-gradient(to right,
      rgba(255,255,255,.10) 0, rgba(255,255,255,.10) 1px, transparent 1px) 0 0 / calc(100% / var(--cols)) 100%;
  pointer-events: none;
  opacity: .65;
  z-index: 0;
}

/* ====== ТВОЙ СТАРЫЙ GRID (cell) — оставил как “fallback”, но БЕЗ дерганной анимации ====== */
.cell{
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  z-index: 1;
}

/* ===== Новый “серьезный” рендер: reels (если JS строит .reel...) ===== */
.reel{
  position: relative;
  z-index: 1;
}

.reel__window{
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255,255,255,.06);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);

  /* ключ: 5 квадратов по высоте */
  aspect-ratio: 1 / 5;
}

.reel__strip{
  display: flex;
  flex-direction: column;
  will-change: transform;
  transform: translate3d(0,0,0);
}

.reel__item{
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

/* общие символы (и для cell, и для reel) */
.sym{
  width: 82%;
  height: 82%;
  border-radius: 18px;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.20), transparent 55%);
  display: grid;
  place-items: center;
  position: relative;
  transform: translateZ(0);
}

.symImg{
  width: 80%;
  height: 80%;
  object-fit: contain;
  filter: drop-shadow(0 16px 24px rgba(0,0,0,.35));
  transform: translateZ(0);
  will-change: transform, filter, opacity;
}

/* motion blur только для reel-анимации */
.reel.is-moving .symImg{
  filter: blur(1.6px) saturate(1.15) drop-shadow(0 12px 18px rgba(0,0,0,.28));
  opacity: .92;
}

/* ===== Collect bar ===== */
.collectBar{
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 14px 12px;
  background: rgba(60, 0, 82, .35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10);
}

.collectTitle{
  font-weight: 900;
  color: rgba(255,255,255,.90);
}

.collectRow{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  min-height: 34px;
}

.collectItem{
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.10);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
  display: grid;
  place-items: center;
}

.collectItem img{
  width: 80%;
  height: 80%;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,.30));
}

/* ===== Spin button image ===== */
.spinBtn{
  width: min(360px, 100%);
  height: 64px;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  background: url("../img/button.png") center / contain no-repeat;
  filter: drop-shadow(0 16px 32px rgba(0,0,0,.28));
  transition: transform .15s ease, filter .15s ease;

  /* твоя доработка: пульсация */
  animation: strong-pulse 1.5s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes strong-pulse{
  0%, 100%{ transform: scale(1); opacity: 1; }
  50%{ transform: scale(1.1); opacity: 0.9; }
}

.spinBtn:hover{
  transform: translateY(-1px);
  filter: drop-shadow(0 18px 34px rgba(0,0,0,.34));
}

.spinBtn:disabled{
  cursor: not-allowed;
  opacity: .65;
  transform: none;
  filter: drop-shadow(0 12px 20px rgba(0,0,0,.25));
  animation: none;
}

.smallNote{
  margin: 0;
  text-align: center;
  color: rgba(255,255,255,.85);
  font-size: 13px;
  text-shadow: 0 10px 24px rgba(0,0,0,.35);
}

/* ===== FINAL ===== */
.screen--final{
  padding-top: 10px;
}

.finalTop{
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 10px;
}

.finalTitle{
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 34px);
  text-shadow: 0 18px 40px rgba(0,0,0,.45);
}

.chance{
  display: inline-block;
  margin-left: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgb(163 58 193);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
  color: #fff;
}

.finalLead{
  margin: 0;
  font-weight: 700;
  color: rgba(255,255,255,.90);
}

.depositBox{
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,.20);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 18px 55px rgba(0,0,0,.28);
  backdrop-filter: blur(8px);
}

.depositBox__label{
  font-weight: 900;
  text-align: left;
}

.depositBox__old{
  font-weight: 900;
  font-size: 34px;
  color: rgba(255,255,255,.92);
  position: relative;
  line-height: 1;
}

.depositBox__old s{
  position: relative;
  text-decoration: none;
}

.depositBox__old s::before{
  content: "";
  width: 100%;
  height: 3px;
  background: #ed0ec4;
  position: absolute;
  top: 20px;
  transform: rotate(-14deg);
}

.depositBox__new{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  color: #fff;
  line-height: 1;
}

.cta{
  width: min(420px, 100%);
  height: 64px;
  border-radius: 999px;
  text-decoration: none;
  display: grid;
  place-items: center;
  background: url("../img/button-2.png") center / contain no-repeat;
  filter: drop-shadow(0 16px 32px rgba(0,0,0,.28));
  transition: transform .15s ease, filter .15s ease;
}

.cta__text{
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .6px;
  color: #fff;
  text-shadow: 0 10px 24px rgba(0,0,0,.35);
}

.cta:hover{
  transform: translateY(-1px);
  filter: drop-shadow(0 18px 34px rgba(0,0,0,.34));
}

.pay{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.pay img{
  height: 22px;
  width: auto;
  background: rgba(255,255,255,.92);
  padding: 2px 6px;
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(0,0,0,.24);
}

/* Timer card with tree top border (repeat) */
.timerCard{
  width: min(520px, 100%);
  background: rgba(255,255,255,.92);
  border-radius: 16px;
  padding: calc(14px + var(--tree-h)) 16px 14px;
  box-shadow: 0 18px 55px rgba(0,0,0,.28);
  position: relative;
  overflow: hidden;
}

.timerCard::before{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--tree-h);
  background: url("../img/tree.png") top left / auto 100% repeat-x;
  opacity: .98;
}

.timerCard__label{
  color: rgba(40, 0, 60, .80);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-size: 12px;
}

.timerDigits{
  margin-top: 10px;
  display: inline-flex;
  align-items: flex-end;
  gap: 10px;
  color: #7a17b9;
  justify-content: center;
}

.tCol{
  display: grid;
  gap: 6px;
  justify-items: center;
  min-width: 82px;
}

.tNum{
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
}

.tLbl{
  font-weight: 900;
  font-size: 12px;
  color: rgba(40, 0, 60, .75);
  text-transform: uppercase;
  letter-spacing: .6px;
}

.tSep{
  font-family: var(--font-display);
  font-size: 42px;
  line-height: 1;
  transform: translateY(-6px);
  opacity: .75;
}

/* ===== Responsive ===== */
@media (max-width: 980px){
  .features{
    left: 10px;
    top: 120px;
    width: 190px;
    opacity: .95;
  }
}

@media (max-width: 760px){
  .features{
    display: none; /* твоя доработка: скрыть фичи */
  }

  /* твоя доработка размера фичи на мобилке */
  img.feature{
    width: 170px;
  }
}

@media (max-width: 560px){
  .wrap{ width: min(520px, calc(100% - 18px)); padding: 16px 0 30px; }

  .hero__inner{ gap: 10px; }
  .hero__logo{ width: 44px; height: 44px; }

  .depositBox{
    grid-template-columns: 1fr;
    text-align: center;
    gap: 8px;
  }
  .depositBox__label{ text-align: center; }
  .depositBox__old, .depositBox__new{ justify-self: center; }

  .slotGrid{ padding: 12px 12px 8px; }
  .slotGrid::after{ inset: 10px 12px 52px 12px; }

  .tNum{ font-size: 38px; }
  .tCol{ min-width: 64px; }
}

/* На низких экранах ужимаем вертикальные отступы/размеры */
@media (max-height: 760px){
  :root{
    --lights-border: 16px; /* рамка гирлянды тоньше -> меньше высота */
  }

  .wrap{ padding: 14px 0 18px; }
  .hero{ gap: 6px; padding: 10px 8px 2px; }
  .slotArea{ gap: 8px; margin-top: 6px; }

  /* меньше внутренних паддингов */
  .slotGrid{ padding: 10px 10px 8px; }
  .collectBar{ padding: 8px 10px 10px; }

  /* кнопка чуть ниже по высоте */
  .spinBtn{ height: 56px; }

  /* подсказку можно скрыть, чтобы не съедала высоту */
  .smallNote{ display: none; }
}

/* ещё ниже — скрываем фичи и уменьшаем шапку, чтобы точно влезло */
@media (max-height: 670px){
  .features{ display: none; }

  .hero__logo{ width: 40px; height: 40px; }
  .hero__title{ font-size: 20px; }
}

/* ===== твоя доработка: mobile-only картинка ===== */
img.bg-mb-f{
  display: block;
  margin: 0 auto;
  position: relative;
  top: 0;
  width: 100%;
  padding: 10px;
}

@media (min-width: 760px){
  img.bg-mb-f{ display: none; }
}

/* ===== твоя доработка: lights по бокам ===== */
.lightsFrame::before,
.lightsFrame::after{
  content:"";
  position: absolute;
  top: calc(-1 * var(--lights-border));
  bottom: calc(-1 * var(--lights-border));
  width: calc(var(--lights-border) + 14px);
  pointer-events: none;

  background: url("../img/lights.png") center top / 100% auto repeat-y;
  background-size: auto;
  filter: drop-shadow(0 18px 28px rgba(0,0,0,.28));
  opacity: .95;
}

.lightsFrame::before{
  left: calc(-1 * (var(--lights-border) + 12px));
}

.lightsFrame::after{
  right: calc(-1 * (var(--lights-border) + 12px));
}

@media (prefers-reduced-motion: reduce){
  .reel.is-moving .symImg{ filter: none; opacity: 1; }
  .spinBtn{ animation: none; transition: none; }
  .cta{ transition: none; }
}