/* =========================================================
   モチキン非公式ファンサイト
   おでんの出汁をイメージした、あたたかい配色
   ========================================================= */

:root {
  --dashi:      #f6efe0;   /* 出汁の色・背景 */
  --dashi-deep: #efe3cd;
  --pouch:      #f0d9a4;   /* 巾着のきつね色 */
  --pouch-dark: #d9b672;
  --tie:        #b8874a;   /* かんぴょうの帯 */
  --ink:        #3c2a1c;
  --ink-soft:   #6b5540;
  --accent:     #d2603f;   /* 唐辛子の赤 */
  --accent-2:   #7fa650;   /* 青のり・薬味の緑 */
  --daikon:     #fdfaf3;
  --line:       #e2d3b6;
  --shadow:     0 4px 0 rgba(60, 42, 28, .10);
  --radius:     18px;
  /* 本文：丸ゴシック。見出し：ぽってりしたポップ体（どちらも SIL OFL） */
  --font: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Kaku Gothic ProN",
          "Yu Gothic Medium", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --font-display: "Mochiy Pop One", "Zen Maru Gothic", "Hiragino Maru Gothic ProN",
          "Yu Gothic", Meiryo, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--dashi);
  /* 背景はモチキンのシルエット柄（tools/make_pattern.py で生成） */
  background-image: url("img/pattern-mochikin.webp");
  background-size: 620px 620px;
  background-repeat: repeat;
  line-height: 1.9;
  font-size: 16px;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

img { max-width: 100%; }

/* ---------- 湯気 ---------- */
.steam {
  position: fixed;
  inset: 0 0 auto 0;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.steam span {
  position: absolute;
  bottom: -140px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.55), rgba(255,255,255,0) 70%);
  animation: rise 22s linear infinite;
}
.steam span:nth-child(1) { left: 6%;  animation-delay: 0s;   }
.steam span:nth-child(2) { left: 28%; animation-delay: -6s;  transform: scale(.7); }
.steam span:nth-child(3) { left: 52%; animation-delay: -11s; transform: scale(1.2); }
.steam span:nth-child(4) { left: 74%; animation-delay: -3s;  transform: scale(.85); }
.steam span:nth-child(5) { left: 91%; animation-delay: -15s; transform: scale(.6); }

@keyframes rise {
  0%   { transform: translateY(0) scale(.8);   opacity: 0; }
  15%  { opacity: .8; }
  100% { transform: translateY(-115vh) scale(1.6); opacity: 0; }
}

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px clamp(16px, 4vw, 40px);
  background: rgba(246, 239, 224, .88);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
}
.logo-mark {
  width: 34px;
  height: auto;
  display: block;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.25; font-size: 19px; }
.logo-text small { font-size: 11px; font-weight: 400; color: var(--ink-soft); letter-spacing: .1em; }

.nav {
  display: flex;
  gap: clamp(8px, 1.6vw, 20px);
  flex-wrap: wrap;
}
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 88px) clamp(20px, 5vw, 40px);
}

.hero-kicker {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: .18em;
  color: var(--ink-soft);
}

.hero-title {
  margin: 0 0 18px;
  line-height: 1.1;
}
.ruby-line {
  display: block;
  font-size: clamp(48px, 10vw, 92px);
  letter-spacing: .04em;
  color: var(--ink);
  text-shadow: 3px 3px 0 var(--pouch);
}
.hero-sub {
  display: block;
  margin-top: 10px;
  font-size: clamp(13px, 2vw, 16px);
  font-weight: 400;
  letter-spacing: .22em;
  color: var(--ink-soft);
}

.hero-lead { margin: 0 0 20px; font-size: clamp(16px, 2.2vw, 19px); }

.hero-catch {
  display: inline-block;
  margin: 0 0 24px;
  padding: 8px 20px;
  background: var(--pouch);
  border: 2px dashed var(--tie);
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .1em;
  transform: rotate(-1.5deg);
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-note {
  margin: 22px 0 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.8;
}

.btn {
  display: inline-block;
  /* スマホで素早く2回押すと、ブラウザが「ダブルタップ拡大」と解釈して
     画面が拡大されてしまう。連打する前提のボタンなので、それを止める。 */
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  padding: 12px 26px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  border: 2px solid var(--ink);
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  font-family: inherit;
}
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost   { background: var(--daikon); color: var(--ink); }

/* ---------- HERO のイラスト（CSSで描いたオリジナル） ---------- */
.hero-art { display: flex; flex-direction: column; align-items: center; }

.hero-oden {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
}

.art-note {
  margin-top: 20px;
  font-size: 11.5px;
  color: var(--ink-soft);
}

/* ---------- セクション共通 ---------- */
.section {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 90px) clamp(20px, 5vw, 40px);
}
.section-alt {
  max-width: none;
  background: rgba(255, 253, 248, .72);
  border-top: 2px dashed var(--line);
  border-bottom: 2px dashed var(--line);
}
.section-alt > * { max-width: 1000px; margin-left: auto; margin-right: auto; }

.section-title {
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.section-title .jp {
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: .05em;
}
.section-title .en {
  font-size: 11px;
  letter-spacing: .28em;
  color: var(--accent);
  font-weight: 400;
}
.section-title::after {
  content: "";
  display: block;
  width: 64px; height: 6px;
  margin-top: 12px;
  background: var(--pouch);
  border-radius: 999px;
}

.section-lead {
  margin: 0 0 32px;
  color: var(--ink-soft);
  max-width: 62ch;
}

/* ---------- 各セクションに置いたモチキン（管理人の二次創作イラスト） ---------- */
.section { position: relative; }

.section-mascot {
  position: absolute;
  top: clamp(28px, 5vw, 62px);
  right: clamp(8px, 3vw, 40px);
  width: clamp(88px, 13vw, 148px);
  height: auto;
  z-index: 2;
  pointer-events: none;
}
.mascot-run   { transform: rotate(-4deg); }
.mascot-smile { transform: rotate(3deg);  }
.mascot-side  { transform: rotate(-2deg); }
.mascot-walk  { transform: rotate(2deg);  }

.meter-face {
  width: 34px;
  height: auto;
  vertical-align: -10px;
  margin-right: 6px;
}

@media (max-width: 720px) {
  .section-mascot {
    position: static;
    display: block;
    width: 104px;
    margin: 0 0 8px auto;
  }
}

/* ---------- ABOUT ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 24px;
  align-items: start;
}

.card {
  background: var(--daikon);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: 6px 6px 0 rgba(60, 42, 28, .12);
}
.card p { margin: 0 0 14px; }
.card p:last-child { margin-bottom: 0; }

.profile {
  margin: 0;
  background: var(--pouch);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 8px 22px;
  box-shadow: 6px 6px 0 rgba(60, 42, 28, .12);
}
.profile > div {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 8px;
  padding: 11px 0;
  border-bottom: 1px dashed rgba(60, 42, 28, .28);
}
.profile > div:last-child { border-bottom: none; }
.profile dt { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.profile dd { margin: 0; font-size: 14px; }

.quote-strip {
  margin-top: 30px;
  padding: 22px 26px;
  background: var(--ink);
  color: var(--dashi);
  border-radius: var(--radius);
  transform: rotate(-.6deg);
}
.quote-strip blockquote { margin: 0; font-size: clamp(15px, 2.4vw, 19px); }
.quote-strip cite {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-style: normal;
  opacity: .7;
}

/* ---------- DANGER ---------- */
.danger-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}
.danger-card {
  background: var(--daikon);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 22px 20px;
  transition: transform .18s;
}
.danger-card:hover { transform: translateY(-5px) rotate(-1deg); }
.danger-icon {
  display: block;
  width: 100px;
  height: auto;
  margin-bottom: 4px;
}
.danger-card h3 { margin: 12px 0 8px; font-size: 17px; }
.danger-card p  { margin: 0; font-size: 14px; color: var(--ink-soft); }

.meter-block {
  margin-top: 32px;
  padding: 26px 28px;
  background: var(--pouch);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
}
.meter-label { margin: 0 0 16px; font-weight: 700; letter-spacing: .08em; }
.meters { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.meters li {
  display: grid;
  grid-template-columns: 7em 1fr 2.6em;
  align-items: center;
  gap: 12px;
}
.m-name { font-size: 14px; font-weight: 700; }
.m-bar {
  height: 16px;
  background: var(--daikon);
  border: 3px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}
.m-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(45deg, var(--accent) 0 8px, #e0765a 8px 16px);
  transition: width 1.2s cubic-bezier(.2, .8, .3, 1);
}
.is-visible .m-bar i { width: var(--v); }
.m-val { font-size: 13px; text-align: right; font-weight: 700; }
.meter-note { margin: 16px 0 0; font-size: 11.5px; color: var(--ink-soft); }

/* ---------- SPELL ---------- */
.spell-wrap {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 24px;
  align-items: start;
}

.spell-card {
  text-align: center;
  padding: 34px 28px;
  background: var(--daikon);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 rgba(60, 42, 28, .12);
}
.spell-intro, .spell-outro { margin: 0; font-size: 14px; color: var(--ink-soft); }
.spell-word {
  margin: 22px 0;
  font-size: clamp(26px, 5.5vw, 46px);
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink);
  text-shadow: 2px 2px 0 var(--pouch), 4px 4px 0 rgba(60, 42, 28, .12);
}
.btn-spell {
  margin-top: 22px;
  background: var(--accent-2);
  color: #fff;
}
.spell-result {
  min-height: 1.9em;
  margin: 14px 0 0;
  font-weight: 700;
  color: var(--accent);
}
.spell-src { margin: 14px 0 0; font-size: 12.5px; }

.spell-side {
  background: var(--pouch);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 24px 26px;
}
.spell-side h3 { margin: 0 0 12px; font-size: 17px; }
.tips { margin: 0; padding-left: 1.2em; }
.tips li { margin-bottom: 12px; font-size: 14px; }
.tips li:last-child { margin-bottom: 0; }

/* 膨らんで破裂する演出。
   原作では「しみっしみの大根」と唱えられると、モチキンは膨張して破裂する。 */
.mochikin-burst {
  position: fixed;
  z-index: 55;
  pointer-events: none;
  height: auto;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}
.mochikin-burst.is-swelling {
  animation: mochikin-swell .34s cubic-bezier(.3, .7, .4, 1) forwards;
}
.mochikin-burst.is-burst {
  animation: mochikin-pop .56s cubic-bezier(.2, .8, .3, 1) forwards;
}

@keyframes mochikin-swell {
  0%   { transform: translate(-50%, -50%) scale(.55); opacity: 0; }
  35%  { opacity: 1; }
  /* ふくらみながら、こらえきれずに震える */
  70%  { transform: translate(-50%, -50%) scale(1.06) rotate(-2.5deg); opacity: 1; }
  85%  { transform: translate(-50%, -50%) scale(1.12) rotate(2.5deg); }
  100% { transform: translate(-50%, -50%) scale(1.18); opacity: 1; }
}

@keyframes mochikin-pop {
  0%   { transform: translate(-50%, -50%) scale(.9);  opacity: 1; }
  30%  { transform: translate(-50%, -50%) scale(1.35); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.75); opacity: 0; }
}

/* モチキンが降ってくる演出 */
.mochikin-drop {
  position: fixed;
  top: -140px;
  width: 64px;
  height: auto;
  z-index: 50;
  pointer-events: none;
  animation: drop 2.6s cubic-bezier(.45, .05, .75, .6) forwards;
}
@keyframes drop {
  0%   { transform: translateY(0) rotate(0deg);              opacity: 0; }
  8%   {                                                     opacity: 1; }
  85%  {                                                     opacity: 1; }
  100% { transform: translateY(112vh) rotate(var(--spin, 360deg)); opacity: 0; }
}

/* ---------- TIMELINE ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.chip {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  padding: 7px 18px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--daikon);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s, color .18s;
}
.chip:hover { background: var(--pouch); }
.chip.is-active { background: var(--ink); color: var(--dashi); }

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 clamp(12px, 3vw, 28px);
  border-left: 4px dotted var(--tie);
}

.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 18px;
  padding: 0 0 26px;
}
.tl-item::before {
  content: "";
  position: absolute;
  left: calc(-1 * clamp(12px, 3vw, 28px) - 12px);
  top: 6px;
  width: 16px; height: 16px;
  background: var(--pouch);
  border: 3px solid var(--ink);
  border-radius: 50%;
}
.tl-item.is-hidden { display: none; }

.tl-date { text-align: right; padding-top: 2px; }
.tl-date .y { display: block; font-size: 11px; color: var(--ink-soft); letter-spacing: .1em; }
.tl-date .d { display: block; font-size: 19px; font-weight: 700; }

.tl-body {
  background: var(--daikon);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 18px 22px;
}
.tl-body h3 { margin: 8px 0 8px; font-size: 18px; }
.tl-body p  { margin: 0; font-size: 14.5px; color: var(--ink-soft); }

.tl-tag {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .06em;
}
.tag-debut  { background: var(--accent-2); }
.tag-danger { background: var(--accent); }
.tag-key    { background: #c1892f; }
.tag-news   { background: #5f8fb0; }
.tag-side   { background: #8b7a94; }
.tag-cute   { background: #d98aa4; }

.tl-src {
  display: inline-block;
  margin-top: 12px;
  margin-right: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 2px solid var(--pouch);
}
.tl-src::before { content: "🔗 "; }
.tl-src:hover { border-bottom-color: var(--accent); }
.tl-src.sub { font-weight: 400; font-size: 12px; color: var(--ink-soft); }

.tl-more {
  margin-top: 8px;
  font-size: 14px;
  color: var(--ink-soft);
}

/* =========================================================
   トップページ：漫画ストリーム
   ========================================================= */

.nav .nav-guide,
.nav .nav-home {
  font-weight: 700;
  color: var(--accent);
}
.nav a.is-current {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.stream-head {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: clamp(34px, 6vw, 60px) 20px clamp(16px, 3vw, 26px);
}
.stream-hero {
  display: block;
  width: clamp(120px, 20vw, 190px);
  height: auto;
  margin: 0 auto 6px;
}

.stream-title {
  margin: 0;
  font-size: clamp(30px, 6vw, 46px);
  letter-spacing: .08em;
  text-shadow: 3px 3px 0 var(--pouch);
}
.stream-sub {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: .04em;
}
.stream-caveat {
  margin: 8px auto 0;
  font-size: 12px;
  color: var(--ink-soft);
  opacity: .85;
}

.stream-hint {
  max-width: 34em;
  margin: 14px auto 0;
  padding: 10px 16px;
  background: var(--daikon);
  border: 2px dashed var(--tie);
  border-radius: 12px;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--ink-soft);
  text-align: left;
}

.stream {
  position: relative;
  z-index: 1;
  list-style: none;
  max-width: 620px;
  margin: 0 auto;
  padding: 0 16px;
}

.stream-item {
  margin: 0 0 clamp(34px, 6vw, 56px);
  scroll-margin-top: 90px;
}

.stream-cap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 0 4px 8px;
  border-bottom: 3px solid var(--pouch);
}
.cap-no {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--tie);
  border-radius: 999px;
  padding: 1px 10px;
  letter-spacing: .06em;
}
.cap-date {
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: .06em;
}
.cap-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .02em;
}
.stream-embed { min-height: 120px; }

/* ---------- 引用カード（公式フレーム風・切り抜きなし） ---------- */
.tweet-card {
  margin: 0;
  background: #fff;
  border: 1px solid #cfd9de;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 0 rgba(60, 42, 28, .08);
  color: #0f1419;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
}

.tweet-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
}
.tweet-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  flex: none;
  background: #eee;
}
.tweet-who {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  min-width: 0;
}
.tweet-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f1419;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tweet-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: #1d9bf0;
  color: #fff;
  font-size: 10px;
  line-height: 1;
}
.tweet-handle {
  font-size: 14px;
  color: #536471;
  text-decoration: none;
}
.tweet-handle:hover { text-decoration: underline; }

.tweet-mark {
  margin-left: auto;
  font-size: 17px;
  color: #0f1419;
  text-decoration: none;
  line-height: 1;
  padding: 4px;
}
.tweet-mark:hover { opacity: .6; }

.tweet-text {
  margin: 0;
  padding: 0 16px 12px;
  font-size: 15px;
  line-height: 1.6;
  color: #0f1419;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 漫画本体。height:auto で原寸比のまま全体を表示する（切り抜かない） */
.tweet-media {
  padding: 0 16px;
  display: grid;
  gap: 8px;
}
.tweet-media.is-multi { gap: 10px; }

.tweet-photo {
  display: block;
  /* 縦スクロールの妨げにならないようにし、長押しメニューも出さない */
  touch-action: pan-y;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: rgba(60, 42, 28, .06);
  border: 1px solid #cfd9de;
  border-radius: 12px;
  overflow: hidden;
  background: #f7f9f9;
  line-height: 0;
}
.tweet-photo img {
  display: block;
  width: 100%;
  height: auto;          /* ← 切り抜きをしないための肝 */
  max-width: 100%;
}

.tweet-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px 14px;
  margin-top: 12px;
  border-top: 1px solid #eff3f4;
  font-size: 13px;
  color: #536471;
}
.tweet-likes { color: #f91880; font-weight: 700; }
.tweet-date  { letter-spacing: .04em; }
.tweet-link {
  margin-left: auto;
  color: #1d9bf0;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}
.tweet-link:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .tweet-foot { font-size: 12px; gap: 10px; }
  .tweet-link { margin-left: 0; width: 100%; }
}

/* 読み込み中のプレースホルダ */
.embed-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  background: var(--daikon);
  border: 3px solid var(--line);
  border-radius: var(--radius);
}
.embed-skeleton span {
  display: block;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--dashi-deep), var(--daikon), var(--dashi-deep));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.embed-skeleton span:nth-child(2) { width: 70%; }
.embed-skeleton span:nth-child(3) { width: 40%; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.stream-end {
  position: relative;
  z-index: 1;
  text-align: center;
  margin: 0;
  padding: clamp(24px, 5vw, 48px) 20px clamp(40px, 7vw, 70px);
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 2.2;
}

.footer-note {
  max-width: 46em;
  margin: 18px auto 0;
  font-size: 11.5px;
  line-height: 1.9;
  opacity: .66;
}
.footer-note a { color: var(--pouch); }

/* ---------- 漫画の埋め込み（Xの公式ウィジェット） ---------- */
.embed-note {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: -14px 0 26px;
  padding: 14px 18px;
  background: var(--daikon);
  border: 2px dashed var(--tie);
  border-radius: 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.btn-openall {
  flex: none;
  padding: 7px 18px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--pouch);
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.btn-openall:hover:not(:disabled) { background: var(--accent); color: #fff; }
.btn-openall:disabled { opacity: .55; cursor: default; }

.btn-read {
  display: block;
  margin-top: 14px;
  padding: 9px 22px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--pouch);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform .12s, box-shadow .12s;
}
.btn-read::before { content: "📖 "; }
.btn-read:hover  { background: var(--pouch-dark); }
.btn-read:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }

.tl-embed {
  margin-top: 16px;
  padding-top: 4px;
  border-top: 2px dashed var(--line);
}
.tl-embed[hidden] { display: none; }

/* 埋め込みウィジェットの横幅がカードからはみ出さないように */
.tl-embed .twitter-tweet,
.tl-embed iframe {
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.embed-loading,
.embed-error {
  margin: 12px 0;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}
.embed-error { color: var(--accent); }

/* ---------- CAST ---------- */
.cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.cast-card {
  background: var(--daikon);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.cast-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  display: inline-block;
  padding-bottom: 3px;
  border-bottom: 3px solid var(--pouch);
}
.cast-card p { margin: 0; font-size: 13.5px; color: var(--ink-soft); }

/* ---------- SOURCE ---------- */
.source-box {
  background: var(--daikon);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 28px 30px;
}
.source-box > p { margin: 0 0 16px; font-size: 14.5px; }
.source-h {
  margin: 26px 0 10px;
  font-size: 16px;
  padding-bottom: 4px;
  border-bottom: 3px solid var(--pouch);
  display: inline-block;
}
.source-link a { font-size: 14px; }

.src-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 4px;
}
.src-list li {
  display: grid;
  grid-template-columns: 6.6em 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
}
.src-d {
  font-size: 11.5px;
  color: var(--ink-soft);
  letter-spacing: .04em;
  white-space: nowrap;
}
.src-list a { text-decoration: none; border-bottom: 1px solid var(--pouch); }
.src-list a:hover { border-bottom-color: var(--accent); }

.disclaimer {
  margin: 22px 0 0;
  padding-left: 1.2em;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.disclaimer li { margin-bottom: 8px; }

/* ---------- FOOTER ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 56px 20px 44px;
  background: var(--ink);
  color: var(--dashi);
}
.footer-mark {
  display: block;
  width: 62px;
  height: auto;
  margin: 0 auto 10px;
}
.footer-text { margin: 0; font-weight: 700; letter-spacing: .08em; }
.footer-sub  { margin: 6px 0 0; font-size: 12px; opacity: .72; }
.footer-sub a { color: var(--pouch); }
.footer-spell {
  margin: 22px 0 0;
  font-size: 11px;
  letter-spacing: .35em;
  opacity: .4;
}

/* ---------- スクロール表示アニメーション ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-actions { justify-content: center; }
  .hero-art { order: -1; }
  .about-grid, .spell-wrap { grid-template-columns: 1fr; }
  .nav { width: 100%; justify-content: center; }
}

@media (max-width: 560px) {
  .tl-item { grid-template-columns: 1fr; gap: 8px; }
  .tl-date { text-align: left; display: flex; align-items: baseline; gap: 8px; }
  .tl-date .y { font-size: 12px; }
  .meters li { grid-template-columns: 5.6em 1fr 2.4em; }
  .src-list li { grid-template-columns: 1fr; gap: 2px; }
  .section-alt { padding-left: 16px; padding-right: 16px; }
}

/* ---------- 動きを減らす設定への配慮 ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .m-bar i { width: var(--v); }
}


/* =========================================================
   書体の割りあて
   本文は Zen Maru Gothic、見出しなどは Mochiy Pop One。
   Mochiy Pop One は太さが1種類なので、font-weight は上書きしない。
   ========================================================= */

.logo-text,
.ruby-line,
.hero-catch,
.stream-title,
.section-title .jp,
.spell-word,
.cap-title,
.cap-no,
.tl-date .d,
.danger-card h3,
.cast-card h3,
.spell-side h3,
.source-h,
.meter-label,
.quote-strip blockquote,
.btn,
.chip,
.footer-text {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: .04em;
}

/* ポップ体は線が太めなので、詰まって見えないよう行間を少し広げる */
.ruby-line,
.stream-title,
.spell-word {
  line-height: 1.25;
}

/* 引用カードは X の見た目に寄せたいので、本文は元のゴシックのままにする */
.tweet-card,
.tweet-card * {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
}


/* ---------- スマホ：固定ヘッダーが場所を取りすぎないように詰める ----------
   ナビを折り返させると3行になり、画面の3分の1をヘッダーが占めてしまう。
   1行に固定して横スクロールにすることで、高さを半分に抑える。 */
@media (max-width: 560px) {
  .site-header {
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    padding: 7px clamp(12px, 4vw, 20px);
  }
  .logo { flex: none; }
  .logo-mark { width: 26px; }
  .logo-text { font-size: 15px; }
  .logo-text small { font-size: 10px; }

  .nav a { font-size: 14px; }

  html { scroll-padding-top: 72px; }

  /* ヘッダーの直下に絵が来ると窮屈なので、上に余白を足す */
  .hero { padding-top: 28px; }
  .stream-head { padding-top: 26px; }

  /* 各話の見出しは、番号と日付を1行にして題名を次の行へ */
  .stream-cap { gap: 6px 8px; }
  .cap-title { width: 100%; font-size: 15px; }
}


/* ---------- 404 ページ ---------- */
.notfound {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(48px, 10vw, 110px) 20px clamp(60px, 10vw, 110px);
  text-align: center;
}
.notfound-art {
  display: block;
  width: clamp(120px, 26vw, 180px);
  height: auto;
  margin: 0 auto 18px;
}
.notfound-code {
  margin: 0;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: .32em;
  color: var(--accent);
}
.notfound-title {
  margin: 6px 0 18px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 7vw, 46px);
  letter-spacing: .08em;
  text-shadow: 3px 3px 0 var(--pouch);
}
.notfound-lead {
  margin: 0 0 30px;
  font-size: 15px;
  color: var(--ink-soft);
}
.notfound-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}


/* =========================================================
   スマホのメニュー（開閉式）
   ボタンは nav.js が作る。JS が動かない場合は .has-nav-toggle が
   付かないので、ナビはそのまま並んだ状態で使える。
   ========================================================= */

.nav-toggle { display: none; }

@media (max-width: 700px) {
  .site-header.has-nav-toggle {
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    margin-left: auto;
    width: 42px;
    height: 42px;
    padding: 0;
    background: var(--daikon);
    border: 2px solid var(--ink);
    border-radius: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-bars {
    display: block;
    position: relative;
    width: 18px;
    height: 14px;
  }
  .nav-bars i {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2.5px;
    border-radius: 2px;
    background: var(--ink);
    transition: transform .22s ease, opacity .18s ease;
  }
  .nav-bars i:nth-child(1) { top: 0; }
  .nav-bars i:nth-child(2) { top: 50%; margin-top: -1.25px; }
  .nav-bars i:nth-child(3) { bottom: 0; }

  /* 開いているあいだは × にする */
  .nav-open .nav-bars i:nth-child(1) { transform: translateY(5.75px) rotate(45deg); }
  .nav-open .nav-bars i:nth-child(2) { opacity: 0; }
  .nav-open .nav-bars i:nth-child(3) { transform: translateY(-5.75px) rotate(-45deg); }

  /* ナビ本体は、ヘッダーの下に開く板にする */
  .site-header.has-nav-toggle .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 4px clamp(14px, 5vw, 24px) 12px;
    background: rgba(246, 239, 224, .97);
    backdrop-filter: blur(8px);
    border-bottom: 2px solid var(--line);
    box-shadow: 0 10px 16px rgba(60, 42, 28, .10);

    /* 閉じているときは、たたんで触れないようにする */
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transition: max-height .24s ease, opacity .18s ease, visibility .24s;
  }
  .site-header.nav-open .nav {
    max-height: 70vh;
    opacity: 1;
    visibility: visible;
    overflow-y: auto;
  }

  .site-header.has-nav-toggle .nav a {
    padding: 11px 2px;
    font-size: 15px;
    border-bottom: 1px dashed var(--line);
  }
  .site-header.has-nav-toggle .nav a:last-child { border-bottom: none; }
  .site-header.has-nav-toggle .nav a:hover { border-bottom-color: var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  .site-header.has-nav-toggle .nav,
  .nav-bars i { transition: none; }
}


/* =========================================================
   みんなが唱えた回数（呪文のカードの中）
   ========================================================= */

.spell-count {
  margin: 22px auto 0;
  padding: 18px 20px 16px;
  max-width: 380px;
  background: var(--dashi);
  border: 2px dashed var(--tie);
  border-radius: 16px;
}

.count-line {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--ink-soft);
  letter-spacing: .04em;
}
.count-total {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.1;
  color: var(--ink);
  vertical-align: -4px;
}
.count-unit { font-size: 13px; color: var(--ink-soft); margin-left: 2px; }

.count-bar {
  height: 14px;
  background: var(--daikon);
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}
.count-bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(45deg, var(--accent-2) 0 8px, #94b866 8px 16px);
  transition: width .5s cubic-bezier(.2, .8, .3, 1);
}

.count-goal {
  margin: 9px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
  min-height: 1.4em;
}
.count-mine-line {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--ink-soft);
}
.count-mine { font-weight: 700; color: var(--accent); }
.count-note { margin: 6px 0 0; font-size: 11px; color: var(--ink-soft); opacity: .8; }

@media (prefers-reduced-motion: reduce) {
  .count-bar > i { transition: none; }
}
