/* ================================================================
   Gacha Builder — ポケット遊園地（2026-10-18 デザイナーの案 h1 から組んだ）
   style.css のあとに読む。見た目だけを上書きする
   ============================================================== */

:root {
  --yc-ink:     #3b2a20;
  --yc-ink-2:   #6b5243;
  --yc-cream:   #fef5dd;
  --yc-cream-2: #fbe8c3;
  --yc-paper:   #fffbf0;
  --yc-coral:   #fb8269;
  --yc-red:     #e8455c;
  --yc-red-d:   #a02235;
  --yc-pink:    #fb5480;
  --yc-pink-d:  #bd2f5b;
  --yc-gold:    #ffcf4a;
  --yc-gold-d:  #d99412;
  --yc-night:   #1b2150;
  --yc-blue:    #3f78dc;
  --yc-purple:  #7c4fd2;
  --yc-green:   #3fa34d;
  --yc-orange:  #f08a1c;
  --focus:      #1e66ff;
}

/* ---------- 背景: 夜の遊園地 ---------- */
body.gacha-builder-page::before,
.gacha-builder-page:not(body):not(html)::before {
  background:
    linear-gradient(180deg, rgba(20, 24, 70, 0.25), rgba(20, 24, 70, 0.55)),
    url('../images/yuenchi/keshiki.jpg') center top / cover no-repeat,
    var(--yc-night);
}
html.gacha-builder-page,
body.gacha-builder-page {
  background-color: var(--yc-night) !important;
  background-image: none !important;
}
/* 本物のページ（html にも印が付く）では紺は html が持つ。body まで紺にすると、景色（body::before）の上に紺が重なって景色が消える */
html.gacha-builder-page body {
  background-color: transparent !important;
  background-image: none !important;
}
.gacha-builder-page:not(body):not(html) { background-color: var(--yc-night); }
/* ページ全体に景色が敷けているときは、入れ物の中にもう1枚敷かない */
body.gacha-builder-page .gacha-builder-page:not(body)::before { background: none; }
body.gacha-builder-page .gacha-builder-page:not(body) { background-color: transparent; }

/* ================================================================
   作る画面
   ============================================================== */
.gb-app.yc-wizard {
  /* hidden だと下の「つぎへ」が画面の下に貼りつかないので clip にする */
  overflow: clip !important;
  max-width: 820px;
  padding: 16px 16px 0;
  color: var(--yc-ink);
  font-size: 16px;
  /* 中身が画面より短い段でも、下の帯を画面のいちばん下に置く（知らせが帯の上に出て、つぎへの字にかぶらないように） */
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}
.gb-app.yc-wizard > .yc-head,
.gb-app.yc-wizard > .yc-panel,
.gb-app.yc-wizard > .yc-nav { width: 100%; }
.gb-app.yc-wizard > .yc-tents { width: calc(100% + 20px); }
@media (min-width: 640px) { .gb-app.yc-wizard > .yc-tents { width: 100%; } }

/* 題 */
.yc-head { margin: 0 auto 10px; }
.yc-title {
  position: relative;
  width: min(100%, 560px);
  margin: 0 auto;
  aspect-ratio: 743 / 207;
  background: url('../images/yuenchi/title.png') center / 100% 100% no-repeat;
  /* 字の大きさを、画面でなく絵の幅に合わせる */
  container-type: inline-size;
}
.yc-title-text,
.yc-title-sub {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  transform: translateY(-50%);
}
.yc-title-text {
  top: 39%;
  margin: 0;
  /* 9文字が絵のクリーム色（幅の 79%）に収まる大きさ */
  font-size: min(8cqw, 46px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}
/* WordPress の本文は h2 の背景を消すので、色は中の span に付ける */
.yc-title-text span {
  display: inline-block;
  padding: 0 2px 2px;
  background: linear-gradient(90deg, #ff4f8b 0%, #ff8a1f 30%, #2fb24a 55%, #2f8be6 78%, #9a4fe0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 #fff) drop-shadow(0 2px 0 #7a2440);
}
/* style.css が見出しをクリーム色にそろえているので、遊園地では濃い字に戻す */
.gacha-builder-page .gb-app.yc-wizard h3.gb-step-title { color: var(--yc-ink) !important; }
.yc-title-sub {
  top: 79%;
  margin: 0;
  font-size: clamp(12px, 3vw, 17px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--yc-red-d);
  white-space: nowrap;
}
/* スマホの幅は、デザイナーがせまい幅のために描いた看板にする（もとの看板だと、リボンに読める大きさの字が入らない）。
   字の位置は絵のクリーム色の所の真ん中（看板 y 37.5〜62.5% / リボン y 73.8〜84.5%） */
@media (max-width: 639px) {
  .yc-title {
    /* 左右の余白（16px）まで使って、リボンの字を大きくする */
    width: min(calc(100% + 32px), 600px);
    margin: 0 max(-16px, calc((100% - 600px) / 2));
    aspect-ratio: 898 / 400;
    background-image: url('../images/yuenchi/title-sumaho.png');
  }
  .yc-title-text { top: 50%; font-size: 7.2cqw; }
  .yc-title-sub { top: 79.2%; font-size: min(3.8cqw, 22px); }
}

/* テントの並び（どこまで進んだか） */
.yc-tents {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  max-width: 600px;
  /* スマホでは横の余白まで使って、テントの字を大きくする */
  margin: 0 -10px 6px;
}
@media (min-width: 640px) { .yc-tents { margin: 0 auto 6px; } }
.yc-tent {
  position: relative;
  aspect-ratio: 165 / 256;
  padding: 0;
  border: 0;
  background: center bottom / 100% 100% no-repeat;
  cursor: pointer;
  font-family: var(--font-jp);
  color: var(--yc-ink);
  filter: saturate(0.7) brightness(0.82);
  transform: translateY(6px) scale(0.94);
  transition: transform 0.2s var(--ease-out), filter 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.yc-tent:nth-child(1) { background-image: url('../images/yuenchi/yatai1.png'); }
.yc-tent:nth-child(2) { background-image: url('../images/yuenchi/yatai2.png'); }
.yc-tent:nth-child(3) { background-image: url('../images/yuenchi/yatai3.png'); }
.yc-tent:nth-child(4) { background-image: url('../images/yuenchi/yatai4.png'); }
.yc-tent:nth-child(5) { background-image: url('../images/yuenchi/yatai5.png'); }
.yc-tent.is-done { filter: none; }
.yc-tent.is-current {
  filter: drop-shadow(0 0 10px rgba(255, 214, 90, 0.95));
  transform: translateY(-2px) scale(1.04);
  z-index: 1;
}
.yc-tent:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-radius: 8px; }

/* 旗の数字は絵に描かれているので、正しい数字の札でおおう */
.yc-tent-no {
  position: absolute;
  top: 1%;
  left: 47%;
  width: 34%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--yc-gold);
  border: 2px solid var(--yc-red-d);
  font-size: clamp(12px, 3.4vw, 18px);
  font-weight: 700;
  line-height: 1;
  color: var(--yc-red-d);
}
.yc-tent-name {
  position: absolute;
  left: 1%;
  right: 1%;
  top: 41%;
  /* 字を大きくすると絵の札からはみ出すので、名前の札を重ねる */
  padding: 3px 0;
  border-radius: 6px;
  background: var(--yc-paper);
  box-shadow: 0 1px 0 rgba(120, 70, 30, 0.25);
  /* 320 の幅でも「えんしゅつ」が札に収まる大きさ（12px） */
  font-size: clamp(12px, 3.7vw, 19px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.06em;
  text-align: center;
  white-space: nowrap;
}
/* 窓の絵（デザイナーの絵から切り出し。2 は本物のツキモノ） */
.yc-tent::before {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  top: 59%;
  bottom: 13%;
  background: center / contain no-repeat;
}
.yc-tent:nth-child(1)::before { background-image: url('../images/yuenchi/mado1.png'); }
.yc-tent:nth-child(2)::before { background-image: url('../images/yuenchi/mado2.png'); }
.yc-tent:nth-child(3)::before { background-image: url('../images/yuenchi/mado3.png'); }
.yc-tent:nth-child(4)::before { background-image: url('../images/yuenchi/mado4.png'); }
.yc-tent:nth-child(5)::before { background-image: url('../images/yuenchi/mado5.png'); }
/* すんだ印は、窓の絵を隠さないように右下の小さな札にする */
.yc-tent.is-done:not(.is-current)::after {
  content: "";
  position: absolute;
  right: 6%;
  top: 74%;
  width: 24%;
  aspect-ratio: 1;
  box-shadow: 0 0 0 2px #fff;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 70% no-repeat,
    var(--yc-green);
}

/* 段の入れ物 */
.yc-panel {
  position: relative;
  margin: 0 auto;
  max-width: 760px;
}
.yc-wizard .gb-step { display: none; }
.yc-wizard .gb-step.is-current { display: block; animation: yc-in 0.25s var(--ease-out); }
@keyframes yc-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.yc-wizard .gb-step {
  margin: 0;
  padding: 0 0 18px;
  background: var(--yc-cream);
  border: 6px solid var(--yc-coral);
  border-top: 0;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 0 0 2px var(--yc-red-d), 0 12px 30px rgba(10, 10, 40, 0.45);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.yc-wizard .gb-step > :not(.gb-step-head) { margin-left: 14px; margin-right: 14px; }

/* 屋根と、STEP の札と題 */
.yc-wizard .gb-step-head {
  position: relative;
  display: block;
  margin: 0 -14px 14px;
  aspect-ratio: 1000 / 183;
  background: url('../images/yuenchi/yane.png') center bottom / 100% 100% no-repeat;
}
.yc-wizard .gb-step-label {
  position: absolute;
  left: 34%;
  right: 34%;
  top: 4%;
  height: 22%;
  display: grid;
  place-items: center;
  font-family: var(--font-jp);
  font-style: normal;
  /* 赤い札の高さに字の外枠が収まる大きさ */
  font-size: clamp(12px, 3.6vw, 22px);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  color: #fff;
  text-shadow: 0 1px 0 var(--yc-red-d);
}
.yc-wizard .gb-step-title {
  position: absolute;
  left: 21%;
  right: 21%;
  top: 33%;
  height: 50%;
  display: grid;
  place-items: center;
  font-size: clamp(16px, 5.2vw, 30px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.04em;
  color: var(--yc-ink);
  white-space: nowrap;
  outline: none;
}

.yc-wizard .gb-hint {
  font-size: 15px;
  line-height: 1.7;
  color: var(--yc-ink-2);
  font-weight: 700;
  text-align: center;
  margin-bottom: 14px;
}

/* STEP 1 えんしゅつ */
.yc-wizard .gb-style-grid { gap: 8px; }
.yc-wizard .gb-style-card {
  padding: 8px clamp(3px, 1.6vw, 6px) 16px;
  background: var(--yc-paper);
  border: 3px solid var(--yc-cream-2);
  border-radius: 16px;
  box-shadow: 0 3px 0 rgba(120, 70, 30, 0.18);
}
.yc-wizard .gb-style-card:hover { background: #fff; border-color: var(--yc-gold); }
.yc-wizard .gb-style-card:has(input:checked) {
  background: #fff6cf;
  border-color: var(--yc-gold);
  box-shadow: 0 0 0 3px #fff, 0 0 18px 4px rgba(255, 196, 40, 0.85);
  transform: translateY(-2px);
}
.yc-wizard .gb-style-card:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.yc-wizard .gb-style-icon {
  width: 100%;
  height: auto;
  margin: 0 0 8px;
  border-radius: 10px;
  overflow: hidden;
}
.yc-wizard .gb-style-icon img { display: block; width: 100%; height: auto; }
.yc-wizard .gb-style-name {
  display: block;
  margin: 0 auto 4px;
  padding: 7px 2px;
  border-radius: 999px;
  /* 320 でも「しょうかん」が1行に収まる大きさ */
  font-size: clamp(12px, 3.7vw, 19px);
  letter-spacing: 0;
  white-space: nowrap;
  color: #fff;
  background: var(--yc-red);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2);
  line-height: 1.1;
}
/* 幅 320 では 12px でも札の右から字が少し出るので、もう一段小さくする */
@media (max-width: 359px) {
  .yc-wizard .gb-style-name { font-size: 11px; }
}
.yc-wizard .gb-style-card:nth-child(2) .gb-style-name { background: var(--yc-blue); }
.yc-wizard .gb-style-card:nth-child(3) .gb-style-name { background: var(--yc-purple); }
.yc-wizard .gb-style-desc {
  font-size: clamp(13px, 4vw, 15px);
  line-height: 1.45;
  font-weight: 700;
  color: var(--yc-ink-2);
  /* 本番のテーマは body に overflow-wrap: break-word を置いていて、ことばの途中で切れる（320 で「まほうじ / ん から」） */
  overflow-wrap: normal;
}
/* 幅 320 では「まほうじん」が字の入る幅より 4px 広いので、カードの内側の空きを左右 4px ずつ使って真ん中に置く */
@media (max-width: 359px) {
  .yc-wizard .gb-style-desc { margin-inline: -4px; }
}

/* STEP 2 キャラ */
.yc-wizard .gb-char-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (min-width: 600px) {
  .yc-wizard .gb-char-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
}
.yc-wizard .gb-char-card {
  padding: 6px 6px 8px;
  background: var(--yc-paper);
  border: 3px solid var(--yc-cream-2);
  border-radius: 14px;
  color: var(--yc-ink);
  box-shadow: 0 3px 0 rgba(120, 70, 30, 0.15);
}
.yc-wizard .gb-char-card:hover { border-color: var(--yc-gold); }
.yc-wizard .gb-char-card.is-on {
  background: #fff;
  border-color: var(--yc-gold);
  box-shadow: 0 0 0 2px #fff, 0 0 12px 2px rgba(255, 196, 40, 0.7);
}
.yc-wizard .gb-char-card.is-on::after {
  top: 6px; right: 6px;
  width: 24px; height: 24px;
  background: var(--yc-green);
  border: 2px solid #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.yc-wizard .gb-char-card.is-on::before {
  top: 10px; right: 14.5px;
  width: 6px; height: 11px;
  border-right: 3px solid #fff;
  border-bottom: 3px solid #fff;
}
.yc-wizard .gb-char-card.is-off { opacity: 0.55; filter: saturate(0.2); }
.yc-wizard .gb-char-card img {
  background: linear-gradient(180deg, #eaf4ff, #fdf3df);
  border-radius: 10px;
}
.yc-wizard .gb-char-name { overflow-wrap: anywhere; text-wrap: balance; font-size: clamp(12px, 3.9vw, 14px); font-weight: 700; letter-spacing: 0; color: var(--yc-ink); margin-top: 4px; }
.yc-wizard .gb-char-rarity {
  font-family: var(--font-jp);
  font-style: normal;
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 1px 10px;
  border: 0;
  border-image: none;
  color: #fff;
  text-shadow: none;
  background: #8a8178;
}
.yc-wizard .gb-char-rarity.rarity-R  { background: var(--yc-blue); }
.yc-wizard .gb-char-rarity.rarity-SR { background: var(--yc-purple); }
.yc-wizard .gb-char-rarity.rarity-UR {
  background: linear-gradient(90deg, #ff4f8b, #ffb02e, #2fb24a, #2f8be6, #9a4fe0);
}
.yc-wizard .gb-char-card .gb-char-edit,
.yc-wizard .gb-char-card .gb-char-upload {
  background: #fff3d6;
  color: var(--yc-ink);
  border: 2px solid #e9c98a;
  border-style: solid;
  border-radius: 999px;
  font-size: 14px;
  /* せまいカードでは、えんぴつを字の上に置く。「かえる」を1字ずつ折らない */
  flex-wrap: wrap;
  row-gap: 2px;
  padding-inline: 2px;
}
.yc-wizard .gb-char-card .gb-char-edit span,
.yc-wizard .gb-char-card .gb-char-upload span { white-space: nowrap; }
.yc-wizard .gb-char-card .gb-char-edit:hover,
.yc-wizard .gb-char-card .gb-char-edit:focus-visible {
  background: var(--yc-gold);
  color: var(--yc-ink);
  border-color: var(--yc-gold-d);
  box-shadow: none;
}
.yc-wizard .gb-char-card.is-custom .gb-char-edit { background: var(--yc-gold); color: var(--yc-ink); }
.yc-wizard .gb-char-card.is-custom img { box-shadow: 0 0 0 2px var(--yc-gold-d); }
.yc-wizard .gb-char-card.is-added img { box-shadow: 0 0 0 2px var(--yc-blue); }
.yc-wizard .gb-char-added-badge,
.yc-wizard .gb-char-custom-badge {
  background: var(--yc-blue);
  color: #fff;
  box-shadow: none;
}
.yc-wizard .gb-char-custom-badge { background: var(--yc-orange); }
.yc-wizard .gb-char-custom-badge { white-space: nowrap; letter-spacing: 0; }
/* 3列のせまいカードでは、左上だと「オリジナル」が右上のチェックにかぶるので、絵の下のふちに置く
   （カードの幅 = 絵の一辺。100cqw はカードの中の幅） */
@media (max-width: 599px) {
  .yc-wizard .gb-char-card { container-type: inline-size; }
  .yc-wizard .gb-char-custom-badge {
    top: calc(100cqw - 14px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    padding: 2px 6px;
  }
}
.yc-wizard .gb-char-add-slot {
  min-height: 160px;
  background: var(--yc-paper);
  border: 3px dashed var(--yc-blue);
  border-radius: 14px;
  color: var(--yc-ink);
}
.yc-wizard .gb-char-add-slot:hover,
.yc-wizard .gb-char-add-slot:focus-visible {
  background: #eef4ff;
  border-color: var(--yc-blue);
  box-shadow: none;
}
.yc-wizard .gb-char-add-slot .gb-add-icon { color: var(--yc-blue); text-shadow: none; }
.yc-wizard .gb-char-add-slot .gb-add-label { font-size: clamp(12px, 3.9vw, 14px); letter-spacing: 0; white-space: nowrap; }
.yc-wizard .gb-custom-actions { margin-top: 14px; }
.yc-wizard .gb-custom-note { color: var(--yc-ink-2); font-size: 13px; }
.yc-wizard .gb-btn-ghost {
  min-height: 44px;
  background: #fff;
  color: var(--yc-red-d);
  border: 2px solid var(--yc-red);
  border-radius: 999px;
  font-weight: 700;
}

/* STEP 3 いろ */
.yc-wizard .gb-color-row { justify-content: center; }
.yc-wizard .gb-color-row input[type=text] {
  background: #fff;
  color: var(--yc-ink);
  border: 2px solid var(--yc-cream-2);
  font-family: var(--font-jp);
  font-style: normal;
}
.yc-wizard .gb-color-preview { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--yc-cream-2); }
.yc-wizard .gb-color-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.yc-wizard .gb-color-presets button {
  min-height: 56px;
  margin: 0;
  padding-left: 4px;
  padding-right: 4px;
  border-radius: 16px;
  font-size: 16px;
  letter-spacing: 0;
  white-space: nowrap;
  font-weight: 700;
  color: #fff;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.2), 0 2px 0 rgba(120, 70, 30, 0.2);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}
/* 幅 320 では3つならぶと板からはみ出すので、字だけ少し小さくする */
@media (max-width: 359px) {
  .yc-wizard .gb-color-presets button { font-size: 14px; }
}
.yc-wizard .gb-color-presets button.is-active {
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px var(--yc-ink), inset 0 -4px 0 rgba(0, 0, 0, 0.2);
}

/* STEP 4 タイトル */
.yc-wizard .gb-title-input {
  display: block;
  width: calc(100% - 28px);
  min-height: 60px;
  background: #fff;
  color: var(--yc-ink);
  border: 3px solid var(--yc-cream-2);
  border-radius: 16px;
  font-size: 22px;
  text-align: center;
}
.yc-wizard .gb-title-input:focus { border-color: var(--yc-gold); outline: none; box-shadow: 0 0 0 4px rgba(255, 207, 74, 0.5); }

/* STEP 5 ジェム */
.yc-wizard .gb-gem-label { color: var(--yc-ink); font-weight: 700; font-size: 15px; }
.yc-wizard .gb-gem-input {
  min-height: 52px;
  background: #fff;
  color: var(--yc-ink);
  border: 3px solid var(--yc-cream-2);
  border-radius: 14px;
  font-family: var(--font-jp);
  font-style: normal;
  font-size: 20px;
}
.yc-wizard .gb-gem-input:focus { border-color: var(--yc-gold); outline: none; }
.yc-wizard .gb-gem-preview {
  background: #fff3d6;
  color: var(--yc-ink);
  border: 2px solid #e9c98a;
  border-radius: 999px;
  font-weight: 700;
  text-align: center;
}

/* ---------- 下の「もどる」「つぎへ」 ---------- */
.yc-nav.gb-finalize {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  max-width: 760px;
  margin: 0 auto;
  align-self: end;
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
  text-align: left;
}
.yc-nav.gb-finalize::before {
  content: "";
  position: absolute;
  inset: 0 -16px;
  z-index: -1;
  background: linear-gradient(180deg, rgba(27, 33, 80, 0), rgba(27, 33, 80, 0.85) 35%);
}
.yc-back {
  min-width: 92px;
  min-height: 72px;
  padding: 0 16px;
  border-radius: 999px;
  border: 3px solid #fff;
  background: var(--yc-paper);
  color: var(--yc-ink);
  font-family: var(--font-jp);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 -4px 0 rgba(120, 70, 30, 0.18);
}
.yc-next,
.yc-wizard .gb-build-btn {
  grid-column: 2;
  min-height: 72px;
  width: 100%;
  padding: 0 20px;
  border-radius: 999px;
  border: 3px solid #fff;
  background: linear-gradient(180deg, #ff7aa0, var(--yc-pink));
  color: #fff;
  font-family: var(--font-jp);
  font-size: clamp(24px, 6.8vw, 30px);
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: inset 0 -6px 0 var(--yc-pink-d), 0 4px 0 rgba(0, 0, 0, 0.25);
  text-shadow: 0 2px 0 var(--yc-pink-d);
  transition: transform 0.12s var(--ease);
}
.yc-next::after { content: " \25B6"; font-size: 0.8em; }
/* 「ガチャを つくる！」は字が多いので、1行に収まる大きさにする（幅 320 でも下の帯の中に収まるよう、下限は 18px） */
.yc-wizard .gb-build-btn {
  padding: 0 12px;
  font-size: clamp(18px, 5.6vw, 28px);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.yc-next:active,
.yc-wizard .gb-build-btn:active { transform: translateY(2px); box-shadow: inset 0 -3px 0 var(--yc-pink-d), 0 2px 0 rgba(0, 0, 0, 0.25); }
.yc-next:disabled,
.yc-wizard .gb-build-btn:disabled {
  background: #cfc6bd;
  color: var(--yc-ink);
  text-shadow: none;
  box-shadow: inset 0 -5px 0 #a99f95;
  font-size: 17px;
  letter-spacing: 0.02em;
  cursor: not-allowed;
}
.yc-next:disabled::after { content: none; }
.yc-back:focus-visible,
.yc-next:focus-visible,
.yc-wizard .gb-build-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
/* もどるが無い1の段は、つぎへを広げる */
.yc-wizard[data-yc-step="0"] .yc-next { grid-column: 1 / -1; }
/* できたよの札が出たら、帯は下に止めない（札の入った背の高い帯が、上のジェムの字にかぶるため） */
.yc-nav.gb-finalize:has(.gb-result-box:not([hidden])) { position: relative; }

/* できたよ */
.yc-wizard .gb-result-box {
  grid-column: 1 / -1;
  background: var(--yc-paper);
  border: 4px solid var(--yc-gold);
  border-radius: 20px;
  color: var(--yc-ink);
  text-align: center;
  box-shadow: 0 0 0 2px var(--yc-gold-d), 0 0 30px rgba(255, 207, 74, 0.7);
}
.yc-wizard .gb-result-label { color: var(--yc-red); font-size: 28px; text-shadow: none; }
.yc-wizard .gb-result-desc { color: var(--yc-ink-2); font-weight: 700; font-size: 16px; word-break: keep-all; }
.yc-wizard .gb-play-btn {
  min-height: 60px;
  border-radius: 999px;
  border: 3px solid #fff;
  background: linear-gradient(180deg, #4fc35c, var(--yc-green));
  color: #fff;
  font-size: clamp(18px, 6vw, 22px);
  white-space: nowrap;
  box-shadow: inset 0 -5px 0 #2a7a35;
  text-shadow: 0 2px 0 #2a7a35;
}
.yc-wizard:not([data-yc-step="4"]) .gb-result-box { display: none; }

/* 窓と知らせ（明るい遊園地に合わせる） */
/* 横向きのスマホなど、窓が画面より高いときは、窓のうしろをスクロールして上から下まで見られるようにする */
.gb-modal-overlay { align-items: flex-start; overflow-y: auto; overscroll-behavior: contain; }
.gb-modal-overlay > .gb-modal,
.gb-modal-overlay > .gp-card-modal { margin-top: auto; margin-bottom: auto; }
.gb-modal {
  background: var(--yc-paper);
  color: var(--yc-ink);
  border: 4px solid var(--yc-coral);
  border-radius: 20px;
  box-shadow: 0 0 0 2px var(--yc-red-d), 0 20px 50px rgba(0, 0, 0, 0.5);
}
.gb-modal-msg, .gb-edit-title, .gb-edit-label { color: var(--yc-ink); }
/* ほかの押す所を大きくしたので、窓の字と押す所もそろえる */
.gb-modal-msg { font-size: 16px; white-space: pre-line; word-break: keep-all; }
.gb-modal-cancel, .gb-modal-confirm { min-height: 52px; font-size: 17px; }
.gb-modal-cancel {
  background: #fff;
  color: var(--yc-ink);
  border: 2px solid var(--yc-cream-2);
}
.gb-modal-confirm {
  background: var(--yc-pink);
  color: #fff;
  border: 2px solid var(--yc-pink-d);
}
.gb-edit-name {
  background: #fff;
  color: var(--yc-ink);
  border: 2px solid var(--yc-cream-2);
}
.gb-edit-preview-box { background: linear-gradient(180deg, #eaf4ff, #fdf3df); }
.gb-edit-img-btn { background: #fff3d6; color: var(--yc-ink); border-color: #e9c98a; }
.gb-edit-rarity-btn { background: #fff; color: var(--yc-ink); }
.gb-toast {
  background: var(--yc-ink);
  color: #fff;
  border: 3px solid var(--yc-gold);
  font-size: 16px;
  font-weight: 700;
}
.gb-toast--error { border-color: var(--yc-red); background: #5a1a26; }
/* 下の帯がある作る画面では、知らせを帯の上に出す（つぎへの字にかぶらないように） */
body:has(.yc-nav) .gb-toast { bottom: calc(112px + env(safe-area-inset-bottom)); }

/* ================================================================
   遊ぶ画面
   ============================================================== */
.gp-app.yc-play {
  max-width: 600px;
  padding: 14px 16px 32px;
  color: var(--yc-ink);
  font-size: 16px;
  letter-spacing: 0.02em;
}

/* 上の段: もどる / 題の看板 / ジェム、その下にタブ */
.yc-play-head.gp-header {
  display: grid;
  /* もどるは残りの幅に収める。ジェムの箱がはみ出さないように */
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "back gem" "sign sign" "nav nav";
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 0;
  margin-bottom: 14px;
}
.yc-play-head > .gp-rebuild-btn {
  grid-area: back;
  position: static;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 60px;
  height: 100%;
  padding: 6px 12px 6px 8px;
  background: linear-gradient(180deg, #59c068, var(--yc-green));
  color: #fff;
  border: 3px solid #fff;
  border-radius: 18px;
  box-shadow: 0 0 0 2px #23702f, inset 0 -5px 0 #2a7a35;
  /* せまい画面では「ちがう／ガチャを／つくる」の3行に折る（折る所は player.php の wbr） */
  font-size: clamp(16px, 5.4vw, 19px);
  line-height: 1.3;
  letter-spacing: 0;
  text-align: left;
  word-break: keep-all;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.yc-play-head > .gp-rebuild-btn svg { width: 24px; height: 24px; flex-shrink: 0; }
.yc-play-head > .gp-rebuild-btn:hover,
.yc-play-head > .gp-rebuild-btn:focus-visible {
  background: linear-gradient(180deg, #6bd07a, #45b053);
  border-color: #fff;
  color: #fff;
}
.yc-play-head > .gp-rebuild-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.yc-sign {
  grid-area: sign;
  position: relative;
  width: 100%;
  aspect-ratio: 352 / 165;
  background: url('../images/yuenchi/title-s.png') center / 100% 100% no-repeat;
}
.gacha-builder-page .gp-app.yc-play h2.yc-sign-text {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  color: var(--yc-ink) !important;
  position: absolute;
  /* 絵のクリーム色の所（y 50.9〜87.3%）。長い題は gacha.js の fitTitle が字を小さくしてここに収める */
  top: 51%;
  bottom: 13%;
  left: 9%;
  right: 9%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(22px, 6.6vw, 30px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-align: center;
  overflow-wrap: anywhere;
  text-wrap: balance;
  text-shadow: none;
}
.gacha-builder-page .gp-app.yc-play h2.yc-sign-text::before,
.gacha-builder-page .gp-app.yc-play h2.yc-sign-text::after { display: none !important; }

.yc-play-head .gp-gem {
  grid-area: gem;
  margin: 0;
  padding: 6px 6px 6px 10px;
  height: 100%;
  min-height: 60px;
  background: var(--yc-paper);
  border: 3px solid #fff;
  border-radius: 18px;
  box-shadow: 0 0 0 2px var(--yc-cream-2), 0 4px 0 rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  justify-content: center;
  backdrop-filter: none;
}
.yc-play-head .gp-gem-row {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 4px 6px;
}
.yc-play-head .gp-gem-icon { width: 24px; height: 24px; color: var(--yc-purple); filter: none; }
.yc-play-head .gp-gem-text {
  font-family: inherit;
  font-style: normal;
  font-size: 22px;
  font-weight: 900;
  color: var(--yc-ink);
  white-space: nowrap;
  letter-spacing: 0;
}
.yc-play-head .gp-gem-text #gpGemNow { font-family: inherit; font-style: normal; font-size: inherit; color: var(--yc-ink); }
.yc-play-head .gp-gem-sep { color: var(--yc-ink-2); margin: 0 2px; }
.yc-play-head .gp-gem-reset {
  min-height: 44px;
  padding: 4px 12px;
  background: var(--yc-pink);
  color: #fff;
  border: 0;
  border-radius: 999px;
  box-shadow: inset 0 -4px 0 var(--yc-pink-d);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}
.yc-play-head .gp-gem-reset:hover,
.yc-play-head .gp-gem-reset:focus-visible { background: #ff6b93; color: #fff; }
.yc-play-head .gp-gem-reset:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.yc-play-head .gp-gem-bar { display: none; }
@media (max-width: 599px) {
  /* 数ともどるの字を大きくしても横に収まるように、あつめるは数の下に置く */
  .yc-play-head .gp-gem-row { grid-template-columns: auto auto; justify-content: center; }
  .yc-play-head .gp-gem-reset { grid-column: 1 / -1; justify-self: stretch; }
}
.yc-play-head .gp-gem.is-empty .gp-gem-text #gpGemNow { color: var(--yc-red); }
.yc-play-head .gp-gem.is-empty .gp-gem-icon { color: #b9a99a; }

.yc-play-head .gp-nav {
  grid-area: nav;
  width: 100%;
  max-width: 440px;
  margin: 4px auto 0;
  padding: 5px;
  gap: 4px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--yc-cream-2), 0 4px 0 rgba(0, 0, 0, 0.18);
}
.yc-play-head .gp-nav button {
  min-height: 52px;
  padding-inline: 8px;
  font-size: clamp(15px, 5vw, 18px);
  white-space: nowrap;
  font-weight: 800;
  color: #5d5a8c;
  background: #e2e0f6;
  letter-spacing: 0.04em;
}
.yc-play-head .gp-nav button.is-active {
  background: var(--yc-red);
  color: #fff;
  box-shadow: inset 0 -4px 0 var(--yc-red-d);
}
.yc-play-head .gp-nav button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.yc-play-head .yc-sign { width: min(82%, 300px); justify-self: center; margin-top: -2px; }
@media (min-width: 600px) {
  .yc-play-head.gp-header {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr);
    grid-template-areas: "back sign gem" "nav nav nav";
    justify-content: stretch;
  }
  .yc-play-head .yc-sign { width: 100%; margin-top: 0; }
  /* 横に3つ並ぶと看板が細くなるので、題の字をそれに合わせる */
  .gacha-builder-page .gp-app.yc-play h2.yc-sign-text { font-size: 22px; }
  .yc-play-head > .gp-rebuild-btn { max-width: none; min-height: 76px; font-size: 16px; }
  .yc-play-head .gp-gem { min-height: 76px; padding: 8px; }
  .yc-play-head .gp-gem-row { grid-template-columns: auto 1fr; justify-items: start; }
  .yc-play-head .gp-gem-reset { grid-column: 1 / -1; justify-self: stretch; }
}

/* 舞台 */
.yc-play .gp-stage {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  min-height: 600px;
  border-radius: 22px;
}

/* 待つ画面: 遊園地のガチャの機械。えらんだ色が機械のまわりの光になる */
.yc-play .gp-idle { padding-bottom: 8px; }
.yc-play .gp-machine {
  display: block;
  position: relative;
  /* 上の字を大きくしたぶん、スマホでは機械を少し小さくして「まわす」を画面に残す */
  width: min(68%, 330px);
  aspect-ratio: 592 / 930;
  margin: 0 auto 10px;
  background: url('../images/yuenchi/kikai.png') center / 100% 100% no-repeat;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--accent, #ffcf4a) 70%, transparent));
}
.yc-play .gp-machine-glow { display: none; }
/* 看板に、えらんだ えんしゅつの なまえ */
.yc-play .gp-machine::before {
  content: "";
  position: absolute;
  left: 20%;
  right: 26%;
  top: 9.4%;
  bottom: auto;
  width: auto;
  height: 9%;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border-radius: 0;
  color: var(--yc-red-d);
  font-size: clamp(18px, 5.4vw, 28px);
  font-weight: 900;
  letter-spacing: 0.08em;
  z-index: 3;
}
.yc-play .gp-machine:has(img.is-style-capsule)::before { content: "カプセル"; }
.yc-play .gp-machine:has(img.is-style-egg)::before     { content: "たまご"; }
.yc-play .gp-machine:has(img.is-style-summon)::before  { content: "しょうかん"; }
/* ガラスの中: たまごと しょうかんは その絵、カプセルは カプセルを つめる */
.yc-play .gp-machine img {
  position: absolute;
  left: 17.2%;
  top: 20%;
  width: 57.4% !important;
  max-width: none;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: none;
  background: transparent;
  filter: none;
  animation: none;
  opacity: 0.95;
  z-index: 1;
}
.yc-play .gp-machine img.is-style-capsule { visibility: hidden; }
.yc-play .gp-machine::after {
  content: "";
  position: absolute;
  left: 17.2%;
  top: 20%;
  width: 57.4%;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(ellipse 30% 18% at 32% 22%, rgba(255, 255, 255, 0.75), transparent 70%),
    radial-gradient(circle at 50% 50%, transparent 62%, rgba(255, 255, 255, 0.35) 72%, transparent 74%);
}
.yc-play .gp-machine:has(img.is-style-capsule)::after {
  background:
    radial-gradient(ellipse 30% 18% at 32% 22%, rgba(255, 255, 255, 0.8), transparent 70%),
    radial-gradient(circle at 26% 80%, #ff7a95 0 13%, transparent 13.5%),
    radial-gradient(circle at 52% 85%, #6fb4ff 0 13%, transparent 13.5%),
    radial-gradient(circle at 77% 78%, #ffd257 0 13%, transparent 13.5%),
    radial-gradient(circle at 38% 61%, #8de07f 0 13%, transparent 13.5%),
    radial-gradient(circle at 64% 62%, #ff9ad5 0 13%, transparent 13.5%),
    radial-gradient(circle at 15% 60%, #b78cff 0 11%, transparent 11.5%),
    radial-gradient(circle at 87% 58%, #ff9d57 0 11%, transparent 11.5%),
    radial-gradient(circle at 50% 42%, #ffe36e 0 12%, transparent 12.5%);
}
.yc-play .gp-machine { animation: device-bob 4s ease-in-out infinite; }

/* まわす / もういちど まわす */
.yc-play .gp-pull-btn,
.yc-play .gp-again-btn {
  display: flex;
  width: min(100%, 380px);
  min-height: 84px;
  margin: 0 auto;
  padding: 10px 24px;
  background: linear-gradient(180deg, #ff7aa0, var(--yc-pink));
  color: #fff;
  border: 4px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 3px var(--yc-pink-d), inset 0 -7px 0 var(--yc-pink-d), 0 8px 0 rgba(0, 0, 0, 0.2);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-shadow: 0 2px 0 var(--yc-pink-d);
  animation: none;
}
.yc-play .gp-pull-btn::before { display: none; }
/* 「もういちど まわす」が途中で折れないように */
.yc-play .gp-again-btn {
  padding: 10px 16px;
  font-size: clamp(24px, 7vw, 34px);
  letter-spacing: 0.04em;
  white-space: nowrap;
  /* 字をボタンのまん中に */
  justify-content: center;
  align-items: center;
}
.yc-play .gp-pull-btn:focus-visible,
.yc-play .gp-again-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; }
.yc-play .gp-pull-btn:disabled,
.yc-play .gp-pull-btn[disabled] {
  background: #d8d2cb;
  color: #fff;
  box-shadow: 0 0 0 3px #9d948b, inset 0 -7px 0 #9d948b;
  text-shadow: 0 2px 0 #9d948b;
  font-size: 22px;
  opacity: 1;
}

.yc-play .gp-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  margin: 18px auto 0;
  padding: 8px 22px;
  background: var(--yc-cream);
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--yc-gold-d);
  color: var(--yc-ink);
  font-size: 17px;
  font-weight: 800;
}
.yc-play .gp-counter span { color: var(--yc-ink); font-size: 22px; font-weight: 900; margin: 0; }
.yc-play .gp-counter::before,
.yc-play .gp-counter::after { content: "\2605"; color: var(--yc-gold-d); font-size: 18px; }
.yc-play .gp-empty-msg {
  margin: 12px auto 0;
  max-width: 380px;
  padding: 10px 14px;
  background: var(--yc-paper);
  border: 3px solid var(--yc-coral);
  border-radius: 14px;
  color: var(--yc-ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
  /* ことばの途中で折らず、最後の行に1字か2字だけ残らないように */
  word-break: keep-all;
  text-wrap: pretty;
}

/* 結果 */
.yc-play .gp-result {
  min-height: 600px;
  padding: 4px 0 8px;
  justify-content: flex-start;
  /* 看板の字を看板の幅に合わせるため、幅を測れるようにする */
  container-type: inline-size;
}
/* SR と UR のときだけ「当たった！」の看板が出る */
.yc-play .gp-result::before {
  content: none;
}
.yc-play .gp-result.rarity-SR::before,
.yc-play .gp-result.rarity-UR::before {
  content: "当たった！";
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: min(92cqw, 440px);
  /* GO した案の、四方にふちと電球のある板。同じ画面の札（.anim-sign）と同じ看板の絵を使う。
     前は title.png を上だけ切って見せていて、板の下のふちと電球がリボンの裏で切れていた。
     ふちと面はくり返さずにのばす（くり返すと、板が横に長い幅でまん中に継ぎ目が出た） */
  margin: 0 auto -4px;
  padding: 6px 6px 8px;
  border: 22px solid transparent;
  border-image: url('../images/yuenchi/kanban.png') 26 fill / 22px stretch;
  color: var(--yc-red);
  font-size: min(calc(min(92cqw, 440px) * 0.092), 46px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.06em;
  text-shadow: 0 3px 0 #fff, 0 5px 0 var(--yc-red-d);
  animation: yc-sign-in 0.5s cubic-bezier(.2, 1.6, .4, 1) both;
  position: relative;
  z-index: 2;
}
@keyframes yc-sign-in {
  from { opacity: 0; transform: translateY(-16px) scale(0.85); }
  to   { opacity: 1; transform: none; }
}

.yc-play .gp-card {
  --card-frame: #b9b2a8;
  --card-ray: rgba(255, 255, 255, 0.9);
  --card-ray-2: #fff3cf;
  width: min(72%, 300px);
  margin: 14px auto 18px;
}
.yc-play .gp-card::before { opacity: 0.55; }
.yc-play .gp-card .gp-card-inner {
  background: var(--yc-paper);
  border: 5px solid var(--card-frame);
  border-radius: 18px;
  box-shadow: 0 0 0 3px #fff, 0 12px 0 rgba(0, 0, 0, 0.18);
  padding: 12px 14px 10px;
}
.yc-play .gp-card .gp-card-holo { opacity: 0; }
/* 番号は名前のすぐ上（NEW の札に隠れないように） */
.yc-play .gp-card-head { display: contents; }
.yc-play .gp-card-rarity { order: 1; align-self: flex-end; margin-bottom: 8px; position: relative; z-index: 3; }
.yc-play .gp-card-art { order: 2; }
.yc-play .gp-card-no { order: 3; align-self: center; position: relative; z-index: 3; margin-bottom: 2px; }
.yc-play .gp-card-foot { order: 4; }
.yc-play .gp-card-no {
  font-family: inherit;
  font-style: normal;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--yc-ink-2);
  text-shadow: none;
}
.yc-play .gp-card-rarity {
  font-family: inherit;
  font-style: normal;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.06em;
  padding: 2px 14px;
  color: #fff;
  background: var(--card-frame);
  border: 0;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
.yc-play .gp-card-art {
  background: repeating-conic-gradient(from 0deg at 50% 50%, var(--card-ray-2) 0 10deg, var(--card-ray) 10deg 20deg);
  border: 0;
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.05);
}
.yc-play .gp-card-art img { filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.12)); }
.yc-play .gp-card-foot { border-top: 2px dashed var(--yc-cream-2); padding-top: 8px; }
.yc-play .gp-card-name {
  color: var(--yc-ink);
  font-size: 24px;
  font-weight: 900;
  overflow-wrap: anywhere;
  text-wrap: balance;
  text-shadow: none;
}
.yc-play .gp-card-count { color: var(--yc-ink-2); font-size: 16px; font-weight: 800; letter-spacing: 0.04em; }
.yc-play .gp-card.rarity-N  { --card-frame: #9b958c; }
.yc-play .gp-card.rarity-R  { --card-frame: var(--yc-blue); --card-ray-2: #e4efff; }
.yc-play .gp-card.rarity-SR { --card-frame: var(--yc-purple); --card-ray-2: #efe4ff; }
.yc-play .gp-card.rarity-UR { --card-frame: var(--yc-gold-d); --card-ray-2: #ffe9a8; }
.yc-play .gp-card.rarity-UR .gp-card-inner { border: 5px solid transparent; background: var(--yc-paper) padding-box; }
.yc-play .gp-card.rarity-UR .gp-card-rarity { background: linear-gradient(90deg, #ff5c8a, #ffb340, #47c7e8, #9b6cff); }
.yc-play .gp-card.rarity-UR::after { inset: -2px; border-radius: 20px; filter: none; }
.yc-play .gp-card .gp-new-badge {
  top: -16px;
  left: -16px;
  padding: 8px 14px;
  background: var(--yc-red);
  color: #fff;
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--yc-red-d), 0 4px 0 rgba(0, 0, 0, 0.2);
  font-family: inherit;
  font-style: normal;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

/* コレクション */
.yc-play .gp-collection {
  padding: 16px 14px 20px;
  background: var(--yc-cream);
  border: 6px solid var(--yc-coral);
  border-radius: 22px;
  box-shadow: 0 0 0 2px var(--yc-red-d);
}
.gacha-builder-page .gp-app.yc-play h3.gp-col-title {
  color: var(--yc-ink) !important;
  font-size: 24px;
  font-weight: 900;
  text-shadow: none;
}
.yc-play .gp-col-progress { color: var(--yc-ink); font-family: inherit; font-style: normal; font-weight: 900; }
.yc-play .gp-col-progress .max { color: var(--yc-ink-2); }
.yc-play .gp-col-bar { background: #fff; box-shadow: inset 0 0 0 2px var(--yc-cream-2); height: 12px; }
.yc-play .gp-col-bar-fill { background: linear-gradient(90deg, var(--yc-gold), var(--yc-orange)); }
.yc-play .gp-col-complete {
  background: var(--yc-gold);
  color: var(--yc-ink);
  font-size: 18px;
  animation: none;
  border-radius: 999px;
}
.yc-play .gp-col-group {
  background: var(--yc-paper);
  border: 3px solid #fff;
  border-radius: 16px;
  box-shadow: 0 0 0 2px var(--yc-cream-2);
}
.yc-play .gp-col-group::before,
.yc-play .gp-col-group::after { display: none; }
.yc-play .gp-col-group-rarity {
  font-family: inherit;
  font-style: normal;
  font-weight: 900;
  padding: 2px 14px;
  border-radius: 999px;
  color: #fff;
  text-shadow: none;
}
.yc-play .gp-col-group-rarity.rarity-N  { background: #9b958c; color: #fff; text-shadow: none; }
.yc-play .gp-col-group-rarity.rarity-R  { background: var(--yc-blue); color: #fff; text-shadow: none; }
.yc-play .gp-col-group-rarity.rarity-SR { background: var(--yc-purple); color: #fff; text-shadow: none; }
.yc-play .gp-col-group-rarity.rarity-UR { background: linear-gradient(90deg, #ff5c8a, #ffb340, #47c7e8, #9b6cff); color: #fff; text-shadow: none; }
.yc-play .gp-col-group-count { color: var(--yc-ink-2); font-family: inherit; font-style: normal; font-weight: 800; }
.yc-play .gp-col-cell {
  background: #fff;
  border: 3px solid var(--yc-cream-2);
  border-radius: 14px;
}
.yc-play .gp-col-cell::after { display: none; }
.yc-play .gp-col-cell.is-empty { background: #f1ece4; border-style: dashed; border-color: #d8cfc2; opacity: 1; }
.yc-play .gp-col-cell-hidden { background: transparent; border: 0; box-shadow: none; color: #b3a99c; text-shadow: none; }
.yc-play .gp-col-cell-name { color: var(--yc-ink); font-weight: 800; }
/* 長い名前（10文字まで）も切らずに2行で見せる。1字だけの行にならないように行の長さをそろえる */
.yc-play .gp-col-cell:not(.is-empty) .gp-col-cell-name {
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  text-wrap: balance;
  letter-spacing: 0;
  line-height: 1.25;
}
.yc-play .gp-col-cell.is-empty .gp-col-cell-name { color: #9d948b; }
.yc-play .gp-col-cell-count { background: var(--yc-red); color: #fff; }
.yc-play .gp-col-cell:not(.is-empty):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.yc-play .gp-col-group:has(.gp-col-group-rarity.rarity-UR) .gp-col-cell:not(.is-empty) { border-color: var(--yc-gold); }
.yc-play .gp-col-group:has(.gp-col-group-rarity.rarity-SR) .gp-col-cell:not(.is-empty) { border-color: #b89af0; }
.yc-play .gp-col-group:has(.gp-col-group-rarity.rarity-R) .gp-col-cell:not(.is-empty)  { border-color: #9dbcf0; }

/* ガチャが まだ ないとき */
.gp-empty-state {
  max-width: 420px;
  margin: 24px auto;
  padding: 20px 18px 22px;
  background: var(--yc-cream);
  border: 6px solid var(--yc-coral);
  border-radius: 22px;
  box-shadow: 0 0 0 2px var(--yc-red-d);
}
.gp-empty-state::before {
  content: "";
  display: block;
  width: 46%;
  aspect-ratio: 592 / 930;
  margin: 0 auto 12px;
  background: url('../images/yuenchi/kikai.png') center / 100% 100% no-repeat;
}
.gp-empty-title { color: var(--yc-ink); font-size: 24px; font-weight: 900; }
.gp-empty-sub { color: var(--yc-ink-2); font-size: 17px; font-weight: 700; }
.gp-empty-go {
  min-height: 64px;
  background: linear-gradient(180deg, #59c068, var(--yc-green));
  color: #fff;
  border: 4px solid #fff;
  box-shadow: 0 0 0 3px #23702f, inset 0 -6px 0 #2a7a35;
  font-size: clamp(16px, 5.4vw, 20px);
  font-weight: 900;
  white-space: nowrap;
}
.gp-empty-go:hover { color: #fff; }
.gp-empty-go:focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; }

.gp-mini-toast {
  background: var(--yc-ink);
  color: #fff;
  border: 3px solid var(--yc-gold);
  font-size: 16px;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  /* 確かめの幕（10001）より上に出す。幕の下に知らせが隠れないように */
  z-index: 10020;
}

/* ---------- まわしている途中（デザイナーの案 h1-mawasu-capsule から） ----------
   遊園地の夜のまま、光る玉が出てきて、看板で「でたよ」を知らせる */
.yc-play .gp-anim {
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 45% at 50% 40%, rgba(255, 214, 120, 0.3), transparent 70%),
    linear-gradient(180deg, rgba(20, 24, 70, 0.5), rgba(20, 24, 70, 0.78)),
    url('../images/yuenchi/keshiki.jpg') center / cover no-repeat,
    var(--yc-night);
}
.yc-play .anim-curtain { background: radial-gradient(ellipse at center, transparent 45%, rgba(10, 12, 40, 0.5) 100%); }
.yc-play .anim-image-wrap { padding-bottom: 22%; }
.yc-play .anim-image,
.yc-play .anim-image.is-r,
.yc-play .anim-image.is-sr,
.yc-play .anim-image.is-ur {
  width: min(88vw, 440px);
  border-radius: 50%;
  border: 0;
  box-shadow: none;
  /* 絵の背景（ゲームセンターや遺跡）は消して、玉と光だけを景色に重ねる */
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 42%, transparent 68%);
  mask-image: radial-gradient(circle at 50% 50%, #000 42%, transparent 68%);
}
/* 横向きのスマホ（高さが低い）は、玉と看板が両方画面に入るように、絵を画面の高さに合わせる（枠の固定は style.css） */
@media (orientation: landscape) and (max-height: 500px) {
  .yc-play .anim-image-wrap { padding-bottom: 96px; }
  .yc-play .anim-image,
  .yc-play .anim-image.is-r,
  .yc-play .anim-image.is-sr,
  .yc-play .anim-image.is-ur {
    width: min(440px, calc(100vh - 96px));
  }
}
.yc-play .anim-sign {
  position: absolute;
  left: 50%;
  bottom: 7%;
  z-index: 6;
  width: min(88%, 380px);
  padding: 4px 6px;
  border: 18px solid transparent;
  /* くり返さずにのばす（くり返すと、横に長い幅でまん中に継ぎ目が出た。「当たった！」の板と同じ） */
  border-image: url('../images/yuenchi/kanban.png') 26 fill / 18px stretch;
  color: var(--yc-red-d);
  /* 看板の中に1行で収まる大きさ。長い「まほうじんが ひかったよ！」は一回り小さく */
  font-size: clamp(17px, 6vw, 32px);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-align: center;
  word-break: keep-all;
  opacity: 0;
  transform: translateX(-50%) scale(0.6);
  animation: yc-deta-in 0.5s cubic-bezier(0.16, 1.1, 0.3, 1) 0.9s forwards;
}
.yc-play .anim-sign.is-long { font-size: clamp(15px, 5.1vw, 26px); }
.yc-play .anim-sign.is-out { animation: yc-deta-out 0.3s ease forwards; }
/* 名前は「当たった！」の yc-sign-in とぶつけない */
@keyframes yc-deta-in {
  to { opacity: 1; transform: translateX(-50%) scale(1); }
}
@keyframes yc-deta-out {
  from { opacity: 1; transform: translateX(-50%) scale(1); }
  to   { opacity: 0; transform: translateX(-50%) scale(1.08); }
}

/* ---------- ジェムを あつめる（デザイナーの案 h1-minigame-tate から） ----------
   遊ぶ画面と同じ遊園地の機械をタップすると、出口から ジェムが とびだす */
.gp-gem-game-overlay {
  padding: 12px 16px;
  /* 低い画面では、上下が切れずにスクロールできるように（真ん中寄せで上が切れるのを防ぐ） */
  overflow-y: auto;
  align-items: safe center;
  background:
    linear-gradient(180deg, rgba(20, 24, 70, 0.55), rgba(20, 24, 70, 0.8)),
    url('../images/yuenchi/keshiki.jpg') center / cover no-repeat,
    var(--yc-night);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font-family: var(--font-jp);
}
.gp-gem-game {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title  title"
    "timer  count"
    "stage  stage"
    "hint   hint"
    "bar    bar"
    "skip   skip";
  align-items: center;
  gap: 8px;
  max-width: 420px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--yc-ink);
}
.gp-gem-game-title {
  grid-area: title;
  margin: 0;
  padding: 2px 6px;
  border: 18px solid transparent;
  /* くり返さずにのばす（くり返すと、横に長い幅でまん中に継ぎ目が出た。「当たった！」の板と同じ） */
  border-image: url('../images/yuenchi/kanban.png') 26 fill / 18px stretch;
  color: var(--yc-ink);
  font-size: clamp(20px, 6vw, 26px);
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-shadow: none;
  word-break: keep-all;
}
/* デザイナーの絵のとおり「タップしまくって／ジェムを あつめよう！」の区切りで折る */
.gp-gem-game-title > span { display: inline-block; }
.gp-gem-game-meta { display: contents; }
.gp-gem-game-timer {
  grid-area: timer;
  justify-self: center;
  padding: 6px clamp(12px, 4vw, 22px);
  background: var(--yc-paper);
  border: 4px solid var(--yc-gold);
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--yc-gold-d);
  color: var(--yc-red);
  font-family: inherit;
  font-style: normal;
  font-size: clamp(24px, 8vw, 30px);
  font-weight: 900;
  line-height: 1.1;
  text-shadow: none;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.gp-gem-game-timer::before,
.gp-gem-game-timer::after {
  color: var(--yc-ink);
  font-size: clamp(14px, 4.4vw, 17px);
  font-weight: 800;
}
.gp-gem-game-timer::before { content: "のこり "; }
.gp-gem-game-timer::after  { content: " びょう"; }
.gp-gem-game-counter {
  grid-area: count;
  display: grid;
  place-items: center;
  width: 84px;
  aspect-ratio: 1;
  padding-top: 26px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2387d4ff' stroke='%23fff' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M6 3h12l4 6-10 12L2 9z'/%3E%3Cpath d='M2 9h20M11 3 8 9l4 12M13 3l3 6-4 12' fill='none'/%3E%3C/svg%3E") center 12px / 30px no-repeat,
    var(--yc-night);
  border: 4px solid #fff;
  box-shadow: 0 0 0 3px var(--yc-blue), 0 0 16px rgba(120, 190, 255, 0.6);
  color: #fff;
  font-family: inherit;
  font-style: normal;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  text-shadow: none;
}
/* 機械は 遊ぶ画面の機械と同じ絵。ガラスの中に えんしゅつの絵 */
.gp-gem-game-stage {
  grid-area: stage;
  /* 低い画面や横向きでも、たたける大きさ（120px）は残す。入りきらない分は幕の中をスクロールする */
  width: max(120px, min(62vw, 250px, calc((100vh - 360px) * 592 / 930)));
  /* 看板の字の大きさを、機械の幅に合わせるため */
  container-type: inline-size;
  max-width: none;
  aspect-ratio: 592 / 930;
  margin: 0 auto;
  overflow: visible;
  border-radius: 0;
  background: url('../images/yuenchi/kikai.png') center / 100% 100% no-repeat;
  filter: drop-shadow(0 0 16px color-mix(in srgb, var(--accent, #ffcf4a) 70%, transparent));
}
.gp-gem-game-stage:focus-visible { outline: 3px solid #fff; outline-offset: 4px; border-radius: 16px; }
.gp-gem-game-stage::before {
  content: "";
  position: absolute;
  left: 20%;
  right: 26%;
  top: 9.4%;
  height: 9%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--yc-red-d);
  /* 「しょうかん」（5字）が看板のクリーム色の所（機械の幅の 54%）に入る大きさ */
  font-size: min(22px, 8.8cqw);
  font-weight: 900;
  letter-spacing: 0.04em;
  white-space: nowrap;
  z-index: 3;
}
.gp-gem-game-stage.is-style-capsule::before { content: "カプセル"; }
.gp-gem-game-stage.is-style-egg::before     { content: "たまご"; }
.gp-gem-game-stage.is-style-summon::before  { content: "しょうかん"; }
.gp-gem-game-stage .gp-gem-game-scene,
.gp-gem-game-stage .gp-light-overlay {
  position: absolute;
  left: 17.2%;
  top: 20%;
  width: 57.4%;
  height: auto;
  aspect-ratio: 1;
  inset: 20% auto auto 17.2%;
  border-radius: 50%;
  object-fit: cover;
}
.gp-gem-game-stage.is-style-capsule .gp-gem-game-scene { visibility: hidden; }
.gp-gem-game-stage::after {
  content: "";
  position: absolute;
  left: 17.2%;
  top: 20%;
  width: 57.4%;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(ellipse 30% 18% at 32% 22%, rgba(255, 255, 255, 0.75), transparent 70%),
    radial-gradient(circle at 50% 50%, transparent 62%, rgba(255, 255, 255, 0.35) 72%, transparent 74%);
}
.gp-gem-game-stage.is-style-capsule::after {
  background:
    radial-gradient(ellipse 30% 18% at 32% 22%, rgba(255, 255, 255, 0.8), transparent 70%),
    radial-gradient(circle at 26% 80%, #ff7a95 0 13%, transparent 13.5%),
    radial-gradient(circle at 52% 85%, #6fb4ff 0 13%, transparent 13.5%),
    radial-gradient(circle at 77% 78%, #ffd257 0 13%, transparent 13.5%),
    radial-gradient(circle at 38% 61%, #8de07f 0 13%, transparent 13.5%),
    radial-gradient(circle at 64% 62%, #ff9ad5 0 13%, transparent 13.5%),
    radial-gradient(circle at 15% 60%, #b78cff 0 11%, transparent 11.5%),
    radial-gradient(circle at 87% 58%, #ff9d57 0 11%, transparent 11.5%),
    radial-gradient(circle at 50% 42%, #ffe36e 0 12%, transparent 12.5%);
}
/* タップで 機械ごと ゆれる */
.gp-gem-game-stage.is-bumping .gp-gem-game-scene { animation: none; }
.gp-gem-game-stage.is-bumping { animation: bump-tremor 0.16s ease-out; }
/* 出口から とびだす ジェム */
.gp-gem-pop {
  position: absolute;
  left: 46%;
  top: 66%;
  z-index: 4;
  width: 15%;
  aspect-ratio: 1;
  margin-left: -7.5%;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2387d4ff' stroke='%23fff' stroke-width='1.4' stroke-linejoin='round'%3E%3Cpath d='M6 3h12l4 6-10 12L2 9z'/%3E%3Cpath d='M2 9h20M11 3 8 9l4 12M13 3l3 6-4 12' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: hue-rotate(var(--hue, 0deg)) drop-shadow(0 0 6px rgba(255, 255, 255, 0.9));
  animation: yc-gem-pop 0.6s cubic-bezier(0.2, 0.7, 0.4, 1) forwards;
}
@keyframes yc-gem-pop {
  0%   { opacity: 1; transform: translate(0, 0) scale(0.5); }
  45%  { opacity: 1; transform: translate(calc(var(--dx, 0px) * 0.6), -70px) scale(1.1); }
  100% { opacity: 0; transform: translate(var(--dx, 0px), -20px) scale(0.9); }
}
.gp-gem-game-hint {
  grid-area: hint;
  margin: 0;
  padding: 10px 14px;
  background: linear-gradient(180deg, #ff5f72, var(--yc-red));
  border: 4px solid var(--yc-gold);
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--yc-red-d), 0 0 14px rgba(255, 207, 74, 0.6);
  color: #fff;
  font-size: clamp(19px, 5.6vw, 24px);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: center;
}
.gp-gem-game-bar {
  grid-area: bar;
  width: 100%;
  max-width: none;
  height: 12px;
  margin: 0;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--yc-cream-2);
}
.gp-gem-game-skip {
  grid-area: skip;
  justify-self: center;
  min-height: 44px;
  padding: 8px 26px;
  background: var(--yc-paper);
  border: 3px solid var(--yc-cream-2);
  color: var(--yc-ink-2);
  font-size: 16px;
}
/* 横向きのスマホ（高さが低い）は、機械を右に置いて、たたきながら字も全部見えるようにする */
@media (orientation: landscape) and (max-height: 500px) {
  .gp-gem-game {
    grid-template-columns: 1fr auto auto;
    grid-template-areas:
      "title title stage"
      "timer count stage"
      "hint  hint  stage"
      "bar   bar   stage"
      "skip  skip  stage";
    column-gap: 20px;
    row-gap: 6px;
    max-width: 680px;
  }
  /* 横に長い 844x390 では題が1行で約500pxまで広がり、看板の電球だけ横に約2.2倍のびた。ほかの大きさ（約1.7〜1.85倍）と同じくらいになる幅で止める */
  .gp-gem-game-title { justify-self: center; max-width: 360px; border-width: 12px; border-image-width: 12px; font-size: 18px; }
  .gp-gem-game-timer { padding: 4px 14px; font-size: 22px; }
  .gp-gem-game-timer::before,
  .gp-gem-game-timer::after { font-size: 14px; }
  .gp-gem-game-counter { width: 64px; padding-top: 20px; background-size: 22px, auto; background-position: center 8px, center; font-size: 20px; }
  .gp-gem-game-hint { padding: 6px 12px; font-size: 17px; }
  .gp-gem-game-skip { min-height: 40px; padding: 6px 22px; }
  .gp-gem-game-stage { width: min(160px, calc((100vh - 40px) * 592 / 930)); }
}
/* おわりの画面 */
.gp-gem-game.is-result {
  display: block;
  padding: 0 0 24px;
}
.gp-gem-game-result {
  margin: 16px auto 0;
  padding: 20px 16px;
  max-width: 300px;
  background: var(--yc-cream);
  border: 6px solid var(--yc-coral);
  border-radius: 22px;
  box-shadow: 0 0 0 2px var(--yc-red-d);
}
.gp-gem-game-result-label { color: var(--yc-ink-2); font-size: 18px; font-weight: 800; }
.gp-gem-game.is-result .gp-gem-game-result { gap: 14px; }
.gp-gem-game-result-num {
  font-family: inherit;
  font-style: normal;
  font-size: 60px;
  font-weight: 900;
  color: var(--yc-blue);
  text-shadow: none;
}
.gp-gem-game-close {
  min-height: 56px;
  padding: 12px 40px;
  background: linear-gradient(180deg, #ff5f72, var(--yc-red));
  border: 4px solid #fff;
  box-shadow: 0 0 0 3px var(--yc-red-d);
  font-size: 19px;
  font-weight: 900;
}
.gp-gem-game-countdown { font-family: var(--font-jp); font-style: normal; }

@media (prefers-reduced-motion: reduce) {
  .gp-gem-pop { display: none; }
  .yc-play .gp-machine,
  .yc-play .gp-result::before { animation: none !important; }
}

/* ゲーム一覧（/games）へのリンク — v0.12.0
   今ある緑のボタン（ちがうガチャを つくる・ガチャを つくりに いく）と同じ形で、高さだけ低め。
   切りかえの帯のすぐ下に、左にそろえて1段。ガチャが無いときは「ガチャを つくりに いく」の下 */
.gacha-builder-page a.yc-games-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  min-height: 44px;
  padding: 4px 14px 4px 10px;
  background: linear-gradient(180deg, #59c068, var(--yc-green));
  color: #fff;
  border: 3px solid #fff;
  border-radius: 18px;
  box-shadow: 0 0 0 2px #23702f, inset 0 -5px 0 #2a7a35;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
}
.gacha-builder-page a.yc-games-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.gacha-builder-page a.yc-games-link:hover,
.gacha-builder-page a.yc-games-link:focus-visible {
  background: linear-gradient(180deg, #6bd07a, #45b053);
  color: #fff;
}
.gacha-builder-page a.yc-games-link:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.yc-play-head.gp-header { grid-template-areas: "games games" "back gem" "sign sign" "nav nav"; }
.yc-play-head > .yc-games-link { grid-area: games; justify-self: start; }
@media (min-width: 600px) {
  .yc-play-head.gp-header { grid-template-areas: "games games games" "back sign gem" "nav nav nav"; }
}
.yc-head > .yc-games-link { margin: 0 0 10px 2px; }
.gp-empty-state .yc-games-link { margin-top: 18px; }
