
:root {
  color-scheme: light;
  --page: #F8F4FC;
  --surface: rgba(255, 255, 255, .82);
  --surface-solid: #FFFFFF;
  --text: #29243D;
  --muted: #746A89;
  --border: #E5D9F0;

  /* Rosa como firma, violeta como identidad */
  --accent: #C875B8;
  --accent-strong: #A95098;
  --accent-soft: #F3E5F5;

  --shadow: 0 14px 40px rgba(62, 38, 91, .10);

  /* Cielo claro: lavanda visible y rosa sutil */
  --hero-start: #F5E7F7;
  --hero-end: #D6C5F5;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #090711;
  --surface: rgba(22, 17, 35, .86);
  --surface-solid: #161020;
  --text: #F4F1FF;
  --muted: #B1A8C9;
  --border: #342541;
  --accent: #E5A0D1;
  --accent-strong: #F0B2DF;
  --accent-soft: #2B1B32;
  --shadow: 0 14px 40px rgba(0, 0, 0, .35);
  --hero-start: #171020;
  --hero-end: #402448;
}

/* Configuración general */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  transition: background .2s ease, color .2s ease;
}

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

img {
  max-width: 100%;
}

/* Encabezado */

.site-header {
  min-height: 76px;
  padding: 0 clamp(20px, 5vw, 76px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -.03em;
}

.brand-star {
  color: var(--accent);
  font-size: 1.7rem;
  line-height: 1;
}

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

.theme-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--accent-soft);
}

/* Botones */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform .18s ease,
    background .18s ease,
    border-color .18s ease,
    color .18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

.button-primary:hover {
  background: var(--accent-strong);
}

.button-quiet,
.button-outline {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: transparent;
}

:root[data-theme="dark"] .button-quiet,
:root[data-theme="dark"] .button-outline {
  color: var(--text);
}


/* =========================================================
   Portada principal: carrusel integrado con el texto
   ========================================================= */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;

  min-height: 400px;
  display: flex;
  align-items: center;
  padding: 56px clamp(24px, 9vw, 140px);

  /* Fondo visible mientras cargan las imágenes */
  background: linear-gradient(
    112deg,
    var(--hero-start) 0%,
    var(--hero-end) 100%
  );

  border-bottom: 1px solid var(--border);
}

.hero-copy {
  position: relative;
  z-index: 3;
  width: 55%;
  max-width: 540px;
}

/* Imagen extendida por toda la portada */
.hero-carousel {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 1;
}

/*
   El degradado mezcla el cielo de fondo con las imágenes.
   A la izquierda conserva legibilidad; a la derecha
   deja que se aprecie más la ilustración.
*/
.hero-carousel::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;

  background: linear-gradient(
    90deg,
    var(--hero-start) 0%,
    color-mix(in srgb, var(--hero-start) 94%, transparent) 13%,
    color-mix(in srgb, var(--hero-start) 76%, transparent) 29%,
    color-mix(in srgb, var(--hero-start) 48%, transparent) 44%,
    color-mix(in srgb, var(--hero-start) 18%, transparent) 64%,
    transparent 100%
  );
}

/* Carrusel horizontal */
.hero-carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transform: translateX(0);
  transition: transform 900ms cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}

.hero-slide {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.hero-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Texto de la portada */
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .72rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.16;
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  letter-spacing: -.045em;
}

h1 span {
  color: var(--accent);
}

.hero-description {
  margin: 18px 0 24px;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}


/* =========================================================
   Catálogo de novelas: portadas completas y texto integrado
   ========================================================= */

.novels-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 56px clamp(20px, 5vw, 76px) 68px;
}

.novel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.novel-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: 2 / 3;

  border: none;
  border-radius: 0;
  background: var(--page);
  box-shadow: none;

  transition: transform .25s ease;
}

.novel-card:hover {
  transform: translateY(-4px);
  box-shadow: none;
}

/* La imagen cubre la tarjeta sin recortar la portada */
.cover {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: grid;
  place-items: center;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: none;
  border-radius: 0;
  background: var(--page);
}

.cover-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: var(--page);
}


/* Degradado rosa suave para el tema claro */
.novel-card::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        transparent 35%,
        rgba(232, 170, 213, 0.08) 50%,
        rgba(196, 119, 177, 0.48) 75%,
        rgba(137, 76, 126, 0.78) 100%
    );
}

/* Degradado oscuro original para el tema oscuro */
:root[data-theme="dark"] .novel-card::before {
    background: linear-gradient(
        180deg,
        transparent 28%,
    rgba(20, 12, 30, .10) 45%,
    rgba(20, 12, 30, .66) 72%,
    rgba(20, 12, 30, .94) 100%
    );
}

/* Texto superpuesto */
.novel-info {
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  padding: clamp(12px, 2vw, 24px);
  color: #FFFFFF;
}

.novel-info h3 {
  margin: 0 0 10px;
  font-size: clamp(1rem, 1.7vw, 1.45rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.novel-info h3 a {
  color: #FFFFFF;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .25);
}

.novel-info h3 a:hover {
  color: #F0B2DF;
}

.novel-info p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;

  margin: 0 0 14px;
  color: rgba(255, 255, 255, .88);
  font-size: .88rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.read-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #F0B2DF;
  font-size: .88rem;
  font-weight: 700;
}

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

/* Tablets: dos novelas por fila */
@media (max-width: 800px) {
  .novel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}

/* Móviles: mantener dos novelas por fila */
@media (max-width: 540px) {
  .novels-section {
    padding: 42px 14px 48px;
  }

  .novel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .novel-card {
    aspect-ratio: 2 / 3;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .novel-info {
    padding: 10px;
  }

  .novel-info h3 {
    font-size: clamp(.85rem, 3.5vw, 1rem);
    margin-bottom: 7px;
  }

  .novel-info p {
    font-size: .75rem;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    margin-bottom: 7px;
  }

  .read-link {
    font-size: .75rem;
  }
}


/* Portada de respaldo cuando una novela no tiene imagen */
.cover-placeholder {
  position: relative;
  z-index: 0;
  color: var(--accent-strong);
  font-size: 2.8rem;
}

.cover-placeholder-title {
  position: relative;
  z-index: 0;
  max-width: 80%;
  padding: 12px;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* Texto superpuesto en la parte inferior */

/* Texto superpuesto: siempre blanco en ambos temas */
.novel-info {
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  padding: clamp(12px, 2vw, 24px);
  color: #FFFFFF;
}

.novel-info h3 a {
  color: #FFFFFF;
}

.novel-info p {
  color: rgba(255, 255, 255, .9);
}

.read-link {
  color: #F0B2DF;
}

/* Mantener el texto blanco incluso en tema claro */
:root:not([data-theme="dark"]) .novel-info,
:root:not([data-theme="dark"]) .novel-info h3 a,
:root:not([data-theme="dark"]) .novel-info p {
  color: #FFFFFF;
}

:root:not([data-theme="dark"]) .read-link {
  color: #F0B2DF;
}


.novel-info h3 {
  margin: 0 0 10px;
  font-size: clamp(1.1rem, 1.7vw, 1.45rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.novel-info h3 a {
  color: var(--text);
  text-shadow: 0 1px 12px rgba(0, 0, 0, .08);
}

.novel-info h3 a:hover {
  color: var(--accent-strong);
}

.novel-info p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;

  margin: 0 0 14px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.read-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  color: var(--accent-strong);
  font-size: .88rem;
  font-weight: 700;
}

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

:root[data-theme="dark"] .novel-info h3 a,
:root[data-theme="dark"] .novel-info p {
  color: #F4F1FF;
}

:root[data-theme="dark"] .read-link {
  color: #F0B2DF;
}

/* Tablet */
@media (max-width: 800px) {
  .novel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}

/* Teléfonos */
@media (max-width: 540px) {
  .novel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .novel-card {
    aspect-ratio: 2 / 3;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .cover {
    border: none;
    border-radius: 0;
  }

  .novel-info {
    padding: 12px;
  }

  .novel-info h3 {
    font-size: 1rem;
  }

  .novel-info p {
    font-size: .8rem;
    -webkit-line-clamp: 2;
    margin-bottom: 9px;
  }

  .read-link {
    font-size: .8rem;
  }
}

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



.catalog-message {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

/* Pie de página */

.site-footer {
  padding: 28px clamp(20px, 5vw, 76px) 18px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand {
  font-size: 1.1rem;
}

.footer-tagline {
  margin: 0;
  color: var(--muted);
  font-size: .85rem;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .82rem;
}

.footer-links a:hover {
  color: var(--accent-strong);
}

.copyright {
  margin: 25px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: .75rem;
}

/* Tablets */

@media (max-width: 800px) {
  


  .novel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-top {
    justify-content: center;
    text-align: center;
  }
}

/* Teléfonos */

@media (max-width: 540px) {
  .site-header {
    padding: 14px 16px;
    flex-wrap: wrap;
  }

  .brand {
    font-size: 1.12rem;
  }

  .header-actions {
    gap: 7px;
  }

  .button {
    min-height: 38px;
    padding: 0 12px;
    font-size: .82rem;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
  }

  .hero {
    min-height: 340px;
    padding: 42px 22px;
  }

  .hero {
  min-height: 340px;
  padding: 42px 22px;
}

.hero-copy {
  width: 100%;
  max-width: 390px;
}

.hero-carousel {
  left: 12%;
  opacity: .72;
}

.hero-carousel::before {
  background: linear-gradient(
    90deg,
    var(--hero-start) 0%,
    color-mix(in srgb, var(--hero-start) 90%, transparent) 30%,
    color-mix(in srgb, var(--hero-start) 45%, transparent) 68%,
    transparent 100%
  );
}

  .desktop-break {
    display: none;
  }

  .novels-section {
    padding: 42px 16px 48px;
  }

  .footer-links {
    justify-content: center;
    gap: 14px;
  }
}

.account-greeting {
    max-width: 220px;
    overflow-wrap: anywhere;
    font-size: 0.92rem;
}

.logout-form {
    display: inline-flex;
    margin: 0;
}

@media (max-width: 520px) {
    .account-greeting {
        max-width: 110px;
        font-size: 0.8rem;
    }

    .header-actions {
        gap: 0.45rem;
    }
}

/* Accesibilidad: reducir animaciones */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }

  .novel-card:hover,
  .button:hover {
    transform: none;
  }
}


/* =========================================================
   Ficha de novela
   ========================================================= */

.novel-page {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 30px 0 76px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: .86rem;
}

.breadcrumbs a {
  color: var(--accent-strong);
  font-weight: 600;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs span:last-child {
  overflow-wrap: anywhere;
}

/* Portada e información */

.novel-detail {
  display: grid;
  grid-template-columns: minmax(220px, 310px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(28px, 5vw, 58px);
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-cover {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(
    145deg,
    var(--accent-soft),
    var(--hero-end)
  );
  box-shadow: 0 18px 42px rgba(62, 48, 119, .13);
}

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

.detail-cover-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  height: 100%;
  padding: 24px;
  text-align: center;
  color: var(--accent-strong);
}

.detail-cover-placeholder > span {
  font-size: 3rem;
}

.detail-cover-placeholder p {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.detail-information {
  min-width: 0;
  padding: 8px 0;
}

.detail-information .eyebrow {
  margin-bottom: 14px;
}

.detail-information h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.35rem);
  overflow-wrap: anywhere;
}

.novel-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

.novel-metadata span,
.chapter-count {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: .78rem;
  font-weight: 600;
}

:root[data-theme="dark"] .novel-metadata span,
:root[data-theme="dark"] .chapter-count {
  color: var(--text);
}

.detail-description {
  margin-top: 25px;
  color: var(--muted);
  font-size: .97rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.detail-description p {
  margin: 0 0 14px;
}

.detail-read-button {
  display: inline-flex;
  gap: 10px;
  margin-top: 24px;
  min-height: 48px;
  padding: 0 24px;
}

.chapters-empty {
  margin-top: 22px;
  color: var(--muted);
  font-size: .9rem;
}

/* Lista de capítulos */

.chapters-section {
  margin-top: 52px;
}

.chapters-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.chapters-heading .eyebrow {
  margin-bottom: 7px;
}

.chapters-heading h2 {
  overflow-wrap: anywhere;
}

.chapter-list {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chapter-item {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease;
}

.chapter-item:hover {
  transform: translateX(3px);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.chapter-number {
  flex: 0 0 43px;
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

:root[data-theme="dark"] .chapter-number {
  color: var(--text);
}

.chapter-information {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.chapter-title {
  font-weight: 650;
  overflow-wrap: anywhere;
}

.chapter-date {
  color: var(--muted);
  font-size: .78rem;
}

.chapter-arrow {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 1.25rem;
}

:root[data-theme="dark"] .chapter-arrow {
  color: var(--accent);
}

.chapters-empty-panel,
.novel-message {
  padding: 38px 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  text-align: center;
  box-shadow: var(--shadow);
}

.chapters-empty-panel > span,
.message-star {
  color: var(--accent);
  font-size: 2rem;
}

.chapters-empty-panel p,
.novel-message p {
  color: var(--muted);
}

.chapters-empty-panel p:last-child {
  margin-bottom: 0;
}

.novel-message {
  max-width: 700px;
  margin: 55px auto;
}

.novel-message h1 {
  margin-top: 12px;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.novel-message .button {
  margin-top: 12px;
}

/* Adaptación a móviles */

@media (max-width: 700px) {
  .novel-page {
    width: min(100% - 32px, 560px);
    padding-top: 22px;
    padding-bottom: 50px;
  }

  .novel-detail {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding: 22px;
    border-radius: 19px;
  }

  .detail-cover {
    width: min(100%, 260px);
    margin: 0 auto;
  }

  .detail-information {
    padding: 0;
  }

  .detail-information h1 {
    font-size: clamp(1.9rem, 8vw, 2.7rem);
  }

  .chapters-section {
    margin-top: 38px;
  }

  .chapter-item {
    gap: 12px;
    padding: 13px;
  }

  .chapter-number {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 420px) {
  .chapters-heading {
    align-items: start;
    flex-direction: column;
  }

  .novel-metadata {
    gap: 7px;
  }

  .chapter-arrow {
    font-size: 1.05rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chapter-item:hover {
    transform: none;
  }
}


/* =========================================================
   Menú desplegable principal
   ========================================================= */

.header-brand-group {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.site-menu {
    position: relative;
    flex: 0 0 auto;
}

.menu-toggle {
    width: 42px;
    height: 42px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease;
}

.menu-toggle:hover,
.menu-toggle[aria-expanded="true"] {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent-strong);
    transition: transform .18s ease, opacity .18s ease;
}

.menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-7px) rotate(-45deg);
}

.menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 1000;
    width: 220px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-solid);
    box-shadow: var(--shadow);
}

.menu-dropdown[hidden] {
    display: none !important;
}

.menu-dropdown a {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 9px;
    color: var(--text);
    font-size: .92rem;
    font-weight: 600;
    transition: background .18s ease, color .18s ease;
}

.menu-dropdown a span {
    color: var(--accent-strong);
    font-size: 1.2rem;
}

.menu-dropdown a:hover {
    background: var(--accent-soft);
    color: var(--accent-strong);
}


/* =========================================================
   Estadísticas y valoraciones de novelas
   ========================================================= */

.novel-statistics {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 14px;
    margin-top: 24px;
}

.novel-rating-summary,
.novel-views-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--accent-soft);
}

.novel-rating-stars {
    display: inline-flex;
    gap: 1px;
    color: var(--accent-strong);
    font-size: 1.2rem;
    letter-spacing: .02em;
}

.novel-rating-average,
.novel-views-summary strong {
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
}

.novel-rating-percent {
    padding: 3px 7px;
    border-radius: 7px;
    background: var(--surface-solid);
    color: var(--accent-strong);
    font-size: .8rem;
    font-weight: 700;
}

.novel-stat-label {
    color: var(--muted);
    font-size: .82rem;
}

.novel-views-summary {
    gap: 8px;
}

.novel-stat-icon {
    color: var(--accent-strong);
    font-size: 1.2rem;
}

.novel-rating-panel {
    margin-top: 22px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}

.novel-rating-panel h2 {
    margin: 0 0 15px;
    font-size: 1.35rem;
}

.novel-rating-panel > p {
    color: var(--muted);
    font-size: .9rem;
}

.novel-rating-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 22px;
}

.rating-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.rating-fieldset legend {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: .85rem;
}

.rating-options {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 3px;
}

.rating-options input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.rating-options label {
    color: var(--border);
    font-size: 2rem;
    line-height: 1.2;
    cursor: pointer;
    transition: color .15s ease, transform .15s ease;
}

/* Destacar la puntuación seleccionada y sus estrellas anteriores. */
.rating-options input:checked ~ label,
.rating-options label:hover,
.rating-options label:hover ~ label {
    color: var(--accent-strong);
}

.rating-options label:hover {
    transform: scale(1.1);
}

.rating-options input:focus-visible + label {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

.rating-message {
    margin: 0 0 14px;
    padding: 10px 13px;
    border-radius: 10px;
    font-size: .88rem;
}

.rating-message.success {
    border: 1px solid var(--border);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.rating-message.error {
    border: 1px solid #d98a9b;
    background: var(--surface);
    color: #b42345;
}

:root[data-theme="dark"] .rating-message.error {
    color: #ffb4c2;
}

@media (max-width: 540px) {
    .novel-statistics {
        flex-direction: column;
    }

    .novel-rating-summary,
    .novel-views-summary {
        justify-content: flex-start;
    }

    .novel-rating-panel {
        padding: 17px;
    }

    .novel-rating-form {
        align-items: flex-start;
        flex-direction: column;
    }
}


@media (max-width: 540px) {
    .header-brand-group {
        gap: 10px;
    }

    .menu-toggle {
        width: 38px;
        height: 38px;
    }

    .menu-dropdown {
        width: 200px;
    }
}



/* =========================================================
   Ajustes responsive del hero
   ========================================================= */

/* Tablets */
@media (max-width: 800px) {
  .hero {
    min-height: 380px;
    padding: 48px clamp(24px, 6vw, 60px);
  }

  .hero-copy {
    width: 65%;
  }

  .hero-carousel {
    inset: 0;
  }

  .hero-carousel::before {
    background: linear-gradient(
      90deg,
      var(--hero-start) 0%,
      color-mix(in srgb, var(--hero-start) 88%, transparent) 20%,
      color-mix(in srgb, var(--hero-start) 60%, transparent) 43%,
      color-mix(in srgb, var(--hero-start) 20%, transparent) 70%,
      transparent 100%
    );
  }
}

/* Teléfonos */
@media (max-width: 540px) {
  .hero {
    min-height: 360px;
    padding: 42px 22px;
  }

  .hero-copy {
    width: 100%;
    max-width: 390px;
  }

  .hero-carousel {
    inset: 0;
    opacity: 1;
  }

  .hero-carousel::before {
    background: linear-gradient(
      90deg,
      var(--hero-start) 0%,
      color-mix(in srgb, var(--hero-start) 86%, transparent) 26%,
      color-mix(in srgb, var(--hero-start) 65%, transparent) 48%,
      color-mix(in srgb, var(--hero-start) 32%, transparent) 73%,
      color-mix(in srgb, var(--hero-start) 15%, transparent) 100%
    );
  }
}
