/* ============================================================
   gacha_home.css — ガチャホームページ専用スタイル
   ============================================================ */

/* 3カラムグリッド（コンテンツやや小さめ） */
.gh-layout {
  display: grid;
  grid-template-columns: 160px 1fr 160px;
  gap: 18px;
  max-width: 920px;
  margin: 0 auto;
  padding: 12px 12px 28px;
  width: 100%;
  align-self: start;
  font-size: 0.85em;
}

/* 広告カラム */
.gh-ad-col {
  position: sticky;
  top: calc(var(--header-height, 60px) + 12px);
}

.gh-ad-col .adsbygoogle {
  min-height: 400px;
  width: 100%;
}

/* ガチャ用サブヘッダー（メインヘッダー直下・中央に所持コイン） */
.gh-sub-header {
  background: rgba(20, 25, 45, 0.92);
  border-bottom: 1px solid rgba(200, 170, 80, 0.35);
  padding: 8px 16px;
  text-align: center;
  flex-shrink: 0;
}

.gh-sub-header__coin {
  font-weight: 700;
  color: #f0d870;
  font-size: 1em;
}

/* メインカラム */
.gh-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
}

/* 半透明背景のメインコンテナ */
.gh-main-container {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 10px 14px;
  background: rgba(15, 18, 35, 0.75);
  border-radius: 12px;
  border: 1px solid rgba(150, 130, 200, 0.25);
}

/* ヘッダー画像 */
.gh-header-img {
  width: 100%;
  max-width: 380px;
  border-radius: 10px;
  border: 1px solid rgba(200, 170, 80, 0.4);
}

/* コインバッジ */
.gh-coin-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(240, 200, 80, 0.12);
  border: 1px solid rgba(240, 200, 80, 0.4);
  border-radius: 999px;
  padding: 6px 20px;
  font-weight: 700;
  color: #f0d870;
  font-size: 1em;
}

/* 残り回数 */
.gh-remaining {
  font-size: 0.85em;
  color: #a0b0d0;
}

/* メイン画像 */
.gh-main-img {
  width: 100%;
  max-width: 210px;
  border-radius: 10px;
  border: 1px solid rgba(150, 130, 200, 0.4);
}

/* ガチャボタン */
.gh-pull-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 250px;
  border-radius: 999px;
  background: linear-gradient(135deg, #31a3ff, #7b5dff);
  border: 1px solid #35558e;
  color: #fff;
  font-size: 1em;
  font-weight: 700;
  padding: 8px 18px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.2s;
}

.gh-pull-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(100, 80, 255, 0.4);
}

.gh-pull-btn:disabled {
  background: #555;
  border-color: #444;
  cursor: not-allowed;
  opacity: 0.7;
}

.gh-pull-btn--10 {
  background: linear-gradient(135deg, #ff7a18, #ffb800);
  border-color: #a06000;
}

.gh-pull-btn--10:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(255, 160, 0, 0.4);
}

/* 10回引くが無効（残り9以下など）のときは灰色 */
.gh-pull-btn--10:disabled {
  background: #6a6a6a;
  border-color: #555;
  cursor: not-allowed;
  opacity: 0.85;
}

/* 価格表示 */
.gh-price-note {
  font-size: 0.65em;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 2px;
}

/* ガチャ詳細リンク */
.gh-detail-link {
  background: none;
  border: none;
  color: #80b0ff;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.88em;
  font-family: inherit;
  padding: 0;
  transition: color 0.2s;
}

.gh-detail-link:hover {
  color: #b0d0ff;
}

/* ガチャ演出動画オーバーレイ（半透明の上に動画） */
.gh-video-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.gh-video-overlay[hidden] {
  display: none !important;
}

.gh-video {
  width: 50vw;
  height: 50vh;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ============================================================
   オーバーレイ共通
   ============================================================ */
.gh-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
}

.gh-overlay[hidden] {
  display: none !important;
}

.gh-sheet {
  background: linear-gradient(160deg, rgba(15, 10, 40, 0.98), rgba(5, 5, 20, 0.98));
  border: 2px solid rgba(200, 170, 80, 0.6);
  border-radius: 16px;
  padding: 16px 20px;
  max-width: 440px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  text-align: center;
  position: relative;
  color: #dfe9f3;
}

.gh-close-btn {
  background: rgba(80, 160, 80, 0.8);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 24px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
  font-family: inherit;
  font-size: 1em;
  transition: background 0.2s;
}

.gh-close-btn:hover {
  background: rgba(80, 180, 80, 1);
}

/* ============================================================
   結果オーバーレイ
   ============================================================ */
.gh-result-title {
  margin: 0 0 16px;
  font-size: 1.2em;
  color: #f0d870;
}

.gh-result-card {
  width: 148px;
  height: 148px;
  margin: 0 auto 8px;
  border-radius: 8px;
  overflow: hidden;
}

.gh-result-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gh-result-rarity {
  font-weight: 900;
  margin: 6px 0 4px;
  font-size: 1.05em;
}

.gh-result-rarity--r   { color: #aaa; }
.gh-result-rarity--sr  { color: #60a0ff; }
.gh-result-rarity--ssr { color: #f0d060; text-shadow: 0 0 12px rgba(240, 200, 60, 0.7); }

.gh-result-label {
  font-size: 0.95em;
  color: #dfe9f3;
}

/* 10連結果グリッド */
.gh-multi-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.gh-multi-item {
  text-align: center;
  font-size: 0.75em;
  color: #dfe9f3;
}

.gh-multi-item img {
  width: 74px;
  height: 74px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  margin: 0 auto 4px;
}

/* ============================================================
   詳細オーバーレイ
   ============================================================ */
.gh-detail-sheet {
  background: #f5f8ff;
  border: 2px solid #1d2433;
  color: #1b1f2a;
}

.gh-detail-sheet .gh-close-btn {
  background: rgba(40, 100, 180, 0.85);
}

.gh-detail-group {
  margin-bottom: 20px;
  text-align: left;
}

.gh-detail-rarity {
  font-size: 1.05em;
  font-weight: 900;
  margin-bottom: 8px;
  padding: 2px 10px;
  border-radius: 4px;
  display: inline-block;
}

.gh-detail-rarity--r   { background: rgba(0,0,0,0.07); color: #555; }
.gh-detail-rarity--sr  { background: rgba(60,120,255,0.12); color: #2060c0; }
.gh-detail-rarity--ssr { background: rgba(200,160,20,0.15); color: #a07000; }

.gh-detail-entries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}

.gh-detail-entry {
  text-align: center;
  font-size: 0.7em;
  color: #1b1f2a;
  border-radius: 10px;
  padding: 6px;
  border: 2px solid transparent;
  background: rgba(0, 0, 0, 0.06);
}

.gh-detail-entry--r {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(80, 80, 80, 0.5);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.gh-detail-entry--sr {
  background: rgba(60, 120, 255, 0.08);
  border-color: rgba(60, 120, 255, 0.5);
  box-shadow: 0 0 0 1px rgba(60, 120, 255, 0.15);
}

.gh-detail-entry--ssr {
  background: rgba(200, 160, 20, 0.12);
  border-color: rgba(180, 140, 20, 0.6);
  box-shadow: 0 0 0 1px rgba(200, 160, 20, 0.2);
}

.gh-detail-entry-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

/* 所持ボックスと同じ背景・枠 (詳細画面 アバター) */
.gh-detail-avatar-visual {
  width: 64px;
  height: 64px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin: 0 auto 2px;
  overflow: hidden;
}
.gh-detail-avatar-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gh-detail-avatar-visual--r {
  background-image: image-set(url('../avatar/R_background.webp') type('image/webp'), url('../avatar/R_background.png') type('image/png'));
  border: 2px solid #6b6b6b;
}
.gh-detail-avatar-visual--sr {
  background-image: image-set(url('../avatar/SR_background.webp') type('image/webp'), url('../avatar/SR_background.png') type('image/png'));
  border: 2px solid #c62828;
}
.gh-detail-avatar-visual--ssr {
  background-image: image-set(url('../avatar/SSR_background.webp') type('image/webp'), url('../avatar/SSR_background.png') type('image/png'));
  border: 2px solid #f4b400;
  box-shadow: 0 0 8px rgba(244, 180, 0, 0.6);
}

/* アイテム（AI券等）用 */
.gh-detail-img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  margin: 0 auto 2px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* 所持ボックスと同じ背景・枠 (1回結果 アバター) */
.gh-result-avatar-visual {
  width: 148px;
  height: 148px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  margin: 0 auto 8px;
}
.gh-result-avatar-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gh-result-avatar-visual--r {
  background-image: image-set(url('../avatar/R_background.webp') type('image/webp'), url('../avatar/R_background.png') type('image/png'));
  border: 4px solid #6b6b6b;
}
.gh-result-avatar-visual--sr {
  background-image: image-set(url('../avatar/SR_background.webp') type('image/webp'), url('../avatar/SR_background.png') type('image/png'));
  border: 4px solid #c62828;
}
.gh-result-avatar-visual--ssr {
  background-image: image-set(url('../avatar/SSR_background.webp') type('image/webp'), url('../avatar/SSR_background.png') type('image/png'));
  border: 4px solid #f4b400;
  box-shadow: 0 0 12px rgba(244, 180, 0, 0.7), 0 0 24px rgba(255, 215, 0, 0.4);
}

/* 所持ボックスと同じ背景・枠 (10連結果 アバター) */
.gh-multi-avatar-visual {
  width: 74px;
  height: 74px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  display: block;
  margin: 0 auto 4px;
}
.gh-multi-avatar-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gh-multi-avatar-visual--r {
  background-image: image-set(url('../avatar/R_background.webp') type('image/webp'), url('../avatar/R_background.png') type('image/png'));
  border: 2px solid #6b6b6b;
}
.gh-multi-avatar-visual--sr {
  background-image: image-set(url('../avatar/SR_background.webp') type('image/webp'), url('../avatar/SR_background.png') type('image/png'));
  border: 2px solid #c62828;
}
.gh-multi-avatar-visual--ssr {
  background-image: image-set(url('../avatar/SSR_background.webp') type('image/webp'), url('../avatar/SSR_background.png') type('image/png'));
  border: 2px solid #f4b400;
  box-shadow: 0 0 8px rgba(244, 180, 0, 0.6);
}

.gh-detail-name {
  font-weight: 600;
  margin-bottom: 0;
  line-height: 1.2;
}

.gh-detail-stats {
  font-size: 0.9em;
  color: #444;
  line-height: 1.25;
}

.gh-detail-count {
  color: #666;
  margin-top: 2px;
}

/* ============================================================
   レスポンシブ
   ============================================================ */
@media (max-width: 820px) {
  .gh-layout {
    grid-template-columns: 1fr;
    padding: 12px 8px 32px;
  }

  .gh-ad-col {
    display: none;
  }
}

@media (max-width: 480px) {
  .gh-pull-btn {
    font-size: 1.1em;
  }
}

@media (max-width: 767px) {
  .gh-pull-btn--10 {
    display: none;
  }
}
