/* ============================================================
   Amen — design tokens
   Dark, warm, candlelit palette. Gold stands in for TikTok's pink/red;
   the cross is the only iconographic departure from a generic feed app.
   ============================================================ */
:root {
  --bg: #0b0a12;
  --bg-elevated: #14121f;
  --surface: #1a1728;
  --surface-2: #221e34;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text: #f6f3ee;
  --text-dim: #b9b2cf;
  --text-faint: #78708f;

  --gold: #e8c766;
  --gold-bright: #f7dd93;
  --gold-dim: #a8894a;
  --gold-glow: rgba(232, 199, 102, 0.35);

  --danger: #e0645a;
  --success: #6fcf97;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;

  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 12px 40px rgba(0, 0, 0, 0.5);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --font-display: 'Fraunces', ui-serif, Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overscroll-behavior-y: none;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app {
  height: 100dvh;
  width: 100%;
  position: relative;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--gold-glow); color: var(--text); }

/* Subtle scrollbars where scrolling exists */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   Cross icon (SVG, drawn — not emoji) used everywhere a "heart" would go
   ============================================================ */
.cross-icon {
  display: inline-block;
  flex-shrink: 0;
}
.cross-icon svg { display: block; width: 100%; height: 100%; }

/* ============================================================
   Utility / loading
   ============================================================ */
.spinner {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.18);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 45%, var(--surface) 60%);
  background-size: 300% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
@keyframes shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -20% 0; }
}

.fade-in { animation: fadeIn 0.4s var(--ease-out) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.toast-stack {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: 100%;
  padding: 0 16px;
}
.toast {
  background: rgba(26, 23, 40, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-soft);
  animation: toastIn 0.35s var(--ease-spring) both;
  max-width: 420px;
  text-align: center;
}
.toast.error { border-color: rgba(224, 100, 90, 0.5); color: #ffd6d2; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
   Auth screen
   ============================================================ */
.auth-screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(232, 199, 102, 0.14), transparent 60%),
    radial-gradient(ellipse 70% 50% at 85% 100%, rgba(120, 70, 180, 0.12), transparent 60%),
    var(--bg);
}

.auth-glow-cross {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  opacity: 0.9;
  filter: drop-shadow(0 0 40px var(--gold-glow));
  animation: floatGlow 6s ease-in-out infinite;
}
@keyframes floatGlow {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

.auth-card {
  width: 100%;
  max-width: 380px;
  z-index: 1;
  margin-top: 90px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.01em;
  margin: 0 0 6px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 60%, var(--gold-dim));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline {
  text-align: center;
  color: var(--text-dim);
  font-size: 14.5px;
  margin: 0 0 32px;
  letter-spacing: 0.01em;
}

.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.field input, .field textarea {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  font-size: 15.5px;
  font-family: inherit;
  transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold-dim);
  background: var(--surface-2);
}
.field.invite input {
  letter-spacing: 0.08em;
  font-weight: 600;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s var(--ease-spring), filter 0.15s var(--ease-out), opacity 0.15s;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #211a08;
  box-shadow: 0 6px 20px var(--gold-glow);
}
.btn-primary:not(:disabled):hover { filter: brightness(1.06); }
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1.5px solid var(--border);
}
.btn-ghost:not(:disabled):hover { border-color: var(--border-strong); color: var(--text); }
.btn-danger { background: rgba(224,100,90,0.15); color: #ffb3ac; }

.auth-switch {
  text-align: center;
  margin-top: 22px;
  font-size: 14px;
  color: var(--text-faint);
}
.auth-switch button {
  background: none; border: none; color: var(--gold); font-weight: 600; cursor: pointer; font-size: 14px;
  padding: 0 4px;
}

.form-error {
  background: rgba(224, 100, 90, 0.12);
  border: 1px solid rgba(224, 100, 90, 0.35);
  color: #ffb3ac;
  font-size: 13.5px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  animation: fadeIn 0.25s var(--ease-out);
}

/* ============================================================
   Shell: bottom nav + top bar
   ============================================================ */
.shell {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.view-slot {
  flex: 1;
  min-height: 0;
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) 18px 14px;
  position: relative;
  z-index: 20;
}
.topbar .brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--gold-bright);
}
.topbar.transparent {
  position: absolute;
  top: 0; left: 0; right: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.45), transparent);
  pointer-events: none;
}
.topbar.transparent * { pointer-events: auto; }

.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 10px max(10px, env(safe-area-inset-bottom));
  background: rgba(14, 12, 22, 0.82);
  backdrop-filter: blur(20px) saturate(150%);
  border-top: 1px solid var(--border);
  z-index: 30;
  flex-shrink: 0;
}
.nav-btn {
  background: none;
  border: none;
  color: var(--text-faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 16px;
  cursor: pointer;
  transition: color 0.2s, transform 0.15s var(--ease-spring);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.nav-btn svg { width: 24px; height: 24px; transition: transform 0.2s var(--ease-spring); }
.nav-btn.active { color: var(--gold); }
.nav-btn.active svg { transform: translateY(-1px); }
.nav-btn:active svg { transform: scale(0.88); }

.nav-upload-btn {
  width: 46px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px var(--gold-glow);
}
.nav-upload-btn svg { width: 22px; height: 22px; color: #211a08; }

.nav-icon-wrap { position: relative; display: inline-flex; }
.nav-badge {
  position: absolute;
  top: -2px; right: -4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid var(--bg-elevated);
}

/* ============================================================
   Feed
   ============================================================ */
.feed {
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}
.feed::-webkit-scrollbar { display: none; }

.feed-card {
  height: 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.feed-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.feed-card .thumb-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.85);
  transition: opacity 0.3s;
}

.feed-card-scrim {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 45%;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.75) 60%, rgba(0,0,0,0.88));
  pointer-events: none;
}
.feed-card-scrim-top {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 18%;
  background: linear-gradient(180deg, rgba(0,0,0,0.4), transparent);
  pointer-events: none;
}

.feed-meta {
  position: absolute;
  left: 16px;
  right: 88px;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 5;
  color: #fff;
}
.feed-meta .reshare-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gold-bright);
  background: rgba(232, 199, 102, 0.14);
  border: 1px solid rgba(232, 199, 102, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
  font-weight: 600;
}
.feed-meta .reshare-tag svg { width: 13px; height: 13px; flex-shrink: 0; }
.feed-meta .owner-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  color: var(--gold-bright);
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
  text-transform: uppercase;
}
.feed-meta .owner-name {
  font-weight: 700;
  font-size: 15px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.feed-meta .owner-name .handle { color: var(--text-dim); font-weight: 500; font-size: 13px; }
.feed-meta .caption {
  font-size: 14.5px;
  line-height: 1.4;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.action-rail {
  position: absolute;
  right: 12px;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.action-btn {
  background: none;
  border: none;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
}
.action-btn .icon-wrap {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(20, 18, 30, 0.4);
  backdrop-filter: blur(6px);
  transition: transform 0.18s var(--ease-spring), background 0.18s;
}
.action-btn:active .icon-wrap { transform: scale(0.88); }
.action-btn .count {
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.action-btn .icon-wrap svg { width: 24px; height: 24px; color: #fff; transition: color 0.2s; }
.action-btn.liked .icon-wrap svg { color: var(--gold); }
.action-btn.liked .icon-wrap { animation: likePop 0.45s var(--ease-spring); }
@keyframes likePop {
  0% { transform: scale(1); }
  35% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.action-btn.reshared .icon-wrap svg { color: var(--gold); }

.center-cross-burst {
  position: absolute;
  top: 50%; left: 50%;
  width: 120px; height: 120px;
  transform: translate(-50%, -50%) scale(0.5);
  color: rgba(255,255,255,0.92);
  opacity: 0;
  pointer-events: none;
  z-index: 6;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.4));
}
.center-cross-burst.play {
  animation: crossBurst 0.7s var(--ease-out) forwards;
}
@keyframes crossBurst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(-8deg); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.05) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.3) rotate(3deg); }
}

.pause-indicator {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 68px; height: 68px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 6;
}
.pause-indicator.show { opacity: 1; }
.pause-indicator svg { width: 30px; height: 30px; color: #fff; }

.mute-toggle {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: 14px;
  z-index: 7;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(20,18,30,0.5);
  backdrop-filter: blur(6px);
  border: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  cursor: pointer;
}
.mute-toggle svg { width: 18px; height: 18px; }

.feed-empty, .feed-loading-end {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-dim);
  text-align: center;
  padding: 40px;
  scroll-snap-align: start;
}
.feed-empty .cross-icon { width: 54px; height: 54px; color: var(--gold-dim); opacity: 0.6; }
.feed-empty h3 { color: var(--text); font-family: var(--font-display); font-weight: 500; font-size: 22px; margin: 0; }
.feed-empty p { margin: 0; font-size: 14px; max-width: 260px; }

/* ============================================================
   Comments sheet
   ============================================================ */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
  opacity: 0;
  animation: fadeIn 0.25s var(--ease-out) forwards;
}
.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 72%;
  background: var(--bg-elevated);
  border-radius: 22px 22px 0 0;
  border-top: 1px solid var(--border-strong);
  z-index: 41;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  animation: sheetUp 0.35s var(--ease-out) forwards;
  box-shadow: var(--shadow-lift);
}
@keyframes sheetUp { to { transform: translateY(0); } }
.sheet-handle {
  width: 36px; height: 4px;
  background: var(--border-strong);
  border-radius: 4px;
  margin: 10px auto 4px;
  flex-shrink: 0;
}
.sheet-header {
  padding: 10px 20px 14px;
  font-weight: 700;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  flex-shrink: 0;
}
.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 18px;
}
.comment-row {
  display: flex;
  gap: 11px;
  padding: 11px 0;
}
.comment-row .avatar { width: 32px; height: 32px; font-size: 12px; }
.comment-content { flex: 1; min-width: 0; }
.comment-author { font-size: 13px; font-weight: 700; color: var(--text-dim); margin-bottom: 2px; }
.comment-body { font-size: 14.5px; line-height: 1.4; word-wrap: break-word; }
.comment-time { font-size: 11.5px; color: var(--text-faint); margin-top: 4px; }
.sheet-composer {
  display: flex;
  gap: 10px;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sheet-composer input {
  flex: 1;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  padding: 11px 16px;
  color: var(--text);
  font-size: 14.5px;
}
.sheet-composer input:focus { outline: none; border-color: var(--gold-dim); }
.sheet-composer button {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: #211a08;
  transition: transform 0.15s var(--ease-spring), opacity 0.15s;
}
.sheet-composer button:disabled { opacity: 0.4; }
.sheet-composer button svg { width: 18px; height: 18px; }
.empty-comments { text-align: center; color: var(--text-faint); padding: 30px 10px; font-size: 14px; }

/* ============================================================
   Upload flow
   ============================================================ */
.upload-view {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.upload-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) 18px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.upload-header h2 { font-size: 17px; margin: 0; font-family: var(--font-display); font-weight: 600; }
.icon-btn {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.icon-btn:hover { background: var(--surface); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 26px 20px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 50px 24px;
  text-align: center;
  color: var(--text-dim);
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.dropzone:hover { border-color: var(--gold-dim); background: rgba(232,199,102,0.04); }
.dropzone .cross-icon { width: 40px; height: 40px; color: var(--gold-dim); margin-bottom: 14px; }
.dropzone h3 { color: var(--text); font-weight: 600; font-size: 16px; margin: 0 0 6px; }
.dropzone p { font-size: 13px; margin: 0; color: var(--text-faint); }

.editor {
  padding: 18px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.editor-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 46vh;
  margin: 0 auto;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}
.editor-preview video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.editor-preview .overlay-text-preview {
  position: absolute;
  left: 8%; right: 8%; bottom: 12%;
  text-align: center;
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
  background: rgba(0,0,0,0.35);
  border-radius: 8px;
  padding: 8px 6px;
  pointer-events: none;
  word-wrap: break-word;
}

.editor-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 10px;
  display: block;
}

.trim-track {
  position: relative;
  height: 46px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}
.trim-track .trim-range {
  position: absolute;
  top: 0; bottom: 0;
  background: rgba(232,199,102,0.22);
  border-left: 3px solid var(--gold);
  border-right: 3px solid var(--gold);
}
.trim-inputs { display: flex; gap: 10px; margin-top: 10px; }
.trim-inputs input[type=range] {
  width: 100%;
  accent-color: var(--gold);
}
.trim-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-faint); margin-top: 6px; }

.filter-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.filter-chip {
  flex-shrink: 0;
  width: 62px;
  text-align: center;
  cursor: pointer;
}
.filter-chip .swatch {
  width: 62px; height: 62px;
  border-radius: 14px;
  background: linear-gradient(135deg, #3a3050, #1a1728);
  border: 2px solid transparent;
  margin-bottom: 6px;
  transition: border-color 0.2s, transform 0.15s var(--ease-spring);
}
.filter-chip.active .swatch { border-color: var(--gold); transform: scale(1.05); }
.filter-chip span { font-size: 11.5px; color: var(--text-dim); }
.filter-chip.active span { color: var(--gold-bright); font-weight: 600; }
.filter-warm .swatch { filter: saturate(1.4) sepia(0.18); }
.filter-mono .swatch { filter: grayscale(1) contrast(1.1); }
.filter-vintage .swatch { filter: sepia(0.35) contrast(0.95) brightness(0.95); }

.upload-footer {
  flex-shrink: 0;
  padding: 14px 20px max(14px, env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11,10,18,0.9);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-dim);
  font-size: 14px;
}
.progress-overlay .cross-icon { width: 46px; height: 46px; color: var(--gold); animation: reverentPulse 1.4s ease-in-out infinite; }
@keyframes reverentPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

/* ============================================================
   Profile
   ============================================================ */
.profile-view { height: 100%; overflow-y: auto; padding-bottom: 24px; }
.profile-header {
  padding: 20px 20px 8px;
  text-align: center;
}
.profile-header .avatar { width: 84px; height: 84px; font-size: 30px; margin: 0 auto 14px; }
.profile-header .display-name { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin: 0 0 2px; }
.profile-header .username { color: var(--text-faint); font-size: 14px; margin-bottom: 12px; }
.profile-header .bio { color: var(--text-dim); font-size: 14px; max-width: 320px; margin: 0 auto 16px; line-height: 1.5; }

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-bottom: 18px;
}
.profile-stats .stat { text-align: center; }
.profile-stats .stat b { display: block; font-size: 18px; font-weight: 700; }
.profile-stats .stat span { font-size: 12px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.03em; }
.profile-stats .stat-clickable { cursor: pointer; transition: opacity 0.15s; }
.profile-stats .stat-clickable:active { opacity: 0.6; }

.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 20px; padding: 0 20px; }
.profile-actions .btn { width: auto; padding: 10px 26px; font-size: 14px; }

.admin-panel {
  margin: 0 20px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}
.admin-panel h4 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gold-bright); }
.invite-code-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 4px 6px 4px 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.invite-code-pill.used { opacity: 0.45; text-decoration: line-through; }

.invite-email-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.invite-email-row input {
  flex: 1;
  min-width: 0;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  font-size: 13px;
}
.invite-email-row input:focus { outline: none; border-color: var(--gold-dim); }
.invite-email-row .btn { width: auto; padding: 9px 16px; font-size: 13px; gap: 6px; flex-shrink: 0; }
.invite-email-row .btn svg { width: 15px; height: 15px; }

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 0 2px;
}
.grid-cell {
  position: relative;
  aspect-ratio: 9/16;
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
}
.grid-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid-cell .reshare-badge {
  position: absolute;
  top: 6px; right: 6px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
}
.grid-cell .reshare-badge svg { width: 11px; height: 11px; color: var(--gold-bright); }
.grid-delete-btn {
  position: absolute;
  top: 6px; left: 6px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s var(--ease-spring);
  z-index: 2;
}
.grid-delete-btn:hover { background: rgba(224,100,90,0.75); }
.grid-delete-btn:active { transform: scale(0.88); }
.grid-delete-btn svg { width: 12px; height: 12px; color: #fff; }
.grid-cell .grid-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px 8px 6px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.75));
  font-size: 11.5px;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-empty {
  text-align: center;
  padding: 50px 30px;
  color: var(--text-faint);
}
.profile-empty .cross-icon { width: 40px; height: 40px; color: var(--gold-dim); opacity: 0.5; margin-bottom: 12px; }

/* Full-screen post viewer launched from profile grid, reuses feed styling */
.post-viewer-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100;
}
.post-viewer-close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 14px;
  z-index: 10;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(20,18,30,0.55);
  backdrop-filter: blur(6px);
  border: none;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.post-viewer-close svg { width: 20px; height: 20px; }

/* ============================================================
   Friends
   ============================================================ */
.friends-view {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.friends-search { padding: 18px 20px 6px; }
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-input-wrap svg {
  position: absolute;
  left: 14px;
  width: 17px; height: 17px;
  color: var(--text-faint);
  pointer-events: none;
}
.search-input-wrap input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  padding: 11px 16px 11px 40px;
  color: var(--text);
  font-size: 14.5px;
}
.search-input-wrap input:focus { outline: none; border-color: var(--gold-dim); }

.friends-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  padding: 18px 20px 6px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
}
.user-row-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.user-row-info { min-width: 0; }
.user-row-name { font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row-handle { font-size: 12.5px; color: var(--text-faint); }
.user-row-action { flex-shrink: 0; }
.user-row-action .btn { width: auto; padding: 8px 16px; font-size: 13px; }

.friend-request-actions { display: flex; gap: 8px; }
.request-accept-btn, .request-decline-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.15s var(--ease-spring);
}
.request-accept-btn:active, .request-decline-btn:active { transform: scale(0.88); }
.request-accept-btn { background: var(--gold); color: #211a08; }
.request-decline-btn { background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border-strong); }
.request-accept-btn svg, .request-decline-btn svg { width: 16px; height: 16px; }

.friends-empty {
  text-align: center;
  padding: 30px 30px 40px;
  color: var(--text-faint);
}
.friends-empty .cross-icon { width: 34px; height: 34px; color: var(--gold-dim); opacity: 0.5; margin-bottom: 10px; }
.friends-empty p { margin: 0; font-size: 14px; }

/* ============================================================
   Responsive: desktop preview centers the phone-shaped column
   ============================================================ */
@media (min-width: 560px) {
  .app { background: #050409; }
  .shell, .auth-screen, .post-viewer-overlay {
    max-width: 460px;
    margin: 0 auto;
    box-shadow: 0 0 80px rgba(0,0,0,0.6);
  }
}

@media (min-width: 900px) {
  .app { display: flex; align-items: center; justify-content: center; }
  .shell, .auth-screen { height: min(100dvh, 900px); border-radius: 28px; overflow: hidden; }
  .post-viewer-overlay { top: 50%; left: 50%; transform: translate(-50%, -50%); inset: auto; height: min(100dvh, 900px); border-radius: 28px; overflow: hidden; }
}
