/* ==========================================================================
   OMAHA NO KENJA: Seamless Webtoon / MangaPlus Reading Experience
   Full-bleed continuous vertical manga flow, auto-hiding chrome,
   organic speech balloons, and whisper-quiet outer border sponsor rails.
   ========================================================================== */

:root {
  --stage-bg: #0c0c0d;
  --stage-surface: rgba(22, 22, 24, 0.88);
  --stage-elevated: #17171a;
  --stage-border: rgba(255, 255, 255, 0.1);
  --text-main: #f2efe9;
  --text-muted: #a19b90;
  --text-dim: #6f6a61;
  --hanko: #d44637;
  --hanko-hover: #e45748;
  --rail-bg: rgba(20, 20, 22, 0.72);
  --rail-hover-bg: rgba(28, 28, 31, 0.96);
  --font-serif: "Georgia", "Times New Roman", "Hiragino Mincho ProN", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

body.paper-mode {
  --stage-bg: #efeae0;
  --stage-surface: rgba(247, 243, 234, 0.92);
  --stage-elevated: #faf7f0;
  --stage-border: rgba(21, 20, 18, 0.12);
  --text-main: #181715;
  --text-muted: #5c564d;
  --text-dim: #8a8377;
  --hanko: #b83124;
  --hanko-hover: #99261b;
  --rail-bg: rgba(250, 247, 240, 0.78);
  --rail-hover-bg: rgba(255, 253, 249, 0.98);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--stage-bg);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Razor-Thin Progress Line */
.progress-line {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 90;
  pointer-events: none;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--hanko);
  transition: width 0.08s linear;
}

/* Auto-Hiding Translucent Webtoon Reader Bar */
.reader-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  background: var(--stage-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stage-border);
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.reader-bar.is-hidden {
  transform: translateY(-100%);
  opacity: 0;
}

.reader-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
  min-width: 0;
}

.hanko-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--hanko);
  color: var(--hanko);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.bar-title {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.bar-ep {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-switcher {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stage-border);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

body.paper-mode .ep-switcher {
  background: rgba(20, 19, 17, 0.05);
}

.ep-tab {
  appearance: none;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 999px;
  padding: 4px 11px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ep-tab:hover {
  color: var(--text-main);
}

.ep-tab.active {
  background: var(--hanko);
  color: #ffffff;
}

.next-ep-card {
  max-width: 680px;
  margin: 0 auto 28px;
  padding: 20px 22px;
  border-radius: 12px;
  background: var(--stage-elevated);
  border: 1px solid var(--stage-border);
  display: flex;
  align-items: center;
  gap: 18px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.next-ep-card:hover {
  border-color: var(--hanko);
  transform: translateY(-2px);
}

.next-ep-thumb {
  width: 78px;
  height: 104px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--stage-border);
  flex-shrink: 0;
  background: #ffffff;
}

.next-ep-body {
  flex: 1;
  min-width: 0;
}

.next-ep-body h3 {
  margin: 4px 0 4px;
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.2;
}

.next-ep-body p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.episode-container {
  display: block;
}

.episode-container.hidden-ep {
  display: none;
}

.page-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.page-dot {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.page-dot:hover {
  color: var(--text-main);
  border-color: var(--stage-border);
}

.page-dot.active {
  color: #ffffff;
  background: var(--hanko);
}

.bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ghost-btn {
  appearance: none;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--stage-border);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.ghost-btn:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

.ghost-btn[aria-pressed="true"] {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--text-muted);
}

body.paper-mode .ghost-btn[aria-pressed="true"] {
  background: rgba(20, 19, 17, 0.08);
}

.accent-pill-btn {
  appearance: none;
  background: var(--hanko);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.accent-pill-btn:hover {
  background: var(--hanko-hover);
}

/* Whisper-Quiet Fixed Outer Border Sponsor Rails (Desktop >= 1260px) */
.outer-rail {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 204px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.outer-rail.left {
  left: 20px;
}

.outer-rail.right {
  right: 20px;
}

.border-sponsor-card {
  background: var(--rail-bg);
  border: 1px solid var(--stage-border);
  border-radius: 10px;
  padding: 16px 15px;
  min-height: 310px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  opacity: 0.82;
  transition: opacity 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.border-sponsor-card:hover {
  opacity: 1;
  background: var(--rail-hover-bg);
  border-color: var(--text-dim);
}

.border-sponsor-card.is-open {
  border-style: dashed;
  border-color: rgba(212, 70, 55, 0.5);
}

.sp-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.sp-brand {
  margin: 6px 0 6px;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.sp-headline {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}

.sp-copy {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.sp-cta {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  transition: background-color 0.15s ease;
}

body.paper-mode .sp-cta {
  background: rgba(20, 19, 17, 0.08);
}

.sp-cta:hover {
  background: var(--hanko);
  color: #ffffff;
}

.border-sponsor-card.is-open .sp-cta {
  background: var(--hanko);
  color: #ffffff;
}

.sp-meta-foot {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
}

.text-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--hanko);
  text-decoration: underline;
  cursor: pointer;
}

.rail-mini-status {
  padding: 10px 13px;
  border-radius: 8px;
  background: var(--rail-bg);
  border: 1px solid var(--stage-border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 5px;
  opacity: 0.78;
  transition: opacity 0.2s ease;
}

.rail-mini-status:hover {
  opacity: 1;
}

.mini-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.mini-row strong {
  color: var(--text-main);
}

.rail-mini-status input[type="range"] {
  width: 100%;
  accent-color: var(--hanko);
  margin-top: 2px;
}

/* ==========================================================================
   SEAMLESS VERTICAL WEBTOON / MANGA STREAM (Zero Hard Blocks!)
   ========================================================================== */

.webtoon-stream {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding-top: 46px;
  padding-bottom: 84px;
}

/* Cinematic Title Opening Strip (Blends straight into Page 1 Artwork!) */
.episode-opening {
  position: relative;
  text-align: center;
  padding: 28px 20px 18px;
}

.episode-jp {
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--hanko);
  margin: 0 0 6px;
  font-weight: 700;
}

.episode-opening h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(24px, 4.2vw, 36px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.episode-deck {
  margin: 8px auto 0;
  max-width: 520px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Individual Manga Page Sheet: Seamless Full-Bleed, Zero Boxy Cards */
.manga-sheet {
  position: relative;
  width: 100%;
  margin: 0;
  scroll-margin-top: 52px;
}

.manga-sheet img {
  display: block;
  width: 100%;
  height: auto;
  background: #ffffff;
}

/* Subtle Webtoon Pacing Breather Between Pages (Atmospheric, Not a Block!) */
.pacing-beat {
  padding: 26px 20px;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pacing-line {
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, transparent, var(--text-dim), transparent);
}

.pacing-caption {
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pacing-note-trigger {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 999px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.pacing-note-trigger:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

/* Organic Manga Dialogue Balloons & Hand-Lettered SFX */
.manga-lettering {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

body.raw-art .manga-lettering {
  opacity: 0;
}

.comic-balloon {
  position: absolute;
  background: #ffffff;
  color: #111111;
  border: 2px solid #121212;
  border-radius: 26px / 22px;
  padding: 9px 14px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.26;
  text-align: center;
  letter-spacing: 0.01em;
  max-width: 44%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.22));
}

.comic-balloon::after {
  content: "";
  position: absolute;
  bottom: -9px;
  left: 26px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-right: 2px solid #121212;
  border-bottom: 2px solid #121212;
  transform: rotate(45deg);
}

.comic-balloon.tail-right::after {
  left: auto;
  right: 26px;
}

.comic-balloon.tail-top::after {
  bottom: auto;
  top: -8px;
  border-right: none;
  border-bottom: none;
  border-left: 2px solid #121212;
  border-top: 2px solid #121212;
}

.manga-caption {
  position: absolute;
  background: rgba(252, 249, 240, 0.96);
  color: #141311;
  border: 1.5px solid #141311;
  padding: 6px 11px;
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  max-width: 46%;
}

.manga-caption.cinema-bar {
  max-width: 90%;
  left: 5% !important;
  text-align: center;
  background: rgba(12, 12, 13, 0.88);
  color: #f4f1ea;
  border: none;
  letter-spacing: 0.07em;
  font-size: 12px;
}

.manga-sfx {
  position: absolute;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 26px;
  color: #111111;
  text-shadow:
    2px 2px 0 #ffffff,
    -2px -2px 0 #ffffff,
    2px -2px 0 #ffffff,
    -2px 2px 0 #ffffff;
  letter-spacing: 0.08em;
  transform: rotate(-7deg);
}

/* End-of-Chapter Cinematic Finale, Reactions & Waitlist */
.episode-finale {
  margin-top: 42px;
  padding: 36px 24px;
  border-top: 1px solid var(--stage-border);
  text-align: center;
}

.finale-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hanko);
  margin: 0 0 8px;
}

.episode-finale h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
}

.finale-sub {
  margin: 0 auto 22px;
  max-width: 520px;
  color: var(--text-muted);
  font-size: 14px;
}

.reaction-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.react-pill {
  appearance: none;
  background: var(--stage-elevated);
  color: var(--text-main);
  border: 1px solid var(--stage-border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.react-pill:hover {
  border-color: var(--text-muted);
}

.react-pill.voted {
  border-color: var(--hanko);
  background: rgba(212, 70, 55, 0.14);
}

.react-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--hanko);
}

.waitlist-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 480px;
  margin: 0 auto 10px;
}

.waitlist-row input {
  flex: 1 1 240px;
  background: var(--stage-elevated);
  color: var(--text-main);
  border: 1px solid var(--stage-border);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
}

.waitlist-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.share-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

/* Single Post-Chapter Sponsor Intermission (Clean, Mobile-Friendly) */
.post-chapter-sponsor {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 20px;
  border-radius: 10px;
  background: var(--stage-elevated);
  border: 1px solid var(--stage-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  text-align: left;
}

.post-chapter-sponsor.is-open {
  border-style: dashed;
  border-color: rgba(212, 70, 55, 0.55);
}

.site-disclaimer {
  margin-top: 28px;
  font-size: 11px;
  color: var(--text-dim);
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

/* Slide-Out Omaha & WSB Lore Drawer (Keeps Comic Strip 100% Pure!) */
.lore-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 85;
  display: none;
  justify-content: flex-end;
}

.lore-drawer-backdrop.open {
  display: flex;
}

.lore-drawer-sheet {
  width: 100%;
  max-width: 400px;
  height: 100%;
  background: var(--stage-elevated);
  border-left: 1px solid var(--stage-border);
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lore-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stage-border);
}

.lore-sheet-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
}

.icon-close {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--stage-border);
  border-radius: 999px;
  width: 30px;
  height: 30px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.lore-item {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--stage-border);
}

.lore-item-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--hanko);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.lore-item h3 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 15px;
}

.lore-item p {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.lore-item .wsb-quip {
  font-size: 12px;
  color: var(--text-main);
  padding-left: 10px;
  border-left: 2px solid var(--hanko);
}

/* Self-Serve "Buy a Border Slot" Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 100;
}

.modal-backdrop.open {
  display: flex;
}

.sponsor-modal {
  background: var(--stage-elevated);
  color: var(--text-main);
  border: 1px solid var(--stage-border);
  border-radius: 12px;
  max-width: 620px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stage-border);
  margin-bottom: 16px;
}

.modal-head h2 {
  margin: 4px 0 0;
  font-family: var(--font-serif);
  font-size: 21px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.field input,
.field select {
  background: var(--stage-bg);
  color: var(--text-main);
  border: 1px solid var(--stage-border);
  border-radius: 6px;
  padding: 9px 11px;
  font-size: 13px;
  font-family: var(--font-sans);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.price-bar {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--stage-bg);
  border: 1px solid var(--stage-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.price-bar strong {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--hanko);
}

.modal-foot {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-foot-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.receipt-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--hanko);
  background: rgba(212, 70, 55, 0.1);
  font-size: 13px;
  display: none;
}

.receipt-box.visible {
  display: block;
}

/* Mobile & Tablet Adaptation */
@media (max-width: 1260px) {
  .outer-rail {
    display: none;
  }
}

@media (max-width: 680px) {
  .bar-ep,
  .page-dots {
    display: none;
  }
  .comic-balloon,
  .manga-caption {
    font-size: 11px;
    max-width: 58%;
    padding: 6px 10px;
  }
  .manga-sfx {
    font-size: 19px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}
