:root {
  /* Dark editorial theme (default), shared with the welcome overlay */
  --bg: #0C0C12;
  --panel-bg: rgba(20, 20, 32, 0.9);
  --card-bg: #141420;
  --glass-bg: rgba(20, 20, 32, 0.82);
  --text-rgb: 237, 232, 224;
  --border: rgba(var(--text-rgb), 0.08);
  --border-glow: rgba(234, 147, 116, 0.45);
  --text: #EDE8E0;
  --text-dim: rgba(var(--text-rgb), 0.45);
  --accent: #EA9374;
  --accent-hover: #D07A5C;
  --accent2: #5A7ED6;
  --accent3: #C8A2FF;
  --blue-deep: #3A62C4;
  --coral: #FF6B6B;
  --sage: #00D4A0;
  --scrollbar: #2a2a3c;
  --radius: 18px;
  --font-display: "Bebas Neue", "Impact", sans-serif;
  --font-serif: "Playfair Display", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light theme — toggled from the sidebar; the splash keeps its own dark
   tokens (scoped to .splash) either way. */
:root[data-theme="light"] {
  --bg: #F3EFE7;
  --panel-bg: rgba(255, 253, 249, 0.9);
  --card-bg: #FFFDF9;
  --glass-bg: rgba(252, 249, 243, 0.85);
  --text-rgb: 35, 34, 46;
  --border: rgba(var(--text-rgb), 0.12);
  --border-glow: rgba(208, 122, 92, 0.55);
  --text: #23222E;
  --text-dim: rgba(var(--text-rgb), 0.55);
  --accent-hover: #C56B4E;
  --scrollbar: #CCC5B8;
}

:root[data-theme="light"] .video-thumb {
  background: linear-gradient(135deg, #E6E1D6, #D8D2C5);
}

:root[data-theme="light"] .drop-hint {
  background: rgba(243, 239, 231, 0.92);
}

:root[data-theme="light"] .app-orb { opacity: 0.12; }

:root[data-theme="light"] .sidebar { box-shadow: 6px 0 30px rgba(35, 34, 46, 0.08); }

:root[data-theme="light"] .video-card,
:root[data-theme="light"] .torrent-card {
  box-shadow: 0 2px 10px rgba(35, 34, 46, 0.08);
}

:root[data-theme="light"] .video-card:hover {
  box-shadow: 0 20px 34px rgba(35, 34, 46, 0.16);
}

* { box-sizing: border-box; }

::selection { background: var(--accent); color: #0C0C12; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 70% 50% at 12% -8%, rgba(90, 126, 214, 0.1) 0%, transparent 60%),
    radial-gradient(ellipse 65% 50% at 90% 8%, rgba(234, 147, 116, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 70% 55% at 30% 105%, rgba(200, 162, 255, 0.07) 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* thin soft scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Film grain over the whole app (matches the welcome overlay) */
.app-grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3000;
  mix-blend-mode: soft-light;
  opacity: 0.1;
}

:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
  border-radius: 4px;
}

.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.app-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.16;
  animation: drift 26s ease-in-out infinite;
}

.orb1 { width: 420px; height: 420px; background: var(--accent); top: -140px; left: 6%; }
.orb2 { width: 380px; height: 380px; background: var(--accent2); bottom: -160px; right: 4%; animation-duration: 30s; animation-delay: -6s; }
.orb3 { width: 320px; height: 320px; background: var(--accent3); top: 42%; left: 48%; animation-duration: 28s; animation-delay: -12s; }

.app-shell {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
  animation: app-in 0.7s var(--ease-out) backwards;
}

@keyframes app-in {
  from { opacity: 0; transform: translateY(14px); }
}

.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-right: 1px solid var(--border);
  box-shadow: 6px 0 30px rgba(0, 0, 0, 0.35);
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  margin-bottom: 30px;
  background: none;
  border: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.sidebar-brand:hover .brand-name { color: var(--accent); }
.sidebar-brand:hover .brand-icon { transform: translateY(-2px) rotate(-6deg); }

.brand-icon {
  font-size: 24px;
  filter: drop-shadow(0 2px 6px rgba(234, 147, 116, 0.45));
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  animation: float-soft 5s ease-in-out infinite;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--text);
  transition: color 0.25s ease;
}

@keyframes float-soft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.side-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tab-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
  text-align: left;
  width: 100%;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
  overflow: hidden;
}

.tab-btn:hover { color: var(--text); background: rgba(var(--text-rgb), 0.05); transform: translateX(2px); }

.tab-btn.active {
  background: var(--accent);
  border-color: transparent;
  color: #0C0C12;
  box-shadow: 0 6px 18px rgba(234, 147, 116, 0.28);
  transform: none;
}

.tab-icon { font-size: 17px; }

.content { flex: 1; min-width: 0; padding: 28px 32px 60px; max-width: 1400px; }

.panel {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.panel.active {
  opacity: 1;
  transform: translateY(0);
}

.panel.active.panel-enter {
  opacity: 0;
  transform: translateY(10px);
  transition: none;
}

.panel { display: none; position: relative; }
.panel.active { display: block; }

.panel-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.folder-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.folder-path {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--accent);
  max-width: 480px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anime-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: -6px 0 16px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 14px;
}

.crumb-item {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.crumb-item:hover { color: var(--accent); background: rgba(var(--text-rgb), 0.05); }
.crumb-item:last-child { color: var(--text); font-weight: 600; }

.crumb-sep { color: var(--text-dim); font-size: 13px; }

.new-folder-inline {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 220px;
}

.new-folder-inline[hidden] { display: none; }

.new-folder-inline input {
  flex: 1;
  min-width: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 11px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.new-folder-inline input:focus { outline: none; border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(90, 126, 214, 0.3); }
.new-folder-inline .btn { padding: 6px 11px; font-size: 10px; }

.folder-card .video-thumb { cursor: pointer; }
.folder-card .video-name { cursor: pointer; }

.toolbar-actions { display: flex; gap: 10px; }

.library-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.search-input {
  flex: 1;
  min-width: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus { outline: none; border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(90, 126, 214, 0.3); }
.search-input::placeholder { color: var(--text-dim); }

.sort-select {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 10px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sort-select:focus { outline: none; border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(90, 126, 214, 0.3); }

.btn {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 8px;
  padding: 11px 18px;
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }

.btn .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
  animation: ripple-anim 0.6s ease-out forwards;
}

@keyframes ripple-anim {
  to { transform: scale(1); opacity: 0; }
}

.btn-primary { background: var(--blue-deep); color: #fff; }
.btn-primary:hover { background: var(--accent); color: #0C0C12; box-shadow: 0 8px 20px rgba(234, 147, 116, 0.3); }

.btn-secondary { background: transparent; color: var(--text); border: 1px solid rgba(var(--text-rgb), 0.25); }
.btn-secondary:hover { border-color: rgba(var(--text-rgb), 0.6); background: rgba(var(--text-rgb), 0.06); }

.toolbar-actions .btn { padding: 7px 12px; font-size: 10px; }

.upload-label { display: inline-block; position: relative; }
/* Keep the file input in the layout (not display:none) so mobile Safari /
   Android WebView reliably opens the picker when the label is tapped. */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.upload-progress-list { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }

.upload-progress-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
}

.upload-progress-item .filename { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--text-dim); }

.progress-bar-track {
  background: rgba(var(--text-rgb), 0.1);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  position: relative;
  background: linear-gradient(90deg, var(--accent), var(--accent3), var(--accent2));
  background-size: 200% 100%;
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
  animation: progress-shimmer 3s linear infinite;
}

@keyframes progress-shimmer {
  0% { background-position: 0% 0; }
  100% { background-position: -200% 0; }
}

.upload-progress-item.done .progress-bar-fill,
.progress-bar-fill.done {
  background: var(--sage);
  animation: none;
}
.upload-progress-item.error .progress-bar-fill { background: var(--accent); animation: none; }

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.empty-state { color: var(--text-dim); font-size: 15px; animation: fade-up 0.4s ease both; }

.video-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--d, 0) * 45ms);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  --lx: 50%;
  --ly: 50%;
}

.video-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 34px rgba(0, 0, 0, 0.5);
  border-color: var(--border-glow);
}

.video-thumb {
  position: relative;
  height: 120px;
  background: linear-gradient(135deg, #141420, #1C1C2A);
  overflow: hidden;
  cursor: pointer;
}

.video-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
}

.video-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(180px circle at var(--lx, 50%) var(--ly, 50%), rgba(255, 255, 255, 0.12), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.video-card:hover .video-thumb::before { opacity: 1; }

.thumb-img { transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.video-card:hover .thumb-img { transform: scale(1.06); }

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

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: white;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.video-card:hover .play-overlay { opacity: 1; }

.video-thumb.no-thumb .play-overlay {
  opacity: 1;
  background: transparent;
  font-size: 36px;
  color: var(--accent);
  transition: color 0.2s ease;
}

.video-card:hover .video-thumb.no-thumb .play-overlay { color: var(--accent-hover); }

.duration-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1.4;
}

.new-badge {
  position: absolute;
  left: 6px;
  top: 6px;
  z-index: 3;
  background: var(--sage);
  color: #0C0C12;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1.4;
}

.watch-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  z-index: 3;
  background: rgba(0, 0, 0, 0.55);
}

.watch-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 0 999px 999px 0;
}

.continue-section { margin-bottom: 24px; animation: fade-up 0.4s ease both; }

.continue-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--text);
}

.continue-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.continue-card { flex: 0 0 200px; }

.continue-card .video-thumb { height: 104px; }

.continue-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 4;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: rgba(237, 232, 224, 0.85);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.continue-card:hover .continue-remove { opacity: 1; }

.continue-remove:hover { background: rgba(0, 0, 0, 0.85); color: var(--coral); }

.video-info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }

.video-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.video-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.video-actions { display: flex; gap: 6px; margin-top: 4px; }

.video-actions .btn { flex: 1; padding: 7px 8px; font-size: 14px; }

.btn-danger { background: transparent; border: 1px solid var(--border); color: var(--text-dim); }
.btn-danger:hover { color: var(--coral); border-color: var(--coral); }

.btn-danger-solid { background: var(--coral); color: #0C0C12; }
.btn-danger-solid:hover { background: #e05555; color: #fff; }

.drop-hint {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(12, 12, 18, 0.92);
  border: 2px dashed var(--accent2);
  border-radius: var(--radius);
  z-index: 5;
  pointer-events: none;
}

.panel.drag-active .drop-hint { display: flex; }

.drop-hint-inner {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  padding: 16px 24px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal {
  position: relative;
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
  width: 520px;
  max-width: 92vw;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 1;
  background: linear-gradient(90deg, var(--accent), var(--accent3), var(--accent2));
}

.modal-overlay.active .modal { transform: scale(1) translateY(0); }

.modal-player { width: 900px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover { color: var(--accent); }

.modal-body { padding: 16px 18px; overflow-y: auto; }

.modal-player .modal-body { padding: 0; }

#player-video { width: 100%; max-height: 70vh; display: block; background: black; }

#rename-input {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}

#rename-input:focus { outline: none; border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(90, 126, 214, 0.3); }

.modal-confirm { width: 400px; }
.modal-confirm .modal-body p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.5; }

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.browse-error { color: var(--accent-hover); font-size: 12px; }

/* ---------- Disk space widget (sidebar) ---------- */

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 11px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: rgba(var(--text-rgb), 0.3);
  background: rgba(var(--text-rgb), 0.05);
}

.disk-widget {
  margin-top: 14px;
  padding: 14px 8px 2px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
}

.disk-widget-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.disk-widget-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.disk-widget-free {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}

.disk-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(var(--text-rgb), 0.1);
  overflow: hidden;
  margin: 9px 0 7px;
}

.disk-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.6s var(--ease-out);
}

.disk-bar-fill.disk-bar-warn { background: var(--coral); }

.disk-widget-detail {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

@media (max-width: 720px) {
  .app-shell { flex-direction: column; }

  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 14px 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-brand { margin-bottom: 14px; }

  .side-tabs {
    flex-direction: row;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -16px;
    padding: 0 16px 4px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
  }

  .side-tabs::-webkit-scrollbar { display: none; }

  .tab-btn { width: auto; flex-shrink: 0; white-space: nowrap; }

  /* Pin the toggle to the top-right of the top bar, beside the brand */
  .theme-toggle {
    position: absolute;
    top: 12px;
    right: 16px;
    margin-top: 0;
    padding: 8px 12px;
    width: auto;
  }

  .disk-widget { margin-top: 10px; padding: 10px 0 0; }
  .disk-widget-detail { display: inline; }

  .content { padding: 20px 16px 60px; }

  .panel-toolbar { flex-direction: column; align-items: flex-start; }
  .folder-path { max-width: 60vw; }

  #magnet-form { flex-direction: column; align-items: stretch; }
  #magnet-input { max-height: 45vh; }
}

/* ---------- Splash / welcome screen ---------- */
/* Dark editorial landing (dark bg, Bebas display, Playfair serif, mono labels).
   All tokens are scoped to .splash so the pastel app theme is untouched. */

.splash {
  --w-deep: #0C0C12;
  --w-dark: #141420;
  --w-surface: #1C1C2A;
  --w-cream: #EDE8E0;
  --w-muted: rgba(237, 232, 224, 0.5);
  --w-dim: rgba(237, 232, 224, 0.25);
  --w-border: rgba(237, 232, 224, 0.08);
  --w-blue-deep: #3A62C4;
  --w-salmon: #EA9374;
  --w-mint: #00D4A0;
  --w-font-display: "Bebas Neue", "Impact", sans-serif;
  --w-font-serif: "Playfair Display", Georgia, serif;
  --w-font-mono: "JetBrains Mono", "Fira Code", monospace;
  --w-pad: clamp(24px, 5vw, 80px);
  --w-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --w-ease-dramatic: cubic-bezier(0.65, 0.05, 0, 1);

  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--w-deep);
  color: var(--w-cream);
  line-height: 1.6;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
  cursor: none;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

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

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

.splash.splash-hide * { animation-play-state: paused !important; }

.splash.splash-skip {
  display: none !important;
  transition: none !important;
}

.splash a { color: inherit; text-decoration: none; cursor: none; }
.splash button { cursor: none; }

.w-display {
  font-family: var(--w-font-display);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.w-serif {
  font-family: var(--w-font-serif);
  font-weight: 400;
  font-style: italic;
  text-transform: none;
}

.w-section { position: relative; width: 100%; }

.w-label {
  position: absolute;
  top: var(--w-pad);
  left: var(--w-pad);
  color: var(--w-mint);
  font-family: var(--w-font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  z-index: 10;
}

/* Entrance helpers: keyframes only declare `from`, so `animation: none`
   (reduced motion) leaves elements in their visible resting state. */
@keyframes w-rise { from { opacity: 0; transform: translateY(40px); } }
@keyframes w-fade { from { opacity: 0; } }

/* Scroll-triggered reveal (JS adds .in via IntersectionObserver) */
.w-reveal {
  opacity: 0;
  transform: translateY(44px);
  transition: opacity 0.8s var(--w-ease), transform 0.8s var(--w-ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.w-reveal.in { opacity: 1; transform: none; }

/* ---- Film grain ---- */
.w-grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 40;
  mix-blend-mode: soft-light;
  opacity: 0.12;
}

/* ---- Custom cursor (fine pointers only) ---- */
.w-cursor-ring,
.w-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  border-radius: 50%;
  mix-blend-mode: difference;
  opacity: 0;
  transform: translate(-100px, -100px);
}

.w-cursor-ring {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  z-index: 60;
  transition: width 0.35s var(--w-ease), height 0.35s var(--w-ease),
              background 0.35s, transform 0.15s ease-out, opacity 0.3s;
}

.w-cursor-ring.hover {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.06);
}

.w-cursor-dot {
  width: 6px;
  height: 6px;
  background: #fff;
  z-index: 61;
  transition: opacity 0.3s;
}

.splash.w-cursor-on .w-cursor-ring,
.splash.w-cursor-on .w-cursor-dot { opacity: 1; }

/* ---- Loader (column wipe, then reveals the hero) ---- */
.w-loader {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: var(--w-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: w-loader-hide 0.5s ease 1.6s forwards;
}

@keyframes w-loader-hide { to { opacity: 0; visibility: hidden; } }

.w-loader-cols {
  position: absolute;
  inset: 0;
  display: flex;
}

.w-loader-col {
  flex: 1;
  background: var(--w-dark);
  transform-origin: top;
  border-right: 1px solid rgba(237, 232, 224, 0.03);
  animation: w-col-away 0.8s var(--w-ease-dramatic) forwards;
}

.w-loader-col:nth-child(1) { animation-delay: 1s; }
.w-loader-col:nth-child(2) { animation-delay: 1.06s; }
.w-loader-col:nth-child(3) { animation-delay: 1.12s; }
.w-loader-col:nth-child(4) { animation-delay: 1.18s; }
.w-loader-col:nth-child(5) { animation-delay: 1.24s; }
.w-loader-col:nth-child(6) { animation-delay: 1.3s; }

@keyframes w-col-away { to { transform: scaleY(0); } }

.w-loader-center {
  position: relative;
  z-index: 2;
  text-align: center;
  animation: w-fade 0.7s ease 0.15s backwards, w-center-out 0.4s ease 1.2s forwards;
}

@keyframes w-center-out { to { opacity: 0; transform: translateY(-12px); } }

.w-loader-brand {
  display: block;
  font-size: clamp(4rem, 12vw, 11rem);
  color: var(--w-cream);
}

.w-loader-sub {
  display: block;
  margin-top: 12px;
  font-family: var(--w-font-mono);
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--w-salmon);
}

/* ---- Nav ---- */
.w-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: 20px var(--w-pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  mix-blend-mode: difference;
  color: #fff;
  animation: w-fade 0.8s ease 2s backwards;
}

.w-nav-logo {
  font-family: var(--w-font-mono);
  font-size: 14px;
  letter-spacing: 0.25em;
  font-weight: 600;
}

.w-nav-dot { color: var(--w-salmon); }

.w-nav-links { display: flex; gap: 28px; }

.w-nav-link {
  font-family: var(--w-font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  position: relative;
  padding: 12px 4px 4px;
}

.w-nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--w-ease);
}

.w-nav-link:hover::after { transform: scaleX(1); transform-origin: left; }

.w-nav-cta {
  font-family: var(--w-font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 10px 22px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: inherit;
  transition: background 0.3s, border-color 0.3s;
}

.w-nav-cta:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.6);
}

/* ---- Hero ---- */
.w-hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--w-pad);
}

.w-hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
}

.w-hero-line {
  font-size: clamp(4.5rem, 17vw, 20rem);
  line-height: 0.82;
  letter-spacing: -0.01em;
  color: var(--w-cream);
  animation: w-rise 1s var(--w-ease) 1.7s backwards;
}

.w-hero-serif {
  font-size: clamp(1.5rem, 5vw, 4.5rem);
  color: var(--w-salmon);
  margin-top: 0.1em;
  animation: w-rise 1s var(--w-ease) 1.85s backwards;
}

.w-hero-sub {
  margin: 32px 0 0;
  font-family: var(--w-font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--w-dim);
  animation: w-fade 0.8s ease 2.1s backwards;
}

.w-hero-actions {
  display: none;
  margin-top: 36px;
  animation: w-fade 0.8s ease 2.2s backwards;
}

.w-hero-enter {
  padding: 16px 42px;
  border: none;
  border-radius: 999px;
  background: var(--w-salmon);
  color: var(--w-deep);
  font-family: var(--w-font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.w-scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--w-dim);
  animation: w-fade 0.8s ease 2.4s backwards;
}

.w-scroll-cue span {
  font-family: var(--w-font-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
}

.w-scroll-arrow {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, var(--w-salmon), transparent);
  animation: w-pulse-arrow 2s ease-in-out infinite;
}

@keyframes w-pulse-arrow {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 0.8; transform: translateY(8px); }
}

/* ---- Mission / zoom words ---- */
.w-zoom {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--w-pad);
}

.w-zoom-text {
  font-size: clamp(2.2rem, 6vw, 6rem);
  line-height: 1.05;
  margin: 0;
}

.w-zoom-word {
  display: inline-block;
  margin: 0 0.06em;
  opacity: 0.08;
  transition: opacity 0.7s ease;
  transition-delay: calc(var(--i, 0) * 90ms);
}

.w-zoom.in .w-zoom-word { opacity: 1; }

.w-zoom-break { display: block; height: 0.15em; }

/* ---- Now Showing (auto-scrolling poster strips) ---- */
.w-showing {
  padding: calc(var(--w-pad) + 44px) 0 var(--w-pad);
  overflow: hidden;
}

.w-strip-caption {
  font-family: var(--w-font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--w-muted);
  padding: 0 var(--w-pad);
  margin: 32px 0 16px;
}

/* Two identical .w-strip-set children; translating -50% loops seamlessly */
.w-strip {
  display: flex;
  width: max-content;
}

.w-strip:hover { animation-play-state: paused; }

.w-strip-movies { animation: w-marquee-left 48s linear infinite; }
.w-strip-anime { animation: w-marquee-right 56s linear infinite; }

.w-strip-set {
  display: flex;
  flex-shrink: 0;
  gap: clamp(14px, 1.8vw, 24px);
  padding-right: clamp(14px, 1.8vw, 24px);
}

.w-poster {
  position: relative;
  width: clamp(160px, 16vw, 230px);
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  overflow: hidden;
  margin: 0;
  background: var(--w-dark);
  border: 1px solid var(--w-border);
}

.w-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform 0.6s var(--w-ease);
}

.w-poster:hover img { transform: scale(1.08); }

.w-poster figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 44px 14px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88), transparent);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.w-poster-title {
  font-size: clamp(1.1rem, 1.6vw, 1.5rem);
  line-height: 0.95;
  color: var(--w-cream);
}

.w-poster-meta {
  font-family: var(--w-font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--w-muted);
}

/* ---- Collection (feature cards) ---- */
.w-collection { padding: calc(var(--w-pad) + 44px) var(--w-pad) var(--w-pad); }

.w-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(16px, 2vw, 28px);
  max-width: 1200px;
  margin: 0 auto;
}

.w-feature {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: clamp(32px, 4vw, 56px);
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(160deg, var(--w-dark) 0%, var(--w-surface) 100%);
  border: 1px solid var(--w-border);
  color: var(--w-cream);
}

.w-feature-num {
  font-family: var(--w-font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  opacity: 0.5;
  margin-bottom: 16px;
}

.w-feature-title {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  line-height: 0.92;
  margin: 0 0 16px;
}

.w-feature-desc {
  font-size: 15px;
  line-height: 1.7;
  opacity: 0.65;
  max-width: 420px;
  margin: 0;
}

.w-feature-line {
  position: absolute;
  left: 0;
  top: 10%;
  bottom: 10%;
  width: 4px;
  border-radius: 0 2px 2px 0;
  background: var(--w-accent, var(--w-salmon));
}

.w-feature-bg {
  position: absolute;
  right: -2%;
  bottom: -18%;
  font-size: clamp(9rem, 16vw, 16rem);
  line-height: 0.8;
  opacity: 0.05;
  pointer-events: none;
  user-select: none;
}

/* ---- Marquee ---- */
.w-marquee {
  padding: clamp(32px, 5vh, 64px) 0;
  overflow: hidden;
  border-top: 1px solid var(--w-border);
  border-bottom: 1px solid var(--w-border);
}

.w-marquee-row {
  display: flex;
  width: max-content;
  white-space: nowrap;
}

.w-marquee-row + .w-marquee-row { margin-top: 12px; }

.w-marquee-content {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.w-marquee-content span { padding: 0 clamp(16px, 2.5vw, 40px); }

.w-marquee-left { animation: w-marquee-left 30s linear infinite; }

.w-marquee-left .w-marquee-content {
  font-size: clamp(3rem, 8vw, 7rem);
  color: var(--w-cream);
}

.w-marquee-right { animation: w-marquee-right 35s linear infinite; }

.w-marquee-right .w-marquee-content {
  font-size: clamp(2.4rem, 7vw, 6rem);
  color: var(--w-salmon);
}

.w-dot, .w-star { font-size: 0.25em; opacity: 0.3; }

@keyframes w-marquee-left {
  to { transform: translateX(-50%); }
}

@keyframes w-marquee-right {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

/* ---- Enter / CTA ---- */
.w-enter {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(60px, 10vh, 120px) var(--w-pad);
}

.w-enter-title {
  font-size: clamp(5.5rem, 20vw, 20rem);
  line-height: 0.82;
  margin: 0;
  color: var(--w-cream);
}

.w-enter-sub {
  font-size: clamp(1.5rem, 4.5vw, 4rem);
  color: var(--w-salmon);
  margin: 6px 0 0;
}

.w-enter-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 52px;
  padding: 20px 60px;
  border: none;
  background: var(--w-blue-deep);
  color: #fff;
  font-family: var(--w-font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: color 0.3s;
}

.w-enter-btn-text { position: relative; z-index: 2; pointer-events: none; }

.w-enter-btn-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--w-salmon);
  clip-path: circle(0% at 50% 50%);
  transition: clip-path 0.5s var(--w-ease-dramatic);
}

.w-enter-btn:hover .w-enter-btn-bg { clip-path: circle(120% at 50% 50%); }
.w-enter-btn:hover { color: var(--w-deep); }

.w-footer {
  margin-top: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.w-footer-brand { font-size: 2rem; color: var(--w-cream); }
.w-footer-tag { font-size: 14px; color: var(--w-salmon); }

.w-footer-copy {
  font-family: var(--w-font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--w-dim);
  margin-top: 6px;
}

/* ---- Welcome responsive ---- */
@media (max-width: 768px) {
  .splash { cursor: auto; }
  .splash a { cursor: pointer; }
  .splash button { cursor: pointer; }
  .w-cursor-ring, .w-cursor-dot { display: none !important; }
  .w-nav-links { display: none; }
  .w-hero-line { font-size: clamp(4rem, 22vw, 9rem); }
  .w-hero-serif { font-size: clamp(1.3rem, 6vw, 3rem); }
  .w-hero-sub { font-size: 8px; letter-spacing: 0.14em; max-width: 85vw; }
  .w-hero-actions { display: block; }
  .w-scroll-cue span { font-size: 10px; }
  .w-zoom { min-height: 40vh; padding: 40px var(--w-pad); }
  .w-zoom-text { font-size: clamp(1.7rem, 7vw, 4rem); }
  .w-poster { width: clamp(130px, 38vw, 170px); border-radius: 10px; }
  .w-poster-title { font-size: 1rem; }
  .w-feature-grid { grid-template-columns: 1fr; }
  .w-feature { min-height: 220px; border-radius: 18px; }
  .w-marquee-left .w-marquee-content { font-size: clamp(2.4rem, 10vw, 5rem); }
  .w-marquee-right .w-marquee-content { font-size: clamp(2rem, 9vw, 4.5rem); }
  .w-enter-title { font-size: clamp(4rem, 22vw, 11rem); }
  .w-enter-btn { padding: 16px 36px; font-size: 11px; margin-top: 40px; }
}

@media (hover: none) {
  .splash { cursor: auto; }
  .splash a { cursor: pointer; }
  .splash button { cursor: pointer; }
  .w-cursor-ring, .w-cursor-dot { display: none !important; }
  .w-nav-link::after { display: none; }
  /* No hover on touch screens — keep the Continue Watching remove button visible */
  .continue-remove { opacity: 1; }
}

/* Keyframes shared with the app shell (bg orbs, empty states) */
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.08); }
  66% { transform: translate(-30px, 25px) scale(0.95); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Toasts ---------- */

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent2);
  border-radius: 12px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateX(20px);
  animation: toast-in 0.3s ease forwards;
}

.toast-icon { font-size: 15px; flex-shrink: 0; }

.toast.toast-success { border-left-color: var(--sage); }
.toast.toast-error { border-left-color: var(--coral); }

.toast.toast-leaving {
  animation: toast-out 0.25s ease forwards;
}

@keyframes toast-in {
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateX(20px); }
}

@media (max-width: 720px) {
  .toast-container { left: 12px; right: 12px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .app-orb, .bg-orbs, .video-card, .thumb-img, .panel, .modal,
  .progress-bar-fill, .btn .ripple, .skeleton-shimmer, .video-thumb::before,
  .brand-icon {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  /* Welcome overlay: stop the choreography but keep everything readable.
     Entrance keyframes only declare `from`, so animation:none = final state. */
  .splash { scroll-behavior: auto; }
  .w-nav, .w-hero-line, .w-hero-serif, .w-hero-sub, .w-scroll-cue,
  .w-scroll-arrow, .w-marquee-left, .w-marquee-right,
  .w-strip-movies, .w-strip-anime, .w-poster img {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
  .w-reveal, .w-zoom-word {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  /* Strips don't auto-move here, so allow manual horizontal scrolling */
  .w-showing { overflow-x: auto; }

  /* Purely decorative; the loader would cover the page without its exit anim */
  .w-loader, .w-cursor-ring, .w-cursor-dot { display: none !important; }
}

/* ---- Torrents ---- */

.magnet-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

#magnet-input {
  flex: 1;
  min-width: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 15px;
  font-family: var(--font-body);
  line-height: 1.5;
  resize: none;
  overflow-y: auto;
  min-height: 42px;
  max-height: 220px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#magnet-input:focus { outline: none; border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(90, 126, 214, 0.3); }
#magnet-input::placeholder { color: var(--text-dim); }

.torrent-download-form { flex-wrap: wrap; }
.torrent-download-form #magnet-input { flex-basis: 100%; }
.torrent-download-form select { flex: 1; min-width: 160px; }

.torrent-list { display: flex; flex-direction: column; gap: 10px; }

.torrent-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  animation: card-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.torrent-card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.4);
  transform: translateY(-3px);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.torrent-name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.torrent-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.torrent-card .progress-bar-track { height: 7px; }
.torrent-card .progress-bar-fill.done { background: var(--sage); }

.torrent-actions { display: flex; gap: 6px; flex-shrink: 0; }
.torrent-actions .btn { padding: 8px 10px; font-size: 14px; }

@media (max-width: 600px) {
  .torrent-card { flex-direction: column; align-items: stretch; }
  .torrent-actions { justify-content: flex-end; }
}

/* Icon-only toggle on narrow phones so it doesn't crowd the brand */
@media (max-width: 420px) {
  #theme-toggle-label { display: none; }
  .theme-toggle { gap: 0; }
}

/* ---- Archive movie search ---- */

#archive-search-input {
  flex: 1;
  min-width: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#archive-search-input:focus { outline: none; border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(90, 126, 214, 0.3); }
#archive-search-input::placeholder { color: var(--text-dim); }

.archive-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin: -8px 0 18px;
}

/* ---- Skeleton loaders ---- */

.skeleton-shimmer {
  background: linear-gradient(90deg, var(--card-bg) 25%, #232334 37%, var(--card-bg) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.6s ease infinite;
}

@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.skeleton-card { pointer-events: none; }

.skeleton-line {
  height: 11px;
  border-radius: 4px;
  margin: 4px 0;
}
