/* ===== WikiManga · estilos globales ===== */
:root {
  --bg: #0b0f19;
  --bg-soft: #111726;
  --surface: #151c2c;
  --surface-2: #1b2438;
  --border: #263149;
  --text: #eef2f9;
  --muted: #9aa6bd;
  --brand: #3b82c4;
  --brand-bright: #5aa9e6;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --font-sans: "Sora", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(59, 130, 196, 0.18), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(90, 169, 230, 0.1), transparent 55%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(11, 15, 25, 0.72);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand img {
  height: 44px;
  width: auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text strong {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  color: var(--brand-bright);
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ===== Buscador ===== */
.search {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 460px;
  margin-left: auto;
}

.search input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

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

.search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(59, 130, 196, 0.18);
}

.search svg {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

/* ===== Hero ===== */
.hero {
  padding: 56px 0 32px;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-sans);
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: 0 0 12px;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.hero h1 .accent {
  background: linear-gradient(90deg, var(--brand-bright), var(--brand));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.hero .count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

/* ===== Grid catálogo ===== */
.catalog {
  padding: 20px 0 80px;
}

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

.card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: var(--brand);
}

.card-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

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

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

.card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 15, 25, 0.95) 0%, rgba(11, 15, 25, 0) 55%);
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(59, 130, 196, 0.9);
  color: #fff;
  backdrop-filter: blur(4px);
}

.badge-rating {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(11, 15, 25, 0.7);
  color: #ffd166;
  backdrop-filter: blur(4px);
}

.card-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 14px;
}

.card-body h3 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.98rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.card-body .meta {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--muted);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 0;
  font-size: 1.05rem;
}

/* ===== Página de detalle ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 28px 0 4px;
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--brand-bright);
}

.detail {
  padding: 24px 0 0;
}

.detail-hero {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.detail-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(0.4) saturate(1.2);
  transform: scale(1.15);
}

.detail-hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 32px;
  padding: 36px;
  background: linear-gradient(to right, rgba(11, 15, 25, 0.92), rgba(11, 15, 25, 0.72));
  flex-wrap: wrap;
}

.detail-cover {
  flex-shrink: 0;
  width: 240px;
  max-width: 100%;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.detail-cover img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.detail-info {
  flex: 1;
  min-width: 260px;
}

.detail-info h1 {
  font-family: var(--font-sans);
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  margin: 0 0 14px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.pill.type {
  background: rgba(59, 130, 196, 0.9);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-bottom: 24px;
}

.stat .label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.stat .value {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 600;
}

.stat .value.star {
  color: #ffd166;
}

.section-title {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.synopsis {
  color: #cdd6e8;
  font-size: 1.02rem;
  max-width: 760px;
}

.not-found {
  text-align: center;
  padding: 100px 20px;
}

.not-found h1 {
  font-family: var(--font-sans);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-bright), var(--brand));
  color: #fff;
  font-weight: 600;
  font-family: var(--font-sans);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 196, 0.4);
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.footer-nav a {
  color: var(--muted);
  transition: color 0.15s;
}

.footer-nav a:hover {
  color: var(--brand-bright);
}

@media (max-width: 640px) {
  .header-inner {
    gap: 12px;
    justify-content: center;
  }
  .brand {
    flex-basis: 100%;
    justify-content: center;
  }
  .main-nav {
    flex-basis: 100%;
    justify-content: center;
  }
  .auth-slot {
    flex-basis: 100%;
    justify-content: center;
  }
  .search {
    order: 3;
    max-width: 100%;
    margin-left: 0;
    flex-basis: 100%;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
  }
  .detail-hero-inner {
    padding: 20px;
  }
  .detail-cover {
    width: 160px;
    margin: 0 auto;
  }
}

/* ===== Navegación principal ===== */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.main-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

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

.main-nav a.active {
  color: #fff;
  background: var(--brand);
}

/* ===== Botones genéricos ===== */
.auth-slot {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
  vertical-align: middle;
}

.btn-outline:hover {
  border-color: var(--brand-bright);
  color: var(--brand-bright);
}

button.btn {
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-block {
  display: flex;
  width: 100%;
  justify-content: center;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

.btn-secondary:hover {
  border-color: var(--brand-bright);
  transform: translateY(-2px);
}

.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}

.btn-share:hover {
  border-color: var(--brand-bright);
  color: var(--brand-bright);
  transform: translateY(-2px);
}

.btn-danger-text {
  border: none;
  background: none;
  color: #e57373;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0;
}

.btn-danger-text:hover {
  text-decoration: underline;
}

/* ===== Menú de usuario ===== */
.user-menu {
  position: relative;
  flex-shrink: 0;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  max-width: 220px;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-bright), var(--brand));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-sans);
  flex-shrink: 0;
}

.user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 60;
  display: flex;
  flex-direction: column;
}

/* Igual que con el modal y las pestañas de autenticación: sin esto, el
   display:flex de arriba gana la partida al [hidden] del navegador y el
   menú de "Mi perfil / Cerrar sesión" se queda visible todo el rato. */
.user-menu-dropdown[hidden] {
  display: none;
}

.user-menu-dropdown a,
.user-menu-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
}

.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover {
  background: var(--surface-2);
}

/* ===== Modal de autenticación ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 8, 14, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px 24px;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

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

.modal-lg {
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
}

.modal-title {
  font-family: var(--font-sans);
  font-size: 1.3rem;
  margin: 0 0 18px;
}

/* ===== Listas de la comunidad ===== */
.lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.list-card {
  display: flex;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

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

.list-card-body h3 {
  font-family: var(--font-sans);
  font-size: 1rem;
  margin: 0 0 6px;
}

.list-card-desc {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.list-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  margin-bottom: 12px;
}

.list-card-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.list-view-author {
  color: var(--muted);
  font-size: 0.85rem;
  margin: -10px 0 14px;
}

.list-view-desc {
  color: #cdd6e8;
  font-size: 0.92rem;
  margin-bottom: 18px;
}

.list-view-grid {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

/* ===== Selector de obras al crear una lista ===== */
.list-picker-label {
  display: block;
  margin-top: 4px;
}

.list-picker-label input[type="search"] {
  margin-top: 6px;
}

.list-picker {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.list-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.86rem;
}

.list-picker-item:hover {
  background: var(--surface-2);
}

.list-picker-item img {
  width: 28px;
  height: 38px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.list-picker-item input {
  flex-shrink: 0;
}

.list-picker-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.list-picker-empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.list-picker-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.78rem;
  color: var(--brand-bright);
}

.list-visibility-field {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-visibility-field legend {
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0;
  margin-bottom: 2px;
}

.list-visibility-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
}

.list-visibility-option:has(input:checked) {
  border-color: var(--brand-bright);
  background: rgba(59, 130, 196, 0.1);
}

.list-visibility-option input {
  margin-top: 3px;
  flex-shrink: 0;
}

.list-visibility-option span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.list-visibility-option small {
  color: var(--muted);
  font-weight: 400;
}

.list-vis-badge {
  color: var(--brand-bright);
  font-weight: 600;
}

.my-lists {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.my-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.my-list-item h3 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  margin: 0 0 4px;
}

.my-list-meta {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0;
}

.my-list-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
  background: var(--surface-2);
  border-radius: 999px;
  padding: 4px;
}

.auth-tabs[hidden] {
  display: none;
}

.auth-tab {
  flex: 1;
  padding: 9px 0;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--brand);
  color: #fff;
}

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

/* El atributo [hidden] necesita más especificidad que ".auth-form"
   (display:flex) para poder ocultar el formulario inactivo. Sin esto,
   los dos formularios (entrar / crear cuenta) se ven a la vez. */
.auth-form[hidden] {
  display: none;
}

.auth-forgot {
  background: none;
  border: none;
  color: var(--brand-bright);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
  align-self: flex-end;
  margin-top: -6px;
}

.auth-forgot:hover {
  text-decoration: underline;
}

.auth-back {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

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

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.auth-form input,
.auth-form textarea {
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font-sans-body, inherit);
  outline: none;
  resize: vertical;
}

.auth-form input:focus,
.auth-form textarea:focus {
  border-color: var(--brand);
}

.auth-hint {
  margin: -6px 0 0;
  font-size: 0.76rem;
  color: var(--muted);
}

.auth-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(229, 115, 115, 0.12);
  border: 1px solid rgba(229, 115, 115, 0.35);
  color: #f2a5a5;
  font-size: 0.82rem;
}

.auth-success {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(90, 230, 150, 0.1);
  border: 1px solid rgba(90, 230, 150, 0.3);
  color: #9fe6bb;
  font-size: 0.82rem;
}

/* ===== Secciones de la home ===== */
.home-section {
  padding: 36px 0;
}

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

.home-section-head h2 {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  margin: 0;
  letter-spacing: -0.01em;
}

.home-section-head .see-all {
  font-size: 0.85rem;
  color: var(--brand-bright);
  flex-shrink: 0;
}

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 168px;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}

.rail .card {
  scroll-snap-align: start;
}

.rail-2rows {
  grid-template-rows: repeat(2, 1fr);
}

.rail::-webkit-scrollbar {
  height: 8px;
}

.rail::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 999px;
}

/* ===== Botón "¿No sabes qué leer?" ===== */
/* ===== Huecos de anuncios (Ezoic) ===== */
.ad-slot {
  margin: 8px auto 28px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ad-slot-label {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.7;
}

/* ===== Aviso de cookies ===== */
.cookie-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.cookie-bar p {
  margin: 0;
  font-size: 0.85rem;
  color: #cdd6e8;
  flex: 1;
  min-width: 220px;
}

.cookie-bar a {
  color: var(--brand-bright);
}

.cookie-bar-accept {
  margin: 0;
  flex-shrink: 0;
  padding: 10px 22px;
}

.random-section {
  display: flex;
  justify-content: center;
  padding: 12px 0 48px;
}

.btn-random {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px 14px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-sans);
  text-align: left;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-random:hover {
  border-color: var(--brand-bright);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(59, 130, 196, 0.25);
}

.btn-random-cover {
  width: 52px;
  height: 68px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s ease-out;
}

.btn-random.is-spinning .btn-random-cover {
  animation: wm-random-spin 0.35s linear infinite;
}

@keyframes wm-random-spin {
  0% { transform: perspective(300px) rotateY(0deg) scale(1); }
  50% { transform: perspective(300px) rotateY(180deg) scale(0.92); }
  100% { transform: perspective(300px) rotateY(360deg) scale(1); }
}

.btn-random-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.btn-random-label strong {
  font-size: 1rem;
  color: var(--text);
}

.btn-random-label span {
  font-size: 0.82rem;
  color: var(--muted);
}

.card-cover .chapter-flag {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 5px 10px;
  font-size: 0.7rem;
  color: var(--muted);
  background: linear-gradient(to top, rgba(11,15,25,0.98), rgba(11,15,25,0));
}

/* ===== Catálogo con filtros ===== */
.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.catalog-toolbar select,
.catalog-toolbar .filter-btn {
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
}

.catalog-toolbar select:focus {
  outline: none;
  border-color: var(--brand);
}

.genre-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.genre-chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
}

.genre-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.toolbar-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-right: -4px;
}

/* ===== Botón seguir + progreso de capítulos ===== */
.follow-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 22px 0;
}

/* ===== Enlaces de lectura oficiales ===== */
.official-links-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 24px;
  margin-bottom: 40px;
}

.official-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.official-link-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.92rem;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

.official-link-card:hover {
  border-color: var(--brand-bright);
  background: rgba(59, 130, 196, 0.12);
  transform: translateY(-2px);
}

.official-link-card img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.official-link-card svg {
  color: var(--muted);
  flex-shrink: 0;
}

.detail-description {
  max-width: 760px;
  margin-bottom: 40px;
}

.btn-follow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.btn-follow.is-following {
  background: transparent;
  color: var(--brand-bright);
}

.btn-follow:hover {
  transform: translateY(-2px);
}

.btn-follow:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.progress-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  margin: 0 0 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}

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

.progress-box label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.progress-box input[type="number"] {
  width: 90px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.95rem;
}

.progress-bar-track {
  flex: 1;
  min-width: 140px;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-bright), var(--brand));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-hint {
  font-size: 0.78rem;
  color: var(--muted);
  width: 100%;
}

/* ===== Recomendados ===== */
.recommend-section {
  margin-top: 48px;
}

/* ===== Comentarios ===== */
.comments-section {
  margin-top: 48px;
  max-width: 760px;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.comment-form textarea {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  resize: vertical;
  min-height: 80px;
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--brand);
}

.comment-login-hint {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 24px;
}

.comment-login-hint button {
  background: none;
  border: none;
  color: var(--brand-bright);
  cursor: pointer;
  font-weight: 600;
  padding: 0;
  font-size: inherit;
}

.comment {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

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

.comment-main {
  flex: 1;
  min-width: 0;
}

.comment-upvote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  width: 44px;
  padding: 8px 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  transition: border-color 0.15s, color 0.15s, transform 0.15s;
}

.comment-upvote:hover {
  border-color: var(--brand-bright);
  color: var(--brand-bright);
  transform: translateY(-1px);
}

.comment-upvote.is-voted {
  border-color: var(--brand-bright);
  background: rgba(59, 130, 196, 0.16);
  color: var(--brand-bright);
}

.comment-upvote:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.comments-sort {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  cursor: pointer;
}

.comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.comment-author {
  font-weight: 600;
  font-size: 0.88rem;
}

.comment-date {
  font-size: 0.74rem;
  color: var(--muted);
}

.comment-body {
  color: #cdd6e8;
  font-size: 0.92rem;
  white-space: pre-wrap;
}

.no-comments {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ===== Página de perfil ===== */
.profile-head {
  padding: 40px 0 24px;
}

.profile-username-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.profile-head h1 {
  font-family: var(--font-sans);
  font-size: 2rem;
  margin: 0;
}

.profile-email {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 6px;
}

.btn-edit-username {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.btn-edit-username:hover {
  color: var(--text);
  border-color: var(--accent);
}

.username-edit-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
}

.input-inline {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  padding: 7px 12px;
  width: 220px;
  outline: none;
}

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

.btn-sm {
  padding: 7px 14px;
  font-size: 0.85rem;
}

.btn-text {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 6px;
}

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

.profile-head p {
  color: var(--muted);
  margin: 0;
}

.following-list {
  display: grid;
  gap: 14px;
  padding-bottom: 60px;
}

.following-item {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.following-item a {
  color: inherit;
  text-decoration: none;
}

.following-item img {
  width: 64px;
  height: 86px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}

.following-item .info {
  flex: 1;
  min-width: 160px;
}

.following-item h3 {
  margin: 0 0 4px;
  font-family: var(--font-sans);
  font-size: 1rem;
}

.following-item .progress-bar-track {
  margin-top: 8px;
  max-width: 220px;
}

.following-item .chapters-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state a {
  color: var(--brand-bright);
  font-weight: 600;
}

@media (max-width: 640px) {
  .main-nav {
    order: 2;
  }
  .user-email {
    display: none;
  }
  .rail {
    grid-auto-columns: 132px;
  }
}

/* ===== Valoración editable (perfil) ===== */
.user-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

.user-rating .rating-label {
  font-size: 0.74rem;
  color: var(--muted);
  margin-right: 4px;
}

.rating-star-btn {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--border);
  line-height: 0;
  transition: color 0.15s, transform 0.15s;
}

.rating-star-btn svg {
  width: 18px;
  height: 18px;
}

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

.rating-star-btn.filled {
  color: #f5b942;
}

.rating-clear-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0 0 0 6px;
}

.rating-clear-btn:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ===== Acerca de: contacto y salón de la fama ===== */
.about-content {
  padding: 60px 0 80px;
  max-width: 780px;
  margin: 0 auto;
}

.about-content h1 {
  font-family: var(--font-sans);
  font-size: 2.1rem;
  margin: 0 0 10px;
  text-align: center;
}

.about-content > p.about-lead {
  text-align: center;
  color: var(--muted);
  margin: 0 0 44px;
}

.legal-content {
  padding: 56px 0 90px;
  max-width: 760px;
  margin: 0 auto;
}

.legal-content h1 {
  font-family: var(--font-sans);
  font-size: 1.9rem;
  margin: 0 0 6px;
}

.legal-content .legal-updated {
  color: var(--muted);
  font-size: 0.84rem;
  margin: 0 0 36px;
}

.legal-content h2 {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  margin: 34px 0 12px;
}

.legal-content p,
.legal-content li {
  color: #cdd6e8;
  font-size: 0.94rem;
  line-height: 1.7;
}

.legal-content ul,
.legal-content ol {
  padding-left: 22px;
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legal-content a {
  color: var(--brand-bright);
}

.legal-nav-back {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 0.86rem;
}

.legal-nav-back:hover {
  color: var(--brand-bright);
}

.contact-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 22px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 56px;
  text-align: center;
}

.contact-card svg {
  color: var(--brand-bright);
  flex-shrink: 0;
}

.contact-card a {
  color: var(--brand-bright);
  font-weight: 600;
}

.hof-title {
  text-align: center;
  font-family: var(--font-sans);
  font-size: 1.5rem;
  margin: 0 0 6px;
  background: linear-gradient(90deg, var(--brand-bright), #f5b942, var(--brand-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.02em;
}

.hof-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0 0 28px;
}

.hof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
}

.hof-card {
  position: relative;
  padding: 26px 18px 22px;
  border-radius: 18px;
  text-align: center;
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  overflow: hidden;
}

.hof-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% -20%, rgba(120, 130, 255, 0.22), transparent 60%);
  pointer-events: none;
}

.hof-card.owner {
  border-color: rgba(245, 185, 66, 0.4);
}

.hof-card.owner::before {
  background: radial-gradient(circle at 50% -20%, rgba(245, 185, 66, 0.28), transparent 60%);
}

.hof-medal {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(245, 185, 66, 0.14);
  color: #f5b942;
  position: relative;
}

.hof-card:not(.owner) .hof-medal {
  background: rgba(140, 150, 255, 0.14);
  color: var(--brand-bright);
}

.hof-name {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.02rem;
  margin: 0 0 4px;
  position: relative;
}

.hof-role {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  position: relative;
}

.hof-card.owner .hof-role {
  color: #f5b942;
}

.hof-more {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 28px;
}
