:root {
  --bg: #0a0a10;
  --surface: #15151f;
  --surface-2: #1e1e2b;
  --border: #2a2a3a;
  --text: #f4f4f6;
  --muted: #9aa0ae;
  --accent: #e50914;
  --accent-hover: #ff1f2c;
  --radius: 10px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

img { display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.85rem; }

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 16px 4%;
  transition: background 0.3s ease;
}
.navbar.scrolled {
  background: rgba(10, 10, 16, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.logo {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent);
  white-space: nowrap;
}
.logo span { color: var(--text); }
.logo-mark {
  height: 32px;
  width: auto;
  display: block;
}
.logo-text {
  color: var(--text);
}
.logo-text small,
.setup-logo small {
  font-size: 0.55em;
  font-weight: 700;
  letter-spacing: 0.5px;
  vertical-align: baseline;
}

.nav-links {
  display: flex;
  gap: 22px;
  flex: 1;
}
.nav-links a {
  font-size: 0.92rem;
  color: #d5d7de;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active { font-weight: 700; }

.nav-burger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  padding: 6px;
  flex-shrink: 0;
}
.nav-burger svg { width: 24px; height: 24px; }

.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid transparent;
  border-radius: 24px;
  padding: 7px 14px;
  transition: border-color 0.2s, background 0.2s;
}
.nav-search:focus-within {
  border-color: var(--muted);
  background: rgba(0, 0, 0, 0.6);
}
.nav-search svg { width: 17px; height: 17px; color: var(--muted); flex-shrink: 0; }
.nav-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.9rem;
  width: 170px;
  font-family: inherit;
}
.nav-search input::placeholder { color: var(--muted); }

.avatar {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 7px;
  background: linear-gradient(135deg, #6c5ce7, #e50914);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  flex-shrink: 0;
  color: #fff;
  font-family: inherit;
}

.profile-gate {
  position: fixed;
  inset: 0;
  z-index: 240;
  background: radial-gradient(circle at 50% 25%, #17172a, var(--bg) 70%);
  display: grid;
  place-items: center;
  overflow-y: auto;
}
.gate-inner {
  text-align: center;
  padding: 40px 20px;
  width: min(760px, 100%);
}
.gate-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 40px;
}
.profile-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  justify-content: center;
  margin-bottom: 36px;
}
.profile-item {
  background: none;
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-family: inherit;
  width: 104px;
}
.profile-box {
  width: 104px;
  height: 104px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  position: relative;
  outline: 3px solid transparent;
  outline-offset: 3px;
  transition: transform 0.2s ease, outline-color 0.2s ease;
}
.profile-initial {
  font-size: 2.3rem;
  font-weight: 800;
  color: #fff;
}
.profile-item:hover .profile-box {
  transform: scale(1.07);
  outline-color: #fff;
}
.profile-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s;
}
.profile-item:hover .profile-label { color: var(--text); }
.add-tile .profile-box {
  background: transparent !important;
  border: 2px dashed var(--border);
  color: var(--muted);
}
.add-tile:hover .profile-box {
  border-color: #fff;
  color: #fff;
}
.add-tile .profile-initial { font-size: 1.9rem; }
.profile-delete {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  color: #fff;
  font-size: 0.72rem;
  display: none;
  place-items: center;
  line-height: 1;
}
.gate-editing .profile-delete { display: grid; }
.gate-manage { margin-top: 4px; }

.add-profile-panel {
  width: min(420px, 92vw);
  margin: 26px auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  text-align: left;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.add-profile-panel h2 { margin-bottom: 18px; }
#new-profile-name,
#editor-name {
  display: block;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  margin-bottom: 22px;
  box-sizing: border-box;
}
#new-profile-name:focus,
#editor-name:focus { border-color: var(--accent); }
.swatch-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.swatch {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  outline: 3px solid transparent;
  outline-offset: 2px;
  transition: transform 0.15s ease, outline-color 0.15s ease;
}
.swatch.active { outline-color: #fff; }
.swatch:hover { transform: scale(1.12); }
.panel-actions { display: flex; gap: 10px; }
.panel-actions .btn {
  flex: 1;
  justify-content: center;
  padding: 10px 18px;
}

.hero {
  position: relative;
  height: min(88vh, 800px);
  min-height: 520px;
  overflow: hidden;
}
.hero-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 12%;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.1s ease, transform 9s ease-out;
}
.hero-backdrop.visible { opacity: 1; transform: scale(1); }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--bg) 2%, rgba(10, 10, 16, 0.15) 42%, rgba(10, 10, 16, 0.55) 100%),
    linear-gradient(to right, rgba(10, 10, 16, 0.88) 0%, rgba(10, 10, 16, 0.25) 55%, transparent 80%);
}
.hero-content {
  position: absolute;
  z-index: 2;
  left: 4%;
  bottom: 18%;
  max-width: 640px;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  font-size: 0.95rem;
}
.hero-type-badge {
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.72rem;
  letter-spacing: 2px;
  font-weight: 700;
}
.hero-rating { color: #ffd166; font-weight: 600; }
.hero-title {
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.08;
  margin-bottom: 16px;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}
.hero-overview {
  color: #d9dbe2;
  font-size: 1rem;
  line-height: 1.6;
  max-width: 540px;
  margin-bottom: 26px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: none;
  border-radius: var(--radius);
  padding: 11px 26px;
  font-size: 0.98rem;
  font-weight: 700;
  transition: background 0.2s, transform 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 19px; height: 19px; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-ghost { background: rgba(109, 109, 128, 0.45); color: #fff; backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(109, 109, 128, 0.65); }

.hero-dots {
  position: absolute;
  z-index: 3;
  right: 4%;
  bottom: 20%;
  display: flex;
  gap: 8px;
}
.hero-dot {
  width: 26px;
  height: 4px;
  border-radius: 3px;
  border: none;
  background: rgba(255, 255, 255, 0.25);
  transition: background 0.3s;
}
.hero-dot.active { background: var(--accent); }

.rows {
  position: relative;
  z-index: 5;
  margin-top: -110px;
  display: flex;
  flex-direction: column;
  gap: 44px;
  padding-bottom: 60px;
}
.rows.no-hero { margin-top: 0; }

.row-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 4%;
  margin-bottom: 12px;
}
.row-title { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.2px; }
.row-count { color: var(--muted); font-size: 0.8rem; }

.row-body { position: relative; }
.row-scroller {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 8px 4%;
  scrollbar-width: none;
}
.row-scroller::-webkit-scrollbar { display: none; }

.row-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 52px;
  border: none;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(10, 10, 16, 0.55);
  color: #fff;
  opacity: 0;
  transition: opacity 0.25s, background 0.2s;
}
.row-nav svg { width: 26px; height: 26px; }
.row-nav.prev { left: 0; border-radius: 0 var(--radius) var(--radius) 0; }
.row-nav.next { right: 0; border-radius: var(--radius) 0 0 var(--radius); }
.row-nav:hover { opacity: 1; background: rgba(10, 10, 16, 0.75); }
.row-body:hover .row-nav { opacity: 0.85; }

.card {
  position: relative;
  flex-shrink: 0;
  width: 185px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  z-index: 5;
}
.card-poster {
  aspect-ratio: 2 / 3;
  width: 100%;
  object-fit: cover;
  background: var(--surface-2);
}
.card-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 10px 9px;
  background: linear-gradient(to top, rgba(5, 5, 10, 0.96) 30%, transparent);
}
.card-title {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-size: 0.72rem;
  color: var(--muted);
}
.card-rating { color: #ffd166; font-weight: 600; }

.bookmark-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(10, 10, 16, 0.65);
  backdrop-filter: blur(6px);
  color: #fff;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  z-index: 6;
}
.card:hover .bookmark-btn { opacity: 1; }
.bookmark-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.bookmark-btn:hover { background: var(--accent); }
.bookmark-btn.active { background: var(--accent); }
.bookmark-btn.active svg { fill: currentColor; }

.skeleton-card {
  flex-shrink: 0;
  width: 185px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface) 40%, var(--surface-2) 50%, var(--surface) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}

.discover-view { padding: 130px 4% 60px; min-height: 100vh; }
.discover-filterbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.discover-filterbar select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
  min-width: 150px;
}
.discover-filterbar select:focus { border-color: var(--accent); }
.discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px;
}
.discover-grid .card { width: auto; }
.discover-load-wrap {
  display: flex;
  justify-content: center;
  margin-top: 34px;
}

.search-results { padding: 120px 4% 60px; min-height: 100vh; }
.results-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; }
.results-sub { color: var(--muted); margin-bottom: 28px; }
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px;
}
.results-grid .card { width: auto; }
.empty-state {
  padding: 90px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state h2 { color: var(--text); margin-bottom: 10px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 4, 8, 0.78);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fadeIn 0.25s ease;
}
.modal {
  width: min(880px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  scrollbar-width: thin;
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.94) translateY(16px); } }

.modal-hero {
  position: relative;
  aspect-ratio: 16 / 8.2;
  background: var(--surface-2) center / cover no-repeat;
}
.modal-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--surface) 0%, transparent 55%),
              linear-gradient(to right, rgba(21, 21, 31, 0.5), transparent 50%);
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(10, 10, 16, 0.75);
  color: #fff;
  font-size: 1.05rem;
  display: grid;
  place-items: center;
  z-index: 5;
  transition: background 0.2s;
}
.modal-close:hover { background: var(--accent); }
.modal-trailer {
  position: absolute;
  inset: 0;
  z-index: 4;
}
.modal-trailer iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.modal-body { padding: 26px 34px 36px; }
.modal-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.modal-title { font-size: 1.9rem; font-weight: 800; line-height: 1.15; }
.modal-tagline { color: var(--muted); font-style: italic; margin-top: 5px; font-size: 0.95rem; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.modal-facts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 18px;
  font-size: 0.9rem;
  color: #d5d7de;
}
.fact-rating { color: #ffd166; font-weight: 700; }
.match { color: #46d369; font-weight: 700; }
.fact-border { border: 1px solid var(--border); border-radius: 4px; padding: 1px 7px; font-size: 0.75rem; color: var(--muted); }

.genre-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.genre-pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 0.78rem;
  color: #d5d7de;
}

.modal-section-title {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 30px 0 14px;
}
.cast-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 14px;
}
.cast-item { text-align: center; }
.cast-photo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 8px;
  background: var(--surface-2);
  border: 2px solid var(--border);
}
.cast-name { font-size: 0.78rem; font-weight: 600; }
.cast-role { font-size: 0.7rem; color: var(--muted); }

.similar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.similar-grid .card { width: auto; }
.similar-grid .card-info { display: none; }
.similar-grid .card:hover .card-info { display: block; }

.footer {
  padding: 40px 4% 46px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: #cfd2da;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setup-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: radial-gradient(circle at 20% 10%, #17172a, var(--bg) 60%);
  display: grid;
  place-items: center;
  padding: 20px;
}
.setup-panel {
  width: min(520px, 94vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 38px 36px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}
.setup-panel h1 { font-size: 1.5rem; margin-bottom: 12px; }
.setup-panel p { color: #cfd2da; font-size: 0.93rem; line-height: 1.55; margin-bottom: 16px; }
.setup-panel a { color: var(--accent-hover); font-weight: 600; }
.setup-logo {
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 22px;
}
.setup-logo span { color: var(--text); }
.setup-logo-mark { height: 28px; width: auto; display: block; }
.setup-steps {
  margin: 0 0 22px 18px;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.8;
}
#api-key-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  padding: 12px 14px;
  outline: none;
  margin-bottom: 14px;
}
#api-key-input:focus { border-color: var(--accent); }
#api-key-save { width: 100%; justify-content: center; }
.setup-error { color: #ff6b73 !important; font-weight: 600; }

#toast-root {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px); }
}

#messageArea {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 500;
  background: rgba(21, 21, 31, 0.92);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  display: none;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}
#messageArea:not(:empty) { display: block; }

.ep-picker { display: flex; gap: 8px; align-items: center; }
.ep-picker select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
}
.ep-picker select:focus { border-color: var(--accent); }

.card-progress {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 52px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
  z-index: 4;
}
.card-progress span { display: block; height: 100%; background: var(--accent); }

.avatar-wrap { position: relative; }
.avatar-menu {
  position: absolute;
  top: 46px;
  right: 0;
  width: 210px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  z-index: 150;
}
.avatar-menu-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.avatar-menu-head strong { display: block; font-size: 0.9rem; }
.avatar-menu-head span { font-size: 0.74rem; color: var(--muted); }
.avatar-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: #d5d7de;
  padding: 11px 14px;
  font-size: 0.87rem;
  font-family: inherit;
  cursor: pointer;
}
.avatar-menu button:hover { background: var(--surface-2); color: #fff; }
#menu-signout:hover { background: rgba(229, 9, 20, 0.3); }

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 260;
  background: radial-gradient(circle at 50% 20%, #17172a, var(--bg) 65%);
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}
.auth-panel {
  width: min(420px, 94vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
}
.auth-tabs {
  display: flex;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
}
.auth-tabs button {
  flex: 1;
  background: none;
  border: none;
  color: var(--muted);
  padding: 9px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
}
.auth-tabs button.active { background: var(--accent); color: #fff; }
.auth-screen form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-screen input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 11px 13px;
  font-family: inherit;
  font-size: 0.93rem;
  outline: none;
}
.auth-screen input:focus { border-color: var(--accent); }
.auth-error {
  color: #ff6b73;
  font-weight: 600;
  font-size: 0.83rem;
  margin: 0;
}
.guest-link {
  display: block;
  margin: 18px auto 0;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.guest-link:hover { color: #fff; }
.auth-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.73rem;
  margin-top: 16px;
  line-height: 1.5;
}

.verify-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 6px; }
.verify-sub {
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.5;
  margin-bottom: 16px;
}
.demo-email {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 18px;
}
.demo-email-head {
  padding: 9px 13px;
  font-size: 0.76rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.demo-email-body {
  padding: 14px 16px 18px;
  font-size: 0.88rem;
  color: #d5d7de;
  line-height: 1.55;
}
.demo-email-body p { margin-bottom: 8px; }
.code-big {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 10px;
  color: var(--text);
  text-align: center;
  padding: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}
.code-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 14px;
}
.code-box {
  width: 44px;
  height: 52px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-align: center;
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: 700;
  outline: none;
  transition: border-color 0.15s;
}
.code-box:focus { border-color: var(--accent); }
#form-verify .btn-accent { width: 100%; justify-content: center; }
.verify-links {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
}
.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: #fff; }

.track-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}
.track-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.track-pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.track-pill:hover { color: #fff; border-color: var(--muted); }
.track-pill.active {
  border-color: var(--accent);
  color: #fff;
  background: rgba(229, 9, 20, 0.2);
}
.star-rating { display: flex; gap: 2px; }
.star {
  background: none;
  border: none;
  color: #3d3d4f;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 1px;
  transition: transform 0.12s, color 0.12s;
}
.star:hover { transform: scale(1.25); }
.star.filled { color: #ffd166; }

.view-tabs {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}
.view-tabs button {
  background: none;
  border: none;
  color: var(--muted);
  padding: 8px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
}
.view-tabs button:hover { color: #fff; }
.view-tabs button.active { background: var(--accent); color: #fff; }

.tracking-section { margin-bottom: 36px; }
.tracking-section h3 {
  font-size: 1.05rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.count-chip {
  background: var(--surface-2);
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 2px 10px;
  color: var(--muted);
  font-weight: 600;
}
.card-status-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
}
.badge-plan { background: #6c5ce7; }
.badge-watching { background: #e50914; }
.badge-completed { background: #46d369; color: #083b1a; }
.badge-hold { background: #fdcb6e; color: #4a3608; }
.badge-dropped { background: #636e72; }
.card-track-meta {
  position: absolute;
  top: 40px;
  left: 8px;
  z-index: 5;
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: #ffd166;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.85);
}

.pin-screen {
  position: fixed;
  inset: 0;
  z-index: 260;
  background: rgba(4, 4, 8, 0.85);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 20px;
}
.pin-panel { width: min(380px, 94vw); text-align: left; }
.pin-panel .verify-title { margin-bottom: 4px; }
.pin-panel .code-row { margin-top: 18px; }
.pin-panel .verify-links { justify-content: center; }

.profile-pencil {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #6c5ce7;
  border: 2px solid #fff;
  color: #fff;
  font-size: 0.72rem;
  display: none;
  place-items: center;
  line-height: 1;
}
.profile-item:hover .profile-pencil,
.gate-editing .profile-pencil { display: grid; }
.profile-item .profile-pencil:hover { transform: scale(1.15); }
.profile-lock {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 0.85rem;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.7));
}

.editor-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.editor-tabs button {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  font-family: inherit;
}
.editor-tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.avatar-grid-wrap { text-align: center; }
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.avatar-choice {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  outline: 3px solid transparent;
  outline-offset: 2px;
  transition: transform 0.15s ease, outline-color 0.15s ease;
}
.avatar-choice:hover { transform: scale(1.06); }
.avatar-choice.active { outline-color: #fff; }

.custom-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 6px 0 2px;
}
.custom-preview {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 2px dashed var(--border);
  border-radius: 50%;
  color: var(--muted);
  font-size: 1.8rem;
  overflow: hidden;
}
.custom-preview.has-img {
  border-style: solid;
  outline-color: transparent;
  cursor: default;
}
.custom-preview.has-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.file-btn {
  position: relative;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 9px 20px;
}

.settings-screen {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(4, 4, 8, 0.8);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 20px;
}
.settings-panel {
  position: relative;
  width: min(860px, 96vw);
  max-height: 86vh;
  overflow: hidden auto;
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
}
.settings-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: #fff;
  cursor: pointer;
  z-index: 5;
}
.settings-close:hover { background: var(--accent); }
.settings-sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 26px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.settings-sidebar h2 { font-size: 1.15rem; margin-bottom: 18px; padding-left: 8px; }
.side-link {
  text-align: left;
  background: none;
  border: none;
  color: var(--muted);
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.side-link:hover { color: #fff; background: var(--surface-2); }
.side-link.active { background: var(--surface-2); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.settings-content {
  flex: 1;
  padding: 30px 32px;
  min-width: 0;
}
.settings-h3 { font-size: 1.15rem; margin-bottom: 22px; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 14px;
}
.setting-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.setting-desc { color: var(--muted); font-size: 0.83rem; line-height: 1.5; }

.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background 0.25s;
}
.switch .slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(24px); }

.lang-list { display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.lang-option {
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: #d5d7de;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.lang-option:hover { border-color: var(--muted); }
.lang-option.active {
  border-color: var(--accent);
  background: rgba(229, 9, 20, 0.14);
  color: #fff;
}

.privacy-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}
.privacy-head { font-weight: 700; font-size: 0.98rem; margin-bottom: 8px; }
.privacy-card .setting-desc { margin-bottom: 14px; }
.settings-input {
  display: block;
  width: min(320px, 100%);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 13px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  margin-bottom: 10px;
}
.settings-input:focus { border-color: var(--accent); }
.privacy-card .btn-accent { margin-top: 4px; }
.panel-actions { display: flex; gap: 10px; margin-top: 6px; }
.panel-actions .btn { flex: 0 1 auto; justify-content: center; padding: 10px 18px; }

@media (max-width: 720px) {
  .settings-panel { flex-direction: column; }
  .settings-sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
    gap: 8px;
  }
  .settings-sidebar h2 { width: 100%; margin-bottom: 6px; padding-left: 0; }
  .settings-content { padding: 20px 18px; }
}

@media (max-width: 720px) {
  .navbar { gap: 10px; padding: 12px 4%; flex-wrap: wrap; }
  .nav-burger { display: block; order: 1; }
  .logo { order: 0; flex-shrink: 0; }
  .nav-links {
    order: 4;
    flex: 1 1 100%;
    display: none;
    flex-direction: column;
    gap: 0;
    background: rgba(10, 10, 16, 0.97);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    margin: 12px -4% 0;
    padding: 6px 4%;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 2px; border-bottom: 1px solid var(--border); }
  .nav-links a:last-child { border-bottom: none; }
  .nav-search { order: 2; flex: 1 1 auto; min-width: 0; }
  .nav-search input { width: 100%; }
  .avatar-wrap { order: 3; flex-shrink: 0; }
  .card, .skeleton-card { width: 138px; }
  .discover-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0;
  }
  .discover-grid .card, .discover-grid .skeleton-card { width: auto; }
  .discover-view { padding: 100px 3% 40px; }
  .discover-filterbar { gap: 8px; margin-bottom: 18px; }
  .discover-filterbar select { min-width: 0; flex: 1; padding: 9px 10px; font-size: 0.8rem; }
  .discover-grid .card-title { font-size: 0.72rem; }
  .discover-grid .card-sub { font-size: 0.65rem; }
  .discover-grid .card-info { padding: 18px 7px 7px; }
  .hero-content { bottom: 12%; right: 4%; }
  .rows { margin-top: -70px; gap: 32px; }
  .modal-body { padding: 20px 20px 28px; }
  .modal-title { font-size: 1.4rem; }
  .hero-dots { display: none; }
  .cast-list { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
  .profile-item, .profile-box { width: 84px; }
  .profile-box { height: 84px; border-radius: 10px; }
  .profile-initial { font-size: 1.8rem; }
  .profile-grid { gap: 18px; margin-bottom: 28px; }
}
