/* ==========================================================================
   SUNFUNCENT STUDIO // Member Club, Modals, Cards & Toast System
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 7, 11, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow-y: auto;
}

.modal-panel {
  width: min(1040px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  background: rgba(12, 15, 23, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(212, 163, 74, 0.45);
  border-radius: 2px;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.72);
}
.modal-panel.compact-auth { width: min(460px, 100%); }
.modal-panel.compact-auth.is-member { width: min(1060px, 100%); }
.modal-panel.detail-panel { width: min(560px, 100%); }
.modal-panel.guide-panel { width: min(760px, 100%); }

.modal-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-crumb {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #d4a34a;
}
.modal-close-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  color: #94a3b8;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.modal-close-btn:hover { color: #f3d9a4; border-color: #d4a34a; }

/* View A: Login / Register */
#loginModalView h3 { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.modal-sub { font-size: 13px; color: #94a3b8; margin-bottom: 16px; line-height: 1.55; }

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px;
  margin-bottom: 16px;
  background: rgba(9, 11, 16, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.auth-tab {
  min-height: 34px;
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  border-radius: 2px;
  transition: background 0.2s ease, color 0.2s ease;
}
.auth-tab.is-active { background: rgba(212, 163, 74, 0.18); color: #f3d9a4; }

.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form label { font-size: 12px; color: #94a3b8; }
.sfc-input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  background: rgba(9, 11, 16, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  color: #f8fafc;
  font-size: 13.5px;
  outline: none;
}
.sfc-input:focus { border-color: rgba(212, 163, 74, 0.65); }
.input-row { display: flex; gap: 8px; align-items: stretch; }
.input-row .sfc-input { flex: 1; min-width: 0; }
.input-row .btn-ghost, .input-row .btn-gold { flex-shrink: 0; white-space: nowrap; }

.invite-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}
.text-link { font-size: 12px; color: #d4a34a; text-decoration: underline; }
.form-note { font-size: 11.5px; color: #64748b; }
.btn-full { width: 100%; margin-top: 4px; }
.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(243, 217, 164, 0.3);
  border-top-color: #f3d9a4;
  border-radius: 50%;
  animation: spinRotate 0.8s linear infinite;
}
.btn-checkmark { color: #34d399; font-weight: 700; }

/* View B: Member Center */
#memberCenterView { display: flex; flex-direction: column; gap: 18px; }
.member-head-card {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px;
  background: rgba(9, 11, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(212, 163, 74, 0.4);
}
.member-avatar {
  width: 52px;
  height: 52px;
  border-radius: 2px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #f3d9a4;
  background: rgba(212, 163, 74, 0.14);
  border: 1px solid rgba(212, 163, 74, 0.45);
  flex-shrink: 0;
}
.member-id-meta { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.member-name-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.member-badge, .member-verified {
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid rgba(212, 163, 74, 0.4);
  color: #f3d9a4;
}
.member-verified { border-color: rgba(52, 211, 153, 0.4); color: #34d399; }
.member-sub-row { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: #94a3b8; }
.exp-bar-wrap { height: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.exp-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #d4a34a, #fff7e6); transition: width 0.4s ease; }
.exp-progress-txt { font-family: var(--font-mono); font-size: 11px; color: #94a3b8; }
.member-stats-col {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #94a3b8;
}
.member-stats-col strong { display: block; font-family: var(--font-mono); font-size: 18px; color: #f3d9a4; }

.member-earn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.earn-card {
  padding: 16px;
  background: rgba(9, 11, 16, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.earn-card h4 { font-size: 15px; font-weight: 600; }
.earn-card p { font-size: 12.5px; color: #94a3b8; }
.earn-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: #64748b;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.invite-code-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.invite-code-box strong { font-family: var(--font-mono); color: #f3d9a4; margin-right: auto; }

.deals-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 6px;
}
.deals-header-bar h4 { font-size: 16px; }
.deals-header-bar p { font-size: 12.5px; color: #94a3b8; }
.deals-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.msk-clock { font-size: 11.5px; color: #94a3b8; }
#moscowCountdownText { display: block; font-family: var(--font-mono); color: #f3d9a4; }
.reset-badge {
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(212, 163, 74, 0.2);
  color: #f3d9a4;
}
#refreshSvgIcon.spinning { animation: spinRotate 0.7s linear infinite; }

/* Sticky Notes Board (4 -> 2 -> 1 cols) */
.sticky-notes-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sticky-note-card {
  padding: 14px;
  background: rgba(9, 11, 16, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(212, 163, 74, 0.28);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.sticky-note-card.placeholder-slot { opacity: 0.72; }
.sticky-note-card.mega-hit { border-top-color: #f3d9a4; box-shadow: 0 0 18px rgba(212, 163, 74, 0.16); }
.sticky-note-card.claimed-note { border-color: rgba(52, 211, 153, 0.45); }
.sticky-note-card.expanded .sticky-brief-box { display: block; }
.sticky-note-card.shuffling { animation: shuffling 0.45s ease; }
.sticky-note-card.tearing { animation: tearing 0.4s ease forwards; }

.sticky-tag-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sticky-badge-chip { font-family: var(--font-mono); font-size: 10.5px; color: #d4a34a; }
.sticky-discount-val { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: #f3d9a4; }
.sticky-img-box, .placeholder-icon-wrap {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  color: #64748b;
}
.sticky-img-box img { width: 100%; height: 100%; object-fit: cover; }
.sticky-title { font-size: 13.5px; font-weight: 600; }
.sticky-price-row { display: flex; align-items: baseline; gap: 8px; }
.sticky-price-now { font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: #f3d9a4; }
.sticky-price-old { font-family: var(--font-mono); font-size: 11.5px; color: #64748b; text-decoration: line-through; }
.sticky-brief-box { font-size: 12px; color: #94a3b8; line-height: 1.5; }
.sticky-tap-hint { font-size: 11px; color: #64748b; }
.btn-sticky-get, .btn-sticky-disabled { width: 100%; min-height: 34px; font-size: 12px; margin-top: auto; }
.btn-sticky-disabled { border: 1px solid rgba(255, 255, 255, 0.08); color: #64748b; cursor: not-allowed; }

/* Points Redeem Board (4 -> 2 -> 1 cols) */
.redeem-section { display: flex; flex-direction: column; gap: 10px; }
.redeem-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: #94a3b8; }
.redeem-head strong { color: #f3d9a4; font-family: var(--font-mono); }
.points-redeem-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.points-coupon-card {
  padding: 14px;
  background: rgba(9, 11, 16, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.points-coupon-cost { font-family: var(--font-mono); font-size: 11.5px; color: #d4a34a; }
.points-coupon-value { font-family: var(--font-mono); font-size: 20px; font-weight: 700; color: #f8fafc; }
.points-coupon-name { font-size: 12px; color: #94a3b8; }
.btn-redeem-points { width: 100%; margin-top: 6px; min-height: 34px; font-size: 11.5px; }

.member-support-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(212, 163, 74, 0.06);
  border: 1px solid rgba(212, 163, 74, 0.25);
  font-size: 12.5px;
}
.support-links { display: flex; gap: 8px; flex-wrap: wrap; }

/* Detail & Guide Modals + Toast */
.detail-hero-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: 14px; border: 1px solid rgba(255, 255, 255, 0.08); }
.detail-rating-row { font-size: 12px; color: #94a3b8; margin: 8px 0 12px; }
.detail-promo-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(9, 11, 16, 0.85);
  border: 1px solid rgba(212, 163, 74, 0.35);
  margin-bottom: 14px;
}
.detail-promo-box strong { font-family: var(--font-mono); font-size: 16px; color: #f3d9a4; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.guide-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 16px; margin: 14px 0; }
.guide-steps-stack { display: flex; flex-direction: column; gap: 8px; }
.step-item-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 11, 16, 0.65);
  cursor: pointer;
}
.step-item-card.active-step { border-color: #d4a34a; animation: fadeSlideStep 0.28s ease; }
.step-num-bubble { font-family: var(--font-mono); font-size: 11px; color: #d4a34a; font-weight: 700; }
.step-content-text { font-size: 12.5px; color: #e2e8f0; }
.guide-anim-stage, .guide-mock-screen {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 11, 16, 0.82);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.mock-pill-box { padding: 8px 10px; border: 1px dashed rgba(212, 163, 74, 0.45); font-family: var(--font-mono); font-size: 12px; color: #f3d9a4; }
.mock-action-tag { font-size: 11.5px; color: #34d399; }
.guide-dots { display: flex; gap: 6px; }
.guide-dot { width: 8px; height: 8px; background: rgba(255, 255, 255, 0.2); }
.guide-dot.active { width: 20px; background: #d4a34a; }

.global-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(12, 15, 23, 0.96);
  border: 1px solid rgba(212, 163, 74, 0.55);
  color: #f8fafc;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.global-toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes spinRotate { to { transform: rotate(360deg); } }
@keyframes shuffling { 0%, 100% { transform: translateX(0); } 40% { transform: translateX(-6px); opacity: 0.65; } 70% { transform: translateX(6px); } }
@keyframes tearing { to { opacity: 0; transform: translateY(14px) scale(0.96); } }
@keyframes fadeSlideStep { from { opacity: 0.4; transform: translateX(-6px); } to { opacity: 1; transform: translateX(0); } }

@media (max-width: 960px) {
  .sticky-notes-board, .points-redeem-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-earn-grid, .guide-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .modal-panel { padding: 16px 14px; }
  .sticky-notes-board, .points-redeem-board { grid-template-columns: 1fr; }
}
