/* BestManga — chapter reader */

:root {
  --bg: #0a0c11;
  --panel: #141824;
  --panel-2: #1b2130;
  --line: #232939;
  --txt: #e8ecf6;
  --txt-2: #a2abc2;
  --txt-3: #6f7994;
  --accent: #ff6b2c;
  --accent-2: #ff9a3c;
  --violet: #7c5cff;
  --bar-h: 56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 15px; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  padding-bottom: calc(var(--bar-h) + 10px);
}

body.is-lightsoff { background: #000; }
body.is-lightsoff .rd-top, body.is-lightsoff .rd-mid { opacity: .35; }

ul, ol { list-style: none; }
a { color: var(--txt); text-decoration: none; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: "Outfit", "Plus Jakarta Sans", sans-serif; font-weight: 700; line-height: 1.2; }

.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.rd-top {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 107, 44, .07), transparent);
  padding: 16px 0 14px;
}
.rd-top__inner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rd-brand { display: flex; align-items: center; gap: 9px; flex: none; }
.rd-brand img { width: 30px; height: 30px; border-radius: 8px; }
.rd-brand b {
  font-family: "Outfit", sans-serif;
  font-size: 1.15rem;
  background: linear-gradient(100deg, var(--accent-2), var(--accent) 50%, var(--violet));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.rd-title { min-width: 0; }
.rd-title h1 { font-size: 1.15rem; }
.rd-title h1 a:hover { color: var(--accent-2); }
.rd-title p { font-size: .82rem; color: var(--txt-3); }

.rd-mid { padding: 14px 0; }
.rd-nav { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--txt);
  font-family: inherit;
  font-size: .86rem;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover { background: #262d3f; color: var(--txt); }
.btn--primary { background: linear-gradient(100deg, var(--accent-2), var(--accent)); border-color: transparent; color: #12141c; }
.btn--primary:hover { filter: brightness(1.08); color: #12141c; }
.btn.is-disabled, .btn:disabled { opacity: .35; pointer-events: none; }
.btn--icon { width: 38px; padding: 0; }

.rd-select { position: relative; min-width: 180px; }
.rd-select select {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--txt);
  padding: 0 12px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.rd-select::after {
  content: "";
  position: absolute;
  right: 13px; top: 50%;
  width: 7px; height: 7px;
  border-right: 2px solid var(--txt-3);
  border-bottom: 2px solid var(--txt-3);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.rd-pages { max-width: 900px; margin: 0 auto; padding: 6px 0 20px; }
.rd-pages img { width: 100%; margin: 0 auto; background: var(--panel); }
.rd-pages img.lazyload { opacity: 0; min-height: 380px; }
.rd-pages img.lazyloaded { opacity: 1; transition: opacity .5s; }

.rd-text { max-width: 760px; margin: 0 auto; padding: 10px 16px 30px; font-size: 1.06rem; line-height: 1.95; color: var(--txt-2); }
.rd-text p { margin-bottom: 1.1rem; }

.rd-msg { text-align: center; padding: 60px 20px; color: var(--txt-3); }

.rd-sound { max-width: 760px; margin: 0 auto 18px; padding: 0 16px; }
.rd-sound p { font-size: .86rem; color: var(--txt-3); margin-bottom: 10px; text-align: center; }

.rd-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 90;
  height: var(--bar-h);
  background: rgba(16, 19, 28, .95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.rd-bar__inner { height: 100%; display: flex; align-items: center; gap: 10px; }
.rd-bar__brand { display: flex; align-items: center; gap: 8px; flex: none; }
.rd-bar__brand img { width: 26px; height: 26px; border-radius: 7px; }
.rd-bar__nav { display: flex; align-items: center; gap: 8px; margin: 0 auto; }
.rd-bar__tools { display: flex; align-items: center; gap: 8px; flex: none; }

.rd-toast {
  position: fixed;
  left: 50%; bottom: calc(var(--bar-h) + 16px);
  transform: translateX(-50%) translateY(12px);
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--txt);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 95;
}
.rd-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

.rd-totop {
  position: fixed;
  right: 14px;
  bottom: calc(var(--bar-h) + 14px);
  z-index: 88;
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(20, 24, 36, .9);
  color: var(--txt-2);
  cursor: pointer;
  font-size: 1rem;
}
.rd-totop:hover { color: var(--accent-2); border-color: var(--accent); }

/* subscribe interstitial */
.as-sub-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .82); z-index: 9999; }
.as-sub-overlay.active { display: flex; align-items: center; justify-content: center; }
.as-sub-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  max-width: 420px; width: 92%;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, .6);
  text-align: center;
  margin: 20px 0;
  animation: asSubUp .35s ease;
}
@keyframes asSubUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.as-sub-card img { width: 100%; }
.as-sub-card h2 { font-size: 1.4em; margin: 18px 20px 8px; }
.as-sub-card h2 span { color: var(--accent); }
.as-sub-card .as-msg { font-size: .92em; color: var(--txt-2); margin: 0 20px 10px; }
.as-music-tag { display: inline-block; background: var(--accent); color: #12141c; padding: 4px 14px; border-radius: 20px; font-size: .78em; font-weight: 700; margin: 6px 0 16px; }
.as-sub-btn { display: block; width: calc(100% - 40px); margin: 0 auto 10px; padding: 13px 22px; border: none; border-radius: 50px; font-family: inherit; font-weight: 700; font-size: .95em; cursor: pointer; text-decoration: none; }
.as-sub-btn-yt { background: linear-gradient(100deg, var(--accent-2), var(--accent)); color: #12141c; }
.as-sub-btn-continue { background: var(--panel-2); color: var(--txt-2); }
.as-sub-btn-continue:hover { background: #262d3f; }
.as-sub-btn-continue:disabled { opacity: .35; cursor: default; }
.as-sub-helper { font-size: .76em; color: var(--txt-3); margin: 0 20px 20px; }
.yt-sub-inline { display: inline-flex; align-items: center; min-height: 30px; }
.as-subscribed .yt-sub-inline { display: none !important; }

@media (max-width: 640px) {
  .rd-title h1 { font-size: 1rem; }
  .rd-select { min-width: 128px; }
  .rd-bar__brand span, .rd-bar__tools span { display: none; }
  .rd-bar__tools .btn { width: 38px; padding: 0; }
}
