@import url('https://fonts.googleapis.com/css2?family=DotGothic16&display=swap');
:root {
  --win: #0d1530; --win2: #18244a; --line: #f4f1e6; --gold: #f2c14e; --gold2: #c98b1c;
  --blue: #3b78d8; --red: #e0483e; --soul: #8fd6ff; --text: #fffbea;
  --r1: #9aa3ad; --r2: #5cc25c; --r3: #4a8fe7; --r4: #b45ce7; --r5: #f2b630;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
html, body { margin: 0; height: 100%; background: #070b18; color: var(--text); overflow: hidden;
  font-family: 'DotGothic16', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif; touch-action: none; }
body { display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #1b2a4a 0%, #070b18 70%); }
#phone { position: relative; height: 100dvh; aspect-ratio: 9 / 18; max-width: 100vw; overflow: hidden;
  background: #2a4a2a; box-shadow: 0 0 60px #000; }
@media (min-aspect-ratio: 9/18) { #phone { height: 100dvh; width: auto; } }
@media (max-aspect-ratio: 9/18) { #phone { width: 100vw; height: auto; aspect-ratio: 9 / 18; max-height: 100dvh; } }
@media (min-width: 600px) { #phone { border-radius: 18px; height: min(100dvh, 900px); } }

.screen { position: absolute; inset: 0; display: none; flex-direction: column; }
.screen.on { display: flex; }

/* 王道 RPG のウィンドウ: 紺地に白い二重枠 */
.win { background: var(--win); border: 3px solid var(--line); border-radius: 8px; box-shadow: 0 0 0 2px var(--win), 0 4px 10px #0008; }

.btn { font-family: inherit; font-size: 17px; color: #fff; border: 3px solid var(--line); border-radius: 10px;
  padding: 10px 16px; background: var(--blue); box-shadow: 0 4px 0 #0007, inset 0 -4px 0 #0003; cursor: pointer; letter-spacing: 1px; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #0007; }
.btn.gold { background: linear-gradient(#ffd767, var(--gold2)); color: #2a1400; font-weight: bold; text-shadow: 0 1px 0 #ffe9a6; } /* 白いにじみは文字を灰色＝押せない色に見せた（10-17） */
.btn.blue { background: linear-gradient(#5b9cf0, #2a5fb8); }
.btn.big { font-size: 21px; padding: 13px 22px; }
.btn:disabled { filter: grayscale(1) brightness(.6); }
.icon-btn { font-family: inherit; background: var(--win2); color: #fff; border: 2px solid var(--line); border-radius: 8px;
  width: 36px; height: 36px; font-size: 18px; cursor: pointer; }

.ico-gold, .ico-soul { display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: -2px; margin-right: 4px; }
.ico-gold { background: radial-gradient(circle at 35% 35%, #fff6b0, var(--gold) 45%, var(--gold2)); box-shadow: 0 0 0 1.5px #6a4500; }
.ico-soul { width: 14px; height: 18px; vertical-align: -3px; border-radius: 0; filter: drop-shadow(0 0 4px var(--soul)); /* 回した四角は見た目が箱からはみ出すので、箱に収まる上向きのしずくの絵にする */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 18'%3E%3Cdefs%3E%3CradialGradient id='g' cx='.38' cy='.55' r='.6'%3E%3Cstop offset='0' stop-color='%23fff'/%3E%3Cstop offset='.45' stop-color='%238fd6ff'/%3E%3Cstop offset='1' stop-color='%232a7fd0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath d='M7 .5C7 .5 1 7.6 1 11.5a6 6 0 0 0 12 0C13 7.6 7 .5 7 .5Z' fill='url(%23g)'/%3E%3C/svg%3E") center / contain no-repeat; }

/* タイトル */
#s-title { align-items: center; justify-content: flex-end; padding-bottom: 12%; gap: 18px; }
.title-art { position: absolute; inset: 0; background: url(img/ui/title.webp) center/cover, linear-gradient(#5fa8ff, #bfe6ff 55%, #5fb25a 56%, #3d8a3d); }
.title-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 55%, #0008); }
.title-logo { position: absolute; top: 9%; left: 0; right: 0; text-align: center; }
.title-logo span { font-size: 44px; color: #fff; letter-spacing: 4px; padding: 8px 18px;
  text-shadow: 0 3px 0 #b5500f, 0 0 2px #000, 3px 3px 0 #6b2a00, -2px -2px 0 #6b2a00, 2px -2px 0 #6b2a00, -2px 2px 0 #6b2a00; }
#s-title .btn { position: relative; z-index: 1; animation: pulse 1.6s ease-in-out infinite; }
.credit-link { position: relative; z-index: 1; font-size: 12px; opacity: .7; text-decoration: underline; cursor: pointer; }
@keyframes pulse { 50% { transform: scale(1.05); } }

/* 拠点 */
#s-home { background: linear-gradient(#24365e, #142039); padding: 0 10px 10px; }
.bar { display: flex; align-items: center; justify-content: space-between; height: 54px; flex: none; }
.bar-btns { display: flex; gap: 6px; }
.bar-title { font-size: 18px; text-shadow: 0 2px 0 #000; }
.money { background: var(--win); border: 2px solid var(--line); border-radius: 20px; padding: 4px 12px 4px 8px; font-size: 16px; min-width: 84px; }
.money-link { cursor: pointer; }
.money-link:hover, .money-link:focus-visible { border-color: #ffd34d; }
.money-link:active { transform: scale(.96); }
.money.sm { font-size: 13px; min-width: 0; padding: 2px 8px 2px 5px; }
.deck-label, .coll-label { font-size: 14px; margin: 6px 2px 4px; }
.deck-label small, .coll-label small { font-size: 11px; opacity: .7; }
.deck { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; grid-auto-rows: max-content; }
.coll { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; align-content: start; grid-auto-rows: max-content; /* 行をカードの高さに。auto だと行が低く見積もられ下の段が食い込む */
  padding: 2px 2px 8px; touch-action: pan-y; }
.home-foot { display: flex; gap: 10px; padding-top: 8px; flex: none; }
.home-foot .btn { flex: 1; }
.home-foot #b-versus { font-size: 14px; padding: 8px 7px; }
.home-foot #b-go { font-size: 17px; padding: 10px 8px; }

/* ユニットカード（どこでも同じ部品） */
.card { position: relative; aspect-ratio: 3/4; border-radius: 9px; border: 3px solid var(--rc, var(--r1));
  background: radial-gradient(circle at 50% 30%, #fff3, transparent 70%), linear-gradient(var(--rbg, #3a4250), #1a1f2a);
  overflow: hidden; cursor: pointer; box-shadow: 0 3px 0 #0006; }
/* 絵の入れ方は元のまま（幅108%・下から14%。足・翼・武器・髪が枠からはみ出す・切れるのがこの絵の迫力）。
   ただし「顔が★・役の印・+N に隠れる／枠の上に出る」子だけ、顔のあたりが線（--L）の下に来るまで絵を下へずらす（--dy）。
   ずらすと顔の下の2割より上が名前の帯にかかる低い枠（戦闘のカード）でだけ、元の91%まで縮める（--sh）。名前の帯は口・あごを隠してよい。
   --A: 顔のあたりの上端から絵の下端までの高さ、--fh: 顔のあたりの高さ、--fx0/--fx1: 顔のあたりの左右（どれも絵の幅を1として・js/art-frame-table.js・絵から測る）、
   --stw: ★の右端（px）、--dup: +N があれば 1（js/art-fit.js が渡す）。顔のあたりの左右が★・役の印・+N の左右にかかるときだけ、その部品の下端を線にする
   （clamp(0, 差×1000, 下端) は「かかれば下端・かからなければ0」）。顔のあたりの3%までは隠れてよい（--tol0・元で隠れていない子を動かさない）。
   表のない絵（--A なし）と、顔が隠れない子は今までと同じ。10-17 circle「人型のキャラがとくに、枠での見え方があれ」→ 10-18 circle「ダイナミックの絵の良さがきえちゃった」 */
.card { container-type: size; }
.card img { --w0: 108cqw; --bl: calc(50cqw + var(--w0) * (var(--fx0, .5) - .5)); --br: calc(50cqw + var(--w0) * (var(--fx1, .5) - .5)); --bh0: calc(var(--w0) * var(--fh, 0));
  --Lm: max(0px, clamp(0px, calc((var(--stw, 0px) - var(--bl)) * 1000), 18px), clamp(0px, calc((var(--br) - 100cqw + 20px) * 1000), 20px), clamp(0px, calc((var(--br) - 100cqw + 13px) * 1000 * var(--dup, 0)), 36px));
  --L: calc(var(--Lm) - var(--bh0) * .03);
  --dy0: max(0px, calc(var(--L) - (86cqh - var(--w0) * var(--A, 0))));
  --sh: min(clamp(0px, calc((var(--L) + var(--bh0) * .8 - (100cqh - 15px)) * 1000), calc(var(--w0) * .09)), clamp(0px, calc(var(--dy0) * 1000), calc(var(--w0) * .09)));
  --w: calc(var(--w0) - var(--sh)); --dy: max(0px, calc(var(--L) - (86cqh - var(--w) * var(--A, 0))));
  position: absolute; left: 50%; bottom: calc(14% - var(--dy)); width: var(--w); transform: translateX(-50%); pointer-events: none; image-rendering: auto; }
/* 絵が届くまでの仮の影（10-17: 絵は使う画面に入るときに読む）。すぐ届いた絵では見えないよう、0.15秒待ってから薄く出す */
.card .art-wait { position: absolute; left: 18%; right: 18%; top: 16%; bottom: 20%; border-radius: 50% 50% 42% 42%; pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, #fff3, #fff1 60%, transparent 72%); opacity: 0; animation: art-wait 1.2s ease-in-out .15s infinite alternate; }
@keyframes art-wait { from { opacity: .35; } to { opacity: .8; } }
/* 小さな絵（つぎの敵・攻略の窓）の仮の影。届いたら class を外す */
img.art-wait-img { border-radius: 50%; animation: art-wait-img 1.2s ease-in-out .15s infinite alternate; }
@keyframes art-wait-img { from { background: #fff1; } to { background: #fff3; } }
.card .nm { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; text-align: center; background: #000a; padding: 1px 0; white-space: nowrap; overflow: hidden; }
.card .st { position: absolute; top: 1px; left: 3px; font-size: 10px; color: var(--rc); text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.card .role { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; line-height: 18px; text-align: center; color: #fff; box-shadow: 0 0 0 1.5px #fff; }
.card .dup { position: absolute; top: 18px; right: 2px; font-size: 11px; color: #ffe36b; text-shadow: 0 1px 0 #000; }
.card .cost { position: absolute; left: 2px; bottom: 15px; font-size: 13px; color: #fff; background: #0b2440d0; border: 1.5px solid var(--soul); border-radius: 10px; padding: 0 5px 0 2px; }
.card.locked { filter: brightness(.25) grayscale(1); }
.card.locked::after { content: '？'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; color: #fff; filter: none; }
.card.indeck { box-shadow: 0 0 0 3px #fff, 0 0 14px var(--gold); }
.card.empty { border-style: dashed; border-color: #fff5; background: #0003; }
.card.new::before { content: 'NEW'; position: absolute; top: 18px; left: 2px; z-index: 2; font-size: 10px; background: var(--red); padding: 0 3px; border-radius: 3px; }
.r1 { --rc: var(--r1); --rbg: #3e454f; } .r2 { --rc: var(--r2); --rbg: #2d5130; } .r3 { --rc: var(--r3); --rbg: #263f6b; }
.r4 { --rc: var(--r4); --rbg: #4b2a66; } .r5 { --rc: var(--r5); --rbg: #6b4a12; }
.card.r5 { animation: shine 2.4s linear infinite; }
@keyframes shine { 50% { box-shadow: 0 0 12px var(--r5), 0 3px 0 #0006; } }

.info { margin-top: 8px; min-height: 74px; padding: 8px 10px; font-size: 13px; line-height: 1.5; display: flex; gap: 10px; align-items: center; }
.info .face { width: 56px; height: 56px; flex: none; border-radius: 8px; border: 2px solid var(--rc); background: var(--rbg) center/120% no-repeat; background-position: 50% 15%; }
.info b { font-size: 15px; }
.info .bars { display: grid; grid-template-columns: auto 1fr; gap: 1px 6px; font-size: 11px; margin-top: 2px; }
.info .bars i { display: block; height: 7px; margin-top: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--gold), #ff8a3a); }

/* ガチャ */
#s-gacha { background: radial-gradient(ellipse at 50% 40%, #3a2a6a, #120a26); padding: 0 10px 12px; }
.gacha-stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; }
.chest { width: 190px; height: 190px; background: url(img/ui/chest_closed.webp) center/contain no-repeat; position: relative; z-index: 2; }
.chest.fallback { background: linear-gradient(#b5651d, #6b3a10); border: 6px solid #f2c14e; border-radius: 16px 16px 8px 8px; width: 160px; height: 120px; }
.chest.shake { animation: shake .12s linear infinite; }
.chest.open { background-image: url(img/ui/chest_open.webp); }
@keyframes shake { 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }
.glow { position: absolute; width: 10px; height: 10px; border-radius: 50%; opacity: 0; z-index: 1; pointer-events: none; }
.glow.go { animation: burst 0.9s ease-out forwards; }
@keyframes burst { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(80); } }
.g-results { position: absolute; inset: 10px 0; display: none; grid-template-columns: repeat(5, 1fr); gap: 6px; align-content: center; grid-auto-rows: max-content; z-index: 3; }
.g-results.one { grid-template-columns: 1fr; justify-items: center; }
.g-results.one .card { width: 46%; }
.g-results .card { animation: flipin .35s ease-out both; }
@keyframes flipin { from { transform: rotateY(90deg) scale(.6); opacity: 0; } }
.g-results .tag { position: absolute; bottom: 15px; right: 2px; font-size: 10px; background: #000b; padding: 0 3px; border-radius: 3px; color: #ffe36b; }
.rates { text-align: center; font-size: 11px; opacity: .7; margin-bottom: 8px; }
.gacha-foot { display: flex; gap: 10px; } .gacha-foot .btn { flex: 1; }

/* 戦闘 */
#s-battle { background: #000; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.hud { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: 6px 8px; pointer-events: none; }
.hud-l { display: flex; flex-direction: column; gap: 4px; }
.hud-r { display: flex; flex-direction: column; gap: 6px; }
.hud-r { align-items: flex-end; }
.wave { background: var(--win); border: 2px solid var(--line); border-radius: 8px; padding: 2px 10px; font-size: 15px; }
.castle { position: relative; width: 120px; height: 16px; background: #000a; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; }
.castle div { height: 100%; background: linear-gradient(#7be07b, #2f9a3a); transition: width .3s; }
.castle span { position: absolute; inset: 0; font-size: 11px; text-align: center; line-height: 12px; text-shadow: 0 1px 0 #000; }
.soul { background: #0b2440e0; border: 2px solid var(--soul); border-radius: 20px; padding: 3px 12px 3px 8px; font-size: 20px; box-shadow: 0 0 12px #8fd6ff66; }
.soul.bump { animation: bump .25s; }
@keyframes bump { 50% { transform: scale(1.15); } }
.boss-bar { position: absolute; top: 66px; left: 12px; right: 100px; display: none; font-size: 13px; text-align: center; text-shadow: 0 1px 0 #000; }
.boss-bar div { height: 12px; border: 2px solid var(--line); border-radius: 6px; background: #000a; overflow: hidden; }
.boss-bar i { display: block; height: 100%; background: linear-gradient(#ff7a5a, #b51c10); width: 100%; transition: width .2s; }
.speed, .quit { position: absolute; font-family: inherit; color: #fff; background: var(--win); border: 2px solid var(--line); border-radius: 8px; cursor: pointer; }
.hud-r .speed, .hud-r .stats-btn { position: static; pointer-events: auto; flex: none; }
.speed { width: 46px; height: 32px; font-size: 15px; }
.speed.fast { background: #a5520f; }
.quit { left: 8px; bottom: 15%; width: 30px; height: 30px; font-size: 13px; opacity: .6; }
.wave-btn { position: absolute; left: 50%; transform: translateX(-50%); bottom: 15%; z-index: 3; }
.wave-btn:active { transform: translateX(-50%) translateY(3px); }
.next-wave { position: absolute; left: 50%; transform: translateX(-50%); bottom: 22%; display: flex; gap: 4px; align-items: center;
  background: var(--win); border: 2px solid var(--line); border-radius: 8px; padding: 3px 8px; font-size: 12px; z-index: 3; }
.next-wave img { width: 28px; height: 28px; object-fit: contain; }
/* 予告の顔は押せる（名前と動きの小窓）。顔の下に動きの印（js/enemy-tags.js・10-18） */
.nw-foe { display: inline-flex; align-items: center; gap: 1px; background: none; border: 0; padding: 0; margin: 0; color: inherit; font: inherit; cursor: pointer; }
.nw-face { display: flex; flex-direction: column; align-items: center; }
.nw-tags { display: flex; gap: 1px; height: 10px; line-height: 10px; margin-top: -1px; }
.nw-tag { font-style: normal; font-size: 9px; font-weight: bold; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.foe-card .foe-head { display: flex; align-items: center; gap: 8px; }
.foe-card .foe-head img { width: 56px; height: 56px; object-fit: contain; flex: none; }
.foe-card h3 { margin: 0; }
.foe-card .foe-tags { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.foe-card .foe-tags li { display: grid; grid-template-columns: 18px auto 1fr; gap: 6px; align-items: baseline; }
.foe-card .foe-tags .nw-tag { font-size: 14px; }
.foe-card .foe-desc { margin: 8px 0 0; color: #ffe4a0; }
.stage-counter-tip { line-height: 1.6; color: #ffe4a0; }
.strip { position: absolute; left: 0; right: 0; bottom: 0; height: 13%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px;
  padding: 6px 6px 8px; background: linear-gradient(#0d1530e0, #0d1530); border-top: 3px solid var(--line); }
.strip .card { aspect-ratio: auto; height: 100%; }
.strip .card.poor { filter: brightness(.45) saturate(.4); }
.strip .card.poor .cost { border-color: var(--red); color: #ffb3ad; }
.strip .card.armed { box-shadow: 0 0 0 3px #fff, 0 0 16px var(--soul); transform: translateY(-4px); }
.sell-zone { position: absolute; left: 0; right: 0; bottom: 0; height: 13%; display: none; place-items: center; z-index: 4;
  background: #6b1410e8; border-top: 3px solid #ffb3ad; font-size: 18px; }
.banner { position: absolute; left: 0; right: 0; top: 36%; text-align: center; font-size: 34px; pointer-events: none; opacity: 0;
  text-shadow: 0 3px 0 #000, 0 0 12px #000; letter-spacing: 3px; }
.banner.go { animation: banner 1.8s ease-out forwards; }
.banner.boss { color: #ff6a4a; font-size: 40px; white-space: nowrap; }
@keyframes banner { 0% { opacity: 0; transform: scale(2); } 15% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }
.vignette { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 60px 10px #ff0000; opacity: 0; transition: opacity .3s; }
.result { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: #000a; z-index: 10; }
.result .win { width: 84%; padding: 18px; text-align: center; }
.result h2 { margin: 4px 0 10px; font-size: 30px; font-weight: normal; }
.result .row { font-size: 16px; margin: 6px 0; }
.result .btns { display: flex; gap: 8px; margin-top: 14px; } .result .btns .btn { flex: 1; font-size: 15px; padding: 10px 6px; }

.ghost { position: absolute; width: 64px; height: 64px; pointer-events: none; display: none; z-index: 20; transform: translate(-50%, -70%); }
.ghost img { width: 100%; filter: drop-shadow(0 4px 4px #000a); }

.modal { position: absolute; inset: 0; background: #000b; display: none; align-items: center; justify-content: center; z-index: 30; }
.modal .win { width: 88%; max-height: 80%; overflow: auto; padding: 14px; font-size: 12px; line-height: 1.6; touch-action: pan-y; }
.modal .btn { margin-top: 10px; width: 100%; }

/* 長押しで待っている印（カードが少し沈む） */
.card.holding { transform: scale(.92) translateY(2px); filter: brightness(.8); transition: transform .4s linear, filter .4s linear; }
.hold-hint { margin-left: 4px; }
/* 性能の小窓 */
.uinfo { background: linear-gradient(#1b2a5a, #101a3c); }
.uinfo .uhead { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.uinfo .uhead b { font-size: 18px; }
.uinfo .face { width: 64px; height: 64px; flex: none; border-radius: 8px; border: 2px solid var(--rc); background: var(--rbg) center/120% no-repeat; background-position: 50% 15%; }
.uinfo .ust { color: var(--rc); font-size: 14px; text-shadow: 0 1px 0 #000; }
.uinfo .usub { opacity: .85; }
.uinfo .ugrid { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 3px 10px; font-size: 13px; border-top: 1px solid #fff4; border-bottom: 1px solid #fff4; padding: 8px 0; }
.uinfo .ugrid span { opacity: .75; } .uinfo .ugrid b { font-weight: normal; color: #ffe36b; }
.uinfo .udesc { margin-top: 8px; font-size: 13px; line-height: 1.6; }
.uinfo .unote { margin-top: 6px; font-size: 10px; opacity: .6; }

/* 活躍の表（戦闘を止めずに重ねて見る。カード帯と Wave ボタンは隠さない） */
.stats-btn { width: 46px; height: 28px; font-family: inherit; font-size: 12px; color: #fff; background: var(--win); border: 2px solid var(--line); border-radius: 8px; cursor: pointer; }
.stats-bg { position: absolute; left: 0; right: 0; top: 0; bottom: 13%; z-index: 2; display: none; }
.stats { position: absolute; left: 6px; right: 6px; top: 158px; bottom: 28%; z-index: 4; display: none; flex-direction: column; padding: 6px 8px; font-size: 12px; background: #0d1530dd; }
.stats.on, .stats-bg.on { display: flex; }
.stats-bg.on { display: block; }
.st-head { display: flex; align-items: center; gap: 8px; }
.st-head b { font-size: 15px; font-weight: normal; margin-right: auto; }
.stats button { font-family: inherit; color: #fff; background: #2a3a6a; border: 2px solid #f4f1e655; border-radius: 6px; font-size: 11px; padding: 2px 7px; cursor: pointer; }
.stats button.on { background: var(--gold2); border-color: var(--line); color: #fff; }
#st-x { width: 26px; height: 26px; padding: 0; font-size: 13px; }
.st-sort { display: flex; gap: 5px; align-items: center; margin: 5px 0 3px; font-size: 11px; opacity: .95; }
.st-sort span { opacity: .7; }
.st-cols, .st-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) repeat(4, 44px); gap: 3px; align-items: center; }
.st-cols { font-size: 10px; opacity: .65; text-align: right; } .st-cols .nm { text-align: left; }
.st-rows { flex: 1; overflow-y: auto; touch-action: pan-y; margin-top: 2px; }
.st-row { position: relative; height: 32px; padding: 0 2px; border-bottom: 1px solid #fff2; background: linear-gradient(90deg, #e7604a66 var(--bar, 0%), transparent var(--bar, 0%)); }
.st-row img { width: 28px; height: 28px; object-fit: contain; }
.st-row .nm { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-row .nm small { opacity: .6; }
.st-row span.n { text-align: right; font-size: 11px; color: #ffe36b; }
.st-row span.n.t { color: #8fc4ff; } .st-row span.n.h { color: #9affb0; } .st-row span.n.k { color: #fff; }
.st-row.sold { filter: grayscale(1); opacity: .55; }
.st-empty { padding: 14px 0; text-align: center; opacity: .7; }
.uinfo .ustat { margin-top: 8px; padding-top: 6px; border-top: 1px solid #fff4; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; text-align: center; font-size: 10px; }
.uinfo .ustat b { display: block; font-weight: normal; font-size: 14px; color: #ffe36b; }
.uinfo .ustat span { opacity: .7; }
.uinfo .ustt { margin-top: 8px; font-size: 11px; opacity: .8; }
.result .mvp { font-size: 13px; margin: 3px 0; text-align: left; padding: 0 6px; }
.result .mvp b { color: #ffe36b; font-weight: normal; }

/* デッキの並べ替えドラッグ */
.card.lifted { opacity: .3; }
.dragghost { position: absolute; z-index: 25; pointer-events: none; margin: 0; aspect-ratio: 3/4; transform: translate(-50%, -58%) scale(1.12) rotate(-4deg); box-shadow: 0 12px 18px #000a, 0 0 0 3px #fff; transition: none; }
.deck .card.drop { box-shadow: 0 0 0 3px #fff, 0 0 16px 4px var(--gold); transform: translateY(-5px) scale(1.06); transition: transform .12s; }
.deck .card { transition: transform .12s; }
.coll.dropzone { outline: 3px dashed var(--soul); outline-offset: -3px; background: #8fd6ff22; }
.deck .card.holding { transition: transform .4s linear, filter .4s linear; }

/* ---- リロール ---- */
.reroll-btn { position: absolute; right: 8px; bottom: 15%; z-index: 3; width: 82px; font-family: inherit; font-size: 15px; line-height: 1.15; color: #fff; cursor: pointer;
  background: linear-gradient(#c880f0, #6a2a9a); border: 3px solid var(--line); border-radius: 10px; padding: 4px 2px 5px; box-shadow: 0 4px 0 #0007, inset 0 -4px 0 #0003; }
.reroll-btn small { font-size: 12px; color: #ffe36b; }
.reroll-btn:active { box-shadow: 0 1px 0 #0007; }
.reroll-btn.off { filter: grayscale(1) brightness(.45); }
.banner.note { font-size: 20px; letter-spacing: 1px; top: 44%; }
.rr h3, .cmp h3 { margin: 0 0 6px; font-size: 18px; font-weight: normal; }
.rr h3 small { font-size: 12px; color: #ffe36b; margin-left: 6px; }
.rr-lab { font-size: 12px; opacity: .8; margin: 6px 0 3px; }
.rr-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; min-height: 72px; }
.rr-slot { position: relative; perspective: 400px; }
.rr .card { cursor: pointer; }
.rr .card.pick { box-shadow: 0 0 0 3px #fff, 0 0 14px var(--gold); }
.rr .card:not(.pick):not(.rrback) { filter: brightness(.55) saturate(.6); }
.rrback { background: repeating-linear-gradient(45deg, #2a1a5a 0 6px, #3a2a7a 6px 12px); border-color: #f2c14e; display: grid; place-items: center; box-shadow: 0 0 10px #b45ce7aa; }
.rrback b { font-size: 26px; color: #ffe36b; font-weight: normal; }
.rrback.turn { animation: rrturn .17s ease-in forwards; }
@keyframes rrturn { to { transform: rotateY(90deg) scale(.9); } }
.rr .card.flipped { animation: flipin .28s ease-out both; }
.rrglow { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; pointer-events: none; z-index: 3; animation: rrburst .8s ease-out forwards; }
@keyframes rrburst { 0% { opacity: 1; transform: scale(.6); } 100% { opacity: 0; transform: scale(5); } }
.rr-count { margin-top: 8px; font-size: 14px; text-align: center; } .rr-count b { color: #ffe36b; font-weight: normal; font-size: 18px; display: inline-block; }
.rr-count small { font-size: 10px; opacity: .65; display: block; }
.rr-count b.bump { animation: bump .25s; }
.ubtns { display: flex; gap: 8px; margin-top: 10px; }
.modal .ubtns .btn { margin-top: 0; width: auto; flex: 1; font-size: 15px; padding: 9px 6px; }
#modal2 { z-index: 31; }
.upgrade-panel { margin-top: 10px; padding-top: 8px; border-top: 1px solid #9c773c; color: #ffe36b; }
.upgrade-button { display: block; width: 100%; min-height: 52px; margin: 7px 0 4px; padding: 10px 6px; border: 2px solid #ffe36b; border-radius: 6px; background: linear-gradient(#ad7930, #65431c); color: #fff5ce; font: bold 15px DotGothic16, sans-serif; cursor: pointer; touch-action: manipulation; }
.evo-onetap { display: flex; align-items: center; gap: 6px; min-height: 40px; font-size: 12px; color: #f3e6c4; cursor: pointer; }
.evo-onetap input { width: 20px; height: 20px; margin: 0; }
.upgrade-button:disabled { background: #36342f; border-color: #6f6653; color: #aaa18e; cursor: default; }
#ui-upgrade-note { min-height: 19px; font-size: 11px; color: #e1caa0; }
.uinfo .ugrid b small { opacity: .6; font-size: 10px; }

/* ---- 比べる ---- */
.cmp-base { font-size: 13px; opacity: .85; margin-bottom: 6px; }
.cmp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-height: 46vh; overflow-y: auto; touch-action: pan-y; padding: 3px; }
.cmp-top { display: grid; grid-template-columns: 82px 1fr 1fr; gap: 6px; align-items: end; margin-bottom: 6px; }
.cmp-h { display: flex; flex-direction: column; align-items: center; gap: 1px; text-align: center; font-size: 12px; }
.cmp-h b { font-size: 14px; font-weight: normal; } .cmp-h .ust { color: var(--rc); } .cmp-h .usub { opacity: .75; font-size: 11px; }
.cmp-h .face { width: 46px; height: 46px; border-radius: 8px; border: 2px solid var(--rc); background: var(--rbg) center/120% no-repeat; background-position: 50% 15%; }
.cmp-rows { display: grid; grid-template-columns: 82px 1fr 1fr; gap: 0 6px; border-top: 1px solid #fff4; }
.cmp-rows > div { padding: 2px 0; border-bottom: 1px solid #fff2; font-size: 12px; }
.cmp-rows .cl { opacity: .75; font-size: 11px; align-self: center; }
.cmp-rows .cv { text-align: center; }
.cmp-rows .cv b { font-weight: normal; color: #ffe36b; font-size: 14px; }
.cmp-rows .cv small { display: inline; margin-left: 5px; font-size: 11px; }
.cmp-rows .cv.up small { color: #7dffa0; } .cmp-rows .cv.dn small { color: #ff7a6a; } .cmp-rows .cv.neu small { color: #aab; }
.cmp-desc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; font-size: 10px; opacity: .85; line-height: 1.45; }

/* ---- なかまの表 ---- */
.viewsw { float: right; } .viewsw button, .tblbar button { font-family: inherit; color: #fff; background: #2a3a6a; border: 2px solid #f4f1e655; border-radius: 6px; font-size: 12px; padding: 1px 9px; cursor: pointer; margin-left: 3px; }
.viewsw button.on, .tblbar button.on { background: var(--gold2); border-color: var(--line); }
.tblbar { display: none; align-items: center; justify-content: space-between; margin: 0 2px 4px; } .tblbar.on { display: flex; } .tblbar small { font-size: 10px; opacity: .65; } .tblbar button { margin: 0 3px 0 0; }
.tbl { display: none; flex: 1; min-height: 0; overflow: auto; touch-action: pan-x pan-y; background: #0d1530a0; border: 2px solid #f4f1e633; border-radius: 6px; }
.tbl.on { display: block; }
.tbl table { border-collapse: separate; border-spacing: 0; font-size: 12px; white-space: nowrap; min-width: 100%; }
.tbl th, .tbl td { padding: 3px 7px; text-align: right; border-bottom: 1px solid #fff2; background: #121c3c; }
.tbl thead th { position: sticky; top: 0; z-index: 2; background: #22346a; font-weight: normal; font-size: 11px; cursor: pointer; }
.tbl thead th.on { color: #ffe36b; }
.tbl th.nm, .tbl td.nm { position: sticky; left: 0; z-index: 1; text-align: left; min-width: 124px; max-width: 124px; overflow: hidden; text-overflow: ellipsis; box-shadow: 2px 0 0 #0008; }
.tbl thead th.nm { z-index: 3; }
.tbl td.nm .face { display: inline-block; width: 26px; height: 26px; vertical-align: middle; margin-right: 5px; border-radius: 5px; border: 1.5px solid var(--rc); background: var(--rbg) center/130% no-repeat; background-position: 50% 15%; }
.tbl td.nm b { font-weight: normal; vertical-align: middle; } .tbl td.nm small { color: #ffe36b; margin-left: 3px; }
.tbl td.s { color: var(--rc); text-align: center; }
.tbl i.rl { display: inline-block; width: 18px; height: 18px; border-radius: 50%; font-style: normal; font-size: 11px; line-height: 18px; text-align: center; color: #fff; }
.tbl tr.indeck td { background: #3a3510; } .tbl tr.indeck td.nm { box-shadow: inset 4px 0 0 var(--gold), 2px 0 0 #0008; }
.tbl tbody tr { cursor: pointer; } .tbl tbody tr:active td { filter: brightness(1.4); }
.tbl-note { font-size: 10px; opacity: .6; padding: 6px 8px; white-space: normal; position: sticky; left: 0; width: 340px; }

.modal .win.cmp { max-height: 92%; padding: 10px 12px; }

.cmp .unote { font-size: 10px; opacity: .6; margin-top: 6px; }

/* ステージ選択 */
.stage-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.stage-wrap { display: flex; flex-direction: column; gap: 4px; flex: none; }
.stage-card { position: relative; display: block; width: 100%; aspect-ratio: 2.2 / 1; padding: 0; overflow: hidden; font-family: inherit; color: #fff; cursor: pointer;
  border: 3px solid var(--line); border-radius: 10px; background: var(--win); box-shadow: 0 0 0 2px var(--win), 0 4px 10px #0008; }
.stage-card:active { transform: translateY(2px); }
.stage-card .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: filter .5s; }
.stage-card .sname { position: absolute; left: 10px; bottom: 31px; font-size: 22px; text-shadow: 0 2px 0 #000, 0 0 8px #000; z-index: 2; }
.stage-card .ssub { position: absolute; left: 8px; bottom: 5px; font-size: 13px; font-weight: bold; color: #fff; background: #000b; border-radius: 6px; padding: 1px 8px; text-shadow: 0 1px 0 #000; z-index: 2; } /* 草や明るい絵の上でも読めるよう暗い下敷き */
.stage-card .sclear { position: absolute; right: 8px; top: 6px; font-size: 12px; color: #ffe36b; background: #000a; border: 1.5px solid #ffe36b; border-radius: 10px; padding: 1px 8px; z-index: 2; }
.stage-card.locked .art { filter: brightness(.3) saturate(.5); }
.stage-card.locked .sname, .stage-card.locked .ssub { z-index: 4; background: #000b; border-radius: 6px; padding: 0 7px; left: 8px; } /* 鎖の上に暗い下敷きごと出して、札の名前が読めるように */
.stage-card.locked .sname { bottom: 32px; }
.stage-card .chains { position: absolute; inset: -2%; width: 104%; height: 104%; object-fit: cover; z-index: 3; pointer-events: none; transform-origin: 50% 50%; animation: chain-sway 3.2s ease-in-out infinite; filter: drop-shadow(0 3px 4px #000a); }
@keyframes chain-sway { 0%, 100% { transform: rotate(-.8deg) scale(1); } 50% { transform: rotate(.8deg) scale(1.012); } }
.stage-card.nope { animation: nope .4s; }
@keyframes nope { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.stage-card.unlocking .chains { animation: lock-rattle .12s linear infinite; }
@keyframes lock-rattle { 0% { transform: translate(-3px, 1px) rotate(-1.2deg); } 50% { transform: translate(3px, -1px) rotate(1.2deg); } 100% { transform: translate(-3px, 1px) rotate(-1.2deg); } }
.stage-card.opened .art { filter: brightness(1.25) saturate(1.1); }
.stage-card .padlock { position: absolute; left: 50%; top: 50%; width: 30%; z-index: 4; transform: translate(-50%, -50%); animation: padlock-pop 1s ease-out forwards; pointer-events: none; }
@keyframes padlock-pop { 0% { transform: translate(-50%, -50%) scale(.8) rotate(-8deg); opacity: 1; } 30% { transform: translate(-50%, -60%) scale(1.15) rotate(6deg); opacity: 1; } 100% { transform: translate(-50%, 40%) scale(.9) rotate(30deg); opacity: 0; } }
.stage-card .piece { position: absolute; left: 50%; top: 50%; width: 22%; z-index: 4; transform: translate(-50%, -50%); animation: piece-fly 1.1s ease-out forwards; pointer-events: none; }
@keyframes piece-fly { 0% { transform: translate(-50%, -50%) rotate(0); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)); opacity: 0; } }
.stage-card .sflash { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0; animation: sflash .8s ease-out; }
@keyframes sflash { 0% { opacity: .9; transform: scale(.2); } 100% { opacity: 0; transform: scale(1.6); } }
.stage-cap { text-align: center; font-size: 13px; color: #cfd6ee; min-height: 18px; }

/* ボスの体力ばー: 中ボスは金ふち、本ボスは大きく・半分の目印つき */
.boss-bar > div { position: relative; }
.boss-bar.mid { color: #ffe9a8; } .boss-bar.mid > div { border-color: #f2c14e; }
.boss-bar.big { font-size: 15px; } .boss-bar.big > div { height: 16px; border-color: #ff9a7a; }
.boss-bar u { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; opacity: .8; display: none; text-decoration: none; }
.boss-intro { position: absolute; inset: 0; z-index: 30; display: none; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle, #1a0008e0, #000d); text-align: center; text-shadow: 0 3px 0 #000; }
.boss-intro img { width: 62%; max-height: 40%; object-fit: contain; filter: drop-shadow(0 0 18px #ff3a1a); animation: bi-in 2s ease-out forwards; }
.boss-intro .bi-sub { font-size: 16px; color: #ffcf9a; margin-top: 10px; }
.boss-intro .bi-name { font-size: 40px; color: #ff6a4a; letter-spacing: 4px; }
.boss-intro .bi-go { font-size: 20px; margin-top: 2px; }
@keyframes bi-in { 0% { transform: scale(.5); opacity: 0; } 25% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

/* スクロールバー: ブラウザ標準の灰色をやめ、ドラクエ風の紺地に金のつまみ（細め・角丸・矢印なし） */
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: #e8c25a rgba(8, 14, 36, .85); } }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(8, 14, 36, .85); border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
::-webkit-scrollbar-thumb { background: linear-gradient(#ffe08a, #c99a2e); border-radius: 8px; border: 1px solid #fff; }
::-webkit-scrollbar-thumb:active { background: linear-gradient(#fff0b8, #e0b040); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }

/* 長押し小窓の「いま受けている効果」（ピクシーの攻撃速度・勇者の攻撃力） */
.uinfo .ubuff { margin-top: 8px; padding: 6px 8px; font-size: 12px; background: #0006; border: 1px solid #fff3; border-radius: 6px; line-height: 1.7; }
.uinfo .ubuff b { font-weight: normal; opacity: .75; margin-right: 6px; }
.uinfo .ubuff .bf { display: inline-block; margin-right: 10px; white-space: nowrap; }
.uinfo .ubuff .bf i { font-style: normal; font-weight: bold; margin-right: 3px; }
.uinfo .ubuff .bf.as i { color: #ffd84a; } .uinfo .ubuff .bf.atk i { color: #ff5a4a; } .uinfo .ubuff .bf.none { opacity: .6; }

/* せってい（拠点の歯車アイコン） */
.setwin { text-align: center; }
.setwin h3 { margin: 0 0 8px; font-size: 18px; color: var(--gold); }
.setwin .setrow { text-align: left; margin-top: 10px; }
.setwin .setrow .btn { margin-top: 0; font-size: 15px; padding: 10px 8px; }
.setwin .setnote { font-size: 11px; color: #c9c6b4; line-height: 1.5; margin: 4px 2px 0; }
.setwin .btn.red { background: linear-gradient(#f0675d, #b3322a); }
.setwin .setmsg { margin-top: 12px; min-height: 2.4em; padding: 7px 9px; font-size: 12px; background: var(--win2); border: 2px solid var(--gold2); border-radius: 8px; line-height: 1.5; text-align: left; }
.setwin .setmsg:empty { display: none; }
.setwin .setask { margin-top: 10px; padding: 10px; border: 2px solid var(--red); border-radius: 8px; background: #2a1020; }
.setwin .setask b { display: block; font-size: 15px; margin-bottom: 4px; }
.setwin .setask .ubtns { display: flex; gap: 8px; margin-top: 8px; }
.setwin .setask .ubtns .btn { margin-top: 0; flex: 1; font-size: 14px; padding: 9px 4px; }

/* 準備中にいちばん下の段のマスへボタンと「つぎ」の札がかぶっていた（10-14 circle「ここの3ます置きづらいね？」）。
   ボタン類はマスの下端とカード帯のすき間（約40px）に収め、「つぎ」は敵が来る上側（左右の HUD の間）へ移す */
.wave-btn { bottom: calc(13% + 3px); height: 36px; padding: 0 18px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.reroll-btn { bottom: calc(13% + 3px); height: 36px; padding: 0; font-size: 11px; line-height: 1.05;
  display: flex; align-items: center; justify-content: center; gap: 2px; }
.reroll-label { flex: none; white-space: nowrap; }
.reroll-dice { display: block; width: 26px; height: 26px; flex: none; object-fit: contain; pointer-events: none; }
.reroll-btn.rolling .reroll-dice { animation: reroll-dice-spin .42s ease-out; }
@keyframes reroll-dice-spin {
  0% { transform: rotate(0deg); }
  15% { transform: rotate(45deg) scale(.7); }
  85% { transform: rotate(315deg) scale(.7); }
  100% { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .reroll-btn.rolling .reroll-dice { animation: none; }
}
.reroll-btn small { font-size: 11px; }
.quit { bottom: calc(13% + 6px); }
.next-wave { top: 62px; bottom: auto; max-width: 216px; flex-wrap: wrap; justify-content: center; }

/* 対戦: 両陣15マスは160〜272と448〜560。帯と操作はその外へ。 */
#s-versus { background: linear-gradient(#14243e, #294a55); }
.vs-guide { text-align: center; font-size: 14px; line-height: 1.8; padding: 8px 16px; }
#vs-levels { display: grid; gap: 18px; margin: 8px 24px; }
#vs-levels small { display: block; margin-top: 8px; font-size: 12px; }
.vs-hud, .vs-note, .vs-peek { display: none; }
.versus .hud-l, .versus #hud-gold, .versus .hud-r .soul, .versus #next-wave { display: none !important; }
.versus .hud-r .money { display: none; }
.versus .hud-r { position: absolute; top: 72px; right: 8px; flex-direction: row; }
.versus .vs-hud { position: absolute; inset: 5px 7px auto; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: #0c1630ed; border: 2px solid #eee4cd; border-radius: 7px; padding: 8px; font-size: 13px; pointer-events: none; }
.vs-blue { color: #8fcaff; }.vs-red { color: #ffa395; }
.versus .vs-note { display: block; position: absolute; top: 44%; width: 100%; text-align: center; font-size: 12px; color: #fff8d2; pointer-events: none; text-shadow: 1px 2px 3px #000; }
.versus .vs-peek { position: absolute; left: 7px; bottom: calc(13% + 3px); height: 36px; padding: 0 6px; font-size: 12px; }
.versus .wave-btn { left: 50%; width: 106px; padding: 0 3px; font-size: 15px; }
.versus .reroll-btn { width: 78px; right: 7px; }
.versus .quit { top: 72px; bottom: auto; }
.versus .vs-inactive { pointer-events: none; opacity: .35; }

/* 対戦の初勝利ボーナス（★確定ガチャ） */
.g-bonus { display: block; margin: 4px auto 6px; padding: 6px 18px; line-height: 1.2; animation: gbonus 1.2s ease-in-out infinite; }
.g-bonus[hidden] { display: none; }
.g-bonus small { display: block; font-size: 11px; opacity: .9; }
@keyframes gbonus { 50% { box-shadow: 0 0 18px 4px #ffd84a; } }
.chest.confirmed { filter: drop-shadow(0 0 14px var(--rc)) drop-shadow(0 0 30px var(--rc)) brightness(1.15); }
.g-confirm { position: absolute; left: 0; right: 0; top: 18%; z-index: 3; text-align: center; font-size: 30px; font-weight: 900; color: #fff;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--rc) 75%, #000), transparent); padding: 8px 0; letter-spacing: .1em;
  text-shadow: 0 2px 0 #000, 0 0 12px var(--rc); pointer-events: none; animation: gconfirm 2.2s ease-out forwards; }
.g-confirm b { font-size: 40px; }
@keyframes gconfirm { 0% { opacity: 0; transform: scaleX(0); } 12% { opacity: 1; transform: scaleX(1.1); } 20% { transform: scaleX(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
.vs-bonus { color: #ffd84a; font-weight: 900; }
.pve-level small em { display: block; font-style: normal; color: #8a1f00; font-weight: 900; text-shadow: none; }
/* はじめて: 宝箱ガチャへ誘う */
#b-gacha.beckon { position: relative; animation: beckon 1s ease-in-out infinite; }
#b-gacha.beckon::after { content: 'まずはここ！'; position: absolute; top: 1px; left: 50%; transform: translateX(-50%); background: #e8322a; color: #fff; font-size: 9px; line-height: 1.3; padding: 0 5px; border-radius: 7px; white-space: nowrap; pointer-events: none; }
@keyframes beckon { 50% { box-shadow: 0 0 18px 6px #ffd84a; } }

/* 推し指名券 */
.pick-modal { position: absolute; inset: 0; z-index: 20; background: #000b; display: flex; align-items: center; justify-content: center; padding: 12px; }
.pick-in { background: #16223b; border: 3px solid #e5d1a0; border-radius: 12px; padding: 10px; max-height: 100%; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 8px; }
.pick-in h3 { margin: 0; text-align: center; color: #ffe9a8; }
.pick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; overflow-y: auto; }
.pick-grid .card.locked { filter: grayscale(1) brightness(.6); }
.pick-grid .card .tag { position: absolute; left: 0; right: 0; top: auto; bottom: 24px; text-align: center; background: #000c; color: #ffe36a; font-size: 11px; padding: 1px 0; }

.g-results.many { align-content: start; overflow-y: auto; padding-bottom: 8px; }
.g-results.many .g-sum { grid-column: 1 / -1; text-align: center; font-weight: bold; color: #ffe36b; background: #000a; border-radius: 6px; padding: 4px; font-size: 13px; }
.g-results.many .tag { font-size: 9px; white-space: nowrap; }
.gacha-foot { flex-wrap: wrap; } .gacha-foot .g-all { flex: 1 0 100%; order: -1; padding-top: 8px; padding-bottom: 8px; }
.g-results .g-hint { grid-column: 1 / -1; justify-self: center; margin-top: 6px; padding: 4px 12px; border-radius: 999px; background: #000a; color: #fff; font-size: 12px; animation: hintpulse 1.6s ease-in-out infinite; }
@keyframes hintpulse { 50% { opacity: .55; } }
.st-row .nm.evo { color: #fff29a; }

/* ランクマッチ */
.ranked-card { margin: 6px 12px 0; flex-shrink: 0; }
.ranked-card .ranked-open { width: 100%; padding: 7px 10px; min-height: 64px; display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; text-align: left; border-color: #e7c979; background: linear-gradient(115deg,#233d66,#18233e); }
.ranked-open b { font-size: 15px; color: #ffe5a2; }
.ranked-open strong { font-size: 14px; }
.ranked-open small { grid-column: 1 / -1; font-size: 11px; font-weight: normal; }
.ranked-details { line-height: 1.7; font-size: 13px; overflow-wrap: anywhere; }
.ranked-details p { margin: 8px 0; }
.ranked-stats { padding: 8px; border: 1px solid #6889b7; border-radius: 6px; background: #152541; }
.ranked-prize { color: #ffe5a2; }
.ranked-result { display: flex; flex-direction: column; gap: 6px; margin: 9px 0; color: #a8edff; animation: ranked-rise .65s ease-out both; }
.ranked-result strong { font-size: 21px; }
.ranked-result small { font-size: 11px; }
.ranked-result.down { color: #e5b7ef; animation-name: ranked-fall; }
.ranked-promotion { align-self: center; color: #ffe27b; animation: ranked-glow 1s ease-in-out 3; }
.ranked-tip { font-size: 12px; line-height: 1.5; margin: 8px 0; }
@keyframes ranked-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ranked-fall { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ranked-glow { 50% { text-shadow: 0 0 15px #ffcd48; transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .ranked-result, .ranked-promotion { animation: none; } }
/* 札の「挑む」は押したらすぐ始まる（ranked-ui.js）。続きのランク戦があるときは「再開」。説明は右下の小さな「くわしく」 */
.ranked-card { position: relative; }
.ranked-more { position: absolute; right: 6px; bottom: 4px; z-index: 1; min-height: 40px; min-width: 52px; padding: 2px 10px; border: 1px solid #e7c979; border-radius: 8px; background: #101a3acc; color: #ffe5a2; font: inherit; font-size: 11px; cursor: pointer; }
.ranked-more.has-reward { background: linear-gradient(#ffd75e,#e09a1c); color: #3a2200; font-weight: bold; }
.ranked-card .ranked-open { position: relative; padding-right: 64px; }
.ranked-card .ranked-open::after { content: attr(data-go); position: absolute; right: 10px; top: 50%; transform: translateY(-50%); padding: 6px 10px; border-radius: 8px; background: linear-gradient(#ffd75e,#e09a1c); color: #3a2200; font-weight: bold; font-size: 13px; box-shadow: 0 2px 0 #8a5a00; }

/* 進化後の絵（キャラ情報の「しんか →」の横に出す） */
.evo-row { display: flex; gap: 10px; align-items: center; }
.evo-row .evo-art { width: 84px; height: auto; flex-shrink: 0; filter: drop-shadow(0 0 6px #fff29a88); }
.evo-row .evolution-preview { flex: 1; min-width: 0; }
.evo-row .evo-art { cursor: zoom-in; }
/* 拡大の窓は gallery.css の .art-view（wiki・ギャラリーと同じ部品） */
.uinfo .face[data-art] { cursor: zoom-in; }

/* 戦闘をやめる確認（標準の confirm の代わり） */
.modal .win.ask-win { width: min(88%, 340px); padding: 18px 16px 14px; text-align: center; font-size: 17px; line-height: 1.6; }
.ask-win small { display: block; margin-top: 4px; font-size: 13px; color: #c9d6ee; }
.ask-win .ubtns { display: flex; gap: 10px; margin-top: 14px; }

/* 攻略の窓: くせのある敵の一覧 */
.modal .win.stage-help-win { max-height: 82%; }
.sh-foes { margin-top: 8px; border-top: 1px solid #ffffff22; padding-top: 6px; }
.sh-cap { font-size: 12px; color: #ffe36b; margin-bottom: 4px; }
.sh-foe { display: flex; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid #ffffff12; }
.sh-foe img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.sh-foe b { display: block; font-size: 13px; }
.sh-foe span { display: block; font-size: 12px; color: #c9d6ee; line-height: 1.45; }
