:root {
  --bg: #030406;
  --panel: rgba(15, 19, 28, 0.86);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f4f7ff;
  --muted: #a9b4c6;
  --accent: #74d4ff;
  --gold: #f0c36a;
}
* { box-sizing: border-box; }
html,
body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(145deg, #020305 0%, #090d15 58%, #020305 100%);
  background-size: 72px 72px, 72px 72px, auto;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}
a {
  color: var(--accent);
}
.comic-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px max(18px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(3, 4, 6, 0.88);
  backdrop-filter: blur(10px);
}
.comic-brand {
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
}
.comic-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.comic-nav a,
.comic-button,
.chapter-select-label select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}
.comic-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  text-decoration: none;
  font-weight: 800;
}
.comic-shell {
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) 0 54px;
  display: grid;
  gap: 24px;
}
.comic-intro {
  display: grid;
  gap: 12px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(15, 19, 28, 0.9), rgba(8, 11, 18, 0.7));
}
.comic-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.comic-intro h1 {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 6.3rem);
  line-height: 0.95;
  letter-spacing: 0;
}
.comic-intro p {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}
.comic-artist-callout {
  padding-top: 8px;
}
.comic-reader {
  display: grid;
  gap: 14px;
}
.comic-reader-top,
.comic-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.comic-page-meta {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}
.comic-page-meta span,
.chapter-select-label {
  color: var(--muted);
}
.comic-arrow,
.comic-side-arrow {
  border: 1px solid rgba(116, 212, 255, 0.32);
  border-radius: 8px;
  color: var(--text);
  background: rgba(116, 212, 255, 0.12);
  cursor: pointer;
  font: inherit;
  font-size: 1.5rem;
  font-weight: 900;
}
.comic-arrow {
  width: 52px;
  height: 44px;
}
.comic-stage {
  position: relative;
  min-height: 520px;
  margin: 0;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2vw, 18px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.42);
}
.comic-stage img {
  width: auto;
  max-width: min(100%, 760px);
  max-height: calc(100vh - 190px);
  display: block;
  border-radius: 4px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.52);
  cursor: zoom-in;
}
.comic-side-arrow {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 68px;
  transform: translateY(-50%);
}
.comic-side-arrow-left {
  left: 12px;
}
.comic-side-arrow-right {
  right: 12px;
}
.comic-button {
  padding: 0 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}
button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.chapter-select-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}
.chapter-select-label select {
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
}
@media (max-width: 720px) {
  .comic-topbar,
  .comic-reader-top,
  .comic-controls {
    align-items: stretch;
    flex-direction: column;
  }
  .comic-nav {
    justify-content: flex-start;
  }
  .comic-arrow {
    display: none;
  }
  .comic-stage {
    min-height: 360px;
    padding-inline: 8px;
  }
  .comic-stage img {
    max-height: none;
    width: 100%;
  }
  .comic-side-arrow {
    top: auto;
    bottom: 12px;
    transform: none;
    width: 44px;
    height: 52px;
    background: rgba(3, 4, 6, 0.76);
  }
  .comic-controls .comic-button,
  .chapter-select-label,
  .chapter-select-label select {
    width: 100%;
  }
  .chapter-select-label {
    display: grid;
  }
}

.fullscreen-reader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px 74px;
  background: rgba(0, 0, 0, 0.96);
}
.fullscreen-reader.hidden {
  display: none;
}
.fullscreen-reader img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  border-radius: 4px;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.82);
}
.fullscreen-close,
.fullscreen-arrow {
  position: fixed;
  z-index: 1002;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: #fff;
  background: rgba(0, 0, 0, 0.46);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}
.fullscreen-close {
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  font-size: 1.15rem;
}
.fullscreen-arrow {
  top: 50%;
  width: 58px;
  height: 88px;
  transform: translateY(-50%);
  font-size: 2.4rem;
}
.fullscreen-arrow-left {
  left: 18px;
}
.fullscreen-arrow-right {
  right: 18px;
}
.fullscreen-meta {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 1002;
  transform: translateX(-50%);
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(0, 0, 0, 0.42);
  font-size: 0.88rem;
}
body.fullscreen-reader-open {
  overflow: hidden;
}
@media (max-width: 720px) {
  .fullscreen-reader {
    padding: 58px 10px 52px;
  }
  .fullscreen-arrow {
    top: auto;
    bottom: 12px;
    width: 52px;
    height: 52px;
    transform: none;
    font-size: 1.7rem;
  }
  .fullscreen-close {
    top: 10px;
    right: 10px;
  }
  .fullscreen-arrow-left {
    left: 10px;
  }
  .fullscreen-arrow-right {
    right: 10px;
  }
  .fullscreen-meta {
    bottom: 18px;
    max-width: calc(100vw - 132px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
