/* コンポーネントのスタイル */

/* カードプール */
.pool {
  position: relative;  /* .pool-loading オーバーレイのアンカー */
  margin-top: calc(var(--slot-height) * 0.1);
  padding: 10px;
  background: #e3e3e3;
  border: 2px dashed #aaa;
  min-width: var(--min-display-width);
}

/* デッキロード中インジケータ（デッキ/EXデッキエリアに重ねて表示） */
.pool-loading {
  position: absolute;
  inset: 0;
  display: none;  /* .pool.is-loading の時のみ表示 */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(26, 37, 71, 0.78);  /* ダークパネル背景 var(--bg-card)=#1a2547 に馴染ませる */
  pointer-events: none;
  z-index: 2;
}
.pool.is-loading .pool-loading {
  display: flex;
}
.pool-loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(74, 124, 255, 0.25);
  border-top-color: var(--accent);  /* #4a7cff */
  border-radius: 50%;
  animation: pool-spin 0.8s linear infinite;
}
.pool-loading-text {
  font-size: 0.85rem;
  color: var(--main-color);  /* ダーク背景で読めるよう明色 #e2e8f0 */
  letter-spacing: 0.04em;
}
@keyframes pool-spin {
  to { transform: rotate(360deg); }
}

.tier-container {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.tier {
  display: flex;
  align-items: center;
  background: #f5f5f5;
  border: 2px solid #bdbdbd;
  border-radius: 10px;
  padding: 14px 14px 14px 0;
  margin-bottom: 8px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.tier:hover {
  box-shadow: 0 4px 16px rgba(120, 120, 120, 0.13);
  border-color: #888;
}

.tier-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  flex: 1;
  min-height: var(--slot-height);
  align-items: flex-start;
}

#poolRow {
  max-height: var(--slot-width);
  min-height: var(--slot-height);
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  flex-wrap: nowrap;
  gap: var(--gap);
  padding-bottom: 2px;
}

#poolRow2 {
  max-height: var(--slot-width);
  min-height: var(--slot-height);
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  flex-wrap: nowrap;
  gap: var(--gap);
  padding-bottom: 2px;
}

/* カード要素 */
.tier-item-wrapper {
  position: relative;
  width: var(--slot-width);
  height: var(--slot-height);
  overflow: hidden;
  justify-items: start;
}

.tier-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  border-radius: 8px;
  transition: transform 0.3s ease-in-out, filter 0.2s;
}

.tier-item:active {
  cursor: grabbing;
  filter: brightness(0.93);
}

.touch-dragging {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: opacity 0.2s, ease;
}

/* プール内の画像重なり */
#poolRow .tier-item-wrapper {
  width: var(--slot-width);
  height: var(--slot-height);
  flex: 0 0 var(--slot-width);
  margin-left: calc(var(--slot-width)*-0.7);
}

#poolRow .tier-item-wrapper:first-child {
  margin-left: 0;
}

#poolRow2 .tier-item-wrapper {
  width: var(--slot-width);
  height: var(--slot-height);
  flex: 0 0 var(--slot-width);
  margin-left: calc(var(--slot-width)*-0.7);
}

#poolRow2 .tier-item-wrapper:first-child {
  margin-left: 0;
}

/* カスタムスロット */
.custom-slot {
  background: #fff;
  border: 2.5px solid #bdbdbd;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: var(--slot-width);
  min-height: var(--slot-height);
  max-width: var(--slot-width);
  max-height: var(--slot-height);
  transition: box-shadow 0.2s, border-color 0.2s;
  overflow: hidden;
  position: relative;
}

.custom-slot:hover {
  box-shadow: 0 6px 16px rgba(120, 120, 120, 0.18);
  border-color: #888;
}

.custom-slot[data-slot="9"] {
  border: 2px dashed #ccc;
}

/* 「場に出す」配置待ち中のハイライト（PC版・2段階クリック方式） */
.custom-slot.pc-placement-target {
  border-color: #2e86de;
  box-shadow: 0 0 0 3px rgba(46, 134, 222, 0.45), 0 6px 16px rgba(46, 134, 222, 0.25);
  cursor: pointer;
}

/* 手札スロット */
.center-slot {
  display: flex;
  flex-direction: row;
  justify-content: start;
  align-items: flex-start;
  gap: 12px;
  width: calc(var(--slot-width) * 5.5);
  height: var(--slot-height);
  background: #fff;
  border: 2.5px solid #bdbdbd;
  border-radius: 16px;
  min-width: 400px;
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  transition: box-shadow 0.2s, border-color 0.2s;
  margin-left: var(--gap);
}

.center-slot:hover {
  box-shadow: 0 6px 16px rgba(120, 120, 120, 0.18);
  border-color: #888;
}

.center-slot .tier-item-wrapper {
  margin-left: calc(var(--slot-width)*-0.7);
}

.center-slot .tier-item-wrapper:first-child {
  margin-left: 0;
}

/* サイドスロット（墓地・除外） */
.side-slot {
  width: calc(var(--slot-width) * 1.2);
  height: 100%;
  background: #fff;
  border: 2.5px solid #bdbdbd;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: var(--gap);
  overflow: hidden;
  position: relative;
  align-self: stretch;
}

.side-slot .tier-item-wrapper {
  /* JS が --stack-overlap を設定したらそちらを優先、未設定時はデフォルトの90%重ね */
  margin-top: var(--stack-overlap, calc(var(--slot-height)*-0.9));
}

.side-slot .tier-item-wrapper:first-child {
  margin-top: 0;
}

#free-space .side-slot {
  border: 2px dashed #ccc;
}

#free-space .side-slot .tier-item-wrapper{
  margin-top: calc(var(--slot-height)*-0.8);
}

#free-space .side-slot .tier-item-wrapper:first-child {
  margin-top: 0;
}

/* ラベル */
.side-slot-label,
.center-slot-label {
  font-size: var(--mini-font-size);
  font-weight: bold;
  text-align: center;
  color: #333;
}

.center-slot-label {
  padding-left: calc(var(--slot-width)*0.1);
  margin-left: calc(var(--font-size)*1);
}

.side-slot-label {
  margin-bottom: 5px;
}

/* カウンター（バッジスタイル統一） */
.counter-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  padding: 0;
  width: fit-content;
  background: rgba(10, 16, 36, 0.88);
  border: 1px solid rgba(74, 124, 255, 0.55);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  overflow: hidden;
  height: 22px;
  min-width: 46px;
}

.counter-textbox {
  width: 1.6rem;
  height: 22px;
  font-size: 0.85rem;
  font-weight: bold;
  text-align: center;
  border: none;
  border-left: 1px solid rgba(74, 124, 255, 0.3);
  border-right: 1px solid rgba(74, 124, 255, 0.3);
  border-radius: 0;
  background: transparent;
  color: #fff;
  outline: none;
  padding: 0;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.triangle-button {
  width: 16px;
  height: 22px;
  font-size: 0.75rem;
  line-height: 1;
  font-weight: bold;
  background: transparent;
  color: rgba(226, 232, 240, 0.7);
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.triangle-button.up:hover {
  background: rgba(74, 124, 255, 0.5);
  color: #fff;
}

.triangle-button.down:hover {
  background: rgba(239, 68, 68, 0.5);
  color: #fff;
}

/* カード上カウンターの削除(×)ボタン: [−][N][+]の並びを崩さず末尾に追加 */
.counter-delete-btn {
  border-left: 1px solid rgba(74, 124, 255, 0.3);
  font-size: 0.7rem;
}

.counter-delete-btn:hover {
  background: rgba(239, 68, 68, 0.6);
  color: #fff;
}

/* tier-item-wrapper 内のカウンター（カード上バッジ）: 位置指定のみ */
.tier-item-wrapper .counter-container {
  position: absolute;
  right: 3px;
  bottom: 3px;
  z-index: 10;
}

/* 説明文ボックス */
.explain-box {
  display: inline-block;
  vertical-align: top;
  padding: 10px 10px 10px 10px;
  background: #fffbe7;
  border: 2px solid #e0c97f;
  border-radius: 10px;
  font-size: var(--font-size);
  color: #665200;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* ── カード状態（守備表示・セット） ───────────────────────────── */

/* 守備スロット: 守備カードを含む場合のみクリップ解除＋前面化
   回転カードは左右21pxはみ出すため、z-index で隣カードより前面に出す */
.custom-slot:has(.tier-item-wrapper.is-defense) {
  overflow: visible;
  z-index: 5;
}

/* 重ね置きスロット: 下カードがスロット枠外にはみ出す部分を見えるようにする */
.custom-slot:has(.tier-item-wrapper ~ .tier-item-wrapper) {
  overflow: visible;
  z-index: 2;
}

/* 守備 wrapper: overflow 許可＋前面 */
.tier-item-wrapper.is-defense {
  overflow: visible;
  z-index: 6;
}

/* 守備表示: 反時計回りに90度回転 */
.tier-item-wrapper.is-defense .tier-item {
  transform: rotate(-90deg);
  transform-origin: center center;
}

/* セット（裏側表示）: CSS で遊戯王カードバック風の裏面を描画
   img.src は変更せず、::after オーバーレイで隠す。
   pointer-events:none でクリック・ドラッグが img に届くようにする */
.tier-item-wrapper.is-set::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: 8px;
  background:
    radial-gradient(ellipse at center, rgba(255, 210, 140, 0.18) 0%, transparent 52%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 145'%3E%3Cellipse cx='50' cy='72' rx='36' ry='57' fill='%232a1508'/%3E%3C/svg%3E") no-repeat center / 78% auto,
    linear-gradient(145deg, #5a3018 0%, #7d4d25 40%, #3e2010 100%);
  border: 2px solid #b87f28;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.55);
}

/* 守備かつ裏（リバースセット）: 裏面オーバーレイも反時計回りに90°回す */
.tier-item-wrapper.is-defense.is-set::after {
  transform: rotate(-90deg);
  transform-origin: center center;
}

/* 裏面オーバーレイを守備回転トランジションに追従させる */
.tier-item-wrapper.is-set::after {
  transition: transform 0.3s ease-in-out;
}

/* ── セット/表向き切り替えアニメーション ────────────────────── */

/* wrapper を scaleX=0 まで折り畳んだ後、状態変更して展開する2段アニメ。
   状態変更は scaleX=0 の不可視タイミングで行うため自然なカードフリップに見える。 */
@keyframes solFlipOut {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
@keyframes solFlipIn {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.tier-item-wrapper.is-flipping-out {
  animation: solFlipOut 0.15s ease-in forwards;
  pointer-events: none;
}
.tier-item-wrapper.is-flipping-in {
  animation: solFlipIn 0.15s ease-out;
  pointer-events: none;
}

/* ── 効果発動アニメーション（fixedグローオーバーレイ） ──────── */

/* card-effects.js の playActivateEffect が body 直下に生成する見た目専用オーバーレイ。
   position:fixed のため overflow/scrollbar に一切影響しない。 */
/* クローンにはカード画像が含まれるため filter:drop-shadow でカード形状に沿ったグローになる */
@keyframes solActivatePulse {
  0%   { transform: scale(1);    filter: drop-shadow(0 0 0px  rgba(212, 175, 55, 0)); }
  40%  { transform: scale(1.05); filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.85)); }
  100% { transform: scale(1);    filter: drop-shadow(0 0 0px  rgba(212, 175, 55, 0)); }
}

.sol-activate-glow {
  position: fixed;
  pointer-events: none;
  z-index: 9000;
  overflow: visible;
  animation: solActivatePulse 0.5s ease-in-out;
}

/* ── リプレイFLIPクローン ────────────────────────────────────── */

/* card-effects.js の flipMoveClone が body 直下に生成する見た目専用クローン */
.sol-flip-clone {
  pointer-events: none;
  overflow: visible;
  border-radius: 8px;
}

/* ── コンテキストメニュー ────────────────────────────────────── */

.sol-context-menu {
  position: fixed;
  z-index: 9999;
  min-width: 160px;
  /* 2026-10-20 白（元の Solo Mode のまま）から暗色へ。ユーザーが比べて選んだ案Y:
     地はパネルの面（#141c2c）、枠線の代わりにごく薄い縁取りと強めの影で盤面から浮かせる */
  background: #141c2c;
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(174, 197, 255, 0.08);
  padding: 4px;
  margin: 0;
  list-style: none;
  font-size: 0.85rem;
  color: #eff3fb;
  user-select: none;
  -webkit-user-select: none;
}

.sol-context-menu-item {
  padding: 7px 12px;
  border-radius: 4px;
  color: #eff3fb;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s;
}

.sol-context-menu-item:hover,
.sol-context-menu-item:focus {
  background: #202c42;
  outline: none;
}

/* 押せない項目（「デッキから1枚抜く」でデッキ欄に抜けるカードが無いとき） */
.sol-context-menu-item.is-disabled {
  opacity: 0.4;
  cursor: default;
}
.sol-context-menu-item.is-disabled:hover { background: transparent; }

/* 見出し（空いたマスの「トークンを出す」） */
.sol-context-menu-heading {
  padding: 6px 12px 4px;
  color: #a8b4c9;
  font-size: 0.72rem;
  font-weight: 700;
  pointer-events: none;
}

/* 中身を作った行（トークン名の入力欄） */
.sol-context-menu-row {
  padding: 2px 8px 6px;
}
.sol-context-menu-input {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 8px;
  background: var(--bg-color);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--main-color);
  font-family: var(--font);
  font-size: 0.82rem;
}
.sol-context-menu-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* 項目名の前の色見本（トークンの色） */
.sol-context-menu-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border-radius: 3px;
  vertical-align: -1px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

/* 先頭のカード名（2026-10-21 マイデッキの右クリックと同じ形。長い名前は1行で省略） */
.sol-context-menu-heading.is-title {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: auto; /* 全文のツールチップ（title）を出すため。押しても何もしない */
  cursor: default;
}

/* 項目の補足（「今 3枚」）。右に寄せる */
.sol-context-menu-item:has(> .sol-context-menu-sub) {
  display: flex;
  align-items: baseline;
  gap: 18px;
}
.sol-context-menu-sub {
  margin-left: auto;
  color: #a8b4c9;
  font-size: 0.72rem;
}

.sol-context-menu-sep {
  height: 1px;
  background: #202c42;
  margin: 4px 0;
  padding: 0;
  pointer-events: none;
}

/* Twitterリンク */
.twitter-link {
  text-decoration: none;
  color: #1DA1F2;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.twitter-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* テキスト */
p, span, li {
  color: #333;
}

/* ?newcards=1&focus= で開いたときの強調（B+D）。強調中だけ body に sol-newcard-focus-active が付く。
   B: デッキ欄の focus 以外を暗くする  D: focus カードを少し大きくして影で浮かせる（デッキ欄の中だけで前面に）。
   選択中（金の実線）・触れている間（アクセントの実線）・置き場所の案内（アクセントの破線）とは重ねない。 */
body.sol-newcard-focus-active #poolRow .tier-item-wrapper:not(.sol-newcard-focus),
body.sol-newcard-focus-active #poolRow2 .tier-item-wrapper:not(.sol-newcard-focus) {
  filter: brightness(.45);
}
/* 拡大した focus の上下がデッキ欄（overflow-y:hidden）で切れないよう、強調中だけ余白を足す。
   負のマージンで相殺するので、盤面の他の部分は動かない。 */
body.sol-newcard-focus-active #poolRow,
body.sol-newcard-focus-active #poolRow2 {
  padding-top: 8px;
  margin-top: -8px;
  padding-bottom: 8px;
  margin-bottom: -6px;
}
#poolRow .tier-item-wrapper.sol-newcard-focus,
#poolRow2 .tier-item-wrapper.sol-newcard-focus {
  transform: scale(1.06);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .7);
  z-index: 3;
}

/* ── デッキ編集（deck-edit-ui.js・2026-10-20）──────────────────────────
   site-theme.css の規則「黄は主操作だけ」に従い、保存ボタンは補助ボタンの青系（#202c42 / #aec5ff）にする
   （下のリプレイバーの黄色い「保存」と取り違えないため。文言も「変更を保存」「マイデッキに新規登録」にしている）。
   一人回しの汎用 span/li の色（#333）が当たらないよう、子要素の文字色まで明示する。 */

/* デッキ欄の見出し: 左に名前（登録済みのときだけ）と状態、右に同じ形のボタン（2026-10-20 ユーザー承認の案A。
   モック _mocks/deck-bar-20261020）。ボタンは「変更を保存」「別のデッキとして保存」「マイデッキに登録」「デッキ画像」を
   すべて同じ塗りのピルにする（以前は塗り・枠線だけ・下線の文字が混ざり、枠線のピルは枠が背景に溶けて文字に見えた）。 */
@media (min-width: 768px) {
  #imagePool > .pool-label { display: flex; align-items: center; }
}
.pool-label .sol-deck-bar {
  display: inline-flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  margin-left: 12px;
  min-width: 0;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.pool-label .sol-deck-bar[hidden] { display: none; }
.sol-deck-bar-name {
  color: #eff3fb;
  font-weight: 700;
  max-width: 18em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sol-deck-bar-state { color: #a8b4c9; white-space: nowrap; }
.sol-deck-bar-acts {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.sol-deck-bar-btn {
  height: 22px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #202c42;
  color: #aec5ff;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.sol-deck-bar-btn:hover, .sol-deck-bar-btn:focus-visible { background: #2b3549; }

/* 範囲を選ぶパネル（pc-recording.js・2026-10-20 ユーザー承認の案A。モック _mocks/pc-range-20261020）
   今の段（① か ②）は地の明るさで示す（金の実線＝選択中・アクセント色の実線＝触れている間 と重ねない）。
   選んだ範囲はスライダーの上の金色の帯（金＝選んでいるもの）。主操作は黄（site-theme.css の主操作と同じ）。 */
.sol-pc-range-panel {
  position: fixed;
  z-index: 1200;
  width: 440px;
  box-sizing: border-box;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .55);
  font-family: var(--font);
}
.sol-pc-range-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sol-pc-range-title { color: #eff3fb; font-size: 14px; font-weight: 700; }
.sol-pc-range-now { margin-left: auto; color: #a8b4c9; font-size: 12px; }
.sol-pc-range-steps { display: flex; gap: 8px; margin-bottom: 10px; }
.sol-pc-range-step {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
}
.sol-pc-range-step.is-current { background: #202c42; border-color: #202c42; }
.sol-pc-range-step-label { display: block; color: #a8b4c9; font-size: 12px; }
.sol-pc-range-step.is-current .sol-pc-range-step-label { color: #eff3fb; }
.sol-pc-range-step-val { display: block; margin-top: 2px; color: #eff3fb; font-size: 14px; }
#solPcRangeStep1:not(.is-current) .sol-pc-range-step-val { color: var(--gold); }
.sol-pc-range-hint { margin: 0 0 10px; color: #a8b4c9 !important; font-size: 12px; line-height: 1.5; }
.sol-pc-range-btns { display: flex; justify-content: flex-end; gap: 8px; }
.sol-pc-range-btns button {
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.sol-pc-range-cancel { background: #202c42; color: #aec5ff; }
.sol-pc-range-cancel:hover { background: #2b3549; }
.sol-pc-range-ok { background: #f3ce46; color: #242013; }
.sol-pc-range-ok:hover { background: #ffe16d; }
.sol-pc-range-ok:disabled { opacity: .45; cursor: default; }
.sol-pc-range-band {
  position: fixed;
  z-index: 1150;
  height: 4px;
  border-radius: 2px;
  background: var(--gold);
  pointer-events: none;
}
.sol-pc-range-band[hidden] { display: none; }

/* 足りない分を購入候補へ（deck-wish-ui.js・2026-10-20 ユーザー承認のモック _mocks/wish-from-sim-20261020）
   面・縁・影は範囲を選ぶパネルと同じ。主操作（追加）は黄、［全部ある］［持ってない］の選ばれた側は accent の面
   （金の実線＝選択中・アクセント色の実線＝触れている間 の目印とは重ねない）。追加する枚数は金の文字。 */
.sol-wish-panel {
  position: fixed;
  z-index: 1300;
  width: 560px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow: auto;
  box-sizing: border-box;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .55);
  font-family: var(--font);
  color: #eff3fb;
}
.sol-wish-panel.is-sheet {
  left: 0; right: 0; bottom: 0; top: auto;
  width: auto; max-width: none; max-height: 86vh;
  border: 0;
  border-radius: 16px 16px 0 0;
  padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .55);
}
.sol-wish-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sol-wish-title { color: #eff3fb !important; font-size: 14px; font-weight: 700; }
.sol-wish-deck { margin-left: auto; color: #a8b4c9 !important; font-size: 12px; }
.sol-wish-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sol-wish-table th { color: #a8b4c9; font-weight: 400; text-align: right; padding: 4px; font-size: 11.5px; white-space: nowrap; }
.sol-wish-table td { padding: 4px; text-align: right; border-top: 1px solid #202c42; color: #eff3fb; }
.sol-wish-table .c-name { text-align: left; }
.sol-wish-table .c-own { white-space: nowrap; }
.sol-wish-table td.is-zero, .sol-wish-table td.c-add:not(.is-add) { color: #a8b4c9; }
.sol-wish-table td.c-add.is-add { color: var(--gold); font-weight: 700; }
.sol-wish-group td { border-top: 0; padding: 10px 4px 2px; color: #a8b4c9; font-size: 11.5px; text-align: left; }
.sol-wish-own {
  width: 42px;
  box-sizing: border-box;
  padding: 2px 6px;
  background: var(--bg-color);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--main-color);
  font: inherit;
  text-align: right;
  -moz-appearance: textfield;
}
.sol-wish-own::-webkit-inner-spin-button, .sol-wish-own::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sol-wish-own:focus { outline: none; border-color: var(--accent); }
.sol-wish-q {
  margin-left: 4px;
  height: 20px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: #202c42;
  color: #aec5ff;
  font: 700 11px var(--font);
  vertical-align: middle;
  cursor: pointer;
}
.sol-wish-q:hover { background: #2b3549; }
.sol-wish-q.is-on { background: #aec5ff; color: #101626; }
.sol-wish-hint { margin: 8px 0 10px; color: #a8b4c9 !important; font-size: 12px; line-height: 1.5; }
.sol-wish-btns { display: flex; justify-content: flex-end; gap: 8px; }
.sol-wish-btns button {
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.sol-wish-cancel { background: #202c42; color: #aec5ff; }
.sol-wish-cancel:hover { background: #2b3549; }
.sol-wish-ok { background: #f3ce46; color: #242013; }
.sol-wish-ok:hover { background: #ffe16d; }
.sol-wish-ok:disabled { opacity: .45; cursor: default; }
/* スマホのシートは幅が足りないので「デッキ」「候補にある」を省く（追加する枚数の計算には入っている） */
.sol-wish-panel.is-sheet .sol-wish-table { font-size: 13px; }
.sol-wish-panel.is-sheet .c-need, .sol-wish-panel.is-sheet .c-wish { display: none; }
.sol-wish-panel.is-sheet .sol-wish-own { width: 36px; }
.sol-wish-panel.is-sheet .sol-wish-btns button { flex: 1; }
/* スマホ編集の選んだカードの欄の［候補へ］ */
.sol-deck-edit-wish { margin-left: 8px; height: 28px; flex-shrink: 0; }

/* このデッキのリプレイ（deck-replays-ui.js・2026-10-21 ユーザー承認のモック _mocks/deck-replay-link-20261021）
   行の地はサイドバーのボタン（.sol-side-btn）と同じ。記録の後にデッキが変わったものは金の文字（選択中の金の実線とは別の、文字だけの印）。
   サイドバーの span には共通の文字色がかかるので、文字色は で決める */
.sol-drp-list { display: flex; flex-direction: column; gap: 6px; }
.sol-drp-deck { margin: -2px 0 2px; font-size: 11px; color: #a8b4c9; }
.sol-drp-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: var(--bg-card);
  text-align: left;
  cursor: pointer;
  font-family: var(--font);
}
.sol-drp-row:hover { background: var(--bg-hover); }
.sol-drp-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sol-drp-title {
  max-width: 100%;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--main-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sol-drp-meta { font-size: 11px; color: #a8b4c9; }
.sol-drp-meta.is-drift { color: var(--gold); }
.sol-drp-empty { margin: 0; font-size: 11.5px; line-height: 1.55; color: #a8b4c9; }

/* スマホ: デッキシートの頭の下の1行と、下から出る一覧 */
/* 下の検索欄と左右の端をそろえる（シートの中身の左右の余白 14px） */
#solMobileDeckReplaysBtn.sol-drp-mobile-btn { margin: 4px 14px 8px; width: calc(100% - 28px); height: 44px; }
.sol-drp-mobile-btn[hidden] { display: none; }
.sol-drp-sheet { position: fixed; inset: 0; z-index: 3200; }
.sol-drp-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.sol-drp-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 80vh;
  overflow: auto;
  box-sizing: border-box;
  padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #141c2c;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .55);
  font-family: var(--font);
}
.sol-drp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.sol-drp-head-title { font-size: 15px; font-weight: 700; color: #eff3fb; }
.sol-drp-head-deck { margin-left: auto; font-size: 12px; color: #a8b4c9; }
.sol-drp-x { width: 32px; height: 32px; border: 0; border-radius: 50%; background: #202c42; color: #aec5ff; font-size: 18px; cursor: pointer; }
.sol-drp-panel .sol-drp-row { padding: 11px 12px; }
.sol-drp-panel .sol-drp-title { font-size: 14px; }
.sol-drp-panel .sol-drp-meta { font-size: 12px; }
.sol-drp-panel .sol-drp-empty { font-size: 13px; }

/* 開いたリプレイの記録の後にデッキが変わっていたときの帯（上の読込の帯の下に重ねる） */
.sol-drp-banner {
  position: fixed;
  left: 50%;
  top: 58px;
  transform: translateX(-50%);
  z-index: 1300;
  display: flex;
  align-items: center;
  gap: 12px;
  /* left:50% のままだと幅が画面の右半分までに縮み、［×］がはみ出すので中身の幅にする */
  width: max-content;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  padding: 9px 10px 9px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  font: 13px var(--font);
}
.sol-drp-banner-text { color: #eff3fb; white-space: nowrap; }
.sol-drp-banner-diff { color: var(--gold); white-space: nowrap; }
.sol-drp-banner-btn {
  flex: none;
  height: 26px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #202c42;
  color: #aec5ff;
  font: 700 12px var(--font);
  cursor: pointer;
}
.sol-drp-banner-btn:hover { background: #2b3549; }
.sol-drp-banner-x { flex: none; border: 0; background: none; color: #a8b4c9; font-size: 16px; cursor: pointer; }
@media (max-width: 767px) {
  .sol-drp-banner { flex-wrap: wrap; width: calc(100vw - 24px); top: 64px; }
  .sol-drp-banner-text, .sol-drp-banner-diff { flex: 1 1 100%; white-space: normal; }
}

/* 左サイドバー「カードを追加」 */
.sol-deck-add-search {
  width: 100%;
  box-sizing: border-box;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-color);
  color: var(--main-color);
  font: inherit;
  font-size: 12px;
}
.sol-deck-add-search::placeholder { color: #a8b4c9; }
/* 検索の候補（PC は body 直下に置き、入力欄の下に重ねる。スマホは編集欄の中に並べる） */
.sol-deck-suggest {
  list-style: none;
  margin: 0;
  padding: 4px;
  background: #141c2c;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .65), 0 0 0 1px rgba(174, 197, 255, .08);
}
.sol-deck-suggest[hidden] { display: none; }
#solDeckAddSuggest {
  position: fixed;
  z-index: 9998;
  width: 320px;
  max-height: 60vh;
  overflow-y: auto;
}
.sol-deck-suggest-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  color: #eff3fb;
  font-size: 12px;
  cursor: pointer;
}
.sol-deck-suggest-item:hover, .sol-deck-suggest-item.is-active { background: #202c42; }
.sol-deck-suggest-thumb {
  flex: none;
  width: 22px;
  height: 32px;
  border-radius: 2px;
  background: #202c42;
  overflow: hidden;
}
.sol-deck-suggest-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sol-deck-suggest-name { color: #eff3fb; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sol-deck-suggest-badge { flex: none; color: #a8b4c9; font-size: 10px; border: 1px solid #2b3549; border-radius: 999px; padding: 0 6px; }
.sol-deck-suggest-add { flex: none; color: #aec5ff; font-weight: 700; }

/* 取り消し付きのトースト（「〜に保存しました［取り消し］」）。通常のトーストは押せないので押せるようにする */
.sol-toast.sol-toast-action {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}
.sol-toast-action span { color: var(--main-color); }
/* 購入候補のお知らせ（deck-wish-ui.js）は文が長いので、狭い画面では折り返す（ボタンが画面の外に出ないように） */
.sol-toast.sol-toast-wrap {
  white-space: normal;
  width: max-content;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
}
.sol-toast-undo {
  flex: none;
  padding: 3px 10px;
  border: 0;
  border-radius: 999px;
  background: #202c42;
  color: #aec5ff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
