/* ============================================
   PromptLab CSS — Light (default) / Dark Theme
   Native CSS, no framework
   ============================================ */

/* ---------- CSS Variables ---------- */
:root,
[data-theme="light"] {
  --bg:          #f8f7f4;
  --bg-alt:      #f0efe9;
  --bg-card:     #ffffff;
  --bg-elevated: #ffffff;
  --bg-input:    #f4f3ef;
  --bg-code:     #f0efe9;

  --text:        #1a1a1a;
  --text-2:      #555555;
  --text-3:      #888888;
  --text-inv:    #ffffff;

  --border:      #e0ddd5;
  --border-light:#eceae3;

  --accent:      #e63946;
  --accent-hover:#d62f3d;
  --accent-soft: rgba(230,57,70,0.08);
  --accent-text: #e63946;

  --success:     #2a9d8f;
  --danger:      #e63946;

  --shadow-sm:   0 1px 3px rgba(0,0,0,0.05);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg:   0 12px 40px rgba(0,0,0,0.08);

  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   16px;
  --radius-full: 9999px;
}

[data-theme="dark"] {
  --bg:          #0d0d10;
  --bg-alt:      #141418;
  --bg-card:     #18181c;
  --bg-elevated: #1e1e24;
  --bg-input:    #1a1a20;
  --bg-code:     #111114;

  --text:        #e8e8ec;
  --text-2:      #9f9faa;
  --text-3:      #5a5a66;
  --text-inv:    #0d0d10;

  --border:      rgba(255,255,255,0.08);
  --border-light:rgba(255,255,255,0.04);

  --accent:      #ff4757;
  --accent-hover:#ff5e6c;
  --accent-soft: rgba(255,71,87,0.1);
  --accent-text: #ff6b7a;

  --shadow-sm:   0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg:   0 12px 40px rgba(0,0,0,0.4);
}

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

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--accent-soft); color: var(--accent); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ---------- Container ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 640px; }
.container-md { max-width: 800px; }

/* ---------- Typography ---------- */
.text-muted { color: var(--text-3); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 12px; }
.link { color: var(--accent-text); }
.link:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm); border: none;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; text-decoration: none;
  line-height: 1.4;
}
.btn-primary {
  background: var(--accent); color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }
.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--text-3); text-decoration: none; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; padding: 12px; }
.btn-icon {
  background: none; border: none; color: var(--text-3); cursor: pointer;
  padding: 8px; border-radius: var(--radius-sm); transition: all 0.2s;
  display: flex; align-items: center;
}
.btn-icon:hover { background: var(--bg-alt); color: var(--text); }
.btn-text {
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: inherit; color: inherit; padding: 0;
}
.btn-text:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg); border-bottom: 1px solid var(--border-light);
  backdrop-filter: blur(16px);
}
[data-theme="dark"] .header { background: rgba(13,13,16,0.88); }
[data-theme="light"] .header { background: rgba(248,247,244,0.92); }

.header-inner {
  height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.header-actions { display: flex; align-items: center; gap: 8px; }

/* Logo */
.logo {
  display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text);
}
.logo:hover { text-decoration: none; }
.logo-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: 'Instrument Serif', serif; font-size: 16px; font-weight: 700;
}
.logo-text {
  font-size: 17px; font-weight: 700; letter-spacing: -0.3px;
}
.logo-text em {
  color: var(--accent-text); font-style: normal;
}
.logo-sm .logo-icon { width: 26px; height: 26px; font-size: 13px; border-radius: 6px; }
.logo-sm .logo-text { font-size: 14px; }

/* Nav */
.nav-desktop { display: flex; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--text-3);
  text-decoration: none; transition: all 0.2s;
}
.nav-link:hover { color: var(--text); background: var(--bg-alt); text-decoration: none; }
.nav-link.active { color: var(--accent-text); background: var(--accent-soft); }

.nav-mobile { display: none; padding: 0 20px 12px; }
.mobile-menu-toggle { display: none; }

/* Theme toggle */
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

/* Avatar */
.avatar-xs { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-sm { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-md { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-xl { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-placeholder {
  background: var(--accent-soft); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; text-transform: uppercase;
}
.avatar-xl.avatar-placeholder { font-size: 28px; }

.avatar-btn {
  background: none; border: 2px solid var(--border); border-radius: 50%;
  padding: 0; cursor: pointer; overflow: hidden; width: 36px; height: 36px;
}
.avatar-btn .avatar-img { width: 100%; height: 100%; object-fit: cover; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 180px; z-index: 200; overflow: hidden;
  animation: slideDown 0.15s ease;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-header { padding: 12px 16px; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.dropdown-item {
  display: block; padding: 10px 16px; font-size: 13px;
  color: var(--text); text-decoration: none; transition: background 0.15s;
}
.dropdown-item:hover { background: var(--bg-alt); text-decoration: none; }
.dropdown-divider { height: 1px; background: var(--border-light); }

/* ---------- Flash ---------- */
.flash {
  position: fixed; top: 72px; left: 50%; transform: translateX(-50%);
  z-index: 300; padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-lg); animation: slideDown 0.3s ease;
  max-width: 480px; width: calc(100% - 40px);
}
.flash-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
[data-theme="dark"] .flash-success { background: #064e3b; color: #a7f3d0; border-color: #065f46; }
[data-theme="dark"] .flash-error { background: #7f1d1d; color: #fecaca; border-color: #991b1b; }
.flash-close { background: none; border: none; font-size: 20px; cursor: pointer; color: inherit; margin-left: auto; }

/* ---------- Hero ---------- */
.hero {
  text-align: center; padding: 60px 20px 40px;
  position: relative;
}
.hero::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); width: 400px; height: 400px;
  border-radius: 50%; background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.hero-title {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(32px, 6vw, 48px);
  font-weight: 400; line-height: 1.15; letter-spacing: -1px;
  margin-bottom: 12px; position: relative;
}
.hero-title em { font-style: italic; color: var(--accent); }
.hero-subtitle {
  color: var(--text-3); font-size: 16px; max-width: 400px;
  margin: 0 auto 28px; position: relative;
}

.hero-search {
  max-width: 520px; margin: 0 auto; display: flex; gap: 8px;
  position: relative;
}
.hero-search .search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
.hero-search-input {
  flex: 1; padding: 12px 16px 12px 44px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-card);
  font-family: inherit; font-size: 14px; color: var(--text); outline: none;
  transition: border-color 0.2s;
}
.hero-search-input:focus { border-color: var(--accent); }
.hero-search .btn { flex-shrink: 0; }

/* ---------- Sections ---------- */
.main { min-height: 60vh; }

.section { padding: 32px 0; }
.section-alt { background: var(--bg-alt); }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-family: 'Instrument Serif', serif;
  font-size: 22px; font-weight: 400; display: flex; align-items: center; gap: 8px;
}
.section-link {
  font-size: 13px; font-weight: 600; color: var(--accent-text);
}

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-title {
  font-family: 'Instrument Serif', serif;
  font-size: 28px; font-weight: 400; display: flex; align-items: center; gap: 10px;
}
.page-desc { color: var(--text-3); font-size: 14px; width: 100%; }

/* ---------- Masonry Grid (Pinterest-style) ---------- */
.grid { }
.grid-4 {
  columns: 4;
  column-gap: 18px;
}
.grid-4 > * {
  break-inside: avoid;
  margin-bottom: 18px;
  display: inline-block;
  width: 100%;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border-light); overflow: hidden;
  transition: all 0.25s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}

.card-image-link { display: block; text-decoration: none; }
.card-image {
  position: relative; overflow: hidden; background: var(--bg-alt);
  line-height: 0;
}
.card-image:not([style]) {
  /* Fallback jika tidak ada aspect-ratio dari DB */
  min-height: 180px;
}
.card-img {
  width: 100%; height: auto; display: block;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
.card-img[loading="lazy"] {
  background: linear-gradient(90deg, var(--bg-alt) 25%, var(--bg-elevated) 50%, var(--bg-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.card:hover .card-img { transform: scale(1.03); }

.card-badges {
  position: absolute; top: 10px; left: 10px;
  display: flex; gap: 6px; z-index: 2;
}

.badge {
  font-size: 11px; font-weight: 600; padding: 4px 10px;
  border-radius: var(--radius-full); letter-spacing: 0.2px;
}
.badge-model {
  background: rgba(0,0,0,0.55); color: #fff;
  backdrop-filter: blur(8px);
}
.badge-style {
  background: var(--accent-soft); color: var(--accent-text);
  backdrop-filter: blur(8px);
}
[data-theme="dark"] .badge-style { background: rgba(255,71,87,0.2); }

.card-body { padding: 14px 16px 16px; }
.card-title {
  font-size: 13px; font-weight: 500; color: var(--text);
  line-height: 1.5; text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.card-title:hover { color: var(--accent-text); text-decoration: none; }

.card-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px;
}
.card-author {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-3); font-size: 12px; text-decoration: none;
}
.card-author:hover { color: var(--text-2); text-decoration: none; }

.card-actions { display: flex; align-items: center; }

/* Like buttons */
.btn-like, .btn-like-lg {
  display: flex; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  color: var(--text-3); font-size: 12px; font-weight: 600;
  font-family: inherit; padding: 4px; border-radius: 6px;
  transition: all 0.2s;
}
.btn-like:hover, .btn-like-lg:hover { color: var(--accent); }
.btn-like.liked, .btn-like-lg.liked { color: var(--accent); }

.btn-like-lg {
  font-size: 14px; gap: 6px; padding: 8px 16px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.btn-like-lg.liked { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Filters ---------- */
.filters { margin-bottom: 24px; }
.filter-group { margin-bottom: 12px; }
.filter-label {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.5px; display: block; margin-bottom: 8px;
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 6px 14px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 600; text-decoration: none;
  background: var(--bg-input); color: var(--text-3);
  border: 1px solid var(--border-light); transition: all 0.2s;
}
.chip:hover { border-color: var(--border); color: var(--text); text-decoration: none; }
.chip.active {
  background: var(--accent-soft); color: var(--accent-text);
  border-color: var(--accent-soft);
}

/* ---------- Search Form ---------- */
.search-form { margin-bottom: 24px; }
.search-input-wrap {
  position: relative; margin-bottom: 12px;
}
.search-input-wrap svg {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
.search-input {
  width: 100%; padding: 13px 16px 13px 44px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-card);
  font-family: inherit; font-size: 15px; color: var(--text); outline: none;
}
.search-input:focus { border-color: var(--accent); }
.search-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.select-filter {
  padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-card);
  font-family: inherit; font-size: 13px; color: var(--text); cursor: pointer;
}
.search-result-info { color: var(--text-3); font-size: 14px; margin-bottom: 20px; }

/* ---------- Prompt Detail ---------- */
.prompt-detail {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  align-items: start;
}
.prompt-image-wrap {
  border-radius: var(--radius-lg); overflow: hidden;
  background: var(--bg-alt); position: sticky; top: 80px;
}
.prompt-image { width: 100%; display: block; }

.prompt-content { padding: 8px 0; }

.prompt-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.prompt-author {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
}
.prompt-author span { color: var(--text-3); font-size: 12px; display: block; }
.prompt-author:hover { text-decoration: none; }

.prompt-title {
  font-family: 'Instrument Serif', serif;
  font-size: 24px; font-weight: 400; line-height: 1.35;
  margin-bottom: 12px;
}

.prompt-badges {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 20px;
}

.prompt-text-box {
  background: var(--bg-code); border-radius: var(--radius);
  border: 1px solid var(--border-light); overflow: hidden;
  margin-bottom: 20px;
}
.prompt-text-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid var(--border-light);
}
.prompt-text-label { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; }
.btn-copy {
  display: flex; align-items: center; gap: 5px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 600;
  color: var(--text-3); transition: all 0.2s;
}
.btn-copy:hover { color: var(--text); border-color: var(--text-3); }
.btn-copy.copied { color: var(--success); border-color: var(--success); }

.prompt-text-content {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; line-height: 1.7; color: var(--text-2);
  padding: 16px; margin: 0; white-space: pre-wrap; word-break: break-word;
}

.prompt-actions-bar { margin-bottom: 28px; }

/* ---------- Comments ---------- */
.comments-section { border-top: 1px solid var(--border-light); padding-top: 24px; }
.comments-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.comments-count { color: var(--text-3); font-weight: 400; }

.comment-form { margin-bottom: 24px; }
.comment-input-wrap { display: flex; gap: 10px; margin-bottom: 8px; }
.comment-input {
  flex: 1; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-input);
  font-family: inherit; font-size: 14px; color: var(--text);
  outline: none; resize: vertical;
}
.comment-input:focus { border-color: var(--accent); }
.comment-form-actions { display: flex; justify-content: flex-end; }

.comments-list { display: flex; flex-direction: column; gap: 16px; }
.comment {
  padding: 14px; background: var(--bg-alt); border-radius: var(--radius-sm);
}
.comment-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.comment-author {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text); font-size: 13px;
}
.comment-author:hover { text-decoration: none; }
.comment-body { font-size: 14px; color: var(--text-2); line-height: 1.6; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 28px;
}
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  margin-bottom: 8px; color: var(--text);
}
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-input);
  font-family: inherit; font-size: 14px; color: var(--text); outline: none;
  transition: border-color 0.2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--accent); }
.form-input:disabled { opacity: 0.5; cursor: not-allowed; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 6px; display: block; }

/* Upload area */
.upload-area {
  position: relative; border: 2px dashed var(--border);
  border-radius: var(--radius); padding: 40px 20px; text-align: center;
  transition: all 0.2s; cursor: pointer;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--accent); background: var(--accent-soft);
}
.upload-input {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.upload-placeholder { color: var(--text-3); }
.upload-placeholder p { margin-top: 10px; font-size: 14px; }
.upload-preview {
  max-width: 100%; max-height: 300px; margin: 0 auto;
  border-radius: var(--radius-sm); object-fit: contain;
}

/* ---------- Leaderboard ---------- */
.leaderboard {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px;
}
.leaderboard-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border-light); text-decoration: none; color: var(--text);
  transition: all 0.2s;
}
.leaderboard-item:hover { border-color: var(--border); box-shadow: var(--shadow-sm); text-decoration: none; }
.leaderboard-rank {
  font-size: 14px; font-weight: 700; color: var(--accent-text); min-width: 28px;
}
.leaderboard-info { min-width: 0; }
.leaderboard-info strong { font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leaderboard-stats { font-size: 12px; color: var(--text-3); }

/* ---------- Profile ---------- */
.profile-header {
  display: flex; gap: 24px; align-items: center;
  padding: 24px 0; border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
}
.profile-name { font-family: 'Instrument Serif', serif; font-size: 26px; font-weight: 400; }
.profile-bio { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.profile-stats { display: flex; gap: 20px; margin-top: 12px; }
.profile-stat { text-align: center; }
.profile-stat strong { display: block; font-size: 18px; }
.profile-stat span { font-size: 12px; color: var(--text-3); }

/* ---------- Empty State ---------- */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { color: var(--text-3); margin-bottom: 16px; }

/* ---------- Load More ---------- */
.load-more-wrap { text-align: center; margin-top: 32px; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 32px; padding: 16px 0;
}
.pagination-btn {
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--border); color: var(--text);
}
.pagination-btn:hover { border-color: var(--accent); color: var(--accent-text); text-decoration: none; }
.pagination-info { font-size: 13px; color: var(--text-3); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border-light);
  padding: 28px 0; margin-top: 40px;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.footer-tagline { color: var(--text-3); font-size: 12px; margin-top: 4px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-3); font-size: 12px; text-decoration: none; }
.footer-links a:hover { color: var(--text-2); }
.footer-copy { color: var(--text-3); font-size: 12px; }

/* ---------- Card Edit Action ---------- */
.btn-card-action {
  display: flex; align-items: center; padding: 4px;
  color: var(--text-3); border-radius: 6px; transition: all 0.2s;
  text-decoration: none;
}
.btn-card-action:hover { color: var(--accent-text); background: var(--accent-soft); text-decoration: none; }

/* ---------- Edit Image ---------- */
.edit-image-current { margin-bottom: 12px; }
.edit-image-preview {
  width: 100%; max-height: 300px; object-fit: contain;
  border-radius: var(--radius); background: var(--bg-alt);
}
.upload-area-sm { padding: 16px 20px; }
.upload-area-sm .upload-placeholder { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.upload-area-sm .upload-placeholder svg { flex-shrink: 0; }

/* ---------- Form Actions ---------- */
.form-actions { display: flex; gap: 10px; }

/* ---------- Danger Zone ---------- */
.danger-zone {
  margin-top: 32px; padding: 20px 24px;
  border: 1px solid var(--danger); border-radius: var(--radius);
  background: rgba(230,57,70,0.04);
}
[data-theme="dark"] .danger-zone { background: rgba(255,71,87,0.06); }
.danger-zone h3 { font-size: 15px; font-weight: 600; color: var(--danger); margin-bottom: 6px; }
.danger-zone p { font-size: 13px; color: var(--text-3); margin-bottom: 14px; }
.btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm); border: none;
  background: var(--danger); color: #fff;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.btn-danger:hover { opacity: 0.9; }

/* ---------- Prose (static page content) ---------- */
.prose { font-size: 15px; line-height: 1.75; color: var(--text-2); }
.prose h2 { font-family: 'Instrument Serif', serif; font-size: 22px; font-weight: 400; color: var(--text); margin: 32px 0 12px; }
.prose h3 { font-size: 16px; font-weight: 600; color: var(--text); margin: 24px 0 8px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 24px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--text); }
.prose a { color: var(--accent-text); }
.prose a:hover { text-decoration: underline; }
.prose em { color: var(--text-3); }
.page-content { padding: 16px 0 40px; }
.page-updated { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border-light); }

/* ---------- Animations ---------- */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 { columns: 3; }
}

@media (max-width: 768px) {
  .nav-desktop { display: none; }
  .mobile-menu-toggle { display: flex; }
  .nav-mobile.open {
    display: flex; flex-direction: column; gap: 4px;
    border-top: 1px solid var(--border-light); padding-top: 12px;
  }

  .grid-4 { columns: 2; column-gap: 12px; }
  .grid-4 > * { margin-bottom: 12px; }

  .prompt-detail { grid-template-columns: 1fr; }
  .prompt-image-wrap { position: static; }

  .hero { padding: 40px 20px 28px; }

  .profile-header { flex-direction: column; text-align: center; }
  .profile-stats { justify-content: center; }

  .leaderboard { grid-template-columns: 1fr; }

  .form-row { grid-template-columns: 1fr; }

  .footer-inner { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  .grid-4 { columns: 2; column-gap: 10px; }
  .grid-4 > * { margin-bottom: 10px; }
  .card-body { padding: 10px 12px 14px; }
  .card-title { font-size: 12px; }
  .hero-search { flex-direction: column; }
  .search-filters { flex-direction: column; }
}
