/* =========================================================
   RAFFLE PAGE — specific styles
   These extend style.css (which is loaded first).
========================================================= */

.rf-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =========================================================
   HERO
========================================================= */
.rf-hero {
  position: relative;
  padding: 100px 24px 60px;
  text-align: center;
  overflow: hidden;
}

.rf-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(50% 45% at 85% 15%, rgba(255, 107, 69, 0.12), transparent 65%),
    radial-gradient(55% 50% at 15% 20%, rgba(139, 92, 246, 0.18), transparent 70%);
}

.rf-hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.rf-hero-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 700;
  line-height: 1.08;
  color: var(--white);
  margin: 0;
}

.rf-hero-sub {
  font-size: clamp(15px, 2vw, 18px);
  color: var(--muted);
  max-width: 540px;
  line-height: 1.6;
  margin: 0;
}

.rf-fair-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.rf-fair-badge svg { color: var(--orange-light); flex-shrink: 0; }

/* =========================================================
   SECTION WRAPPER
========================================================= */
.rf-section {
  border-top: 1px solid var(--border);
  padding: 56px 0 100px;
}

.rf-prizes-head {
  text-align: center;
  margin-bottom: 36px;
}

.rf-admin-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- schedule status banner ---- */
.rf-schedule-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto 32px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.rf-schedule-banner.upcoming {
  background: rgba(255, 107, 69, 0.08);
  border: 1px solid rgba(255, 107, 69, 0.3);
  color: #ff9d7a;
}

.rf-schedule-banner.active {
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #8fd15a;
}

.rf-schedule-banner.ended {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* ---- date inputs in the schedule modal ---- */
.rf-date-field {
  text-align: left;
  margin-bottom: 14px;
}

.rf-date-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rf-date-field input[type="date"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
}

.rf-date-field input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

.rf-reset-btn {
  margin-top: 16px;
  font-size: 13.5px;
  padding: 10px 20px;
  border-color: rgba(255, 107, 69, 0.35);
  color: #ff9d7a;
}

.rf-reset-btn:hover {
  border-color: rgba(255, 107, 69, 0.6);
  color: #ffb298;
  background: rgba(255, 107, 69, 0.08);
}

.rf-loading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  padding: 60px 0;
}

.spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--orange);
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   PRIZE CARDS
========================================================= */
.rf-prizes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.rf-prize-card {
  position: relative;
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.06), transparent 45%), var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: inherit;
  transition: border-color 0.25s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
}

.rf-prize-card::before {
  content: '';
  position: absolute;
  top: 0; left: 14%; right: 14%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--orange), var(--rust), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.rf-prize-card:hover::before { opacity: 1; }

.rf-prize-card:hover {
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(139, 92, 246, 0.14);
}

.rf-prize-card.rf-prize-drawn { border-color: rgba(74, 222, 128, 0.3); }

.rf-prize-image {
  width: 100%;
  aspect-ratio: 1.3 / 1;
  object-fit: contain;
  border-radius: 12px;
  background: var(--surface-2);
}

.rf-prize-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  margin: 0;
}

.rf-prize-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rf-prize-participants {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.rf-prize-status-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: var(--orange-light);
}

.rf-prize-status-pill.drawn {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.3);
  color: #8fd15a;
}

.rf-prize-status-pill.closed {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--muted);
}

/* =========================================================
   MODAL BASE (self-contained - this page doesn't load store.css)
========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: overlay-in 0.2s ease both;
}

@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.1), rgba(255, 107, 69, 0.03) 60%), rgba(20, 19, 42, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 24px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 30px 70px rgba(5, 4, 16, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: modal-in 0.25s ease both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease;
}

.modal-close:hover { color: var(--white); }

.error-text { color: #ff8f7a; }

/* =========================================================
   PRIZE MODAL CONTENT
========================================================= */
.rf-modal-image {
  width: 100%;
  aspect-ratio: 1.5 / 1;
  object-fit: contain;
  border-radius: 14px;
  margin-bottom: 16px;
  background: var(--surface-2);
}

.rf-modal-name {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 6px;
}

.rf-modal-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 18px;
}

.rf-modal-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.rf-modal-stat {
  flex: 1;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.rf-modal-stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--orange-light);
}

.rf-modal-stat-label {
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.panel-eyebrow {
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

.panel-text {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0 0 18px;
}

/* ---- ticket dots ---- */
.rf-ticket-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
}

.rf-ticket-dots { display: flex; gap: 6px; }

.rf-ticket-dot {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.rf-ticket-dot.filled {
  background: linear-gradient(135deg, var(--orange), var(--rust));
  border-color: transparent;
  transform: scale(1.08);
}

.rf-ticket-count {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
}

.rf-buy-btn { width: 100%; }

.rf-buy-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.rf-points-note {
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 0;
}

.rf-points-note strong { color: var(--orange-light); }

.rf-draw-btn { width: 100%; margin-top: 14px; }

/* ---- shuffle / draw animation ---- */
.rf-draw-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}

.rf-shuffle-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--orange-light);
  padding: 20px;
  border-radius: 14px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px dashed rgba(139, 92, 246, 0.35);
}

/* ---- winner state ---- */
.rf-winner-icon {
  font-size: 40px;
  margin-bottom: 6px;
  animation: winner-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes winner-pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.rf-winner-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--orange-light), var(--rust-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 4px 0 20px;
}

.rf-fairness-box {
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}

.rf-fairness-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 8px;
}

.rf-fairness-line {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 4px;
}

.rf-fairness-line strong { color: var(--orange-light); }

.rf-fairness-hash {
  font-family: monospace;
  font-size: 11px;
  color: var(--muted-2);
  word-break: break-all;
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.rf-modal-error {
  font-size: 13.5px;
  margin: 14px 0 0;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 640px) {
  .rf-hero { padding: 70px 20px 50px; }
  .modal-box { padding: 26px 20px; }
}