body {
  background: #000;
  color: #f5f5f5;
  font-family: 'Georgia', serif;
  line-height: 1.2; /* tightened a bit */
  margin: 0;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.character-card {
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #00ff99;
  padding: 1rem;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 0 10px #00ff99;
  transition: transform 0.3s, box-shadow 0.3s;
}

.character-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 20px #00ff99;
}

.character-card img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 0.8rem;
  border: 1px solid #00ff99;
}

.character-card h2 {
  margin: 0.5rem 0 0.2rem;
  font-size: 1.3rem;
  color: #00ff99;
}

.character-card h3 {
  margin: 0.2rem 0 0.8rem;
  font-size: 1rem;
  color: #00cc7a;
  font-style: italic;
}

.character-card p {
  font-size: 0.95rem;
  color: #ccc;
}

img.responsive {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
  margin: 0 auto;
}



body.light .character-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #007755;
  box-shadow: 0 0 10px #007755;
}

body.light .character-card:hover {
  box-shadow: 0 0 20px #007755;
}

body.light .character-card h2 {
  color: #007755;
}

body.light .character-card h3 {
  color: #005a44;
}

body.light .character-card p {
  color: #333;
}


.chapter-title-sticky {
  position: sticky;
  top: 60px; /* so it stays below your navbar */
  background: rgba(0, 0, 0, 0.8);
  padding: 0.5rem 0;
  font-size: 1.4rem;
  font-weight: bold;
  color: #00ff99;
  text-shadow: 0 0 8px #00ff99;
  z-index: 9;
}

body.light .chapter-title-sticky {
  background: rgba(255, 255, 255, 0.9);
  color: #007755;
}

.category {
  margin-bottom: 1.5rem;
}

.category h2 {
  color: #00ff99;
  cursor: pointer;
  font-size: 1.3rem;
  margin: 0;
  padding: 0.5rem 0;
  text-shadow: 0 0 8px #00ff99;
  transition: color 0.3s;
}

.category h2:hover {
  color: #fff;
}

.chapter-list {
  list-style: none;
  padding-left: 1rem;
  margin-top: 0.5rem;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}

.chapter-list li {
  margin: 0.4rem 0;
}

.chapter-list a {
  color: #00ff99;
  text-decoration: none;
  font-size: 1.1rem;
}

.chapter-list a:hover {
  text-shadow: 0 0 8px #00ff99;
}

.category.collapsed .chapter-list {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}


/* Back to Top Button */
#backToTop {
  display: none;               /* hidden by default */
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  background-color: #00ff99;
  color: #000;
  border: none;
  padding: 0.7rem 1rem;
  font-size: 1rem;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 0 10px #00ff99;
  transition: background 0.3s, transform 0.2s;
}

#backToTop:hover {
  background-color: #00cc7a;
  transform: translateY(-3px);
}

body.light #backToTop {
  background-color: #007755;
  color: white;
  box-shadow: 0 0 10px #007755;
}

body.light #backToTop:hover {
  background-color: #005a44;
}



/* 🟢 Themed text for bold and italic */
.reading-section strong {
  color: #D3D3D3;
  font-weight: bold;
}

.reading-section em {
  color: #808080;
  font-style: italic;
  font-family: 'Courier New', Courier, monospace;
}

/* Optional — if someone uses both bold + italic together */
.reading-section strong em,
.reading-section em strong {
  color: #D3D3D3;
  font-weight: bold;
  font-style: italic;

}

.reading-section strong,
.reading-section em {
  text-shadow: 0 0 2px #ffffff;
}


/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(0, 0, 0, 0.95);
  border-bottom: 1px solid #00ff99;
  position: sticky;
  top: 0;
  z-index: 10;
}

.navbar .brand {
  font-size: 1.4rem;
  color: #00ff99;
  text-shadow: 0 0 8px #00ff99;
}

.nav a {
  color: #00ff99;
  text-decoration: none;
  margin-left: 1.5rem;
}

.nav a:hover {
  text-shadow: 0 0 10px #00ff99;
}

.container {
  max-width: 800px;
  margin: auto;
  padding: 2rem;
}

.hero {
  text-align: center;
  margin-bottom: 1.5rem;
}

.chapters ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.chapters li {
  margin: 0.4rem 0;
}

.chapters a {
  color: #00ff99;
  text-decoration: none;
  font-size: 1.2rem;
}

.chapters a:hover {
  text-shadow: 0 0 8px #00ff99;
}

.reading-section {
  white-space: pre-line;
  padding-top: 1rem;
  font-size: 1.1rem;
}

.reading-section p {
  margin-top: 0.3rem !important;
  margin-bottom: 0.3rem !important;
  padding: 0 !important;
  line-height: 1.2; /* controls space within each paragraph */
}

/* Chapter navigation */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  font-size: 1rem;
}

.chapter-nav a {
  color: #00ff99;
  text-decoration: none;
  padding: 0.6rem 1rem;
  border: 1px solid #00ff99;
  border-radius: 5px;
  transition: 0.2s;
}

.chapter-nav a:hover {
  background: #00ff99;
  color: #000;
}

/* Light mode */
body.light {
  background: #f5f5f5;
  color: #222;
}

body.light .navbar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid #00ff99;
}

body.light .nav a {
  color: #007755;
}

body.light .chapter-nav a {
  border-color: #007755;
  color: #007755;
}

body.light .chapter-nav a:hover {
  background: #007755;
  color: #fff;
}

/* Footer */
.footer {
  text-align: center;
  padding: 1rem;
  border-top: 1px solid #00ff99;
  background: rgba(0, 0, 0, 0.9);
}

body.light .footer {
  background: rgba(255, 255, 255, 0.9);
}

/* 📱 Mobile adjustments */
@media (max-width: 600px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    margin-top: 0.5rem;
  }

  .nav a {
    margin-left: 0;
    margin-right: 1rem;
    display: inline-block;
  }

  .reading-section {
    font-size: 1rem;
  }

  .
