/* =========================================
   WALLS — Premium Wallpaper App
   style.css  v3
   ========================================= */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ---- Design Tokens ---- */
:root {
  --bg:          #080809;
  --surface:     #111114;
  --surface-2:   #18181d;
  --surface-3:   #212128;
  --border:      #2a2a33;
  --border-soft: #1e1e25;
  --text:        #eeeef2;
  --text-sub:    #a8a8b8;
  --text-muted:  #5e5e72;
  --accent:      #7c6af7;
  --accent-2:    #a78bfa;
  --accent-glow: rgba(124, 106, 247, 0.22);
  --accent-dim:  rgba(124, 106, 247, 0.12);
  --gold:        #f5a623;
  --gold-dim:    rgba(245, 166, 35, 0.15);

  --font-display: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  26px;

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-std:    cubic-bezier(0.4, 0, 0.2, 1);

  --t-fast: 0.15s var(--ease-std);
  --t-med:  0.25s var(--ease-out);
}

/* ---- Base ---- */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
}

/* ==========================================
   HEADER
   ========================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 8, 9, 0.84);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-soft);
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.header__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Back button */
.back-btn[hidden] { display: none; }

.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-sub);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  animation: fadeSlideIn 0.2s var(--ease-out);
}

.back-btn:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border);
}

.back-btn:active { transform: scale(0.96); }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Brand (clickable logo) */
.header__brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--r-sm);
  transition: opacity var(--t-fast);
}

.header__brand:hover { opacity: 0.75; }

.header__logo {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1;
  background: linear-gradient(135deg, #fff 30%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header__tagline {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1;
  -webkit-text-fill-color: var(--text-muted);
}

/* ==========================================
   HERO BAR
   ========================================== */
.hero-bar {
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
}

.hero-bar__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 24px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.breadcrumb {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.breadcrumb:empty { display: none; }

.breadcrumb__sep {
  color: var(--border);
}

.breadcrumb__item {
  cursor: pointer;
  transition: color var(--t-fast);
}

.breadcrumb__item:hover { color: var(--text-sub); }

.breadcrumb__item--current {
  color: var(--text-sub);
  cursor: default;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.7px;
  line-height: 1.1;
  color: var(--text);
  opacity: 0;
  transform: translateY(5px);
  transition: opacity var(--t-med), transform var(--t-med);
  flex: 1;
  min-width: 0;
}

.hero-title.visible { opacity: 1; transform: translateY(0); }

.hero-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-3);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--t-med) 0.08s;
}

.hero-count.visible { opacity: 1; }

/* ==========================================
   MAIN WRAPPER
   ========================================== */
.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

/* ==========================================
   VIEW TRANSITION
   ========================================== */
.view-enter {
  animation: viewIn 0.3s var(--ease-out) both;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   PACK GRID (Home screen)
   ========================================== */
.pack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 600px) {
  .pack-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

@media (min-width: 800px) {
  .pack-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
}

/* Pack tile */
.pack-tile {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  aspect-ratio: 9 / 14;
  cursor: pointer;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  will-change: transform;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35), 0 1px 4px rgba(0,0,0,0.25);
  transition:
    transform    0.32s var(--ease-out),
    box-shadow   0.32s var(--ease-out),
    border-color 0.2s var(--ease-std);
}

.pack-tile:hover {
  transform: translateY(-6px) scale(1.012);
  box-shadow:
    0 12px 28px rgba(0,0,0,0.55),
    0 28px 52px rgba(0,0,0,0.4),
    0 0 0 1px var(--accent);
  border-color: var(--accent);
}

.pack-tile:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: transform 0.1s var(--ease-std), box-shadow 0.1s var(--ease-std);
}

/* Pack background image */
.pack-tile__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out), transform 0.5s var(--ease-out);
  transform: scale(1.05);
}

.pack-tile__img.loaded {
  opacity: 1;
  transform: scale(1);
}

.pack-tile:hover .pack-tile__img {
  transform: scale(1.08);
}

/* Gradient overlay */
.pack-tile__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.88) 0%,
    rgba(0,0,0,0.35) 40%,
    rgba(0,0,0,0.05) 70%,
    transparent      100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px 16px;
  gap: 6px;
}

/* Price badge */
.pack-tile__badge {
  align-self: flex-start;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1;
}

.pack-tile__badge--free {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.pack-tile__badge--paid {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid rgba(245, 166, 35, 0.3);
}

/* Pack name */
.pack-tile__name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.4px;
  line-height: 1.1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* Category count */
.pack-tile__meta {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  font-weight: 500;
}

/* ---- Premium tile variant ---- */
.pack-tile--premium .pack-tile__img.loaded {
  filter: brightness(0.68) saturate(0.8);
}

/* Lock badge top-right */
.pack-tile__lock {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: rgba(10, 8, 6, 0.65);
  border: 1px solid rgba(245, 166, 35, 0.35);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}

/* Arrow hint */
.pack-tile__arrow {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s var(--ease-spring);
}

.pack-tile:hover .pack-tile__arrow {
  opacity: 1;
  transform: scale(1);
}

/* Pack shimmer */
.pack-tile__shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, var(--surface-2) 0%, var(--surface-3) 40%, var(--surface-2) 80%);
  background-size: 250% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

/* ==========================================
   CATEGORY GRID (Categories screen)
   ========================================== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 520px) {
  .cat-grid { gap: 12px; }
}

@media (min-width: 680px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}

/* Category tile */
.cat-tile {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  cursor: pointer;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  will-change: transform;
  box-shadow: 0 3px 12px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.2);
  transition:
    transform    0.28s var(--ease-out),
    box-shadow   0.28s var(--ease-out),
    border-color 0.18s var(--ease-std);
}

.cat-tile:hover {
  transform: translateY(-4px) scale(1.012);
  box-shadow: 0 8px 20px rgba(0,0,0,0.5), 0 18px 36px rgba(0,0,0,0.35), 0 0 0 1px var(--accent);
  border-color: var(--accent);
}

.cat-tile:active {
  transform: scale(0.97);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  transition: transform 0.1s var(--ease-std), box-shadow 0.1s var(--ease-std);
}

.cat-tile__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.35s var(--ease-out), transform 0.5s var(--ease-out);
  transform: scale(1.04);
  filter: brightness(0.85);
}

.cat-tile__img.loaded { opacity: 1; transform: scale(1); }
.cat-tile:hover .cat-tile__img { transform: scale(1.07); }

.cat-tile__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.15) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px 14px;
  gap: 3px;
}

.cat-tile__name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.cat-tile__count {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
}

.cat-tile__shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, var(--surface-2) 0%, var(--surface-3) 40%, var(--surface-2) 80%);
  background-size: 250% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

/* ==========================================
   WALLPAPER GRID (Walls screen)
   ========================================== */
.wall-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 520px) { .wall-grid { gap: 12px; } }

@media (min-width: 680px) {
  .wall-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}

@media (min-width: 900px) {
  .wall-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
}

/* Wall card */
.card {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 9 / 16;
  background: var(--surface-2);
  cursor: pointer;
  border: 1px solid var(--border-soft);
  outline: none;
  will-change: transform;
  box-shadow: 0 3px 10px rgba(0,0,0,0.28), 0 1px 3px rgba(0,0,0,0.18);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.2s var(--ease-std);
}

.card:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: 0 10px 24px rgba(0,0,0,0.5), 0 22px 44px rgba(0,0,0,0.38), 0 0 0 1px var(--accent);
  border-color: var(--accent);
  z-index: 2;
}

.card:active {
  transform: scale(0.97);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: transform 0.1s var(--ease-std), box-shadow 0.1s var(--ease-std);
}

.card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.35s var(--ease-out), transform 0.5s var(--ease-out);
  transform: scale(1.04);
}

.card__img.loaded { opacity: 1; transform: scale(1); }
.card:hover .card__img { transform: scale(1.07); }

.card__shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, var(--surface-2) 0%, var(--surface-3) 40%, var(--surface-2) 80%);
  background-size: 250% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: inherit;
}

.card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.1) 45%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
  display: flex;
  align-items: flex-end;
  padding: 14px;
}

.card:hover .card__overlay { opacity: 1; }

.card__cta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transform: translateY(4px);
  transition: transform 0.22s var(--ease-out);
}

.card:hover .card__cta { transform: translateY(0); }

/* ==========================================
   SHIMMER ANIMATION
   ========================================== */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================
   SKELETON LOADING (Home)
   ========================================== */
.skeleton-pack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 800px) {
  .skeleton-pack-grid { grid-template-columns: repeat(3, 1fr); }
}

.skeleton-tile {
  border-radius: var(--r-xl);
  aspect-ratio: 9 / 14;
  background: linear-gradient(105deg, var(--surface-2) 0%, var(--surface-3) 40%, var(--surface-2) 80%);
  background-size: 250% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border: 1px solid var(--border-soft);
}

.skeleton-tile:nth-child(2) { animation-delay: 0.1s; }
.skeleton-tile:nth-child(3) { animation-delay: 0.2s; }
.skeleton-tile:nth-child(4) { animation-delay: 0.3s; }

/* ==========================================
   GRID ENTRANCE ANIMATION
   ========================================== */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.grid-enter > * {
  opacity: 0;
  animation: cardIn 0.38s var(--ease-out) forwards;
}

.grid-enter > *:nth-child(1)  { animation-delay:  0ms; }
.grid-enter > *:nth-child(2)  { animation-delay: 40ms; }
.grid-enter > *:nth-child(3)  { animation-delay: 80ms; }
.grid-enter > *:nth-child(4)  { animation-delay:120ms; }
.grid-enter > *:nth-child(5)  { animation-delay:160ms; }
.grid-enter > *:nth-child(6)  { animation-delay:200ms; }
.grid-enter > *:nth-child(7)  { animation-delay:240ms; }
.grid-enter > *:nth-child(8)  { animation-delay:280ms; }
.grid-enter > *:nth-child(n+9){ animation-delay:280ms; }

/* ==========================================
   ERROR STATE
   ========================================== */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 64px 24px;
  text-align: center;
}

.error-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  display: flex; align-items: center; justify-content: center;
  color: rgba(239,68,68,0.7);
}

.error-title {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 700;
  color: var(--text-sub);
}

.error-msg {
  font-size: 13px; max-width: 260px;
  line-height: 1.65; color: var(--text-muted);
}

.retry-btn {
  padding: 10px 24px;
  border-radius: var(--r-sm);
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent-2);
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast), box-shadow var(--t-fast);
}

.retry-btn:hover {
  background: rgba(124,106,247,0.22);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ==========================================
   EMPTY STATE
   ========================================== */
.empty-state {
  display: flex; align-items: center; justify-content: center;
  min-height: 200px; color: var(--text-muted); font-size: 14px;
}

/* ==========================================
   LOCKED CARD (Premium walls)
   ========================================== */
.card--locked {
  cursor: pointer;
}

.card--locked .card__img.loaded {
  filter: blur(7px) brightness(0.65) saturate(0.7);
  transform: scale(1.08);
}

.card--locked:hover .card__img {
  transform: scale(1.08);
}

.card__lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
}

.card__lock-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(10, 8, 6, 0.7);
  border: 1px solid rgba(245, 166, 35, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
}

.card--locked:hover .card__lock-icon {
  transform: scale(1.12);
  box-shadow: 0 6px 20px rgba(0,0,0,0.6), 0 0 0 3px rgba(245,166,35,0.2);
}

/* ==========================================
   PREMIUM MODAL
   ========================================== */
.premium-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(4,4,6,0.8);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  animation: pmFadeIn 0.22s var(--ease-out) both;
}

@media (min-width: 520px) {
  .premium-modal {
    align-items: center;
    padding: 24px;
  }
}

@keyframes pmFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.premium-modal.closing {
  animation: pmFadeOut 0.22s var(--ease-std) forwards;
}

@keyframes pmFadeOut { to { opacity: 0; } }

/* Panel */
.premium-modal__panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  box-shadow:
    0 -20px 60px rgba(0,0,0,0.7),
    0 0 0 1px rgba(255,255,255,0.04) inset;
  animation: pmSlideUp 0.34s var(--ease-spring) both;
}

@media (min-width: 520px) {
  .premium-modal__panel {
    border-radius: var(--r-xl);
    border-bottom: 1px solid var(--border);
    animation: pmScaleIn 0.34s var(--ease-spring) both;
  }
}

@keyframes pmSlideUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pmScaleIn {
  from { opacity: 0; transform: scale(0.9) translateY(16px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

.premium-modal.closing .premium-modal__panel {
  animation: pmSlideDown 0.22s var(--ease-std) forwards;
}

@keyframes pmSlideDown {
  to { opacity: 0; transform: translateY(30px); }
}

/* Background image strip */
.premium-modal__bg-wrap {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: var(--surface-2);
}

.premium-modal__bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.55) saturate(0.8);
}

.premium-modal__bg-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 20%, var(--surface) 100%);
}

/* Close button */
.premium-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: background var(--t-fast);
}

.premium-modal__close:hover { background: rgba(255,255,255,0.14); }
.premium-modal__close:active { transform: scale(0.9); }

/* Body content */
.premium-modal__body {
  padding: 4px 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.premium-modal__icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid rgba(245,166,35,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  margin-top: -28px;
  position: relative;
  box-shadow: 0 4px 20px rgba(245,166,35,0.18);
}

.premium-modal__title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.premium-modal__name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-top: -2px;
}

.premium-modal__desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 300px;
}

/* Feature list */
.premium-modal__features {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  border: 1px solid var(--border-soft);
  margin: 4px 0;
}

.premium-modal__feature {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text-sub);
  font-weight: 500;
}

.premium-modal__feature svg {
  flex-shrink: 0;
  color: #4ade80;
}

/* CTA button */
.premium-modal__cta {
  width: 100%;
  padding: 14px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #f59e0b 0%, var(--gold) 100%);
  border: none;
  color: #1a0f00;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.2px;
  cursor: pointer;
  margin-top: 4px;
  transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 20px rgba(245, 166, 35, 0.35);
}

.premium-modal__cta:hover {
  opacity: 0.92;
  box-shadow: 0 6px 28px rgba(245,166,35,0.5);
}

.premium-modal__cta:active {
  transform: scale(0.97);
  transition-duration: 0.08s;
}

/* ==========================================
   LIGHTBOX
   ========================================== */
.lightbox {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(4,4,6,0.88);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  animation: lbFadeIn 0.22s var(--ease-out) both;
}

@keyframes lbFadeIn {
  from { opacity:0; backdrop-filter: blur(0px); }
  to   { opacity:1; backdrop-filter: blur(28px); }
}

.lightbox.closing { animation: lbFadeOut 0.22s var(--ease-std) forwards; }

@keyframes lbFadeOut { to { opacity:0; } }

.lightbox__panel {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  max-width: min(400px, calc(100vw - 32px));
  width: 100%;
  box-shadow:
    0 40px 80px rgba(0,0,0,0.75),
    0 16px 32px rgba(0,0,0,0.5),
    0 0 0 1px rgba(255,255,255,0.05) inset;
  animation: lbSlideIn 0.32s var(--ease-spring) both;
}

@keyframes lbSlideIn {
  from { opacity:0; transform: scale(0.88) translateY(24px); }
  to   { opacity:1; transform: scale(1)   translateY(0); }
}

.lightbox.closing .lightbox__panel { animation: lbSlideOut 0.22s var(--ease-std) forwards; }

@keyframes lbSlideOut { to { opacity:0; transform: scale(0.93) translateY(10px); } }

.lightbox__img-wrap {
  position: relative;
  aspect-ratio: 9/16;
  max-height: 55vh;
  overflow: hidden;
  background: var(--surface-2);
}

.lightbox__img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  opacity: 0; transition: opacity 0.35s var(--ease-out);
}

.lightbox__img.loaded { opacity: 1; }

.lightbox__img-loader {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
}

.img-spinner {
  width: 30px; height: 30px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.lightbox__footer {
  padding: 16px 18px;
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--border-soft);
}

.lightbox__meta { display: flex; flex-direction: column; gap: 2px; }

.lightbox__label {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700;
  color: var(--text); letter-spacing: -0.3px;
}

.lightbox__sub { font-size: 11px; color: var(--text-muted); font-weight: 500; }

.lightbox__actions { display: flex; gap: 8px; }

.lb-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  border: none; text-decoration: none;
}

.lb-btn:active { transform: scale(0.96); }

.lb-btn--primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 2px 8px rgba(124,106,247,0.35);
}

.lb-btn--primary:hover {
  background: var(--accent-2);
  box-shadow: 0 4px 14px rgba(124,106,247,0.45);
}

.lb-btn--ghost {
  background: var(--surface-2);
  color: var(--text-sub);
  border: 1px solid var(--border);
}

.lb-btn--ghost:hover { background: var(--surface-3); color: var(--text); }

.lightbox__close {
  position: absolute; top: 14px; right: 14px; z-index: 10;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast), transform var(--t-fast);
  backdrop-filter: blur(6px);
}

.lightbox__close:hover { background: rgba(255,255,255,0.14); }
.lightbox__close:active { transform: scale(0.9); }

/* ==========================================
   TOAST
   ========================================== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 8px 28px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);
  border: 1px solid transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.28s var(--ease-out), transform 0.28s var(--ease-spring);
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast--ok {
  background: rgba(22, 38, 22, 0.9);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.25);
}

.toast--warn {
  background: rgba(38, 28, 8, 0.9);
  color: var(--gold);
  border-color: rgba(245, 166, 35, 0.25);
}
