/* ═══════════════════════════════════════════════════════════
   Wapka File — Design System
   Modern, elegant, dark-mode-ready
   ═══════════════════════════════════════════════════════════ */

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

/* ─── Design Tokens ─────────────────────────────────────── */
:root {
  /* Brand */
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-300: #a5b4fc;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-800: #3730a3;
  --brand-900: #312e81;

  /* Accent (success/safe) */
  --accent-50:  #ecfdf5;
  --accent-500: #10b981;
  --accent-600: #059669;

  /* Danger */
  --danger-500: #ef4444;
  --danger-50:  #fef2f2;

  /* Neutrals (light) */
  --gray-50:  #fafafa;
  --gray-100: #f4f4f5;
  --gray-200: #e4e4e7;
  --gray-300: #d4d4d8;
  --gray-400: #a1a1aa;
  --gray-500: #71717a;
  --gray-600: #52525b;
  --gray-700: #3f3f46;
  --gray-800: #27272a;
  --gray-900: #18181b;
  --gray-950: #09090b;

  /* Semantic — Light theme */
  --bg:           #f4f4f7;
  --bg-elevated:  #ffffff;
  --surface:      #ffffff;
  --surface-2:    #f9f9fb;
  --text:         #18181b;
  --text-2:       #3f3f46;
  --text-3:       #71717a;
  --text-4:       #a1a1aa;
  --border:       #e4e4e7;
  --border-2:     #f4f4f5;
  --shadow-color: 15 23 42;

  /* Effects */
  --shadow-xs: 0 1px 2px rgba(var(--shadow-color) / 0.04);
  --shadow-sm: 0 1px 3px rgba(var(--shadow-color) / 0.06), 0 1px 2px rgba(var(--shadow-color) / 0.04);
  --shadow-md: 0 4px 6px rgba(var(--shadow-color) / 0.04), 0 8px 24px rgba(var(--shadow-color) / 0.06);
  --shadow-lg: 0 8px 16px rgba(var(--shadow-color) / 0.05), 0 20px 40px rgba(var(--shadow-color) / 0.08);
  --shadow-xl: 0 12px 24px rgba(var(--shadow-color) / 0.06), 0 32px 64px rgba(var(--shadow-color) / 0.1);
  --shadow-glow: 0 4px 20px rgba(99, 102, 241, 0.3);
  --shadow-glow-strong: 0 6px 28px rgba(99, 102, 241, 0.4);

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-pill: 999px;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  /* Type */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', -apple-system, system-ui, sans-serif;

  /* Layout */
  --max-w: 720px;
  --header-h: 56px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --d-fast: 150ms;
  --d-base: 250ms;
  --d-slow: 400ms;
}

/* Dark theme */
[data-theme="dark"] {
  --bg:           #09090b;
  --bg-elevated:  #0f0f12;
  --surface:      #131316;
  --surface-2:    #1a1a1f;
  --text:         #fafafa;
  --text-2:       #d4d4d8;
  --text-3:       #a1a1aa;
  --text-4:       #71717a;
  --border:       #27272a;
  --border-2:     #1f1f23;
  --shadow-color: 0 0 0;
  --shadow-glow: 0 4px 24px rgba(129, 140, 248, 0.25);
  --shadow-glow-strong: 0 6px 32px rgba(129, 140, 248, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:           #09090b;
    --bg-elevated:  #0f0f12;
    --surface:      #131316;
    --surface-2:    #1a1a1f;
    --text:         #fafafa;
    --text-2:       #d4d4d8;
    --text-3:       #a1a1aa;
    --text-4:       #71717a;
    --border:       #27272a;
    --border-2:     #1f1f23;
    --shadow-color: 0 0 0;
    --shadow-glow: 0 4px 24px rgba(129, 140, 248, 0.25);
    --shadow-glow-strong: 0 6px 32px rgba(129, 140, 248, 0.35);
  }
}

/* ─── Base ──────────────────────────────────────────────── */
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color var(--d-base) var(--ease), color var(--d-base) var(--ease);
}

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

/* ─── Animations ────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes downloadPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3), 0 0 0 0 rgba(99, 102, 241, 0.4); }
  50%      { box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3), 0 0 0 8px rgba(99, 102, 241, 0); }
}

.fade-in    { animation: fadeUp 0.5s var(--ease-out) both; }
.fade-in-d1 { animation-delay: 0.06s; }
.fade-in-d2 { animation-delay: 0.12s; }
.fade-in-d3 { animation-delay: 0.18s; }
.fade-in-d4 { animation-delay: 0.24s; }
.fade-in-d5 { animation-delay: 0.3s; }
.scale-in   { animation: scaleIn 0.4s var(--ease-out) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Header (Glassmorphism) ────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg-elevated) 75%, transparent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--d-base) var(--ease), border-color var(--d-base) var(--ease);
}
.nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s-5);
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  display: flex; align-items: center; gap: 9px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.nav-brand svg { width: 22px; height: 22px; }

.nav-actions { display: flex; align-items: center; gap: var(--s-2); }

.icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all var(--d-fast) var(--ease);
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--text-4);
}
.icon-btn svg { width: 16px; height: 16px; }

/* ─── Container ─────────────────────────────────────────── */
.container {
  flex: 1;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--s-5);
}
.page { padding: var(--s-6) 0 var(--s-10); }
.page > * + * { margin-top: var(--s-5); }

/* ─── Breadcrumb ────────────────────────────────────────── */
.breadcrumb {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: var(--s-3) var(--s-5) 0;
}
.breadcrumb-list {
  display: flex; align-items: center; flex-wrap: wrap;
  list-style: none; gap: 2px;
  font-size: 0.8125rem;
}
.breadcrumb-item {
  display: inline-flex; align-items: center; gap: 2px;
  min-width: 0;
}
.breadcrumb-link {
  color: var(--text-3);
  font-weight: 500;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  transition: all var(--d-fast) var(--ease);
  text-decoration: none;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breadcrumb-link:hover {
  color: var(--text);
  background: var(--surface);
}
.breadcrumb-current {
  color: var(--text-2);
  font-weight: 600;
  padding: 2px 6px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breadcrumb-sep {
  width: 12px; height: 12px;
  color: var(--text-4);
  flex-shrink: 0;
  margin: 0 2px;
}

/* ─── Preview — Full-bleed, dominant ────────────────────── */
.preview {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 1px solid var(--border-2);
  transition: background-color var(--d-base) var(--ease), border-color var(--d-base) var(--ease);
}

/* Image */
.preview-image {
  position: relative;
  background: #0a0a0c;
  display: flex; align-items: center; justify-content: center;
  min-height: 200px;
  max-height: 70vh;
  overflow: hidden;
}
.preview-image img {
  display: block; width: 100%;
  max-height: 70vh; object-fit: contain;
  opacity: 0; transition: opacity var(--d-slow) var(--ease);
}
.preview-image img.loaded { opacity: 1; }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg,
    var(--surface-2) 0%,
    var(--border-2) 50%,
    var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}
.preview-image .skeleton { position: absolute; inset: 0; }

/* Video */
.preview-video {
  background: #0a0a0c;
  position: relative;
}
.preview-video video {
  display: block; width: 100%;
  max-height: 70vh; background: #0a0a0c;
}
.preview-video .plyr--video { max-height: 70vh; }
.preview-video .plyr { --plyr-color-main: var(--brand-500); }

/* Audio */
.preview-audio {
  background: linear-gradient(135deg, var(--brand-50) 0%, var(--brand-100) 100%);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: var(--s-10) var(--s-6);
  display: flex; flex-direction: column; align-items: center; gap: var(--s-6);
  border: 1px solid var(--border-2);
  transition: background var(--d-base) var(--ease);
}
[data-theme="dark"] .preview-audio {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border-color: var(--border);
}
.preview-audio-art {
  width: 120px; height: 120px;
  border-radius: var(--r-2xl);
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-600);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}
.preview-audio-art svg { width: 52px; height: 52px; }
.preview-audio-player { width: 100%; max-width: 460px; }
.preview-audio .plyr--audio { border-radius: var(--r-md); }
.preview-audio .plyr { --plyr-color-main: var(--brand-500); }

/* Other (documents, archives) */
.preview-other {
  padding: var(--s-12) var(--s-6);
  display: flex; flex-direction: column; align-items: center; gap: var(--s-4);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}
.preview-other-icon {
  width: 96px; height: 96px;
  border-radius: var(--r-2xl);
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-600);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
}
.preview-other-icon svg { width: 44px; height: 44px; }
.preview-other-label {
  font-size: 0.7rem; font-weight: 700;
  color: var(--text-3); text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Fallback */
.preview-fallback {
  padding: var(--s-12) var(--s-6);
  display: flex; flex-direction: column; align-items: center; gap: var(--s-3);
  color: var(--text-3);
}
.preview-fallback svg { width: 40px; height: 40px; opacity: 0.4; }
.preview-fallback span { font-size: 0.8rem; }

/* ─── File info ─────────────────────────────────────────── */
.file-info { padding: 0 var(--s-1); }
.file-name {
  font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 700;
  line-height: 1.25; word-break: break-word;
  color: var(--text);
  letter-spacing: -0.02em;
}
.file-meta {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  margin-top: var(--s-2); align-items: center;
}
.file-meta-dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--text-4); flex-shrink: 0;
}
.file-meta-item {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.8125rem; color: var(--text-2);
  font-weight: 500;
}
.file-meta-item svg { flex-shrink: 0; width: 13px; height: 13px; color: var(--text-3); }
.file-ext-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--brand-50); color: var(--brand-600);
  font-size: 0.6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
}
[data-theme="dark"] .file-ext-badge { background: rgba(99,102,241,0.15); color: var(--brand-300); }

/* ─── Trust row ─────────────────────────────────────────── */
.trust-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  font-size: 0.8125rem;
  transition: all var(--d-base) var(--ease);
}
.trust-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 0.75rem;
}
.trust-badge--safe {
  background: var(--accent-50); color: var(--accent-600);
}
[data-theme="dark"] .trust-badge--safe { background: rgba(16,185,129,0.12); color: var(--accent-500); }
.trust-badge svg { width: 12px; height: 12px; }
.trust-stat {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--text-3); font-weight: 500;
}
.trust-stat svg { width: 13px; height: 13px; }
.trust-spacer { flex: 1; }
.trust-link {
  color: var(--text-3); font-weight: 500;
  font-size: 0.75rem;
  transition: color var(--d-fast) var(--ease);
}
.trust-link:hover { color: var(--text); }

/* ─── Download button — dominant CTA ────────────────────── */
.btn-download {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 0 var(--s-5); height: 58px;
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-600) 100%);
  color: #fff;
  font-size: 1.05rem; font-weight: 700;
  border-radius: var(--r-lg);
  border: none;
  box-shadow: var(--shadow-glow);
  transition: all var(--d-base) var(--ease);
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
  font-family: var(--font-body);
  animation: downloadPulse 2.4s ease-in-out infinite;
}
.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-strong);
  animation: none;
}
.btn-download:active { transform: translateY(0); }
.btn-download svg {
  width: 20px; height: 20px; flex-shrink: 0;
  transition: transform var(--d-base) var(--ease);
}
.btn-download:hover svg { transform: translateY(3px); }
.btn-download .btn-text { display: inline-flex; align-items: center; gap: 10px; }

/* Subtle shine effect */
.btn-download::before {
  content: '';
  position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.6s var(--ease);
}
.btn-download:hover::before { left: 100%; }

/* ─── Share row ─────────────────────────────────────────── */
.share-row {
  display: flex; align-items: center; gap: var(--s-2);
}
.share-btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 0.8125rem; font-weight: 500;
  transition: all var(--d-fast) var(--ease);
  text-decoration: none;
  cursor: pointer;
}
.share-btn:hover {
  background: var(--surface-2);
  border-color: var(--text-4);
  color: var(--text);
}
.share-btn svg { width: 14px; height: 14px; }
.share-btn--copied { color: var(--accent-600); border-color: var(--accent-500); background: var(--accent-50); }
[data-theme="dark"] .share-btn--copied { background: rgba(16,185,129,0.12); }

/* ─── Details card ──────────────────────────────────────── */
.details-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--s-5) var(--s-6);
  border: 1px solid var(--border);
  transition: all var(--d-base) var(--ease);
}
.details-title {
  font-family: var(--font-display);
  font-size: 0.75rem; font-weight: 700;
  color: var(--text-3); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: var(--s-3);
}
.details-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 9px 0;
  gap: var(--s-3);
}
.details-row + .details-row { border-top: 1px solid var(--border-2); }
.details-row-label {
  font-size: 0.8125rem; color: var(--text-3); font-weight: 500;
  flex-shrink: 0;
}
.details-row-value {
  font-size: 0.875rem; color: var(--text); font-weight: 500;
  text-align: right; word-break: break-word;
}
.details-row-value-mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.8125rem; }

/* ─── Download page ─────────────────────────────────────── */
.dl-hero {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: var(--s-10) var(--s-6);
  text-align: center;
  border: 1px solid var(--border-2);
  transition: all var(--d-base) var(--ease);
  position: relative;
  overflow: hidden;
}
.dl-hero::before {
  content: '';
  position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at center, var(--brand-50) 0%, transparent 60%);
  opacity: 0.4;
  pointer-events: none;
}
[data-theme="dark"] .dl-hero::before { opacity: 0.15; }
.dl-hero > * { position: relative; }

.dl-icon {
  width: 84px; height: 84px;
  margin: 0 auto var(--s-5);
  border-radius: var(--r-2xl);
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-600);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
.dl-icon svg { width: 40px; height: 40px; }

.dl-title {
  font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 700;
  margin-bottom: 4px; letter-spacing: -0.02em;
  word-break: break-word;
}
.dl-meta {
  font-size: 0.875rem; color: var(--text-2);
  font-weight: 500;
}
.dl-status {
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border-2);
}
.dl-status-title {
  font-size: 1rem; font-weight: 700; margin-bottom: 2px;
}
.dl-status-text {
  font-size: 0.875rem; color: var(--text-3);
  transition: color var(--d-base) var(--ease);
}
.dl-status-text--success { color: var(--accent-600); }
[data-theme="dark"] .dl-status-text--success { color: var(--accent-500); }

/* Countdown */
.countdown-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: var(--s-8) var(--s-5);
  text-align: center;
  border: 1px solid var(--border-2);
  transition: all var(--d-base) var(--ease);
}
.countdown-ring {
  position: relative;
  width: 120px; height: 120px;
  margin: 0 auto var(--s-5);
}
.countdown-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.countdown-ring-bg { stroke: var(--border); }
.countdown-ring-progress {
  stroke: var(--brand-500);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.4));
}
.countdown-num {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 2.2rem; font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.countdown-text {
  font-size: 0.9rem; color: var(--text-2);
  margin-bottom: var(--s-2);
}
.countdown-text strong { color: var(--text); font-weight: 700; }
.countdown-link {
  font-size: 0.8125rem;
}
.countdown-link a {
  color: var(--brand-600); text-decoration: none; font-weight: 600;
  transition: color var(--d-fast) var(--ease);
}
.countdown-link a:hover { color: var(--brand-700); text-decoration: underline; }
[data-theme="dark"] .countdown-link a { color: var(--brand-400); }
[data-theme="dark"] .countdown-link a:hover { color: var(--brand-300); }

/* Server indicator */
.server-info {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.75rem; color: var(--text-2);
  font-weight: 500;
  margin-top: var(--s-2);
  opacity: 0; transition: opacity var(--d-base) var(--ease);
}
.server-info.visible { opacity: 1; }
.server-info .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-500);
  animation: pulse 1.4s infinite;
}

/* Progress bar */
.progress {
  width: 100%; height: 4px;
  background: var(--border-2);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-top: var(--s-4);
  opacity: 0; transition: opacity var(--d-base) var(--ease);
}
.progress.visible { opacity: 1; }
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-400));
  border-radius: var(--r-pill);
  width: 0%;
  transition: width 0.3s var(--ease);
}

/* ─── Turnstile ─────────────────────────────────────────── */
.turnstile-wrap {
  display: flex; justify-content: center;
  padding: var(--s-2) 0;
}

/* ─── 404 / Error ───────────────────────────────────────── */
.error-page {
  text-align: center;
  padding: var(--s-16) var(--s-5);
  display: flex; flex-direction: column; align-items: center;
}
.error-icon {
  width: 88px; height: 88px;
  border-radius: var(--r-2xl);
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--s-6);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
}
.error-icon svg { width: 40px; height: 40px; color: var(--brand-600); }
.error-icon--danger { background: linear-gradient(135deg, var(--danger-50), #fee2e2); }
.error-icon--danger svg { color: var(--danger-500); }
.error-title {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 700; margin-bottom: var(--s-2);
  letter-spacing: -0.02em;
}
.error-desc {
  font-size: 0.9rem; color: var(--text-3); margin-bottom: var(--s-6);
  max-width: 320px; line-height: 1.5;
}
.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text); font-size: 0.875rem; font-weight: 600;
  transition: all var(--d-fast) var(--ease);
  text-decoration: none;
}
.btn-outline:hover {
  border-color: var(--brand-500);
  color: var(--brand-600);
  background: var(--brand-50);
}
[data-theme="dark"] .btn-outline:hover { background: rgba(99,102,241,0.1); }
.btn-outline svg { width: 14px; height: 14px; }

/* ─── Footer ────────────────────────────────────────────── */
.footer {
  padding: var(--s-5) var(--s-5) var(--s-6);
  text-align: center;
}
.footer-inner {
  font-size: 0.75rem; color: var(--text-4);
  display: flex; justify-content: center; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.footer-link { color: var(--text-3); text-decoration: none; transition: color var(--d-fast) var(--ease); }
.footer-link:hover { color: var(--text); }
.footer-sep { color: var(--text-4); }

/* ─── Ad slots — native feel ────────────────────────────── */
.ad-slot {
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border-2);
  overflow: hidden;
  transition: all var(--d-base) var(--ease);
}
.ad-label {
  display: block;
  font-size: 0.625rem; font-weight: 600;
  color: var(--text-4); text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  text-align: right;
}
.ad-slot iframe { display: block; width: 100%; min-height: 90px; border: 0; }
.ad-stub {
  height: 90px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-4); font-size: 0.75rem;
  background: var(--surface-2);
}

/* ─── Donate ────────────────────────────────────────────── */
.donate-card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  padding: var(--s-5) var(--s-6);
  transition: all var(--d-base) var(--ease);
}
.donate-header {
  display: flex; align-items: flex-start; gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.donate-header svg {
  width: 20px; height: 20px;
  flex-shrink: 0; margin-top: 1px;
  color: var(--brand-500);
}
.donate-title {
  font-family: var(--font-display);
  font-size: 0.925rem; font-weight: 700;
  color: var(--text); margin-bottom: 1px;
}
.donate-desc {
  font-size: 0.8125rem; color: var(--text-3);
  line-height: 1.4;
}
.donate-amounts {
  display: flex; gap: var(--s-2);
  margin-bottom: var(--s-3);
}
.donate-btn {
  flex: 1;
  height: 42px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.875rem; font-weight: 600;
  cursor: pointer;
  transition: all var(--d-fast) var(--ease);
  font-family: var(--font-body);
}
.donate-btn:hover {
  border-color: var(--brand-300);
  color: var(--brand-600);
  background: var(--brand-50);
}
.donate-btn.is-selected {
  border-color: var(--brand-500);
  color: var(--brand-600);
  background: var(--brand-50);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
[data-theme="dark"] .donate-btn.is-selected { background: rgba(99,102,241,0.12); box-shadow: 0 0 0 3px rgba(99,102,241,0.25); }
.donate-custom { flex: 1; }
.donate-input {
  width: 100%; height: 42px;
  padding: 0 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem; font-weight: 500;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--d-fast) var(--ease);
}
.donate-input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
.donate-input::placeholder { color: var(--text-4); font-weight: 500; }
.donate-submit {
  width: 100%; height: 44px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff;
  font-size: 0.875rem; font-weight: 700;
  border: none; border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--d-fast) var(--ease);
  font-family: var(--font-body);
  margin-bottom: var(--s-2);
}
.donate-submit:hover { box-shadow: var(--shadow-glow); }
.donate-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.donate-submit-loader svg { width: 18px; height: 18px; }
.donate-footnote {
  font-size: 0.6875rem; color: var(--text-4);
  text-align: center; font-weight: 500;
}

@keyframes spin { to { transform: rotate(360deg); } }
.donate-submit-loader .spin { animation: spin 0.8s linear infinite; }

/* ─── Donate highlight (download page encouragement) ──── */
.donate-card--highlight {
  border-color: var(--brand-400) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15), var(--shadow-md);
  animation: donatePulse 2s ease-in-out 3;
}
@keyframes donatePulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(99,102,241,0.15), var(--shadow-md); }
  50% { box-shadow: 0 0 0 8px rgba(99,102,241,0.20), var(--shadow-lg); }
}
.dl-encourage {
  text-align: center;
  margin-top: var(--s-4);
  font-size: 0.9375rem;
  color: var(--text-2);
  line-height: 1.5;
  animation: fadeUp 0.5s ease both;
}
.dl-encourage strong { color: var(--text); }

@media (max-width: 640px) {
  .donate-card { padding: var(--s-4); }
  .donate-amounts { gap: var(--s-1); }
  .donate-btn { font-size: 0.8125rem; height: 40px; }
  .donate-input { height: 40px; font-size: 0.8125rem; }
  .donate-submit { height: 42px; font-size: 0.8125rem; }
}

/* ─── Promo ─────────────────────────────────────────────── */
.promo-card {
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  transition: all var(--d-base) var(--ease);
}
.promo-icon {
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-600);
}
.promo-icon svg { width: 20px; height: 20px; }
.promo-text { flex: 1; min-width: 0; }
.promo-title {
  font-size: 0.875rem; font-weight: 700;
  color: var(--text); margin-bottom: 2px;
}
.promo-desc {
  font-size: 0.8125rem; color: var(--text-3);
  line-height: 1.4;
}
.promo-btn {
  flex-shrink: 0;
  padding: 8px 18px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff; font-size: 0.8125rem; font-weight: 600;
  border-radius: var(--r-pill);
  text-decoration: none;
  transition: all var(--d-fast) var(--ease);
  white-space: nowrap;
}
.promo-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

@media (max-width: 640px) {
  .promo-card {
    flex-wrap: wrap; gap: var(--s-3);
    padding: var(--s-4);
  }
  .promo-icon { width: 36px; height: 36px; }
  .promo-icon svg { width: 16px; height: 16px; }
  .promo-text { width: calc(100% - 44px); }
  .promo-btn { width: 100%; text-align: center; padding: 10px; }
}

/* ─── Discord link ──────────────────────────────────────── */
.discord-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: var(--s-3) auto 0;
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  transition: all var(--d-fast) var(--ease);
  width: fit-content;
}
.discord-link:hover {
  color: var(--brand-500);
  border-color: var(--brand-300);
  background: var(--brand-50);
}
[data-theme="dark"] .discord-link:hover {
  background: rgba(99,102,241,0.08);
}
.discord-link svg { width: 15px; height: 15px; flex-shrink: 0; }

[data-theme="dark"] .plyr--video,
[data-theme="dark"] .plyr--audio {
  --plyr-video-background: #000;
  --plyr-menu-background: var(--surface-2);
  --plyr-menu-color: var(--text);
  --plyr-tab-focus-color: var(--brand-500);
  --plyr-control-color: rgba(255,255,255,0.85);
}
[data-theme="dark"] .plyr__control--overlaid { background: rgba(99,102,241,0.9); }

/* ─── Mobile ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .container { padding: 0 var(--s-4); }
  .page { padding: var(--s-5) 0 var(--s-8); }
  .page > * + * { margin-top: var(--s-4); }

  .nav { padding: 0 var(--s-4); }

  .preview { border-radius: var(--r-md); }
  .preview-image { max-height: 60vh; }
  .preview-image img { max-height: 60vh; }
  .preview-video video { max-height: 60vh; }
  .preview-video .plyr--video { max-height: 60vh; }
  .preview-audio { padding: var(--s-8) var(--s-4); border-radius: var(--r-md); gap: var(--s-5); }
  .preview-audio-art { width: 88px; height: 88px; border-radius: var(--r-xl); }
  .preview-audio-art svg { width: 40px; height: 40px; }
  .preview-other { padding: var(--s-10) var(--s-4); }
  .preview-other-icon { width: 80px; height: 80px; }

  .file-name { font-size: 1.15rem; }

  .btn-download { height: 52px; font-size: 0.975rem; border-radius: var(--r-md); }

  .dl-hero { padding: var(--s-8) var(--s-4); border-radius: var(--r-md); }
  .countdown-card { padding: var(--s-6) var(--s-4); border-radius: var(--r-md); }
  .countdown-ring { width: 100px; height: 100px; }
  .countdown-num { font-size: 1.9rem; }

  .details-card { padding: var(--s-4); border-radius: var(--r-md); }
  .details-row { padding: 8px 0; }

  .trust-row { padding: var(--s-2) var(--s-3); font-size: 0.75rem; }

  .share-btn { height: 38px; font-size: 0.75rem; }

  .error-page { padding: var(--s-12) var(--s-4); }
  .error-icon { width: 72px; height: 72px; }
  .error-icon svg { width: 32px; height: 32px; }
  .error-title { font-size: 1.25rem; }
}

@media (max-width: 380px) {
  .file-name { font-size: 1.05rem; }
  .btn-download { height: 48px; font-size: 0.9rem; }
  .nav-brand { font-size: 0.95rem; }
}

/* ─── Donate Sticky Bar (download page) ────────────────── */
.donate-sticky {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  display: none;
  justify-content: center;
  pointer-events: none;
  padding: 0 var(--s-5);
}
.donate-sticky.visible { display: flex; }
.donate-sticky-inner {
  width: 100%;
  max-width: var(--max-w);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 10px 16px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
  font-family: var(--font-body);
  pointer-events: auto;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
[data-theme="dark"] .donate-sticky-inner {
  background: rgba(24,24,27,0.92);
  border-top-color: var(--gray-800);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.donate-sticky-text {
  font-size: 0.8125rem;
  color: var(--text-2);
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}
.donate-sticky-text strong { color: var(--text); }
.donate-sticky-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: var(--brand-500);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: var(--font-body);
  transition: all var(--d-fast) var(--ease);
}
.donate-sticky-btn:hover { background: var(--brand-600); }
.donate-sticky-btn svg { width: 14px; height: 14px; }
.donate-sticky-close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  color: var(--text-4);
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 50%;
  transition: all var(--d-fast) var(--ease);
}
.donate-sticky-close:hover { background: var(--surface-2); color: var(--text-2); }
.donate-sticky-close svg { width: 16px; height: 16px; }

@media (max-width: 640px) {
  .donate-sticky { padding: 0 var(--s-4); }
  .donate-sticky-inner { padding: 8px 12px; }
  .donate-sticky-text { font-size: 0.75rem; }
  .donate-sticky-btn { font-size: 0.6875rem; padding: 6px 10px; }
}
/* Ensure page bottom padding so content isn't hidden by sticky bar */
body.has-sticky { padding-bottom: 56px; }
@media (max-width: 640px) { body.has-sticky { padding-bottom: 48px; } }
