/* ============================================================
   profile.css — NovaSounds User Profile
   Matches CreatorDashboard card/layout conventions exactly.
   ============================================================ */

/* ── Profile Header ── */
.profile-header {
  margin-bottom: 48px;
}

.profile-avatar-section {
  display: flex;
  align-items: flex-start;
  gap: 28px;
}

.profile-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--teal));
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--border);
  box-shadow: var(--shadow-md);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Avatar ring — badge tier glow frame ──────────────────────
   profileAvatarWrap (or .avatar-wrap / .profile-avatar-section's
   first child) gets .avatar-ring-{tier} added by renderAvatarRing().
   The ring is drawn outside the photo via a ::before mask trick.  */
.profile-avatar-wrap,
.avatar-wrap {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}
.profile-avatar-wrap::before,
.avatar-wrap::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  padding: 3px;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 1;
}
/* Activate when a tier class is present */
.avatar-ring-spark::before,
.avatar-ring-pulse::before,
.avatar-ring-nova::before,
.avatar-ring-supernova::before,
.avatar-ring-galactic::before { opacity: 1; }

/* Spark — soft gold */
.avatar-ring-spark::before {
  background: conic-gradient(from 0deg, rgba(212,168,67,0.5), rgba(212,168,67,0.9), rgba(212,168,67,0.5));
  box-shadow: 0 0 10px 2px rgba(212,168,67,0.25);
}
/* Pulse — teal */
.avatar-ring-pulse::before {
  background: conic-gradient(from 0deg, #2eb8a4, #55e8d0, #2eb8a4);
  box-shadow: 0 0 14px 3px rgba(46,184,164,0.4);
}
/* The Aura (🔥) — fiery amber-orange */
.avatar-ring-nova::before {
  background: conic-gradient(from 0deg, #ff6b00, #ffaa33, #ff9900, #ffcc55, #ff6b00);
  box-shadow: 0 0 18px 4px rgba(255,120,0,0.50);
}
/* The Oracle (🧿) — deep indigo/cyan */
.avatar-ring-supernova::before {
  background: conic-gradient(from 0deg, #1a4fff, #00c8ff, #5b21ff, #00c8ff, #1a4fff);
  box-shadow: 0 0 20px 5px rgba(0,160,255,0.50);
}
/* The Plotrixx (🪶) — animated spinning iridescent rainbow */
.avatar-ring-galactic::before {
  background: conic-gradient(from var(--pr-ring-angle, 0deg),
    #ff6b6b, #ffd93d, #6bcb77, #4d96ff, #c77dff, #ff6b6b);
  box-shadow: 0 0 24px 6px rgba(255,180,60,0.5);
  animation: prGalacticSpin 3s linear infinite;
}
@property --pr-ring-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes prGalacticSpin { to { --pr-ring-angle: 360deg; } }

/* ── Corner badge icon (tier emoji overlaid on avatar bottom-right) ── */
.profile-avatar-badge-icon {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  border: 2px solid var(--bg, #0d0d0d);
  z-index: 2;
  cursor: default;
  transition: transform 0.2s;
}
.profile-avatar-wrap:hover .profile-avatar-badge-icon,
.avatar-wrap:hover .profile-avatar-badge-icon { transform: scale(1.15); }

/* Per-tier icon glow backgrounds */
.badge-icon-spark     { background: rgba(212,168,67,0.18);  box-shadow: 0 2px 8px rgba(212,168,67,0.30); }
.badge-icon-pulse     { background: rgba(46,184,164,0.18);  box-shadow: 0 2px 8px rgba(46,184,164,0.35); }
/* The Aura (🔥) — fiery amber glow */
.badge-icon-nova      { background: rgba(255,120,0,0.18);   box-shadow: 0 2px 8px rgba(255,120,0,0.45);  }
/* The Oracle (🧿) — deep blue glow */
.badge-icon-supernova { background: rgba(0,160,255,0.18);   box-shadow: 0 2px 8px rgba(0,160,255,0.45);  }
.badge-icon-galactic  {
  background: rgba(255,180,60,0.22);
  box-shadow: 0 2px 10px rgba(255,180,60,0.5);
  animation: prGalacticIconPulse 2s ease-in-out infinite;
}
@keyframes prGalacticIconPulse {
  0%, 100% { box-shadow: 0 2px 10px rgba(255,180,60,0.50); }
  50%      { box-shadow: 0 2px 18px rgba(255,180,60,0.85); }
}

.profile-basic {
  flex: 1;
  min-width: 0;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.profile-name-row h1 {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.profile-basic > p {
  font-size: 13px;
  color: var(--ink3);
  margin-bottom: 10px;
}

/* Role badge row */
.vibe-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.vibe-badge {
  background: linear-gradient(135deg, var(--gold), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  font-style: italic;
}

.classic-role {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  padding: 3px 8px;
  background: rgba(212,168,67,0.12);
  border-radius: 6px;
  border: 1px solid rgba(212,168,67,0.25);
}

/* ── Earned badges row (app-awarded, shown in header) ── */
.earned-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
  align-items: center;
}

.earned-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  border: 1.5px solid;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

/* Earned badge tier colours */
.earned-badge-spark     { background: rgba(212,168,67,0.12);  color: var(--gold);   border-color: rgba(212,168,67,0.35); }
.earned-badge-pulse     { background: rgba(46,184,164,0.12);  color: var(--teal);   border-color: rgba(46,184,164,0.35); }
/* The Aura (🔥) — fiery amber */
.earned-badge-nova      { background: rgba(255,120,0,0.12);   color: #ff8c33;       border-color: rgba(255,120,0,0.35);  }
/* The Oracle (🧿) — deep blue */
.earned-badge-supernova { background: rgba(0,160,255,0.12);   color: #33b8ff;       border-color: rgba(0,160,255,0.35);  }
.earned-badge-galactic  { background: rgba(255,180,60,0.15);  color: #ffb43c;       border-color: rgba(255,180,60,0.4);  }

/* Locked (not yet earned) */
.earned-badge-locked {
  background: transparent;
  color: var(--ink3);
  border-color: var(--border2);
  opacity: 0.55;
  font-weight: 400;
}

.verify-text {
  font-size: 12px;
  color: var(--ink3);
  margin: 0 0 10px;
}

/* ── Tabs ── */
.profile-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.tab-btn {
  padding: 12px 18px;
  border: none;
  background: transparent;
  color: var(--ink3);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
  white-space: nowrap;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--ink); border-bottom-color: var(--gold); }

/* ── Stats Row (same pattern as CreatorDashboard .stats-row) ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.stat-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
}

.stat-icon { font-size: 2rem; flex-shrink: 0; }
.stat-info { flex: 1; }
.stat-number {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.stat-label {
  font-size: 11px;
  color: var(--ink3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* ── Activity card ── */
.activity-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
}
.activity-card h2 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 24px;
}
.activity-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.activity-item {
  display: flex;
  align-items: center;
  gap: 14px;
}
.activity-icon { font-size: 1.8rem; flex-shrink: 0; }
.activity-val {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.activity-lbl {
  font-size: 11px;
  color: var(--ink3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 3px;
}

/* ── Continue Reading (Reading History tab) ── */
.continue-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.continue-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.continue-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Vertical book cover — 2:3 ratio, fixed width */
.continue-cover {
  width: 90px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  /* aspect-ratio handled by the fixed width + stretch */
  min-height: 135px;
}

.continue-body {
  flex: 1;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  gap: 12px;
}

.continue-body h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 3px;
}
.continue-author {
  font-size: 12px;
  color: var(--ink3);
  margin: 0 0 4px;
}
.continue-progress {
  font-size: 12px;
  color: var(--ink2);
  margin: 0 0 8px;
}

.progress-bar-wrap {
  height: 4px;
  background: var(--border2);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  border-radius: 2px;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.empty-state h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.empty-state p {
  font-size: 13px;
  color: var(--ink3);
  max-width: 400px;
  margin: 0 auto;
}

/* ── Settings Grid ── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.settings-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.settings-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 20px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.setting-row:last-child { border-bottom: none; padding-bottom: 0; }
.setting-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink2);
  cursor: pointer;
  margin: 0;
}
.setting-row input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
}

/* ── Form Styles ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.form-input {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  transition: border-color var(--transition);
}
.form-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-subtle);
}

/* ── Avatar Upload ── */
.cover-upload-wrap {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  background: var(--surface);
  transition: border-color var(--transition), background var(--transition);
  margin: 0 auto;
}
.cover-upload-wrap:hover { border-color: var(--gold); background: var(--gold-subtle); }

/* Preview image fills the circular frame perfectly */
#avatarPreview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.cover-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  text-align: center;
  padding: 20px;
}
.cover-upload-icon { font-size: 2rem; line-height: 1; }
.cover-upload-text { font-size: 14px; font-weight: 600; color: var(--ink2); }
.cover-upload-hint { font-size: 11px; color: var(--ink3); }

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(8,8,16,0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
html.light-theme .modal { background: rgba(250,248,245,0.92); }

.modal-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--ink3);
  cursor: pointer;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}
.modal-close:hover { color: var(--ink); background: var(--surface); }

/* ── Social Links — Profile Display ── */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 16px;
  align-items: center;
}

.social-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  flex-shrink: 0;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.social-icon-btn:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  opacity: 0.92;
}

.social-icon-btn svg {
  pointer-events: none;
}

/* ── Social Links — Modal Input Rows ── */
.social-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.social-input-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-input-field {
  flex: 1;
  padding: 9px 12px !important;
  font-size: 12px !important;
}

/* ── Badge Progress Card (Overview tab) ── */
.badge-progress-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
}

.badge-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.badge-progress-header h2 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.badge-progress-link {
  font-size: 12px;
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
  transition: opacity var(--transition);
}
.badge-progress-link:hover { opacity: 0.75; }

.badge-progress-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.bp-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  text-align: center;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
}

.bp-card.earned {
  border-color: var(--gold);
  background: var(--gold-subtle);
}

.bp-card.earned:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.bp-card.locked {
  opacity: 0.5;
}

.bp-icon {
  font-size: 2rem;
  line-height: 1;
}

.bp-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.3px;
}

.bp-desc {
  font-size: 10px;
  color: var(--ink3);
  line-height: 1.4;
}

.bp-progress-wrap {
  width: 100%;
}

.bp-progress-bar {
  height: 4px;
  background: var(--border2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.bp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  border-radius: 2px;
  transition: width 0.6s ease;
}

.bp-progress-label {
  font-size: 10px;
  color: var(--ink3);
}

.bp-earned-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Dual-track requirement hints shown on locked badge cards */
.bp-track-hint {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  margin-bottom: 4px;
}
.bp-track-hint span {
  font-size: 9px;
  color: var(--ink3);
  background: var(--border2, rgba(255,255,255,0.04));
  border-radius: 4px;
  padding: 2px 5px;
  text-align: left;
  line-height: 1.4;
}

/* ── Role Selector in Edit Profile Modal ── */
.form-hint {
  font-size: 11px;
  color: var(--ink3);
  margin: -4px 0 10px;
  line-height: 1.5;
}

.role-options-modal {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.role-option-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  user-select: none;
}

.role-option-card:hover {
  border-color: var(--gold);
  background: var(--gold-subtle);
}

.role-option-card.selected,
.role-option-card:has(input:checked) {
  border-color: var(--gold);
  background: var(--gold-subtle);
}

.role-option-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.role-option-body {
  flex: 1;
  min-width: 0;
}

.role-option-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.role-option-desc {
  font-size: 11px;
  color: var(--ink3);
  margin-top: 2px;
}

.role-option-check {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  opacity: 0;
  transition: opacity var(--transition);
  flex-shrink: 0;
}

.role-option-card:has(input:checked) .role-option-check {
  opacity: 1;
}

/* ── Btn size override ── */
.btn-sm { padding: 8px 14px !important; font-size: 12px !important; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .stats-row            { grid-template-columns: repeat(2, 1fr); }
  .activity-row         { grid-template-columns: repeat(2, 1fr); }
  .settings-grid        { grid-template-columns: 1fr; }
  .badge-progress-grid  { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
  .profile-avatar-section { flex-direction: column; align-items: center; text-align: center; }
  .profile-name-row       { justify-content: center; }
  .profile-name-row h1    { font-size: 1.5rem; }
  .vibe-section           { justify-content: center; }
  .earned-badges-row      { justify-content: center; }
  .stats-row              { grid-template-columns: 1fr; }
  .activity-row           { grid-template-columns: repeat(2, 1fr); }
  .badge-progress-grid    { grid-template-columns: repeat(2, 1fr); }
  .profile-tabs           { gap: 0; }
  .tab-btn                { padding: 10px 12px; font-size: 12px; }
  .continue-cover         { width: 70px; min-height: 105px; font-size: 1.8rem; }
}

/* ══════════════════════════════════════════════════════
   MY WORKS TAB
   ══════════════════════════════════════════════════════ */

/* Header row */
.mw-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.mw-title {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
}
.mw-subtitle {
  font-size: 13px;
  color: var(--ink3);
  margin: 0;
}
.mw-dashboard-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

/* Filter pills */
.mw-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.mw-filter-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink3);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.mw-filter-btn:hover { color: var(--ink); border-color: var(--border2); }
.mw-filter-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
  font-weight: 600;
}

/* Loading state */
.mw-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 24px;
  gap: 14px;
  color: var(--ink3);
  font-size: 14px;
}
.mw-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: mw-spin 0.75s linear infinite;
}
@keyframes mw-spin { to { transform: rotate(360deg); } }

/* Empty state */
.mw-empty {
  text-align: center;
  padding: 64px 24px;
  background: var(--card);
  border: 1px dashed var(--border2);
  border-radius: var(--radius-lg);
}
.mw-empty-icon { font-size: 3rem; margin-bottom: 14px; }
.mw-empty h3   { font-family: var(--serif); font-size: 1.2rem; color: var(--ink); margin-bottom: 8px; }
.mw-empty p    { font-size: 13px; color: var(--ink3); max-width: 340px; margin: 0 auto; }

/* Works grid */
.mw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

/* Individual work card */
.mw-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}
.mw-card:hover {
  border-color: var(--gold);
  box-shadow: 0 6px 24px rgba(0,0,0,0.10);
  transform: translateY(-2px);
}

/* Cover area */
.mw-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: var(--bg2);
}
.mw-cover-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(160deg, var(--bg2), var(--bg));
}

/* Type badge */
.mw-type-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
}
.mw-type-badge.novel     { background: rgba(100, 70, 200, 0.82); }
.mw-type-badge.audiobook { background: rgba(46, 150, 184, 0.82); }
.mw-type-badge.book      { background: rgba(46, 130, 80, 0.82); }
.mw-type-badge.show      { background: rgba(212, 100, 30, 0.82); }

/* Status dot */
.mw-status-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
}
.mw-status-dot.published { background: #2fc99a; }
.mw-status-dot.draft     { background: #f0b429; }

/* Card body */
.mw-card-body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mw-card-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mw-card-meta {
  font-size: 11.5px;
  color: var(--ink3);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.mw-card-meta span { display: flex; align-items: center; gap: 4px; }

/* Card footer */
.mw-card-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mw-view-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  transition: opacity var(--transition);
}
.mw-view-btn:hover { opacity: 0.75; }
.mw-edit-hint {
  font-size: 11px;
  color: var(--ink3);
  opacity: 0.7;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 600px) {
  .mw-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .mw-cover-placeholder { font-size: 2rem; }
}
@media (max-width: 380px) {
  .mw-grid { grid-template-columns: 1fr; }
}