/* 夜のインディゴを土台に、読む部分だけクリーム。光っているところ（琥珀）がボタン */
:root {
  /* 指定の6色 */
  --night: #1f2440;   /* 夜空のインディゴ：ヘッダー、ヒーロー、フッター。全体の約6割 */
  --cream: #f1e6d0;   /* 石畳のクリーム：漫画・キャラ紹介・通販など読む部分。約3割 */
  --amber: #e8b465;   /* ランタンの琥珀：ボタン */
  --pink:  #d49aa3;   /* くすみピンク：花の飾り、選択中のタブ、小さな目印 */
  --mauve: #8a6b88;   /* 花びらのモーヴ：区切り線、サブ見出し */
  --char:  #2b2630;   /* 黒い葉のチャコール：クリーム地の上の文字 */

  /* 上の色から作った補助の色（読みやすさのため） */
  --cream-2: #e7d9bf;      /* クリームより少し濃い面 */
  --cream-3: #f7efdf;      /* カードの面 */
  --night-2: #2a3053;      /* インディゴより少し明るい面 */
  --link: #5e4760;         /* モーヴを濃くした文字色。クリーム地の上で読める */
  --muted: #5d525f;        /* 補足の文字 */
  --line: rgba(138, 107, 136, 0.35);

  --display: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --body: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--char);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: 0.02em;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
h1, h2 { font-family: var(--display); font-weight: 800; line-height: 1.4; text-wrap: balance; letter-spacing: 0.04em; margin: 0; }
h2 { font-size: 1.45rem; }
h3 { font-family: var(--display); font-weight: 800; margin: 0; }
p { margin: 0; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding-inline: 20px; }
.wrap.narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; background: var(--cream); padding: 6px 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* ヘッダー：夜のインディゴ */
.site-header {
  background: var(--night);
  color: var(--cream);
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  border-bottom: 1px solid rgba(232, 180, 101, 0.3);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--cream); text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: 0.08em; }
.logo img { width: 36px; height: 36px; }
.site-header nav { display: flex; gap: 4px 18px; flex-wrap: wrap; }
.site-header nav a { color: var(--cream); text-decoration: none; font-size: 0.95rem; padding-block: 4px; border-bottom: 2px solid transparent; }
.site-header nav a:hover { border-color: var(--amber); }
.site-header nav a[aria-current="page"] { border-color: var(--pink); }

/* ヒーロー：町の絵を全面に敷き、文字は左下の暗がりに置く（スマホは絵の下に重ねる） */
.hero { background: var(--night); color: var(--cream); position: relative; overflow: hidden; }
.hero-media { position: relative; height: clamp(300px, 112vw, 520px); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 86%; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--night) 0%, rgba(31, 36, 64, 0.55) 35%, rgba(31, 36, 64, 0) 70%); }
.hero-text { position: relative; margin-top: -72px; padding-bottom: 48px; }
.eyebrow { color: var(--amber); font-size: 0.8rem; letter-spacing: 0.25em; text-transform: uppercase; }
.hero h1 { font-size: clamp(1.9rem, 6vw, 3.1rem); margin-top: 6px; word-break: keep-all; overflow-wrap: break-word; line-break: strict; text-shadow: 0 2px 18px rgba(31, 36, 64, 0.8); }
.lead { margin-top: 14px; max-width: 34em; opacity: 0.95; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
@media (min-width: 880px) {
  .hero { min-height: clamp(520px, 80vh, 700px); display: flex; align-items: flex-end; }
  .hero-media { position: absolute; inset: 0; height: auto; }
  .hero-media img { object-position: 60% 40%; }
  .hero-media::after {
    background:
      linear-gradient(to right, rgba(31, 36, 64, 0.94) 0%, rgba(31, 36, 64, 0.78) 30%, rgba(31, 36, 64, 0) 62%),
      linear-gradient(to top, rgba(31, 36, 64, 0.85) 0%, rgba(31, 36, 64, 0) 40%);
  }
  .hero-text { margin-top: 0; padding-block: 0 64px; }
  .hero-text > * { max-width: 28em; }
  .hero-text h1 { max-width: 9.5em; text-shadow: 0 2px 14px rgba(31,36,64,.85); }
  .hero-text .lead { text-shadow: 0 1px 10px rgba(31,36,64,.9); }
}

/* ボタン：光っているところを押す */
.btn { display: inline-block; padding: 11px 24px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 0.95rem; }
.btn.primary { background: var(--amber); color: var(--char); box-shadow: 0 0 22px rgba(232, 180, 101, 0.35); }
.btn.primary:hover { background: #f2c684; }
.btn.ghost { border: 1.5px solid currentColor; color: inherit; }
.section:not(.hero) .btn.ghost { color: var(--char); }

/* セクション */
.section { padding-block: 48px; }
.section.tight { padding-block: 8px 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.more { font-size: 0.95rem; }
.page-title { font-size: clamp(1.6rem, 4.5vw, 2.2rem); margin-bottom: 8px; }
.section.tight h2 { margin-bottom: 16px; }

.paper-dark { background: var(--night-2); color: var(--cream); }
.paper-dark a { color: var(--amber); }
.story { max-width: 760px; display: grid; gap: 18px; }
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 8px 0 0; }
.rules div { border: 1px solid rgba(241, 230, 208, 0.25); border-radius: var(--radius); padding: 14px 16px; }
.rules dt { font-family: var(--display); font-weight: 800; color: var(--amber); font-size: 1.15rem; }
.rules dd { margin: 2px 0 0; }

/* 漫画カード */
.comic-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px 16px; }
@media (min-width: 700px) { .comic-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); } }
.comic-card a { display: grid; gap: 6px; text-decoration: none; color: var(--char); }
.thumb { display: block; aspect-ratio: 4 / 3; max-width: 100%; overflow: hidden; border-radius: 10px; background: var(--cream-2); box-shadow: 0 1px 0 rgba(43, 38, 48, 0.15); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.comic-card a:hover .thumb img { transform: scale(1.03); }
.meta { display: flex; gap: 10px; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.no { color: var(--link); font-weight: 700; }
.comic-title { font-weight: 700; line-height: 1.5; }

/* キャラカード */
.char-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (min-width: 700px) { .char-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.char-card a { display: grid; gap: 4px; text-decoration: none; color: var(--char); background: var(--cream-3); border-radius: var(--radius); padding: 12px 14px 16px; height: 100%; align-content: start; }
.char-card a:hover { background: #fff6e6; }
.char-name { font-family: var(--display); font-weight: 800; font-size: 1.1rem; }
.char-line { font-size: 0.88rem; color: var(--muted); line-height: 1.6; }

/* スタンプ */
.stickers { background: var(--cream-2); }
.status { font-size: 0.8rem; background: var(--night); color: var(--amber); padding: 2px 12px; border-radius: 999px; }
.sticker-name { font-weight: 700; margin-bottom: 14px; }
.sticker-strip { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 700px) { .sticker-strip { grid-template-columns: repeat(8, minmax(0, 1fr)); } }

/* X（旧Twitter） */
.x-section { background: var(--night); color: var(--cream); }
.x-inner { display: grid; gap: 20px; align-items: start; }
@media (min-width: 880px) { .x-inner { grid-template-columns: minmax(0, 1fr) 360px; } }
.x-embed { background: var(--night-2); border: 1px solid rgba(232, 180, 101, 0.25); border-radius: var(--radius); padding: 10px; min-height: 180px; }
.x-note { font-size: 0.9rem; opacity: 0.85; }

/* 漫画ページ：1コマずつ縦に読む */
.lead-sm { font-size: 1.05rem; margin-top: 4px; }
.chips, .filter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.filter { margin-block: 18px 24px; }
.chip { display: inline-block; font: inherit; font-size: 0.85rem; padding: 3px 14px; border-radius: 999px; border: 1px solid var(--mauve); color: var(--char); background: transparent; text-decoration: none; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--night); color: var(--cream); border-color: var(--night); }
.panels { list-style: none; margin: 28px 0 10px; padding: 0; display: grid; gap: 14px; justify-items: center; }
.panel { width: 100%; max-width: 760px; position: relative; }
.panel img { width: 100%; border-radius: 8px; box-shadow: 0 6px 26px rgba(31, 36, 64, 0.2); }
.panel-no {
  position: absolute; top: 8px; left: 8px;
  background: var(--night); color: var(--cream);
  font-size: 0.75rem; font-variant-numeric: tabular-nums;
  padding: 1px 9px; border-radius: 999px;
}
.transcript { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 12px; }
.transcript summary { cursor: pointer; font-weight: 700; }
.transcript p { margin-top: 10px; }
.share { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 32px; }
.pager a, .pager-end { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--radius); background: var(--cream-3); text-decoration: none; color: var(--char); font-weight: 700; min-width: 0; }
.pager a span { font-size: 0.78rem; color: var(--muted); font-weight: 400; }
.pager .next { text-align: right; }
.pager-end { color: var(--muted); font-weight: 400; text-align: right; align-content: center; }
.back { margin-top: 24px; }

/* プロフィール */
.profile { display: grid; gap: 24px; align-items: center; }
.profile-art { width: 100%; max-width: 320px; background: var(--cream-3); border-radius: var(--radius); }
.profile-text { display: grid; gap: 10px; min-width: 0; }
@media (min-width: 700px) { .profile { grid-template-columns: 320px minmax(0, 1fr); } }

/* お知らせ・イベント */
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.post-list li { border-bottom: 1px solid var(--line); padding-block: 14px; }
.post-list a { font-weight: 700; }
.post-date { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.post-body { margin-top: 18px; display: grid; gap: 14px; }
.event-where { font-size: 0.9rem; color: var(--mauve); font-weight: 700; }

/* フッター */
.site-footer { background: var(--night); color: var(--cream); padding-block: 36px calc(36px + env(safe-area-inset-bottom, 0px)); }
.footer-inner { display: grid; gap: 12px; }
.footer-copy { font-family: var(--display); font-weight: 800; font-size: 1.1rem; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { color: var(--cream); }
.credit { font-size: 0.8rem; opacity: 0.75; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* キャラページ：今日の気分 */
.sheet-note { margin-bottom: 12px; }
.mood-stage { width: min(100%, 420px); aspect-ratio: 1; background: var(--cream-3); border-radius: var(--radius); overflow: hidden; }
.mood-stage img { width: 100%; height: 100%; object-fit: contain; }
.mood-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* 夕方→真夜中の切り替え（town-hero-dusk.jpg があるときだけ） */
.hero-dusk { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.hero-dusk img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 86%; }
@media (min-width: 880px) { .hero-dusk img { object-position: 60% 40%; } }
.hero-hint { position: absolute; z-index: 2; right: 16px; top: 12px; margin: 0; padding: 4px 12px; border-radius: 999px; background: rgba(31, 36, 64, .7); color: var(--cream); font-size: .8rem; }
@media (min-width: 880px) { .hero-hint { top: 76px; } }
