* { box-sizing: border-box; }

html {
  touch-action: manipulation;
}

:root {
  --sea: #1c5c8c;
  --sea-deep: #123c5c;
  --sea-horizon: #6fb3d6; /* 水平線に近いほど明るくなる遠景の海色 */
  --sand: #f3e4c8;
  --pink: #d9607a;
  --pink-soft: #f0b7c4;
  --pink-bg: #fdeef1;
  --text-muted: #7a7a7a;
  --sky: #bfe3ef;
  /* 2026-08-25「クォッカが沈んでいるようにみえる」対応: 下端を砂ではなく防波堤にし、
     上端に空・太陽・水平線を描くための配色を追加。 */
  --sky-band-top: #cdeaf5;
  --sky-band-horizon: #ffe3ad;
  --sun-color: #ffd76b;
  --pier: #9a9488;
  --pier-dark: #7a746a;
  --pier-edge: #5f594f;
}

body {
  margin: 0;
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
  background: var(--sky);
  color: #2c2c2c;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

.hidden { display: none !important; }

/* --- 画面共通 --------------------------------------------------------------- */
.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 16px 110px;
  padding-top: calc(24px + env(safe-area-inset-top));
}

/* --- タイトル画面 ------------------------------------------------------------ */
.title-card {
  width: 100%;
  max-width: 420px;
  background: #ffffffcc;
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.title-logo { font-size: 22px; margin: 0 0 4px; }
.title-tagline { color: var(--text-muted); font-size: 13px; margin: 0 0 12px; }
.quokka-hero { display: flex; justify-content: center; margin: 12px 0; }
.quokka-hero svg { image-rendering: pixelated; }

.field { display: block; text-align: left; margin: 12px 0; }
.field-label { font-size: 12px; color: var(--text-muted); display: block; margin-bottom: 4px; }
.field input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--pink-soft);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
}

.primary-button, .secondary-button, .danger-button {
  display: block;
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  border-radius: 999px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.primary-button { background: var(--pink); color: #fff; }
.primary-button:disabled { opacity: 0.5; cursor: not-allowed; }
.secondary-button { background: #fff; color: var(--pink); border: 2px solid var(--pink-soft); }

/* v0.6.0「モードをふたつにする」対応: タイトル画面の2つの開始ボタン(ランキング戦/エンドレス)。
   通常のprimary-buttonの見た目をベースに、ボタン内にサブテキスト(mode-choice-sub)を
   1行小さく添える。エンドレス側は少し落ち着いた色にして「記録に挑戦する」ランキング戦との
   温度差を見た目でも出す。 */
.mode-choice-row { margin: 10px 0 6px; }
.mode-choice-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.3;
}
.mode-choice-sub { font-size: 11px; font-weight: 500; opacity: 0.9; }
.mode-choice-button-endless { background: var(--sea-deep, #123c5c); }
.secondary-button:disabled { opacity: 0.5; cursor: not-allowed; }
.danger-button { background: #fff; color: #b23; border: 2px solid #e6a6a6; }

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}
.rules-link, .link-row .home-link, .share-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border: 2px solid var(--pink-soft);
  border-radius: 999px;
  background: #ffffff;
  color: var(--pink);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
}
.rules-link:hover, .link-row .home-link:hover, .share-button:hover {
  border-color: var(--pink);
  background: var(--pink-bg);
}

/* --- 音コントロール ---------------------------------------------------------- */
.sound-controls {
  position: fixed;
  top: max(14px, env(safe-area-inset-top) + 10px);
  right: max(24px, env(safe-area-inset-right) + 10px);
  z-index: 70;
  display: flex;
  gap: 6px;
}
.sound-toggle-btn, .sound-settings-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #ffffffdd;
  font-size: 16px;
  cursor: pointer;
}
.sound-panel {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 56px);
  right: max(24px, env(safe-area-inset-right) + 10px);
  z-index: 60;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  width: 200px;
}
.sound-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.sound-row button { font-size: 11px; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--pink-soft); background: #fff; }

/* --- オーバーレイ・モーダル --------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 16px;
}
.modal-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  position: relative;
}
.modal-desc { font-size: 13px; color: var(--text-muted); }
.modal-error { color: #b23; font-size: 12px; }
.modal-buttons { display: flex; gap: 8px; margin-top: 12px; }
.modal-buttons button { flex: 1; margin: 0; }
.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #eee;
  cursor: pointer;
}
.legal-modal-card { padding: 8px; max-width: 640px; }
.legal-frame { width: 100%; height: 70vh; border: none; }

/* v0.4.0難易度対応: quokka-cooking-lifeの難易度モーダル(mode-options/mode-option)と
   同じ構成・命名をそのまま踏襲し、色だけfishing-lifeの --pink 系に合わせた
   (series他作品との一貫性チェックリスト対応)。ランキングモーダルの難易度タブにも流用する。 */
.mode-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.mode-option {
  border: 2px solid var(--pink-soft);
  border-radius: 14px;
  background: #fff;
  padding: 10px 6px;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  color: inherit;
}
.mode-option .mode-name { display: block; font-size: 13px; font-weight: 800; }
.mode-option .mode-sub { display: block; font-size: 10.5px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }
.mode-option.active { border-color: var(--pink); background: var(--pink-bg); box-shadow: 0 0 8px rgba(217, 96, 122, 0.35); }
.difficulty-choice-panel h2 { margin-top: 0; }
.difficulty-note { font-size: 12px; color: var(--text-muted); margin: 4px 0 8px; line-height: 1.6; }

/* v0.9.0(2026-08-26)「モードとチャレンジの難易度切り替えとボタンが同じなのでUI的に
   わかりづらい」対応: 以前はモードタブ(2択)・むずかしさタブ(3択)がどちらも同じ
   .mode-options(3列グリッド)を共有しており、2択のモードタブは3列グリッドの中で
   片側に寄って不揃いな余白ができ、見た目の優劣が付かないまま並んでいた。
   モードタブを「全幅の大きな2分割セグメントコントロール(主役)」、むずかしさタブを
   「むずかしさ、の見出し付きの小さなピル(従属)」として明確に描き分ける。 */
.ranking-mode-tabs {
  display: flex;
  gap: 0; /* 2026-08-26「真ん中の白いとこをなくすやつが消えてる」再発対応: .mode-optionsのgap:8pxが
    flexにも継承されたままで、区切り線を消しても2つのボタンの間に地色(白)の隙間が見えていた。 */
  margin: 10px 0 4px;
  border: 2px solid var(--pink);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}
.ranking-mode-tabs .mode-option {
  flex: 1;
  border: none;
  border-radius: 0;
  background: var(--pink-bg); /* 2026-08-26「いろぬりがおかしい」: 非アクティブも真っ白ではなく
    うっすらピンクの地色にして、アクティブとの塗り分けが1つのトグルとして自然に見えるようにする */
  padding: 13px 6px;
  box-shadow: none;
}
/* 2026-08-26「真ん中の白い部分がいらない」対応: 区切り線を廃止(アクティブ側の塗り分けだけで十分見分けがつく)。 */
.ranking-mode-tabs .mode-option .mode-name { font-size: 14px; font-weight: 800; color: var(--pink); }
.ranking-mode-tabs .mode-option.active { background: var(--pink); color: #fff; box-shadow: none; }
.ranking-mode-tabs .mode-option.active .mode-name { color: #fff; }

.ranking-difficulty-heading {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin: 4px 0 4px 2px;
  letter-spacing: 0.02em;
}
.ranking-difficulty-tabs { margin: 0 0 14px; gap: 6px; }
/* 2026-08-26「ランキング切り替えボタンを押すと画面が一瞬ずれる」対応: エンドレスに切り替えた
   ときにこの見出し+タブ行を.hidden(display:none)で即座に消していたため、その下のランキング
   一覧が高さぶん瞬時にガタッと動いて見えていた。display:noneの代わりにmax-height/opacityの
   transitionで畳む/開くようにし、レイアウトが一瞬で変わらないようにする。 */
.ranking-difficulty-heading,
.ranking-difficulty-tabs {
  overflow: hidden;
  transition: max-height 0.2s ease, opacity 0.15s ease, margin 0.2s ease;
}
.ranking-difficulty-heading { max-height: 28px; opacity: 1; }
.ranking-difficulty-tabs { max-height: 60px; opacity: 1; }
.ranking-difficulty-heading.tabs-collapsed,
.ranking-difficulty-tabs.tabs-collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
  pointer-events: none;
}
.ranking-difficulty-tabs .mode-option {
  padding: 7px 4px;
  border-radius: 999px;
  border: 1.5px solid #e2ddd0;
  background: #f8f4ec;
  box-shadow: none;
}
.ranking-difficulty-tabs .mode-option .mode-name { font-size: 11.5px; font-weight: 700; }
.ranking-difficulty-tabs .mode-option.active { border-color: var(--pink-soft); background: var(--pink-bg); color: var(--pink); box-shadow: none; }
.ranking-difficulty-tabs.hidden + .ranking-group { margin-top: 4px; }

.ranking-more-link {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--pink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}
.ranking-more-link:hover { text-decoration: underline; }

.password-input {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 2px solid var(--pink-soft);
  font-family: monospace;
  font-size: 13px;
  margin: 10px 0;
}
.password-display {
  font-family: monospace;
  font-size: 12px;
  word-break: break-all;
  background: #f6f6f6;
  padding: 10px;
  border-radius: 10px;
}
/* 2026-08-26「あいことば自体はタップするとコピーできる」対応: #result-password はタップ
   可能にする(cursor/active状態のフィードバックのみ、コピー成功時の文言表示は下の
   .copy-feedback)。 */
#result-password {
  cursor: pointer;
  user-select: all;
}
#result-password:active {
  background: #eee;
}
.copy-feedback {
  margin: -6px 0 10px;
  font-size: 12px;
  color: var(--pink, #d9607a);
  font-weight: 700;
  text-align: center;
}

.ranking-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ranking-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f8f4ec;
  border-radius: 10px;
}
.ranking-rank { font-size: 16px; text-align: center; }
.ranking-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-value { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-muted); white-space: nowrap; }
.empty-note { font-size: 12px; color: var(--text-muted); }

/* タイトル画面のランキング上位プレビュー(2026-08-25「開始画面のデザインが他のゲームと
   ちがう」対応。シリーズ他作品の並びに合わせ、オーバーレイを開かなくても上位が見える)。 */
.ranking-groups { margin: 14px 0; text-align: left; }
.ranking-preview-label { font-size: 12px; color: var(--text-muted); margin: 0 0 6px; }
.ranking-list-compact .ranking-row { padding: 6px 10px; }
/* 2026-08-25(v0.3.2)「ランキングに釣った魚の種類の数を別で用意しよう」対応: スコア/種類数の
   2部門をそれぞれグループとして縦に並べる。ranking-overlay側は2つ目のグループに上マージンを足す。 */
.ranking-group + .ranking-group { margin-top: 16px; }
.ranking-group-label { font-size: 13px; font-weight: 700; margin: 0 0 6px; }

.pill-button { border: none; cursor: pointer; font-family: inherit; font-size: 12px; }

/* --- 魚図鑑(v0.2.0) --------------------------------------------------------------- */
.fishbook-modal-card { max-width: 460px; }
.fishbook-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; max-height: 60vh; overflow-y: auto; }
.fishbook-card { display: flex; gap: 10px; background: #f8f4ec; border-radius: 12px; padding: 10px; align-items: flex-start; }
.fishbook-card .fishbook-shadow { flex: 0 0 auto; width: 56px; display: flex; align-items: center; justify-content: center; background: #123c5c; border-radius: 8px; padding: 4px; }
.fishbook-card .fishbook-shadow svg { width: 100%; height: auto; display: block; }
.fishbook-card .fishbook-info { flex: 1 1 auto; min-width: 0; }
.fishbook-name { font-weight: 700; font-size: 14px; margin: 0 0 2px; }
.fishbook-reading { font-size: 11px; color: var(--text-muted); margin: 0 0 4px; }
.fishbook-stats { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 11px; color: var(--text-muted); margin: 0 0 4px; }
.fishbook-note { font-size: 11px; margin: 0; }

/* v0.8.0「あいことばで保存できるものを増やす、図鑑情報」対応: 未発見の種はシルエット代わりに
   「❔」を出し、カード全体をやや控えめな見た目にする。 */
.fishbook-card-undiscovered { opacity: 0.7; }
.fishbook-shadow-mystery { font-size: 26px; color: #fff; }
.fishbook-discovered-badge { display: inline-block; font-size: 10px; font-weight: 700; color: #2f7a4d; background: #e3f5e8; border-radius: 8px; padding: 1px 6px; margin-left: 4px; vertical-align: middle; }

/* v0.9.0「図鑑も冗長すぎる、必要な情報のみにしぼり可愛く」対応: HP/スコア等の数値は
   <details>(タップで開く「詳しく見る」)に折りたたみ、常時表示は名前・必要ルアー・
   活動時間・サイズ記録バッジだけに絞った。 */
.fishbook-size-badge { display: inline-block; font-weight: 700; color: #b5762f; background: #fdf1de; border-radius: 8px; padding: 1px 6px; }
.fishbook-size-badge-none { color: var(--text-muted); background: #eee; font-weight: 500; }
.fishbook-detail { margin-top: 2px; }
.fishbook-detail summary { font-size: 10.5px; color: var(--pink); cursor: pointer; list-style: none; }
.fishbook-detail summary::-webkit-details-marker { display: none; }
.fishbook-detail summary::before { content: "▸ "; }
.fishbook-detail[open] summary::before { content: "▾ "; }
.fishbook-detail .fishbook-note { margin-top: 4px; }

.shop-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.shop-row { background: #f8f4ec; border-radius: 10px; padding: 10px; font-size: 13px; }
.shop-row-head { font-weight: 700; margin-bottom: 6px; }
.shop-row-body { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.shop-maxed { color: var(--text-muted); }
.shop-buy-btn { width: auto; padding: 6px 14px; font-size: 12px; }

/* --- v0.7.0: ショップ刷新 + 装備切り替えモーダル共通コンポーネント ---------------------
   「ショップのデザイン変更、所持金が表示されること、ルアーと竿で表示内容を切り替えれること
   購入済み、未購入すべてが表示されること、装備中がわかりやすくなっていること」
   「ゲーム中画面に装備ボタンを用意する、購入済み装備が表示されていて装備切り替えができる」
   の両方でこのtier-listコンポーネントを再利用する(DRY)。 */
.equipment-modal-card { max-width: 460px; }
.equipment-score-display {
  font-size: 15px;
  font-weight: 800;
  background: #fff7e0;
  border: 2px solid #f0d68a;
  border-radius: 10px;
  padding: 8px 12px;
  margin: 10px 0;
  text-align: center;
}
.equipment-score-display strong { color: #c9862a; font-variant-numeric: tabular-nums; }
.equipment-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 12px; }
.equipment-tab {
  border: 2px solid var(--pink-soft);
  border-radius: 12px;
  background: #fff;
  padding: 8px 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: inherit;
}
.equipment-tab.active { border-color: var(--pink); background: var(--pink-bg); box-shadow: 0 0 8px rgba(217, 96, 122, 0.35); }
.equipment-tier-list { display: flex; flex-direction: column; gap: 8px; }
.equipment-tier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f8f4ec;
  border-radius: 10px;
  padding: 10px 12px;
  border: 2px solid transparent;
}
.equipment-tier-row.is-equipped { border-color: #4caf7d; background: #eaf7ee; }
.equipment-tier-info { min-width: 0; }
.equipment-tier-name { font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.equipment-tier-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }
.equipment-tier-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}
.equipment-tier-badge.owned { background: #e4ecff; color: #3457c9; }
.equipment-tier-badge.locked { background: #eee; color: var(--text-muted); }
.equipment-tier-badge.equipped { background: #4caf7d; color: #fff; }
/* 2026-08-26(v0.9.5)「初級以外のルアー・竿に使用回数(耐久)を設ける」対応 */
.equipment-tier-durability { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.equipment-tier-durability.exhausted { color: var(--danger, #d9607a); font-weight: 700; }
.equipment-tier-action { flex: 0 0 auto; }
.equipment-tier-action button { width: auto; padding: 6px 14px; font-size: 12px; margin: 0; }
.equipment-tier-action .locked-note { font-size: 10.5px; color: var(--text-muted); }

/* --- 釣り画面 ----------------------------------------------------------------- */
/* 2026-08-26「ゲーム中画面でスクロールがでてるけどでないように縮める案がほしい」対応:
   .screenの汎用paddingは他画面(フッターの固定ぶんの余白確保)向けの値のまま流用されて
   おり、釣り画面では要素も多くその分だけ縦に余っていた。#fishing-screenだけ上下の
   paddingを詰め、.hud/.sea-population/.action-rowの余白・サイズも合わせて縮小し、
   1画面に収まりやすくする。 */
#fishing-screen {
  padding-left: 12px;
  padding-right: 12px;
  padding-top: calc(8px + env(safe-area-inset-top));
  padding-bottom: 76px;
}

.hud {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-right: 60px;
  margin-bottom: 4px;
}
.pill {
  background: #ffffffdd;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pill strong { font-variant-numeric: tabular-nums; min-width: 2ch; display: inline-block; }
/* v0.6.0: ランキング戦モードのカウントダウンが残りわずかになったときの強調(main.js startClock)。
   #fight-timer.urgentと同じ考え方(色を赤系にして点滅させる)。 */
#pill-time.urgent { background: #ffd7de; }
#pill-time.urgent strong, #pill-time.urgent #v-time-icon { color: #b3324a; animation: pulse 0.5s infinite alternate; }

.fishing-layout {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* 2026-08-25(v0.3.0)「文字選択状態にならないでほしい」対応。海の上のタップだけであらゆる
   操作をおこなうようになった(v0.3.0)ぶん、連打・素早い連続タップで上に重なるテキストや
   絵文字(「!」「タップで合わせる!」等)が文字選択されてしまう不具合が出た。
   cooking-lifeの同種の修正(.chip, .chip *, button, button *)にならい、海の中身
   (#sea, #sea *)とボタン全般に選択無効化をかける。 */
#sea, #sea * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
button, button * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.sea {
  flex: 1 1 auto;
  min-width: 0;
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  /* 上から: 空(0-12%) → 海(水平線側は明るく、手前ほど深くなる。12-78%) → 防波堤(78-100%)。
     見下ろし風のプレイエリア(魚影・着水点)と、遠景の空・太陽/月を1枚の中で自然につなぐため、
     水平線の帯(12%)で空と海の色を近づけている。この背景色は昼夜サイクルに合わせて
     main.jsのupdateDayNight()がインラインstyleで直接上書きする(下の値は初期表示用)。 */
  background: linear-gradient(
    180deg,
    var(--sky-band-top) 0%,
    var(--sky-band-horizon) 11%,
    var(--sea-horizon) 12%,
    var(--sea) 40%,
    var(--sea-deep) 78%,
    var(--pier) 78%,
    var(--pier-dark) 100%
  );
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.2);
  transition: background 1s linear;
}

/* 空の帯(水平線までの領域。太陽・月自体はこの帯の"中"に収まるよう .celestial 側で
   高さの範囲を制限し、2026-08-25「太陽が地平線より手前(海側)にあるのはおかしい」の
   指摘通り、水平線(12%)を越えて描かれないようにしている)。 */
.sky-band {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 11%;
  pointer-events: none;
}

/* 太陽・月(2026-08-25「時間経過がわかるように昇り沈み・昼夜サイクルを」対応)。
   main.jsのupdateDayNight()がRULES.dayNightCycleMs(既定4分)周期でleft/top/opacityを
   毎ティック書き換える。topは常に2%〜9%の範囲(=水平線12%より手前=空側)に収める。 */
.celestial {
  position: absolute;
  width: 9%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  transform: translate(-50%, 0);
  pointer-events: none;
  opacity: 0;
}
.sun { background: radial-gradient(circle, #fff3d0 0%, var(--sun-color) 55%, rgba(255, 215, 107, 0) 100%); }
.moon { background: radial-gradient(circle, #f6f8ff 0%, #cfd6ea 60%, rgba(207, 214, 234, 0) 100%); }

/* 防波堤(2026-08-25「もう少し堤防っぽくして」対応)。コンクリートの目地とテトラポッド風の
   丸みを重ねて質感を出し、水面との境目に濃い縁線を引いてクォッカが「その上に立っている」
   ことが分かるようにする。 */
.pier {
  position: absolute;
  left: 0;
  /* .quokka-dock はこの中に入れ子(position:absoluteの基準にする) */
  right: 0;
  bottom: 0;
  height: 22%;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0 2px, transparent 2px 34px),
    radial-gradient(circle at 15% 30%, rgba(255, 255, 255, 0.12) 0 10px, transparent 11px),
    radial-gradient(circle at 45% 55%, rgba(0, 0, 0, 0.1) 0 9px, transparent 10px),
    radial-gradient(circle at 75% 25%, rgba(255, 255, 255, 0.1) 0 8px, transparent 9px),
    radial-gradient(circle at 90% 60%, rgba(0, 0, 0, 0.08) 0 7px, transparent 8px);
  box-shadow: inset 0 3px 0 var(--pier-edge);
}

.fish-layer { position: absolute; inset: 0; }

/* v0.2.0(照準式アタリ)「魚影は複数種類あり見た目でわかる」+「見た目も種で変える」対応。
   これまでの.ambient-fish(演出のみの楕円)を廃止し、実際にかかる魚そのものである魚影を
   shared/engine.js getVisibleShadows() の座標(top%/left%)にそのまま置く。
   種ごとのシルエットはclient/src/shadows.jsが差し込む。 */
.shadow-fish {
  position: absolute;
  transform: translate(-50%, -50%);
  opacity: 0.8;
  pointer-events: none;
  transition: left 0.2s linear, top 0.2s linear;
}
.shadow-fish svg { display: block; image-rendering: pixelated; }
.shadow-fish.approaching { opacity: 0.95; filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5)); }
/* 2026-08-25「ファイト中に魚が消える」対応: 針にかかっている間は糸の先端に固定表示 */
.shadow-fish.hooked { opacity: 1; z-index: 4; filter: drop-shadow(0 0 5px rgba(255, 246, 191, 0.7)); }

/* v0.2.0: 糸(#cast-line)は竿先(#rod-tip)から着水点までを結ぶSVGの<line>で描く。
   .sea と同じ0-100の座標系(preserveAspectRatio="none")なので、main.jsはleft%/top%の
   数値をそのままx1/y1/x2/y2に設定できる。 */
.line-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}
#cast-line {
  opacity: 0;
  vector-effect: non-scaling-stroke;
}
.splash {
  position: absolute;
  left: 50%;
  top: 74%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%) scale(0.5);
  border-radius: 50%;
  /* v0.7.0「装備しているもので見た目がかわるといい（竿の色や波紋の色）」対応:
     main.jsがルアーのtierに応じて--lure-splash-colorを#seaに設定する(未装備時は白)。 */
  background: var(--lure-splash-color, #fff);
  box-shadow: var(--lure-splash-glow, none);
  opacity: 0;
}
.splash.show {
  animation: splash-pop 0.5s ease-out;
}
@keyframes splash-pop {
  0% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.4); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(3); }
}

/* 2026-08-25「着水後のアニメーションもっと頻繁に波紋だしていいよ」対応。着水点(main.jsが
   left/top%を設定)で輪が繰り返し広がって消える波紋。魚影を隠しすぎないよう線が細く薄い。
   アタリ待ち(wait)フェーズの間だけ表示し、魚影が寄ってきている間(.approaching)は
   速く・濃くして緊張感を出す。 */
.ripple {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  /* v0.7.0: ルアーのtierに応じてmain.jsが--lure-ripple-colorを#seaに設定する。 */
  border: 2px solid var(--lure-ripple-color, rgba(255, 255, 255, 0.5));
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
  opacity: 0;
}
.ripple.show {
  animation: ripple-pulse 1.6s ease-out infinite;
}
.ripple.show.approaching {
  animation-duration: 0.75s;
  border-color: rgba(255, 246, 191, 0.75);
}
/* 上級ルアー以上(sparkle:true)は波紋の輪郭を太めにしてキラッと感を強調する。 */
.ripple.lure-sparkle {
  border-width: 3px;
}
@keyframes ripple-pulse {
  0% { width: 8px; height: 8px; opacity: 0.65; }
  100% { width: 64px; height: 64px; opacity: 0; }
}

/* --- 竿アニメーション(v0.2.0「クォッカに釣り竿もたせてキャストと連携する動きに」対応) --- */
/* transform-origin/transitionはSVG側のstyle属性(quokka.js)で竿の握り手位置に設定済み。
   ここではpose(状態)ごとの回転角だけを切り替える。 */
#rod-arm[data-pose="held"] { transform: rotate(-8deg); }
#rod-arm[data-pose="windup"] { transform: rotate(-50deg); }
#rod-arm[data-pose="swing"] { transform: rotate(36deg); transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.3, 1); }
#rod-arm[data-pose="waiting"] { animation: rod-bob 1.6s ease-in-out infinite; }
#rod-arm[data-pose="fight"] { transform: rotate(24deg) scaleY(0.93); }
#rod-arm[data-pose="catch"] { transform: rotate(-64deg); }
@keyframes rod-bob {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(1deg); }
}

/* 2026-08-25「釣りで戦ってるときタップのタイミングで腕を一瞬ひいて戻されるような演出に
   したい」対応。#quokka-arms(client/src/quokka.js)にmain.jsがタップのたびclassを一瞬付け
   外しする。#rod-arm自体のfight bend(data-pose="fight"、上のrule)とは別グループなので独立
   して動く。演出は2種類:
   - .arm-tug: 通常/外れ/回復タップ共通。180ms、腕がわずかに手前(-2px,+3px)+軽く回転(-4deg)
     してから戻る「魚に引かれる」動き。
   - .arm-tug-strong: ダメージが入った(良いタイミングで当たった)タップ用。220ms、
     引きを少し強め(-4px,+5px / -7deg)にしてヒットの手応えを出す。
   タイミングメーターの視認性を邪魔しないよう、腕(#quokka-arms)はメーター(#fight-meter-*)
   と別要素で動きも数px程度に抑えている。 */
.arm-tug { animation: arm-tug 180ms ease-out; }
.arm-tug-strong { animation: arm-tug-strong 220ms ease-out; }
@keyframes arm-tug {
  0% { transform: translate(0, 0) rotate(0deg); }
  35% { transform: translate(-2px, 3px) rotate(-4deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
@keyframes arm-tug-strong {
  0% { transform: translate(0, 0) rotate(0deg); }
  35% { transform: translate(-4px, 5px) rotate(-7deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* --- いま海にいる魚パネル(v0.2.0「いま海にいる魚がなにかわかるように」対応) ---
   2026-08-25(v0.3.2)「🧪 TEST: いま海にいる魚(確認用) → 🐟️いま海にいる魚 にする」対応:
   テスト専用表示から正式な常設機能に昇格し、黄色い破線のテスト用スタイルをやめて
   他のパネル(fishbook-card等)と揃うクリーム色の通常パネルに変更した。 */
.sea-population {
  width: 100%;
  max-width: 480px;
  background: #f8f4ec;
  border-radius: 12px;
  padding: 6px 10px;
  margin-top: 4px;
  font-size: 11px;
}
.sea-population-label { margin: 0 0 3px; font-weight: 700; color: var(--text-muted); }
.debug-population-list { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; min-height: 24px; }
.debug-population-chip {
  background: #ffffffcc;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.quokka-dock {
  position: absolute;
  left: 50%;
  bottom: 12%; /* 防波堤(.pier, 高さ22%)の上に足が乗るように余白を取る */
  transform: translateX(-50%);
  transition: transform 0.3s ease;
  z-index: 5;
  max-width: 20%; /* 2026-08-25「クォッカでかすぎる」対応: シーン全体に対して控えめなサイズに */
}
.quokka-dock svg { image-rendering: pixelated; display: block; width: 100%; height: auto; }

/* --- 魚カゴ(v0.3.2「この部分をカゴみたいにして釣った魚がどんどん雑にのっかっていく演出に
   したい」対応、v0.3.0で見送っていた項目) ------------------------------------------------
   防波堤(.pier)の中、クォッカ(中央)より左寄りに編み籠を置く。max-width/leftはクォッカ・
   下の枠外ボタン(下のaction-rowは.sea/.pierの外なので元々重ならない)のどちらとも
   重ならないよう控えめなサイズ・位置にした。 */
.fish-basket {
  position: absolute;
  left: 8%;
  bottom: 6%;
  width: 17%;
  max-width: 90px;
  aspect-ratio: 4 / 3;
  z-index: 4;
  pointer-events: none;
}
.fish-basket-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.basket-pile {
  position: absolute;
  left: 50%;
  top: 8%;
  width: 78%;
  height: 62%;
  transform: translateX(-50%);
}
.basket-pile-fish {
  position: absolute;
  left: calc(50% + var(--dx, 0%));
  top: calc(50% + var(--dy, 0%));
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
  animation: basket-pile-drop 0.22s ease-out both;
}
.basket-pile-fish svg { width: 60%; height: auto; display: block; image-rendering: pixelated; opacity: 0.96; }
@keyframes basket-pile-drop {
  0% { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(0.6); opacity: 0; }
  100% { transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(1); opacity: 0.96; }
}

/* 2026-08-26「結果画面のとき、最終的なカゴの絵をそのまま載せる」対応: ゲーム中は.sea基準の
   絶対配置だが、結果画面(.result-card)は通常のドキュメントフローなので、ここだけ静的な
   ブロックとして中央に置き直す(中身の.basket-pile/.basket-pile-fishの座標計算はそのまま流用)。 */
.result-basket {
  position: relative;
  left: auto;
  bottom: auto;
  width: 120px;
  margin: 4px auto 10px;
}
.result-basket .basket-pile-fish { animation: none; } /* 演出済みの最終状態を静的に出すだけなのでドロップアニメは不要 */

/* キャストのフックから籠までの、釣った瞬間の弧のトス演出(main.js tossFishToBasket)。
   left/topを0%→55%→100%のキーフレームで刻み、中間点(55%)のtopを両端より小さく
   (=画面上で高く)することで放物線のような弧に見せる。回転・縮小も添えて「放り込む」勢いを
   出す(main.jsが --start-x/--start-y/--mid-x/--mid-y/--end-x/--end-y を個体ごとに設定)。 */
.toss-fish {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 6;
  animation: toss-arc 520ms cubic-bezier(0.3, 0, 0.6, 1) forwards;
}
.toss-fish svg { display: block; image-rendering: pixelated; }
@keyframes toss-arc {
  0% { left: var(--start-x); top: var(--start-y); transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
  55% { left: var(--mid-x); top: var(--mid-y); transform: translate(-50%, -50%) scale(0.85) rotate(150deg); opacity: 1; }
  100% { left: var(--end-x); top: var(--end-y); transform: translate(-50%, -50%) scale(0.55) rotate(280deg); opacity: 0.9; }
}

/* --- in-sea オーバーレイ(v0.3.0「基本操作はすべてここでおこなうこと」対応) --------------
   idle/wait/bite/fightのすべてを.sea(海)の上に重ねる。装飾テキストはpointer-events:noneで
   タップを素通しし(#seaのclickリスナーがフェーズに応じて処理を振り分ける、main.js参照)、
   実際に押すボタン(まきあげるチップ)だけpointer-events:autoにする。 */
.sea-prompt {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 6;
  animation: sea-prompt-breathe 1.8s ease-in-out infinite;
}
@keyframes sea-prompt-breathe {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.95; }
}

/* 2026-08-26「アタリを待っています　魚影が～　逃げられた　見送った　見送ったなどのメッセージは
   現在の魚影が～のメッセージと同じUIで同じ場所に表示して」対応: 待機中の状態文
   (旧#wait-status/.sea-wait-status)は廃止し、下の.catch-toast(1つの共有アンカー)に統合した。
   #sea-wait-overlayもこの状態文の入れ物でしかなかったため、あわせて廃止した
   (main.js setPhaseの参照も削除済み)。 */
.sea-bite-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
/* 2026-08-25(v0.3.2)「食いついたとき「!」をもっとわかりやすく「HIT!」でフォントも大きめに」
   対応: 単なる「!」の代わりに、大きく太い「HIT!」を海の上(浮きの位置あたり)にはっきり
   出す。sea-bite-popで登場時にスケールポップさせ、その後pulseで軽く脈打たせ続ける。
   縁取り(-webkit-text-stroke)+濃い影で海の背景色(昼・夜どちらでも)に対して高コントラストを
   保つ。 */
.sea-bite-mark {
  margin: 0;
  font-size: clamp(40px, 13vw, 56px);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff8dc;
  -webkit-text-stroke: 2px #7a3b00;
  text-shadow: 0 0 14px rgba(0, 0, 0, 0.5), 0 3px 6px rgba(0, 0, 0, 0.45), 0 0 24px rgba(255, 246, 191, 0.6);
  animation: sea-bite-pop 0.28s cubic-bezier(0.2, 1.6, 0.4, 1) both, pulse 0.5s 0.28s infinite alternate;
}
.sea-bite-caption {
  margin: 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
/* 2026-08-26 item14「釣れたときHITみたいにGETもだして」対応: #sea-bite-markと同じ見た目・
   アンカーを流用しつつ、HIT(琥珀)と見分けがつくよう縁取り・光彩を緑系にした「GET!」演出。 */
.sea-catch-mark {
  color: #f2fff0;
  -webkit-text-stroke: 2px #1e6b2e;
  text-shadow: 0 0 14px rgba(0, 0, 0, 0.5), 0 3px 6px rgba(0, 0, 0, 0.45), 0 0 24px rgba(191, 255, 205, 0.7);
}
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.1); } }
@keyframes sea-bite-pop {
  0% { transform: scale(0.2); opacity: 0; }
  60% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* 2026-08-26「ファイト中の画面が見づらい」→「背景もっとはっきり差し替えちゃっていいよ」→
   「背景海の方は消えないで」→「背景やめよう、ファイトUIを海側(釣り堀すぐ上)に移動したら
   どうかな」と紆余曲折した末の方針: .sea-fight-overlay自体を塗りつぶすのはやめ(海・魚影は
   常に見えたままにする)、代わりにファイトUI一式だけを.sea-fight-panelという単独のカードに
   まとめ、そのカードだけに背景を敷いて釣り堀(.pier、下22%)のすぐ上に寄せて置く
   (海が主役の画面のまま、UIだけ読みやすくする)。 */
.sea-fight-overlay {
  position: absolute;
  inset: 0;
  /* .catwrap(猫)がz-index:6のため、同じ6だと猫がパネルの上に描かれてしまう。
     猫より確実に手前(上)になるよう7にする。 */
  z-index: 7;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end; /* パネルを釣り堀(.pier)のすぐ上に寄せる */
  padding-bottom: 22%; /* .pier(下22%)にぴったり接するように、隙間なく上に重ねる */
}
/* 2026-08-26「背景は透過にもどしてこんな感じの位置」対応(添付画像どおり): 角丸の
   独立カードではなく、左右いっぱいに広がる半透明の帯にする。海(魚影)は薄く透けて見える
   ままにし、上端は特に区切らず(タップで竿を振るのすぐ下から).pierの上端まで隙間なく
   ぴったり続ける。 */
.sea-fight-panel {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(10, 16, 28, 0.62);
  padding: 10px 12px 12px;
}
.sea-fight-fish-name {
  margin: 0 0 6px;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  /* 2026-08-26「HIT後のファイトメーターが1タップめで必ず上にすこしずれる」対応:
     開始時のプレースホルダ文言「？？？ (影がはっきりしてきた…)」と、1タップ目で
     差し替わる実際の魚名(例: 鰯(いわし))とで折り返し行数が変わり(2行→1行)、
     このブロックの高さが変化していた。#sea-fight-meter-track等は下の
     .sea-fish-life-track の margin-top:auto で位置が決まるため、fish-nameの高さが
     変わるとメーターごと縦位置がずれる(=1タップ目だけ動いて見える)。min-height を
     2行ぶん確保して固定し、テキストが変わっても高さが変わらないようにする。 */
  min-height: 30px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.3;
}
.sea-fight-timer {
  margin: 0 0 4px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.sea-fight-timer.urgent {
  color: #ffb3b3;
  font-weight: 700;
  animation: pulse 0.5s infinite alternate;
}
.sea-fish-life-track {
  /* 2026-08-25(v0.6.0)「ファイト中の魚HPはファイト中メーターのすぐ上にだす」対応の名残。
     2026-08-26「残り秒数と魚名表示、HPの上あたりにして」対応: margin-top:autoは
     このグループの先頭(.sea-fight-fish-name)側に移したため、ここは魚名/タイマーとの
     間隔だけを決める小さな固定値にする(auto二重にすると再び間延びする)。 */
  width: 88%;
  height: 10px;
  margin-top: 2px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.sea-fish-life-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #d9607a, #f0b7c4);
  transition: width 0.2s ease;
}
/* 2026-08-26「ファイト中の端の回復はそのタイミングで回復して」対応: メーターの端で
   跳ね返るたびの回復をタップを待たずその場で見せるための、ライフバー自身の一瞬の光。
   タップ結果の表示(#fight-damage)とは別の演出にして「余計な表示が増えた」を避ける。 */
.sea-fish-life-fill.bounce-heal-flash { animation: bounce-heal-flash 0.5s ease-out; }
@keyframes bounce-heal-flash {
  0% { box-shadow: 0 0 0 rgba(182, 242, 193, 0); filter: brightness(1); }
  30% { box-shadow: 0 0 10px rgba(182, 242, 193, 0.9); filter: brightness(1.4); }
  100% { box-shadow: 0 0 0 rgba(182, 242, 193, 0); filter: brightness(1); }
}
.sea-fight-meter-track {
  position: relative;
  width: 88%;
  height: 12px;
  margin-top: 6px;
  margin-bottom: 8px;
  border-radius: 999px;
  overflow: hidden;
  /* 2026-08-25「ピンクのエリア外でタップしてもダメージ判定がまだ入ってる」対応:
     ピンクゾーンの幅(38%〜62%)は shared/engine.js fightPinkZoneHalfWidth()
     ( = RULES.fightCenterDamage / RULES.fightDamageFalloff = 9/1.2 = 7.5、中心50%から
     ±7.5)と必ず一致させる(サーバーの当たり判定もこの式そのもの、single source of
     truth)。RULES側の数値を変えたらここも一緒に直すこと。
     2026-08-26「ピンクゾーン内で中央に近づくほどダメージが入る判定になっているが境目が
     わかるようにちょうど真ん中を赤としてピンクゾーンをグラデーションにする」対応:
     ゾーン外(0〜38%・62〜100%)は白のまま、ゾーン内(38〜62%)は端のピンクから
     中心50%の赤へ連続的に濃くなるグラデーションにし、ダメージが中心に近いほど
     大きいという実際の判定式(fightDamageForValue、中心からの距離に比例して減衰)を
     見た目でも表現する。
     2026-08-26「ファイトで魚が回復するのはこちらがタップしたエリアがピンク以外のゾーンだった
     とき…タップしたエリアがピンク内のときはダメージ」対応: 端だけを回復ゾーンにする案を
     一度試したが実用にならなかった(「回復されなくなった」)ため撤回し、ピンク=ダメージ、
     それ以外=回復のシンプルな二値に戻した(server/src/runs.js参照)。それに合わせて、
     ピンク以外の領域(0〜38%・62〜100%)全体を.sea-fight-damage.healと同じ薄緑(#b6f2c1)で
     塗り、「ピンク以外はどこでも回復する」ことが見た目でも分かるようにした。 */
  background: linear-gradient(90deg,
    #b6f2c1 0%,
    #b6f2c1 38%,
    #ffd7de 38%,
    #ff3b5c 50%,
    #ffd7de 62%,
    #b6f2c1 62%,
    #b6f2c1 100%
  );
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.sea-fight-meter-needle {
  position: absolute;
  top: -3px;
  width: 4px;
  height: 18px;
  background: var(--pink);
  border-radius: 2px;
  left: 0%;
}
.sea-fight-damage {
  margin: 0 0 4px;
  /* 2026-08-26「HIT後最初のタップでファイトメーターがずれるバグがなおってない」再調査で判明:
     以前のmin-height:16pxはfont-size:13pxの実際のレンダリング高さ(空文字なら16pxだが、
     "-8"等の文字が入ると約19px)を下回っていた。この要素は#fight-fish-nameより後にDOM上に
     あるが、親.sea-fight-overlay内で.sea-fish-life-track以降がmargin-top:autoで下寄せ
     されているため、後続要素であるこの#fight-damageの高さが変わるだけでも
     .sea-fish-life-track/.sea-fight-meter-trackの位置(margin-top:autoで決まる)が
     一緒に動いてしまっていた(=1タップ目、初めてダメージ数値が入る瞬間だけ発生)。
     min-heightを実際の最大高さぶんに広げて解消する。 */
  min-height: 19px;
  line-height: 19px;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.sea-fight-damage.heal { color: #b6f2c1; }
.sea-fight-caption {
  margin: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 11px;
}

/* 2026-08-25「逃げられたのメッセージがちょっとズレた場所に表示されていそう」対応:
   position:fixed(ビューポート基準)をやめ、.sea基準のposition:absoluteにした。
   キャッチ・見送り・逃げられた、すべてのトーストがこの1つのアンカーを共有する。 */
.catch-toast {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  font-weight: 700;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 90;
  max-width: 90%;
  text-align: center;
  pointer-events: none;
}
.catch-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 釣果の縦リスト(2026-08-25「釣った魚は右にリスト表示して」対応)。プレイエリアを
   狭めすぎないよう幅を抑えたスリムな列で、新しい釣果ほど上に来る。 */
.catch-sidebar {
  flex: 0 0 auto;
  width: 64px;
  max-height: none;
  align-self: stretch;
  background: #ffffffcc;
  border-radius: 14px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.catch-sidebar-label { font-size: 10px; color: var(--text-muted); margin: 0 0 6px; text-align: center; }
.catch-sidebar-list {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  overflow-y: auto;
}
.catch-sidebar-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f8f4ec;
  border-radius: 8px;
  padding: 3px 2px;
  font-size: 10px;
  line-height: 1.2;
}
.catch-sidebar-chip .kanji { font-size: 14px; }
.catch-sidebar-chip .count { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.action-row {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.action-row > * { flex: 1 1 45%; margin: 0; text-decoration: none; box-sizing: border-box; text-align: center; }
/* 2026-08-26「道具、図鑑、ショップ、あいことばのボタンを小さくして1行にできない?」→
   「納竿するもショップの横にして全部並ぶようにボタン小さくしようか」→
   「図鑑と納竿の間に『遊び方』ボタンほしい、1列にしたいのでボタンサイズは調整して」対応:
   道具・ショップ・図鑑・遊び方(aタグ)・納竿の5個すべてを、より小さくして横1行に収める
   (.action-row > *でbutton/aタグどちらも対象にする)。 */
.action-row > * {
  flex: 1 1 0;
  font-size: 10px;
  padding: 8px 1px;
}

/* --- 結果画面 ------------------------------------------------------------------ */
.result-card {
  width: 100%;
  max-width: 420px;
  background: #ffffffee;
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  z-index: 50;
}
.result-score { font-size: 24px; font-variant-numeric: tabular-nums; }
.result-line { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.result-catches { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 12px 0; }
.catch-chip { background: #f8f4ec; border-radius: 999px; padding: 4px 10px; font-size: 12px; }
/* 2026-08-26「釣果画面がみづらい魚別に集計した結果にして」対応: 結果画面(納竿後)は
   釣った順のチップ羅列ではなく、魚種ごとに1行(名前・匹数・最大サイズ・合計スコア)で集計表示する。 */
.catch-summary-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8f4ec;
  font-size: 13px;
}
.catch-summary-row + .catch-summary-row { margin-top: 6px; }
.catch-summary-name { font-weight: 700; }
.catch-summary-count { color: var(--text-muted); }
.catch-summary-size { color: var(--text-muted); font-size: 11.5px; white-space: nowrap; }
.catch-summary-score { font-weight: 800; color: var(--pink); white-space: nowrap; }

/* --- フッター ------------------------------------------------------------------ */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  background: #ffffffee;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 11px;
  border-top: 1px solid #eee;
}
.footer-links, .footer-meta { margin: 2px 0; display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--pink); }
.version-link { font-size: 10px; color: var(--text-muted); text-decoration: none; border-bottom: 1px dotted currentColor; }
.version-link:hover { color: var(--pink); }
.copyright { color: var(--text-muted); }

/* --- v0.11.0「撒き餌」対応 ---------------------------------------------------------- */
/* ヘッダーの装備表示ピル(ルアー・竿・撒き餌)。既存.pillのスタイルをそのまま使う。 */
#pill-chum { background: #fff2c9dd; }

/* 魚カゴ(#fish-basket、.pier内)とは重ならない位置に置く「撒き餌」ボタン。
   idleフェーズかつ撒き餌を装備しているときだけmain.js側でhiddenを外す。
   2026-08-26「撒き餌のボタンをもう少し上の海側に、カゴとかぶらないようにする」対応:
   以前はbottom:20%で籠(防波堤22%の範囲内)と重なって見えていたため、防波堤の外
   (海側)まで引き上げた(32%)。
   2026-08-26「撒き餌ボタンはもっと上でカゴとかぶらないようにして」対応: 32%でもまだ
   籠(bottom:6%、高さぶんを含めると防波堤付近まで及ぶ)と近すぎたため、さらに引き上げた(44%)。
   2026-08-26「全然まだかぶってる、もっと海スレスレまで上でいいしもっと左でいい」対応:
   一旦.pierの外(.sea直下)へ移し、.sea基準top:13%(水平線のすぐ下)まで引き上げた。
   2026-08-26「撒き餌ボタンと竿を振るの判定が同時に入ってる、撒き餌ボタンは釣り堀の海際に
   してほしい」対応(真因判明): .pierの外に出したことで、#seaのクリック判定
   (isTapInPierArea、.pierの中だけをキャスト開始タップの対象外にしている)の対象になって
   しまい、ボタンを押すとその下でキャストも同時に始まっていた。.pierの中(タップ判定の
   対象外)へ戻し、その中で最も海側=上端に寄せることで、要望(海際に置く)とタップ誤爆
   防止を両立させた。以降、%指定は.pier(.seaの下22%)基準に戻る。 */
.chum-button {
  position: absolute;
  left: 3%;
  top: 6%; /* .pier基準、その上端(海際)寄り */
  z-index: 6;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--pink);
  border: 2px solid var(--pink-soft);
  cursor: pointer;
}
.chum-button:disabled { opacity: 0.5; cursor: not-allowed; }

/* 「撒き餌」押下時、海に向かって何かを撒くエフェクト(main.js playChumScatterEffect)。
   小さな粒がふわっと弧を描いて散らばって消える、tossFishToBasket/toss-arcと同じ考え方の
   シンプルなCSSキーフレーム。 */
.chum-scatter-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #f5d98a 0%, #c99a3a 100%);
  pointer-events: none;
  z-index: 6;
  transform: translate(-50%, -50%);
  animation: chum-scatter 650ms ease-out forwards;
}
@keyframes chum-scatter {
  0% { left: var(--start-x); top: var(--start-y); opacity: 1; transform: translate(-50%, -50%) scale(1); }
  70% { opacity: 1; }
  100% { left: var(--end-x); top: var(--end-y); opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
}

/* v0.12.0「忍び寄る猫」対応(2026-08-26設計メモ)。
   猫ルーチュボタン(#use-catfood-btn): .chum-buttonと同じ.pier子要素・同じ見た目で、
   左右反転しただけの位置(right:3%; top:6%)。 */
.catfood-button {
  position: absolute;
  right: 3%;
  top: 6%; /* .pier基準、.chum-buttonと同じ高さ */
  z-index: 6;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--pink);
  border: 2px solid var(--pink-soft);
  cursor: pointer;
}
.catfood-button:disabled { opacity: 0.5; cursor: not-allowed; }

/* 猫の見た目: .sea(.pierではない)の直下、防波堤の上を歩く「見える」キャラクター。
   段階が進むごとにmain.jsがright/transform(scaleY)/中身のSVG(eyeSlit)を書き換える。
   大きさ(高さ)自体は段階を問わず一定(distance/posture/eyesだけで演出する設計)。 */
.catwrap {
  position: absolute;
  bottom: 6%; /* .pier(下22%)の上端付近、防波堤の上を歩いているように見せる */
  height: 8%;
  aspect-ratio: 110 / 66;
  transform-origin: bottom right;
  transition: right 1.4s ease-in, transform 1.4s ease-in, opacity 0.6s ease 0.9s;
  /* 2026-08-26「猫の動きと絵はクォッカの手前にしたい」対応: 以前は.quokka-dockと同じ
     z-index:5だったため、レイヤーが重なったときDOM順(クォッカが先)でクォッカが手前に
     描画されていた。クォッカ(z-index:5)より確実に手前になるよう6に上げる
     (猫ルーチュボタン系のz-index:6とは別レイヤー、.catwrapはpointer-events:noneなので
     ボタンのクリックは奪わない)。 */
  z-index: 6; /* 魚カゴ・クォッカより手前 */
  pointer-events: none;
}
.catwrap svg { display: block; overflow: visible; width: 100%; height: 100%; }

/* 猫の接近段階に応じた.seaの警戒色(#pill-time.urgentと同じ配色を踏襲)。
   段階3〜4はやや警戒(オレンジ寄り)、段階5(猶予中)は既存の.urgentと同じ赤系+明滅。 */
.sea.cat-warn { box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.2), 0 0 0 3px #e39a63; }
.sea.cat-danger {
  box-shadow: inset 0 0 30px rgba(179, 50, 74, 0.35), 0 0 0 3px #b3324a, 0 0 14px rgba(179, 50, 74, 0.55);
  animation: cat-danger-pulse 0.6s infinite alternate;
}
@keyframes cat-danger-pulse {
  from { box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.2), 0 0 0 3px #b3324a; }
  to { box-shadow: inset 0 0 30px rgba(179, 50, 74, 0.35), 0 0 0 3px #b3324a, 0 0 14px rgba(179, 50, 74, 0.55); }
}
