/* =========================================================
   nclToyTools ─ あきの むしのこえ
   秋の夜長テーマ スタイルシート（つみきこうじょうと世界観をそろえつつ、夜の配色）
   ========================================================= */

:root {
  --night-bg: linear-gradient(180deg, #141033 0%, #241a52 42%, #3a2668 78%, #5b3a6e 100%);
  --panel-bg: rgba(255, 255, 255, 0.08);
  --panel-border: rgba(255, 255, 255, 0.20);
  --text-main: #f3ecff;
  --text-sub: #cabce8;
  --accent: #ffd98a;              /* 月あかりの色 */
  --accent-2: #9ad0ff;
  --shadow-soft: 0 12px 34px rgba(10, 6, 30, 0.45);
  --shadow-tile: 0 8px 18px rgba(10, 6, 30, 0.40);
  --radius-card: 24px;
  --radius-btn: 999px;
  --font-main: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'Yu Gothic', sans-serif;
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  overflow: hidden;            /* スクロール禁止（アプリ風に画面ぴったり） */
  overscroll-behavior: none;   /* 端のバウンス防止 */
}

body {
  margin: 0;
  position: fixed;             /* iOS でのスクロール／バウンスを確実に止める */
  inset: 0;
  font-family: var(--font-main);
  color: var(--text-main);
  background: var(--night-bg);
  background-attachment: fixed;
  /* 長押しの文字選択・コールアウト（画像保存メニュー等）を無効化 */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, p { margin: 0; }
button { font-family: inherit; }

/* =========================================================
   夜の飾り（背景装飾・操作不可）
   ========================================================= */
.night-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.night-decor .moon {
  position: absolute;
  top: 4vh;
  right: 6vw;
  font-size: clamp(48px, 10vw, 92px);
  filter: drop-shadow(0 0 24px rgba(255, 220, 150, 0.55));
  animation: floaty 9s ease-in-out infinite;
}
.night-decor .twinkle {
  position: absolute;
  font-size: clamp(14px, 2.4vw, 24px);
  opacity: 0.9;
  animation: twinkle 3.6s ease-in-out infinite;
}
.night-decor .t1 { top: 12vh; left: 10vw; animation-delay: 0s; }
.night-decor .t2 { top: 22vh; left: 26vw; animation-delay: 0.6s; }
.night-decor .t3 { top: 8vh;  left: 46vw; animation-delay: 1.2s; }
.night-decor .t4 { top: 30vh; left: 66vw; animation-delay: 0.3s; }
.night-decor .t5 { top: 16vh; left: 82vw; animation-delay: 1.6s; }
.night-decor .t6 { top: 40vh; left: 16vw; animation-delay: 2.1s; }
.night-decor .grass {
  position: absolute;
  bottom: -6px;
  font-size: clamp(40px, 9vw, 78px);
  opacity: 0.75;
  transform-origin: bottom center;
  animation: sway 6s ease-in-out infinite;
}
.night-decor .g1 { left: 2vw;  animation-delay: 0s; }
.night-decor .g2 { left: 50vw; animation-delay: 1.1s; font-size: clamp(48px, 11vw, 96px); }
.night-decor .g3 { right: 3vw; animation-delay: 2s; }

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50%      { opacity: 1;    transform: scale(1.1); }
}
@keyframes sway {
  0%, 100% { transform: rotate(-4deg); }
  50%      { transform: rotate(5deg); }
}

/* =========================================================
   レイアウト
   ========================================================= */
#app {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;              /* 画面ぴったり（スクロールなし） */
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* main が残りの高さを full に使い、描画エリアが最大化される */
main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.glass-card {
  background: var(--panel-bg);
  border: 1.5px solid var(--panel-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ---- ヘッダー ---- */
.night-header {
  position: relative;
  padding: 22px 18px 18px;
  text-align: center;
}
.night-header h1 {
  font-size: clamp(26px, 6vw, 40px);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}
.night-header .tagline {
  margin-top: 8px;
  color: var(--text-sub);
  font-size: clamp(13px, 3vw, 16px);
}
.home-link {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid var(--panel-border);
  border-radius: var(--radius-btn);
  padding: 7px 12px;
  transition: transform 0.12s ease, background 0.12s ease;
}
.home-link:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.2); }
.home-link:active { transform: translateY(0); }

.mute-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.12);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.mute-btn:hover { transform: scale(1.08); background: rgba(255, 255, 255, 0.2); }
.mute-btn:active { transform: scale(0.94); }

/* ---- コンパクトなトップバー＋ハンバーガーメニュー ---- */
.topbar {
  position: relative;
  z-index: 40; /* ドロップダウンメニューを meadow(月・虫など)より前面に */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px 9px 16px;
}
.topbar .title {
  font-size: clamp(15px, 3.6vw, 19px);
  font-weight: 800;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.1s ease;
}
.menu-btn:hover { background: rgba(255, 255, 255, 0.2); }
.menu-btn:active { transform: scale(0.94); }

.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 8px;
  z-index: 30;
  width: min(262px, 82vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: #2a2450;
  border: 1.5px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}
.menu[hidden] { display: none; }
.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  text-decoration: none;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid var(--panel-border);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
}
.menu-item:hover { background: rgba(255, 255, 255, 0.16); }
.menu-item:active { transform: scale(0.98); }
.menu-views {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 999px;
  padding: 5px;
}
.menu-views .view-btn { flex: 1; }

/* ---- アイコングリッド ---- */
.grid-card {
  padding: 16px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;   /* 一覧が入りきらないときはこの中だけスクロール */
}
.insect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(102px, 1fr));
  gap: clamp(14px, 3.5vw, 26px) clamp(10px, 3vw, 20px);
  justify-items: center;
}

.insect-tile {
  appearance: none;
  border: none;
  background: none;
  padding: 4px;
  width: 100%;
  max-width: 132px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-main);
  -webkit-tap-highlight-color: transparent;
}

.tile-icon {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  background: linear-gradient(145deg, var(--c1), var(--c2));
  box-shadow: var(--shadow-tile), inset 0 2px 3px rgba(255, 255, 255, 0.35), inset 0 -6px 12px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.14s ease;
}
.tile-icon svg { display: block; width: 100%; height: 100%; }
/* 本物のイラスト（png）／フォールバックSVG をタイルいっぱいに */
.tile-icon .insect-img,
.tile-icon .insect-fallback {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.22));
}
.tile-icon .insect-fallback svg { width: 100%; height: 100%; display: block; }

/* 実録音がある虫の目じるし（右上の小さなマイク） */
.tile-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.insect-tile:hover .tile-icon { transform: translateY(-4px) scale(1.03); }
.insect-tile:active .tile-icon { transform: translateY(-1px) scale(0.95); }
.insect-tile:focus-visible { outline: none; }
.insect-tile:focus-visible .tile-icon {
  box-shadow: var(--shadow-tile), 0 0 0 4px rgba(255, 217, 138, 0.85);
}

.tile-name {
  font-weight: 800;
  font-size: clamp(13px, 3.2vw, 16px);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}
.tile-kanji {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: -3px;
}

/* ---- タップで「ぷるっ」---- */
.tile-icon.wiggle { animation: wiggle 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes wiggle {
  0%   { transform: scale(0.95); }
  30%  { transform: scale(1.08) rotate(-4deg); }
  55%  { transform: scale(1.02) rotate(4deg); }
  75%  { transform: scale(1.05) rotate(-2deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ---- 鳴き声の吹き出し ---- */
.tile-bubble {
  position: absolute;
  left: 50%;
  top: 6px;
  transform: translate(-50%, -6px) scale(0.7);
  background: rgba(255, 255, 255, 0.96);
  color: #4a3a5e;
  font-weight: 800;
  font-size: clamp(11px, 2.6vw, 14px);
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tile-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.96);
  border-bottom: 0;
}
.tile-bubble.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* ---- 合唱ボタン ---- */
.chorus-row { display: flex; justify-content: center; flex: 0 0 auto; }
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-weight: 800;
  border-radius: var(--radius-btn);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.btn-chorus {
  font-size: clamp(16px, 4vw, 19px);
  color: #3a2a1e;
  background: linear-gradient(145deg, #ffe6a8, #ffc45e);
  padding: 14px 26px;
  box-shadow: 0 6px 0 rgba(180, 120, 40, 0.5), var(--shadow-soft);
}
.btn-chorus:hover { transform: translateY(-2px); filter: brightness(1.04); }
.btn-chorus:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(180, 120, 40, 0.5); }

/* ---- フッター ---- */
.night-footer { padding: 16px 18px; text-align: center; }
.small { font-size: 12px; color: var(--text-sub); line-height: 1.7; }

/* 読み込み失敗時の簡易メッセージ */
body.load-error #app::before {
  content: '😢 うまく よみこめなかったみたい。さいしんの Chrome / Safari で ためしてね。';
  display: block;
  background: rgba(255, 255, 255, 0.14);
  border: 1.5px solid var(--panel-border);
  border-radius: var(--radius-card);
  padding: 16px;
  text-align: center;
  margin-bottom: 12px;
}

/* せまい画面では、タイトルを角のボタン（つみきへ／ミュート）の下へ逃がす */
@media (max-width: 560px) {
  .night-header { padding-top: 60px; }
  .night-header h1 { font-size: clamp(23px, 7vw, 32px); }
  .home-link { font-size: 12px; padding: 6px 10px; }
}

/* 動きをへらす設定のときはアニメを止める */
@media (prefers-reduced-motion: reduce) {
  .night-decor .moon,
  .night-decor .twinkle,
  .night-decor .grass,
  .tile-icon.wiggle { animation: none; }
  .tile-icon, .home-link, .mute-btn, .btn-chorus { transition: none; }
}

/* =========================================================
   表示きりかえ（くさむら / いちらん）
   ========================================================= */
.view-toggle {
  display: flex;
  gap: 6px;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid var(--panel-border);
  border-radius: var(--radius-btn);
  padding: 5px;
  align-self: center;
}
.view-btn {
  border: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  color: var(--text-sub);
  background: transparent;
  border-radius: var(--radius-btn);
  padding: 8px 16px;
  transition: background 0.14s ease, color 0.14s ease, transform 0.1s ease;
}
.view-btn[aria-pressed="true"] {
  color: #3a2a5e;
  background: linear-gradient(145deg, #ffe6a8, #ffc45e);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.view-btn:active { transform: scale(0.96); }

/* =========================================================
   くさむらビュー
   ========================================================= */
.meadow-card {
  padding: 8px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
/* 使い方ヒントはフッター（最後のセクション）にまとめて、あそべるエリアを大きく見せる */
.footer-hint {
  color: var(--text-main);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
  margin-bottom: 6px;
}
.meadow {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #1b1746 0%, #24314a 42%, #1f3626 74%, #12250f 100%);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.35);
  touch-action: manipulation;
}

/* 草のシルエット（bottom-anchored・fillはCSSで継承させる） */
.grass-layer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  display: block;
  pointer-events: none;
}
.grass-far { height: 30%; fill: #3b4f76; opacity: 0.42; }
.grass-mid { height: 28%; fill: #244430; opacity: 0.82; z-index: 2; }
.grass-near { height: 38%; fill: #12241a; opacity: 0.9; z-index: 4; }

.critter-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none; /* 空きスペースは背面の月・星へ素通し。虫だけが受ける */
}

/* 1匹の虫（歩き回る・タップできる） */
.critter {
  position: absolute;
  top: 0;
  left: 0;
  width: clamp(60px, 17vw, 84px);
  height: auto;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
  pointer-events: auto; /* 親(critter-layer)が none でも虫はタップ可能に */
}
.critter-face {
  display: block;
  width: 100%;
  transform-origin: 50% 60%;
}
.critter-face svg,
.critter-face .insect-img,
.critter-face .insect-fallback svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5));
}
/* 夜の叢でも見えるよう、虫の色でうっすら月あかりの光をまとわせる */
.critter-glow {
  position: absolute;
  inset: -34% -28%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, var(--glow), transparent 66%);
  opacity: 0.4;
  filter: blur(3px);
  z-index: -1;
}
.critter:hover .critter-glow { opacity: 0.6; }
.critter:focus-visible { outline: none; }
.critter:focus-visible .critter-glow { opacity: 0.85; }

/* 鳴き声の吹き出し（虫の上に出る） */
.critter-bubble {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, 6px) scale(0.7);
  background: rgba(255, 255, 255, 0.96);
  color: #4a3a5e;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
  text-align: center;
  padding: 5px 11px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.critter-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.96);
  border-bottom: 0;
}
.critter-bubble.show {
  opacity: 1;
  transform: translate(-50%, -4px) scale(1);
}

/* 鳴いているとき: はねを小刻みにふるわせ、光をつよめる */
.critter.singing .critter-face svg,
.critter.singing .critter-face .insect-img { animation: buzz 0.11s linear infinite; }
.critter.singing .critter-glow { animation: glowpulse 0.5s ease-in-out infinite; opacity: 0.7; }
@keyframes buzz {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(-1px) scaleY(1.06); }
}
@keyframes glowpulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.9; }
}

/* 動きをへらす設定: 虫は歩かず（JS側で静止配置）、点滅系アニメも止める */
@media (prefers-reduced-motion: reduce) {
  .critter.singing .critter-face svg,
  .critter.singing .critter-glow { animation: none; }
  .view-btn, .critter { transition: none; }
}

/* =========================================================
   くさむらの夜空: 月・ホタル・星
   ========================================================= */
.meadow-moon {
  position: absolute;
  top: 6%;
  right: 9%;
  width: clamp(46px, 13vw, 68px);
  height: clamp(46px, 13vw, 68px);
  border-radius: 50%;
  z-index: 1;
  background:
    radial-gradient(circle at 62% 30%, rgba(120, 90, 40, 0.10) 0 12%, transparent 14%),
    radial-gradient(circle at 40% 62%, rgba(120, 90, 40, 0.08) 0 9%, transparent 11%),
    radial-gradient(circle at 70% 66%, rgba(120, 90, 40, 0.07) 0 7%, transparent 9%),
    radial-gradient(circle at 38% 36%, #fff7e0, #ffe6a0 55%, #f3cf7a 100%);
  box-shadow: 0 0 34px 10px rgba(255, 224, 150, 0.35), 0 0 74px 22px rgba(255, 224, 150, 0.16);
  pointer-events: none;
}

/* 星（上空・小さくまたたく） */
.meadow-star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 4px 1px rgba(255, 255, 255, 0.8);
  opacity: 0.5;
  z-index: 1;
  pointer-events: none;
  animation: star-tw var(--tw, 3.5s) ease-in-out var(--sd, 0s) infinite;
}
@keyframes star-tw {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50%      { opacity: 0.95; transform: scale(1.15); }
}

/* ホタル（全体に散らして明滅＋ゆっくり漂う） */
.firefly-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}
.firefly {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #f2ffb0 0%, #b6f06a 45%, transparent 72%);
  box-shadow: 0 0 8px 2px rgba(180, 255, 120, 0.75);
  opacity: 0;
  animation:
    firefly-blink var(--blink, 3s) ease-in-out var(--d1, 0s) infinite,
    firefly-drift var(--drift, 9s) ease-in-out var(--d2, 0s) infinite alternate;
}
@keyframes firefly-blink {
  0%, 100% { opacity: 0; }
  45%, 65% { opacity: var(--max, 0.9); }
}
@keyframes firefly-drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(var(--dx, 0), var(--dy, -30px)); }
}

/* 動きをへらす設定: 明滅・漂い・またたきを止めて、うっすら常時ともす */
@media (prefers-reduced-motion: reduce) {
  .firefly { animation: none; opacity: 0.5; }
  .meadow-star { animation: none; opacity: 0.6; }
}

/* =========================================================
   月・星・ホタルもタップできる（キラめきアクション）
   ========================================================= */
.meadow-moon { pointer-events: auto; cursor: pointer; }
.meadow-moon:hover { filter: brightness(1.05); }
.meadow-moon.poke { animation: moon-poke 0.5s ease-out; }
@keyframes moon-poke {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.14); }
  60%  { transform: scale(0.97); }
  100% { transform: scale(1); }
}

.meadow-star { pointer-events: auto; cursor: pointer; }
/* 小さい星でも押しやすいよう、透明な当たり判定を広げる */
.meadow-star::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
}

.firefly { pointer-events: auto; cursor: pointer; }
.firefly::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
}

/* はじけるキラめき（月＝金／星＝金／ホタル＝緑） */
.sparkle-burst {
  position: absolute;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 6;
}
.sparkle-burst.gold { --bc: #ffe6a0; }
.sparkle-burst.green { --bc: #bff06a; }
.sparkle-burst::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--bc, #ffe6a0);
  animation: burst-ring 0.6s ease-out forwards;
}
.sparkle-burst::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, var(--bc, #ffe6a0) 60%, transparent 72%);
  transform: translate(-50%, -50%);
  animation: burst-core 0.5s ease-out forwards;
}
@keyframes burst-ring {
  from { transform: scale(0.4); opacity: 0.9; }
  to   { transform: scale(3.4); opacity: 0; }
}
@keyframes burst-core {
  0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .meadow-moon.poke { animation: none; }
  .sparkle-burst::before, .sparkle-burst::after { animation-duration: 0.01s; }
}

/* =========================================================
   クレジット・出典（フッターのリンクボタン＋モーダル）
   ========================================================= */
.link-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover { filter: brightness(1.12); }

.credits-modal {
  width: min(440px, 92vw);
  max-height: 82vh;
  padding: 0;
  border: 1.5px solid var(--panel-border);
  border-radius: 18px;
  background: #241f4a;
  color: var(--text-main);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.credits-modal::backdrop {
  background: rgba(10, 6, 30, 0.62);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.credits-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--panel-border);
}
.credits-head h2 { font-size: 17px; font-weight: 800; }
.credits-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.credits-close:hover { background: rgba(255, 255, 255, 0.2); }
.credits-body {
  padding: 14px 16px 18px;
  overflow-y: auto;
  max-height: calc(82vh - 58px);
  font-size: 13px;
  line-height: 1.7;
  -webkit-user-select: text; /* モーダル内は選択・コピーできるように */
  user-select: text;
}
.credits-body h3 {
  font-size: 12px;
  color: var(--text-sub);
  margin: 14px 0 6px;
  font-weight: 800;
}
.credits-body h3:first-child { margin-top: 0; }
.credits-body ul { margin: 0; padding-left: 1.1em; }
.credits-body li { margin: 5px 0; }
.credits-body a { color: var(--accent-2); font-weight: 800; }
.credits-note { color: var(--text-sub); }
