/* 特別な出来事の演出（public/js/show.js）
   重なり：全画面 .show は z45（#banners z35・#tapfx z40 より上）、ポップ .show-pop とリボン .show-rib は z44
   動きを減らす設定：.rm（show.js が付ける）と @media で、揺れ・回転・光の帯・降るコインを止め、ふわっと出すだけにする */

/* ---- 全画面の土台 ---- */
.show { position: fixed; inset: 0; z-index: 45; overflow: hidden; background: #060818; color: var(--ink);
  -webkit-user-select: none; user-select: none; touch-action: manipulation; animation: show-fade .35s ease-out; }
.show.bye { animation: show-out .4s ease-in forwards; pointer-events: none; }
.show-in { position: absolute; inset: 0; }
.show.shake .show-in { animation: show-shake .5s linear; }
.show-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.show-body { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(8px, 2vh, 18px); padding: calc(56px + var(--safe-t)) 12px calc(36px + var(--safe-b)); pointer-events: none; perspective: 900px; text-align: center; }
.show-hint { position: absolute; left: 0; right: 0; bottom: calc(10px + var(--safe-b)); z-index: 3; margin: 0; text-align: center;
  font-size: 12px; color: var(--sub); opacity: 0; transition: opacity .6s; pointer-events: none; text-shadow: 0 1px 0 #000; }
.show-hint.on { opacity: .85; }
.show-x { position: absolute; top: calc(8px + var(--safe-t)); right: calc(8px + env(safe-area-inset-right, 0px)); z-index: 6;
  width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 2px solid #000;
  background: rgba(18, 26, 63, .88); color: var(--ink); font-size: 26px; line-height: 1; box-shadow: 0 4px 0 #000; cursor: pointer; }
.show-x:active { transform: translateY(2px); box-shadow: 0 2px 0 #000; }

/* ---- 光の門：映像は真四角。縦長では左右を、横長では上下が収まる大きさで真ん中に置き、ふちは夜空に溶かす ---- */
.show-stage { --S: min(max(100vw, 62vh), 100vh); position: absolute; left: 50%; top: 50%; width: var(--S); height: var(--S); transform: translate(-50%, -50%); }
.show-vid, .show-end { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  -webkit-mask-image: radial-gradient(closest-side, #000 74%, transparent 100%); mask-image: radial-gradient(closest-side, #000 74%, transparent 100%); }
.show-end { opacity: 0; }
.show-glow { position: absolute; inset: 0; opacity: 0; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(circle at 50% 51.44%, rgba(255, 244, 200, .95) 0%, rgba(255, 210, 63, .55) 12%, rgba(255, 150, 40, .18) 30%, transparent 55%); }
/* 映像が出せないとき（.css）：閉じた門の絵を暗く置き、光が息をする → 開く → カードの瞬間に1回だけ広がる */
.show.css .show-vid { opacity: 0; }
.show.css .show-end { opacity: 1; filter: brightness(.35) saturate(.8); transform: scale(.94); transition: filter 1.1s ease-out, transform 1.1s ease-out; }
.show.css.opened .show-end { filter: none; transform: none; }
.show.css .show-glow { animation: show-breathe 2.4s ease-in-out infinite; }
.show.css.bloom .show-glow { animation: show-bloom 1.3s ease-out both, show-breathe 2.4s 1.3s ease-in-out infinite; }
/* 動きを減らす設定：映像なし。開いた門の絵に、ゆっくりした光だけ */
.show.rm .show-vid { display: none; }
.show.rm .show-end { opacity: 1; }
.show.rm .show-glow { animation: show-breathe-rm 4s ease-in-out infinite; }

/* 手描きの文字（黒を抜いた絵）。--ar は縦横比、--m は自分の絵（光の帯を文字の形だけに通す） */
.show-ttl { --th: clamp(48px, 17vh, 170px); position: relative; flex: none; width: min(88vw, 620px, calc(var(--th) * var(--ar, 3))); aspect-ratio: var(--ar, 3); opacity: 0; }
.show-ttl img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 16px rgba(255, 210, 63, .4)); }
.show-ttl::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .8) 50%, transparent 62%) no-repeat; background-size: 260% 100%;
  -webkit-mask: var(--m) center / 100% 100% no-repeat; mask: var(--m) center / 100% 100% no-repeat; }
.show-ttl.on { animation: show-drop .7s cubic-bezier(.2, .9, .3, 1.25) both; }
.show-ttl.on::after { animation: show-shine 2.8s .9s ease-in-out infinite; }

/* メンバーのカード（虹は上の細い帯だけ。縁は黒・影は真下） */
.show-card { --tc: var(--accent); position: relative; flex: none; display: grid; grid-template-areas: "badge" "ava" "info"; justify-items: center; gap: 6px;
  width: min(clamp(300px, 36vh, 350px), 78vw); padding: 12px 14px 14px; border: 3px solid #000; border-radius: 18px; text-align: center; visibility: hidden;
  background: linear-gradient(180deg, #1f2c6c, var(--panel) 58%, var(--bg2));
  box-shadow: inset 0 0 0 2px rgba(255, 210, 63, .75), 0 8px 0 #000, 0 0 44px rgba(255, 210, 63, .35); }
.show-card::before { content: ""; position: absolute; left: 16px; right: 16px; top: -3px; height: 4px; border-radius: 2px; background: var(--rainbow); }
.show-card.on { visibility: visible; animation: show-spin .75s cubic-bezier(.2, .8, .3, 1.15) both; }
.sc-badge { grid-area: badge; display: flex; align-items: center; justify-content: center; gap: 8px; }
.sc-mem { font-family: var(--head); font-size: 12px; letter-spacing: .12em; color: #1a1300; background: linear-gradient(180deg, #fff1a8, var(--accent) 55%, #e0a400);
  border: 2px solid #000; border-radius: 999px; padding: 0 10px; box-shadow: 0 2px 0 #000; }
.sc-lv { font-family: var(--head); font-size: 13px; color: var(--ink); }
.sc-avw { --avh: clamp(96px, 16vh, 168px); grid-area: ava; min-height: var(--avh); width: calc(var(--avh) / 2); display: flex; align-items: flex-end; justify-content: center;
  background: radial-gradient(closest-side, rgba(255, 210, 63, .45), transparent 80%); }
.sc-ava { height: calc(var(--avh) * var(--av-k, 1)); width: auto; max-width: none; display: block; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .55)); }
.sc-info { grid-area: info; min-width: 0; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sc-nick { display: block; max-width: 100%; font-family: var(--head); font-weight: 400; font-size: clamp(20px, 3.4vh, 28px); line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 0 #000; }
.sc-title { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 1px 10px 1px 4px; border: 2px solid var(--tc); border-radius: 999px;
  color: var(--tc); font-size: 13px; font-weight: 800; background: rgba(0, 0, 0, .35); }
.sc-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-em { width: 20px; height: 20px; flex: none; }
.sc-co { max-width: 100%; font-size: 13px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-goal { margin: 2px 0 0; max-width: 100%; font-size: 13px; line-height: 1.45; font-weight: 700; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: auto-phrase; }
.sc-goal-ic { margin-right: 4px; }
.show-sub { margin: 0; max-width: min(92vw, 640px); font-weight: 800; font-size: clamp(14px, 2.4vh, 18px); line-height: 1.5; color: var(--ink);
  text-shadow: 0 2px 0 #000, 0 0 12px rgba(0, 0, 0, .8); opacity: 0; transform: translateY(8px); transition: opacity .5s, transform .5s; overflow-wrap: anywhere; word-break: auto-phrase; text-wrap: balance; }
.show-sub.on { opacity: 1; transform: none; }
.show-nm { display: inline-block; max-width: 100%; overflow-wrap: anywhere; } /* 名前をひとかたまりで折り返す */

/* 低い横長（スマホ横・低いウィンドウ）：カードを横並びにして、高さを詰める */
@media (max-height: 560px) {
  .show-body { padding-top: calc(10px + var(--safe-t)); padding-bottom: calc(28px + var(--safe-b)); }
  .show-ttl { --th: clamp(40px, 15vh, 96px); }
  .show-card { width: min(540px, 86vw); grid-template-columns: auto 1fr; grid-template-areas: "ava badge" "ava info"; justify-items: start; align-items: center;
    column-gap: 14px; row-gap: 4px; text-align: left; padding: 10px 14px; }
  .show-card .sc-badge { justify-content: flex-start; }
  .show-card .sc-info { align-items: flex-start; }
  .sc-avw { --avh: clamp(80px, 30vh, 140px); }
}

/* 自分の昇格：最初の「おめでとうございます／タップして門を開く」 */
.show-intro { position: absolute; inset: 0; z-index: 5; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: calc(18vh + var(--safe-t)) 16px calc(16vh + var(--safe-b)); border: 0; margin: 0; color: var(--ink); cursor: pointer;
  background: radial-gradient(circle at 50% 52%, rgba(255, 210, 63, .22), transparent 38%), radial-gradient(circle at 50% 50%, #18205c 0%, #060818 72%); }
.show-intro b { font-family: var(--head); font-weight: 400; font-size: clamp(20px, 7vw, 56px); line-height: 1.2; letter-spacing: .04em; white-space: nowrap;
  background: linear-gradient(180deg, #fff8d0, var(--accent) 50%, #ff9f1c); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #000) drop-shadow(0 0 18px rgba(255, 210, 63, .45)); animation: show-in-fade .6s both; }
.show-intro span { font-weight: 800; font-size: clamp(15px, 2.6vh, 20px); padding: 8px 20px; border: 2px solid #000; border-radius: 999px;
  background: rgba(18, 26, 63, .9); box-shadow: 0 4px 0 #000, 0 0 0 0 rgba(255, 210, 63, .6); animation: show-tap 1.6s ease-in-out infinite; }
.show-intro.bye { animation: show-out .4s forwards; pointer-events: none; }

/* ---- 大きな演出（称号・プロジェクト完了・紹介ボーナス・WELCOME）：--c は色、--ca はその薄い色 ---- */
.show-big { --c: var(--accent); --ca: rgba(255, 210, 63, .28); background: radial-gradient(circle at 50% 45%, rgba(24, 34, 79, .92), rgba(6, 8, 24, .95) 70%); }
.show-rays { position: absolute; left: 50%; top: 45%; width: 160vmax; height: 160vmax; margin: -80vmax 0 0 -80vmax; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, var(--ca) 0deg 7deg, transparent 7deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 42%); mask-image: radial-gradient(circle, #000 0%, transparent 42%);
  animation: show-rot 24s linear infinite; }
.show-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.show-em { width: clamp(88px, 18vh, 150px); height: auto; filter: drop-shadow(0 4px 0 #000) drop-shadow(0 0 24px var(--c)); animation: show-pop-in .6s .2s both; }
.show-lv { font-family: var(--head); font-size: clamp(15px, 2.6vh, 22px); color: var(--ink); background: rgba(0, 0, 0, .5); border: 2px solid #000; border-radius: 999px; padding: 0 14px; }
.show-name { margin: 0; max-width: 92vw; font-family: var(--head); font-weight: 400; font-size: min(clamp(24px, 5vh, 40px), 7.4vw); line-height: 1.25; color: var(--c);
  text-shadow: 0 3px 0 #000, 0 0 18px var(--ca); overflow-wrap: anywhere; word-break: auto-phrase; text-wrap: balance; animation: show-pop-in .5s .35s both; }
.show-gain { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.show-gain > span { display: inline-flex; align-items: center; gap: 4px; padding: 2px 14px; border: 2px solid #000; border-radius: 999px;
  background: rgba(0, 0, 0, .55); box-shadow: 0 3px 0 #000; font-family: var(--head); font-weight: 400; color: var(--accent); }
.show-gain img { width: 20px; height: 20px; }
.show-heads { display: flex; justify-content: center; padding-left: 10px; animation: show-pop-in .5s .2s both; }
.show-heads img { width: clamp(48px, 9vh, 72px); height: clamp(48px, 9vh, 72px); margin-left: -10px; object-fit: cover; border-radius: 50%;
  border: 3px solid #000; background: var(--panel2); box-shadow: 0 4px 0 #000; }
.show-ref-ava { display: grid; place-items: end center; background: radial-gradient(closest-side, var(--ca), transparent 80%); }
.show-fb { height: calc(clamp(110px, 24vh, 220px) * var(--av-k, 1)); width: auto; display: block; filter: drop-shadow(0 5px 0 rgba(0, 0, 0, .55)); animation: show-pop-in .6s .2s both; }
.show-amt { display: inline-flex; align-items: center; gap: 8px; font-family: var(--head); font-weight: 400; font-size: min(clamp(28px, 6vh, 48px), 9.6vw); line-height: 1.1; white-space: nowrap;
  color: var(--accent); text-shadow: 0 3px 0 #000, 0 0 18px rgba(255, 210, 63, .45); animation: show-pop-in .5s .6s both; }
.show-amt img { width: 1.1em; height: 1.1em; filter: drop-shadow(0 3px 0 #000); }
.show-coins { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.show-coin { position: absolute; top: -70px; width: var(--sz, 36px); height: var(--sz, 36px); animation: show-fall var(--d, 3s) var(--dl, 0s) linear infinite both; }

/* ---- 中の演出：真ん中のポップ（下の画面は触れる） ---- */
.show-pop { --c: var(--accent); position: fixed; inset: 0; z-index: 44; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 0 12px; text-align: center; animation: show-fade .3s ease-out; }
.show-pop::before { content: ""; position: absolute; left: 50%; top: 50%; width: min(150vw, 900px); height: min(150vw, 900px); transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(6, 8, 24, .8) 0%, rgba(6, 8, 24, .5) 34%, transparent 64%); }
.show-pop > * { position: relative; }
.show-pop > .show-pop-fx { position: absolute; inset: 0; width: 100%; height: 100%; }
.show-pop .show-ttl { --th: clamp(44px, 12vh, 110px); }
.show-pop-big { font-family: var(--head); font-weight: 400; font-size: clamp(40px, 10vh, 84px); line-height: 1.1; color: var(--c);
  text-shadow: 0 4px 0 #000, 0 0 24px rgba(0, 0, 0, .6); animation: show-pop-in .5s .25s both; }
.show-pop-sub { margin: 0; max-width: 92vw; font-weight: 800; font-size: clamp(14px, 2.4vh, 18px); color: var(--c); text-shadow: 0 2px 0 #000, 0 0 10px rgba(0, 0, 0, .8);
  word-break: auto-phrase; text-wrap: balance; animation: show-in-fade .4s .5s both; }
.show-pop.bye { animation: show-out .5s forwards; }

/* ---- 中の演出：上のリボン（新しい仲間） ---- */
.show-rib { position: fixed; top: calc(8px + var(--safe-t)); left: 0; right: 0; margin: 0 auto; width: min(460px, calc(100% - 16px)); z-index: 44;
  display: flex; animation: show-rib-in .45s cubic-bezier(.2, .9, .3, 1.2) both; }
.show-rib.bye { animation: show-rib-out .35s ease-in forwards; pointer-events: none; }
.show-rib-main { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px 54px 8px 12px; margin: 0;
  border: 2px solid #000; border-radius: 16px; color: var(--ink); text-align: left; cursor: pointer; background: linear-gradient(90deg, #1c2b6e, var(--panel));
  box-shadow: inset 0 0 0 2px rgba(46, 230, 166, .65), 0 5px 0 #000, 0 0 24px rgba(46, 230, 166, .3); }
.show-rib-main::before { content: ""; position: absolute; left: 14px; right: 14px; top: -2px; height: 3px; border-radius: 2px; background: var(--rainbow); }
.show-rib-ava { position: relative; flex: none; width: 52px; height: 52px; }
.show-rib-ava img { display: block; width: 52px; height: 52px; object-fit: cover; border-radius: 50%; border: 2px solid #000; background: var(--panel2); }
.show-rib-ava canvas { position: absolute; left: -30px; top: -30px; width: 112px; height: 112px; pointer-events: none; }
.show-rib-txt { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.show-rib-txt img { display: block; height: 26px; width: auto; max-width: 100%; }
.show-rib-txt span { font-size: 14px; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.show-rib-x { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; padding: 0; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--sub); font-size: 22px; line-height: 1; cursor: pointer; }
.show-rib-x:active { color: var(--ink); }

/* ---- 動き ---- */
@keyframes show-fade { from { opacity: 0; } }
@keyframes show-in-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes show-out { to { opacity: 0; } }
@keyframes show-shake {
  0%, 100% { transform: none; } 12% { transform: translate(-7px, 3px); } 26% { transform: translate(6px, -4px); } 40% { transform: translate(-5px, -2px); }
  55% { transform: translate(4px, 3px); } 70% { transform: translate(-3px, 1px); } 85% { transform: translate(2px, -1px); } }
@keyframes show-breathe { 0%, 100% { opacity: .25; transform: scale(.9); } 50% { opacity: .6; transform: scale(1.05); } }
@keyframes show-breathe-rm { 0%, 100% { opacity: .25; } 50% { opacity: .5; } }
@keyframes show-bloom { 0% { opacity: .4; transform: scale(.8); } 22% { opacity: 1; transform: scale(2.4); } 100% { opacity: .5; transform: scale(1.2); } }
@keyframes show-drop { 0% { opacity: 0; transform: translateY(-36px) scale(1.6); } 60% { opacity: 1; transform: translateY(0) scale(.95); } 100% { opacity: 1; transform: none; } }
@keyframes show-shine { 0% { opacity: 1; background-position: 130% 0; } 45%, 100% { opacity: 1; background-position: -30% 0; } }
@keyframes show-spin {
  0% { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 0)) scale(.15) rotateY(540deg); }
  15% { opacity: 1; }
  75% { transform: translate(0, 0) scale(1.08) rotateY(0deg); }
  100% { opacity: 1; transform: none; } }
@keyframes show-pop-in { 0% { opacity: 0; transform: scale(.4); } 70% { opacity: 1; transform: scale(1.1); } 100% { opacity: 1; transform: none; } }
@keyframes show-rot { to { transform: rotate(360deg); } }
@keyframes show-fall { from { transform: translateY(-10vh) rotate(0deg); } to { transform: translateY(118vh) rotate(var(--r, 360deg)); } }
@keyframes show-tap { 0%, 100% { transform: scale(1); box-shadow: 0 4px 0 #000, 0 0 0 0 rgba(255, 210, 63, .6); } 50% { transform: scale(1.06); box-shadow: 0 4px 0 #000, 0 0 0 10px rgba(255, 210, 63, 0); } }
@keyframes show-rib-in { from { opacity: 0; transform: translateY(-130%); } to { opacity: 1; transform: none; } }
@keyframes show-rib-out { to { opacity: 0; transform: translateY(-130%); } }

/* ---- 動きを減らす設定：ふわっと出すだけ ---- */
.show.rm.shake .show-in { animation: none; }
.show.rm .show-card.on, .show.rm .show-ttl.on, .show-pop.rm .show-ttl.on, .show.rm .show-em, .show.rm .show-name, .show.rm .show-amt,
.show.rm .show-fb, .show.rm .show-heads, .show-pop.rm .show-pop-big, .show.rm .show-intro b { animation: show-in-fade .6s both; }
.show.rm .show-ttl::after, .show-pop.rm .show-ttl::after { display: none; }
.show.rm .show-rays { animation: none; }
.show.rm .show-coins { display: none; }
.show.rm .show-intro span { animation: none; }
.show.rm .show-sub { transform: none; }
.show-rib.rm { animation: show-in-fade .3s both; }
.show-rib.rm.bye { animation: show-out .3s forwards; }
@media (prefers-reduced-motion: reduce) {
  .show.shake .show-in, .show-rays, .show-intro span { animation: none; }
  .show-ttl::after, .show-coins { display: none; }
  .show-card.on, .show-ttl.on, .show-em, .show-name, .show-amt, .show-fb, .show-heads, .show-pop-big { animation: show-in-fade .6s both; }
  .show-rib { animation: show-in-fade .3s both; }
}
