/* ============================================================
   白パネル系ツールページの共通部品 (tool-panel.css)

   読み込むページ: gacha.html / cards.html / phantom-cards.html / deposit-plus1.html / shadow.html
   読み込み順: common.css → gacha_styles.css → tool-panel.css →（card-list.css）→ ページ固有 <style>

   ここに置くもの
     - 外枠（.tp-app / .tp-main）… 夜空の上に白いパネルを1枚置くレイアウト
     - ヘッダーと白パネルの間隔
     - 白い面の上のフォーカス表示
     - モード切替トグル（ヘッダー内）/ ボタン化したフィルタチップ
     - 中国先行バッジ / 該当なし表示
   ページごとに幅・余白・光彩の色が違う場合は、そのページの <style> で上書きする。
   ============================================================ */

/* ---------- 外枠 ---------- */
.tp-app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 32px 48px;
}
.tp-main {
  background: var(--panel);
  border-radius: 22px;
  padding: 26px 30px 34px;
  box-shadow: var(--sh-panel);
  border: 1px solid var(--panel-edge);
  position: relative;
  /* 右上の光彩（::after）のはみ出しを切る。overflow:hidden はスクロールコンテナを作り、
     内側の position:sticky（ガチャの抽選パネル・シャドウの計算機・カード一覧の表示切替バー）を
     効かなくするため、スクロールコンテナを作らない clip を使う。
     clip 未対応のブラウザ（Safari 15 以前）では hidden が残る（sticky は効かないが見た目は崩れない） */
  overflow: hidden;
  overflow: clip;
}
/* スマホ幅：画面端→白パネルは --gutter-panel、パネル内は 14px。
   PC の 32px＋30px のままだと 390px 幅で本文が左から 60px 以上内側に入り、カード一覧が細くなる */
@media (max-width: 600px) {
  .tp-app { padding-left: var(--gutter-panel); padding-right: var(--gutter-panel); }
  .tp-main { padding: 18px 14px 24px; border-radius: 18px; }
}
.tp-main::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 169, 74, 0.18), transparent 70%);
  pointer-events: none;
}

/* ---------- サイトヘッダー ----------
   見た目は common.css。白パネル（.tp-main）との間隔を取るため下側だけ広げる（common.css は 18px 4px 10px） */
header.site {
  padding: 18px 4px 14px;
  margin-bottom: 16px;
}

/* ---------- 白い面の上のフォーカス表示 ----------
   common.css の金色リング（#ffe088）は白パネル上ではほぼ見えないので、白い面の中だけ濃い青にする。
   モーダルなど .tp-main の外にある白い面には .tp-light を付ける */
:where(.tp-main, .tp-light) :where(a, button, summary, [role="button"], [tabindex], select):focus-visible {
  outline: 2px solid var(--sky-btn-d);
  outline-offset: 2px;
}

/* ---------- モード切替トグル（ヘッダー内・暗い背景の上） ---------- */
.tp-mode-toggle {
  display: inline-flex;
  margin-top: 14px;
  background: rgba(0, 0, 0, 0.28);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(212, 160, 74, 0.5);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.tp-mode-btn {
  font-family: var(--f-display);
  padding: 8px 22px;
  font-size: var(--fs-md);
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--ink-sub);
  cursor: pointer;
  letter-spacing: 2px;
  font-weight: 700;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.tp-mode-btn:hover:not(.active) { color: #fff; }
.tp-mode-btn.active {
  background: linear-gradient(180deg, #fff0c9 0%, var(--gold-1) 50%, var(--gold-2) 100%);
  color: #3a2200;
  box-shadow: 0 2px 10px rgba(244, 210, 122, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ---------- ボタン化したフィルタチップ ----------
   gacha_styles.css の .chip は span 前提。button にすると既定の system フォントになるので継承させ、
   指で押しやすい高さ（32px 以上）を確保する */
button.chip {
  font-family: inherit;
  line-height: 1.3;
  min-height: 32px;
  margin: 0;
}

/* ---------- 中国先行バッジ（日本版未実装・中国版の先行情報） ----------
   cards.html / phantom-cards.html / deposit-plus1.html で同じ赤系配色にしてサイト内の意味付けを揃える。
   HTML は js/card-list.js の ROMCards.cnBadge() */
.cl-cn-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 4px;
  padding: 1px 6px 1px 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #e85d5d, #c73a3a);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  vertical-align: 1px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}
.cl-cn-badge svg {
  width: 9px;
  height: 9px;
  display: block;
  fill: #ffde3a;
}

/* ---------- 該当なし（一覧が空のとき） ---------- */
.tp-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-muted);
  font-size: var(--fs-md);
  grid-column: 1 / -1;
}
