/* ECODROP — 白・黒・黄緑のポップな画面。太いフチ＋ベタ影でセル調に */

:root {
  color-scheme: dark;
  --ink: #111411;
  --paper: #fbfbf4;
  --lime: #b8f23c;
  --leaf: #3fa34d;
  --pink: #ff6fa5;
  --orange: #ff9a3c;
  --gold: #ffd23c;
  --red: #ff5a4e;
  --muted: #7d857a;
  --bg: #121712;
  --display: 'Dela Gothic One', 'Zen Kaku Gothic New', system-ui, sans-serif;
  --body: 'Zen Kaku Gothic New', 'Hiragino Sans', 'Yu Gothic', system-ui, sans-serif;
  --rainbow: linear-gradient(90deg, #ff6fa5, #ffd23c, #b8f23c, #7fd3ff, #ff6fa5);
}

* { box-sizing: border-box; }
/* スマホのダブルタップで拡大しない（生き物のカードやボタンを続けてタップしても拡大されない）。スクロールはできる。
   ※ ページ全体（* や html・body）にかけると、iPhone で背景の絵が消えることがあったので、操作する部分だけにかける */
button, .top, .scorebar, .hud, .overlay, .card { touch-action: manipulation; }
html, body { height: 100%; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 10%, #22301f 0, transparent 40%),
    radial-gradient(circle at 90% 90%, #1d2a1a 0, transparent 45%),
    var(--bg);
  color: var(--paper);
  font-family: var(--body);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
/* 壁紙：森の草原の絵を暗めに敷く。iOS は background-attachment: fixed が効かないので、固定した疑似要素に描く */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(12, 20, 10, 0.55), rgba(12, 20, 10, 0.72)),
    url('../../assets/bg.jpg') center top / cover no-repeat,
    var(--bg);
  pointer-events: none;
}
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: max(8px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

/* ── ヘッダー ── */
.top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.logo {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 24px;
  color: var(--lime);
  text-shadow: 3px 3px 0 #000;
  line-height: 1;
}
.best-chip { font-family: var(--display); font-size: 12px; color: var(--gold); background: #000; border: 2px solid var(--gold); border-radius: 999px; padding: 3px 9px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.best-chip:empty { display: none; }
.lives { display: flex; gap: 2px; margin-left: auto; font-size: 20px; }
.lives .dead { filter: grayscale(1) brightness(0.5); opacity: 0.6; }
.lives .pulse { animation: pulse 0.6s ease; }
@keyframes pulse { 50% { transform: scale(1.6) rotate(-12deg); } }
.icon-btn {
  width: 38px; height: 38px;
  border: 3px solid #000; border-radius: 12px;
  background: var(--paper); color: var(--ink);
  font-size: 17px; box-shadow: 0 3px 0 #000;
  cursor: pointer;
}
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }

/* ── ステージ ── */
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 480 / 446;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#canvas { display: block; width: 100%; height: 100%; cursor: none; }

:root { --ov-pt: 12px; --ov-pb: 12px; } /* ひらく画面（カード）の上下のあき。ホーム画面から開いたときは、時計の帯・ホームバーの分も あける */
.overlay {
  position: fixed; inset: 0; z-index: 10;
  display: grid; place-items: center;
  /* 後ろのキャンバスは毎フレーム描き直すので、ぼかし（backdrop-filter）は使わない。iOS で黒くチラつく原因になる */
  background: rgba(10, 14, 10, 0.68);
  padding: var(--ov-pt) 12px var(--ov-pb);
  animation: fade 0.25s ease;
}
.overlay.hidden { display: none; }
@keyframes fade { from { opacity: 0; } }

.card {
  background: var(--paper);
  color: var(--ink);
  border: 4px solid #000;
  border-radius: 22px;
  box-shadow: 0 6px 0 #000;
  padding: 18px 20px;
  text-align: center;
  width: min(100%, 380px);
  max-height: calc(var(--app-h, 100dvh) - var(--ov-pt) - var(--ov-pb));
  overflow: auto;
  animation: pop 0.35s cubic-bezier(.2, 1.6, .4, 1);
}
@keyframes pop { from { transform: scale(0.8); opacity: 0; } }

.logo.big { position: relative; z-index: 1; font-size: 44px; color: var(--lime); -webkit-text-stroke: 2px #000; text-shadow: 4px 4px 0 #000; }
.tagline { font-weight: 900; font-size: clamp(13px, 4.2vw, 18px); margin: 8px 0 10px; white-space: nowrap; } /* 1行に収める（せまい画面では少し小さく） */

.big-btn {
  font-family: var(--display);
  font-size: 26px;
  padding: 10px 32px;
  border: 4px solid #000;
  border-radius: 999px;
  background: var(--lime);
  color: #000;
  box-shadow: 0 5px 0 #000;
  cursor: pointer;
  letter-spacing: 0.04em;
}
.big-btn:hover { background: #c9ff55; }
.big-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #000; }
.big-btn.play { font-size: 34px; padding: 10px 48px; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06); } }
.sub-btn { font: inherit; font-weight: 700; font-size: 13px; background: none; border: none; text-decoration: underline; color: #333; cursor: pointer; padding: 6px; }

.ranking { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.ranking:empty { display: none; }
.ranking li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: baseline; padding: 3px 8px; border-radius: 8px; background: #f0f2ea; font-variant-numeric: tabular-nums; }
.ranking li:first-child { background: #fff3c2; }
.ranking .r { font-family: var(--display); }
.ranking .s { font-family: var(--display); text-align: left; }
.ranking .rv { font-size: 0.85em; margin-right: 3px; }
.ranking .d { color: #666; font-size: 11px; }

/* ── 結果 ── */
.result { padding: 14px 16px 0; } /* 下は余白なし：ボタンの帯（sticky）の下から、スクロール中の中身がのぞかないように */
.collapsed { font-family: var(--display); font-size: 20px; line-height: 1.1; margin: 0; }
.collapsed.cleared { color: var(--leaf); }
/* いつもの森を、再生の森から遊ぶ */
.pick-revival { display: grid; gap: 2px; width: 100%; margin: 10px 0 6px; font: inherit; font-weight: 900; font-size: 17px; color: var(--ink); background: #dff5c8; border: 3px solid #000; border-radius: 16px; box-shadow: 0 4px 0 #000; padding: 10px 12px; cursor: pointer; }
.pick-revival span { font-size: 11.5px; font-weight: 700; color: #4a5a40; }
.pick-revival:active { transform: translateY(2px); box-shadow: 0 2px 0 #000; }
.final-score { font-family: var(--display); font-size: 44px; margin: 2px 0 0; color: var(--leaf); -webkit-text-stroke: 1.5px #000; font-variant-numeric: tabular-nums; }
.rank-line { margin: 0 0 8px; font-weight: 900; font-size: 13px; color: #555; }
.new-record {
  margin: 6px auto 0;
  display: inline-block;
  font-family: var(--display);
  font-size: 16px;
  padding: 3px 14px;
  border: 2px solid #000;
  border-radius: 999px;
  background: var(--rainbow);
  background-size: 200% 100%;
  animation: rainbowSlide 2s linear infinite, pop 0.4s cubic-bezier(.2, 1.8, .4, 1) 0.9s both;
}
@keyframes rainbowSlide { to { background-position: -200% 0; } }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 0 0 10px; font-size: 12px; text-align: left; }
.stats div { display: flex; justify-content: space-between; border-bottom: 1.5px dashed #ccc; padding-bottom: 2px; }
.stats dt { color: #555; }
.stats dd { margin: 0; font-weight: 900; font-variant-numeric: tabular-nums; }
.what { background: #eef6dc; border: 2px solid #000; border-radius: 14px; padding: 8px 10px; margin-bottom: 12px; }
.what-title { font-family: var(--display); font-size: 13px; margin: 0 0 4px; }
.chain { font-size: 20px; margin: 0 0 4px; line-height: 1.3; }
.chain .x { font-family: var(--display); font-size: 14px; color: var(--red); }
.chain .arr { font-weight: 900; font-size: 15px; }
.chain .next { font-weight: 900; font-size: 20px; color: #e07b1b; margin: 0 2px; }
.what-text { font-weight: 700; font-size: 13px; margin: 0 0 4px; }
.what-term { font-size: 11.5px; color: #3c5d1c; margin: 0; }
.result-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; position: sticky; bottom: 0; background: var(--paper); padding: 8px 0 max(14px, env(safe-area-inset-bottom)); }
.result-actions .big-btn { width: 100%; max-width: 260px; margin: 0 auto 4px; }
.sub-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pill-btn { font: inherit; font-weight: 900; font-size: 13px; color: var(--ink); background: #fff; border: 2.5px solid #000; border-radius: 999px; box-shadow: 0 3px 0 #000; padding: 5px 14px; cursor: pointer; }
.pill-btn:hover { background: #f1ffd6; }
.pill-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }

/* ── HUD ── */
.hud {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: 'picker' 'pop';
  gap: 8px;
}

/* 落とす生き物のカードとエネルギー */
.picker { grid-area: picker; display: grid; gap: 6px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sp-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 6px;
  padding: 6px 8px;
  background-color: #dfe4d8;
  /* たまるまでの進み具合（下から満ちる）。--fill は JS が入れる */
  background-image: linear-gradient(to top, #fff8 var(--fill, 0%), transparent var(--fill, 0%));
  color: var(--ink);
  border: 3px solid #000;
  border-radius: 14px;
  box-shadow: 0 3px 0 #000;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.sp-card .e { grid-row: 1 / 3; font-size: 30px; line-height: 1; position: relative; z-index: 1; }
.sp-card .n { grid-column: 2; grid-row: 1; font-weight: 900; font-size: 12px; position: relative; z-index: 1; white-space: nowrap; }
.sp-card .c { grid-column: 2; grid-row: 2; font-size: 10px; letter-spacing: 1px; color: #3a7d1a; position: relative; z-index: 1; }
.sp-card .key { position: absolute; top: 3px; right: 6px; font-family: var(--display); font-size: 10px; color: #0006; z-index: 1; }
/* キーボードの数字（1〜3キーで選べる）。タッチの画面では使わないので出さない（名前と重ならないように） */
@media (hover: none) and (pointer: coarse) { .sp-card .key { display: none; } }
.sp-card.selected { background-color: var(--lime); transform: translateY(-2px); box-shadow: 0 5px 0 #000; }
.sp-card.ready:not(.selected) { background-color: var(--paper); }
.sp-card .e img { display: block; width: 1.25em; height: 1.25em; object-fit: contain; }
.sp-card.poor .e { filter: grayscale(0.8); opacity: 0.6; }
.sp-card:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.sp-card.bump { animation: cardBump 0.3s ease; }
/* 絶滅の危機：赤いふちが点滅して、カードの上のふちに「⚠ 残り2」 */
.sp-card .warn { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); z-index: 2; background: var(--red); color: #fff; border: 2px solid #000; border-radius: 999px; padding: 0 8px; font-weight: 900; font-size: 12px; line-height: 17px; white-space: nowrap; box-shadow: 0 2px 0 #000; }
.sp-card .warn:empty { display: none; }
.sp-card .uses { position: absolute; bottom: 4px; right: 6px; z-index: 2; background: #6a5acd; color: #fff; border: 2px solid #000; border-radius: 999px; padding: 0 7px; font-weight: 900; font-size: 11px; line-height: 15px; white-space: nowrap; }
.sp-card .uses:empty { display: none; }
/* 時のゆがみ：時が速いカードは 黄色、遅いカードは むらさき。札は ● のところに重ねる（2026/10/11 けいしさんの指定） */
.sp-card.warp-fast { box-shadow: 0 0 0 4px #ffc800, 0 0 16px 4px rgba(255, 200, 0, 0.8); animation: warp-fast 0.5s ease-in-out infinite alternate; }
.sp-card.warp-slow { box-shadow: 0 0 0 4px #9a5cff, 0 0 16px 4px rgba(154, 92, 255, 0.75); animation: warp-slow 2.4s ease-in-out infinite alternate; }
.sp-card.warp-fast .uses, .sp-card.warp-slow .uses { position: relative; grid-column: 2; grid-row: 2; justify-self: start; bottom: auto; right: auto; font-size: 13px; line-height: 17px; padding: 0 8px; } /* ●（タネの数）のところに重ねる */
.sp-card.warp-fast .uses { background: #ffd000; color: #000; }
.sp-card.warp-slow .uses { background: #8a3dff; }
@keyframes warp-fast { to { box-shadow: 0 0 0 4px #fff07a, 0 0 22px 7px rgba(255, 200, 0, 0.95); } }
@keyframes warp-slow { to { box-shadow: 0 0 0 4px #c9a3ff, 0 0 22px 7px rgba(154, 92, 255, 0.9); } }
.sp-card.danger::after { content: ''; position: absolute; inset: 0; border-radius: 11px; box-shadow: inset 0 0 0 3px var(--red); animation: dangerBlink 0.8s ease-in-out infinite; pointer-events: none; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .sp-card.danger::after { animation: none; } }
@keyframes cardBump { 40% { transform: scale(1.1); } }

.energy { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.energy-bar {
  height: 14px;
  border: 2.5px solid #000;
  border-radius: 999px;
  background: #1f281c;
  overflow: hidden;
  /* 1目盛り＝エネルギー1 */
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), #000 calc(10% - 2px) 10%);
}
.energy-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7cc21a, var(--lime)); }
#energyNum { font-family: var(--display); font-size: 16px; color: var(--lime); min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }

/* スコアの帯（ロゴの下、横いっぱい） */
.scorebar { background: rgba(10, 14, 10, 0.72); border: 2px solid #000; border-radius: 14px; padding: 6px 12px; box-shadow: 0 3px 0 #000; }
.scorebox { display: grid; align-content: center; gap: 4px; min-width: 0; }
.score-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.score-row .k { font-family: var(--display); font-size: 10px; color: var(--muted); letter-spacing: 0.04em; }
#score { font-family: var(--display); font-size: 28px; color: var(--lime); font-variant-numeric: tabular-nums; white-space: nowrap; }
#score.bump { animation: bump 0.3s ease; }
/* FEVER 中の虹色は JS で文字色をゆっくり変える（iOS Safari は background-clip:text で黒くチラつくことがある） */
#score.fever, .mult.fever { text-shadow: 0 0 10px rgba(255, 255, 255, 0.25); }
.mult-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.mult { font-family: var(--display); font-size: 22px; color: var(--gold); font-variant-numeric: tabular-nums; min-width: 3.6em; }
.mult.bump { animation: bump 0.4s ease; }
.mult.lost { animation: shake 0.5s ease; color: var(--red); }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.mult-mid { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; } /* 右の WAVE・時間に重ならないように（2026/10/11） */
.mult-mid .mult-bar { flex: 1; min-width: 0; }
.mult-mid .env-icon { flex-shrink: 0; }
.env-icon { font-size: 18px; line-height: 1; animation: bump 1.2s ease infinite; } /* 出来事のあいだ（アイコン＋残りの帯） */
.mult-bar { height: 8px; background: #2a3327; border-radius: 999px; overflow: hidden; border: 1.5px solid #000; }
.mult-bar i { display: block; height: 100%; width: 0; background: #ff9a3c; border-radius: 999px; transition: width 0.25s linear; }
.time { font-family: var(--display); font-size: 14px; color: var(--paper); font-variant-numeric: tabular-nums; white-space: nowrap; }
.time .wave { font-weight: 400; color: #ff9a3c; margin-right: 4px; }
.time .wave.bump { display: inline-block; animation: bump 0.5s ease; }

.pop {
  grid-area: pop;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 6px 8px;
}
.counts { display: grid; gap: 1px; font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; }
.counts span { display: flex; gap: 6px; align-items: center; }
.counts .zero { opacity: 0.35; }
#graph { width: 100%; height: 64px; display: block; }
/* 神の力のボタン（グラフの右） */
.pop:has(.power-btn:not([hidden])) { grid-template-columns: auto 1fr auto; }
.power-btn { align-self: center; display: grid; justify-items: center; gap: 0; min-width: 76px; padding: 5px 8px 6px; border-radius: 14px; border: 2px solid #000; background: linear-gradient(#e9ffd2, #b8f23c); color: #1d3a10; font: inherit; font-weight: 900; font-size: 11px; line-height: 1.2; box-shadow: 0 4px 0 #000; cursor: pointer; }
.power-btn.flow-btn { background: linear-gradient(#e0f6ff, #8fd3ff); color: #0d3550; }
.power-btn.flow-btn.armed { background: linear-gradient(#fff6b0, #ffd23c); }
.power-btn b { font-size: 18px; font-weight: 400; }
.power-btn small { font-size: 10px; opacity: 0.8; }
.power-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #000; }
.power-btn.armed { background: linear-gradient(#fff6b0, #ffd23c); animation: powerGlow 0.9s ease-in-out infinite; }
.power-btn:disabled { filter: grayscale(1); opacity: 0.45; box-shadow: none; cursor: default; }
/* 回復したとき：ピコンと光って、ぽんと はねる（2026/10/20） */
.power-btn.ping { animation: powerPing 0.6s ease-out 4; }
@keyframes powerPing { 0% { transform: scale(1); } 30% { transform: scale(1.22); box-shadow: 0 4px 0 #000, 0 0 22px 8px rgba(255, 244, 150, 0.95); } 100% { transform: scale(1); box-shadow: 0 4px 0 #000; } }
@keyframes powerGlow { 50% { box-shadow: 0 4px 0 #000, 0 0 14px 4px rgba(255, 230, 90, 0.8); } }

@media (max-width: 480px) {
  .logo { font-size: 20px; }
  .lives { font-size: 17px; }
  .icon-btn { width: 36px; height: 36px; font-size: 16px; }
  #score { font-size: 24px; }
}

/* タブレットの縦持ちなど：画面の幅いっぱいまで広げる（下の HUD まで画面に収まる範囲で。収まらなければ今までの 560px） */
@media (min-width: 600px) and (orientation: portrait) {
  #app {
    max-width: clamp(560px, calc((100vh - 350px) * 480 / 446 + 32px), 1100px);
    max-width: clamp(560px, calc((100dvh - 350px) * 480 / 446 + 32px), 1100px);
  }
  .sp-card .e { font-size: 36px; }
  .sp-card .n { font-size: 14px; }
  #score { font-size: 34px; }
  .score-row .k { font-size: 12px; }
  .mult { font-size: 26px; }
  .time { font-size: 18px; }
  .mult-bar { height: 10px; }
  .scorebar { padding: 8px 16px; }
}

/* ホーム画面から開いたとき（全画面）：上の時計・電池の帯に近すぎないよう、少しあける（2026/10/9） */
@media (display-mode: standalone) {
  /* iPhone は時計の帯の下が少しぼやけるので、もう少し下げる（2026/10/10） */
  #app { padding-top: max(24px, calc(env(safe-area-inset-top) + 22px)); }
  /* iPad・iPhone：時計の帯の下は、OS がぼかして見せる。森の絵がぼやけて見えないよう、帯の下は落ち着いた色で塗る（2026/10/11） */
  :root { --ov-pt: calc(env(safe-area-inset-top) + 12px); --ov-pb: max(12px, env(safe-area-inset-bottom)); } /* ひらく画面（マップなど）も、帯の下から。高さも この分をひく（2026/10/17） */
  body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(env(safe-area-inset-top) + 10px);
    z-index: 40;
    background: linear-gradient(#0f170d 0, #0f170d calc(100% - 10px), rgba(15, 23, 13, 0));
    pointer-events: none;
  }
}

/* 横持ち（スマホ・タブレット・パソコン）：左に大きくステージ、右の列にロゴ・スコア・カード・グラフ。
   縦・横は画面の向きで自動で切りかわる */
@media (orientation: landscape) and (min-width: 560px) {
  #app {
    --side: clamp(250px, 30vw, 380px);
    --pad-t: max(8px, env(safe-area-inset-top));
    --pad-b: max(8px, env(safe-area-inset-bottom));
    --pad-l: max(16px, env(safe-area-inset-left));
    --pad-r: max(16px, env(safe-area-inset-right));
    max-width: none;
    padding: var(--pad-t) var(--pad-r) var(--pad-b) var(--pad-l);
    grid-template-columns: auto var(--side);
    /* 右の列は、大きさはそのまま下に寄せて、いちばん下をステージの下にそろえる（2026/10/11。上のあまりは空ける） */
    grid-template-rows: 1fr auto auto auto;
    grid-template-areas: 'stage .' 'stage top' 'stage score' 'stage hud';
    column-gap: 16px;
    row-gap: 10px;
    justify-content: center;
    align-items: start;
  }
  .top { grid-area: top; }
  .scorebar { grid-area: score; }
  /* 画面の高さいっぱい（右の列のぶんは幅から引く） */
  .stage {
    grid-area: stage;
    width: min(calc(100vw - var(--side) - 16px - var(--pad-l) - var(--pad-r)), calc((100vh - var(--pad-t) - var(--pad-b)) * 480 / 446));
    width: min(calc(100vw - var(--side) - 16px - var(--pad-l) - var(--pad-r)), calc((100dvh - var(--pad-t) - var(--pad-b)) * 480 / 446));
  }
  .hud { grid-area: hud; gap: 10px; }
  .pop, .pop:has(.power-btn:not([hidden])) { grid-template-columns: 1fr; }
  .counts { grid-template-columns: repeat(3, auto); justify-content: space-around; }
  #graph { height: 90px; }
}
/* 横持ちで背が高い（タブレット・パソコン）：カードを大きく */
@media (orientation: landscape) and (min-width: 560px) and (min-height: 600px) {
  .cards { grid-template-columns: 1fr; }
  .sp-card .e { font-size: 36px; }
  .sp-card .n { font-size: 14px; }
  /* 右の列の幅に合わせて、点数・倍率・WAVE の字を小さくする（大きな点数が枠からはみ出さないように） */
  .scorebar { container-type: inline-size; }
  #score { font-size: min(34px, 10.5cqi); }
  .mult { font-size: min(24px, 7cqi); min-width: 3.2em; }
  .time { font-size: min(16px, 4.6cqi); white-space: nowrap; }
  #graph { height: 120px; }
}
/* 横持ちで背が低い（スマホ）：右の列を詰める */
@media (orientation: landscape) and (min-width: 560px) and (max-height: 599px) {
  #app { row-gap: 6px; }
  .logo { font-size: 18px; }
  .icon-btn { width: 32px; height: 32px; font-size: 15px; }
  .scorebar { padding: 4px 10px; }
  #score { font-size: 22px; }
  .mult { font-size: 17px; }
  .time { font-size: 12px; }
  .hud { gap: 6px; }
  .cards { grid-template-columns: 1fr; gap: 6px; }
  .sp-card { padding: 3px 8px; }
  .sp-card .e { font-size: 24px; }
  .sp-card .n { font-size: 11px; }
  .pop { padding: 4px 8px; gap: 2px; }
  .counts { font-size: 12px; }
  #graph { height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .big-btn.play, .new-record, .card, .overlay, .mult.lost { animation: none !important; }
}

/* タイトルのエコ */
/* タイトルのエコはロゴの後ろ（ロゴの文字が手前に重なる） */
.menu-head, .menu-body { display: contents; } /* せまい画面では、ふつうの1列 */
/* タブレットの横持ちなど：画面の横 2/3 くらいまで広げて、左にエコとロゴ、右にモード・ボタン・ランキング */
@media (orientation: landscape) and (min-width: 820px) and (min-height: 600px) {
  /* 2026/10/11：iPad（横）で右のボタンの文字がはみ出したので、メニュー全体を大きく（66vw → 88vw）、右の列を広く */
  .card.menu { width: min(100%, 88vw, 1120px); display: flex; align-items: center; gap: 26px; padding: 24px 30px; }
  .menu .menu-head { display: flex; flex-direction: column; justify-content: center; align-items: center; flex: 0 0 36%; } /* 左も右も、縦の真ん中にそろえる（.card.menu の align-items: center） */
  .menu .menu-body { display: block; flex: 1; min-width: 0; }
  .menu .hero-eco { width: min(100%, 300px); margin-bottom: clamp(-70px, -5.5vw, -36px); }
  .menu .tagline { position: relative; z-index: 1; } /* エコの足に、文字が隠れないように */
  .menu .logo.big { font-size: clamp(44px, 5vw, 64px); }
  .menu .tagline { font-size: clamp(14px, 1.6vw, 19px); }
  .menu .mode-name { font-size: clamp(15px, 1.7vw, 21px); }
  .menu .mode-sub { font-size: clamp(11px, 1.2vw, 14px); }
  .menu .menu-links .tips-btn { font-size: clamp(13px, 1.4vw, 16px); }
  .menu .ranking { font-size: clamp(13px, 1.3vw, 15px); }
}
.hero-eco { display: block; width: 150px; height: auto; max-width: 100%; margin: -6px auto -46px; animation: heroBob 2.4s ease-in-out infinite; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.25)); }
@keyframes heroBob { 50% { transform: translateY(-5px) rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) { .hero-eco { animation: none; } }

/* ── 自然のしくみ（TIPS） ── */
.tips-btn {
  display: block;
  margin: 12px auto 0;
  font: inherit;
  font-weight: 900;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  border: 3px solid #000;
  border-radius: 999px;
  box-shadow: 0 3px 0 #000;
  padding: 6px 18px;
  cursor: pointer;
}
.tips-btn:hover { background: #f1ffd6; }
.tips-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.tips-btn.small { font-size: 12px; padding: 4px 14px; margin-top: 6px; }
/* タイトルの「自然のしくみ」「更新履歴」を横に並べる */
/* 2026/10/9：2列で、どのボタンも同じ大きさ。すきまは つづきから・モードと同じ 10px */
.menu-links { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 10px; }
.menu-links .tips-btn { margin: 0; position: relative; width: 100%; white-space: nowrap; }
.menu-links .tips-btn[hidden] { display: none; }
/* いちばん下の更新履歴は、同じ大きさのまま真ん中に（音楽室がまだないときは、森の記録のとなり） */
.menu-links:has(#musicBtn[hidden]):has(#installBtn[hidden]) #backupBtn { grid-column: 1 / -1; justify-self: center; width: calc(50% - 5px); } /* 2026/10/9：記録の引き継ぎ・ホーム画面に追加。数が奇数のときは最後のボタンをまん中に */
.menu-links:not(:has(#musicBtn[hidden])):not(:has(#installBtn[hidden])) #installBtn { grid-column: 1 / -1; justify-self: center; width: calc(50% - 5px); }
/* ホーム画面に追加の案内 */
.install-guide { align-items: center; }
.install-card { max-width: 360px; width: calc(100% - 32px); text-align: left; }
.install-body ol { margin: 6px 0; padding-left: 22px; font-size: 14px; line-height: 1.7; }
.install-body p { margin: 6px 0; font-size: 13px; line-height: 1.6; }
.install-body .note { color: #5a5f55; font-size: 12px; }
.install-body { max-height: 70vh; overflow-y: auto; }
.install-sec { margin-top: 10px; padding: 8px 10px; border: 2px solid rgba(0, 0, 0, 0.15); border-radius: 12px; }
.install-sec.now { border-color: #8fd14f; background: #f3fde4; }
.install-sec h3 { margin: 0 0 2px; font-size: 15px; }
.install-sec .here { white-space: nowrap; display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 99px; background: #8fd14f; color: #111411; font-size: 11px; vertical-align: 2px; }
.install-sec .big-btn.small { font-size: 15px; padding: 8px 22px; margin: 6px 0 2px; }
.install-warn { margin: 4px 0; padding: 8px 10px; border-radius: 10px; background: #ffe1dc; color: #9a2a1e; font-weight: 700; }
.share-ico { width: 1.6em; height: 1.6em; vertical-align: -0.45em; margin: 0 2px; }
.install-body .key { display: inline-block; padding: 0 6px; border: 2px solid #111411; border-radius: 6px; background: #fff; font-weight: 900; }
.install-arrow { position: fixed; left: 50%; bottom: 8px; transform: translateX(-50%); font-size: 44px; color: #ffd23c; text-shadow: 0 2px 0 #000, 0 0 12px rgba(0, 0, 0, 0.6); animation: install-bob 1s ease-in-out infinite; pointer-events: none; }
.install-arrow.top { bottom: auto; top: 8px; left: auto; right: 18px; transform: none; }
.install-arrow[hidden] { display: none; }
@keyframes install-bob { 0%, 100% { margin-bottom: 0; margin-top: 0; } 50% { margin-bottom: -10px; margin-top: 10px; } }
.storage-warn { margin: 10px 0 0; padding: 8px 10px; border-radius: 12px; background: rgba(224, 87, 75, 0.92); color: #fff; font-size: 12px; font-weight: 700; line-height: 1.5; text-align: left; }
.storage-warn[hidden] { display: none; }
.storage-note { display: flex; align-items: flex-start; gap: 6px; margin: 10px 0 0; padding: 8px 8px 8px 10px; border-radius: 12px; background: rgba(255, 244, 196, 0.95); color: #4a3a10; font-size: 12px; font-weight: 700; line-height: 1.5; text-align: left; }
.storage-note b { color: #b0441f; }
.storage-note[hidden] { display: none; }
.storage-note-close { flex: none; width: 24px; height: 24px; padding: 0; border: 2px solid #4a3a10; border-radius: 50%; background: #fff; color: #4a3a10; font-size: 12px; font-weight: 900; line-height: 1; cursor: pointer; }
/* 記録の引き継ぎ */
.backup-body { text-align: left; }
.backup-status { margin: 0 0 8px; padding: 8px 10px; border-radius: 12px; background: #eef8dc; color: #2c4a14; font-weight: 700; font-size: 13px; }
.backup-status.ok { background: #e2f7c4; }
.backup-status.bad { background: #ffe1dc; color: #9a2a1e; }
.backup-lead, .backup-sec p { margin: 4px 0; font-size: 13px; line-height: 1.6; }
.backup-sec { margin-top: 12px; padding-top: 10px; border-top: 2px dashed rgba(0, 0, 0, 0.15); }
.backup-sec h3 { margin: 0 0 4px; font-size: 15px; }
.backup-sec textarea { width: 100%; box-sizing: border-box; margin: 6px 0; padding: 8px; background: #fff; color: #111411; border: 2px solid #111411; border-radius: 10px; font: 12px/1.4 ui-monospace, monospace; word-break: break-all; resize: vertical; }
.backup-sec textarea[hidden], .backup-row[hidden], .backup-sec .big-btn[hidden] { display: none; }
.backup-sec .big-btn.small { font-size: 15px; padding: 8px 22px; margin: 6px 0; }
.backup-row { display: flex; gap: 8px; }
.backup-row .tips-btn.small { margin: 0; }
.backup-msg { min-height: 1em; font-weight: 700; }
.cloud-sec { border-top: none; padding-top: 0; }
.cloud-id { margin: 6px 0; padding: 10px; border: 3px solid #111411; border-radius: 12px; background: #fff; font: 900 20px/1.2 ui-monospace, monospace; letter-spacing: 1px; text-align: center; user-select: all; }
.cloud-in { width: 100%; box-sizing: border-box; margin: 6px 0; padding: 10px; border: 2px solid #111411; border-radius: 10px; background: #fff; color: #111411; font: 700 16px ui-monospace, monospace; text-transform: uppercase; }
.backup-sub { margin: 18px 0 0; padding-top: 10px; border-top: 2px solid rgba(0, 0, 0, 0.2); font-size: 13px; color: #5a5f55; }
.new-badge { position: absolute; top: -9px; right: -8px; background: var(--red); color: #fff; border: 2px solid #000; border-radius: 999px; padding: 0 6px; font-family: var(--display); font-size: 10px; line-height: 16px; }
.new-badge[hidden] { display: none; }
/* 更新履歴 */
.news-card { grid-template-rows: auto 1fr; }
.tips-card.rank-card { width: min(100%, 440px); height: auto; min-height: 320px; max-height: calc(var(--app-h, 100dvh) - var(--ov-pt) - var(--ov-pb)); }
.rank-card .rank-note { text-align: center; font-size: 14px; margin-top: 18px; }
.rank-card .rank-box { margin-top: 0; }
.rank-card .ranking { font-size: 15px; }
.rank-card .ranking li:has(.nm) .d { display: block; grid-column: 2 / -1; margin-top: -2px; text-align: left; } /* みんなのランキングも、名前の下に 日付・WAVE・時間 */
@media (min-width: 700px) { .rank-card .rank-tabs button { font-size: 14px; padding: 4px 14px; } }
.news-entry { background: #fff; border: 2px solid #000; border-radius: 14px; padding: 10px 12px; }
.news-entry.latest { box-shadow: 0 0 0 3px var(--lime); }
.news-date { margin: 0; font-family: var(--display); font-size: 12px; color: var(--leaf); }
.news-title { margin: 2px 0 6px; font-weight: 900; font-size: 15px; }
.news-list { margin: 0; padding-left: 1.2em; display: grid; gap: 3px; font-size: 13px; line-height: 1.55; }

.pop-story { background: #fff; border: 2px solid #000; border-radius: 14px; padding: 8px 10px; margin-bottom: 12px; }
#popChart { display: block; width: 100%; height: 190px; touch-action: pan-y; cursor: crosshair; }
.pop-read { margin: 4px 0 6px; min-height: 1.4em; font-size: 12px; font-weight: 700; color: #555; font-variant-numeric: tabular-nums; }
.pop-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; text-align: left; font-size: 12.5px; line-height: 1.5; }
.pop-notes li { display: grid; grid-template-columns: 22px 1fr; gap: 6px; align-items: start; }
.pop-notes .no { width: 20px; height: 20px; border-radius: 50%; border: 2px solid; background: #fff; display: grid; place-items: center; font-weight: 900; font-size: 11px; color: var(--ink); }
.advice { background: #fff6d6; border: 2px solid #000; border-radius: 14px; padding: 8px 10px; margin-bottom: 12px; text-align: left; }
.advice-title { font-family: var(--display); font-size: 13px; margin: 0 0 4px; text-align: center; }
.advice-text { font-weight: 700; font-size: 13px; line-height: 1.6; margin: 0; }
/* つぎのコツは「WHAT HAPPENED?」の中に（見つけた 自然のしくみと、欄が重ならないように） */
.what .advice-text { text-align: left; margin-top: 8px; padding-top: 8px; border-top: 1.5px dashed #9fbf7a; }
.what .advice-text::before { content: '💡 つぎは：'; color: #3d6b1f; }
.what.cleared .advice-text::before { content: none; }
/* クリアしたとき：本当の自然では → きみにできること */
/* 字は小さく・細めに（うるさくならないように） */
.what.real .advice-text { font-weight: 500; font-size: 12.5px; color: #3a3a3a; }
.what.real .advice-text::before { content: none; } /* 見出し（本当の自然では・きみにできること）は出さない（2026/10/7） */
.advice-act { display: block; margin-top: 5px; }
.what .advice-env { text-align: left; border-top-color: #9fbf7a; }
.what .tips-btn.small { margin-top: 8px; }
.advice-env { font-size: 12px; line-height: 1.6; margin: 6px 0 0; padding-top: 6px; border-top: 1.5px dashed #d8c27a; }

.tips-overlay { z-index: 20; }
.tips-card { width: min(100%, 560px); text-align: left; padding: 14px 16px 16px; display: grid; grid-template-rows: auto auto 1fr; gap: 8px; }
.tips-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tips-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 20px; }
.tips-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.tips-nav button { font: inherit; font-weight: 900; font-size: 12px; background: #eef6dc; border: 2px solid #000; border-radius: 999px; padding: 3px 12px; cursor: pointer; color: var(--ink); }
.tips-nav button:hover { background: var(--lime); }
.tips-body { overflow: auto; min-height: 0; display: grid; gap: 10px; padding-right: 2px; align-content: start; } /* 中身が少ないときも、上から詰めて並べる */
.tips-body h3 { margin: 6px 0 0; font-family: var(--display); font-weight: 400; font-size: 15px; color: var(--leaf); }
.tip { border: 2px solid #000; border-radius: 14px; padding: 10px 12px; background: #fff; scroll-margin-top: 8px; }
.tip.focus { background: #f1ffd6; box-shadow: 0 0 0 3px var(--lime); }
.tip-title { margin: 0 0 4px; font-weight: 900; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.tip-title .i { font-size: 22px; }
.tip-body { margin: 0; font-size: 13px; line-height: 1.7; max-width: 60ch; }
.tip-figure { margin: 8px auto 0; max-width: 360px; }
.tip-figure svg { display: block; width: 100%; height: auto; }
.pyramid-note { margin: 4px 0 0; text-align: right; font-size: 11.5px; font-weight: 900; color: #2e7d32; }
.tip-game { margin: 8px 0 0; font-size: 12.5px; line-height: 1.6; background: #eef6dc; border-radius: 10px; padding: 6px 10px; }
.tip-game b { font-family: var(--display); font-weight: 400; font-size: 11px; color: var(--leaf); margin-right: 6px; }
.tips-card { height: calc(var(--app-h, 100dvh) - var(--ov-pt) - var(--ov-pb)); max-height: 760px; overflow: hidden; }

/* ── 動物図鑑 ── */
.zukan-overlay { z-index: 22; } /* 自然のしくみ・保全と再生の上にひらく */
.restore-overlay { z-index: 21; }
.tips-nav .rs-nav { background: #fff; }
/* 自然のしくみのタブ：ゲームの話は緑、現実の世界の話（生き物図鑑・保全と再生）は水色（2026/10/8） */
.tips-nav button[data-cat] { background: #cfeeb0; }
.tips-nav button.real { background: #c8ecfb; } /* 字の色・ふちは ほかのタブと同じ */
.tips-nav button.real:hover { background: #a8e0f8; }
.tips-nav button { position: relative; }
.zk-body h3 .ach-new, .song-title .ach-new { margin-left: 6px; vertical-align: 2px; }
/* 保全と再生 */
.rs-lead { margin: 0; font-size: 13px; line-height: 1.7; }
.rs-place { margin: -2px 0 4px; font-size: 11.5px; font-weight: 700; color: #666; }
.rs-actions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rs-actions li { display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: start; background: #fff; border: 2px solid #000; border-radius: 14px; padding: 8px 12px; }
.rs-actions .i { font-size: 22px; line-height: 1.2; }
.rs-actions b { font-size: 14px; }
.rs-actions p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.6; }
.zukan-card { grid-template-rows: auto 1fr; }
.zukan-card .tips-head h2 { flex: 1; }
.tips-nav .zk-nav { background: #fff; }
/* 本文の動物の名前（タップで図鑑） */
.zk-link { font: inherit; font-weight: 900; color: var(--leaf); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.zk-link::after { content: '📗'; font-size: 0.8em; margin-left: 1px; }
/* 自然のしくみの中の写真カード */
.zk-cards { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.zk-card { font: inherit; color: var(--ink); display: grid; grid-template-columns: 52px auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; background: #fff; border: 2px solid #000; border-radius: 12px; padding: 4px 10px 4px 4px; cursor: pointer; box-shadow: 0 2px 0 #000; }
.zk-card:hover { background: #f1ffd6; }
.zk-card:active { transform: translateY(1px); box-shadow: 0 1px 0 #000; }
.zk-thumb { grid-row: span 2; width: 52px; height: 52px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: #eef6dc; font-size: 30px; }
.zk-thumb img, .zk-pic img, .zk-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.zk-card-name { font-weight: 900; font-size: 13px; align-self: end; }
.zk-card-more { font-size: 11px; color: var(--leaf); font-weight: 700; align-self: start; }
/* 一覧 */
.zk-lead { margin: 0; font-size: 13px; line-height: 1.6; }
.zk-count { margin: 0; font-size: 13px; font-weight: 700; }
.zk-count b { font-size: 18px; color: #1f5f7a; }
.zk-count small { display: block; font-weight: 500; color: #666; font-size: 11.5px; line-height: 1.5; }
.zk-ranks { background: #fff; border: 2px solid #8fc3d9; border-radius: 12px; padding: 6px 10px; }
.zk-ranks summary { font-weight: 900; font-size: 13px; color: #1f5f7a; cursor: pointer; }
.zk-ranks-lead, .zk-ranks-note { margin: 6px 0 0; font-size: 12px; line-height: 1.6; }
.zk-ranks-note { color: #777; font-size: 11px; }
.zk-ranks-h { margin: 10px 0 0; padding-top: 8px; border-top: 3px solid #8fc3d9; font-weight: 900; font-size: 12.5px; color: #1f5f7a; }
.zk-ranks-h.alien { margin-top: 12px; border-top-color: #8e3fb0; color: #6a1b9a; }
.zk-ranks dl { margin: 6px 0 0; display: grid; gap: 4px; }
.zk-ranks dl div { display: grid; grid-template-columns: 9.5em 1fr; gap: 6px; align-items: start; border-bottom: 1px dashed #d6e6ee; padding: 3px 0; }
.zk-ranks dt { margin: 0; }
.zk-ranks dd { margin: 0; font-size: 12px; line-height: 1.5; }
.zk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.zk-item { font: inherit; color: var(--ink); background: #fff; border: 2px solid #000; border-radius: 14px; padding: 6px; cursor: pointer; display: grid; gap: 4px; justify-items: center; box-shadow: 0 2px 0 #000; }
.zk-item:hover { background: #f1ffd6; }
.zk-pic { width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: #eef6dc; font-size: 48px; }
.zk-item-name { font-weight: 900; font-size: 14px; }
.zk-status { font-size: 10.5px; font-weight: 900; color: #fff; background: var(--c); border-radius: 999px; padding: 1px 8px; }
/* くわしいページ */
.zk-detail { gap: 12px; }
.zk-photo { margin: 0; }
.zk-hero { width: 100%; aspect-ratio: 3 / 2; border: 2px solid #000; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: #eef6dc; font-size: 96px; }
.zk-credit { margin: 4px 0 0; font-size: 10.5px; color: #666; line-height: 1.5; }
.zk-credit a { color: inherit; }
.zk-credit b { color: var(--ink); font-size: 12px; }
.zk-name h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--ink); }
.zk-sci { margin: 0 0 6px; font-style: italic; font-size: 13px; color: #555; }
.zk-note { margin: 6px 0 0; font-size: 12px; line-height: 1.6; color: #555; }
.zk-sec { background: #fff; border: 2px solid #000; border-radius: 14px; padding: 8px 12px; }
.zk-sec h4 { margin: 0 0 4px; font-size: 13px; font-weight: 900; color: var(--leaf); }
.zk-sec p, .zk-sec ul { margin: 0; font-size: 13px; line-height: 1.7; }
.zk-sec ul { padding-left: 1.2em; display: grid; gap: 4px; }
.zk-taxon { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 13px; }
.zk-taxon dt { font-weight: 900; color: #666; }
.zk-taxon dd { margin: 0; }
.zk-tips { display: flex; flex-wrap: wrap; gap: 6px; }
.zk-tip { font: inherit; font-weight: 900; font-size: 12px; color: var(--ink); background: #eef6dc; border: 2px solid #000; border-radius: 999px; padding: 3px 12px; cursor: pointer; }
.zk-tip:hover { background: var(--lime); }

/* ── エンディング ── */
.ending { z-index: 30; overflow: hidden; background: radial-gradient(ellipse at 50% 30%, rgba(255, 244, 190, 0.55), rgba(255, 244, 190, 0) 60%), linear-gradient(rgba(20, 40, 16, 0.25), rgba(20, 40, 16, 0.55)), url('../../assets/bg.jpg') center / cover no-repeat, var(--bg); cursor: pointer; }
.ending-inner { position: relative; z-index: 1; width: min(100%, 460px); display: grid; justify-items: center; gap: 6px; padding: 12px 18px; text-align: center; }
.ending-head { margin: 0; font-family: var(--display); font-size: 18px; color: var(--lime); text-shadow: 0 2px 0 #000, 0 0 6px rgba(0, 0, 0, 0.6); letter-spacing: 0.06em; animation: endIn 1s ease both; }
.ending-eco { width: min(52vw, 210px); height: auto; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.25)); animation: endIn 1s ease both, heroBob 2.6s ease-in-out 1s infinite; }
.ending-text { display: grid; gap: 8px; min-height: 9em; }
.ending-text p { margin: 0; background: rgba(251, 251, 244, 0.95); border: 3px solid #000; border-radius: 16px; padding: 7px 14px; font-weight: 900; font-size: clamp(14px, 4vw, 17px); line-height: 1.5; color: var(--ink); box-shadow: 0 3px 0 #000; opacity: 0; animation: endIn 0.8s ease both; }
.ending-next { margin-top: 6px; font: inherit; font-family: var(--display); font-size: 18px; color: #000; background: var(--lime); border: 4px solid #000; border-radius: 999px; box-shadow: 0 5px 0 #000; padding: 10px 34px; cursor: pointer; opacity: 0; animation: endIn 0.8s ease both; }
.ending-next:active { transform: translateY(3px); box-shadow: 0 2px 0 #000; }
.ending-credit { margin: 4px 0 0; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; }
/* タップしたら、残りのことばをすぐ出す */
.ending.all .ending-text p, .ending.all .ending-next { animation-delay: 0s !important; }
/* エンディングの最後の1枚 */
.ending-final { position: absolute; inset: 0; z-index: 2; display: grid; grid-template-rows: minmax(0, auto) auto auto; align-content: center; justify-items: center; gap: 10px; padding: 12px 12px 18px; background: #0d1a0c; overflow: hidden; animation: endIn 1.2s ease both; }
.ending-final[hidden] { display: none; }
/* スタッフロール（2026/10/11）：下から上へ、ゆっくり流れる */
.staff-roll { position: absolute; inset: 0; z-index: 3; overflow: hidden; background: #060e06; }
.staff-roll::before { content: ''; position: absolute; inset: -30px; background: url('../../assets/ending-blur-3.webp') center / cover; filter: blur(18px) brightness(0.3); } /* 背景はなめらかにぼかす */
.staff-roll[hidden] { display: none; }
.staff-inner { position: absolute; left: 0; right: 0; top: 100%; display: grid; justify-items: center; gap: 34px; padding: 0 16px 40px; text-align: center; color: #fff8e6; animation: staffRoll 62s linear forwards; }
@keyframes staffRoll { to { transform: translateY(calc(-100% - 100vh)); } }
.staff-logo { margin: 0; font-family: var(--display); font-size: clamp(34px, 9vw, 54px); color: var(--lime); text-shadow: 0 3px 0 #000; }
.staff-inner section { display: grid; gap: 4px; }
.staff-inner h4 { margin: 0 0 4px; font-size: 13px; font-weight: 900; letter-spacing: 0.12em; color: #c9e98a; }
.staff-inner p { margin: 0; font-size: clamp(15px, 4vw, 18px); font-weight: 900; line-height: 1.5; }
.staff-inner .staff-sub { font-size: 12px; font-weight: 700; opacity: 0.8; }
.staff-cast { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.staff-cast figure { margin: 0; display: grid; justify-items: center; gap: 6px; }
.staff-cast img { width: auto; height: 130px; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.35)); } /* 立ち絵（2026/10/11） */
.staff-cast figcaption { display: grid; font-weight: 900; font-size: 16px; }
.staff-cast small { font-size: 11px; opacity: 0.85; }
.staff-inner .staff-animals { gap: 10px; }
.staff-animals p { display: grid; justify-items: center; line-height: 1.3; }
.staff-animals img { height: 84px; width: auto; margin-bottom: 4px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.35)); }
.staff-animals span { font-size: 13px; font-weight: 700; opacity: 0.9; }
.staff-animals i { font-size: 12px; font-weight: 400; opacity: 0.75; font-family: Georgia, serif; } /* 学名はイタリック */
.rc-staff { display: block; width: 100%; margin: 0 0 12px; padding: 10px; border: 2px solid #c9e98a; border-radius: 12px; background: #1d3318; color: #fff8e6; font: inherit; font-weight: 900; cursor: pointer; }
.staff-skip { position: absolute; right: 12px; bottom: 10px; margin: 0; font-size: 12px; font-weight: 700; color: #fff; opacity: 0.75; }
@media (prefers-reduced-motion: reduce) { .staff-inner { animation-duration: 60s; } }
.ending-final::before { content: ''; position: absolute; inset: -20px; background: url('../../assets/ending-blur-3.webp') center / cover; filter: blur(14px) brightness(0.55); }
.ending-art { position: relative; min-height: 0; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; align-self: center; border-radius: 6px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45); }
.ending-thanks { position: relative; margin: 0; padding: 0 12px; font-family: var(--display); font-size: clamp(24px, 7vw, 44px); color: var(--lime); text-align: center; text-shadow: 0 3px 0 #000, 0 0 12px rgba(0, 0, 0, 0.6); opacity: 0; animation: endIn 1.2s ease 1.2s both; }
.ending-hint { position: relative; margin: 0; font-size: 12px; font-weight: 700; color: #fff; opacity: 0; animation: endIn 0.8s ease 3s both; }
@keyframes endIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
/* 舞う花びら */
.petal { position: absolute; top: -20px; width: 12px; height: 10px; border-radius: 60% 0 60% 0; background: #ffb3c7; opacity: 0.85; animation: petal 9s linear infinite; }
.petal:nth-of-type(1) { left: 8%; animation-delay: 0s; }
.petal:nth-of-type(2) { left: 26%; animation-delay: 3s; background: #fff; }
.petal:nth-of-type(3) { left: 44%; animation-delay: 6s; }
.petal:nth-of-type(4) { left: 62%; animation-delay: 1.5s; background: #ffd23c; }
.petal:nth-of-type(5) { left: 78%; animation-delay: 4.5s; }
.petal:nth-of-type(6) { left: 92%; animation-delay: 7.5s; background: #fff; }
@keyframes petal { to { transform: translate(-60px, 110vh) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) { .petal { display: none; } .ending-eco { animation: endIn 1s ease both; } }

/* ── はじめの画面（タップしてスタート） ── */
.splash { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; cursor: pointer; background: linear-gradient(rgba(12, 20, 10, 0.35), rgba(12, 20, 10, 0.6)), url('../../assets/bg.jpg') center / cover no-repeat, var(--bg); animation: fade 0.3s ease; -webkit-user-select: none; user-select: none; }
.splash.out { opacity: 0; transition: opacity 0.35s ease; pointer-events: none; }
.splash-inner { display: grid; justify-items: center; }
.splash-eco { width: min(56vw, 34vh, 240px); height: auto; margin-bottom: calc(min(56vw, 34vh, 240px) * -0.27); /* ロゴの文字がエコの足もとに重なる */ animation: heroBob 2.4s ease-in-out infinite; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.3)); }
.splash-logo { position: relative; z-index: 1; margin: 0; font-size: min(15vw, 10vh, 64px); }
.splash-sound { margin: 12px 0 0; font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, 0.85); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.splash-load { margin: 22px 0 0; display: grid; justify-items: center; gap: 8px; color: #fff; font-size: 13px; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.splash-load p { margin: 0; }
.splash-bar { width: min(220px, 60vw); height: 10px; border: 2px solid #000; border-radius: 8px; background: rgba(10, 14, 10, 0.7); overflow: hidden; }
.splash-bar i { display: block; height: 100%; width: 0; background: var(--lime); transition: width 0.25s; }
.splash:not(.ready) .splash-tap, .splash:not(.ready) .splash-sound { display: none; }
.splash.ready .splash-load { display: none; }
.splash-tap { margin: 22px 0 0; font-family: var(--display); font-size: 20px; color: #fff; background: rgba(10, 14, 10, 0.7); border: 3px solid var(--lime); border-radius: 999px; padding: 8px 26px; animation: tapBlink 1.4s ease-in-out infinite; }
@keyframes tapBlink { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .splash-eco, .splash-tap { animation: none; } }

/* ── ルール説明 ── */
.rules-body { align-content: start; }
.rules-sub { margin: 10px 0 0; font-family: var(--display); font-weight: 400; font-size: 16px; color: var(--leaf); }
.rules-score { display: grid; gap: 10px; }
.rule-hello { display: flex; align-items: center; gap: 8px; }
.rule-hello img { width: 96px; height: auto; flex: none; }
.bubble { position: relative; margin: 0; background: #fff; border: 2px solid #000; border-radius: 16px; padding: 8px 12px; font-weight: 900; font-size: 14px; line-height: 1.5; }
.bubble::before { content: ''; position: absolute; left: -9px; top: 50%; margin-top: -7px; border: 7px solid transparent; border-right: 9px solid #000; border-left: 0; }
.rule { border: 2px solid #000; border-radius: 14px; background: #fff; padding: 10px 12px; display: grid; gap: 6px; }
.rule-head { margin: 0; font-weight: 900; font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.rule-head .no { width: 26px; height: 26px; border-radius: 50%; background: var(--lime); border: 2px solid #000; display: grid; place-items: center; font-family: var(--display); font-size: 13px; flex: none; }
.rule-art { display: flex; justify-content: center; align-items: flex-end; gap: 10px; background: #eef6dc; border-radius: 12px; padding: 8px; }
.rule-art > img { width: min(62%, 220px); height: auto; }
.rule-art figure { margin: 0; display: grid; justify-items: center; gap: 2px; flex: 1; min-width: 0; }
.rule-art figcaption { font-weight: 900; font-size: 12.5px; display: grid; justify-items: center; }
.rule-art figcaption i { font-style: normal; color: var(--leaf); letter-spacing: 1px; }
.rule-art.seeds img { width: 100%; max-width: 76px; height: auto; } /* ゲームのカードと同じ絵 */
.rule-art.hazards img { height: 52px; width: auto; max-width: 100%; object-fit: contain; }
.rule-text { margin: 0; font-size: 13.5px; line-height: 1.7; }
#rulesMore { margin: 2px auto 6px; }

/* ── アルバム（実績・設定・イラスト） ── */
.album-count { font-family: var(--body); font-weight: 900; font-size: 13px; color: var(--leaf); margin-left: 4px; }
.album-tabs button[aria-selected='true'] { background: var(--lime); }
.album-body { align-content: start; }
.ach { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; border: 2px solid #000; border-radius: 14px; padding: 8px 12px; background: #f2f2ea; color: #666; }
.ach.got { background: #fff; color: var(--ink); }
.ach-icon { font-size: 26px; text-align: center; }
.ach:not(.got) .ach-icon { opacity: 0.55; }
.ach-name { margin: 0; font-weight: 900; font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.ach-new { background: var(--red); color: #fff; border: 2px solid #000; border-radius: 999px; padding: 0 6px; font-family: var(--display); font-size: 10px; line-height: 15px; }
.ach-desc { margin: 1px 0 0; font-size: 12.5px; font-weight: 700; }
.ach-reward { margin: 3px 0 0; font-size: 11.5px; color: var(--leaf); font-weight: 700; }
.ach:not(.got) .ach-reward { color: #888; }
.ach-mark { font-size: 20px; font-weight: 900; color: var(--leaf); }
.lore .tip-body + .tip-body { margin-top: 6px; }
.lore.locked { background: #f2f2ea; color: #777; }
.album-body.art { grid-template-columns: 1fr 1fr; }
.art { position: relative; display: grid; grid-template-rows: 1fr auto; gap: 4px; padding: 6px; border: 2px solid #000; border-radius: 14px; background: #eef6dc; font: inherit; color: var(--ink); cursor: pointer; text-align: center; min-width: 0; }
.art.wide { grid-column: 1 / -1; }
.art img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.art.wide img { aspect-ratio: auto; height: auto; border-radius: 8px; } /* 横長の絵は切らずに全体を見せる */
.art span { font-weight: 900; font-size: 12.5px; line-height: 1.4; }
.art:hover { background: #f1ffd6; }
.art.locked { cursor: default; background: #e6e8e0; }
.art.locked img { filter: brightness(0); opacity: 0.18; }
.art.locked span { font-size: 11px; color: #666; font-weight: 700; }
.viewer { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-rows: 1fr auto auto; place-items: center; gap: 6px; padding: 16px; background: rgba(10, 14, 10, 0.94); cursor: zoom-out; animation: fade 0.2s ease; }
.viewer.hidden { display: none; }
.viewer-frame { width: 100%; height: 100%; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.viewer-frame img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer.can-zoom .viewer-frame img { cursor: zoom-in; }
/* 拡大：絵を大きくして、指でスクロールして見る */
.viewer.zoomed .viewer-frame { display: block; overflow: auto; -webkit-overflow-scrolling: touch; }
.viewer.zoomed .viewer-frame img { max-width: none; max-height: none; width: max(250%, 1400px); cursor: zoom-out; }
.viewer p { margin: 0; color: #fff; font-weight: 900; }
.viewer .viewer-hint { font-size: 12px; color: #aaa; font-weight: 700; }

/* 結果画面：新しく解除したもの */
.unlocks { background: #f1ffd6; border: 2px solid #000; border-radius: 14px; padding: 8px 10px; margin: 0 0 12px; box-shadow: 0 0 0 3px var(--lime); }
.unlocks-title { margin: 0 0 4px; font-family: var(--display); font-size: 14px; }
.unlocks-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; text-align: left; font-size: 13px; }
.unlocks-list li { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.unlocks-list .i { font-size: 16px; }
.unlocks-list .rw { font-size: 12px; color: var(--leaf); font-weight: 700; }

/* ── 音楽室 ── */
.music-card { grid-template-rows: auto 1fr auto; height: auto; max-height: calc(var(--app-h, 100dvh) - var(--ov-pt) - var(--ov-pb)); }
.songs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; overflow: auto; min-height: 0; align-content: start; }
.song { display: grid; grid-template-columns: 44px 1fr 24px; gap: 10px; align-items: center; border: 2px solid #000; border-radius: 14px; padding: 8px 12px; background: #fff; }
.song.on { background: #f1ffd6; box-shadow: 0 0 0 3px var(--lime); }
.song.locked { background: #eef0e8; border-style: dashed; }
.song.locked .song-btn { display: grid; place-items: center; background: #d9ddd2; box-shadow: none; cursor: default; }
.song.locked .song-title { color: #888; }
.song-btn { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #000; background: var(--lime); box-shadow: 0 3px 0 #000; font-size: 16px; font-weight: 900; cursor: pointer; color: var(--ink); padding: 0; }
.song-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.song-title { margin: 0; font-weight: 900; font-size: 15px; }
.song-scene { margin: 1px 0 0; font-size: 12px; color: #555; font-weight: 700; }
.eq { display: flex; gap: 2px; align-items: flex-end; height: 18px; visibility: hidden; }
.song.on .eq { visibility: visible; }
.eq i { width: 4px; background: var(--leaf); border-radius: 2px; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.3s; }
.eq i:nth-child(3) { animation-delay: -0.6s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 18px; } }
.music-artist { margin: 0; text-align: center; font-size: 12px; color: #555; font-weight: 700; line-height: 1.9; }
.music-artist a { display: inline-block; margin-top: 2px; padding: 3px 14px; border: 2px solid #000; border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; font-weight: 900; font-size: 13px; box-shadow: 0 2px 0 #000; }
.music-artist a:active { transform: translateY(1px); box-shadow: 0 1px 0 #000; }

/* ── はじめる前のルール説明（一枚絵の紙芝居） ── */
.intro { z-index: 30; background: rgba(10, 14, 10, 0.92); padding: 16px; }
.intro-box { position: relative; width: min(100%, 620px); display: grid; gap: 12px; padding-top: 34px; }
.intro-skip {
  position: absolute; top: 0; right: 0; z-index: 2;
  font: inherit; font-weight: 900; font-size: 13px;
  color: var(--paper); background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.5); border-radius: 999px;
  padding: 4px 12px; cursor: pointer;
}
.intro-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1578 / 996;
  overflow: hidden;
  border: 4px solid #000;
  border-radius: 20px;
  box-shadow: 0 6px 0 #000;
  background: #cfe9f7;
}
.intro-frame img {
  display: block; width: 100%; height: 100%; max-width: 100%;
  transform-origin: 0 0;
  transition: transform 1.3s cubic-bezier(.3, .7, .3, 1);
  will-change: transform;
}
.intro-card {
  background: var(--paper);
  color: var(--ink);
  border: 4px solid #000;
  border-radius: 20px;
  box-shadow: 0 6px 0 #000;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 15.5em; /* ページで高さが変わって絵が上下にずれないように */
}
.intro-card .intro-nav { margin-top: auto; }
.intro-text { margin: 0; font-weight: 900; font-size: 16px; line-height: 1.65; min-height: 3.3em; text-wrap: pretty; }
.intro-text b { color: var(--leaf); }
.intro-text.fade { animation: fade 0.35s ease; }
.intro-extra:empty { display: none; }
.intro-extra { display: flex; flex-wrap: wrap; gap: 6px; }
.intro-extra span { background: #eef6dc; border: 2px solid #000; border-radius: 999px; padding: 2px 10px; font-weight: 900; font-size: 13px; }
.intro-extra span i { font-style: normal; color: var(--leaf); letter-spacing: 1px; margin-left: 4px; }
.intro-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.intro-dots { display: flex; gap: 6px; }
.intro-dots i { width: 9px; height: 9px; border-radius: 50%; background: #cfd5c6; border: 1.5px solid #000; }
.intro-dots i.on { background: var(--lime); transform: scale(1.25); }
.intro-next { font-size: 20px; padding: 6px 26px; }
@media (prefers-reduced-motion: reduce) { .intro-frame img { transition: none; } }
/* 絶滅の危機（残り3以下）の個体数は赤く点滅 */
.counts .danger { color: var(--red); animation: dangerBlink 0.8s ease-in-out infinite; }
@keyframes dangerBlink { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .counts .danger { animation: none; } }

/* ── みんなのランキング ── */
.modes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 0; } /* minmax(0)：名前が長くても、つづきからの幅をはみ出さない */
.mode-btn { font: inherit; min-width: 0; display: grid; gap: 4px; justify-items: center; align-content: center; padding: 12px 8px; border: 4px solid #000; border-radius: 18px; box-shadow: 0 5px 0 #000; cursor: pointer; color: #000; }
.mode-btn.normal { background: var(--lime); }
.mode-tag { font-size: 10.5px; font-weight: 900; letter-spacing: 0.06em; color: #fff; background: #111411; border-radius: 999px; padding: 1px 10px; }
.mode-btn.daily { background: #ffd98a; }
.mode-btn:hover { filter: brightness(1.05); }
.mode-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #000; }
.mode-btn:disabled { opacity: 0.55; cursor: default; }
.mode-name { font-family: var(--display); font-size: 17px; white-space: nowrap; max-width: 100%; }
.mode-sub { font-size: 11.5px; font-weight: 700; line-height: 1.35; min-height: 1.35em; } /* 2026/10/11：タイトルのカードの下の行は1行だけ */
.mode-sub .nw, .nw { white-space: nowrap; }
#storySub { overflow: hidden; max-width: 100%; }
#storySub.fresh { color: #c0392b; } /* 新しいステージ */ /* 1行のまとまりは途中で折り返さない */
/* 文のまとまり（<wbr> の所）でだけ折り返す。言葉の途中で切れないように（2026/10/11 けいしさんの指示：不自然な改行はしない）。入りきらないときだけ、どこでも折り返す */
.phrase { word-break: keep-all; overflow-wrap: anywhere; }
@media (max-width: 380px) { .menu-links .tips-btn { font-size: 14px; letter-spacing: 0; } }
.daily-card { max-width: 400px; text-align: center; display: grid; gap: 8px; justify-items: center; }
.daily-date { margin: 0; font-family: var(--display); font-size: 14px; color: #8a5a00; }
.daily-theme { margin: 0; font-family: var(--display); font-size: 26px; display: flex; gap: 8px; align-items: center; }
.daily-icon { font-size: 34px; }
.daily-desc { margin: 0; font-weight: 700; font-size: 14px; }
.daily-list { margin: 4px 0; padding: 10px 12px; list-style: none; background: #fff6d6; border: 2px solid #000; border-radius: 14px; text-align: left; font-size: 12.5px; line-height: 1.6; display: grid; gap: 4px; }
.daily-tries { margin: 0; font-weight: 900; font-size: 13px; }
.rank-box { margin-top: 12px; }
.tab-row { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.rank-modes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; margin-bottom: 10px; }
.rank-modes button { font: inherit; font-weight: 900; font-size: 13px; white-space: nowrap; background: #fff; border: 3px solid #000; border-radius: 14px; box-shadow: 0 3px 0 #000; padding: 5px 2px 6px; cursor: pointer; color: var(--ink); display: grid; justify-items: center; gap: 1px; }
.rank-modes .i { font-size: 20px; line-height: 1.1; }
@media (min-width: 700px) { .rank-modes button { font-size: 15px; } }
.rank-modes button[aria-selected='true'] { background: var(--lime); }
.rank-modes button[data-mode='daily'][aria-selected='true'] { background: #ffd98a; }
.rank-modes button[data-mode='extra'][aria-selected='true'] { background: #d9ccff; }
.rank-tabs { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-bottom: 6px; }
.rank-weeks { margin: 6px 0 4px; display: grid; gap: 4px; }
.rank-weeks button { font: inherit; font-weight: 900; font-size: 12px; background: #fff; border: 2px solid #000; border-radius: 999px; padding: 2px 10px; cursor: pointer; color: var(--ink); }
.rank-weeks button[aria-selected='true'] { background: #8fe3ff; }
.rank-days { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; margin-bottom: 8px; } /* 2026/10/9：日付は縦に並べる（1行に日付と森） */
.rank-days button { font: inherit; display: flex; gap: 10px; align-items: center; justify-content: flex-start; text-align: left; background: #fff8e6; border: 2px solid #000; border-radius: 12px; padding: 6px 12px; cursor: pointer; color: var(--ink); }
.rank-days button[aria-selected='true'] { background: #ffd98a; }
.rank-days button[data-chapter] { background: #f3efff; }
.rank-days button[data-chapter][aria-selected='true'] { background: #d9ccff; }
.rank-days button.soon { background: #eee; color: #999; cursor: default; }
.rank-days .dd { font-weight: 900; font-size: 13px; flex: none; min-width: 5.5em; }
.rank-days .dt { font-weight: 700; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rank-day-head { margin: 0 0 6px; text-align: center; font-weight: 900; font-size: 15px; }
.rank-range { margin: 0; text-align: center; font-size: 12px; font-weight: 700; color: #555; }
.rank-tabs button { font: inherit; font-weight: 900; font-size: 12px; background: #eef6dc; border: 2px solid #000; border-radius: 999px; padding: 3px 10px; cursor: pointer; color: var(--ink); }
.rank-tabs button[aria-selected='true'] { background: var(--lime); }
.ranking li .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font-weight: 700; }
.ranking li:has(.nm) { grid-template-columns: 28px minmax(0, 1fr) auto; }
.rank-box .ranking { margin-top: 0; }
.ranking li:has(.nm) .d { display: none; }
.rank-note { margin: 6px 0 0; font-size: 12px; color: #555; }
.online { background: #e8f3ff; border: 2px solid #000; border-radius: 14px; padding: 8px 10px; margin: 0 0 12px; }
.online-title { margin: 0 0 6px; font-weight: 900; font-size: 13px; }
.online-row { display: flex; gap: 6px; }
.online-row input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 6px 10px; border: 2px solid #000; border-radius: 10px; background: #fff; color: var(--ink); }
.online-btn { font: inherit; font-weight: 900; font-size: 15px; padding: 6px 16px; border: 2px solid #000; border-radius: 10px; background: var(--lime); color: #000; cursor: pointer; box-shadow: 0 3px 0 #000; }
.online-btn:disabled, .online-row input:disabled { opacity: 0.55; cursor: default; }
.online-msg { margin: 0 0 6px; min-height: 1em; font-size: 13px; font-weight: 700; white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.online-hint { margin: 0 0 4px; font-size: 11.5px; color: #666; }
.online-msg:empty { display: none; }
.online-msg.err { color: #c0392b; }

/* ── テストモード（ロゴを5回タップ） ── */
.debug { position: fixed; left: 8px; bottom: 8px; z-index: 50; display: grid; gap: 6px; justify-items: start; max-width: calc(100vw - 16px); }
.debug[hidden] { display: none; }
.debug button { font: inherit; font-weight: 700; font-size: 12px; color: #fff; background: #2a3327; border: 1.5px solid #6b7a63; border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.debug button:hover { background: #3a4636; }
.debug button.on { background: #b8f23c; color: #000; border-color: #000; }
.debug-toggle { box-shadow: 0 2px 0 #000; }
.script-view { position: fixed; inset: 0; z-index: 80; overflow: auto; background: #fbfaf3; color: #222; font-size: 13px; line-height: 1.6; -webkit-overflow-scrolling: touch; }
.sc-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #2f4a1f; color: #fff; }
.sc-head button { background: #fff; color: #222; border: 2px solid #000; border-radius: 999px; padding: 2px 12px; font-weight: 900; }
.sc-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 12px; border-bottom: 1px solid #ddd; }
.sc-nav button { color: #2f4a1f; border: 1.5px solid #6b7a63; border-radius: 999px; background: #eef6dc; padding: 1px 10px; font-size: 12px; font-weight: 700; }
.sc-body { padding: 4px 14px 40px; max-width: 760px; margin: 0 auto; }
.sc-stage { border-bottom: 2px dashed #c9d6b4; padding: 10px 0 14px; }
.sc-stage h3 { margin: 6px 0; font-size: 17px; }
.sc-stage h3 small { margin-left: 8px; font-size: 12px; color: #6b7a63; font-weight: 700; }
.sc-h { margin: 10px 0 4px; font-weight: 900; color: #2f4a1f; }
.sc-h em { margin-left: 8px; font-style: normal; font-size: 12px; color: #a0522d; }
.sc-note { margin: 0 0 4px; font-size: 12px; color: #777; }
.sc-talk { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.sc-line { display: grid; grid-template-columns: 6.5em auto 1fr; gap: 6px; align-items: baseline; padding: 3px 6px; border-radius: 8px; background: #fff; border: 1px solid #e6e6dc; }
.sc-line b { font-size: 12px; }
.sc-line i { font-style: normal; font-size: 10px; color: #888; }
.sc-line.eco b { color: #3d8a1f; }
.sc-line.koyomi b { color: #6b4fbf; }
.sc-line.say { grid-template-columns: 7.5em 1fr; background: #f5f9ee; }
.fl-rules { margin: 4px 0 8px; padding-left: 1.2em; font-size: 12px; color: #444; }
.fl-table { width: 100%; border-collapse: collapse; font-size: 12px; background: #fff; }
.fl-table th, .fl-table td { border: 1px solid #e0e4d6; padding: 4px 6px; text-align: left; vertical-align: top; }
.fl-table thead th { background: #eef6dc; font-size: 11px; }
.fl-table tbody th { white-space: nowrap; background: #f7f9f2; }
.fl-table th small { display: block; font-size: 10px; color: #a0522d; font-weight: 700; }
.fl-table tr.last th, .fl-table tr.last td { background: #fff6d6; }
.fl-rand { color: #999; }
.debug-panel { width: min(380px, calc(100vw - 16px)); max-height: 55vh; overflow: auto; background: rgba(12, 18, 10, 0.94); border: 2px solid #6b7a63; border-radius: 14px; padding: 8px 10px 10px; }
.debug-h { margin: 6px 0 4px; font-size: 11px; font-weight: 900; color: #b8f23c; }
.debug-row { display: flex; flex-wrap: wrap; gap: 4px; }

/* 見せ場をシェア */
.pill-btn.share { background: var(--lime); }
.pill-btn.share[hidden] { display: none; }
.share-card { width: min(100%, 420px); display: grid; gap: 10px; justify-items: center; }
.share-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.share-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 20px; }
.share-preview { width: min(100%, 300px); aspect-ratio: 4 / 5; border: 3px solid #000; border-radius: 14px; overflow: hidden; background: #121712; display: grid; place-items: center; }
.share-preview img, .share-preview video { width: 100%; height: 100%; object-fit: contain; display: block; }
.share-preview.loading::after { content: ''; width: 34px; height: 34px; border-radius: 50%; border: 4px solid rgba(184, 242, 60, 0.25); border-top-color: var(--lime); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.share-status { margin: 0; min-height: 1.2em; font-weight: 900; font-size: 13px; }
.share-card .big-btn { width: 100%; max-width: 260px; }
.share-card .big-btn[hidden] { display: none; }
.share-card .big-btn:disabled, .share-card .pill-btn:disabled { opacity: 0.45; cursor: default; }
.share-note { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.5; }
@media (max-height: 640px) { .share-preview { width: min(100%, 220px); } }

/* 結果画面：タブレット・パソコンでは広く、字も大きく */
@media (min-width: 600px) {
  .result { width: min(100%, 540px); padding: 18px 24px 0; }
  .collapsed { font-size: 26px; }
  .final-score { font-size: 60px; }
  .rank-line { font-size: 15px; }
  .stats { font-size: 14px; gap: 6px 18px; }
  .what-title, .advice-title { font-size: 15px; }
  .chain { font-size: 24px; }
  .what-text, .advice-text { font-size: 15px; }
  .what-term, .advice-env { font-size: 13px; }
  .what.real .advice-text { font-size: 14px; }
  #popChart { height: 240px; }
  .pop-read { font-size: 13.5px; }
  .pop-notes { font-size: 14px; }
  .online-title, .online-msg { font-size: 14px; }
  .result .pill-btn { font-size: 15px; padding: 6px 18px; }
  .result-actions .big-btn { max-width: 300px; }
}
@media (min-width: 900px) and (min-height: 800px) {
  .result { width: min(100%, 620px); }
  #popChart { height: 280px; }
}

/* ── 中断と再開 ── */
.resume-btn { display: grid; gap: 2px; justify-items: center; width: 100%; box-sizing: border-box; margin: 0 0 10px; font: inherit; color: #000; background: #8fe3ff; border: 4px solid #000; border-radius: 18px; box-shadow: 0 5px 0 #000; padding: 8px 12px; cursor: pointer; }
.resume-name { font-family: var(--display); font-size: 19px; }
.resume-btn .mode-sub { min-height: 0; }
.resume-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #000; }
.pause-card { display: grid; gap: 12px; justify-items: center; max-width: 320px; }
.pause-title { font-family: var(--display); font-size: 28px; margin: 0; }
.pause-note { font-size: 12px; font-weight: 700; color: #4a5a40; margin: 0; }

/* ── 結果：見つけた 自然のしくみ ── */
.finds { background: #e6f4ff; border: 2px solid #000; border-radius: 14px; padding: 8px 10px; margin-bottom: 12px; }
#findList { display: grid; gap: 8px; }
.find { background: #fff; border: 2px solid #000; border-radius: 12px; padding: 8px 10px; text-align: left; }
.find-title { font-weight: 900; font-size: 14px; margin: 0 0 4px; }
.find-text { font-size: 12.5px; line-height: 1.6; margin: 0 0 6px; }
@media (min-width: 700px) { .find-text { font-size: 14px; } }

/* ── 📒 森の記録 ── */
.records-body { text-align: left; }
.records-body { align-content: start; }
.records-body h3 { font-size: 15px; margin: 4px 0 6px; }
.rc-lead { font-size: 13px; line-height: 1.6; margin: 0 0 8px; color: #4a5a40; }
.rc-count { font-weight: 900; margin: 0 0 10px; text-align: center; }
.rc-count b { font-family: var(--display); font-size: 22px; color: #3d6b1f; }
/* スタンプのボード：一枚絵の上をブロックがおおう（こわれると下の絵が見える）。仮版・テストモードだけ */
.rc-draft { margin: 0 0 8px; padding: 4px 10px; border-radius: 8px; background: #fff3c4; font-size: 12px; font-weight: 700; text-align: center; }
.zk-summary { margin: 8px 0; border: 2px solid #9ec27a; border-radius: 12px; background: #f4fbe9; padding: 6px 10px; }
.zk-summary summary { cursor: pointer; font-weight: 900; font-size: 13px; color: #2e6b1a; }
.zk-summary dl { margin: 6px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; font-size: 12.5px; line-height: 1.5; }
.zk-summary dt { font-weight: 900; color: #4a6a30; white-space: nowrap; }
.zk-summary dd { margin: 0; }
.zk-summary ul { margin: 6px 0 0; padding-left: 1.2em; font-size: 12.5px; line-height: 1.5; }
.zk-summary .zk-card-more { margin-top: 6px; }
.board-sec { margin-bottom: 14px; }
.board { position: relative; display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-template-rows: repeat(var(--rows), 1fr); background: #233 center / cover no-repeat; border: 3px solid #000; border-radius: 14px; overflow: hidden; box-shadow: 0 4px 0 #000; }
/* まだ出会っていない神さま（コヨミ・ハザマ）は、絵のその部分を黒いシルエットでかくす（2026/10/12）。ブロックがこわれた所だけ、見える */
.board-hide { position: absolute; z-index: 0; display: grid; place-items: center; pointer-events: none; border-radius: 45%; background: radial-gradient(ellipse at 50% 40%, rgba(40, 24, 70, 0.96) 55%, rgba(20, 10, 40, 0) 100%); -webkit-backdrop-filter: brightness(0) blur(5px); backdrop-filter: brightness(0) blur(5px); }
.board-hide b { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 9vw, 56px); color: rgba(200, 170, 255, 0.75); }
.blk { z-index: 1; position: relative; display: grid; place-items: center; padding: 0; font: inherit; font-size: clamp(14px, 4.4vw, 22px); color: #fff; background: linear-gradient(145deg, #8bc34a, #5d8f2b); border: 0; outline: 1px solid rgba(0, 0, 0, 0.55); box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.35), inset -2px -2px 0 rgba(0, 0, 0, 0.25); cursor: pointer; transition: opacity 0.2s; }
.blk:nth-child(odd) { background: linear-gradient(145deg, #9ccc5a, #6a9c34); }
.blk span { filter: drop-shadow(0 1px 0 #000); opacity: 0.85; }
.blk.gift { background: linear-gradient(145deg, #ffd54f, #e0a21a); }
.blk.star { background: linear-gradient(145deg, #7e8b9a, #56616d); cursor: default; font-size: 14px; }
.blk.broken { background: transparent; box-shadow: none; outline-color: rgba(255, 255, 255, 0.12); }
.blk.broken.sel, .blk.sel { outline: 3px solid #ffd23c; outline-offset: -3px; z-index: 1; }
.blk.breaking { z-index: 3; animation: blk-burst 0.3s ease-out var(--delay, 0s) both; }
.blk.breaking span { animation: blk-pop 0.7s ease-out var(--delay, 0s) both; }
/* ブロックがつぶれて光り、バラバラのかけらになって飛び散る */
.blk .shard { position: absolute; left: 50%; top: 50%; width: var(--sz); height: var(--sz); margin: calc(var(--sz) / -2 * 1) 0 0 calc(var(--sz) / -2 * 1); background: var(--sc); box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.35); clip-path: polygon(10% 0, 100% 25%, 80% 100%, 0 80%); opacity: 0; pointer-events: none; animation: blk-shard 0.8s cubic-bezier(0.15, 0.7, 0.4, 1) var(--delay, 0s) both; }
@keyframes blk-shard { 0% { opacity: 0; transform: none; } 6% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: translate(var(--sx), var(--sy)) rotate(var(--sr)) scale(0.35); } }
@keyframes blk-burst {
  0% { background: linear-gradient(145deg, #8bc34a, #5d8f2b); transform: none; opacity: 1; }
  45% { background: linear-gradient(145deg, #fff59d, #ffd54f); transform: scale(1.18); box-shadow: 0 0 14px 4px rgba(255, 235, 120, 0.9); opacity: 1; }
  100% { background: transparent; transform: scale(1.3); box-shadow: none; opacity: 0; }
}
@keyframes blk-pop { 0% { transform: scale(1); opacity: 0.9; } 25% { transform: scale(1.7); opacity: 1; } 100% { transform: scale(0.4); opacity: 0; } }
.board:has(.breaking) { overflow: visible; }
.bonus-lead { margin: 10px 0 4px; font-size: 12.5px; font-weight: 700; }
.bonus-lead small { font-weight: 400; color: #6a6f63; }
.bonus-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; }
.bonus { display: flex; gap: 8px; align-items: center; padding: 6px 8px; font: inherit; text-align: left; border: 2px dashed #9a9a8a; border-radius: 12px; background: #f1f1e8; color: #6a6f63; cursor: default; }
.bonus.got { border: 2px solid #b8860b; background: linear-gradient(145deg, #fff3b0, #ffd54f); color: #3a2a00; cursor: pointer; }
.bonus.sel { outline: 3px solid #3d6b1f; outline-offset: 1px; }
.bonus-icon { flex: none; font-size: 20px; }
.bonus-txt { min-width: 0; }
.bonus-txt b { display: block; font-size: 12.5px; }
.bonus-txt small { display: block; font-size: 10.5px; line-height: 1.35; }
.bonus-card { margin-top: 8px; padding: 10px 12px; border: 2px solid #b8860b; border-radius: 12px; background: #fffbe6; text-align: left; }
.bonus-card h4 { margin: 0 0 4px; font-size: 14px; }
.bonus-card p { margin: 4px 0; font-size: 12.5px; line-height: 1.7; }
.board.done { box-shadow: 0 0 0 3px #ffd23c, 0 4px 0 #000; }
.blk-detail { display: flex; gap: 8px; align-items: center; margin-top: 8px; padding: 8px 10px; border: 2px dashed #8a8; border-radius: 12px; background: #f6f6ee; text-align: left; }
.blk-detail.got { border-style: solid; border-color: #3d6b1f; background: #f1ffd6; }
.blk-detail-icon { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: #fff; border: 2px dashed #3d6b1f; }
.blk-detail > span:nth-child(2) { flex: 1; min-width: 0; }
.blk-detail b { display: block; font-size: 13px; }
.blk-detail small { display: block; font-size: 11.5px; color: #4a5a40; line-height: 1.4; }
.blk-detail .tips-btn.small { margin: 0; flex: none; }
.blk-hint { margin: 6px 0 0; font-size: 11.5px; color: #6a6f63; text-align: center; }
@media (prefers-reduced-motion: reduce) { .blk.breaking, .blk.breaking span { animation-duration: 0.01s; } }
.stamp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.stamp { display: grid; grid-template-columns: 36px 1fr; gap: 6px; align-items: center; text-align: left; font: inherit; color: var(--ink); background: #f1ffd6; border: 2.5px solid #000; border-radius: 12px; box-shadow: 0 3px 0 #000; padding: 6px 8px; cursor: pointer; min-height: 52px; }
.stamp:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.stamp-icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; background: #fff; border: 2px dashed #3d6b1f; }
.stamp-name { font-weight: 900; font-size: 12.5px; line-height: 1.3; }
.stamp.locked { background: #eee; border-style: dashed; box-shadow: none; cursor: default; }
.stamp.locked .stamp-icon { border-color: #aaa; color: #999; font-weight: 900; }
.stamp-hint { font-size: 11px; line-height: 1.4; color: #666; }
.rc-list { margin: 0; display: grid; gap: 4px; font-size: 13px; }
.rc-list div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1.5px dashed #ccc; padding-bottom: 3px; }
.rc-list dt { color: #555; }
.rc-list dd { margin: 0; font-weight: 900; text-align: right; font-variant-numeric: tabular-nums; }
/* しくみの項目・結果画面：見つけたスタンプの印 */
.tip-stamp { display: inline-block; margin-left: 6px; font-size: 15px; vertical-align: middle; }
.find-new { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 900; color: #fff; background: #e0533d; border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.find-more { font-size: 12.5px; line-height: 1.6; margin: 8px 0 0; text-align: left; }
.rc-note { margin-top: 14px; background: #fff6d6; border: 2px solid #000; border-radius: 14px; padding: 10px 12px; font-size: 12.5px; line-height: 1.65; }
.rc-note b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.records-body h3 small { font-family: system-ui, sans-serif; font-size: 12px; color: #666; margin-left: 4px; }
.stamp.got { cursor: default; }
.stamp-name small { display: block; font-weight: 700; font-size: 10.5px; color: #4a5a40; margin-top: 2px; }
#retryBtn.long { font-size: 20px; white-space: nowrap; padding-left: 16px; padding-right: 16px; }

/* ── コヨミのお題 ── */
.mode-btn.extra { grid-column: 1 / -1; position: relative; background: #d9ccff; padding: 10px 8px; }
.mode-btn.extra .mode-sub { min-height: 0; }
.odai-card { width: min(100%, 420px); max-width: 420px; display: grid; gap: 10px; justify-items: center; text-align: center; }
.odai-head { font-family: var(--display); font-size: 22px; margin: 0; }
.odai-lead { margin: 0; font-size: 12.5px; font-weight: 700; line-height: 1.6; color: #555; }
.odai-chapter { width: 100%; box-sizing: border-box; text-align: left; border: 3px solid #000; border-radius: 16px; padding: 10px 12px; background: #fff; display: grid; gap: 8px; }
.odai-chapter.locked { background: #f1f1f1; color: #888; }
.odai-chapter h3 { margin: 0; font-family: var(--display); font-size: 17px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.odai-chapter h3 small { font-family: system-ui, sans-serif; font-weight: 700; font-size: 11.5px; color: #6a5acd; }
.odai-best { margin: 0; font-size: 12.5px; font-weight: 900; }
.odai-best .clear { color: #2f7d1e; }
#odaiList { width: 100%; display: grid; gap: 8px; }
.talk-skip-all { position: absolute; top: -16px; right: 14px; z-index: 3; font: inherit; font-weight: 900; font-size: 12px; color: var(--ink); background: #fff; border: 3px solid #000; border-radius: 999px; box-shadow: 0 3px 0 #000; padding: 2px 12px; cursor: pointer; }
.talk-skip-all[hidden] { display: none; }
.talk-replay { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.talk-replay[hidden] { display: none; }
.talk-replay button { font: inherit; font-weight: 900; font-size: 13px; color: var(--ink); border: 3px solid #000; border-radius: 999px; box-shadow: 0 3px 0 #000; padding: 4px 14px; cursor: pointer; background: #fff; }
.talk-replay .talk-skip { background: var(--lime); }
.odai-replay { width: 100%; font: inherit; font-weight: 900; font-size: 15px; color: #fff; background: #6a5acd; border: 3px solid #000; border-radius: 14px; box-shadow: 0 4px 0 #000; padding: 8px 12px; cursor: pointer; }
.odai-replay:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.talk-act { margin: -2px 0 6px; font-family: var(--display); font-size: 13px; color: #fff; background: #6a5acd; border: 2px solid #000; border-radius: 999px; padding: 1px 12px; justify-self: start; display: inline-block; }
.sp-card.banned { opacity: 0.35; filter: grayscale(1); }
.sp-card.unknown .e { font-family: var(--display); font-size: 26px; color: #888; }
.talk { align-items: end; z-index: 30; background: linear-gradient(rgba(20, 14, 50, 0.55), rgba(10, 8, 30, 0.85)); cursor: pointer; }
.talk-scene { width: min(100%, 520px); margin-bottom: 18px; display: grid; }
/* 立ち絵：左にエコ、右にコヨミ。話している方を明るく前に、聞いている方は少し暗く */
.talk-stage { position: relative; height: min(52vh, 420px); pointer-events: none; }
.talk-chara { position: absolute; bottom: -34px; height: 100%; max-width: 62%; object-fit: contain; object-position: bottom; opacity: 0; transition: opacity 0.25s, filter 0.25s, transform 0.25s; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45)); }
.talk-chara.eco { left: -4%; }
.talk-chara.koyomi { right: -4%; }
/* ハザマの絵は、ふくらんだ髪で横に広いので、ほかのキャラより少し広い幅（72%）までにして、エコと同じくらいの大きさに（2026/10/9・10/12） */
.talk-chara.koyomi.hazama { max-width: 72%; height: 100%; right: -6%; } /* 2026/10/12：幅でおさえる（前は max-width なしで、スマホでは画面いっぱいになっていた） */
.talk-chara.on { opacity: 1; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45)) brightness(0.5); transform: scale(0.94); transform-origin: bottom center; }
.talk-chara.on.speak { filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5)); transform: scale(1); z-index: 1; }
.talk-box { position: relative; z-index: 2; color: var(--ink); background: var(--paper); border: 4px solid #000; border-radius: 18px; box-shadow: 0 6px 0 #000; padding: 10px 14px 8px; }
.talk-name { margin: 0 0 4px; font-family: var(--display); font-size: 15px; color: #6a5acd; }
.talk-name.eco { color: #3d6b1f; }
.talk-name.hazama { color: #8a4fd6; }
.talk-text { margin: 0; font-size: 15px; line-height: 1.7; font-weight: 700; height: 3.4em; overflow: hidden; } /* 2行ぶんで固定（枠が動かないように） */
.talk-hint { margin: 4px 0 0; text-align: right; font-size: 11px; color: #888; opacity: 0; transition: opacity 0.2s; }
.talk.ready .talk-hint { opacity: 1; animation: hintBob 1s ease-in-out infinite; }
@keyframes hintBob { 50% { transform: translateX(3px); } }

/* ─── ストーリーモードのマップ（1本の道。下がスタート、上へ進む） ─── */
.endless-row { display: flex; gap: 8px; margin-top: 10px; align-items: stretch; }
.endless-row[hidden] { display: none; }
.endless-row .mode-btn { flex: 1 1 0; min-width: 0; margin-top: 0; padding: 10px 2px; }
.endless-row .endless-rank { width: 54px; }
.endless-row .mode-btn.endless { margin-top: 0; }
.endless-row .mode-name { font-size: 12px; letter-spacing: -0.04em; }
.endless-row .mode-btn.free .mode-name { font-size: 11px; letter-spacing: -0.06em; }
.endless-row .mode-tag { font-size: 9.5px; padding: 1px 7px; }
.endless-row .mode-sub { font-size: 10.5px; display: grid; justify-items: center; }
.endless-row [hidden] { display: none; }
.endless-rank { flex: none; width: 64px; font: inherit; font-weight: 900; font-size: 22px; line-height: 1.1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 2px solid #000; border-radius: 14px; background: #fff3c4; color: #000; cursor: pointer; box-shadow: 0 3px 0 #000; }
.endless-rank span { font-size: 10px; white-space: nowrap; }
.online-rank { display: block; margin: 8px auto 0; }
.mode-btn.endless { width: 100%; margin-top: 10px; background: linear-gradient(135deg, #c9f0ff, #d9ccff); } /* エンドレスチャレンジ：ストーリー・きょうの森の下に、横いっぱい */
.mode-btn.story { position: relative; background: linear-gradient(135deg, #ffd0e4, #ffe9b8); } /* 余白はきょうの森と同じ（左右で文字の位置をそろえる） */
.map-card { width: min(100%, 460px); max-width: 460px; display: grid; gap: 8px; text-align: center; height: calc(var(--app-h, 100dvh) - var(--ov-pt) - var(--ov-pb)); max-height: 860px; grid-template-rows: auto minmax(0, 1fr) auto; padding: 10px; background: linear-gradient(rgba(16, 32, 18, 0.82), rgba(16, 32, 18, 0.9)), url('../../assets/bg.jpg') center / cover; border-color: #0c1a0e; }
/* 上の見出し：木の札（いま見ている章） */
.map-banner { position: relative; display: grid; gap: 0; text-align: left; padding: 9px 16px 11px 18px; border-radius: 14px; color: #fff8e6; border: 3px solid #4a2e12; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), 0 5px 0 #2c1a08; text-shadow: 0 2px 0 rgba(60, 30, 5, 0.6); background: repeating-linear-gradient(176deg, rgba(0, 0, 0, 0) 0 9px, rgba(70, 40, 10, 0.12) 9px 11px), linear-gradient(#b67d45, #8d5a2b); transition: filter 0.3s; }
.map-banner small { font-weight: 900; font-size: 12px; opacity: 0.85; letter-spacing: 0.06em; }
.map-banner b { font-family: var(--display); font-size: 20px; font-weight: 400; }
.map-banner.z2 { background: repeating-linear-gradient(176deg, rgba(0, 0, 0, 0) 0 9px, rgba(70, 40, 10, 0.12) 9px 11px), linear-gradient(#9a6a4e, #74472f); } /* 見出しの顔の色を変えないよう、filter ではなく色で（2026/10/11） */
.map-banner.z3 { background: repeating-linear-gradient(176deg, rgba(0, 0, 0, 0) 0 9px, rgba(20, 0, 40, 0.15) 9px 11px), linear-gradient(#6b4a9a, #3e2466); border-color: #24123d; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), 0 5px 0 #170a29; }
/* 札にからまる草 */
.map-leaf { position: absolute; right: -8px; bottom: -10px; width: 70px; height: 54px; background: url('../../assets/species/grass.webp') center / contain no-repeat; pointer-events: none; }
.map-path { position: relative; width: 100%; min-height: 240px; overflow-y: auto; overflow-x: hidden; border-radius: 18px; border: 3px solid #0c1a0e; scrollbar-width: none; overscroll-behavior: contain; }
.map-path::-webkit-scrollbar { display: none; }
.map-world { position: relative; width: 100%; overflow: hidden; }
/* 章ごとの景色 */
.map-zone { position: absolute; left: 0; right: 0; }
.map-zone.z1 { background: radial-gradient(ellipse at 50% 50%, rgba(255, 255, 220, 0.18), transparent 70%), url('../../assets/field-tile.webp') center / 680px; }
.map-zone.z2 { background: linear-gradient(rgba(70, 40, 110, 0.45), rgba(120, 70, 30, 0.35)), url('../../assets/field-tile.webp') center / 680px; filter: sepia(0.5) saturate(0.9); }
.map-zone.z3 { overflow: hidden; background: radial-gradient(circle at 50% 50%, rgba(255, 214, 120, 0.55), rgba(150, 80, 220, 0.5) 18%, rgba(60, 22, 110, 0.85) 55%, #12082a 85%); }
/* EX（ハザマ）：空間転移の渦（ui/swirl.js と同じ色）。ゆっくり回る（2026/10/11） */
.map-zone.z3::before { content: ''; position: absolute; left: 50%; top: 50%; width: 900px; height: 900px; margin: -450px 0 0 -450px; background: url('../../assets/terrain/map-swirl.svg') center / contain no-repeat; animation: mapSwirl 28s linear infinite; }
.map-zone.z3::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(255, 245, 210, 0.55), transparent 22%); }
@keyframes mapSwirl { to { transform: rotate(-360deg); } }
@media (prefers-reduced-motion: reduce) { .map-zone.z3::before { animation: none; } }
.map-banner-face { height: 1.9em; width: auto; vertical-align: -0.55em; margin: -0.5em 6px -0.2em 0; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35)); } /* 神さまの立ち絵（2026/10/11） */
.map-banner-face.sil, .map-dot img.stand.sil, .staff-cast img.sil, .staff-animals img.sil { filter: brightness(0) drop-shadow(0 0 3px rgba(255, 255, 255, 0.35)); opacity: 0.8; } /* まだ出会っていない神さまは、シルエット */
/* 2つ目からの景色：下のふちを ゆるい波の形に（ひとつ前の景色に重ねる。storymap.js の SEAM） */
.map-zone.seam {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 34' preserveAspectRatio='none'%3E%3Cpath d='M0 0H160V16C140 30 122 32 104 22S70 4 52 12 18 32 0 20Z'/%3E%3C/svg%3E") bottom left / 160px 34px repeat-x, linear-gradient(#000, #000) top / 100% calc(100% - 33px) no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 34' preserveAspectRatio='none'%3E%3Cpath d='M0 0H160V16C140 30 122 32 104 22S70 4 52 12 18 32 0 20Z'/%3E%3C/svg%3E") bottom left / 160px 34px repeat-x, linear-gradient(#000, #000) top / 100% calc(100% - 33px) no-repeat;
}
.map-dot img.stand { width: auto; height: 74px; margin-top: -26px; } /* 神さまの立ち絵（コヨミ・ハザマ。2026/10/11） */
.map-node.boss .map-dot img.stand { height: 84px; margin-top: -30px; }
.map-seam { position: absolute; transform: translate(-50%, 50%); pointer-events: none; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.3)); }
.map-seam img { display: block; width: 34px; height: auto; }
.map-seam.r img { transform: scaleX(-1); }
.map-seam.em { font-size: 15px; opacity: 0.9; }
.map-zone.locked { filter: grayscale(0.7) brightness(0.65) blur(1px); }
.map-zone.z3.locked { filter: none; }
.map-deco { position: absolute; transform: translate(-50%, 50%); font-size: 22px; pointer-events: none; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.25)); }
.map-deco img { display: block; width: 46px; height: auto; }
.map-deco.r img { transform: scaleX(-1); }
.map-fly { position: absolute; font-size: 18px; pointer-events: none; animation: mapFly 9s ease-in-out infinite; }
.map-fly.f2 { width: 7px; height: 7px; border-radius: 50%; background: #fff7a8; box-shadow: 0 0 10px 4px rgba(255, 240, 120, 0.7); animation-duration: 6s; }
.map-fly.f3 { display: none; }
/* けもの道 */
.map-road { position: absolute; left: 0; bottom: 0; width: 100%; pointer-events: none; }
.map-road path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.road-edge { stroke: rgba(80, 50, 20, 0.55); stroke-width: 34; }
.road-dirt { stroke: #c9a06a; stroke-width: 26; }
.road-step { stroke: #a77d48; stroke-width: 6; stroke-dasharray: 1 16; }
/* 章のさかいめ：さくと木の札 */
.map-line { position: absolute; left: 0; right: 0; height: 30px; transform: translateY(50%); display: grid; place-items: center; background: linear-gradient(transparent 7px, #8d5a2b 7px 11px, #4a2e12 11px 12px, transparent 12px 18px, #8d5a2b 18px 22px, #4a2e12 22px 23px, transparent 23px), repeating-linear-gradient(90deg, transparent 0 26px, #a06a35 26px 33px, #4a2e12 33px 34px, transparent 34px 40px); z-index: 2; pointer-events: none; }
.map-line span { font-weight: 900; font-size: 13px; color: #fff8e6; padding: 3px 14px; border-radius: 8px; border: 2px solid #4a2e12; background: linear-gradient(#b67d45, #8d5a2b); box-shadow: 0 3px 0 #2c1a08; text-shadow: 0 1px 0 rgba(60, 30, 5, 0.6); }
/* ステージ：切りかぶ（上は葉っぱの色、横は木の幹） */
.map-node { position: absolute; transform: translate(-50%, 50%); font: inherit; background: none; border: 0; padding: 0; cursor: pointer; z-index: 3; -webkit-tap-highlight-color: transparent; }
.map-dot { --c1: #c8f58a; --c2: #74c847; --d: #7a4a1e; position: relative; width: 78px; height: 68px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; line-height: 1; background: radial-gradient(ellipse at 50% 42%, var(--c1) 0 32%, var(--c2) 33% 100%); border: 3px solid #3d250c; box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.18), inset 0 -5px 0 rgba(0, 0, 0, 0.1), 0 10px 0 var(--d), 0 10px 0 3px #3d250c, 0 14px 8px 3px rgba(0, 0, 0, 0.35); transition: transform 0.08s, box-shadow 0.08s; }
.map-dot img { width: 56px; height: 56px; object-fit: contain; margin-top: -14px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.25)); }
.map-dot em { font-style: normal; font-family: var(--display); color: #3d250c; }
.map-node.next { z-index: 4; }
.map-node.sel { z-index: 5; }
.map-node:active .map-dot { transform: translateY(6px); box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.18), 0 4px 0 var(--d), 0 4px 0 3px #3d250c; }
.map-node.z2 .map-dot { --c1: #f4dca0; --c2: #c99a52; }
.map-node.done .map-dot { --c1: #fff3a0; --c2: #ffc93c; }
.map-node.lock .map-dot { --c1: #a9aca6; --c2: #80847d; --d: #565a52; border-color: #33362f; box-shadow: 0 10px 0 var(--d), 0 10px 0 3px #33362f; }
.map-node.lock .map-dot em { font-size: 22px; opacity: 0.85; }
.map-node.boss .map-dot { width: 92px; height: 80px; }
.map-node.boss .map-dot img { width: 68px; height: 68px; }
.map-dot i { position: absolute; right: -8px; top: -10px; font-style: normal; font-size: 22px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.3)); }
/* そのステージの自分のベスト */
.map-score { position: absolute; left: 50%; top: calc(100% + 14px); transform: translateX(-50%); font-weight: 900; font-size: 11.5px; color: #fff8e6; background: rgba(61, 37, 12, 0.82); border-radius: 999px; padding: 1px 9px; white-space: nowrap; pointer-events: none; z-index: 1; }
/* 葉っぱ3まい（取っていないものは うすい） */
.map-score { display: grid; justify-items: center; gap: 0; line-height: 1.3; }
.map-leaves { font-size: 15px; letter-spacing: -1px; }
.map-leaves b, .map-goals b { font-weight: 900; color: #c9c6b8; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); }
.map-leaves b.on, .map-goals li.on b { color: #ffc61a; text-shadow: 0 0 0 #000, 0 1px 0 #8a5a00; }
.map-goals { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 1px; font-size: 12.5px; font-weight: 700; }
.map-goals li { color: #8d8b83; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* ステージの WAVE 数（タイトルの右） */
.map-stage { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.map-badge { font-family: var(--display); font-size: 12px; font-weight: 400; color: #fff; background: #e0874b; border: 2px solid #3d250c; border-radius: 999px; padding: 1px 10px; box-shadow: 0 2px 0 #3d250c; white-space: nowrap; }
.map-goals li.on { color: #2f6b1a; }
.map-goals b { margin-right: 4px; }
/* 根もとの草 */
.map-tuft { position: absolute; left: 50%; bottom: -20px; width: 120px; height: 40px; transform: translateX(-50%); background: url('../../assets/species/grass.webp') 0 100% / 40px auto no-repeat, url('../../assets/species/grass.webp') 100% 100% / 34px auto no-repeat; pointer-events: none; }
.map-node.boss .map-tuft { width: 136px; }
.map-node.lock .map-tuft, .map-node.z3 .map-tuft { filter: grayscale(1) brightness(0.6); }
/* いま進めるステージ：光の輪と、そばにエコ */
.map-node.next .map-dot::after, .map-node.sel .map-dot::after { content: ''; position: absolute; inset: -12px -12px -22px; border-radius: 50%; border: 6px solid rgba(255, 250, 200, 0.55); animation: mapGlow 1.6s ease-in-out infinite; }
.map-node.sel .map-dot::after { border-color: rgba(255, 255, 255, 0.85); animation: none; }
.map-eco { position: absolute; bottom: -10px; width: 58px; height: auto; pointer-events: none; filter: drop-shadow(0 4px 2px rgba(0, 0, 0, 0.35)); animation: mapHop 1.4s ease-in-out infinite; }
.map-eco.l { right: calc(100% + 8px); }
.map-eco.r { left: calc(100% + 8px); transform: scaleX(-1); animation-name: mapHopR; }
.map-here { position: absolute; left: 50%; bottom: calc(100% + 18px); transform: translateX(-50%); font-family: var(--display); font-size: 13px; color: #3d7a1e; background: #fffaf0; border: 2px solid #3d250c; border-radius: 12px; padding: 4px 12px; white-space: nowrap; animation: mapBob 1.1s ease-in-out infinite; box-shadow: 0 3px 0 #3d250c; }
.map-here::after { content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border: 7px solid transparent; border-top-color: #3d250c; }
.map-node.boss .map-here { bottom: calc(100% + 20px); }
/* 吹き出し：葉っぱ色のふち */
.map-pop { position: absolute; left: 12px; right: 12px; z-index: 6; display: grid; gap: 5px; text-align: left; padding: 13px 16px 15px; border-radius: 18px; background: #fffaf0; color: #3b2a12; border: 3px solid #3d250c; box-shadow: inset 0 0 0 4px #b8e07a, 0 6px 0 #3d250c; animation: mapPop 0.15s ease-out; }
.map-pop::before { content: ''; position: absolute; bottom: 100%; left: clamp(20px, calc(var(--ax) - 14px), calc(100% - 46px)); border: 13px solid transparent; border-bottom-color: #3d250c; }
.map-pop.z2 { box-shadow: inset 0 0 0 4px #e8c98a, 0 6px 0 #3d250c; }
.map-pop.lock { background: #e9e8e2; color: #6b6a63; box-shadow: inset 0 0 0 4px #cfcdc4, 0 6px 0 #3d250c; }
.map-stage { margin: 0; font-size: 17px; font-weight: 900; }
.map-sub { margin: 0; font-size: 13px; font-weight: 700; opacity: 0.85; }
.map-best { margin: 0; font-size: 12.5px; font-weight: 900; color: #3d7a1e; }
.map-btns { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-top: 4px; }
.map-pop .big-btn { margin: 0; width: 100%; font-size: 18px; padding: 6px 16px; box-sizing: border-box; background: linear-gradient(#8fe05a, #5cb83a); color: #fff; border: 3px solid #3d250c; box-shadow: 0 5px 0 #3d250c; text-shadow: 0 2px 0 rgba(30, 70, 10, 0.5); }
.map-pop.z2 .big-btn { background: linear-gradient(#e6b86a, #c38a3c); }
.map-pop.lock .big-btn { background: #cfcdc4; color: #8d8b83; box-shadow: none; border-color: #b5b3aa; text-shadow: none; margin-top: 6px; }
.map-btns .odai-replay { width: auto; margin: 0; }
#storyMap #mapBack { justify-self: center; }
@keyframes mapBob { 50% { transform: translate(-50%, -4px); } }
@keyframes mapHop { 50% { transform: translateY(-6px); } }
@keyframes mapHopR { 0%, 100% { transform: scaleX(-1); } 50% { transform: scaleX(-1) translateY(-6px); } }
@keyframes mapGlow { 50% { opacity: 0.35; transform: scale(1.06); } }
@keyframes mapFly { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(40px, -30px); } 50% { transform: translate(90px, 10px); } 75% { transform: translate(30px, 30px); } }
@keyframes mapPop { from { opacity: 0; transform: translateY(-6px); } }

/* 結果の「次のステージへ」（ストーリー） */
#nextBtn { background: linear-gradient(#8fe05a, #5cb83a); color: #fff; text-shadow: 0 2px 0 rgba(30, 70, 10, 0.5); font-size: 20px; }
/* 結果：ストーリーのステージの葉っぱ3まい */
.stage-leaves { list-style: none; margin: 4px auto 8px; padding: 6px 12px; display: grid; gap: 2px; max-width: 320px; text-align: left; font-size: 12.5px; font-weight: 700; background: #f1f8e6; border: 2px solid #9fbf7a; border-radius: 12px; }
.stage-leaves li { color: #9a998f; }
.stage-leaves li small { font-size: 11.5px; color: #8a887e; white-space: nowrap; }
.stage-leaves li.on { color: #2f6b1a; }
.stage-leaves b { font-weight: 900; margin-right: 5px; color: #c9c6b8; }
.stage-leaves li.on b { color: #ffc61a; text-shadow: 0 1px 0 #8a5a00; }
/* ゲーム中の曲名（森の左下。少しして消える） */
.now-playing { position: absolute; left: 4%; bottom: 3%; margin: 0; z-index: 4; pointer-events: none; font-weight: 900; font-size: 12px; color: #fff; background: rgba(0, 0, 0, 0.5); border-radius: 999px; padding: 3px 12px; opacity: 0; transform: translateY(6px); transition: opacity 0.6s, transform 0.6s; white-space: nowrap; }
.now-playing.show { opacity: 1; transform: none; }

/* ─── コヨミとの神遊び：コヨミの札（3枚から1枚） ─── */
.duel-cards { z-index: 30; background: linear-gradient(rgba(20, 14, 50, 0.6), rgba(10, 8, 30, 0.88)); cursor: pointer; }
.dc-box { width: min(100%, 440px); color: var(--ink); background: var(--paper); border: 4px solid #000; border-radius: 18px; box-shadow: 0 6px 0 #000; padding: 10px 12px 8px; display: grid; gap: 8px; }
.dc-head { margin: 0; display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 16px; color: #6a5acd; }
.dc-head img { width: 36px; height: 36px; border-radius: 50%; border: 2px solid #000; background: #fff; }
.dc-head small { font-family: inherit; font-size: 12px; color: #888; }
.dc-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dc-card { display: grid; justify-items: center; gap: 2px; padding: 10px 4px 8px; border: 3px solid #000; border-radius: 12px; background: linear-gradient(#fff, color-mix(in srgb, var(--c) 30%, #fff)); box-shadow: 0 4px 0 #000; text-align: center; transition: transform 0.3s, opacity 0.3s, filter 0.3s; }
.dc-card .dc-icon { font-size: 30px; }
.dc-card b { font-size: 13px; line-height: 1.3; }
.dc-card small { font-size: 11px; color: #555; font-weight: 700; }
.dc-card.picked { transform: translateY(-6px) scale(1.08); box-shadow: 0 0 0 4px var(--c), 0 8px 0 #000; }
.dc-card.dim { opacity: 0.45; filter: grayscale(0.7); transform: scale(0.94); }
.dc-say { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.6; min-height: 3.2em; }
.duel-cards.ready .talk-hint { opacity: 1; animation: hintBob 1s ease-in-out infinite; }
/* 森の記録：ごほうび（2026/10/8：アルバムをまとめた） */
.stamp-gift { display: block; font-style: normal; font-size: 11px; font-weight: 700; color: #a0522d; margin-top: 2px; }
.stamp.got.gift { cursor: pointer; background: #fff7d6; }
.rw-lore { display: grid; gap: 8px; margin-bottom: 10px; }
.rw-art { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rw-lore .focus, .rw-art .focus { outline: 4px solid var(--lime); outline-offset: 2px; }
/* 森の記録：ストーリーの記録（ステージごと） */
.rc-story dd { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; justify-content: flex-end; }
.rc-story dd small { color: #777; font-weight: 700; }
.rc-stars b { color: #c9c6b8; font-weight: 900; }
.rc-stars b.on { color: #ffc61a; text-shadow: 0 1px 0 #8a5a00; }
.art .art-q { display: grid; place-items: center; aspect-ratio: 1; font-size: 40px !important; color: #aaa; }
/* 自然のしくみ：生き物のゲームの数値（2026/10/8） */
.sp-stats { margin-top: 8px; background: #fff; border: 2px solid #9fbf7a; border-radius: 12px; padding: 6px 10px; }
.sp-stats summary { font-weight: 900; font-size: 13px; color: #2f6b1a; cursor: pointer; }
.sp-stats dl { margin: 6px 0 0; display: grid; gap: 2px; }
.sp-stats dl div { display: grid; grid-template-columns: 9em 1fr; gap: 6px; font-size: 12.5px; border-bottom: 1px dashed #dfe8cf; padding: 2px 0; }
.sp-stats dt { color: #666; font-weight: 700; }
.sp-stats dd { margin: 0; font-weight: 900; }
.sp-note { margin: 6px 0 0; font-size: 11px; color: #888; }
.art.stand img { aspect-ratio: 3 / 4; }
.art span small { display: block; font-size: 10.5px; color: #777; font-weight: 700; }
/* 生き物のアイコン（絵文字のかわり。2026/10/9） */
.sp-ico { display: inline-block; width: 1.25em; height: 1.25em; object-fit: contain; vertical-align: -0.28em; margin: 0 1px; }
.sp-ico.big { width: 30px; height: 30px; vertical-align: middle; margin: 0; }

/* 週末の森のルーレット（2026/10/9） */
.daily-roulette { margin: 4px 0 8px; }
.roulette-slots { display: flex; justify-content: center; gap: 10px; }
.roulette-slots .slot { width: 64px; height: 64px; display: grid; place-items: center; font-size: 36px; background: #fff; border: 3px solid #000; border-radius: 16px; box-shadow: 0 3px 0 #000; }
.roulette-slots .slot .sp-ico { width: 44px; height: 44px; vertical-align: middle; margin: 0; }
.roulette-slots .slot.stop { background: #f1ffd6; animation: slot-pop 0.25s ease-out; }
@keyframes slot-pop { from { transform: scale(1.25); } to { transform: scale(1); } }
.roulette-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; text-align: left; }
.roulette-list li b { margin-right: 6px; }

/* エンドレス：空間転移の渦（画面全体。src/ui/swirl.js） */
.swirl-fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 25; pointer-events: none; }

/* ホーム画面から開いたとき（横持ち）：時計の帯（OS のぼかし）に、エコの頭がかからないよう少し下げる（2026/10/11） */
@media (display-mode: standalone) and (orientation: landscape) and (min-width: 560px) {
  #app { --pad-t: max(16px, calc(env(safe-area-inset-top) + 14px)); }
}

/* ハザマ見参のカットイン（2026/10/11 ド派手に。ui/main.js の hazamaCutin） */
.cutin { position: fixed; inset: 0; z-index: 60; overflow: hidden; display: grid; place-items: center; cursor: pointer; background: radial-gradient(circle at 50% 50%, rgba(255, 236, 170, 0.35), rgba(70, 20, 140, 0.88) 45%, rgba(18, 6, 40, 0.95)); animation: cutinIn 0.25s ease-out both; }
.cutin.out { animation: cutinOut 0.28s ease-in both; }
.cutin-burst { position: absolute; width: 220vmax; height: 220vmax; left: 50%; top: 50%; margin: -110vmax 0 0 -110vmax; background: repeating-conic-gradient(rgba(255, 214, 90, 0.38) 0 6deg, rgba(190, 120, 255, 0.12) 6deg 18deg); animation: cutinSpin 6s linear infinite; }
.cutin-sq { position: absolute; left: 50%; top: 50%; border: 6px solid #ffd23c; box-shadow: 0 0 0 3px #7a4a00, 0 0 24px #ffd23c, inset 0 0 18px rgba(255, 210, 60, 0.6); }
.cutin-sq.a { width: 70vmin; height: 70vmin; margin: -35vmin 0 0 -35vmin; animation: cutinSq 2.6s ease-out both, cutinSpin 3s linear infinite; }
.cutin-sq.b { width: 50vmin; height: 50vmin; margin: -25vmin 0 0 -25vmin; animation: cutinSq 2.6s 0.08s ease-out both, cutinSpinR 2.2s linear infinite; }
.cutin-sq.c { width: 92vmin; height: 92vmin; margin: -46vmin 0 0 -46vmin; border-width: 3px; opacity: 0.7; animation: cutinSq 2.6s 0.16s ease-out both, cutinSpinR 5s linear infinite; }
.cutin-chara { position: relative; height: min(78vh, 120vw); max-width: 92vw; object-fit: contain; filter: drop-shadow(0 0 18px rgba(255, 220, 120, 0.9)) drop-shadow(0 8px 0 rgba(0, 0, 0, 0.35)); animation: cutinChara 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.cutin-name { position: absolute; left: 0; right: 0; bottom: 7vh; margin: 0; padding: 0.25em 0 0.3em; text-align: center; font-family: var(--display); font-size: clamp(34px, 9vmin, 72px); line-height: 1.05; color: #fff8d8; background: linear-gradient(90deg, transparent, rgba(30, 8, 70, 0.92) 12%, rgba(30, 8, 70, 0.92) 88%, transparent); border-top: 3px solid #ffd23c; border-bottom: 3px solid #ffd23c; text-shadow: 0 0 2px #3a1470, 2px 2px 0 #3a1470, -2px 2px 0 #3a1470, 2px -2px 0 #3a1470, -2px -2px 0 #3a1470, 0 0 18px #ffd23c; animation: cutinName 0.45s 0.2s cubic-bezier(0.2, 1.8, 0.4, 1) both; }
.cutin-name small { display: block; font-size: 0.42em; letter-spacing: 0.3em; color: #e8d2ff; }
.cutin-name b { color: #ffd23c; margin-left: 0.2em; }
@keyframes cutinIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cutinOut { to { opacity: 0; transform: scale(1.15); } }
@keyframes cutinSpin { to { transform: rotate(360deg); } }
@keyframes cutinSpinR { to { transform: rotate(-360deg); } }
@keyframes cutinSq { from { scale: 0.1; opacity: 0; } 30% { scale: 1.15; opacity: 1; } to { scale: 1; } }
@keyframes cutinChara { from { transform: translateX(80vw) scale(0.6) rotate(12deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes cutinName { from { transform: scale(2.4); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cutin-burst, .cutin-sq { animation: none; } }

/* 🌿 自由な森（試作・2026/10/15） */
.free-row { margin-top: 10px; }
.free-row[hidden] { display: none; }
.mode-btn.free { width: 100%; background: linear-gradient(135deg, #d9f5c0, #fff3b0); }
.free-card { grid-template-rows: auto 1fr; }
.free-draft { font-family: system-ui, sans-serif; font-size: 11px; background: #ffe08a; border: 1px solid #000; border-radius: 8px; padding: 1px 6px; vertical-align: middle; }
.free-body { overflow-y: auto; text-align: left; display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; min-height: 0; }
.free-body > * { flex: none; }
.fr-scene { position: relative; width: 100%; aspect-ratio: 16 / 10; border: 3px solid #000; border-radius: 14px; overflow: hidden; background: #8cc152 url('../../assets/free-bg.webp') center / cover; box-shadow: 0 4px 0 #000; }
.fr-sky { position: absolute; inset: 0; z-index: 900; pointer-events: none; transition: background 1s; }
.fr-sp { position: absolute; height: auto; transform: translate(-50%, -90%); animation: fr-bob 3.2s ease-in-out infinite; pointer-events: none; }
.fr-sp[src*="grass"] { animation: none; }
.fr-sp.sleep { opacity: 0.75; animation: none; }
@keyframes fr-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
.fr-zzz { position: absolute; right: 12px; top: 40px; z-index: 950; font-size: 22px; animation: fr-bob 2s ease-in-out infinite; }
.fr-parts { position: absolute; inset: 0; z-index: 920; pointer-events: none; overflow: hidden; }
.fr-parts i { position: absolute; top: -10%; font-style: normal; font-size: 16px; opacity: 0.85; animation: fr-fall 8s linear infinite; }
.fr-parts.p-summer i { animation-duration: 12s; opacity: 0.5; }
@keyframes fr-fall { 0% { transform: translate(0, 0) rotate(0); } 100% { transform: translate(-24px, 130px) rotate(200deg); } }
.fr-clock { position: absolute; left: 8px; top: 8px; z-index: 960; background: rgba(255, 255, 255, 0.85); border: 2px solid #000; border-radius: 12px; padding: 3px 9px; font-size: 13px; }
.fr-clock small { display: block; font-size: 11px; color: #444; }
.fr-nums { margin: 0; font-size: 12px; color: #4a5a40; line-height: 1.8; }
.fr-h { margin: 4px 0 2px; font-size: 14px; font-weight: 700; }
.fr-h small { font-weight: 400; color: #6a6f63; font-size: 11.5px; }
.fr-sheet > .fr-h:first-of-type { padding-right: 40px; }
.fr-sheet .fr-h small { display: inline-block; }
.fr-acts { display: grid; gap: 6px; }
.fr-act { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; padding: 8px 10px; font: inherit; border: 3px solid #000; border-radius: 14px; background: #f1ffd6; box-shadow: 0 3px 0 #000; cursor: pointer; color: #000; }
.fr-act:disabled { opacity: 0.55; cursor: default; box-shadow: none; }
.fr-act.picked { opacity: 1; background: #ffe08a; }
.fr-act-i { grid-row: span 2; font-size: 24px; text-align: center; }
.fr-act small { font-size: 11.5px; color: #4a5a40; }
.fr-night, .fr-away, .fr-note { margin: 0; font-size: 12px; color: #6a6f63; line-height: 1.6; }
.fr-last { margin: 0; font-size: 12.5px; background: #fffbe6; border: 2px solid #b8860b; border-radius: 12px; padding: 6px 10px; }
.fr-last span { color: #4a5a40; }
.fr-d { display: grid; gap: 1px; padding: 6px 8px; border: 2px dashed #9a9a8a; border-radius: 10px; background: #f6f6ee; font-size: 12.5px; margin: 0; }
.fr-d small { color: #6a6f63; font-size: 11px; }
.fr-dbg { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; padding: 6px; border: 2px dashed #c33; border-radius: 10px; }
.fr-dbg button { color: #000; font: inherit; font-size: 12px; padding: 3px 8px; border: 2px solid #000; border-radius: 8px; background: #fff; cursor: pointer; }
.fr-who { margin: 0; font-size: 14px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.fr-who small { font-size: 11.5px; background: #e6f5d0; border: 1px solid #3d6b1f; border-radius: 8px; padding: 0 6px; }
.fr-sub { margin-left: auto; font-size: 11.5px; color: #6a6f63; }
.fr-say { margin: 0; font-size: 12.5px; line-height: 1.7; background: #fffbe6; border: 2px solid #b8860b; border-radius: 12px; padding: 6px 10px; }
.fr-wait { margin: 0; font-size: 12.5px; color: #4a5a40; background: #f6f6ee; border: 2px dashed #9a9a8a; border-radius: 12px; padding: 6px 10px; }
.fr-act.big { background: #ffe08a; }
.fr-sub-btn { font: inherit; font-size: 12px; padding: 4px 10px; border: 2px solid #000; border-radius: 10px; background: #fff; cursor: pointer; justify-self: start; color: #000; }
.fr-spots { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fr-spots .fr-act { grid-template-columns: 28px 1fr; padding: 6px 8px; }
.fr-spots .fr-act small { grid-column: 1 / -1; font-size: 10.5px; }
.fr-spot { position: absolute; z-index: 980; transform: translate(-50%, -50%); display: grid; place-items: center; padding: 2px 6px; font: inherit; border: 2px solid #000; border-radius: 12px; background: rgba(255, 255, 255, 0.92); cursor: pointer; animation: fr-bob 1.6s ease-in-out infinite; color: #000; }
.fr-spot i { font-style: normal; font-size: 18px; line-height: 1.1; }
.fr-spot span { font-size: 10px; font-weight: 700; }
.fr-cam { position: absolute; z-index: 970; transform: translate(-50%, -50%); font-size: 22px; line-height: 0; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5)); }
.fr-report { display: grid; gap: 6px; padding: 8px 10px; border: 3px solid #000; border-radius: 14px; background: #f1ffd6; box-shadow: 0 3px 0 #000; }
.fr-v { display: flex; gap: 8px; align-items: center; }
.fr-v img { width: 40px; height: 40px; object-fit: contain; background: #fff; border: 2px solid #3d6b1f; border-radius: 10px; }
.fr-v b { font-size: 13.5px; }
.fr-v small { display: block; font-size: 11px; color: #4a5a40; }
.fr-new { font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: #e0473a; border-radius: 8px; padding: 0 6px; margin-left: 6px; }
.fr-quiz { display: grid; gap: 6px; }
.fr-ans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fr-a { display: grid; justify-items: center; gap: 2px; padding: 6px 4px; font: inherit; font-size: 12px; border: 3px solid #000; border-radius: 12px; background: #fff; cursor: pointer; color: #000; }
.fr-a img { width: 44px; height: 44px; object-fit: contain; }
.fr-a.right { background: #c9f0a0; }
.fr-a.wrong { background: #ffc9c9; }
.fr-a:disabled { cursor: default; }
.fr-sayrow { display: flex; gap: 8px; align-items: flex-start; }
.fr-sayrow .fr-say { flex: 1; min-width: 0; }
.fr-face { flex: none; width: 52px; height: 52px; border-radius: 50%; border: 3px solid #000; background: #fff3d6; object-fit: cover; }
.fr-who img { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #000; background: #fff3d6; align-self: center; }
.fr-intro { display: flex; gap: 8px; align-items: flex-end; }
.fr-intro img { flex: none; width: 110px; height: auto; }
.fr-intro .fr-say { flex: 1; min-width: 0; margin-bottom: 6px; }
/* 自由な森：入る前の説明（シラベの立ち絵つき） */
.fr-guide { display: grid; grid-template-columns: 38% 1fr; grid-template-areas: 'art box' 'dots dots' 'btns btns'; gap: 8px 10px; align-items: end; padding: 4px 0 8px; }
.fr-g-art { grid-area: art; align-self: end; display: grid; place-items: end center; background: radial-gradient(ellipse at 50% 85%, #e8f6cf 0 55%, transparent 56%); }
.fr-g-art img { width: 100%; max-width: 190px; height: auto; animation: fr-bob 3s ease-in-out infinite; }
.fr-g-box { grid-area: box; align-self: center; display: grid; gap: 6px; padding: 10px 12px; border: 3px solid #000; border-radius: 16px; background: #fffbe6; box-shadow: 0 3px 0 #000; position: relative; }
.fr-g-box::before { content: ''; position: absolute; left: -12px; bottom: 26px; border: 8px solid transparent; border-right: 10px solid #000; }
.fr-g-title { margin: 0; font-family: var(--display); font-size: 16px; }
.fr-g-say { margin: 0; font-size: 13px; line-height: 1.7; }
.fr-g-note { margin: 0; font-size: 12px; line-height: 1.7; color: #3d4a32; background: #f1ffd6; border-radius: 10px; padding: 6px 8px; }
.fr-g-list { margin: 0; padding-left: 1.1em; font-size: 12.5px; line-height: 1.8; }
.fr-g-day { display: grid; gap: 4px; }
.fr-g-day div { display: grid; grid-template-columns: 26px auto; column-gap: 6px; align-items: center; font-size: 12px; background: #fff; border: 2px solid #d8d2b0; border-radius: 10px; padding: 3px 6px; }
.fr-g-day span { grid-row: span 2; font-size: 18px; text-align: center; }
.fr-g-day small { color: #4a5a40; font-size: 11px; }
.fr-g-dots { grid-area: dots; display: flex; gap: 6px; justify-content: center; }
.fr-g-dots i { width: 8px; height: 8px; border-radius: 50%; background: #c9c3a0; }
.fr-g-dots i.on { background: #3d6b1f; }
.fr-g-btns { grid-area: btns; display: flex; gap: 8px; justify-content: space-between; }
.fr-go { font: inherit; font-weight: 700; font-size: 15px; padding: 10px 18px; border: 3px solid #000; border-radius: 14px; background: #ffe08a; box-shadow: 0 3px 0 #000; cursor: pointer; color: #000; margin-left: auto; }
@media (max-width: 420px) { .fr-guide { grid-template-columns: 34% 1fr; } .fr-g-title { font-size: 15px; } }
/* 森の目じるし（仮の絵） */
.fr-lm { position: absolute; height: auto; transform: translate(-50%, -78%); pointer-events: none; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.25)); }
.fr-pond { position: absolute; width: 20%; height: 16%; transform: translate(-50%, -50%); border-radius: 50%; background: url('../../assets/terrain/water-1.jpg') center / 120px; box-shadow: inset 0 3px 8px rgba(0, 40, 80, 0.45), 0 0 0 4px rgba(120, 90, 50, 0.45); z-index: 5; }
.fr-trail { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.fr-trail path { fill: none; stroke: rgba(160, 120, 70, 0.55); stroke-width: 5; stroke-linecap: round; }
.fr-sun { position: absolute; right: 6%; top: 6%; width: 9%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #fff7c2 0 40%, rgba(255, 230, 120, 0.5) 60%, transparent 72%); z-index: 905; pointer-events: none; }
.fr-moon { position: absolute; right: 8%; top: 7%; width: 7%; aspect-ratio: 1; border-radius: 50%; box-shadow: -6px 3px 0 0 #fff6c8; z-index: 955; pointer-events: none; transform: rotate(-20deg); }
.fr-stars { position: absolute; inset: 0 0 60% 0; z-index: 952; pointer-events: none; }
.fr-stars i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; animation: fr-twinkle 2.4s ease-in-out infinite; }
@keyframes fr-twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.fr-cam i { position: absolute; right: -2px; top: -2px; width: 6px; height: 6px; border-radius: 50%; background: #ff3b30; animation: fr-twinkle 1.2s ease-in-out infinite; }
/* 自動撮影カメラの写真 */
.fr-photo { position: relative; aspect-ratio: 16 / 9; border: 3px solid #000; border-radius: 10px; overflow: hidden; background: #6b8f3e url('../../assets/free-grass.webp') center / cover; }
.fr-photo img { position: absolute; left: 50%; bottom: 6%; height: 78%; width: auto; transform: translateX(-50%); }
.fr-photo.night { filter: grayscale(1) contrast(1.25) brightness(1.15); }
.fr-photo.night::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 55%, transparent 40%, rgba(0, 0, 0, 0.55) 100%); }
.fr-stamp { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 2px 8px; font: 700 11px/1.4 ui-monospace, monospace; color: #fff; background: rgba(0, 0, 0, 0.55); letter-spacing: 0.04em; }
.fr-ir { position: absolute; right: 8px; top: 6px; z-index: 2; font: 700 11px ui-monospace, monospace; color: #fff; background: rgba(0, 0, 0, 0.5); padding: 0 5px; border-radius: 4px; }
/* 自由な森：作業（2026/10/16） */
.fr-mini { display: grid; gap: 8px; padding: 10px; border: 3px solid #000; border-radius: 16px; background: #f6fbe9; box-shadow: 0 3px 0 #000; }
.fr-dial { position: relative; width: min(56vw, 190px); aspect-ratio: 1; margin: 4px auto; border-radius: 50%; border: 4px solid #000; background: radial-gradient(circle, #fffef4 0 58%, #e9e4c6 59%); }
.fr-zone { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from -24deg, rgba(86, 180, 60, 0.75) 0 48deg, transparent 48deg); }
.fr-needle { position: absolute; left: calc(50% - 4px); top: 8%; width: 8px; height: 42%; border-radius: 4px; background: #e0473a; border: 2px solid #000; transform-origin: 50% 100%; animation: fr-spin 1.5s linear infinite; }
@keyframes fr-spin { to { transform: rotate(360deg); } }
.fr-dial-c { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 30px; }
.fr-dial-t { position: absolute; left: 50%; top: -24px; transform: translateX(-50%); font-size: 11px; font-weight: 700; white-space: nowrap; }
.fr-reel { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.fr-frame { position: relative; aspect-ratio: 16 / 10; border: 3px solid #000; border-radius: 10px; background: #2a2f26; color: #fff; font: inherit; cursor: pointer; display: grid; place-items: center; overflow: hidden; }
.fr-frame > span:first-child:not(.fr-empty) { font-size: 26px; }
.fr-frame .fr-stamp { font-size: 10px; padding: 1px 6px; }
.fr-mini > .fr-g-btns { grid-area: auto; }
.fr-diary-btns { flex-wrap: wrap; justify-content: center; }
.fr-diary-btns .fr-sub-btn { white-space: nowrap; }
.fr-frame small { position: absolute; left: 6px; top: 4px; font-size: 11px; opacity: 0.8; }
.fr-frame.open { cursor: default; animation: fr-pop-in 0.35s ease-out; background: #6b8f3e url('../../assets/free-grass.webp') center / cover; }
.fr-frame.open img { height: 82%; bottom: 8%; }
.fr-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px !important; color: #fff; text-shadow: 0 1px 2px #000; }
.fr-flash { position: absolute; inset: 0; background: #fff; animation: fr-flash 0.45s ease-out forwards; pointer-events: none; z-index: 3; }
@keyframes fr-flash { from { opacity: 1; } to { opacity: 0; } }
@keyframes fr-pop-in { 0% { transform: scale(0.9); } 60% { transform: scale(1.04); } 100% { transform: none; } }
.fr-ground { position: relative; height: 170px; border: 3px solid #000; border-radius: 12px; overflow: hidden; background: #a98a5a; touch-action: none; }
.fr-print { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 6px; padding: 10px; text-align: center; background: radial-gradient(circle, #b89a68, #8f7448); }
.fr-print span { font-size: 54px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.3)); }
.fr-print small { font-size: 12px; color: #2a1d0b; font-weight: 700; }
#frDig { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; transition: opacity 0.6s; }
#frDig.gone { opacity: 0; pointer-events: none; }
.fr-digbar { margin: 0; height: 10px; border: 2px solid #000; border-radius: 6px; background: #fff; overflow: hidden; }
.fr-digbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #d9a23a, #8bc34a); transition: width 0.2s; }
.fr-field { position: relative; height: 210px; border: 3px solid #000; border-radius: 12px; overflow: hidden; background: #7fb24a url('../../assets/free-grass.webp') center / cover; touch-action: manipulation; }
.fr-timer { position: absolute; right: 8px; top: 6px; z-index: 5; min-width: 30px; text-align: center; font: 700 16px var(--display); background: #fff; border: 2px solid #000; border-radius: 10px; padding: 0 6px; }
.fr-pop { position: absolute; transform: translate(-50%, -50%) scale(0); padding: 0; border: 0; background: none; cursor: pointer; animation: fr-pop-up 0.25s ease-out forwards; }
.fr-pop img { width: 52px; height: auto; pointer-events: none; }
.fr-pop.got { animation: fr-got 0.4s ease-out forwards; }
.fr-pop.bye { animation: fr-bye 0.35s ease-in forwards; }
@keyframes fr-pop-up { to { transform: translate(-50%, -50%) scale(1); } }
@keyframes fr-got { 0% { transform: translate(-50%, -50%) scale(1.25); filter: brightness(1.6); } 100% { transform: translate(-50%, -110%) scale(0.6); opacity: 0; } }
@keyframes fr-bye { to { transform: translate(-50%, -30%) scale(0.2); opacity: 0; } }
.fr-tally { margin: 0; display: flex; gap: 10px; justify-content: center; font-size: 14px; }
.fr-tally span { background: #fff; border: 2px solid #000; border-radius: 12px; padding: 2px 12px; }
.fr-tally b { font: 700 18px var(--display); }
.fr-graph { display: grid; grid-auto-flow: column; gap: 6px; align-items: end; height: 100px; padding: 6px 8px 18px; border: 2px solid #d8d2b0; border-radius: 10px; background: #fff; }
.fr-graph div { position: relative; height: 100%; display: flex; gap: 2px; align-items: flex-end; }
.fr-graph i { flex: 1; border-radius: 3px 3px 0 0; min-height: 2px; }
.fr-graph i.r { background: #c9a27a; }
.fr-graph i.f { background: #e07a2a; }
.fr-graph small { position: absolute; left: 0; right: 0; bottom: -16px; text-align: center; font-size: 10px; color: #6a6f63; }
/* 自由な森：スクロールしない画面（2026/10/16） */
.free-card { height: calc(var(--app-h, 100dvh) - var(--ov-pt) - var(--ov-pb)); max-height: 900px; }
.free-body { position: relative; overflow-x: hidden; overflow-y: auto; gap: 6px; padding-bottom: 0; overscroll-behavior: contain; scrollbar-width: thin; } /* ふだんは1画面におさまる。ボタンがふえて入りきらないときだけ、スクロールできる */
.fr-hud { display: flex; align-items: center; gap: 6px; font-size: 13px; min-height: 30px; }
.fr-hud img { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #000; background: #fff3d6; }
.fr-hud small { font-size: 11px; background: #e6f5d0; border: 1px solid #3d6b1f; border-radius: 8px; padding: 0 6px; }
.fr-hud em { margin-left: auto; font-style: normal; font-size: 10.5px; color: #6a6f63; }
.free-body .fr-scene { flex: none; width: min(100%, calc(40dvh * 1.6)); margin: 0 auto; }
.free-body > .fr-sayrow .fr-say { font-size: 13px; padding: 6px 10px; }
.free-body > .fr-sayrow .fr-face { width: 46px; height: 46px; }
.fr-actions { display: grid; gap: 6px; margin-top: -3px; padding-bottom: 6px; } /* 「きょうの調査」のすぐ下にくっつける（2026/10/19）。あいたところは下に */
.fr-ab-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: 6px; } /* 5つ以上は2段に折り返す（文字が切れないように） */
.fr-ab { display: grid; justify-items: center; gap: 2px; padding: 8px 2px 6px; font: inherit; color: #000; border: 3px solid #000; border-radius: 14px; background: #fff; box-shadow: 0 3px 0 #000; cursor: pointer; min-width: 0; }
.fr-ab span { font-size: 24px; line-height: 1.1; }
.fr-ab small { font-size: clamp(10px, 3.1vw, 11.5px); font-weight: 700; white-space: nowrap; max-width: 100%; overflow: hidden; }
.fr-ab.hot { background: #ffe08a; animation: fr-hot 1.6s ease-in-out infinite; }
@keyframes fr-hot { 0%, 100% { transform: none; } 50% { transform: translateY(-2px); } }
.fr-ab:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.free-body .fr-dbg { padding: 3px 4px; gap: 4px; font-size: 11px; }
.free-body .fr-dbg button { padding: 1px 6px; font-size: 11px; }
.fr-sheet { position: absolute; left: 0; right: 0; bottom: 0; top: 36px; z-index: 1000; overflow-y: auto; padding: 12px 12px 14px; border: 3px solid #000; border-radius: 18px 18px 0 0; background: #fbfbf2; box-shadow: 0 -4px 0 rgba(0, 0, 0, 0.15); display: flex; flex-direction: column; gap: 8px; animation: fr-sheet-up 0.22s ease-out; }
.fr-sheet > * { flex: none; }
.fr-sheet.mini { top: auto; max-height: calc(100% - 36px); }
.fr-sheet .fr-mini { border: 0; box-shadow: none; padding: 0; background: none; }
.fr-sheet .fr-report { border: 0; box-shadow: none; padding: 0; background: none; }
.fr-sheet-x { position: sticky; top: 0; align-self: flex-end; margin-bottom: -34px; z-index: 2; width: 34px; height: 34px; border: 2px solid #000; border-radius: 50%; background: #fff; font: inherit; font-size: 15px; cursor: pointer; color: #000; }
@keyframes fr-sheet-up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.fr-sheet .fr-guide { padding: 0; }
.talk-chara.koyomi.shirabe { max-width: 46%; height: 92%; right: 2%; }
.talk-name.shirabe { background: #e6f5d0; }
.talk-chara.koyomi.nagi { max-width: 56%; height: 94%; right: 0%; } /* 2章のナギ（ウミガメ。2026/10/25） */
.talk-name.nagi { background: #cdeeea; }
.talk-chara.koyomi.fukurou { max-width: 56%; height: 94%; right: 0%; } /* 1章前半のシマフクロウ「シマフ」（2026/10/28 Codex の絵） */
.talk-name.fukurou { background: #e8dcc0; }
.talk-chara.koyomi.wadami { max-width: 52%; height: 96%; right: 0%; } /* 2章の神さま・仲間（2026/10/27 の確定版の絵） */
.talk-name.wadami { background: #cdd3f4; }
.talk-chara.koyomi.takane { max-width: 56%; height: 94%; right: 0%; }
.talk-name.takane { background: #dcefff; }
.talk-chara.koyomi.noa { max-width: 52%; height: 94%; right: 0%; }
.talk-name.noa { background: #ffeec2; }
.fr-today { flex: 1 0 auto; min-height: 96px; overflow: hidden; display: grid; align-content: start; gap: 4px; padding: 8px 10px; border: 2px solid #d8d2b0; border-radius: 14px; background: #fffef6; }
.fr-today p { margin: 0 0 2px; font-size: 12.5px; font-weight: 700; }
.fr-today p small { font-weight: 400; color: #6a6f63; }
.fr-today li { list-style: none; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 6px; border-radius: 10px; color: #6a6f63; }
.fr-today ul { margin: 0; padding: 0; display: grid; gap: 3px; }
.fr-today li.now { background: #fff3c4; color: #000; font-weight: 700; }
.fr-today li.done { color: #3d6b1f; }
.fr-today li.done b::after { content: '✓'; color: #3d6b1f; font-weight: 900; }
.fr-today li b { font-size: 14px; }
/* 自由な森：画面の説明（会話のあと） */
.fr-tour { position: absolute; inset: 0; z-index: 1100; pointer-events: auto; }
.fr-tour.wait { pointer-events: none; }
.fr-tour-hole { position: absolute; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(20, 24, 16, 0.62); border: 3px solid #ffd23c; pointer-events: none; transition: all 0.3s ease; }
@keyframes fr-hole { 0%, 100% { border-color: #ffd23c; } 50% { border-color: #fff6c8; } }
.fr-tour-tip { position: absolute; left: 6px; right: 6px; display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border: 3px solid #000; border-radius: 16px; background: #fffbe6; box-shadow: 0 4px 0 #000; pointer-events: auto; transition: top 0.3s ease; }
.fr-tour-tip img { flex: none; width: 50px; height: 50px; border-radius: 50%; border: 2px solid #000; background: #fff3d6; }
.fr-tour-tip > div { flex: 1; min-width: 0; }
.fr-tour-tip b { font-size: 14px; }
.fr-tour-tip p { margin: 2px 0 6px; font-size: 12.5px; line-height: 1.6; }
.fr-tour-btns { display: flex; gap: 6px; align-items: center; }
.fr-tour-btns small { color: #6a6f63; font-size: 11px; }
.fr-tour-btns .fr-go { padding: 6px 14px; font-size: 14px; }
.fr-tour-btns .fr-sub-btn { font-size: 11px; padding: 3px 8px; }

.fr-cam img { width: 24px; height: auto; display: block; }
.fr-cam i { right: 2px; top: 6px; }
.fr-print .fr-track { width: 96px; height: 96px; object-fit: contain; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35)); }
.fr-qprint { display: flex; gap: 8px; align-items: center; }
.fr-qprint .fr-say { flex: 1; min-width: 0; }
.fr-track.sm { width: 58px; height: 58px; object-fit: contain; flex: none; }

/* 行動写真（★1〜★4）。★4 は金のふち */
.fr-cap { position: absolute; left: 0; right: 0; top: 0; z-index: 3; padding: 2px 6px; font-size: 10.5px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, 0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-cap b { color: #ffd54a; letter-spacing: 1px; font-size: 10px; }
.fr-photo.b3 { border-color: #d9a000; box-shadow: 0 0 0 2px #fff3b0, 0 0 14px 2px rgba(255, 200, 40, 0.8); }
.fr-photo.b3::before { content: '貴重'; position: absolute; right: 6px; top: 22px; z-index: 4; padding: 1px 7px; font-size: 10px; font-weight: 700; color: #4a3200; background: #ffd54a; border: 2px solid #000; border-radius: 8px; }
.fr-photo.b1 img { transform: translateX(-50%) scaleX(-1); }
.fr-st { color: #d98f00; letter-spacing: 1px; }
.fr-st.b3 { color: #d93a00; }
.fr-bhs { display: grid; gap: 4px; }
.fr-bh { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 2px 6px; font-size: 11.5px; padding-bottom: 4px; border-bottom: 1px dotted #d8d0b8; }
.fr-bh img { width: 24px; height: 24px; object-fit: contain; }
.fr-bh > span { text-align: center; }
.fr-bh > b { white-space: nowrap; }
.fr-bh > span { grid-row: 1; }
.fr-bh > div { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
.fr-bh i { font-style: normal; display: grid; place-items: center; min-height: 30px; padding: 1px 2px; border: 2px dashed #b9b19a; border-radius: 8px; color: #b9b19a; font-size: 11px; text-align: center; line-height: 1.15; }
.fr-bh i.on { border: 2px solid #000; background: #fffbe6; color: #d98f00; }
.fr-bh i.on.b3 { background: #ffe9a0; color: #d93a00; border-color: #b8860b; }
.fr-bh i small { font-size: 9px; color: #333; font-weight: 700; overflow-wrap: anywhere; }
.fr-bh.off { opacity: 0.55; }

/* 行動ごとの写真（実物の絵）：そのままの色でいっぱいに見せる */
.fr-photo.real { aspect-ratio: 4 / 3; }
.fr-frame.fr-photo.real { aspect-ratio: 4 / 3; }
.fr-photo.real img, .fr-frame.open.real img { left: 0; top: 0; bottom: auto; width: 100%; height: 100%; object-fit: cover; transform: none; }
.fr-photo.real.b1 img { transform: none; }
.fr-photo.real .fr-ir { display: none; }

.mode-btn.loading { opacity: 0.7; pointer-events: none; }

/* 森の整備（2026/10/17） */
.fr-habs { display: grid; gap: 6px; }
.fr-hab { display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: center; padding: 6px 8px; border: 2px solid #000; border-radius: 12px; background: #f6fbe9; }
.fr-hab-i { font-size: 22px; text-align: center; }
.fr-hab > div { display: grid; gap: 3px; min-width: 0; }
.fr-hab b { font-size: 13px; }
.fr-hab small { font-size: 11.5px; color: #3e4a2c; }
.fr-hab .fr-go { justify-self: start; font-size: 12px; padding: 3px 12px; }
.fr-hab .fr-go:disabled { opacity: 0.45; }
.fr-lv { font-style: normal; color: #2e8b2e; letter-spacing: 1px; font-size: 11px; }
.fr-spot .fr-lv { display: block; font-size: 9px; line-height: 1; }
.fr-habmark { position: absolute; z-index: 960; transform: translate(-50%, -50%); display: grid; place-items: center; font-size: 15px; line-height: 1; padding: 2px 4px; border-radius: 10px; background: rgba(255, 255, 255, 0.7); border: 1.5px solid #2e8b2e; pointer-events: none; }
.fr-habmark em { font-style: normal; font-size: 7px; color: #2e8b2e; letter-spacing: 1px; }
.fr-habmark.lv3 { box-shadow: 0 0 8px 2px rgba(255, 230, 120, 0.9); }
.fr-ab.ready { background: #e9ffd2; animation: fr-bob 1.6s ease-in-out infinite; }

/* テストモード：行動写真の一覧 */
.fr-dbgt { width: 100%; border-collapse: collapse; font-size: 12px; text-align: center; }
.fr-dbgt th, .fr-dbgt td { border: 1px solid #ccc; padding: 2px 4px; }
.fr-dbgp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.fr-dbgp figure { margin: 0; border: 2px solid #000; border-radius: 8px; overflow: hidden; background: #fff; }
.fr-dbgp img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.fr-dbgp figcaption { padding: 3px 5px; font-size: 11px; line-height: 1.3; }
.fr-dbgp figcaption b { color: #d98f00; }
.fr-dbgp figcaption small { display: block; color: #555; font-size: 10px; }

.fr-dbgtoggle { align-self: flex-start; font: inherit; font-size: 11px; color: #a33; background: #fff; border: 2px dashed #c33; border-radius: 8px; padding: 1px 8px; cursor: pointer; }

/* 背の低い画面：森の絵とチェックリストをつめて、ボタンまで1画面に入れる。それでも入らなければ、スクロール */
@media (max-height: 700px) {
  .free-body .fr-scene { width: min(100%, calc(32dvh * 1.6)); }
  .fr-today { min-height: 0; padding: 5px 8px; gap: 2px; }
  .fr-today li { padding: 2px 6px; font-size: 12px; }
  .fr-today ul { gap: 1px; }
  .fr-ab { padding: 5px 2px 4px; }
  .fr-ab span { font-size: 20px; }
}

/* 📸 行動の記録（2026/10/17）：生き物ごとに 10 まい。タップで写真と解説 */
.fr-bh { display: grid; gap: 4px; padding-bottom: 6px; border-bottom: 1px dotted #d8d0b8; grid-template-columns: none; }
.fr-bh > p { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.fr-bh > p img { width: 24px; height: 24px; object-fit: contain; }
.fr-bh > p small { margin-left: auto; color: #6a6f63; font-size: 11px; }
.fr-bh > .fr-bcs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; } /* 1段目＝いつでも4・2段目＝春夏秋冬・3段目＝夜2 */
.fr-bc { position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 0; font: inherit; border: 2px dashed #b9b19a; border-radius: 8px; background: #f4f1e4; color: #b9b19a; cursor: pointer; overflow: hidden; }
.fr-bc > span { font-size: 16px; font-weight: 900; }
.fr-bc img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fr-bc img.sp { object-fit: contain; background: #e7efd2; }
.fr-bc em { position: absolute; left: 2px; top: 1px; font-style: normal; font-size: 11px; z-index: 1; }
.fr-bc small { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; font-size: 8.5px; line-height: 1.15; padding: 1px 2px; background: rgba(255, 255, 255, 0.85); color: #333; font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fr-bc:not(.on) small { background: none; color: #c9a300; }
.fr-bc.on { border: 2px solid #000; }
.fr-bc.on.b3 { border-color: #d9a000; box-shadow: 0 0 6px 1px rgba(255, 200, 40, 0.8); }
.fr-photo.big { aspect-ratio: 4 / 3; }
.fr-photo.locked { aspect-ratio: 4 / 3; display: grid; place-items: center; background: #ddd8c4; }
.fr-photo.locked span { font-size: 48px; font-weight: 900; color: #fff; }
.fr-vtext { margin: 0; font-size: 13px; font-weight: 700; display: grid; gap: 2px; }
.fr-vtext small { font-weight: 400; color: #6a6f63; font-size: 11px; }
.fr-v[data-view] { cursor: pointer; }
.fr-dbgp figure { position: relative; cursor: pointer; }
.fr-noart { position: absolute; right: 4px; top: 4px; font-style: normal; font-size: 10px; background: #c33; color: #fff; border-radius: 6px; padding: 0 5px; }

/* フィールドサイン・季節の残り日数（2026/10/17） */
.fr-signbtn { font: inherit; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border: 2px solid #6b4a1c; border-radius: 9px; background: #fff3dc; color: #4a3210; cursor: pointer; white-space: nowrap; }
.fr-sign { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: center; padding: 6px 8px; border: 2px solid #000; border-radius: 12px; background: #fbf7ea; }
.fr-sign > img { width: 64px; height: 64px; object-fit: contain; }
.fr-sign > img.photo { object-fit: cover; border-radius: 8px; border: 2px solid #000; }
.fr-sign > span { font-size: 34px; text-align: center; }
.fr-sign b { font-size: 13px; }
.fr-sign p { margin: 2px 0 0; font-size: 12px; line-height: 1.55; }
.fr-sleft { font-style: normal; font-size: 10px; margin-left: 3px; color: #6a6f63; }

/* 写真のズーム（2026/10/17 けいしさんの指示）：タップで大きく、もういちどタップで とじる */
.fr-photo.real img, .fr-sign > img { cursor: zoom-in; }
.fr-zoom { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; align-content: center; gap: 8px; padding: 16px; background: rgba(0, 0, 0, 0.88); cursor: zoom-out; animation: fr-zoom-in 0.18s ease-out; }
.fr-zoom img { max-width: min(96vw, 96dvh); max-height: 88dvh; width: auto; height: auto; object-fit: contain; border: 3px solid #fff; border-radius: 12px; }
.fr-zoom small { color: #fff; font-size: 12px; font-weight: 700; opacity: 0.8; }
@keyframes fr-zoom-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }

/* 生物調査：枠なしの全画面。ふちの「✕」ではなく「◀ もどる」（2026/10/17 けいしさんの指示） */
#free.overlay { padding: 0; background: #fbfbf2; }
#free .free-card { width: 100%; max-width: none; height: var(--app-h, 100dvh); max-height: none; border: 0; border-radius: 0; box-shadow: none; background: #fbfbf2; padding: max(10px, env(safe-area-inset-top)) 14px max(12px, env(safe-area-inset-bottom)); }
#free .tips-head { justify-content: space-between; gap: 10px; } /* 右上：🏠 ホーム（モードを出てタイトルへ）。板の中の「◀ もどる」は ひとつ前へ */
#free .tips-head h2 { font-size: 18px; min-width: 0; }
.free-back { flex: none; font: inherit; font-size: 14px; font-weight: 900; color: #000; background: #fff; border: 3px solid #000; border-radius: 12px; padding: 4px 12px; box-shadow: 0 3px 0 #000; cursor: pointer; white-space: nowrap; }
.free-back:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.fr-sheet-x { width: auto; height: auto; padding: 4px 12px; border-radius: 12px; font-size: 14px; font-weight: 900; align-self: flex-start; margin-bottom: 4px; box-shadow: 0 3px 0 #000; }

/* フィールドサインも、写真と同じ所に（2026/10/17） */
.fr-bc.sign small { color: #6b4a1c; }
.fr-bc.sign .e { font-size: 28px; display: grid; place-items: center; height: 100%; }
.fr-bcs > i.gap { visibility: hidden; }

/* 森の元気の説明（記録の画面） */

/* 森の課題カード（2026/10/17 案A の仮版） */
.fr-issue { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 0 8px; text-align: left; font: inherit; color: #000; padding: 6px 10px; border: 3px solid #000; border-radius: 14px; background: #fff; box-shadow: 0 3px 0 #000; cursor: pointer; }
.fr-issue span { grid-row: span 2; font-size: 26px; text-align: center; }
.fr-issue b { font-size: 13.5px; }
.fr-issue small { font-size: 11.5px; color: #555; }
.fr-issue.open { background: #ffe9c2; animation: fr-hot 1.6s ease-in-out infinite; }
.fr-issue.done.q-good { background: #e6f5d0; }
.fr-issue.done.q-ok { background: #fff6d6; }
.fr-issue.done.q-bad { background: #f3e6e6; }
.fr-opts { display: grid; gap: 6px; }
.fr-opt { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; text-align: left; font: inherit; color: #000; padding: 8px 10px; border: 3px solid #000; border-radius: 14px; background: #fff; box-shadow: 0 3px 0 #000; cursor: pointer; }
.fr-opt span { font-size: 24px; text-align: center; }
.fr-opt b { font-size: 13.5px; }
.fr-opt small { font-size: 12px; font-weight: 700; white-space: nowrap; }
.fr-opt:disabled { opacity: 0.5; cursor: default; }
.fr-note { margin: 0; font-size: 11.5px; color: #555; }

/* 軽さ：作業・板・説明を開いているあいだ、後ろの森の動きは止める */
#free.busy .fr-scene *, #free.busy .fr-actions * { animation-play-state: paused; }

/* 記録：生き物の一覧（写真は、生き物を押してから出す） */
.fr-bls { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; }
.fr-bl { display: grid; justify-items: center; gap: 1px; padding: 6px 4px; font: inherit; border: 2px solid #000; border-radius: 12px; background: #fffbe6; color: #000; cursor: pointer; box-shadow: 0 2px 0 #000; }
.fr-bl img { width: 40px; height: 40px; object-fit: contain; }
.fr-bl b { font-size: 12.5px; white-space: nowrap; }
.fr-bl small { font-size: 10.5px; color: #555; white-space: nowrap; }
.fr-bl.off { background: #f1ede0; }
.fr-bl.off img { filter: brightness(0.35); }

/* きょうの調査：タップでひらく・とじる（はじめはとじている） */
.fr-today.closed { flex: none; min-height: 0; padding: 4px 8px; }
.fr-today-h { display: flex; align-items: center; gap: 6px; width: 100%; padding: 4px 2px; font: inherit; font-size: 12.5px; font-weight: 700; background: none; border: 0; color: #000; cursor: pointer; text-align: left; }
.fr-today-h small { font-weight: 400; color: #6a6f63; }
.fr-today-h i { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 700; color: #3d6b1f; background: #eef4d6; border: 1.5px solid #3d6b1f; border-radius: 10px; padding: 1px 8px; white-space: nowrap; }

/* 観察レポート：写っていた生き物ぜんぶの写真を、小さく並べる（2026/10/18） */
.fr-v .fr-photo.thumb { flex: 0 0 38%; width: 38%; aspect-ratio: 4 / 3; border-width: 2px; border-radius: 8px; box-shadow: none; }
.fr-v .fr-photo.thumb .fr-cap, .fr-v .fr-photo.thumb .fr-stamp, .fr-v .fr-photo.thumb .fr-ir, .fr-v .fr-photo.thumb::before { display: none; }
.fr-found { margin: 6px 0 0; padding: 6px 10px; font-size: 13px; font-weight: 700; background: #fff3b0; border: 2px solid #d9a000; border-radius: 10px; }
.fr-found small { display: block; font-weight: 400; font-size: 11px; color: #5a4a10; }
.fr-v .fr-new { white-space: nowrap; margin-right: 4px; }
.fr-mon { margin: 6px 0; padding: 6px 10px; background: #eef7e0; border: 2px solid #3d6b1f; border-radius: 10px; }
.fr-mon-h { margin: 0 0 4px; font-size: 13px; font-weight: 700; }
.fr-mon-h small { display: block; font-weight: 400; font-size: 11px; color: #4a5a40; }
.fr-mon-r { display: flex; gap: 8px; align-items: baseline; margin: 2px 0; font-size: 14px; }
.fr-mon-r span { flex: 1; }
.fr-mon-r i { font-style: normal; color: #4a5a40; }
.fr-mon-r em { min-width: 40px; font-style: normal; font-weight: 700; text-align: right; }
.fr-mon-r em.up { color: #2a7a1f; }
.fr-mon-r em.dn { color: #c0392b; }
.fr-opt.sr { grid-template-columns: 34px 1fr; }
.fr-opt.sr small { display: block; white-space: normal; font-weight: 400; color: #4a5a40; }
.fr-opt.sr .fr-left { font-weight: 700; color: #2a7a1f; }

/* テストモード：見出しをタップで ひらく・とじる */
.debug .debug-h { display: block; width: 100%; margin: 4px 0 2px; padding: 6px 6px; text-align: left; font-size: 12px; font-weight: 900; color: #b8f23c; background: rgba(255, 255, 255, 0.06); border: 0; border-radius: 8px; }

/* ご意見・ご要望（2026/10/19）：メニューのいちばん下の小さなリンクと、送る画面 */
.feedback-link { display: inline-block; margin: 0; padding: 4px 12px; font: inherit; font-size: 12px; font-weight: 700; color: rgba(0, 0, 0, 0.55); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.feedback-link:hover { color: #000; }
.feedback-card { max-width: 460px; }
.fb-kinds { display: flex; gap: 6px; justify-content: center; margin: 8px 0; }
.fb-kinds button { font: inherit; font-size: 13px; font-weight: 700; color: #000; padding: 5px 12px; background: #fff; border: 2px solid #000; border-radius: 999px; cursor: pointer; }
.fb-kinds button[aria-pressed='true'] { background: #b8f23c; }
.fb-text { width: 100%; font: inherit; font-size: 16px; line-height: 1.5; padding: 8px 10px; color: #000; background: #fff; border: 2px solid #000; border-radius: 12px; resize: vertical; }
.fb-count { margin: 2px 0 6px; font-size: 11px; color: #666; text-align: right; }
.fb-note { margin: 4px 0; font-size: 11.5px; line-height: 1.6; color: #444; text-align: left; }
.fb-msg { min-height: 1.4em; margin: 4px 0; font-size: 13px; font-weight: 700; color: #2a7a1f; }
.fb-msg.err { color: #c0392b; }
#fbSend:disabled { opacity: 0.45; cursor: default; }
#feedback { z-index: 60; } /* 「?feedback」で開くとき、最初の画面（タップしてスタート）より前に出す */

/* 森の記録：きょうの森（テーマ別）は、見出しの下に、テーマごとの回数を折り返して並べる（2026/10/19） */
.rc-list .wide { display: block; }
.rc-list .wide dt { white-space: nowrap; }
.rc-list .wide dd { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; text-align: left; }

/* 森の生物調査（2026/10/19 けいしさんの指示）：ボタンを「きょうの調査」の上へ。「きょうの調査」はポップアップ。iPhone は上の帯の下を ぼかさず、くっきり塗る */
.fr-today.closed { margin-top: 2px; }
.fr-modal { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; }
.fr-modal-bg { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: rgba(15, 23, 13, 0.55); cursor: default; }
.fr-modal-card { position: relative; width: min(100%, 360px); display: grid; gap: 8px; padding: 14px 14px 12px; background: #fffef2; border: 3px solid #000; border-radius: 16px; box-shadow: 0 4px 0 #000; }
.fr-modal-card .fr-h { margin: 0; font-size: 15px; font-weight: 900; }
.fr-modal-card .fr-h small { font-weight: 400; color: #6a6f63; }
.fr-modal-card ul { margin: 0; padding: 0; display: grid; gap: 4px; }
.fr-modal-card li { list-style: none; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 6px; padding: 6px 8px; font-size: 14px; border-radius: 10px; color: #6a6f63; }
.fr-modal-card li.now { background: #fff3c4; color: #000; font-weight: 700; }
.fr-modal-card li.done { color: #3d6b1f; }
.fr-modal-card li.done b::after { content: '✓'; font-weight: 900; }
@media (display-mode: standalone) {
  body.free-open::after { height: env(safe-area-inset-top); background: #0f170d; }
}

/* ─── 生物調査：観察ノート・事件簿・道具・学会発表（2026/10/21） ─── */
.fr-nb { position: relative; }
.fr-nbar { display: block; width: 100%; height: 6px; border-radius: 4px; background: #e2dcc5; overflow: hidden; }
.fr-nbar i { display: block; height: 100%; background: linear-gradient(90deg, #8bc34a, #3e8e2f); }
.fr-nb.done { border-color: #c9a000; background: #fff8d8; }
.fr-nb.done .fr-nbar i { background: linear-gradient(90deg, #ffd54a, #e0a000); }
.fr-page { position: relative; display: grid; gap: 6px; padding: 10px 10px 12px; border: 3px solid #4a3a20; border-radius: 8px 14px 14px 8px; background: #fbf7e8 repeating-linear-gradient(transparent 0 25px, #e6dfc6 25px 26px); box-shadow: inset 6px 0 0 #d8ccaa; }
.fr-page.done { border-color: #c9a000; box-shadow: inset 6px 0 0 #ffd54a, 0 0 0 2px #fff3b0, 0 0 14px rgba(255, 200, 40, 0.6); }
.fr-page-h { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 16px; }
.fr-page-h img { width: 34px; height: 34px; object-fit: contain; }
.fr-page-h small { color: #6a6f63; font-size: 12px; }
.fr-pstamp { margin-left: auto; padding: 2px 8px; border: 3px solid #c0392b; border-radius: 8px; color: #c0392b; font-weight: 900; font-size: 13px; transform: rotate(-8deg); background: rgba(255, 255, 255, 0.7); }
.fr-memo { margin: 0; padding: 0 0 0 4px; list-style: none; display: grid; gap: 2px; font-size: 12.5px; line-height: 1.6; color: #2c3a8a; font-family: 'Klee One', 'Hiragino Maru Gothic ProN', system-ui, sans-serif; }
.fr-memo li::before { content: '✎ '; color: #8a7a5a; }
.fr-memo li.lock { color: #b5ad94; }
.fr-psec { margin: 4px 0 0; font-size: 12.5px; font-weight: 700; color: #4a3a20; }
.fr-bc.case .e { font-size: 24px; color: #000; }
.fr-bc.on.case { background: #fff3cf; }
.fr-cases { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.fr-case { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; font: inherit; border: 2px dashed #b9b19a; border-radius: 10px; background: #f4f1e4; color: #9a937c; cursor: pointer; min-height: 64px; }
.fr-case span { font-size: 22px; }
.fr-case small { font-size: 10px; line-height: 1.3; text-align: center; }
.fr-case.on { border: 2px solid #000; background: #fff8e0; color: #000; }
.fr-casehit { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; width: 100%; margin: 6px 0; padding: 8px 10px; font: inherit; text-align: left; border: 3px solid #000; border-radius: 12px; background: #fff3cf; cursor: pointer; color: #000; }
.fr-casehit span { grid-row: span 2; font-size: 28px; }
.fr-casehit small { font-size: 11.5px; color: #4a3a20; }
.fr-casehit.new { background: #ffe58a; animation: frCaseNew 1.2s ease-in-out 3; }
@keyframes frCaseNew { 50% { transform: scale(1.03); } }
.fr-casepics { display: flex; gap: 2px; }
.fr-casepics img { position: static !important; flex: 1; width: 50% !important; height: 100% !important; object-fit: cover; transform: none !important; }
.fr-casepics.n1 img { width: 100% !important; }
.fr-tool { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; padding: 8px; border: 3px solid #000; border-radius: 12px; background: #fff; }
.fr-tool.off { border-style: dashed; border-color: #aaa; background: #f4f1e4; color: #6a6f63; }
.fr-tool-i { font-size: 30px; }
.fr-tool b { font-size: 14px; }
.fr-tool small { display: block; font-size: 11.5px; color: #4a5a40; }
.fr-tool p { margin: 4px 0 0; font-size: 12px; line-height: 1.6; color: #3d4a32; }
.fr-bino { position: relative; width: min(100%, 300px); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; overflow: hidden; border: 6px solid #111; box-shadow: 0 0 0 4px #444; touch-action: none; background: #5d7a3a; }
.fr-bino-w { position: absolute; left: 0; top: 0; width: 320%; height: 220%; will-change: transform; }
.fr-bino-w .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fr-bino-t { position: absolute; width: 7%; transform: translate(-50%, -50%); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); }
.fr-bino-t.sky { width: 6%; }
.fr-bino-ring { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; box-shadow: inset 0 0 30px 12px rgba(0, 0, 0, 0.65); background: linear-gradient(transparent 49.6%, rgba(0, 0, 0, 0.35) 49.6% 50.4%, transparent 50.4%), linear-gradient(90deg, transparent 49.6%, rgba(0, 0, 0, 0.35) 49.6% 50.4%, transparent 50.4%); }
.fr-focus { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; }
.fr-focus input { flex: 1; accent-color: #3e8e2f; }
.fr-sand { position: relative; height: 160px; border: 3px solid #000; border-radius: 12px; background: radial-gradient(circle at 30% 30%, #f0dcaa, #d9bf86); box-shadow: inset 0 0 18px rgba(120, 90, 40, 0.4); }
.fr-sandp { position: absolute; }
.fr-sandp .fr-track { width: 76px; height: 76px; object-fit: contain; opacity: 0.85; mix-blend-mode: multiply; }
.fr-a.sel { background: #c9f0a0; box-shadow: 0 0 0 3px #3e8e2f; }
.fr-cpick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-height: 46vh; overflow: auto; }
.fr-cpick .fr-bc { aspect-ratio: 4 / 3; border-style: solid; border-color: #000; }
.fr-cpick .fr-bc.sel { box-shadow: 0 0 0 3px #e0a000; }
.fr-cnum { position: absolute; right: 4px; top: 4px; z-index: 3; width: 22px; height: 22px; border-radius: 50%; background: #e0a000; color: #fff; font-style: normal; font-weight: 900; display: grid; place-items: center; font-size: 12px; }
.fr-poster { display: grid; gap: 6px; padding: 10px; border: 3px solid #2f5a2a; border-radius: 10px; background: #f7f1df; text-align: center; }
.fr-poster-t { margin: -10px -10px 0; padding: 8px; background: #2f5a2a; color: #fff; font-weight: 900; font-size: 14px; border-radius: 6px 6px 0 0; }
.fr-poster-n, .fr-poster-s { margin: 0; font-size: 12px; font-weight: 700; color: #2f3a24; }
.fr-poster-ph { display: flex; gap: 6px; justify-content: center; }
.fr-poster-ph img { width: 31%; aspect-ratio: 4 / 3; object-fit: cover; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
.fr-opt.right { background: #c9f0a0; }
.fr-opt.wrong { background: #ffc9c9; }
.fr-page > .fr-bcs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.fr-opt.qa { grid-template-columns: 1fr; text-align: center; }
.fr-page, .fr-bls { scroll-margin-top: 52px; }

/* 生物調査：新しい要素のお知らせ（NEW の印と、ポップアップの行）。2026/10/21 */
.fr-ab { position: relative; }
.fr-newb { position: absolute; top: -6px; right: -4px; padding: 1px 6px; font-style: normal; font-size: 10px; font-weight: 700; line-height: 1.4; color: #fff; background: #e0452e; border: 2px solid #000; border-radius: 999px; animation: frNewPing 1.2s ease-in-out infinite; pointer-events: none; }
@keyframes frNewPing { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.fr-news-r { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; margin: 6px 0; padding: 8px; border: 3px solid #000; border-radius: 12px; background: #fff3cf; }
.fr-news-r > span { font-size: 28px; }
.fr-news-r p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.6; }

/* 個体数調査（2026/10/21）：空・痕跡・にせもの、結果の診断、種ごとのグラフ */
.fr-pop.sky img { width: 64px; filter: drop-shadow(0 4px 2px rgba(0,0,0,.25)); }
.fr-pop.sign { transform: translate(-50%, -50%) scale(0); display: grid; justify-items: center; }
.fr-pop.sign img { width: 40px; }
.fr-pop.sign i { font-style: normal; font-size: 10px; font-weight: 700; background: #fff; border: 2px solid #000; border-radius: 8px; padding: 0 4px; }
.fr-pop.decoy { font-size: 34px; opacity: .9; }
.fr-pop.wrong { animation: fr-bye 0.45s ease-in forwards; filter: grayscale(1); }
.fr-tally { flex-wrap: wrap; }
.fr-tally .fr-miss { background: #fde4e0; }
.fr-mon-r small { font-size: 11px; color: #4a5a40; }
.fr-mon-n { margin: 6px 0; font-size: 12.5px; line-height: 1.6; }
.fr-mon-n.fr-warn { padding: 6px 8px; background: #ffe58a; border: 2px solid #000; border-radius: 10px; font-weight: 700; }
.fr-sg { display: grid; gap: 4px; padding: 6px 8px; border: 2px solid #d8d2b0; border-radius: 10px; background: #fff; }
.fr-sg-r, .fr-sg-d { display: grid; grid-template-columns: 26px 1fr; align-items: end; gap: 6px; }
.fr-sg-b { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 30px); justify-content: start; gap: 6px; margin-top: 12px; align-items: end; height: 34px; }
.fr-sg-b i { position: relative; background: #c9a27a; border-radius: 3px 3px 0 0; min-height: 4px; }
.fr-sg-b i em { position: absolute; top: -14px; left: 0; right: 0; text-align: center; font-style: normal; font-size: 10px; color: #4a5a40; }
.fr-sg-r:nth-child(2n) .fr-sg-b i { background: #e07a2a; }
.fr-sg-r:nth-child(3n) .fr-sg-b i { background: #8fb56a; }
.fr-sg-d > div { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 30px); justify-content: start; gap: 6px; text-align: center; }
.fr-sg-d small { font-size: 10px; color: #6a6f63; }

/* 素材とライセンス（2026/10/21） */
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; margin: 12px auto 2px; }
#licenses { z-index: 60; }
.lic-card { max-width: 520px; }
.lic-body { max-height: min(58vh, 520px); overflow-y: auto; text-align: left; -webkit-overflow-scrolling: touch; }
.lic-body h3 { margin: 10px 0 4px; font-size: 14px; }
.lic-note { margin: 2px 0 6px; font-size: 12px; line-height: 1.7; color: #333; }
.lic-photos { list-style: none; margin: 0; padding: 0; font-size: 11px; }
.lic-photos li { display: grid; grid-template-columns: 1.1fr 1.3fr 1fr 1fr; gap: 4px; padding: 4px 0; border-bottom: 1px solid #ddd; align-items: start; }
.lic-photos li > * { min-width: 0; overflow-wrap: anywhere; }
.lic-photos .lic-h { font-weight: 700; color: #555; }
.lic-photos a { color: #1a5fb4; }

/* 生物調査：調査ランク・腕前・気持ちよさの演出（2026/10/21） */
.fr-res { position: relative; display: grid; gap: 6px; padding: 10px 12px; border: 3px solid #000; border-radius: 14px; background: #fff; box-shadow: 0 3px 0 #000; overflow: hidden; animation: frResIn 0.35s ease-out both; }
.fr-res.g-S { background: linear-gradient(135deg, #fff6c9, #ffe27a 60%, #fff3b0); }
.fr-res.g-A { background: #eaffd9; }
.fr-res.g-B { background: #eef6ff; }
@keyframes frResIn { from { transform: translateY(8px); opacity: 0; } }
.fr-res-top { display: flex; align-items: center; gap: 12px; }
.fr-res-m { min-width: 0; }
.fr-grade { flex: none; display: grid; place-items: center; width: 64px; height: 64px; font: 400 44px/1 var(--display); color: #fff; border: 3px solid #000; border-radius: 50%; transform: rotate(-12deg); animation: frStamp 0.42s cubic-bezier(0.2, 1.6, 0.4, 1) 0.18s both; text-shadow: 0 2px 0 #000; }
.fr-grade.g-S { background: radial-gradient(circle at 35% 30%, #fff59a, #f2a900 70%); box-shadow: 0 0 0 4px #fff3b0, 0 0 22px #ffcf33; }
.fr-grade.g-A { background: #3e8e2f; }
.fr-grade.g-B { background: #2f6fb4; }
.fr-grade.g-C { background: #8a8f86; }
@keyframes frStamp { 0% { transform: rotate(-12deg) scale(2.6); opacity: 0; } 70% { transform: rotate(-12deg) scale(0.92); opacity: 1; } 100% { transform: rotate(-12deg) scale(1); } }
.fr-res-w { font: 400 18px var(--display); }
.fr-best { margin-left: 6px; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: #e0473a; border-radius: 8px; padding: 1px 6px; animation: frPulse 1s ease-in-out 3; }
.fr-res-pts { margin: 2px 0 0; font-size: 13px; }
.fr-res-pts small { display: block; font-size: 11px; color: #555; }
.fr-up { display: inline-block; font: 400 18px var(--display); color: #2a7a1f; }
.fr-up.tick { animation: frTick 0.14s ease-out; }
@keyframes frTick { from { transform: scale(1.5); } }
.fr-skill { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 6px; font-size: 12px; position: relative; }
.fr-sk-lv { font-size: 12px; }
.fr-skbar { position: relative; height: 10px; border: 2px solid #000; border-radius: 6px; background: #f1ecd8; overflow: hidden; }
.fr-skbar i { position: absolute; inset: 0 auto 0 0; width: var(--to); background: linear-gradient(90deg, #7dd36b, #3e8e2f); animation: frBar 0.9s ease-out 0.7s both; }
.fr-skbar.sm { height: 8px; }
@keyframes frBar { from { width: var(--from); } }
.fr-lvup { position: absolute; right: 0; top: -14px; font-style: normal; font: 400 15px var(--display); color: #fff; background: #f2a900; border: 2px solid #000; border-radius: 10px; padding: 0 8px; animation: frLv 0.5s cubic-bezier(0.2, 1.8, 0.4, 1) 1.3s both; }
@keyframes frLv { from { transform: scale(0) rotate(-20deg); opacity: 0; } }
.fr-streak { margin: 0; font-size: 12.5px; color: #b5420f; }
.fr-streak small { color: #777; }
.fr-lesson { display: grid; gap: 2px; padding: 6px 8px; font-size: 12.5px; line-height: 1.6; background: #eef4ff; border: 2px solid #2f6fb4; border-radius: 10px; }
.fr-lesson b { font-size: 12px; color: #2f6fb4; }
.fr-confetti { position: absolute; inset: 0; pointer-events: none; }
.fr-confetti i { position: absolute; top: -10px; left: var(--x); width: 7px; height: 11px; background: var(--c); border: 1px solid rgba(0, 0, 0, 0.3); transform: rotate(var(--r)); animation: frConf 1.6s ease-in var(--d) both; }
@keyframes frConf { 0% { transform: translateY(0) rotate(var(--r)); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(240px) rotate(calc(var(--r) + 540deg)); opacity: 0; } }
@keyframes frPulse { 50% { transform: scale(1.15); } }
.fr-float { position: absolute; z-index: 6; transform: translate(-50%, -100%); font: 400 15px var(--display); color: #fff; text-shadow: 0 0 3px #000, 0 2px 0 #000; pointer-events: none; white-space: nowrap; animation: frFloat 0.8s ease-out forwards; }
.fr-float.bad { color: #ffd0d0; }
@keyframes frFloat { to { transform: translate(-50%, -260%); opacity: 0; } }
.fr-chain { margin: 0; padding: 6px 8px; font-size: 12.5px; line-height: 1.6; background: #fff7e6; border: 2px dashed #c98a1a; border-radius: 10px; }
/* 写真めくりの目の光 */
.fr-glint { position: absolute; z-index: 3; width: 34px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: radial-gradient(circle at 30% 50%, #fff 0 3px, transparent 4px), radial-gradient(circle at 70% 50%, #fff 0 3px, transparent 4px); filter: drop-shadow(0 0 4px #b8ff7a); cursor: pointer; animation: frGlint 1.4s ease-in-out infinite; }
@keyframes frGlint { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
.fr-glintimg { animation: frResIn 0.4s ease-out; }
.fr-indtag { position: absolute; left: 6px; top: 6px; z-index: 3; font-style: normal; font-size: 11px; font-weight: 700; color: #000; background: #ffe58a; border: 2px solid #000; border-radius: 8px; padding: 0 6px; }
.fr-new.ind { background: #c98a1a; }
.fr-a.hint-no { opacity: 0.4; }
/* 🔬 糞の分析 */
.fr-scope { position: relative; width: min(240px, 70vw); aspect-ratio: 1; margin: 0 auto; border: 6px solid #333; border-radius: 50%; overflow: hidden; background: radial-gradient(circle, #f5ecd2, #d8c7a0 70%, #8a7a5a); box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.45); touch-action: manipulation; }
.fr-scope .fr-timer { right: 50%; transform: translateX(50%); top: 4px; }
.fr-bit { position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center; width: 38px; height: 38px; padding: 0; font-size: 26px; border: 0; background: none; cursor: pointer; animation: frDrift 3s ease-in-out infinite alternate; }
.fr-bit.sand::before { content: ''; width: 14px; height: 12px; border-radius: 45%; background: #7a5a3a; box-shadow: 0 1px 0 #3a2a1a; }
.fr-bit.got { animation: fr-got 0.4s ease-out forwards; }
.fr-bit.wrong { animation: fr-bye 0.4s ease-in forwards; }
@keyframes frDrift { to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))); } }
.fr-clues { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; font-size: 24px; }
.fr-clues small { font-size: 12px; color: #555; }
/* 🏷️ 個体識別 */
.fr-idpair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fr-idcard { position: relative; display: grid; justify-items: center; padding: 6px; border: 3px solid #000; border-radius: 12px; background: #3b4a32; color: #fff; }
.fr-idcard img { width: 100%; max-width: 120px; aspect-ratio: 1; object-fit: contain; filter: saturate(0.85); }
.fr-idpair .fr-idcard:nth-child(2) img { transform: scaleX(-1); }
.fr-idcard small { font-size: 11px; }
.fr-idmark { position: absolute; font-size: 16px; animation: frStamp 0.35s ease-out both; }
.fr-idmark.head { left: 18%; top: 14%; }
.fr-idmark.body { left: 48%; top: 46%; }
.fr-idmark.tail { right: 12%; top: 58%; }
.fr-idrow { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; padding: 6px 8px; font-size: 12.5px; border: 2px solid #000; border-radius: 10px; background: #fff; animation: frResIn 0.3s ease-out; }
.fr-idrow b { grid-row: span 2; align-self: center; }
.fr-idrow em { grid-column: 1 / -1; font-style: normal; font-weight: 700; }
.fr-idrow.same em { color: #2a7a1f; }
.fr-idrow.diff { background: #fff1f1; }
.fr-idrow.diff em { color: #c0392b; }
.fr-names { display: flex; flex-wrap: wrap; gap: 6px; }
.fr-name { font: inherit; font-weight: 700; padding: 6px 12px; border: 3px solid #000; border-radius: 999px; background: #fff; cursor: pointer; color: #000; }
.fr-name.on { background: #ffe58a; }
/* 🌿 植生調査（コドラート） */
.fr-quad { position: relative; height: 230px; border: 3px solid #000; border-radius: 12px; overflow: hidden; background: #8cbd55 url('../../assets/free-grass.webp') center / cover; touch-action: manipulation; }
.fr-quad.fence { box-shadow: inset 0 0 0 8px rgba(160, 110, 40, 0.55); }
.fr-quad-f { position: absolute; left: 24%; top: 24%; width: 52%; height: 52%; border: 3px dashed #fff; border-radius: 4px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.18); pointer-events: none; }
.fr-plant { position: absolute; transform: translate(-50%, -50%); padding: 0; font-size: 24px; border: 0; background: none; cursor: pointer; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.3)); }
.fr-plant.got { animation: fr-got 0.4s ease-out forwards; }
.fr-plant.wrong { animation: fr-bye 0.4s ease-in forwards; }
.fr-vegbars { display: grid; gap: 6px; padding: 8px; border: 2px solid #d8d2b0; border-radius: 10px; background: #fff; }
.fr-vegbar { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 6px; font-size: 12px; }
.fr-vegbar > div { display: grid; gap: 3px; }
.fr-vegbar i { position: relative; display: block; height: 12px; min-width: 4px; border-radius: 0 4px 4px 0; animation: frBarW 0.8s ease-out both; }
.fr-vegbar i.open { background: #c98a1a; }
.fr-vegbar i.fence { background: #3e8e2f; }
.fr-vegbar i em { position: absolute; left: calc(100% + 4px); top: -2px; font-style: normal; font-size: 11px; }
@keyframes frBarW { from { width: 0; } }
.fr-g-note b.o { color: #c98a1a; }
.fr-g-note b.f { color: #3e8e2f; }
/* 記録：腕前・学んだこと・食べもの・見わけた個体 */
.fr-skills { display: grid; gap: 4px; padding: 8px; border: 2px solid #d8d2b0; border-radius: 10px; background: #fff; }
.fr-skrow { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 64px auto; align-items: center; gap: 6px; font-size: 12px; }
.fr-skrow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-skrow em { font-style: normal; font-weight: 700; }
.fr-best-g { min-width: 50px; text-align: right; font-weight: 700; }
.fr-best-g.g-S { color: #c98a00; }
.fr-best-g.g-A { color: #2a7a1f; }
.fr-learned { padding: 6px 8px; font-size: 12.5px; border: 2px solid #2f6fb4; border-radius: 10px; background: #eef4ff; }
.fr-learned summary { font-weight: 700; cursor: pointer; }
.fr-learned ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.6; }
.fr-bc.diet .e { font-size: 24px; color: #000; }
.fr-bc.on.diet { background: #fff3cf; }
.fr-inds { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.fr-inds span { font-size: 12px; font-weight: 700; padding: 2px 8px; border: 2px solid #000; border-radius: 999px; background: #ffe58a; }
.fr-inds small { margin-left: 4px; font-weight: 400; }

/* 生物調査の上の帯：肩書きと 🌱 調査ポイント（つぎの肩書きまでのバー）。2026/10/21 */
.fr-rankbar { flex: 1; min-width: 36px; max-width: 90px; height: 8px; border: 2px solid #000; border-radius: 6px; background: #f1ecd8; overflow: hidden; }
.fr-rankbar i { display: block; height: 100%; background: linear-gradient(90deg, #7dd36b, #3e8e2f); }
.fr-pts { font-style: normal; font-size: 12px; font-weight: 700; white-space: nowrap; }
.fr-pts small { font-weight: 400; color: #666; }

/* ─── 生物調査：見やすさの見直し（2026/10/21 けいしさんの指示：UI が全体的に見にくい） ───
   ・文字を少し大きく・灰色を濃く（小さく うすい字を減らす）
   ・黒く太いふちは「押せるもの」だけ。カード・枠は細く やわらかい緑のふちに
   ・下のボタンは、いつもの3つ（小さめ横長）と、いまできる調査（大きく）で、目立ち方を分ける */
#free { --fw-ink: #26301e; --fw-sub: #4f5a43; --fw-line: #c9d3a8; --fw-card: #ffffff; --fw-leaf: #3e8e2f; --fw-leaf-bg: #eef6dc; --fw-sun: #ffe08a; }
#free .free-body { gap: 8px; color: var(--fw-ink); }

/* 上の帯：シラベ・肩書き ｜ 調査ポイントのバー */
#free .fr-hud { gap: 8px; min-height: 40px; padding: 6px 10px; border: 1.5px solid var(--fw-line); border-radius: 14px; background: var(--fw-card); }
#free .fr-hud img { width: 34px; height: 34px; border: 2px solid var(--fw-ink); }
#free .fr-hud-id { display: grid; line-height: 1.25; flex: none; }
#free .fr-hud-id b { font-size: 13px; }
#free .fr-hud small { background: none; border: 0; padding: 0; }
#free .fr-hud-id small { font-size: 12px; font-weight: 700; color: var(--fw-leaf); }
#free .fr-hud-xp { flex: 1; min-width: 0; display: grid; gap: 3px; }
#free .fr-hud .fr-pts { margin: 0; display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--fw-ink); min-width: 0; }
#free .fr-pts b { font-size: 15px; }
#free .fr-pts small { margin-left: auto; font-size: 11px; color: var(--fw-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#free .fr-rankbar { max-width: none; width: 100%; height: 9px; border: 0; border-radius: 6px; background: #e6e9d6; }
#free .fr-rankbar i { border-radius: 6px; }
.fr-away-note { margin: -2px 0 0; font-size: 12px; color: var(--fw-sub); text-align: center; }

/* 森の時計 */
#free .fr-clock { border: 1.5px solid rgba(38, 48, 30, 0.6); border-radius: 12px; background: rgba(255, 255, 255, 0.92); }
#free .fr-clock small { color: var(--fw-sub); }

/* シラベのひとこと */
#free .free-body > .fr-sayrow { align-items: center; }
#free .free-body > .fr-sayrow .fr-face { width: 44px; height: 44px; border-width: 2px; }
#free .free-body > .fr-sayrow .fr-say { font-size: 13.5px; line-height: 1.6; border-width: 1.5px; border-color: #d4aa4a; padding: 8px 12px; }

/* きょうの調査（見出しに「いま：○○」） */
#free .fr-today.closed { padding: 2px 6px; border: 1.5px solid var(--fw-line); border-radius: 14px; background: var(--fw-card); }
#free .fr-today-h { gap: 8px; font-size: 13px; color: var(--fw-ink); padding: 6px 4px; }
#free .fr-today-h small { color: var(--fw-sub); }
.fr-today-next { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 400; color: var(--fw-sub); }
.fr-today-next.on { font-weight: 700; color: #8a5a00; }
#free .fr-today-h i { flex: none; border: 0; background: var(--fw-leaf-bg); color: var(--fw-leaf); padding: 2px 9px; }
#free .fr-modal-card li { color: var(--fw-sub); }
#free .fr-modal-card li.now { color: var(--fw-ink); }

/* 下のボタン：一段目（いつも）＝横長で小さめ・二段目（いまできる調査）＝大きく */
#free .fr-actions { gap: 8px; margin-top: 0; }
#free .fr-ab-row.sub { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); }
#free .fr-ab-row.sub .fr-ab { grid-auto-flow: column; justify-content: center; align-items: center; gap: 5px; padding: 7px 6px; border: 1.5px solid var(--fw-ink); border-radius: 12px; box-shadow: 0 2px 0 rgba(38, 48, 30, 0.35); background: var(--fw-card); }
#free .fr-ab-row.sub .fr-ab span { font-size: 18px; }
#free .fr-ab-row.sub .fr-ab small { font-size: 12.5px; }
#free .fr-ab-row.sub .fr-ab.ready { background: #e4f7cf; border-color: var(--fw-leaf); }
#free .fr-ab-row.main { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
#free .fr-ab-row.main .fr-ab { padding: 10px 4px 8px; border-width: 2.5px; background: var(--fw-sun); }
#free .fr-ab-row.main .fr-ab span { font-size: 26px; }
#free .fr-ab-row.main .fr-ab small { font-size: 13px; }
#free .fr-ab small { color: var(--fw-ink); }

/* 下から出る板：見出し・説明・カード */
#free .fr-sheet { gap: 10px; padding: 10px 14px 16px; border-width: 2px; border-color: var(--fw-ink); background: #fbfcf4; }
#free .fr-sheet-x { position: sticky; top: -10px; margin: -10px -14px 0; padding: 10px 14px 8px; align-self: stretch; text-align: left; border: 0; border-radius: 0; box-shadow: none; background: #fbfcf4; border-bottom: 1px solid var(--fw-line); font-size: 14px; color: var(--fw-leaf); }
#free .fr-h { font-size: 15px; color: var(--fw-ink); }
#free .fr-h small { display: block; margin-top: 2px; font-size: 12px; color: var(--fw-sub); }
#free .fr-g-note { font-size: 13px; line-height: 1.7; color: var(--fw-ink); background: var(--fw-leaf-bg); border: 1px solid #d6e5b3; padding: 8px 10px; }
#free .fr-note, #free .fr-nums { font-size: 12.5px; color: var(--fw-sub); }

/* 森を整える：1行に アイコン｜場所と つぎ｜ボタン */
#free .fr-habs { gap: 8px; }
#free .fr-hab { grid-template-columns: 36px minmax(0, 1fr); padding: 10px; border: 1.5px solid var(--fw-line); background: var(--fw-card); }
#free .fr-hab > div { grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: center; }
#free .fr-hab > div > b { grid-column: 1 / -1; font-size: 14px; }
#free .fr-hab small { font-size: 12.5px; color: var(--fw-sub); line-height: 1.5; }
#free .fr-hab .fr-go { justify-self: end; font-size: 13px; padding: 6px 14px; border-width: 2px; box-shadow: 0 2px 0 var(--fw-ink); white-space: nowrap; }
#free .fr-hab .fr-go:disabled { opacity: 1; background: #eceee2; color: #7a8070; border-color: #b9bfab; box-shadow: none; }
#free .fr-lv { font-style: normal; margin-left: 4px; letter-spacing: 2px; color: var(--fw-leaf); }
#free .fr-hab.lv3 { border-color: #d9b44a; background: #fffbe8; }

/* 調査の道具 */
#free .fr-tool { padding: 10px; border: 1.5px solid var(--fw-line); background: var(--fw-card); gap: 10px; }
#free .fr-tool.off { border-style: dashed; background: #f3f3ea; }
#free .fr-tool b { font-size: 15px; }
.fr-when { display: inline-block; margin: 3px 0 2px; padding: 1px 8px; font-size: 12px; font-weight: 700; color: var(--fw-leaf); background: var(--fw-leaf-bg); border-radius: 999px; }
#free .fr-tool.off .fr-when { color: #6d6f60; background: #e7e7da; }
#free .fr-tool small { font-size: 12.5px; line-height: 1.6; color: var(--fw-ink); }
#free .fr-tool p { font-size: 12px; color: var(--fw-sub); }

/* 記録：腕前の表 */
#free .fr-skills { gap: 6px; padding: 10px; border: 1.5px solid var(--fw-line); }
#free .fr-skrow { font-size: 12.5px; }
#free .fr-skbar { border: 0; background: #e6e9d6; }
#free .fr-best-g.g-none { color: #9aa08c; font-weight: 400; }
#free .fr-today-h { white-space: nowrap; }
#free .fr-today-h small { flex: none; }
#free .fr-bl { border: 1.5px solid var(--fw-ink); box-shadow: 0 2px 0 rgba(38, 48, 30, 0.35); background: var(--fw-card); }
#free .fr-bl small { font-size: 11.5px; color: var(--fw-sub); }
#free .fr-nb.done { border-color: #c9a000; background: #fff8d8; }
#free .free-body { width: min(100%, 760px); margin: 0 auto; } /* タブレット横などの広い画面では、まん中に寄せる */
#free .fr-idstep { margin: 6px 0 0; font-size: 13.5px; font-weight: 900; color: var(--fw-leaf); }
#free .fr-idstep small { font-weight: 400; color: var(--fw-sub); }
#free .fr-opt.sr small { display: block; font-weight: 400; font-size: 12px; color: var(--fw-sub); }
/* 一段目のボタン（レポート・整える・記録・道具）：せまい画面でも文字が切れないように（2026/10/22） */
#free .fr-ab-row.sub { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 5px; }
#free .fr-ab-row.sub .fr-ab { padding: 7px 3px; gap: 3px; }
#free .fr-ab-row.sub .fr-ab span { font-size: 16px; }
#free .fr-ab-row.sub .fr-ab small { font-size: clamp(11px, 3.1vw, 12.5px); overflow: visible; }

/* 🔦 ライトセンサス（夜専用。2026/10/22）：まっ暗な森を、ライトの輪でてらす */
.fr-night { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; border: 3px solid #000; background: #05070f; touch-action: none; user-select: none; }
.fr-night-bg { position: absolute; inset: 0; background: url(assets/free-grass.webp) center / cover; filter: brightness(0.9) saturate(0.8); }
.fr-dark { position: absolute; inset: 0; pointer-events: none; --lx: 50%; --ly: 50%; background: radial-gradient(circle at var(--lx) var(--ly), rgba(255, 230, 170, 0.0) 0, rgba(255, 230, 170, 0.0) 38px, rgba(2, 4, 14, 0.96) 62px); }
.fr-night .fr-timer { position: absolute; right: 8px; top: 6px; font-weight: 900; color: #fff; background: rgba(0, 0, 0, 0.6); border-radius: 12px; padding: 0 9px; z-index: 3; }
.fr-eye { position: absolute; transform: translate(-50%, -50%); display: flex; gap: 7px; padding: 12px; border: 0; background: none; opacity: 0; z-index: 2; cursor: pointer; }
.fr-eye.lit { opacity: 1; }
.fr-eye i { width: 9px; height: 9px; border-radius: 50%; background: var(--ec, #ffe68a); box-shadow: 0 0 8px 3px var(--ec, #ffe68a); animation: frBlink 2.4s infinite; }
.fr-eye.decoy i { background: #bfe6ff; box-shadow: 0 0 8px 3px #bfe6ff; }
.fr-eye.got { opacity: 1; filter: brightness(1.4); }
.fr-eye.got::after { content: '✓'; position: absolute; left: 50%; top: -6px; transform: translateX(-50%); color: #fff; font-weight: 900; font-size: 15px; }
.fr-eye.wrong { opacity: 0.3; }
@keyframes frBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }

/* 生物調査（2026/10/22）：時刻・季節・天気は森の絵にかぶせず、絵の上の帯に。痕跡の絵は丸く切りぬく。調査のルール */
#free .fr-clock { position: static; z-index: auto; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 2px 10px; margin: 0 0 6px; padding: 3px 12px; font-size: 14px; background: var(--fw-card, #fff); }
#free .fr-clock .fr-csub { font-size: 12.5px; color: var(--fw-sub); }
.fr-pop.sign img { width: 46px; height: 46px; object-fit: cover; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
.fr-rule { border: 1.5px solid var(--fw-line, #c9d3b8); border-radius: 12px; padding: 8px 12px; margin: 8px 0; background: #fff; }
.fr-rule > b { font-size: 15px; }
.fr-rule ol { margin: 6px 0 2px; padding-left: 1.4em; display: grid; gap: 4px; font-size: 13.5px; line-height: 1.5; }
.fr-rule.off { opacity: 0.6; }
.fr-rule.off small { display: block; color: var(--fw-sub); }

/* 時刻の帯の右に「きょうの調査」ボタン（2026/10/22） */
#free .fr-clock { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 4px 12px; }
.fr-clock-t { display: grid; gap: 1px; min-width: 0; }
#free .fr-clock .fr-csub { white-space: nowrap; font-size: 12px; }
.fr-todaybtn { flex: none; display: grid; gap: 1px; max-width: 52%; padding: 5px 10px; text-align: left; font: inherit; color: var(--fw-ink); background: #fff3c4; border: 2px solid #000; border-radius: 12px; box-shadow: 0 3px 0 #000; cursor: pointer; }
.fr-todaybtn b { font-size: 13px; white-space: nowrap; }
.fr-todaybtn small { font-weight: 400; color: var(--fw-sub); }
.fr-todaybtn .fr-today-next { font-size: 11px; max-width: 100%; }
.fr-tool-st { display: inline-block; margin-left: 8px; font-size: 11.5px; font-weight: 700; color: var(--fw-sub); }
.fr-tool-st.ok { color: #2f7d17; }
.fr-go.sm { margin-top: 6px; padding: 6px 14px; font-size: 13px; }

/* 事件簿の絵（Codex の絵。2026/10/22） */
.fr-caseart { margin: 6px 0 8px; border: 3px solid #000; border-radius: 14px; overflow: hidden; background: #eef0e2; }
.fr-caseart img { display: block; width: 100%; max-width: 420px; margin: 0 auto; height: auto; aspect-ratio: 1; object-fit: cover; }
.fr-casecap { margin: 4px 0 2px; font-size: 12px; font-weight: 700; color: var(--fw-sub, #6a6f63); }
.fr-casepics { height: 120px; }
.fr-case img { width: 100%; max-width: 76px; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.fr-casehit .fr-casethumb { grid-row: span 2; width: 48px; height: 48px; border-radius: 10px; border: 2px solid #000; object-fit: cover; }

/* Codex の絵（糞の分析・足跡トラップ・植生調査・道具。2026/10/22） */
.fr-scope { background: #2a2418 url('../../assets/free/scat/scope-bg.webp') center / cover; }
.fr-clueimg { display: block; width: 44px; height: 44px; object-fit: contain; pointer-events: none; }
.fr-clues .fr-clueimg { width: 34px; height: 34px; }
.fr-opt .fr-clueimg { width: 36px; height: 36px; }
.fr-bit.sand::before { content: none; }
.fr-sand { background: #e2c98f url('../../assets/free/trap/sand.webp') center / cover; }
.fr-quad { background: #8cbd55 url('../../assets/free/veg/open.webp') center / cover; }
.fr-quad.fence { background-image: url('../../assets/free/veg/fence.webp'); }
.fr-plant img { display: block; width: 40px; height: 40px; object-fit: contain; pointer-events: none; }
.fr-tool-i img { width: 44px; height: 44px; object-fit: contain; }

/* タイトルのモード4つ（2026/10/22 けいしさんの指示）：左上 ストーリー・右上 きょうの森・その下に 生物調査とエンドレス。ぜんぶ同じ大きさ。ランキングはタイトルから外した */
.modes { grid-auto-rows: 1fr; }
.modes .mode-btn, .modes .mode-btn.free, .modes .mode-btn.endless { width: auto; margin-top: 0; padding: 12px 4px; }
.modes .mode-btn[hidden] { display: none; }
.modes .mode-name { font-size: clamp(12px, 3.5vw, 17px); letter-spacing: -0.04em; }
@media (min-width: 700px) { .modes .mode-name { font-size: clamp(15px, 1.7vw, 21px); letter-spacing: 0; } }
.modes .mode-tag { white-space: nowrap; font-size: clamp(9px, 2.6vw, 10.5px); letter-spacing: 0; padding: 1px 8px; }
#free .fr-ab .fr-newb { top: 5px; right: 6px; } #free .fr-ab { position: relative; }
.fr-poster-img { display: block; width: 100%; max-width: 420px; margin: 6px auto; border: 3px solid #000; border-radius: 6px; box-shadow: 0 4px 0 #000; }
.fr-pop.sign i { color: #111; white-space: nowrap; }
#free .fr-ab .fr-newb { top: 3px; right: 4px; padding: 0 5px; font-size: 9px; border-width: 1.5px; }

#free .fr-late{margin:4px 0;padding:6px 8px;border-radius:8px;background:#fff3d6;color:#6b4a00;font-size:12px;line-height:1.5}

/* 2章：海と山のシェア率の帯（2026/10/24）。左が海・右が山。かたよると色がかわる */
.share-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 6px; font-family: var(--display); font-size: 12px; color: var(--paper); }
.share-l { color: #7fd3ff; white-space: nowrap; }
.share-r { color: #d9b36a; white-space: nowrap; }
.share-bar { position: relative; height: 10px; background: #8a6a2e; border-radius: 999px; overflow: hidden; border: 1.5px solid #000; }
.share-bar i { display: block; height: 100%; width: 50%; background: linear-gradient(90deg, #39a6e8, #7fd3ff); transition: width 0.4s ease; }
.share-bar b { position: absolute; left: 50%; top: -1px; bottom: -1px; width: 2px; margin-left: -1px; background: #fff; opacity: 0.8; } /* まん中（つりあい）の目印 */
.share-row em { font-style: normal; min-width: 5.2em; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.share-row.warn-sea .share-bar i { background: linear-gradient(90deg, #e8553a, #ff9a3c); }
.share-row.warn-mountain .share-bar { background: #e8553a; }
.share-row.warn-sea em, .share-row.warn-mountain em { color: var(--orange); animation: bump 1.2s ease infinite; }

/* ストーリーのマップ：1章と2章を、横にスライドして行き来する（2026/10/24） */
.map-card { grid-template-columns: minmax(0, 1fr); }
.map-slider { position: relative; width: 100%; min-width: 0; min-height: 0; height: 100%; overflow: hidden; border-radius: 18px; touch-action: pan-y; }
.map-track { display: flex; width: 200%; height: 100%; transition: transform 0.4s cubic-bezier(0.3, 0.7, 0.2, 1); }
.map-track.v2 { transform: translateX(-50%); }
.map-track > .map-path { flex: 0 0 50%; width: 50%; min-height: 0; height: 100%; }
.map-chap { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); font-family: var(--display); font-size: 12px; color: #4a2e12; background: #ffe9a8; border: 2.5px solid #2c1a08; border-radius: 999px; padding: 5px 11px 6px; box-shadow: 0 3px 0 #2c1a08; cursor: pointer; animation: bump 2.2s ease infinite; white-space: nowrap; }
.map-banner { position: relative; }
/* 2章の景色：海・里海（z5）と 山（z6）。森（z1）は 1章と同じ草はら */
.map-zone.z5 { background: radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.25), transparent 55%), linear-gradient(180deg, #7fd3ff 0%, #39a6e8 38%, #1f6fb0 100%); }
.map-zone.z5::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(8deg, rgba(255, 255, 255, 0) 0 22px, rgba(255, 255, 255, 0.13) 22px 24px); }
.map-zone.z6 { background: radial-gradient(ellipse at 70% 20%, rgba(255, 255, 255, 0.3), transparent 50%), linear-gradient(180deg, #cfd8dc 0%, #8d9aa0 40%, #5b6b4a 100%); filter: saturate(0.85); }
.map-banner.z5 { background: repeating-linear-gradient(176deg, rgba(0, 0, 0, 0) 0 9px, rgba(0, 30, 70, 0.12) 9px 11px), linear-gradient(#3b8fd0, #1f5f9a); border-color: #0f3158; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), 0 5px 0 #0a2038; }
.map-banner.z6 { background: repeating-linear-gradient(176deg, rgba(0, 0, 0, 0) 0 9px, rgba(20, 30, 10, 0.12) 9px 11px), linear-gradient(#7a8a62, #55663f); border-color: #2d3a1f; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), 0 5px 0 #1b2412; }
.map-zone.z8 { background: linear-gradient(90deg, #39a6e8 0%, #7fd3ff 44%, #dfe5e6 50%, #aab6a0 56%, #5b6b4a 100%); }
.map-banner.z8 { background: repeating-linear-gradient(176deg, rgba(0, 0, 0, 0) 0 9px, rgba(0, 30, 70, 0.1) 9px 11px), linear-gradient(90deg, #3b8fd0, #7a8a62); border-color: #24352f; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), 0 5px 0 #0a2038; }

/* 神遊び（再戦。2026/10/24） */
.mode-btn.godplay { width: 100%; margin-top: 10px; background: linear-gradient(135deg, #ffd9d9, #e5d2ff); }
.mode-btn.godplay[hidden] { display: none; }
#godplay { z-index: 40; }
.gp-card { max-height: calc(var(--app-h, 100vh) - 24px); overflow-y: auto; }
.gp-gods { display: flex; gap: 8px; justify-content: center; margin: 8px 0; }
.gp-god { font: inherit; font-size: 13px; font-weight: 800; color: #000; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 12px; background: #fff; border: 2px solid #000; border-radius: 14px; cursor: pointer; }
.gp-god img { width: 56px; height: 56px; object-fit: cover; object-position: top; border-radius: 50%; }
.gp-god.on { background: #ffe9a8; }
.gp-god.sil img { filter: brightness(0); opacity: 0.5; }
.gp-h { margin: 10px 0 4px; font-size: 12px; font-weight: 800; color: #555; text-align: left; }
.gp-row { display: flex; gap: 8px; }
.gp-opt { flex: 1; font: inherit; font-size: 14px; font-weight: 800; color: #000; padding: 8px 6px; background: #fff; border: 2px solid #000; border-radius: 12px; cursor: pointer; }
.gp-opt.on { background: #ffb3a1; }
.gp-binds { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; }
.gp-bind { font: inherit; color: #000; text-align: left; display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; background: #fff; border: 2px solid #000; border-radius: 12px; cursor: pointer; }
.gp-bind.on { background: #b8f23c; }
.gp-bn { font-size: 13px; font-weight: 800; }
.gp-bd { font-size: 11px; color: #555; }
.gp-best { margin: 10px 0 6px; font-size: 12.5px; font-weight: 800; color: #2a5a8a; }
.gp-opt { white-space: nowrap; font-size: 13px; }
.gp-binds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gp-bd { line-height: 1.3; }
.gp-card .big-btn { margin-top: 6px; }
.modes + .mode-btn.godplay, .mode-btn.godplay { padding: 8px 4px; }
.gp-bd { word-break: keep-all; overflow-wrap: anywhere; }

/* 神遊び：お題（ステージ）のカード */
.gp-body { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; }
.gp-stage { font: inherit; color: #000; text-align: left; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border: 2px solid #000; border-radius: 14px; cursor: pointer; }
.gp-stage.done { background: #efffd0; }
.gp-stage.lock { background: #e8e8e8; color: #777; cursor: default; }
.gp-no { flex: none; width: 28px; height: 28px; display: grid; place-items: center; font-weight: 900; background: #ffe9a8; border: 2px solid #000; border-radius: 50%; }
.gp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gp-name { font-size: 15px; }
.gp-theme { font-size: 11.5px; color: #555; word-break: keep-all; overflow-wrap: anywhere; }
.gp-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.gp-chips i { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 1px 6px; background: #f3e8ff; border-radius: 999px; white-space: nowrap; }
.gp-best { flex: none; font-size: 12px; font-weight: 800; color: #2a5a8a; }

/* 2章のマップ：深さで景色がかわる（浅い海 z5 → 沖 z9 → 深海 z10。山は z6）。2026/10/25 */
.map-zone.z9 { background: radial-gradient(ellipse at 30% 25%, rgba(180, 235, 255, 0.18), transparent 55%), linear-gradient(180deg, #1f6fb0 0%, #1a5c9e 45%, #13427a 100%); }
.map-zone.z9::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(8deg, rgba(255, 255, 255, 0) 0 26px, rgba(255, 255, 255, 0.07) 26px 28px); }
.map-zone.z10 { background: radial-gradient(ellipse at 50% 20%, rgba(80, 140, 220, 0.18), transparent 60%), linear-gradient(180deg, #13427a 0%, #0a2448 40%, #040c1c 100%); }
.map-banner.z9 { background: repeating-linear-gradient(176deg, rgba(0, 0, 0, 0) 0 9px, rgba(0, 20, 60, 0.15) 9px 11px), linear-gradient(#1f6fb0, #134a85); border-color: #0a2a52; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), 0 5px 0 #06182f; }
.map-banner.z10 { background: repeating-linear-gradient(176deg, rgba(0, 0, 0, 0) 0 9px, rgba(0, 0, 20, 0.2) 9px 11px), linear-gradient(#132d57, #060f24); border-color: #03070f; box-shadow: inset 0 2px 0 rgba(120, 170, 255, 0.2), 0 5px 0 #02050b; }

/* 2章の海：深さの色（河口と浜〜アトランティス）。色は storymap.js の DEPTH（--a が上・--b が下） */
.map-zone.zd { background: linear-gradient(180deg, var(--a), var(--b)); }
.map-zone.zd::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(8deg, rgba(255, 255, 255, 0) 0 26px, rgba(255, 255, 255, 0.06) 26px 28px); }
.map-banner.zd { color: var(--t, #fff); background: repeating-linear-gradient(176deg, rgba(0, 0, 0, 0) 0 9px, rgba(0, 0, 20, 0.14) 9px 11px), linear-gradient(var(--a), var(--b)); border-color: #03070f; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.22), 0 5px 0 rgba(0, 0, 0, 0.55); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.map-banner.zd small { color: inherit; opacity: 0.8; }

/* 2章のマップ：横から見た断面図（左が山・陸の岩、右が空と海）。右がわに高さ・深さの目もり（2026/10/26） */
.map-art { position: absolute; left: 0; top: 0; width: 100%; overflow: hidden; pointer-events: none; background: #2b86c6; } /* 2章のマップの背景の絵（Codex の絵。2026/10/27） */
.map-art img { position: absolute; left: 0; width: 100%; object-fit: fill; display: block; }
.map-side { position: absolute; left: 0; bottom: 0; width: 100%; pointer-events: none; }
.map-side path { vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.sv-earth { stroke: rgba(30, 20, 10, 0.55); stroke-width: 3; }
.sv-surf { fill: none; stroke: rgba(255, 255, 255, 0.85); stroke-width: 3; stroke-dasharray: 10 6; }
.sv-route { fill: none; stroke: rgba(255, 255, 255, 0.7); stroke-width: 5; stroke-dasharray: 1 12; }
.map-gauge { position: absolute; right: 0; top: 0; width: 76px; pointer-events: none; border-left: 2px solid rgba(255, 255, 255, 0.55); background: linear-gradient(90deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.3)); }
.map-gtick { position: absolute; left: 0; right: 0; transform: translateY(50%); display: flex; flex-wrap: wrap; align-items: center; gap: 0 3px; padding-left: 0; white-space: nowrap; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); }
.map-gtick i { flex: none; width: 9px; height: 3px; background: #fff; border-radius: 2px; }
.map-gtick b { font-family: var(--display); font-weight: 400; font-size: 12.5px; }
.map-gtick small { flex: 0 0 100%; padding-left: 12px; font-size: 10px; font-weight: 800; opacity: 0.9; }
.map-gtick.zero b { font-size: 15px; color: #fff3a6; }
.map-gtick.up b { color: #fff; }
.map-gtick.down b { color: #dff4ff; }
/* 2章の断面図の一枚絵：太陽・雲・飾り・深海の光・さかいめの線・進む向き（2026/10/26） */
.sv-sun { position: absolute; width: 46px; height: 46px; border-radius: 50%; transform: translate(-50%, 0); background: radial-gradient(circle, #fffbe0 0 45%, #ffe27a 60%, rgba(255, 226, 122, 0) 72%); box-shadow: 0 0 40px 18px rgba(255, 240, 170, 0.55); pointer-events: none; }
.sv-cloud { position: absolute; transform: translate(-50%, 50%); font-size: 34px; opacity: 0.92; pointer-events: none; animation: svCloud 14s ease-in-out infinite alternate; }
.sv-cloud.s { font-size: 24px; animation-duration: 18s; }
@keyframes svCloud { to { margin-left: 18px; } }
.sv-deco { position: absolute; transform: translate(-50%, 50%); font-size: 20px; pointer-events: none; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.3)); }
.sv-deco.dark { filter: drop-shadow(0 0 4px rgba(140, 220, 255, 0.8)) brightness(0.85); }
.sv-deco.fly { font-size: 22px; }
.sv-glow { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #9ff3ff; box-shadow: 0 0 8px 3px rgba(120, 240, 255, 0.75); pointer-events: none; animation: svGlow 4s ease-in-out infinite; }
.sv-snow { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); pointer-events: none; }
@keyframes svGlow { 50% { opacity: 0.2; } }
@media (prefers-reduced-motion: reduce) { .sv-cloud, .sv-glow { animation: none; } }
.sv-line { position: absolute; right: 76px; transform: translateY(50%); border-top: 2px dashed rgba(255, 255, 255, 0.85); pointer-events: none; }
.sv-line span { position: absolute; right: 0; bottom: 3px; font-size: 10.5px; font-weight: 900; color: #1c3b45; background: rgba(255, 255, 255, 0.88); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.sv-line.dark { border-top-color: rgba(160, 220, 255, 0.7); }
.sv-line.dark span { color: #e6f6ff; background: rgba(5, 20, 45, 0.82); border: 1px solid rgba(160, 220, 255, 0.5); }
.sv-dir { position: absolute; right: 80px; transform: translateY(50%); font-size: 12px; font-weight: 900; color: #fff; background: rgba(30, 60, 90, 0.72); border-radius: 999px; padding: 3px 10px; white-space: nowrap; pointer-events: none; }
.sv-dir.up { background: rgba(70, 110, 60, 0.85); }
.sv-dir.down { background: rgba(20, 70, 130, 0.85); }
/* 名前の長い生き物（植物プランクトン・カタクチイワシ・タカアシガニ など）は、カードの中に収まるよう小さめに（2026/10/27） */
.sp-card .n.long { font-size: 0.8em; letter-spacing: -0.5px; }

/* 森の記録の「👥 キャラクター」（2026/10/28） */
.ch-wrap { display: block; min-width: 0; }
.ch-chips { min-height: 82px; }
.ch-chip, .ch-face { color: #222; }
.ch-chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 4px 8px; margin-bottom: 6px; }
.ch-chip { position: relative; flex: 0 0 auto; width: 64px; padding: 4px 2px 3px; border: 2px solid #000; border-radius: 12px; background: #fff; font: inherit; font-size: 11px; font-weight: 900; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ch-chip img { width: 46px; height: 46px; object-fit: cover; object-position: 50% 4%; border-radius: 50%; background: #eef6df; }
.ch-chip.on { background: #fff3c4; box-shadow: 0 3px 0 #000; transform: translateY(-2px); }


.ch-new { position: absolute; top: -6px; right: -4px; padding: 0 4px; border-radius: 6px; background: #e8433a; color: #fff; font-style: normal; font-size: 9px; font-weight: 900; }
.ch-part .ch-new { position: static; margin-left: 4px; vertical-align: middle; }
.ch-card { display: grid; grid-template-columns: minmax(120px, 42%) 1fr; gap: 10px; align-items: end; background: linear-gradient(#eef6df, #fff8e6); border: 2px solid #000; border-radius: 16px; padding: 8px 10px 10px; }
.ch-art { height: min(46vh, 340px); display: flex; align-items: flex-end; justify-content: center; }
.ch-art img { max-height: 100%; max-width: 100%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,.18)); }
.ch-title { margin: 0; font-size: 12px; font-weight: 700; color: #4a5a40; }
.ch-name { margin: 0 0 8px; font-family: var(--display); font-size: 26px; }
.ch-faces { display: flex; flex-wrap: wrap; gap: 4px; }
.ch-face { padding: 3px 8px; border: 1.5px solid #3d6b1f; border-radius: 999px; background: #fff; font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ch-face.on { background: #3d6b1f; color: #fff; }

.ch-parts { display: grid; gap: 8px; margin: 10px 0; }
.ch-part { background: #fff; border: 1.5px solid #9cc56a; border-radius: 12px; padding: 8px 12px; }
.ch-part h4 { margin: 0 0 4px; font-size: 14px; }
.ch-part h4 small { font-weight: 700; color: #a0522d; font-size: 11px; }
.ch-part p { margin: 0; font-size: 13px; line-height: 1.7; }
.ch-part.lock { background: #f2f2ec; border-style: dashed; border-color: #bbb; color: #777; }
@media (max-width: 420px) { .ch-card { grid-template-columns: 1fr; } .ch-art { height: 38vh; } }

/* 神遊びの画面（2026/10/28）：キャラえらび → 左上にキャラ・右上にお題・下にそのお題の説明 */
.gp-gods { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 10px 0; }
.gp-god { padding: 8px 6px 10px; gap: 2px; }
.gp-god img { width: 96px; height: 96px; }
.gp-god b { font-size: 16px; }
.gp-god span { font-size: 11.5px; color: #555; font-weight: 700; }
.gp-stage-view { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; grid-template-areas: "char list" "info info"; gap: 8px 10px; margin: 8px 0 10px; align-items: stretch; }
.gp-stage-view[hidden], .gp-gods[hidden] { display: none; }
.gp-char { grid-area: char; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; background: linear-gradient(#f3e8ff, #fff8e6); border: 2px solid #000; border-radius: 14px; padding: 6px; min-height: 180px; }
.gp-char img { max-width: 100%; max-height: 200px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0,0,0,.2)); }
.gp-char p { margin: 4px 0 0; text-align: center; line-height: 1.2; }
.gp-char b { display: block; font-size: 16px; }
.gp-char small { font-size: 11px; color: #555; font-weight: 700; }
.gp-stage-view .gp-body { grid-area: list; margin: 0; justify-content: center; }
.gp-stage-view .gp-stage { padding: 8px 10px; }
.gp-stage.on { background: #ffe9a8; box-shadow: 0 3px 0 #000; }
.gp-stage.on.done { background: #e4f7b8; }
.gp-info { grid-area: info; background: #fff; border: 2px solid #000; border-radius: 14px; padding: 10px 12px; text-align: left; }
.gp-iname { margin: 0 0 2px; font-size: 16px; }
.gp-info .gp-theme { margin: 0 0 6px; font-size: 12.5px; }
.gp-info .gp-binds { list-style: none; margin: 0 0 6px; padding: 0; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.gp-info .gp-binds li { display: flex; flex-direction: column; gap: 1px; padding: 5px 8px; background: #f3e8ff; border-radius: 10px; font-size: 11.5px; }
.gp-info .gp-binds li b { font-size: 12.5px; }
.gp-rec { margin: 4px 0 6px; font-size: 12.5px; font-weight: 800; color: #2a5a8a; }
.gp-rec small { color: #777; font-weight: 700; }
.gp-info .big-btn { width: 100%; margin: 0; }
@media (max-width: 380px) { .gp-stage-view { grid-template-columns: 1fr 1.2fr; } }
.gp-info .big-btn { font-size: 16px; padding: 10px 12px; white-space: nowrap; }

/* ───── 神遊び（再戦）の画面：オシャレでかっこよく（2026/10/28 けいしさんの指示） ───── */
#godplay .gp-card { --ga: #b48cff; --gb: #ffd36a; position: relative; width: min(100%, 560px); color: #f4f0ff; border: 3px solid #000; background:
  radial-gradient(120% 70% at 50% 0%, #3b2468 0%, transparent 60%),
  radial-gradient(90% 60% at 100% 100%, #0f3a4a 0%, transparent 60%),
  linear-gradient(160deg, #161028, #0b0a18 60%, #101a2a); box-shadow: 0 6px 0 #000, 0 0 0 2px #ffd36a55 inset; overflow-x: hidden; }
#godplay .gp-card::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5; background-image:
  radial-gradient(1.2px 1.2px at 12% 18%, #fff, transparent), radial-gradient(1px 1px at 72% 12%, #fff, transparent), radial-gradient(1.4px 1.4px at 88% 44%, #ffe9a8, transparent),
  radial-gradient(1px 1px at 34% 62%, #fff, transparent), radial-gradient(1.2px 1.2px at 58% 84%, #cfe8ff, transparent), radial-gradient(1px 1px at 8% 88%, #fff, transparent); }
#godplay .gp-card > * { position: relative; }
.gp-title { margin: 0; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.gp-title span { font-family: var(--display); font-size: 34px; letter-spacing: .12em; background: linear-gradient(180deg, #fff6d6, #ffd36a 55%, #c98a1c); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 #000) drop-shadow(0 0 12px #ffd36a66); }
.gp-title small { margin-top: 4px; font-size: 10px; font-weight: 900; letter-spacing: .38em; color: #ffd36a; opacity: .85; }
#gpDesc { margin: 6px 0 4px; color: #cdbfff; font-size: 13px; letter-spacing: .08em; }

/* キャラえらび：縦長のカード。うしろで その神の紋がゆっくり回る */
#godplay .gp-gods { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 12px 0; }
#godplay .gp-god { position: relative; overflow: hidden; min-height: 300px; padding: 0; display: block; color: #fff; text-align: left; border: 2px solid var(--ga); border-radius: 18px; cursor: pointer;
  background: radial-gradient(80% 55% at 50% 38%, color-mix(in srgb, var(--ga) 45%, transparent), transparent 70%), linear-gradient(180deg, #1c1436, #0b0a18);
  box-shadow: 0 0 0 1px #000, 0 6px 18px #0008, inset 0 0 24px color-mix(in srgb, var(--ga) 30%, transparent);
  transform: skewX(-4deg); transition: transform .2s, box-shadow .2s; animation: gpIn .5s calc(var(--k, 0) * .12s) both cubic-bezier(.2, 1.3, .4, 1); }
#godplay .gp-god > * { transform: skewX(4deg); }
#godplay .gp-god:hover, #godplay .gp-god:focus-visible { transform: skewX(-4deg) translateY(-4px) scale(1.02); box-shadow: 0 0 0 1px #000, 0 10px 24px #000a, 0 0 22px var(--ga); }
#godplay .gp-god .gp-art { position: absolute; left: 50%; bottom: 74px; width: auto; height: 230px; max-width: 120%; translate: -50% 0; border-radius: 0; object-fit: contain; filter: drop-shadow(0 4px 8px #000a) drop-shadow(0 0 10px color-mix(in srgb, var(--ga) 60%, transparent)); }
.gp-sigil { position: absolute; left: 50%; top: 42%; width: 240px; height: 240px; translate: -50% -50%; background: center / contain no-repeat; opacity: .28; mix-blend-mode: screen; animation: gpSpin 40s linear infinite; pointer-events: none; }
#godplay .gp-god .gp-plate { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 14px 12px; background: linear-gradient(transparent, #000c 35%); display: flex; flex-direction: column; gap: 1px; }
.gp-plate small { font-size: 10.5px; font-weight: 900; letter-spacing: .18em; color: var(--gb); }
.gp-plate b { font-family: var(--display); font-size: 26px; line-height: 1.05; text-shadow: 0 2px 0 #000, 0 0 12px var(--ga); }
.gp-plate em { font-style: normal; font-size: 10.5px; color: #e6dcff; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-pips { display: flex; gap: 4px; margin-top: 4px; }
.gp-pips i { width: 14px; height: 5px; border-radius: 3px; background: #ffffff2e; }
.gp-pips i.on { background: var(--gb); box-shadow: 0 0 6px var(--gb); }

/* お題の画面：左上キャラ・右上お題・下に説明 */
#godplay .gp-stage-view { grid-template-columns: minmax(120px, 40%) 1fr; gap: 10px; animation: gpFade .35s both; }
#godplay .gp-char { position: relative; overflow: hidden; min-height: 230px; border: 2px solid var(--ga); border-radius: 16px; padding: 0; justify-content: flex-end;
  background: radial-gradient(80% 60% at 50% 40%, color-mix(in srgb, var(--ga) 45%, transparent), transparent 70%), linear-gradient(180deg, #1c1436, #0b0a18); box-shadow: inset 0 0 22px color-mix(in srgb, var(--ga) 30%, transparent); }
#godplay .gp-char .gp-sigil { width: 200px; height: 200px; top: 40%; }
#godplay .gp-char .gp-art { position: relative; max-height: 210px; margin-bottom: 40px; filter: drop-shadow(0 4px 8px #000a) drop-shadow(0 0 10px color-mix(in srgb, var(--ga) 60%, transparent)); animation: gpFloat 3.6s ease-in-out infinite; }
#godplay .gp-char .gp-plate { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 8px 10px; text-align: left; background: linear-gradient(transparent, #000d 40%); }
#godplay .gp-char .gp-plate b { font-size: 21px; }
#godplay .gp-stage-view .gp-body { gap: 6px; }
#godplay .gp-stage { position: relative; color: #f4f0ff; background: linear-gradient(90deg, #ffffff12, #ffffff05); border: 1.5px solid #ffffff2a; border-radius: 12px; padding: 8px 10px; gap: 10px; transition: background .15s, border-color .15s, transform .15s; }
#godplay .gp-stage:hover:not(.lock) { transform: translateX(3px); border-color: var(--ga); }
#godplay .gp-stage.on { background: linear-gradient(90deg, color-mix(in srgb, var(--ga) 55%, transparent), color-mix(in srgb, var(--ga) 12%, transparent)); border-color: var(--gb); box-shadow: 0 0 14px color-mix(in srgb, var(--ga) 55%, transparent); }
#godplay .gp-stage.on::before { content: ''; position: absolute; left: -2px; top: 18%; bottom: 18%; width: 4px; border-radius: 2px; background: var(--gb); box-shadow: 0 0 8px var(--gb); }
#godplay .gp-stage.done { background: linear-gradient(90deg, #ffffff16, #ffffff05); }
#godplay .gp-stage.on.done { background: linear-gradient(90deg, color-mix(in srgb, var(--ga) 55%, transparent), color-mix(in srgb, var(--ga) 12%, transparent)); }
#godplay .gp-stage.lock { background: #ffffff08; color: #8a83a8; border-style: dashed; }
#godplay .gp-no { width: 34px; height: 34px; font-family: var(--display); font-size: 16px; color: #1a1030; background: linear-gradient(180deg, #fff3c4, var(--gb)); border: 2px solid #000; border-radius: 10px; transform: rotate(45deg); }
#godplay .gp-stage .gp-no { display: grid; place-items: center; }
#godplay .gp-main small { font-size: 9.5px; font-weight: 900; letter-spacing: .2em; color: var(--gb); opacity: .9; }
#godplay .gp-name { font-size: 15px; letter-spacing: .04em; }
.gp-seal { display: inline-grid; place-items: center; width: 26px; height: 26px; font-style: normal; font-family: var(--display); font-size: 13px; color: #c8102e; border: 2px solid #c8102e; border-radius: 50%; transform: rotate(-14deg); background: #fff5; }
#godplay .gp-info { color: #f4f0ff; background: linear-gradient(180deg, #ffffff10, #ffffff06); border: 1.5px solid color-mix(in srgb, var(--gb) 60%, transparent); border-radius: 16px; padding: 12px 14px 14px; backdrop-filter: blur(2px); animation: gpFade .3s both; }
.gp-kicker { margin: 0; font-size: 10.5px; font-weight: 900; letter-spacing: .3em; color: var(--gb); }
#godplay .gp-iname { margin: 0 0 4px; font-family: var(--display); font-size: 24px; letter-spacing: .06em; text-shadow: 0 2px 0 #000, 0 0 12px var(--ga); }
#godplay .gp-info .gp-theme { color: #ddd3ff; font-size: 12.5px; margin: 0 0 6px; }
.gp-quote { margin: 0 0 8px; padding: 6px 10px; border-left: 3px solid var(--ga); background: #0006; border-radius: 0 10px 10px 0; font-size: 12.5px; font-weight: 700; color: #fff; }
#godplay .gp-info .gp-binds li { background: color-mix(in srgb, var(--ga) 22%, #0008); border: 1px solid color-mix(in srgb, var(--ga) 50%, transparent); color: #f4f0ff; }
#godplay .gp-info .gp-binds li span { color: #cfc4ef; }
#godplay .gp-rec { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 8px 0 10px; font-size: 12px; color: #cdbfff; }
#godplay .gp-rec b { margin-left: 6px; font-family: var(--display); font-size: 16px; color: var(--gb); }
.gp-new { font-weight: 900; color: #fff; letter-spacing: .1em; }
.gp-hard b { color: #ff8a8a !important; }
.gp-go { position: relative; overflow: hidden; width: 100%; padding: 12px 10px; font-family: var(--display); font-size: 19px; letter-spacing: .14em; color: #1a1030; cursor: pointer; border: 3px solid #000; border-radius: 14px;
  background: linear-gradient(180deg, #fff6d6, var(--gb) 45%, #e0a020); box-shadow: 0 5px 0 #000, 0 0 20px color-mix(in srgb, var(--gb) 60%, transparent); white-space: nowrap; }
.gp-go::after { content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, #fff9, transparent); transform: skewX(-20deg); animation: gpShine 2.6s 0.6s infinite; }
.gp-go:active { transform: translateY(3px); box-shadow: 0 2px 0 #000; }
#godplay #gpBack, #godplay #gpClose { background: #ffffff14; color: #f4f0ff; border-color: #ffffff55; box-shadow: none; }
#godplay #gpBack:hover, #godplay #gpClose:hover { background: #ffffff26; }
@keyframes gpSpin { to { rotate: 360deg; } }
@keyframes gpIn { from { opacity: 0; translate: 0 18px; } }
@keyframes gpFade { from { opacity: 0; translate: 0 6px; } }
@keyframes gpFloat { 50% { translate: 0 -5px; } }
@keyframes gpShine { 0% { left: -60%; } 45%, 100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) { .gp-sigil, #godplay .gp-char .gp-art, .gp-go::after, #godplay .gp-god { animation: none; } }
@media (max-width: 380px) { #godplay .gp-god { min-height: 260px; } #godplay .gp-god .gp-art { height: 190px; } .gp-title span { font-size: 28px; } }
/* 神遊びの画面の手直し：名前は金と白のグラデーション文字・お題の番号はひし形の札（字はまっすぐ） */
#godplay .gp-gods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gp-plate b, #godplay .gp-iname { color: transparent; background: linear-gradient(180deg, #ffffff, color-mix(in srgb, var(--ga) 35%, #fff) 60%, var(--gb)); -webkit-background-clip: text; background-clip: text; text-shadow: none; filter: drop-shadow(0 2px 0 #000); }
#godplay .gp-no { position: relative; transform: none; background: none; border: 0; color: #1a1030; z-index: 0; }
#godplay .gp-no::before { content: ''; position: absolute; inset: 3px; z-index: -1; transform: rotate(45deg); background: linear-gradient(180deg, #fff3c4, var(--gb)); border: 2px solid #000; border-radius: 6px; }
#godplay .gp-stage.lock .gp-no::before { background: #5a5470; }
#godplay .gp-gods { justify-content: stretch; }
#godplay .gp-god { width: 100%; }
#godplay .gp-iname { font-family: 'Zen Kaku Gothic New', system-ui, sans-serif; font-weight: 900; font-size: 23px; }
#godplay .gp-no { font-family: 'Zen Kaku Gothic New', system-ui, sans-serif; font-weight: 900; font-size: 14px; }
#godplay .gp-gods, #godplay .gp-stage-view { width: 100%; align-self: stretch; }
.gp-plate b { font-family: 'Zen Kaku Gothic New', system-ui, sans-serif; font-weight: 900; letter-spacing: .08em; }

/* ── タイトル画面の新しい見た目の試作（2026/10/29 けいしさんの案A：AIらしさを減らす）──
   html.ui2 のときだけ効く（テストモードの「🎨 タイトルの新しい見た目（試作）」か、アドレスの ?ui2）。
   決まり：絵文字は出さない・押せる大きなものだけ濃いふち・色は森の3色（深緑・土・生成り）・影はうすく1段 */
html.ui2 {
  --u-paper: #f5f0e1; --u-ink: #22301f; --u-sub: #5e6a55; --u-line: rgba(34, 48, 31, 0.16);
  --u-green: #2e5a32; --u-moss: #e4ead2; --u-soil: #efe2c6; --u-sky: #dfe9e6; --u-dusk: #e8e0ea;
}
html.ui2 #menu .em { display: none; }
html.ui2 .card.menu { background: var(--u-paper); border: 3px solid var(--u-ink); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35); border-radius: 18px; }
html.ui2 .menu .tagline { color: var(--u-sub); font-weight: 700; letter-spacing: 0.08em; }
/* モード：同じ形のカード。左に小さな絵、右に名前。上の小さな見出しは黒い札ではなく、細い字 */
html.ui2 .modes { gap: 8px; }
html.ui2 .menu .mode-btn {
  position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 10px; row-gap: 1px;
  justify-items: start; align-content: center; text-align: left;
  padding: 10px 10px 10px 10px; border: 2px solid var(--u-ink); border-radius: 12px; box-shadow: 0 3px 0 var(--u-ink);
  background: #fffdf6; color: var(--u-ink); filter: none;
}
html.ui2 .menu .mode-btn::before {
  content: ''; grid-row: 1 / 4; grid-column: 1; align-self: center; width: 44px; height: 44px; border-radius: 10px;
  background: var(--u-moss) center / 78% no-repeat; box-shadow: inset 0 0 0 1px var(--u-line);
}
html.ui2 .menu .mode-btn > * { grid-column: 2; }
html.ui2 .menu .mode-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--u-ink); }
html.ui2 .menu .mode-tag { background: none; color: var(--u-sub); padding: 0; font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; }
html.ui2 .menu .mode-name { font-family: var(--body); font-weight: 900; font-size: clamp(14px, 4vw, 17px); letter-spacing: 0.02em; }
html.ui2 .menu .mode-sub { color: var(--u-sub); font-size: 11px; min-height: 0; }
/* いちばん大事なストーリーだけ、深緑でぬる */
html.ui2 .menu .mode-btn.story { background: var(--u-green); color: #fbf8ee; }
html.ui2 .menu .mode-btn.story .mode-tag, html.ui2 .menu .mode-btn.story .mode-sub { color: #cfe0bf; }
html.ui2 .menu .mode-btn.story::before { background-color: #3f7343; background-image: url(../../assets/terrain/nest-tree-1.webp); box-shadow: none; }
html.ui2 .menu .mode-btn.daily::before { background-color: var(--u-soil); background-image: url(../../assets/icons/rabbit.webp); }
html.ui2 .menu .mode-btn.free::before { background-color: var(--u-moss); background-image: url(../../assets/free/cam.webp); }
html.ui2 .menu .mode-btn.endless::before { background-color: var(--u-sky); background-image: url(../../assets/terrain/map-swirl.svg); background-size: 120%; }
html.ui2 .menu .mode-btn.godplay { margin-top: 8px; }
html.ui2 .menu .mode-btn.godplay::before { background-color: var(--u-dusk); background-image: url(../../assets/chara/koyomi3-face-grin.webp); background-size: cover; }
html.ui2 .resume-btn { background: #fffdf6; color: var(--u-ink); border: 2px solid var(--u-ink); border-radius: 12px; box-shadow: 0 3px 0 var(--u-ink); }
/* サブのボタン：ふちなしの文字の一覧（2列・細い線で区切る）。メインより目立たせない */
html.ui2 .menu-links { gap: 0 14px; margin-top: 12px; border-top: 1px solid var(--u-line); }
html.ui2 .menu-links .tips-btn {
  background: none; border: 0; border-bottom: 1px solid var(--u-line); border-radius: 0; box-shadow: none;
  padding: 10px 2px; text-align: left; font-weight: 700; font-size: 14px; color: var(--u-ink);
}
html.ui2 .menu-links .tips-btn::after { content: '›'; float: right; color: var(--u-sub); font-weight: 400; }
html.ui2 .menu-links .tips-btn:hover { background: rgba(46, 90, 50, 0.06); }
html.ui2 .menu-links .tips-btn:active { transform: none; box-shadow: none; background: rgba(46, 90, 50, 0.1); }
html.ui2 .menu-links:has(#musicBtn[hidden]):has(#installBtn[hidden]) #backupBtn,
html.ui2 .menu-links:not(:has(#musicBtn[hidden])):not(:has(#installBtn[hidden])) #installBtn { grid-column: auto; justify-self: stretch; width: 100%; }
html.ui2 .menu-links .new-badge { position: static; display: inline-block; margin-left: 6px; transform: none; vertical-align: 1px; }
html.ui2 .storage-note { background: var(--u-soil); color: var(--u-ink); border-radius: 10px; }
html.ui2 .storage-note b { color: #8a3b1c; }
html.ui2 .storage-note-close { border-width: 1px; }
html.ui2 .menu .mode-btn > * { min-width: 0; max-width: 100%; }
/* せまい画面（スマホ縦）：絵を小さく、字のあきをつめて、カードからはみ出さない */
@media (max-width: 699px) {
  html.ui2 .menu .mode-btn { grid-template-columns: 34px minmax(0, 1fr); column-gap: 8px; padding: 9px 8px; }
  html.ui2 .menu .mode-btn::before { width: 34px; height: 34px; border-radius: 8px; }
  html.ui2 .menu .mode-tag { font-size: 9.5px; letter-spacing: 0.02em; }
  html.ui2 .menu .mode-name { font-size: clamp(12.5px, 3.7vw, 16px); letter-spacing: -0.02em; }
  html.ui2 .menu .mode-sub { font-size: 10.5px; }
}
/* 和文はプロポーショナルにつめる（palt）。字の並びが整い、せまいカードにも入る */
html.ui2 #menu .card.menu { font-feature-settings: 'palt'; }
/* スマホ縦：絵は見出しの行の左に小さく、名前と説明はカードの幅いっぱいに（名前を小さくしすぎない） */
@media (max-width: 699px) {
  html.ui2 .menu .mode-btn { grid-template-columns: 26px minmax(0, 1fr); grid-template-rows: auto; row-gap: 3px; padding: 9px 10px; }
  html.ui2 .menu .mode-btn::before { grid-row: 1; width: 26px; height: 26px; border-radius: 7px; }
  html.ui2 .menu .mode-btn > .mode-tag { grid-row: 1; grid-column: 2; align-self: center; }
  html.ui2 .menu .mode-btn > .mode-name, html.ui2 .menu .mode-btn > .mode-sub { grid-column: 1 / -1; }
  html.ui2 .menu .mode-name { font-size: clamp(13px, 3.9vw, 16px); letter-spacing: 0; }
}
/* 2026/10/29 けいしさんの指示：試作のカードは名前ひとつだけ（ストーリーモード・デイリーチャレンジ・フィールドワーク・エンドレスチャレンジ・神遊び）。下の行（到達・日付）は残す */
.u2-name { display: none; }
html.ui2 .menu .mode-btn > .mode-tag, html.ui2 .menu .mode-btn > .mode-name { display: none; }
html.ui2 .menu .mode-btn > .u2-name { display: block; grid-column: 2; font-weight: 900; font-size: clamp(15px, 1.6vw, 19px); letter-spacing: 0.02em; white-space: nowrap; }
@media (max-width: 699px) {
  html.ui2 .menu .mode-btn { grid-template-columns: minmax(0, 1fr); }
  html.ui2 .menu .mode-btn::before { grid-row: auto; grid-column: 1; }
  html.ui2 .menu .mode-btn > .u2-name, html.ui2 .menu .mode-btn > .mode-sub { grid-column: 1; }
  html.ui2 .menu .mode-btn > .u2-name { font-size: clamp(12px, 3.3vw, 16px); letter-spacing: 0; }
}
/* 広い画面：絵はカードの左に重ね（行を作らない）、名前と下の行を縦のまん中に */
@media (min-width: 700px) {
  html.ui2 .menu .mode-btn { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; padding-left: 64px; min-height: 64px; }
  html.ui2 .menu .mode-btn::before { position: absolute; grid-area: auto; left: 10px; top: 50%; transform: translateY(-50%); } /* grid-area を外さないと、位置の基準が列になる */
  html.ui2 .menu .mode-btn > .u2-name, html.ui2 .menu .mode-btn > .mode-sub { grid-column: 1; }
}
/* 2026/10/30 けいしさんの指示：左にモードの一覧、右に挿絵と説明（もう一度押すと進む）。本物のカードは ui2 ではかくす（look.js が一覧から呼ぶ） */
html.ui2 #menu .modes, html.ui2 #menu #godplayBtn { display: none; }
.u2-split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr); gap: 10px; align-items: start; text-align: left; font-feature-settings: 'palt'; }
.u2-list { display: grid; gap: 6px; }
.u2-item { font: inherit; position: relative; display: flex; align-items: center; min-height: 44px; padding: 8px 10px 8px 14px; border: 1.5px solid var(--u-line); border-radius: 10px; background: #fffdf6; color: var(--u-ink); font-weight: 900; font-size: clamp(12px, 3.3vw, 16px); white-space: nowrap; cursor: pointer; text-align: left; }
.u2-item span { overflow: hidden; text-overflow: clip; }
.u2-item.on { background: var(--u-green); border-color: var(--u-green); color: #fbf8ee; box-shadow: 0 3px 0 #1b3a1f; }
.u2-item.on::before { content: ''; position: absolute; left: 5px; top: 50%; width: 0; height: 0; border: 4px solid transparent; border-left: 5px solid #cfe0bf; transform: translateY(-50%); }
.u2-item:active { transform: translateY(1px); }
.u2-panel { border: 2px solid var(--u-ink); border-radius: 12px; background: #fffdf6; overflow: hidden; box-shadow: 0 3px 0 var(--u-ink); animation: u2in 0.22s ease; }
@keyframes u2in { from { opacity: 0.4; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .u2-panel { animation: none; } }
.u2-art { position: relative; aspect-ratio: 16 / 10; background: var(--u-moss); overflow: hidden; border-bottom: 1px solid var(--u-line); }
.u2-art > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.u2-info { padding: 8px 10px 10px; display: grid; gap: 4px; }
.u2-info h3 { margin: 0; font-size: clamp(13px, 3.6vw, 17px); font-weight: 900; color: var(--u-ink); }
.u2-sub { margin: 0; font-size: 11px; font-weight: 700; color: var(--u-green); }
.u2-text { margin: 0; font-size: clamp(11px, 3vw, 13px); line-height: 1.6; color: var(--u-sub); font-weight: 700; }
.u2-go { font: inherit; justify-self: stretch; margin-top: 4px; padding: 7px 10px; border: 2px solid var(--u-ink); border-radius: 10px; background: var(--u-green); color: #fbf8ee; font-weight: 900; font-size: 14px; box-shadow: 0 3px 0 var(--u-ink); cursor: pointer; }
.u2-go::after { content: ' ›'; }
.u2-go:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--u-ink); }
.u2-list > .u2-item { width: 100%; min-width: 0; overflow: hidden; }
@media (max-width: 699px) {
  .u2-split { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.2fr); gap: 8px; }
  .u2-item { font-size: clamp(11px, 3vw, 14px); padding: 8px 6px 8px 12px; letter-spacing: -0.02em; }
}
/* 2026/10/30 試作：スマホ縦では、エコを小さく左に・ロゴとキャッチを右に（一覧を上へ寄せる） */
@media (max-width: 699px) {
  html.ui2 .menu .menu-head { display: grid; grid-template-columns: 92px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 6px; margin-bottom: 10px; }
  html.ui2 .menu .hero-eco { grid-row: 1 / 3; width: 92px; margin: -4px 0 -6px; }
  html.ui2 .menu .logo.big { grid-column: 2; align-self: end; margin: 0; font-size: clamp(26px, 8.2vw, 38px); text-align: left; -webkit-text-stroke-width: 1.5px; text-shadow: 3px 3px 0 #000; }
  html.ui2 .menu .tagline { grid-column: 2; align-self: start; margin: 2px 0 0; text-align: left; font-size: clamp(10.5px, 3vw, 13px); letter-spacing: 0.02em; }
}
/* 2026/10/30 けいしさんの指示：メニューはポップアップにしない（後ろのプレイ画面を見せない）。画面いっぱいのメニューの画面にする */
html.ui2 #menu { background: var(--u-paper); padding: var(--ov-pt) 0 var(--ov-pb); place-items: start center; overflow-y: auto; }
html.ui2 #menu .card.menu { width: min(100%, 560px); border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: 14px 16px 20px; margin: auto 0; }
@media (min-width: 700px) {
  html.ui2 #menu { place-items: center; }
  html.ui2 #menu .card.menu { width: min(100%, 1120px); padding: 24px 36px; }
}
/* メニューの中の音のボタン（ヘッダーの #mute をかくしたので、ここから切りかえる） */
.u2-mute { position: fixed; top: calc(var(--ov-pt) + 6px); right: 12px; z-index: 12; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--u-line); background: #fffdf6; color: var(--u-ink); font-size: 18px; line-height: 1; cursor: pointer; }
html:not(.ui2) .u2-mute, #menu[hidden] .u2-mute { display: none; }
/* 2026/10/30 けいしさんの指示：ルール説明・自然のしくみは森の記録の中へ。残り（更新履歴・音楽室・引き継ぎ・ホームに追加）は ご意見・ご要望と同じ小さなリンクに */
html.ui2 #menu .menu-links { display: none; }
.u2-foot { display: contents; }
.u2-small { position: relative; }
.u2-dot { position: absolute; top: 2px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.u2-new { margin-left: auto; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-style: normal; font-size: 9.5px; line-height: 16px; font-weight: 900; letter-spacing: 0.04em; }
.u2-item .u2-new { flex: none; margin-left: 6px; }
html.ui2 #menu .foot-links { gap: 2px 4px; margin-top: 16px; }
.u2-art.contain > img { object-fit: contain; padding: 4px; }
.u2-rec { display: none; }
html.ui2 .u2-rec { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 8px; }
.u2-recbtn { font: inherit; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 8px; border: 1.5px solid var(--u-line); border-radius: 10px; background: #fffdf6; color: var(--u-ink); font-weight: 900; font-size: 13px; cursor: pointer; }
.u2-recbtn::after { content: '›'; color: var(--u-sub); font-weight: 400; }
.u2-recbtn .u2-new { margin-left: 0; }
html.ui2 #records .tips-card { grid-template-rows: auto auto auto 1fr; }
html.ui2 .u2-rec { margin: 0; }
/* 2026/10/30 けいしさんの指示：背景の森はのこす（後ろのプレイ画面ではなく、森の絵を メニューの背景として しく）。メニューは生成りの紙の上に */
html.ui2 #menu { background: linear-gradient(rgba(16, 28, 14, 0.25), rgba(16, 28, 14, 0.45)), url('../../assets/bg.jpg') center / cover no-repeat, var(--bg); padding: var(--ov-pt) 12px var(--ov-pb); }
html.ui2 #menu .card.menu { background: var(--u-paper); border: 3px solid var(--u-ink); border-radius: 18px; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35); }
/* 2026/10/30 けいしさんの指示：モードをまたぐ画面（メニューから進んだ先）はポップアップにしない。後ろ（メニュー・プレイ画面）を見せない、画面いっぱいのページにする。
   同じモードの中のポップアップ（森の記録の中のルール説明など）は、そのまま重ねる */
html.ui2 :is(#storyMap, #dailyInfo, #endlessInfo, #records) { background: linear-gradient(rgba(16, 28, 14, 0.35), rgba(16, 28, 14, 0.55)), url('../../assets/bg.jpg') center / cover no-repeat, var(--bg); }
html.ui2 #godplay { background: radial-gradient(ellipse at 50% 20%, #3a2a66 0, #160f2b 70%), #120c22; }
@media (max-width: 699px) {
  html.ui2 :is(#storyMap, #dailyInfo, #endlessInfo, #records, #godplay) { padding: 0; place-items: stretch; }
  html.ui2 :is(#storyMap, #dailyInfo, #endlessInfo, #records, #godplay) > .card { width: 100%; max-width: none; height: var(--app-h, 100dvh); max-height: none; border: 0; border-radius: 0; box-shadow: none; padding-top: calc(var(--ov-pt) + 12px); padding-bottom: calc(var(--ov-pb) + 12px); overflow-y: auto; }
  html.ui2 :is(#dailyInfo, #endlessInfo) > .card { align-content: safe center; }
}
@media (max-width: 699px) {
  html.ui2 #godplay > .card { align-content: safe center; } /* safe：入りきらないときは上から（上が切れてスクロールできなくならないように） */
  html.ui2 #godplay :is(#gpClose, #gpBack) { align-self: center; height: auto; }
}
/* 2026/10/30：高さをそろえた枠の中で、「はじめる」「神遊び、開始」はいつも下にそろえる（文字の量でボタンの位置が動かない） */
.u2-panel { display: flex; flex-direction: column; }
.u2-panel .u2-info { flex: 1; grid-template-rows: auto auto 1fr auto; }
.u2-sub { min-height: 1.4em; }
#godplay .gp-info { display: flex; flex-direction: column; }
#godplay .gp-info .gp-go { margin-top: auto; }
/* 2026/10/30 新ロゴ「Dにも双葉」（Codex の絵＝PR #21。けいしさんが採用）：試作（ui2）のタイトルの ECODROP の文字を、ロゴの絵にする。
   文字は消さずに残す（読み上げ・検索・data-title のため。font-size 0 でかくすだけ） */
html.ui2 .menu .logo.big {
  font-size: 0; color: transparent; text-shadow: none; -webkit-text-stroke: 0;
  background: url('../../assets/title/logo.webp') center / contain no-repeat;
  aspect-ratio: 3 / 1; width: 100%; max-width: 420px; margin: 0 auto; overflow: hidden;
}
@media (max-width: 699px) {
  html.ui2 .menu .logo.big { grid-column: 2; align-self: end; margin: 0; max-width: none; font-size: 0; background-position: left center; }
  html.ui2 .menu .menu-head { grid-template-columns: 96px minmax(0, 1fr); }
  html.ui2 .menu .hero-eco { width: 96px; }
}
/* 2026/10/30 けいしさんの指示：タイトルの上のエコの絵とサブタイトルはいらない（試作 ui2）。ロゴだけを上に、その下にメニュー */
html.ui2 .menu .hero-eco, html.ui2 .menu .tagline { display: none; }
html.ui2 .menu .menu-head { display: block; margin: 0 0 10px; }
html.ui2 .menu .logo.big { display: block; width: min(72%, 260px); max-width: none; margin: 0 auto; background-position: center; grid-column: auto; }
@media (min-width: 700px) {
  html.ui2 #menu .card.menu { display: block; width: min(100%, 980px); padding: 22px 36px 26px; }
  html.ui2 .menu .menu-head { flex: none; margin-bottom: 18px; }
  html.ui2 .menu .logo.big { width: min(100%, 300px); }
}
/* 2026/10/31 けいしさんの指示：デイリーとエンドレスを「チャレンジ」にまとめ、右の説明のボタンから えらんで進む */
.u2-gos { display: grid; gap: 6px; align-self: end; margin-top: 4px; }
.u2-gos .u2-go { margin-top: 0; }
.u2-art.two { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: var(--u-paper); }
.u2-art.two.n1 { grid-template-columns: 1fr; }
.u2-art.two > img { min-width: 0; }
.u2-tail { display: none; } /* 広い画面だけ「デイリーチャレンジ」と全部出す。スマホ縦は「デイリー」だけ（ボタンの中で折り返さない） */
@media (min-width: 700px) { .u2-tail { display: inline; } }
/* 2026/11/1 けいしさんの指示：タブレットは、右の挿絵・説明のはばを、左の一覧の文字のはばより少し大きいくらいに（広がりすぎない）。まん中にまとめる */
@media (min-width: 700px) {
  .u2-split { grid-template-columns: 250px 340px; justify-content: center; gap: 16px; }
  html.ui2 #menu .card.menu { width: min(100%, 700px); padding: 24px 32px; } /* 外の枠も、中身に合わせて せまく */
  .u2-item { font-size: 15px; padding: 11px 14px 11px 16px; }
  .u2-info h3 { font-size: 18px; }
  .u2-text { font-size: 13.5px; }
}
.u2-art.two > img:first-child { object-position: 100% 50%; } /* デイリー：掲示板が はんぶんに おさまるように */
/* 2026/11/1 けいしさんの指示：タブレット横では、プレイ画面は本編のゲームのような横の比率に（メニュー系の画面は今のまま）。
   フィールドワークの森の画面も、左に大きな森・右に シラベ・時刻・ひとこと・ボタン の2列にする（本編の横向きと同じ条件） */
@media (orientation: landscape) and (min-width: 820px) {
  /* 2026/11/1 けいしさんの指示：背景も本編のプレイ画面と同じ森の絵に・右の列のはばも本編と同じ（画面のはばの30%・250〜380px） */
  #free .free-body { --fw-side: clamp(250px, 30vw, 380px); width: 100%; display: grid; grid-template-columns: auto var(--fw-side); justify-content: center; grid-template-rows: repeat(10, auto); column-gap: 16px; row-gap: 0; align-content: safe center; }
  #free .free-body > * { grid-column: 2; margin-bottom: 8px; min-width: 0; }
  #free .free-body > .fr-scene { grid-column: 1; grid-row: 1 / -1; align-self: start; justify-self: center; width: min(calc(100vw - var(--fw-side) - 16px - 28px), calc((var(--app-h, 100dvh) - var(--ov-pt, 0px) - var(--ov-pb, 0px) - 96px) * 1.6)); margin: 0; }
  #free .free-body > .fr-actions .fr-act-row { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
  /* 板（記録・作業など＝メニュー系）と画面の説明は、列に入れず 今までどおり森の画面全体に重ねる。板のはばは前と同じ 760px でまん中に */
  #free .free-body > :is(.fr-sheet, .fr-tour) { grid-column: auto; grid-row: auto; margin: 0; }
  #free .free-body > .fr-sheet { width: min(100%, 760px); margin: 0 auto; }
}
/* 2026/11/1 けいしさんの指示：タブレット・パソコンでは、メニュー系の画面（タイトル・ストーリーのマップ・きょうの森・果てしない森の遊ぶ前に・神遊び・森の記録）の
   はばを そろえる。固定のはばではなく「形」（よこ:たて＝3:4）をたもつ：横向きは高さに、縦向きは はばに合わせて、どちらでも同じ形におさめる。
   比を変えるときは --menu-ratio だけ。スマホ（はば 700px 未満）と、高さが低い画面（スマホの横向き）は今までどおり */
@media (min-width: 700px) and (min-height: 600px) {
  html.ui2 {
    --menu-ratio: 0.75;
    --menu-w: min(calc(100vw - 32px), calc((var(--app-h, 100dvh) - var(--ov-pt, 0px) - var(--ov-pb, 0px) - 24px) * var(--menu-ratio)));
  }
  html.ui2 #menu .card.menu,
  html.ui2 :is(#storyMap, #dailyInfo, #endlessInfo, #records, #godplay) > .card { width: var(--menu-w); max-width: none; }
  html.ui2 #menu .card.menu { padding: 22px 26px; }
  /* タイトルの一覧と挿絵は、はばに合わせて のびちぢみ（一覧：挿絵 ≒ 4:6） */
  .u2-split { grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr); gap: 14px; }
}
/* 2026/11/1 けいしさんの指示：フィールドワークの背景は、どの向き・どの画面でも本編のプレイ画面と同じ森の絵に（前は縦向きだけ生成りの無地だった） */
#free.overlay, #free .free-card { background: linear-gradient(rgba(12, 20, 10, 0.55), rgba(12, 20, 10, 0.72)), url('../../assets/bg.jpg') center top / cover no-repeat, var(--bg); }
#free .tips-head h2 { color: var(--paper); text-shadow: 0 2px 0 #000; }
/* 2026/11/1 けいしさんの指示：タブレット・パソコンの横向きは、メニュー系の画面を画面のはばに合わせて大きく（左右に10%ずつ余白＝余韻をのこす）。
   縦向きは今までどおり（高さ×3/4 と はばの小さいほう） */
@media (min-width: 700px) and (min-height: 600px) and (orientation: landscape) {
  html.ui2 { --menu-w: 80vw; }
}
/* 2026/11/1 音楽室：挿絵がまだないあいだは、やわらかい緑の面に「♪」 */
.u2-art.plain { display: grid; place-items: center; background: linear-gradient(135deg, #dbe8c8, #bfd3a4); }
.u2-art.plain > span { font-size: clamp(40px, 9vw, 72px); line-height: 1; color: #4f7a3a; opacity: 0.85; }
/* 2026/11/1 けいしさんの指示：基本はずっと同じルールで。音楽室（一覧のいちばん下＝モードのひとつ）も、ほかのメニュー系と同じはば・後ろは森の絵（ポップアップにしない）。
   タイトルから開くほかの画面（更新履歴・記録の引き継ぎ・素材とライセンス・ご意見・ランキング・ルール説明・自然のしくみ・図鑑・保全と再生・アルバム）も、同じはばの決まりにそろえる */
html.ui2 #music { background: linear-gradient(rgba(16, 28, 14, 0.35), rgba(16, 28, 14, 0.55)), url('../../assets/bg.jpg') center / cover no-repeat, var(--bg); }
@media (max-width: 699px) {
  html.ui2 #music { padding: 0; place-items: stretch; }
  html.ui2 #music > .card { width: 100%; max-width: none; height: var(--app-h, 100dvh); max-height: none; border: 0; border-radius: 0; box-shadow: none; padding-top: calc(var(--ov-pt) + 12px); padding-bottom: calc(var(--ov-pb) + 12px); overflow-y: auto; }
}
@media (min-width: 700px) and (min-height: 600px) {
  html.ui2 :is(#music, #news, #backup, #licenses, #feedback, #rankings, #rules, #tips, #zukan, #restore, #album) > .card { width: var(--menu-w); max-width: none; }
}
/* 2026/11/1 途中セーブ：試作（ui2）では、上の「つづきから」はかくし、ストーリー・チャレンジの説明の中に出す（look.js の RESUME） */
html.ui2 .resume-btn { display: none; }
.u2-go.u2-resume { display: grid; gap: 1px; justify-items: center; background: #fffdf6; color: var(--u-ink); }
.u2-go.u2-resume::after { content: none; }
.u2-go.u2-resume small { font-size: 11px; font-weight: 700; color: var(--u-sub); line-height: 1.3; }

/* 新しいロゴを、タイトル以外のロゴにも（2026/11/1 けいしさんの指示「できる範囲で揃えて」）：
   最初の画面（タップしてスタート）・ゲーム中の上の帯・スタッフロール。文字は読み上げ用に残し、見た目は絵（assets/title/logo.webp・3:1） */
html.ui2 .splash-logo, html.ui2 .top > h1.logo, html.ui2 .staff-logo {
  font-size: 0 !important; color: transparent; text-shadow: none; -webkit-text-stroke: 0;
  background: url('../../assets/title/logo.webp') center / contain no-repeat;
  aspect-ratio: 3 / 1;
}
html.ui2 .splash-logo { width: min(78vw, 46vh, 400px); filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.35)); }
html.ui2 .top > h1.logo { flex: none; height: 36px; width: 108px; background-position: left center; filter: drop-shadow(0 0 1px #000) drop-shadow(0 2px 0 rgba(0, 0, 0, 0.55)); }
@media (min-width: 700px) and (min-height: 600px) { html.ui2 .top > h1.logo { height: 44px; width: 132px; } }
html.ui2 .staff-logo { width: min(80vw, 380px); }
