/* =========================================================
   prestige.css
   ---------------------------------------------------------
   周回（Prestige）システム関連UI：
   転生ヒント・転生ボタン・リザルトモーダル・
   サポートキャラクターカード
   ========================================================= */

/* ── クリックエリア内 転生ヒント / ボタン ── */
.prestige-hint {
  margin-top: 8px;
  font-size: 0.8rem;
  color: #b07800;
  text-align: center;
  flex-shrink: 0;
}

.prestige-btn {
  margin-top: 8px;
  padding: 10px 24px;
  min-height: 44px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd166, #ff9f4b);
  color: #7a3e00;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 159, 75, 0.5);
  touch-action: manipulation;
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

.prestige-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 159, 75, 0.6);
}

.prestige-btn:active { transform: scale(0.96); }

.prestige-slot-info {
  margin-top: 6px;
  width: min(280px, 80%);
  flex-shrink: 0;
}

.prestige-slot-label {
  font-size: 0.75rem;
  color: #7a7a7a;
  text-align: center;
  margin-bottom: 3px;
}

.prestige-slot-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e0e0e0;
  overflow: hidden;
}

.prestige-slot-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd166, #ff9f4b);
  transition: width 0.2s ease-out;
}

/* ── 転生リザルトモーダル ── */
/* display: none / flex はクラスで制御する */
.prestige-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  /* 初期状態は非表示。JS から style.display を直接操作する代わりに
     .hidden クラスで制御するが、既存コードとの互換のため
     style.display="flex"/"none" も引き続き機能する */
}

.prestige-modal {
  width: min(92vw, 480px);
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fffaf0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

/* 表示直後の連打による誤クリックを防ぐための一時的なクリック無効化 */
.prestige-modal.click-guard {
  pointer-events: none;
}

.prestige-modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #e07b00;
  text-align: center;
  margin-bottom: 14px;
}

.prestige-modal-summary { margin-bottom: 16px; }

.prestige-modal-note {
  font-size: 0.9rem;
  color: #2c5f8d;
  font-weight: bold;
  text-align: center;
  margin-bottom: 12px;
}

.prestige-confirm-btn {
  display: block;
  width: 100%;
  padding: 12px;
  min-height: 44px;
  border: none;
  border-radius: 8px;
  background: #4b8bea;
  color: white;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  touch-action: manipulation;
}

/* ── 転生確認モーダル：キャンセル／転生する の2ボタン並び ── */
.prestige-confirm-actions {
  display: flex;
  gap: 10px;
}

.prestige-confirm-actions .prestige-confirm-btn {
  flex: 1;
}

.prestige-cancel-btn {
  display: block;
  flex: 1;
  padding: 12px;
  min-height: 44px;
  border: 2px solid #ccc;
  border-radius: 8px;
  background: #f5f5f5;
  color: #555;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  touch-action: manipulation;
}

/* ── サポートキャラ合計ボーナス表示 ── */
.passive-bonus-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: linear-gradient(135deg, #eef4ff, #f7faff);
  border: 2px solid #cddffb;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.passive-bonus-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.passive-bonus-label {
  font-size: 0.85rem;
  font-weight: bold;
  color: #2c5f8d;
}

.passive-bonus-value {
  font-size: 0.9rem;
  font-weight: bold;
  color: #4b8bea;
}

/* ── サポートキャラクターカードグリッド ── */
.passive-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.passive-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #fafafa;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 10px 8px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  overflow: hidden;
}

.passive-card.selectable {
  cursor: pointer;
  touch-action: manipulation;
}

.passive-card.selectable:hover {
  border-color: #4b8bea;
  box-shadow: 0 3px 10px rgba(75, 139, 234, 0.25);
  transform: translateY(-2px);
}

/* 複数選択UI：選択中のカードを緑の縁取りで強調する */
.passive-card.selectable.selected {
  border-color: #2ecc71;
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.35);
}

.prestige-confirm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#prestigeMultiPickConfirmBtn {
  margin-top: 12px;
}

/* N : デフォルトのまま（変更なし） */

/* R : 青みがかった光沢 */
.passive-card.rarity-R {
  background: linear-gradient(160deg, #e8f3ff 0%, #f5faff 60%, #ddeeff 100%);
  border-color: #4a90d9;
  box-shadow: 0 2px 8px rgba(74, 144, 217, 0.18);
}

/* SR : 紫の深みある輝き */
.passive-card.rarity-SR {
  background: linear-gradient(160deg, #f3eaff 0%, #faf5ff 55%, #e8d8ff 100%);
  border-color: #9b59b6;
  box-shadow: 0 3px 12px rgba(155, 89, 182, 0.25);
}

/* SSR : 金のゴージャス感 */
.passive-card.rarity-SSR {
  background: linear-gradient(160deg, #fff8e1 0%, #fffdf5 50%, #fff0b0 100%);
  border-color: #e0a800;
  box-shadow: 0 4px 16px rgba(224, 168, 0, 0.3);
}
.passive-card.rarity-SSR::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-linear-gradient(
    120deg,
    transparent 0px,
    transparent 18px,
    rgba(255, 220, 80, 0.07) 18px,
    rgba(255, 220, 80, 0.07) 20px
  );
  pointer-events: none;
}

/* UR : レインボーホログラム風 */
.passive-card.rarity-UR {
  background: linear-gradient(160deg, #fff0f2 0%, #fff8f0 30%, #fffde8 55%, #f0fff8 75%, #f0f4ff 100%);
  border-width: 2px;
  border-style: solid;
  border-color: transparent;
  border-image: linear-gradient(135deg, #ff6578, #ffd166, #a8edca, #89c4f4, #d5a0ff) 1;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(255, 101, 120, 0.25), 0 0 12px rgba(255, 209, 102, 0.2);
}
.passive-card.rarity-UR::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-linear-gradient(
    105deg,
    transparent 0px,
    transparent 12px,
    rgba(255, 255, 255, 0.18) 12px,
    rgba(255, 255, 255, 0.18) 14px
  );
  pointer-events: none;
}

.passive-card-icon .item-icon-image {
  width: 56px;
  height: 56px;
  margin-bottom: 6px;
}

.passive-card-name {
  font-weight: bold;
  font-size: 0.85rem;
  color: #2c2c2c;
  overflow-wrap: break-word;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.passive-card-rarity {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
  color: white;
  flex-shrink: 0;
}

.passive-card-rarity.rarity-N   { background: #9e9e9e; }
.passive-card-rarity.rarity-R   { background: #4a90d9; }
.passive-card-rarity.rarity-SR  { background: #9b59b6; }
.passive-card-rarity.rarity-SSR { background: #f39c12; }
.passive-card-rarity.rarity-UR  { background: linear-gradient(135deg, #ff6578, #ffd166); }

.passive-card-desc {
  font-size: 0.72rem;
  color: #777;
  overflow-wrap: break-word;
  width: 100%;
}

/* ── 転生候補：所持済みキャラ→特殊サポートアイテムへの変換候補 ── */
/* キャラクターカードの見た目をベースに、所持済み・変換候補であることが
   ひと目で分かるよう、グレー基調＋斜線パターンでトーンを落とす */
.passive-card.owned-conversion {
  background: repeating-linear-gradient(
    135deg,
    #f0f0f0,
    #f0f0f0 10px,
    #e6e6e6 10px,
    #e6e6e6 20px
  );
  border-color: #9aa0a6;
  opacity: 0.92;
}

.passive-card.owned-conversion .passive-card-icon .item-icon-image {
  filter: grayscale(70%);
}

.passive-card.owned-conversion .passive-card-desc {
  color: #4b6b3a;
  font-weight: bold;
}

.passive-card-owned-badge {
  position: absolute;
  top: 4px;
  right: -22px;
  transform: rotate(40deg);
  background: #6b6f76;
  color: white;
  font-size: 0.62rem;
  font-weight: bold;
  padding: 2px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

/* 特殊サポートアイテムの重複入手数バッジ（例：×2）。
   「所持済み」リボン（右上）と重ならないよう左上に大きく目立たせて置く */
.passive-card-multiply-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: linear-gradient(135deg, #ff9f4b, #ff6b6b);
  color: white;
  font-size: 0.9rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 10px;
  box-shadow: 0 2px 6px rgba(255, 107, 107, 0.45);
  pointer-events: none;
  z-index: 1;
}

/* 説明文中の個数部分も大きく色付けして強調する */
.passive-card-multiply-count {
  font-size: 1.05em;
  font-weight: 800;
  color: #e05a00;
}

/* ── 特殊サポートアイテムカードグリッド（サポートタブ） ── */
/* キャラクターカードとは別種のデータであることが分かるよう、
   写真ではなくアイコン（絵文字）＋点線ボーダーの独自デザインにする */
.passive-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.passive-item-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(160deg, #fff7e6 0%, #fffaf0 60%, #ffefc9 100%);
  border: 2px dashed #d9a441;
  border-radius: 10px;
  padding: 10px 8px;
  overflow: hidden;
}

.passive-item-icon {
  font-size: 1.8rem;
  line-height: 1;
  margin-bottom: 6px;
}

.passive-item-name {
  font-weight: bold;
  font-size: 0.85rem;
  color: #7a5300;
  overflow-wrap: break-word;
  width: 100%;
}

.passive-item-desc {
  font-size: 0.72rem;
  color: #8a6a2f;
  overflow-wrap: break-word;
  width: 100%;
  margin-top: 4px;
}

.passive-item-count-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #d9a441;
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  border-radius: 999px;
  padding: 1px 7px;
}
