/* ═══════════════════════════════════════════════════════════════════
   ChronX Manga — "The Birthday Promise" (second pass)
   Large paper-page composition ported from the owner's Claude Design
   comic: 840px paper page, ink borders + hard shadows, halftone
   balloon strips, kanji seals, Shippori Mincho / Zen Maru Gothic.
   ═══════════════════════════════════════════════════════════════════ */

.comic-section { background: #0c0e14; padding: 72px 14px 80px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.comic-wrap.manga2 {
  --ink: #1a1c22;
  --paper: #f5f1e8;
  --panel: #fdfcf8;
  --red: #b3402a;
  --gold: #a97b1e;
  --dim: #57534a;
  --faint: #8a8578;
  color: #e9e6de;
  display: flex; flex-direction: column; align-items: center;
  font-family: 'Zen Maru Gothic', 'Outfit', sans-serif;
}

/* ── Header ─────────────────────────────────────────────────────── */
.mg2-head { width: 100%; max-width: 840px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 4px 14px; }
.mg2-brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.mg2-logo { font-family: 'Shippori Mincho', serif; font-weight: 800; font-size: 19px; color: #f0e6c8; }
.mg2-kicker { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--faint); }
.mg2-chapter { font-size: 12px; color: var(--faint); white-space: nowrap; }

/* ── Book / panels (engine hooks: .panel, .active) ───────────────── */
.mg2-book { width: 100%; max-width: 840px; display: flex; flex-direction: column; align-items: stretch; }
.mg2-book .panel { display: none; width: 100%; }
.mg2-book .panel.active { display: block; animation: mg2In .45s cubic-bezier(.22,1,.36,1) both; }
.mg2-book .panel.exit { animation: mg2Out .3s ease both; }
@keyframes mg2In { from { opacity: 0; transform: translateX(40px);} to { opacity: 1; transform: none;} }
@keyframes mg2Out { from { opacity: 1; transform: none;} to { opacity: 0; transform: translateX(-30px);} }

/* ── The paper page ─────────────────────────────────────────────── */
.mg2-page { flex: 1 1 0; width: 100%; max-width: 840px; background: var(--paper); color: var(--ink); border-radius: 4px; box-shadow: 0 24px 60px rgba(0,0,0,.55); padding: clamp(16px, 3.5vw, 30px); box-sizing: border-box; }

.mg2-pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 3px solid var(--ink); padding-bottom: 12px; margin-bottom: 14px; }
.mg2-chno { font-size: 11px; letter-spacing: .3em; font-weight: 700; color: var(--red); }
.mg2-title { font-family: 'Shippori Mincho', serif; font-weight: 800; font-size: clamp(24px, 4.5vw, 34px); line-height: 1.15; color: var(--ink); margin: 0; }
.mg2-sub { font-family: 'Shippori Mincho', serif; font-style: italic; font-size: clamp(12px, 1.7vw, 13.5px); color: var(--dim); margin: 3px 0 0; }
.mg2-seal { flex: 0 0 auto; width: 52px; height: 52px; border: 3px solid var(--red); color: var(--red); display: grid; place-items: center; font-family: 'Shippori Mincho', serif; font-weight: 800; font-size: 28px; border-radius: 6px; }

/* ── Main panel + balloon strip ─────────────────────────────────── */
.mg2-mainpanel { border: 2.5px solid var(--ink); background: var(--panel); box-shadow: rgba(26,28,34,.85) 3px 3px 0; }
.mg2-mainpanel > svg { display: block; width: 100%; height: auto; }
.mg2-balloons { position: relative; border-top: 2.5px solid var(--ink); background-image: radial-gradient(#d8d2c6 1px, transparent 1px); background-size: 9px 9px; padding: 14px 14px 34px; display: flex; flex-direction: column; gap: 10px; }
.mg2-bubble { align-self: flex-start; max-width: 88%; background: #fff; border: 2px solid var(--ink); border-radius: 16px; padding: 7px 13px; font-weight: 900; font-size: clamp(13px, 2vw, 16px); line-height: 1.4; color: var(--ink); box-shadow: rgba(26,28,34,.7) 3px 3px 0; }
.mg2-bubble.right { align-self: flex-end; max-width: 92%; }
.mg2-bubble strong { color: var(--red); font-weight: 900; }
.mg2-caption { font-family: 'Shippori Mincho', serif; font-style: italic; font-size: clamp(12px, 1.7vw, 13.5px); color: var(--dim); margin: 0; }
.mg2-tag { position: absolute; right: 2.5%; bottom: 4%; background: var(--ink); color: var(--paper); font-size: 10px; letter-spacing: .18em; font-weight: 700; padding: 3px 8px; }

/* ── Info cards ─────────────────────────────────────────────────── */
.mg2-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.mg2-card { border: 2.5px solid var(--ink); background: var(--panel); box-shadow: rgba(26,28,34,.85) 3px 3px 0; padding: 10px 12px; }
.mg2-card p { font-family: 'Shippori Mincho', serif; font-size: clamp(12.5px, 1.7vw, 14.5px); line-height: 1.55; color: #2a2c33; margin: 6px 0 0; }
.mg2-card em { color: var(--red); font-style: italic; }
.mg2-chip { display: inline-block; font-size: 10px; letter-spacing: .22em; font-weight: 700; padding: 3px 8px; }
.mg2-chip.red { background: var(--red); color: var(--paper); }
.mg2-chip.gold { background: var(--gold); color: var(--paper); }

.mg2-strip { margin-top: 12px; text-align: center; font-size: clamp(10.5px, 1.5vw, 12px); letter-spacing: .06em; font-weight: 700; color: var(--dim); }
.mg2-strip em { color: var(--red); font-style: normal; }

.mg2-band { margin-top: 12px; border: 2.5px solid var(--ink); background: var(--ink); color: var(--paper); padding: 12px 16px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.mg2-band-t { font-family: 'Shippori Mincho', serif; font-weight: 800; font-size: clamp(15px, 2.4vw, 19px); }
.mg2-band-a { font-size: 11px; letter-spacing: .2em; color: #c9a86c; font-weight: 700; }

/* ── Chapter CTA (last page) ────────────────────────────────────── */
.mg2-cta { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 12px; }
.mg2-cta-btn { flex: 1 1 260px; text-align: center; background: var(--red); color: var(--paper) !important; border: 2px solid var(--ink); box-shadow: rgba(26,28,34,.85) 3px 3px 0; padding: 13px 18px; font-weight: 900; font-size: 15px; border-radius: 4px; }
.mg2-cta-btn:hover { background: #cf4c33; }
.mg2-cta-ghost { flex: 1 1 200px; text-align: center; background: var(--panel); color: var(--ink) !important; border: 2.5px solid var(--ink); box-shadow: rgba(26,28,34,.85) 3px 3px 0; padding: 13px 18px; font-weight: 700; font-size: 15px; border-radius: 4px; }
.mg2-cta-ghost:hover { background: #fff; }

/* ── Pager ──────────────────────────────────────────────────────── */
.comic-wrap .book-nav { width: 100%; max-width: 840px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 4px 6px; }
.comic-wrap .cw-btn { min-height: 44px; min-width: 96px; padding: 8px 18px; background: transparent; border: 1.5px solid #4a4f5e; color: #e9e6de; border-radius: 4px; font-family: 'Zen Maru Gothic', sans-serif; font-weight: 700; font-size: 14px; cursor: pointer; opacity: 1; transition: all .15s; }
.comic-wrap .cw-btn:hover:not(:disabled) { border-color: var(--red); }
.comic-wrap .cw-btn:disabled { opacity: .35; cursor: not-allowed; }
.comic-wrap .cw-btn-next { background: var(--red); border-color: var(--red); color: var(--paper); font-weight: 900; }
.comic-wrap .cw-btn-next:hover:not(:disabled) { background: #cf4c33; }
.comic-wrap .cw-dots { display: flex; align-items: center; gap: 0; }
.comic-wrap .cw-dots .dot { width: 24px; height: 44px; padding: 0; background: transparent; border: none; cursor: pointer; display: grid; place-items: center; }
.comic-wrap .cw-dots .dot::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: transparent; border: 1.5px solid #8a8578; display: block; transition: background .2s; }
.comic-wrap .cw-dots .dot.active::after { background: var(--red); }
.comic-wrap .cw-dots .dot:focus-visible { outline: 2px solid #c9a86c; outline-offset: -2px; }
.comic-wrap .book-meta { display: flex; align-items: center; gap: 14px; padding-top: 2px; }
.comic-wrap .cw-counter { font-size: 12px; color: var(--faint); }
.mg2-hint { font-size: 12px; color: var(--faint); }

/* ── Read-all transcript ────────────────────────────────────────── */
.comic-wrap .comic-transcript { max-width: 840px; width: 100%; margin-top: 22px; text-align: start; }
.comic-wrap .comic-transcript summary { cursor: pointer; font-size: 13.5px; color: #c9a86c; padding: 10px 16px; border: 1px solid #4a4f5e; border-radius: 100px; display: inline-block; transition: all .15s; }
.comic-wrap .comic-transcript summary:hover { border-color: var(--red); color: #f0e6c8; }
.comic-wrap .comic-transcript-body { margin-top: 16px; padding: 22px 26px; background: #12141d; border: 1px solid #2a2d3a; border-radius: 8px; display: grid; gap: 14px; max-height: 420px; overflow-y: auto; }
.comic-wrap .comic-transcript-body p { font-size: 13.5px; line-height: 1.7; color: #b9b4a6; }
.comic-wrap .comic-transcript-body strong { color: #e9e6de; }

/* ── Reduced motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .mg2-book .panel.active, .mg2-book .panel.exit { animation: none; }
  .mg2-mainpanel svg *, .mg2-balloons [data-anim] { animation: none !important; }
}

/* ── Motion (ported from the owner's comic): gentle idle life per panel ── */
@keyframes idleSway  { from { transform: rotate(-2.6deg); } to { transform: rotate(2.6deg); } }
@keyframes idleFlow  { to   { stroke-dashoffset: -20; } }
@keyframes idleOffer { from { transform: translateY(0); } to { transform: translateY(-3px); } }
@keyframes idleBlink { 0%,45% { opacity: 1; } 55%,100% { opacity: .2; } }
@keyframes idleRise  { from { transform: translateY(0); opacity: .85; } to { transform: translateY(-5px); opacity: 1; } }
@keyframes softPulse { 0% { opacity: .9; transform: scale(.75); } 60% { opacity: 0; transform: scale(1.6); } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes fadeUp    { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn     { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: scale(1); } }
@keyframes drawLine  { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes travelGift { 0% { transform: translate(470px,210px); opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { transform: translate(648px,210px); opacity: 0; } }

/* ── Narrow screens: the pager must fit 320px ───────────────────── */
@media (max-width: 480px) {
  .comic-wrap .book-nav { flex-wrap: wrap; justify-content: center; gap: 8px; }
  .comic-wrap .cw-btn { min-width: 84px; }
  .comic-wrap .cw-dots .dot { width: 20px; height: 36px; }
  .comic-wrap .book-meta { flex-wrap: wrap; justify-content: center; }
  .mg2-band { flex-direction: column; align-items: flex-start; }
}
