/* TCG入手情報ボード(β) - モック用スタイル
   ライト固定・外部フォント/CDN不使用・システムフォントスタック */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: #f5f7fb;
}

body {
  color: #17233b;
  background-color: #f5f7fb;
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

a {
  color: #2563eb;
}

/* キーボードfocusリング(共通)。ブラウザ既定の消失/不一致を防ぐ */
:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* ---- header ---- */

.site-header {
  position: relative;
  z-index: 0;
  overflow: hidden;
  margin-top: 12px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #05193e 0%, #123a7c 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(5, 25, 62, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.site-header::after {
  content: '';
  position: absolute;
  z-index: -1;
  top: -50px;
  right: -50px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.pr-disclosure {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 6px;
}

/* ツール一覧への戻り導線。site-header は濃色背景なので既定のリンク色(#2563eb)では
   読めない＝pr-disclosure と同じ白系で置く（2026-09-01 公開時に追加） */
.back-link {
  display: inline-block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  margin: 0 0 8px;
}

.back-link:hover,
.back-link:focus-visible {
  color: #fff;
  text-decoration: underline;
}

.site-header h1 {
  font-size: 21px;
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}

.site-header .lead {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 6px;
}

.updated-at {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* ---- control bar (sticky tabs + filters) ---- */

.control-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 16px -16px 0;
  padding: 12px 16px;
  background: rgba(245, 247, 251, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(5, 25, 62, 0.08);
}

/* ---- tabs / filters ---- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
}

.tab-btn,
.chip-btn {
  appearance: none;
  border: 1px solid #d8dde5;
  background: #ffffff;
  color: #374151;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.tab-btn:active,
.chip-btn:active {
  transform: translateY(1px);
}

.tab-btn.is-active,
.chip-btn.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 8px;
}

/* ---- search + store (検索・販売元) ---- */
/* filter-row とは別の行にしている。モバイルでは filter-row が横スクロール帯に
   なるため、その中に入れると検索窓が画面外へ流れて押せなくなる。 */
.search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.search-icon {
  position: absolute;
  left: 10px;
  font-size: 12px;
  line-height: 1;
  opacity: 0.55;
  pointer-events: none;
}

.search-input {
  width: 100%;
  min-width: 0;
  font-size: 16px; /* iOSで入力時に自動ズームされない下限 */
  font-family: inherit;
  color: #17233b;
  background: #ffffff;
  border: 1px solid #d8dde5;
  border-radius: 999px;
  padding: 7px 36px 7px 30px;
  appearance: none;
}

.search-input::placeholder {
  color: #9ca3af;
  font-size: 13px;
}

.search-input:focus {
  border-color: #2563eb;
}

/* 既定の×は環境差が大きいので自前ボタンに統一する */
.search-input::-webkit-search-cancel-button {
  display: none;
}

/* hidden属性より .search-clear の display が優先されてしまうため明示的に消す */
.search-clear[hidden] {
  display: none;
}

/* 見た目は直径22pxの丸、当たり判定は32px四方（WCAG 2.2 の最小24pxを満たす）。
   背景を radial-gradient で描くことで、要素を大きくしても丸は太らない。 */
.search-clear {
  position: absolute;
  right: 3px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: radial-gradient(circle at center, #e5e7eb 0 11px, transparent 11px);
  color: #4b5563;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.store-label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
  font-size: 12px;
  color: #6b7280;
}

.store-label select {
  max-width: 190px;
  font-size: 13px;
  font-family: inherit;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #d8dde5;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
  text-overflow: ellipsis;
}

/* ---- chip の件数バッジ ---- */
/* opacity で薄めるとコントラストが 4.33:1 まで落ちる（AA 4.5:1 未満）ため色で指定する */
.chip-count {
  margin-left: 4px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: #6b7280;
}

.chip-btn.is-active .chip-count {
  color: rgba(255, 255, 255, 0.88);
}

.chip-count:empty {
  display: none;
}

/* 0件の選択肢。押せなくはしない（別の条件を外せば出てくるため）＝
   操作可能な文字なのでコントラストは AA(4.5:1)を満たす色にする。#9ca3af は 2.45:1 で不足。 */
.chip-btn.is-empty:not(.is-active) {
  color: #6b7280;
  border-color: #e5e7eb;
  background: #fafbfc;
}

.game-chips,
.kind-chips,
.apply-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toggle-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #374151;
  border: 1px solid #d8dde5;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  background: #ffffff;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.toggle-label:active {
  transform: translateY(1px);
}

.toggle-label.is-active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}

.toggle-label input {
  margin: 0;
  accent-color: #2563eb;
}

.reset-link {
  font-size: 12px;
  color: #6b7280;
  text-decoration: underline;
}

.sort-label {
  font-size: 12px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.sort-label select {
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #d8dde5;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
}

/* ---- ⑥「自分向け設定」(条件タグの優先表示) ---- */
.profile-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed #e5e7eb;
}

.profile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 選択中は「合致」を示す色(緑系)にする。矛盾チェック(⑥矛盾は下位表示)自体は色を変えない
   ＝選んだ・選んでいないの状態表示であり、判定結果の色ではないため既定のis-activeより
   トーンを変える(#16a34aはrail-openと同系色＝「受付中」表現と混同しないよう緑を1段階変える)。 */
.profile-chips .chip-btn.is-active {
  background: #059669;
  border-color: #059669;
  color: #ffffff;
}

.profile-note {
  flex-basis: 100%;
  margin: 0;
  font-size: 11px;
  color: #6b7280;
}

/* ---- attention info / result count ---- */

.attention-info {
  margin-top: 12px;
  font-size: 12px;
  color: #6b7280;
}

.attention-info summary {
  cursor: pointer;
  color: #374151;
  font-weight: 600;
}

.attention-info p {
  margin: 8px 0 4px;
}

.attention-info ul {
  margin: 0 0 4px;
  padding-left: 18px;
}

.result-count {
  font-size: 12px;
  color: #6b7280;
  margin: 12px 0 0;
}

/* ---- 適用中の絞り込み（一覧の直前・スクロールしない位置に出す） ---- */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.active-filters[hidden] {
  display: none;
}

.active-filters-label {
  font-size: 12px;
  color: #6b7280;
}

/* 枠線はページ地(#f5f7fb)に対して3:1以上にする（WCAG 1.4.11・UI部品の輪郭）。
   #bfd3f5 は 1.41:1 で地と同化し「押せる」ことが伝わらない。#4d84d1 で 3.54:1。 */
.active-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  border: 1px solid #4d84d1;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 3px 8px 3px 10px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-pill:hover {
  border-color: #2563eb;
}

.active-pill-x {
  font-size: 13px;
  line-height: 1;
  opacity: 0.75;
}

.active-pill-reset {
  border-color: #7c8798; /* 地に対して3.39:1 */
  background: #ffffff;
  color: #4b5563;
  padding: 3px 10px;
}

/* ---- event list / cards ---- */

.event-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.event-card {
  position: relative;
  border: 1px solid rgba(5, 25, 62, 0.08);
  border-radius: 12px;
  padding: 12px 12px 12px 16px;
  margin-bottom: 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(5, 25, 62, 0.06), 0 8px 24px rgba(5, 25, 62, 0.06);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.event-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(5, 25, 62, 0.08), 0 12px 32px rgba(5, 25, 62, 0.10);
}

.event-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #9ca3af;
}

.event-card.rail-open::before {
  background: #16a34a;
}

.event-card.rail-upcoming::before {
  background: #2563eb;
}

.event-card.rail-awaiting::before {
  background: #f59e0b;
}

.event-card.rail-ended::before {
  background: #9ca3af;
}

.event-card.is-applied {
  opacity: 0.55;
}

/* ⑥「自分向け設定」に選んだ属性と合致するカードの軽いハイライト(枠色)。
   排除ではなく優先表示のための印であり、rail(左帯・ステータス色)とは別軸なので上書きしない。 */
.event-card.is-profile-match {
  box-shadow: 0 0 0 2px #059669, 0 1px 2px rgba(5, 25, 62, 0.06), 0 8px 24px rgba(5, 25, 62, 0.06);
}

.event-card-main {
  display: flex;
  gap: 8px;
}

.event-thumb {
  flex: 0 0 104px;
  width: 104px;
  height: 104px;
  border-radius: 8px;
  overflow: hidden;
}

@media (min-width: 600px) {
  .event-thumb {
    flex-basis: 120px;
    width: 120px;
    height: 120px;
  }
}

.thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid #d8dde5;
}

.thumb-placeholder {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #ffffff;
  overflow: hidden;
}

.thumb-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.14) 0,
    rgba(255, 255, 255, 0.14) 6px,
    transparent 6px,
    transparent 12px
  );
}

.placeholder-pokemon {
  background: linear-gradient(135deg, #e0463c 0%, #f59e0b 100%);
}

.placeholder-onepiece {
  background: linear-gradient(135deg, #05193e 0%, #2563eb 100%);
}

.placeholder-yugioh {
  background: linear-gradient(135deg, #4c1d95 0%, #a16207 100%);
}

.thumb-kind {
  position: relative;
  font-size: 13px;
  font-weight: 700;
  z-index: 1;
}

.thumb-game {
  position: relative;
  font-size: 11px;
  margin-top: 4px;
  opacity: 0.9;
  z-index: 1;
}

.event-body {
  flex: 1 1 auto;
  min-width: 0;
}

.applied-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 11px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ウォッチ(☆/★)トグル。応募済みトグル(右上)と対になる左上に置く。 */
.watch-toggle {
  position: absolute;
  top: 8px;
  left: 8px;
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  padding: 2px;
}

.watch-toggle.is-watched {
  color: #f59e0b;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  padding-right: 64px;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
}

.badge-today {
  background: #dc2626;
  color: #ffffff;
}

.badge-open {
  background: #16a34a;
  color: #ffffff;
  font-weight: 700;
}

.badge-upcoming {
  background: #eff6ff;
  color: #1d4ed8;
}

.badge-new {
  background: #dbeafe;
  color: #1e40af;
}

.badge-neutral {
  background: #e5e7eb;
  color: #374151;
}

.badge-awaiting-purchase {
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
}

.badge-purchasable {
  background: #b45309;
  color: #ffffff;
  font-weight: 700;
}

.badge-override {
  background: #374151;
  color: #ffffff;
}

/* 暫定掲載(商品同定が未確定)。needs_check(日時等の一部未確定・amber系チップ)とは
   色ではなく形状で見分ける: 新しい色相を持ち込まず、サイト内で既に使っているグレー系
   (badge-neutral/badge-overrideと同じ #e5e7eb・#374151、枠線は他所でも使用中の #6b7280)
   に破線の枠を組み合わせる。 */
.badge-provisional {
  background: #e5e7eb;
  color: #374151;
  border: 1px dashed #6b7280;
}

.provisional-no-source {
  font-size: 12px;
  color: #b45309;
  margin: 4px 0;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 400;
}

.chip-game-pokemon {
  background: #fee2e2;
  color: #b91c1c;
}

.chip-game-onepiece {
  background: #e0e7ff;
  color: #312e81;
}

.chip-game-yugioh {
  background: #ede9fe;
  color: #5b21b6;
}

.chip-kind {
  background: #eef1f6;
  color: #374151;
  border: 1px solid #d8dde5;
}

.chip-condition {
  background: #eef1f6;
  color: #374151;
  border: 1px solid #d8dde5;
  font-size: 11px;
}

.chip-remain-urgent {
  background: #dc2626;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
}

.chip-remain-soon {
  background: #f59e0b;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
}

.chip-remain-normal {
  background: #e5e7eb;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
}

.chip-needs-check {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* 情報鮮度チップ(sources最古のcheck時刻が72h超)。要確認チップ(amber濃)より
   トーンを落とし、常時目に入っても煩くならないようにする。 */
.chip-stale {
  background: #f3f4f6;
  color: #92400e;
  border: 1px solid #e5e7eb;
}

/* ウォッチ中カードの締切48h以内チップをさらに強調する(通知・音は無し・静的な縁取りのみ)。 */
.chip-watch-emphasis {
  box-shadow: 0 0 0 2px #facc15;
}

.chip-game-other {
  background: #ede9fe;
  color: #5b21b6;
}

.placeholder-other {
  background: linear-gradient(135deg, #475569 0%, #7c3aed 100%);
}

.card-detail {
  margin: 8px 0 4px;
  font-size: 13px;
  color: #374151;
}

.card-detail summary {
  cursor: pointer;
  color: #2563eb;
  font-size: 12px;
}

.card-detail p {
  margin: 8px 0 0;
}

.detail-analysis {
  color: #374151;
  background: #eef1f6;
  border-left: 3px solid #cbd5e1;
  padding: 6px 8px;
  border-radius: 0 6px 6px 0;
}

.key-info {
  font-size: 13px;
  line-height: 1.55;
  color: #1e3a5f;
  background: #eff6ff;
  border-left: 3px solid #2563eb;
  padding: 6px 8px;
  border-radius: 0 6px 6px 0;
  margin: 8px 0 4px;
}

.event-product {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.55;
  margin: 4px 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.event-store {
  font-size: 13px;
  line-height: 1.55;
  color: #374151;
  margin: 4px 0;
}

.event-result,
.event-purchase {
  font-size: 13px;
  line-height: 1.55;
  color: #374151;
  margin: 4px 0;
}

.event-period {
  font-size: 17px;
  font-weight: 700;
  color: #17233b;
  line-height: 1.4;
  margin: 8px 0 4px;
}

.period-suffix {
  font-size: 13px;
  font-weight: 400;
  color: #6b7280;
}

.event-notes {
  font-size: 12px;
  line-height: 1.55;
  color: #6b7280;
  margin: 4px 0;
}

/* ② 作戦ビューを開くリンク(カード内・route_count>=2の時のみ表示) */
.strategy-link-row {
  margin: 8px 0 0;
}

.strategy-link {
  appearance: none;
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

/* ③ offersバッジ(既定OFF・OFFERS_UI_ENABLED=trueになるまでDOMに出ない) */
.event-offers {
  margin: 8px 0 0;
}

.offers-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #065f46;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  border-radius: 999px;
  padding: 4px 10px;
  text-decoration: none;
}

.event-attention {
  font-size: 13px;
  margin: 4px 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.attention-pill {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 10px;
  line-height: 1.4;
}

.attention-pill-5 {
  background: #fde68a;
}

.attention-note {
  font-size: 12px;
  color: #6b7280;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: opacity 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  opacity: 0.88;
}

.btn:active {
  transform: translateY(1px);
}

.btn-official {
  background: #ffffff;
  color: #2563eb;
  border-color: #2563eb;
}

.btn-official-primary {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.btn-affiliate-amazon {
  background: #ff9900;
  color: #1f2937;
  border-color: #ff9900;
}

.btn-affiliate-rakuten {
  background: #bf0000;
  color: #ffffff;
  border-color: #bf0000;
}

.calendar-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  height: 40px;
  font-size: 13px;
  color: #6b7280;
  text-decoration: underline;
}

.empty-msg {
  list-style: none;
  text-align: center;
  color: #6b7280;
  padding: 24px 0;
  font-size: 13px;
}

.empty-title {
  margin: 0;
  color: #374151;
  font-weight: 600;
}

.empty-sub {
  margin: 6px 0 0;
  font-size: 12px;
}

.empty-reset {
  margin-top: 12px;
  border: 1px solid #d8dde5;
  background: #ffffff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.empty-reset:hover {
  border-color: #2563eb;
  background: #eff6ff;
}

.load-error {
  color: #dc2626;
  font-size: 13px;
}

/* 情報鮮度の全体障害バナー(表示対象の80%以上がstaleな時のみ・個別チップの代わりに1本だけ出す)。 */
.freshness-banner {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  margin: 12px 0 0;
}

.freshness-banner[hidden] {
  display: none;
}

/* ---- sections ---- */

.section-details {
  margin-top: 16px;
  border-top: 1px solid #d8dde5;
  padding-top: 8px;
}

.section-details summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: #05193e;
  padding: 8px 0;
}

.section-details summary span {
  display: inline-block;
  margin-left: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(5, 25, 62, 0.08);
  color: #05193e;
  font-size: 12px;
  font-weight: 700;
}

/* ---- footer ---- */

.site-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid #d8dde5;
  font-size: 12px;
  color: #6b7280;
}

.site-footer p {
  margin: 0 0 6px;
}

.channels-details {
  margin: 10px 0;
}

.channels-details summary {
  cursor: pointer;
  color: #374151;
}

.channels-details ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

/* ---- ② 作戦ビュー(商品別の全入手経路一覧)パネル ---- */
/* ページ内の1枚だけを共有するオーバーレイパネル。カード側の「入手経路N件」ボタンで開く。 */
.strategy-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(5, 25, 62, 0.45);
  padding: 0;
}

.strategy-panel[hidden] {
  display: none;
}

.strategy-panel-inner {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 82vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 16px 16px 0 0;
  padding: 20px 16px 24px;
  box-shadow: 0 -8px 32px rgba(5, 25, 62, 0.2);
}

@media (min-width: 600px) {
  .strategy-panel {
    align-items: center;
  }
  .strategy-panel-inner {
    border-radius: 16px;
    max-height: 80vh;
  }
}

.strategy-panel-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
}

.strategy-panel-title {
  font-size: 16px;
  font-weight: 700;
  color: #05193e;
  margin: 0 32px 4px 0;
}

.strategy-panel-note {
  font-size: 12px;
  color: #6b7280;
  margin: 0 0 12px;
}

.strategy-route-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.strategy-route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 10px 0;
  border-top: 1px solid #eef1f6;
  font-size: 13px;
  color: #374151;
}

.strategy-route:first-child {
  border-top: none;
}

.strategy-route-store {
  font-weight: 700;
  color: #05193e;
}

.strategy-route-method,
.strategy-route-status {
  background: #eef1f6;
  border: 1px solid #d8dde5;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  color: #374151;
}

.strategy-route-period {
  color: #6b7280;
  font-size: 12px;
  width: 100%;
}

.strategy-jump {
  appearance: none;
  border: 1px solid #2563eb;
  background: #ffffff;
  color: #2563eb;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

/* ---- mobile (control-bar row budget / card density) ---- */

@media (max-width: 480px) {
  .control-bar {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  /* tabs + filter-row become single-line horizontal scroll strips so the
     sticky control-bar stays within a small, predictable row budget
     regardless of how many chips are shown. */
  .tabs,
  .filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .tabs::-webkit-scrollbar,
  .filter-row::-webkit-scrollbar {
    display: none;
  }

  .tabs > *,
  .filter-row > * {
    flex: 0 0 auto;
  }

  .game-chips,
  .kind-chips,
  .apply-chips,
  .toggle-chips,
  .profile-chips {
    flex-wrap: nowrap;
  }

  .sort-label {
    margin-left: 0;
  }

  /* 検索・販売元は横スクロール帯に載せない（画面外へ流れて押せなくなるため）。
     検索窓を広く取り、販売元セレクトは残り幅に収める。 */
  .search-row {
    margin-top: 6px;
    gap: 6px;
  }

  .store-label-text {
    display: none;
  }

  .store-label select {
    max-width: 47vw;
  }

  .event-card {
    padding: 8px 8px 8px 12px;
  }

  .event-card-main {
    gap: 8px;
  }
}

/* ---- desktop layout (2026-08-26) ----
   PC幅では control-bar(タブ+検索+チップ4群+並び替え)が縦に約300px積み上がり、
   sticky常時固定のせいでファーストビューの半分を占め商品一覧が見えなかった対策。
   - 481〜959px: stickyのみ解除(背の高い積み上げバーを画面に居座らせない)
   - 960px〜  : 2カラム化。フィルタ一式は左サイドバーのカードへ移し、
                商品一覧が右カラムの全高を使う。モバイル(〜480px)は従来のまま */

/* チップ群のグループ見出し。サイドバー化した時だけ表示する
   (SR向けの名前は各グループの role="group"+aria-label が持つ) */
.fgroup-label {
  display: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #6b7280;
}

@media (min-width: 481px) and (max-width: 959px) {
  .control-bar {
    position: static;
  }
}

@media (min-width: 960px) {
  .page {
    max-width: 1200px;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    column-gap: 24px;
    align-items: start;
  }

  .site-header {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .attention-info {
    grid-column: 2;
    grid-row: 2;
  }

  main {
    grid-column: 2;
    grid-row: 3;
  }

  .site-footer {
    grid-column: 1 / -1;
    grid-row: 4;
  }

  /* フィルタ一式＝左サイドバーのカード。列内でstickyにし、
     ビューポートより背が高い環境ではカード内部でスクロールする */
  .control-bar {
    grid-column: 1;
    grid-row: 2 / 4;
    align-self: start;
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    margin: 16px 0 0;
    padding: 14px 14px 16px;
    background: #ffffff;
    border: 1px solid rgba(5, 25, 62, 0.08);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(5, 25, 62, 0.06), 0 8px 24px rgba(5, 25, 62, 0.06);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* サイドバー内は縦積み+グループ見出し。チップは一回り小さく */
  .fgroup-label {
    display: block;
  }

  .tabs {
    gap: 6px;
  }

  .tab-btn,
  .chip-btn,
  .toggle-label {
    padding: 5px 10px;
    font-size: 12px;
  }

  .search-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 12px;
  }

  .store-label {
    justify-content: space-between;
    gap: 8px;
  }

  .store-label .store-label-text {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .store-label select {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-top: 12px;
  }

  .game-chips,
  .kind-chips,
  .apply-chips,
  .toggle-chips,
  .profile-chips {
    gap: 6px;
    margin-bottom: 6px;
  }

  .sort-label {
    margin-left: 0;
    justify-content: space-between;
    gap: 8px;
  }

  .sort-label select {
    flex: 1 1 auto;
    min-width: 0;
  }
}
