/* 視聴者の画面（docs/stamp_site.md §10）。inline style は使わない（CSP の style-src 'self'） */
:root {
  color-scheme: light;
  /* 色 */
  --bg: #fbf6ee;
  --surface: #ffffff;
  --text: #2a2119;
  --text-sub: #5a4b3c;
  --line: #cdbca5;
  --primary: #9e2a1e;
  --primary-press: #7f2117;
  --link: #1b4f9c;
  --focus: #1b4f9c;
  --ok-bg: #e9f4e6;  --ok: #2c6a2e;
  --warn-bg: #fff3d4; --warn: #7a5300;
  --err-bg: #fdeceb; --err: #a1261b;
  --ghost: #b9ad9e;
  /* 印の色（kind） */
  --seal-normal: #c0392b;
  --seal-limited: #1f6f8b;
  --seal-secret: #6b3fa0;
  --seal-memorial: #a8790b;
  --seal-complete: #a8790b;
  /* 文字 */
  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif;
  --font-seal: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  /* 文字の大きさ（老眼向け。rem なので OS・ブラウザの文字サイズの設定に従う。1rem = 16px の場合の px を併記） */
  --fs-small: 1.125rem;  /* 18px これより小さくしない */
  --fs-body: 1.375rem;   /* 22px */
  --fs-lead: 1.5rem;     /* 24px */
  --fs-h2: 1.75rem;      /* 28px */
  --fs-h1: 2.125rem;     /* 34px */
  --fs-num: 2.75rem;     /* 44px 「8 / 16 こ」 */
  --fs-otp: 2.5rem;      /* 40px */
  --fs-btn: 1.375rem;    /* 22px ボタンの字（太字） */
  --fs-input: 1.5rem;    /* 24px 入力欄の字 */
  --lh: 1.8;
  /* 形 */
  --radius: 12px;
  --btn-h: 4rem;     /* 64px ボタンの高さ。押せる場所は 48px 以上 */
  --input-h: 4.25rem; /* 68px */
  --btn-gap: 1rem;   /* 16px ボタンどうしの間 */
  --gap: 16px;
  --shadow: 0 1px 3px rgba(60, 40, 20, .12);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh);
  /* 日本語の折り返し: 文節（BudouX が <wbr> を入れる）の途中では切らない。keep-all は <wbr> のところだけで折る。
     auto-phrase は使わない（ブラウザ独自の文節が <wbr> に足されて「10月／31日」のように切れるため）。長い語がはみ出すときだけ anywhere で切る（最後の手段）。
     line-break: strict で、句読点・小さい かな・閉じかっこが行の頭に来ない。 */
  word-break: keep-all;
  line-break: strict;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
h1, h2, h3, .btn, .camp-head, .camp-short, .camp-done, .eyebrow, .set-line, .stamp-name, .lead, .result-lines p, .note, .coming .next, .coming .at,
.slot .ttl, .slot .when, .slot .tag, .video-list li, .badge-title, .notify-state, .check span, .title-line, .recommend, .goals li { text-wrap: balance; }
[hidden] { display: none !important; }

.page { max-width: 560px; margin: 0 auto; padding: 24px var(--gap) 40px; }
.site-head { text-align: center; color: var(--text-sub); font-size: var(--fs-small); line-height: 1.5; margin: 0 0 8px; letter-spacing: .04em; }
.eyebrow { text-align: center; color: var(--text-sub); font-size: var(--fs-lead); font-weight: 700; margin: 0 0 8px; }

h1 { text-wrap: balance; font-size: var(--fs-h1); line-height: 1.4; margin: 8px 0 12px; text-align: center; }
h2 { font-size: var(--fs-h2); line-height: 1.4; margin: 28px 0 10px; }
h3 { font-size: var(--fs-lead); line-height: 1.5; margin: 22px 0 6px; }
p { margin: 0 0 12px; }
.lead { font-size: var(--fs-lead); }
.center { text-align: center; }
.sub { color: var(--text-sub); }
.small { font-size: var(--fs-small); line-height: 1.7; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* ボタン */
.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: var(--btn-h);
  margin: var(--btn-gap) 0 0; padding: 8px 16px;
  border: 2px solid var(--primary); border-radius: var(--radius);
  background: var(--primary); color: #fff;
  font: 700 var(--fs-btn)/1.4 var(--font);
  text-align: center; text-decoration: none; cursor: pointer;
  -webkit-appearance: none; appearance: none; text-wrap: balance;
}
.btn:hover, .btn:active { background: var(--primary-press); border-color: var(--primary-press); }
.btn.secondary { background: var(--surface); color: var(--primary); }
.btn.secondary:hover, .btn.secondary:active { background: #f6e9e6; }
.btn.danger { background: var(--err); border-color: var(--err); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--ghost); border-color: var(--ghost); color: #fff; cursor: default; }
.btn.secondary:disabled { background: var(--ghost); color: #fff; }
.textlink {
  display: inline-block; min-height: 52px; padding: 12px 4px; font-size: var(--fs-body);
  background: none; border: 0; font: inherit; color: var(--link);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

/* 入力 */
label.field { display: block; font-weight: 700; margin: 16px 0 6px; }
.input {
  display: block; width: 100%; height: var(--input-h); padding: 0 14px;
  background: var(--surface); color: var(--text);
  border: 2px solid var(--line); border-radius: var(--radius);
  font: 400 var(--fs-input)/1.2 var(--font);
  -webkit-appearance: none; appearance: none;
}
.input:focus { outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--focus); }
.input.otp { height: 5.5rem; font-size: var(--fs-otp); letter-spacing: .4em; text-align: center; padding-left: .4em; font-variant-numeric: tabular-nums; }
.input.invalid { border-color: var(--err); }

/* 注意・案内 */
.note { border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; font-size: var(--fs-body); line-height: 1.7; }
.note.err { background: var(--err-bg); color: var(--err); border: 2px solid var(--err); font-weight: 700; }
.note.ok { background: var(--ok-bg); color: var(--ok); border: 2px solid var(--ok); font-weight: 700; }
.note.warn { background: var(--warn-bg); color: var(--warn); border: 2px solid var(--warn); }
.note .btn { margin-top: 10px; }

.card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }

details.help { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 4px 14px; margin: 20px 0 0; }
details.help summary { min-height: 52px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
details.help ol { margin: 4px 0 8px; padding-left: 1.4em; }
details.help li { margin: 0 0 10px; }

/* 確認中（点が3つ動くだけ） */
.dots { display: inline-flex; gap: 6px; margin-left: 6px; vertical-align: middle; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-sub); animation: dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* 印 */
.seal-wrap { display: flex; justify-content: center; margin: 12px 0 8px; }
.seal-wrap .seal { display: block; max-width: 100%; height: auto; }
#app > .seal-wrap .seal { width: min(240px, 64vw); }
.seal-wrap.faint { opacity: .35; }
.seal-wrap.stamping .seal { animation: stamp-down .45s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes stamp-down {
  0% { transform: translateY(-24px) scale(1.35); opacity: 0; }
  70% { transform: translateY(0) scale(.96); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.copied { animation: pop .2s ease-out; }
@keyframes pop { from { opacity: 0; } to { opacity: 1; } }

.result-title { font-size: var(--fs-h1); line-height: 1.4; text-align: center; margin: 4px 0 8px; font-weight: 700; }
.result-lines p { text-align: center; margin: 0 0 6px; font-size: var(--fs-lead); }
.result-lines p.big { font-size: var(--fs-h2); font-weight: 700; }
.badge-title { display: block; background: var(--warn-bg); color: var(--warn); border: 2px solid var(--warn); border-radius: var(--radius); padding: 10px 12px; margin: 12px 0; text-align: center; font-weight: 700; }

/* スタンプ帳 */
.count { text-align: center; font-size: var(--fs-num); font-weight: 700; line-height: 1.3; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.count small { font-size: var(--fs-lead); font-weight: 700; }
.bar { display: flex; gap: 4px; margin: 4px 0 14px; }
.bar .seg { flex: 1; min-width: 0; text-align: center; }
.bar .seg i { display: block; height: 20px; }
.bar .mark { display: block; font-size: var(--fs-small); color: var(--text-sub); line-height: 1.4; margin-top: 4px; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.set-line { text-align: center; font-size: var(--fs-body); margin: 0 0 4px; text-wrap: balance; }
.bar i { flex: 1; border-radius: 4px; background: #e8dfd1; border: 1px solid var(--line); }
.bar i.on { background: var(--seal-normal); border-color: var(--seal-normal); }
.bar.single { display: block; background: #e8dfd1; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.bar.single b { display: block; height: 100%; background: var(--seal-normal); }
.title-line { text-align: center; margin: 0 0 4px; }
.title-line strong { font-weight: 700; }

/* 回の題と印のカード（1列。印は左、題は右に大きく） */
.cards { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 14px 0 18px; padding: 0; list-style: none; }
.slot { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: row; align-items: center; gap: 12px; min-width: 0; box-shadow: var(--shadow); font: inherit; color: inherit; line-height: 1.5; text-align: left; }
.slot.done { border-color: var(--seal-normal); }
.slot.empty { background: var(--bg); border-style: dashed; box-shadow: none; }
button.slot { cursor: pointer; width: 100%; -webkit-appearance: none; appearance: none; }
button.slot:active { background: #f7f1e8; }
.slot .seal-wrap { margin: 0; flex: none; width: 104px; }
.slot .seal-wrap .seal { width: 100%; max-width: none; height: auto; }
.slot .body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.slot .ttl { font-size: var(--fs-body); font-weight: 700; color: var(--text); line-height: 1.5; }
.slot.empty .ttl { color: var(--text-sub); }
.slot .when { font-size: var(--fs-small); color: var(--text-sub); }
.slot.done .when { color: var(--ok); font-weight: 700; }
.slot .watch { display: flex; align-items: center; min-height: 52px; font-size: var(--fs-small); font-weight: 700; }
.slot .secret-mark { font-size: var(--fs-small); color: var(--seal-secret); font-weight: 700; }
.slot .tag { font-size: var(--fs-small); letter-spacing: .06em; color: var(--text-sub); font-weight: 700; }
.set-head { font-size: var(--fs-h2); margin: 22px 0 6px; text-align: center; }
.stamp-name { text-align: center; font-size: var(--fs-h2); font-weight: 700; line-height: 1.5; margin: 0 0 10px; }
.video-list { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 4px 16px 10px; margin: 16px 0; }
.video-list h2 { font-size: var(--fs-lead); margin: 12px 0 6px; }
.video-list ul { margin: 0; padding-left: 1.2em; }
.video-list li { margin-bottom: 8px; line-height: 1.6; }
.video-list li.soon { color: var(--text-sub); }
.notify-box { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 4px 16px 14px; margin: 16px 0; }
.notify-box h2 { font-size: var(--fs-lead); margin: 12px 0 6px; }
.notify-state { font-size: var(--fs-h2); font-weight: 700; margin: 0 0 6px; }
.notify-box .btn { margin-top: 8px; }
label.notify-check { margin: 10px 0 0; }
.nb { white-space: nowrap; }
.coming .next .next-title { display: block; }
.coming { border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px; margin: 18px 0; }
.coming .row { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.coming .row .seal-wrap { margin: 0; flex: none; }
.coming .row .seal { width: 72px; height: 72px; }
.coming .tag { font-size: var(--fs-small); letter-spacing: .1em; color: var(--text-sub); font-weight: 700; }
.coming .next { font-size: var(--fs-h2); font-weight: 700; line-height: 1.4; }
.coming .at { font-size: var(--fs-lead); text-wrap: balance; }
.coming p.cta { margin: 12px 0 0; }
.footer { border-top: 2px solid var(--line); margin-top: 32px; padding-top: 8px; font-size: var(--fs-small); text-align: center; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 18px; }
.footer a { display: inline-flex; align-items: center; min-height: 52px; }

/* 称号の目標・チャンネル登録の札・COMING SOON の札 */
.goals { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 14px; font-size: var(--fs-small); color: var(--text-sub); }
.goals li { white-space: nowrap; line-height: 1.8; }
.goals li.reached { color: var(--primary); font-weight: 700; }
.recommend { margin: 22px 0 0; font-size: var(--fs-small); color: var(--text-sub); text-align: center; }
.purposes { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 4px 14px 8px; margin: 12px 0 4px; }
.purposes h3 { margin: 10px 0 4px; font-size: var(--fs-body); font-weight: 700; }
.purposes ul { margin: 0 0 6px; padding-left: 1.2em; font-size: var(--fs-small); line-height: 1.7; }
.purposes ul li { margin-bottom: 4px; }
.purposes p { margin: 0; font-size: var(--fs-small); color: var(--text-sub); line-height: 1.7; }

/* 重ね表示（印を大きく） */
dialog.zoom { border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px; width: min(90vw, 400px); max-height: 92vh; overflow: auto; text-align: center; color: var(--text); }
dialog.zoom::backdrop { background: rgba(42, 33, 25, .6); }
dialog.zoom .seal { width: 100%; max-width: none; height: auto; }
dialog.zoom .btn { margin-top: 8px; }

/* 文章ページ */
.doc h2 { font-size: var(--fs-lead); margin: 26px 0 6px; }
.doc ol.steps { padding-left: 1.4em; }
.doc ol.steps li { margin: 0 0 12px; }
.doc dl { margin: 0 0 12px; }
.doc pre.policy { white-space: pre-wrap; font: inherit; margin: 0 0 12px; }
.placeholder { background: var(--warn-bg); color: var(--warn); font-weight: 700; padding: 0 4px; border-radius: 4px; }

/* キャンペーンの札・応募の箱（§14.0.5）。字は 18px 以上・ボタン 64px・チェックの □ は 32px・行の高さ 56px 以上 */
.camp-box { margin: 18px 0; }
.campaign { background: var(--surface); border: 3px solid var(--primary); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.campaign .camp-head { font-size: var(--fs-h2); font-weight: 700; line-height: 1.45; margin: 0 0 8px; }
.campaign.lottery, .campaign { background: #fff8e6; }
.campaign.lottery { margin: 16px 0; }
.campaign.lottery .camp-head { font-size: 1.875rem; color: var(--primary); } /* 30px */
.campaign .camp-line { font-size: var(--fs-body); line-height: 1.7; margin: 0 0 10px; }
.campaign .camp-count { font-size: var(--fs-h2); font-weight: 700; line-height: 1.4; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.campaign .camp-done { font-size: var(--fs-h2); font-weight: 700; line-height: 1.4; margin: 6px 0 10px; color: var(--ok); }
.campaign .camp-short { font-size: var(--fs-h2); font-weight: 700; line-height: 1.5; margin: 0 0 8px; }
.campaign .camp-btn, .camp-btn { font-size: var(--fs-lead); }
.campaign .textlink { min-height: 48px; padding: 8px 0; }
.camp-notice { border: 2px solid var(--primary); border-radius: var(--radius); background: var(--surface); padding: 12px 14px; margin: 14px 0 0; }
.camp-notice .camp-short { font-size: var(--fs-lead); line-height: 1.6; }
.camp-notice .camp-line { font-size: var(--fs-body); margin: 0 0 8px; }
.camp-notice .btn { margin-top: 10px; }
.cbar { display: flex; gap: 4px; margin: 4px 0 14px; }
.cbar .seg { flex: 1; min-width: 0; text-align: center; }
.cbar .seg i { display: block; height: 16px; border-radius: 4px; background: #e8dfd1; border: 1px solid var(--line); }
.cbar .seg i.on { background: var(--seal-normal); border-color: var(--seal-normal); }
.cbar .mark { display: block; font-size: var(--fs-small); color: var(--text-sub); line-height: 1.4; margin-top: 4px; white-space: nowrap; }
label.check { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 6px 0; font-size: var(--fs-body); line-height: 1.5; cursor: pointer; }
label.check input[type="checkbox"] { flex: none; width: 32px; height: 32px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.camp-mail { margin: 12px 0 0; }
.campaign.reached { margin: 18px 0 0; }
.camp-points { margin: 0 0 8px; padding-left: 1.3em; font-size: var(--fs-lead); line-height: 1.7; font-weight: 700; }
.camp-points li { margin-bottom: 8px; }
.camp-rules h2 { font-size: var(--fs-h2); line-height: 1.5; margin: 28px 0 8px; }
.camp-rules h3 { font-size: var(--fs-lead); margin: 22px 0 4px; }
.camp-rules p { font-size: var(--fs-body); line-height: 1.8; margin: 0 0 8px; }
.camp-login { margin-top: 8px; }

@media (min-width: 540px) {
  .coming .row { flex-direction: row; text-align: left; gap: 14px; }
  #app > .seal-wrap .seal { width: 280px; }
  .page { padding-top: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .seal-wrap.stamping .seal, .copied { animation: none; }
  .dots i { animation: none; opacity: .6; }
}
