/* 参加者ページと、管理画面のページ計測で共通に使う本文の組版 */
.rs-page {
  box-sizing: border-box;
  width: var(--w);
  height: var(--h);
  overflow: hidden;
  margin: 0;
  padding: 0;
  background: #fff;
  color: #111;
  font-family: "Noto Serif JP", serif;
  font-size: var(--fs);
  line-height: var(--lh);
  font-weight: 400;
  font-kerning: none;
  font-feature-settings: normal;
  letter-spacing: 0;
  text-align: justify;
  line-break: strict;
  word-break: normal;
  overflow-wrap: anywhere;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.rs-page.rs-v { writing-mode: vertical-rl; text-orientation: mixed; }
.rs-page.rs-h { writing-mode: horizontal-tb; }
.rs-page p { margin: 0; text-indent: 1em; }
.rs-page p.cont { text-indent: 0; }
.rs-page .rs-title {
  margin: 0;
  margin-block-end: 0.7em;
  font-size: var(--ts);
  font-weight: 600;
  line-height: 1.5;
  text-indent: 0;
}
.rs-page.rs-h .rs-title { text-align: center; }
.rs-page.rs-v .rs-title { text-align: start; padding-inline-start: 1em; }
/* 実機で万一収まらなかった場合に、文字を隠さず読めるようにする */
.rs-page.rs-overflow { overflow: auto; }

/* ---- 参加者ページ ---- */
html, body { margin: 0; padding: 0; background: #fff; }
body {
  color: #1d2329;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
button { font: inherit; touch-action: manipulation; }

.screen {
  box-sizing: border-box;
  max-width: 34rem;
  margin: 0 auto;
  padding: 32px 22px calc(32px + env(safe-area-inset-bottom));
  font-size: 17px;
  line-height: 1.75;
}
.screen h1 { font-size: 22px; line-height: 1.5; margin: 0 0 18px; }
.screen p { margin: 0 0 18px; }
.screen .check {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 24px 0; padding: 14px 16px;
  border: 1px solid #c9d1d8; border-radius: 8px; background: #f7f9fa;
  cursor: pointer;
}
.screen .check input { flex: none; width: 24px; height: 24px; margin: 3px 0 0; }
.primary, .secondary {
  display: block; width: 100%; min-height: 52px;
  padding: 10px 16px; border-radius: 8px; border: 1px solid #1f5577;
  font-size: 17px; cursor: pointer;
}
.primary { background: #1f5577; color: #fff; }
.secondary { background: #fff; color: #1f5577; border-color: #a9bac7; }
.primary:disabled { background: #a7b4be; border-color: #a7b4be; cursor: default; }
.note { color: #a3311b; font-weight: 600; min-height: 1.75em; }
.screen .trial { display: inline-block; margin: 0 0 16px; padding: 2px 10px; border-radius: 4px; background: #fff1c9; color: #6b4a00; font-size: 13px; line-height: 1.6; }
.screen #restart { margin-top: 28px; }
.trial-mark { margin-left: 6px; padding: 0 5px; border-radius: 3px; background: #fff1c9; color: #6b4a00; font-size: 11px; }
.loading { color: #5b6975; }

/* 閲読画面 */
.reader {
  position: fixed; left: 0; top: 0; right: 0;
  height: var(--vh, 100vh);
  display: flex; flex-direction: column;
  background: #fff;
}
.stage {
  flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.frame { position: relative; flex: none; }
.frame .rs-page { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.nav {
  flex: none;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  height: 56px;
  padding: 0 12px env(safe-area-inset-bottom);
  border-top: 1px solid #e1e5e8;
  background: #fff;
}
.nav button { min-height: 44px; padding: 6px 10px; }
.nav .pageno { font-size: 14px; color: #5b6975; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nav .secondary:disabled { visibility: hidden; }

.overlay {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(20, 30, 40, 0.55);
}
.overlay[hidden] { display: none; }
.overlay .box {
  box-sizing: border-box; width: 100%; max-width: 26rem;
  padding: 24px 20px; border-radius: 10px; background: #fff;
  font-size: 17px; line-height: 1.75;
}
.overlay .box h2 { font-size: 20px; margin: 0 0 12px; }
.overlay .box p { margin: 0 0 20px; }
.overlay .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.overlay.rotate { background: #fff; color: #1d2329; font-size: 18px; text-align: center; }
