/* Колесо фортуны («лудильня») — оверлей кабинета.
 * Веб-only (см. [[feedback-cabinet-web-only]]). Отдельный файл, чтобы не
 * раздувать cabinet.css (CLAUDE.md: монолиты не копим). */

.spinw-overlay {
  position: fixed;
  inset: 0;
  z-index: 9400;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 40px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.spinw-overlay.is-open { opacity: 1; }

.spinw-sheet {
  width: 100%;
  max-width: 460px;
  background: var(--card-bg, #fff);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  padding: 20px 20px 24px;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
.spinw-overlay.is-open .spinw-sheet { transform: translateY(0) scale(1); }

.spinw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.spinw-title {
  font-size: 1.12rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary, #0f172a);
}
.spinw-close {
  border: none;
  background: var(--bg-subtle, #f1f5f9);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-secondary, #64748b);
  transition: background 0.15s;
}
.spinw-close:hover { background: #e2e8f0; }

.spinw-sub {
  font-size: 0.84rem;
  color: var(--text-secondary, #64748b);
  margin: 0 0 14px;
  line-height: 1.45;
}

/* --- Колесо --- */
.spinw-wheel-wrap {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 6px auto 16px;
}
.spinw-pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 22px solid var(--accent, #0d9488);
  filter: drop-shadow(0 2px 3px rgba(15, 23, 42, 0.3));
  z-index: 3;
}
.spinw-wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 8px solid #fff;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.25),
              inset 0 0 0 3px rgba(15, 23, 42, 0.06);
  transition: transform 4.4s cubic-bezier(0.16, 0.84, 0.3, 1);
  will-change: transform;
}
.spinw-sector-label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
}
.spinw-sector-label > span {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.35));
  user-select: none;
}
.spinw-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #e2e8f0);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 2;
}

/* --- Действие --- */
.spinw-spin-btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent, #0d9488), #0b7c72);
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.35);
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.15s;
}
.spinw-spin-btn:active { transform: translateY(1px); }
.spinw-spin-btn:disabled {
  cursor: default;
  opacity: 0.55;
  box-shadow: none;
}
.spinw-status {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-secondary, #64748b);
  margin: 10px 0 0;
  min-height: 1.1em;
}

/* --- Результат --- */
.spinw-result {
  margin-top: 14px;
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  background: var(--bg-subtle, #f1f5f9);
  border: 1px solid rgba(15, 23, 42, 0.06);
  animation: spinw-pop 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
.spinw-result.tier-jackpot {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #f59e0b;
}
.spinw-result.tier-rare,
.spinw-result.tier-uncommon {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  border-color: #a78bfa;
}
@keyframes spinw-pop {
  from { transform: scale(0.86); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.spinw-result-emoji { font-size: 2.6rem; line-height: 1; }
.spinw-result-label {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 8px 0 2px;
  color: var(--text-primary, #0f172a);
}
.spinw-result-note {
  font-size: 0.84rem;
  color: var(--text-secondary, #64748b);
  margin: 0;
  line-height: 1.45;
}
.spinw-promo {
  margin: 10px auto 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px dashed var(--accent, #0d9488);
  border-radius: 10px;
  padding: 8px 12px;
}
.spinw-promo code {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--accent, #0d9488);
}
.spinw-copy {
  border: none;
  background: var(--accent, #0d9488);
  color: #fff;
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 0.78rem;
  cursor: pointer;
}

/* --- Постоянная карточка активного промокода --- */
.spinw-active-promo {
  margin: 16px 0 4px;
  padding: 16px 14px;
  text-align: center;
  background: linear-gradient(180deg, #f5f3ff, #ede9fe);
  border: 1px solid #ddd6fe;
  border-radius: 14px;
}
.spinw-active-promo-emoji { font-size: 1.9rem; line-height: 1; }
.spinw-active-promo-title {
  font-weight: 800;
  font-size: 1.02rem;
  margin-top: 6px;
  color: var(--text, #0f172a);
}
.spinw-active-promo-note {
  font-size: 0.82rem;
  color: var(--text-secondary, #64748b);
  margin: 4px 0 0;
  line-height: 1.4;
}
.spinw-apply-btn {
  display: block;
  width: 100%;
  margin: 12px auto 0;
  border: none;
  background: var(--accent, #0d9488);
  color: #fff;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}
.spinw-apply-btn:hover { filter: brightness(1.06); }

/* --- Коллекция значков --- */
.spinw-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary, #64748b);
  margin: 20px 0 8px;
}
.spinw-collection {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
}
.spinw-badge {
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--bg-subtle, #f1f5f9);
}
.spinw-badge.is-locked { opacity: 0.32; filter: grayscale(1); }
.spinw-badge.is-new {
  animation: spinw-badge-pop 0.5s ease;
  box-shadow: 0 0 0 2px var(--accent, #0d9488);
}
@keyframes spinw-badge-pop {
  0% { transform: scale(0.5); }
  60% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* --- Последние выигрыши --- */
.spinw-recent {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.spinw-recent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-primary, #0f172a);
}
.spinw-recent-row .e { font-size: 1.05rem; }
.spinw-recent-empty {
  font-size: 0.84rem;
  color: var(--text-secondary, #64748b);
  margin: 0;
}

/* Карточка-вход «Колесо фортуны» в зоне сообщества кабинета.
 * .card даёт белый бокс + padding 24px + margin — здесь только flex-раскладка. */
.spinw-card {
  display: flex;
  align-items: center;
  gap: 14px;
}
.spinw-card-emoji {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}
.spinw-card-body {
  flex: 1 1 auto;
  min-width: 0;
}
.spinw-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 2px;
  color: var(--text-primary, #0f172a);
}
.spinw-card-hint {
  font-size: 0.85rem;
  color: var(--text-secondary, #6b7280);
  margin: 0;
  line-height: 1.4;
}
.spinw-card-btn {
  flex-shrink: 0;
  border: none;
  border-radius: 12px;
  padding: 11px 22px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--accent, #0d9488), #0b7c72);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
  transition: transform 0.12s;
}
.spinw-card-btn:active { transform: translateY(1px); }

@media (max-width: 420px) {
  .spinw-card { gap: 10px; }
  .spinw-card-title { font-size: 1rem; }
  .spinw-card-btn { padding: 10px 15px; font-size: 0.85rem; }
}

@media (max-width: 380px) {
  .spinw-wheel-wrap { width: 240px; height: 240px; }
  .spinw-collection { grid-template-columns: repeat(4, 1fr); }
}
