* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding-top: 60px;
  background: #0f0f0f;
  color: #fff;
  font-family: Arial, sans-serif;
}

/* TOP NAV */
.top-nav {
  position: fixed;
  top: 15px;
  left: 0;
  right: 0;
  padding: 0 15px;
  display: flex;
  justify-content: space-between;
  z-index: 999;
  pointer-events: none;
}

.nav-btn {
  pointer-events: auto;
  background: rgba(0,0,0,.6);
  border-radius: 50%;
  padding: 10px 14px;
  font-size: 18px;
  color: #fff;
  border: none;
  text-decoration: none;
  cursor: pointer;
}

/* NAVBAR */
.navbar {
  background: #1a1a1a;
  padding: 15px;
}

.logo {
  font-size: 20px;
  font-weight: bold;
}

/* LAYOUT */
.container {
  padding: 15px;
}

.manga-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 240px);
  gap: 24px;
  justify-content: start; /* rapi kiri */
}

/* CARD */
.manga-card {
  width: 240px;
  display: flex;
  flex-direction: column;
}

.cover-link {
  width: 240px;
  height: 360px;
  display: block;
}

.manga-card img {
  width: 240px;
  height: 360px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

.manga-info {
  padding: 10px;
}

.manga-info h3 {
  font-size: 14px;
  margin: 0 0 8px;
  line-height: 1.3;
}

.chapter-links {
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chapter-links a {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;

  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(6px);

  font-size: 13px;
  font-weight: 600;

  display: flex;
  justify-content: space-between;
  align-items: center;

  color: #fff;
  text-decoration: none;
}

.chapter-links a small {
  color: #aaa;
}

/* === FIX LINK TITLE COLOR (INDEX) === */
.manga-info {
  display: flex;
  flex-direction: column;
  padding: 10px 0; /* ruang napas */
}

/* JUDUL */
.manga-title,
.manga-title:link,
.manga-title:visited {
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;

  margin: 10px 0;  /* ⬅ INI KUNCI POSISI TENGAH */

  color: #fff;
  text-decoration: none;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.manga-title:hover {
  text-decoration: none; /* pastikan tidak muncul */
  opacity: 0.85;
}

.manga-title:active {
  color: #ffffff;
}

/* DETAIL */
.manga-detail-v2 {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
}

.cover {
  width: 180px;
  height: 260px;
  object-fit: cover;
  border-radius: 6px;
}

.btn-read-full {
  display: inline-block;
  margin-top: 10px;
  background: #ff9800;
  color: #000;
  padding: 10px 16px;
  border-radius: 4px;
  font-weight: bold;
  text-decoration: none;
}

/* CHAPTER LIST */
.chapter-list-v2 {
  background: #1c1c1c;
  border-radius: 6px;
}

.chapter-list-v2 a {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid #2a2a2a;
  text-decoration: none;
  color: #fff;
}

/* === READER ABSOLUTE NO GAP (FINAL) === */
.reader {
  max-width: 800px;
  margin: 0 auto;
  background: #000;

  /* FIX UTAMA */
  font-size: 0;
  line-height: 0;
}

.reader img:not(:first-child) {
  margin-top: -2px;
}

html, body {
  margin: 0;
  padding: 0;
  background: #000;
}

/* ===============================
   LIBRARY LAYOUT (DESKTOP)
   =============================== */

.library-layout {
  display: grid;
  grid-template-columns: 260px 1fr; /* sidebar + konten */
  gap: 24px;
  padding: 20px;
}

/* SIDEBAR */
.library-sidebar {
  background: #111;
  border-radius: 12px;
  padding: 16px;
  height: fit-content;
}

.library-sidebar h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

/* GENRE BUTTON */
.genre-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.genre-filter button {
  background: #1e1e1e;
  border: none;
  padding: 6px 12px;
  border-radius: 14px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}

.genre-filter button.active {
  background: #ff9800;
  color: #000;
}

/* CONTENT */
.library-content {
  min-width: 0;
}

/* GENRE DEFAULT */
.genre-filter button {
  background: #1e1e1e;
  border: none;
  padding: 6px 12px;
  border-radius: 14px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}

/* INCLUDE (klik 1x) */
.genre-filter .genre-include {
  background: #4caf50;
  color: #000;
}

/* EXCLUDE (klik 2x) */
.genre-filter .genre-exclude {
  background: #f44336;
  color: #fff;
}

/* ===============================
   MOBILE RESPONSIVE (HP)
   =============================== */

@media (max-width: 600px) {

  .manga-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    justify-content: center;
  }

  .manga-card {
    width: 100%;
    align-items: center;
  }

  .cover-link,
  .manga-card img {
    width: 100%;
    height: 270px;
  }

  .manga-title {
    font-size: 14px;
    margin: 8px 0;
    text-align: center;
  }

  .chapter-links {
    width: 100%;
    gap: 6px;
  }

  .chapter-links a {
    font-size: 12px;
    padding: 6px 8px;
  }
}

/* ===============================
   MOBILE KECIL
   =============================== */

@media (max-width: 400px) {

  .cover-link,
  .manga-card img {
    height: 240px;
  }

  .manga-title {
    font-size: 13px;
  }
}
