/* キャラクターのカテゴリトップ（デモ）
   土台は style.css（トヨタマさんのページ）。ここには、このページだけの組みを置く
   1キャラ1全画面。左に名前の板、右寄せのテープのメニュー */

.page-characters {
  --blue: #1f6fd6;
  --pink: #c2416c;
}

/* 名前の板は左上、メニューは右下（トヨタマさんのページの最初の画面と同じ組み） */
.chara {
  align-items: stretch;
  gap: 24px;
}

/* ── 最初の画面の壁画 ──
   何も描かれていない壁の写真の上に、キャラのグラフィティ（白地）を乗算で重ねる。白い所は消え、壁の明暗が透けて塗料に見える。
   人数に合わせて横に等分して並べる。キャラを足すときは HTML の .mural に li を1つ足すだけ */
.mural {
  position: absolute;
  top: calc(var(--header-h) + 4svh);
  right: 2vw;
  left: 40vw;
  /* 右下のテープのメニュー（4本と下の余白で、画面の下から約380px）に重ならない高さにする */
  height: min(56svh, calc(100svh - var(--header-h) - 4svh - 400px));
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 2vw;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mural li {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mural img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  opacity: 0.94;
}

/* 本文の区画（だれ？、スタンプ、買う）では、板を左に寄せ、空いた右の帯に区画ごとのポーズを描く。
   板の後ろに壁画が隠れないようにする。スマホと縦長の画面は板が全幅なので、この組みを使わない */
@media (min-width: 1000px) and (min-aspect-ratio: 3/4) {
  /* PCの最初の画面は、右下のテープのメニュー（幅約240px）の左まで壁画を伸ばし、画面の高さいっぱいに描く */
  .mural:not(.mural--side) {
    top: calc(var(--header-h) + 3svh);
    left: 36vw;
    right: max(310px, 17vw);
    height: calc(100svh - var(--header-h) - 8svh);
  }

  .mural--side {
    top: calc(var(--header-h) + 4svh);
    left: 70vw;
    right: 1vw;
    height: 84svh;
  }

  .screen:not(.hero):not(.chara) > .screen-panel {
    width: min(1200px, 72vw);
    margin-right: auto;
  }
}

/* 6人以上になったら、壁画の幅に入りきらないので2段にする */
.mural:has(li:nth-child(6)) {
  flex-wrap: wrap;
}

.mural:has(li:nth-child(6)) li {
  flex-basis: 30%;
  height: 50%;
}

.top-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  /* 一番長い行「ムジンケイカクプロの」10字が、板の内側（最大480px）に収まる大きさ。46px×10字＝460px */
  font-size: clamp(26px, 3.4vw, 46px);
  line-height: 1.25;
  word-break: keep-all;
}

/* テープの数は人数で変わるので、赤は最後の「買う」のテープに付ける */
.top-hero .menu-tape:nth-child(3) {
  background: var(--tape);
  color: var(--ink);
}

.top-hero .menu-tape:nth-child(4) {
  --tilt: 1deg;
}

.menu-tape.menu-tape--buy {
  background: var(--red);
  color: #fff;
}

/* このページは全画面ごとに右下にメニューがあるので、「ページの先頭へ」は左下に置く */
.page-characters .to-top {
  left: 16px;
  right: auto;
}

.chara-words {
  max-width: 560px;
  min-width: 0;
}

.chara-eyebrow {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 12px;
  background: var(--concrete);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.chara-count {
  margin: 0 0 4px;
  color: #5b6064;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* 板の内側の幅（最大480px）に一番長い行が収まる大きさ
   「ラックサーバー」7字 × 64px ＝ 448px */
.chara-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 64px);
  line-height: 1.15;
  word-break: keep-all;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

/* 1字ずつ出す演出は文字を1字ずつの箱に分けるため、語の切れ目の指定が効かない。
   名前は <br> で語の切れ目に行を分け、行の中では折り返さない */
.chara-name .fx-line {
  white-space: nowrap;
}

.chara-name--red {
  color: var(--red);
}

.chara-name--blue {
  color: var(--blue);
}

.chara-name--pink {
  color: var(--pink);
}

.chara-nick {
  margin: 6px 0 0;
  font-weight: 700;
}

.chara-lead {
  max-width: 34em;
  margin: 12px 0 0;
}

.chara-lead + .chara-lead {
  margin-top: 4px;
}

@media (max-width: 759px) {
  .chara {
    justify-content: flex-end;
    gap: 14px;
  }

  .chara-eyebrow {
    font-size: 13px;
  }

  /* スマホ用の背景はキャラが上の半分にいるので、板とメニューを画面の下40%に収める */
  .chara-words.panel-light {
    padding: 12px 16px;
  }

  .chara-eyebrow {
    margin-bottom: 4px;
    padding: 2px 10px;
  }

  .chara-count {
    display: none;
  }

  .chara-name {
    font-size: clamp(26px, 7.4vw, 32px);
  }

  .chara-nick {
    margin-top: 2px;
    font-size: 14px;
  }

  .chara-lead {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.6;
  }

  .chara .content-menu {
    gap: 8px;
  }

  .chara .menu-tape {
    padding: 6px 16px;
    font-size: 15px;
  }

  /* スマホの壁画は、ヘッダーの下から画面の上40%に並べる。板とメニューは下に置く */
  .mural {
    top: calc(var(--header-h) + 2svh);
    left: 4vw;
    right: 4vw;
    height: 40svh;
  }

  .top-title {
    font-size: clamp(22px, 6.4vw, 28px);
  }
}

/* パンくず。項目ごとに折り返し、語の途中で切らない */
.breadcrumb {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.8;
}

.breadcrumb a,
.breadcrumb span {
  display: inline-block;
  word-break: keep-all;
  white-space: nowrap;
}

/* セットのページの「〇〇のページへ戻る」。語の切れ目（<wbr>）でだけ折り返す */
.back-link {
  word-break: keep-all;
}

/* スタンプ一覧の表。個数と価格は右寄せ */
.table-scroll {
  overflow-x: auto;
  max-width: 100%;
}

.sticker-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.sticker-table th,
.sticker-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #c9c9c4;
  text-align: left;
  white-space: nowrap;
}

.sticker-table .num {
  text-align: right;
}

/* 一覧のページは表の板が広いので、壁画を板の右に寄せる（スマホは上に並べるので変えない） */
@media (min-width: 760px) and (min-aspect-ratio: 3/4) {
  .scene-bg[data-scene="list"] .mural {
    left: 66vw;
  }
}

/* 5行が1画面に収まるよう、表の中の購入ボタンは小さくする */
.sticker-table .buy-link {
  min-height: 0;
  padding: 6px 14px;
  font-size: 13px;
}

.sticker-table td {
  padding-top: 6px;
  padding-bottom: 6px;
}

/* スマホは表を横に送らせず、1セット1行の札にする。キャラ名はセット名に入っているので省く */
@media (max-width: 759px) {
  .sticker-table thead,
  .sticker-table td:first-child {
    display: none;
  }

  .sticker-table,
  .sticker-table tbody {
    display: block;
  }

  .sticker-table tr {
    display: grid;
    grid-template-columns: auto auto auto 1fr;
    align-items: center;
    gap: 2px 10px;
    padding: 8px 0;
    border-bottom: 1px solid #c9c9c4;
  }

  .sticker-table td {
    padding: 0;
    border: 0;
    font-size: 13px;
  }

  .sticker-table td:nth-child(2) {
    grid-column: 1 / -1;
    white-space: normal;
    word-break: keep-all;
    font-size: 14px;
  }

  .sticker-table td:last-child {
    justify-self: end;
  }
}

@media (min-width: 760px) and (max-aspect-ratio: 3/4) {
  .mural {
    left: 6vw;
    right: 6vw;
    height: 40svh;
  }
}
