/*
  Скретч-карта за бронирование (docs-project/LOYALTY_ECONOMY.md, план
  внедрения п.4) - стиль строго по docs-project/MOTION_LANGUAGE.md
  (длительности/кривые раздела 2-3 и 7, дисциплина исходов раздела 9.4).
  Переменные ниже - та же канонiческая таблица из MOTION_LANGUAGE.md,
  раздел 7 - продублирована здесь, а не импортирована из reward-widget.css,
  т.к. showcase.html его не подключает (см. showcase.html, комментарий у
  #coin-bonuses-block про собственную палитру программы лояльности).
*/
.sc-root {
  --motion-instant: 100ms;
  --motion-fast: 200ms;
  --motion-base: 300ms;
  --motion-slow: 450ms;
  --motion-celebration: 700ms;
  --motion-stagger-step: 45ms;
  --ease-standard: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(0, 0, .2, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  position: relative;
  border-radius: 18px;
  background: linear-gradient(160deg, rgb(var(--color-reward-panel-from-rgb)), rgb(var(--color-reward-panel-to-rgb)));
  border: 1px solid rgb(var(--color-overlay-rgb) / .08);
  padding: 16px;
  color: rgb(var(--color-reward-text-rgb));
  overflow: hidden;
}

.sc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sc-title { font-weight: 700; font-size: .95rem; color: rgb(var(--color-reward-text-rgb)); }
.sc-hint { font-size: .76rem; color: #94a3b8; margin-top: 2px; }

.sc-card-frame {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #1c2333, #0b0f19);
  border: 1px solid rgba(255, 255, 255, .1);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.sc-backing {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 12px;
}
.sc-backing-amount { font-size: 1.6rem; font-weight: 800; color: #fde68a; display: flex; align-items: center; gap: 6px; }
.sc-backing-label { font-size: .78rem; color: #cbd5e1; }
.sc-backing.is-business { color: #fde68a; }
.sc-backing.is-business .sc-backing-amount { color: #fbbf24; font-size: 1.15rem; }

.sc-foil-canvas { position: absolute; inset: 0; cursor: grab; }
.sc-foil-canvas:active { cursor: grabbing; }

.sc-progress-track {
  position: absolute; left: 12px; right: 12px; bottom: 10px; height: 4px;
  border-radius: 999px; background: rgba(255, 255, 255, .12); overflow: hidden;
  pointer-events: none;
}
.sc-progress-fill { height: 100%; width: 0; background: #f59e0b; transform-origin: left; transition: width var(--motion-fast) var(--ease-out); }

.sc-open-btn {
  margin: 14px auto 0; display: block; padding: .7rem 1.4rem; border-radius: 12px;
  font-weight: 700; font-size: .88rem; border: none; background: #f59e0b; color: #1c1917; cursor: pointer;
}

.sc-result { text-align: center; padding: 6px 4px 0; }
.sc-result-amount { font-size: 1.5rem; font-weight: 800; color: #fde68a; display: flex; align-items: center; justify-content: center; gap: 6px; }
.sc-result-note { font-size: .78rem; color: #94a3b8; margin-top: 4px; }

.sc-business-banner {
  margin-top: 12px; padding: 12px 14px; border-radius: 14px; text-align: center;
  background: linear-gradient(135deg, rgba(251, 191, 36, .22), rgba(245, 158, 11, .06));
  border: 1px solid rgba(251, 191, 36, .4);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, .08), 0 8px 24px rgba(245, 158, 11, .18);
}
.sc-business-title { font-weight: 800; font-size: .95rem; color: #fef3c7; }
.sc-business-code { margin-top: 4px; font-size: .8rem; color: #fde68a; }

/* Плашка счастливого часа - спокойная, без мигания и без агрессивного
   таймера (постановка задачи) - только статичное состояние, апдейтится
   раз при загрузке страницы, не тикает. */
.hh-plaque { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, .12), rgba(245, 158, 11, .03));
  border: 1px solid rgba(245, 158, 11, .22); }
.hh-plaque-icon { flex: none; }
.hh-plaque-title { font-weight: 700; font-size: .9rem; color: #fde68a; }
.hh-plaque-subtitle { font-size: .78rem; color: #94a3b8; margin-top: 1px; }

@media (prefers-reduced-motion: no-preference) {
  .sc-root { animation: sc-pop-in var(--motion-base) var(--ease-spring) both; }
  @keyframes sc-pop-in { 0% { opacity: 0; transform: translateY(10px) scale(.97); } 100% { opacity: 1; transform: translateY(0) scale(1); } }

  .sc-card-frame.is-revealing { animation: sc-reveal-shake 260ms var(--ease-standard); }
  @keyframes sc-reveal-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px) rotate(-.4deg); }
    50% { transform: translateX(3px) rotate(.4deg); }
    75% { transform: translateX(-2px); }
  }

  .sc-backing { animation: sc-backing-in var(--motion-slow) var(--ease-spring) both; }
  @keyframes sc-backing-in { 0% { opacity: 0; transform: scale(.85); } 100% { opacity: 1; transform: scale(1); } }

  .sc-business-banner { animation: sc-business-in var(--motion-celebration) var(--ease-spring) both; }
  @keyframes sc-business-in {
    0% { opacity: 0; transform: translateY(8px) scale(.92); filter: brightness(1); }
    60% { filter: brightness(1.35); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: brightness(1); }
  }

  .sc-particle {
    position: absolute; left: 50%; top: 50%; width: var(--size, 6px); height: var(--size, 6px);
    border-radius: 50%; background: var(--color, #fde68a); pointer-events: none;
    animation: sc-particle-fly var(--dur, 500ms) var(--ease-out) both;
  }
  @keyframes sc-particle-fly {
    0% { opacity: 1; transform: translate(-50%, -50%) translate(0, 0) scale(1); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) translate(var(--dx, 0), var(--dy, 40px)) scale(.6); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .sc-root, .sc-backing, .sc-business-banner { opacity: 1; transform: none; animation: none; }
}
