:root {
  --bg: #14161c;
  --bg-2: #1c1f28;
  --text: #eae6dd;
  --muted: #b7ae9f;
  --accent: #b44a2a;
  --accent-2: #3a6ea5;
  --border: #2a2e3a;
  --shadow: rgba(0, 0, 0, 0.55);
}

html[data-theme="light"] {
  --bg: #f5f3ee;
  --bg-2: #ffffff;
  --text: #211f1c;
  --muted: #5c5750;
  --accent: #c0502f;
  --accent-2: #2f6ea8;
  --border: #ddd8cd;
  --shadow: rgba(0, 0, 0, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  transition: background 0.25s, color 0.25s;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.brand { font-size: 22px; font-weight: bold; letter-spacing: 3px; color: var(--text); text-decoration: none; }
.brand span { color: var(--accent); }
.topbar nav { display: flex; align-items: center; gap: 18px; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.topbar nav a.active, .topbar nav a:hover { color: var(--text); }
.icon-btn {
  background: none; border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; font-size: 18px; cursor: pointer; padding: 4px 10px;
}
.icon-btn:hover { background: var(--border); }

.ep-picker {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; font-family: inherit; font-size: 14px; padding: 5px 8px;
  max-width: 240px; cursor: pointer;
}
@media (max-width: 620px) {
  .ep-picker { max-width: 170px; font-size: 13px; }
}

main { max-width: 760px; margin: 0 auto; padding: 26px 18px 40px; }

.hero h1 { font-size: 40px; margin: 8px 0 6px; }
.hero p { color: var(--muted); font-size: 17px; max-width: 56ch; }

.episode-list { margin: 40px 0; }
.episode-card {
  display: flex; gap: 18px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px; text-decoration: none; color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s;
}
.episode-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--shadow); }
.thumb {
  width: 96px; height: 144px; border-radius: 4px; flex-shrink: 0;
  background-size: cover; background-position: top center; border: 1px solid var(--border);
}
.meta h2 { margin: 4px 0; font-size: 22px; }
.meta p { color: var(--muted); margin: 4px 0 10px; }
.badge {
  background: var(--accent); color: #fff; font-size: 12px; font-weight: bold;
  letter-spacing: 1px; padding: 2px 10px; border-radius: 20px;
}
.buttons { color: var(--accent-2); font-weight: bold; }

.resume-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-2); border: 1px solid var(--accent-2);
  border-radius: 8px; padding: 14px 16px; margin: 6px 0 22px;
  text-decoration: none; color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s;
}
.resume-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--shadow); }
.resume-icon { font-size: 24px; }
.resume-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.resume-label {
  text-transform: uppercase; letter-spacing: 1px; font-size: 11px; color: var(--accent-2); font-weight: bold;
}
.resume-title { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resume-pct { color: var(--muted); font-size: 13px; }
.resume-card .buttons { margin-left: auto; }
[hidden] { display: none !important; }

.section-title { margin: 38px 0 14px; padding-top: 18px; border-top: 1px solid var(--border); }
.section-title:first-of-type { margin-top: 8px; }
.section-title h2 { margin: 0; font-size: 22px; }

.about { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.about h2 { font-size: 24px; }
.about p { color: var(--muted); line-height: 1.7; }

.foot {
  text-align: center; color: var(--muted); font-size: 13px;
  padding: 22px; border-top: 1px solid var(--border);
}

/* reader */
.reader-wrap { max-width: 760px; padding-top: 18px; }
.reader-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.reader-head h1 { font-size: 24px; margin: 0; }
.reader-nav { display: flex; align-items: center; gap: 10px; }
.btn {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 6px; cursor: pointer; text-decoration: none; font-family: inherit; font-size: 14px;
}
.btn:hover { background: var(--border); }
#panelCounter { color: var(--muted); font-size: 14px; min-width: 70px; text-align: center; }

.panel-stage {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px; cursor: pointer; margin-bottom: 18px;
}
.panel-stage img {
  display: block; width: 100%; height: auto; border-radius: 4px;
}
.reader-nav.bottom { justify-content: space-between; }

/* Zoom panel komik */
.zoom-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px; cursor: zoom-out;
}
.zoom-overlay img {
  max-width: 94vw; max-height: 82vh; width: auto; height: auto;
  border-radius: 6px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
}
.zoom-cap {
  color: #ddd; text-align: center; margin-top: 12px; font-size: 14px;
  line-height: 1.6;
}
.zoom-hint { color: #999; font-size: 12px; }

@media (max-width: 560px) {
  .episode-card { flex-direction: column; }
  .thumb { width: 100%; height: 220px; }
  .hero h1 { font-size: 30px; }
}