/* Smile Lab USA — скретч-карта «приз на открытие» (assets/sl-game.js).
   Cream-фон, forest-текст, gold-акценты, шрифт сайта. По углам — наши
   изделия, как у донора его каппы. Оверлей fixed и непрозрачный: страница под
   ним не двигается, прокрутку не запираем (иначе на десктопе пропадёт полоса
   прокрутки и контент съедет — это и есть CLS). */

.slg {
  position: fixed;
  inset: 0;
  z-index: 100001;               /* над консьержем и меню; консультация открывается из чата, не отсюда */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: var(--sl-cream, #faf7f2);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  font-family: Satoshi, 'Assistant', Helvetica, Arial, sans-serif;
  color: var(--sl-forest, #14322b);
  animation: slg-fade var(--dur-base, 250ms) var(--ease-productive, ease) both;
}

.slg[hidden] { display: none; }

.slg *,
.slg *::before,
.slg *::after { box-sizing: border-box; }

@keyframes slg-fade { from { opacity: 0; } to { opacity: 1; } }

/* изделия по углам: декор, не информация */
.slg__deco {
  position: absolute;
  width: clamp(120px, 34vw, 200px);
  aspect-ratio: 1;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(20, 50, 43, .16);
  pointer-events: none;
}

.slg__deco img { display: block; width: 100%; height: 100%; object-fit: cover; }
.slg__deco--tl { top: -18px; left: -30px; transform: rotate(-12deg); }
.slg__deco--br { bottom: -22px; right: -28px; transform: rotate(10deg); }

.slg__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  margin: auto;
  padding: 8px 4px;
  text-align: center;
  animation: slg-rise var(--dur-entrance, 500ms) var(--ease-expressive, ease-out) both;
}

@keyframes slg-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.slg__x {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 2px 10px rgba(20, 50, 43, .14);
  color: var(--sl-forest, #14322b);
  cursor: pointer;
}

.slg__x:hover { background: #fff; }
.slg__x:focus-visible,
.slg__reveal:focus-visible,
.slg__btn:focus-visible { outline: 2px solid var(--cta-ring, #a97c22); outline-offset: 3px; }

.slg__kicker {
  display: inline-block;
  margin: 0 0 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f6ead0;
  box-shadow: inset 0 0 0 1px #e6cf9c;
  color: #7a5714;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.slg__h {
  margin: 0;
  font-size: clamp(30px, 8.6vw, 40px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -.028em;
  color: var(--sl-forest, #14322b);
  text-transform: none;
}

.slg .slg__h:focus,
.slg .slg__h:focus-visible { outline: none; box-shadow: none; background: none; }

.slg__sub {
  margin: 10px auto 0;
  max-width: 30ch;
  font-size: 16px;
  line-height: 1.4;
  color: rgba(28, 27, 25, .72);
}

/* карта: приз внизу, золотой слой сверху */
.slg__card {
  position: relative;
  width: min(330px, 100%);
  aspect-ratio: 16 / 10;
  margin: 22px auto 0;
  border-radius: var(--radius-card, 12px);
  background: #fff;
  box-shadow: 0 0 0 1px var(--sl-hairline, #eee7db), 0 14px 32px rgba(20, 50, 43, .14);
  overflow: hidden;
}

.slg__prize {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 12px;
}

.slg__got { font-size: 18px; font-weight: 600; color: var(--sl-ink, #1c1b19); }

.slg__amt {
  font-size: clamp(46px, 14vw, 60px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.035em;
  color: var(--sl-forest, #14322b);
}

.slg__when {
  margin-top: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--sl-forest, #14322b);
  color: #f4dc98;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.slg__foil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;            /* палец стирает, а не листает */
  transition: opacity var(--dur-entrance, 500ms) var(--ease-productive, ease);
}

.slg--revealed .slg__foil { opacity: 0; pointer-events: none; }

.slg__reveal {
  margin: 14px auto 0;
  padding: 6px 4px;
  border: 0;
  background: none;
  color: rgba(28, 27, 25, .6);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.slg__reveal:hover { color: var(--sl-forest, #14322b); }

.slg__claim { margin-top: 20px; }
.slg__claim[hidden] { display: none; }

.slg__ask {
  margin: 0 auto 12px;
  max-width: 32ch;
  font-size: 15.5px;
  line-height: 1.45;
  color: var(--sl-ink, #1c1b19);
}

.slg__row { display: flex; flex-wrap: wrap; gap: 10px; }

.slg__in {
  flex: 1 1 200px;
  min-width: 0;
  height: 50px;
  padding: 0 18px;
  border: 1px solid #d9cfbf;
  border-radius: 50px;
  background: #fff;
  color: var(--sl-ink, #1c1b19);
  font: inherit;
  font-size: 16px;               /* 16px — iOS не зумит страницу при фокусе */
}

.slg__in:focus { outline: none; border-color: var(--sl-forest, #14322b); box-shadow: 0 0 0 3px rgba(20, 50, 43, .12); }

.slg__honey {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.slg__btn {
  flex: 1 1 140px;
  height: 50px;
  padding: 0 24px;
  border: 0;
  border-radius: 50px;
  background: var(--cta-gold, #e8b54a);
  box-shadow: var(--cta-ring-shadow, inset 0 0 0 1px #a97c22);
  color: var(--cta-ink, #1c1b19);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color var(--dur-fast, 150ms) var(--ease-productive, ease);
}

.slg__btn:hover { background: var(--cta-gold-hover, #d99e34); }
.slg__btn:disabled { opacity: .7; cursor: default; }

.slg__note {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(28, 27, 25, .58);
}

.slg__msg {
  margin: 14px auto 0;
  max-width: 34ch;
  font-size: 15px;
  line-height: 1.45;
  color: var(--sl-ink, #1c1b19);
}

.slg__msg[hidden] { display: none; }
.slg__msg--bad { color: var(--sl-copper-dark, #9c370d); }

.slg__msg--done {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: var(--radius-card, 12px);
  background: #fff;
  box-shadow: 0 0 0 1px var(--sl-hairline, #eee7db);
  font-size: 16px;
  font-weight: 500;
  color: var(--sl-forest, #14322b);
}

@media (min-width: 750px) {
  .slg__deco--tl { top: 6%; left: 6%; }
  .slg__deco--br { bottom: 6%; right: 6%; }
}

@media (max-height: 640px) {
  .slg__deco { display: none; }
  .slg__card { margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .slg,
  .slg__panel { animation: none; }
  .slg__foil { transition: none; }
}

/* Команды после сохранения почты: золотая «в каталог» и тихая «остаться». */
.slg__after {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.slg__after .slg__go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;   /* иначе flex-basis 140px от .slg__btn растягивает высоту в колонке */
  width: 100%;
  max-width: 320px;
  height: 50px;
  text-decoration: none;
  text-align: center;
}
.slg__stay {
  background: none;
  border: 0;
  padding: 6px 10px;
  font: inherit;
  font-size: 15px;
  color: var(--ink-soft, #4a5a53);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.slg__stay:focus-visible { outline: 2px solid var(--cta-ring, #a97c22); outline-offset: 3px; }

/* ------------------------------------------------------------ колесо ---- */
/* Второй вариант игры (sl-game.js, kind=wheel). 6 секторов conic-gradient,
   золото и крем через один; подписи — радиально; указатель сверху; кнопка
   «TAP TO SPIN» в центре не вращается. Финал — та же карточка приза, что у
   скретча: после остановки колесо уступает ей место. */

.slg--wheel .slg__card { display: none; }
.slg--wheel.slg--revealed .slg__card { display: block; }
.slg--wheel.slg--revealed .slg__wheelwrap,
.slg--wheel.slg--revealed .slg__odds,
.slg--wheel.slg--revealed .slg__sub { display: none; }   /* «Tap the center to spin» после вращения — уже неправда */

.slg__wheelwrap {
  position: relative;
  width: min(300px, 78vw);
  aspect-ratio: 1;
  margin: 26px auto 0;
}

.slg__wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 6px var(--sl-gold, #d8a548), 0 0 0 7px #a97c22, 0 18px 40px rgba(20, 50, 43, .2);
  transform: rotate(0deg);
  transition: transform 3600ms cubic-bezier(.12, .62, .1, 1);
  will-change: transform;
}

/* подпись сектора: от центра по биссектрисе, читается снаружи внутрь */
.slg__label {
  position: absolute;
  inset: 0;
  transform: rotate(var(--a));
  pointer-events: none;
}

.slg__label > span {
  position: absolute;
  top: 9%;
  left: 50%;
  transform: translateX(-50%);
  color: var(--sl-forest, #14322b);
  font-size: clamp(15px, 4.6vw, 19px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.01em;
  text-align: center;
}

.slg__pointer {
  position: absolute;
  top: -14px;
  left: 50%;
  z-index: 2;
  width: 0;
  height: 0;
  margin-left: -15px;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 26px solid var(--sl-forest, #14322b);
  filter: drop-shadow(0 3px 3px rgba(20, 50, 43, .25));
}

.slg__spin {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 38%;
  aspect-ratio: 1;
  padding: 0 8px;
  border: 0;
  border-radius: 50%;
  background: var(--sl-forest, #14322b);
  box-shadow: 0 0 0 5px #fff, 0 6px 16px rgba(20, 50, 43, .3);
  color: #f4dc98;
  font: inherit;
  font-size: clamp(14px, 4vw, 16px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: .04em;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.slg__spin:hover { background: #0f2822; }
.slg__spin:disabled { cursor: default; }
.slg__spin:focus-visible { outline: 2px solid var(--cta-ring, #a97c22); outline-offset: 6px; }

.slg__odds {
  margin: 22px 0 0;
  font-size: 12.5px;
  color: rgba(28, 27, 25, .58);
}

@media (prefers-reduced-motion: reduce) {
  .slg__wheel { transition: none; }
}
