/* css/src/*.css を順にまとめたものです。直すときは、css/src/ の元ファイルと、このファイルの両方を同じように直してください（ビルドの仕組みはありません） */

/* 基本：色・文字・余白の決まり（ポーズ帳は、紙のスケッチブックのような落ち着いた配色） */
:root {
  --paper: #ffffff;
  --paper-deep: #f2f2ef;
  --card: #f7f7f5;
  --ink: #1d1b18;
  --ink-soft: #5d574d;
  --rule: #cfc6b4;
  --vermilion: #c8492f;
  --serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.75;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

/* 中身の幅をそろえる入れ物 */
.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 見出しの上の小さな文字 */
.eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
}

.text-link {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--rule);
}

@media (max-width: 600px) {
  body { font-size: 15px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
}

/* ページの骨組み：ヘッダー・ページ見出し・フッター */

/* 画面の高さいっぱいに広げ、フッターを下に置く */
body.page-fill {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

body.page-fill > main { flex: 1; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 0 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}

.brand small {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}

.site-nav {
  display: flex;
  gap: 22px;
  font-size: 13px;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { border-bottom-color: var(--ink); }

/* ---------- ページ見出し ---------- */
.page-head {
  padding: 48px 0 18px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 24px;
}

.page-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
}

.page-head p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- フッター（中央そろえ：リンク行・コピーライト） ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 32px 20px 12px;
  font-size: 12px;
  color: var(--ink-soft);
}

.site-footer .wrap { text-align: center; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  font-size: 14px;
}

.footer-links a {
  padding: 0 22px;
  color: var(--ink);
  text-decoration: none;
  border-left: 1px solid var(--rule);
}

.footer-links a:first-child { border-left: 0; }
.footer-links a:hover { text-decoration: underline; }

.footer-copy {
  margin: 2px 0;
  font-size: 12px;
}

/* ---------- 端末ごとの調整 ---------- */
@media (min-width: 861px) {
  .site-nav { font-size: 14px; }
  .page-head h1 { font-size: 34px; }
}

@media (max-width: 600px) {
  .site-header { flex-wrap: wrap; min-height: 0; padding: 10px 16px; row-gap: 6px; }
  .brand { font-size: 18px; }
  .brand small { display: none; }
  .site-nav { width: 100%; justify-content: space-between; overflow-x: visible; gap: 6px; font-size: 13px; }
  .site-nav a { padding: 8px 2px; }
  .page-head { padding-top: 28px; }
  .page-head h1 { font-size: 26px; }
}

/* 部品：ボタン・タグ・フォーム・ポーズカード・拡大表示・広告 */

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn:hover { background: var(--ink); color: var(--paper); }

.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--vermilion); border-color: var(--vermilion); color: #fff; }

.btn-quiet { border-color: var(--rule); }
.btn-quiet:hover { border-color: var(--ink); }

.btn-block { width: 100%; }

/* 押せない状態（練習中の開始ボタンなど） */
.btn:disabled,
.btn-solid:disabled,
.btn-solid:disabled:hover {
  background: #a39b8e;
  border-color: #a39b8e;
  color: #fff;
  cursor: not-allowed;
  transform: none;
}

/* ---------- フォーム部品 ---------- */
.select {
  padding: 7px 10px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--card);
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
}

/* 数字の入力欄（時間・枚数） */
.count-field {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
}

.count-input {
  width: 110px;
  padding: 6px 4px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 22px;
  font-family: var(--serif);
}

.count-input:focus { outline: none; border-bottom-color: var(--vermilion); }

/* 文字で選ぶ選択肢（下線と ✓ が選択中の目印） */
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.options button {
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
}

.options button:hover { color: var(--ink); }

.options button.is-on {
  color: var(--ink);
  border-bottom-color: var(--vermilion);
}

.options button.is-on::before { content: "✓ "; }

/* ---------- 絞り込み（タグ・ツールバー） ---------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.tag {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}

.tag .no { font-size: 10px; color: var(--ink-soft); letter-spacing: 0.08em; }
.tag small { font-size: 10px; color: var(--ink-soft); }

.tag:hover { border-color: var(--ink); }

.tag.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.tag.is-on .no,
.tag.is-on small { color: #cfc6b4; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  margin-bottom: 26px;
  font-size: 13px;
}

.count {
  margin-left: auto;
  color: var(--ink-soft);
  font-size: 12px;
}

/* ---------- ポーズカード（3:4のフレーム＋キャプション） ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 26px 20px;
  margin-bottom: 56px;
}

.pose-card { margin: 0; }

.frame {
  position: relative;
  aspect-ratio: 3 / 4;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--rule);
  cursor: zoom-in;
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
}

.frame:hover img { opacity: 0.88; }

.pose-card figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}

.pose-card figcaption span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty {
  padding: 56px 0;
  text-align: center;
  color: var(--ink-soft);
}

/* ---------- 拡大表示（画像を押したとき） ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(29, 27, 24, 0.88);
}

.lightbox.is-open { display: flex; }

/* 画像は、画面に収まる最大の大きさ（高さは、説明文と余白ぶんを引いた残り。3:4のまま） */
.lightbox figure {
  margin: 0;
  width: min(100%, 960px, calc((100vh - 110px) * 3 / 4));
  width: min(100%, 960px, calc((100dvh - 110px) * 3 / 4));
  text-align: center;
}

.lightbox img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #fff;
}

.lightbox figcaption {
  margin-top: 12px;
  font-family: var(--serif);
  color: var(--paper);
  font-size: 14px;
}

.lightbox .close {
  position: absolute;
  top: 6px;
  right: 10px;
  width: 44px;
  height: 44px;
  padding: 0;
  line-height: 1;
  border: 0;
  background: none;
  color: var(--paper);
  font-size: 32px;
  cursor: pointer;
}

/* ---------- 広告（AdSense の枠） ---------- */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  margin: 40px auto;
  border: 1px dashed var(--rule);
  color: #8a8172;
  font-size: 12px;
  text-align: center;
}

/* 本物の広告が入ったあと（ads.js が付ける） */
.ad-slot.is-live {
  display: block;
  min-height: 0;
  border: 0;
}

/* 広告が出なかった枠（AdSense が unfilled を付ける）は、空白を残さない */
.ad-slot ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

/* ---------- PR欄（アフィリエイトのバナー） ---------- */
.pr {
  margin: 48px 0;
  padding: 22px 24px 22px 28px;
  background: var(--card);
  border-left: 3px solid var(--vermilion);
}

.pr h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
}

.pr .note {
  margin: 2px 0 14px;
  font-size: 11px;
  color: var(--ink-soft);
}

/* 同じ幅の列に並べ、それぞれ中央にそろえる（狭い画面では折り返す） */
.banner-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  justify-items: center;
  align-items: start;
  gap: 16px;
}

.banner-row img { max-width: 100%; height: auto; }

.banner-item {
  display: flex;
  flex-direction: column;
  width: 120px;
  max-width: 100%;
}

.banner-item a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
}

.banner-caption {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ---------- 端末ごとの調整 ---------- */
@media (min-width: 861px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 32px 24px; }
  .pose-card figcaption { font-size: 13px; }
  .tag { font-size: 14px; padding: 6px 13px; }
}

@media (max-width: 600px) {
  .lightbox { padding: 8px; }
  .btn { flex: 1 1 150px; }
  .select { padding: 10px 12px; font-size: 16px; }
  .options button { min-height: 40px; padding: 8px 12px; font-size: 15px; }
  .tag { min-height: 38px; padding: 8px 12px; font-size: 14px; }
  .toolbar { gap: 10px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
  .pose-card figcaption { font-size: 13px; }
}

/* トップページ：ヒーロー・壁に貼ったスケッチ・Poses の帯 */

/* ---------- ヒーロー ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding-top: 72px;
  padding-bottom: 56px;
}

.hero h1 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.hero h1 em {
  font-style: normal;
  color: var(--vermilion);
  white-space: nowrap;
}

.hero .lead {
  margin: 0 0 30px;
  max-width: 30em;
  font-size: 14px;
  color: var(--ink-soft);
}

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

/* ---------- 壁に貼ったスケッチのコラージュ ---------- */
.pinboard {
  position: relative;
  height: 500px;
}

.pinboard .sketch {
  position: absolute;
  width: 46%;
  padding: 8px 8px 30px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(29, 27, 24, 0.14);
}

.pinboard .sketch img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

.pinboard .sketch:nth-child(1) { left: 2%; top: 10px; transform: rotate(-4deg); }
.pinboard .sketch:nth-child(2) { left: 30%; top: 60px; transform: rotate(3deg); width: 50%; }
.pinboard .sketch:nth-child(3) { right: 0; top: 200px; width: 40%; transform: rotate(-2deg); }

/* ---------- Poses の帯（横に流れる） ---------- */
.sheet {
  background: var(--ink);
  color: var(--paper);
  padding: 30px 0 34px;
}

.sheet-head {
  padding: 0 20px 18px;
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #fff;
}

.sheet-view { overflow: hidden; }

/* 同じ並びを2回つないで、半分ずつ流してループさせる */
.sheet-track {
  display: flex;
  width: max-content;
  animation: sheet-flow 60s linear infinite;
}

.sheet-view:hover .sheet-track { animation-play-state: paused; }

.sheet-track figure {
  flex: 0 0 auto;
  margin: 0 14px 0 0;
}

.sheet-track img {
  height: 240px;
  width: auto;
  aspect-ratio: 3 / 4;
  border: 1px solid #3a352e;
}

@keyframes sheet-flow {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .sheet-track { animation: none; }
}

/* ---------- 端末ごとの調整 ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 32px; }
  .pinboard { height: 360px; max-width: 420px; margin: 0 auto; width: 100%; }
}

@media (max-width: 600px) {
  .sheet-head { padding-left: 16px; padding-right: 16px; }
  .sheet-track img { height: 160px; }
  .pinboard { height: 420px; }
  .pinboard .sketch { width: 44%; }
  .pinboard .sketch:nth-child(1) { top: 0; left: 0; }
  .pinboard .sketch:nth-child(2) { top: 60px; left: 42%; width: 48%; }
  .pinboard .sketch:nth-child(3) { top: 190px; right: 0; }
}

/* ランダムページ：1枚を大きく見せる ＋ 右にタグ・広告 */

.random-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  padding-bottom: 8px;
}

/* ---------- 左：1枚のポーズ ---------- */
.random-main { max-width: 420px; width: 100%; }

.pose-view { margin: 0; }

.pose-view .frame {
  cursor: zoom-in;
  box-shadow: 0 10px 22px rgba(29, 27, 24, 0.12);
}

.pose-view figcaption {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-soft);
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

/* ---------- 右：タグ・広告 ---------- */
.random-side { padding-top: 6px; }

.random-side .ad-slot { margin: 28px 0 0; }
.random-side .pr { margin: 28px 0 0; }

.side-title {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

.side-note {
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--ink-soft);
}

.tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 8px;
}

.tagbtn {
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
}

.tagbtn small {
  font-size: 11px;
  color: var(--ink-soft);
}

.tagbtn:hover { border-bottom-color: var(--vermilion); color: var(--vermilion); }

/* 固定中のタグは、文字の色を変える */
.tagbtn.is-on { color: var(--vermilion); border-bottom-color: var(--vermilion); }

/* ---------- 端末ごとの調整 ---------- */
@media (max-width: 860px) {
  .random-layout { grid-template-columns: 1fr; gap: 32px; }
  .random-main { max-width: 100%; }
}

@media (min-width: 861px) {
  .tagbtn { font-size: 16px; }

  /* 左の列は、右の列と同じ高さまで伸ばす。名前・出力・一覧は下に付く */
  .random-layout { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: stretch; min-height: max(620px, calc(100vh - 336px)); min-height: max(620px, calc(100dvh - 336px)); }
  .random-main { max-width: none; display: flex; flex-direction: column; container-type: inline-size; }
  .pose-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  /* 画像の枠は3:4のまま、列の幅と、画面の高さ(ヘッダー・見出し・フッターと、名前・ボタンの分を引いた残り)に収まる最大の大きさにする。
     右の列(広告の有無)には左右されない */
  .pose-view .frame { flex: none; aspect-ratio: 3 / 4; width: min(100cqw, calc((max(620px, 100vh - 336px) - 100px) * 0.75)); width: min(100cqw, calc((max(620px, 100dvh - 336px) - 100px) * 0.75)); }
}

@media (max-width: 600px) {
  .random-main { max-width: 360px; margin: 0 auto; }
  .random-side { padding-top: 0; }
  .tagbtn { padding: 8px 6px; font-size: 16px; }
}

/* クロッキーのページ：左に設定、右に練習。練習中は設定を隠して画像を大きくする */

.studio {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 40px;
  align-items: center;
  padding-top: 12px;
  padding-bottom: 12px;
}

/* ---------- 左：設定 ---------- */
.setup-col { padding-right: 8px; }

.setup-col h1 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
}

.setup-col > p {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--ink-soft);
}

.step {
  padding: 6px 0;
  border-top: 1px solid var(--rule);
}

.step:last-of-type { border-bottom: 1px solid var(--rule); }

.step-title {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 500;
}

.step-title .no {
  font-family: var(--serif);
  font-size: 12px;
  color: var(--vermilion);
}

.step select { width: 100%; }

/* 数のボタン列（入力欄の下に置く） */
.mode-row { margin-top: 6px; }

/* 効果音のオン・オフ */
.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}

.switch button {
  width: 46px;
  height: 24px;
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: var(--ink);
  position: relative;
  cursor: pointer;
}

.switch button::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 25px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper);
  transition: left 0.15s;
}

.switch button[aria-pressed="false"] { background: transparent; }
.switch button[aria-pressed="false"]::after { left: 3px; background: var(--ink); }

.start-wrap { margin-top: 10px; }

/* ---------- 右：練習 ---------- */
.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--ink-soft);
}

.preview-head strong {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
}

/* 棒ゲージ：残り時間を横幅で示す */
.gauge {
  height: 8px;
  margin: 6px 0 12px;
  background: var(--rule);
  overflow: hidden;
}

.gauge > span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--vermilion);
  transform-origin: left center;
}

.timer-text {
  margin-bottom: 14px;
  font-family: var(--serif);
  font-size: 44px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* 画像（高さを画面に合わせ、3:4のまま縮める） */
.stage {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--rule);
}

.stage img {
  display: block;
  height: 52vh;
  width: auto;
  max-width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
}

/* 画像を大きく、時間と操作は右に並べる */
.practice-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.practice-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 180px;
}

.practice-side .timer-text { margin: 0; text-align: left; }

.practice-side .practice-controls {
  flex-direction: column;
  margin-top: 0;
}

.practice-side .btn { width: 100%; }

.practice-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* 練習画面と広告が1画面に収まるように、縦の余白を詰める */
.preview-col .ad-slot {
  min-height: 90px;
  margin: 16px 0 0;
}

/* 待機・完了の表示 */
.idle-note { margin-top: 12px; }

.done {
  text-align: center;
  padding: 80px 0;
}

.done h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  margin: 0 0 8px;
}

/* ---------- 練習中（js が body に is-practicing を付ける） ---------- */
body.is-practicing > .site-footer { display: none; }
body.is-practicing .setup-col { display: none; }
body.is-practicing .studio { grid-template-columns: minmax(0, 1fr); }
body.is-practicing .preview-col { max-width: 1000px; width: 100%; margin: 0 auto; }
body.is-practicing .stage img { height: 62vh; }

/* ---------- 端末ごとの調整 ---------- */
@media (max-width: 860px) {
  .studio { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 600px) {
  .stage { width: 100%; max-width: 300px; }
  .stage img { height: auto; width: 100%; }
  body.is-practicing .stage img { height: auto; }
  .practice-body { flex-direction: column; gap: 16px; }
  .practice-side { width: 100%; min-width: 0; }
  .practice-side .timer-text { text-align: center; }
  .practice-side .practice-controls { flex-direction: row; justify-content: center; }
  .practice-side .btn { width: auto; flex: 1 1 0; }
}

/* 文章ページ（プライバシーポリシーなど） */

.prose {
  max-width: 680px;
  margin: 40px auto 72px;
  font-size: 15px;
}

.prose h1 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.45;
  margin: 8px 0 18px;
}

.prose h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  margin: 44px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

.prose .meta { font-size: 12px; color: var(--ink-soft); margin: 0; }
.prose a { color: var(--vermilion); }

/* タッチ操作（スマホ・タブレット）と、横向きスマホのような低い画面 */

/* 指で押す画面では、押す場所を大きくする（幅が狭くないタブレットも含む） */
@media (pointer: coarse) {
  .site-nav a { padding: 10px 2px; }
  .options button { min-height: 40px; padding: 8px 12px; }
  .tag { min-height: 38px; padding: 8px 12px; }
  .tagbtn { padding: 8px 6px; }
  .select { padding: 10px 12px; font-size: 16px; }
  .footer-links a { padding-top: 8px; padding-bottom: 8px; }
  .lightbox .close { width: 48px; height: 48px; }
  /* 効果音のスイッチは見た目を変えず、押せる範囲だけ広げる */
  .switch button::before { content: ""; position: absolute; inset: -10px; }
}

/* 画面が低いとき（横向きのスマホ）：練習中はヘッダーを隠し、画像が1画面に収まる大きさにする */
@media (max-height: 500px) {
  body.is-practicing .site-header { display: none; }
  body.is-practicing .stage { width: fit-content; max-width: 100%; }
  body.is-practicing .stage img { height: calc(100vh - 110px); height: calc(100dvh - 110px); width: auto; }
  body.is-practicing .practice-body { flex-direction: row; gap: 28px; }
  body.is-practicing .practice-side { width: auto; min-width: 180px; }
  body.is-practicing .practice-side .timer-text { text-align: left; }
  body.is-practicing .practice-side .practice-controls { flex-direction: column; }
  body.is-practicing .practice-side .btn { width: 100%; flex: none; }
  .lightbox figure { width: min(100%, 960px, calc((100vh - 70px) * 3 / 4)); width: min(100%, 960px, calc((100dvh - 70px) * 3 / 4)); }
}

/* 画像の保存・ドラッグ・印刷を抑える（完全には防げません） */

.frame img,
.stage img,
.sheet-track img,
.pinboard img,
.lightbox img,
.pose-view img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
  pointer-events: none;
}

@media print {
  img { display: none !important; }
}
