/* ════════════════════════════════════════════════════════
   ШРИФТЫ
═══════════════════════════════════════════════════════════ */
@font-face {
  font-family: 'GaliverSans';
  src: url('../fonts/GaliverSans.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'GaliverSans';
  src: url('../fonts/GaliverSansBold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'GaliverSans';
  src: url('../fonts/GaliverSansItalic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: block;
}
@font-face {
  font-family: 'GaliverSans';
  src: url('../fonts/GaliverSansBoldItalic.ttf') format('truetype');
  font-weight: 700;
  font-style: italic;
  font-display: block;
}

/* ════════════════════════════════════════════════════════
   ПЕРЕМЕННЫЕ
═══════════════════════════════════════════════════════════ */
:root {
  --gold:        #E8940B;
  --gold-light:  #F5C842;
  --gold-dim:    #B87209;
  --dark:        #100c05;
  --dark-deep:   #0a0804;
  --white:       #FFFFFF;

  /*
   * --lvw: «логический vw».
   * По умолчанию = 1vw (физический viewport).
   * JavaScript переопределяет до фиксированных px когда включён zoom,
   * чтобы vw-зависимые размеры оставались привязаны к дизайнному 1440px.
   */
  --lvw: 1vw;

  /*
   * На широком экране колесо зависит от ширины.
   * В узком высоком окне нижняя граница размера берётся от высоты,
   * поэтому колесо не становится непропорционально маленьким.
   */
  --wheel-size: clamp(
    300px,
    max(calc(46 * var(--lvw)), calc(72 * var(--lvh, 1vh))),
    900px
  );
  /* Вращающаяся часть — 61.4% от кольца (r_inner_edge / r_outer * 2) */
  --wheel-inner: calc(var(--wheel-size) * 0.614);
  /* Кнопка — 50.2% от вращающейся части */
  --btn-size:    calc(var(--wheel-inner) * 0.502);
}

/* ════════════════════════════════════════════════════════
   БАЗОВЫЕ СТИЛИ
═══════════════════════════════════════════════════════════ */
*,
*::before,
*::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body { width: 100%; height: 100%; overflow: hidden; }


body {
  font-family: 'GaliverSans', sans-serif;
  background: var(--dark-deep);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
}

img    { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ════════════════════════════════════════════════════════
   СЦЕНА
═══════════════════════════════════════════════════════════ */
.scene {
  position: relative;
  width: 100%;
  height: 100svh;
  transform-origin: top left;
  overflow: hidden;
  background: url('../img/full_bg.png') center center / cover no-repeat;
  background-color: var(--dark-deep);
}

/* ════════════════════════════════════════════════════════
   СЛОИ ИЗОБРАЖЕНИЙ
═══════════════════════════════════════════════════════════ */
.layer {
  position: absolute;
  pointer-events: none;
}

/* ── Декорации без персонажа (desktop) ────────────────── */
.layer--decor-desk {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 4;
}

/* ── Отдельный персонаж справа (desktop) ───────────────── */
.layer--char-desk {
  right: 0;
  bottom: 0;
  height: min(100%, calc(65 * var(--lvw)));
  width: auto;
  object-fit: contain;
  object-position: right bottom;
  z-index: 4; /* поверх декора и колеса, под нижними монетами */
  max-width: none;
  transform-origin: right bottom;
  animation: character-pulse 4s ease-in-out infinite;
}

@keyframes character-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.008); }
}

@media (prefers-reduced-motion: reduce) {
  .layer--char-desk {
    animation: none;
  }
}

/* ── Персонаж portrait (mobile) ────────────────────────── */
.layer--char-mob {
  display: none;
  top: 44px;   /* ниже шапки */
  right: -10px;
  height: 48vh;
  max-height: 380px;
  width: auto;
  object-fit: contain;
  object-position: right top;
  z-index: 1;
}

.layer--mobile-chest,
.layer--mobile-relic,
.layer--mobile-pot {
  display: none;
}

/* ── Жук — на монетах слева, поверх всего ────────────────── */
.layer--juk {
  bottom: clamp(20px, 4vh, 60px);
  left: clamp(20px, 8vw, 140px);
  height: clamp(150px, 23vh, 300px);
  width: auto;
  object-fit: contain;
  z-index: 6;
}

/* ── Нижний декор ───────────────────────────────────────── */
.layer--bottom {
  bottom: 0;
  left: 0;
  right: 0;
  height: clamp(100px, 17vh, 210px);
  z-index: 5;
}

.bottom-img {
  position: absolute;
  bottom: 0;
}

/* Полная панорама (жук, книга, монеты) */
.bottom-img--bg {
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* Левые монеты (поверх общей панорамы) */
.bottom-img--left {
  left: 0;
  height: 95%;
  width: auto;
  object-fit: contain;
  object-position: left bottom;
}

/* Правые монеты */
.bottom-img--right {
  right: 0;
  height: 90%;
  width: auto;
  object-fit: contain;
  object-position: right bottom;
}

/* Книга в центре */
.bottom-img--book {
  left: 50%;
  transform: translateX(-50%);
  height: 75%;
  width: auto;
  object-fit: contain;
  object-position: center bottom;
  z-index: 1;
}

/* ════════════════════════════════════════════════════════
   МОБИЛЬНАЯ ШАПКА
═══════════════════════════════════════════════════════════ */
.mobile-header {
  display: none;
  position: relative;
  z-index: 10;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px;
  background: rgba(10,8,4,0.75);
  border-bottom: 1px solid rgba(232,148,11,0.15);
}

.burger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

/* ════════════════════════════════════════════════════════
   ЛОГО
═══════════════════════════════════════════════════════════ */
.logo {
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 0.5vw, 10px);
}

.logo-icon {
  width: clamp(22px, 2.1vw, 40px);
  height: auto;
  flex-shrink: 0;
}

.logo-text {
  font-size: clamp(15px, 1.6vw, 30px);
  font-weight: 700;
  font-style: italic;
  color: var(--gold);
  letter-spacing: 0.04em;
  line-height: 1;
}

/* Desktop лого — отступ снизу */
.logo--desktop {
  margin-bottom: clamp(28px, 4vh, 64px);
}

.logo-img {
  height: clamp(28px, 3vw, 56px);
  width: auto;
  display: block;
}

/* ════════════════════════════════════════════════════════
   ОСНОВНОЙ МАКЕТ
═══════════════════════════════════════════════════════════ */
.layout {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: row;
  align-items: center;
  min-height: 100%;
  padding: clamp(16px, 3vw, 72px) clamp(16px, 5vw, 96px);
  padding-bottom: clamp(100px, 20vh, 240px); /* освобождаем место под монеты */
  gap: 0;
}

/* ════════════════════════════════════════════════════════
   ИНФО-КОЛОНКА
═══════════════════════════════════════════════════════════ */
.info-col {
  flex: 0 0 clamp(200px, 22vw, 420px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: clamp(16px, 2vh, 32px);
  align-self: flex-start;
  position: relative;
  z-index: 3;
}

/* WIN PRIZES */
.win-prizes {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.6vw, 14px);
  margin-bottom: clamp(4px, 0.6vh, 12px);
}

.win-line {
  display: block;
  width: clamp(36px, 4.5vw, 87px);
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(232,148,11,0.8), transparent);
}

.win-text {
  font-size: clamp(7px, 0.65vw, 13px);
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
  white-space: nowrap;
}

/* Главный заголовок */
.main-title {
  font-size: clamp(38px, 5.6vw, 108px);
  font-weight: 700;
  font-style: normal;
  line-height: 0.92;
  color: var(--gold);
  background: linear-gradient(
    90deg,
    #ffad24 0%,
    #ffc85a 48%,
    #fff1bd 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  text-shadow:
    0 0 34px rgba(255, 180, 45, 0.55),
    2px 3px 0 rgba(0, 0, 0, 0.28);
  margin-bottom: clamp(12px, 2.2vh, 36px);
}

.excl { color: var(--gold-light); }

/* Бонусные карточки */
.bonus-cards {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.9vh, 14px);
  width: 100%;
  max-width: clamp(180px, 16.7vw, 320px);
}

.bonus-card {
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.bonus-card.revealed {
  opacity: 1;
  transform: translateX(0);
}

.bonus-card img { width: 100%; height: auto; display: block; }

/* ════════════════════════════════════════════════════════
   КОЛОНКА КОЛЕСА
═══════════════════════════════════════════════════════════ */
.wheel-col {
  position: absolute;
  /*
   * bottom: 17% логического viewport height (≈160px при 900px).
   * --lvh устанавливается JS при zoom, иначе = 1vh (CSS default).
   */
  bottom: calc(17 * var(--lvh, 1vh));
  /* Центр колеса остаётся на 46% сцены при любом масштабе */
  left: 46%;
  transform: translateX(-50%);
  width: var(--wheel-size);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  z-index: 3;
  pointer-events: none;
}

/* ─── Обёртка колеса ─────────────────────────────────── */
.wheel-wrap {
  position: relative;
  width: var(--wheel-size);
  height: var(--wheel-size);
  flex-shrink: 0;
  pointer-events: auto;
  /* overlap монет ≈ 14% логического vh (≈130px при 900px) */
  margin-bottom: calc(-14 * var(--lvh, 1vh));
}

/* Лёгкая пульсация колеса */
@keyframes wheel-pulse {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 18px rgba(255,175,20,0.25)); }
  50%       { transform: scale(1.02); filter: drop-shadow(0 0 38px rgba(255,195,40,0.55)); }
}

.wheel-wrap {
  animation: wheel-pulse 3.2s ease-in-out infinite;
}

.wheel-wrap.spinning {
  animation: none;
}

/* Тонкое свечение за кольцом */
.wheel-wrap::before {
  content: '';
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255,175,20,0.22) 0%,
    rgba(200,110,8,0.10) 50%,
    transparent 72%);
  pointer-events: none;
  z-index: 0;
}

/* Вращающаяся часть (сегменты) — нижний слой */
.wheel-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--wheel-inner);
  height: var(--wheel-inner);
  object-fit: contain;
  z-index: 1;
  will-change: transform;
  transform-origin: center center;
  /* Transition переопределяется JS перед спином */
  transition: none;
  user-select: none;
}

/* Статичное кольцо/рамка — поверх вращения */
.wheel-ring-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;
  user-select: none;
}

/* ─── Кнопка спина ───────────────────────────────────── */
.spin-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--btn-size);
  height: var(--btn-size);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  padding: 0;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.spin-btn > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
  user-select: none;
}

.spin-label {
  position: relative;
  z-index: 1;
  font-size: clamp(8px, 0.85vw, 15px);
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.09em;
  color: var(--white);
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
  pointer-events: none;
  user-select: none;
}

.spin-btn:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.06);
  filter: brightness(1.15) drop-shadow(0 0 14px rgba(255,175,40,0.75));
}

.spin-btn:active:not(:disabled) {
  transform: translate(-50%, -50%) scale(0.97);
}

.spin-btn:disabled {
  cursor: not-allowed;
  filter: brightness(0.65);
  animation: none !important;
}

/* Небольшое покачивание стрелок для привлечения внимания */
@keyframes btn-rock {
  0%, 12%, 100%  { transform: rotate(0deg); }
  28%            { transform: rotate(18deg); }
  44%            { transform: rotate(0deg); }
  60%            { transform: rotate(-18deg); }
  76%            { transform: rotate(0deg); }
}

.spin-btn:not(:disabled) > img {
  animation: btn-rock 3.4s ease-in-out infinite;
}

.spin-btn:disabled > img {
  animation: none;
}

/* Пульсирующее свечение пока не крутится */
@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(255,170,30,0.5)); }
  50%       { filter: drop-shadow(0 0 20px rgba(255,200,60,0.9)); }
}

.spin-btn:not(:disabled) {
  animation: pulse-glow 2.5s ease-in-out infinite;
}

/* ════════════════════════════════════════════════════════
   БЕЙДЖ «ПОПЫТКИ ОСТАЛОСЬ»
═══════════════════════════════════════════════════════════ */
.attempts {
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 0.5vw, 10px);
  background: rgba(8,5,1,0.88);
  border: 1.5px solid rgba(232,148,11,0.3);
  border-radius: 100px;
  padding: clamp(4px, 0.5vh, 8px) clamp(12px, 1vw, 20px) clamp(4px, 0.5vh, 8px) clamp(5px, 0.45vh, 8px);
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0,0,0,0.6);
  margin-bottom: clamp(10px, 1.5vh, 24px);
  z-index: 7;
  position: relative;
}

.attempts-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(24px, 2.2vw, 40px);
  height: clamp(24px, 2.2vw, 40px);
  background: var(--gold);
  border-radius: 50%;
  font-size: clamp(11px, 1vw, 18px);
  font-weight: 700;
  color: var(--dark);
  flex-shrink: 0;
}

.attempts-label {
  font-size: clamp(9px, 0.78vw, 14px);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--white);
  text-transform: uppercase;
}

/* ════════════════════════════════════════════════════════
   ПОПАП
═══════════════════════════════════════════════════════════ */
.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4,2,0,0.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.popup-overlay[hidden] { display: none !important; }

.popup-overlay.is-visible { opacity: 1; }

/* ─── Попап-карточка ─────────────────────────────────── */
.popup {
  position: relative;
  width: clamp(300px, 90vw, 568px);
  max-height: 95svh;
  overflow: hidden;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Фон — изображение back.png */
.popup-bg {
  position: absolute;
  inset: 0;
  background: url('../img/back.png') center center / 100% 100% no-repeat;
  z-index: 0;
  border-radius: 6px;
}

/* Контент поверх фона */
.popup-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: clamp(36px, 7%, 80px) clamp(16px, 7%, 48px) clamp(20px, 5%, 40px);
}

.popup-congrats {
  font-size: clamp(11px, 1.1vw, 18px);
  color: var(--gold-light);
  letter-spacing: 0.06em;
  text-align: center;
  margin-bottom: clamp(6px, 1vh, 12px);
}

.popup-title {
  font-size: clamp(24px, 3.8vw, 56px);
  font-weight: 700;
  color: var(--white);
  text-align: center;
  line-height: 1.08;
  margin-bottom: clamp(14px, 3vh, 32px);
}

/* ─── Призовые карточки ──────────────────────────────── */
.popup-prizes {
  display: flex;
  gap: clamp(8px, 2vw, 16px);
  width: 100%;
  justify-content: center;
  margin-bottom: clamp(14px, 2.8vh, 30px);
}

.popup-prize {
  flex: 1;
  max-width: 196px;
  position: relative;
  aspect-ratio: 195 / 280;
  background: rgba(12,8,2,0.72);
  border-top: 2px solid rgba(200,130,10,0.4);
  overflow: hidden;
  border-radius: 4px;
}

.popup-prize-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.popup-prize-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popup-prize-val {
  position: absolute;
  top: 17%;
  left: 0;
  right: 0;
  z-index: 2;
  font-size: clamp(24px, 3.5vw, 48px);
  font-weight: 700;
  color: var(--white);
  text-align: center;
  line-height: 1;
}

.popup-prize-lbl {
  position: absolute;
  top: 30%;
  left: 0;
  right: 0;
  z-index: 2;
  font-size: clamp(9px, 0.85vw, 15px);
  color: rgba(255,255,255,0.7);
  text-align: center;
  letter-spacing: 0.04em;
}

/* ─── Кнопка «Забрать» ───────────────────────────────── */
.popup-claim {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(150px, 45%, 217px);
  height: clamp(44px, 5.5vh, 64px);
  background: linear-gradient(180deg, #F5C842 0%, #D4810A 55%, #B06808 100%);
  border-radius: 8px;
  font-size: clamp(14px, 1.2vw, 20px);
  font-weight: 700;
  font-style: normal;
  color: var(--white);
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
  letter-spacing: 0.05em;
  box-shadow:
    0 2px 0 rgba(0,0,0,0.5),
    0 0 22px rgba(232,148,11,0.5);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.popup-claim:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.popup-claim:active {
  transform: translateY(1px);
}

/* Анимация появления попапа */
@keyframes popup-in {
  from { transform: scale(0.88) translateY(18px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);    opacity: 1; }
}

.popup-overlay.is-visible .popup {
  animation: popup-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ════════════════════════════════════════════════════════
   УТИЛИТЫ
═══════════════════════════════════════════════════════════ */
.desk-only { display: flex; }
.mob-only  { display: none; }

/* ════════════════════════════════════════════════════════
   BREAKPOINT: МОБИЛКА (≤ 767px)
═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  :root {
    --wheel-size:  min(160vw, 630px);
    --wheel-inner: calc(var(--wheel-size) * 0.614);
    --btn-size:    calc(var(--wheel-inner) * 0.502);
  }

  .scene {
    border: 2px solid rgba(245, 190, 65, 0.9);
  }

  /* Десктопную панораму не используем: она давала полосу посередине */
  .layer--decor-desk {
    display: none;
  }

  .layer--char-desk { display: none; }
  .layer--char-mob {
    display: block;
    top: clamp(18px, 3svh, 30px);
    right: clamp(-75px, -27vw, -88px);
    height: min(58svh, 600px);
    max-height: none;
    z-index: 2;
  }

  .layer--mobile-chest,
  .layer--mobile-relic,
  .layer--mobile-pot {
    display: block;
    height: auto;
    max-width: none;
    z-index: 4;
  }

  .layer--mobile-chest {
    top: clamp(270px, 35svh, 255px);
    left: clamp(-98px, -22vw, -34px);
    width: min(90vw, 390px);
  }

  .layer--mobile-relic {
    top: clamp(326px, 42svh, 372px);
    left: clamp(-18px, -3vw, -4px);
    width: min(55vw, 230px);
  }

  .layer--mobile-pot {
    top: clamp(312px, 40svh, 375px);
    right: clamp(-58px, -14vw, -38px);
    width: min(62vw, 270px);
  }

  .layer--juk {
    display: none;
  }

  /* Нижние монеты перекрывают нижнюю часть большого колеса */
  .layer--bottom {
    height: clamp(78px, 13svh, 120px);
  }

  /* Книга уже присутствует в среднем декоративном слое */
  .bottom-img--book  { display: none; }
  .bottom-img--left  { height: 100%; }
  .bottom-img--right { height: 95%; }

  /* Прозрачная шапка поверх первого экрана */
  .mobile-header {
    display: flex;
    position: absolute;
    inset: 0 0 auto;
    justify-content: flex-start;
    padding: clamp(18px, 3.2svh, 26px) 22px 0;
    background: none;
    border: 0;
  }

  .mobile-header .logo {
    order: 1;
  }

  .mobile-header .logo-img {
    height: clamp(27px, 13vw, 40px);
  }

  .mobile-header .burger {
    display: none;
  }

  /* Текстовый блок расположен поверх фоновой композиции */
  .layout {
    flex-direction: column;
    align-items: flex-start;
    min-height: unset;
    padding: clamp(84px, 12svh, 102px) 24px 0;
  }

  .info-col {
    flex: none;
    width: min(62vw, 230px);
    padding: 0;
    align-items: flex-start;
  }

  /* Desktop лого скрыт (есть в шапке) */
  .logo--desktop { display: none; }

  /* Карточки скрыть */
  .desk-only { display: none !important; }

  /* Выигранные плашки появляются по очереди поверх мобильной сцены */
  .bonus-cards {
    position: fixed;
    top: clamp(200px, 24svh, 225px);
    left: 19%;
    z-index: 12;
    width: min(52vw, 112px);
    max-width: none;
    gap: 6px;
    transform: translateX(-50%);
    pointer-events: none;
  }

  .bonus-card {
    display: none;
    width: 100%;
    opacity: 1;
    transform: none;
    border-radius: 0;
  }

  .bonus-card.revealed {
    display: block;
    animation: mobile-prize-in 0.45s ease-out both;
  }

  #card-deposit { order: 1; }
  #card-fs      { order: 2; }

  /* Показать «!» */
  .mob-only  { display: inline; }

  /* Заголовок */
  .main-title {
    font-size: clamp(38px, 12vw, 48px);
    line-height: 0.9;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
  }

  /* WIN PRIZES */
  .win-prizes {
    margin-bottom: 7px;
  }

  .win-line { width: 28px; }
  .win-text { font-size: 8px; }

  /* Большое колесо, намеренно обрезанное по бокам */
  .wheel-col {
    position: absolute;
    top: clamp(250px, 46svh, 405px);
    left: 0;
    bottom: auto;
    width: 100%;
    transform: none;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    pointer-events: auto;
    z-index: auto;
  }

  .wheel-wrap {
    margin: 0;
    /* Колесо закрывает резкие нижние края персонажа и декораций */
    z-index: 6;
  }

  .attempts {
    display: inline-flex;
    position: fixed;
    top: auto;
    bottom: max(340px, env(safe-area-inset-bottom));
    left: 50%;
    z-index: 8;
    margin: 0;
    transform: translateX(-50%);
  }

  .attempts-dot {
    width: 40px;
    height: 40px;
    font-size: 15px;
  }

  .attempts-label { font-size: 12px; }

  /* Попап на мобилке — почти полноэкранный */
  .popup {
    width: 96vw;
    max-height: 92svh;
  }

  .popup-title {
    font-size: clamp(22px, 6.5vw, 32px);
  }

  .popup-prizes { gap: 8px; }

  .popup-prize {
    max-width: 44vw;
  }

  .popup-prize-val {
    font-size: clamp(22px, 7vw, 38px);
  }

  .popup-claim {
    width: min(80%, 200px);
  }
}

@keyframes mobile-prize-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Низкие мобильные экраны: держим центр колеса выше счётчика */
@media (max-width: 767px) and (max-height: 700px) {
  .wheel-col {
    /*
     * Учитываем радиус центральной кнопки и высоту нижнего счётчика:
     * кнопка всегда заканчивается минимум за 16px до плашки попыток.
     */
    top: max(120px, calc(100svh - 77px - 105vw));
  }
}
