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

/* ---- shared container ---- */
.st-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.points-panel { max-width: 480px; margin: 0 auto; }

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

.st-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%);
}

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

.st-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;
}

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

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

/* =========================================================
   POINTS PANEL
========================================================= */
.points-panel {
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.09), rgba(255, 107, 69, 0.03) 60%), rgba(20, 19, 42, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 26px;
  padding: 48px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 24px 60px rgba(5, 4, 16, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.panel-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.panel-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.1);
  color: var(--orange-light);
}

.panel-icon svg { width: 28px; height: 28px; }

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

/* ---- avatar ---- */
.profile-avatar-wrap {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--orange), var(--rust));
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.profile-avatar-wrap:hover {
  box-shadow: 0 0 0 7px rgba(139, 92, 246, 0.14);
  transform: translateY(-2px);
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  background: var(--surface-2);
}

.panel-title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  color: var(--white);
  margin: 0;
}

.panel-text {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 420px;
  margin: 0;
}

.error-text { color: #ff8f7a; }

/* ---- minimal logout link (not a heavy button) ---- */
.logout-link {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.logout-link:hover {
  color: var(--orange-light);
  background: rgba(139, 92, 246, 0.08);
}

/* ---- loading spinner ---- */
.spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--orange);
  animation: spin 0.8s linear infinite;
}

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

/* ---- points total display ---- */
.points-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 8px 0 4px;
  padding: 20px 40px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.16), rgba(255, 107, 69, 0.05));
  border: 1px solid rgba(139, 92, 246, 0.28);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.points-total:hover {
  box-shadow: 0 8px 28px rgba(139, 92, 246, 0.22);
  transform: translateY(-2px);
}

.points-number {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 56px);
  font-weight: 700;
  color: var(--orange-light);
  line-height: 1;
  text-shadow: 0 0 24px rgba(139, 92, 246, 0.35);
}

.points-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- entrance animation for panel states ---- */
.panel-state {
  animation: panel-in 0.4s ease both;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.btn-small {
  padding: 10px 22px;
  font-size: 13.5px;
}

/* =========================================================
   STORE PREVIEW (legacy, kept for compatibility)
========================================================= */
.store-preview {
  margin-top: 40px;
  text-align: center;
  padding: 40px 24px;
  border: 1px dashed var(--border);
  border-radius: 16px;
}

.store-preview-title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  margin: 4px 0 12px;
}

/* =========================================================
   HOW TO EARN POINTS (shown in logged-out panel)
========================================================= */
.how-to-earn {
  margin-top: 12px;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-align: left;
  width: 100%;
}

.how-to-earn-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  margin: 0 0 8px;
}

.how-to-earn-text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 10px;
}

.how-to-earn-text strong {
  color: var(--orange-light);
  font-weight: 600;
}

.how-to-earn-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--orange-light);
  transition: color 0.15s ease;
}

.how-to-earn-link:hover { color: var(--orange); }

/* =========================================================
   ITEMS GRID
========================================================= */
.store-grid-wrap { margin-top: 56px; }

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

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

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

/* ---- VIP / special item highlight ---- */
.item-card-special {
  border: 1px solid rgba(139, 92, 246, 0.55);
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.08), var(--surface) 55%);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.15), 0 16px 34px rgba(139, 92, 246, 0.1);
}

.item-card-special:hover {
  border-color: var(--orange);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.3), 0 20px 44px rgba(139, 92, 246, 0.22);
}

.item-special-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--orange), var(--rust));
  color: #120c26;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.item-image {
  width: 100%;
  aspect-ratio: 1.4 / 1;
  object-fit: contain;
  border-radius: 10px;
  background: var(--surface-2);
}

.item-name {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 600;
  color: var(--white);
  margin: 0;
  min-height: 2.6em;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-cost-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: var(--orange-light);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  margin-top: auto;
}

/* =========================================================
   REDEMPTION MODAL
========================================================= */
.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: 420px;
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.1), rgba(255, 107, 69, 0.03) 60%), rgba(20, 19, 42, 0.75);
  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); }

.modal-item-image {
  width: 100%;
  aspect-ratio: 1.6 / 1;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 16px;
  background: var(--surface-2);
}

.modal-item-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 8px;
}

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

.modal-cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.modal-cost-label {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.modal-cost-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--orange-light);
}

.modal-balance-note {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 18px;
}

.modal-balance-note.insufficient { color: #ff8f7a; }

.modal-redeem-btn { width: 100%; }

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

/* ---- success state ---- */
.modal-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(99, 153, 34, 0.15);
  color: #8fd15a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-success-icon svg { width: 26px; height: 26px; }

.redemption-code {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--orange-light);
  background: rgba(139, 92, 246, 0.1);
  border: 1px dashed rgba(139, 92, 246, 0.4);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 18px;
}

.claim-instructions {
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 20px;
}

.claim-instructions-title {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--white);
  margin: 0 0 6px;
}

.claim-instructions-text {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 640px) {
  .st-hero { padding: 70px 20px 50px; }
  .points-panel { padding: 36px 22px; }
  .points-total { padding: 16px 28px; }
}