:root {
  --bg: #12021f;
  --bg-deep: #1a0033;
  --bg-card: #1f1535;
  --bg-hover: #2e004f;
  --text: #f8f4ff;
  --text-muted: #c4b5fd;
  --accent: #a78bfa;
  --accent-hover: #8b5cf6;
  --accent-glow: #c4b5fd;
  --accent-soft: rgba(167, 139, 250, 0.2);
  --star: rgba(255, 255, 255, 0.35);
  --discord: #5865f2;
  --discord-hover: #4752c4;
  --success: #34d399;
  --danger: #f87171;
  --border: #4c1d95;
  --radius: 12px;
  --shadow: 0 4px 28px rgba(26, 0, 51, 0.65);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 100% 60% at 50% -10%, rgba(167, 139, 250, 0.18), transparent 55%),
    radial-gradient(circle at 20% 80%, rgba(75, 0, 130, 0.35), transparent 40%),
    radial-gradient(circle at 85% 25%, rgba(139, 92, 246, 0.12), transparent 35%),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 80px,
      rgba(255, 255, 255, 0.015) 80px,
      rgba(255, 255, 255, 0.015) 81px
    ),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 100%);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* Custom scrollbar — thin purple theme */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(167, 139, 250, 0.6) var(--bg-deep);
}

html::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

html::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

html::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, 0.55);
  border-radius: 999px;
  border: 2px solid var(--bg-deep);
}

html::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

html::-webkit-scrollbar-corner {
  background: var(--bg-deep);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* Header */
.header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 10px 24px 0;
  min-height: 56px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: visible;
}

.logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding-left: 98px;
  padding-bottom: 12px;
  text-decoration: none;
  color: var(--text);
}

.logo-img {
  position: absolute;
  left: -6px;
  bottom: -25px;
  width: 92px;
  height: 92px;
  border-radius: 0;
  object-fit: contain;
  object-position: center bottom;
  border: none;
  box-shadow: none;
  flex-shrink: 0;
  z-index: 2;
  pointer-events: none;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent-glow), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.footer-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border: none;
  border-radius: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 12px;
}

.nav a:hover,
.nav-link:hover {
  color: var(--accent);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

.nav-link.active {
  color: var(--accent);
  font-weight: 600;
}

.nav-profile {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 24px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-soft);
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #333;
}

.btn-discord {
  background: var(--discord);
  color: white;
}

.btn-discord:hover {
  background: var(--discord-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #c0392b;
}

.oa-icon {
  flex-shrink: 0;
  display: block;
}

.btn .oa-icon,
.vote-btn .oa-icon,
.nav-link .oa-icon {
  width: 1.1em;
  height: 1.1em;
}

.btn-follow.is-following {
  background: var(--bg-hover);
  color: var(--text);
  border: 2px solid var(--profile-accent, var(--accent));
}

.btn-follow.is-following:hover {
  background: #333;
  color: var(--text);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  backdrop-filter: blur(4px);
  transition: transform 0.15s, background 0.15s;
}

.btn-icon:hover {
  transform: scale(1.08);
}

.btn-icon-danger {
  background: rgba(231, 76, 60, 0.92);
}

.btn-icon-danger:hover {
  background: var(--danger);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.inline-form {
  display: inline;
}

/* Main */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.page-title {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.page-subtitle {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.error-page {
  text-align: center;
  max-width: 480px;
  margin: 48px auto;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

/* Masonry Pinterest grid */
.masonry {
  column-count: 4;
  column-gap: 16px;
}

@media (max-width: 1200px) {
  .masonry { column-count: 3; }
}

@media (max-width: 768px) {
  .masonry { column-count: 2; }
}

@media (max-width: 480px) {
  .masonry { column-count: 1; }
}

.card-wrap {
  break-inside: avoid;
  margin-bottom: 16px;
  position: relative;
}

.card-wrap:hover .card-delete-form {
  opacity: 1;
}

.card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  position: relative;
  display: block;
  transition: transform 0.2s;
}

.card-delete-form {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.2s;
  margin: 0;
}

.card-delete-form:focus-within {
  opacity: 1;
}

.card-wrap:hover .card {
  transform: scale(1.02);
  box-shadow: var(--shadow);
}

.card-image {
  position: relative;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.card-overlay {
  padding: 12px;
}

.card-title {
  font-size: 0.95rem;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.card-display-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.card-discord {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-stats {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--accent);
}

.card-likes {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.profile-stats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Toasts */
.oa-toast-root {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  right: 16px;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 32px));
}

.oa-toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  color: #f8f4ff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  cursor: pointer;
}

.oa-toast--visible {
  opacity: 1;
  transform: translateY(0);
}

.oa-toast--out {
  opacity: 0;
  transform: translateY(-6px);
}

.oa-toast--success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.92), rgba(22, 163, 74, 0.95));
}

.oa-toast--error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.92), rgba(185, 28, 28, 0.95));
}

body.has-mobile-nav .oa-toast-root {
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

.nav-link-discord .oa-icon {
  color: #5865f2;
}

.nav-link-discord:hover .oa-icon {
  color: #7289da;
}

.footer-links {
  margin-top: 4px;
}

.footer-discord-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 500;
}

.footer-discord-link .oa-icon {
  color: #5865f2;
}

/* Profile */

.profile-page {
  --profile-accent: #a78bfa;
  --profile-banner: #1a0033;
  --profile-accent-hover: #8b5cf6;
  --profile-banner-ratio: 3 / 1;
  --profile-banner-min-h: 280px;
  --profile-banner-max-h: 360px;
  --profile-avatar-size: 128px;
  --profile-header-overlap: 76px;
  margin: -24px -24px 0;
  padding-bottom: 24px;
  position: relative;
  z-index: 0;
}

.profile-banner {
  position: relative;
  width: 100%;
  aspect-ratio: var(--profile-banner-ratio);
  min-height: var(--profile-banner-min-h);
  max-height: var(--profile-banner-max-h);
  overflow: hidden;
}

.profile-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--banner-pos, 50% 50%);
}

.profile-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 25%,
    color-mix(in srgb, var(--bg) 35%, transparent) 65%,
    var(--bg) 100%
  );
  pointer-events: none;
}

.profile-header-custom {
  display: flex;
  align-items: flex-start;
  gap: 20px 24px;
  margin: calc(-1 * var(--profile-header-overlap)) 24px 40px;
  position: relative;
  z-index: 2;
}

.profile-avatar {
  width: var(--profile-avatar-size);
  height: var(--profile-avatar-size);
  object-fit: cover;
  border: 4px solid var(--profile-accent, var(--accent));
  background: var(--bg-card);
  flex-shrink: 0;
  margin-top: 4px;
}

.profile-body {
  flex: 1;
  min-width: 0;
  padding-top: calc(var(--profile-header-overlap) - 20px);
}

.profile-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.profile-info {
  flex: 1 1 220px;
  min-width: 0;
}

.profile-name-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.avatar-circle { border-radius: 50%; }
.avatar-rounded { border-radius: 20px; }
.avatar-square { border-radius: 4px; }
.avatar-ring {
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 8px var(--profile-accent, var(--accent));
}

.profile-display-name {
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  line-height: 1.25;
  color: var(--text);
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.staff-badge,
.owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  vertical-align: middle;
}

.staff-badge-owner {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 45%, #d97706 100%);
  color: #1a1200;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.35);
}

.staff-badge-owner .oa-icon {
  stroke: #1a1200;
}

.staff-badge-partner {
  background: linear-gradient(135deg, #f9a8d4 0%, #ec4899 45%, #be185d 100%);
  color: #fff;
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.35);
}

.staff-badge-partner .oa-icon {
  stroke: #fff;
}

.nav-staff-badge,
.nav-owner-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.nav-staff-badge.staff-badge-owner {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #1a1200;
}

.nav-staff-badge.staff-badge-partner {
  background: linear-gradient(135deg, #f9a8d4, #be185d);
  color: #fff;
}

.profile-discord {
  display: block;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  margin: 0;
  line-height: 1.35;
}

.profile-tagline {
  margin: 8px 0 0;
  font-size: 0.95rem;
  color: var(--profile-accent, var(--accent));
  font-style: italic;
  line-height: 1.4;
}

.profile-bio {
  margin: 14px 0 0;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 52rem;
}

.profile-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.profile-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

.profile-social-link:hover {
  background: var(--profile-accent, var(--accent));
  border-color: var(--profile-accent, var(--accent));
  color: #0f0f0f;
  transform: translateY(-1px);
}

.social-links-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.social-link-field .social-link-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.profile-meta {
  margin-top: 12px;
}

.profile-stats {
  margin-top: 0;
  font-size: 0.9rem;
}

.profile-actions {
  margin-left: auto;
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  align-self: flex-start;
  flex-shrink: 0;
}

.btn-profile {
  background: var(--profile-accent, var(--accent));
  color: #0f0f0f;
  font-weight: 700;
}

.btn-profile:hover {
  background: var(--profile-accent-hover, var(--accent-hover));
  color: #0f0f0f;
}

.profile-tabs .tab:hover,
.profile-tabs .tab.active {
  background: var(--profile-accent, var(--accent));
  border-color: var(--profile-accent, var(--accent));
  color: #0f0f0f;
}

.profile-page .profile-masonry.cols-2 { column-count: 2; }
.profile-page .profile-masonry.cols-3 { column-count: 3; }
.profile-page .profile-masonry.cols-4 { column-count: 4; }

.profile-card-soft .card { border-radius: 20px; }
.profile-card-sharp .card { border-radius: 0; }
.profile-card-rounded .card { border-radius: var(--radius); }

.profile-page .card-stats {
  color: var(--profile-accent, var(--accent));
}

/* Edit profile */
.edit-profile-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.edit-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.edit-page-header h1 {
  margin-bottom: 4px;
}

.edit-status-chip {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.edit-status-chip--warn {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.35);
  color: #fcd34d;
}

.edit-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.edit-tab-btn {
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.edit-tab-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.edit-tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 4px 12px var(--accent-soft);
}

.edit-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 900px) {
  .edit-layout {
    grid-template-columns: 1fr;
  }
}

.edit-preview-panel {
  position: sticky;
  top: 80px;
}

.edit-preview-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.edit-panels {
  min-width: 0;
}

.edit-tab-panel {
  display: none;
}

.edit-tab-panel.active {
  display: block;
}

.edit-panel-form {
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.edit-panel-title {
  font-size: 1.25rem;
  margin-bottom: 6px;
  color: var(--text);
}

.edit-panel-desc {
  margin-bottom: 20px;
}

.form-section--compact {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.form-section--compact:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.edit-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.edit-details {
  margin-top: 16px;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg-hover);
  color: var(--text-muted);
}

.edit-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
}

.category-add-form {
  margin-top: 16px;
}

.profile-preview-box {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.profile-preview-box {
  --profile-banner-min-h: 100px;
  --profile-banner-max-h: 130px;
  --profile-avatar-size: 80px;
  --profile-header-overlap: 42px;
}

.profile-preview-box .profile-header-custom {
  margin: calc(-1 * var(--profile-header-overlap)) 16px 16px;
  gap: 12px 16px;
}

.profile-preview-box .profile-avatar {
  width: var(--profile-avatar-size);
  height: var(--profile-avatar-size);
}

.profile-preview-box .profile-body {
  padding-top: calc(var(--profile-header-overlap) - 14px);
}

.profile-preview-box .profile-display-name {
  font-size: 1.15rem;
}

.profile-preview-box .profile-discord {
  font-size: 0.8rem;
}

.profile-preview-box .profile-bio {
  margin-top: 10px;
  font-size: 0.85rem;
}

.form-section {
  margin-bottom: 28px;
}

.form-section h3 {
  margin-bottom: 12px;
  color: var(--accent);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 600px) {
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
}

.theme-option {
  cursor: pointer;
  text-align: center;
}

.theme-option input {
  display: none;
}

.theme-swatch {
  display: block;
  height: 48px;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.theme-option input:checked + .theme-swatch {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

.theme-label {
  display: block;
  font-size: 0.75rem;
  margin-top: 4px;
  color: var(--text-muted);
}

.color-row {
  display: flex;
  gap: 16px;
}

.color-row label {
  flex: 1;
}

.color-row input[type="color"] {
  width: 100%;
  height: 44px;
  padding: 4px;
  cursor: pointer;
}

.current-banner {
  margin-bottom: 16px;
}

.current-banner img {
  max-height: 120px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.banner-position-frame {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 3 / 1;
  min-height: 100px;
  max-height: 160px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border);
  cursor: crosshair;
  margin-bottom: 12px;
  background: var(--bg-card);
}

.banner-position-frame--upload {
  margin-top: 12px;
}

.banner-position-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.banner-position-marker {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 2;
}

.banner-position-sliders {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.banner-position-sliders label {
  font-size: 0.85rem;
}

.banner-position-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  pointer-events: none;
  z-index: 1;
}

.post-music-fab {
  position: fixed;
  bottom: 88px;
  right: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.post-music-fab-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #0f0f0f;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.post-music-fab-btn.is-playing {
  animation: post-music-pulse 1.2s ease-in-out infinite;
}

@keyframes post-music-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

.post-music-fab-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.post-music-fab-panel.hidden {
  display: none;
}

.post-music-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.post-music-mute {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
}

/* Category tabs */
.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 24px 24px;
}

.tab {
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  transition: all 0.2s;
}

.tab:hover,
.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0f0f0f;
}

.profile-page .profile-masonry {
  padding: 0 24px;
}

/* Post detail */
.post-page {
  max-width: 1200px;
  margin: 0 auto;
}

.post-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
}

@media (min-width: 901px) {
  .post-layout .post-image-wrap {
    max-width: 680px;
    justify-self: center;
    width: 100%;
  }
}

@media (max-width: 900px) {
  .post-layout {
    grid-template-columns: 1fr;
  }
}

.post-image-wrap {
  --post-frame-ratio: 4 / 5;
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: var(--post-frame-ratio);
  max-height: min(82vh, 760px);
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(165deg, #0c0a14 0%, #161024 45%, #1f1535 100%);
  border: 1px solid rgba(168, 85, 247, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.post-image-wrap.is-frame-ready {
  transition: width 0.2s ease, height 0.2s ease;
}

.post-image-wrap.is-portrait.is-frame-ready {
  max-width: min(100%, 500px);
}

.post-image-wrap.is-protected .post-image {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Marca d'água com nome do autor da arte */
.post-image-watermark {
  --wm-pattern: none;
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.post-image-watermark.is-capture-active {
  opacity: 1;
  visibility: visible;
}

.post-image-wrap.is-mobile-guard .post-image {
  -webkit-touch-callout: none;
}

.post-image-watermark.is-capture-active.is-mobile-flash {
  animation: mobile-watermark-pulse 0.35s ease;
}

@keyframes mobile-watermark-pulse {
  from {
    opacity: 0.5;
  }
  to {
    opacity: 1;
  }
}

.post-image-watermark::before,
.post-image-watermark::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 240%;
  height: 240%;
  transform: translate(-50%, -50%) rotate(-32deg);
  background-image: var(--wm-pattern);
  background-size: var(--wm-tile-w, 150px) 72px;
  background-repeat: repeat;
  opacity: 0.85;
}

.post-image-watermark::after {
  transform: translate(calc(-50% + 50%), calc(-50% + 36px)) rotate(-32deg);
  opacity: 0.65;
}

.post-image-wrap.is-capture-active {
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.45);
}

.post-image-wrap > .post-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
}

.post-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
}

.post-image-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
}

.post-image-carousel .carousel-track {
  display: grid;
  grid-template-areas: 'stack';
  position: relative;
  width: 100%;
  height: 100%;
}

.post-image-carousel .carousel-slide {
  grid-area: stack;
  position: relative;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 300ms ease, visibility 300ms ease;
}

.post-image-carousel .carousel-slide .post-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.post-image-carousel .carousel-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

.post-image-carousel .carousel-track.is-transitioning .carousel-slide {
  will-change: opacity;
}

.post-image-carousel .carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.post-image-carousel .carousel-arrow:hover {
  background: rgba(0, 0, 0, 0.75);
}

.post-image-carousel .carousel-arrow[hidden] {
  display: none;
}

.post-image-carousel .carousel-swipe-hint {
  display: none;
}

.post-image-carousel .carousel-prev {
  left: 12px;
}

.post-image-carousel .carousel-next {
  right: 12px;
}

.post-image-carousel .carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 4;
}

.post-image-carousel .carousel-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.post-image-carousel .carousel-dot.is-active {
  background: #fff;
}

.post-image-carousel .carousel-counter {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}

.card-image-count {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  pointer-events: none;
}

.post-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.post-display-name {
  font-weight: 700;
  font-size: 1.1rem;
  display: block;
}

.post-display-name:hover {
  color: var(--accent);
}

.post-discord {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.post-title {
  font-size: 1.4rem;
}

.post-description {
  color: var(--text-muted);
}

.post-category,
.post-art-type,
.card-art-type {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-hover);
  border-radius: 12px;
  font-size: 0.8rem;
}

.card-art-type {
  margin-bottom: 6px;
  color: var(--accent);
  font-weight: 600;
}

.post-art-type {
  margin-left: 6px;
  color: var(--accent);
}

/* Votes */
.vote-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.post-category-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 8px;
}

.post-category-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.post-category-select {
  min-width: 160px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
}

.post-owner-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.post-edit-panel {
  margin: 16px 0;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.post-edit-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  color: var(--accent);
  list-style: none;
}

.post-edit-summary::-webkit-details-marker {
  display: none;
}

.post-edit-form {
  margin-top: 14px;
}

.post-edit-form label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.post-edit-form input,
.post-edit-form textarea,
.post-edit-form select {
  width: 100%;
  margin-top: 4px;
}

.post-edit-music {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.post-edit-music-title {
  font-size: 1rem;
  margin-bottom: 8px;
}

.post-edit-alert {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.post-edit-alert--ok {
  background: rgba(46, 204, 113, 0.15);
  color: var(--success);
}

.post-edit-alert--err {
  background: rgba(231, 76, 60, 0.15);
  color: var(--danger);
}

.file-drop-zone--compact {
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
}

.vote-btn:hover {
  background: var(--bg-hover);
}

.vote-btn.active.vote-like {
  background: rgba(46, 204, 113, 0.2);
  border-color: var(--success);
  color: var(--success);
}

.vote-btn.active.vote-dislike {
  background: rgba(231, 76, 60, 0.2);
  border-color: var(--danger);
  color: var(--danger);
}

.vote-score {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Comments */
.comments-section {
  margin-top: 8px;
}

.comments-title {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--text);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.comment-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-replies {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-left: 28px;
  padding-left: 12px;
  border-left: 2px solid rgba(168, 85, 247, 0.35);
}

.comment {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.comment--reply .comment-bubble {
  border-radius: 4px 14px 14px 14px;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--accent-soft);
  object-fit: cover;
}

.comment-bubble {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  background: linear-gradient(145deg, var(--bg-card) 0%, rgba(168, 85, 247, 0.08) 100%);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 4px 16px 16px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  position: relative;
}

.comment-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.comment-author {
  min-width: 0;
}

.comment-display-name {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.comment-author:hover .comment-display-name {
  color: var(--accent);
}

.comment-discord {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

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

.comment-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.comment-body {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  word-break: break-word;
}

.comment-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(168, 85, 247, 0.1);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.comment-delete-btn:hover {
  color: #fff;
  background: var(--danger);
  border-color: rgba(248, 113, 113, 0.5);
}

.comment-reply-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.comment-reply-btn:hover {
  background: var(--accent-soft);
}

.comment-reply-to {
  margin: 0 0 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.comment-reply-to a {
  color: var(--accent);
  font-weight: 600;
}

.comment-reply-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 8px 12px;
  background: rgba(168, 85, 247, 0.12);
  border-radius: 10px;
  font-size: 0.85rem;
}

.comment-reply-banner.hidden {
  display: none;
}

.comment-reply-cancel {
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
}

.comment-reply-cancel:hover {
  color: var(--text);
  border-color: var(--accent);
}

.comment-delete-icon {
  font-size: 0.85rem;
  font-weight: 700;
}

.comment-form {
  margin-top: 4px;
}

.comment-compose {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.comment-compose textarea {
  flex: 1;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  resize: vertical;
  font-family: inherit;
  font-size: 0.9rem;
}

.comment-compose textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.btn-comment-send {
  flex-shrink: 0;
  padding: 10px 18px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--accent-soft);
  transition: transform 0.15s, filter 0.15s;
}

.btn-comment-send:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-comment-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.comment-login-hint {
  padding: 12px;
  text-align: center;
  background: var(--bg-card);
  border-radius: 12px;
}

/* Forms */
.form-page {
  max-width: 560px;
  margin: 0 auto;
}

.form label {
  display: block;
  margin-bottom: 16px;
  font-weight: 500;
}

.form input,
.form textarea,
.form select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
}

.form input:focus,
.form textarea:focus,
.form select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-inline {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.form-inline label {
  flex: 1;
}

/* Login */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.login-card {
  text-align: center;
  max-width: 420px;
  padding: 48px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-logo {
  width: 140px;
  height: 140px;
  border-radius: 0;
  margin: 0 auto 16px;
  object-fit: contain;
  border: none;
  box-shadow: none;
}

.login-card h1 {
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent-glow), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-card p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Leaderboard */
.leaderboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

@media (max-width: 768px) {
  .leaderboard-grid {
    grid-template-columns: 1fr;
  }
}

.leaderboard-col h2 {
  margin-bottom: 16px;
  color: var(--accent);
}

.leaderboard-list {
  list-style: none;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 4px;
}

.leaderboard-item:hover {
  background: var(--bg-card);
}

.rank {
  font-weight: 700;
  width: 28px;
  color: var(--accent);
}

.lb-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.lb-info {
  flex: 1;
}

.lb-display-name {
  font-weight: 600;
  display: block;
}

.lb-display-name:hover {
  color: var(--accent);
}

.lb-discord {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.lb-score {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Categories */
.category-list {
  list-style: none;
  margin-bottom: 24px;
}

.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.profile-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
}

.preview-discord {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.alert-error {
  background: rgba(231, 76, 60, 0.15);
  color: var(--danger);
}

.alert-success {
  background: rgba(46, 204, 113, 0.15);
  color: var(--success);
}

.hint {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.hint a {
  color: var(--accent);
}

.env-list {
  margin: 8px 0 0 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.env-list code {
  color: var(--accent);
}

.btn-discord:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.empty-state {
  color: var(--text-muted);
  padding: 32px;
  text-align: center;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.hidden {
  display: none !important;
}

.loading {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
}

.load-sentinel {
  height: 1px;
}

.file-upload-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 16px;
  background: var(--bg-card);
  position: relative;
}

.file-drop-zone input[type='file'],
.file-drop-zone .file-input-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.file-drop-zone.has-file .file-zone-prompt {
  display: none;
}

.file-zone-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
}

.file-zone-preview .image-preview-thumb {
  flex: 1 1 140px;
  max-width: calc(50% - 6px);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-elevated, var(--bg-elevated));
}

.file-zone-preview .image-preview-thumb img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  margin: 0;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.file-drop-zone.has-file {
  border-color: var(--accent);
  border-style: solid;
}

.file-zone-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.file-zone-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.file-zone-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.file-zone-name {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--accent);
}

.url-upload-details {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.url-upload-details summary {
  cursor: pointer;
  color: var(--text-muted);
}

.url-upload-details summary:hover {
  color: var(--accent);
}

.image-preview {
  margin-bottom: 16px;
  border-radius: var(--radius);
  overflow: hidden;
}

.image-preview img {
  max-height: 300px;
  width: auto;
  margin: 0 auto;
}

.image-preview-multi {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}

.image-preview-thumb {
  flex: 1 1 140px;
  max-width: calc(50% - 6px);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-elevated, var(--bg-elevated));
}

.image-preview-thumb img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  margin: 0;
}

.error-page {
  text-align: center;
  padding: 64px 24px;
}

.error-page h1 {
  margin-bottom: 12px;
}

.error-page p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Profile music */
.profile-music-edit .current-music {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-hover);
  border: 1px solid var(--border);
}

.music-preview-audio,
.current-music audio,
.music-trim-audio {
  width: 100%;
  margin: 10px 0;
}

.music-trim-panel {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg-hover);
  border: 1px solid var(--border);
}

.music-trim-panel h4 {
  margin-bottom: 8px;
  color: var(--accent);
}

.trim-slider-row {
  margin: 12px 0;
}

.trim-slider-row label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.trim-slider-row input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
}

.trim-segment-info {
  font-size: 0.9rem;
  margin: 8px 0 12px;
  color: var(--text-muted);
}

.trim-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.volume-slider-label {
  display: block;
  margin-top: 12px;
}

.volume-slider-label input[type='range'] {
  width: 100%;
  margin-top: 8px;
  accent-color: var(--accent);
}

.profile-music-fab {
  position: fixed;
  right: 16px;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.profile-music-fab-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--profile-accent, var(--accent));
  color: #0f0f0f;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.profile-music-fab-btn.is-playing {
  animation: music-pulse 2s ease-in-out infinite;
}

@keyframes music-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.profile-music-fab-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.profile-music-fab-panel.hidden {
  display: none;
}

.profile-music-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.profile-music-fab-panel input[type='range'] {
  width: 90px;
  accent-color: var(--accent);
}

.profile-music-mute {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
}

/* Upload progress overlay */
.oa-upload-progress-root {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 8, 18, 0.72);
  backdrop-filter: blur(4px);
}

.oa-upload-progress-root.hidden {
  display: none;
}

.oa-upload-progress-card {
  width: min(100%, 360px);
  padding: 24px 22px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.oa-upload-progress-label {
  margin: 0 0 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.oa-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  overflow: hidden;
}

.oa-progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transition: width 0.15s ease-out;
}

.oa-progress-bar.is-indeterminate .oa-progress-bar-fill {
  width: 40% !important;
  animation: oa-progress-indeterminate 1.2s ease-in-out infinite;
}

@keyframes oa-progress-indeterminate {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

.oa-upload-progress-percent {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  min-height: 1.2em;
}

.footer {
  text-align: center;
  padding: 24px 16px 32px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 600;
}

.footer-brand img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.footer a {
  color: var(--accent-glow);
}

.footer a:hover {
  color: var(--accent);
}

/* Credits */
.credits-page {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  text-align: center;
}

.credits-hero {
  margin-bottom: 28px;
}

.credits-logo {
  width: min(240px, 80vw);
  height: auto;
  border-radius: 0;
  margin: 0 auto 20px;
  object-fit: contain;
  border: none;
  box-shadow: none;
}

.credits-page h1 {
  font-size: 1.75rem;
  margin-bottom: 6px;
}

.credits-tagline {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.credits-card {
  text-align: left;
  padding: 24px;
  background: linear-gradient(160deg, var(--bg-card), rgba(46, 0, 79, 0.5));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.credits-list {
  margin: 0;
}

.credits-row {
  padding: 14px 0;
  border-bottom: 1px solid rgba(76, 29, 149, 0.5);
}

.credits-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.credits-row dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.credits-row dd {
  margin: 0;
  font-size: 1.05rem;
}

.credits-highlight {
  font-size: 1.35rem !important;
  font-weight: 800;
  color: var(--accent-glow) !important;
}

.credits-footer-note {
  margin-top: 24px;
  text-align: center;
}

/* Profile stats links */
.profile-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.profile-stat-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  transition: color 0.15s;
}

.profile-stat-link:hover {
  color: var(--profile-accent, var(--accent));
}

.profile-stat-sep {
  color: var(--text-muted);
  opacity: 0.5;
  user-select: none;
}

/* Connections (following / followers) */
.connections-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px;
}

.connections-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.connections-back:hover {
  color: var(--accent);
}

.connections-header h1 {
  font-size: 1.75rem;
  margin-bottom: 4px;
}

.connections-subtitle {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.connections-subtitle a:hover {
  color: var(--accent);
}

.connections-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.connections-tabs .tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.connections-tabs .tab:hover,
.connections-tabs .tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0f0f0f;
}

.user-list {
  list-style: none;
}

.user-list-item {
  border-bottom: 1px solid var(--border);
}

.user-list-item:last-child {
  border-bottom: none;
}

.user-list-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 8px;
  transition: background 0.15s;
}

.user-list-link:hover {
  background: var(--bg-hover);
}

.user-list-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--accent);
}

.user-list-name {
  display: block;
  font-weight: 600;
  font-size: 1rem;
}

.user-list-discord {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.user-list-bio {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* OA modal (substitui confirm do navegador) */
.oa-modal-root {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.oa-modal-root.hidden {
  display: none;
}

.oa-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 10, 20, 0.82);
  backdrop-filter: blur(10px);
}

.oa-modal-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 28px 24px 22px;
  border-radius: 20px;
  background: linear-gradient(160deg, var(--bg-card) 0%, #1a1228 100%);
  border: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(168, 85, 247, 0.1);
  text-align: center;
}

.oa-modal-box--danger .oa-modal-icon {
  background: rgba(248, 113, 113, 0.15);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}

.oa-modal-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--accent-soft);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: var(--accent);
}

.oa-modal-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--text);
}

.oa-modal-message {
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 22px;
  font-size: 0.95rem;
}

.oa-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-modal-cancel {
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-modal-cancel:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--bg-hover);
}

.btn-modal-confirm {
  padding: 10px 24px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--accent-soft);
  transition: transform 0.15s, filter 0.15s;
}

.btn-modal-confirm:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-modal-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

.btn-modal-danger:hover {
  filter: brightness(1.1);
}

body.oa-modal-open {
  overflow: hidden;
}

@media print {
  .post-image-watermark {
    opacity: 1 !important;
    visibility: visible !important;
  }
}

/* Content warnings (nudismo) */
.card-image.content-sensitive,
.post-image-wrap.content-sensitive {
  position: relative;
  overflow: hidden;
}

.content-sensitive.is-blurred img {
  filter: blur(48px) brightness(0.55);
  transform: scale(1.05);
  object-fit: contain;
  object-position: center center;
}

.post-image-wrap.content-sensitive.is-blurred .post-image,
.post-image-wrap.content-sensitive.is-blurred .carousel-slide .post-image {
  width: 100%;
  height: 100%;
}

.content-warning-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  text-align: center;
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(4px);
  cursor: pointer;
  z-index: 5;
}

.content-warning-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.content-warning-action {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}

.content-warning-overlay.content-warning-blocked {
  cursor: not-allowed;
  pointer-events: none;
}

.content-sensitive.is-revealed img {
  filter: none;
  transform: none;
}

/* Achievement badges */
.badges-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.badges-hero h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.badges-stats-card,
.badges-picker-section,
.badges-catalog {
  margin-top: 32px;
}

.badges-stats-card {
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.badges-unlock-count {
  margin: 8px 0 16px;
  color: var(--text-muted);
}

.badges-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  list-style: none;
}

.badges-stats-grid .stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.badges-stats-grid .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badges-category-title {
  margin: 24px 0 12px;
  font-size: 1rem;
  color: var(--text-muted);
}

.badges-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.badge-catalog-card {
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.badge-catalog-card.is-unlocked {
  border-color: rgba(34, 197, 94, 0.35);
}

.badge-catalog-status {
  display: block;
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badge-catalog-status--ok {
  color: var(--accent);
  font-weight: 600;
}

.badge-progress {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.badge-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
}

.badges-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.badge-picker-item {
  cursor: pointer;
}

.badge-picker-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.badge-picker-item.is-selected .achievement-badge {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.profile-achievement-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 6px;
}

.achievement-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-card);
  line-height: 1.2;
}

.achievement-badge--lg {
  padding: 10px 14px;
  font-size: 0.85rem;
  border-radius: 12px;
  flex-direction: column;
  align-items: flex-start;
  min-width: 140px;
}

.achievement-badge-icon {
  font-size: 1.1em;
  line-height: 1;
}

.achievement-badge--lg .achievement-badge-icon {
  font-size: 1.5rem;
}

.achievement-badge-desc {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 4px;
}

.achievement-badge.is-locked,
.badge-catalog-card:not(.is-unlocked) .achievement-badge--lg {
  opacity: 0.55;
}

.achievement-badge--bronze {
  border-color: #b45309;
  background: rgba(180, 83, 9, 0.12);
}

.achievement-badge--silver {
  border-color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
}

.achievement-badge--gold {
  border-color: #eab308;
  background: rgba(234, 179, 8, 0.12);
}

.achievement-badge--platinum {
  border-color: #a78bfa;
  background: rgba(167, 139, 250, 0.15);
}

.achievement-badge.is-new {
  animation: badge-pop 0.5s ease;
}

@keyframes badge-pop {
  0% {
    transform: scale(0.85);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 600px) {
  .badges-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .badges-catalog-grid {
    grid-template-columns: 1fr;
  }
}

/* Special staff tags (not in /badges) */
.profile-special-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 6px;
}

@media (max-width: 768px) {
  .profile-page {
    --profile-banner-min-h: 200px;
    --profile-banner-max-h: 260px;
    --profile-avatar-size: 100px;
    --profile-header-overlap: 58px;
  }

  .profile-preview-box {
    --profile-banner-min-h: 88px;
    --profile-banner-max-h: 110px;
    --profile-header-overlap: 36px;
  }

  .profile-header-custom {
    margin-left: 16px;
    margin-right: 16px;
    margin-bottom: 28px;
    gap: 14px 16px;
  }

  .profile-body {
    padding-top: calc(var(--profile-header-overlap) - 16px);
  }

  .profile-top-row {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .profile-actions {
    margin-left: 0;
    align-self: stretch;
    justify-content: flex-start;
  }

  .profile-page .profile-masonry {
    padding: 0 16px;
  }
}

@media (max-width: 480px) {
  .profile-page {
    --profile-banner-min-h: 168px;
    --profile-banner-max-h: 220px;
    --profile-avatar-size: 88px;
    --profile-header-overlap: 50px;
  }

  .profile-preview-box {
    --profile-banner-min-h: 76px;
    --profile-banner-max-h: 96px;
    --profile-header-overlap: 32px;
  }

  .profile-actions .btn span {
    display: none;
  }

  .profile-actions .btn {
    padding: 10px 12px;
  }
}

.special-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--tag-color, #a78bfa);
  background: color-mix(in srgb, var(--tag-color, #a78bfa) 18%, transparent);
  color: var(--text);
}

.special-tag-icon {
  font-size: 1em;
}

.staff-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.staff-user-panel h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.staff-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.staff-badge-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 24px;
}

.staff-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.staff-badge-row.is-unlocked {
  border-color: rgba(34, 197, 94, 0.35);
}

.staff-tag-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.staff-tag-list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.staff-tag-id {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.staff-user-tags {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.staff-user-tags li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.staff-tag-create-form {
  display: grid;
  gap: 10px;
  max-width: 420px;
}

.site-status-banner {
  margin: 0 24px 16px;
  padding: 12px 16px;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.4);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.site-status-banner.hidden {
  display: none;
}

.site-status-banner code {
  font-size: 0.8em;
}

.nudismo-staff-banner {
  padding: 8px 16px;
  text-align: center;
  font-size: 0.85rem;
  background: rgba(99, 102, 241, 0.2);
  border-bottom: 1px solid rgba(99, 102, 241, 0.35);
  color: var(--text, #e8e0f0);
}

.nudismo-staff-banner--blocked {
  background: rgba(34, 197, 94, 0.12);
  border-bottom-color: rgba(34, 197, 94, 0.3);
}

/* Notifications bell */
.nav-notifications {
  position: relative;
}

.nav-notif-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

.nav-notifications.has-unread .oa-icon {
  color: var(--accent);
}

.mobile-nav-icon-wrap {
  position: relative;
  display: inline-flex;
}

.mobile-nav-notif-badge {
  top: -6px;
  right: -10px;
}

.notifications-page {
  max-width: 640px;
  margin: 0 auto;
}

.notifications-hero h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.notifications-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted, #a1a1aa);
}

.notifications-empty-icon {
  opacity: 0.35;
  margin-bottom: 12px;
}

.notifications-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-item {
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.notification-item.is-unread {
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.15);
}

.notification-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
}

.notification-link:hover {
  background: rgba(168, 85, 247, 0.06);
}

.notification-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}

.notification-body {
  flex: 1;
  min-width: 0;
}

.notification-text {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.notification-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted, #a1a1aa);
}

.notification-post-title {
  font-weight: 500;
}

.notification-type-icon {
  flex-shrink: 0;
  opacity: 0.7;
  margin-top: 2px;
}

