@font-face {
  font-family: 'AgencyGothic';
  src: url('/assets/agencygothicct_condensed.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

:root {
  --bg: #000000;
  --surface: #0c0c0c;
  --surface2: #141414;
  --border: #1f1f1f;
  --border2: #2a2a2a;
  --accent: #7c3aed;
  --accent2: #a855f7;
  --accent3: #c084fc;
  --text: #ffffff;
  --text2: #a0a0a0;
  --text3: #555555;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --card-glow: rgba(124, 58, 237, 0.25);
}

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

html {
  scroll-behavior: smooth;
  background: #000000;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }


/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 2rem;
  height: 60px;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-family: 'AgencyGothic', sans-serif;
  letter-spacing: 0.15em;
}

.nav-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* .nav-admin-link visibility is controlled by an inline <head> script — see each HTML page */

.nav-links a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 18px;
  border-radius: 8px;
  transition: all 0.2s;
  letter-spacing: 0.01em;
}

.nav-links a:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.07);
}

.nav-user-wrap {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  position: relative;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px 4px 4px;
  border-radius: 20px;
  border: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}

.nav-user:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.08);
}

.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.12);
  flex-shrink: 0;
}

.nav-avatar--initials {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.nav-username {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text2);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-login-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text2);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.nav-login-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.25);
  color: #fff;
}

.nav-user-caret {
  font-size: 0.55rem;
  color: var(--text3);
  margin-left: 2px;
  transition: transform 0.2s;
}

.nav-user-wrap.open .nav-user-caret {
  transform: rotate(180deg);
}

/* dropdown */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: #111;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top right;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 9999;
}

.nav-user-wrap.open .nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.nav-dd-profile {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.nav-dd-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.12);
  flex-shrink: 0;
}

.nav-dd-avatar--initials {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.nav-dd-info { min-width: 0; }

.nav-dd-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-dd-type {
  font-size: 0.68rem;
  color: var(--text3);
  margin-top: 2px;
  text-transform: capitalize;
}

.nav-dd-actions {
  border-top: 1px solid rgba(255,255,255,0.07);
}

.nav-dd-action {
  display: block;
  width: 100%;
  padding: 11px 16px;
  background: none;
  border: none;
  color: var(--text2);
  font-size: 0.82rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-dd-action:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.nav-dd-logout {
  display: block;
  width: 100%;
  padding: 11px 16px;
  background: none;
  border: none;
  color: #f87171;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.nav-dd-logout:hover {
  background: rgba(248,113,113,0.08);
}

/* ── PROFILE PAGE ── */
.profile-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 2rem 80px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 40px;
}

.profile-avatar-lg {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.12);
  flex-shrink: 0;
}

.profile-avatar-lg--initials {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.profile-hero-info { min-width: 0; }

.profile-display-name {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.profile-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.profile-email {
  font-size: 0.8rem;
  color: var(--text3);
  margin-top: 8px;
}

.profile-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 32px 0;
}

.profile-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
}

.profile-bio-input {
  width: 100%;
  min-height: 90px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.profile-bio-input:focus { border-color: rgba(255,255,255,0.18); }
.profile-bio-input::placeholder { color: var(--text3); }

.profile-name-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
  margin-bottom: 12px;
}

.profile-name-input:focus { border-color: rgba(255,255,255,0.18); }

.profile-save-btn {
  margin-top: 20px;
  background: #111 !important;
  color: #fff !important;
  box-shadow: none !important;
  transform: none !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  transition: background 0.18s, color 0.18s, border-color 0.18s !important;
}
.profile-save-btn:hover {
  background: #fff !important;
  color: #000 !important;
  border-color: #fff !important;
  box-shadow: none !important;
  transform: none !important;
}

.profile-saved-msg {
  font-size: 0.78rem;
  color: #4ade80;
  margin-top: 10px;
  display: none;
}

.profile-not-logged-in {
  text-align: center;
  padding: 80px 0;
  color: var(--text3);
}

.profile-not-logged-in a {
  color: var(--text2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── ROLE BADGES ── */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.role-badge--owner {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.3);
  color: #fbbf24;
}

.role-badge--creator {
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.25);
  color: #a78bfa;
}

.role-badge--member {
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  color: #4ade80;
}

.role-badge--discord {
  background: rgba(88,101,242,0.12);
  border: 1px solid rgba(88,101,242,0.25);
  color: #818cf8;
}

.role-badge--google {
  background: rgba(234,67,53,0.1);
  border: 1px solid rgba(234,67,53,0.2);
  color: #f87171;
}

.role-badge--email {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text3);
}

.role-dd {
  position: relative;
  display: inline-block;
}

.role-dd-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.role-dd-caret {
  font-size: 0.6rem;
  color: var(--text3);
  transition: transform 0.15s;
}

.role-dd.open .role-dd-caret { transform: rotate(180deg); }

.role-dd-menu {
  position: fixed;
  min-width: 120px;
  background: #161616;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0,0,0,1), 0 0 0 1px rgba(255,255,255,0.04);
  transition: opacity 0.12s;
  z-index: 9999;
}

.role-dd-menu.open {
  opacity: 1;
  pointer-events: auto;
}

.role-dd-item {
  padding: 9px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.role-dd-item:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}


.sidebar-link--owner {
  color: rgba(255,255,255,0.75) !important;
}
.sidebar-link--owner:hover {
  color: #fff !important;
  background: rgba(255,255,255,0.07);
}

.nav-links a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(124, 58, 237, 0.5);
}

#editModalSave {
  background: #111;
  color: #fff;
  box-shadow: none;
  border: 1px solid rgba(255,255,255,0.12);
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

#editModalSave:hover:not(:disabled) {
  background: #fff;
  color: #111;
  border-color: #fff;
  transform: none;
  box-shadow: none;
}

.btn-upload {
  background: #000;
  color: #fff;
  border: 2px solid #000;
  margin-top: 16px;
  width: 100%;
}

.btn-upload:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent3);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
  border-radius: 12px;
}

/* ── HERO ── */
.hero {
  position: relative;
  text-align: center;
  padding: 80px 2rem 60px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 420px;
  background: radial-gradient(ellipse, rgba(124, 58, 237, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 40%, var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text2);
  max-width: 480px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-search {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.hero-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 18px;
  pointer-events: none;
}

.hero-search input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px 20px 14px 46px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s, background 0.2s;
  font-family: inherit;
}

.hero-search input:focus {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
}

.hero-search input::placeholder {
  color: var(--text3);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
}

.stat {
  text-align: center;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent2), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

/* ── FILTERS ── */
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 2rem 32px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.8rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 4px;
}

.filter-btn {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent3);
}

.filter-btn.active {
  background: rgba(124, 58, 237, 0.2);
  border-color: var(--accent);
  color: var(--accent3);
}

.search-box {
  margin-left: auto;
  position: relative;
}

.search-box input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 16px 8px 36px;
  color: var(--text);
  font-size: 0.875rem;
  width: 220px;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--accent);
}

.search-box input::placeholder {
  color: var(--text3);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 14px;
}

/* ── GRID ── */
.grid-section {
  padding: 0 2rem 80px;
}

.grid-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  min-height: 400px;
  align-content: start;
}

/* ── 3D CARD ── */
.card-wrapper {
  perspective: 900px;
}

.scenepack-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.1s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  text-decoration: none;
  display: block;
}

.scenepack-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow:
    -18px 0 40px -8px rgba(255, 255, 255, 0.12),
     18px 0 40px -8px rgba(255, 255, 255, 0.12),
    0 24px 64px rgba(0, 0, 0, 0.8);
}

.card-shine {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.07), transparent 55%);
  z-index: 10;
}

.scenepack-card:hover .card-shine {
  opacity: 1;
}

/* ── POSTER THUMBNAIL ── */
.card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: #0a0a0a;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.scenepack-card:hover .card-thumb img {
  transform: scale(1.06);
}

.card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  background: linear-gradient(160deg, #111 0%, #0a0a0a 100%);
}

/* poster gradient — title lives here */
.card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.3) 40%, transparent 65%);
  pointer-events: none;
}

/* text block sitting over the bottom gradient */
.card-overlay-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  padding: 12px 12px 12px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.scenepack-card:hover .card-overlay-text {
  opacity: 1;
  transform: translateY(0);
}

.card-overlay-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-overlay-tagline {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
}

.card-overlay-packs {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.4);
  margin-top: 5px;
  letter-spacing: 0.03em;
}

/* keep badge styles for the download page */
.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  backdrop-filter: blur(12px);
}

.badge-new {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-hot {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-featured {
  background: rgba(124, 58, 237, 0.2);
  color: var(--accent3);
  border: 1px solid rgba(124, 58, 237, 0.3);
}

.tag {
  padding: 2px 7px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.65rem;
  color: var(--text3);
  letter-spacing: 0.03em;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
  grid-column: 1 / -1;
  width: 100%;
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--text2);
}

.empty-state span {
  font-size: 0.875rem;
}

/* ── DOWNLOAD PAGE v2 ── */
.download-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text3);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s;
  font-weight: 500;
}
.download-back:hover { color: var(--text); }

/* HERO */
.dlv2-hero {
  position: relative;
  overflow: hidden;
  padding-bottom: 0;
}

.dlv2-hero-bg {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center top;
  filter: blur(70px) brightness(0.12) saturate(0.5);
}

.dlv2-hero-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 160px;
  background: linear-gradient(to bottom, transparent, #000);
  pointer-events: none;
  z-index: 1;
}

.dlv2-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 2rem 56px;
}

.dlv2-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  margin-bottom: 32px;
  transition: color 0.2s;
}
.dlv2-back:hover { color: rgba(255,255,255,0.7); }

.dlv2-hero-content {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.dlv2-poster-wrap { flex-shrink: 0; }

.dlv2-poster {
  width: 160px;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
}

.dlv2-poster--empty {
  background: #0a0a0a;
  border: 1px solid var(--border);
}

.dlv2-info {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.dlv2-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.dlv2-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text2);
}

.dlv2-pill--star {
  background: rgba(1,180,228,0.08);
  border-color: rgba(1,180,228,0.2);
  color: #e0f7ff;
}
.dlv2-pill--rawg {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.15);
  color: #fff;
}

.dlv2-pill--tag {
  background: rgba(124,58,237,0.1);
  border-color: rgba(124,58,237,0.2);
  color: var(--accent3);
}

.dlv2-title {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.dlv2-tagline {
  font-size: 0.95rem;
  color: var(--text3);
  font-style: italic;
  margin-bottom: 12px;
}

.dlv2-desc {
  font-size: 0.875rem;
  color: var(--text2);
  line-height: 1.75;
  margin-bottom: 20px;
  max-width: 540px;
}

.dlv2-cast {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.dlv2-cast-label {
  font-size: 0.68rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-right: 2px;
}

.dlv2-cast-name {
  font-size: 0.75rem;
  padding: 3px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  color: var(--text2);
}

.dlv2-filesize {
  font-size: 0.75rem;
  color: var(--text3);
  margin-top: 4px;
}

/* DOWNLOADS SECTION */
.dlv2-section {
  background: #000;
  padding: 48px 0 64px;
}

.dlv2-section-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
}

.dlv2-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.dlv2-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 3px;
}

.dlv2-section-sub {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.dlv2-copy-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  overflow: hidden;
}
.dlv2-copy-btn:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.35);
  color: #fff;
}
.dlv2-copy-link-icon {
  filter: brightness(0) invert(0.6);
  transition: filter 0.15s, opacity 0.15s;
}
.dlv2-copy-btn:hover .dlv2-copy-link-icon {
  filter: brightness(0) invert(1);
}
.dlv2-copy-check {
  display: none;
  position: absolute;
  inset: 0;
  margin: auto;
  color: #fff;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
}
.dlv2-copy-btn.copied {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.4);
}
.dlv2-copy-btn.copied .dlv2-copy-link-icon {
  opacity: 0;
}
.dlv2-copy-btn.copied .dlv2-copy-check {
  display: block;
  animation: dlv2-check-pop 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards,
             dlv2-check-draw 0.3s 0.05s ease forwards;
}
@keyframes dlv2-check-pop {
  0%   { transform: scale(0); }
  100% { transform: scale(1); }
}
@keyframes dlv2-check-draw {
  from { stroke-dashoffset: 30; }
  to   { stroke-dashoffset: 0; }
}

.dlv2-search-wrap {
  position: relative;
  flex-shrink: 0;
}

.dlv2-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 15px;
  pointer-events: none;
}

.dlv2-search {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 9px 14px 9px 36px;
  color: var(--text);
  font-size: 0.825rem;
  outline: none;
  font-family: inherit;
  width: 220px;
  transition: border-color 0.2s;
}

.dlv2-search:focus { border-color: rgba(255,255,255,0.15); }
.dlv2-search::placeholder { color: var(--text3); }

.dlv2-links {
  border-top: 1px solid rgba(255,255,255,0.07);
}

.dlv2-link-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: default;
}


.dlv2-link-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 0.05em;
  width: 28px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

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

.dlv2-link-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dlv2-link-sub {
  font-size: 0.72rem;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.dlv2-encoder-badge {
  color: rgba(255,255,255,0.9);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s;
  flex-shrink: 0;
}
.dlv2-encoder-badge:hover {
  color: #fff;
}

.dlv2-dl-btn {
  padding: 8px 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s;
  flex-shrink: 0;
  font-family: inherit;
}

.dlv2-dl-btn:hover {
  background: #fff;
  border-color: #fff;
  color: #000;
}

@media (max-width: 600px) {
  .dlv2-link-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .dlv2-link-body {
    width: 0; /* forces min-width: 0 to kick in with flex-wrap */
  }
  .dlv2-link-name {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
  .dlv2-link-sub {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
  .dlv2-dl-btn {
    margin-left: auto;
  }
}

.dlv2-empty {
  padding: 40px 0;
  color: var(--text3);
  font-size: 0.875rem;
  text-align: center;
}

/* RELATED */
.dlv2-related {
  padding: 0 0 72px;
}

@media (max-width: 700px) {
  .dlv2-hero-content { flex-direction: column; }
  .dlv2-poster { width: 120px; }
  .dlv2-section-header { flex-direction: column; align-items: flex-start; }
  .dlv2-search { width: 100%; }
}

/* ── ADMIN ── */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 60px);
}

.admin-sidebar {
  background: rgba(255,255,255,0.02);
  border-right: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
  padding: 24px 0 80px;
  position: relative;
}

.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-label {
  font-size: 0.68rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0 20px;
  margin-bottom: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--text3);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.15s;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  margin: 1px 8px;
  border-radius: 8px;
}

.sidebar-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.07);
}

.sidebar-link.active {
  color: #fff;
  background: rgba(255,255,255,0.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.sidebar-link--action {
  color: rgba(255,255,255,0.75);
}

.sidebar-link--action:hover {
  color: #fff;
  background: rgba(255,255,255,0.07);
}

.admin-main {
  padding: 32px;
  overflow-y: auto;
}

.admin-packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 14px;
}

.admin-pack-card {
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 2/3;
  background: #111;
  cursor: pointer;
}

.admin-pack-card:hover .admin-pack-overlay { opacity: 1; }

.admin-pack-cover {
  position: absolute;
  inset: 0;
}

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

.admin-pack-cover-empty {
  width: 100%;
  height: 100%;
  background: #1a1a1a;
}

.admin-pack-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.5) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
  opacity: 0;
  transition: opacity 0.2s;
}

.admin-pack-card:not(:hover) .admin-pack-overlay {
  opacity: 1;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%);
}

.admin-pack-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s;
}

.admin-pack-card:hover .admin-pack-actions {
  opacity: 1;
  transform: translateY(0);
}

.admin-pack-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 6px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.admin-pack-btn {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(30,30,30,0.85);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.admin-pack-btn:hover { background: rgba(60,60,60,0.95); border-color: rgba(255,255,255,0.45); }
.admin-pack-btn--danger { border-color: rgba(248,113,113,0.35); color: #fca5a5; }
.admin-pack-btn--danger:hover { background: rgba(127,29,29,0.6); border-color: rgba(248,113,113,0.6); }

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

.admin-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-header p {
  color: var(--text2);
  font-size: 0.875rem;
  margin-top: 4px;
}

/* ── GLASS PANEL (replaces admin-table-wrap) ── */
.glass-panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  margin-bottom: 20px;
  backdrop-filter: blur(12px);
}

.glass-panel--overflow-hidden {
  overflow: hidden;
}

.glass-panel--danger {
  border-color: rgba(239,68,68,0.18);
  background: rgba(239,68,68,0.04);
}

.glass-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.glass-panel-header h2 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

/* ── STATS CARDS ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  border-radius: 14px;
  padding: 20px;
}

.stat-card.glass {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(16px);
  transition: background 0.2s, border-color 0.2s;
}

.stat-card.glass:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
}

.stat-card-label {
  font-size: 0.7rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
}

.stat-card-sub {
  font-size: 0.75rem;
  color: var(--success);
  margin-top: 4px;
}

/* ── TABLE ── */
.admin-table-wrap {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 32px;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.table-header h2 {
  font-size: 1rem;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 12px 24px;
  font-size: 0.7rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

tbody td {
  padding: 14px 24px;
  font-size: 0.875rem;
  color: var(--text2);
  vertical-align: middle;
}

tbody td:first-child {
  color: var(--text);
}

.td-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: #0d0d0d;
  border: 1px solid var(--border2);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-in 0.2s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.modal-close:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.modal-body {
  padding: 0 24px 24px;
}

/* ── FORM ── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: rgba(255,255,255,0.6);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.08);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text3);
}

.form-select option {
  background: var(--surface2);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text3);
  margin-top: 4px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ── TOAST ── */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toast-in 0.3s ease;
  pointer-events: auto;
  min-width: 240px;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
.toast-title { font-weight: 600; font-size: 0.875rem; }
.toast-sub { font-size: 0.775rem; color: var(--text2); margin-top: 2px; }

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent); }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 2rem;
  text-align: center;
  color: var(--text3);
  font-size: 0.8rem;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    display: none;
  }
  .download-info {
    grid-template-columns: 1fr;
  }
  .download-details {
    min-width: unset;
  }
  .hero-stats {
    gap: 24px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ── ANIMATIONS ── */
.fade-in {
  animation: fade-in 0.4s ease forwards;
}

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

.card-wrapper {
  animation: fade-in 0.4s ease forwards;
  opacity: 0;
}

.no-anim .card-wrapper {
  animation: none;
  opacity: 1;
}

.card-wrapper:nth-child(1) { animation-delay: 0.05s; }
.card-wrapper:nth-child(2) { animation-delay: 0.1s; }
.card-wrapper:nth-child(3) { animation-delay: 0.15s; }
.card-wrapper:nth-child(4) { animation-delay: 0.2s; }
.card-wrapper:nth-child(5) { animation-delay: 0.25s; }
.card-wrapper:nth-child(6) { animation-delay: 0.3s; }
.card-wrapper:nth-child(7) { animation-delay: 0.35s; }
.card-wrapper:nth-child(8) { animation-delay: 0.4s; }

/* ── UPLOAD DROPZONE ── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text3);
  font-size: 0.875rem;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: rgba(124, 58, 237, 0.05);
  color: var(--accent3);
}

.dropzone-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  opacity: 0.5;
}

/* ── FORM PAGE LAYOUT ── */
.form-page-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  align-items: start;
}

.form-page-left {
  min-width: 0;
}

.form-page-right {
  position: sticky;
  top: 80px;
}

.form-section {
  margin-bottom: 4px;
}

.form-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.poster-preview {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0a0a;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.poster-preview:hover {
  border-color: rgba(255,255,255,0.6);
  box-shadow: 0 0 18px rgba(255,255,255,0.15);
}

.poster-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}

.poster-preview-empty span {
  font-size: 3rem;
  opacity: 0.3;
}

.poster-preview-empty p {
  font-size: 0.78rem;
  color: var(--text3);
  line-height: 1.5;
}

@media (max-width: 860px) {
  .form-page-layout {
    grid-template-columns: 1fr;
  }
  .form-page-right {
    position: static;
    max-width: 240px;
  }
}

/* ── TMDB AUTOFILL ── */
#tmdbSearchGroup {
  position: relative;
}

.tmdb-search-wrap {
  position: relative;
}

.af-type-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text3);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.af-type-btn:hover { border-color: rgba(255,255,255,0.5); color: var(--text1); }
.af-type-btn.active { background: #000; border-color: rgba(255,255,255,0.7); color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.12); }

.tmdb-spinner {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent2);
  border-radius: 50%;
  display: none;
}

.tmdb-spinner.active {
  display: block;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

.tmdb-dropdown {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  background: #0d0d0d;
  border: 1px solid var(--border2);
  border-radius: 10px;
  overflow: hidden;
  z-index: 200;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}

.tmdb-dropdown.open {
  display: block;
}

.tmdb-result-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.tmdb-result-row:hover {
  background: var(--surface2);
}

.tmdb-result-poster {
  width: 26px;
  height: 39px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

.tmdb-result-poster--empty {
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.tmdb-result-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.tmdb-result-sub {
  font-size: 0.7rem;
  color: var(--text3);
  margin-top: 1px;
}

.tmdb-no-results {
  padding: 16px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text3);
}


.form-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ── BADGE COUNT ── */
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  margin-left: 6px;
}

/* ── LOGIN PAGE ── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-wrap {
  width: 100%;
  max-width: 400px;
}

.login-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 40px 36px;
  backdrop-filter: blur(20px);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 28px;
}

.login-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.login-sub {
  font-size: 0.875rem;
  color: var(--text3);
  margin-bottom: 28px;
}

.login-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.825rem;
  color: #fca5a5;
  margin-bottom: 20px;
  line-height: 1.5;
}

.login-socials {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.login-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.login-social-btn:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.18);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--text3);
  font-size: 0.75rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.07);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.login-submit {
  width: 100%;
  justify-content: center;
  margin-top: 20px;
  padding: 12px;
  font-size: 0.9rem;
}

/* ── SIDEBAR FOOTER ── */
.sidebar-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user {
  font-size: 0.78rem;
  color: var(--text3);
  padding: 0 8px;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout {
  width: 100%;
  padding: 8px 12px;
  background: rgba(239,68,68,0.07);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-align: left;
}

.sidebar-logout:hover {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.3);
}

/* ── GHOST BUTTON ── */
.btn-ghost {
  background: rgba(255,255,255,0.04);
  color: var(--text2);
  border: 1px solid rgba(255,255,255,0.08);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border-color: rgba(255,255,255,0.14);
}

/* ── MODAL GLASS ── */
.modal.glass {
  background: rgba(10,10,10,0.85);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(24px);
}

.edit-modal {
  max-width: 860px;
  width: 100%;
}

.edit-modal-body {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 16px;
  padding: 0 24px 8px;
  overflow-y: auto;
  max-height: calc(90vh - 130px);
}

.edit-modal-left { min-width: 0; }

.edit-modal-right {
  position: sticky;
  top: 0;
  align-self: start;
}

/* ── DOWNLOAD LINKS LIST ── */
.link-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  margin-bottom: 8px;
  transition: background 0.15s, border-color 0.15s;
  cursor: grab;
}

.link-row-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.link-row-top,
.link-row-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.link-row:active {
  cursor: grabbing;
}

.link-row.dragging {
  opacity: 0.5;
}

.link-row.drag-over {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.06);
}

.link-row-drag {
  color: var(--text3);
  font-size: 14px;
  line-height: 1;
  cursor: grab;
  padding: 6px 2px 0;
  flex-shrink: 0;
  user-select: none;
}

.link-row-actions {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  flex-shrink: 0;
  padding-top: 4px;
}

.link-move-btn {
  width: 26px;
  height: 26px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  color: var(--text3);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.link-move-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

.link-remove-btn {
  width: 26px;
  height: 26px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 6px;
  color: var(--danger);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  line-height: 1;
}

.link-remove-btn:hover {
  background: rgba(239,68,68,0.2);
}

/* download page multi-link buttons */
.download-links-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.download-link-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
}

.download-link-btn:hover {
  background: rgba(124,58,237,0.12);
  border-color: rgba(124,58,237,0.3);
  transform: translateY(-1px);
}

.download-link-btn .link-arrow {
  color: var(--text3);
  font-size: 18px;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.download-link-btn:hover .link-arrow {
  transform: translateX(3px);
  color: var(--accent3);
}

.download-link-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.download-link-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.download-link-meta {
  font-size: 0.75rem;
  color: var(--text3);
  font-weight: 400;
}

/* ── WEBSITE STATUS BUTTONS (admin) ── */
.status-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: var(--text2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.status-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}
.status-btn:active { transform: scale(0.97); }
.status-btn.active {
  color: #fff;
  background: color-mix(in srgb, var(--c) 18%, transparent);
  border-color: var(--c);
}
.status-btn:disabled { opacity: 0.5; cursor: default; }
