/**
 * gacha.css
 * ガチャシステム専用スタイル
 * style.css から分離したガチャ関連の全スタイルを管理する
 */

/* ================================================
 * メインコンテナ
 * ================================================ */
.gacha-container {
  position: relative;
  max-width: 650px;
  margin: 50px auto;
  padding: 50px 25px 35px;
  background-color: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* ================================================
 * ヘッダー：ポイント表示・リセットボタン
 * ================================================ */
.gacha-points-wrapper {
  position: absolute;
  top: 10px;
  right: 25px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
  height: 40px;
}

.gacha-points-badge {
  background-color: #02b340;
  color: #fff;
  padding: 6px 12px;
  min-height: 36px;
  min-width: 130px;
  width: 130px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(152, 217, 142, 0.4);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  will-change: auto;
  transform: translateZ(0);
  line-height: 1;
  overflow: hidden;
}

/* 100万PT以上で幅を拡張 */
.gacha-points-badge[data-large="true"] {
  width: 150px;
  font-size: 16px;
}

.gacha-pt-text,
[class*="-pt-text"] {
  font-size: 12px;
  margin-left: 2px;
  display: inline-block;
  vertical-align: baseline;
}

.gacha-reset-btn {
  font-size: 14px;
  font-weight: bold;
  padding: 8px 16px;
  min-width: 120px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  background-color: #fff;
  color: #02b340;
  border: none;
  position: relative;
  top: 0;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 0 #d0d0d0, 0 5px 10px rgba(0, 0, 0, 0.2);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}
.gacha-reset-btn:hover {
  background-color: #f8fff8;
  box-shadow: 0 4px 0 #d0d0d0, 0 6px 14px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}
.gacha-reset-btn:active {
  top: 2px;
  box-shadow: 0 2px 0 #d0d0d0, 0 3px 6px rgba(0, 0, 0, 0.15);
}
.gacha-reset-btn:focus {
  outline: 3px solid rgba(2, 179, 64, 0.5);
  outline-offset: 2px;
}

/* ================================================
 * 賞品表示エリア
 * ================================================ */
.gacha-prize-text {
  font-size: 36px;
  font-weight: 900;
  color: #ff4500;
  text-align: center;
  margin: 25px 0 15px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.gacha-prize-images {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 30px auto 40px;
}
.gacha-prize-images .gacha-prize-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.gacha-prize-item {
  position: relative;
  display: inline-block;
}
.gacha-prize-item img {
  display: block;
  background-color: #ffffff;
  padding: 8px;
  border-radius: 8px;
  max-width: 260px;
  min-width: 160px;
  height: auto;
  object-fit: contain;
}

/* 枚数バッジ */
.gacha-prize-item::after {
  content: "×" attr(data-count);
  position: absolute;
  bottom: 16px;
  right: 16px;
  background-color: #02b340;
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  padding: 5px 12px;
  border-radius: 6px;
  border: 2px solid #02b340;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 5;
  letter-spacing: 0.05em;
}

/* ================================================
 * コスト・残口数表示エリア
 * ================================================ */
.gacha-cost-wrapper {
  text-align: center;
  margin: 25px 0;
  padding: 20px;
  background: #02b340;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(152, 217, 142, 0.3);
}

/* ガチャページではピンクを上書き */
.gacha-container .gacha-cost-wrapper {
  background: #ff69b4;
  border: 4px solid #ff69b4;
  box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
}

.gacha-cost-text {
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.4;
  display: block;
}
.gacha-cost-amount {
  font-size: 32px;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  display: inline-block;
  min-width: 60px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.gacha-remaining-text {
  font-size: 18px;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.4;
  display: block;
}
.gacha-remaining,
.gacha-total {
  font-weight: bold;
  font-size: 32px;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  display: inline-block;
  min-width: 50px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.gacha-progress-bar {
  width: 100%;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}
.gacha-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #33cc66, #28a650);
  border-radius: 10px;
  transition: width 0.3s;
}

/* ================================================
 * ボタン共通レイアウト
 * ================================================ */
.gacha-button-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin: 15px 0;
}

/* メインガチャボタン */
.gacha-main-button {
  font-size: 26px;
  font-weight: 900;
  padding: 16px 40px;
  min-height: 60px;
  min-width: 240px;
  border-radius: 12px;
  background-color: #02b340;
  color: white;
  border: none;
  box-shadow: 0 6px 0 #018a30, 0 8px 15px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.2s;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3), 0 0 10px rgba(255, 255, 255, 0.2);
  letter-spacing: 0.05em;
  position: relative;
  top: 0;
  -webkit-tap-highlight-color: transparent;
}
.gacha-main-button:hover:enabled {
  background-color: #02b340;
  box-shadow: 0 6px 0 #018a30, 0 10px 20px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}
.gacha-main-button:active:enabled {
  top: 4px;
  box-shadow: 0 2px 0 #018a30, 0 4px 8px rgba(0, 0, 0, 0.2);
}
.gacha-main-button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  box-shadow: 0 4px 0 #999, 0 6px 10px rgba(0, 0, 0, 0.2);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* ポイント変換ボタン */
.gacha-convert-button {
  font-size: 26px;
  font-weight: 900;
  padding: 16px 40px;
  min-height: 60px;
  min-width: 240px;
  border-radius: 12px;
  background-color: #02b340;
  color: white;
  border: none;
  box-shadow: 0 6px 0 #018a30, 0 8px 15px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.2s;
  display: block;
  margin: 14px auto 30px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3), 0 0 10px rgba(255, 255, 255, 0.2);
  letter-spacing: 0.05em;
  position: relative;
  top: 0;
  -webkit-tap-highlight-color: transparent;
}
.gacha-convert-button:hover:enabled {
  background-color: #02b340;
  box-shadow: 0 6px 0 #018a30, 0 10px 20px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}
.gacha-convert-button:active:enabled {
  top: 4px;
  box-shadow: 0 2px 0 #018a30, 0 4px 8px rgba(0, 0, 0, 0.2);
}
.gacha-convert-button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  box-shadow: 0 4px 0 #999, 0 6px 10px rgba(0, 0, 0, 0.2);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  transform: none;
}

/* 演出リプレイボタン */
.gacha-replay-button {
  font-size: 26px;
  font-weight: 900;
  padding: 16px 40px;
  min-height: 60px;
  min-width: 240px;
  border-radius: 12px;
  background-color: #ff69b4;
  color: white;
  border: none;
  box-shadow: 0 6px 0 #d14a8a, 0 8px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
  cursor: pointer;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3), 0 0 10px rgba(255, 255, 255, 0.2);
  letter-spacing: 0.05em;
  position: relative;
  top: 0;
  -webkit-tap-highlight-color: transparent;
}
.gacha-replay-button:hover {
  background-color: #ff69b4;
  box-shadow: 0 6px 0 #d14a8a, 0 10px 20px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}
.gacha-replay-button:active {
  top: 4px;
  box-shadow: 0 2px 0 #d14a8a, 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ================================================
 * ガチャ結果エリア
 * ================================================ */
.gacha-result {
  margin-top: 30px;
}

.gacha-select-all-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  padding: 0 30px;
}
.gacha-select-all-container input[type="checkbox"] {
  width: 24px;
  height: 24px;
  appearance: none;
  background-color: #fff;
  border: 2px solid #02b340;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.gacha-select-all-container input[type="checkbox"]:hover {
  border-color: #02b340;
  box-shadow: 0 0 8px rgba(152, 217, 142, 0.3);
}
.gacha-select-all-container input[type="checkbox"]:checked {
  background-color: #02b340;
  border-color: #02b340;
}
.gacha-select-all-container input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.gacha-select-all-container label {
  font-size: 26px;
  font-weight: bold;
  color: #000;
  cursor: pointer;
  margin: 0;
  -webkit-tap-highlight-color: transparent;
}

/* 結果カード */
.gacha-card {
  max-width: 540px;
  padding: 30px;
  margin: 25px auto;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
  border-radius: 16px;
  background: white;
  transition: all 0.3s;
}
.gacha-card:hover {
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45);
  transform: translateY(-5px);
}

.gacha-card-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 8px;
}

.gacha-card-checkbox {
  width: 24px;
  height: 24px;
  appearance: none;
  background-color: #fff;
  border: 2px solid #02b340;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.gacha-card-checkbox:hover {
  border-color: #02b340;
  box-shadow: 0 0 8px rgba(152, 217, 142, 0.3);
}
.gacha-card-checkbox:checked {
  background-color: #02b340;
  border-color: #02b340;
}
.gacha-card-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.gacha-card-name {
  font-size: 26px;
  font-weight: bold;
  color: #000;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 480px;
  -webkit-tap-highlight-color: transparent;
}
.gacha-card-points {
  font-size: 40px;
  font-weight: 900;
  color: #ff4500;
  text-align: center;
  margin: 12px 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}
.gacha-card img {
  width: 100%;
  max-width: 480px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  background-color: #ffffff;
  padding: 8px;
}

/* ポイント交換レート表示 */
.gacha-exchange-rate {
  text-align: center;
  font-size: 18px;
  margin: 15px 0;
  padding: 12px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #f59e0b;
  border-radius: 8px;
  color: #92400e;
  font-weight: bold;
}

/* ================================================
 * モーダル（確認・交換・結果）
 * ================================================ */
.gacha-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  overflow-y: auto;
}

.gacha-modal {
  background: white;
  padding: 40px 30px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  text-align: center;
  max-width: 90%;
  min-width: 300px;
}
.gacha-modal-text {
  font-size: 20px;
  font-weight: bold;
  color: #333;
  margin-bottom: 25px;
  line-height: 1.6;
  word-wrap: break-word;
  white-space: normal;
}
.gacha-modal-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.gacha-button-cancel,
.gacha-button-confirm {
  font-size: 18px;
  font-weight: bold;
  padding: 12px 30px;
  min-width: 120px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  position: relative;
  top: 0;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.gacha-button-cancel {
  background-color: #e0e0e0;
  color: #333;
  box-shadow: 0 5px 0 #9e9e9e, 0 6px 12px rgba(0, 0, 0, 0.25);
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
}
.gacha-button-cancel:hover {
  background-color: #e8e8e8;
  box-shadow: 0 5px 0 #9e9e9e, 0 8px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}
.gacha-button-cancel:active {
  top: 3px;
  box-shadow: 0 2px 0 #9e9e9e, 0 3px 6px rgba(0, 0, 0, 0.2);
}
.gacha-button-confirm {
  background-color: #02b340;
  color: white;
  box-shadow: 0 5px 0 #018a30, 0 6px 12px rgba(0, 0, 0, 0.25);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}
.gacha-button-confirm:hover {
  background-color: #02c547;
  box-shadow: 0 5px 0 #018a30, 0 8px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}
.gacha-button-confirm:active {
  top: 3px;
  box-shadow: 0 2px 0 #018a30, 0 3px 6px rgba(0, 0, 0, 0.2);
}
.gacha-button-cancel:focus,
.gacha-button-confirm:focus {
  outline: 3px solid rgba(2, 179, 64, 0.5);
  outline-offset: 2px;
}

/* ================================================
 * ガチャ演出オーバーレイ
 * ================================================ */
.gacha-effect-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  flex-direction: column;
  gap: 20px;
}
.gacha-effect-text {
  font-size: 32px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
  animation: pulse 1.5s infinite;
  z-index: 100001;
}
@keyframes pulse {
  0%, 100% { transform: scale(1);   opacity: 1;   }
  50%       { transform: scale(1.1); opacity: 0.8; }
}

.gacha-skip-button {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 16px;
  font-weight: bold;
  padding: 10px 20px;
  background-color: rgba(255, 255, 255, 0.3);
  color: white;
  border: 2px solid white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 100002;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 0 rgba(255, 255, 255, 0.4), 0 5px 15px rgba(0, 0, 0, 0.5);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.gacha-skip-button:hover {
  background-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 0 rgba(255, 255, 255, 0.4), 0 6px 18px rgba(0, 0, 0, 0.6);
  transform: translateY(-1px) scale(1.03);
}
.gacha-skip-button:active {
  top: 22px;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.4), 0 3px 8px rgba(0, 0, 0, 0.4);
}
.gacha-skip-button:focus {
  outline: 3px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

/* 音声ON/OFFボタン */
.gacha-mute-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 15px;
  font-weight: bold;
  padding: 10px 18px;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 100002;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 0 rgba(255, 255, 255, 0.3), 0 5px 15px rgba(0, 0, 0, 0.5);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.gacha-mute-btn:hover {
  background-color: rgba(255, 255, 255, 0.38);
  transform: translateY(-1px) scale(1.03);
}
.gacha-mute-btn:active {
  top: 22px;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.3), 0 3px 8px rgba(0, 0, 0, 0.4);
}
.gacha-mute-btn.is-muted {
  background-color: rgba(255, 80, 80, 0.25);
  border-color: rgba(255, 160, 160, 0.8);
}
@media (max-width: 480px) {
  .gacha-mute-btn { font-size: 13px; padding: 8px 12px; }
}

.gacha-effect-video {
  /* 1本目・2本目でサイズが変わらないよう width/height を固定し object-fit で収める */
  /* 動画が正方形に近いため height を width と同じにしてコンテナを大きく確保する */
  width: min(90vh, 90vw, 860px);
  height: min(90vh, 90vw, 860px);
  object-fit: contain;
  background: #000;           /* レターボックス部分を黒で統一 */
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  z-index: 100000;
  flex-shrink: 0;
  /* AirPlay / リモート再生ボタンを非表示 */
  -webkit-media-controls-wireless-playback-picker: none;
}
/* WebKit系：動画コントロールUI全体を非表示 */
.gacha-effect-video::-webkit-media-controls { display: none !important; }
.gacha-effect-video::-webkit-media-controls-enclosure { display: none !important; }
.gacha-effect-video::-webkit-media-controls-overlay-cast-button { display: none !important; }

/* ================================================
 * PC限定：黒フィルムエフェクト（疑似要素で動画に重ねる）
 * スマホ（768px以下）には適用しない
 * ================================================ */
@media (min-width: 769px) {
  /* オーバーレイを重ねるため動画の親を基準にする */
  .gacha-effect-overlay {
    isolation: isolate;
  }
  /* 動画を ::after で包むためにラッパーに疑似要素を使う。
     video自体には疑似要素が使えないため、
     オーバーレイ全体に半透明の黒フィルムをかける */
  .gacha-effect-overlay::before {
    content: '';
    position: fixed;
    inset: 0;
    /* ざらついた黒フィルム：グレインをSVGで生成しつつ暗めの黒を重ねる */
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E"),
      rgba(0, 0, 0, 0.22);
    background-size: 200px 200px, cover;
    pointer-events: none;
    z-index: 100001; /* 動画(100000)の上、ボタン(100002)の下 */
    mix-blend-mode: multiply;
    animation: bb-film-flicker 0.1s steps(1) infinite;
  }
}

/* フィルムのわずかな明滅 */
@keyframes bb-film-flicker {
  0%   { opacity: 1; }
  92%  { opacity: 1; }
  93%  { opacity: 0.93; }
  94%  { opacity: 1; }
  97%  { opacity: 1; }
  98%  { opacity: 0.96; }
  100% { opacity: 1; }
}

/* ================================================
 * トップページ：ガチャ情報ボックス
 * ================================================ */
.gacha-home-info {
  background: #ff69b4;
  border: 4px solid #ff69b4;
  box-shadow: 0 3px 10px rgba(255, 105, 180, 0.4);
  padding: 14px 18px;
  border-radius: 8px;
  margin-top: 12px;
}
.gacha-home-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-size: 18px;
  line-height: 1.6;
}
.gacha-home-header {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
.gacha-home-label-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.gacha-home-category {
  font-size: 18px;
  color: #ff1493;
  padding: 2px 8px;
  background: #ffffff;
  border-radius: 4px;
  font-weight: 700;
}
.gacha-home-label {
  font-weight: 700;
  font-size: 18px;
  color: #ff1493;
  padding: 2px 8px;
  background: #ffffff;
  border-radius: 4px;
}
.gacha-home-cost {
  font-size: 18px;
  color: #fff;
  white-space: nowrap;
}
.gacha-home-cost-value {
  font-size: 26px;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}
.gacha-home-progress-wrapper {
  margin: 8px 0;
}
.gacha-home-progress-bar {
  width: 80%;
  height: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
  margin: 0 auto;
}
.gacha-home-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #33cc66 0%, #28a650 100%);
  border-radius: 8px;
  transition: width 0.5s ease;
  box-shadow: 0 0 8px rgba(152, 217, 142, 0.6);
}
.gacha-home-remaining {
  font-size: 18px;
  color: #fff;
  width: 100%;
  text-align: center;
}
.gacha-home-remaining-value {
  font-size: 30px;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  font-variant-numeric: tabular-nums;
}

/* ================================================
 * 図鑑ボタン（メインボタンと同サイズ・赤色）
 * ================================================ */
.gacha-main-button.gacha-collection-btn-main {
  font-size: 26px;
  font-weight: 900;
  padding: 16px 40px;
  min-height: 60px;
  min-width: 240px;
  border-radius: 12px;
  background-color: #dc143c !important;
  color: white !important;
  border: none;
  box-shadow: 0 6px 0 #b01030, 0 8px 15px rgba(0, 0, 0, 0.3) !important;
  cursor: pointer;
  transition: all 0.2s;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3), 0 0 10px rgba(255, 255, 255, 0.2);
  letter-spacing: 0.05em;
  position: relative;
  top: 0;
  -webkit-tap-highlight-color: transparent;
}
.gacha-main-button.gacha-collection-btn-main:hover,
.gacha-main-button.gacha-collection-btn-main:hover:enabled {
  background-color: #dc143c !important;
  box-shadow: 0 6px 0 #b01030, 0 10px 20px rgba(0, 0, 0, 0.4) !important;
  transform: translateY(-2px);
}
.gacha-main-button.gacha-collection-btn-main:active,
.gacha-main-button.gacha-collection-btn-main:active:enabled {
  top: 4px;
  box-shadow: 0 2px 0 #b01030, 0 4px 8px rgba(0, 0, 0, 0.2) !important;
}

/* 旧図鑑ボタン（非表示） */
.gacha-collection-btn {
  display: none !important;
}

/* ================================================
 * コレクション（図鑑）モーダル
 * ================================================ */
.gacha-collection-modal {
  background: #ffffff;
  padding: 25px 20px 20px 20px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-width: 90vw;
  max-height: 85vh;
  width: 900px;
  overflow-y: auto;
  position: relative;
  margin: 20px auto;
  z-index: 10001;
}
.gacha-collection-header {
  display: flex !important;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 12px 20px;
  margin-top: 0;
  margin-bottom: 0;
  background-color: #dc143c !important;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}

/* 図鑑ステータスバー */
.gacha-collection-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background-color: #dc143c;
  padding: 6px 20px 2px;
  margin-bottom: 20px;
  border-radius: 0 0 8px 8px;
  flex-wrap: wrap;
}
.gacha-collection-stat-item {
  color: #fff;
  font-size: 17px;
  font-weight: bold;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.gacha-collection-stat-item strong {
  font-size: 20px;
  color: #fff;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}
.gacha-collection-stat-divider {
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
}

/* 図鑑 CODE行 */
.gacha-collection-code-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 0;
  flex-wrap: wrap;
}
.gacha-collection-code-label {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .14em;
  white-space: nowrap;
  flex-shrink: 0;
}
.gacha-collection-code-value {
  font-family: 'Courier New', Consolas, monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #fff;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  padding: 2px 8px;
  word-break: break-all;
  text-align: center;
}

/* 図鑑カードアイテム：Noバッジ */
.gacha-collection-item-no {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #fff;
  margin-right: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 図鑑下部の閉じるボタン */
.gacha-collection-footer {
  display: flex;
  justify-content: center;
  padding: 16px 0 8px;
  margin-top: 8px;
}
.gacha-collection-close-bottom {
  font-size: 18px;
  font-weight: 900;
  padding: 12px 60px;
  min-height: 50px;
  border-radius: 10px;
  background-color: #dc143c;
  color: white;
  border: none;
  box-shadow: 0 5px 0 #b01030, 0 7px 14px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.2s;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.1em;
  position: relative;
  top: 0;
  -webkit-tap-highlight-color: transparent;
  z-index: 100005;
}
.gacha-collection-close-bottom:hover {
  background-color: #c0122e;
  box-shadow: 0 5px 0 #b01030, 0 10px 20px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}
.gacha-collection-close-bottom:active {
  top: 4px;
  box-shadow: 0 2px 0 #b01030, 0 3px 8px rgba(0, 0, 0, 0.2);
  transform: none;
}

/* ================================================
 * コレクション：S賞・A賞グレード表示（取得済みのみ）
 * ================================================ */

/* S賞：金枠・赤テキスト */
.gacha-collection-item.grade-s:not(.locked) {
  box-shadow: 0 0 0 3px #c8960c, 0 4px 12px rgba(200, 150, 12, 0.5);
}
.gacha-collection-item.grade-s:not(.locked) .gacha-collection-item-name {
  background: linear-gradient(135deg, #b8860b, #ffd700, #b8860b);
  color: #cc0000;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}
.gacha-collection-item.grade-s:not(.locked) .gacha-collection-item-no {
  color: #cc0000;
}
.gacha-collection-item.grade-s:not(.locked)::before {
  content: "S賞";
  position: absolute;
  top: 6px;
  left: 6px;
  background: linear-gradient(135deg, #b8860b, #ffd700);
  color: #cc0000;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 4px;
  z-index: 6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
  text-shadow: none;
  letter-spacing: 0.05em;
}

/* A賞：銀枠・青テキスト */
.gacha-collection-item.grade-a:not(.locked) {
  box-shadow: 0 0 0 3px #888, 0 4px 12px rgba(136, 136, 136, 0.5);
}
.gacha-collection-item.grade-a:not(.locked) .gacha-collection-item-name {
  background: linear-gradient(135deg, #606060, #c0c0c0, #606060);
  color: #003399;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}
.gacha-collection-item.grade-a:not(.locked) .gacha-collection-item-no {
  color: #003399;
}
.gacha-collection-item.grade-a:not(.locked)::before {
  content: "A賞";
  position: absolute;
  top: 6px;
  left: 6px;
  background: linear-gradient(135deg, #707070, #c0c0c0);
  color: #003399;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 4px;
  z-index: 6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
  text-shadow: none;
  letter-spacing: 0.05em;
}

/* 図鑑タイトル */
.gacha-collection-title {
  display: block !important;
  font-size: 32px;
  font-weight: 900;
  color: #ffffff !important;
  text-align: center;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  background: none !important;
  border: none !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.05em;
}
.gacha-collection-title::before { content: "🍀 "; margin-right: 8px; }
.gacha-collection-title::after  { content: " 🍀"; margin-left: 8px; }

.gacha-collection-header h2,
.gacha-collection-header h2.gacha-collection-title {
  display: block !important;
  font-size: 32px !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  text-align: center !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  background: none !important;
  border: none !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2) !important;
  letter-spacing: 0.05em !important;
  box-shadow: none !important;
}

.gacha-collection-close {
  position: absolute;
  top: 50% !important;
  right: 20px !important;
  transform: translateY(-50%) !important;
  background: transparent !important;
  color: #fff !important;
  border: none !important;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: 0;
  line-height: 1;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
}
.gacha-collection-close:hover {
  background: transparent !important;
  color: #fff !important;
  transform: translateY(-50%) scale(1.15) !important;
  border: none !important;
  box-shadow: none !important;
}
.gacha-collection-close:active {
  transform: translateY(-50%) scale(1.0) !important;
  box-shadow: none !important;
}
.gacha-collection-close:focus {
  outline: none;
}

/* コレクショングリッド（全サイズで3列） */
.gacha-collection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 15px;
  padding: 10px;
}

.gacha-collection-item {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
}
.gacha-collection-item:hover {
  transform: scale(1.05);
  z-index: 10;
}
.gacha-collection-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 未取得カード：黒塗り */
.gacha-collection-item.locked img {
  visibility: hidden !important;
  filter: none !important;
}
.gacha-collection-item.locked .gacha-collection-item-name {
  visibility: hidden;
}
.gacha-collection-item.locked {
  background-color: #555 !important;
  border-color: #666 !important;
  box-shadow: none !important;
}
.gacha-collection-item.locked::after {
  content: "？";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.15);
  text-shadow: none;
}

/* カード名 */
.gacha-collection-item-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 6px 6px 6px 4px;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* コレクションカードのホバー効果 */
.gacha-collection-item:not(.locked) { cursor: pointer; }
.gacha-collection-item:not(.locked):hover {
  transform: scale(1.08);
  z-index: 10;
  box-shadow: 0 8px 20px rgba(255, 105, 180, 0.5);
}
.gacha-collection-item.locked { cursor: not-allowed; }

/* ================================================
 * 画像拡大モーダル
 * ================================================ */
.gacha-image-zoom-modal {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gacha-image-zoom-modal img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

/* 拡大モーダルの閉じるボタン */
.gacha-image-zoom-close {
  position: absolute;
  top: -15px;
  right: -15px;
  background: #fff;
  border: none;
  color: #333;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  line-height: 1;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  box-shadow: 0 5px 0 #c0c0c0, 0 6px 15px rgba(0, 0, 0, 0.3);
}
.gacha-image-zoom-close:hover {
  background: #ff69b4;
  color: #fff;
  transform: translateY(-2px) scale(1.1) rotate(90deg);
  box-shadow: 0 5px 0 #d14a8a, 0 8px 20px rgba(255, 105, 180, 0.6);
}
.gacha-image-zoom-close:active {
  top: -13px;
  box-shadow: 0 2px 0 #c0c0c0, 0 3px 8px rgba(0, 0, 0, 0.2);
}
.gacha-image-zoom-close:focus {
  outline: 3px solid rgba(255, 105, 180, 0.5);
  outline-offset: 2px;
}

/* ================================================
 * モーダル z-index 調整（グローバルメニュー対策）
 * ================================================ */
.gacha-modal-overlay      { z-index: 99998 !important; }
.gacha-collection-modal   { z-index: 99999 !important; }
.gacha-collection-header  { z-index: 100000 !important; }
.gacha-collection-grid    { z-index: 100000 !important; }
.gacha-collection-item    { z-index: 100001 !important; }
.gacha-collection-item:hover { z-index: 100010 !important; }
.gacha-collection-close   { z-index: 100005 !important; }
.gacha-image-zoom-modal   { z-index: 99999 !important; }
.gacha-image-zoom-close   { z-index: 100005 !important; }

/* モーダル表示中はヘッダーを下げる */
body.gacha-modal-active .header-container,
body.gacha-modal-active .mobile-category-nav { z-index: 1 !important; }
body.gacha-modal-active header,
body.gacha-modal-active nav[style*="position: fixed"],
body.gacha-modal-active [class*="header"],
body.gacha-modal-active [class*="navigation"]  { z-index: 1 !important; }

/* ================================================
 * レスポンシブ：モーダル位置補正
 * ================================================ */
@media screen and (max-width: 768px) {
  .gacha-modal-overlay { align-items: center; padding: 20px; }
}
@media screen and (max-width: 480px) {
  .gacha-modal-overlay { padding: 15px; }
}
@media screen and (max-width: 360px) {
  .gacha-modal-overlay { padding: 10px; }
}

/* ================================================
 * レスポンシブ：ガチャコンテナ全般（767px以下）
 * ================================================ */
@media screen and (max-width: 767px) {
  .gacha-container { padding: 60px 15px 25px; margin: 20px auto; }
  .gacha-points-wrapper { left: 15px; right: 15px; gap: 6px; justify-content: space-between; }
  .gacha-reset-btn { font-size: 11px; padding: 7px 8px; min-width: 100px; min-height: 36px; flex: 0 0 100px; white-space: nowrap; }
  .gacha-points-badge { font-size: 16px; padding: 7px 12px; min-height: 36px; flex: 0 0 auto; }
  .gacha-pt-text { font-size: 11px; }
  .gacha-prize-text { font-size: 28px; margin: 20px 0 10px; }
  .gacha-prize-images { gap: 10px; margin: 20px auto 30px; }
  .gacha-prize-images .gacha-prize-row { gap: 8px; }
  .gacha-prize-images img { background-color: #ffffff; padding: 8px; border-radius: 8px; max-width: 40%; min-width: 100px; }
  .gacha-cost-wrapper { padding: 15px; margin: 20px 0; }
  .gacha-cost-text { font-size: 16px; }
  .gacha-cost-amount { font-size: 28px; }
  .gacha-remaining-text { font-size: 14px; }
  .gacha-button-wrapper { display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; gap: 10px !important; }
  .gacha-main-button    { font-size: 19px; font-weight: 900; padding: 12px 20px; min-height: 52px; min-width: 0; flex: 1; order: 1; box-shadow: 0 4px 0 #02b340, 0 6px 12px rgba(0, 0, 0, 0.3); }
  .gacha-replay-button  { font-size: 19px; font-weight: 900; padding: 12px 20px; min-height: 52px; min-width: 0; flex: 1; order: 2; box-shadow: 0 4px 0 #ff69b4, 0 6px 12px rgba(0, 0, 0, 0.3); }
  .gacha-convert-button { font-size: 19px; font-weight: 900; padding: 12px 20px; min-height: 52px; min-width: 200px; box-shadow: 0 4px 0 #02b340, 0 6px 12px rgba(0, 0, 0, 0.3); }
  .gacha-card { padding: 20px; margin: 20px auto; }
  .gacha-card-name { font-size: 20px; max-width: 280px; }
  .gacha-card-points { font-size: 32px; }
  .gacha-modal { padding: 30px 20px; min-width: 280px; }
  .gacha-modal-text { font-size: 18px; margin-bottom: 20px; line-height: 1.6; word-wrap: break-word; white-space: normal; }
  .gacha-modal-buttons { display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; gap: 10px !important; }
  .gacha-button-cancel,
  .gacha-button-confirm { font-size: 17px !important; padding: 12px 10px !important; min-width: 0 !important; flex: 1 !important; min-height: 50px !important; white-space: nowrap !important; }
  .gacha-select-all-container { padding: 0 20px; margin: 15px 0; }
  .gacha-select-all-container label { font-size: 20px; }
  .gacha-effect-text { font-size: 24px; }
  .gacha-effect-video { width: 96vw !important; height: 96vw !important; }
  .gacha-home-info { padding: 12px 14px; }
  .gacha-home-info-row { font-size: 16px; }
  .gacha-home-label-wrapper { gap: 6px; }
  .gacha-home-category { font-size: 16px; padding: 2px 6px; }
  .gacha-home-label { font-size: 16px; }
  .gacha-home-cost { font-size: 16px; }
  .gacha-home-cost-value { font-size: 22px; }
  .gacha-home-progress-bar { height: 14px; }
  .gacha-home-remaining { font-size: 16px; }
  .gacha-home-remaining-value { font-size: 26px; }
}

/* 480px以下 */
@media screen and (max-width: 480px) {
  .gacha-points-wrapper { position: absolute; top: 10px; right: 10px; left: 10px; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; height: auto; z-index: 10; }
  .gacha-reset-btn { font-size: 11px; font-weight: bold; padding: 6px 10px; min-width: 85px; max-width: 95px; min-height: 32px; height: 32px; white-space: nowrap; flex-shrink: 0; }
  .gacha-points-badge { font-size: 14px; padding: 4px 10px; min-width: 100px; width: auto; max-width: 120px; min-height: 32px; height: 32px; flex-shrink: 0; }
  .gacha-pt-text { font-size: 10px; }
  .gacha-container { padding-top: 80px; }
  .gacha-main-button    { font-size: 19px !important; padding: 11px 24px !important; min-height: 48px !important; min-width: 170px !important; max-width: 85% !important; box-shadow: 0 5px 0 #018a30, 0 6px 12px rgba(0, 0, 0, 0.25) !important; }
  .gacha-main-button:hover:enabled  { box-shadow: 0 5px 0 #018a30, 0 7px 14px rgba(0, 0, 0, 0.3) !important; }
  .gacha-main-button:active:enabled { box-shadow: 0 2px 0 #018a30, 0 3px 6px rgba(0, 0, 0, 0.2) !important; }
  .gacha-convert-button { font-size: 19px !important; padding: 11px 24px !important; min-height: 48px !important; min-width: 170px !important; max-width: 85% !important; box-shadow: 0 5px 0 #018a30, 0 6px 12px rgba(0, 0, 0, 0.25) !important; }
  .gacha-convert-button:hover:enabled  { box-shadow: 0 5px 0 #018a30, 0 7px 14px rgba(0, 0, 0, 0.3) !important; }
  .gacha-convert-button:active:enabled { box-shadow: 0 2px 0 #018a30, 0 3px 6px rgba(0, 0, 0, 0.2) !important; }
  .gacha-replay-button  { font-size: 19px !important; padding: 11px 24px !important; min-height: 48px !important; min-width: 170px !important; max-width: 85% !important; box-shadow: 0 5px 0 #d14a8a, 0 6px 12px rgba(0, 0, 0, 0.25) !important; }
  .gacha-replay-button:hover  { box-shadow: 0 5px 0 #d14a8a, 0 7px 14px rgba(0, 0, 0, 0.3) !important; }
  .gacha-replay-button:active { box-shadow: 0 2px 0 #d14a8a, 0 3px 6px rgba(0, 0, 0, 0.2) !important; }
  .gacha-modal { padding: 30px 15px; max-width: 90%; min-width: 260px; }
  .gacha-modal-text { font-size: 17px; line-height: 1.6; margin-bottom: 20px; white-space: normal; word-wrap: break-word; overflow: visible; }
  .gacha-modal-buttons { gap: 10px; }
  .gacha-button-cancel,
  .gacha-button-confirm { font-size: 17px; padding: 11px 24px; min-width: 100px; min-height: 50px; }
  .gacha-home-info { padding: 10px 12px; }
  .gacha-home-info-row { font-size: 15px; }
  .gacha-home-label-wrapper { gap: 4px; }
  .gacha-home-category { font-size: 15px; padding: 2px 5px; }
  .gacha-home-label { font-size: 15px; }
  .gacha-home-cost { font-size: 14px; }
  .gacha-home-cost-value { font-size: 20px; }
  .gacha-home-progress-bar { height: 12px; }
  .gacha-home-remaining { font-size: 14px; }
  .gacha-home-remaining-value { font-size: 24px; }
  /* 立体効果を調整 */
  .gacha-reset-btn { box-shadow: 0 3px 0 #d0d0d0, 0 4px 8px rgba(0, 0, 0, 0.15); }
  .gacha-reset-btn:hover  { box-shadow: 0 3px 0 #d0d0d0, 0 5px 10px rgba(0, 0, 0, 0.2); }
  .gacha-reset-btn:active { top: 2px; box-shadow: 0 1px 0 #d0d0d0, 0 2px 4px rgba(0, 0, 0, 0.1); }
  .gacha-button-cancel,
  .gacha-button-confirm { box-shadow: 0 4px 0 var(--shadow-color), 0 5px 10px rgba(0, 0, 0, 0.2); }
  .gacha-button-cancel  { --shadow-color: #9e9e9e; }
  .gacha-button-confirm { --shadow-color: #018a30; }
  .gacha-skip-button { box-shadow: 0 3px 0 rgba(255, 255, 255, 0.4), 0 4px 10px rgba(0, 0, 0, 0.4); }
  .gacha-skip-button:active { top: 21px; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4), 0 2px 5px rgba(0, 0, 0, 0.3); }
  .gacha-collection-close { box-shadow: 0 4px 0 #999, 0 5px 12px rgba(0, 0, 0, 0.25); }
  .gacha-collection-close:hover { box-shadow: 0 4px 0 #8b0000, 0 6px 15px rgba(220, 20, 60, 0.5); }
  .gacha-image-zoom-close { box-shadow: 0 4px 0 #c0c0c0, 0 5px 12px rgba(0, 0, 0, 0.25); }
  .gacha-image-zoom-close:hover { box-shadow: 0 4px 0 #d14a8a, 0 6px 15px rgba(255, 105, 180, 0.5); }
}

/* 360px以下 */
@media screen and (max-width: 360px) {
  .gacha-points-wrapper { gap: 4px; right: 8px; left: 8px; }
  .gacha-reset-btn { font-size: 10px; padding: 5px 8px; min-width: 75px; max-width: 85px; min-height: 30px; height: 30px; box-shadow: 0 3px 0 #d0d0d0, 0 4px 7px rgba(0, 0, 0, 0.15); }
  .gacha-reset-btn:hover  { box-shadow: 0 3px 0 #d0d0d0, 0 5px 9px rgba(0, 0, 0, 0.18); }
  .gacha-reset-btn:active { top: 2px; box-shadow: 0 1px 0 #d0d0d0, 0 2px 4px rgba(0, 0, 0, 0.1); }
  .gacha-points-badge { font-size: 13px; padding: 4px 8px; min-width: 90px; max-width: 110px; min-height: 30px; height: 30px; }
  .gacha-pt-text { font-size: 9px; }
  .gacha-container { padding: 85px 15px 25px; }
  .gacha-main-button    { font-size: 17px !important; padding: 10px 20px !important; min-height: 44px !important; min-width: 150px !important; }
  .gacha-convert-button { font-size: 17px !important; padding: 10px 20px !important; min-height: 44px !important; min-width: 150px !important; }
  .gacha-replay-button  { font-size: 17px !important; padding: 10px 20px !important; min-height: 44px !important; min-width: 150px !important; }
  .gacha-modal { padding: 25px 12px; max-width: 92%; min-width: 240px; }
  .gacha-modal-text { font-size: 16px; line-height: 1.6; white-space: normal; word-wrap: break-word; }
  .gacha-button-cancel,
  .gacha-button-confirm { font-size: 16px; padding: 10px 20px; min-width: 90px; min-height: 48px; }
}

/* 481px〜600px（中型スマホ） */
@media screen and (min-width: 481px) and (max-width: 600px) {
  .gacha-points-wrapper { right: 15px; gap: 8px; }
  .gacha-reset-btn { font-size: 12px; padding: 7px 12px; min-width: 100px; }
  .gacha-points-badge { font-size: 16px; min-width: 110px; }
  .gacha-main-button    { font-size: 21px !important; padding: 13px 30px !important; min-height: 52px !important; min-width: 190px !important; }
  .gacha-convert-button { font-size: 21px !important; padding: 13px 30px !important; min-height: 52px !important; min-width: 190px !important; }
  .gacha-replay-button  { font-size: 21px !important; padding: 13px 30px !important; min-height: 52px !important; min-width: 190px !important; }
  .gacha-modal-text { font-size: 18px; }
}

/* 賞品画像のタブレット・スマホ対応 */
@media screen and (max-width: 768px) {
  .gacha-prize-item::after { font-size: 13px; padding: 4px 10px; bottom: 14px; right: 14px; border-width: 1.5px; }
}
@media screen and (max-width: 600px) {
  .gacha-prize-item img   { max-width: 170px; min-width: 110px; }
  .gacha-prize-item::after { font-size: 12px; padding: 3px 8px; bottom: 12px; right: 12px; border-width: 1.5px; }
}
@media screen and (max-width: 400px) {
  .gacha-prize-item img   { max-width: 135px; min-width: 95px; }
  .gacha-prize-item::after { font-size: 11px; padding: 2px 6px; bottom: 10px; right: 10px; border-width: 1px; }
}

/* 画像拡大モーダルのスマホ対応 */
@media screen and (max-width: 768px) {
  .gacha-image-zoom-modal img { max-width: 95vw; max-height: 85vh; }
  .gacha-image-zoom-close { font-size: 28px; width: 40px; height: 40px; top: -10px; right: -10px; }
}

/* ================================================
 * コレクションモーダル：レスポンシブ
 * ================================================ */
@media screen and (max-width: 768px) {
  .gacha-collection-modal {
    width: 95vw; max-width: 95vw;
    max-height: calc(100vh - 160px);
    padding: 15px 12px 60px 12px;
    margin: 142px auto 75px;
    overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .gacha-collection-header { padding: 10px 15px; border-radius: 6px 6px 0 0; }
  .gacha-collection-stats  { padding: 5px 12px 12px; gap: 8px; margin-bottom: 14px; border-radius: 0 0 6px 6px; }
  .gacha-collection-stat-item        { font-size: 13px; }
  .gacha-collection-stat-item strong { font-size: 15px; }
  .gacha-collection-code-value       { font-size: 15px; padding: 2px 8px; }
  .gacha-collection-close-bottom { font-size: 16px; padding: 12px 48px; min-height: 46px; }
  .gacha-collection-title,
  .gacha-collection-header h2,
  .gacha-collection-header h2.gacha-collection-title {
    font-size: 20px !important;
    color: #ffffff !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
  }
  .gacha-collection-title::before { content: "🍀 "; margin-right: 6px; }
  .gacha-collection-title::after  { content: " 🍀"; margin-left: 6px; }
  .gacha-collection-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 10px; }
  .gacha-collection-close { font-size: 28px; width: 44px; height: 44px; right: 12px !important; top: 50% !important; transform: translateY(-50%) !important; padding: 8px; z-index: 10002; }
}

@media screen and (max-width: 480px) {
  .gacha-collection-modal {
    max-height: calc(100vh - 140px);
    padding: 12px 10px 50px 10px;
    margin: 132px auto 65px;
    width: 96vw; max-width: 96vw;
  }
  .gacha-collection-header { padding: 8px 12px; border-radius: 6px 6px 0 0; }
  .gacha-collection-title,
  .gacha-collection-header h2,
  .gacha-collection-header h2.gacha-collection-title {
    font-size: 20px !important;
    color: #ffffff !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
  }
  .gacha-collection-title::before,
  .gacha-collection-title::after { font-size: 18px; }
  .gacha-collection-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 8px; }
  .gacha-collection-close { font-size: 22px; width: 38px; height: 38px; right: 12px !important; }
}

@media screen and (max-width: 360px) {
  .gacha-collection-modal {
    max-height: calc(100vh - 150px);
    padding: 16px 10px 10px 10px;
    margin: 137px auto 70px;
  }
  .gacha-collection-header { padding: 6px 10px; border-radius: 6px 6px 0 0; }
  .gacha-collection-title,
  .gacha-collection-header h2,
  .gacha-collection-header h2.gacha-collection-title {
    font-size: 18px !important;
    color: #ffffff !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
  }
  .gacha-collection-title::before,
  .gacha-collection-title::after { font-size: 16px; }
  .gacha-collection-close { font-size: 20px; width: 36px; height: 36px; right: 10px !important; }
  .gacha-collection-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ================================================
 * タッチデバイス：アクティブ状態をより明確に
 * ================================================ */
@media (hover: none) and (pointer: coarse) {
  .gacha-button-cancel:active,
  .gacha-button-confirm:active,
  .gacha-reset-btn:active,
  .gacha-skip-button:active             { transform: scale(0.97); }
  .gacha-main-button:active:enabled,
  .gacha-convert-button:active:enabled,
  .gacha-replay-button:active           { transform: scale(0.97); }
  .gacha-collection-close:active        { transform: translateY(-50%) scale(0.97) !important; }
  .gacha-collection-close-bottom:active { transform: scale(0.97); }
  .gacha-image-zoom-close:active        { transform: scale(0.97); }
}

/* ================================================
 * 記事カード：gacha-home-info の枠線リセット
 * （トップ・カテゴリー・アーカイブページの border-reset ルールに対応）
 * ================================================ */
.home .gacha-home-info,
.home .gacha-home-info *,
.category .gacha-home-info,
.category .gacha-home-info *,
.archive .gacha-home-info,
.archive .gacha-home-info * {
  border-color: transparent !important;
}

/* ================================================
 * ガチャ演出中：ヘッダー・フッター非表示
 * ================================================ */
body.gacha-playing .footer,
body.gacha-playing footer,
body.gacha-playing .footer-bottom,
body.gacha-playing .footer-container,
body.gacha-playing .site-info,
body.gacha-playing .copyright,
body.gacha-playing .mobile-menu-buttons,
body.gacha-playing .header-container {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  z-index: -1 !important;
}

/* ================================================
 * タップハイライト削除：ガチャカード要素
 * ================================================ */
.gacha-card,
.gacha-card-name,
.gacha-card img {
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}


/* ================================================================
 * トップ・アーカイブ ガチャ/ゲームカード
 * （functions.php の add_gacha_home_inline_assets から移動）
 * ================================================================ */

.gacha-home-info {
  padding: 14px 18px;
  border-radius: 16px !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  border: none !important;
}
/* ホームカードのみピンク */
.gacha-home-info.gacha-card {
  background: #ff69b4 !important;
  box-shadow: 0 3px 10px rgba(255, 105, 180, 0.4) !important;
  padding: 14px 18px !important;
}

/* 排出結果カード：白背景＋立体シャドウ */
.gacha-result .gacha-card {
  background: #ffffff !important;
  box-shadow:
    0 1px 0 rgba(0,0,0,0.03),
    0 4px 0 rgba(0,0,0,0.04),
    0 8px 16px rgba(0,0,0,0.10),
    0 20px 40px rgba(0,0,0,0.08) !important;
  border: 1px solid rgba(0,0,0,0.07) !important;
  padding: 30px !important;
}
.gacha-card .gacha-home-category { color: #ff1493 !important; }
.game-card {
  background: #4da6ff !important;
  box-shadow: 0 3px 10px rgba(77, 166, 255, 0.4) !important;
  padding: 14px 18px 24px !important;
}
.game-card .gacha-home-category { color: #0066cc !important; }

.gacha-home-outer-border {
  border: none !important;
  padding: 0 !important;
  border-radius: 0 0 13px 13px !important;
  margin: 0 !important;
}
.gacha-home-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  color: #fff;
}
.gacha-home-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 8px;
  padding-bottom: 8px;
}
.gacha-home-label-wrapper { display: flex; align-items: center; gap: 8px; }
.gacha-home-category {
  background-color: #ffffff;
  color: #ff1493;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  text-shadow: none;
}
.gacha-home-label {
  background-color: #ffffff;
  color: #ff1493;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  text-shadow: none;
}
.gacha-home-cost { font-size: 18px; font-weight: 300; color: #fff; white-space: nowrap; }
.gacha-home-cost-value { font-size: 26px; font-weight: 700; color: #fff; text-shadow: 1px 1px 2px rgba(0,0,0,0.3); }
.gacha-home-progress-wrapper { margin: 8px 0; }
.gacha-home-progress-bar {
  width: 100%; height: 10px;
  background: rgba(255,255,255,0.3);
  border-radius: 4px; overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}
.gacha-home-progress-fill {
  background: linear-gradient(90deg, #33cc66 0%, #28a650 100%);
  border-radius: 4px; transition: width 0.5s ease;
  box-shadow: 0 0 8px rgba(51,204,102,0.6); height: 100%;
}
.gacha-home-remaining { font-size: 18px; font-weight: 300; color: #fff; width: 100%; text-align: center; }
.gacha-home-remaining-value {
  font-size: 30px; font-weight: 700; color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3); font-variant-numeric: tabular-nums;
}
.gacha-game-description {
  color: #fff; font-size: 26px; font-weight: 700;
  margin-top: 8px; line-height: 0.8; word-break: break-all;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
  white-space: pre-line;
  min-height: 55px;
}

@media screen and (max-width: 767px) {
  .gacha-home-outer-border { padding: 0 !important; margin: 0 !important; }
  .gacha-home-info { padding: 10px 12px !important; }
  .gacha-home-header { margin-bottom: 6px !important; padding-bottom: 6px !important; }
  .gacha-home-info-row { font-size: 14px !important; }
  .gacha-home-label-wrapper { gap: 5px !important; }
  .gacha-home-category, .gacha-home-label { font-size: 13px !important; padding: 2px 5px !important; }
  .gacha-home-cost { font-size: 14px !important; }
  .gacha-home-cost-value { font-size: 18px !important; }
  .gacha-home-progress-wrapper { margin: 6px 0 !important; }
  .gacha-home-progress-bar { height: 6px !important; }
  .gacha-home-remaining { font-size: 16px !important; }
  .gacha-home-remaining-value { font-size: 26px !important; }
  .gacha-card, .game-card { padding: 10px 12px 20px !important; }
  .gacha-game-description { font-size: 18px !important; min-height: 44px !important; }
}
@media screen and (max-width: 480px) {
  .gacha-home-info { padding: 8px 10px !important; }
  .gacha-home-header { margin-bottom: 5px !important; padding-bottom: 5px !important; }
  .gacha-home-info-row { font-size: 12px !important; }
  .gacha-home-label-wrapper { gap: 4px !important; }
  .gacha-home-category, .gacha-home-label { font-size: 11px !important; padding: 1px 4px !important; }
  .gacha-home-cost { font-size: 12px !important; }
  .gacha-home-cost-value { font-size: 16px !important; }
  .gacha-home-progress-wrapper { margin: 5px 0 !important; }
  .gacha-home-progress-bar { height: 5px !important; }
  .gacha-home-remaining { font-size: 14px !important; }
  .gacha-home-remaining-value { font-size: 22px !important; }
  .gacha-card, .game-card { padding: 8px 10px 18px !important; }
  .gacha-game-description { font-size: 16px !important; min-height: 40px !important; }
}
@media screen and (max-width: 360px) {
  .gacha-home-info { padding: 7px 8px !important; }
  .gacha-home-header { margin-bottom: 4px !important; padding-bottom: 4px !important; }
  .gacha-home-info-row { font-size: 11px !important; }
  .gacha-home-label-wrapper { gap: 3px !important; }
  .gacha-home-category, .gacha-home-label { font-size: 10px !important; padding: 1px 3px !important; }
  .gacha-home-cost { font-size: 11px !important; }
  .gacha-home-cost-value { font-size: 14px !important; }
  .gacha-home-progress-wrapper { margin: 4px 0 !important; }
  .gacha-home-progress-bar { height: 4px !important; }
  .gacha-home-remaining { font-size: 13px !important; }
  .gacha-home-remaining-value { font-size: 20px !important; }
  .gacha-card, .game-card { padding: 7px 8px 16px !important; }
  .gacha-game-description { font-size: 14px !important; min-height: 36px !important; }
}