/* くろーの漫画 */
:root {
  --paper: #f5f2ec;
  --card: #fffdf8;
  --ink: #1d1b18;
  --sub: #6e685e;
  --line: #e3ddd2;
  --accent: #b8442c;
  --shadow: 0 1px 2px rgba(40, 30, 20, .08), 0 6px 18px rgba(40, 30, 20, .10);
  --mincho: "Zen Old Mincho", "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
  --sans: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #161513;
    --card: #1f1d1a;
    --ink: #ece7dd;
    --sub: #a39b8e;
    --line: #2e2b27;
    --accent: #e0745a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --paper: #161513;
  --card: #1f1d1a;
  --ink: #ece7dd;
  --sub: #a39b8e;
  --line: #2e2b27;
  --accent: #e0745a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--paper); line-height: 1.7; }
a { color: inherit; }
img { display: block; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: 11px 26px; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font: 600 15px/1.4 var(--sans); text-decoration: none; cursor: pointer;
}
.btn:hover { opacity: .88; }
.btn:focus-visible, .card:focus-visible, .back:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------------- 一覧 ---------------- */
.site-head {
  max-width: 1080px; margin: 0 auto; padding: 18px 16px 8px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.brand { font-family: var(--mincho); font-weight: 700; font-size: 20px; letter-spacing: .06em; text-decoration: none; }
.xlink { font-size: 13px; color: var(--sub); text-decoration: none; white-space: nowrap; }
.xlink:hover { color: var(--ink); }

.hero {
  display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px 40px; align-items: center;
  padding: 22px 0 38px; border-bottom: 1px solid var(--line);
}
.hero-cover img { width: 100%; height: auto; border-radius: 4px; box-shadow: var(--shadow); }
.kicker { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .12em; color: var(--accent); }
.hero-title { margin: 0 0 6px; font-family: var(--mincho); font-weight: 700; font-size: clamp(28px, 4.4vw, 44px); line-height: 1.3; }
.meta { margin: 0 0 14px; font-size: 13px; color: var(--sub); }
.blurb { margin: 0 0 22px; font-size: 15px; max-width: 34em; }
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; gap: 20px; padding-top: 10px; }
  .hero-cover { width: 72%; max-width: 280px; margin: 0 auto; }
}

.resume { margin: 22px 0 0; }
.resume a {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); text-decoration: none;
}
.resume img { width: 42px; height: auto; border-radius: 3px; flex: none; }
.r-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.5; }
.r-label { font-size: 12px; color: var(--sub); }
.r-title { font-family: var(--mincho); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-go { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; }

.shelf { padding: 30px 0 8px; }
.shelf-title { margin: 0 0 16px; font-size: 13px; font-weight: 600; letter-spacing: .12em; color: var(--sub); }
.shelf-title span { margin-left: .6em; font-weight: 400; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 26px 18px; }
@media (max-width: 480px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; } }
.series + .series { margin-top: 30px; }
.series-title { margin: 0 0 14px; font-family: var(--mincho); font-weight: 700; font-size: 20px; line-height: 1.4; }
.series-title span { margin-left: .7em; font-family: var(--sans); font-weight: 400; font-size: 12px; color: var(--sub); }
.shelf + .shelf { border-top: 1px solid var(--line); }
.card { display: block; text-decoration: none; }
.thumb { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 4px; background: var(--line); box-shadow: var(--shadow); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .thumb img { transform: scale(1.03); }
.card-title { display: block; margin-top: 10px; font-family: var(--mincho); font-weight: 700; font-size: 15px; line-height: 1.45; }
.card-meta { display: block; font-size: 12px; color: var(--sub); }
.badge {
  position: absolute; left: 8px; bottom: 8px; padding: 2px 9px; border-radius: 999px;
  background: rgba(20, 18, 16, .8); color: #fff; font-size: 11px; font-weight: 600; line-height: 1.7;
}
.badge.done { background: rgba(20, 18, 16, .55); }
.site-foot { padding-top: 40px; padding-bottom: 48px; font-size: 12px; color: var(--sub); }
.site-foot p { margin: 2px 0; }
.notfound { padding-top: 60px; padding-bottom: 80px; }
.notfound h1 { font-family: var(--mincho); }

/* ---------------- 読む ---------------- */
body.reader {
  height: 100vh; height: 100dvh; overflow: hidden; overscroll-behavior: none;
  background: #111; color: #eee;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
.stage { position: fixed; inset: 0; overflow: hidden; touch-action: none; }
.track { position: absolute; inset: 0; will-change: transform; }
.slot { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.view { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transform-origin: 0 0; }
.pair { display: flex; flex-direction: row-reverse; }
.pair img { max-width: none; background: #1b1b1b; -webkit-user-drag: none; }
body.zoomed .stage { cursor: grab; }

.bar {
  position: fixed; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  color: #f2f2f2; pointer-events: none; transition: opacity .2s, transform .2s;
}
.bar a, .bar input, .bar button { pointer-events: auto; }
.bar-top { top: 0; padding-top: max(10px, env(safe-area-inset-top)); background: linear-gradient(rgba(0, 0, 0, .75), rgba(0, 0, 0, 0)); }
.bar-bottom { bottom: 0; padding: 18px 18px max(14px, env(safe-area-inset-bottom)); background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .75)); }
body.ui-hidden .bar { opacity: 0; }
body.ui-hidden .bar a, body.ui-hidden .bar input, body.ui-hidden .bar button { pointer-events: none; }
body.ui-hidden .bar-top { transform: translateY(-8px); }
body.ui-hidden .bar-bottom { transform: translateY(8px); }
.back { flex: none; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); font-size: 14px; text-decoration: none; }
.bar-title { flex: 1; min-width: 0; margin: 0; font-size: 14px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { flex: none; min-width: 4.6em; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fs {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin: -4px -4px -4px 0;
  border: 0; border-radius: 999px; background: rgba(255, 255, 255, .14); color: inherit; cursor: pointer;
}
.fs[hidden] { display: none; }
.fs:hover { background: rgba(255, 255, 255, .24); }
.fs:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.fs-off, body.fullscreen .fs-on { display: none; }
body.fullscreen .fs-off { display: block; }
.seek { direction: rtl; width: 100%; height: 28px; margin: 0; accent-color: #e0745a; }

.nav {
  display: none; position: fixed; top: 50%; z-index: 4; width: 44px; height: 64px; margin-top: -32px;
  border: 0; border-radius: 10px; background: rgba(255, 255, 255, .08); color: #fff;
  font: 300 34px/1 var(--sans); cursor: pointer; transition: opacity .2s, background .2s;
}
.nav:hover { background: rgba(255, 255, 255, .18); }
.nav-next { left: 14px; }
.nav-prev { right: 14px; }
@media (hover: hover) and (pointer: fine) { .nav { display: block; } }
body.ui-hidden .nav { opacity: 0; }
body.ui-hidden .nav:hover { opacity: 1; }
body.zoomed .nav, body.at-end .nav-next, body.at-start .nav-prev { display: none; }

.hint { position: fixed; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .5); pointer-events: none; }
.hint[hidden] { display: none; }
.hint-box { padding: 18px 24px; border-radius: 12px; background: rgba(20, 20, 20, .82); color: #fff; font-size: 14px; line-height: 1.9; text-align: center; }
.hint-box p { margin: 0; }
.hint-arrow { font-size: 20px; font-weight: 700; }

.endcard {
  width: min(400px, calc(100% - 32px)); padding: 28px 22px 22px;
  border: 1px solid #2c2a27; border-radius: 14px; background: #1c1b19; color: #ece7dd; text-align: center;
}
.owari { margin: 0 0 4px; font-family: var(--mincho); font-size: 30px; font-weight: 700; letter-spacing: .2em; }
.end-title { margin: 0 0 20px; font-family: var(--mincho); font-size: 16px; font-weight: 600; color: #bdb5a8; }
.end-actions { display: grid; gap: 10px; }
.end-actions .btn { width: 100%; background: #ece7dd; color: #161513; }
.end-actions .btn.ghost { background: transparent; color: #ece7dd; border: 1px solid #3d3a35; }
.end-more { margin-top: 22px; text-align: left; }
.end-more p { margin: 0 0 6px; font-size: 12px; letter-spacing: .1em; color: #a39b8e; }
.end-more a { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; text-decoration: none; }
.end-more a:hover { background: #262421; }
.end-more img { width: 40px; height: auto; border-radius: 3px; flex: none; }
.end-more span { font-family: var(--mincho); font-size: 14px; font-weight: 700; }

.noscript { position: absolute; inset: 0; overflow: auto; touch-action: auto; padding: 56px 0; }
.noscript img { width: 100%; max-width: 800px; height: auto; margin: 0 auto 8px; }
