/* サッカー人生スロット — 夜のスタジアム */
:root {
  --bg: #07140d;
  --bg2: #0c2016;
  --pitch: #1f7a3f;
  --pitch2: #165c2f;
  --line: #e8f3ea;
  --ink: #f2f7f2;
  --dim: #9fb4a6;
  --gold: #e0b400;
  --gold2: #ffd84a;
  --t0: #5f6e65;
  --t1: #e9efe9;
  --t2: #42a8e8;
  --t3: #3fae4a;
  --t4: #e8402e;
  --t5: #e0b400;
  --rainbow: linear-gradient(90deg, #ff5a5a, #ffb02e, #ffe94a, #46d06a, #42a8e8, #b26bff);
  --f-jp: 'Noto Sans JP', system-ui, -apple-system, 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
  --f-num: 'Rajdhani', 'Noto Sans JP', system-ui, sans-serif;
  --f-min: 'Shippori Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #030a06; color: var(--ink); font-family: var(--f-jp); -webkit-tap-highlight-color: transparent; }
body { overflow: hidden; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .45; }
[hidden] { display: none !important; }

/* スマホ枠(PC では中央 430px) */
.phone { position: relative; margin: 0 auto; width: 100%; max-width: 430px; height: 100vh; height: 100dvh; overflow: hidden;
  background: radial-gradient(120% 60% at 50% -10%, #1d3b28 0%, var(--bg) 55%) , var(--bg); user-select: none; -webkit-user-select: none; }
@media (min-width: 560px) {
  body { display: flex; align-items: center; justify-content: center; background: radial-gradient(80% 80% at 50% 30%, #0d2617, #020604); }
  .phone { height: min(100dvh, 932px); border-radius: 28px; box-shadow: 0 0 0 10px #0b1a11, 0 0 0 11px #24412f, 0 30px 80px #000c; }
}

.scr { position: absolute; inset: 0; display: none; flex-direction: column; padding: calc(10px + var(--safe-t)) 14px calc(12px + var(--safe-b)); }
.scr.active { display: flex; animation: scrIn .28s ease-out; }
@keyframes scrIn { from { opacity: 0; transform: translateY(8px); } }

.btn-main { display: block; width: 100%; border: 0; border-radius: 14px; padding: 15px 10px; font-size: 18px; font-weight: 900; letter-spacing: .08em;
  background: linear-gradient(180deg, #ffe27a, var(--gold) 55%, #b88f00); color: #1b1400; box-shadow: 0 4px 0 #6d5500, 0 8px 24px #e0b40033; }
.btn-main:active { transform: translateY(3px); box-shadow: 0 1px 0 #6d5500; }
.btn-sub { display: block; width: 100%; border: 1px solid #3b5c47; border-radius: 14px; padding: 13px 10px; font-size: 16px; font-weight: 700; background: #0f281a; }
.link { background: none; border: 0; color: var(--dim); text-decoration: underline; font-size: 13px; padding: 6px; }

/* ---------- タイトル ---------- */
#scrTitle { justify-content: space-between; }
.title-sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.light { position: absolute; top: -40px; width: 220px; height: 520px; background: linear-gradient(180deg, #fffbe8cc, #fffbe800 80%); filter: blur(18px); opacity: .32; }
.light.l1 { left: -70px; transform: rotate(-24deg); }
.light.l2 { right: -70px; transform: rotate(24deg); }
.pitch-lines { position: absolute; left: -10%; right: -10%; bottom: -8%; height: 46%; background:
  repeating-linear-gradient(90deg, var(--pitch) 0 46px, var(--pitch2) 46px 92px); transform: perspective(500px) rotateX(58deg); transform-origin: bottom; opacity: .55;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 40%); mask-image: linear-gradient(180deg, transparent, #000 40%); }
.title-body { position: relative; margin-top: 6vh; text-align: center; }
.cohort { display: inline-block; margin: 0 0 10px; padding: 4px 12px; border: 1px solid #ffffff33; border-radius: 99px; font-size: 13px; color: var(--dim); background: #0008; }
.logo { margin: 0; line-height: 1; font-family: var(--f-min); font-weight: 800; }
.logo-a { display: block; font-size: 40px; color: #fff; letter-spacing: .04em; text-shadow: 0 2px 0 #0007, 0 0 24px #ffffff55; }
.logo-b { display: block; margin-top: 6px; font-size: 56px; letter-spacing: .12em; background: linear-gradient(180deg, #fff6c8, var(--gold2) 40%, var(--gold) 70%, #a07a00);
  -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 #0009) drop-shadow(0 0 18px #e0b40066); }
.title-sub { margin: 14px 0 22px; font-size: 14px; font-weight: 700; color: #dfeadf; }
.setup { margin: 0 auto; max-width: 340px; text-align: left; background: #04100acc; border: 1px solid #ffffff1a; border-radius: 18px; padding: 14px; backdrop-filter: blur(4px); }
.fld { display: block; margin-bottom: 12px; }
.fld > span { display: block; font-size: 12px; color: var(--dim); margin-bottom: 5px; font-weight: 700; }
.fld input { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid #2c4a37; background: #0a1d12; color: var(--ink); font: 700 16px var(--f-jp); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg6 { grid-template-columns: repeat(3, 1fr); }
.seg button { padding: 9px 4px; border-radius: 10px; border: 1px solid #2c4a37; background: #0a1d12; font-size: 14px; font-weight: 700; }
.seg button[aria-checked="true"] { background: var(--pitch); border-color: #6fd18f; box-shadow: inset 0 0 0 1px #6fd18f; }
.nth { margin: 8px 0 0; text-align: center; font-size: 12px; color: var(--dim); }
.title-foot { position: relative; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--dim); }

/* ---------- スロット ---------- */
#scrSlot { gap: 8px; padding-top: calc(8px + var(--safe-t)); }
.hud { display: flex; align-items: center; gap: 8px; }
.hud-l { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.hud-l b { font-size: 20px; font-weight: 900; letter-spacing: .02em; }
.hud-l span { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { padding: 5px 12px; border-radius: 99px; font-size: 13px; font-weight: 900; background: #23352a; border: 1px solid #3a5545; white-space: nowrap; }
.chip.k-out { background: #2a2a2a; color: #bbb; }
.chip.k-bench { background: #173a52; border-color: #42a8e8; }
.chip.k-reg { background: #1d5a31; border-color: #6fd18f; }
.chip.k-star { background: linear-gradient(180deg, #ffe27a, var(--gold)); color: #241a00; border-color: #fff2b0; }
.chip.pop { animation: pop .5s; }
@keyframes pop { 40% { transform: scale(1.25); } }
.snd { width: 38px; height: 38px; border-radius: 50%; border: 1px solid #2e4a39; background: #0c2016 center/22px no-repeat; }
.snd::before { content: '♪'; font-size: 18px; }
.snd.off::before { content: '×'; color: #889; }

.rail { display: flex; gap: 3px; align-items: flex-end; padding: 0 2px; }
.rail .yr { flex: 1; min-width: 0; text-align: center; font: 700 10px var(--f-jp); color: #6f8577; }
.rail .yr i { display: block; height: 9px; margin-bottom: 3px; border-radius: 3px; background: #1a2b21; border: 1px solid #263b2e; }
.rail .yr.g-es i { border-radius: 5px; }
.rail .yr.now { color: #fff; }
.rail .yr.now i { border-color: #fff; box-shadow: 0 0 6px #fff8; }
.rail .yr.t0 i { background: var(--t0); } .rail .yr.t1 i { background: var(--t1); } .rail .yr.t2 i { background: var(--t2); }
.rail .yr.t3 i { background: var(--t3); } .rail .yr.t4 i { background: var(--t4); } .rail .yr.t5 i { background: var(--t5); }
.rail .yr.t6 i { background: var(--rainbow); }
.rail .yr.rush i { outline: 2px solid #ff7a2e; outline-offset: 1px; box-shadow: 0 0 8px #ff5a00; }
.rail .sep { width: 4px; }

.cab { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; border-radius: 18px; padding: 8px; gap: 8px;
  background: linear-gradient(180deg, #13301f, #0a1a10); border: 2px solid #2c4a37; box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #000, 0 10px 30px #0008; transition: box-shadow .2s, border-color .2s; }
.marquee { position: relative; overflow: hidden; height: 38px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #0a140e, #000); border: 1px solid #36513f; font-weight: 900; font-size: 16px; letter-spacing: .06em; color: #fff; text-shadow: 0 0 8px #ffffff66; }
.marquee::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, #ffffff22 1px, transparent 1.5px) 0 0/6px 6px; pointer-events: none; }
.marquee.rush { background: linear-gradient(180deg, #5a0d00, #2a0500); border-color: #ff5a2e; color: #ffd0b0; animation: blinkRush .5s steps(2) infinite; }
@keyframes blinkRush { 50% { color: #fff; text-shadow: 0 0 12px #ff3a00; } }
.marquee.freeze { background: #000; color: #9be7ff; border-color: #9be7ff; }
.marquee.go { color: var(--gold2); }

.reels { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, minmax(0, 178px)); align-content: center; gap: 10px 7px; }
.reels.gk { grid-template-columns: repeat(6, 1fr); }
.reels.gk .reel { grid-column: span 2; }
.reels.gk .reel:nth-child(4) { grid-column: 2 / span 2; }
.reel { position: relative; min-height: 0; display: flex; flex-direction: column; border-radius: 12px; background: #050d08; border: 1px solid #2a4434; padding: 5px 5px 6px; transition: box-shadow .25s, border-color .25s; }
.rl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 2px; line-height: 1.1; }
.rl-name { font-size: 11px; font-weight: 700; color: #cfe0d4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl-rank { font: 700 17px var(--f-num); }
.rl-rank small { font-size: 12px; color: var(--dim); margin-left: 2px; }
.rl-mark { position: absolute; top: -6px; left: 6px; font-size: 9px; font-weight: 900; padding: 1px 5px; border-radius: 4px; }
.rl-mark.good { background: var(--gold); color: #221900; }
.rl-mark.bad { background: #4b5560; color: #dde; }
.rl-win { position: relative; flex: 1; min-height: 40px; margin: 4px 0; overflow: hidden; border-radius: 8px; background: linear-gradient(180deg, #020604, #0d1f14 50%, #020604);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent); mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent); }
.strip { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.cell { display: flex; align-items: center; justify-content: center; font: 700 38px/1 var(--f-num); letter-spacing: .01em; }
.cell.t0 { color: var(--t0); } .cell.t1 { color: var(--t1); } .cell.t2 { color: var(--t2); } .cell.t3 { color: var(--t3); }
.cell.t4 { color: var(--t4); text-shadow: 0 0 10px #e8402e88; } .cell.t5 { color: var(--gold2); text-shadow: 0 0 12px #e0b400aa; }
.cell.t6 { background: var(--rainbow); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 6px #fff8); }
.cell.revive { animation: revive .7s ease-out; }
@keyframes revive { 0% { transform: scale(.4) rotate(-12deg); filter: brightness(4); } 60% { transform: scale(1.3); } }
.rl-gauge { height: 6px; border-radius: 3px; background: #18281e; overflow: hidden; }
.rl-gauge i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, #2c8a4b, #8fe0a6); transition: width .6s ease-out; }
.reel.hit2 { border-color: var(--t2); box-shadow: 0 0 14px #42a8e899; }
.reel.hit3 { border-color: var(--t3); box-shadow: 0 0 16px #3fae4aaa; }
.reel.hit4 { border-color: var(--t4); box-shadow: 0 0 20px #e8402ecc; }
.reel.hit5 { border-color: var(--gold2); box-shadow: 0 0 24px #e0b400dd; }
.reel.hit6 { border-color: #fff; box-shadow: 0 0 6px #fff, 0 0 26px #b26bff, 0 0 40px #42a8e8; }

/* 予告 */
.cab.nt-blue { border-color: var(--t2); box-shadow: 0 0 22px #42a8e8aa, inset 0 0 30px #42a8e855; }
.cab.nt-red { border-color: var(--t4); box-shadow: 0 0 26px #e8402ecc, inset 0 0 34px #e8402e66; animation: shakeS .12s 4; }
.cab.nt-gold { border-color: var(--gold2); box-shadow: 0 0 34px #e0b400, inset 0 0 40px #e0b40077; animation: shakeS .1s 6; }
.cab.nt-rainbow { border-color: #fff; animation: rbGlow .5s linear infinite, shakeS .08s 8; }
@keyframes rbGlow { 0% { box-shadow: 0 0 30px #ff5a5a; } 25% { box-shadow: 0 0 30px #ffe94a; } 50% { box-shadow: 0 0 30px #46d06a; } 75% { box-shadow: 0 0 30px #42a8e8; } 100% { box-shadow: 0 0 30px #b26bff; } }
@keyframes shakeS { 25% { transform: translate(-2px, 1px); } 75% { transform: translate(2px, -1px); } }
.shake { animation: shakeS .08s 5; }

.slot-foot { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.total { display: flex; align-items: baseline; gap: 4px; }
.total span { font-size: 12px; color: var(--dim); font-weight: 700; }
.total b { font: 700 40px/1 var(--f-num); }
.total i { font: 700 18px var(--f-num); font-style: normal; color: var(--gold2); opacity: 0; }
.total i.show { animation: deltaIn 1.6s ease-out forwards; }
@keyframes deltaIn { 0% { opacity: 0; transform: translateY(6px); } 15%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.spin { position: relative; width: 104px; height: 104px; border-radius: 50%; border: 0; padding: 0; background: radial-gradient(circle at 50% 40%, #2e9a55, #145a2c 70%);
  box-shadow: 0 6px 0 #0a3318, 0 0 0 4px #0a1a10, 0 0 0 6px #3c6a4c, 0 10px 30px #000a; transition: transform .08s; }
.spin .ball { width: 74px; height: 74px; display: block; margin: auto; filter: drop-shadow(0 3px 2px #0008); transition: transform .3s; }
.spin:active, .spin.down { transform: translateY(5px); box-shadow: 0 1px 0 #0a3318, 0 0 0 4px #0a1a10, 0 0 0 6px #3c6a4c; }
.spin.spinning .ball { animation: ballSpin .45s linear infinite; }
@keyframes ballSpin { to { transform: rotate(360deg); } }
.spin.idle .ball { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.spin-lab { position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 900; padding: 2px 10px; border-radius: 99px; background: var(--gold); color: #221900; display: none; }
.spin.next .spin-lab { display: block; }
.rankline { text-align: right; font-size: 12px; color: var(--dim); line-height: 1.3; }
.rankline b { display: block; font: 700 24px/1 var(--f-num); color: #fff; }

/* ---------- 大会 ---------- */
#scrCup { gap: 10px; }
.cup-head { text-align: center; }
.cup-stage { margin: 4px 0 2px; color: var(--dim); font-size: 13px; font-weight: 700; }
.cup-name { margin: 0; font: 800 23px var(--f-min); letter-spacing: .04em; }
.number { text-align: center; }
.num-cap { margin: 0; font-size: 12px; color: var(--dim); letter-spacing: .2em; }
.num-shirt { position: relative; width: 124px; height: 124px; margin: 2px auto 0; }
.num-shirt svg { width: 100%; height: 100%; }
.num-shirt b { position: absolute; left: 0; right: 0; top: 40px; text-align: center; font: 700 50px/1 var(--f-num); color: #fff; text-shadow: 0 2px 0 #0008; }
.number.rolling b { animation: numRoll .1s steps(1) infinite; opacity: .7; }
.number.done .num-shirt { animation: pop .5s; }
.num-lab { margin: 2px 0 0; font-size: 16px; font-weight: 900; color: var(--gold2); min-height: 1.4em; }
.ladder { position: relative; list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.ladder li { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 10px; background: #0b1c12; border: 1px solid #1f3529; color: #6c8274; font-size: 14px; font-weight: 700; transition: all .2s; }
.ladder li .mk { width: 22px; text-align: center; font: 700 20px/1 var(--f-num); }
.ladder li.sec { background: none; border: 0; padding: 4px 4px 0; font-size: 11px; letter-spacing: .2em; color: var(--gold); }
.ladder li.win { color: #fff; background: #123a22; border-color: #3fae4a; }
.ladder li.win .mk { color: #6fd18f; }
.ladder li.lose { color: #fff; background: #3a1410; border-color: #e8402e; }
.ladder li.lose .mk { color: #ff7a66; }
.ladder li.nat.win { background: linear-gradient(90deg, #3a2d00, #123a22); border-color: var(--gold); }
.ladder li.lit { animation: pop .35s; }
.cup-res { text-align: center; min-height: 56px; opacity: 0; transition: opacity .3s; }
.cup-res.show { opacity: 1; }
.cup-res b { display: block; font-size: 22px; font-weight: 900; }
.cup-res b.champ { background: var(--rainbow); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cup-res span { font-size: 14px; color: #d6e6da; }

/* ---------- 分かれ道・進路 ---------- */
#scrFork, #scrPath { gap: 12px; }
.fork-cap { margin: 10px 0 0; text-align: center; font-size: 12px; letter-spacing: .3em; color: var(--gold); font-weight: 900; }
.fork-title { margin: 0; text-align: center; font: 800 20px/1.4 var(--f-min); word-break: keep-all; overflow-wrap: anywhere; }
.fork-cards { flex: 1; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.fcard { text-align: left; border-radius: 16px; padding: 16px; background: #0b1c12; border: 2px solid #24402f; transition: all .2s; }
.fcard h3 { margin: 0 0 8px; font-size: 20px; font-weight: 900; }
.fcard .row { display: flex; justify-content: space-between; font-size: 13px; color: var(--dim); margin-top: 4px; }
.fcard .pips i { display: inline-block; width: 12px; height: 12px; margin-left: 3px; border-radius: 3px; background: #24402f; }
.fcard .pips i.on { background: var(--t3); }
.fcard .note { margin-top: 8px; font-size: 12px; color: var(--gold2); }
.fcard.sel { border-color: var(--gold2); background: #1a2a10; box-shadow: 0 0 20px #e0b40055; transform: scale(1.02); }
.fcard.a h3::before { content: 'A '; color: var(--gold); font-family: var(--f-num); }
.fcard.b h3::before { content: 'B '; color: var(--dim); font-family: var(--f-num); }
.path-lines { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.path-lines li { text-align: center; padding: 14px 10px; border-radius: 14px; background: #0b1c12; border: 1px solid #24402f; animation: lineIn .45s ease-out both; }
.path-lines li b { display: block; font-size: 20px; font-weight: 900; }
.path-lines li span { display: block; margin-top: 4px; font-size: 14px; color: #cfe0d4; }
.path-lines li.pro { background: linear-gradient(180deg, #3a2d00, #13240f); border-color: var(--gold2); }
.path-lines li.pro b { color: var(--gold2); font-size: 22px; }
.path-lines li.college, .path-lines li.jfl { border-color: #42a8e8; }
.path-lines li.retire b { font-family: var(--f-min); }
.path-lines li.cand { border-color: #b26bff; }
.path-lines li.grade-S b, .path-lines li.grade-A b { color: var(--gold2); }
@keyframes lineIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ---------- プロ編 ---------- */
#scrPro { gap: 8px; }
.pro-head { display: flex; justify-content: space-between; align-items: flex-end; padding: 6px 2px; border-bottom: 1px solid #24402f; }
.pro-head b { display: block; font-size: 19px; font-weight: 900; }
.pro-head span { font-size: 12px; color: var(--dim); }
.pro-age { text-align: right; }
.pro-age b { font: 700 30px/1 var(--f-num); }
.pro-rows { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 5px; scroll-behavior: smooth; }
.pro-rows li { display: grid; grid-template-columns: 38px 34px 1fr; gap: 6px; align-items: center; padding: 7px 9px; border-radius: 10px; background: #0b1c12; border: 1px solid #1f3529; font-size: 13px; animation: lineIn .3s ease-out both; }
.pro-rows .age { font: 700 18px var(--f-num); color: var(--dim); }
.pro-rows .cat { font: 700 13px var(--f-num); text-align: center; border-radius: 6px; padding: 2px 0; background: #24402f; }
.pro-rows .cat.J1 { background: #b88f00; color: #1b1400; } .pro-rows .cat.J2 { background: #2a6db0; } .pro-rows .cat.J3 { background: #2f7a45; } .pro-rows .cat.EU { background: #6b3fb5; }
.pro-rows .ln { min-width: 0; }
.pro-rows .ln small { display: block; color: var(--dim); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pro-rows .flags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.pro-rows .flags em { font-style: normal; font-size: 11px; font-weight: 900; padding: 1px 6px; border-radius: 5px; background: #2b3f33; }
.pro-rows li.h1 { opacity: .75; } .pro-rows li.h1 .flags em { background: #4a2020; }
.pro-rows li.h3 { border-color: #3fae4a; }
.pro-rows li.h4 { border-color: #42a8e8; background: #0d2130; }
.pro-rows li.h5 { border-color: var(--gold); background: #2a2208; } .pro-rows li.h5 .flags em { background: var(--gold); color: #1b1400; }
.pro-rows li.h6 { border-color: #fff; background: linear-gradient(90deg, #3a1b52, #10304a, #3a2d00); box-shadow: 0 0 14px #b26bff88; }
.pro-rows li.h6 .flags em { background: #fff; color: #200a33; }
.pro-sum { font-size: 13px; color: #d6e6da; text-align: center; min-height: 1.4em; }

/* ---------- 結果カード ---------- */
#scrResult { padding: 0; }
.res-scroll { flex: 1; overflow: auto; padding: calc(12px + var(--safe-t)) 14px calc(16px + var(--safe-b)); }
.card { position: relative; border-radius: 20px; padding: 3px; background: #6b756f; }
.card.r-r { background: linear-gradient(135deg, #1f5f96, #6ec3ff, #1f5f96); }
.card.r-sr { background: linear-gradient(135deg, #8a6a00, #ffe27a, #b88f00, #fff3c0, #8a6a00); }
.card.r-ssr { background: linear-gradient(135deg, #ff5a5a, #ffb02e, #ffe94a, #46d06a, #42a8e8, #b26bff); background-size: 200% 200%; animation: rbMove 4s linear infinite; }
.card.r-ur { background: linear-gradient(135deg, #000, #ff5a5a, #000 30%, #ffe94a, #000 55%, #42a8e8, #000 80%, #b26bff); background-size: 300% 300%; animation: rbMove 5s linear infinite; box-shadow: 0 0 30px #b26bff66; }
@keyframes rbMove { to { background-position: 200% 200%; } }
.card-in { border-radius: 17px; padding: 14px; background: radial-gradient(120% 70% at 50% 0%, #1b3a27, #08150d 70%); }
.card.r-ur .card-in { background: radial-gradient(120% 70% at 50% 0%, #2a1638, #050308 70%); }
.cd-top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--dim); }
.cd-logo { font: 800 14px var(--f-min); color: #fff; } .cd-logo em { font-style: normal; color: var(--gold2); }
.cd-rar { font: 700 14px var(--f-num); padding: 1px 8px; border-radius: 6px; background: #0007; border: 1px solid #fff4; }
.cd-title { margin: 10px 0 2px; text-align: center; font: 800 32px/1.2 var(--f-min); letter-spacing: .04em; }
.card.r-sr .cd-title, .card.r-ssr .cd-title { color: var(--gold2); }
.card.r-ur .cd-title { background: var(--rainbow); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cd-name { text-align: center; font-size: 15px; font-weight: 700; color: #dfeadf; }
.cd-main { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-items: center; margin: 10px 0 6px; }
.cd-score { text-align: center; }
.cd-score .ov { font: 700 64px/1 var(--f-num); }
.cd-score .ovl { font-size: 11px; color: var(--dim); }
.cd-score .rk { margin-top: 6px; font-size: 12px; color: #cfe0d4; }
.cd-score .rk b { font: 700 26px var(--f-num); color: #fff; }
.radar { width: 100%; max-width: 170px; margin: auto; display: block; }
.cd-abs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 6px 0 10px; }
.cd-abs div { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 7px; border-radius: 7px; background: #0006; font-size: 11px; color: #cfe0d4; }
.cd-abs b { font: 700 16px var(--f-num); }
.cd-hist { list-style: none; margin: 0 0 8px; padding: 0; font-size: 12.5px; }
.cd-hist li { padding: 5px 2px; border-top: 1px solid #ffffff14; color: #e4efe6; }
.cd-stats { display: grid; gap: 3px; font-size: 12px; color: #cfe0d4; margin-bottom: 8px; }
.cd-stats div { display: flex; justify-content: space-between; padding: 3px 6px; background: #0005; border-radius: 6px; }
.cd-foot { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--dim); border-top: 1px solid #ffffff1a; padding-top: 8px; }
.cd-foot .pips i { display: inline-block; width: 8px; height: 8px; margin-left: 2px; border-radius: 2px; background: #2b3f33; }
.cd-foot .pips i.on { background: var(--gold2); }
.rk-S { color: var(--gold2); } .rk-A { color: #ff7a5c; } .rk-B { color: #ffb02e; } .rk-C { color: #6fd18f; } .rk-D { color: #6ec3ff; } .rk-E { color: #a9c3d3; } .rk-F { color: #8a978e; } .rk-G { color: #66756b; }
.after { margin: 12px 4px; text-align: center; font: 700 15px/1.6 var(--f-min); color: #e4efe6; }
.after::before { content: 'その後 — '; color: var(--dim); font-family: var(--f-jp); font-size: 12px; }
.res-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.res-btns .again { grid-column: 1 / -1; }
.res-btns .link { grid-column: 1 / -1; }
.res-btns #btnShare { font-size: 16px; }

/* ---------- シート ---------- */
.sheet-bg { position: absolute; inset: 0; background: #000a; z-index: 40; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88%; z-index: 41; display: flex; flex-direction: column; border-radius: 18px 18px 0 0; background: #0b1c12; border-top: 1px solid #3a5545; animation: sheetUp .3s ease-out; }
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #24402f; }
.sheet-bar .x { background: none; border: 0; font-size: 26px; line-height: 1; padding: 0 4px; }
.sheet-body { overflow: auto; padding: 4px 16px calc(20px + var(--safe-b)); font-size: 13px; line-height: 1.6; -webkit-user-select: text; user-select: text; }
.sheet-body h3 { margin: 16px 0 6px; font-size: 14px; color: var(--gold2); }
.sheet-body table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sheet-body td, .sheet-body th { padding: 5px 4px; border-bottom: 1px solid #1f3529; vertical-align: top; text-align: left; }
.sheet-body th { color: var(--dim); font-weight: 700; }
.sheet-body td.n { text-align: right; white-space: nowrap; font-family: var(--f-num); font-size: 14px; }
.sheet-body a { color: #8fd0ff; word-break: break-all; }
.sheet-body .note { color: var(--dim); font-size: 12px; }

/* ---------- 演出 ---------- */
#fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }
.flash { position: absolute; inset: 0; pointer-events: none; z-index: 31; opacity: 0; }
.flash.go { animation: flashGo .45s ease-out; }
.flash.rb { background: var(--rainbow); }
@keyframes flashGo { 0% { opacity: .85; } 100% { opacity: 0; } }
.blackout { position: absolute; inset: 0; background: #000; pointer-events: none; z-index: 32; opacity: 0; transition: opacity .35s; }
.blackout.on { opacity: 1; }
.awaken { position: absolute; inset: 0; z-index: 35; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px;
  background: radial-gradient(circle at 50% 42%, #2b2300, #000 70%); animation: awIn .6s ease-out; }
@keyframes awIn { from { opacity: 0; transform: scale(1.08); } }
.aw-art { width: min(80vw, 300px); aspect-ratio: 1; animation: awArt 3s ease-in-out infinite; }
.aw-art svg { width: 100%; height: 100%; }
@keyframes awArt { 50% { transform: scale(1.04); } }
.aw-title { margin: 6px 0; font: 800 64px/1 var(--f-min); letter-spacing: .2em; background: var(--rainbow); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 12px #fff6); }
.aw-line { margin: 8px 0 0; font: 700 20px var(--f-min); color: #fff; }
.aw-line small { display: block; font: 700 11px var(--f-jp); color: var(--dim); letter-spacing: .2em; margin-bottom: 4px; }
.aw-tap { position: absolute; bottom: calc(24px + var(--safe-b)); font-size: 12px; color: var(--dim); }
.toast { position: absolute; left: 50%; top: 22%; z-index: 33; transform: translate(-50%, -10px); padding: 10px 18px; border-radius: 99px; background: #000d; border: 1px solid var(--gold); color: var(--gold2); font-weight: 900; font-size: 16px; opacity: 0; pointer-events: none; white-space: nowrap; transition: all .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.rush { border-color: #ff5a2e; color: #ffd0b0; background: #3a0800ee; }

/* ---------- 見本メニュー(?demo, localhost のみ) ---------- */
#demo { position: fixed; right: 8px; top: 8px; z-index: 100; width: 190px; max-height: calc(100dvh - 16px); overflow: auto; padding: 8px; border-radius: 12px; background: #000e; border: 1px solid #ffffff33; font-size: 12px; }
#demo.fold { width: auto; top: 46%; right: 2px; padding: 4px; opacity: .8; }
#demo.fold .dm-body { display: none; }
#demo h4 { margin: 8px 0 4px; font-size: 11px; color: var(--gold2); }
#demo button { margin: 2px; padding: 4px 7px; border-radius: 6px; border: 1px solid #ffffff33; background: #1a2b21; font-size: 12px; }
#demo button.on { background: var(--gold); color: #1b1400; }
#demo .dm-msg { margin-top: 6px; color: #9fb4a6; min-height: 1.4em; }

@media (max-height: 700px) {
  .cell { font-size: 24px; }
  .spin { width: 88px; height: 88px; } .spin .ball { width: 62px; height: 62px; }
  .total b { font-size: 32px; }
  .logo-a { font-size: 32px; } .logo-b { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.sheet-body .src-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.sheet-body .src-h b { text-align: right; color: #fff; }
.sheet-body .src-h span { flex: none; max-width: 52%; }
