/* ═══════════════════════════════════════════════════════════
   PromptNest — style.css (v2)
   Theme: Dark editorial with amber accent
   Fonts: Syne (display) + DM Mono (body/code)
═══════════════════════════════════════════════════════════ */

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  --bg:          #0d0d0f;
  --surface:     #141417;
  --surface-2:   #1c1c21;
  --border:      #2a2a32;
  --border-glow: #f5a62340;
  --accent:      #f5a623;
  --accent-dim:  #f5a62320;
  --accent-hover:#ffc15e;
  --text-1:      #f0ede8;
  --text-2:      #9896a0;
  --text-3:      #58566a;
  --red:         #ff5c5c;
  --green:       #4ade80;
  --blue:        #60a5fa;
  --radius:      12px;
  --radius-lg:   18px;
  --shadow:      0 4px 24px #00000060;
  --shadow-card: 0 2px 12px #00000040;
  --transition:  0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text-1);
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
h1, h2, h3 { font-family: 'Syne', sans-serif; letter-spacing: -0.02em; }
.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════
   HEADER / NAV
══════════════════════════════════════════════════════════ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  text-decoration: none;
}
.logo-icon { font-size: 22px; }
.logo-text {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.03em;
}

/* Desktop nav */
.main-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}
.nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--text-3);
  font-size: 13px;
  font-family: 'DM Mono', monospace;
  transition: all var(--transition);
}
.nav-link:hover { color: var(--text-1); background: var(--surface-2); }
.nav-link.active { color: var(--accent); background: var(--accent-dim); }

/* Auth area */
.auth-area { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Google sign-in button */
.btn-google {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  padding: 8px 16px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-google:hover { border-color: var(--accent); color: var(--accent); }

/* User chip (shown when logged in) */
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 14px 5px 6px;
}
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-dim);
}
.user-name {
  font-size: 13px;
  color: var(--text-1);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 12px;
  font-family: 'DM Mono', monospace;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition);
}
.btn-logout:hover { color: var(--red); }

/* Hamburger (mobile only) */
.hamburger {
  display: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 8px;
  width: 36px; height: 36px;
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Mobile nav drawer */
.mobile-nav {
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-nav .nav-link { display: block; }

/* ── Responsive nav ──────────────────────────────────────── */
@media (max-width: 700px) {
  .main-nav    { display: none; }
  .auth-area   { display: none; }
  .hamburger   { display: flex; margin-left: auto; }
  .user-name   { display: none; }
}

/* ══════════════════════════════════════════════════════════
   TOOLBAR (search + add button)
══════════════════════════════════════════════════════════ */
.toolbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.toolbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.search-wrap {
  flex: 1;
  position: relative;
}
.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 18px;
  pointer-events: none;
}
.search-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  padding: 10px 14px 10px 38px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input::placeholder { color: var(--text-3); }
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ══════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════ */
.btn-primary {
  background: var(--accent);
  color: #0d0d0f;
  border: none;
  border-radius: var(--radius);
  padding: 10px 20px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px #f5a62340;
}
.btn-primary:active { transform: translateY(0); }
.btn-full { width: 100%; justify-content: center; padding: 14px; font-size: 15px; }

/* ══════════════════════════════════════════════════════════
   FILTER BAR
══════════════════════════════════════════════════════════ */
.filter-bar { background: var(--surface); border-bottom: 1px solid var(--border); }
.filter-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-label { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill.active { background: var(--accent); color: #0d0d0f; border-color: var(--accent); font-weight: 500; }

/* ══════════════════════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════════════════════ */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* Page headings */
.page-heading { margin-bottom: 28px; }
.page-heading h1 { font-size: 28px; font-weight: 800; }
.page-sub { color: var(--text-3); font-size: 13px; margin-top: 4px; }

.section-title {
  font-family: 'Syne', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-sub { color: var(--text-3); font-size: 12px; font-weight: 400; }

/* ── Cards Grid ──────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
@media (max-width: 480px) { .cards-grid { grid-template-columns: 1fr; } }

/* ── Prompt Card ─────────────────────────────────────────── */
.prompt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  animation: cardIn 0.35s ease both;
}
.prompt-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px #00000060;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.3;
  flex: 1;
}
.card-badge {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid #f5a62330;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.04em;
}
.card-badge[data-cat="Coding"]       { background: #3b82f615; color: #60a5fa; border-color: #3b82f630; }
.card-badge[data-cat="Social Media"] { background: #ec489920; color: #f472b6; border-color: #ec489930; }
.card-badge[data-cat="Education"]    { background: #10b98120; color: #34d399; border-color: #10b98130; }
.card-badge[data-cat="Fun"]          { background: #f5a62320; color: var(--accent); border-color: #f5a62330; }

.card-content {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px 14px;
  border-left: 3px solid var(--border);
  font-style: italic;
}

.card-author { color: var(--text-3); font-size: 11px; margin-top: -4px; }

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  flex-wrap: wrap;
  gap: 8px;
}
.card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Vote Buttons ────────────────────────────────────────── */
.btn-vote {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-3);
  padding: 6px 11px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition);
}
.vote-icon { font-size: 14px; transition: transform 0.15s; }

/* Like */
.btn-like:hover             { border-color: var(--red); color: var(--red); }
.btn-like.voted             { border-color: var(--red); color: var(--red); background: #ff5c5c15; }
.btn-like:hover .vote-icon,
.btn-like.voted .vote-icon  { transform: scale(1.3); }

/* Dislike */
.btn-dislike:hover              { border-color: var(--blue); color: var(--blue); }
.btn-dislike.voted.disliked     { border-color: var(--blue); color: var(--blue); background: #60a5fa15; }
.btn-dislike:hover .vote-icon,
.btn-dislike.voted .vote-icon   { transform: scale(1.3); }

/* Copy button */
.btn-copy {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-2);
  padding: 6px 11px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}
.btn-copy:hover  { border-color: var(--green); color: var(--green); background: #4ade8015; }
.btn-copy.copied { border-color: var(--green); color: var(--green); background: #4ade8015; }

.card-date { color: var(--text-3); font-size: 11px; }

/* Inline stat display (profile page) */
.stat-inline { color: var(--text-3); font-size: 12px; }
.stat-inline.muted { color: var(--text-3); }

/* ══════════════════════════════════════════════════════════
   LOADING & EMPTY & GATE STATES
══════════════════════════════════════════════════════════ */
.loading-state,
.empty-state,
.gate-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 24px;
  color: var(--text-3);
  font-size: 14px;
  text-align: center;
}
.empty-icon { font-size: 48px; line-height: 1; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.link-accent { color: var(--accent); text-decoration: underline; cursor: pointer; }

/* ══════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: #00000090;
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow);
  animation: slideUp 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-header {
  padding: 22px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.modal-close {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  width: 32px; height: 32px;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--text-1); }
.modal-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 18px; }

/* ── Form ────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label {
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
}
.form-group input,
.form-group textarea,
.form-group select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  padding: 11px 14px;
  width: 100%;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-3); }
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-group textarea { resize: vertical; min-height: 110px; }
.form-group select { appearance: none; cursor: pointer; }
.form-group select option { background: var(--surface-2); }
.char-count { font-size: 11px; color: var(--text-3); text-align: right; margin-top: -4px; }
.form-error {
  color: var(--red);
  font-size: 13px;
  background: #ff5c5c12;
  border: 1px solid #ff5c5c30;
  border-radius: 8px;
  padding: 10px 14px;
}
.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid #0d0d0f50;
  border-top-color: #0d0d0f;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ══════════════════════════════════════════════════════════
   PROFILE PAGE
══════════════════════════════════════════════════════════ */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 36px;
  animation: cardIn 0.3s ease;
}
.profile-info { flex: 1; }
.profile-name {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 2px;
}
.profile-email { color: var(--text-3); font-size: 12px; margin-bottom: 14px; }

/* ── Edit Name Widget ────────────────────────────────────── */
.name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}
.btn-edit-name {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
  border-radius: 7px;
  width: 28px; height: 28px;
  font-size: 15px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.btn-edit-name:hover { border-color: var(--accent); color: var(--accent); }

.name-editor {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.name-input {
  background: var(--surface-2);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--text-1);
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 7px 12px;
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-dim);
  width: 220px;
  max-width: 100%;
}
.btn-save-name {
  background: var(--accent);
  color: #0d0d0f;
  border: none;
  border-radius: 8px;
  padding: 7px 16px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-save-name:hover    { background: var(--accent-hover); }
.btn-save-name:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-cancel-name {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-3);
  border-radius: 8px;
  padding: 7px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-cancel-name:hover { border-color: var(--red); color: var(--red); }
.profile-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}
.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}
.stat-label { font-size: 11px; color: var(--text-3); margin-top: 2px; }

@media (max-width: 500px) {
  .profile-hero { flex-direction: column; text-align: center; }
  .profile-stats { justify-content: center; }
}

/* ══════════════════════════════════════════════════════════
   LEADERBOARD PAGE
══════════════════════════════════════════════════════════ */
.lb-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 800px) { .lb-layout { grid-template-columns: 1fr; } }

.lb-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background var(--transition);
  margin-bottom: 6px;
}
.lb-row:hover { background: var(--surface-2); }
.lb-row--top {
  border-color: var(--border-glow);
  background: var(--accent-dim);
}

.lb-rank {
  font-size: 18px;
  min-width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.lb-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.lb-title {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-author { color: var(--text-3); font-size: 11px; }

.lb-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.lb-likes { color: var(--red); font-size: 13px; font-weight: 500; }
.lb-count { color: var(--accent); font-size: 13px; font-weight: 500; }
.lb-empty { color: var(--text-3); font-size: 13px; text-align: center; padding: 20px 0; }

/* ══════════════════════════════════════════════════════════
   TOAST NOTIFICATION
══════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-1);
  font-size: 13px;
  padding: 10px 22px;
  z-index: 300;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--shadow);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.toast-success { border-color: #4ade8040; color: var(--green); }
.toast.toast-error   { border-color: #ff5c5c40; color: var(--red); }

/* ══════════════════════════════════════════════════════════
   AVATAR CHANGE (profile page)
══════════════════════════════════════════════════════════ */
.avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 80px;
  height: 80px;
}
.avatar-wrap .profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-dim);
  display: block;
}
.avatar-change-btn {
  position: absolute;
  bottom: 0; right: 0;
  background: var(--accent);
  border-radius: 50%;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  cursor: pointer;
  border: 2px solid var(--bg);
  transition: background var(--transition);
  user-select: none;
}
.avatar-change-btn:hover { background: var(--accent-hover); }

/* ══════════════════════════════════════════════════════════
   PROMPT PREVIEW MODAL
══════════════════════════════════════════════════════════ */
.modal--wide { max-width: 700px; }

.preview-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.preview-author { color: var(--text-3); font-size: 12px; }
.preview-likes  { color: var(--red);    font-size: 12px; font-weight: 500; }

.preview-content {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
  color: var(--text-2);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 340px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.preview-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── "Send to AI" button (used in preview modal & cards) ── */
.btn-send-ai {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
  padding: 10px 18px;
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}
.btn-send-ai:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── "See Prompt" button on home cards ── */
.btn-see {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-2);
  padding: 6px 11px;
  font-size: 12px;
  font-family: 'DM Mono', monospace;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-see:hover { border-color: var(--blue); color: var(--blue); }

/* ══════════════════════════════════════════════════════════
   SEND TO AI MODAL
══════════════════════════════════════════════════════════ */
.ai-hint {
  color: var(--text-3);
  font-size: 13px;
  margin-bottom: 14px;
}

.ai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.ai-tile {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-1);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  transition: all var(--transition);
}
.ai-tile:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px #00000040;
}
.ai-icon { font-size: 24px; line-height: 1; }
.ai-name { font-size: 12px; color: var(--text-2); }
.ai-tile--custom {
  background: transparent;
  border-style: dashed;
  border-color: var(--text-3);
}
.ai-tile--custom:hover { border-color: var(--accent); border-style: solid; }

.custom-ai-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  animation: slideUp 0.2s ease;
}
.ai-note {
  color: var(--text-3);
  font-size: 11px;
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════
   LEADERBOARD FILTER BAR
══════════════════════════════════════════════════════════ */
.lb-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ── "See Prompt" button on leaderboard rows ── */
.btn-see-prompt {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-3);
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  flex-shrink: 0;
}
.btn-see-prompt:hover { border-color: var(--blue); color: var(--blue); background: #60a5fa12; }

/* Make lb-row flex so the See btn sits on the right */
.lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background var(--transition);
  margin-bottom: 6px;
}

/* ══════════════════════════════════════════════════════════
   CARD OWNER BUTTONS (edit / delete) — v4
══════════════════════════════════════════════════════════ */
.card-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.btn-owner {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  width: 28px; height: 28px;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.btn-edit:hover   { border-color: var(--accent); color: var(--accent); }
.btn-delete:hover { border-color: var(--red);    color: var(--red);    background: #ff5c5c12; }

/* ══════════════════════════════════════════════════════════
   SAVE TO COLLECTION MODAL
══════════════════════════════════════════════════════════ */
.collection-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  max-height: 220px;
  overflow-y: auto;
}
.collection-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  text-align: left;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text-1);
  cursor: pointer;
  transition: all var(--transition);
}
.collection-item:hover { border-color: var(--accent); background: var(--accent-dim); }

.new-collection-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── btn-save-col on cards ── */
.btn-save-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-2);
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-save-col:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ══════════════════════════════════════════════════════════
   LEADERBOARD TABS
══════════════════════════════════════════════════════════ */
.lb-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.lb-tab {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
  padding: 8px 18px;
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}
.lb-tab:hover  { border-color: var(--accent); color: var(--accent); }
.lb-tab.active { background: var(--accent); color: #0d0d0f; border-color: var(--accent); }
.lb-copies { color: var(--blue); font-size: 13px; font-weight: 500; }

/* ══════════════════════════════════════════════════════════
   COLLECTIONS — PROFILE PAGE ACCORDION
══════════════════════════════════════════════════════════ */
.collections-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 36px 0 12px;
  flex-wrap: wrap;
  gap: 10px;
}
.btn-new-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  padding: 7px 16px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-new-col:hover { background: var(--accent-dim); border-color: var(--accent); }

.new-col-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: slideUp 0.2s ease;
}

.col-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  overflow: hidden;
}

.col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid transparent;
  transition: background var(--transition);
}
.col-section:has(.col-body:not(.hidden)) .col-header {
  border-bottom-color: var(--border);
}
.col-toggle {
  background: none; border: none; color: var(--text-1);
  font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 10px;
}
.col-arrow { color: var(--text-3); font-size: 11px; transition: transform 0.2s; }
.col-actions { display: flex; gap: 6px; }

.btn-rename-col,
.btn-delete-col {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  width: 28px; height: 28px;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.btn-rename-col:hover { border-color: var(--accent); color: var(--accent); }
.btn-delete-col:hover { border-color: var(--red); color: var(--red); background: #ff5c5c12; }

.col-body { padding: 10px; display: flex; flex-direction: column; gap: 6px; }

.col-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  animation: cardIn 0.25s ease;
}
.col-item-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.col-item-title {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.col-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.btn-remove-item {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-3);
  width: 24px; height: 24px;
  font-size: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.btn-remove-item:hover { border-color: var(--red); color: var(--red); }
