/* ホーム「今週の絶対引くなガチャ」。中身は node tools/sync-gacha-warning.mjs が index.html に書く。 */
.gacha-warning {
  --gw-surface: #17181c;
  --gw-surface-2: #1f2025;
  --gw-text: #f4f2f1;
  --gw-muted: #b9b6b5;
  --gw-rule: rgba(255, 255, 255, .13);
  --gw-critical: #ff7a70;
  --gw-good: #3bbd8f;
  --gw-neutral: #6d6b6f;
  width: min(1040px, calc(100% - 24px));
  margin: 18px auto 0;
  color: var(--gw-text);
  font-family: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}
.gacha-warning .gacha-warning__title {
  border-left-color: var(--gw-critical);
}
.gacha-warning__panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 0 24px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 122, 112, .5);
  border-radius: 12px;
  background: var(--gw-surface);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .25);
  text-align: left;
}
.gacha-warning__verdict {
  display: flex;
  grid-column: 1;
  grid-row: 1 / span 2;
  flex-direction: column;
}
/* 公式バナーは切り抜かない（画像内の文字が切れるため）。 */
.gacha-warning__banner,
.gacha-warning__alt-banner {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: #0e0e0e;
}
.gacha-warning__banner { margin-bottom: 12px; }
.gacha-warning__banner img,
.gacha-warning__alt-banner img {
  display: block;
  width: 100%;
  height: auto;
}
.gacha-warning__head {
  display: flex;
  gap: 14px;
  align-items: center;
}
.gacha-warning__stamp {
  flex: none;
  padding: 5px 10px 6px;
  border: 2px solid var(--gw-critical);
  border-radius: 6px;
  color: var(--gw-critical);
  font-family: "Zen Maru Gothic", "M PLUS Rounded 1c", "Yu Gothic", sans-serif;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: .06em;
  transform: rotate(-5deg);
}
.gacha-warning__name {
  margin: 0;
  color: var(--gw-text);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}
.gacha-warning__meta {
  margin: 3px 0 0;
  color: var(--gw-muted);
  font-size: 13px;
  line-height: 1.4;
}
.gacha-warning__hook {
  margin: 14px 0 0;
  color: var(--gw-text);
  font-size: 21px;
  font-weight: 800;
  line-height: 1.4;
}
/* 文節の切れ目でだけ改行する。 */
.gacha-warning__name span,
.gacha-warning__meta span,
.gacha-warning__hook span,
.gacha-warning__reasons span,
.gacha-warning__alt-text b span,
.gacha-warning__alt-detail span,
.gacha-warning__note span { display: inline-block; }
.gacha-warning__tally {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  margin: 10px 0 0;
  padding: 0;
  color: var(--gw-muted);
  font-size: 13px;
  list-style: none;
}
.gacha-warning__tally li {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  white-space: nowrap;
}
.gacha-warning__tally b {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.gacha-warning__tally .is-s b { background: #7b1fa2; }
.gacha-warning__tally .is-a b { background: #c9303d; }
.gacha-warning__tally .is-b b { background: #3d6f8e; }
.gacha-warning__tally .is-c b { background: #1f7f74; }
.gacha-warning__tally .is-none b { width: auto; padding: 0 5px; background: #4a494d; font-weight: 700; }
.gacha-warning__tally .is-c { color: var(--gw-text); font-weight: 800; }
.gacha-warning__cards {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.gacha-warning__card {
  position: relative;
  display: block;
  aspect-ratio: 498 / 524; /* カード画像と同じ比率にして、下の機体名を切らない */
  overflow: hidden;
  border-radius: 8px;
  background: #0e0e0e;
}
.gacha-warning__card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gacha-warning__card span {
  position: absolute;
  right: 3px;
  bottom: 24%; /* 機体名の帯のすぐ上 */
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: #1f7f74;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.gacha-warning__more { display: none; }
.gacha-warning__reasons {
  margin: 12px 0;
  padding: 0;
  color: var(--gw-text);
  font-size: 14px;
  line-height: 1.6;
  list-style: none;
}
.gacha-warning__reasons li + li { margin-top: 4px; }
.gacha-warning__compare {
  grid-column: 2;
  grid-row: 1;
}
.gacha-warning__toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--gw-rule);
  border-radius: 8px;
  background: var(--gw-surface-2);
  color: var(--gw-text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.gacha-warning__toggle::-webkit-details-marker { display: none; }
.gacha-warning__toggle::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.gacha-warning__toggle:focus-visible {
  outline: 2px solid var(--gw-text);
  outline-offset: 2px;
}
.gacha-warning__compare[open] > .gacha-warning__toggle { margin-bottom: 14px; }
.gacha-warning__compare[open] > .gacha-warning__toggle::after { transform: translateY(2px) rotate(225deg); }
.gacha-warning__compare-title {
  margin: 0;
  color: var(--gw-text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
}
.gacha-warning__rows {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.gacha-warning__row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.gacha-warning__row + .gacha-warning__row { margin-top: 10px; }
.gacha-warning__thumb {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}
.gacha-warning__row-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  align-items: center;
  justify-content: space-between;
}
.gacha-warning__row-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}
.gacha-warning__flag {
  padding: 0 7px;
  border-radius: 999px;
  color: #101114;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  white-space: nowrap;
}
.is-best .gacha-warning__flag { background: var(--gw-good); }
.is-worst .gacha-warning__flag { background: var(--gw-critical); }
.gacha-warning__row-note {
  margin: 0;
  color: var(--gw-muted);
  font-size: 12px;
  line-height: 1.4;
}
.gacha-warning__meter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
  margin-top: 3px;
}
.gacha-warning__track {
  position: relative;
  height: 10px;
  border-left: 1px solid rgba(255, 255, 255, .28);
}
.gacha-warning__bar {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: var(--gw-neutral);
}
.is-best .gacha-warning__bar { background: var(--gw-good); }
.is-worst .gacha-warning__bar { background: var(--gw-critical); }
.gacha-warning__value {
  color: var(--gw-text);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.gacha-warning__alt {
  display: grid;
  grid-column: 2;
  grid-row: 2;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 10px 12px 10px 10px;
  border-left: 3px solid var(--gw-good);
  border-radius: 0 8px 8px 0;
  background: var(--gw-surface-2);
  color: var(--gw-text);
}
.gacha-warning__alt-banner { border-radius: 6px; }
.gacha-warning__alt-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}
.gacha-warning__alt-label {
  display: inline-block;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--gw-good);
  color: #101114;
  font-size: 12px;
  font-weight: 800;
  line-height: 20px;
}
.gacha-warning__alt-text b {
  display: block;
  margin-top: 3px;
  font-weight: 800;
}
.gacha-warning__alt-detail {
  display: block;
  margin-top: 1px;
  color: var(--gw-muted);
  font-size: 12px;
}
.gacha-warning__note {
  margin: auto 0 0;
  color: var(--gw-muted);
  font-size: 11px;
  line-height: 1.5;
}
.gacha-warning__fine {
  margin: 8px 0 0;
  color: var(--gw-muted);
  font-size: 11px;
  line-height: 1.6;
}
.gacha-warning__fine a { color: var(--gw-text); }

/* 広い画面では比較を常に開いておく（開くのはセクション内の小さなスクリプト）。
   スクリプトが動かないときは閉じたままなので、開くボタンを残す。 */
@media (min-width: 861px) {
  .gacha-warning__compare[open] > .gacha-warning__toggle { display: none; }
}
@media (max-width: 860px) {
  .gacha-warning__panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    gap: 12px 0;
    padding: 14px;
  }
  .gacha-warning__verdict,
  .gacha-warning__alt,
  .gacha-warning__compare {
    grid-column: 1;
    grid-row: auto;
  }
  .gacha-warning__alt { margin-top: 0; }
}
/* 横幅いっぱいのバナーだと縦に長くなりすぎるので、判定をバナーの横に置く。 */
@media (min-width: 601px) and (max-width: 860px) {
  .gacha-warning__verdict {
    display: grid;
    grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
    column-gap: 16px;
    align-content: start;
  }
  .gacha-warning__head { gap: 10px; }
  .gacha-warning__stamp { font-size: 17px; }
  .gacha-warning__name { font-size: 16px; }
  .gacha-warning__meta { font-size: 12px; }
  .gacha-warning__banner {
    grid-row: 1 / span 3;
    align-self: start;
    margin-bottom: 0;
  }
  .gacha-warning__head,
  .gacha-warning__hook,
  .gacha-warning__tally { grid-column: 2; }
  .gacha-warning__cards,
  .gacha-warning__reasons,
  .gacha-warning__note { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .gacha-warning__stamp { font-size: 17px; }
  .gacha-warning__name { font-size: 16px; }
  .gacha-warning__hook { font-size: 18px; }
  .gacha-warning__alt {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px;
  }
  .gacha-warning__row {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 8px;
  }
  .gacha-warning__cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gacha-warning__cards li:nth-child(n + 4):not(.gacha-warning__more) { display: none; }
  .gacha-warning__more {
    display: grid;
    place-items: center;
    aspect-ratio: 498 / 524;
    border-radius: 8px;
    background: var(--gw-surface-2);
    color: var(--gw-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
  }
}
@media (max-width: 360px) {
  .gacha-warning__head { gap: 10px; }
  .gacha-warning__stamp {
    padding: 4px 8px 5px;
    font-size: 15px;
  }
  .gacha-warning__name { font-size: 14.5px; }
}
