/* ねこきめ（秋の見本）— 見た目の定義
   書体は Zen Maru Gothic の1つだけを使う（RS01-S14：書体をそろえる）。
   色は明るい色だけで組み、画面に大きな暗い面を作らない（RS01-S06）。 */

@font-face {
  font-family: "NekoMaru";
  src: url("../fonts/ZenMaruGothic-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "NekoMaru";
  src: url("../fonts/ZenMaruGothic-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

:root {
  color-scheme: light;
  --bg: #fff4e0;
  --paper: #fffbf2;
  --paper-2: #fff6e6;
  --ink: #5a3e2e;
  --ink-soft: #8c6e5a;
  --line: #ead3b2;
  --line-strong: #d9b98e;
  --momiji: #e8664a;
  --kaki: #f29a4a;
  --icho: #f5c451;
  --olive: #a3bd6e;
  --sky: #e6f2f2;
  --chestnut: #b9784e;
  --rose: #f6bfae;
  --yellow: #ffd45e;
  --yellow-edge: #e3a92c;
  --ok: #4f8a5b;
  --ng: #b5523b;
  --font: "NekoMaru", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}
body { overflow: hidden; position: fixed; inset: 0; }

button, input { font-family: var(--font); color: var(--ink); }
svg text { font-family: var(--font); }

.app { position: fixed; inset: 0; background: var(--bg); overflow: hidden; }

/* ---- 画面（ビュー）の切り替え：明るい画面どうしを重ねて切り替える ---- */
.view {
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0;
  transition: opacity 260ms ease;
}
.view.is-shown { opacity: 1; }
.view[hidden] { display: none; }

.scene { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.scene svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.leaves { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
/* 季節と行事の飾り（画面の いちばん上の帯と、下の左右の角）。ゲームの絵や文字より奥に置く（RS01-S13） */
.decor { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.decor-top { position: absolute; left: 0; right: 0; top: var(--safe-top); aspect-ratio: 390 / 64; }
/* 下の角：遊ぶボタン（幅 300px まで）の左右の すきまに入る大きさ */
.decor-bl, .decor-br { position: absolute; bottom: calc(var(--safe-bottom) + 18px); width: clamp(28px, calc(50% - 154px), 58px); aspect-ratio: 1; }
.decor-bl { left: 2px; }
.decor-br { right: 2px; }
.decor svg { width: 100%; height: 100%; display: block; overflow: visible; }
.leaf-fall { position: absolute; top: -40px; left: 0; width: 26px; height: 26px; will-change: transform; }

.view-body {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 6px) 16px calc(var(--safe-bottom) + 14px);
}

/* ---- ホーム ---- */
.home-body { justify-content: space-between; }
.home-head { text-align: center; padding-top: 12px; }
.logo { width: 180px; height: 99px; margin: 0 auto; }
.logo svg { width: 100%; height: 100%; display: block; }
.home-title {
  margin: 4px 0 0;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.home-sub { margin: 2px 0 0; font-size: 16px; color: var(--ink-soft); letter-spacing: 0.1em; }

/* あそびの一覧：2列のカード。数が増えて収まらない時は、一覧の中だけを縦に送る */
.menu {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  gap: 12px;
  margin: 8px 0;
  padding: 4px 2px 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.menu-card {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 8px 6px 10px;
  border: 3px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 5px 0 var(--line-strong);
  text-align: center;
  touch-action: manipulation;
  transition: transform 90ms ease, box-shadow 90ms ease;
}
.menu-card:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--line-strong); }
.menu-art {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--paper-2);
  overflow: hidden;
}
.menu-art svg { width: 100%; height: 100%; display: block; }
.menu-name { display: flex; flex-direction: column; font-size: 17px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.menu-desc { font-size: 12.5px; color: var(--ink-soft); line-height: 1.4; white-space: nowrap; }

/* 決め方の仕組みの かたまり（見出し＋カード）。ゲームが1本だけの かたまりは1列ぶんで、となりに並ぶ */
.menu { grid-auto-flow: row dense; }
.menu-sec { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.menu-sec.is-single { grid-column: auto; }
.menu-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.menu-sec.is-single .menu-cards { grid-template-columns: 1fr; }
/* お気に入り（v12）：カードの右上の星と、一覧の いちばん上の かたまり */
.menu-card { position: relative; }
.fav-toggle {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 34px;
  height: 34px;
  padding: 6px;
  display: block;
}
.fav-toggle svg, .fav-mark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.fav-toggle path { fill: var(--paper); stroke: var(--line-strong); }
.menu-card.is-favorite .fav-toggle path, .fav-mark path { fill: #ffd36b; stroke: #d9b04d; }
.menu-fav-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 4px;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
  color: var(--chestnut);
  letter-spacing: 0.08em;
}
.menu-fav-title::after { content: ""; flex: 1; height: 2px; border-radius: 1px; background: #f3d36b; }
.fav-mark { width: 20px; height: 20px; display: inline-block; }
.menu-fav[hidden] { display: none; }
.panel[hidden] { display: none; }
/* 決め方の仕組みの見出し */
.menu-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 4px;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
  color: var(--chestnut);
  letter-spacing: 0.08em;
}
.menu-group::after { content: ""; flex: 1; height: 2px; border-radius: 1px; background: var(--line); }
/* いまの選択肢の数を扱えないゲーム（RS01-S08）：うすくして押せない。扱える数を添える */
.menu-card.is-off { opacity: 0.42; box-shadow: 0 2px 0 var(--line-strong); }
.menu-card.is-off .menu-desc { color: var(--chestnut); font-weight: 700; }

/* おまかせ */
.omakase {
  appearance: none;
  flex: none;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100%, 300px);
  height: 52px;
  margin-top: 6px;
  border: none;
  border-radius: 999px;
  background: var(--yellow);
  box-shadow: 0 5px 0 var(--yellow-edge), 0 5px 0 3px rgba(150, 100, 40, 0.12);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ink);
  touch-action: manipulation;
  transition: transform 90ms ease, box-shadow 90ms ease;
}
.omakase:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--yellow-edge); }
.icon-dice { display: inline-block; width: 28px; height: 28px; }
.icon-dice svg { width: 100%; height: 100%; display: block; }

/* ゲームの画面で、いまの選択肢の数を扱えない時のお知らせ */
.limit-note {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.limit-note p {
  margin: 0;
  padding: 22px 28px;
  border: 3px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  font-size: 20px;
  line-height: 1.7;
  text-align: center;
}
.limit-note b { color: var(--momiji); font-size: 24px; }

.home-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.notice {
  margin: 0;
  padding: 8px 14px;
  border-radius: 14px;
  background: #fde7df;
  color: var(--ng);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

/* 画面の低い端末（iPhone SE など）では、ホームの見出しを小さくして収める */
@media (max-height: 700px) {
  .logo { width: 128px; height: 70px; }
  .home-title { font-size: 34px; margin-top: 0; }
  .home-sub { font-size: 14px; }
  .home-head { padding-top: 4px; }
  .menu { gap: 8px; margin: 4px 0; }
  .menu-card { padding: 6px 6px 8px; gap: 2px; }
  .menu-art { width: 48px; height: 48px; border-radius: 14px; }
  .menu-name { font-size: 16px; }
  .menu-desc { font-size: 11.5px; }
  .omakase { height: 44px; font-size: 19px; margin-top: 2px; }
  .icon-dice { width: 24px; height: 24px; }
  .menu-group { font-size: 14px; }
  .menu-cards { gap: 8px; }
}

/* ---- 小さいボタン ---- */
.sub-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 4px 0 var(--line-strong);
  font-size: 17px;
  font-weight: 700;
  touch-action: manipulation;
}
.sub-button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line-strong); }
.sub-button[disabled] { opacity: 0.45; }
.icon-gear, .icon-plus { display: inline-block; width: 22px; height: 22px; }
.icon-gear svg, .icon-plus svg { width: 100%; height: 100%; display: block; }

/* ---- ゲームの画面 ---- */
.bar { display: flex; align-items: center; gap: 8px; height: 56px; flex: none; }
.back {
  appearance: none;
  flex: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 3px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 3px 0 var(--line-strong);
  touch-action: manipulation;
}
.back:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line-strong); }
.back[disabled] { opacity: 0.4; }
.icon-back { display: block; width: 24px; height: 24px; margin: 0 auto; }
.icon-back svg { width: 100%; height: 100%; display: block; }
.bar-title {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.bar-space { flex: none; width: 48px; }

.stage { position: relative; flex: 1; min-height: 0; }
/* ゲームの絵は押す所が無い。絵の外へ広がる光などが、上のボタン（おやつ・お楽しみ袋）を覆って押せなくしないよう、押されないようにする（v14：ひだまりの光が覆っていた） */
.stage > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; pointer-events: none; }

.result {
  flex: none;
  position: relative;
  min-height: 92px;
  margin: 6px 0 12px;
  padding: 10px 18px;
  border: 3px solid var(--line);
  border-radius: 30px;
  background: var(--paper);
  box-shadow: 0 4px 0 var(--line-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.result-hint { font-size: 18px; color: var(--ink-soft); }
.result-label { font-size: 15px; color: var(--ink-soft); letter-spacing: 0.1em; }
.result-value { font-size: 36px; font-weight: 700; line-height: 1.2; letter-spacing: 0.04em; }
.result.is-pop { animation: pop 520ms cubic-bezier(.2,1.6,.4,1); }
@keyframes pop {
  0% { transform: scale(0.86); }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.actions { flex: none; display: flex; justify-content: center; }
.play {
  appearance: none;
  width: min(100%, 300px);
  height: 68px;
  border: none;
  border-radius: 999px;
  background: var(--yellow);
  box-shadow: 0 6px 0 var(--yellow-edge), 0 6px 0 3px rgba(150, 100, 40, 0.12);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ink);
  touch-action: manipulation;
  transition: transform 90ms ease, box-shadow 90ms ease, opacity 200ms ease;
}
.play:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--yellow-edge); }
.play[disabled] { opacity: 0.55; transform: translateY(5px); box-shadow: 0 1px 0 var(--yellow-edge); }

/* ---- 設定 ---- */
.settings-body { padding-bottom: 0; }
.settings-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px calc(var(--safe-bottom) + 24px);
  -webkit-user-select: text;
  user-select: text;
}
.panel {
  margin: 10px 0 16px;
  padding: 14px 16px 16px;
  border: 3px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
}
.panel-title { margin: 0 0 4px; font-size: 19px; font-weight: 700; }
/* 選択肢の組（v12） */
.set-tabs { display: flex; gap: 8px; margin: 8px 0 10px; }
.set-tab {
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 6px;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  touch-action: manipulation;
}
.set-tab.is-on { background: var(--yellow); border-color: var(--yellow-edge); color: var(--ink); }
.set-name-row { display: flex; align-items: center; gap: 10px; }
.set-name-label { flex: none; font-size: 14px; color: var(--ink-soft); }
.panel-hint { margin: 2px 0 8px; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.choice-list { list-style: none; margin: 8px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.choice-row { display: flex; align-items: center; gap: 8px; }
.choice-num {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 2px solid var(--line);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.choice-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-size: 17px;
  font-weight: 500;
  -webkit-user-select: text;
  user-select: text;
}
.choice-input:focus { outline: none; border-color: var(--kaki); }
.choice-del {
  appearance: none;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  touch-action: manipulation;
}
.choice-del svg { width: 18px; height: 18px; display: block; margin: 0 auto; }
.choice-del[disabled] { opacity: 0.35; }
.choice-note { margin: 0 0 8px; font-size: 13px; color: var(--ng); }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 2px dashed var(--line);
}
.switch-row:first-of-type { border-top: none; }
.switch-label { font-size: 17px; }
.switch {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 58px;
  height: 34px;
  margin: 0;
  border-radius: 999px;
  background: #eadfcf;
  border: 2px solid var(--line-strong);
  transition: background 160ms ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 0 rgba(150, 100, 40, 0.25);
  transition: transform 160ms ease;
}
.switch:checked { background: var(--olive); }
.switch:checked::after { transform: translateX(24px); }

.status { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 4px 0 10px; font-size: 14px; }
.status dt { color: var(--ink-soft); white-space: nowrap; }
.status dd { margin: 0; font-weight: 700; text-align: right; }
.cat-mini svg { display: inline-block; width: 34px; height: 34px; vertical-align: middle; }
.is-ok { color: var(--ok); }
.is-ng { color: var(--ng); }

/* ---- 横向きの時 ---- */
.rotate {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.rotate[hidden] { display: none; }
.rotate-art { width: 140px; height: 140px; }
.rotate-art svg { width: 100%; height: 100%; display: block; }
.rotate-text { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: 0.1em; }

/* ---- お祝いの葉っぱ ---- */
.fx { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
/* 大当たり（v12） */
.fx-jackpot { position: absolute; inset: 0; }
.jp-text {
  position: absolute; left: 0; right: 0; top: 24%;
  text-align: center; font-size: 46px; font-weight: 700; letter-spacing: 0.08em;
  color: #ffcf4a; -webkit-text-stroke: 2px #c8615c; paint-order: stroke fill;
  text-shadow: 0 4px 0 rgba(200, 97, 92, 0.25);
}
.jp-cat { position: absolute; bottom: 190px; width: 140px; height: 140px; }
.jp-cat svg { width: 100%; height: 100%; display: block; overflow: visible; }
.jp-left { left: 10px; }
.jp-right { right: 10px; }
/* 結果の ひとこと（v12）：猫の顔と、アズ・イズの ことば */
.result-say { display: inline-flex; align-items: center; gap: 6px; letter-spacing: 0.04em; color: var(--ink); }
.say-face { width: 26px; height: 26px; flex: none; overflow: visible; }
.fx-piece { position: absolute; left: 0; top: 0; width: 30px; height: 30px; will-change: transform, opacity; }
.fx-piece svg, .leaf-fall svg { width: 100%; height: 100%; display: block; overflow: visible; }

/* ---- 決めるもの（おやつ・コイン）の切り替え ---- */
.purpose {
  flex: none;
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 2px auto 4px;
  padding: 3px;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}
.purpose-btn {
  appearance: none;
  min-width: 104px;
  height: 38px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  touch-action: manipulation;
  transition: background 160ms ease, color 160ms ease;
}
.purpose-btn.is-on { background: var(--yellow); color: var(--ink); box-shadow: 0 2px 0 var(--yellow-edge); }
.purpose-btn[disabled] { opacity: 0.6; }
/* 画面の低い端末（iPhone SE など）では、切り替えと結果の欄を詰めて、ゲームの場所を広く取る */
@media (max-height: 700px) {
  .purpose { margin: 0 auto 2px; padding: 2px; }
  .purpose-btn { height: 32px; font-size: 16px; min-width: 96px; }
  .result { min-height: 80px; margin: 4px 0 10px; padding: 6px 18px; }
}

/* ---- お楽しみ袋の出やすさ（RS01-S21）。割合は「せってい」の中だけに出す ---- */
.choice-row.has-odds { flex-wrap: wrap; row-gap: 6px; padding-bottom: 8px; border-bottom: 2px dashed var(--line); }
.choice-row.has-odds:last-child { border-bottom: none; padding-bottom: 0; }
.odds { flex: 1 0 100%; display: flex; align-items: center; gap: 8px; padding-left: 38px; }
.odds-group {
  flex: 1;
  min-width: 0;
  display: flex;
  padding: 2px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}
.odds-btn {
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 2px;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--ink-soft);
  touch-action: manipulation;
  transition: background 160ms ease, color 160ms ease;
}
.odds-btn.is-on { background: var(--yellow); color: var(--ink); box-shadow: 0 2px 0 var(--yellow-edge); }
.odds-pct { flex: none; width: 46px; text-align: right; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- 季節と行事 ---- */
.yotei-notes { margin: 0 0 8px; padding-left: 1.2em; font-size: 13px; line-height: 1.55; }
.yotei-notes:empty { display: none; }
.try-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0 4px; border-top: 2px dashed var(--line); }
.try-date { flex: none; height: 40px; padding: 0 8px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font-family: var(--font); font-size: 15px; color: var(--ink); }
.try-result { margin: 4px 0 0; font-size: 14px; line-height: 1.5; }
.try-result:empty { display: none; }

/* ---- ゲームの中の部品 ---- */
.cell-label { font-weight: 700; }
.try-back { margin-top: 8px; }
.try-back[hidden] { display: none; }

/* ---- 行事の色（v10：行事の時は、ボタンや枠も行事の色にする。docs/決めたことの記録.md §9） ---- */
body[data-theme="christmas"] { --yellow: #f6a0a0; --yellow-edge: #d9706f; --line: #bfdcb0; --line-strong: #93bf7f; --chestnut: #5f8f4a; }
body[data-theme="omisoka"] { --yellow: #ffd98a; --yellow-edge: #d9a843; --line: #cdd3ea; --line-strong: #9aa3cc; }
body[data-theme="oshogatsu"] { --yellow: #f59b8f; --yellow-edge: #d66e62; --line: #f0d39a; --line-strong: #d9ad5a; --chestnut: #c9584a; }
body[data-theme="setsubun"] { --yellow: #ffcf6a; --yellow-edge: #e0a03a; --line: #f2c6b4; --line-strong: #e09a82; --chestnut: #c96a4a; }
body[data-theme="valentine"] { --yellow: #f7a8c0; --yellow-edge: #e07a9a; --line: #f6cfdc; --line-strong: #eaa6bd; --chestnut: #d0708e; }
body[data-theme="nekonohi"] { --yellow: #f9b8a0; --yellow-edge: #e58e72; --line: #f4d4c4; --line-strong: #e6ad96; --chestnut: #c97a5e; }
body[data-theme="hinamatsuri"] { --yellow: #f8b4c4; --yellow-edge: #e3869d; --line: #d6e8b8; --line-strong: #a9cc86; --chestnut: #c96a86; }
body[data-theme="hanami"] { --yellow: #f9bfd0; --yellow-edge: #e690aa; --line: #f8d5e0; --line-strong: #eab0c2; --chestnut: #c7708c; }
body[data-theme="kodomonohi"] { --yellow: #9fcdf2; --yellow-edge: #6fa2d4; --line: #c8e2f4; --line-strong: #93bfe0; --chestnut: #4f84b8; }
body[data-theme="tanabata"] { --yellow: #ffe08a; --yellow-edge: #d9b04d; --line: #c9c6ee; --line-strong: #9d98d6; }
body[data-theme="natsumatsuri"] { --yellow: #ffb07a; --yellow-edge: #e0804a; --line: #f4c9b4; --line-strong: #d99a7e; }
body[data-theme="sekainekonohi"] { --yellow: #9fdccf; --yellow-edge: #62b3a2; --line: #c4e6e6; --line-strong: #8fcaca; --chestnut: #3f8f86; }
body[data-theme="otsukimi"] { --yellow: #ffe08a; --yellow-edge: #d9b04d; --line: #d8d4ea; --line-strong: #aaa4d0; }
body[data-theme="manekinekonohi"] { --yellow: #f6d55e; --yellow-edge: #d9a82c; --line: #f2b8a8; --line-strong: #e08670; --chestnut: #c95a48; }
body[data-theme="halloween"] { --yellow: #f8b15c; --yellow-edge: #dc8a36; --line: #d7cbe9; --line-strong: #ab96d0; --chestnut: #8a6cb8; }
/* 夜の行事：空の上に じかに書く文字を明るくする（カードや欄の中の文字は そのまま） */
body[data-night="1"] .home-title, body[data-night="1"] .bar-title { color: #fff8ec; text-shadow: 0 2px 0 rgba(30, 30, 70, 0.35); }
body[data-night="1"] .home-sub, body[data-night="1"] .menu-group { color: #f3ecff; text-shadow: 0 1px 0 rgba(30, 30, 70, 0.35); }
body[data-night="1"] .menu-group::after { background: rgba(255, 255, 255, 0.35); }

/* ---- 背景の動く物（背景と同じ置き方：下を基準に、画面いっぱいに広げる） ---- */
.scene-fx { position: absolute; left: 50%; bottom: 0; width: max(100%, 46.21vh); aspect-ratio: 390 / 844; transform: translateX(-50%); pointer-events: none; }
.scene-fx > div { position: absolute; will-change: transform, opacity; }
.scene-fx svg { width: 100%; height: 100%; display: block; overflow: visible; }
.fx-twinkle { animation: fx-twinkle 3.2s ease-in-out infinite; }
.fx-blink { animation: fx-blink 2s ease-in-out infinite; }
.fx-firework { opacity: 0; animation: fx-firework 3.6s ease-out infinite; }
.fx-firefly { animation: fx-firefly 4.2s ease-in-out infinite; }
.fx-float { animation: fx-float 5s ease-in-out infinite; }
@keyframes fx-twinkle { 0%, 100% { opacity: 0.15; transform: scale(0.6); } 50% { opacity: 1; transform: scale(1); } }
@keyframes fx-blink { 0%, 100% { opacity: 0.2; } 50% { opacity: 0.95; } }
@keyframes fx-firework { 0% { opacity: 0; transform: scale(0.1); } 8% { opacity: 1; } 40% { opacity: 1; transform: scale(1); } 65% { opacity: 0; transform: scale(1.12); } 100% { opacity: 0; transform: scale(1.12); } }
@keyframes fx-firefly { 0%, 100% { opacity: 0.1; transform: translate(0, 0); } 50% { opacity: 1; transform: translate(8px, -14px); } }
@keyframes fx-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@media (prefers-reduced-motion: reduce) {
  .scene-fx > div { animation: none; }
  .fx-firework { opacity: 0.85; }
}
/* 板や紙の明るい背景の上に題名がある画面（スタンプ・すごろく・まとあて）は、夜でも いつもの色 */
body[data-night="1"] :is(#view-stamp, #view-sugoroku, #view-mato, #view-gacha, #view-himo, #view-crane) .bar-title { color: var(--ink); text-shadow: none; }
