@charset "UTF-8";

/* ==========================================================================
   キャラクター一覧
   ========================================================================== */
.p-chara {
  padding: 80px 20px 160px;
  background: #000 url("../images/character/bg_dots.webp") center 150px / 1440px auto repeat-y;
}
.p-chara__lead {
  width: 662px;
  max-width: 100%;
  margin: 60px auto 0;
}
.p-chara__list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  max-width: 1000px;
  margin: 30px auto 0;
}

/* カード（一覧・モーダル下サムネイル共通） */
.c-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  width: 100%;
  aspect-ratio: 1;
  padding: 20px 10px;
  border: 4px solid #fff;
  text-decoration: none;
  transition: transform .15s, filter .15s;
}
.c-card--red { background: var(--c-red); }
.c-card--blue { background: var(--c-blue); }
.c-card--orange { background: var(--c-orange); }
a.c-card:hover,
button.c-card:hover { transform: translateY(-4px); filter: brightness(1.1); }
.c-card__no {
  position: absolute;
  left: 3px;
  top: 0;
  font-family: var(--f-display);
  font-size: 50px;
  line-height: .81;
}
.c-card__sprite { width: 90px; height: 90px; }
.c-card__name {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.1;
  text-align: center;
}

@media (max-width: 767px) {
  .p-chara { padding: 40px 8px 80px; background-size: 800px auto; background-position: center 100px; }
  .p-chara__lead { width: 92%; margin-top: 40px; }
  .p-chara__list { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 16px; }
  /* SP はデザインに合わせ、ドット絵をカード幅の半分まで大きくする */
  .c-card { gap: 10px; padding: 12px 6px 18px; border-width: 3px; }
  .c-card__no { font-size: 44px; }
  .p-chara__list .c-card { padding-top: 38px; } /* 番号の下にはドット絵を入れない */
  .p-chara__list .c-card__sprite { flex-shrink: 1; width: 50%; height: auto; min-height: 0; aspect-ratio: 1; } /* 名前が2行の時は縮む */
  .c-card__name { font-size: clamp(12px, 3.6vw, 14px); word-break: keep-all; overflow-wrap: anywhere; } /* スペースの位置で改行 */
}

/* ==========================================================================
   詳細モーダル
   ========================================================================== */
.p-modal {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  overflow: hidden;
  touch-action: manipulation; /* 前後ボタンの連打やボタン周りのタップでズームしないように */
}
.p-modal::backdrop {
  background: rgba(0, 0, 0, .59);
  -webkit-backdrop-filter: blur(27px);
  backdrop-filter: blur(27px);
}
.p-modal__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px 0 160px;
  pointer-events: none;
}
.p-modal__inner > * { pointer-events: auto; }

.p-modal__main {
  display: flex;
  align-items: center;
  gap: 20px;
}
.p-modal__nav { flex-shrink: 0; transition: opacity .2s; }
.p-modal__nav:hover { opacity: .8; }
.p-modal__nav img { width: 60px; height: 60px; }

.p-modal__card {
  display: flex;
  align-items: stretch;
  width: 1000px;
  max-height: calc(100vh - 260px);
  padding: 20px;
  border: 8px solid var(--c-red-light);
  background: var(--c-red);
  overflow-y: auto;
}
.p-modal__card:focus { outline: none; } /* 初期フォーカス用（tabindex="-1"）。枠は出さない */
.p-modal[data-color="blue"] .p-modal__card { background: var(--c-blue); border-color: #70c1ff; }
.p-modal[data-color="orange"] .p-modal__card { background: var(--c-orange); border-color: #ffa54d; }

.p-modal__profile {
  position: relative;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 0;
  min-width: 0;
}
.p-modal__no {
  position: absolute;
  left: -8px;
  top: 0;
  font-family: var(--f-display);
  font-size: 149px;
  line-height: .7;
  opacity: .28;
  pointer-events: none;
}
.p-modal__name {
  position: relative;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 58px;
  line-height: 1.1;
  text-align: center;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.p-modal__sprite { width: 200px; height: 200px; flex-shrink: 0; }
.p-modal__special {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.p-modal__special-label {
  padding: 0 6px;
  border: 2px solid #fff;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
}
.p-modal__special-name { font-weight: 900; font-size: 28px; line-height: 1.2; }
/* 改行位置を指定した超人名・必殺技名（characters.js の nameWrap / specialWrap） */
.u-wrap-unit { display: inline-block; }
@media (min-width: 768px) {
  .u-wrap-unit { white-space: nowrap; }
}
.p-modal__command { font-weight: 700; font-size: 22px; line-height: 1.3; }

.p-modal__detail {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  min-width: 0;
}
.p-modal__movie {
  position: relative;
  display: flex;
  justify-content: center;
  height: 300px;
  border: 1px solid #fff;
  background: #000;
}
.p-modal__movie[hidden] { display: none; }
.p-modal__movie-img { height: 100%; width: auto; max-width: none; object-fit: contain; }
.p-modal__movie-label {
  position: absolute;
  right: -10px;
  bottom: -26px;
  width: 198px;
}
.p-modal__text {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.3;
}

.p-modal__close {
  margin-top: 20px;
  font-family: var(--f-display);
  font-size: 40px;
  line-height: 1;
}
.p-modal__close:hover { color: var(--c-yellow); }

/* モーダル下のサムネイル（PCのみ） */
.p-modal__thumbs {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 5px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.p-modal__thumbs li { flex: 0 0 calc((100% - 63px) / 10); }
.p-modal__thumbs .c-card {
  gap: 8px;
  padding: 14px 7px;
  border-width: 3px;
}
.p-modal__thumbs .c-card.is-current { opacity: .6; }
.p-modal__thumbs .c-card__no { font-size: 36px; }
.p-modal__thumbs .c-card__sprite { width: 64px; height: 64px; }
.p-modal__thumbs .c-card__name { font-size: 11px; }

@media (max-width: 1180px) {
  .p-modal__card { width: calc(100vw - 200px); }
}

@media (max-width: 767px) {
  .p-modal__inner { justify-content: flex-start; padding: 100px 20px 20px; }
  .p-modal__thumbs { display: none; }
  .p-modal__main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px 12px;
    width: 100%;
  }
  .p-modal__card {
    grid-column: 1 / -1;
    grid-row: 1;
    flex-direction: column;
    width: 100%;
    max-height: calc(100dvh - 240px);
    padding: 14px 16px 20px;
    border-width: 4px;
  }
  .p-modal__nav { grid-row: 2; }
  .p-modal__nav--prev { justify-self: end; }
  .p-modal__nav--next { justify-self: start; }
  .p-modal__nav img { width: 44px; height: 44px; }
  .p-modal__profile { gap: 10px; padding: 0; flex: none; }
  .p-modal__no { left: -2px; font-size: 66px; }
  .p-modal__name { font-size: 26px; }
  .p-modal__sprite { width: 100px; height: 100px; }
  .p-modal__special { gap: 4px; }
  .p-modal__special-label { font-size: 11px; }
  .p-modal__special-name { font-size: 18px; }
  .p-modal__command { font-size: 14px; }
  .p-modal__detail { flex: none; gap: 12px; margin-top: 18px; }
  /* SP は枠を必殺技動画（1150×1080）と同じ比率にして、幅 80% で中央に表示 */
  .p-modal__movie { width: 80%; height: auto; margin-inline: auto; aspect-ratio: 1150 / 1080; }
  .p-modal__movie-img { width: 100%; height: 100%; }
  .p-modal__movie-label { right: -8px; bottom: -14px; width: 92px; }
  .p-modal__text { font-size: 14px; line-height: 1.5; }
  .p-modal__close {
    position: absolute;
    right: 16px;
    bottom: 16px;
    margin: 0;
    font-size: 24px;
  }
}
