/**
 * gacha.css
 * ガチャシステム専用スタイル
 */

/* ================================================
 * メインコンテナ
 * ================================================ */
.gacha-container {
  --wk-button-history: var(--wk-button-history-red);
  --wk-button-history-hover: var(--wk-button-history-red-hover);
  --wk-button-history-edge: var(--wk-button-history-red-edge);
  position: relative;
  max-width: 560px;
  margin: 24px auto;
  padding: 24px;
  background-color: #fff4fa;
  border: 1px solid #f1b9d4;
  border-radius: 14px;
  box-shadow: 0 5px 18px #d12a820a;
  box-sizing: border-box;
  color: #692542;
}
.gacha-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 460px; margin: 0 auto; }
.gacha-heading-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.gacha-play-panel { max-width: 460px; margin: 16px auto 0; }

/* ================================================
 * ヘッダーの保有ポイント・独立したおためし設定
 * ================================================ */
.gacha-points-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 10px 12px;
  border: 2px solid #f1b9d4;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
}

.gacha-points-label { font-size: 18px; line-height: 1.5; white-space: nowrap; }

.gacha-points-badge {
  background: transparent;
  color: var(--wk-button-history-red);
  padding: 0;
  min-height: 0;
  min-width: 0;
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 24px;
  border-radius: 0;
  box-shadow: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  will-change: auto;
  transform: translateZ(0);
  line-height: 1.4;
  overflow: hidden;
}

.gacha-pt-text,
[class*="-pt-text"] {
  font-size: 18px;
  margin-left: 2px;
  display: inline-block;
  vertical-align: baseline;
}

.gacha-reset-btn {
  font-family: var(--wk-dialog-font);
  font-size: var(--wk-font-control, 18px);
  font-weight: 400;
  padding: 8px 12px;
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s;
  background-color: #fff;
  color: var(--wk-button-pale-ink);
  border: 1px solid var(--wk-button-reset-rim);
  position: relative;
  top: 0;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
  text-shadow: none;
  white-space: nowrap;
}
.gacha-container:not([data-trial-mode="true"]):not([data-public-reset="true"]) .gacha-reset-btn {
  display: none;
}
.gacha-reset-btn:hover {
  background-color: var(--wk-button-pale);
}
.gacha-reset-btn:active {
  background-color: #ffd7ea;
}
.gacha-reset-btn:focus {
  outline: 2px solid #b62970;
  outline-offset: 2px;
}
.gacha-trial-settings { max-width: 460px; margin: 20px auto 0; border-top: 1px solid #f1bfd6; color: #903b64; font-size: 18px; }
.gacha-trial-settings > summary { display: flex; align-items: center; gap: 8px; width: fit-content; min-height: 44px; list-style: none; cursor: pointer; }
.gacha-trial-settings > summary::-webkit-details-marker { display: none; }
.gacha-trial-settings > summary[aria-disabled="true"] { color: #999; cursor: not-allowed; }
.gacha-trial-settings > summary::after { content: "＋"; }
.gacha-trial-settings[open] > summary::after { content: "−"; }
.gacha-trial-settings-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 8px; }

/* ================================================
 * 賞品表示エリア
 * ================================================ */
.gacha-prize-details {
  margin: 16px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.gacha-prize-details > summary {
  padding: 14px 12px;
  color: #903b64;
  border: 1px solid #efb9d2;
  border-radius: 6px;
  min-height: 46px;
  font-size: inherit;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
}
.gacha-prize-details > summary:focus-visible {
  outline: 3px solid #a71265;
  outline-offset: 2px;
  border-radius: 6px;
}
.gacha-container.has-prize-toggle .gacha-prize-details > summary { display: none; }
.gacha-prize-details .gacha-prize-hide-label,
.gacha-prize-details[open] .gacha-prize-show-label {
  display: none;
}
.gacha-prize-details[open] .gacha-prize-hide-label {
  display: inline;
}
.gacha-prize-text {
  position: relative;
  isolation: isolate;
  width: min(220px, calc(100% - 48px));
  margin: 28px auto 18px;
  font-size: 32px;
  font-weight: 900;
  line-height: 1.2;
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 1px #a90e5055;
  padding: 8px 18px;
  border: 2px solid #ff9aca;
  border-radius: 8px;
  background: linear-gradient(180deg, #ff60b5 0%, #ff3899 28%, #ed2789 100%);
  box-shadow: inset 0 2px 0 #ffffff60, 0 3px 5px #a50d4933;
}
.gacha-prize-text::before,
.gacha-prize-text::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 12px;
  width: 24px;
  height: calc(100% - 2px);
  background: linear-gradient(135deg, #ff58ab, #ed2582 65%, #a41358);
  border: 1px solid #ff8ec4;
  filter: drop-shadow(0 2px 1px #b32e6830);
}
.gacha-prize-text::before {
  left: -24px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 24% 50%);
}
.gacha-prize-text::after {
  right: -24px;
  background: linear-gradient(225deg, #ff58ab, #ed2582 65%, #a41358);
  clip-path: polygon(0 0, 100% 0, 76% 50%, 100% 100%, 0 100%);
}
.gacha-prize-text > span {
  display: block;
  position: relative;
}


.gacha-prize-images {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 38px auto 48px;
}
.gacha-prize-images.gacha-prize-images-compact {
  margin: 26px auto 36px;
}
.gacha-prize-images .gacha-prize-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.gacha-prize-item {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(160px, 22vw, 260px);
  flex: 0 1 clamp(160px, 22vw, 260px);
  min-width: 0;
  contain: layout paint;
  border-radius: 8px;
  background: transparent;
  overflow: hidden;
}
.gacha-prize-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.28),
    rgba(255, 255, 255, 0.72),
    rgba(255, 255, 255, 0.28)
  );
  opacity: 0.32;
  pointer-events: none;
}
.gacha-prize-item:has(img)::before {
  display: none;
}
.gacha-prize-item img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 260px;
  min-width: 0;
  height: auto;
  aspect-ratio: auto 5 / 7;
  box-sizing: border-box;
  background-color: transparent;
  padding: 0;
  border-radius: 8px;
  object-fit: contain;
}

/* 枚数バッジ */
.gacha-prize-item::after {
  content: "×" attr(data-count);
  position: absolute;
  bottom: 16px;
  left: 2px;
  background-color: #02b340;
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  padding: 5px 8px;
  border-radius: 6px;
  border: 2px solid #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 5;
  letter-spacing: 0.05em;
  transform: translateZ(0);
  will-change: auto;
}

/* ================================================
 * コスト・残口数表示エリア
 * ================================================ */
.gacha-cost-wrapper {
  text-align: left;
  margin: 0 0 22px;
  padding: 16px 18px;
  background: #fff;
  border: 2px solid #f1b9d4;
  border-radius: 12px;
  box-shadow: none;
}
.gacha-cost-summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }

/* 全体残数と個人上限を同じ情報帯にまとめる。 */
.gacha-per-user-limit {
  display: block;
  text-align: left;
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  color: var(--wk-button-history-red);
  line-height: 1.4;
  white-space: nowrap;
  letter-spacing: 0;
}
.gacha-per-user-limit-val,
.gacha-per-user-limit-max {
  font-size: 20px;
  color: var(--wk-button-history-red);
  text-shadow: none;
}
.gacha-per-user-limit-val {
  font-weight: bold;
  font-size: 28px;
  color: var(--wk-button-history-red);
}


.gacha-cost-text {
  font-size: 18px;
  font-weight: 500;
  color: var(--wk-button-history-red);
  margin-bottom: 10px;
  line-height: 1.4;
  display: block;
  white-space: nowrap;
}
.gacha-cost-amount {
  font-size: 20px;
  color: var(--wk-button-history-red);
  text-shadow: none;
  display: inline-block;
  min-width: 0;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.gacha-remaining-text {
  font-size: 18px;
  color: var(--wk-button-history-red);
  margin: 0;
  line-height: 1.4;
  display: block;
  white-space: nowrap;
}
.gacha-remaining,
.gacha-total {
  font-weight: bold;
  font-size: 40px;
  color: var(--wk-button-history-red);
  text-shadow: none;
  display: inline-block;
  min-width: 0;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.gacha-total { font-size: 18px; color: var(--wk-button-history-red); font-weight: 500; }

.gacha-progress-bar {
  width: 100%;
  height: 6px;
  margin-top: 12px;
  background-color: #f9d8e8;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: none;
}
.gacha-progress-fill {
  height: 100%;
  background: #27ad5a;
  border-radius: inherit;
  transition: width 0.3s;
}

/* ================================================
 * ボタン共通レイアウト
 * ================================================ */
.gacha-button-wrapper {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 460px;
  margin: 12px auto 0;
}
.gacha-main-button {
  --gacha-button-min-width: 0px;
  --gacha-button-max-width: none;
  --gacha-button-width: 100%;
  --gacha-button-inline-padding: 12px;
}
.gacha-start-button,
.gacha-button-wrapper > .gacha-replay-button {
  grid-column: 1 / -1;
  justify-self: center;
  --gacha-button-width: 100%;
}

/* メインガチャボタン */
/* ボタン: 共通構造・色の差分・レスポンシブを一箇所で管理する。 */
.gacha-main-button,
.gacha-convert-button {
  --gacha-button-color: var(--wk-button-play);
  --gacha-button-hover-color: var(--wk-button-play-hover);
  --gacha-button-edge: var(--wk-button-play-edge);
  --gacha-button-text: 0 1px 2px #a6156080;
}
.gacha-replay-button {
  --gacha-button-color: var(--wk-button-ranking);
  --gacha-button-hover-color: var(--wk-button-ranking-hover);
  --gacha-button-edge: var(--wk-button-ranking-edge);
  --gacha-button-text: 0 1px 2px #00457880;
}
.gacha-main-button,
.gacha-convert-button,
.gacha-replay-button {
  --gacha-button-rest: 0 4px 0 var(--gacha-button-edge);
  --gacha-button-hover: 0 5px 0 var(--gacha-button-edge);
  --gacha-button-active: 0 1px 0 var(--gacha-button-edge);
  font-size: var(--gacha-button-font-size, 24px);
  font-weight: 700;
  padding: 12px var(--gacha-button-inline-padding, 20px);
  min-height: var(--gacha-button-min-height, 58px);
  min-width: var(--gacha-button-min-width, 240px);
  max-width: var(--gacha-button-max-width, 100%);
  width: var(--gacha-button-width, auto);
  box-sizing: border-box;
  white-space: nowrap;
  border-radius: 10px;
  background-color: var(--gacha-button-color);
  background-image: var(--gacha-button-image, none);
  color: var(--gacha-button-foreground, #fff);
  border: 1px solid var(--gacha-button-border-color, var(--gacha-button-color));
  box-shadow: var(--gacha-button-rest);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s;
  text-shadow: var(--gacha-button-text);
  letter-spacing: .01em;
  position: relative;
  top: 0;
  -webkit-tap-highlight-color: transparent;
}
.gacha-convert-button {
  display: block;
  margin: 14px auto 30px;
}
.gacha-result-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px auto 30px; }
.gacha-result-actions > button { --gacha-button-font-size: clamp(14px, 4.2vw, 20px); --gacha-button-min-width: 0px; --gacha-button-max-width: 100%; --gacha-button-width: 100%; --gacha-button-inline-padding: 6px; margin: 0; }
.gacha-main-button:hover:enabled,
.gacha-convert-button:hover:enabled,
.gacha-replay-button:hover {
  background-color: var(--gacha-button-hover-color, var(--gacha-button-color));
  background-image: var(
    --gacha-button-hover-image,
    var(--gacha-button-image, none)
  );
  box-shadow: var(--gacha-button-hover);
  transform: translateY(-1px);
}
.gacha-main-button:active:enabled,
.gacha-convert-button:active:enabled,
.gacha-replay-button:active {
  transform: translateY(3px);
  box-shadow: var(--gacha-button-active);
}
.gacha-main-button:disabled,
.gacha-convert-button:disabled {
  background-color: var(--wk-button-disabled);
  color: var(--wk-button-disabled-ink);
  border-color: #e4dee6;
  cursor: not-allowed;
  box-shadow: none;
  text-shadow: none;
}
.gacha-convert-button:disabled {
  transform: none;
}
@media screen and (max-width: 767px) {
  .gacha-main-button,
  .gacha-convert-button,
  .gacha-replay-button {
    font-size: var(--gacha-button-font-size, 21px);
    padding: 12px var(--gacha-button-inline-padding, 20px);
    min-height: var(--gacha-button-min-height, 52px);
    min-width: var(--gacha-button-min-width, 0px);
  }
  .gacha-main-button {
    flex: 1;
    order: 1;
  }
  .gacha-replay-button {
    flex: 1;
    order: 2;
  }
  .gacha-convert-button {
    min-width: 200px;
  }
}
@media screen and (min-width: 481px) and (max-width: 600px) {
  .gacha-main-button,
  .gacha-convert-button,
  .gacha-replay-button {
    font-size: var(--gacha-button-font-size, 21px);
    padding: 13px var(--gacha-button-inline-padding, 30px);
    min-height: var(--gacha-button-min-height, 52px);
    min-width: var(--gacha-button-min-width, 190px);
  }
}
@media screen and (max-width: 480px) {
  .gacha-cost-wrapper { padding: 12px; }
  .gacha-main-button,
  .gacha-convert-button,
  .gacha-replay-button {
    font-size: var(--gacha-button-font-size, 21px);
    padding: 11px var(--gacha-button-inline-padding, 24px);
    min-height: var(--gacha-button-min-height, 52px);
    min-width: var(--gacha-button-min-width, 170px);
    max-width: var(--gacha-button-max-width, 85%);
  }
}
@media screen and (max-width: 360px) {
  .gacha-convert-button,
  .gacha-replay-button {
    font-size: var(--gacha-button-font-size, 17px);
    padding: 10px var(--gacha-button-inline-padding, 20px);
    min-height: 44px;
    min-width: var(--gacha-button-min-width, 150px);
  }
}
.gacha-main-button.gacha-collection-btn-main,
.gacha-main-button.cont-ranking-btn-main,
.gacha-main-button.gacha-zukan-ranking-open-btn,
.gacha-main-button.gacha-prize-toggle {
  --gacha-button-color: var(--wk-button-pale);
  --gacha-button-hover-color: var(--wk-button-pale-hover);
  --gacha-button-foreground: var(--wk-button-pale-ink);
  --gacha-button-border-color: #edabc9;
  --gacha-button-edge: var(--wk-button-pale-edge);
  --gacha-button-font-size: 18px;
  --gacha-button-min-height: 46px;
  --gacha-button-inline-padding: 8px;
  --gacha-button-text: none;
}
.gacha-main-button.cont-ranking-btn-main,
.gacha-main-button.gacha-zukan-ranking-open-btn {
  --gacha-button-color: var(--wk-button-ranking);
  --gacha-button-hover-color: var(--wk-button-ranking-hover);
  --gacha-button-foreground: #fff;
  --gacha-button-border-color: var(--wk-button-ranking);
  --gacha-button-edge: var(--wk-button-ranking-edge);
}
.gacha-main-button.gacha-collection-btn-main:not(.gacha-zukan-ranking-open-btn):not(.gacha-history-btn-main) {
  --gacha-button-color: var(--wk-button-collection);
  --gacha-button-hover-color: var(--wk-button-collection-hover);
  --gacha-button-foreground: #fff;
  --gacha-button-border-color: var(--wk-button-collection);
  --gacha-button-edge: var(--wk-button-collection-edge);
}
.gacha-main-button.gacha-history-btn-main {
  --gacha-button-color: var(--wk-button-history);
  --gacha-button-hover-color: var(--wk-button-history-hover);
  --gacha-button-foreground: #fff;
  --gacha-button-border-color: var(--wk-button-history);
  --gacha-button-edge: var(--wk-button-history-edge);
}
.gacha-main-button.gacha-prize-toggle[aria-expanded="true"] {
  --gacha-button-color: #ffd4e9;
  --gacha-button-foreground: #b61e6b;
  --gacha-button-border-color: #e7b1cb;
}
@media (hover: none) and (pointer: coarse) {
  .gacha-main-button:active:enabled,
  .gacha-convert-button:active:enabled,
  .gacha-replay-button:active {
    transform: translateY(3px);
  }
}

/* ポイント変換ボタン */

/* 演出リプレイボタン */

/* ================================================
 * ガチャ結果エリア
 * ================================================ */
.gacha-result {
  margin-top: 0;
}
.gacha-result:not(:empty) { margin-top: 24px; }

.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-result-card {
  max-width: 380px;
  padding: 0;
  margin: 32px auto;
  box-shadow: none;
  border-radius: 16px;
  background: transparent;
  transition: all 0.3s;
}
.gacha-result-card:hover {
  box-shadow: none;
  transform: translateY(-5px);
}

/* gacha-card クラス（後方互換のため定義を維持） */
.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: var(--gacha-card-info-margin, 12px 0 8px);
}
.gacha-result-caption { --gacha-card-info-margin: 14px 0 0; --gacha-card-name-size: clamp(20px, 6vw, 32px); --gacha-card-name-color: var(--wk-button-history-red, #dc143c); margin: 14px 0 0; color: var(--gacha-card-name-color); font-size: var(--gacha-card-name-size); line-height: 1.2; }
.gacha-preview-points { flex-shrink: 0; margin-inline-start: 8px; font-size: inherit; font-weight: 700; white-space: nowrap; }
.gacha-result-card:not(:last-child) .gacha-result-caption { padding-bottom: 12px; border-bottom: 2px solid currentColor; }

.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: var(--gacha-card-name-size, 26px);
  font-weight: bold;
  color: var(--gacha-card-name-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,
.gacha-card-img {
  width: 100%;
  max-width: 480px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  background-color: transparent;
  padding: 0;
}

/* カードの文字枠。画像と同じ比率で位置を保つ。 */
.gacha-card-face {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 5 / 7;
  container-type: inline-size;
}
.gacha-card-face-label {
  position: absolute;
  z-index: 2;
  inset: 88.15% 6.4% 5.2% 34.4%;
  display: grid;
  place-items: center;
  color: #48241d;
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", Meiryo, sans-serif;
  font-size: 5.55cqw;
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  -webkit-text-stroke: .05cqw currentColor;
  pointer-events: none;
}
.gacha-card-face--a .gacha-card-face-label {
  inset: 88.6% 8.2% 5.55% 37.8%;
  color: #482e1a;
}
.gacha-card-face--shared .gacha-card-face-label {
  inset: 87.7% 10% 5.1% 40%;
  color: #482e1a;
}
.gacha-card-face-label.is-long {
  font-size: 3.15cqw;
}
.gacha-card-face-label > span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

/* ポイント交換レート表示 */
.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;
  overflow-y: auto;
  z-index: 99998;
}

.gacha-modal {
  font-family: var(--wk-dialog-font);
  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;
  box-sizing: border-box;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
}
.gacha-modal-text {
  font-family: inherit;
  font-size: 20px;
  font-weight: 400;
  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-family: var(--wk-dialog-font);
  font-size: 18px;
  font-weight: 400;
  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: #ffe5f1;
  color: #333;
  box-shadow:
    0 5px 0 #e6a3c4,
    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: #ffd4e9;
  box-shadow:
    0 5px 0 #e6a3c4,
    0 8px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}
.gacha-button-cancel:active {
  top: 3px;
  box-shadow:
    0 2px 0 #e6a3c4,
    0 3px 6px rgba(0, 0, 0, 0.2);
}
.gacha-button-confirm {
  background-color: var(--wk-button-play);
  color: white;
  box-shadow: 0 5px 0 var(--wk-button-play-edge), 0 6px 12px #0004;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}
.gacha-button-confirm:hover {
  background-color: var(--wk-button-play-hover);
  box-shadow:
    0 5px 0 var(--wk-button-play-edge),
    0 8px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}
.gacha-button-confirm:active {
  top: 3px;
  box-shadow: 0 2px 0 var(--wk-button-play-edge), 0 3px 6px #0003;
}
.gacha-modal .gacha-button-cancel:focus,
.gacha-modal .gacha-button-confirm:focus {
  outline: 3px solid rgba(255, 44, 152, 0.5);
  outline-offset: 2px;
}

/* ================================================
 * ガチャ演出オーバーレイ
 * ================================================ */
.gacha-effect-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  flex-direction: column;
  gap: 8px;
}
.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: calc(20px + env(safe-area-inset-top, 0px));
  right: 20px;
  font-size: var(--wk-font-control, 18px);
  font-weight: bold;
  line-height: 1.2;
  white-space: nowrap;
  box-sizing: border-box;
  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: calc(22px + env(safe-area-inset-top, 0px));
  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-sound-controls {
  display: flex;
  justify-content: flex-end;
  flex: none;
  margin: 0 0 0 auto;
}
.gacha-sound-btn {
  appearance: none;
  min-width: 92px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #edabc9;
  border-radius: 8px;
  background: var(--wk-button-pale);
  color: var(--wk-button-pale-ink);
  font-family: inherit;
  font-size: var(--wk-font-control, 18px);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 0.15s;
  text-shadow: none;
  animation: none;
}
.gacha-sound-btn[aria-pressed="true"] {
  background: var(--wk-button-pale-hover);
  color: var(--wk-button-pale-ink);
  border-color: #e7b1cb;
}
.gacha-mute-btn[aria-pressed="true"] {
  background: var(--wk-button-pale-hover);
}
.gacha-sound-btn:disabled { background: var(--wk-button-disabled); color: var(--wk-button-disabled-ink); border-color: #e4dee6; cursor: not-allowed; }
.gacha-sound-btn:hover:enabled {
  background: #ffd4e9;
}
.gacha-sound-btn:active:enabled {
  transform: translateY(1px);
}
.gacha-sound-btn:focus-visible,
.gacha-mute-btn:focus-visible {
  outline: 3px solid #a71265;
  outline-offset: 2px;
}
.gacha-mute-btn {
  position: absolute;
  top: calc(20px + env(safe-area-inset-top, 0px));
  left: 20px;
  font-size: var(--wk-font-control, 18px);
  font-weight: bold;
  line-height: 1.2;
  white-space: nowrap;
  box-sizing: border-box;
  padding: 10px 20px;
  min-height: 44px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 100002;
  -webkit-tap-highlight-color: transparent;
  text-shadow: none;
  animation: none;
  box-shadow: 0 4px 0 var(--wk-button-pale-edge), 0 6px 12px #0003;
  background-color: var(--wk-button-pale);
  color: var(--wk-button-pale-ink);
}
.gacha-mute-btn:hover {
  transform: translateY(-1px) scale(1.03);
}
.gacha-mute-btn:active {
  top: calc(22px + env(safe-area-inset-top, 0px));
}
@media (max-width: 480px) {
  .gacha-mute-btn {
    font-size: var(--wk-font-control, 16px);
    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;
}
.gacha-effect-overlay[data-effect-device="phone"] {
  --shared-effect-height: calc(
    100vh - 110px - env(safe-area-inset-top, 0px) -
      env(safe-area-inset-bottom, 0px)
  );
  --shared-effect-width: min(94vw, calc(var(--shared-effect-height) * 9 / 16));
  gap: 8px;
}
@supports (height: 100dvh) {
  .gacha-effect-overlay[data-effect-device="phone"] {
    --shared-effect-height: calc(
      100dvh - 110px - env(safe-area-inset-top, 0px) -
        env(safe-area-inset-bottom, 0px)
    );
  }
}
.gacha-effect-overlay[data-effect-device="phone"] .gacha-effect-video {
  width: var(--shared-effect-width);
  height: auto;
  aspect-ratio: 9 / 16;
  max-height: var(--shared-effect-height);
  object-fit: contain;
}
.gacha-effect-overlay[data-effect-device="phone"] .gacha-btn-row {
  width: var(--shared-effect-width);
}
.gacha-effect-overlay .gacha-shared-video-stage {
  position: relative;
  display: block;
  width: fit-content;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  line-height: 0;
}
.gacha-effect-overlay .gacha-shared-video-stage > .gacha-effect-video-after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  max-width: none;
  max-height: none;
  margin: 0;
  box-sizing: border-box;
}

/* ================================================
 * PC（769px以上）：動画を縮小し、ボタンを動画の上に配置
 * overlay を縦 flex にして「ボタン行 → 動画」の順に積む
 * ボタンは position:static にして動画と重ならないようにする
 * ================================================ */
@media (min-width: 769px) {
  .gacha-effect-video {
    width: min(72vh, 72vw, 700px);
    height: min(72vh, 72vw, 700px);
  }

  /* ミュートボタン・SKIPボタン：position を static に戻し
     flex flow で動画の上に自然に並べる               */
  .gacha-mute-btn {
    position: static;
    /* top / left / right のリセット（他メディアクエリの上書き対策） */
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
  }
  .gacha-mute-btn:active {
    top: auto;
  }
  .gacha-skip-button {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
  }
  .gacha-skip-button:active {
    top: auto;
  }

  /* overlay をラッパーとして使い、ボタン行を動画の上に置く
     ボタン2つを横並びにして動画幅に揃える             */
  .gacha-effect-overlay {
    flex-direction: column;
    gap: 8px;
  }

}

/* 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;
}


/* ================================================
 * 図鑑ボタン（メインボタンと同サイズ・赤色）
 * ================================================ */

/* 図鑑ボタン（非表示） */
.gacha-collection-btn {
  display: none;
}

/* ================================================
 * コレクション（図鑑）モーダル
 * ================================================ */
.gacha-collection-modal {
  --gacha-header-color: var(--wk-button-collection);
  --gacha-panel-hover: var(--wk-button-collection-hover);
  --gacha-panel-edge: var(--wk-button-collection-edge);
  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: 99999;
  font-family: var(--wk-record-font);
  font-weight: 700;
  line-height: 1.5;
  box-sizing: border-box;
}
.gacha-collection-modal[data-panel-kind="history"] {
  --gacha-header-color: var(--wk-button-history-red);
  --gacha-panel-hover: var(--wk-button-history-red-hover);
  --gacha-panel-edge: var(--wk-button-history-red-edge);
}
.gacha-collection-modal[data-panel-kind="ranking"],
.cont-ranking-modal {
  --gacha-header-color: var(--wk-button-ranking);
  --gacha-panel-hover: var(--wk-button-ranking-hover);
  --gacha-panel-edge: var(--wk-button-ranking-edge);
}
/* 図鑑・履歴・ランキングのヘッダー。差分はモーダル側の変数で指定する。 */
.gacha-collection-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: auto;
  min-height: var(--gacha-header-height, 96px);
  margin: var(--gacha-header-margin, 0);
  padding: var(--gacha-header-padding, 28px 58px 24px);
  background: var(--gacha-header-color);
  border-bottom: none;
  border-radius: var(--gacha-header-radius, 16px 16px 0 0);
  z-index: 100000;
}
.gacha-collection-header h2.gacha-collection-title {
  display: var(--gacha-title-display, block);
  position: var(--gacha-title-position, static);
  align-items: var(--gacha-title-align, normal);
  justify-content: var(--gacha-title-align, normal);
  gap: var(--gacha-title-gap, normal);
  height: auto;
  min-height: var(--gacha-title-min-height, auto);
  margin: 0;
  padding: 0;
  font-size: var(--gacha-title-size, 36px);
  font-weight: 900;
  color: #fff;
  text-align: center;
  line-height: var(--gacha-title-line, 1.1);
  background: none;
  border: none;
  box-shadow: none;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.05em;
  transform: var(--gacha-title-transform, translateZ(0));
  will-change: auto;
  white-space: var(--gacha-title-white-space, normal);
}
.gacha-collection-title::before {
  content: "🍀 ";
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 2px #fff);
  margin-right: 8px;
}
.gacha-collection-title::after {
  content: " 🍀";
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 2px #fff);
  margin-left: 8px;
}
.gacha-collection-close {
  position: absolute;
  top: 50%;
  right: var(--gacha-close-right, 20px);
  transform: translateY(-50%);
  background: #fff;
  color: #333;
  border: none;
  font-size: 0;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  line-height: 1;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  z-index: 100005;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  font-family: var(--wk-record-font);
  text-shadow: none;
}
.gacha-collection-close::before,
.gacha-collection-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56%;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  pointer-events: none;
}
.gacha-collection-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
.gacha-collection-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}
.gacha-collection-close:hover {
  transform: var(--gacha-close-hover, translateY(-50%) scale(1.15));
  background: var(--wk-button-neutral-hover);
}
.gacha-collection-close:active {
  transform: var(--gacha-close-active, translateY(-50%) scale(1));
}
.gacha-collection-close:focus {
  outline: none;
}
.gacha-zukan-ranking-modal {
  --gacha-header-color: var(--wk-button-ranking);
  --gacha-panel-hover: var(--wk-button-ranking-hover);
  --gacha-panel-edge: var(--wk-button-ranking-edge);
  --gacha-title-white-space: nowrap;
  --gacha-title-gap: 10px;
  --gacha-title-align: center;
}
.gacha-zukan-ranking-modal .gacha-collection-header {
  margin-left: 10px;
  margin-right: 10px;
}
@media screen and (max-width: 768px) {
  .gacha-collection-modal {
    --gacha-title-size: 24px;
    font-family: var(--wk-record-font);
    font-weight: 700;
    line-height: 1.5;
    max-height: calc(100dvh - 40px);
    width: 100%;
    max-width: 100%;
    padding: 15px 12px 60px;
    margin: 0 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .gacha-collection-title::before {
    margin-right: 6px;
  }
  .gacha-collection-title::after {
    margin-left: 6px;
  }
  .gacha-collection-close {
    width: 44px;
    height: 44px;
    right: var(--gacha-close-right, 12px);
  }
}
@media screen and (max-width: 480px) {
  .gacha-collection-modal {
    --gacha-header-height: 84px;
    --gacha-header-padding: 24px 48px 20px;
    font-family: var(--wk-record-font);
    font-weight: 700;
    line-height: 1.5;
    max-height: calc(100dvh - 30px);
    width: 100%;
    max-width: 100%;
    padding: 12px 10px 50px;
    margin: 0 auto;
  }
  .gacha-collection-title::before,
  .gacha-collection-title::after {
    font-size: 18px;
  }
  .gacha-collection-close {
    width: 38px;
    height: 38px;
  }
  .gacha-zukan-ranking-modal {
    --gacha-title-gap: 6px;
  }
  .gacha-zukan-ranking-modal .gacha-collection-title::before,
  .gacha-zukan-ranking-modal .gacha-collection-title::after {
    flex: 0 0 auto;
    margin: 0;
    font-size: 15px;
  }
}
@media screen and (max-width: 360px) {
  .gacha-collection-modal {
    --gacha-title-size: 22px;
    font-family: var(--wk-record-font);
    font-weight: 700;
    line-height: 1.5;
    max-height: calc(100dvh - 20px);
    width: 100%;
    max-width: 100%;
    padding: 16px 10px 10px;
    margin: 0 auto;
  }
  .gacha-collection-title::before,
  .gacha-collection-title::after {
    font-size: 16px;
  }
  .gacha-collection-close {
    width: 36px;
    height: 36px;
    right: var(--gacha-close-right, 10px);
  }
}
@media (hover: none) and (pointer: coarse) {
  .gacha-collection-close:active {
    transform: var(--gacha-close-active, translateY(-50%) scale(0.97));
  }
}
/*図鑑・履歴の統計と公開コード。基本・種別差分・画面幅差分をまとめて管理する。
 */
.gacha-collection-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background-color: #dc143c;
  padding: 2px 20px 8px;
  margin-bottom: 0;
  border-radius: 0 0 16px 16px;
  flex-wrap: wrap;
}
.gacha-collection-stat-item {
  color: #fff;
  font-size: var(--wk-record-body, 16px);
  font-weight: bold;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.gacha-collection-stat-item strong {
  font-size: var(--wk-record-score, 28px);
  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: 18px;
}
.gacha-collection-code-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 2px;
  flex-basis: 100%;
}
.gacha-collection-code-label {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.14em;
  white-space: nowrap;
  flex-shrink: 0;
}
.gacha-collection-code-value {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  font-family: var(--wk-record-font);
  font-size: var(--wk-record-body, 16px);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  padding: 2px 10px;
  text-align: center;
  word-break: break-all;
}
.gacha-collection-x-row {
  width: 100%;
  display: flex;
  justify-content: center;
  flex-basis: 100%;
}
.gacha-collection-x-button {
  min-width: 160px;
  min-height: 36px;
  padding: 8px 20px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-size: var(--wk-font-control, 18px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.28);
  cursor: pointer;
  font-family: var(--wk-record-font);
}
.gacha-collection-x-button.is-disabled,
.gacha-collection-x-button:disabled,
.gacha-prize-history-x:disabled {
  opacity: 0.48;
  cursor: default;
  box-shadow: none;
}
@media screen and (max-width: 768px) {
  .gacha-collection-stats {
    padding: 2px 12px 8px;
    gap: 8px;
    margin-bottom: 0;
    border-radius: 0 0 12px 12px;
  }
  .gacha-collection-stat-item {
    font-size: var(--wk-record-body, 16px);
  }
  .gacha-collection-stat-item strong {
    font-size: var(--wk-record-score, 28px);
  }
  .gacha-collection-code-row {
    width: 100%;
    flex-basis: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-top: 2px;
  }
  .gacha-collection-code-label {
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.12em;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .gacha-collection-code-value {
    font-family: var(--wk-record-font);
    font-size: var(--wk-record-body, 16px);
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #fff;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    padding: 2px 8px;
    text-align: center;
    word-break: break-all;
  }
}

.gacha-collection-modal:not(#rush001-collectionModal) .gacha-collection-stats {
  display: flex;
  margin: 18px 22px 14px;
  padding: 14px 16px;
  border: 2px solid #111;
  border-radius: 10px;
  background: #fff;
  box-shadow:
    0 4px 0 rgba(0, 0, 0, 0.14),
    0 12px 24px rgba(0, 0, 0, 0.08);
  justify-content: center;
  align-items: center;
  gap: 8px 18px;
  text-align: center;
}

.gacha-collection-modal:not(#rush001-collectionModal)
  .gacha-collection-stat-item {
  font-weight: 900;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  color: #111;
  font-size: var(--wk-record-body, 16px);
  line-height: 1.2;
  text-align: center;
}

.gacha-collection-modal:not(#rush001-collectionModal)
  .gacha-collection-stat-item
  strong {
  color: #dc143c;
  text-shadow: none;
  font-size: var(--wk-record-score, 28px);
  line-height: 1;
}

.gacha-collection-modal:not(#rush001-collectionModal)
  .gacha-collection-stat-divider {
  color: #cfcfcf;
  display: none;
}

.gacha-collection-modal:not(#rush001-collectionModal)
  .gacha-collection-code-row {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid #e5e5e5;
}

.gacha-collection-modal:not(#rush001-collectionModal)
  .gacha-collection-code-label {
  color: #111;
  font-size: var(--wk-font-meta, 14px);
  letter-spacing: 0.08em;
}

.gacha-collection-modal:not(#rush001-collectionModal)
  .gacha-collection-code-value {
  max-width: min(100%, 360px);
  color: #111;
  background: #f8f8f8;
  border: 1px solid #d9d9d9;
  font-size: var(--wk-record-body, 16px);
  line-height: 1.25;
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
  --gacha-code-min-width: 42px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .gacha-collection-modal:not(#rush001-collectionModal)
    .gacha-collection-stats {
    margin: 14px 12px 12px;
    padding: 12px;
    gap: 6px 12px;
  }
}
.gacha-collection-code-time-row {
  width: 100%;
  flex-basis: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 2px;
}
.gacha-collection-time-label {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.gacha-collection-time-value {
  color: #fff;
  font-size: var(--wk-record-date, 16px);
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  line-height: 1.5;
}
.gacha-collection-modal:not(#rush001-collectionModal)
  .gacha-collection-code-time-row {
  padding-top: 0;
}
.gacha-collection-modal:not(#rush001-collectionModal)
  .gacha-collection-time-label {
  color: #111;
  font-size: var(--wk-font-meta, 14px);
  font-weight: 900;
}
.gacha-collection-modal:not(#rush001-collectionModal)
  .gacha-collection-time-value {
  color: #111;
  font-size: var(--wk-record-date, 16px);
  font-weight: 800;
  line-height: 1.5;
  white-space: nowrap;
}
.gacha-collection-modal.is-prize-history-mode .gacha-collection-stats {
  display: none;
}
@media (max-width: 480px) {
  .gacha-collection-modal:not(#rush001-collectionModal)
    .gacha-collection-stat-item {
    min-height: 30px;
    font-size: var(--wk-record-body, 16px);
  }
  .gacha-collection-modal:not(#rush001-collectionModal)
    .gacha-collection-stat-item
    strong {
    font-size: var(--wk-record-score, 28px);
  }
}
.gacha-collection-modal:not(#rush001-collectionModal)
  .gacha-collection-code-label,
.gacha-collection-modal:not(#rush001-collectionModal)
  .gacha-collection-time-label {
  font-size: 15px;
  line-height: 1.25;
}
.gacha-collection-modal:not(#rush001-collectionModal)
  .gacha-collection-code-value,
.gacha-collection-modal:not(#rush001-collectionModal)
  .gacha-collection-time-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--gacha-code-min-width, 34px);
  min-height: 26px;
  font-size: var(--wk-record-body, 16px);
  line-height: 1.5;
  vertical-align: middle;
  box-sizing: border-box;
  white-space: nowrap;
}
.gacha-collection-modal:not(#rush001-collectionModal)
  .gacha-collection-x-button {
  min-width: 168px;
  min-height: 40px;
  font-size: var(--wk-font-control, 18px);
  line-height: 1.1;
}
@media (max-width: 480px) {
  .gacha-collection-modal:not(#rush001-collectionModal)
    .gacha-collection-code-label,
  .gacha-collection-modal:not(#rush001-collectionModal)
    .gacha-collection-time-label {
    font-size: 14px;
  }
  .gacha-collection-modal:not(#rush001-collectionModal)
    .gacha-collection-code-value,
  .gacha-collection-modal:not(#rush001-collectionModal)
    .gacha-collection-time-value {
    min-width: 32px;
    min-height: 24px;
    font-size: var(--wk-record-body, 16px);
    line-height: 1.5;
  white-space: nowrap;
}
  .gacha-collection-modal:not(#rush001-collectionModal)
    .gacha-collection-code-value {
    min-width: 40px;
    font-size: var(--wk-record-body, 16px);
}
  .gacha-collection-modal:not(#rush001-collectionModal)
    .gacha-collection-x-button {
    min-width: 156px;
    min-height: 38px;
    font-size: var(--wk-font-control, 16px);
  }
}

/* 図鑑下部の閉じるボタン */
.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: var(--gacha-header-color);
  color: #fff;
  border: none;
  box-shadow: 0 5px 0 var(--gacha-panel-edge), 0 7px 14px #0003;
  cursor: pointer;
  transition: all 0.2s;
  text-shadow: none;
  letter-spacing: 0.1em;
  position: relative;
  top: 0;
  -webkit-tap-highlight-color: transparent;
  z-index: 100005;
  font-family: var(--wk-record-font);
}
.gacha-collection-close-bottom:hover {
  background-color: var(--gacha-panel-hover);
  box-shadow: 0 5px 0 var(--gacha-panel-edge), 0 10px 20px #0004;
  transform: translateY(-2px);
}
.gacha-collection-close-bottom:active {
  top: 4px;
  box-shadow: 0 2px 0 var(--gacha-panel-edge), 0 3px 8px #0003;
  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)::before {
  content: "S賞";
  position: absolute;
  top: 6px;
  left: 6px;
  background: linear-gradient(135deg, #b8860b, #ffd700);
  color: #cc0000;
  font-size: var(--wk-font-min, 14px);
  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;
  transform: translateZ(0);
  will-change: auto;
}

/* 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)::before {
  content: "A賞";
  position: absolute;
  top: 6px;
  left: 6px;
  background: linear-gradient(135deg, #707070, #c0c0c0);
  color: #003399;
  font-size: var(--wk-font-min, 14px);
  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;
  transform: translateZ(0);
  will-change: auto;
}

/* 図鑑タイトル */

/* コレクショングリッド（全サイズで3列） */
.gacha-collection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  padding: 16px 10px 10px;
  z-index: 100000;
}

.gacha-collection-item {
  position: relative;
  aspect-ratio: 5 / 7;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
  z-index: 100001;
}
.gacha-collection-item:hover {
  transform: scale(1.05);
  z-index: 100010;
}
.gacha-collection-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
  display: block;
}

/* 未取得カード：黒塗り */
.gacha-collection-item.locked img {
  visibility: hidden;
  filter: none;
}
.gacha-collection-item.locked .gacha-collection-item-name {
  visibility: hidden;
}
.gacha-collection-item.locked {
  background-color: #555;
  border-color: #666;
  box-shadow: none;
  cursor: not-allowed;
}
.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 4px;
  font-size: var(--wk-font-meta, 14px);
  font-weight: bold;
  text-align: center;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: auto-phrase;
  text-wrap: balance;
  line-height: 1.5;
  min-height: 3em;
  box-sizing: border-box;
}

/* コレクションカードのホバー効果 */
.gacha-collection-item:not(.locked) {
  cursor: pointer;
}
.gacha-collection-item:not(.locked):hover {
  transform: scale(1.08);
  box-shadow: 0 8px 20px rgba(255, 105, 180, 0.5);
}
/* ================================================
 * 画像拡大モーダル
 * ================================================ */
.gacha-image-zoom-modal {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}
.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-content {
  min-width: 0;
}
.gacha-image-zoom-content .gacha-card-face {
  width: min(90vw, calc(90vh * 5 / 7));
}

/* 拡大モーダルの閉じるボタン */
.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;
  box-shadow:
    0 5px 0 #c0c0c0,
    0 6px 15px rgba(0, 0, 0, 0.3);
  z-index: 100005;
  text-shadow: none;
}
.gacha-image-zoom-close:hover {
  background: var(--wk-button-neutral-hover);
  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 調整（グローバルメニュー対策）
 * ================================================ */

/* 図鑑モーダル表示中（body.gacha-modal-active）：
 * ヘッダー・ナビ・フッターを非表示にしてモーダルを全画面表示 */
body.gacha-modal-active .header-container,
body.gacha-modal-active .mobile-menu-buttons,
body.gacha-modal-active .mobile-category-nav,
body.gacha-modal-active #header,
body.gacha-modal-active .navi,
body.gacha-modal-active .header-in,
body.gacha-modal-active header,
body.gacha-modal-active #footer,
body.gacha-modal-active .footer,
body.gacha-modal-active footer,
body.gacha-modal-active .footer-container,
body.gacha-modal-active .site-footer,
body.gacha-modal-active .copyright,
body.gacha-modal-active .site-info,
body.gacha-modal-active .back-to-top,
body.gacha-modal-active #back-to-top,
body.gacha-modal-active #totop,
body.gacha-modal-active .totop {
  display: none !important;
  visibility: hidden !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: 18px;
    margin: 20px auto;
  }
  .gacha-heading { flex-wrap: wrap; }
  .gacha-heading-name { flex-basis: 100%; order: 2; }
  .gacha-sound-controls { flex-basis: 100%; order: 1; }
  .gacha-pt-text {
    font-size: var(--wk-font-min, 14px);
  }
  .gacha-prize-text {
    width: min(180px, calc(100% - 48px));
    font-size: 26px;
    margin: 24px auto 18px;
  }
  .gacha-prize-images {
    gap: 10px;
    margin: 28px auto 38px;
  }
  .gacha-prize-images .gacha-prize-row {
    gap: 8px;
  }
  .gacha-prize-images img {
    background-color: transparent;
    padding: 0;
    border-radius: 8px;
    max-width: 40%;
    min-width: 100px;
  }
  .gacha-card {
    padding: 20px;
    margin: 20px auto;
  }
  .gacha-card-name {
    font-size: var(--gacha-card-name-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;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
  }
  .gacha-button-cancel,
  .gacha-button-confirm {
    font-size: 17px;
    padding: 12px 10px;
    min-width: 0;
    flex: 1;
    min-height: 50px;
    white-space: nowrap;
  }
  .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;
    height: 96vw;
  }
}

/* 480px以下 */
@media screen and (max-width: 480px) {
  .gacha-pt-text {
    font-size: var(--wk-font-min, 14px);
  }
  .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 {
    box-shadow:
      0 4px 0 var(--shadow-color),
      0 5px 10px rgba(0, 0, 0, 0.2);
  }
  .gacha-button-cancel {
    --shadow-color: #e6a3c4;
  }
  .gacha-button-confirm {
    --shadow-color: var(--wk-button-play-edge);
  }
  .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: calc(21px + env(safe-area-inset-top, 0px));
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.4),
      0 2px 5px rgba(0, 0, 0, 0.3);
  }
  .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-pt-text {
    font-size: var(--wk-font-min, 14px);
  }
  .gacha-main-button {
    --gacha-button-inline-padding: 8px;
  }
  .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;
  }
}

@media screen and (max-width: 300px) {
  .gacha-secondary-actions > .gacha-main-button {
    min-height: 58px;
    padding-right: 5px;
    padding-left: 5px;
    font-size: 16px;
    line-height: 1;
    white-space: nowrap;
  }
}

/* 481px〜600px（中型スマホ） */
@media screen and (min-width: 481px) and (max-width: 600px) {
  .gacha-modal-text {
    font-size: 18px;
  }
}

/* 賞品画像のタブレット・スマホ対応 */
@media screen and (max-width: 768px) {
  .gacha-prize-item::after {
    font-size: var(--wk-font-min, 14px);
    padding: 4px 8px;
    bottom: 14px;
    
    border-width: 1.5px;
  }
}
@media screen and (max-width: 600px) {
  .gacha-prize-item {
    width: clamp(110px, 43vw, 170px);
    flex-basis: clamp(110px, 43vw, 170px);
  }
  .gacha-prize-item img {
    max-width: 170px;
  }
  .gacha-prize-item::after {
    font-size: var(--wk-font-min, 14px);
    padding: 3px 6px;
    bottom: 12px;
    
    border-width: 1.5px;
  }
}
@media screen and (max-width: 400px) {
  .gacha-prize-item {
    width: clamp(95px, 43vw, 135px);
    flex-basis: clamp(95px, 43vw, 135px);
  }
  .gacha-prize-item img {
    max-width: 135px;
  }
  .gacha-prize-item::after {
    font-size: var(--wk-font-min, 14px);
    padding: 2px 4px;
    bottom: 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-close-bottom {
    font-size: 16px;
    padding: 12px 48px;
    min-height: 46px;
  }
  .gacha-collection-grid {
    gap: 10px;
  }
}

@media screen and (max-width: 480px) {
  .gacha-collection-grid {
    gap: 8px;
  }
}

/* ================================================
 * タッチデバイス：アクティブ状態をより明確に
 * ================================================ */
@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-collection-close-bottom:active {
    transform: scale(0.97);
  }
  .gacha-image-zoom-close:active {
    transform: scale(0.97);
  }
}


/* ================================================
 * ガチャ演出中：ヘッダー・フッター非表示
 * ================================================ */
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,
body.gacha-playing .mobile-category-nav {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  z-index: -1 !important;
}

/* ================================================
 * スマホ：SKIPボタン・ミュートボタンをヘッダー分下げる
 * ヘッダーが非表示になる前の一瞬も含め、常にヘッダー下に配置
 * ================================================ */
@media screen and (max-width: 768px) {
  .gacha-skip-button {
    top: auto;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    right: 20px;
  }
  .gacha-skip-button:active {
    top: auto;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .gacha-mute-btn {
    top: auto;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    left: 20px;
  }
  .gacha-mute-btn:active {
    top: auto;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }
}

/* 演出中の操作ボタン：PC/スマホ共通で動画のすぐ上に配置 */
.gacha-effect-overlay .gacha-btn-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(72vh, 72vw, 700px);
  flex-shrink: 0;
}
.gacha-effect-overlay .gacha-btn-row .gacha-mute-btn,
.gacha-effect-overlay .gacha-btn-row .gacha-skip-button {
  position: static;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
}
.gacha-effect-overlay .gacha-btn-row .gacha-mute-btn:active,
.gacha-effect-overlay .gacha-btn-row .gacha-skip-button:active {
  top: auto;
  bottom: auto;
}
@media screen and (max-width: 768px) {
  .gacha-effect-overlay .gacha-btn-row {
    width: 96vw;
  }
}
@media screen and (max-width: 480px) {
  .gacha-effect-overlay .gacha-btn-row {
    gap: 8px;
  }
  .gacha-effect-overlay .gacha-btn-row .gacha-mute-btn,
  .gacha-effect-overlay .gacha-btn-row .gacha-skip-button {
    font-size: var(--wk-font-control, 16px);
    padding: 8px 10px;
    min-width: 0;
  }
}

/* ================================================
 * タップハイライト削除：ガチャカード要素
 * ================================================ */
.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;
}

/* ================================================
 * 図鑑コンプリートバナー
 * stats（赤枠）直後・グリッドの上に表示
 * ================================================ */
.gacha-complete-banner {
  width: 100%;
  padding: 0;
  margin: 12px 0 0;
  display: block;
  line-height: 0;
  border-radius: 12px;
  overflow: hidden;
}

.gacha-complete-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
/* ================================================
 * 当選おめでとうバナー（S賞・A賞当選時に表示）
 * ボタンとカード一覧の間に挿入される
 * ================================================ */
.gacha-win-banner {
  display: block;
  width: 100%;
  max-width: 500px;
  height: auto;
  margin: 12px auto 4px;
  object-fit: contain;
  border-radius: 16px;
}
/* Final collection/history structure: header title only, stats/code in content cards. */

.gacha-collection-modal:not(#rush001-collectionModal) .gacha-complete-banner {
  margin: 14px 22px 18px;
}

.gacha-collection-modal:not(#rush001-collectionModal) .gacha-complete-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

@media (max-width: 480px) {
  .gacha-collection-modal:not(#rush001-collectionModal)
    .gacha-complete-banner {
    margin: 12px 12px 14px;
  }
}
/* Zukan completion ranking. */
/* 図鑑ランキング: 通常のパネルと独立モーダルの差分。 */
.gacha-zukan-ranking-panel {
  margin: 0 22px 16px;
  padding: 14px 16px;
  border: 2px solid #111;
  border-radius: 10px;
  background: #fff;
  box-shadow:
    0 4px 0 rgba(0, 0, 0, 0.14),
    0 12px 24px rgba(0, 0, 0, 0.08);
  font-family: var(--wk-record-font);
  font-weight: 700;
  line-height: 1.5;
}
.gacha-zukan-ranking-panel.is-standalone {
  width: auto;
  margin: 28px 22px 16px;
}
.gacha-collection-modal.gacha-zukan-ranking-modal {
  width: min(94vw, 760px);
}
.gacha-zukan-ranking-modal .gacha-collection-close-bottom {
  display: block;
  margin: 18px auto 0;
}
.gacha-collection-modal.is-prize-history-mode .gacha-zukan-ranking-panel {
  display: none;
  font-family: var(--wk-record-font);
  font-weight: 700;
  line-height: 1.5;
}
@media (max-width: 640px) {
  .gacha-zukan-ranking-panel.is-standalone {
    margin: 22px 12px 14px;
  }
}
@media (max-width: 480px) {
  .gacha-zukan-ranking-panel {
    padding: 12px;
    font-family: var(--wk-record-font);
  font-weight: 700;
  line-height: 1.5;
}
  .gacha-zukan-ranking-panel:not(.is-standalone) {
    margin: 0 12px 14px;
  }
}
.gacha-zukan-ranking-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e5e5;
  color: #111;
  font-weight: 900;
  text-align: center;
}
.gacha-zukan-ranking-head span {
  font-size: 19px;
  line-height: 1.3;
  white-space: nowrap;
}
.gacha-zukan-ranking-head strong {
  display: none;
}
.gacha-zukan-ranking-mine {
  margin: 14px 0 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #fff8cf;
  color: #111;
  font-size: var(--wk-record-period, 18px);
  font-weight: 900;
  line-height: 1.45;
  text-align: center;
}
.gacha-zukan-ranking-list {
  display: grid;
  gap: 12px;
}
.gacha-zukan-ranking-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 6px 12px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  background: #fff;
}
.gacha-zukan-ranking-row.is-mine {
  border: 3px solid #dc143c;
  background: #fff5f7;
  box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.14) inset;
}
.gacha-ranking-own-label {
  display: block;
  width: fit-content;
  margin: 0 0 5px;
  padding: 3px 7px;
  border-radius: 4px;
  background: #dc143c;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}
.gacha-result-summary {
  margin: 12px 8px;
  color: #b70843;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}
.gacha-zukan-ranking-rank {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-radius: 7px;
  background: #111;
  color: #fff;
  font-weight: 900;
  font-size: 18px;
}
.gacha-zukan-ranking-main strong {
  display: block;
  color: #dc143c;
  font-size: var(--wk-record-score, 28px);
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}
.gacha-zukan-ranking-main span,
.gacha-zukan-ranking-date {
  color: #555;
  font-size: var(--wk-record-date, 16px);
  font-weight: 900;
  line-height: 1.5;
  white-space: nowrap;
}
.gacha-zukan-ranking-main span {
  display: block;
  margin-top: 5px;
  line-height: 1.2;
}
.gacha-zukan-ranking-date {
  justify-self: start;
  text-align: left;
  white-space: nowrap;
  font-size: var(--wk-record-date, 16px);
  line-height: 1.5;
  grid-column: 2;
}
.gacha-zukan-ranking-empty {
  padding: 14px;
  border: 1px dashed #ddd;
  border-radius: 8px;
  text-align: center;
  color: #777;
  font-weight: 900;
  word-break: auto-phrase;
  text-wrap: balance;
}
.gacha-zukan-x-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 360px);
  min-height: 40px;
  margin: 12px auto 0;
  border: 2px solid #111;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: var(--wk-font-control, 18px);
  font-weight: 900;
  font-family: var(--wk-record-font);
}
.gacha-zukan-x-button.is-disabled,
.gacha-zukan-x-button:disabled {
  border-color: #aaa;
  background: #aaa;
  color: #fff;
  cursor: default;
}
@media (max-width: 480px) {
  .gacha-zukan-ranking-row {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 6px 12px;
    min-height: 60px;
    padding: 9px;
  }
  .gacha-zukan-ranking-head span {
    font-size: clamp(14px, 4.4vw, 17px);
  }
  .gacha-zukan-ranking-rank {
    font-size: 18px;
  }
  .gacha-zukan-ranking-main strong {
    font-size: var(--wk-record-score, 28px);
  }
  .gacha-zukan-ranking-date {
    grid-column: 2;
    justify-self: start;
    font-size: var(--wk-record-date, 16px);
    text-align: left;
    line-height: 1.5;
  white-space: nowrap;
}
}
/* Prize hit history cards for free gift gachas */
.gacha-collection-modal.is-prize-history-mode .gacha-complete-banner {
  display: none;
}
.gacha-collection-modal.is-prize-history-mode .gacha-collection-grid {
  width: min(100%, 860px);
  margin: 22px auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 300px));
  gap: 18px;
  align-items: stretch;
  justify-content: center;
}
.gacha-prize-history-section-title {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  padding: 10px 0;
  border-bottom: 2px solid var(--wk-button-history);
  color: #333;
  font-size: var(--wk-font-control, 18px);
  font-weight: 900;
  text-align: left;
}
.gacha-prize-history-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 100%;
  border: 2px solid #111;
  border-radius: 14px;
  background: #fff;
  box-shadow:
    0 10px 0 rgba(0, 0, 0, 0.14),
    0 18px 36px rgba(0, 0, 0, 0.18);
}
.gacha-prize-history-card.grade-s {
  border-color: #c69200;
  background: linear-gradient(180deg, #fff9d8 0%, #fff 48%, #fffaf0 100%);
}
.gacha-prize-history-card.grade-a {
  border-color: #b6bcc8;
  background: linear-gradient(180deg, #f6f8fc 0%, #fff 50%, #f7f7f7 100%);
}
.gacha-prize-history-ribbon {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  min-width: 58px;
  padding: 7px 10px;
  border: 2px solid #111;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
}
.gacha-prize-history-card.grade-s .gacha-prize-history-ribbon {
  background: #ffd942;
  color: #111;
}
.gacha-prize-history-card.grade-a .gacha-prize-history-ribbon {
  background: #e9edf4;
  color: #111;
}
.gacha-prize-history-image {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 5 / 7;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: #f2f2f2;
  cursor: pointer;
  overflow: hidden;
}
.gacha-prize-history-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.gacha-prize-history-image.is-locked {
  background: linear-gradient(135deg, #4c4c4c, #646464);
  color: rgba(255, 255, 255, 0.28);
  cursor: default;
}
.gacha-prize-history-image.is-locked span {
  font-size: 72px;
  font-weight: 900;
  line-height: 1;
}
.gacha-prize-history-body {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.92);
}
.gacha-prize-history-name {
  min-height: 1.4em;
  color: #111;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
}
.gacha-prize-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 8px;
  background: #fff;
}
.gacha-prize-history-row > span {
  color: #666;
  font-size: var(--wk-font-meta, 14px);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
}
.gacha-prize-history-row strong {
  min-width: 0;
  color: #111;
  font-family: var(--wk-record-font);
  font-size: var(--wk-record-date, 16px);
  font-weight: 900;
  line-height: 1.5;
  text-align: center;
  word-break: break-word;
}
.gacha-prize-history-x {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: var(--wk-font-control, 18px);
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow:
    0 5px 0 rgba(0, 0, 0, 0.28),
    0 10px 18px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  font-family: var(--wk-record-font);
}
.gacha-prize-history-x:active {
  transform: translateY(3px);
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.28),
    0 6px 12px rgba(0, 0, 0, 0.18);
}
.gacha-prize-history-empty-text,
.gacha-prize-history-error {
  color: #666;
  font-size: var(--wk-font-body, 16px);
  font-weight: 800;
  line-height: 1.55;
  text-align: center;
  word-break: auto-phrase;
  text-wrap: balance;
}
.gacha-prize-history-error {
  grid-column: 1 / -1;
  padding: 24px;
  border: 2px solid #111;
  border-radius: 12px;
  background: #fff;
  word-break: auto-phrase;
  text-wrap: balance;
}
@media (max-width: 640px) {
  .gacha-collection-modal.is-prize-history-mode .gacha-collection-grid {
    width: min(100%, 330px);
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 16px;
    justify-content: center;
  }
  .gacha-prize-history-card {
    border-radius: 12px;
  }
  .gacha-prize-history-name {
    font-size: 17px;
  }
}

/* Separate zukan ranking button and weekly modal. */

/* Center the close button in zukan ranking modals. */
.gacha-zukan-ranking-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 0;
}
.gacha-zukan-ranking-tab {
  min-height: 40px;
  border: 2px solid #111;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: var(--wk-font-control, 18px);
  font-weight: 900;
  cursor: pointer;
  font-family: var(--wk-record-font);
}
.gacha-zukan-ranking-tab.is-active {
  background: #111;
  color: #fff;
}

