/* =====================================================================
   WILD CREO · Колесо фортуни — стилі
   Кольори винесені в змінні: --green — фірмовий лаймовий з логотипа,
   --gold — золото рамки-вінка.
   ===================================================================== */
:root {
  --bg: #04120b;
  --green: #9dff0a;                 /* фірмовий лайм WILD CREO */
  --green-rgb: 157, 255, 10;
  --gold: #f4c64e;
  --gold-rgb: 244, 198, 78;
  --text: #f3f7ef;
  --muted: rgba(243, 247, 239, .72);
  --muted-2: rgba(243, 247, 239, .5);
  --ink: #0b1a03;                   /* темний текст на лаймовому */
  --line: rgba(var(--green-rgb), .22);
  --line-soft: rgba(255, 255, 255, .1);
  --radius: 24px;
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 50% 100%, rgba(var(--green-rgb), .06), transparent 70%),
    var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; }
strong { font-weight: 700; color: var(--text); }
[hidden] { display: none !important; }

.container { width: min(1240px, 100% - 40px); margin-inline: auto; }

/* Шари: фон (0) → сніг (1) → контент (2) → конфеті/вікно (90+).
   Сніг лежить ПІД текстом і не перехоплює кліки. */
.snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}
.header, .hero__inner, main, .footer { position: relative; z-index: 2; }

/* =====================================================================
   ОСНОВНИЙ БЛОК
   ===================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* Жорстко обрізаємо розмитий фон по краях блоку. Без цього Chrome, коли зʼявляється
     картка виграшу з backdrop-filter, «випускає» смугу фону під основний блок. */
  overflow: hidden;
  clip-path: inset(0);
  contain: paint;
}
/* Фон «Зимова нічна казка»: легкий блюр + притемнення, щоб акцент був на колесі й тексті.
   inset з запасом — щоб блюр не давав світлих країв. */
.hero__scene {
  position: absolute;
  inset: 0;
}
.hero__scene::before {
  content: '';
  position: absolute;
  inset: -16px;
  background: url('../assets/bg-winter.jpg') center bottom / cover no-repeat;
  filter: blur(3px) brightness(.68) saturate(.9);
}
/* Мерехтіння зірок і гірлянд — та сама геометрія, що й у зображення фону */
.twinkle {
  position: absolute;
  top: -16px; left: -16px;
  width: calc(100% + 32px);
  height: calc(100% + 32px);
  pointer-events: none;
}
/* Камера: фон темнішає, периферія менш акцентна (фокус — колесо) */
.hero__shade {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--wx, 30%) var(--wy, 55%), rgba(2, 8, 5, .05) 0, rgba(2, 8, 5, .3) 28%, rgba(2, 8, 5, .72) 70%);
}
/* Затемнення для читабельності тексту (рухається разом зі сценою) */
.hero__scene::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 30%, rgba(4, 18, 11, .28) 60%, rgba(4, 18, 11, .38) 100%),
    linear-gradient(180deg, rgba(4, 18, 11, .35) 0%, transparent 20%);
}
/* Плавний перехід фону в темно-зелений наступних блоків. Окремий НЕРУХОМИЙ шар:
   сцена зсувається паралаксом і при скролі, тож градієнт усередині неї «відʼїжджав»
   і внизу зʼявлялась різка межа. Тут він завжди точно на краю блоку. */
.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
    transparent 76%, rgba(4, 18, 11, .22) 83%, rgba(4, 18, 11, .55) 90%,
    rgba(4, 18, 11, .85) 95%, var(--bg) 98.5%, var(--bg) 100%);
  /* на 2px нижче краю: на екранах з високою щільністю останній ряд пікселів
     інакше лишався напівпрозорим і було видно тонку світлу лінію */
  bottom: -2px;
}

/* ---------- Header ---------- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
}
.header__logo img { height: 46px; width: auto; }
.header__right { display: flex; align-items: center; gap: 10px; }
.sound-toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  background: rgba(4, 18, 11, .5);
  backdrop-filter: blur(8px);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .2s ease, color .2s ease, transform .15s ease;
}
.sound-toggle:hover { border-color: var(--green); color: var(--green); }
.sound-toggle:active { transform: scale(.92); }
.sound-toggle .ico-off { display: none; }
.sound-toggle.is-off { color: var(--muted-2); }
.sound-toggle.is-off .ico-on { display: none; }
.sound-toggle.is-off .ico-off { display: block; }
/* звук увімкнено, але браузер чекає дії користувача — іконка мʼяко «дихає» */
.sound-toggle.is-pending { color: var(--muted); }
.sound-toggle.is-pending .ico-on { animation: sndWait 2.2s ease-in-out infinite; }
@keyframes sndWait { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

/* Перемикач мови UA / EN */
.lang-switch {
  flex: none;
  display: inline-flex;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(4, 18, 11, .5);
  backdrop-filter: blur(8px);
}
.lang-switch__btn {
  min-width: 36px;
  height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .25s ease, color .25s ease, box-shadow .25s ease;
}
.lang-switch__btn:hover { color: var(--text); }
.lang-switch__btn.is-active {
  background: var(--green);
  color: var(--ink);
  box-shadow: 0 0 14px rgba(var(--green-rgb), .35);
  cursor: default;
}
.lang-switch__btn:focus-visible, .sound-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* Зміна мови: тексти коротко згасають і проявляються вже новою мовою */
[data-i18n], [data-i18n-html], .cta__hint, #timerTitle, #timerNote,
#result > *, #modalBody > *, .seg-labels { transition: opacity .17s ease; }
.i18n-out [data-i18n], .i18n-out [data-i18n-html], .i18n-out .cta__hint,
.i18n-out #timerTitle, .i18n-out #timerNote, .i18n-out #result > *,
.i18n-out #modalBody > *, .i18n-out .seg-labels { opacity: 0; }
.result__err { margin: 10px 0 0; font-size: 13px; color: #ffcf70; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(4, 18, 11, .5);
  backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

/* ---------- Сітка: колесо зліва, текст + дія справа ---------- */
.hero__inner {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "wheel text"
    "wheel terms"
    "wheel action";
  grid-template-rows: auto auto auto;
  column-gap: 40px;
  align-content: center;
  padding: 8px 0 110px;
}
.hero__wheel  { grid-area: wheel; display: flex; justify-content: center; align-items: center; }
.hero__text   { grid-area: text; align-self: end; }
.hero__terms  { grid-area: terms; }
.hero__action { grid-area: action; align-self: start; margin-top: 30px; }

/* ---------- Текст ---------- */
/* Заголовок: 2–3 рядки, рівний трекінг і рівний міжрядковий інтервал */
.hero__title {
  margin: 0;
  font-size: clamp(30px, 3.4vw, 50px);
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: 0;
  word-spacing: 0;
  text-wrap: balance;
  text-shadow: 0 4px 30px rgba(0, 0, 0, .5);
}
.accent {
  color: var(--green);
  text-shadow: 0 0 30px rgba(var(--green-rgb), .45);
}
.hero__lead {
  margin: 18px 0 0;
  font-size: clamp(16px, 1.5vw, 19px);
  font-weight: 500;
  color: var(--muted);
}
.terms {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
}
.terms li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(4, 18, 11, .55);
  backdrop-filter: blur(8px);
  font-size: 14px;
  color: var(--muted);
}
.terms li::before {
  content: '';
  flex: none;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* ---------- Колесо ----------
   Рамка wheel-frame.png квадратна; її внутрішній отвір має центр
   у точці (49.08%, 51.83%) і діаметр ≈ 66.7% ширини рамки
   (рамка «Різдвяний вінок із золотим маркером»).
   Якщо заміните рамку — оновіть ці три змінні. */
.wheel {
  --cx: 49.08%;
  --cy: 51.83%;
  --d: 66.8%;
  position: relative;
  width: min(100%, 640px);
  aspect-ratio: 1;
  transform-origin: 50% 50%;
}
.wheel.is-spinning { will-change: transform; }
.wheel::before {
  /* мʼяке світіння під колесом */
  content: '';
  position: absolute;
  left: var(--cx); top: var(--cy);
  width: 80%; height: 80%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--gold-rgb), .28), transparent 65%);
  filter: blur(24px);
  opacity: .85;
  transition: opacity .8s ease, transform .8s ease;
}
.wheel.is-spinning::before { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
.wheel.is-win::before { opacity: 1; transform: translate(-50%, -50%) scale(1.14); transition-duration: .4s; }
.wheel__rotor {
  position: absolute;
  left: calc(var(--cx) - var(--d) / 2);
  top: calc(var(--cy) - var(--d) / 2);
  width: var(--d);
  height: var(--d);
  border-radius: 50%;
  transform: rotate(0deg);
  will-change: transform;
}
.wheel__rotor svg { width: 100%; height: 100%; display: block; }
.wheel__frame {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 28px 50px rgba(0, 0, 0, .55));
}
/* Світло рамки (лампочки, відблиски, іскри) — js/fx.js */
/* полотно світла більше за колесо на 9% з кожного боку — магічні частинки
   ширяють і за межами рамки (геометрія перераховується в js/fx.js) */
.wheel__fx {
  position: absolute;
  top: -9%; left: -9%;
  z-index: 3;
  width: 118%;
  height: 118%;
  pointer-events: none;
}
/* Вказівник — окремий шар; точка обертання у кріпленні зверху */
.wheel__pointer {
  position: absolute;
  left: 44.019%;
  top: 10.526%;
  width: 12.281%;
  height: 13.557%;
  z-index: 4;
  max-width: none;
  transform-origin: 49.68% 9.41%;
  pointer-events: none;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .4));
}

/* Текст на секторах */
.seg-value, .seg-caption { font-family: var(--font); }
.seg-value { font-weight: 900; }
.seg-caption { font-size: 13px; font-weight: 700; letter-spacing: .16em; }

/* Виграшний сектор — золотисто-лаймове світіння, інші притемнюються */
.seg-flash { opacity: 0; fill: url(#gWin); pointer-events: none; }
.seg-flash.is-win { animation: winflash 2.6s ease-in-out infinite alternate; }
@keyframes winflash {
  from { opacity: .18; }
  to   { opacity: .46; }
}
.seg-dim { fill: #020a05; opacity: 0; pointer-events: none; transition: opacity .7s ease; }
.has-winner .seg-dim:not(.is-win) { opacity: .32; }

/* Центральна кнопка */
.wheel__hub {
  position: absolute;
  left: var(--cx);
  top: var(--cy);
  z-index: 5;
  width: 17%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #17582f 0 58%, transparent 59%),
    conic-gradient(from 30deg, #fff1b8, #e3a826, #fbe08a, #b9800f, #fff1b8, #d99a1e, #fff1b8);
  box-shadow: 0 0 0 3px rgba(11, 40, 22, .9), 0 0 28px rgba(var(--gold-rgb), .6), 0 10px 24px rgba(0, 0, 0, .5);
  color: #ffe9a3;
  font-size: clamp(10px, 1.6vw, 15px);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
  cursor: pointer;
  transform: translate(-50%, -50%);
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s ease, filter .3s ease;
}
.wheel__hub:hover:not(:disabled) { transform: translate(-50%, -50%) scale(1.06); }
.wheel__hub:active:not(:disabled) { transform: translate(-50%, -50%) scale(.95); transition-duration: .1s; }
.wheel__hub::after {
  content: '';
  position: absolute;
  inset: -7px;
  border: 2px solid rgba(var(--gold-rgb), .75);
  border-radius: 50%;
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  from { transform: scale(1); opacity: .9; }
  to   { transform: scale(1.4); opacity: 0; }
}
.wheel__hub:disabled { cursor: not-allowed; filter: saturate(.55) brightness(.85); }
.wheel__hub:disabled::after { display: none; }
.wheel.is-spinning .wheel__hub { cursor: wait; }

/* ---------- Кнопки ---------- */
.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.2, .7, .3, 1), box-shadow .25s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn--primary {
  background: var(--green);
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(var(--green-rgb), .3), 0 0 18px rgba(var(--green-rgb), .18);
}
.btn--primary:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 16px 44px rgba(var(--green-rgb), .48), 0 0 26px rgba(var(--green-rgb), .3);
}
.btn:active:not(:disabled) { transform: scale(.97); transition-duration: .1s; }
.btn--primary:hover:active:not(:disabled) { transform: translateY(-1px) scale(.97); }
.btn--primary.is-done { background: #f1ffd9; }
.btn--ghost {
  background: rgba(4, 18, 11, .5);
  border-color: rgba(255, 255, 255, .2);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--green); color: var(--green); }
.btn--lg { min-height: 62px; padding: 0 48px; font-size: 17px; }
/* Відблиск, що пробігає по головній кнопці кожні ~6 с */
.btn--sheen::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%);
  transform: translateX(-130%);
  animation: sheen 6s ease-in-out 1.8s infinite;
  pointer-events: none;
}
@keyframes sheen {
  0%       { transform: translateX(-130%); }
  16%, 100% { transform: translateX(130%); }
}
.btn:disabled {
  cursor: not-allowed;
  background: rgba(40, 56, 44, .85);
  color: var(--muted-2);
  box-shadow: none;
  transform: none;
}
.btn:disabled::after { animation: none; opacity: 0; }
.btn:focus-visible,
.wheel__hub:focus-visible,
a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}

.cta { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.cta__hint { margin: 0 0 0 6px; font-size: 13px; font-weight: 500; color: var(--muted); min-height: 1.5em; }

/* ---------- Результат ---------- */
.result {
  max-width: 520px;
  padding: 26px;
  border: 1px solid rgba(var(--green-rgb), .45);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(14, 44, 25, .88), rgba(5, 20, 12, .92));
  box-shadow: 0 0 60px rgba(var(--green-rgb), .14), 0 30px 80px rgba(0, 0, 0, .5);
  backdrop-filter: blur(14px);
}
.result.is-revealed { animation: reveal .8s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes reveal {
  from { opacity: 0; transform: translateY(18px) scale(.96); filter: blur(8px); }
  to   { opacity: 1; transform: none; filter: none; }
}
.result__label {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.result__prize {
  margin: 0 0 18px;
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--green);
  text-shadow: 0 0 24px rgba(var(--green-rgb), .35);
}
.result__code {
  padding: 14px;
  border: 1.5px dashed rgba(var(--gold-rgb), .7);
  border-radius: 16px;
  background: rgba(var(--gold-rgb), .08);
  color: #ffe9a3;
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 800;
  letter-spacing: .14em;
  text-align: center;
  user-select: all;
  -webkit-user-select: all;
}
.result__note { margin: 14px 0 0; font-size: 15px; font-weight: 600; }
.result__terms {
  list-style: none;
  display: grid;
  gap: 4px;
  margin: 10px 0 0;
  padding: 0;
  font-size: 13px;
  color: var(--muted);
}
.result__terms li { display: flex; align-items: center; gap: 8px; }
.result__terms li::before {
  content: '';
  flex: none;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--green);
}
.result__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

/* ---------- Вікно з виграшем ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: radial-gradient(circle at 50% 45%, rgba(4, 18, 11, .45), rgba(2, 8, 5, .78));
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .4s ease;
}
.modal-backdrop.is-open { opacity: 1; }
.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 95;               /* під вікном — не перекриває приз, код і кнопки */
  pointer-events: none;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  pointer-events: none;      /* клік повз картку закриває вікно (через фон) */
}
.modal__card {
  pointer-events: auto;
  position: relative;
  width: min(480px, 100%);
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  text-align: left;
  opacity: 0;
  transform: translateY(12px) scale(.9);
  transition: opacity .4s cubic-bezier(.2, .8, .2, 1), transform .55s cubic-bezier(.2, .9, .25, 1.12);
}
.modal.is-open .modal__card { opacity: 1; transform: none; }
/* Неонова обводка картки виграшу (на сторінці і у вікні): мʼякий лаймовий
   відблиск повільно обходить контур (одне коло ≈ 7.5 с), навпроти — ледь
   помітний золотий. Не відволікає від коду. */
@property --edge { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.result { position: relative; }
.result::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  pointer-events: none;
  background: conic-gradient(from var(--edge),
    transparent 0deg,
    rgba(var(--green-rgb), .12) 30deg, rgba(214, 255, 130, .95) 62deg, rgba(var(--green-rgb), .12) 94deg,
    transparent 130deg,
    transparent 200deg,
    rgba(var(--gold-rgb), .45) 242deg,
    transparent 284deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: edgeRun 7.5s linear infinite;
}
/* у вікні відблиск зʼявляється плавно, вже після відкриття */
.modal__card::before { opacity: 0; transition: opacity .8s ease .5s; }
.modal.is-open .modal__card::before { opacity: 1; }
@keyframes edgeRun { to { --edge: 360deg; } }
.modal__title {
  margin: 0 40px 16px 0;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 800;
  line-height: 1.15;
}
.modal__close {
  position: absolute;
  top: 14px; right: 14px;
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  background: rgba(4, 18, 11, .5);
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, transform .15s ease;
}
.modal__close:hover { border-color: var(--green); color: var(--green); }
.modal__close:active { transform: scale(.92); }

/* =====================================================================
   ТАЙМЕР
   ===================================================================== */
.timer { margin-top: 8px; }
.timer__card {
  max-width: 900px;
  margin-inline: auto;
  padding: 38px 32px;
  border: 1px solid rgba(var(--gold-rgb), .28);
  border-radius: 28px;
  background:
    radial-gradient(600px 200px at 50% 0%, rgba(var(--gold-rgb), .1), transparent 70%),
    linear-gradient(180deg, rgba(16, 46, 27, .78), rgba(5, 20, 12, .9));
  box-shadow: 0 30px 80px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .06);
  text-align: center;
}
.timer__title {
  margin: 0 0 24px;
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 800;
}
.timer__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 680px;
  margin-inline: auto;
}
.timer__grid div {
  padding: 18px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0, 0, 0, .25);
}
.timer__grid b {
  display: block;
  font-size: clamp(30px, 5vw, 54px);
  font-weight: 800;
  line-height: 1.1;
  color: var(--green);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(var(--green-rgb), .35);
}
.timer__grid span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.timer__note { margin: 22px 0 0; font-size: 14px; color: var(--muted); }
.timer.is-ended .timer__grid { opacity: .35; }

/* =====================================================================
   ПРАВИЛА
   ===================================================================== */
.rules {
  max-width: 900px;
  margin-top: 56px;
  padding: 28px 32px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: rgba(8, 24, 15, .6);
}
.rules h2 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text);
}
.rules ol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 36px;
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
}
.rules li::marker { color: var(--green); font-weight: 700; }

/* =====================================================================
   ФУТЕР
   ===================================================================== */
.footer {
  margin-top: 48px;
  border-top: 1px solid var(--line-soft);
  background: rgba(2, 10, 6, .6);
}
.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 36px 0 44px;
  text-align: center;
}
.footer__logo { height: 64px; width: auto; }
.footer__btn { min-height: 54px; padding: 0 28px; margin-top: 6px; }
.footer__copy { margin: 0; font-size: 12px; color: var(--muted-2); }

/* Debug */
.debug-reset {
  position: fixed;
  left: 16px; bottom: 16px;
  z-index: 60;
  padding: 10px 14px;
  border: 1px dashed #ffb020;
  border-radius: 10px;
  background: #1d1608;
  color: #ffcf70;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* =====================================================================
   АДАПТИВ
   ===================================================================== */

/* Десктоп: після виграшу підзаголовок і умови ховаються,
   а картка виграшу стає одразу під заголовком */
@media (min-width: 961px) {
  .hero.has-result .hero__lead,
  .hero.has-result .terms { display: none; }
  .hero.has-result .hero__action { margin-top: 28px; }
}
@media (max-width: 960px) {
  .hero { min-height: 0; }
  /* Окремий вертикальний фон для мобільних (assets/bg-winter-mobile.jpg) */
  .hero__scene::before {
    background-image: url('../assets/bg-winter-mobile.jpg');
    background-position: center bottom;
    filter: blur(1px) brightness(.95);
  }
  .hero__scene::after {
    background: linear-gradient(180deg, rgba(4, 18, 11, .15) 0%, transparent 20%);
  }
  /* мобільні: довший, мʼякший перехід — починається ще всередині зображення
     (кілька проміжних точок, щоб не було видимих «сходинок») */
  .hero__bg::after {
    background: linear-gradient(180deg,
      transparent 58%, rgba(4, 18, 11, .08) 64%, rgba(4, 18, 11, .2) 70%,
      rgba(4, 18, 11, .38) 76%, rgba(4, 18, 11, .58) 82%, rgba(4, 18, 11, .76) 88%,
      rgba(4, 18, 11, .9) 92%, var(--bg) 97%, var(--bg) 100%);
  }
  .hero__inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "text"
      "wheel"
      "terms"
      "action";
    row-gap: 8px;
    padding: 8px 0 56px;
    text-align: center;
  }
  .hero__text, .hero__action { align-self: auto; }
  .hero__action { margin-top: 0; display: flex; justify-content: center; }
  .terms { align-items: center; margin: 4px 0 22px; }
  .cta { align-items: center; }
  .cta__hint { margin: 0; }
  .result { text-align: left; width: 100%; }
  .wheel { width: min(100%, 560px); }
}

@media (max-width: 560px) {
  .container { width: calc(100% - 32px); }
  .header { padding: 16px 0; }
  .header__logo img { height: 34px; }
  .badge { padding: 7px 11px; font-size: 12px; }
  /* Заголовок компактніше, підзаголовок — строго в один рядок */
  .hero__title { font-size: clamp(21px, 6.4vw, 28px); line-height: 1.2; }
  .hero__text { padding-top: 22px; }   /* відступ тексту від шапки (лого + дата) */
  .hero__lead {
    margin-top: 14px;
    font-size: clamp(11px, 3.55vw, 15px);
    white-space: nowrap;
  }
  .terms { margin: 2px 0 18px; gap: 8px; }
  .terms li {
    font-size: clamp(11px, 3.3vw, 13px);
    padding: 8px 13px;
    gap: 8px;
    white-space: nowrap;
  }
  /* запас по краях, щоб камера (+4.5%) не обрізала рамку */
  .wheel { width: calc(100% + 12px); margin-inline: -6px; }
  .header__right { gap: 8px; }
  .sound-toggle { width: 34px; height: 34px; }
  .wheel__hub { width: 19%; }
  .btn--lg { width: 100%; }
  .cta { width: 100%; }
  .result { padding: 22px; }
  .result__actions { grid-template-columns: 1fr; }
  .timer__card { padding: 28px 16px; }
  .timer__grid { gap: 8px; }
  .timer__grid div { padding: 14px 2px 10px; border-radius: 14px; }
  .timer__grid span { font-size: 9px; letter-spacing: .08em; }
  .rules { padding: 22px; }
  .rules ol { grid-template-columns: 1fr; }
  .footer { margin-top: 32px; }
  .footer__inner { padding-top: 28px; }
  .footer__logo { height: 52px; }
  .lang-switch__btn { min-width: 32px; height: 30px; padding: 0 7px; }
}
/* Вузькі телефони: лого, дата, мова і звук в один рядок без переносу */
@media (max-width: 400px) {
  .header { gap: 10px; }
  .header__logo img { height: 30px; }
  .header__right { gap: 6px; }
  .badge { padding: 6px 9px; font-size: 11px; gap: 6px; }
  .badge .dot { width: 6px; height: 6px; }
  .lang-switch { padding: 2px; }
  .lang-switch__btn { min-width: 29px; height: 28px; padding: 0 5px; font-size: 11px; }
  .sound-toggle { width: 32px; height: 32px; }
}
@media (max-width: 350px) {
  .badge .dot { display: none; }
}

/* =====================================================================
   ВСТУПНА АНІМАЦІЯ (~1.7 с)
   Фон, сніг і зірки — одразу. Колесо «вистрибує» з пружинним рухом
   0.7 → 1.04 → 1 (сектори при цьому трохи доверчуються — js/app.js,
   гірлянда засвічується по колу — js/fx.js). Потім уся текстова
   композиція проявляється ОДНИМ мʼяким fade-in зі зміщенням.
   Колесо анімується через обгортку .hero__wheel, щоб не конфліктувати з камерою.
   ===================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .hero__wheel { animation: wheelPop 1.15s .1s both; }
  .header,
  .hero__text,
  .hero__terms,
  .hero__action { animation: compIn .95s .72s cubic-bezier(.22, .61, .36, 1) both; }

  .fx-ready .reveal { transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
  .fx-ready .reveal:not(.is-in) { opacity: 0; transform: translateY(26px); }
}
@keyframes wheelPop {
  0%   { opacity: 0; transform: scale(.7);  animation-timing-function: cubic-bezier(.22, .68, .32, 1); }
  30%  { opacity: 1; }
  62%  { transform: scale(1.04); animation-timing-function: cubic-bezier(.45, 0, .35, 1); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes compIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* Повага до налаштувань «менше руху» */
@media (prefers-reduced-motion: reduce) {
  .wheel__hub::after,
  .seg-flash.is-win,
  .btn--sheen::after { animation: none; }
  .seg-flash.is-win { opacity: .4; }
  .sound-toggle.is-pending .ico-on { animation: none; opacity: .6; }
  .result::before { animation: none; }
  .modal__card, .modal-backdrop { transition-duration: .01s; }
}
