/* JavDB Atlas — dark, quiet, private-library aesthetic */
:root {
  --bg: #0e0b08;
  --bg-raised: #16130e;
  --bg-deep: #0a0805;
  --panel: rgba(26, 22, 17, 0.86);
  --panel-solid: #1a1611;
  --line: rgba(228, 210, 182, 0.07);
  --line-strong: rgba(228, 210, 182, 0.14);
  --text: #ece6dd;
  --text-dim: #b6aa98;
  --text-faint: #7f7057;
  --accent: #c9a86a;
  --accent-strong: #d9bc85;
  --accent-dim: rgba(201, 168, 106, 0.1);
  --accent-line: rgba(201, 168, 106, 0.28);
  --ok: #8fcf9f;
  --err: #ef8d8d;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 54px rgba(10, 7, 3, 0.62);
  --shadow-soft: 0 8px 30px rgba(10, 7, 3, 0.44);
  --font-display: "Cormorant Garamond", "Playfair Display", Georgia, "Noto Serif SC", "Songti SC", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
  color: inherit;
}

/* iOS Safari zooms into form controls smaller than 16px on focus. */
input,
select,
textarea {
  font-size: 16px;
}

button {
  cursor: pointer;
}

::selection {
  background: rgba(201, 168, 106, 0.25);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(201, 168, 106, 0.22);
  border-radius: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--accent);
  background: rgba(217, 184, 120, 0.08);
  border: 1px solid var(--accent-line);
  border-radius: 6px;
  padding: 0.12em 0.45em;
}

.is-hidden {
  display: none !important;
}

/* ---------- ambient background ---------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.ambient::before,
.ambient::after {
  content: "";
  position: absolute;
  width: 55vw;
  height: 55vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}

.ambient-one::before {
  top: -28vw;
  left: -12vw;
  background: radial-gradient(circle, rgba(201, 168, 106, 0.07), transparent 65%);
}

.ambient-two::after {
  bottom: -32vw;
  right: -14vw;
  background: radial-gradient(circle, rgba(240, 135, 155, 0.05), transparent 62%);
}

/* ---------- toast ---------- */
.toast-root {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(92vw, 420px);
}

.toast {
  pointer-events: auto;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-soft);
  font-size: 13.5px;
  color: var(--text);
  display: flex;
  gap: 9px;
  align-items: center;
  animation: toast-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  max-width: 100%;
}

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

.toast-mark {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}

.toast-ok .toast-mark {
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
}

.toast-err .toast-mark {
  background: var(--err);
  box-shadow: 0 0 10px var(--err);
}

.toast-info .toast-mark {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

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

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }
}

/* ---------- shared buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.button:active {
  transform: translateY(1px) scale(0.99);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #241a0c;
  box-shadow: 0 8px 24px rgba(201, 168, 106, 0.28);
}

.button-primary:hover {
  box-shadow: 0 12px 30px rgba(201, 168, 106, 0.38);
}

.movie-play-trigger {
  position: relative;
  overflow: hidden;
}

.movie-play-trigger > *:not(.playback-progress-fill) {
  position: relative;
  z-index: 1;
}

.playback-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(255, 255, 255, 0.24);
  transition: width 0.45s ease;
  pointer-events: none;
}

.movie-play-trigger.is-discovering .playback-progress-fill {
  width: var(--playback-progress, 5%);
}

.button-secondary {
  background: var(--accent-dim);
  border-color: var(--accent-line);
  color: var(--accent-strong);
}

.button-secondary:hover {
  background: rgba(217, 184, 120, 0.22);
}

.button-quiet {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text-dim);
  padding: 8px 14px;
  font-size: 13px;
}

.button-quiet:hover {
  color: var(--text);
  border-color: var(--text-faint);
}

.button-wide {
  width: 100%;
}

.button[disabled] {
  opacity: 0.55;
  cursor: wait;
}

.button-arrow {
  font-size: 13px;
  transition: transform 0.2s ease;
}

.button:hover .button-arrow {
  transform: translate(2px, -2px);
}

.button-icon {
  font-size: 15px;
}

.icon-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

.mini-button {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 14px;
  padding: 3px 7px;
  border-radius: 7px;
  transition: color 0.2s ease, background 0.2s ease;
}

.mini-button:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.mobile-only {
  display: none;
}

/* ---------- login screen ---------- */
.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
  align-items: center;
  gap: clamp(24px, 6vw, 96px);
  padding: clamp(28px, 6vw, 90px);
}

.auth-art {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.art-orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
}

.orbit-one {
  width: min(46vw, 540px);
  height: min(46vw, 540px);
  animation: orbit-spin 60s linear infinite;
}

.orbit-two {
  width: min(32vw, 380px);
  height: min(32vw, 380px);
  border-color: var(--accent-line);
  animation: orbit-spin 40s linear infinite reverse;
}

.art-orbit::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px 3px rgba(217, 184, 120, 0.55);
  top: -5px;
  left: 50%;
  margin-left: -4.5px;
}

@keyframes orbit-spin {
  to {
    transform: rotate(360deg);
  }
}

.art-card {
  position: absolute;
  border-radius: 22px;
  padding: 34px 38px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(60%, 360px);
  transform-style: preserve-3d;
}

.art-card-back {
  background: linear-gradient(160deg, rgba(217, 184, 120, 0.16), rgba(30, 40, 54, 0.4));
  border: 1px solid var(--accent-line);
  transform: rotate(-9deg) translate(-14px, 10px);
}

.art-card-front {
  background: linear-gradient(165deg, #211a1d, #161012 70%);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  animation: card-float 7s ease-in-out infinite;
}

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

.art-kicker {
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--accent);
}

.art-title {
  font-family: var(--font-display);
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, #f0e2c0, var(--accent) 60%, #8d6f3f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.art-line {
  width: 52px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.art-caption {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.7;
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(26px, 4vw, 44px);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #241a0c;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(201, 168, 106, 0.22);
}

.brand-lockup strong {
  display: block;
  font-size: 15.5px;
  letter-spacing: 0.02em;
}

.brand-lockup small {
  display: block;
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 1px;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: 0.01em;
}

.auth-lede {
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.75;
  margin: 0 0 26px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.auth-form label span {
  font-size: 12.5px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.auth-form input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.auth-form input::placeholder {
  color: var(--text-faint);
}

.form-error {
  min-height: 18px;
  margin: 0;
  font-size: 12.5px;
  color: var(--err);
}

.auth-note {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 9px var(--ok);
  flex: none;
}

/* ---------- app shell ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #130e11, #0c090b);
  border-right: 1px solid var(--line);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
}

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

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-top .brand-lockup {
  margin-bottom: 0;
}

.nav-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 11px 13px;
  color: var(--text-dim);
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.nav-item.is-active {
  color: var(--text);
  background: var(--accent-dim);
  border-color: var(--accent-line);
}

.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 15px;
  color: var(--text-faint);
  transition: color 0.2s ease;
}

.nav-item.is-active .nav-icon,
.nav-item:hover .nav-icon {
  color: var(--accent);
}

.nav-count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 2px 9px;
  font-variant-numeric: tabular-nums;
}

.nav-group-label {
  font-size: 10px;
  letter-spacing: 0.26em;
  color: var(--text-faint);
  padding: 14px 4px 4px;
}

.lock-tag {
  display: none;
  margin-left: 6px;
  font-size: 11px;
}

.nav-item.is-locked {
  opacity: 0.62;
}

.nav-item.is-locked .lock-tag {
  display: inline;
}

.nav-item.is-locked:hover {
  opacity: 0.85;
}

.sidebar-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  letter-spacing: 0.26em;
  color: var(--text-faint);
  padding: 0 4px;
}

.sidebar-lists {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.sidebar-lists::-webkit-scrollbar {
  display: none;
}

.sidebar-empty {
  font-size: 12px;
  color: var(--text-faint);
  padding: 10px 4px;
}

.sidebar-list-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.sidebar-list-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-list-item.is-active {
  background: var(--accent-dim);
  border-color: var(--accent-line);
}

.sidebar-list-cover {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--accent-strong);
}

.sidebar-list-item span:last-child {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-list-item.is-active span:last-child {
  color: var(--text);
}

.sidebar-list-item small {
  font-size: 10.5px;
  color: var(--text-faint);
  margin-left: auto;
  flex: none;
}

.sidebar-placeholder {
  height: 46px;
  border-radius: 10px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.03) 30%, rgba(255, 255, 255, 0.07) 50%, rgba(255, 255, 255, 0.03) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite linear;
}

.sidebar-placeholder.short {
  width: 78%;
}

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

.sidebar-bottom {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.connection-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.sidebar-bottom p {
  margin: 0;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
}

.sidebar-scrim {
  display: none;
}

/* ---------- main ---------- */
.main-shell {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(18px, 3.4vw, 40px);
  background: rgba(20, 16, 17, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.topbar-context {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-dim);
}

.context-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text-dim);
}

button.user-chip {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}

button.user-chip:hover {
  color: var(--text);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3c4c63, #243041);
  border: 1px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--accent-strong);
}

.content-shell {
  flex: 1;
  padding: clamp(22px, 3.6vw, 44px);
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
}

.content-view[hidden],
.content-view.is-hidden {
  display: none;
}

.content-view {
  animation: view-in 0.3s ease;
}

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

.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.page-pending {
  display: grid;
  place-items: center;
  min-height: 40vh;
  color: var(--text-faint);
  font-size: 14px;
}

.page-intro h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  margin: 0 0 8px;
}

.page-intro p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13.5px;
  max-width: 520px;
}

/* ---------- stats ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
}

/* ---------- lists grid ---------- */
.lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.list-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0;
  text-align: left;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.list-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-soft);
}

.list-cover {
  height: 118px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 40px;
  letter-spacing: 0.02em;
}

/* deterministic gradient variants for covers/fallbacks */
.hue-0 {
  background: linear-gradient(150deg, #4a2530, #231116);
}

.hue-1 {
  background: linear-gradient(150deg, #3e2335, #1e1019);
}

.hue-2 {
  background: linear-gradient(150deg, #402432, #211116);
}

.hue-3 {
  background: linear-gradient(150deg, #472a22, #23120e);
}

.hue-4 {
  background: linear-gradient(150deg, #45212c, #210e14);
}

.hue-5 {
  background: linear-gradient(150deg, #33202a, #190f13);
}

.list-cover span {
  opacity: 0.92;
}

.list-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.list-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.list-desc {
  font-size: 12.5px;
  color: var(--text-faint);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 0;
}

.list-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.list-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.list-meta .meta-item::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-faint);
}

/* ---------- movie grid & cards ---------- */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: 18px 14px;
}

.movie-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  color: var(--text);
}

.watch-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.16);
}

.watch-progress::after {
  content: "";
  display: block;
  width: var(--watch-progress, 0%);
  height: 100%;
  background: var(--accent-strong);
}

.poster-wrap {
  position: relative;
  aspect-ratio: 2 / 2.86;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: linear-gradient(160deg, #241d13, #141008);
  border: 1px solid var(--line);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
}

.movie-card:hover .poster-wrap {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-soft);
}

.poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.poster-img.is-loaded {
  opacity: 1;
}

.movie-card:hover .poster-img.is-loaded {
  transform: scale(1.035);
}

.poster-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-faint);
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.06em;
}

.poster-fallback small {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.18em;
}

/* score + magnet badges, grouped top-left: magnet first, then score (tier-colored) */
.poster-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: flex;
  gap: 4px;
  align-items: center;
}

.score-badge,
.magnet-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-radius: 999px;
  padding: 2px 7px;
  box-shadow: 0 2px 8px rgba(8, 5, 2, 0.5);
}

.score-badge {
  color: #241a0c;
}

.score-badge.s1 {
  background: linear-gradient(135deg, #f0d590, #c9a86a);
}

.score-badge.s2 {
  background: linear-gradient(135deg, #e8b878, #c08a45);
}

.score-badge.s3 {
  background: linear-gradient(135deg, #cbb188, #a8894f);
}

.score-badge.s4 {
  background: linear-gradient(135deg, #9a9a9a, #757575);
  color: #141414;
}

.magnet-badge {
  color: var(--text);
  background: rgba(22, 18, 12, 0.55);
  border: 1px solid rgba(240, 226, 192, 0.18);
  backdrop-filter: blur(6px);
}


.movie-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.movie-number {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.03em;
  font-family: var(--font-mono);
}

.movie-title {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-sub {
  font-size: 11px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.section-meta {
  margin: 14px 0 18px;
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ---------- search ---------- */
.search-box {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 8px 8px 8px 18px;
  max-width: 640px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.search-symbol {
  color: var(--text-faint);
  font-size: 17px;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  padding: 8px 0;
  min-width: 0;
}

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

/* ---------- empty state ---------- */
.empty-state {
  text-align: center;
  padding: 70px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--text-dim);
}

.empty-mark {
  font-size: 34px;
  color: var(--accent);
  margin-bottom: 14px;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.empty-state p {
  margin: 0;
  font-size: 13px;
  color: var(--text-faint);
}

/* ---------- loading grid ---------- */
.loading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: 18px 14px;
}

.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.skeleton-block {
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.04) 30%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.04) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite linear;
  border-radius: var(--radius-sm);
}

.skeleton-card .skeleton-block.poster {
  aspect-ratio: 2 / 2.86;
}

.skeleton-card .skeleton-block.line {
  height: 12px;
  width: 100%;
}

.skeleton-card .skeleton-block.line.short {
  width: 55%;
}

/* ---------- drawer ---------- */
.drawer-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
}

.drawer-scrim,
.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 12, 0.66);
  backdrop-filter: blur(3px);
  animation: fade-in 0.22s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.detail-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 94vw);
  background: var(--bg-raised);
  border-left: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  animation: drawer-in 0.3s cubic-bezier(0.25, 0.9, 0.3, 1);
  overflow: hidden;
}

@keyframes drawer-in {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px 16px;
  border-bottom: 1px solid var(--line);
}

.drawer-header h2 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  margin: 0;
  line-height: 1.35;
  max-width: 380px;
}

.drawer-summary {
  padding: 18px 26px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 14px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.summary-item b {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.drawer-movies {
  flex: 1;
  overflow-y: auto;
  padding: 20px 26px 30px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 18px 12px;
  align-content: start;
}

.drawer-movies .poster-wrap {
  aspect-ratio: 2 / 2.7;
}

.drawer-movies .load-more,
.movie-grid .load-more,
.reviews-list .load-more {
  grid-column: 1 / -1;
  justify-self: center;
  min-width: 180px;
}

.load-more-wrap {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 6px 0;
}

.load-more-wrap .button {
  min-width: 180px;
}

/* ---------- lightbox (in-app image viewer) ---------- */

.lightbox-layer {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, 0.92);
  backdrop-filter: blur(6px);
  animation: fade-in 0.2s ease;
}

.lightbox-body {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 1200px);
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox-body img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  cursor: default;
  animation: modal-in 0.25s cubic-bezier(0.25, 0.9, 0.3, 1.1);
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2;
  background: rgba(10, 14, 20, 0.72);
  backdrop-filter: blur(8px);
  border-color: var(--line-strong);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: var(--text-dim);
  background: rgba(10, 14, 20, 0.66);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.lightbox-nav:hover:not(:disabled) {
  color: var(--accent-strong);
  border-color: var(--accent-line);
  background: rgba(10, 14, 20, 0.9);
}

.lightbox-nav:disabled {
  opacity: 0.3;
  cursor: default;
}

.lightbox-nav.prev {
  left: 18px;
}

.lightbox-nav.next {
  right: 18px;
}

.lightbox-count {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  background: rgba(10, 14, 20, 0.72);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 16px;
  font-variant-numeric: tabular-nums;
}

.hero-tags.actors {
  margin-top: 12px;
}

/* ---------- home page ---------- */

.home-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  padding: 34px 6px 30px;
  margin-bottom: 6px;
}

.home-hero-text {
  flex: 1 1 280px;
  min-width: 0;
}

.home-hero-text .eyebrow {
  margin-bottom: 8px;
}

.home-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 600;
  font-style: italic;
  margin: 0 0 8px;
  letter-spacing: 0.01em;
  background: linear-gradient(120deg, #f0e2c0, var(--accent) 60%, #8d6f3f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.home-hero p {
  margin: 0;
  max-width: 480px;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.7;
}

.home-search {
  flex: 1 1 420px;
  max-width: 460px;
  min-width: 260px;
  margin: 0;
}

.quick-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13px;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.quick-link:hover {
  color: var(--accent-strong);
  border-color: var(--accent-line);
  transform: translateY(-1px);
}

.quick-link svg {
  color: var(--accent);
}

.guest-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  margin-bottom: 34px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-dim);
}

.guest-banner-mark {
  font-size: 15px;
}

.home-section {
  margin-bottom: 40px;
}

.home-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.home-section-head h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}

.home-more {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.home-more:hover {
  color: var(--accent-strong);
  background: var(--accent-dim);
}

/* ---------- rank badge ---------- */

.rank-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  min-width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.78);
  border: 1px solid var(--accent-line);
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(6px);
}

.rank-badge.top {
  border-color: transparent;
}

.rank-badge.rank-1 {
  background: linear-gradient(135deg, #f5d27e, #d9a94e);
  color: #231503;
  box-shadow: 0 0 14px rgba(217, 169, 78, 0.45);
}

.rank-badge.rank-2 {
  background: linear-gradient(135deg, #d7dce2, #aeb6c0);
  color: #14181d;
  box-shadow: 0 0 12px rgba(174, 182, 192, 0.4);
}

.rank-badge.rank-3 {
  background: linear-gradient(135deg, #d9a077, #b9794c);
  color: #1d0f05;
  box-shadow: 0 0 12px rgba(185, 121, 76, 0.4);
}

/* ---------- entity grid (collections) ---------- */

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

.entity-card {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--text);
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
}

.entity-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-soft);
}

.entity-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--accent-strong);
}

.entity-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

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

.entity-info small {
  font-size: 11.5px;
  color: var(--text-faint);
}

/* ---------- A-group: entity detail / tags / letters / plaza / gallery ---------- */

.detail-back {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text-dim);
  border-radius: 9px;
  padding: 7px 14px;
  font-size: 13px;
  margin-bottom: 18px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.detail-back:hover {
  color: var(--accent-strong);
  border-color: var(--accent-line);
}

.entity-header {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  margin-bottom: 26px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.entity-header .entity-avatar {
  width: 74px;
  height: 74px;
  border-radius: 18px;
  font-size: 30px;
  flex: none;
}

.entity-header-info {
  min-width: 0;
}

.entity-header-info h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 10px;
}

.entity-desc {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.7;
  margin: 12px 0 0;
}

.meta-link {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--accent-strong);
  font-weight: 600;
  font-size: inherit;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}

.meta-link:hover {
  text-decoration: underline;
}

.tag-pill.link {
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.tag-pill.link:hover {
  background: rgba(217, 184, 120, 0.26);
  transform: translateY(-1px);
}

/* tags page */
.tag-category {
  margin-bottom: 20px;
}

.tag-category-name {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--text-faint);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 13px;
  color: var(--text-dim);
  transition: all 0.18s ease;
}

.tag-chip:hover {
  border-color: var(--accent-line);
  color: var(--text);
}

.tag-chip.is-active {
  background: var(--accent-dim);
  border-color: var(--accent-line);
  color: var(--accent-strong);
  font-weight: 600;
}

/* series letters */
.letter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.letter-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  color: var(--text);
  text-align: left;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.letter-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.letter-card.is-active {
  background: var(--accent-dim);
  border-color: var(--accent-line);
}

.letter-code {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-strong);
  letter-spacing: 0.05em;
}

.letter-desc {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* preview gallery */
.preview-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.preview-large {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #241d13, #141008);
}

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

/* ---------- interactive actions (movie status / review / like) ---------- */

.movie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.review-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-form-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.review-form-label {
  font-size: 13px;
  color: var(--text-dim);
  margin-right: 6px;
}

.star-btn {
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--text-faint);
  padding: 0 2px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.star-btn.is-on {
  color: var(--accent);
}

.star-btn:hover {
  transform: scale(1.15);
}

.review-form-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  resize: vertical;
  font: inherit;
  outline: none;
}

.review-form-input:focus {
  border-color: var(--accent-line);
}

.review-form-actions {
  display: flex;
  justify-content: flex-end;
}

.like-btn {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}

.like-btn:hover {
  color: var(--err);
  background: rgba(229, 138, 138, 0.12);
}

.like-btn.is-liked {
  color: var(--err);
}

.similar-section {
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.similar-section h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 16px;
}

.entity-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.entity-header-top h2 {
  margin-bottom: 0;
}

.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.list-delete {
  margin-top: 10px;
  font-size: 12px;
  color: var(--err);
  align-self: flex-start;
}

.list-delete:hover {
  text-decoration: underline;
}

.create-list-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.create-list-form input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 9px 12px;
  color: var(--text);
  outline: none;
}

.create-list-form input:focus {
  border-color: var(--accent-line);
}

.theme-toggle {
  margin-right: 2px;
}

.home-section-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-section-actions .tabs-bar {
  margin-bottom: 0;
}

/* ---------- light theme ---------- */

body.light {
  --bg: #f7f1e6;
  --bg-raised: #fcf8f0;
  --bg-deep: #efe6d5;
  --panel: rgba(252, 248, 240, 0.92);
  --panel-solid: #fcf8f0;
  --line: rgba(92, 74, 44, 0.12);
  --line-strong: rgba(92, 74, 44, 0.2);
  --text: #3a2c17;
  --text-dim: #7a6440;
  --text-faint: #a08a60;
  --accent: #a8863f;
  --accent-strong: #9a7a37;
  --accent-dim: rgba(168, 134, 63, 0.12);
  --accent-line: rgba(168, 134, 63, 0.35);
  --shadow: 0 18px 50px rgba(80, 60, 20, 0.16);
  --shadow-soft: 0 8px 28px rgba(80, 60, 20, 0.12);
}

body.light .sidebar {
  background: linear-gradient(180deg, #fcf8f0, #f2e9d8);
}

body.light .topbar {
  background: rgba(247, 241, 230, 0.86);
}

body.light .ambient-one::before {
  background: radial-gradient(circle, rgba(168, 134, 63, 0.16), transparent 65%);
}

body.light .ambient-two::after {
  background: radial-gradient(circle, rgba(168, 134, 63, 0.1), transparent 62%);
}

body.light .art-card-front {
  background: linear-gradient(165deg, #fcf8f0, #eee3cf 70%);
}

body.light .poster-wrap,
body.light .hero-poster,
body.light .preview-item,
body.light .preview-large {
  background: linear-gradient(160deg, #e0d2b4, #cdb992);
}

body.light .review-form-input,
body.light .create-list-form input,
body.light .auth-form input {
  background: rgba(92, 74, 44, 0.05);
}

/* ---------- add-to-list picker / profile / search history ---------- */

.list-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 20px;
}

.list-picker-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.list-picker-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line-strong);
}

.list-picker-item span:nth-child(2) {
  flex: 1;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-picker-item small {
  color: var(--text-faint);
  font-size: 11.5px;
}

.list-picker-empty {
  padding: 12px;
  font-size: 13px;
  color: var(--text-faint);
}

.profile-card {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.profile-card .entity-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  font-size: 26px;
  flex: none;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-name-row h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}

.vip-badge {
  font-size: 11px;
  font-weight: 700;
  color: #171310;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  border-radius: 6px;
  padding: 2px 8px;
  letter-spacing: 0.06em;
}

.profile-email {
  color: var(--text-faint);
  font-size: 13px;
  margin: 4px 0 0;
}

.profile-share {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  display: flex;
  gap: 14px;
  align-items: center;
}

.profile-share a {
  color: var(--accent-strong);
  text-decoration: none;
}

.profile-share a:hover {
  text-decoration: underline;
}

.profile-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.profile-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-align: left;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.profile-link:hover {
  border-color: var(--accent-line);
  transform: translateX(2px);
}

.profile-link span {
  flex: 1;
  font-size: 14px;
}

.profile-link svg {
  color: var(--text-faint);
}

.search-history {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.search-history .tag-chip {
  padding: 5px 12px;
  font-size: 12px;
}

.history-clear {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 12px;
  margin-left: 6px;
  cursor: pointer;
}

.history-clear:hover {
  color: var(--err);
}

/* ---------- feed review (home / hot reviews) ---------- */

.feed-review {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.movie-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px;
  margin-bottom: 12px;
  color: var(--text);
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.movie-strip:hover {
  border-color: var(--accent-line);
  background: rgba(255, 255, 255, 0.05);
}

.movie-strip-thumb {
  position: relative;
  width: 46px;
  height: 62px;
  border-radius: 7px;
  overflow: hidden;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-strong);
  font-size: 12px;
}

.movie-strip-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.movie-strip-thumb img.is-loaded {
  opacity: 1;
}

.movie-strip-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.movie-strip-number {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
  font-weight: 600;
}

.movie-strip-title {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- modal ---------- */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 40px);
}

.movie-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(880px, 100%);
  max-height: min(88vh, 900px);
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow-y: auto;
  animation: modal-in 0.28s cubic-bezier(0.25, 0.9, 0.3, 1.1);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
}

.modal-close {
  position: sticky;
  top: 14px;
  align-self: flex-end;
  margin: 14px 14px 0 0;
  z-index: 5;
  flex: none;
  background: rgba(10, 14, 20, 0.72);
  backdrop-filter: blur(8px);
  border-color: var(--line-strong);
}

.movie-detail-content {
  padding: 6px 30px 34px;
}

/* hero */
.hero-poster-btn {
  background: none;
  border: none;
  padding: 0;
  flex: none;
  cursor: zoom-in;
}

.hero-poster-btn .hero-poster {
  width: min(210px, 38vw);
  aspect-ratio: 2 / 2.86;
}

.movie-hero {
  display: flex;
  gap: 26px;
  align-items: flex-start;
  margin-bottom: 26px;
}

.hero-poster {
  position: relative;
  width: min(210px, 38vw);
  aspect-ratio: 2 / 2.86;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(160deg, #241d13, #141008);
  border: 1px solid var(--line-strong);
  flex: none;
}

.hero-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.hero-poster img.is-loaded {
  opacity: 1;
}

.hero-poster .poster-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-faint);
  font-family: var(--font-display);
  font-size: 32px;
}

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

.hero-info .eyebrow {
  margin-bottom: 8px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.6vw, 27px);
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}

.hero-number {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.chip.score {
  color: #241a0c;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  border-color: transparent;
  font-weight: 700;
}

.chip .chip-label {
  color: var(--text-faint);
  font-size: 11px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-pill {
  font-size: 11.5px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 3px 9px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.tag-pill:hover {
  color: var(--accent-strong);
  border-color: var(--accent-line);
  background: var(--accent-dim);
}

.hero-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 18px;
  margin-top: 16px;
  font-size: 12.5px;
}

.hero-meta-grid .meta-row {
  color: var(--text-dim);
  display: flex;
  gap: 8px;
}

.hero-meta-grid .meta-row b {
  color: var(--text);
  font-weight: 600;
}

.hero-meta-grid .meta-row span {
  color: var(--text-faint);
  flex: none;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

/* preview strip */
.preview-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.preview-item {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #241d13, #141008);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.preview-item img.is-loaded {
  opacity: 1;
}

/* section tabs */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.filter-bar .tabs-bar {
  margin-bottom: 0;
}

.movie-flags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.movie-flag {
  font-size: 10px;
  line-height: 1;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 2px 5px;
}

/* Mantine integration overrides */
.tabs-bar {
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.tabs-bar .mantine-Tabs-list {
  border-bottom: none;
}

.tabs-bar .mantine-Tabs-tab {
  font-size: 13.5px;
  padding: 10px 16px;
  color: var(--text-faint);
}

.tabs-bar .mantine-Tabs-tab[data-active] {
  color: var(--accent-strong);
}

.section-tabs {
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.section-tabs .mantine-Tabs-list {
  border-bottom: none;
}

.section-tabs .mantine-Tabs-tab {
  font-size: 13.5px;
  padding: 10px 16px;
  color: var(--text-faint);
}

.section-tabs .mantine-Tabs-tab[data-active] {
  color: var(--accent-strong);
}

/* Mantine Modal (movie detail) */
.movie-modal-content {
  background: var(--bg-raised) !important;
}

.movie-modal-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-raised);
}

/* no visible scrollbar inside the detail modal; scrolling stays */
.movie-modal-content .mantine-ScrollArea-scrollbar {
  display: none;
}

/* back button beside the close button: right-aligned, just left of the X */
.movie-modal-header .mantine-Modal-title {
  margin-left: auto;
  margin-right: 54px;
}

.movie-modal-back,
.movie-modal-close {
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  background: transparent;
  border: 0;
}

.movie-modal-back:hover,
.movie-modal-close:hover {
  color: var(--text);
  background: var(--bg-hover);
}

/* keep both controls identical and equally spaced */
.movie-modal-header .mantine-Modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  margin: 0;
}

.movie-modal-header .mantine-Modal-title {
  display: flex;
  align-items: center;
}

.movie-modal-content .movie-detail-content {
  padding: 6px 30px 34px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.playback-panel {
  display: grid;
  gap: 0;
  width: 100%;
  overflow: visible;
  border-radius: 0;
  background: transparent;
}

.playback-source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.playback-empty {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 42px 16px;
  color: var(--text-faint);
}

.playback-empty .skeleton-block {
  width: 100%;
  height: 260px;
}

/* Focused playback surface: the player opens above the movie modal with the
   same frosted, blurred treatment used by login and the image lightbox. */
.playback-modal-overlay {
  background: rgba(4, 6, 10, 0.58);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
}

.playback-modal-content {
  width: min(980px, 94vw) !important;
  max-width: min(980px, 94vw) !important;
  background: rgba(19, 22, 28, 0.48) !important;
  border: 0 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  overflow: hidden;
}

.playback-modal-header {
  display: none !important;
}

.playback-modal-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.playback-modal-close {
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border-radius: 50%;
  color: var(--text-faint);
}

.playback-modal-close:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.playback-modal-body {
  width: 100%;
  padding: 0;
  background: transparent;
}

.playback-modal-body .hls-player-wrap {
  gap: 0;
}

.playback-modal-body .hls-player {
  width: 100%;
  min-height: 0;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 0;
  background: #000;
  box-shadow: none;
}

.playback-modal-body .hls-player-video {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.playback-modal-body .player-seekbar {
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.035);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.playback-modal-empty {
  min-height: 360px;
}

body.light .playback-modal-overlay {
  background: rgba(247, 241, 230, 0.42);
}

body.light .playback-modal-content {
  background: rgba(252, 248, 240, 0.48) !important;
  box-shadow: none !important;
}

body.light .playback-modal-header {
  display: none !important;
}

body.light .playback-panel {
  background: rgba(255, 255, 255, 0.42);
}

body.light .playback-source-list,
body.light .playback-modal-body .player-seekbar {
  background: rgba(255, 255, 255, 0.34);
  border-color: rgba(80, 60, 20, 0.12);
}

.hls-player-wrap {
  display: grid;
  gap: 8px;
}

.hls-player-wrap.is-fullscreen {
  width: 100vw;
  height: 100vh;
  gap: 0;
  background: #000;
  grid-template-rows: 1fr auto auto;
}

.hls-player-wrap.is-fullscreen .hls-player {
  min-height: 0;
  height: 100%;
  border: 0;
  border-radius: 0;
}

.hls-player-wrap.is-fullscreen .hls-player-video {
  width: 100%;
  height: 100%;
  max-height: none;
}

.hls-player-wrap.is-fullscreen .player-controls,
.hls-player-wrap.is-fullscreen .player-seekbar {
  background: rgba(8, 8, 8, 0.92);
}

.hls-player {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  background: #050505;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.hls-player-video {
  display: block;
  width: 100%;
  max-height: min(68vh, 620px);
  background: #050505;
}

.hls-player-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.72);
  pointer-events: none;
}

.hls-player-error {
  color: #e6a7a7;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px 3px;
  background: rgba(255, 255, 255, 0.035);
}

.player-control-icon,
.player-subtitle-button,
.player-subtitle-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
}

.player-subtitle-select {
  width: 48px;
  height: 25px;
  color-scheme: dark;
  font-size: 10px;
  outline: none;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.player-subtitle-button {
  width: auto;
  min-width: 42px;
  padding: 0 8px;
}

.player-zh-button {
  width: auto;
  min-width: 0;
  padding: 0 8px;
  position: relative;
  overflow: hidden;
}

.player-zh-button::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--subtitle-progress, 0%);
  background: var(--accent-dim);
  transition: width 0.25s ease;
  pointer-events: none;
}

.player-zh-button.is-loading {
  color: var(--accent-strong);
}

.player-control-icon:hover,
.player-subtitle-button:hover,
.player-subtitle-button.is-active {
  color: var(--accent-strong);
  background: var(--accent-dim);
}

.player-progress {
  flex: 1;
  min-width: 80px;
  accent-color: var(--accent-strong);
}

.player-volume {
  width: 58px;
  min-width: 48px;
  accent-color: var(--accent-strong);
}

.player-seekbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.player-seek-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 27px;
  padding: 3px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-dim);
  font-size: 11.5px;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.player-seek-button:hover {
  color: var(--accent-strong);
  border-color: var(--accent-line);
  background: var(--accent-dim);
}

.player-time {
  min-width: 78px;
  color: var(--text-faint);
  font-size: 11px;
  white-space: nowrap;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.movie-modal-content .mantine-Tabs-tab .tab-count {
  font-size: 11px;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 5px;
}

/* Mantine Drawer (lists / collections) */
.drawer-mantine-content {
  background: var(--bg-raised) !important;
  display: flex;
  flex-direction: column;
}

.drawer-mantine-content .mantine-Drawer-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.drawer-mantine-content .drawer-header {
  flex: none;
}

.drawer-mantine-content .drawer-summary {
  flex: none;
}

.drawer-mantine-content .drawer-movies {
  flex: 1;
  min-height: 0;
}

/* login modal: borderless, fully frosted glass, click-outside to close */
.login-modal-overlay {
  background: rgba(8, 6, 3, 0.4);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
}

.login-modal-content {
  background: transparent;
  border: none;
  box-shadow: none;
}

.login-modal-content .login-modal-card {
  margin: 0;
  border: none;
  background: rgba(24, 20, 15, 0.4);
  backdrop-filter: blur(28px) saturate(1.45);
  -webkit-backdrop-filter: blur(28px) saturate(1.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 210, 0.08),
    0 24px 64px rgba(8, 5, 2, 0.5);
}

body.light .login-modal-overlay {
  background: rgba(247, 241, 230, 0.35);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
}

body.light .login-modal-content .login-modal-card {
  background: rgba(252, 248, 240, 0.5);
  backdrop-filter: blur(28px) saturate(1.45);
  -webkit-backdrop-filter: blur(28px) saturate(1.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 24px 64px rgba(80, 60, 20, 0.2);
}

.tabs-bar {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tab-button {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--text-faint);
  transition: color 0.2s ease, border-color 0.2s ease;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.tab-button:hover {
  color: var(--text-dim);
}

.tab-button.is-active {
  color: var(--accent-strong);
  border-bottom-color: var(--accent);
}

.tab-button .tab-count {
  font-size: 11px;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 1px 8px;
}

/* reviews */
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.review-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.review-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.review-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3c4c63, #243041);
  border: 1px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--accent-strong);
  flex: none;
}

.review-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.review-status {
  font-size: 11px;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}

.review-score {
  margin-left: auto;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.review-content {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
}

.review-foot {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.review-likes {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* magnets */
.magnet-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 16px;
  transition: border-color 0.2s ease;
}

.magnet-row:hover {
  border-color: var(--line-strong);
}

.magnet-info {
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  overflow: hidden;
}

.magnet-name {
  max-width: 100%;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.magnet-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.magnet-meta .flag {
  color: var(--accent);
}

.magnet-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  max-width: 100%;
  min-width: 0;
}

.magnet-btn {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text-dim);
  border-radius: 9px;
  padding: 8px 13px;
  font-size: 12.5px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.magnet-btn:hover {
  color: var(--accent-strong);
  border-color: var(--accent-line);
  background: var(--accent-dim);
}

.magnet-btn.primary {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #171310;
  border-color: transparent;
  font-weight: 600;
}

.magnet-btn.primary:hover {
  filter: brightness(1.06);
  color: #171310;
}

/* detail loading */
.detail-loading {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 10px 0;
}

.detail-loading .skeleton-block {
  height: 120px;
  border-radius: var(--radius);
}

.detail-loading .skeleton-block.short {
  height: 60px;
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .home-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .home-hero-text {
    flex: 0 1 auto;
  }

  .home-search {
    max-width: 100%;
    flex: 1 1 auto;
    padding: 6px 6px 6px 14px;
    border-radius: 12px;
  }

  .home-search input {
    padding: 6px 0;
    font-size: 16px;
  }

  .home-search .button {
    padding: 8px 14px;
    font-size: 13px;
  }
  .boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-screen {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .auth-art {
    min-height: 300px;
  }

  .orbit-one {
    width: 78vw;
    height: 78vw;
  }

  .orbit-two {
    width: 54vw;
    height: 54vw;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 86vw);
    z-index: 80;
    transform: translateX(-102%);
    transition: transform 0.3s cubic-bezier(0.25, 0.9, 0.3, 1);
    box-shadow: var(--shadow);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-scrim.is-visible {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(5, 8, 12, 0.6);
    backdrop-filter: blur(2px);
    animation: fade-in 0.2s ease;
  }

  .mobile-only {
    display: inline-flex;
  }

  .movie-hero {
    flex-direction: column;
  }

  .hero-poster {
    width: min(240px, 60vw);
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }

  /* Detail modal: keep every tab within the viewport on narrow phones. */
  .movie-modal-content {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    min-width: 0;
  }

  .movie-modal-content .movie-detail-content {
    width: 100%;
    min-width: 0;
    padding: 6px 12px 24px;
    overflow-x: hidden;
  }

  .movie-modal-content .mantine-Tabs-list {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .movie-modal-content .mantine-Tabs-list::-webkit-scrollbar {
    display: none;
  }

  .movie-modal-content .mantine-Tabs-tab {
    flex: 0 0 auto;
    white-space: nowrap;
    padding-left: 10px;
    padding-right: 10px;
  }

  .home-search {
    padding: 5px 5px 5px 12px;
  }

  .home-search input {
    font-size: 16px;
  }

  .home-search .button {
    padding: 7px 12px;
  }

  .boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-screen {
    padding: 22px 16px;
  }

  .auth-art {
    min-height: 210px;
  }

  .art-card {
    width: 78%;
    padding: 24px 26px;
  }

  .page-intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .topbar {
    padding: 11px 14px;
  }

  .content-shell {
    padding: 16px 8px 28px;
  }

  .movie-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 8px;
    gap: 14px 10px;
  }

  .drawer-movies {
    padding: 16px 16px 24px;
  }

  .magnet-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .magnet-info {
    width: 100%;
    min-width: 0;
  }

  .magnet-name {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    line-height: 1.45;
  }

  .magnet-meta {
    gap: 6px 10px;
    line-height: 1.4;
  }

  .magnet-actions {
    width: 100%;
    justify-content: stretch;
  }

  .magnet-btn {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
    padding-left: 8px;
    padding-right: 8px;
  }

  .movie-detail-content {
    padding: 6px 12px 26px;
  }

  .playback-modal-body {
    width: 100%;
    padding: 0;
  }

  .player-seekbar {
    gap: 3px;
    padding-left: 6px;
    padding-right: 6px;
  }

  .player-seek-button {
    flex: 1 1 auto;
    min-height: 25px;
    padding-left: 4px;
    padding-right: 4px;
    font-size: 10px;
  }

  .player-time {
    order: -1;
    flex: 0 0 100%;
  }

  .drawer-header,
  .drawer-summary {
    padding-left: 18px;
    padding-right: 18px;
  }
}

/* ---------- related lists (movie detail) ---------- */

.related-lists {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.related-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.related-list-row:hover {
  border-color: var(--accent-line);
  background: var(--accent-dim);
}

.related-list-row .sidebar-list-cover {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.related-list-name {
  flex: 1;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-list-count {
  font-size: 11.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* tag-pill label (category marker inside pill rows) */
.tag-pill.label {
  color: var(--text-faint);
  background: transparent;
  border-color: transparent;
  cursor: default;
  font-size: 10.5px;
  letter-spacing: 0.12em;
}

.tag-pill.label:hover {
  color: var(--text-faint);
  border-color: transparent;
  background: transparent;
}

/* score chip: rating + number of raters (含金量) */
.chip.score .score-count {
  font-style: normal;
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 500;
}

/* rank + score both live top-right: stack them when the rank badge is present */
.poster-wrap:has(.rank-badge) .score-badge {
  top: 36px;
}

/* drawer sort control */
.drawer-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.drawer-sort label {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.drawer-sort select {
  appearance: none;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  font-size: 12.5px;
  padding: 6px 26px 6px 12px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-faint) 50%), linear-gradient(135deg, var(--text-faint) 50%, transparent 50%);
  background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.drawer-sort select:focus {
  outline: none;
  border-color: var(--accent-line);
}

/* inline sort select inside section-meta */
.section-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sort-inline {
  font-size: 12px;
  padding: 5px 24px 5px 10px;
}

/* rank list thumb (static snapshot lists, direct jdbstatic images) */
