/* 明るい配色：白ベース＋水色〜ピンクのパステルグラデーション＋濃紺文字 */
:root {
  --ink: #16255c;
  --ink-soft: #43538a;
  --sky: #7fd4f7;
  --pink: #ffc7de;
  --bg: #ffffff;
  --panel: #f6fbff;
  --border: #cfe8f7;
  --accent: #1f9ed1;
  --ok: #1d8a56;
}

* { box-sizing: border-box; }

html, body { max-width: 100%; overflow-x: hidden; overflow-x: clip; }

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
img, svg { max-width: 100%; }

.site-header {
  background-image: linear-gradient(100deg, var(--sky) 0%, #bfe9ff 45%, var(--pink) 100%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  width: 100%;
  padding: 20px 16px;
  border-bottom: 3px solid var(--border);
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap;
}
.site-header h1 { margin: 4px 0; font-size: 1.5rem; line-height: 1.3; }
.logo-title { margin: 6px 0 2px; position: relative; width: fit-content; }
.logo-img { display: block; width: min(520px, 92vw); height: auto; }
.title-sparkle {
  position: absolute; left: -26px; top: -20px;
  width: calc(100% + 52px); height: calc(100% + 36px);
  pointer-events: none;
}
.badge {
  display: inline-block; background: #fff; color: var(--accent);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 10px; font-size: .78rem; font-weight: 700; margin: 0;
}
.tagline { margin: 4px 0 0; color: var(--ink-soft); }

.auth-box {
  background: rgba(255,255,255,.85); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px 8px; min-width: 0;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
#auth-status { font-size: .74rem; font-weight: 700; margin: 0; }
.auth-box button { padding: 3px 9px; font-size: .72rem; border-radius: 6px; white-space: nowrap; }
.auth-note { font-size: .68rem; color: var(--ink-soft); margin: 0; flex-basis: 100%; }

button {
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  border-radius: 8px; padding: 8px 14px; font-weight: 700;
}
button.secondary { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
button:disabled { opacity: .45; cursor: not-allowed; }

.shared-banner {
  background: #fff3f7; border-bottom: 1px solid var(--pink);
  padding: 10px 16px; text-align: center; font-weight: 700;
}

.layout {
  max-width: 1200px; margin: 0 auto; padding: 16px;
  display: grid; grid-template-columns: 400px 1fr; gap: 16px;
  align-items: start;
}
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }
/* 横画面では左バーだけを独立スクロールさせず、ページ全体のスクロールに統一する
   （独立スクロールは、端まで送ったときにページ側へ受け渡されて引っかかるため）。
   代わりにデッキの完成度バーだけを画面上部に残す */
@media (min-width: 861px) {
  .deck-summary {
    position: sticky; top: 10px; z-index: 20;
  }
}

/* デッキ完成度のまとめ（バー＋あと何枚か） */
.deck-summary {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.sum-row { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.sum-label { font-weight: 700; min-width: 64px; }
.sum-count { font-weight: 700; color: var(--accent); min-width: 52px; text-align: right; }
.sum-mark { font-size: .8rem; color: var(--ink-soft); min-width: 52px; }
.bar { flex: 1; height: 10px; background: #e3f2fa; border-radius: 999px; overflow: hidden; }
.bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--sky), var(--pink));
  border-radius: 999px; transition: width .2s ease;
}

.howto { font-size: .88rem; color: var(--ink-soft); margin: 0 0 10px; }

.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px;
  min-width: 0;
}

/* 「カードを探す」の見出し＋検索＋絞り込みを画面上部に固定。
   サイズは最初から小さい方に固定し、スクロールで変化させない（変化させると挙動が不安定になるため） */
.catalog-head {
  position: sticky; top: 0; z-index: 30;
  background: var(--panel);
  padding: 4px 2px 6px; margin: -6px -2px 10px;
  border-bottom: 2px solid var(--border);
}
.catalog-head h2 { margin: 0 0 4px; font-size: 1.02rem; }
.head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
/* 説明文（使い方・件数・レアリティ凡例）は固定見出しの外に置き、スクロールで流れるようにする。
   固定見出しの中で表示／非表示が切り替わると高さが大きく変わり、画面が上下に巻き戻るため */
.catalog-notes { margin-bottom: 10px; }
/* 固定見出しの高さ変化にブラウザのスクロール位置補正が反応して揺れるのを防ぐ */

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.filters input, .filters select, .save-box input, .share-row input {
  padding: 8px; border: 1px solid var(--border); border-radius: 8px;
  font-size: .95rem; color: var(--ink); background: #fff;
}
.filters input { flex: 1 1 180px; }
/* 選択肢に長い文言（収録の商品名など）があっても、枠からはみ出さないように縮められるようにする */
.filters select { min-width: 0; max-width: 100%; }
/* 詳細検索（PCでは常に表示、スマホでは開閉式） */
.adv-toggle { display: none; }
.advanced-filters { display: contents; }
.sample-note, .rule-note { font-size: .8rem; color: var(--ink-soft); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
.card-tile {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 8px; display: flex; flex-direction: column; gap: 5px;
  height: 100%; min-width: 0;
}
.card-tile .meta, .card-tile .name { overflow-wrap: anywhere; }
/* アーツの必要エール（色付き●） */
.arts-costs { display: flex; flex-direction: column; gap: 3px; min-height: 33px; }
.arts-group { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; line-height: 1; width: 100%; }
.arts-right { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.arts-dmg { font-weight: 800; font-size: .92rem; color: var(--ink); }
.arts-tok { font-weight: 800; font-size: .85rem; color: var(--ink-soft); white-space: nowrap; }
.tok-dia { font-size: .78rem; text-shadow: 0 0 2px rgba(30, 41, 82, .55); }
.cost-dot {
  display: inline-block; border-radius: 50%;
  border: 1.5px solid rgba(20, 30, 60, .45);
  margin-right: 2px; flex: none;
}
.modal-arts-note { font-size: .72rem; color: var(--ink-soft); margin-top: 4px; }
/* 合体したアーツ表示（実カードの表記に似せて：左にコスト●、名前、右に大きくダメージ） */
.art-block { background: #fbfcfe; border: 1px solid #e2e9f2; border-left: 4px solid #90a4ae; border-radius: 10px; padding: 7px 10px; margin: 8px 0; }
.art-line { display: flex; align-items: center; gap: 8px; }
.art-dots { display: inline-flex; gap: 2px; flex: none; }
.art-name { font-weight: 700; font-size: .92rem; }
.art-dmg { margin-left: auto; font-size: 1.25rem; font-weight: 800; white-space: nowrap; }
.art-effect { margin-top: 3px; font-size: .86rem; line-height: 1.6; }

/* 「追加」ボタンを全タイルで一番下に揃える */
.card-tile .add-row { display: flex; gap: 6px; margin-top: auto; }
.card-tile .add-btn { flex: 1; padding: 10px 14px; }
.card-tile .sub-btn {
  flex: none; width: 42px; padding: 10px 0;
  background: #fff; color: var(--accent); border: 1.5px solid var(--accent);
  border-radius: 10px; font-weight: 800; font-size: 1rem;
}
/* 非表示でも場所は確保する（出入りで「追加」ボタンの幅が変わって画面がズレないように） */
.card-tile .sub-btn[hidden] { display: block; visibility: hidden; }
.card-tile .add-btn.has-count { box-shadow: inset 0 0 0 2px rgba(194, 24, 91, .5); }
.card-tile .thumb {
  position: relative;
  border-radius: 8px; min-height: 74px; display: grid; place-items: center;
  font-weight: 800; color: var(--ink);
  background: linear-gradient(140deg, #eaf8ff, #ffeef6);
}
/* カード画像の右下に重ねる枚数バッジ（メインデッキの重なり表示と同じ見た目） */
.card-tile .tile-badge {
  position: absolute; right: 6px; bottom: 6px; z-index: 7; pointer-events: none;
  background: var(--accent); color: #fff; font-weight: 800; font-size: .85rem;
  border: 2px solid #fff; border-radius: 999px; padding: 2px 9px;
  box-shadow: 1px 1px 4px rgba(22, 37, 92, .3);
}
.card-tile .tile-badge[hidden] { display: none; }
.card-tile .thumb img { width: 100%; height: auto; display: block; border-radius: 8px; }
.card-tile .name {
  font-weight: 700; font-size: .93rem; line-height: 1.35; min-height: 2.7em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* タグチップ（拡大表示で使用） */
.tag-chip { display: inline-block; font-size: .72rem; line-height: 1.5; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--ink-soft); white-space: nowrap; }
.rarity {
  display: inline-block; vertical-align: middle;
  background: linear-gradient(120deg, #fff3c9, #ffe3ef);
  border: 1px solid #f0d48a; color: #8a6d00;
  font-size: .75rem; font-weight: 800; line-height: 1.5;
  padding: 0 6px; border-radius: 999px; white-space: nowrap;
}
.card-tile .meta { font-size: .85rem; color: var(--ink-soft); }


.recipe-row { display: flex; gap: 8px; margin-top: 6px; }
.recipe-picker { position: relative; flex: 1; min-width: 0; }
.recipe-picker-btn {
  width: 100%; display: flex; align-items: center; gap: 6px;
  background: #fff; color: var(--ink); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px; font-weight: 600; text-align: left;
}
.recipe-caret { margin-left: auto; color: var(--ink-soft); }
.oshi-sq { flex: none; font-size: .95em; text-shadow: 0 0 1px rgba(38, 50, 56, .55), 0 0 1px rgba(38, 50, 56, .55); }
.name-sq { margin-right: 3px; }
.recipe-list {
  /* 選択肢はボタンの上に開く（下に開くと選びにくいため） */
  position: absolute; bottom: calc(100% + 4px); left: 0; right: 0; z-index: 40;
  list-style: none; margin: 0; padding: 4px; max-height: min(264px, 60vh); overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(22, 37, 92, .22);
}
.recipe-item {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px;
  border-radius: 7px; cursor: pointer; font-weight: 600;
}
.recipe-item:hover { background: #eef6fd; }
.saved-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 4px; }
.saved-row select {
  flex: 1; min-width: 0; padding: 8px; border-radius: 8px;
  border: 1px solid var(--border); background: #fff; font: inherit; font-size: .92rem;
}
.saved-note { font-size: .74rem; color: var(--ink-soft); margin: 2px 0 4px; }
.guide-toggle {
  background: none; border: none; padding: 2px 0; cursor: pointer;
  color: var(--blue); font-size: .78rem; text-decoration: underline;
}
.guide-panel {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 6px 12px 2px; margin: 6px 0 12px; font-size: .8rem; line-height: 1.7;
}
.guide-panel .guide-head { font-weight: 700; margin: 6px 0 2px; }
.guide-panel ul { margin: 0 0 8px; padding-left: 1.15em; }
.guide-panel li { margin: 2px 0; }
.empty-note {
  border: 1px dashed var(--border); background: #fbfdff; border-radius: 10px;
  color: var(--ink-soft); font-size: .82rem; padding: 10px 12px; width: 100%;
}

/* 編成デッキのグラフィカル表示（サムネイル＋重なり） */
.stack-area { display: flex; flex-wrap: wrap; gap: 16px 12px; margin: 10px 0 16px; }
.oshi-row { display: flex; gap: 12px; align-items: flex-start; width: 100%; }
/* テスト機能（ラボ） */
.lab-box { margin-top: 18px; background: linear-gradient(135deg, #e9f5fe, #fdeef7); border: 1.5px solid #c3def6; border-radius: 12px; padding: 10px 12px 12px; }
.lab-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; background: none; border: none; padding: 2px 0 6px; font: inherit; font-size: 1rem; font-weight: 800; color: inherit; cursor: pointer; text-align: left; }
.lab-caret-wrap { flex: none; display: inline-flex; align-items: center; gap: 7px; }
.lab-caret-label { font-size: .78rem; font-weight: 800; color: #d81b60; white-space: nowrap; }
.lab-caret {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #ec407a, #d81b60); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(216, 27, 96, .3);
}
/* 三角は図形で描いて丸の真ん中に置き、開いたら下向きに回す */
.lab-caret svg { display: block; }
.lab-toggle[aria-expanded="true"] .lab-caret svg { transform: rotate(90deg); }
.lab-sec { margin-bottom: 16px; }
.lab-head { font-weight: 800; font-size: .92rem; margin-bottom: 6px; color: #1565c0; }
.lab-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.lab-note { font-size: .74rem; color: var(--ink-soft); margin: 5px 0 0; line-height: 1.5; }
.lab-hand { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lab-hand-img { width: 62px; border-radius: 6px; display: block; }
.lab-hand-ph { background: #eceff1; font-size: .6rem; padding: 6px 4px; text-align: center; }
.lab-legend { font-size: .72rem; color: var(--ink-soft); margin-bottom: 6px; line-height: 1.5; }
.lab-bar-row { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.lab-bar-lab { flex: none; width: 40px; font-size: .76rem; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.lab-bar-tracks { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lab-bar-track { display: block; height: 7px; background: #eceff1; border-radius: 99px; overflow: hidden; }
.lab-bar-fill { display: block; height: 100%; border-radius: 99px; }
.lab-bar-fill.need { background: #ef5350; }
.lab-bar-fill.sup { background: #42a5f5; }
.lab-bar-num { flex: none; font-size: .7rem; color: var(--ink-soft); white-space: nowrap; }
.lab-summary { font-size: .76rem; margin-top: 7px; line-height: 1.6; }
.lab-brick-line { font-size: .84rem; margin: 4px 0; line-height: 1.55; }
.lab-brick-line b { font-size: 1.02rem; }
.lab-brick-sub { font-size: .74rem; color: var(--ink-soft); }
.lab-debut-head { font-size: .8rem; font-weight: 700; margin-top: 9px; }
.lab-debut-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 4px; }
.lab-debut-cell { background: rgba(255, 255, 255, .65); border: 1px solid #c3def6; border-radius: 8px; padding: 4px 2px 5px; text-align: center; }
.lab-debut-k { font-size: .68rem; color: var(--ink-soft); }
.lab-debut-v { font-size: .94rem; font-weight: 800; }
.lab-curve { width: 100%; height: auto; display: block; margin-top: 4px; }
.board-sheet { display: grid; grid-template-columns: .62fr 1fr 1fr 1fr .8fr; grid-template-areas: "life collab center oshi power" "life back back back deck" "cheer back back back archive"; gap: 5px; background: linear-gradient(160deg, #e3f2fd, #fce4ec); padding: 6px; border-radius: 10px; margin-top: 8px; }
.bz { border: 1.5px solid #f48fb1; border-radius: 7px; background: rgba(255, 255, 255, .68); padding: 3px; min-width: 0; }
.bz-label { font-size: .6rem; font-weight: 700; color: #ad1457; line-height: 1.2; margin-bottom: 2px; }
.bz-img { width: 100%; border-radius: 4px; display: block; }
.bz-name { font-size: .6rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.bz-empty { font-size: .62rem; color: var(--ink-soft); text-align: center; padding: 10px 0; }
.bz-pile { font-size: .72rem; font-weight: 700; color: #37474f; text-align: center; padding: 6px 0; }
.bz-back { width: 100%; border-radius: 4px; display: block; box-shadow: 1.5px 1.5px 0 rgba(62, 39, 35, .35), 3px 3px 0 rgba(62, 39, 35, .18); }
.bz-count { font-size: .68rem; font-weight: 700; color: #37474f; text-align: center; margin-top: 3px; }
.bz-back-land { aspect-ratio: 88 / 63; display: grid; place-items: center; }
.bz-back-land img { width: 71.6%; transform: rotate(90deg); border-radius: 4px; display: block; box-shadow: 1.5px 1.5px 0 rgba(62, 39, 35, .3); }
.life-stack { position: relative; }
.life-card { width: 100%; display: block; border-radius: 3px; box-shadow: 0 1px 2px rgba(62, 39, 35, .35); }
.life-card.life-first { position: relative; z-index: 10; }
.life-card:not(.life-first) { position: absolute; left: 0; }
.bz-backs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.bz-mini-empty { border: 1px dashed #f48fb1; border-radius: 4px; aspect-ratio: 63 / 88; }
.bz-sub { font-size: .58rem; color: var(--ink-soft); margin-top: 3px; }
.board-rest { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 8px; }
.board-rest img { width: 44px; border-radius: 5px; display: block; }
.board-rest-label { font-size: .74rem; color: var(--ink-soft); width: 100%; }
.lab-prob-row { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.lab-prob-name { flex: 1; min-width: 0; font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-prob-track { flex: none; width: 74px; height: 8px; background: #eceff1; border-radius: 99px; overflow: hidden; }
.lab-prob-fill { display: block; height: 100%; background: #7e57c2; border-radius: 99px; }
.lab-prob-num { flex: none; width: 44px; text-align: right; font-size: .76rem; font-weight: 700; }
.lab-prob-meta { color: var(--ink-soft); font-size: .92em; margin-left: 5px; }
.stack-life { margin-top: 4px; }
.stack-life .stat-chip { font-size: .82rem; font-weight: 700; padding: 2px 12px; }
.oshi-desc { flex: 1; min-width: 0; font-size: .8rem; line-height: 1.65; text-align: left; padding-top: 12px; }
.oshi-desc-p { margin: 0 0 9px; }
.oshi-desc-p:last-child { margin-bottom: 0; }
.oshi-desc-h { display: block; font-weight: 700; color: #1565c0; margin-bottom: 1px; }
/* 推しスキル系：実カードのデザインに似せて（ピンクのロゴ風見出し＋ホロパワーのピル＋スキル名） */
.oshi-skill { background: #fff7fa; border: 1px solid #f3c6da; border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
.oshi-desc .oshi-skill { margin: 0 0 9px; }
.oshi-skill-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.oshi-skill-logo {
  font-weight: 900; font-style: italic; letter-spacing: .02em; font-size: 1.05rem; line-height: 1.2;
  color: #ec407a; text-shadow: 0 1px 0 #fff, 0 2px 5px rgba(233, 30, 99, .35);
}
.holo-power {
  display: inline-block; background: linear-gradient(120deg, #f06292, #d81b60); color: #fff;
  font-weight: 800; font-size: .78rem; line-height: 1; padding: 4px 10px; border-radius: 999px;
  box-shadow: 0 1px 3px rgba(216, 27, 96, .35); white-space: nowrap;
}
.oshi-skill-name { font-weight: 800; font-size: .95rem; }
.oshi-skill-body { line-height: 1.65; }
.stack { width: 92px; text-align: center; }
.stack-pile { position: relative; width: 80px; margin: 14px auto 0; }
.stack-layer {
  position: absolute; inset: 0; aspect-ratio: 63 / 88;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 1px 1px 3px rgba(22, 37, 92, .15);
}
.stack-img {
  position: relative; z-index: 5; width: 100%; aspect-ratio: 63 / 88; object-fit: cover;
  display: block; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 2px 2px 5px rgba(22, 37, 92, .18); background: #fff;
}
.stack-ph { display: grid; place-items: center; font-weight: 800; }
.stack-badge {
  position: absolute; z-index: 6; right: -10px; bottom: -8px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: .9rem;
  border: 2px solid #fff; border-radius: 999px; padding: 2px 9px;
  box-shadow: 1px 1px 4px rgba(22, 37, 92, .3);
}
.stack-name {
  font-size: .72rem; line-height: 1.3; margin-top: 10px; font-weight: 700;
  min-height: 2.6em;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.stack-bloom {
  display: inline-block; margin-top: 3px; min-height: 1.6em;
  background: #eaf7ff; border: 1px solid var(--border); color: var(--accent);
  font-size: .68rem; font-weight: 800; padding: 0 7px; border-radius: 999px; line-height: 1.6;
}
.stack-bloom-empty { background: transparent; border-color: transparent; }
.stack-controls { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 5px; }
.stack-controls button { width: 34px; height: 34px; padding: 0; font-size: .95rem; line-height: 1; flex: none; }
.stack-count { font-size: .8rem; font-weight: 700; color: var(--ink-soft); }
/* 推しは大きめに（左上にドンと表示） */
.oshi-area .stack { width: 150px; }
.oshi-area .stack-pile { width: 128px; }
.oshi-area .stack-name { font-size: .85rem; }
.oshi-area .stack-controls button { width: auto; height: auto; padding: 7px 16px; }
.count { color: var(--accent); font-size: .9rem; }
.undo-oshi-btn { font-size: .78rem; padding: 5px 10px; border-radius: 999px; vertical-align: 2px; }
.count.done { color: var(--ok); font-weight: 800; }
.card-tile button { padding: 10px 14px; }

.color-breakdown { display: flex; gap: 6px; flex-wrap: wrap; font-size: .8rem; margin: 8px 0; }
.color-breakdown span { background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; }

.validation {
  font-weight: 700; border-radius: 10px; padding: 10px 12px; margin: 0 0 12px;
}
.validation.ok { color: var(--ok); background: #e7f8ef; border: 1px solid #bfe8d2; }
.validation.ng { color: #a05a00; background: #fff6e0; border: 1px solid #f3ddab; }

.save-box { border-top: 1px dashed var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.save-buttons, .share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.save-buttons button { padding: 12px 18px; font-size: 1rem; }
.share-row input { flex: 1 1 160px; }
.save-status { font-size: .85rem; color: var(--ink-soft); margin: 0; }
/* 上限などのお知らせを、操作している場所の近く（画面下部）に小さく出す */
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  z-index: 120; max-width: 92vw; text-align: center;
  background: #3d4f6d; color: #fff;
  font-size: .88rem; font-weight: 700; line-height: 1.5;
  padding: 9px 18px; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(22, 37, 92, .35);
  animation: toast-in .18s ease-out;
}
.toast[hidden] { display: none; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
}

/* 右下に常時表示する「上へ戻る」ボタン */
.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 90;
  width: 54px; height: 54px; border-radius: 50%;
  font-size: 1.5rem; line-height: 1; padding: 0;
  background: linear-gradient(140deg, var(--sky), var(--pink));
  color: var(--ink); border: 2px solid #fff;
  box-shadow: 0 4px 14px rgba(22, 37, 92, .3);
}
.to-top:active { transform: translateY(1px); }

/* 左下に常時表示する「一番下へ」ボタン（上へ戻ると対の形） */
.to-bottom {
  position: fixed; left: 16px; bottom: 16px; z-index: 90;
  width: 54px; height: 54px; border-radius: 50%;
  font-size: 1.5rem; line-height: 1; padding: 0;
  background: linear-gradient(140deg, var(--sky), var(--pink));
  color: var(--ink); border: 2px solid #fff;
  box-shadow: 0 4px 14px rgba(22, 37, 92, .3);
}
.to-bottom:active { transform: translateY(1px); }

/* カード拡大表示（原寸大モーダル） */
.zoomable { cursor: zoom-in; }
.card-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  /* スクロールの連鎖で後ろのページが動かないようにする */
  overscroll-behavior: contain;
}
.card-modal[hidden] { display: none; }
.card-modal-backdrop { position: absolute; inset: 0; background: rgba(10, 20, 50, .68); }
.card-modal-body {
  position: relative; margin: 0; background: #fff; border-radius: 14px;
  padding: 14px; max-height: 94vh; overflow-y: auto; overflow-x: hidden; text-align: center;
  /* スクロールバーの出る・出ないで中身の幅が変わらないよう、両側に同じ幅の余白を常時確保する
     （バーが出たときだけ画像が数ピクセル横にずれるのを防ぐ） */
  scrollbar-gutter: stable both-edges;
  overscroll-behavior: contain;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}
.card-modal-body img {
  /* 公式の元画像を、拡大表示の箱の内側にぴったり収まる最大サイズで表示する。
     画面幅（vw）基準だと箱よりはみ出して横スクロールできてしまうため、箱の幅基準にする */
  max-width: 100%; max-height: 76vh; width: auto; height: auto;
  border-radius: 10px; border: 1px solid var(--border);
}
.card-modal-close {
  /* 親指の届く下端に常時表示する（スクロールしても下に留まる）。
     「追加」と色が紛らわしくないよう、落ち着いた紺色にする */
  position: sticky; bottom: 0; z-index: 5;
  display: block; width: 100%; margin: 14px 0 0;
  padding: 14px; border: none; border-radius: 12px;
  background: #3d4f6d; color: #fff;
  font-size: 1rem; font-weight: 800;
  box-shadow: 0 -2px 10px rgba(22, 37, 92, .18);
  cursor: pointer;
}
.card-modal-caption { max-width: 560px; margin: 10px auto 0; text-align: left; }
.card-modal-name { font-weight: 800; font-size: 1.05rem; }
.modal-name-row { display: flex; align-items: flex-start; gap: 10px; }
.modal-name-row .card-modal-name { flex: 1; min-width: 0; }
.modal-add { flex: none; display: flex; align-items: center; gap: 6px; padding-top: 1px; }
.modal-add button { padding: 6px 12px; font-size: .85rem; }
.modal-add .modal-sub-btn, .modal-add .modal-plus-btn { width: 32px; padding: 6px 0; text-align: center; }
/* 拡大表示の −／＋ は、文字ではなく図形で描いて大きさを完全一致させる
   （フォントの字形は − と ＋ で大きさ・太さが微妙に違うため） */
/* 高さは「追加」ボタンと −／＋ で32pxに統一。−／＋ は32×32pxの正方形にする */
.modal-add .modal-add-btn { width: 52px; height: 32px; padding: 0; }
.modal-add .modal-pm-btn { position: relative; width: 32px; height: 32px; padding: 0; }
.modal-add .modal-pm-btn::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 13px; height: 3px; border-radius: 2px;
  transform: translate(-50%, -50%); background: currentColor;
}
.modal-add .modal-plus-btn::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 3px; height: 13px; border-radius: 2px;
  transform: translate(-50%, -50%); background: currentColor;
}
.modal-count-badge {
  background: var(--accent); color: #fff; font-weight: 800; font-size: .85rem;
  border: 2px solid #fff; border-radius: 999px; padding: 2px 9px;
  box-shadow: 1px 1px 4px rgba(22, 37, 92, .3); white-space: nowrap;
}
.card-modal-text { font-size: .88rem; line-height: 1.65; margin: 10px 0 0; }
#card-modal-effects:empty, #card-modal-arts:empty, #card-modal-extra:empty { margin: 0; }
.modal-tags { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 10px; }
.modal-tag { cursor: default; }
.card-modal-product { margin-top: 10px; font-size: .8rem; color: var(--ink-soft); }
.modal-notes { margin-top: 12px; background: #fff8e1; border: 1px solid #ffe082; border-radius: 10px; padding: 10px 12px; text-align: left; }
.modal-notes-title { font-weight: 700; font-size: .9rem; color: #8d6e00; margin-bottom: 4px; }
#card-modal-notes-body { margin: 0; font-size: .9rem; line-height: 1.75; }
#card-modal-notes-body .note-para { margin: 0 0 .6em; }
#card-modal-notes-body .note-para:last-child { margin-bottom: 0; }
#card-modal-notes-body .note-qa.qa-first { border-top: 1px dashed #e3cf8f; padding-top: .6em; }
#card-modal-notes-body .qa-tag { display: inline-block; font-size: .72rem; font-weight: 700; color: #fff; background: #b8860b; border-radius: 4px; padding: 1px 6px; margin-right: 6px; vertical-align: 2px; }
.modal-limited {
  background: #971b21; color: #fff; font-weight: 700; font-size: .85rem;
  padding: 6px 10px; border-radius: 8px; margin: 0 0 8px; white-space: nowrap; overflow-x: auto;
}
.modal-name-color { font-size: .85em; font-weight: 600; color: var(--ink-soft); }
.card-modal-number { margin-top: 10px; font-size: .8rem; color: var(--ink-soft); }
.mt-p { margin: 0 0 10px; }
.mt-p:last-child { margin-bottom: 0; }
.mt-h { display: block; font-weight: 700; color: #1565c0; margin-bottom: 1px; }

/* HP・LIFEチップと段階バッジ（個別表示） */
.stat-chips { min-height: 24px; display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.stat-chip { display: inline-block; color: #fff; font-weight: 800; font-size: .75rem; line-height: 1; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.stat-chip.hp { background: #33475f; }
.stat-chip.life { background: #c2185b; }
/* サポートの属性チップ（種類ごとに色分け） */
.support-kind-chip { display: inline-block; font-weight: 800; font-size: .75rem; line-height: 1; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: #eceff1; color: #37474f; }
.support-kind-chip[data-kind="アイテム"] { background: #ffecb3; color: #6d4c00; }
.support-kind-chip[data-kind="イベント"] { background: #bbdefb; color: #0d47a1; }
.support-kind-chip[data-kind="ツール"] { background: #b2dfdb; color: #004d40; }
.support-kind-chip[data-kind="マスコット"] { background: #e1bee7; color: #4a148c; }
.support-kind-chip[data-kind="ファン"] { background: #f8bbd0; color: #880e4f; }
.support-kind-chip[data-kind="スタッフ"] { background: #c8e6c9; color: #1b5e20; }
/* サポート文章中のタグ表記（[#歌] の形で囲んだもの） */
.tag-ref { font-weight: 700; color: #1565c0; background: #e3f2fd; border-radius: 4px; padding: 0 2px; white-space: nowrap; }
/* 結果が0件になる選択肢は選べない（灰色で表示） */
select option:disabled { color: #b0bec5; }
/* Buzz表記：実カードの黒×金の斜め帯（注意テープ風）に似せたマーク */
.buzz-mark {
  display: inline-flex; align-items: center;
  font-size: .92em; font-style: italic; font-weight: 800; letter-spacing: .03em; line-height: 1.25;
  color: #ffcf3f;
  background: repeating-linear-gradient(125deg, #0c0c0c 0 7px, #2a2a2a 7px 14px);
  border-top: 1px solid #c9a227; border-bottom: 1px solid #c9a227;
  padding: .08em .55em; border-radius: 3px;
  transform: skewX(-10deg);
}
.bl-badge { display: inline-block; font-weight: 800; font-size: .75rem; line-height: 1; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(0, 0, 0, .18); white-space: nowrap; }
.bl-badge.bl-debut { background: linear-gradient(135deg, #e0aa7e, #b0763a); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.bl-badge.bl-1st { background: linear-gradient(135deg, #f4f7fa, #aeb9c4); color: #37474f; }
.bl-badge.bl-2nd { background: linear-gradient(135deg, #ffe082, #d4a017); color: #5d4037; }
.bl-badge.bl-spot { background: linear-gradient(90deg, #f8bbd0, #c5cae9, #b2dfdb); color: #37474f; }
/* Buzzホロメンの1stバッジ：Buzzマークと同じ黒×金の配色 */
.bl-badge.bl-buzz {
  background: repeating-linear-gradient(125deg, #0c0c0c 0 7px, #2a2a2a 7px 14px);
  color: #ffcf3f; border-color: #c9a227;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .65);
}
.stack-bloom.bl-badge { font-size: .72rem; padding: 2px 9px; }
.modal-baton { margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--border); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-weight: 700; font-size: .88rem; }
.modal-baton[hidden] { display: none; }
.baton-dots { display: inline-flex; gap: 4px; }
.modal-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.modal-chips .stat-chip, .modal-chips .bl-badge { font-size: .85rem; padding: 5px 12px; }
/* LIFEの横の「重なったカード」風マーク：文字記号だと端末のフォントで下端や間隔がずれるため、色付きの箱で描く（どの環境でも下端一致・間隔1px） */
.life-pips { display: inline-flex; align-items: flex-end; gap: 1px; line-height: 0; align-self: center; }
.life-pips > span { display: block; background: currentColor; }
.life-pips .pip-sq { width: 16px; height: 16px; }
.life-pips .pip-bar { width: 5px; height: 12px; }

/* レアリティ枠（「トレカの地図」のレア度目安に基づく段階付け）※詳細度を上げて各所の基本枠より優先させる */
.rf-c.rf-c { border: 1px solid #cfd8dc; }
.rf-u.rf-u { border: 1px solid #d7ccc8; }
.rf-r.rf-r { border: 1px solid #bbdefb; }
.rf-s.rf-s { border: 2px solid #66bb6a; }
.rf-oc.rf-oc { border: 1px solid #e3d5cf; }
.rf-rr.rf-rr { border: 2px solid #5c6bc0; }
.rf-sr.rf-sr { border: 2px solid #ab47bc; }
.rf-p.rf-p { border: 2px solid #ffa726; }
.rf-osr.rf-osr { border: 2px solid #e91e63; }
.rf-sy.rf-sy { border: 2px solid #00bfa5; }
.rf-ur.rf-ur { border: 3px solid transparent; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(135deg, #f7e08b, #c9a227 45%, #f7e08b) border-box; }
.rf-hr.rf-hr { border: 3px solid transparent; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(135deg, #ffffff, #9fb2c3 45%, #eef3f7) border-box; }
.rf-sec.rf-sec, .rf-our.rf-our { border: 3px solid transparent; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(120deg, #ff8a80, #ffd180, #ffff8d, #ccff90, #a7ffeb, #80d8ff, #8c9eff, #ea80fc) border-box; }

/* カード画像のホログラム風の光（レアリティ「高い」以上に反映）
   SEC＝一番煌びやか／OUR＝その次／高い（UR＝金・HR＝銀）＝金属色の帯だけ控えめに */
@keyframes holo-sweep {
  from { background-position: 0% 0; }
  to { background-position: 100% 0; }
}
.card-tile.rf-ur .thumb, .card-tile.rf-hr .thumb,
.card-tile.rf-sec .thumb, .card-tile.rf-our .thumb,
.card-tile.rf-osr .thumb { position: relative; overflow: hidden; }
.card-tile.rf-ur .thumb::after, .card-tile.rf-hr .thumb::after,
.card-tile.rf-sec .thumb::after, .card-tile.rf-our .thumb::after,
.card-tile.rf-osr .thumb::after,
.modal-img-wrap.holo-ur::after, .modal-img-wrap.holo-hr::after, .modal-img-wrap.holo-sec::after, .modal-img-wrap.holo-our::after,
.modal-img-wrap.holo-osr::after,
.holo-sheen {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  mix-blend-mode: overlay;
  animation: holo-sweep 6s ease-in-out infinite alternate;
}
.card-tile.rf-ur .thumb::after, .card-tile.rf-hr .thumb::after,
.card-tile.rf-sec .thumb::after, .card-tile.rf-our .thumb::after,
.card-tile.rf-osr .thumb::after { border-radius: 8px; }
/* 最上位（SEC）：虹色の反射＋強い白い光の帯、一番煌びやかに */
.card-tile.rf-sec .thumb::after,
.modal-img-wrap.holo-sec::after, .holo-sheen.holo-sec {
  background:
    linear-gradient(115deg, transparent 33%, rgba(255, 255, 255, .68) 49%, rgba(255, 255, 255, .25) 51%, transparent 67%),
    repeating-linear-gradient(115deg, rgba(255, 133, 133, .4) 0 14%, rgba(255, 255, 133, .4) 14% 28%, rgba(133, 255, 162, .4) 28% 42%, rgba(133, 225, 255, .4) 42% 56%, rgba(196, 133, 255, .4) 56% 70%);
  background-size: 260% 100%, 220% 100%;
}
/* 非常に高い（OUR）：金色の反射＋金色の光の帯、SECの次に煌びやかに */
.card-tile.rf-our .thumb::after,
.modal-img-wrap.holo-our::after, .holo-sheen.holo-our {
  background:
    linear-gradient(115deg, transparent 37%, rgba(255, 246, 200, .6) 49%, rgba(255, 215, 120, .2) 51%, transparent 63%),
    repeating-linear-gradient(115deg, rgba(212, 160, 32, .3) 0 14%, rgba(255, 215, 120, .3) 14% 28%, rgba(255, 240, 180, .3) 28% 42%, rgba(240, 192, 64, .3) 42% 56%, rgba(255, 215, 120, .3) 56% 70%);
  background-size: 260% 100%, 220% 100%;
}
/* 高い（UR）：金色の光の帯だけ、ゆっくり控えめに */
.card-tile.rf-ur .thumb::after, .modal-img-wrap.holo-ur::after, .holo-sheen.holo-ur {
  background: linear-gradient(115deg, transparent 40%, rgba(255, 232, 160, .55) 50%, transparent 60%);
  background-size: 260% 100%;
}
/* 高い（HR）：銀色の光の帯だけ、ゆっくり控えめに */
.card-tile.rf-hr .thumb::after, .modal-img-wrap.holo-hr::after, .holo-sheen.holo-hr {
  background: linear-gradient(115deg, transparent 40%, rgba(235, 245, 255, .55) 50%, transparent 60%);
  background-size: 260% 100%;
}
/* 中間（OSR）：ピンクの光の帯（下地に三角モザイクの透かし柄） */
.card-tile.rf-osr .thumb::after, .modal-img-wrap.holo-osr::after, .holo-sheen.holo-osr {
  background: linear-gradient(115deg, transparent 40%, rgba(255, 170, 205, .55) 50%, transparent 60%);
  background-size: 260% 100%;
}
/* SY（エールのみ）：本当に少しだけ光る、控えめな白い光の帯だけ */
.card-tile.rf-sy .thumb { position: relative; overflow: hidden; }
.card-tile.rf-sy .thumb::after, .modal-img-wrap.holo-sy::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  mix-blend-mode: overlay;
  background: linear-gradient(115deg, transparent 43%, rgba(255, 255, 255, .2) 50%, transparent 57%);
  background-size: 260% 100%;
  animation: holo-sweep 6s ease-in-out infinite alternate;
}
.card-tile.rf-sy .thumb::after { border-radius: 8px; }
.modal-img-wrap.holo-sy { overflow: hidden; border-radius: 10px; }
.modal-img-wrap.holo-sy::after { border-radius: 10px; }
.holo-sheen.holo-sy {
  background: linear-gradient(115deg, transparent 43%, rgba(255, 255, 255, .2) 50%, transparent 57%);
  background-size: 260% 100%;
}
@media (prefers-reduced-motion: reduce) {
  .card-tile.rf-sy .thumb::after, .modal-img-wrap.holo-sy::after, .holo-sheen.holo-sy { animation: none; }
}
.holo-sheen { z-index: 6; border-radius: 8px; overflow: hidden; }

/* 透かし柄（光の下に敷く層）：SEC＝ラメ／OUR＝金の放射／UR・HR＝◆の格子／OSR＝三角モザイク（方向のある柄は光と同じ115度系）。アニメーション速度は全て6秒に統一 */
@keyframes dia-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 12px 0, 12px 0; }
}
.card-tile.rf-sec .thumb::before, .card-tile.rf-our .thumb::before,
.card-tile.rf-ur .thumb::before, .card-tile.rf-hr .thumb::before,
.card-tile.rf-osr .thumb::before,
.modal-img-wrap.holo-sec::before, .modal-img-wrap.holo-our::before,
.modal-img-wrap.holo-ur::before, .modal-img-wrap.holo-hr::before,
.modal-img-wrap.holo-osr::before,
.holo-sheen::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  /* 柄は光の帯の中だけに表示する（光と同じ形・同じ動きのマスク） */
  -webkit-mask-image: linear-gradient(115deg, transparent 36%, #000 50%, transparent 64%);
  mask-image: linear-gradient(115deg, transparent 36%, #000 50%, transparent 64%);
  -webkit-mask-size: 260% 100%; mask-size: 260% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
@keyframes mask-drift {
  from { -webkit-mask-position: 0% 0; mask-position: 0% 0; }
  to { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
}
.card-tile.rf-sec .thumb::before, .card-tile.rf-our .thumb::before,
.card-tile.rf-ur .thumb::before, .card-tile.rf-hr .thumb::before,
.card-tile.rf-osr .thumb::before,
.holo-sheen::before { border-radius: 8px; }
.modal-img-wrap.holo-sec::before, .modal-img-wrap.holo-our::before,
.modal-img-wrap.holo-ur::before, .modal-img-wrap.holo-hr::before,
.modal-img-wrap.holo-osr::before { border-radius: 10px; }
/* SEC＝ラメ（細かい粒のきらめきを敷き詰めた透かし柄、光の帯の中で瞬く） */
.card-tile.rf-sec .thumb::before, .modal-img-wrap.holo-sec::before, .holo-sheen.holo-sec::before {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, .95) 0 1px, transparent 1.7px),
    radial-gradient(circle, rgba(255, 183, 222, .9) 0 1px, transparent 1.9px),
    radial-gradient(circle, rgba(165, 222, 255, .9) 0 1.2px, transparent 2.1px),
    radial-gradient(circle, rgba(255, 241, 168, .9) 0 1px, transparent 1.8px),
    radial-gradient(circle, rgba(196, 255, 186, .85) 0 .8px, transparent 1.6px);
  background-size: 26px 26px, 38px 38px, 46px 46px, 32px 32px, 22px 22px;
  background-position: 0 0, 9px 13px, 17px 6px, 4px 21px, 12px 3px;
  mix-blend-mode: overlay;
  animation: glitter-twinkle 6s ease-in-out infinite alternate, mask-drift 6s ease-in-out infinite alternate;
}
@keyframes glitter-twinkle {
  from { opacity: .45; }
  to { opacity: 1; }
}
/* OUR＝金の放射（サンバースト）：中心から広がる金の光条 */
.card-tile.rf-our .thumb::before, .modal-img-wrap.holo-our::before, .holo-sheen.holo-our::before {
  background: repeating-conic-gradient(from 25deg at 50% 50%, rgba(255, 215, 120, .13) 0deg 5deg, transparent 5deg 11deg);
  mix-blend-mode: overlay;
  animation: gold-pulse 6s ease-in-out infinite alternate, mask-drift 6s ease-in-out infinite alternate;
}
@keyframes gold-pulse {
  from { opacity: .55; }
  to { opacity: 1; }
}
/* UR＝◆の格子（金）：115度の光に合わせたダイヤ柄 */
.card-tile.rf-ur .thumb::before, .modal-img-wrap.holo-ur::before, .holo-sheen.holo-ur::before {
  background:
    repeating-linear-gradient(115deg, rgba(255, 226, 150, .13) 0 1.5px, transparent 1.5px 9px),
    repeating-linear-gradient(25deg, rgba(255, 226, 150, .13) 0 1.5px, transparent 1.5px 9px);
  mix-blend-mode: overlay;
  animation: dia-drift 6s ease-in-out infinite alternate, mask-drift 6s ease-in-out infinite alternate;
}
/* HR＝◆の格子（銀） */
.card-tile.rf-hr .thumb::before, .modal-img-wrap.holo-hr::before, .holo-sheen.holo-hr::before {
  background:
    repeating-linear-gradient(115deg, rgba(220, 238, 255, .13) 0 1.5px, transparent 1.5px 9px),
    repeating-linear-gradient(25deg, rgba(220, 238, 255, .13) 0 1.5px, transparent 1.5px 9px);
  mix-blend-mode: overlay;
  animation: dia-drift 6s ease-in-out infinite alternate, mask-drift 6s ease-in-out infinite alternate;
}
/* OSR＝三角モザイク（ピンク系の面を組み合わせた柄、主軸は光と同じ115度） */
.card-tile.rf-osr .thumb::before, .modal-img-wrap.holo-osr::before, .holo-sheen.holo-osr::before {
  background:
    repeating-linear-gradient(115deg, rgba(255, 128, 171, .17) 0 9px, rgba(255, 196, 222, .17) 9px 18px, rgba(233, 30, 99, .13) 18px 27px, rgba(255, 235, 243, .16) 27px 36px),
    repeating-linear-gradient(25deg, rgba(255, 255, 255, .12) 0 7px, transparent 7px 14px, rgba(173, 20, 87, .10) 14px 21px),
    repeating-linear-gradient(70deg, rgba(244, 143, 177, .11) 0 11px, transparent 11px 22px);
  mix-blend-mode: overlay;
  animation: mosaic-drift 6s ease-in-out infinite alternate, mask-drift 6s ease-in-out infinite alternate;
}
@keyframes mosaic-drift {
  from { background-position: 0 0, 0 0, 0 0; }
  to { background-position: 14px 0, -10px 0, 8px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .card-tile.rf-sec .thumb::before, .card-tile.rf-our .thumb::before,
  .card-tile.rf-ur .thumb::before, .card-tile.rf-hr .thumb::before,
  .card-tile.rf-osr .thumb::before,
  .modal-img-wrap.holo-sec::before, .modal-img-wrap.holo-our::before,
  .modal-img-wrap.holo-ur::before, .modal-img-wrap.holo-hr::before,
  .modal-img-wrap.holo-osr::before,
  .holo-sheen::before { animation: none; }
}
.modal-img-wrap { position: relative; display: block; width: fit-content; max-width: 100%; margin-inline: auto; }
/* 拡大画像の右下に重ねる枚数バッジ（一覧と同じ見た目・少し大きめ） */
.modal-img-wrap .tile-badge {
  position: absolute; right: 10px; bottom: 10px; z-index: 8; pointer-events: none;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 1rem;
  border: 2px solid #fff; border-radius: 999px; padding: 3px 11px;
  box-shadow: 1px 1px 4px rgba(22, 37, 92, .3);
}
.modal-img-wrap .tile-badge[hidden] { display: none; }
.modal-img-wrap.holo-ur, .modal-img-wrap.holo-hr, .modal-img-wrap.holo-sec, .modal-img-wrap.holo-our, .modal-img-wrap.holo-osr { overflow: hidden; border-radius: 10px; }
.modal-img-wrap.holo-ur::after, .modal-img-wrap.holo-hr::after, .modal-img-wrap.holo-sec::after, .modal-img-wrap.holo-our::after, .modal-img-wrap.holo-osr::after { border-radius: 10px; }
@media (prefers-reduced-motion: reduce) {
  .card-tile.rf-ur .thumb::after, .card-tile.rf-hr .thumb::after,
  .card-tile.rf-sec .thumb::after, .card-tile.rf-our .thumb::after,
  .modal-img-wrap.holo-ur::after, .modal-img-wrap.holo-hr::after, .modal-img-wrap.holo-sec::after, .modal-img-wrap.holo-our::after,
  .holo-sheen { animation: none; }
}

/* レアリティ凡例（枠色の対応表） */
.rarity-legend span { margin-right: 7px; white-space: nowrap; }
.rarity-legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; background: #fff; vertical-align: -1px; margin-right: 3px; }

/* キーワードの色付きラベル（公式カードの帯の色） */
.kw-label { display: inline-block; color: #fff; font-weight: 800; font-size: .72rem; line-height: 1; padding: 4px 9px; border-radius: 999px; letter-spacing: .02em; white-space: nowrap; }
.kw-bloom { background: #1b7ed4; }
.kw-collab { background: #d42427; }
.kw-gift { background: #00a03c; }
.kw-chips { min-height: 24px; display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.kw-block { background: #fbfcfe; border: 1px solid #e2e9f2; border-left: 4px solid #c9d6e4; border-radius: 10px; padding: 8px 10px; margin: 8px 0; white-space: normal; }
.kw-block.kb-kw-bloom { border-left-color: #1b7ed4; }
.kw-block.kb-kw-collab { border-left-color: #d42427; }
.kw-block.kb-kw-gift { border-left-color: #00a03c; }
.kw-extra { background: #ffc21c; color: #4e342e; }
.kw-block.kb-extra { border-left-color: #ffc21c; }
.kw-limited { background: #971b21; color: #fff; }
.kw-block .kw-label { margin-right: 7px; vertical-align: 2px; }
.kw-head { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.kw-head .kw-label { margin-right: 0; }
.kw-name { font-weight: 700; font-size: .92rem; }
/* エフェクトのタイトル（効果名）は、そのエフェクトで使われている色にする */
.kb-kw-bloom .kw-name { color: #1b7ed4; }
.kb-kw-collab .kw-name { color: #d42427; }
.kb-kw-gift .kw-name { color: #00a03c; }
.kw-body { display: block; }
.kw-body { font-size: .88rem; line-height: 1.6; }

/* スマホ用ミニ完成度バー（PCでは非表示） */
.mini-summary { display: none; }

@media (max-width: 860px) {
  .mini-summary {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    position: sticky; top: 0; left: 0; right: 0; z-index: 60; margin: 0;
    width: 100%; border-radius: 0; border: none;
    background: linear-gradient(100deg, var(--sky), var(--pink));
    color: var(--ink); font-size: .92rem; font-weight: 800;
    padding: 11px 14px; box-shadow: 0 2px 8px rgba(22, 37, 92, .18);
  }
  .mini-status {
    background: #fff; color: #a05a00; border-radius: 999px;
    padding: 2px 10px; font-size: .78rem; white-space: nowrap;
  }
  .mini-status.done { color: var(--ok); }

  /* 固定ヘッダ（検索欄）はミニバーの下に張り付く */
  .catalog-head { top: 45px; }

  /* 全体の余白を詰める（1列が画面幅を超えないようにする） */
  .layout { padding: 10px; gap: 10px; grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 12px; }
  .site-header { padding: 14px 12px; }
  .auth-box { min-width: 0; width: 100%; }
  .catalog-head { margin-left: 0; margin-right: 0; }
  .sum-label { min-width: 52px; }
  .sum-count { min-width: 46px; }
  .sum-mark { min-width: 44px; }
  .bar { min-width: 0; }

  /* カード一覧は2列に（列がはみ出さないよう最小幅0で固定） */
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card-tile { padding: 8px; }

  /* 絞り込みは押しやすい大きさに（入力欄16pxで画面ズーム防止） */
  .filters { gap: 6px; }
  .filters input, .filters select { font-size: 16px; padding: 10px 8px; }
  .filters input { flex: 1 1 100%; }
  .filters select { flex: 1 1 46%; }
  /* 詳細検索タブ（プルタブ風） */
  .adv-toggle {
    display: block; flex: 1 1 100%;
    background: #eef7ff; color: var(--accent);
    border: 1.5px dashed var(--border); border-radius: 10px;
    font-weight: 800; font-size: .9rem; padding: 8px;
  }
  .advanced-filters { display: none; flex: 1 1 100%; min-width: 0; gap: 6px; flex-wrap: wrap; }
  .advanced-filters.open { display: flex; }
  .advanced-filters select { flex: 1 1 46%; }
  .save-box input, .share-row input { font-size: 16px; padding: 10px 8px; }

  /* デッキのサムネイルは3列ほど並ぶ大きさに */
  .stack { width: 86px; }
  .stack-pile { width: 74px; }
  .oshi-area .stack { width: 140px; }
  .oshi-area .stack-pile { width: 118px; }
  .stack-controls button { width: 30px; height: 30px; padding: 0; font-size: .95rem; }
  .oshi-area .stack-controls button { width: auto; height: auto; padding: 7px 16px; }
  .saved-row button { padding: 8px 13px; }

  /* 上へ戻るボタンは親指の届く位置に */
  .to-top { right: 12px; bottom: 20px; width: 50px; height: 50px; }
  .to-bottom { left: 12px; bottom: 20px; width: 50px; height: 50px; }

  /* 拡大表示は画面いっぱいに（画像は箱の内側に収める：vw基準だと箱からはみ出す） */
  .card-modal { padding: 8px; }
  .card-modal-body img { max-width: 100%; max-height: 72vh; }
}

.site-footer {
  /* 下部の固定ボタン（↑・↓、下から約74pxまで）にフッター末尾が隠れないよう余白を確保 */
  max-width: 1200px; margin: 0 auto; padding: 8px 16px 96px;
  font-size: .85rem; color: var(--ink-soft);
}
.site-footer a { color: var(--accent); }

/* 言語切り替え（日本語／英語）：ヘッダー右上の小さなスイッチ */
.lang-switch { display: flex; gap: 4px; justify-content: flex-end; margin-bottom: 6px; }
.lang-switch button { padding: 3px 10px; font-size: .72rem; font-weight: 700; border-radius: 999px; border: 1.5px solid #90caf9; background: #fff; color: #1565c0; cursor: pointer; }
.lang-switch button.active { background: linear-gradient(135deg, #42a5f5, #ec407a); border-color: transparent; color: #fff; }

/* 英語モード用：未発売カードの注意書き・「英語版発売済みのみ」スイッチ・デッキ内注意 */
.en-notice { background: #fff3cd; color: #664d03; border-bottom: 1px solid #ffecb5; padding: 8px 14px; font-size: .85rem; font-weight: 600; text-align: center; line-height: 1.5; }
.en-notice[hidden] { display: none; }
.enonly-wrap { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; color: #3d4f6d; cursor: pointer; padding: 4px 2px; }
.enonly-wrap[hidden] { display: none; }
.enonly-wrap input { width: 17px; height: 17px; accent-color: #ec407a; margin: 0; }
.enonly-note { color: #8a5a00; background: #fff8e1; border: 1px solid #ffe082; border-radius: 8px; padding: 6px 10px; font-size: .82rem; font-weight: 600; margin: 6px 0; }
.enonly-note[hidden] { display: none; }

/* 問い合わせフォーム */
.feedback-btn {
  margin-top: 6px; padding: 5px 12px; border-radius: 999px;
  background: #fff; border: 1.5px solid #f48fb1; color: #d81b60;
  font-weight: 700; font-size: .78rem; cursor: pointer; white-space: nowrap;
}
.feedback-btn:hover { background: #fdeef7; }
.feedback-modal { position: fixed; inset: 0; z-index: 130; display: flex; align-items: center; justify-content: center; }
.feedback-modal[hidden] { display: none; }
.feedback-backdrop { position: absolute; inset: 0; background: rgba(38, 50, 80, .45); }
.feedback-sheet {
  position: relative; background: #fff; border-radius: 18px; padding: 20px;
  width: min(480px, calc(100vw - 32px)); max-height: 86vh; overflow-y: auto;
  box-shadow: 0 18px 48px rgba(22, 37, 92, .35);
}
.feedback-sheet h2 { font-size: 1.05rem; margin-bottom: 8px; color: var(--ink); }
.fb-label { display: block; font-size: .82rem; font-weight: 700; margin: 10px 0 4px; color: var(--ink); }
.feedback-sheet select, .feedback-sheet input[type="text"], .feedback-sheet textarea {
  width: 100%; padding: 9px 10px; border: 1.5px solid #c3def6; border-radius: 10px;
  font-size: .92rem; font-family: inherit; background: #fbfdff; color: var(--ink);
}
.feedback-sheet textarea { resize: vertical; line-height: 1.6; }
.fb-status { font-size: .85rem; min-height: 1.3em; margin-top: 10px; color: #1b7ed4; font-weight: 700; }
.fb-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.fb-actions button { padding: 9px 18px; border-radius: 999px; font-weight: 700; cursor: pointer; }
#fb-cancel { background: #eef3fa; border: 1.5px solid #c3def6; color: var(--ink); }
#fb-submit { background: linear-gradient(140deg, var(--sky), var(--pink)); border: 2px solid #fff; color: var(--ink); box-shadow: 0 3px 10px rgba(22, 37, 92, .25); }
#fb-submit:disabled { opacity: .55; cursor: wait; }
