:root {
  --bg: #0a0a0e;
  --surface: #14141c;
  --surface-hover: #1c1c28;
  --text: #f4f4f8;
  --muted: #9494a8;
  --accent: #5eb3ff;
  --hammer: #e8c547;
  --max-width: 720px;
  --panel-ratio: 2 / 3;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.55;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

.site-header {
  background: linear-gradient(165deg, #161622 0%, var(--bg) 70%);
  border-bottom: 1px solid #252532;
  padding: 2.5rem 0 2rem;
}

.brand {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(2.8rem, 9vw, 4.5rem);
  letter-spacing: 0.06em;
  margin: 0;
  line-height: 1;
  color: var(--text);
}

.brand span { color: var(--hammer); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

.tagline {
  color: var(--muted);
  max-width: 38rem;
  margin: 0.75rem 0 0;
}

.section-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.07em;
  margin: 0 0 1rem;
}

.card-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

.series-card {
  display: block;
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid #2a2a3a;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.series-card:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.series-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.series-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.chapter-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.chapter-row {
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid #2a2a3a;
  border-radius: 10px;
}

.chapter-row-head {
  margin-bottom: 0.65rem;
}

.chapter-row .chapter-title {
  font-size: 1.05rem;
}

.format-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.format-chip {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #3a3a4a;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}

.format-chip.manhwa:hover {
  border-color: var(--accent);
  background: #1a2a3a;
}

.format-chip.novel:hover {
  border-color: var(--hammer);
  background: #2a2818;
}

.series-formats-note {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 1.25rem;
}

.format-bar {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.5rem 1rem;
  background: #0e0e14;
  border-bottom: 1px solid #1e1e28;
}

.format-btn {
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid transparent;
}

.format-btn.active {
  color: var(--text);
  background: var(--surface);
  border-color: #3a3a4a;
}

a.format-btn:hover {
  color: var(--text);
}

.chapter-list a {
  display: block;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid #2a2a3a;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
}

.chapter-list a:hover { border-color: var(--accent); }

.chapter-list .chapter-id {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.2rem;
}

.empty {
  color: var(--muted);
  font-style: italic;
}

.site-footer {
  border-top: 1px solid #252532;
  margin-top: 3rem;
  padding: 1.5rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.reader-body { background: #060608; }

.reader-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(6, 6, 8, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #1e1e28;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.reader-header h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  margin: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.reader {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.25rem 0 5rem;
}

.panel-frame {
  margin: 0;
  padding: 0;
  line-height: 0;
  background: #0e0e12;
}

.reader img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  margin: 0;
  aspect-ratio: var(--panel-ratio);
  object-fit: contain;
  object-position: center;
  background: #0e0e12;
}

.empty-state-inline {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

/* Webnovel reader */
.novel-body {
  background: #0c0c10;
}

.novel-article {
  max-width: 42rem;
  padding: 1.5rem 1.5rem 6rem;
  font-family: Literata, Georgia, "Times New Roman", serif;
  font-size: 1.125rem;
  line-height: 1.75;
  color: #e8e8ec;
}

.novel-article p {
  margin: 0 0 1.25rem;
  text-indent: 1.5em;
}

.novel-article p:first-child {
  text-indent: 0;
}

.novel-article p:first-child::first-letter {
  font-size: 3.2em;
  float: left;
  line-height: 0.85;
  padding-right: 0.08em;
  font-weight: 600;
  color: var(--hammer);
}

.reader-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: rgba(6, 6, 8, 0.96);
  border-top: 1px solid #1e1e28;
}

.nav-btn {
  color: var(--text);
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  background: var(--surface);
  border-radius: 8px;
  font-size: 0.88rem;
}

.nav-btn:hover { background: #2a3a50; }

.series-hero {
  margin-bottom: 1.5rem;
}

.series-hero h2 {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2rem;
  letter-spacing: 0.05em;
  margin: 0 0 0.5rem;
}

.series-hero .logline {
  color: var(--muted);
  margin: 0;
}
