/* ================================================================
   BoomTV79 — Premium theme v2
   Deep navy base + violet→orange gradient accents, glassmorphism,
   smooth micro-animations. Mobile-first, reels (9:16) optimized.
================================================================ */

:root {
  --bg: #06060d;
  --bg-elev: #0f0f1b;
  --widget-bg: #141425;
  --widget-bg-2: #1a1a2e;
  --border: #262640;
  --border-hover: #3a3a5c;

  --accent: #ff7a18;
  --accent-2: #ff3d7f;
  --accent-3: #8b5cf6;
  --accent-grad: linear-gradient(135deg, #ff7a18 0%, #ff3d7f 50%, #8b5cf6 100%);
  --accent-grad-soft: linear-gradient(135deg, rgba(255,122,24,0.15), rgba(139,92,246,0.15));

  --title: #ffffff;
  --text: #d8d8e8;
  --muted: #8a8aa8;
  --muted-2: #6a6a88;

  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --info: #3b82f6;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xl: 22px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 32px rgba(255,122,24,0.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(139,92,246,0.14), transparent 60%),
    radial-gradient(1000px 500px at 90% 110%, rgba(255,61,127,0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 80px;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: #ffa057; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ================================================================
   Header
================================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6,6,13,0.75);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.header-inner {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--title); font-weight: 800; font-size: 1.35rem;
  letter-spacing: -0.5px;
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--accent-grad);
  color: #fff; font-size: 15px;
  box-shadow: 0 6px 20px rgba(255,122,24,0.4);
  position: relative;
  overflow: hidden;
}
.brand-mark::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.3));
}
.brand-name {
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.search { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 1; max-width: 460px; }
.search input {
  flex: 1; background: rgba(255,255,255,0.04); color: var(--text);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 999px;
  padding: 11px 18px; outline: none; font-size: 0.95rem;
  transition: all 0.2s;
}
.search input:focus {
  border-color: var(--accent);
  background: rgba(255,122,24,0.05);
  box-shadow: 0 0 0 3px rgba(255,122,24,0.15);
}
.search input::placeholder { color: var(--muted-2); }
.search button {
  background: var(--accent-grad); color: #fff; border: 0;
  padding: 11px 18px; border-radius: 999px; cursor: pointer;
  font-weight: 600; transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(255,122,24,0.35);
}
.search button:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255,122,24,0.5); }

/* ================================================================
   Main / Section titles
================================================================ */
.main-content { max-width: 1240px; margin: 0 auto; padding: 18px 14px; }

.section-title {
  color: var(--title); font-size: 1.15rem; font-weight: 700;
  margin: 20px 6px 14px;
  display: flex; align-items: center; gap: 10px;
  letter-spacing: -0.3px;
}
.section-title::before {
  content: ""; width: 4px; height: 20px; border-radius: 2px;
  background: var(--accent-grad);
}
.section-title .count {
  color: var(--muted); font-weight: 500; font-size: 0.85rem;
  margin-left: auto;
}

/* ================================================================
   Reels Grid (9:16 cards)
================================================================ */
.reel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 540px) { .reel-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (min-width: 820px) { .reel-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
@media (min-width: 1100px) { .reel-grid { grid-template-columns: repeat(5, 1fr); } }

.reel-card {
  position: relative; display: block;
  background: var(--widget-bg);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 9 / 16;
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.1), box-shadow 0.25s, border-color 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  isolation: isolate;
}
.reel-card:hover {
  transform: translateY(-4px) scale(1.015);
  border-color: rgba(255,122,24,0.5);
  box-shadow: 0 14px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,122,24,0.2);
}
.reel-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.9));
  pointer-events: none; z-index: 1;
}
.reel-thumb {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: linear-gradient(135deg, #1a1a2a, #2a2a44);
  transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1);
  z-index: 0;
}
.reel-card:hover .reel-thumb { transform: scale(1.08); }
.reel-thumb.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-2); font-size: 2.4rem;
  background: linear-gradient(135deg, #1a1a2a, #2a2a44, #1a1a2a);
}
.reel-play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(0,0,0,0.5); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255,255,255,0.4);
  z-index: 2;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}
.reel-card:hover .reel-play {
  background: var(--accent-grad);
  border-color: #fff;
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 0 30px rgba(255,122,24,0.6);
}
.reel-title {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 32px 12px 10px;
  color: #fff; font-size: 0.85rem; font-weight: 600;
  z-index: 2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
  line-height: 1.35;
}
.reel-meta {
  position: absolute; left: 10px; bottom: 44px;
  color: rgba(255,255,255,0.85); font-size: 0.7rem;
  z-index: 2;
  display: flex; align-items: center; gap: 10px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.reel-meta i { font-size: 0.75rem; margin-right: 2px; }
.reel-badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--accent-grad);
  color: #fff; font-size: 0.65rem; font-weight: 800;
  padding: 4px 10px; border-radius: 999px;
  letter-spacing: 1px; z-index: 3;
  box-shadow: 0 4px 10px rgba(255,122,24,0.4);
  animation: pulse-badge 2.5s ease-in-out infinite;
}
@keyframes pulse-badge {
  0%, 100% { box-shadow: 0 4px 10px rgba(255,122,24,0.4); }
  50% { box-shadow: 0 4px 20px rgba(255,122,24,0.8); }
}
.reel-badge.hot { background: linear-gradient(135deg, #ef4444, #ff3d7f); }

/* ================================================================
   Ad containers
================================================================ */
.ad-slot {
  display: flex; justify-content: center; align-items: center;
  margin: 16px auto; min-height: 50px;
  overflow: hidden;
}
.ad-slot.ad-top { margin: 12px auto 18px; }
.ad-slot iframe { max-width: 100%; }

/* ================================================================
   Post page
================================================================ */
.post-wrap { max-width: 440px; margin: 0 auto; padding: 0 2px; }

.post-title {
  color: var(--title); font-size: 1.3rem; font-weight: 800;
  margin: 12px 0 6px; text-align: center;
  letter-spacing: -0.3px; line-height: 1.3;
}
.post-meta {
  display: flex; justify-content: center; gap: 16px;
  color: var(--muted); font-size: 0.82rem;
  margin-bottom: 14px;
}
.post-meta span { display: inline-flex; align-items: center; gap: 5px; }
.post-meta i { color: var(--accent); }

.reel-embed {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin: 0 auto;
  width: 100%; max-width: 360px;
  aspect-ratio: 9 / 16;
  position: relative;
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(255,122,24,0.1);
}
.reel-embed .fb-video, .reel-embed iframe {
  width: 100% !important; height: 100% !important;
  position: absolute; inset: 0;
}

.post-desc {
  color: var(--text); font-size: 0.95rem; line-height: 1.6;
  background: linear-gradient(135deg, var(--widget-bg), var(--widget-bg-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin: 16px auto; text-align: center;
}

/* ---- Next Part CTA (click 1 = ad, click 2 = next post) ---- */
.next-part-cta {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--accent-grad);
  color: #fff;
  padding: 16px 20px;
  border-radius: var(--radius);
  margin: 18px auto;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(255,122,24,0.4);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: next-part-glow 2.8s ease-in-out infinite;
}
.next-part-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(255,122,24,0.55);
  color: #fff;
}
.next-part-cta::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: translateX(-100%);
  animation: shine 2.5s ease-in-out infinite;
}
@keyframes shine {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}
@keyframes next-part-glow {
  0%, 100% { box-shadow: 0 8px 24px rgba(255,122,24,0.4); }
  50% { box-shadow: 0 10px 30px rgba(255,61,127,0.55); }
}
.next-part-cta .np-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.05rem;
}
.next-part-cta .np-sub {
  display: block; font-size: 0.75rem; font-weight: 500; opacity: 0.9; margin-top: 2px;
}
.next-part-cta .np-arrow {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.1rem; backdrop-filter: blur(4px);
  border: 2px solid rgba(255,255,255,0.3);
}
.next-part-cta.armed .np-arrow {
  background: #fff; color: var(--accent);
}
.next-part-cta.armed::after {
  content: "Click again"; position: absolute; top: 6px; right: 14px;
  background: #fff; color: var(--accent);
  font-size: 0.6rem; font-weight: 800; padding: 2px 8px;
  border-radius: 999px; letter-spacing: 0.5px;
  animation: bounce 0.6s ease infinite alternate;
}
@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-3px); }
}

/* All Parts card */
.all-parts {
  background: linear-gradient(135deg, var(--widget-bg), var(--widget-bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin: 16px auto;
}
.all-parts h3 {
  margin: 0 0 12px; color: var(--title); font-size: 1rem;
  text-align: center; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.all-parts .parts-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px;
}
.btn-part {
  display: block; text-align: center;
  background: var(--accent-grad);
  color: #fff; font-weight: 700; font-size: 0.9rem;
  padding: 11px 8px; border-radius: var(--radius-sm);
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 10px rgba(255,122,24,0.3);
}
.btn-part:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(255,122,24,0.5); color: #fff; }

.direct-link-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  text-align: center; margin: 14px auto;
  background: var(--accent-grad);
  color: #fff !important; font-weight: 700; font-size: 1rem;
  padding: 14px 22px; border-radius: 999px; text-decoration: none;
  box-shadow: 0 8px 24px rgba(255,122,24,0.4);
  max-width: 420px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.direct-link-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(255,122,24,0.55); color: #fff !important; }

/* Share bar */
.share-bar {
  display: flex; justify-content: center; gap: 10px; margin: 14px auto;
  flex-wrap: wrap;
}
.share-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--widget-bg); border: 1px solid var(--border);
  color: var(--text); font-size: 1.05rem;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; cursor: pointer;
  transition: all 0.2s;
}
.share-btn:hover { background: var(--accent-grad); color: #fff; border-color: transparent; transform: translateY(-2px); }
.share-btn.copy.copied { background: var(--success); color: #fff; }

/* Related reels on post page */
.related-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 16px;
}
@media (min-width: 540px) { .related-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 820px) { .related-grid { grid-template-columns: repeat(6, 1fr); } }

/* ================================================================
   Buttons / Forms
================================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent-grad); color: #fff; border: 0;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.95rem;
  cursor: pointer; text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 12px rgba(255,122,24,0.3);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(255,122,24,0.45); color: #fff; }
.btn:active { transform: translateY(0); }
.btn-secondary {
  background: var(--widget-bg); color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn-secondary:hover { background: var(--widget-bg-2); color: var(--title); box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #b91c1c); box-shadow: 0 4px 12px rgba(239,68,68,0.3); }
.btn-danger:hover { box-shadow: 0 6px 16px rgba(239,68,68,0.5); }
.btn-success { background: linear-gradient(135deg, #22c55e, #15803d); box-shadow: 0 4px 12px rgba(34,197,94,0.3); }
.btn-sm { padding: 7px 13px; font-size: 0.85rem; }
.btn-xs { padding: 5px 10px; font-size: 0.75rem; }

.card {
  background: linear-gradient(135deg, var(--widget-bg), var(--widget-bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin: 14px 0;
  box-shadow: var(--shadow-sm);
}

.form-row { margin-bottom: 16px; }
.form-row label {
  display: block; color: var(--title); font-weight: 600;
  margin-bottom: 7px; font-size: 0.9rem;
}
.form-row input, .form-row textarea, .form-row select {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 0.95rem; font-family: inherit;
  outline: none;
  transition: border 0.15s, box-shadow 0.15s;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,122,24,0.12);
}
.form-row textarea { min-height: 130px; resize: vertical; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 0.85rem; }
.form-row input[type="file"] { padding: 7px; cursor: pointer; }
.hint { color: var(--muted); font-size: 0.8rem; margin-top: 5px; line-height: 1.5; }
.hint code { background: rgba(255,255,255,0.07); padding: 1px 6px; border-radius: 4px; font-size: 0.8rem; }

.alert {
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 0.9rem;
}
.alert i { font-size: 1.1rem; }
.alert-error { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.4); color: #ffb4b4; }
.alert-success { background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.4); color: #bffcc9; }
.alert-info { background: rgba(255,122,24,0.08); border: 1px solid rgba(255,122,24,0.35); color: #ffd4ad; }

/* ================================================================
   Admin
================================================================ */
.admin-wrap { max-width: 1140px; margin: 0 auto; padding: 18px; }
.admin-top {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.admin-top h1 {
  color: var(--title); margin: 0; font-size: 1.4rem; font-weight: 800;
  display: flex; align-items: center; gap: 10px;
}
.admin-top h1 i {
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.admin-top .spacer { flex: 1; min-width: 10px; }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.stat-card {
  background: linear-gradient(135deg, var(--widget-bg), var(--widget-bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-card .label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .value {
  color: var(--title); font-size: 1.7rem; font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-card .sub { color: var(--muted-2); font-size: 0.75rem; }

/* Admin posts table (desktop) */
.posts-table {
  width: 100%; border-collapse: collapse;
  background: var(--widget-bg); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.posts-table th, .posts-table td {
  padding: 12px 14px; text-align: left;
  border-bottom: 1px solid var(--border); font-size: 0.9rem;
  vertical-align: middle;
}
.posts-table th {
  background: var(--widget-bg-2); color: var(--title);
  font-weight: 700; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.posts-table tr:last-child td { border-bottom: 0; }
.posts-table tr:hover { background: rgba(255,255,255,0.02); }
.posts-table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.posts-table img {
  width: 46px; height: 80px; object-fit: cover;
  border-radius: 8px; background: #1a1a2a;
  border: 1px solid var(--border);
}
.posts-table .thumb-placeholder {
  width: 46px; height: 80px; background: #1a1a2a; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); border: 1px solid var(--border);
}

/* Admin posts cards (mobile) */
.posts-cards { display: none; }
@media (max-width: 820px) {
  .posts-table { display: none; }
  .posts-cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
}
.post-admin-card {
  background: var(--widget-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
  display: flex; gap: 12px;
}
.post-admin-card .thumb {
  width: 64px; height: 110px; object-fit: cover; flex-shrink: 0;
  border-radius: 10px; background: #1a1a2a;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); border: 1px solid var(--border);
}
.post-admin-card .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.post-admin-card h4 {
  margin: 0; color: var(--title); font-size: 0.95rem; font-weight: 700;
  line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-admin-card .meta { color: var(--muted); font-size: 0.75rem; display: flex; gap: 10px; flex-wrap: wrap; }
.post-admin-card .actions { display: flex; gap: 6px; margin-top: auto; flex-wrap: wrap; }

/* Ads editor */
.ad-item {
  background: linear-gradient(135deg, var(--widget-bg), var(--widget-bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
.ad-item h4 { color: var(--title); margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.ad-item .meta { color: var(--muted); font-size: 0.78rem; margin-bottom: 10px; }
.ad-item .meta code { background: rgba(255,255,255,0.07); padding: 1px 6px; border-radius: 4px; }
.ad-item .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.toggle { display: inline-flex; align-items: center; gap: 10px; user-select: none; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track {
  width: 44px; height: 24px; background: #2a2a40;
  border-radius: 999px; position: relative;
  transition: background 0.2s;
}
.toggle .track::after {
  content: ""; width: 18px; height: 18px; background: #fff;
  border-radius: 50%;
  position: absolute; top: 3px; left: 3px;
  transition: left 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.toggle input:checked + .track { background: var(--accent-grad); }
.toggle input:checked + .track::after { left: 23px; }

/* ================================================================
   Thumbnail cropper (upload form)
================================================================ */
.thumb-upload {
  display: grid; grid-template-columns: 150px 1fr; gap: 14px;
  align-items: start;
}
@media (max-width: 540px) { .thumb-upload { grid-template-columns: 110px 1fr; } }

.thumb-preview {
  aspect-ratio: 9 / 16; width: 100%;
  background: var(--bg); border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); overflow: hidden;
  position: relative;
}
.thumb-preview img { width: 100%; height: 100%; object-fit: cover; }
.thumb-preview.has-image { border-style: solid; border-color: var(--accent); }
.thumb-preview .ratio-label {
  position: absolute; bottom: 4px; left: 4px;
  background: rgba(0,0,0,0.7); color: #fff;
  font-size: 0.65rem; padding: 2px 6px; border-radius: 4px;
}
.thumb-loading {
  position: absolute; inset: 0;
  background: rgba(6,6,13,0.85);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--accent); z-index: 5;
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(255,122,24,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================
   Bottom nav + back-to-top
================================================================ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(6,6,13,0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 40;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 0.68rem; font-weight: 600;
  padding: 4px 16px; min-width: 64px;
  transition: color 0.15s;
}
.nav-item i { font-size: 1.15rem; }
.nav-item.active {
  color: var(--accent);
  background: linear-gradient(180deg, transparent, rgba(255,122,24,0.08));
}
.nav-item:hover { color: var(--accent); }

@media (min-width: 900px) {
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
}

.back-to-top {
  position: fixed; bottom: 90px; right: 16px; z-index: 45;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--accent-grad); color: #fff; border: 0;
  display: none; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 6px 18px rgba(255,122,24,0.4);
  transition: transform 0.2s;
}
.back-to-top:hover { transform: translateY(-2px); }
.back-to-top.show { display: inline-flex; animation: fade-in 0.3s ease; }
@media (min-width: 900px) { .back-to-top { bottom: 24px; } }
@keyframes fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ================================================================
   Footer
================================================================ */
.site-footer {
  margin-top: 40px; padding: 24px 14px;
  border-top: 1px solid var(--border);
  color: var(--muted); text-align: center; font-size: 0.85rem;
  background: rgba(0,0,0,0.3);
}
.footer-inner { max-width: 1240px; margin: 0 auto; }
.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--accent); }

/* ================================================================
   Login / Setup
================================================================ */
.login-wrap { max-width: 400px; margin: 70px auto; padding: 0 14px; }
.login-wrap .card { padding: 28px; }
.login-wrap h1 {
  color: var(--title); text-align: center; margin: 0 0 22px;
  font-size: 1.5rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.login-wrap h1 i {
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ================================================================
   Empty / Pagination
================================================================ */
.empty-state {
  text-align: center; padding: 70px 20px; color: var(--muted);
}
.empty-state i { font-size: 3.5rem; margin-bottom: 16px; color: var(--border); }
.empty-state h3 { color: var(--title); margin: 0 0 10px; font-weight: 700; }

.pagination { display: flex; justify-content: center; gap: 8px; margin: 24px 0; }
.pagination a, .pagination span {
  padding: 9px 16px; border-radius: var(--radius-sm);
  background: var(--widget-bg); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-size: 0.9rem; font-weight: 600;
  transition: all 0.15s;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.pagination .current { background: var(--accent-grad); color: #fff; border-color: transparent; }
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* ================================================================
   Small helpers
================================================================ */
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-sm { margin-top: 8px; } .mt-md { margin-top: 16px; } .mt-lg { margin-top: 24px; }
.flex-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
