/* ============================================================
   SPEC-109: ショップ (= レベルアップの置き換え。 枠と札は .levelup-modal / .levelup-card を借りる)
   ============================================================ */

.shop-modal__card { max-width: 820px; }

/* 店主 (= シャドーヒーローの顔とひとこと) と財布 */
.shop-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.7rem;
}
.shop-head__face {
  width: 64px; height: 64px;
  image-rendering: pixelated;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 60%, rgba(140, 90, 220, 0.35), rgba(0, 0, 0, 0.5) 70%);
  border: 1.5px solid rgba(187, 134, 252, 0.55);
  filter: drop-shadow(0 0 6px rgba(187, 134, 252, 0.45));
}
.shop-head__talk { min-width: 0; }
.shop-head__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.shop-head__title::before {
  content: attr(data-kicker);
  display: block;
  font-family: var(--font-num, inherit);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  color: var(--muted);
}
.shop-head__line {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.4;
}
/* 商人の名前の横に「（あと n 回でボス）」 */
.shop-head__boss { margin-left: 0.5em; font-family: var(--font-body, inherit); font-size: 0.72rem; color: var(--muted); letter-spacing: 0; white-space: nowrap; }
/* 装備中 (= 8) と手持ちの CE (= 2) を 1 行に */
.shop-status { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 2fr); gap: 0.5rem; align-items: stretch; }
.shop-status > .levelup-modal__owned.hidden + .shop-wallet { grid-column: 1 / -1; }
.shop-wallet__heal { font-size: 0.68rem; color: #9dffb4; white-space: nowrap; }
.shop-wallet__bans { display: none; font-size: 0.6rem; color: var(--muted); white-space: nowrap; }
.shop-wallet {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem; min-width: 0;
  padding: 0.35rem 0.6rem;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(240, 193, 75, 0.18), rgba(240, 193, 75, 0.05));
  border: 1px solid rgba(240, 193, 75, 0.45);
}
.shop-wallet__label { font-size: 0.62rem; color: var(--muted); letter-spacing: 0.1em; }
.shop-wallet__ce { font-size: 1.05rem; color: var(--xp); font-weight: 800; white-space: nowrap; }
.shop-wallet__ce b { font-size: 1.35rem; }
.shop-wallet__gift { font-size: 0.72rem; color: #9be7ff; white-space: nowrap; }

/* 品 (= 札 + 取り置き・お断り) */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: 0.55rem;
}
.shop-offer { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.shop-card { flex: 1 1 auto; }
.shop-card--short { opacity: 0.55; cursor: not-allowed; }
.shop-price {
  position: relative;
  display: block;
  margin-top: auto;
  padding: 0.25rem 0;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  color: #1a1420;
  background: linear-gradient(180deg, #ffe08a, #e0a93a);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 2px 6px rgba(0, 0, 0, 0.35);
}
.shop-price--short { color: #ffd6d6; background: linear-gradient(180deg, #8a2d3a, #5a1a26); }
.shop-price--gift  { color: #06202a; background: linear-gradient(180deg, #b8f1ff, #5fc6e6); }
.shop-price--sale[data-tag]::after {
  content: attr(data-tag);
  position: absolute; top: -0.75rem; right: -0.2rem;
  padding: 0.05rem 0.4rem;
  font-size: 0.62rem;
  border-radius: var(--r-pill);
  color: #fff;
  background: linear-gradient(180deg, #ff6a6a, #c62f3d);
  transform: rotate(6deg);
}

/* 取り置き (= 右上) とお断り (= 左上) は札の角のアイコン */
.shop-offer { position: relative; }
.shop-corner {
  appearance: none;
  position: absolute; top: -7px; z-index: 3;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  padding: 0;
  border-radius: 50%;
  font-size: 0.95rem; line-height: 1;
  color: var(--text);
  background: rgba(20, 16, 30, 0.92);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}
.shop-corner--lock { right: -7px; }
.shop-corner--ban { left: -7px; font-size: 0.85rem; font-weight: 800; color: #ffb3b3; }
.shop-corner--lock.is-on { background: linear-gradient(180deg, #b8f1ff, #5fc6e6); border-color: #e6fbff; box-shadow: 0 0 10px rgba(155, 231, 255, 0.8); }
.shop-corner--ban.is-armed { color: #fff; background: linear-gradient(180deg, #ff6a6a, #c62f3d); border-color: #ffd0d0; animation: shop-ban-pulse 0.8s ease-in-out infinite; }
@keyframes shop-ban-pulse { 50% { scale: 1.12; } }
@media (hover: hover) {
  .shop-corner:hover { border-color: rgba(255, 255, 255, 0.6); }
}
/* 取り置き中: 枠を水色に光らせ、 上に「取り置き中」 */
.shop-offer--locked .shop-card {
  outline: 2.5px solid #9be7ff; outline-offset: -1px;
  box-shadow: 0 0 14px rgba(155, 231, 255, 0.55);
}
.shop-offer__lockTag {
  position: absolute; top: -8px; left: 50%; translate: -50% 0; z-index: 2;
  padding: 0.05rem 0.5rem;
  border-radius: var(--r-pill);
  font-size: 0.6rem; font-weight: 800; white-space: nowrap;
  color: #06202a; background: linear-gradient(180deg, #b8f1ff, #5fc6e6);
  pointer-events: none;
}
/* お断りの確かめ: 札を赤くかげらせ、 上に「もう一度タップで今後表示しない」 */
.shop-offer--banArm .shop-card { filter: saturate(0.4) brightness(0.75); outline: 2px solid rgba(231, 96, 96, 0.8); outline-offset: -1px; }
.shop-offer__banHint {
  position: absolute; top: 26px; left: 4px; right: 4px; z-index: 2;
  padding: 0.25rem 0.3rem;
  border-radius: 6px;
  font-size: 0.66rem; font-weight: 800; line-height: 1.3; text-align: center;
  color: #fff; background: rgba(198, 47, 61, 0.92);
  pointer-events: none;
}
:root[data-reduce-fx] .shop-corner--ban.is-armed { animation: none; }

/* 売れた品 */
.shop-offer--sold .shop-offer__soldcard {
  flex: 1 1 auto;
  min-height: 156px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem;
  border-radius: 8px;
  border: 1.5px dashed var(--border);
  color: var(--muted);
  font-size: 0.8rem; font-weight: 700;
}
.shop-offer--sold img { width: 48px; height: 48px; opacity: 0.4; filter: grayscale(0.6); }

/* お断りした品 */
.shop-bans { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; font-size: 0.7rem; color: var(--muted); }
.shop-bans.hidden { display: none; }
.shop-bans__head { margin-right: 0.2rem; }
.shop-bans img { width: 22px; height: 22px; opacity: 0.55; filter: grayscale(1); }

/* 下の段 (= お断りの残り・リロール・出る) */
.shop-actions { align-items: center; }
.shop-actions__bans { flex: 0 0 auto; font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.shop-modal .levelup-modal__actions .shop-actions__leave {
  flex-grow: 1.5;
  font-weight: 800;
  color: #1a1420;
  background: linear-gradient(180deg, #ffe08a 0%, #e0a93a 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 3px 10px rgba(224, 169, 58, 0.35);
}
.shop-modal .levelup-modal__actions .shop-actions__reroll {
  flex-grow: 1;
  color: var(--text);
  background: linear-gradient(180deg, #5a4a86 0%, #3a2f5c 100%);
  border: 1px solid rgba(187, 134, 252, 0.45);
}
/* 下の段は札が多くても見えるように、 窓の下に貼る */
.shop-modal .shop-actions {
  position: sticky; bottom: -1.1rem;
  margin: 0 -1.1rem -1.1rem;
  padding: 0.6rem 1.1rem 0.8rem;
  background: linear-gradient(180deg, rgba(23, 19, 31, 0), #17131f 30%);
}


/* 狭い画面は 2 列 (= 4 枚・5 枚とも)。 スクロールせずに 1 画面に入るよう、 どの段も詰める */
@media (max-width: 640px) {
  .shop-modal { padding: max(0.35rem, var(--safe-t)) max(0.4rem, var(--safe-r)) max(0.35rem, var(--safe-b)) max(0.4rem, var(--safe-l)); }
  .shop-modal__card { padding: 0.6rem 0.65rem 0.65rem; gap: 0.45rem; }
  .shop-head { gap: 0.5rem; }
  .shop-head__face { width: 40px; height: 40px; }
  .shop-head__title { font-size: 0.95rem; }
  .shop-head__title::before { display: none; }
  .shop-head__line { font-size: 0.72rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .shop-intro { padding: 0.3rem 0.5rem; gap: 0.4rem; }
  .shop-intro__ain { width: 32px; height: 32px; }
  .shop-intro__text { font-size: 0.68rem; line-height: 1.3; }
  /* 装備中と手持ち: 見出しを外し、 絵を 24px に */
  .shop-modal .levelup-modal__owned { grid-template-columns: minmax(0, 1fr); padding: 0.25rem 0.4rem; }
  .shop-modal .levelup-owned__head { display: none; }
  .shop-modal .levelup-owned__rows { gap: 0.15rem 0.3rem; }
  .shop-modal .levelup-owned__label { flex-direction: row; gap: 0.2em; padding-top: 0.35rem; font-size: 0.58rem; }
  .shop-modal .levelup-owned__tiles { gap: 0.2rem; }
  .shop-modal .levelup-owned__tile { width: 24px; }
  .shop-modal .levelup-owned__icon, .shop-modal .levelup-owned__tile--empty { width: 24px; height: 24px; }
  .shop-modal .levelup-owned__lv { font-size: 0.5rem; line-height: 1.1; }
  .shop-wallet { padding: 0.2rem 0.25rem; }
  .shop-wallet__label { font-size: 0.56rem; }
  .shop-wallet__ce { font-size: 0.9rem; }
  .shop-wallet__ce b { font-size: 1.15rem; }
  .shop-wallet__gift, .shop-wallet__heal { font-size: 0.6rem; }
  /* 品: 絵と字を小さく */
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; }
  .shop-offer { gap: 0.2rem; }
  .shop-card { min-height: 0; gap: 0.15rem; padding: 0.3rem 0.35rem 0.35rem; }
  .shop-card .levelup-card__cat { font-size: 0.56rem; padding: 0 0.4em; }
  .shop-card .levelup-card__icon-wrap { aspect-ratio: auto; height: 40px; }
  .shop-card .levelup-card__icon { width: 36px; height: 36px; object-fit: contain; }
  .shop-card .levelup-card__rankup { font-size: 0.5rem; }
  .shop-card .levelup-card__name { font-size: 0.78rem; }
  .shop-card .levelup-card__skill { font-size: 0.72rem; }
  .shop-card .levelup-card__effect { font-size: 0.62rem; line-height: 1.3; }   /* SPEC-127: 説明は切らない (= 効果が分からなくなる) */
  .shop-card .levelup-card__lv { font-size: 0.62rem; }
  .shop-price { padding: 0.15rem 0; font-size: 0.82rem; }
  .shop-corner { width: 26px; height: 26px; font-size: 0.8rem; top: -6px; }
  .shop-corner--lock { right: -5px; }
  .shop-corner--ban { left: -5px; }
  .shop-offer--sold .shop-offer__soldcard { min-height: 0; height: 100%; }
  /* 固有スキル: 2 列のまま低く */
  .shop-sig { padding: 0.35rem 0.5rem; }
  .shop-sig__face { width: 32px; height: 32px; }
  .shop-sig__name { font-size: 0.8rem; }
  .shop-sig__buy { padding: 0.3rem 0.2rem; font-size: 0.78rem; }
  /* 下の段: お断りの残りはボタンの上に小さく */
  .shop-actions { flex-wrap: wrap; row-gap: 0.2rem; }
  .shop-actions__bans { flex-basis: 100%; text-align: center; font-size: 0.64rem; }
  .shop-modal .levelup-modal__actions .btn { padding: 0.5rem 0.3rem; }
  /* 窓の下に貼る段は、 窓の余白 (= 詰めたぶん) に合わせる */
  .shop-modal .shop-actions { bottom: -0.65rem; margin: 0 -0.65rem -0.65rem; padding: 0.45rem 0.65rem 0.6rem; }
  /* さらに詰める: お断りの残りは手持ちの欄へ。 札の「武器／強化エクステ」は残す (= 作者 2026-10-24 SPEC-172: 見分けられたほうがよい) */
  .shop-card .levelup-card__series { margin: 0; }
  .shop-actions__bans { display: none; }
  .shop-wallet__bans { display: block; }
  /* 最初の店は、 商人のひとことを畳む (= マインちゃんの説明があるので) */
  .shop-modal--intro .shop-head__line { display: none; }
  /* 最初の店 (= CE はまだ 2〜3) では固有スキルの強化 (= 40 CE から) は買えないので畳む。 2 回目の店から出る */
  .shop-modal--intro .shop-sig { display: none; }
  /* 固有スキル: 見出しを外し、 名前と Lv を 1 行に */
  .shop-sig__kicker { display: none; }
  .shop-sig__title { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 0.4em; }
  .shop-sig { row-gap: 0.2rem; }
  /* 5 枚 (= マゼラン) は 3 列 (= 説明は残す) */
  .shop-grid[data-n="5"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shop-grid[data-n="5"] .levelup-card__name { font-size: 0.7rem; }
}
}

/* ============================================================
   SPEC-110: 固有スキルの強化 (= 常設の札)
   ============================================================ */
.shop-body { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 0.6rem; align-items: start; }
.shop-body > .shop-grid { grid-column: 1; grid-row: 1; }
.shop-sig { grid-column: 2; grid-row: 1; }
.shop-sig.hidden { display: none; }
.shop-body:has(.shop-sig.hidden) { grid-template-columns: minmax(0, 1fr); }
.shop-sig {
  display: flex; flex-direction: column; gap: 0.45rem;
  padding: 0.6rem;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(187, 134, 252, 0.18), rgba(30, 26, 40, 0.9) 60%);
  border: 1.5px solid rgba(187, 134, 252, 0.6);
  box-shadow: 0 0 14px rgba(187, 134, 252, 0.2);
}
.shop-sig__head { display: flex; align-items: center; gap: 0.45rem; }
.shop-sig__face { width: 48px; height: 48px; image-rendering: pixelated; flex: 0 0 auto; }
.shop-sig__title { display: flex; flex-direction: column; min-width: 0; }
.shop-sig__kicker { font-size: 0.6rem; letter-spacing: 0.2em; color: var(--tiamat); }
.shop-sig__name { font-size: 0.9rem; color: var(--text); line-height: 1.25; }
.shop-sig__lv { font-size: 0.75rem; color: var(--accent); font-weight: 800; }
.shop-sig__rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.shop-sig__rows li { display: flex; justify-content: space-between; gap: 0.3rem; font-size: 0.72rem; color: var(--muted); }
.shop-sig__rows li .num { color: var(--text); white-space: nowrap; }
.shop-sig__rows li.is-up .num { color: #c9ffb0; }
.shop-sig__buy {
  appearance: none; border: 0; cursor: pointer;
  padding: 0.45rem 0.3rem;
  border-radius: var(--r-pill);
  font-weight: 800; font-size: 0.85rem;
  color: #1a1420;
  background: linear-gradient(180deg, #e3c8ff, #a26ef0);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 2px 8px rgba(162, 110, 240, 0.4);
}
.shop-sig__buy:disabled { cursor: not-allowed; filter: grayscale(0.7); opacity: 0.6; }
.shop-sig__note { margin: 0; font-size: 0.62rem; color: var(--muted); text-align: center; }

@media (max-width: 640px) {
  .shop-body { grid-template-columns: minmax(0, 1fr); }
  .shop-sig { grid-column: 1; grid-row: 1; display: grid; grid-template-columns: 1fr 1fr; align-items: center; padding: 0.45rem 0.55rem; gap: 0.3rem 0.5rem; }
  .shop-sig.hidden { display: none; }
  .shop-body > .shop-grid { grid-row: 2; }
  .shop-sig__head { grid-column: 1; }
  .shop-sig__rows { grid-column: 2; grid-row: 1 / span 2; }
  .shop-sig__buy { grid-column: 1; }
  .shop-sig__note { display: none; }
  .shop-sig__face { width: 40px; height: 40px; }
}

/* 最初の店: マインちゃんの説明 (= CE を集めて買う・サービスの 1 品) */
.shop-intro {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(95, 198, 230, 0.22), rgba(95, 198, 230, 0.06));
  border: 1px solid rgba(155, 231, 255, 0.55);
}
.shop-intro.hidden { display: none; }
.shop-intro__ain { width: 48px; height: 48px; flex: 0 0 auto; image-rendering: pixelated; object-fit: contain; }
.shop-intro__text { margin: 0; font-size: 0.82rem; line-height: 1.45; color: var(--text); }

/* ============================================================
   ヘッダーの「次の店まで」の帯 (= XP の帯の場所。 次に来る商人が左から右へ歩いてくる)
   ============================================================ */
.shop-bar {
  display: flex; align-items: center; gap: 8px;
  flex: 1.4 1 0; min-width: 0;
}
.shop-bar.hidden { display: none; }
.shop-bar__label { flex: 0 0 auto; font-size: 0.72rem; color: var(--muted); white-space: nowrap; max-width: 17em; overflow: hidden; text-overflow: ellipsis; }
.hud.hud--shop { padding-top: 9px; padding-bottom: 9px; }
.shop-bar__label b { color: #d9c2ff; font-weight: 700; }
.shop-bar__track {
  --walker: 28px;
  position: relative;
  flex: 1 1 0; min-width: 80px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(187, 134, 252, 0.35);
}
.shop-bar__fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(140, 127, 176, 0.5), #bb86fc);
  transition: width 0.25s linear;
}
/* 商人: 帯の上を左 (= 0) から右 (= 1。 店) へ。 足もとを帯に乗せる */
.shop-bar__walker {
  position: absolute;
  top: 50%;
  margin-top: calc(var(--walker) * -0.62);   /* 足もとを帯に乗せる (= HUD の高さに収める) */
  left: calc(var(--x, 0) * (100% - var(--walker) - 14px));
  width: var(--walker); height: var(--walker);
  image-rendering: pixelated;
  filter: drop-shadow(0 0 4px rgba(187, 134, 252, 0.8)) drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5));
  transform: scaleX(-1);   /* 絵は左向きなので、 右 (= 店) を向かせる */
  transition: left 0.25s linear;
  animation: shop-walk 0.5s steps(2) infinite;
  pointer-events: none;
}
.shop-bar__walker[hidden] { display: none; }
@keyframes shop-walk { 50% { translate: 0 -2px; } }
.shop-bar__goal { position: absolute; right: -4px; top: 50%; translate: 0 -50%; font-size: 1rem; line-height: 1; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6)); }
.shop-bar__sec {
  flex: 0 0 auto; min-width: 3.4em; text-align: right;
  font-size: 0.85rem; font-weight: 800; color: #e6d6ff;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.shop-bar__ce { flex: 0 0 auto; font-weight: 800; color: var(--xp); white-space: nowrap; }

/* 残り 10 秒: 帯が金に光って脈打ち、 秒が大きくなり、 商人が跳ねる */
.shop-bar--soon .shop-bar__track {
  box-shadow: inset 0 0 0 1px rgba(255, 224, 138, 0.9), 0 0 10px rgba(255, 196, 64, 0.7);
  animation: shop-bar-glow 0.8s ease-in-out infinite;
}
.shop-bar--soon .shop-bar__fill { background: linear-gradient(90deg, #e0a93a, #ffe08a); }
.shop-bar--soon .shop-bar__sec {
  color: #1a1420; font-size: 1rem;
  padding: 0 0.45em; border-radius: 6px;
  background: linear-gradient(180deg, #ffe08a, #e0a93a);
  animation: shop-bar-pulse 0.8s ease-in-out infinite;
}
.shop-bar--soon .shop-bar__walker { animation: shop-walk 0.25s steps(2) infinite; }
@keyframes shop-bar-glow { 50% { box-shadow: inset 0 0 0 1px #fff3c4, 0 0 18px rgba(255, 196, 64, 1); } }
@keyframes shop-bar-pulse { 50% { scale: 1.12; } }
.shop-bar--done .shop-bar__track { opacity: 0.45; }
.shop-bar--done .shop-bar__sec { color: var(--muted); font-size: 0.75rem; }
:root[data-reduce-fx] .shop-bar__walker,
:root[data-reduce-fx] .shop-bar--soon .shop-bar__track,
:root[data-reduce-fx] .shop-bar--soon .shop-bar__sec { animation: none; }

/* スマホ: HUD の 2 段目に、 横いっぱいの帯 */
@media (max-width: 640px) {
  .hud.hud--shop { flex-wrap: wrap; row-gap: 4px; padding-top: 6px; padding-bottom: 6px; }
  .hud--shop .shop-bar { flex: 1 1 100%; order: 10; padding-top: 14px; }
  .shop-bar__label { display: none; }
  .shop-bar__track { --walker: 28px; }
}

/* 広い画面でも、 高さが足りなければ札の絵を低くする (= ノート PC の 800px でもスクロールしない) */
@media (min-width: 641px) and (max-height: 920px) {
  .shop-modal__card { gap: 0.55rem; padding-top: 0.8rem; }
  .shop-head__face { width: 52px; height: 52px; }
  .shop-card { min-height: 0; gap: 0.25rem; }
  .shop-card .levelup-card__icon-wrap { aspect-ratio: auto; height: 64px; }
  .shop-card .levelup-card__icon { width: 56px; height: 56px; object-fit: contain; }
  .shop-card .levelup-card__cat { font-size: 0.62rem; }
  .shop-modal--intro .shop-head__line { display: none; }
  .shop-modal--intro .shop-sig { display: none; }
  .shop-modal--intro .shop-body { grid-template-columns: minmax(0, 1fr); }
  .shop-intro { padding: 0.35rem 0.6rem; }
}

/* SPEC-130: 「ギフト券支払いを優先」 (= 手持ちの欄の中。 券を持っているときだけ) */
.shop-giftpref {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 0.62rem; line-height: 1.2; color: #9be7ff; cursor: pointer; text-align: left;
}
.shop-giftpref.hidden { display: none; }
.shop-giftpref input { width: 14px; height: 14px; margin: 0; flex: 0 0 auto; accent-color: #9be7ff; cursor: pointer; }
@media (max-width: 640px) {
  .shop-giftpref { font-size: 0.58rem; gap: 3px; }
  .shop-giftpref input { width: 12px; height: 12px; }
}

/* 空いた枠 (= お断りした・並べる品が尽きた。 作者 2026-10-24: 枠の数を見えるままにする) */
.shop-offer--empty .shop-offer__soldcard { opacity: 0.7; font-weight: 600; }

/* ============================================================
   SPEC-168: チームの 3 列 (= メインの固有スキル・サブ 1 の武器・サブ 2 の武器)。 横いっぱいに、 品の上
   ============================================================ */
.shop-body:has(.shop-sig--team) { grid-template-columns: minmax(0, 1fr); }
.shop-body:has(.shop-sig--team) > .shop-grid { grid-row: 2; }
.shop-sig.shop-sig--team {
  grid-column: 1; grid-row: 1;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; align-items: stretch;
  padding: 0.4rem;
  margin-bottom: 0.5rem;   /* 下の札の角のボタン (= 取り置き・お断り) が上にはみ出すぶん */
}
.shop-sig--team .shop-sig__cell {
  display: flex; flex-direction: column; gap: 0.3rem; min-width: 0;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
  background: rgba(20, 16, 30, 0.55);
  border: 1px solid rgba(187, 134, 252, 0.35);
}
.shop-sig--team .shop-sig__cell--sub { border-color: rgba(255, 92, 92, 0.45); }
.shop-sig--team .shop-sig__head { align-items: flex-start; gap: 0.3rem; }
.shop-sig--team .shop-sig__face { width: 36px; height: 36px; }
.shop-sig__subface { position: relative; flex: 0 0 auto; display: inline-block; margin-right: 8px; }
.shop-sig__weapon { position: absolute; right: -9px; bottom: -3px; width: 18px; height: 18px; image-rendering: pixelated; filter: drop-shadow(0 0 2px #000); }
.shop-sig--team .shop-sig__title { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; }
.shop-sig--team .shop-sig__kicker { display: block; font-size: 0.55rem; letter-spacing: 0.1em; }
.shop-sig--team .shop-sig__cell--sub .shop-sig__kicker { color: #ff8a8a; }
.shop-sig--team .shop-sig__name { font-size: 0.72rem; line-height: 1.2; overflow-wrap: anywhere; }
.shop-sig--team .shop-sig__lv { font-size: 0.66rem; }
.shop-sig--team .shop-sig__rows { flex: 1 1 auto; gap: 0.1rem; }
.shop-sig--team .shop-sig__rows li { font-size: 0.6rem; gap: 0.2rem; }
.shop-sig--team .shop-sig__buy { padding: 0.3rem 0.15rem; font-size: 0.7rem; white-space: nowrap; }
.shop-sig--team .shop-sig__note { display: none; }
@media (max-width: 640px) {
  .shop-sig.shop-sig--team { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0.3rem; gap: 0.3rem; }
  .shop-sig--team .shop-sig__head, .shop-sig--team .shop-sig__rows, .shop-sig--team .shop-sig__buy { grid-column: auto; grid-row: auto; }
  .shop-sig--team .shop-sig__face { width: 30px; height: 30px; }
  .shop-sig--team .shop-sig__title { flex-direction: column; }
}

/* ============================================================
   SPEC-176: Extra パネル (= 通常の品が尽きたら。 エネミーとシャドーヒーローの絵)
   ============================================================ */
.shop-grid[data-n="extra"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.shop-extra__head {
  grid-column: 1 / -1; display: flex; align-items: baseline; gap: 0.6rem;
  padding: 0.3rem 0.6rem; border-radius: 6px;
  background: linear-gradient(90deg, rgba(200, 30, 50, 0.55), rgba(20, 10, 20, 0.2));
  border: 1px solid rgba(255, 120, 120, 0.6);
}
.shop-extra__head b { font: 900 1rem/1 "Chakra Petch", system-ui, sans-serif; letter-spacing: 0.2em; color: #ffd400; }
.shop-extra__head span { font-size: 0.75rem; color: #ffe; }
.shop-extra {
  appearance: none; cursor: pointer; text-align: center; color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  padding: 0.45rem 0.35rem 0.4rem; border-radius: 8px;
  background: linear-gradient(180deg, rgba(120, 20, 30, 0.35), rgba(20, 14, 24, 0.92) 55%);
  border: 1.5px solid rgba(255, 110, 110, 0.5);
}
.shop-extra.is-on { border-color: #ffd400; box-shadow: 0 0 10px rgba(255, 212, 0, 0.35); }
.shop-extra.is-short { filter: grayscale(0.6); opacity: 0.75; }
.shop-extra.is-max { cursor: default; opacity: 0.85; }
.shop-extra__icon { width: 56px; height: 56px; image-rendering: pixelated; object-fit: contain; filter: drop-shadow(0 0 4px rgba(255, 60, 60, 0.6)); }
.shop-extra__name { font-weight: 800; font-size: 0.82rem; line-height: 1.2; }
.shop-extra__lv { font-size: 0.7rem; font-weight: 800; color: #ffd400; }
.shop-extra__what { font-size: 0.62rem; color: var(--muted); line-height: 1.2; }
.shop-extra__val { font-size: 0.72rem; color: #ffb3b3; }
.shop-extra__score { font-size: 0.66rem; color: #c9ffb0; }
.shop-extra__price { margin-top: auto; width: 100%; padding: 0.2rem 0; border-radius: var(--r-pill); font-weight: 800; font-size: 0.8rem; color: #1a1420; background: linear-gradient(180deg, #ffe38a, #e0a922); }
.shop-extra.is-short .shop-extra__price { background: #555; color: #ccc; }
@media (max-width: 640px) {
  .shop-grid[data-n="extra"] { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.3rem; }
  .shop-extra { padding: 0.3rem 0.2rem; }
  .shop-extra__icon { width: 40px; height: 40px; }
  .shop-extra__name { font-size: 0.66rem; }
  .shop-extra__what, .shop-extra__score { font-size: 0.54rem; }
  .shop-extra__val, .shop-extra__lv { font-size: 0.6rem; }
  .shop-extra__price { font-size: 0.66rem; }
}
