/* ============================================================
   tupeli · tema oscuro cinematográfico
   Paleta: base carbón azulado + acento ámbar de marquesina.
   Radios: tarjetas 14px · inputs 10px · botones píldora.
   ============================================================ */

:root {
  --bg: #0b0d12;
  --bg-elev: #10131a;
  --surface: #141824;
  --surface-2: #1b2030;
  --line: #262c3d;
  --line-soft: #1e2433;
  --text: #eceef4;
  --muted: #98a0b3;
  --accent: #f5b638;
  --accent-soft: rgba(245, 182, 56, 0.14);
  --accent-ink: #1a1104;
  --ok: #45d183;
  --info: #5aa7ff;
  --danger: #ff5d6c;
  --shadow: 0 10px 30px rgba(4, 6, 12, 0.55);
  --r-card: 14px;
  --r-input: 10px;
  --nav-h: 64px;
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html { color-scheme: dark; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.9em; }

::selection { background: var(--accent); color: var(--accent-ink); }

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

.muted { color: var(--muted); }
.ic { vertical-align: -0.18em; flex-shrink: 0; }

/* ---------- Barra de navegación ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  background: rgba(11, 13, 18, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
  z-index: 40;
}

.nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.brand-dot { color: var(--accent); }

.nav-search { position: relative; flex: 1; max-width: 440px; }

.nav-search form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  color: var(--muted);
  transition: border-color 0.2s ease;
}

.nav-search form:focus-within { border-color: var(--accent); color: var(--accent); }

.nav-search input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  outline: none;
  min-width: 0;
}

.nav-search input::placeholder { color: var(--muted); }
.nav-search input::-webkit-search-cancel-button { display: none; }

.search-drop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 50;
}

.search-drop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  transition: background 0.15s ease;
}

.search-drop-item:hover, .search-drop-item.sel { background: var(--surface-2); }

.search-drop-item img {
  width: 34px;
  height: 51px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-2);
}

.search-drop-item .sd-title { font-weight: 600; font-size: 0.92rem; }
.search-drop-item .sd-sub { font-size: 0.8rem; color: var(--muted); }

.search-drop-empty, .search-drop-note {
  padding: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.sd-skel {
  height: 51px;
  margin: 8px 12px;
  border-radius: 8px;
  background: linear-gradient(100deg, var(--surface-2) 40%, #232a3d 50%, var(--surface-2) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.nav-links > a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.92rem;
  position: relative;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-links > a:hover { color: var(--text); background: var(--surface); }

.nav-badge-wrap .badge-count {
  position: absolute;
  top: 2px;
  right: 4px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.68rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

.nav-user { position: relative; margin-left: 6px; }

.nav-avatar-btn {
  background: none;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 2px;
  transition: border-color 0.15s ease;
}

.nav-avatar-btn:hover, .nav-avatar-btn[aria-expanded="true"] { border-color: var(--accent); }

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 210px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 50;
}

.user-menu-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
}

.user-menu-head .muted { font-size: 0.82rem; }

.user-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 0.92rem;
  color: var(--text);
  transition: background 0.15s ease;
}

.user-menu a:hover { background: var(--surface-2); }
.user-menu a.danger { color: var(--danger); }

.notice-bar {
  margin-top: var(--nav-h);
  background: var(--accent-soft);
  border-bottom: 1px solid rgba(245, 182, 56, 0.25);
  color: #f8d489;
  padding: 10px 20px;
  text-align: center;
  font-size: 0.9rem;
}

.notice-bar + .main { padding-top: 24px; }

/* ---------- Estructura ---------- */
.main { padding: calc(var(--nav-h) + 24px) 0 64px; }

body.landing .main, body.auth-page .main { padding-top: var(--nav-h); }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-narrow { max-width: 640px; }

.block { margin-bottom: 40px; }

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.block-head h2 {
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 9px;
}

.block-head h2 .ic { color: var(--accent); }

.block-head h3 { font-size: 1rem; font-weight: 600; }

.link-more { color: var(--muted); font-size: 0.9rem; transition: color 0.15s ease; }
.link-more:hover { color: var(--accent); }

.page-title-h { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 24px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 20px;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #ffc95e; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.btn-ghost:hover { border-color: var(--muted); background: var(--surface); }

.btn-ghost.is-on {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.btn-sm { padding: 7px 14px; font-size: 0.87rem; }
.btn-lg { padding: 13px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }

.icon-btn {
  background: none;
  border: none;
  color: var(--muted);
  padding: 5px;
  border-radius: 8px;
  display: inline-flex;
  transition: color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover { color: var(--text); background: var(--surface-2); }

/* ---------- Formularios ---------- */
.form { display: flex; flex-direction: column; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; flex: 1; }

.field-row { display: flex; gap: 14px; }

.field label, .field-label { font-weight: 600; font-size: 0.92rem; }

.field input, .field textarea, .comment-input textarea {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  padding: 10px 14px;
  transition: border-color 0.15s ease;
  width: 100%;
}

.field input:focus, .field textarea:focus, .comment-input textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.field textarea, .comment-input textarea { resize: vertical; }

.hint { color: var(--muted); font-size: 0.8rem; }

.alert {
  background: rgba(255, 93, 108, 0.12);
  border: 1px solid rgba(255, 93, 108, 0.35);
  color: #ff98a2;
  border-radius: var(--r-input);
  padding: 11px 15px;
  font-size: 0.92rem;
  margin-bottom: 16px;
}

.alert-ok {
  background: rgba(69, 209, 131, 0.1);
  border-color: rgba(69, 209, 131, 0.35);
  color: #7fe3ab;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.92rem;
  color: var(--muted);
  cursor: pointer;
}

.check-line input { accent-color: var(--accent); width: 16px; height: 16px; }

.inline-form { display: inline; }

/* ---------- Autenticación ---------- */
.auth-page .main {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding-bottom: 0;
}

.auth-card {
  width: min(440px, calc(100vw - 40px));
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 36px;
  margin: 32px 0;
  box-shadow: var(--shadow);
}

.auth-title { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; }

.auth-sub { color: var(--muted); margin: 6px 0 22px; }

.auth-alt { margin-top: 20px; text-align: center; color: var(--muted); font-size: 0.92rem; }
.auth-alt a { color: var(--accent); font-weight: 600; }

.panel-soft {
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
  padding: 16px;
}

/* ---------- Portada (invitados) ---------- */
body.landing { overflow-x: hidden; }

.landing-wall {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  padding: 10px;
  z-index: -1;
  transform: rotate(-4deg) scale(1.15);
}

.landing-wall img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  opacity: 0.5;
}

.landing-scrim {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 13, 18, 0.72) 0%, rgba(11, 13, 18, 0.88) 55%, var(--bg) 100%),
    radial-gradient(80% 60% at 25% 45%, rgba(11, 13, 18, 0.3), transparent);
}

.landing-hero {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: calc(100dvh - var(--nav-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  max-width: 1240px;
}

.landing-hero h1 {
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.04;
  max-width: 13ch;
}

.landing-hero p {
  margin: 22px 0 34px;
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 46ch;
}

.landing-cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Tarjetas de póster ---------- */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 18px;
}

.hscroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-2) transparent;
}

.hscroll::-webkit-scrollbar { height: 8px; }
.hscroll::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 99px; }
.hscroll::-webkit-scrollbar-track { background: transparent; }

.poster-row .tcard { width: 152px; flex-shrink: 0; scroll-snap-align: start; }

.tcard { position: relative; }

.tcard-poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tcard-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.tcard:hover .tcard-poster {
  transform: translateY(-4px);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.tcard:hover .tcard-poster img { transform: scale(1.045); }

.tcard-type {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(9, 11, 16, 0.78);
  backdrop-filter: blur(4px);
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}

.tcard-status {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(9, 11, 16, 0.82);
}

.tcard-status.st-watched { color: var(--ok); }
.tcard-status.st-watching { color: var(--info); }
.tcard-status.st-pending { color: var(--muted); }

.tcard-rating {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(9, 11, 16, 0.82);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.tcard-add {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 2;
}

.tcard:hover .tcard-add, .tcard-add:focus-visible { opacity: 1; transform: scale(1); }

.tcard-add:hover { background: #ffc95e; }

.tcard-meta { padding: 9px 2px 0; display: flex; flex-direction: column; gap: 1px; }

.tcard-title {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tcard-title:hover { color: var(--accent); }

.tcard-sub { font-size: 0.8rem; color: var(--muted); }

/* ---------- Inicio ---------- */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}

.home-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: calc(var(--nav-h) + 24px); }

.side-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
  padding: 20px;
}

.side-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.side-card h3 .ic { color: var(--accent); }

.side-stats { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.side-stats li { color: var(--muted); font-size: 0.92rem; }

.side-stats span {
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  display: inline-block;
  min-width: 2ch;
}

.side-invite p { font-size: 0.9rem; margin-bottom: 4px; }

/* Recomendaciones "Para ti" */
.rec-card {
  display: flex;
  gap: 12px;
  width: 300px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
  padding: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
  scroll-snap-align: start;
}

.rec-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.rec-card img {
  width: 64px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.rec-card-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.rec-card-from {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.rec-card-info strong {
  font-size: 0.95rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rec-card-info em {
  font-style: italic;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Feed de actividad */
.feed { list-style: none; display: flex; flex-direction: column; }

.feed-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.feed-item:last-child { border-bottom: none; }

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

.feed-body p { font-size: 0.95rem; }

.feed-user { font-weight: 700; }
.feed-user:hover { color: var(--accent); }

.feed-title { font-weight: 600; color: var(--accent); }
.feed-title:hover { text-decoration: underline; }

.feed-time { font-size: 0.8rem; color: var(--muted); }

.feed-thumb img {
  width: 44px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 7px;
  transition: transform 0.15s ease;
}

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

/* ---------- Avatares ---------- */
.avatar {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, hsl(var(--hue) 65% 52%), hsl(calc(var(--hue) + 45) 72% 38%));
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
  user-select: none;
}

.avatar-xs { width: 22px; height: 22px; font-size: 0.65rem; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.85rem; }
.avatar-md { width: 42px; height: 42px; font-size: 1.05rem; }
.avatar-lg { width: 58px; height: 58px; font-size: 1.4rem; }
.avatar-xl { width: 88px; height: 88px; font-size: 2.1rem; }

/* ---------- Ficha de título ---------- */
body.title-page .main { padding-top: var(--nav-h); }

.title-hero { position: relative; }

.title-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--backdrop);
  background-size: cover;
  background-position: center 25%;
  opacity: 0.28;
  filter: saturate(1.1);
}

.title-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 13, 18, 0.25) 0%, rgba(11, 13, 18, 0.72) 60%, var(--bg) 100%);
}

.title-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px 20px 40px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 36px;
  align-items: end;
}

.title-poster img {
  border-radius: var(--r-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.title-info h1 {
  font-size: clamp(1.7rem, 3.6vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.title-year { color: var(--muted); font-weight: 500; }

.title-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 12px 0 4px;
  color: var(--muted);
  font-size: 0.93rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 0.8rem;
  font-weight: 600;
}

.chip-type { background: var(--surface-2); color: var(--text); }
.chip-score { background: var(--accent-soft); color: var(--accent); }
.chip-ok { background: rgba(69, 209, 131, 0.12); color: var(--ok); }

.title-director { margin-bottom: 8px; font-size: 0.93rem; }

.title-overview { max-width: 65ch; color: #c6cbd8; margin-bottom: 20px; }

.title-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.status-group {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}

.status-btn {
  border: none;
  background: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.87rem;
  padding: 7px 15px;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}

.status-btn:hover { color: var(--text); }

.status-btn.active { background: var(--accent); color: var(--accent-ink); }

.rate-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.rate-label { font-weight: 600; font-size: 0.93rem; }

.stars { display: inline-flex; gap: 2px; }

.star {
  background: none;
  border: none;
  color: var(--muted);
  padding: 2px;
  display: inline-flex;
  transition: color 0.1s ease, transform 0.1s ease;
}

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

.star.on { color: var(--accent); }
.star.on svg { fill: var(--accent); }

.rate-value { color: var(--accent); font-weight: 700; }

/* Dónde verla */
.providers { display: flex; flex-direction: column; gap: 16px; }

.prov-group h3 { font-size: 0.9rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }

.prov-list { display: flex; flex-wrap: wrap; gap: 10px; }

.prov {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

.prov img { width: 28px; height: 28px; border-radius: 7px; }

/* Notas de la peña */
.avg-badge {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 4px 13px;
  border-radius: 999px;
}

.rating-chips { display: flex; flex-wrap: wrap; gap: 10px; }

.rating-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 6px 12px 6px 7px;
  font-size: 0.9rem;
  transition: border-color 0.15s ease;
}

.rating-chip:hover { border-color: var(--muted); }

.rating-chip strong { color: var(--accent); }

/* Reparto */
.cast-row { padding-top: 4px; }

.cast-card {
  width: 100px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  line-height: 1.3;
  scroll-snap-align: start;
}

.cast-card img, .cast-noimg {
  width: 100px;
  height: 128px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--surface);
}

.cast-noimg { display: grid; place-items: center; color: var(--muted); }

.cast-card strong { font-weight: 600; }
.cast-card .muted { font-size: 0.76rem; }

/* Comentarios */
.comments { list-style: none; display: flex; flex-direction: column; gap: 18px; margin-bottom: 22px; }

.comment { display: flex; gap: 12px; }

.comment-body {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 4px 14px 14px 14px;
  padding: 11px 15px;
}

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

.comment-author { font-weight: 700; font-size: 0.92rem; }
.comment-author:hover { color: var(--accent); }

.comment-body p { font-size: 0.94rem; }

.comment-form { display: flex; gap: 12px; align-items: flex-start; }

.comment-input { flex: 1; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }

/* ---------- Perfil ---------- */
.profile-head {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.profile-id { flex: 1; min-width: 220px; }

.profile-id h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; }

.profile-bio { margin-top: 6px; max-width: 55ch; }

.profile-action { display: flex; gap: 10px; }

.profile-stats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 0.92rem;
}

.profile-stats span { color: var(--text); font-weight: 800; font-size: 1.05rem; margin-right: 4px; }

.tabs { display: flex; gap: 4px; margin-bottom: 18px; }

.tab {
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.15s ease, background 0.15s ease;
}

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

.tab.active { background: var(--surface); color: var(--text); border: 1px solid var(--line); }

.tab-count {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.78rem;
  padding: 1px 8px;
  margin-left: 4px;
}

.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.fchip {
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.fchip:hover { color: var(--text); }

.fchip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- Amigos ---------- */
.friends-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}

.people { list-style: none; display: flex; flex-direction: column; }

.person {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.person:last-child { border-bottom: none; }

.person-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.person-name { font-weight: 700; }
.person-name:hover { color: var(--accent); }

.person-info .muted { font-size: 0.83rem; }

.person-actions { display: flex; gap: 8px; }

.invite-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.invite {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-input);
  padding: 8px 12px;
  font-size: 0.9rem;
}

.invite code { color: var(--accent); font-weight: 600; letter-spacing: 0.04em; }

.invite.used { opacity: 0.55; }
.invite.used code { color: var(--muted); text-decoration: line-through; }

.invite .muted { font-size: 0.82rem; }
.invite .muted a { text-decoration: underline; }

.invite .icon-btn { margin-left: auto; }

/* ---------- Buzón ---------- */
.inbox-list { list-style: none; display: flex; flex-direction: column; gap: 16px; }

.inbox-item {
  display: flex;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
  padding: 16px;
}

.inbox-poster img {
  width: 84px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
}

.inbox-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }

.inbox-from { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.9rem; color: var(--muted); }

.inbox-from a { display: inline-flex; align-items: center; gap: 7px; }

.inbox-from a:hover strong { color: var(--accent); }

.inbox-title { font-size: 1.12rem; font-weight: 700; }
.inbox-title:hover { color: var(--accent); }

.inbox-genres { font-size: 0.84rem; }

.inbox-msg {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 12px;
  margin: 5px 0;
  color: #c6cbd8;
  font-style: italic;
  font-size: 0.94rem;
}

.inbox-actions { display: flex; gap: 10px; margin-top: 6px; align-items: center; }

/* ---------- Paneles y vacíos ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
  padding: 26px;
}

.panel h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 18px; }

.empty {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-card);
  padding: 40px 28px;
  text-align: center;
  color: var(--muted);
}

.empty strong { color: var(--text); font-size: 1.05rem; }

.empty p + p { margin-top: 6px; }

.empty-actions { display: flex; gap: 12px; justify-content: center; margin-top: 18px; }

.search-hero { text-align: left; padding: 8px 0 4px; }

.search-hero h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }

.search-hero p { margin-top: 6px; }

/* ---------- Ajustes ---------- */
.hue-row { display: flex; align-items: center; gap: 18px; }

.hue-row input[type="range"] {
  flex: 1;
  appearance: none;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    hsl(0 65% 52%), hsl(60 65% 52%), hsl(120 65% 45%),
    hsl(180 65% 45%), hsl(240 65% 58%), hsl(300 65% 52%), hsl(359 65% 52%));
  outline-offset: 4px;
}

.hue-row input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  border: 3px solid var(--bg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  cursor: grab;
}

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  bottom: 22px;
  right: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 90;
  max-width: min(360px, calc(100vw - 44px));
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 12px 17px;
  font-size: 0.93rem;
  box-shadow: var(--shadow);
  animation: toast-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.error { border-left-color: var(--danger); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.toast.out { opacity: 0; transition: opacity 0.3s ease; }

/* ---------- Modales ---------- */
.modal-root { position: relative; z-index: 80; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 14, 0.7);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade-in 0.18s ease;
}

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

.modal-card {
  width: min(500px, 100%);
  max-height: min(86dvh, 640px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  animation: pop-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.modal-head h3 { font-size: 1.1rem; font-weight: 700; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.modal-video {
  width: min(920px, 100%);
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  background: #000;
}

.friend-picks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin: 10px 0 18px;
}

.friend-pick input { position: absolute; opacity: 0; pointer-events: none; }

.friend-pick-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.friend-pick-card:hover { border-color: var(--muted); }

.friend-pick input:checked + .friend-pick-card {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.friend-pick input:focus-visible + .friend-pick-card { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .home-grid, .friends-grid { grid-template-columns: 1fr; }
  .home-side { position: static; }
  .nav-label { display: none; }
  .nav-links > a { padding: 9px; }
}

@media (max-width: 720px) {
  .nav-inner { gap: 12px; padding: 0 14px; }
  .container { padding: 0 14px; }
  .poster-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }
  .poster-row .tcard { width: 124px; }
  .title-hero-inner {
    grid-template-columns: 1fr;
    align-items: start;
    padding-top: 28px;
  }
  .title-poster { max-width: 168px; }
  .field-row { flex-direction: column; gap: 18px; }
  .auth-card { padding: 26px 20px; }
  .profile-head { gap: 14px; }
  .inbox-item { padding: 12px; gap: 12px; }
  .inbox-poster img { width: 64px; }
  .landing-wall { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
