/* ============================================================
   Promptopia — پرامپتوپیا
   Aurora design system · RTL/LTR aware · dark & light themes
   ============================================================ */

@font-face {
  font-family: 'Vazirmatn';
  src: url('../assets/fonts/Vazirmatn-Variable.woff2') format('woff2 supports variations'),
       url('../assets/fonts/Vazirmatn-Variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #07080d;
  --bg-soft: #0c0e16;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef0f6;
  --muted: #9aa1b5;
  --violet: #a78bfa;
  --pink: #f472b6;
  --amber: #fbbf24;
  --grad: linear-gradient(120deg, #8b5cf6 0%, #d946ef 48%, #fb923c 100%);
  --grad-soft: linear-gradient(120deg, rgba(139, 92, 246, .22), rgba(217, 70, 239, .18), rgba(251, 146, 60, .14));
  --shadow: 0 18px 50px rgba(0, 0, 0, .5);
  --radius: 18px;
  --header-h: 64px;
  color-scheme: dark;
  /* keep the scrollbar slot reserved so locking body scroll doesn't shift layout */
  scrollbar-gutter: stable;
}

/* ---- themes ---- */
html[data-theme="light"] {
  --bg: #f4f5fa;
  --bg-soft: #ffffff;
  --surface: rgba(15, 18, 34, 0.04);
  --surface-2: rgba(15, 18, 34, 0.08);
  --border: rgba(15, 18, 34, 0.1);
  --border-strong: rgba(15, 18, 34, 0.2);
  --text: #171923;
  --muted: #5d6474;
  --violet: #7c3aed;
  --pink: #db2777;
  --amber: #d97706;
  --grad: linear-gradient(120deg, #7c3aed 0%, #db2777 48%, #f59e0b 100%);
  --grad-soft: linear-gradient(120deg, rgba(124, 58, 237, .14), rgba(219, 39, 119, .1), rgba(245, 158, 11, .1));
  --shadow: 0 18px 50px rgba(23, 25, 35, .14);
  color-scheme: light;
}

html[data-theme="midnight"] {
  --bg: #060913;
  --bg-soft: #0a1222;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #e8edf8;
  --muted: #8b96b3;
  --violet: #818cf8;
  --pink: #f472b6;
  --amber: #fbbf24;
  --grad: linear-gradient(120deg, #2563eb 0%, #7c3aed 48%, #ec4899 100%);
  --grad-soft: linear-gradient(120deg, rgba(37, 99, 235, .22), rgba(124, 58, 237, .18), rgba(236, 72, 153, .14));
  --shadow: 0 18px 50px rgba(0, 0, 12, .55);
  color-scheme: dark;
}

html[data-theme="emerald"] {
  --bg: #051410;
  --bg-soft: #081f18;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #e6f5ee;
  --muted: #8fb3a4;
  --violet: #34d399;
  --pink: #f472b6;
  --amber: #fbbf24;
  --grad: linear-gradient(120deg, #059669 0%, #10b981 48%, #a3e635 100%);
  --grad-soft: linear-gradient(120deg, rgba(5, 150, 105, .22), rgba(16, 185, 129, .18), rgba(163, 230, 53, .14));
  --shadow: 0 18px 50px rgba(0, 12, 6, .55);
  color-scheme: dark;
}

html[data-theme="sunset"] {
  --bg: #150806;
  --bg-soft: #200d09;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f7ece7;
  --muted: #b89a90;
  --violet: #fb7185;
  --pink: #fb923c;
  --amber: #fbbf24;
  --grad: linear-gradient(120deg, #e11d48 0%, #f97316 48%, #f59e0b 100%);
  --grad-soft: linear-gradient(120deg, rgba(225, 29, 72, .22), rgba(249, 115, 22, .18), rgba(245, 158, 11, .16));
  --shadow: 0 18px 50px rgba(18, 6, 4, .55);
  color-scheme: dark;
}

html[data-theme="cream"] {
  --bg: #faf6f0;
  --bg-soft: #ffffff;
  --surface: rgba(64, 42, 20, 0.05);
  --surface-2: rgba(64, 42, 20, 0.09);
  --border: rgba(64, 42, 20, 0.1);
  --border-strong: rgba(64, 42, 20, 0.2);
  --text: #2b2119;
  --muted: #7d6f62;
  --violet: #c2410c;
  --pink: #e11d48;
  --amber: #d97706;
  --grad: linear-gradient(120deg, #f43f5e 0%, #f97316 48%, #d97706 100%);
  --grad-soft: linear-gradient(120deg, rgba(244, 63, 94, .14), rgba(249, 115, 22, .12), rgba(217, 119, 6, .1));
  --shadow: 0 18px 50px rgba(90, 55, 20, .16);
  color-scheme: light;
}

html[data-theme="ocean"] {
  --bg: #04131d;
  --bg-soft: #07212f;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #e2f2fb;
  --muted: #8fb0c4;
  --violet: #38bdf8;
  --pink: #2dd4bf;
  --amber: #fbbf24;
  --grad: linear-gradient(120deg, #0ea5e9 0%, #06b6d4 48%, #22d3ee 100%);
  --grad-soft: linear-gradient(120deg, rgba(14, 165, 233, .22), rgba(6, 182, 212, .18), rgba(34, 211, 238, .14));
  --shadow: 0 18px 50px rgba(0, 10, 20, .55);
  color-scheme: dark;
}

html[data-theme="lavender"] {
  --bg: #100b1d;
  --bg-soft: #181030;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f1ecfb;
  --muted: #a99cc9;
  --violet: #a78bfa;
  --pink: #f0abfc;
  --amber: #fbbf24;
  --grad: linear-gradient(120deg, #8b5cf6 0%, #a855f7 48%, #f0abfc 100%);
  --grad-soft: linear-gradient(120deg, rgba(139, 92, 246, .22), rgba(168, 85, 247, .18), rgba(240, 171, 252, .14));
  --shadow: 0 18px 50px rgba(16, 8, 30, .55);
  color-scheme: dark;
}

html[data-theme="rose"] {
  --bg: #1a080f;
  --bg-soft: #2a0d18;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #fdeef2;
  --muted: #c08d9e;
  --violet: #fb7185;
  --pink: #f472b6;
  --amber: #fbbf24;
  --grad: linear-gradient(120deg, #e11d48 0%, #ec4899 48%, #f472b6 100%);
  --grad-soft: linear-gradient(120deg, rgba(225, 29, 72, .22), rgba(236, 72, 153, .18), rgba(244, 114, 182, .14));
  --shadow: 0 18px 50px rgba(26, 6, 14, .55);
  color-scheme: dark;
}

html[data-theme="graphite"] {
  --bg: #101318;
  --bg-soft: #191d24;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef1f5;
  --muted: #9aa3ae;
  --violet: #94a3b8;
  --pink: #e2e8f0;
  --amber: #fbbf24;
  --grad: linear-gradient(120deg, #64748b 0%, #94a3b8 48%, #cbd5e1 100%);
  --grad-soft: linear-gradient(120deg, rgba(100, 116, 139, .22), rgba(148, 163, 184, .18), rgba(203, 213, 225, .14));
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background .3s ease, color .3s ease;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3 { line-height: 1.35; margin: 0; }
::selection { background: rgba(217, 70, 239, .35); }

.wrap { width: min(1180px, 92vw); margin-inline: auto; }

/* ---------- aurora background ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; animation: float 18s ease-in-out infinite alternate; }
html[data-theme="light"] .blob, html[data-theme="cream"] .blob { opacity: .25; }
.b1 { width: 520px; height: 520px; background: #7c3aed33; top: -160px; inset-inline-start: -120px; animation-duration: 16s; }
.b2 { width: 620px; height: 620px; background: #d946ef22; top: 22vh; inset-inline-end: -220px; animation-duration: 22s; animation-delay: -6s; }
.b3 { width: 480px; height: 480px; background: #f59e0b18; bottom: -180px; inset-inline-start: 30vw; animation-duration: 26s; animation-delay: -12s; }
/* aurora hues per theme */
html[data-theme="midnight"] .b1 { background: #2563eb33; }
html[data-theme="midnight"] .b2 { background: #7c3aed22; }
html[data-theme="midnight"] .b3 { background: #ec489918; }
html[data-theme="emerald"] .b1 { background: #10b98133; }
html[data-theme="emerald"] .b2 { background: #34d39922; }
html[data-theme="emerald"] .b3 { background: #a3e63518; }
html[data-theme="sunset"] .b1 { background: #e11d4833; }
html[data-theme="sunset"] .b2 { background: #f9731622; }
html[data-theme="sunset"] .b3 { background: #f59e0b18; }
html[data-theme="cream"] .b1 { background: #f43f5e2e; }
html[data-theme="cream"] .b2 { background: #f59e0b22; }
html[data-theme="cream"] .b3 { background: #d9770618; }
html[data-theme="ocean"] .b1 { background: #0ea5e933; }
html[data-theme="ocean"] .b2 { background: #06b6d422; }
html[data-theme="ocean"] .b3 { background: #22d3ee18; }
html[data-theme="lavender"] .b1 { background: #8b5cf633; }
html[data-theme="lavender"] .b2 { background: #a855f722; }
html[data-theme="lavender"] .b3 { background: #f0abfc18; }
html[data-theme="rose"] .b1 { background: #e11d4833; }
html[data-theme="rose"] .b2 { background: #ec489922; }
html[data-theme="rose"] .b3 { background: #f472b618; }
html[data-theme="graphite"] .b1 { background: #64748b33; }
html[data-theme="graphite"] .b2 { background: #94a3b822; }
html[data-theme="graphite"] .b3 { background: #cbd5e118; }
@keyframes float {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(46px, 34px) scale(1.08); }
}

/* ---------- shared entrance ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } }
.hero-badge { animation: fadeUp .6s cubic-bezier(.2, .7, .2, 1) backwards; }
.hero-title { animation: fadeUp .6s .07s cubic-bezier(.2, .7, .2, 1) backwards; }
.hero-sub { animation: fadeUp .6s .14s cubic-bezier(.2, .7, .2, 1) backwards; }
.hero-cta { animation: fadeUp .6s .2s cubic-bezier(.2, .7, .2, 1) backwards; }
.hero-stats { animation: fadeUp .6s .26s cubic-bezier(.2, .7, .2, 1) backwards; }

[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .65s ease, transform .65s cubic-bezier(.2, .7, .2, 1); }
[data-reveal].in { opacity: 1; transform: none; }

/* scrollbar + focus */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 4px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .3s ease;
}
.site-header.scrolled { box-shadow: 0 10px 32px rgba(0, 0, 0, .28); }
.header-in { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; }
.logo { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 4px 18px rgba(217, 70, 239, .4); transition: transform .4s cubic-bezier(.34, 1.56, .64, 1); }
.brand:hover .logo { transform: rotate(-8deg) scale(1.08); }
.header-nav { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface);
  transition: background .2s, border-color .2s, transform .2s;
  font-weight: 700; font-size: .8rem;
}
#langToggle { width: auto; min-width: 38px; padding: 0 13px; border-radius: 999px; letter-spacing: .02em; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); transform: translateY(-1px); }

/* theme icon swap (by light/dark mode, not theme id) */
html[data-mode="dark"] .ic-sun { display: none; }
html[data-mode="light"] .ic-moon { display: none; }

/* ---------- theme picker ---------- */
.theme-wrap { position: relative; }
.theme-menu {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 70;
  min-width: 190px; padding: 8px;
  border: 1px solid var(--border-strong); border-radius: 16px;
  background: var(--bg-soft); box-shadow: var(--shadow);
  display: grid; gap: 3px;
}
.theme-menu[hidden] { display: none; }
.theme-opt {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 11px; border-radius: 11px;
  font-size: .85rem; font-weight: 600; color: var(--text);
  transition: background .15s;
}
.theme-opt:hover { background: var(--surface-2); }
.theme-opt.active { background: var(--surface-2); }
.theme-dots { display: inline-flex; flex: 0 0 auto; }
.theme-dots i { width: 15px; height: 15px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.theme-dots i + i { margin-inline-start: -5px; }
.theme-check { margin-inline-start: auto; color: var(--violet); font-size: .92rem; font-weight: 800; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 14px; font-weight: 700; font-size: .95rem;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-sm { padding: 8px 14px; border-radius: 11px; font-size: .85rem; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 26px rgba(217, 70, 239, .35); position: relative; overflow: hidden; }
.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .35) 50%, transparent 60%);
  transform: translateX(-130%);
  transition: transform .65s ease;
  pointer-events: none;
}
.btn-primary:hover::after { transform: translateX(130%); }
.btn-primary:hover { box-shadow: 0 14px 32px rgba(217, 70, 239, .5); }
.btn-ghost { border: 1px solid var(--border-strong); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-2); }

/* ---------- hero (minimal) ---------- */
.hero { padding: clamp(38px, 6vh, 64px) 0 clamp(26px, 4vh, 42px); text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 13px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: .76rem; color: var(--muted); margin-bottom: 16px;
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 0 rgba(244, 114, 182, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(244, 114, 182, 0); } 100% { box-shadow: 0 0 0 0 rgba(244, 114, 182, 0); } }

.hero-title { font-size: clamp(1.45rem, 3.6vw, 2.3rem); font-weight: 800; letter-spacing: -.015em; }
.grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero-sub { max-width: 560px; margin: 12px auto 0; color: var(--muted); font-size: .93rem; line-height: 1.8; }
.hero-cta { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 20px; }
.hero-cta .btn { padding: 10px 20px; font-size: .88rem; }

.hero-stats {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px;
}
.stat {
  min-width: 110px; padding: 10px 18px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface);
}
.stat b { display: block; font-size: 1.15rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: .72rem; color: var(--muted); }

/* ---------- prompt of the day ---------- */
.daily { margin-top: 22px; display: flex; justify-content: center; }
.daily-card {
  display: flex; align-items: center; gap: 14px; width: min(560px, 100%);
  padding: 12px 16px; border-radius: 18px; text-align: start;
  border: 1px solid var(--border-strong); background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .25s cubic-bezier(.2, .7, .2, 1), border-color .25s, box-shadow .25s;
}
.daily-card:hover { transform: translateY(-3px); border-color: var(--violet); }
.daily-card img {
  width: 52px; height: 65px; border-radius: 12px; object-fit: cover; flex: 0 0 auto;
  border: 1px solid var(--border); box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.daily-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.daily-badge {
  font-size: .72rem; font-weight: 700; color: var(--violet);
  display: inline-flex; align-items: center; gap: 6px;
}
.daily-badge::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto;
  background: var(--grad); animation: pulse 2s infinite;
}
.daily-name {
  font-weight: 800; font-size: .95rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.daily-cta { flex: 0 0 auto; }

/* ---------- toolbar ---------- */
.gallery-section { padding: 0 0 64px; scroll-margin-top: calc(var(--header-h) + 10px); }
/* soft gradient hairline marks the hero -> gallery transition */
.gallery-section::before {
  content: ''; display: block;
  width: min(620px, 74vw); height: 1px; margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--border-strong) 18%, var(--border-strong) 82%, transparent);
}
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: clamp(26px, 4vh, 40px); margin-bottom: 14px; }
.toolbar-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-pair { display: flex; gap: 10px; flex: 1 1 100%; }
.search {
  display: flex; align-items: center; gap: 9px;
  flex: 1 1 0; min-width: 0;
  padding: 11px 16px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted);
  transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(167, 139, 250, .18); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; }
.search input::placeholder { color: var(--muted); }

.select {
  padding: 11px 14px; border-radius: 14px; font: inherit; font-size: .9rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer;
}

/* native dropdown list: force readable colors on every platform/theme.
   --surface is translucent and native popups don't composite it over the
   page (dark text on white popup), so use the opaque --bg instead. */
.select option,
.select optgroup {
  background: var(--bg);
  color: var(--text);
}

.dice-btn { padding: 10px 16px; }
.dice { display: inline-block; transition: transform .3s; }
.dice-btn:hover .dice { animation: diceSpin .55s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes diceSpin { 50% { transform: rotate(180deg) scale(1.2); } }

/* ---------- category navigation (below hero) ---------- */
.category-nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
.category-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 15px; border-radius: 999px; font-size: .85rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  transition: all .2s;
}
.category-link:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.category-link b { font-size: .72rem; opacity: .75; font-weight: 700; }
.category-icon { line-height: 1; }
.category-link-fav { border-color: rgba(244, 63, 94, .35); }
.category-link-fav:hover { border-color: rgba(244, 63, 94, .7); color: var(--pink); }

.count { color: var(--muted); font-size: .85rem; margin-bottom: 18px; }

/* ---------- per-category sections ---------- */
.prompt-section { padding: 32px 0 46px; scroll-margin-top: calc(var(--header-h) + 12px); }
.prompt-section + .prompt-section { border-top: 1px solid var(--border); }
.section-heading {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
.section-heading-main { display: flex; align-items: center; gap: 12px; }
.section-icon {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 13px;
  background: var(--grad-soft); border: 1px solid var(--border);
  font-size: 1.1rem;
}
.section-heading h2 { font-size: 1.18rem; font-weight: 800; line-height: 1.3; }
.section-count { color: var(--muted); font-size: .78rem; margin: 2px 0 0; }
.section-top {
  padding: 6px 13px; border-radius: 999px; font-size: .76rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  transition: all .2s;
}
.section-top:hover { color: var(--text); border-color: var(--border-strong); }
.section-pagination { margin-top: 24px; }
/* collapsed sections: preview row + centered "view all" button */
.section-more-row { display: flex; justify-content: center; margin-top: 22px; }
.section-more-row[hidden] { display: none; }
.section-more { padding: 10px 22px; font-size: .86rem; }
.section-more:hover { border-color: var(--violet); color: var(--violet); }

/* ---------- grid & cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 18px; transition: opacity .18s ease, transform .18s ease; }
.grid.grid-in { animation: gridIn .45s cubic-bezier(.2, .7, .2, 1); }
@keyframes gridIn { from { opacity: .35; transform: translateY(10px); } }
.card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; outline: none;
  /* no iOS long-press callout / selection on gallery cards */
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
  transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s ease, border-color .3s ease;
  opacity: 0;
}
.card.in { opacity: 1; animation: cardIn .55s cubic-bezier(.2, .7, .2, 1) backwards; }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.card:hover, .card:focus-visible { border-color: var(--border-strong); box-shadow: var(--shadow); }
.card-media { position: relative; aspect-ratio: 4 / 5; background: var(--surface-2); background-size: cover; background-position: center; }
/* img is positioned so it paints above the skeleton placeholder; the blur
   background shows through the translucent shimmer until the photo loads */
.card-media img { position: relative; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s ease, transform .5s ease; }
.card-media img.loaded { opacity: 1; }

.card-media::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(7, 8, 13, .78), rgba(7, 8, 13, 0) 52%);
  pointer-events: none;
  opacity: 0; transition: opacity .35s ease;
}
.card:hover .card-media::after, .card:focus-visible .card-media::after,
.card.touched .card-media::after { opacity: 1; }
html[data-theme="light"] .card-media::after { background: linear-gradient(to top, rgba(23, 25, 35, .62), rgba(23, 25, 35, 0) 52%); }
.card-media .skeleton { position: absolute; inset: 0; opacity: .55; background: linear-gradient(100deg, var(--surface) 40%, var(--surface-2) 50%, var(--surface) 60%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.badge {
  position: absolute; top: 12px; inset-inline-start: 12px; z-index: 2;
  padding: 4px 11px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: rgba(7, 8, 13, .55); color: #fff;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .16);
  opacity: 0; transform: translateY(-6px);
  transition: opacity .3s ease, transform .3s ease;
}
.card:hover .badge, .card:focus-visible .badge, .card.touched .badge {
  opacity: 1; transform: translateY(0);
}

.fav {
  position: absolute; top: 10px; inset-inline-end: 10px; z-index: 2;
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px;
  background: rgba(7, 8, 13, .5); color: #fff;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .14);
  transition: transform .2s, background .2s, opacity .3s ease;
  opacity: 0;
  /* invisible controls must not swallow taps (opacity doesn't block hit-testing) */
  pointer-events: none;
}
.card:hover .fav, .card:focus-visible .fav, .card.touched .fav { opacity: 1; pointer-events: auto; }
.fav:hover { transform: scale(1.12); }
.fav.on { color: #fb7185; }
.fav.on svg path { fill: currentColor; }

.card-title {
  position: absolute; bottom: 56px; inset-inline: 0; z-index: 2;
  padding: 10px 16px; color: #fff; font-weight: 700; font-size: .92rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease;
}
.card:hover .card-title, .card:focus-visible .card-title,
.card.touched .card-title { opacity: 1; transform: translateY(0); }

/* text prompts have no photo to admire — their title/category stay visible
   without hover, on desktop and mobile alike */
.card-text .card-media::after { opacity: 1; }
.card-text .card-title { opacity: 1; transform: none; }
.card-text .badge { opacity: 1; transform: none; }

.card-foot {
  position: absolute; bottom: 0; inset-inline: 0; z-index: 3;
  display: flex; gap: 8px; padding: 12px;
  background: linear-gradient(to top, rgba(7, 8, 13, .85), rgba(7, 8, 13, 0));
  opacity: 0; transform: translateY(8px);
  pointer-events: none; /* see .fav — hidden buttons must not intercept taps */
  transition: opacity .3s ease, transform .3s ease;
}
html[data-theme="light"] .card-foot {
  background: linear-gradient(to top, rgba(23, 25, 35, .8), rgba(23, 25, 35, 0));
}
.card:hover .card-foot, .card:focus-visible .card-foot, .card.touched .card-foot {
  opacity: 1; transform: translateY(0); pointer-events: auto;
}
.card-foot .btn-copy, .card-foot .btn-use {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 8px; border-radius: 11px; font-size: .8rem; font-weight: 700;
  transition: background .2s, color .2s;
}
.card-foot .btn-copy { background: var(--surface-2); color: var(--text); }
.card-foot .btn-copy:hover { background: var(--grad); color: #fff; }
.card-foot .btn-use { border: 1px solid var(--border); color: var(--muted); }
.card-foot .btn-use:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------- pagination ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 30px; }
.page-btn {
  min-width: 40px; height: 40px; padding: 0 10px;
  display: inline-grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted);
  font-weight: 700; font-size: .9rem;
  transition: all .2s;
}
.page-btn:hover:not(:disabled):not(.active) { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.page-btn.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(217, 70, 239, .35); }
.page-btn:disabled { opacity: .35; cursor: default; }
.page-dots { color: var(--muted); padding: 0 2px; }
.page-info { color: var(--muted); font-size: .82rem; margin-inline: 8px; }

/* ---------- empty state ---------- */
.empty { text-align: center; padding: 70px 0; color: var(--muted); }
.empty-emoji { font-size: 2.6rem; margin-bottom: 10px; }
.empty-hint { font-size: .88rem; opacity: .8; }

/* ---------- how it works ---------- */
.how { padding: 30px 0 80px; }
.section-title { text-align: center; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 900; margin-bottom: 30px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.step { padding: 26px 22px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); position: relative; overflow: hidden; }
.step::before { content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 3px; background: var(--grad); }
.step-n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--grad-soft); color: var(--violet); font-weight: 900; margin-bottom: 12px; }
.step h3 { font-size: 1.02rem; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: .9rem; margin: 0; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 30px; background: var(--bg-soft); }
.footer-in { display: flex; justify-content: space-between; gap: 26px; flex-wrap: wrap; }
.footer-brand .brand-name { font-weight: 900; font-size: 1.1rem; }
.footer-brand p { color: var(--muted); font-size: .88rem; max-width: 420px; margin: 8px 0 0; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: var(--muted); font-size: .9rem; transition: color .2s; display: inline-flex; align-items: center; gap: 7px; }
.footer-links a:hover { color: var(--violet); }
.footer-author .author-label { color: var(--muted); font-size: .78rem; font-weight: 700; opacity: .8; }
.footer-note { margin-top: 26px; color: var(--muted); font-size: .8rem; text-align: center; }

/* ---------- modal ---------- */
.modal {
  width: min(960px, 94vw); padding: 0; border: 1px solid var(--border);
  border-radius: 22px; background: var(--bg-soft); color: var(--text);
  box-shadow: var(--shadow); overflow: hidden; max-height: 88vh;
}
/* while the dialog is open the page behind must not scroll */
html.modal-open, html.modal-open body { overflow: hidden; }
.modal[open] { animation: modalIn .38s cubic-bezier(.2, .7, .2, 1); }
@keyframes modalIn { from { opacity: 0; transform: translateY(26px) scale(.97); } }
.modal[open]::backdrop { animation: backdropIn .3s ease; }
@keyframes backdropIn { from { opacity: 0; } }
.modal::backdrop { background: rgba(4, 5, 10, .7); backdrop-filter: blur(6px); }
.modal-bar { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 5; display: flex; gap: 8px; }
.modal-bar .icon-btn { background: rgba(7, 8, 13, .55); color: #fff; border-color: rgba(255, 255, 255, .18); }
.modal-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.modal-media { margin: 0; position: relative; min-height: 320px; background: var(--bg); background-size: cover; background-position: center; }
/* contain: the whole picture stays visible — cover would crop left/right */
.modal-media img { width: 100%; height: 100%; object-fit: contain; position: absolute; inset: 0; transition: opacity .28s ease; }
.modal-media img.img-fade { opacity: 0; }
.modal-body {
  padding: 26px 26px 24px; display: flex; flex-direction: column; gap: 14px;
  max-height: 82vh; overflow-y: auto; overscroll-behavior: contain;
}
.modal-meta { display: flex; align-items: center; gap: 10px; }
.modal-meta .badge { position: static; background: var(--grad-soft); color: var(--text); border-color: var(--border); }
.modal-date { color: var(--muted); font-size: .8rem; }

/* text prompts: category icon instead of the media panel, prompt text as the hero */
.modal-icon { display: none; width: 56px; height: 70px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.modal.text-prompt .modal-icon { display: block; }
.modal.text-prompt .modal-media { display: none; }
.modal.text-prompt .modal-grid { grid-template-columns: 1fr; }
.modal.text-prompt .prompt-box { font-size: .95rem; line-height: 1.9; max-height: none; min-height: 190px; }
.modal.text-prompt .modal-title { font-size: 1.5rem; }
.modal-title { font-size: 1.35rem; font-weight: 900; }

.variant-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.vtab {
  padding: 7px 16px; border-radius: 999px; font-size: .82rem; font-weight: 700;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.vtab.active { background: var(--grad); color: #fff; border-color: transparent; }

.prompt-box {
  flex: 1; min-height: 130px; max-height: 300px; overflow: auto;
  padding: 16px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: .86rem; line-height: 1.8; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
  user-select: all;
}

/* ---------- premium lock ---------- */
.badge-premium {
  color: #fbbf24 !important; font-weight: 800;
  text-shadow: 0 0 8px rgba(251,191,36,.5);
  opacity: 1 !important; transform: translateY(0) !important;
}
.prompt-box.locked { position: relative; user-select: none; overflow: hidden; }
.prompt-box.locked .lock-teaser {
  filter: blur(4px); opacity: .55; pointer-events: none;
  -webkit-user-select: none; user-select: none;
}
.lock-note {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  text-align: center; padding: 14px; background: transparent;
}
.lock-note .lock-star { font-size: 1.5rem; color: #fbbf24; filter: drop-shadow(0 0 10px rgba(251,191,36,.6)); }
.lock-note p { margin: 0; font-size: .8rem; line-height: 1.6; color: var(--muted); max-width: 340px; }
.lock-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.code-row { display: flex; gap: 8px; width: 100%; max-width: 360px; }
.code-row[hidden] { display: none; }
.code-input {
  flex: 1; direction: ltr; text-align: left;
  padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-family: ui-monospace, monospace; font-size: .78rem;
}

.modal-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.modal-actions .btn { flex: 1 1 auto; }

.modal-sites { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.site-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px 14px; border-radius: 13px; font-size: .85rem; font-weight: 700;
  border: 1px solid var(--border); background: var(--surface);
  transition: transform .2s, border-color .2s, background .2s;
  text-align: center;
}
.site-btn:hover { transform: translateY(-2px); border-color: var(--border-strong); background: var(--surface-2); }
.site-btn .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.site-btn.gemini .dot { background: conic-gradient(from 90deg, #4285f4, #9b72cb, #d96570, #f2a60c, #4285f4); }
.site-btn.chatgpt .dot { background: conic-gradient(from 90deg, #10a37f, #74d0ae, #10a37f); }
.site-btn.gemini:hover { border-color: rgba(66, 133, 244, .6); }
.site-btn.chatgpt:hover { border-color: rgba(16, 163, 127, .6); }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%) translateY(20px);
  padding: 11px 22px; border-radius: 999px; font-size: .88rem; font-weight: 700;
  background: var(--grad); color: #fff; box-shadow: 0 12px 30px rgba(217, 70, 239, .4);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- scroll top ---------- */
.top-btn {
  position: fixed; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); inset-inline-end: 26px; z-index: 60;
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.top-btn.show { opacity: 1; pointer-events: auto; }
.top-btn:hover { transform: translateY(-3px); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .modal-grid { grid-template-columns: 1fr; max-height: 88vh; overflow-y: auto; }
  .modal-media { min-height: 0; aspect-ratio: auto; display: grid; place-items: center; padding: 12px; }
  .modal-media img { position: static; width: auto; max-width: 100%; max-height: 40vh; height: auto; object-fit: contain; }
  .modal-media img.img-fade { opacity: 0; }
  .modal-body { max-height: none; overflow: visible; padding: 20px 18px 18px; }
  .modal-sites { grid-template-columns: 1fr; }
  /* bottom-sheet style modal on small screens */
  .modal {
    width: 100vw; max-width: 100vw;
    margin: auto auto 0;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
  }
  .modal[open] { animation: sheetIn .42s cubic-bezier(.2, .7, .2, 1); }
  @keyframes sheetIn { from { transform: translateY(56px); opacity: .5; } }
}

@media (max-width: 560px) {
  .hero { padding: 30px 0 22px; }
  .hero-cta .btn { flex: 0 1 auto; padding: 10px 16px; font-size: .84rem; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { min-width: 96px; padding: 10px 14px; }
  .stat b { font-size: 1.2rem; }
  .brand-name { font-size: 1rem; }
  .toolbar { gap: 9px; }
  .search-pair { flex-direction: column; gap: 8px; }
  .search { width: 100%; flex: 0 0 auto; }
  .toolbar-row { flex: 1 1 100%; flex-wrap: nowrap; }
  .toolbar-row .select { flex: 1 1 0; min-width: 0; width: auto; }
  .toolbar-row .dice-btn { flex: 0 0 auto; padding: 10px 12px; }
  .toolbar-row .dice-label { display: none; }
  .toolbar-row .icon-btn { flex: 0 0 auto; }
  .daily-card { gap: 10px; padding: 10px 12px; }
  .daily-card img { width: 44px; height: 55px; }
  .daily-name { font-size: .85rem; }
  .daily-cta { display: none; }
  .category-nav { gap: 6px; }
  .category-link { padding: 7px 12px; font-size: .78rem; }
  .section-heading h2 { font-size: 1.05rem; }
  .section-icon { width: 34px; height: 34px; font-size: .95rem; }
  .prompt-section { padding: 26px 0 34px; }
  .search { padding: 10px 13px; }
  .badge { font-size: .64rem; padding: 3px 8px; top: 8px; inset-inline-start: 8px; }
  .fav { width: 30px; height: 30px; border-radius: 9px; top: 7px; inset-inline-end: 7px; }
  .card-title { font-size: .82rem; padding: 10px 12px 8px; }
  .card-foot { padding: 8px; gap: 6px; }
  .card-foot .btn-copy, .card-foot .btn-use { padding: 8px 4px; font-size: .7rem; border-radius: 9px; gap: 4px; }
  .modal-body { padding: 16px 14px 14px; }
  .modal-title { font-size: 1.15rem; }
  .modal-actions .btn { padding: 11px 14px; }
  .footer-in { flex-direction: column; gap: 18px; }
  .footer-author { flex-direction: row; flex-wrap: wrap; gap: 14px; align-items: center; }
  .filter-panel { flex-direction: column; align-items: stretch; }
  .filter-row { min-width: unset; }
  .filter-select { width: 100%; }
  .builder-form { padding: 18px; }
  .builder-chips { gap: 5px; }
  .builder-chips .chip { padding: 5px 10px; font-size: .74rem; }
}

/* ===== Platform selector ===== */
.platform-selector { margin-bottom: 14px; }
.platform-label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em; }
.platform-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 10px;
  background: var(--surface-2); color: var(--text);
  border: 1.5px solid var(--border); font-size: .78rem;
  cursor: pointer; transition: all .2s;
}
.chip:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.chip-active {
  border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent); font-weight: 600;
}
.chip-icon { font-size: .9rem; }

/* ===== Advanced filters ===== */
.filter-panel {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px;
  padding: 16px; margin-bottom: 16px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px;
}
.filter-row { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.filter-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.filter-select { min-width: 150px; }

/* ===== Prompt Builder ===== */
.builder-section { padding: 48px 0 32px; }
.builder-desc { color: var(--muted); text-align: center; margin-bottom: 28px; font-size: .95rem; }
.builder-form {
  max-width: 680px; margin: 0 auto; padding: 28px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 18px;
}
.builder-field { margin-bottom: 20px; }
.builder-label {
  display: block; font-size: .82rem; font-weight: 600; color: var(--text);
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: .04em;
}
.builder-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.builder-actions { text-align: center; margin-top: 8px; }
.builder-result {
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border);
}
.builder-result h3 { font-size: .9rem; color: var(--muted); margin-bottom: 10px; }
.builder-result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
