/* Minesocial - Dark theme, clean and professional */
:root {
  --bg: #0c1017;
  --panel: #141922;
  --panel-2: #1a2030;
  --border: #232a3b;
  --border-strong: #2e3648;
  --text-primary: #e8ecf3;
  --text-secondary: #b4bdcc;
  --text-muted: #76839a;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --like: #f43f5e;
  --success: #10b981;
  --sidebar: #0c1017;
  --sidebar-hover: #181f2e;
  --sidebar-active: #1d2637;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
}

/* Opening splash animation */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, #141c2b 0%, #0c1017 70%);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.splash.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  animation: splashPop 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.splash-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  animation: splashFloat 2.2s ease-in-out infinite;
  filter: drop-shadow(0 12px 40px rgba(59, 130, 246, 0.35));
}

.splash-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  animation: splashFade 0.9s ease 0.15s both;
}

@keyframes splashPop {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes splashFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes splashFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

a {
  color: var(--accent);
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 32px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-name {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text-muted);
  font-weight: 500;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
  position: relative;
}

.nav-item:hover {
  transform: translateX(2px);
}

.nav-item i {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 22px;
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
}

.nav-item .material-symbols-outlined {
  font-size: 22px;
  width: 24px;
  text-align: center;
}

.bottom-nav-item .material-symbols-outlined {
  font-size: 26px;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: var(--text-primary);
}

.nav-item.active i,
.nav-item.active .material-symbols-outlined {
  color: var(--accent);
}

.nav-item.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

.badge {
  position: absolute;
  right: 12px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--sidebar-hover);
  border-radius: 10px;
}

.avatar-btn {
  padding: 0;
  border-radius: 50%;
  flex-shrink: 0;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.avatar-fallback {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
}

.avatar-fallback-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
}

.avatar-fallback-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 28px;
  text-transform: uppercase;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-handle {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-ghost {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-ghost:hover {
  background: var(--border);
  color: var(--text-primary);
}

/* Main */
.main {
  flex: 1;
  margin-left: 280px;
  width: calc(100% - 280px);
  padding: 32px 48px 80px;
}

/* Content sections wrapper width handled per-view */
.content-section {
  width: 100%;
  margin: 0 auto;
}

.topbar-mobile {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand-mobile {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text-primary);
}

.brand-logo-sm {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-sm img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

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

/* Content sections */
.content-section {
  display: none;
}

.content-section.active {
  display: block;
  max-width: 900px;
  margin: 0 auto;
  animation: fadeUp 0.28s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.header {
  margin-bottom: 24px;
}

.header-sub {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* User menu (3 dots) */
.user-menu {
  position: absolute;
  bottom: 72px;
  left: 16px;
  right: 16px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 60;
  animation: popIn 0.14s ease both;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: left;
}

.user-menu-item .material-symbols-outlined {
  font-size: 18px;
}

.user-menu-item:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

.user-menu-item.danger {
  color: var(--like);
}

.user-menu-item.danger:hover {
  background: rgba(244, 63, 94, 0.12);
}

.user-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

.sidebar-footer {
  position: relative;
}

/* Studio */
.studio-range {
  margin-bottom: 24px;
  max-width: 100%;
}

.studio-range .studio-range-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.studio-range .studio-range-btn i {
  font-size: 14px;
  opacity: 0.85;
}

.studio-range .studio-range-btn:hover {
  color: var(--text-primary);
  background: var(--sidebar-hover);
}

.studio-range .studio-range-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px -2px rgba(59, 130, 246, 0.5);
}

.studio-range .studio-range-btn.active i {
  opacity: 1;
}

.studio-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.studio-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.studio-card.accent {
  border-color: rgba(59, 130, 246, 0.4);
  background: linear-gradient(160deg, rgba(59, 130, 246, 0.1), var(--panel));
}

.studio-card-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.studio-card-label .material-symbols-outlined {
  font-size: 16px;
}

.studio-card-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.studio-card-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.studio-chart-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.studio-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.studio-chart-head h3 {
  margin: 0;
  font-size: 15px;
}

.studio-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
}

.studio-chart {
  position: relative;
  min-height: 200px;
}

.studio-empty {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 60px 0;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 200px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.bar-col {
  flex: 1;
  min-width: 8px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: flex-end;
  position: relative;
}

.bar {
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: opacity 0.15s ease;
}

.bar.views { background: #3b82f6; }
.bar.likes { background: #f43f5e; }
.bar.coins { background: #10b981; }

.bar-col:hover .bar { opacity: 0.75; }

.bar-tip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 11px;
  white-space: nowrap;
  color: var(--text-primary);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 5;
}

.bar-col:hover .bar-tip { opacity: 1; }

/* Shop */
.shop-cat {
  margin-bottom: 32px;
}

.shop-cat h3 {
  font-size: 15px;
  margin: 0 0 14px;
}

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

.shop-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.shop-item:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.shop-item.owned {
  border-color: var(--success);
}

.shop-item-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  background: var(--panel-2);
}

.shop-item-body {
  padding: 12px;
}

.shop-item-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.shop-item-price {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.shop-item-price .material-symbols-outlined {
  font-size: 15px;
  color: #f5c542;
}

.shop-item .btn-primary,
.shop-item .btn-secondary {
  width: 100%;
  padding: 8px;
  font-size: 13px;
}

.btn-secondary {
  padding: 9px 18px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

.btn-primary.owned,
.shop-item .owned-btn {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.4);
  cursor: default;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

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

.stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.stat-label .material-symbols-outlined {
  font-size: 16px;
}

.stat-card[data-live] .stat-label .material-symbols-outlined {
  color: var(--success);
}

.stat-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Stats */
.stats-big {
  display: flex;
  flex-direction: column;
  gap: 56px;
  padding: 24px 0 56px;
  text-align: center;
}

.stat-big-value {
  font-size: clamp(48px, 9vw, 96px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-primary);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.4), color 0.3s ease;
}

.stat-big-value.bump {
  animation: statBump 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

@keyframes statBump {
  0% { transform: scale(1); color: var(--text-muted); }
  40% { transform: scale(1.12); color: var(--accent); }
  100% { transform: scale(1); color: var(--text-primary); }
}

.stat-big-label {
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 6px;
}

/* Fixed coins pill */
.coins-pill {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 12px 14px;
  background: linear-gradient(150deg, #1c2536, #141922);
  border: 1px solid rgba(245, 197, 66, 0.35);
  border-radius: 999px;
  box-shadow: 0 8px 30px -8px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(245, 197, 66, 0.08);
  z-index: 45;
  animation: popIn 0.2s ease both;
}

.coins-pill-icon {
  font-size: 24px;
  color: #f5c542;
  filter: drop-shadow(0 0 6px rgba(245, 197, 66, 0.5));
}

.coins-pill-value {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.coins-pill-value.bump {
  animation: statBump 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

@media (max-width: 720px) {
  .coins-pill {
    right: 14px;
    bottom: 84px;
    padding: 10px 16px 10px 12px;
  }
}

/* Admin */
.admin-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  max-width: 560px;
}

.admin-block h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.admin-hint {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 18px;
}

.admin-add-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-add-row input {
  flex: 1;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.admin-msg {
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 18px;
}

.admin-msg.ok { color: var(--success); }
.admin-msg.err { color: var(--like); }

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.admin-row button {
  color: var(--like);
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px;
}

.admin-row button:hover {
  background: rgba(244, 63, 94, 0.12);
}

.admin-block {
  max-width: 640px;
  margin-bottom: 20px;
}

.admin-report-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.admin-report-msg {
  color: var(--text-primary);
  font-size: 14px;
  word-break: break-word;
}

.admin-report-meta {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.admin-report-actions {
  display: flex;
  gap: 8px;
}

.admin-report-actions button {
  color: var(--accent);
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.admin-report-actions button:hover {
  background: var(--sidebar-hover);
}

.admin-report-actions button.danger {
  color: var(--like);
}

.modal-sm {
  max-width: 400px;
}

.header h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.filters {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.filter i {
  font-size: 14px;
  opacity: 0.85;
}

.filter:hover {
  color: var(--text-primary);
  background: var(--sidebar-hover);
}

.filter.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px -2px rgba(59, 130, 246, 0.5);
}

.filter.active i {
  opacity: 1;
}

/* Composer */
.composer {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.composer.locked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.composer.locked p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.btn-primary {
  padding: 9px 18px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -6px rgba(59, 130, 246, 0.6);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.composer-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.composer textarea {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  resize: vertical;
  min-height: 70px;
  outline: none;
  transition: border-color 0.15s ease;
}

.composer textarea:focus {
  border-color: var(--accent);
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-left: 48px;
}

.charcount {
  color: var(--text-muted);
  font-size: 13px;
}

/* Feed */
.feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.3s ease both;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.post:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
}

.post.no-anim {
  animation: none;
}

.post-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.post-author-info {
  min-width: 0;
}

.post-author-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.post-author-handle {
  color: var(--text-muted);
  font-size: 13px;
}

.post-time {
  color: var(--text-muted);
  font-size: 13px;
}

.post-content {
  margin: 12px 0 16px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
  color: var(--text-primary);
}

.post-actions {
  display: flex;
  gap: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Post / profile mini menus (3 dots) */
.post-menu-wrap,
.mini-menu-wrap {
  position: relative;
  margin-left: auto;
}

.post-menu-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.post-menu-btn:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

.post-menu-btn .material-symbols-outlined {
  font-size: 20px;
}

.mini-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 168px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 50;
  animation: popIn 0.14s ease both;
}

.mini-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: left;
}

.mini-menu-item .material-symbols-outlined {
  font-size: 18px;
}

.mini-menu-item:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

.mini-menu-item.danger {
  color: var(--like);
}

.mini-menu-item.danger:hover {
  background: rgba(244, 63, 94, 0.12);
}

.nav-item.has-unread,
.bottom-nav-item.has-unread {
  color: var(--accent);
}

.nav-item.has-unread .material-symbols-outlined,
.bottom-nav-item.has-unread .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s ease, transform 0.15s ease;
}

.action-btn:hover {
  color: var(--text-secondary);
}

.action-btn:active {
  transform: scale(0.94);
}

.action-btn.liked {
  color: var(--like);
}

.action-btn.liked i {
  animation: pop 0.28s ease;
}

@keyframes pop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.empty-state i {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: inline-block;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--text-primary);
}

.empty-state p {
  margin: 0;
  color: var(--text-muted);
}

/* Notifications */
.notifications-list {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: visible;
}

.notification-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  animation: fadeUp 0.3s ease both;
}

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

.notification-item:hover {
  background: var(--panel-2);
  transform: translateX(2px);
}

.notification-item.unread {
  background: var(--accent-soft);
}

.notification-text {
  flex: 1;
  font-size: 14px;
  color: var(--text-secondary);
}

.notification-text strong {
  font-weight: 600;
  color: var(--text-primary);
}

.notification-time {
  color: var(--text-muted);
  font-size: 12px;
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.notification-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.notif-menu-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.notification-menu-wrap .mini-menu {
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
}

/* Profile edit */
.pe-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.pe-banner {
  display: block;
  width: 100%;
  height: 180px;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  background-size: cover;
  background-position: center;
  position: relative;
}

.pe-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.pe-banner:hover .pe-hint {
  opacity: 1;
}

.pe-pfp-wrap {
  padding: 0 24px;
  margin-top: -50px;
  position: relative;
}

.pe-pfp {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid var(--panel);
  padding: 0;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--panel-2);
  display: block;
}

.pe-pfp-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pe-pfp-fb {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 32px;
  text-transform: uppercase;
}

.pe-pfp-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.pe-pfp:hover .pe-pfp-overlay {
  opacity: 1;
}

@media (hover: none) {
  .pe-hint,
  .pe-pfp-overlay {
    opacity: 1;
  }
}

.pe-fields {
  padding: 16px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pe-field {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pe-field:hover {
  background: var(--panel-2);
  border-color: var(--border);
}

.pe-field.editing {
  background: var(--panel-2);
  border-color: var(--accent);
  cursor: default;
}

.pe-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.pe-field-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.pe-field-icon {
  font-size: 16px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.pe-field:hover .pe-field-icon {
  opacity: 1;
}

.pe-field.editing .pe-field-icon {
  opacity: 0;
}

.pe-field-value {
  font-size: 15px;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 22px;
}

.pe-field-value:empty::after {
  content: "(empty)";
  color: var(--text-muted);
}

.pe-field-editor {
  margin-top: 8px;
}

.pe-field-editor input,
.pe-field-editor textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 8px;
  outline: none;
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
}

.pe-editor-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

.pe-savebar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 12px 12px 12px 20px;
  box-shadow: var(--shadow-lg);
  z-index: 80;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.pe-savebar-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

.pe-savebar-actions {
  display: flex;
  gap: 8px;
}

@media (max-width: 720px) {
  .pe-savebar {
    bottom: 84px;
    left: 14px;
    right: 14px;
    transform: none;
    justify-content: space-between;
  }
  .pe-banner {
    height: 140px;
  }
}

/* Cosmetic picker */
.modal-lg {
  max-width: 720px;
}

.cosmetic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  padding: 20px 24px 24px;
  max-height: 60vh;
  overflow-y: auto;
}

.cosmetic-item {
  background: var(--panel-2);
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
  text-align: left;
}

.cosmetic-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.cosmetic-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.cosmetic-item img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  background: var(--panel);
}

.cosmetic-item-name {
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.cosmetic-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease;
}

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

.form-group small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 6px;
}

/* Creator */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-weight: 500;
}

.btn-back:hover {
  color: var(--text-primary);
}

.creator-header {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  /* visible : sinon les menus (timeout, ban, block...) sont rognes */
  overflow: visible;
  margin-bottom: 24px;
}

.creator-banner {
  height: 200px;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  background-size: cover;
  background-position: center;
  border-radius: var(--radius) var(--radius) 0 0;
}

.creator-info-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 24px;
  margin-top: -40px;
}

.creator-pfp-wrap {
  position: relative;
}

.creator-pfp {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid var(--panel);
  object-fit: cover;
}

.creator-pfp-fb {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid var(--panel);
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 36px;
  text-transform: uppercase;
}

.creator-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
}

.creator-actions .mini-menu-wrap { position: relative; }

.creator-meta {
  padding: 16px 24px 0;
}

.creator-meta h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.creator-handle {
  color: var(--text-muted);
  margin-bottom: 12px;
}

.creator-bio {
  margin: 0 0 16px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-secondary);
}

.creator-stats {
  display: flex;
  gap: 32px;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

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

.stat i {
  color: var(--text-muted);
  font-size: 18px;
}

.stat span {
  font-weight: 600;
  color: var(--text-primary);
}

.stat small {
  color: var(--text-muted);
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--text-primary);
}

/* Comments */
.comments-wrap {
  margin-top: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.comments-wrap h3 {
  margin: 0 0 16px;
  font-size: 16px;
  color: var(--text-primary);
}

.comment-form {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.comment-form textarea {
  flex: 1;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  resize: vertical;
  min-height: 44px;
  outline: none;
}

.comment-form textarea:focus {
  border-color: var(--accent);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.comment-item .avatar-btn {
  flex-shrink: 0;
  line-height: 0;
  display: block;
}

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

.comment-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
  line-height: 1.4;
}

.comment-author {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.comment-time {
  color: var(--text-muted);
  font-size: 12px;
}

.comment-text {
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-secondary);
}

.comment-actions {
  margin-top: 6px;
}

.comment-reply-btn {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

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

.replies {
  margin-top: 12px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  backdrop-filter: blur(3px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-sub {
  padding: 8px 24px 0;
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.tabs {
  display: flex;
  gap: 4px;
  margin: 20px 24px 0;
  background: var(--panel-2);
  padding: 4px;
  border-radius: 10px;
}

.tab {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  font-weight: 500;
  color: var(--text-muted);
}

.tab.active {
  background: var(--panel);
  color: var(--text-primary);
  box-shadow: var(--shadow);
}

.form-error {
  margin: 16px 24px 0;
  padding: 10px 12px;
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

#auth-form {
  padding: 16px 24px 24px;
}

/* Auth modal redesign */
.auth-modal {
  max-width: 920px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  overflow: hidden;
  padding: 0;
}

.auth-visual {
  position: relative;
  min-height: 540px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: inherit;
  background-size: cover;
  background-position: center;
  filter: none;
  transform: none;
}

.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 16, 23, 0.2) 0%, rgba(12, 16, 23, 0.88) 100%);
}

.auth-visual-inner {
  position: relative;
  z-index: 1;
  padding: 36px;
}

.auth-logo {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5));
}

.auth-visual-inner h3 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.auth-visual-inner p {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  max-width: 320px;
  line-height: 1.6;
}

.auth-body {
  padding: 28px 28px 8px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.auth-body .modal-header {
  padding: 0;
}

.auth-body .modal-sub {
  padding: 8px 0 0;
}

.auth-body .tabs {
  margin: 22px 0 0;
}

.auth-body .form-error {
  margin: 16px 0 0;
}

.auth-body #auth-form {
  padding: 16px 0 24px;
}

@media (max-width: 760px) {
  .auth-modal {
    grid-template-columns: 1fr;
    max-width: 440px;
  }
  .auth-visual {
    min-height: 130px;
  }
  .auth-visual-inner {
    padding: 20px 24px;
  }
  .auth-logo {
    width: 38px;
    height: 38px;
    font-size: 18px;
    margin-bottom: 8px;
  }
  .auth-visual-inner h3 {
    font-size: 18px;
  }
  .auth-visual-inner p {
    display: none;
  }
  .auth-body {
    padding: 20px 20px 4px;
    max-height: none;
  }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.toast.error {
  background: #7f1d1d;
  border-color: #991b1b;
  color: #fecaca;
}

/* Mobile bottom nav */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  z-index: 50;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  color: var(--text-muted);
  font-size: 11px;
  position: relative;
}

.bottom-nav-item i {
  font-size: 22px;
}

.bottom-nav-item.active {
  color: var(--accent);
}

.bottom-nav-item .badge {
  position: absolute;
  top: 2px;
  right: 50%;
  transform: translateX(12px);
  padding: 1px 6px;
  font-size: 10px;
}

/* Responsive */
@media (max-width: 968px) {
  .sidebar {
    display: none;
  }
  .main {
    margin-left: 0;
    max-width: 100%;
    padding: 0 0 90px;
  }
  .topbar-mobile {
    display: flex;
  }
  .bottom-nav {
    display: flex;
  }
  .content-section {
    padding: 16px;
  }
  .header {
    padding: 0 4px;
  }
  .pe-card {
    max-width: 100%;
  }
  .creator-info-wrap {
    padding: 0 16px;
  }
  .creator-meta,
  .creator-stats {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 640px) {
  .filters {
    display: flex;
    width: 100%;
  }
  .filter > span {
    display: none;
  }
  .filter {
    flex: 1 1 0;
    justify-content: center;
    padding: 9px 8px;
  }
  .filter i {
    font-size: 16px;
  }
  .composer.locked {
    flex-direction: column;
    align-items: flex-start;
  }
  .composer-footer {
    padding-left: 0;
  }
  .creator-banner {
    height: 140px;
  }
  .creator-pfp,
  .creator-pfp-fb {
    width: 80px;
    height: 80px;
    font-size: 28px;
  }
  .creator-stats {
    gap: 16px;
  }
}

/* --------------------------- SKELETON --------------------------- */
.skeleton {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skeleton-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.skeleton-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--panel-2);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: var(--panel-2);
  position: relative;
  overflow: hidden;
}

.skeleton-line.w40 { width: 40%; }
.skeleton-line.w25 { width: 25%; }
.skeleton-line.w90 { width: 90%; }
.skeleton-line.w70 { width: 70%; }

.skeleton-circle::after,
.skeleton-line::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .skeleton-circle::after,
  .skeleton-line::after {
    animation: none;
  }
}

/* =====================================================================
   Moderation, badges, search, sanctions (appended)
   ===================================================================== */

/* ---- report / coins modal fields ---- */
#report-text,
#coins-amount {
  display: block;
  width: calc(100% - 48px);
  margin: 14px 24px 0;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
}

#report-text:focus,
#coins-amount:focus {
  border-color: var(--accent);
}

.modal > .btn-block {
  width: calc(100% - 48px);
  margin: 12px 24px 24px;
}

/* ---- badges ---- */
.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 2px 7px 2px 4px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  border: 1px solid transparent;
  line-height: 1;
  white-space: nowrap;
}

.badge-chip .material-symbols-outlined {
  font-size: 13px;
  line-height: 1;
  overflow: hidden;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20;
}

.badge-admin    { background: rgba(239, 68, 68, 0.16); color: #f87171; border-color: rgba(239, 68, 68, 0.3); }
.badge-owner    { background: rgba(45, 212, 191, 0.16); color: #2dd4bf; border-color: rgba(45, 212, 191, 0.3); }
.badge-verified { background: rgba(16, 185, 129, 0.16); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.badge-banned   { background: rgba(239, 68, 68, 0.16); color: #f87171; border-color: rgba(239, 68, 68, 0.3); }
.badge-timeout  { background: rgba(245, 158, 11, 0.16); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }

.badge-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: var(--text-muted);
}
.badge-dot.badge-owner { background: #2dd4bf; }
.badge-dot.badge-admin { background: #f87171; }
.badge-dot.badge-verified { background: #34d399; }

/* ---- search ---- */
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.search-box .material-symbols-outlined { color: var(--text-muted); }

.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 15px;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.search-result:hover { background: var(--panel-2); border-color: var(--border-strong); }

.search-result-info { min-width: 0; }
.search-result-name { font-weight: 600; color: var(--text-primary); }
.search-result-handle { font-size: 13px; color: var(--text-muted); }

/* ---- timeout modal ---- */
.timeout-duration {
  padding: 16px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timeout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.timeout-row label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}

.stepper-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: var(--panel);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
}

.stepper-btn:hover { background: var(--sidebar-hover); }

.stepper-value {
  min-width: 34px;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
}

.unit-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.unit-btn {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}

.unit-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text-primary);
}

.timeout-total {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  padding-top: 4px;
}

#timeout-modal .form-group {
  padding: 16px 24px 0;
}

/* ---- moduser modal ---- */
.moduser-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px 0;
}

.moduser-pfp {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.moduser-name { font-weight: 700; color: var(--text-primary); }
.moduser-handle { font-size: 13px; color: var(--text-muted); }

.moduser-rows { padding: 16px 24px 24px; display: flex; flex-direction: column; gap: 10px; }

.moduser-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.moduser-row span { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.moduser-row strong { font-size: 14px; color: var(--text-primary); font-weight: 600; }

/* ---- sanction screen ---- */
body.sanctioned .app,
body.sanctioned .bottom-nav,
body.sanctioned .coins-pill {
  display: none !important;
}

.sanction-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 30%, #1a1016 0%, #0c1017 75%);
}

.sanction-card {
  text-align: center;
  max-width: 460px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 44px 32px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sanction-icon {
  font-size: 64px;
  color: #ef4444;
  margin-bottom: 12px;
}

.sanction-card h1 {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
}

.sanction-reason {
  color: var(--text-secondary);
  font-size: 15px;
  margin: 0 0 20px;
}

.sanction-timer-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.sanction-timer {
  font-size: 34px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #ef4444;
  letter-spacing: -0.01em;
}

.sanction-note {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---- creator banner + menu ---- */
.creator-banner-wrap { position: relative; }

.creator-menu-btn {
  z-index: 4;
  background: var(--panel-2);
  border: 1px solid var(--border);
}

.creator-actions .mini-menu {
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
}

/* ---- admin extras ---- */
.admin-sanction-row { cursor: pointer; }
.admin-report-actions button.ok { color: var(--success); border-color: rgba(16, 185, 129, 0.4); }

.badge-picker-wrap { position: relative; }

.badge-picker-wrap #badge-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.badge-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 170px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 6px;
  z-index: 20;
  box-shadow: var(--shadow-lg);
}

.badge-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-primary);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.badge-picker-item:hover { background: var(--panel-2); }

/* =====================================================================
   Notification stacking, badge, shop hover, line chart, Wiki
   ===================================================================== */

/* Keep notification dropdowns above the cards below them. */
.notifications-list {
  overflow: visible;
  isolation: isolate;
}

.notification-item {
  position: relative;
  z-index: 1;
}

.notification-item:first-child {
  border-radius: var(--radius) var(--radius) 0 0;
}

.notification-item:last-child {
  border-radius: 0 0 var(--radius) var(--radius);
}

.notification-item.menu-open {
  z-index: 30;
}

.notification-menu-wrap .mini-menu {
  z-index: 60;
}

.nav-item > .badge {
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  line-height: 1.4;
}

/* Owned shop buttons must keep their green state even on hover. */
.shop-item .owned-btn,
.shop-item .owned-btn:hover,
.shop-item .owned-btn:focus,
.shop-item .owned-btn:active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: none;
  transform: none;
  cursor: default;
}

/* Profile coins stat : meme couleur que les autres stats (pas de doré) */
.stat-coins i {
  color: var(--text-muted);
}

.stat-coins span {
  color: var(--text-primary);
}

/* Announcement / admin danger action */
.danger-btn,
.btn-primary.danger-btn {
  background: var(--like);
  border-color: var(--like);
}

.danger-btn:hover,
.btn-primary.danger-btn:hover {
  background: #e11d48;
  box-shadow: 0 6px 16px -6px rgba(244, 63, 94, 0.6);
}

/* ---- Studio line chart ---- */
.line-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid-line {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 3 5;
  vector-effect: non-scaling-stroke;
}

.chart-axis-line {
  stroke: var(--border-strong);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-axis-label {
  fill: var(--text-muted);
  font-size: 10px;
  font-family: inherit;
}

.chart-line {
  fill: none;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chart-line.chart-views { stroke: #3b82f6; }
.chart-line.chart-likes { stroke: #f43f5e; }
.chart-line.chart-coins { stroke: #f5c542; }

.chart-dot {
  stroke: var(--panel);
  stroke-width: 1.5;
  transition: r 0.12s ease;
}

.chart-dot.chart-views { fill: #3b82f6; }
.chart-dot.chart-likes { fill: #f43f5e; }
.chart-dot.chart-coins { fill: #f5c542; }

.chart-dot:hover { r: 4.5; }

/* ---- Wiki ---- */
.wiki-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.wiki-search-box {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.wiki-toolbar #wiki-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px 16px;
  min-height: 44px;
}

.wiki-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.wiki-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.wiki-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.wiki-card-img {
  width: 100%;
  height: 145px;
  object-fit: cover;
  display: block;
  background: var(--panel-2);
  flex-shrink: 0;
}

.wiki-card-img-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.25), transparent 55%),
    linear-gradient(135deg, var(--panel-2), var(--panel));
  color: var(--accent);
}

.wiki-card-img-empty .material-symbols-outlined {
  font-size: 40px;
}

.wiki-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  flex: 1;
}

.wiki-card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.wiki-card-intro {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wiki-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  color: var(--text-muted);
  font-size: 11px;
}

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

.wiki-card-meta .material-symbols-outlined,
.wiki-article-meta .material-symbols-outlined {
  font-size: 14px;
}

.wiki-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wiki-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

.wiki-article {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(18px, 4vw, 36px);
  overflow: hidden;
}

.wiki-article-hero {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 22px;
  display: block;
}

.wiki-article-title {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.wiki-article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 22px;
}

.wiki-article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.wiki-article-intro {
  margin: 0 0 22px;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-soft);
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.6;
}

.wiki-article-content {
  color: var(--text-secondary);
  font-size: 15.5px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.wiki-article-content h2,
.wiki-article-content h3 {
  color: var(--text-primary);
  margin: 1.5em 0 0.6em;
  letter-spacing: -0.01em;
}

.wiki-article-content h2 { font-size: 24px; }
.wiki-article-content h3 { font-size: 19px; }
.wiki-article-content p { margin: 0 0 1em; }
.wiki-article-content ul,
.wiki-article-content ol { margin: 0 0 1em; padding-left: 1.5em; }
.wiki-article-content li { margin-bottom: 0.35em; }
.wiki-article-content blockquote {
  margin: 1em 0;
  padding: 10px 16px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-muted);
  background: var(--panel-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.wiki-empty-content {
  color: var(--text-muted);
  font-style: italic;
}

.wiki-editor {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 860px;
}

.wiki-editor label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.wiki-editor input[type="text"],
.wiki-editor input[type="url"],
.wiki-editor textarea {
  width: 100%;
  padding: 11px 13px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
}

.wiki-editor input:focus,
.wiki-editor textarea:focus,
.wiki-content-editor:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.wiki-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.wiki-editor-toolbar button {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--panel);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
}

.wiki-editor-toolbar button:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.wiki-content-editor {
  min-height: 280px;
  padding: 14px 16px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.wiki-content-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

.wiki-editor-image-preview {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-top: 10px;
}

.wiki-editor small {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.wiki-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- responsive wiki ---- */
@media (max-width: 640px) {
  .wiki-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .wiki-toolbar #wiki-create-btn {
    justify-content: center;
  }

  .wiki-list {
    grid-template-columns: 1fr;
  }

  .wiki-article {
    border-radius: var(--radius-sm);
  }

  .wiki-article-hero {
    max-height: 220px;
  }

  .wiki-editor-actions {
    flex-direction: column-reverse;
  }

  .wiki-editor-actions button {
    width: 100%;
  }
}

.creator-stats {
  flex-wrap: wrap;
  row-gap: 14px;
}

/* =====================================================================
   Pinned posts, rich post content, WIKI MANAGER badge
   ===================================================================== */

.post-pin-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
  padding: 3px 9px 3px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  white-space: nowrap;
}

.post-pin-flag .material-symbols-outlined {
  font-size: 14px;
  line-height: 1;
}

.post-content-rich {
  white-space: pre-wrap;
}

.post-content-rich p {
  margin: 0 0 10px;
}

.post-content-rich p:last-child {
  margin-bottom: 0;
}

.post-content-rich h2,
.post-content-rich h3 {
  margin: 6px 0 8px;
  line-height: 1.3;
}

.post-content-rich h2 { font-size: 19px; }
.post-content-rich h3 { font-size: 16px; }

.post-content-rich ul,
.post-content-rich ol {
  margin: 6px 0 10px;
  padding-left: 22px;
}

.post-content-rich li { margin: 3px 0; }

.post-content-rich blockquote {
  margin: 8px 0;
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-secondary);
}

.post-content-rich a {
  color: var(--accent);
  text-decoration: underline;
  word-break: break-all;
}

.badge-wiki-manager {
  background: rgba(139, 92, 246, 0.16);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.32);
}

.badge-dot.badge-wiki-manager { background: #a78bfa; }

/* =====================================================================
   Post composer : editeur riche
   ===================================================================== */

.composer-editor-wrap {
  flex: 1;
  min-width: 0;
}

.composer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  padding: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.composer-toolbar button {
  min-width: 30px;
  padding: 4px 8px;
  border-radius: 5px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  transition: background 0.15s ease, color 0.15s ease;
}

.composer-toolbar button:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

.composer-editor {
  min-height: 88px;
  max-height: 340px;
  overflow-y: auto;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  outline: none;
  color: var(--text-primary);
  line-height: 1.65;
  transition: border-color 0.15s ease;
  word-break: break-word;
}

.composer-editor:focus { border-color: var(--accent); }

.composer-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

.composer-editor p { margin: 0 0 6px; }
.composer-editor h2 { font-size: 19px; margin: 4px 0 8px; }
.composer-editor h3 { font-size: 16px; margin: 4px 0 8px; }
.composer-editor ul,
.composer-editor ol { margin: 4px 0 8px; padding-left: 22px; }
.composer-editor blockquote {
  margin: 6px 0;
  padding-left: 10px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-secondary);
}

/* =====================================================================
   Action modal (remplace confirm / prompt)
   ===================================================================== */

#action-input-wrap {
  padding: 16px 24px 0;
  margin: 0;
}

#action-input-wrap input {
  width: 100%;
  padding: 11px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease;
}

#action-input-wrap input:focus { border-color: var(--accent); }

#action-modal .modal-sub { line-height: 1.6; }

.action-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 24px 24px;
}

.action-actions .btn-primary,
.action-actions .btn-secondary {
  min-width: 112px;
  justify-content: center;
}

/* =====================================================================
   Wiki article actions (delete)
   ===================================================================== */

.wiki-article-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.wiki-article-actions .danger-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: #fff;
}

.wiki-article-actions .danger-btn .material-symbols-outlined { font-size: 18px; }

/* =====================================================================
   Admin panel redesign
   ===================================================================== */

.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px;
  margin-bottom: 18px;
  background:
    radial-gradient(120% 180% at 0% 0%, rgba(59, 130, 246, 0.18), transparent 55%),
    linear-gradient(145deg, #18202e, #121720);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.admin-hero h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.admin-hero .header-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.admin-hero-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  flex-shrink: 0;
}

.admin-hero-mark .material-symbols-outlined { font-size: 30px; }

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.admin-grid .admin-block {
  max-width: none;
  margin: 0;
  padding: 20px;
}

.admin-block-wide { grid-column: 1 / -1; }

.admin-block-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-block-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.admin-block-head .admin-hint { margin: 0; }

.admin-block-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--accent-soft);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

.admin-block-icon .material-symbols-outlined { font-size: 20px; }

.admin-block-icon.is-warning {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.admin-block-icon.is-danger {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.3);
  color: #fb7185;
}

.admin-block-icon.is-success {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.admin-block-icon.is-purple {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(139, 92, 246, 0.32);
  color: #a78bfa;
}

.admin-grid .admin-add-row { flex-wrap: wrap; }
.admin-grid .admin-add-row input { min-width: 120px; }
.admin-grid .admin-list { max-height: 320px; overflow-y: auto; padding-right: 4px; }

@media (max-width: 900px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-block-wide { grid-column: auto; }
}

@media (max-width: 560px) {
  .admin-hero { padding: 20px; }
  .admin-hero-mark { display: none; }
  .admin-grid .admin-add-row { flex-direction: column; }
  .admin-grid .admin-add-row .btn-primary,
  .admin-grid .admin-add-row .btn-secondary,
  .admin-grid .admin-add-row .badge-picker-wrap { width: 100%; }
  .badge-picker-wrap #badge-picker-btn { width: 100%; justify-content: space-between; }
}

/* =====================================================================
   Site-wide page frame, stats, leaderboard, embeds and refresh polish
   ===================================================================== */

/* Framed page header used on every page (subtle nod to the admin hero). */
.header {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 20px;
  padding: 20px 24px;
  margin-bottom: 22px;
  background:
    radial-gradient(120% 180% at 0% 0%, rgba(59, 130, 246, 0.14), transparent 55%),
    linear-gradient(145deg, #171e2b, #121720);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.header::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(90% 140% at 100% 0%, rgba(139, 92, 246, 0.07), transparent 60%);
}

.header > * { position: relative; z-index: 1; }

.header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.header .header-sub {
  flex: 1 1 100%;
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.header .filters { margin-left: auto; }

/* Composer footer actions (text + optional YouTube post) */
.composer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#btn-youtube-post {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#btn-youtube-post .material-symbols-outlined { font-size: 18px; }

/* Pin indicator: icon only, away from the user badges */
.post-menu-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-pin-mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  flex-shrink: 0;
}

.post-pin-mark .material-symbols-outlined {
  font-size: 16px;
  line-height: 1;
  font-variation-settings: 'FILL' 1;
}

/* YouTuber badge */
.badge-youtuber { background: rgba(239, 68, 68, 0.16); color: #fb7185; border-color: rgba(239, 68, 68, 0.32); }
.badge-dot.badge-youtuber { background: #ef4444; }

/* YouTube embed posts */
.post-content-embed { margin: 12px 0 16px; }

.post-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
}

.post-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Stats: one headline number, then small framed cards */
.stats-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 42px 24px 36px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 180% at 50% 0%, rgba(59, 130, 246, 0.18), transparent 62%),
    linear-gradient(145deg, #18202e, #121720);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.stats-hero-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.28);
  margin-bottom: 12px;
}

.stats-hero-value {
  font-size: clamp(64px, 13vw, 118px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.05em;
  color: var(--text-primary);
}

.stats-hero-value.bump {
  animation: statBump 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

.stats-hero-label {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stats-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stats-card-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 10px;
  color: #93c5fd;
  background: var(--accent-soft);
  border: 1px solid rgba(59, 130, 246, 0.22);
}

.stats-card-icon .material-symbols-outlined { font-size: 20px; }

.stats-card-text { min-width: 0; }

.stats-card-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stats-card-value.bump {
  animation: statBump 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

.stats-card-label {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* Leaderboard */
.lb-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.lb-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.lb-tab .material-symbols-outlined { font-size: 18px; }

.lb-tab:hover { border-color: var(--border-strong); color: var(--text-primary); }

.lb-tab.active {
  color: #bfdbfe;
  background: var(--accent-soft);
  border-color: rgba(59, 130, 246, 0.42);
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.lb-row.is-self {
  border-color: rgba(59, 130, 246, 0.42);
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.11), var(--panel));
}

.lb-rank {
  width: 30px;
  flex-shrink: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.lb-rank.rank-1 { color: #fbbf24; }
.lb-rank.rank-2 { color: #cbd5e1; }
.lb-rank.rank-3 { color: #d97706; }

.lb-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
}

.lb-main { flex: 1; min-width: 0; }

.lb-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-handle {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-value {
  flex-shrink: 0;
  text-align: right;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.lb-value small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.lb-post-text {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-row.is-post { cursor: pointer; }
.lb-row.is-post:hover { border-color: var(--border-strong); }

.lb-empty {
  padding: 26px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.lb-self {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 180% at 0% 0%, rgba(59, 130, 246, 0.16), transparent 60%),
    linear-gradient(145deg, #18202e, #121720);
  box-shadow: var(--shadow);
}

.lb-self-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #93c5fd;
}

.lb-self-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}

.lb-self-rank {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.lb-self-copy { flex: 1; min-width: 0; }
.lb-self-copy .lb-name { font-size: 15px; }

.lb-self-value {
  text-align: right;
  font-size: 20px;
  font-weight: 700;
}

.lb-self-value small {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* During the 5s auto-refresh, keep data fresh without replaying entrance
   animations for content that is already on screen. */
body.is-refreshing .content-section.active,
body.is-refreshing .post,
body.is-refreshing .notification-item,
body.is-refreshing .wiki-card,
body.is-refreshing .lb-row {
  animation: none !important;
}

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

@media (max-width: 520px) {
  .header { padding: 16px 18px; }
  .header h1 { font-size: 21px; }
  .header .filters { margin-left: 0; width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
  .stats-hero { padding: 34px 18px 28px; }
  .lb-row { padding: 11px 13px; gap: 10px; }
  .lb-rank { width: 24px; font-size: 13px; }
  .lb-avatar { width: 34px; height: 34px; }
}

/* Leaderboard fallbacks */
.lb-avatar-fb {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
}

.lb-you {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.32);
  vertical-align: middle;
}
