/* =====================
   ITEM 共通
===================== */

.item-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* =====================
   アイテムカード
===================== */

.item-card {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

/* 上段 */
.item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.item-kind {
  font-size: 15px;
  font-weight: 700;
  color: #ffd45c;
}

.item-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.item-status.active {
  background: rgba(45, 255, 122, 0.2);
  color: #2dff7a;
}

.item-status.burned {
  background: rgba(255, 118, 117, 0.2);
  color: #ff7675;
}

/* 中段 */
.item-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-price {
  font-size: 22px;
  font-weight: 800;
  color: #2dff7a;
}

.item-cycle {
  font-size: 12px;
  opacity: 0.75;
}

/* 下段 */
.item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-next {
  font-size: 11px;
  opacity: 0.7;
}

.item-action-btn {
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #003b2b;
  background: linear-gradient(135deg, #1fff9b, #22e6ff);
}

/* =====================
   抽選カード
===================== */

.lottery-card {
  max-width: 420px;
  margin: 24px auto;
  padding: 20px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.lottery-group {
  margin-bottom: 18px;
}

.lottery-label {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
  color: #aefde1;
}

.lottery-select {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: none;
  padding: 0 14px;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.lottery-info {
  font-size: 13px;
  text-align: center;
  color: #ffd45c;
}

/* =====================
   履歴（アイテム用）
===================== */

#itemHistoryList {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.item-history {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-history-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item-history-title {
  font-size: 14px;
  font-weight: 600;
  color: #2cffc9;
}

.item-history-date {
  font-size: 11px;
  opacity: 0.7;
}

.item-history-value {
  font-size: 18px;
  font-weight: 700;
  color: #2dff7a;
}

/* 種類別カラー */
.item-history.evolve .item-history-title {
  color: #ffd45c;
}

.item-history.split .item-history-title {
  color: #ff9f43;
}

.item-history.grow .item-history-title {
  color: #2cffc9;
}

/* =====================
   モーダル（アイテム操作）
===================== */

#itemActionModal .modal-card {
  text-align: center;
}

#itemActionModal .confirm {
  width: 100%;
  height: 44px;
  border-radius: 999px;
  border: none;
  margin-top: 10px;
  background: linear-gradient(135deg, #1fff9b, #22e6ff);
  color: #003b2b;
  font-weight: 700;
}

/* =====================
   スクロール + CTA被り防止
===================== */

#tab-items,
#tab-buy,
#tab-sell,
#tab-list,
#tab-request,
#tab-lottery,
#gold-tab,
#tab-history {
  padding-bottom: 140px;
}
/* =====================
   ITEMレイアウト調整
===================== */

.item-card {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.item-row {
  display: flex;
  gap: 14px;
  align-items: center;
}

.item-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.item-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-kind {
  font-size: 15px;
  font-weight: 700;
  color: #ffd45c;
}

.item-status {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(45, 255, 122, 0.18);
  color: #2dff7a;
  font-weight: 700;
}

.item-mid {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-price {
  font-size: 22px;
  font-weight: 800;
  color: #2dff7a;
}

.item-cycle-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #22e6ff, #1fff9b);
  color: #003b2b;
  font-weight: 800;
}

.item-next {
  font-size: 11px;
  opacity: 0.75;
}

.item-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.item-action-btn {
  border: none;
  border-radius: 999px;
  padding: 6px 16px;
  background: linear-gradient(135deg, #1fff9b, #22e6ff);
  color: #003b2b;
  font-weight: 700;
}
/* バッジ系を縦中央で揃える */
.item-status,
.item-cycle-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px; /* 高さを固定 */
  line-height: 1;
  padding: 0 10px;
}

/* 上段（名前＋ACTIVE）を揃える */
.item-top {
  display: flex;
  align-items: center; /* ← これ重要 */
}

/* 中段（価格＋cycle）も揃える */
.item-mid {
  display: flex;
  align-items: center; /* ← これ重要 */
}
/* 横並びの親 */
.item-row {
  display: flex;
  align-items: center; /* ← 縦中央 */
  gap: 14px;
}

/* 右側テキストブロック */
.item-main {
  display: flex;
  flex-direction: column;
  justify-content: center; /* ← 縦中央 */
  flex: 1;
}

/* 上段（名前＋ACTIVE） */
.item-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 中段（価格＋cycle） */
.item-mid {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* バッジ共通 */
.item-status,
.item-cycle-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  line-height: 1;
  padding: 0 10px;
}
/* === ITEM CARD LAYOUT FIX === */

.item-card {
  padding: 14px 16px;
}

/* 横並びの親 */
.item-row {
  display: flex;
  align-items: center; /* ← 縦中央 */
  gap: 14px;
}

/* アイコン */
.item-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* 右側テキストブロック */
.item-main {
  display: flex;
  flex-direction: column;
  justify-content: center; /* ← 縦中央 */
  gap: 4px;
}

/* 上段：名前＋ACTIVE */
.item-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 中段：価格＋cycle */
.item-mid {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ACTIVEバッジ */
.item-status {
  background: #1faa59;
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 8px;
  line-height: 1;
}

/* cycleバッジ */
.item-cycle-badge {
  background: #00f2a6;
  color: #003b2f;
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 8px;
  line-height: 1;
}

/* 金額 */
.item-price {
  font-size: 18px;
  font-weight: bold;
  color: #00ff9c;
}

/* 次の成長 */
.item-next {
  font-size: 11px;
  opacity: 0.8;
}
/* 強制上書き（ズレ修正） */
.item-top {
  display: flex;
  align-items: center;
  justify-content: flex-start !important; /* ← space-between殺す */
  gap: 8px;
}

.item-mid {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

/* item-main 自体を中央寄せ */
.item-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* バッジ高さ統一 */
.item-status,
.item-cycle-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  line-height: 1;
}
/* 上段：名前＋ACTIVE → ACTIVEを右寄せ */
.item-top {
  display: flex;
  align-items: center;
}

.item-kind {
  flex: 1; /* 名前を左側いっぱいに */
}

.item-status {
  margin-left: auto; /* ACTIVEを右端へ */
}

/* 中段：価格＋cycle → cycleを右寄せ */
.item-mid {
  display: flex;
  align-items: center;
}

.item-price {
  flex: 1; /* 価格を左 */
}

.item-cycle-badge {
  margin-left: auto; /* cycleを右端へ */
}
/* 抽選カード */
.lottery-card {
  background: rgba(0, 0, 0, 0.45);
  border-radius: 20px;
  padding: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 25px rgba(0, 255, 200, 0.15);
  margin: 16px;
}

/* select */
.lottery-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 12px;
  padding: 14px;
  color: #00ffcc;
  font-size: 16px;
  outline: none;
}

/* option（白対策） */
.lottery-select option {
  background: #0a0f1c;
  color: #00ffcc;
}

/* 説明行 */
.lottery-info {
  margin-top: 10px;
  font-size: 14px;
  color: #fff;
  opacity: 0.85;
}

/* 費用表示 */
.lottery-cost {
  margin-top: 10px;
  font-size: 15px;
  color: #00ff99;
}

/* 残高カード */
.balance-card {
  margin: 20px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: space-between;
}

.gacha-overlay.hidden,
.gacha-result.hidden {
  display: none;
}

.gacha-light {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  box-shadow: 0 0 60px #00ffcc;
  background: radial-gradient(circle at center, #00ffd5 0%, transparent 60%);
  filter: blur(2px);
}

.gacha-text {
  margin-top: 30px;
  color: #00ffcc;
  font-size: 18px;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

/* 結果 */
.gacha-result {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.result-card {
  background: linear-gradient(135deg, #0ff, #06f);
  padding: 30px;
  border-radius: 20px;
  text-align: center;
  color: #fff;
  width: 80%;
}
.lottery-card {
  margin: 20px auto;
  width: 90%;
  max-width: 420px;
}

.gp-balance {
  padding: 12px 14px 20px;
  margin: 16px auto;
  width: 90%;
  max-width: 420px;
}

.gacha-light {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle at center, #00ffd5 0%, transparent 60%);
  filter: blur(2px);
}

@keyframes pulseGlow {
  0% {
    transform: scale(0.7);
    opacity: 0.4;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0.7);
    opacity: 0.4;
  }
}

.gacha-text {
  position: absolute;
  margin-top: 260px;
  color: #00ffd5;
  font-weight: bold;
  letter-spacing: 2px;
}
#gachaResult .result-card button {
  background: linear-gradient(90deg, #00ffd5, #00bfff);
  border: none;
  border-radius: 999px;
  padding: 10px 28px;
  color: #002b2b;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(0, 255, 213, 0.6);
  transition: all 0.2s ease;
}

#gachaResult .result-card button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(0, 255, 213, 0.9);
}
.gacha-item-img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  animation: pulseGlow 1.6s ease-in-out infinite;
  box-shadow: 0 0 40px rgba(0, 255, 213, 0.9);
}

@keyframes pulseGlow {
  0% {
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0.7;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0.7;
  }
}

/* 結果モーダル画像を中央 */
.result-item-img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: block;
  margin: 0 auto 16px;
  box-shadow: 0 0 40px rgba(0, 255, 213, 0.8);
}
.gacha-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
}
.gacha-circle {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 255, 213, 0.8), rgba(0, 0, 0, 0));
}
.gacha-item-img {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  animation: pulseGlow 1.6s ease-in-out infinite;
}
.confirm {
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease,
    filter 0.1s ease;
  box-shadow: 0 4px 12px rgba(0, 255, 200, 0.3);
}

.confirm:active {
  transform: scale(0.97);
  box-shadow: 0 2px 6px rgba(0, 255, 200, 0.2);
  filter: brightness(0.9);
}
/* 進化・分裂演出 */
.item-card.effect {
  animation: evolveEffect 0.6s ease forwards;
}

@keyframes evolveEffect {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(0, 255, 200, 0);
    opacity: 1;
  }
  40% {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(0, 255, 200, 0.8);
  }
  100% {
    transform: scale(0.95);
    opacity: 0;
    box-shadow: 0 0 40px rgba(0, 255, 200, 1);
  }
}
.gold-history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-card {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 16px;
  padding: 12px 16px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-text {
  font-weight: 600;
}

.history-date {
  font-size: 12px;
  opacity: 0.7;
}
.lottery-card {
  display: flex;
  flex-direction: column;
  align-items: center; /* ← 中央寄せ */
  text-align: center; /* ← テキスト中央 */
  padding: 24px;
}

.lottery-item-img {
  width: 96px;
  height: auto;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 8px rgba(0, 255, 200, 0.5));
}

.lottery-kind {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 6px;
}

.lottery-rate {
  margin-top: 8px;
  font-size: 14px;
  opacity: 0.9;
}

.lottery-cost {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: #00ffcc;
}
/* =========================
   基準サイズ
========================= */
:root {
  --card-height: 140px; /* ← ここを変えるだけで全体が連動 */
}

/* =========================
   Item Card
========================= */
.item-card {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 14px;

  display: flex;
  align-items: center;
  gap: 16px;

  min-height: var(--card-height);
}

/* =========================
   Item Icon（カード高さに比例）
========================= */
.item-icon {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}
:root {
  --card-height: 140px;
}

/* カード */
.item-card {
  min-height: var(--card-height);
}

/* style.css を上書き */
.item-card img.item-icon {
  width: calc(var(--card-height) * 1);
  height: calc(var(--card-height) * 1);
  border-radius: 50%;
  object-fit: cover;
  margin-right: 0; /* 既存の 12px を消す場合 */
}
.item-sell-btn {
  margin-top: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 0.05em;
  color: #002b1f;
  background: linear-gradient(135deg, #00ffd5, #00ff88);
  box-shadow: 0 0 12px rgba(0, 255, 200, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
}

.item-sell-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 18px rgba(0, 255, 200, 0.8);
}

.item-sell-btn:active {
  transform: scale(0.95);
}
.sell-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.sell-modal.hidden {
  display: none;
}

.sell-modal-card {
  width: 85%;
  max-width: 320px;
  background: linear-gradient(
    135deg,
    rgba(20, 30, 60, 0.9),
    rgba(10, 10, 30, 0.9)
  );
  border-radius: 18px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
  color: white;
}

.sell-modal-card h3 {
  margin-bottom: 10px;
  font-size: 18px;
  color: #00ffd5;
  text-shadow: 0 0 6px rgba(0, 255, 213, 0.8);
}

.sell-modal-info {
  margin: 12px 0;
  font-size: 14px;
  line-height: 1.6;
}

.sell-modal-info span {
  color: #00ff99;
  font-weight: bold;
}

.sell-modal-actions {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sell-confirm-btn {
  padding: 10px;
  border-radius: 999px;
  border: none;
  font-weight: bold;
  background: linear-gradient(135deg, #00ffd5, #00ff88);
  color: #002b1f;
  box-shadow: 0 0 12px rgba(0, 255, 200, 0.5);
  cursor: pointer;
}

.sell-cancel-btn {
  padding: 10px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #555, #222);
  color: #fff;
  cursor: pointer;
}
