:root {
  --roxo: #696969;
  --roxo-escuro: #3d3d3d;
  --fundo: #fdfdfd;
  --fundo-escuro: #4a4a4a;
  --texto: #222;
  --texto-claro: #ffffff;
  --highlight: #8a8a8a;
  --lilas-escuro: #b5b5b5;
  --card-bg-light: #ffffff;
  --card-bg-dark: #5c5c5c;
  --borda-sutil: rgba(120, 120, 120, 0.3);
  --sombra-card: 0 12px 35px -8px rgba(0, 0, 0, 0.08);
  --sombra-card-dark: 0 12px 35px -8px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Georgia', serif;
  background: var(--fundo);
  color: var(--texto);
  overflow-x: hidden;
  width: 100%;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.transp {
    background: #FFF;
}

#progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background-color: #d6d6d6;
  z-index: 2000;
}

#progress-bar {
  height: 100%;
  background-color: var(--roxo);
  width: 0%;
  transition: width 0.2s;
}

.toggle-btn {
  position: fixed;
  left: 15px;
  top: 15px;
  background: var(--roxo);
  color: white;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 1003;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, background 0.2s ease;
}

.toggle-btn:hover {
  transform: scale(1.08);
  background: var(--roxo-escuro);
}

.container {
  display: flex;
  flex-direction: row;
  transition: all 0.3s ease;
  width: 100%;
  overflow-x: hidden;
}

.header-bar {
  width: 100%;
  height: 45px;
  background-color: var(--roxo);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1001;
  margin: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.info {
  color: var(--highlight);
}

#email {
  text-decoration: none;
  color: #5e5d5d;
  font-weight: 300;
}

/* SIDEBAR CORRIGIDA PARA LIBERAR CLIQUES */
.sidebar {
  width: 300px;
  background: #f2f2f3;
  border-right: 2px solid var(--borda-sutil);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 0 24px 24px 0;
  position: fixed;
  top: 45px;
  bottom: 0;
  left: 0;
  z-index: 1001;
  transform: translateX(-100%);
  transition: transform 0.35s ease;
  overflow-y: auto;
  box-shadow: 5px 0 25px rgba(0,0,0,0.06);
  pointer-events: none;
}

.sidebar.open {
  transform: translateX(0);
  pointer-events: auto;
}

.sidebar * {
  pointer-events: auto;
}

.album-cover {
  width: 150px;
  height: 150px;
  border-radius: 14px;
  object-fit: cover;
  margin-bottom: -30px;
  z-index: 2;
  position: relative;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  border: 2px solid white;
}

.cylinder-label {
  background: var(--roxo);
  color: #fff;
  padding: 8px 16px;
  border-radius: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: bold;
  position: relative;
  top: -35px;
  z-index: 1;
  width: 170px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cylinder-label .artista {
  font-size: 0.75rem;
}

.cylinder-label .album {
  font-size: 0.6rem;
  opacity: 0.9;
}

.musica {
  font-size: 1.15rem;
  font-weight: bold;
  text-align: center;
  color: var(--roxo-escuro);
}

.autora {
  font-size: 0.9rem;
  font-style: italic;
  margin-bottom: 15px;
  text-align: center;
  color: var(--roxo-escuro);
}

body.dark-mode .musica,
body.dark-mode .autora {
  color: var(--lilas-escuro);
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.menu button {
  background: white;
  color: var(--roxo);
  border: 2px solid var(--borda-sutil);
  padding: 12px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.25s ease;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.menu button:hover {
  background: var(--roxo);
  color: white;
  border-color: var(--roxo);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.botoes-util {
  display: flex;
  gap: 8px;
  margin-top: 15px;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 10;
}

.botoes-util button {
  padding: 6px 12px;
  font-size: 14px;
  border: 1px solid var(--borda-sutil);
  background: #fff;
  color: var(--roxo);
  border-radius: 8px;
  cursor: pointer !important;
  transition: all 0.2s;
  position: relative;
  z-index: 11;
}

.botoes-util button:hover {
  background: var(--roxo);
  color: white;
}

.spotify-player {
  margin-top: 10px;
  margin-bottom: 0;
  width: 100% !important;
  max-width: 100% !important;
  border-radius: 12px;
  overflow: hidden;
  border: none;
}

.sidebar iframe {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.contador {
  margin-top: 15px;
  font-size: 0.85rem;
  text-align: center;
}

.redes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-top: 10px;
  padding-top: 10px;
}

.redes a {
  color: var(--roxo-escuro);
  font-size: 20px;
  transition: transform 0.2s, color 0.2s;
}

.redes a:hover {
  transform: scale(1.15);
  color: var(--roxo);
}

.main-content {
  font-size: 1.15rem;
  flex: 1;
  margin-left: 300px;
  padding: 40px 60px;
  max-width: 1250px;
  transition: margin-left 0.35s ease;
  margin-top: 50px;
}

.sidebar:not(.open)~.main-content {
  margin-left: auto;
  margin-right: auto;
}

header {
  text-align: center;
  padding: 0;
  margin: 0;
}

header img {
  width: 100%;
  max-width: 700px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  margin-top: -20px;
  z-index: 1000;
  border: 3px solid rgba(120, 120, 120, 0.3);
}

/* ESTILIZAÇÃO DOS CAPÍTULOS (<section id="cap...">) */
section {
  margin-bottom: 50px;
}

h2 {
  text-align: right;
  color: var(--roxo);
  font-size: 2rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-top: 40px;
}

.frase {
  text-align: right;
  font-style: italic;
  color: #777;
  margin-bottom: 15px;
  font-size: 1.1rem;
}

/* CAIXA DE TEXTO DOS CAPÍTULOS E NOTAS */
.texto, .nota-autora {
  background: rgba(140, 140, 140, 0.1);
  padding: 50px 60px;
  border-radius: 24px;
  line-height: 1.9;
  text-align: justify;
  font-family: 'Georgia', serif;
  border: 2px solid var(--borda-sutil);
  box-shadow: var(--sombra-card);
  margin-bottom: 20px;
}

.continua-fim h2 {
  text-align: center;
}

#contador {
  background-color: #eeeeee;
  padding: 6px;
  border-radius: 10px;
  max-width: 100%;
}

body.dark-mode #contador {
  background-color: #ffffff;
  filter: invert(1) hue-rotate(180deg);
}

body.dark-mode {
  background: #3b3b3b;
  color: var(--texto-claro);
}

body.dark-mode .texto,
body.dark-mode .nota-autora {
  background: var(--card-bg-dark);
  border: 2px solid rgba(180, 180, 180, 0.3);
  box-shadow: var(--sombra-card-dark);
}

body.dark-mode .menu button,
body.dark-mode .botoes-util button {
  background: #505050;
  color: var(--texto-claro);
  border-color: rgba(180, 180, 180, 0.3);
}

body.dark-mode .menu button:hover,
body.dark-mode .botoes-util button:hover {
  background: var(--roxo);
  color: var(--texto-claro);
}

body.dark-mode .redes a {
  color: #d3d3d3;
}

body.dark-mode .cylinder-label {
  background: var(--roxo-escuro);
  color: var(--highlight);
  border: 1px solid var(--lilas-escuro);
}

body.dark-mode h2,
body.dark-mode .frase {
  color: #efeef0;
}

body.dark-mode #email {
  text-decoration: none;
  color: #e6e6e6;
  font-weight: 200;
}

body.dark-mode .sidebar {
  background: #484848;
  border-right: 2px solid rgba(180, 180, 180, 0.3);
}

body.dark-mode .header-bar {
  background-color: #555555;
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
    overflow-x: hidden;
  }

  .header-bar {
    height: 35px;
  }

  .sidebar {
    width: 100%;
    height: auto;
    border-radius: 0 0 24px 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    transform: translateY(-100%);
    transition: transform 0.35s ease;
  }

  .sidebar.open {
    transform: translateY(0);
  }

  .main-content {
    margin-left: 0;
    padding: 20px;
    margin-top: 20px;
  }

  body.sidebar-open .main-content {
    margin-left: 0;
  }

  header img {
    width: 100%;
    max-width: 100%;
    margin-top: 10px;
    z-index: 1000;
  }
}

.btn-cilindro {
  background: var(--highlight);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 10px 24px;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.95rem;
  margin-top: 15px;
  transition: all 0.25s ease;
  font-family: 'Georgia', serif;
  display: inline-block;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.btn-cilindro:hover {
  background: var(--roxo-escuro);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.sinopse {
  display: none;
  margin-top: 20px;
  border-radius: 24px;
  background: rgba(140, 140, 140, 0.1);
  padding: 35px;
  line-height: 1.8;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  font-family: 'Georgia', serif;
  text-align: justify;
  border: 2px solid var(--borda-sutil);
  box-shadow: var(--sombra-card);
}

.sinopse.mostrar {
  display: block;
}

body.dark-mode .sinopse {
  background: var(--card-bg-dark);
  color: var(--texto-claro);
  border: 2px solid rgba(180, 180, 180, 0.3);
}

body.dark-mode .btn-cilindro {
  background: var(--roxo);
  color: var(--texto-claro);
}

.descricao {
  font-family: 'Georgia', serif;
  text-align: justify;
  font-size: 17px;
  color: var(--texto);
}

.descri {
  padding: 6%;
  border: 2px solid var(--borda-sutil);
  border-radius: 24px;
  transition: background-color 0.3s, color 0.3s;
  font-family: 'Georgia', serif;
  text-align: justify;
  font-size: inherit;
  background: rgba(140, 140, 140, 0.12);
  color: var(--texto);
  box-shadow: var(--sombra-card);
}

.descri.light {
  background-color: rgba(140, 140, 140, 0.12);
  color: var(--texto);
  border: 2px solid var(--borda-sutil);
}

.descri.dark {
  background-color: var(--card-bg-dark);
  color: var(--texto-claro);
  border: 2px solid rgba(180, 180, 180, 0.3);
}

/* ========================================
   ESTANTE FICSVERSE
   Favoritar + Quero ler
======================================== */

.fv-estante-botoes {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px auto 32px;
}

.fv-estante-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 40px;
    padding: 0 16px;

    background: #f3f3f3;
    border: 1px solid #c9c9c9;
    border-radius: 999px;

    color: #666;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

.fv-estante-btn:hover {
    background: #e9e9e9;
    border-color: #aaa;
    color: #444;
    transform: translateY(-1px);
}

.fv-estante-btn .fv-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

#fv-estante-msg {
    width: 100%;
    margin: 2px 0 0;
    color: #777;
    font-size: 11px;
    text-align: center;
}

/* ========================================
   SALVAR TRECHO
======================================== */

#fv-salvar-trecho {
    position: fixed;
    z-index: 999999;

    padding: 9px 15px;

    background: #f3f3f3;
    border: 1px solid #c9c9c9;
    border-radius: 999px;

    color: #555;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;

    cursor: pointer;

    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.12);

    white-space: nowrap;

    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

#fv-salvar-trecho:hover {
    background: #e9e9e9;
    border-color: #aaa;
    color: #333;

    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.16);
}

/* ========================================
   SALVAR TRECHO — DARK MODE
======================================== */

body.dark-mode #fv-salvar-trecho {
    background: #242424;
    border-color: #444;
    color: #e8e8e8;

    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.35);
}

body.dark-mode #fv-salvar-trecho:hover {
    background: #303030;
    border-color: #5a5a5a;
    color: #ffffff;

    box-shadow: 0 7px 22px rgba(0, 0, 0, 0.45);
}
/* ========================================
   BALÕES DOS COMENTÁRIOS POR TRECHO
   LAYOUT ESTELAR
======================================== */

.texto .fv-inline-trigger .fv-inline-icon {
    display: inline-block !important;
    width: 14px !important;
    height: 10px !important;
    background: #888888 !important;
    border-radius: 50% !important;
    position: relative !important;
    opacity: 0.85 !important;
}

.texto .fv-inline-trigger .fv-inline-icon::after {
    content: "" !important;
    position: absolute !important;
    left: 2px !important;
    bottom: -3px !important;
    width: 0 !important;
    height: 0 !important;
    border-top: 4px solid #888888 !important;
    border-right: 3px solid transparent !important;
}

body.dark-mode .texto .fv-inline-trigger .fv-inline-icon {
    background: #b5b5b5 !important;
    opacity: 0.90 !important;
}

body.dark-mode .texto .fv-inline-trigger .fv-inline-icon::after {
    border-top-color: #b5b5b5 !important;
}

body.dark-mode .texto .fv-inline-count {
    color: #b5b5b5 !important;
}


/* ========================================
   ESPAÇAMENTO DOS TRECHOS
======================================== */

.texto .fv-inline-paragraph {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.texto .fv-inline-content {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.texto .fv-inline-actions {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}