/* Comic Showcase — mobile-first, paper-like, comics carry the colour. */
:root {
  --bg: #faf7f0;
  --surface: #fffdf8;
  --text: #1d1a16;
  --muted: #6f6a61;
  --border: #e5ded0;
  --accent: #b3402a;
  --accent-soft: #f6e8e4;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
}
a { color: var(--accent); }
img { max-width: 100%; display: block; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.topnav a { margin-left: 18px; color: var(--text); text-decoration: none; }
.topnav a:hover { color: var(--accent); }

.view { max-width: 1060px; margin: 0 auto; padding: 20px 16px 40px; }
.intro h1 { font-size: 1.6rem; margin: 6px 0 4px; line-height: 1.3; }
.intro p { color: var(--muted); margin: 0 0 18px; max-width: 60ch; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.controls input[type="search"] {
  flex: 1 1 240px; padding: 10px 12px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
.lang-toggle { display: flex; gap: 6px; }
.lang-toggle button, .chips button, .topics button, .more button, .reader-tools button {
  padding: 8px 14px; font-size: 0.95rem; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text);
}
.lang-toggle button.active, .chips button.active, .topics button.active {
  background: var(--text); color: var(--bg); border-color: var(--text);
}
.chips, .topics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.topics button { font-size: 0.85rem; padding: 5px 11px; }
.count { color: var(--muted); font-size: 0.9rem; margin: 8px 0 12px; }

.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text);
}
.card img { width: 100%; height: auto; background: #eee7d8; }
.card .card-body { padding: 10px 12px 12px; }
.card h2 { font-size: 1rem; margin: 0 0 2px; line-height: 1.35; }
.card .card-meta { font-size: 0.82rem; color: var(--muted); margin: 0; }
.card:hover { border-color: var(--accent); }
.empty { color: var(--muted); }
.more { text-align: center; margin-top: 18px; }

.crumbs { color: var(--muted); font-size: 0.9rem; }
.crumbs a { text-decoration: none; }
#comicTitle { font-size: 1.7rem; margin: 4px 0; }
.meta { color: var(--muted); margin: 0 0 14px; }
.stage {
  margin: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: auto; max-height: 82vh;
  touch-action: pan-x pan-y;
}
.stage img { width: 100%; height: auto; margin: 0 auto; }
.stage.zoomed { cursor: zoom-out; }
.stage.zoomed img { width: 220%; max-width: none; }
.reader-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.reader-tools button { border-radius: var(--radius); }
.share-msg { color: var(--muted); font-size: 0.9rem; }

.engage { margin: 4px 0 22px; }
.like-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.like-row button {
  padding: 8px 16px; font-size: 0.95rem; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text);
}
.like-row button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.like-count { font-size: 0.92rem; }
.like-note { color: var(--muted); font-size: 0.85rem; }
.comments h2, #about h2 { font-size: 1.1rem; margin: 0 0 10px; }
.comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.comment { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 10px 12px; }
.comment .c-head { margin: 0 0 2px; font-size: 0.92rem; }
.comment .c-time { color: var(--muted); font-size: 0.82rem; font-weight: 400; }
.comment .c-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-msg { color: var(--muted); font-size: 0.9rem; min-height: 1.2em; }
.comment-form { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.comment-form input[type="text"], .comment-form textarea {
  padding: 10px 12px; font-size: 1rem; font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
.comment-form button {
  align-self: flex-start; padding: 8px 16px; font-size: 0.95rem; cursor: pointer;
  border: 1px solid var(--text); border-radius: 999px;
  background: var(--text); color: var(--bg);
}
.prevnext { display: flex; justify-content: space-between; margin: 10px 0 22px; }
.prevnext a { text-decoration: none; font-weight: 600; }
.prevnext a[aria-disabled="true"] { color: var(--muted); pointer-events: none; font-weight: 400; }
.behind { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 12px 14px; }
.behind summary { cursor: pointer; font-weight: 700; }
.behind .facts { color: var(--muted); font-size: 0.92rem; }
.behind .qa-line { font-size: 0.9rem; }
.more-series h2 { font-size: 1.1rem; margin: 26px 0 10px; }
.strip { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.strip .card h2 { font-size: 0.9rem; }

#about p { max-width: 62ch; }
.foot { border-top: 1px solid var(--border); padding: 18px; text-align: center; color: var(--muted); font-size: 0.88rem; }
.foot a { color: var(--muted); }

@media (min-width: 720px) {
  .intro h1 { font-size: 2rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .stage.zoomed img { width: 160%; }
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171512; --surface: #211e1a; --text: #f0ebe2;
    --muted: #a89f92; --border: #38322a; --accent: #e0785f; --accent-soft: #3a2723;
  }
  .card img { background: #2a2620; }
}

/* Sticker Showcase addition: per-sticker grid inside the reader. */
.stickers-grid {
  display: grid; gap: 14px; margin: 18px 0 8px;
  grid-template-columns: repeat(2, 1fr);
}
.sticker-cell {
  margin: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.sticker-cell img { width: 100%; height: auto; }
.sticker-cell figcaption { padding: 8px 10px 10px; text-align: center; }
.sticker-ja { display: block; font-weight: 700; font-size: 0.95rem; }
.sticker-zh { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
@media (min-width: 720px) {
  .stickers-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Column modal: the news column is the backdrop of a set, shown as a modal. */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 50; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(29, 26, 22, 0.55); }
.modal-box {
  position: relative; max-width: 640px; margin: 7vh auto; padding: 22px 22px 26px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  max-height: 84vh; overflow: auto;
}
.modal-box h2 { font-size: 1.2rem; margin: 2px 28px 10px 0; line-height: 1.35; }
.modal-close {
  position: absolute; top: 10px; right: 12px; padding: 4px 10px; font-size: 1.2rem;
  cursor: pointer; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text);
}
.modal-body h3 { font-size: 1.05rem; margin: 16px 0 6px; }
.modal-body h4 { font-size: 0.95rem; margin: 14px 0 4px; }
.modal-body p { margin: 6px 0; }
.modal-body ul { margin: 6px 0; padding-left: 20px; }
.modal-body li { margin: 3px 0; }
body.modal-open { overflow: hidden; }

/* Character sheet: collapsed by default, names under the image. */
.char-sheet { margin: 14px 0 4px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 10px 14px; }
.char-sheet[hidden] { display: none; }
.char-sheet summary { cursor: pointer; font-weight: 700; }
.char-sheet figure { margin: 10px 0 4px; text-align: center; }
.char-sheet img { max-width: 100%; height: auto; border-radius: var(--radius); }
.char-sheet figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 6px; }

/* Tappable sticker cells: a finger badge so readers know to tap. */
.sticker-cell { position: relative; cursor: pointer; }
.sticker-cell:hover { border-color: var(--accent); }
.sticker-cell:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.tap-badge {
  position: absolute; top: 8px; right: 8px; padding: 2px 9px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  font-size: 0.8rem; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  animation: tap-nudge 1.6s ease-in-out infinite;
}
@keyframes tap-nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* The column button gets the same click-me treatment as the stickers. */
.tap-me { animation: tap-nudge 1.6s ease-in-out infinite; }

/* Sticker modal: big image, lines, and the script behind it. */
.sticker-modal-img {
  width: 100%; max-width: 420px; display: block;
  margin: 6px auto 10px; border-radius: var(--radius);
}
.sticker-modal-ja { font-size: 1.25rem; font-weight: 700; text-align: center; margin: 4px 0 0; }
.sticker-modal-zh { color: var(--muted); text-align: center; margin: 2px 0 12px; }
