/* ほんだな — 共通の見た目
   決めごと（UI仕上げ §12）
   ・性格：たまに見る・外の人（中学生・先生）が見る画面 → 演出は1画面1つまで
   ・色：支配＝ミント #53C197 ／ ニュートラル＝緑相を残した生成り ／ アクセント＝オレンジ #F0A15E
        （空色は「先生」「NEW」の札にだけ・色相は3つまで）
   ・書体：見出し Zen Maru Gothic 900 ＋ 欧文 Jost 700 ／ 本文 Noto Sans JP 400・700
   ・角丸：16px（ボタンだけ丸ピル）
   ・分ける手段：太い黒線＋ずらした黒影＝dōzo 系の「ステッカー」の絵柄として意図的に使う
   ・動かさない：フォームの入力欄・運営画面
*/
:root {
  --cream: #f4f1e8;
  --paper: #fdfbf6;
  --cream-2: #eae6da;
  --ink: #191615;
  --ink-2: #4a4640;
  --ink-3: #6f6a61;
  --mint: #53c197;
  --mint-soft: #d5efe4;
  --orange: #f0a15e;
  --orange-soft: #fbe3cc;
  --sky: #9cd5ea;
  --sky-soft: #dff1f8;
  --yellow: #f2c94c;
  --red: #d9482f;
  --r: 16px;
  --line: 2px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
  --shadow-l: 8px 8px 0 var(--ink);
  --font-body: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --font-disp: "Zen Maru Gothic", "Noto Sans JP", "Hiragino Sans", system-ui, sans-serif;
  --font-latin: "Jost", "Zen Maru Gothic", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  font-feature-settings: "palt";
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--yellow); color: var(--ink); }

.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
@media (max-width: 560px) { .wrap { width: min(1120px, 100% - 32px); } }

/* ---------- 見出し・文字 ---------- */
.disp { font-family: var(--font-disp); font-weight: 900; line-height: 1.25; letter-spacing: 0.01em; }
.latin { font-family: var(--font-latin); font-weight: 700; letter-spacing: 0.06em; }
.eyebrow {
  font-family: var(--font-latin); font-weight: 700; font-size: 12px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-2);
}
.marker { background: linear-gradient(transparent 55%, var(--yellow) 55%); padding-inline: 2px; }
.muted { color: var(--ink-3); }

/* ---------- ヘッダー ---------- */
.site-head {
  position: sticky; top: 0; z-index: 30;
  background: var(--cream);
  border-bottom: var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo img { width: 40px; height: 40px; }
.logo .word { font-family: var(--font-latin); font-weight: 700; font-size: 26px; letter-spacing: 0.04em; line-height: 1; }
.logo .word small { display: block; font-family: var(--font-disp); font-weight: 900; font-size: 11px; letter-spacing: 0.08em; margin-top: 2px; color: var(--ink-2); }
.site-head nav { margin-left: auto; display: flex; gap: 8px; align-items: center; }
@media (max-width: 560px) {
  .logo .word { font-size: 22px; }
  .logo .word small { display: none; }
  .site-head .btn.sm { padding: 0 12px; white-space: nowrap; }
}

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: var(--line);
  background: var(--ink); color: var(--cream);
  font-family: var(--font-disp); font-weight: 900; font-size: 16px; text-decoration: none;
  transition: transform 150ms var(--ease-out), box-shadow 150ms var(--ease-out), background 150ms ease;
  box-shadow: var(--shadow);
  user-select: none;
}
.btn .arw {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--mint); color: var(--ink); font-family: var(--font-latin); font-size: 15px; line-height: 1;
}
.btn.ghost { background: var(--paper); color: var(--ink); }
.btn.mint { background: var(--mint); color: var(--ink); }
.btn.sm { min-height: 44px; padding: 0 16px; font-size: 14px; box-shadow: 3px 3px 0 var(--ink); }
.btn.flat { box-shadow: none; }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); transition-duration: 34ms; }
.btn.flat:active { transform: translateY(1px); box-shadow: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: var(--shadow); }
.btn.loading { pointer-events: none; }
.btn.loading .arw { animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
  .btn.sm:hover:not(:disabled) { box-shadow: 4px 4px 0 var(--ink); }
  .btn.flat:hover:not(:disabled) { transform: none; box-shadow: none; background: var(--cream-2); }
}
:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid var(--sky); outline-offset: 3px;
}

/* ---------- 札（ステッカー） ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 999px; border: var(--line);
  font-family: var(--font-disp); font-weight: 900; font-size: 12px; line-height: 1.6;
  background: var(--paper); white-space: nowrap;
}
.tag.mint { background: var(--mint); }
.tag.orange { background: var(--orange); }
.tag.sky { background: var(--sky); }
.tag.yellow { background: var(--yellow); }
.tag.soft { border-color: transparent; background: var(--cream-2); color: var(--ink-2); font-weight: 700; }
.stars { font-family: var(--font-latin); letter-spacing: 0.08em; color: #c8721f; font-size: 14px; white-space: nowrap; }
.stars .off { color: #b8b2a6; }

/* ---------- 本のカード ---------- */
.grid {
  display: grid; gap: 24px 20px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
@media (max-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 20px 12px; } }
.book {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 0; border: 0; background: none; text-align: left; width: 100%;
  border-radius: var(--r);
}
.book .cover {
  position: relative; aspect-ratio: 3 / 4; border-radius: var(--r); border: var(--line);
  background: var(--paper); overflow: hidden; box-shadow: var(--shadow);
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
  display: grid; place-items: center;
}
.book .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.book .cover .fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px; font-family: var(--font-disp); font-weight: 900; font-size: 18px; line-height: 1.3;
  color: var(--ink);
}
.book .cover .fallback::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 12px; background: var(--ink); opacity: 0.85;
}
.book .cover .fallback span { padding-left: 8px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.book .stickers { position: absolute; z-index: 2; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.book .stickers .tag { transform: rotate(-4deg); }
.book .want-mini {
  position: absolute; z-index: 2; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; border: var(--line); background: var(--paper);
  font-family: var(--font-latin); font-size: 12px; font-weight: 700;
}
.book .t { font-family: var(--font-disp); font-weight: 900; font-size: 16px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book .c { font-size: 14px; line-height: 1.6; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book .by { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; font-size: 13px; color: var(--ink-3); }
.book .by b, .book .by span { white-space: nowrap; }
.book .by .tag { font-size: 11px; padding: 0 8px; }
.book .by b { color: var(--ink); font-weight: 700; }
@media (hover: hover) and (pointer: fine) {
  .book:hover .cover { transform: translate(-3px, -3px); box-shadow: var(--shadow-l); }
}
.book:active .cover { transform: translate(1px, 1px); box-shadow: 3px 3px 0 var(--ink); transition-duration: 34ms; }

/* ---------- スケルトン（幅が変わらない） ---------- */
.sk .cover { background: var(--cream-2); box-shadow: none; border-color: var(--cream-2); }
.sk .bar { height: 14px; border-radius: 6px; background: var(--cream-2); }
.sk .bar.w2 { width: 60%; }

/* ---------- 空・エラー ---------- */
.empty { text-align: center; padding: 48px 16px; }
.empty img { width: 160px; margin: 0 auto 12px; }
.empty .t { font-family: var(--font-disp); font-weight: 900; font-size: 20px; }
.notice { border: var(--line); border-radius: var(--r); background: var(--paper); padding: 16px 20px; }
.notice.err { background: #fbe1dc; }
.notice.err b { color: var(--red); }

/* ---------- モーダル ---------- */
dialog.modal {
  border: var(--line); border-radius: var(--r); padding: 0; background: var(--paper); color: var(--ink);
  width: min(900px, 100% - 32px); max-height: min(90vh, 100% - 32px);
  box-shadow: var(--shadow-l);
}
dialog.modal::backdrop { background: rgba(25, 22, 21, 0.55); }
dialog.modal[open] { animation: pop 220ms var(--ease-out); }
@keyframes pop { from { opacity: 0; transform: scale(0.95) translateY(8px); } to { opacity: 1; transform: none; } }
.modal .close {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%;
  border: var(--line); background: var(--paper); font-size: 22px; line-height: 1; display: grid; place-items: center;
}
@media (max-width: 560px) {
  dialog.modal { width: 100%; max-width: 100%; max-height: 100%; height: 100%; border-radius: 0; border: 0; box-shadow: none; margin: 0; }
  /* 全画面なので fixed＝画面の右上に貼りつく。本文をスクロールしても消えない */
  .modal .close { position: fixed; z-index: 3; }
}

/* ---------- 入力 ---------- */
.field { display: grid; gap: 6px; margin-bottom: 20px; }
.field > label, .field > .lab { font-family: var(--font-disp); font-weight: 900; font-size: 15px; }
.field .hint { font-size: 13px; color: var(--ink-3); }
.field .req { color: var(--red); font-size: 12px; margin-left: 6px; font-weight: 700; }
.field .count { font-family: var(--font-latin); font-size: 12px; color: var(--ink-3); justify-self: end; }
.field .err { font-size: 13px; color: var(--red); font-weight: 700; display: none; }
.field.invalid .err { display: block; }
.field.invalid .in { border-color: var(--red); background: #fff4f1; }
.in {
  width: 100%; min-height: 48px; padding: 10px 14px; border: var(--line); border-radius: var(--r);
  background: var(--paper); font-size: 16px; line-height: 1.6;
}
.in:focus { outline: 3px solid var(--sky); outline-offset: 2px; }
textarea.in { min-height: 160px; resize: vertical; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: var(--line);
  background: var(--paper); font-family: var(--font-disp); font-weight: 900; font-size: 15px;
  transition: background 150ms ease, transform 150ms var(--ease-out);
}
.choice input:checked + span { background: var(--mint); }
.choice input:focus-visible + span { outline: 3px solid var(--sky); outline-offset: 2px; }
.choice input:disabled + span { opacity: 0.4; }
@media (hover: hover) and (pointer: fine) { .choice:hover span { background: var(--mint-soft); } .choice input:checked:hover + span { background: var(--mint); } }

/* ---------- マーキー（1画面1つの演出） ---------- */
.marquee { overflow: hidden; background: var(--ink); color: var(--cream); border-top: var(--line); border-bottom: var(--line); }
.marquee .track { display: flex; width: max-content; animation: marquee 28s linear infinite; }
.marquee .track > span { padding: 8px 20px; font-family: var(--font-latin); font-weight: 700; font-size: 14px; letter-spacing: 0.14em; white-space: nowrap; }
.marquee .track > span b { color: var(--mint); font-family: var(--font-disp); font-weight: 900; letter-spacing: 0.06em; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- 下部の固定アクション ---------- */
.acts {
  position: sticky; bottom: 0; z-index: 5; display: flex; gap: 12px; align-items: center; justify-content: flex-end;
  padding: 16px 0; background: var(--cream); border-top: var(--line); margin-top: 8px;
}
.acts .left { margin-right: auto; }
@media (max-width: 560px) {
  .acts { flex-direction: column; align-items: stretch; }
  .acts .btn { width: 100%; }
  .acts .left { margin-right: 0; }
}

/* ---------- フッター ---------- */
.site-foot { margin-top: 64px; border-top: var(--line); padding: 32px 0 40px; font-size: 13px; color: var(--ink-3); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
.site-foot a { color: var(--ink-3); }

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

/* ---------- 文字リンク（タップ領域44px） ---------- */
.link { display: inline-flex; align-items: center; min-height: 44px; background: none; border: 0; padding: 0; text-decoration: underline; color: var(--ink-2); font-size: 14px; cursor: pointer; }
