/* ===== ゲームステージ ===== */
.stg{position:relative;overflow:hidden;display:flex;align-items:center;gap:10px;height:46px;padding:0 10px;border-radius:8px;border:1px solid #23252d;animation:none}
@keyframes stgIn{0%{opacity:0;transform:translateX(-14px);filter:brightness(2)}100%{opacity:1;transform:none;filter:none}}
.stg-bg{position:absolute;inset:0;z-index:0}
.stg>*:not(.stg-bg){position:relative;z-index:1}
.stg-rank{flex:none;min-width:38px;height:28px;padding:0 6px;border-radius:6px;display:grid;place-items:center;font-family:var(--en);font-weight:600;font-style:italic;font-size:15px;letter-spacing:.02em}
.stg-txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.stg-txt small{font-family:var(--en);font-size:8px;letter-spacing:.22em;color:rgba(255,255,255,.55);display:flex;gap:6px}
.stg-txt small em{font-style:normal;letter-spacing:.14em}
.stg-txt b{font-size:14px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stg-next{flex:none;display:flex;flex-direction:column;align-items:flex-end;gap:1px;padding-left:10px;border-left:1px solid rgba(255,255,255,.12);min-width:80px}
.stg-next small{font-size:8px;font-weight:700;color:rgba(255,255,255,.55);white-space:nowrap}
.stg-next b{font-family:var(--en);font-weight:600;font-size:19px;line-height:1.1;color:#fff;white-space:nowrap}
.stg-next em{font-style:normal;font-family:var(--jp);font-size:9px;font-weight:700;color:rgba(255,255,255,.6);margin-left:2px}
.stg.t-chance .stg-next b{color:#ffd23a}
.stg.t-lucky .stg-next b{background:linear-gradient(90deg,#ff4d6d,#f5ff5a,#4ab8ff,#c86bff);-webkit-background-clip:text;background-clip:text;color:transparent}
.stg-next.top b{display:inline-block;padding:0 .16em 0 .04em;margin-right:-.12em;line-height:1.15;font-style:italic;letter-spacing:.06em;background:linear-gradient(90deg,#ff4d6d,#ffb84a,#f5ff5a,#4affb4,#4ab8ff,#c86bff);background-size:200% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;animation:auroraBg 1.2s linear infinite alternate}
/* 通常 */
.stg.t-normal .stg-bg{background:linear-gradient(90deg,#15161c,#0b0b0e)}
.stg.t-normal .stg-rank{background:#2a2b30;color:#c9c9cc}
.stg.t-normal .stg-txt b{color:#d8d7d3}
/* チャンス（RUSH） */
.stg.t-chance{border-color:rgba(255,90,74,.5)}
.stg.t-chance .stg-bg{background:linear-gradient(90deg,rgba(160,20,10,.55),rgba(30,6,4,.9) 70%);animation:stgPulse 1.2s ease-in-out infinite}
@keyframes stgPulse{50%{filter:brightness(1.35)}}
.stg.t-chance .stg-rank{background:linear-gradient(180deg,#ff8a7c,#c01a0c);color:#fff}
.stg.t-chance .stg-txt b{color:#ffb3a8}
/* 幸運（黄金） */
.stg.t-lucky{border-color:rgba(255,210,60,.7);box-shadow:0 0 14px rgba(255,200,60,.3)}
.stg.t-lucky .stg-bg{background:linear-gradient(90deg,#5a3e08,#2a1c04 60%,#140e04);}
.stg.t-lucky .stg-bg::after{content:'';position:absolute;inset:0;background:linear-gradient(100deg,transparent 30%,rgba(255,240,180,.35) 50%,transparent 70%);background-size:250% 100%;animation:ftShine 2.2s linear infinite}
.stg.t-lucky .stg-rank{background:linear-gradient(180deg,#fff3c4,#e3b53a 55%,#a8700a);color:#3a2400;box-shadow:0 0 10px rgba(255,210,60,.6)}
.stg.t-lucky .stg-txt b{background:linear-gradient(180deg,#fff6c2,#ffd23a);-webkit-background-clip:text;background-clip:text;color:transparent}

/* 最上級：共有デザインのレインボー枠・光粒 */
@property --stage-angle{syntax:'<angle>';initial-value:0deg;inherits:false}
@keyframes stageBorder{to{--stage-angle:360deg}}
@keyframes stageAurora{to{background-position:100% 50%}}
.stg.t-premium{border:1.5px solid transparent;background:linear-gradient(#000,#000) padding-box,conic-gradient(from var(--stage-angle),#ff4d6d,#ffb84a,#f5ff5a,#4affb4,#4ab8ff,#c86bff,#ff4d6d) border-box;animation:stageBorder 3s linear infinite;box-shadow:0 0 18px rgba(200,160,255,.4)}
.stg.t-premium .stg-bg{background:radial-gradient(120% 140% at 0% 50%,rgba(255,255,255,.22),transparent 55%),linear-gradient(90deg,#2a1a4a,#3a2a10 50%,#0e2a3a)}
.stg.t-premium .stg-rank{background:linear-gradient(90deg,#ff4d6d,#ffb84a,#f5ff5a,#4affb4,#4ab8ff,#c86bff);background-size:200% 100%;color:#fff;-webkit-text-stroke:.5px rgba(0,0,0,.35);text-shadow:0 1px 0 rgba(0,0,0,.4);animation:stageAurora 1.2s linear infinite alternate;box-shadow:0 0 12px rgba(255,255,255,.5)}
.stg.t-premium .stg-txt b{background:linear-gradient(90deg,#fff,#fff3c4,#cfe9ff,#fff);background-size:200% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;animation:stageAurora 2s linear infinite alternate;filter:drop-shadow(0 0 6px rgba(255,255,255,.6))}
.stg>.stg-stars{position:absolute;inset:0;z-index:0;pointer-events:none;display:none}.stg.t-premium>.stg-stars{display:block}
.stg-stars i{position:absolute;top:50%;width:3px;height:3px;border-radius:50%;background:#fff;box-shadow:0 0 6px #fff;animation:stageStar 2.7s ease-in-out infinite}
.stg-stars i:nth-child(odd){top:22%}.stg-stars i:nth-child(3n){top:76%}
@keyframes stageStar{0%,100%{opacity:0;transform:scale(.4)}50%{opacity:1;transform:scale(1.3)}}

/* Stage names and transitions come from the saved machine configuration. */
#game-stage{margin:0 0 10px;height:auto;min-height:46px;box-sizing:border-box;padding:6px 10px;flex-shrink:0}
.stg-txt small{flex-wrap:wrap;letter-spacing:.15em;line-height:1.4}.stg-txt small em{font-family:inherit;letter-spacing:.03em;color:#d2d0ca}
.stg.t-jitan{border-color:#347893}.stg.t-jitan .stg-bg{background:linear-gradient(90deg,#10384a,#09151d)}.stg.t-jitan .stg-rank{background:#286785;color:#d5f5ff}.stg.t-jitan .stg-txt b{color:#a5e7ff}
.stg.t-lucky .stg-bg::after{animation-name:stageShine}@keyframes stageShine{to{background-position:250% 0}}
body:not([data-running="true"]) #game-stage,body:not([data-running="true"]) #game-stage *,body:not([data-running="true"]) #game-stage *::after{animation-play-state:paused}
@media(max-width:360px){#game-stage{gap:8px;padding:6px 8px}.stg-txt b{font-size:13px}.stg-rank{min-width:32px;font-size:13px}.stg-ladder i{width:18px}}
@media(prefers-reduced-motion:reduce){#game-stage,#game-stage *,#game-stage *::after{animation:none!important}}

/* Keep long machine names and the published-rate condition visible on phones. */
.stg-txt b{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.3}
.stg-next{min-width:72px;padding-left:7px}.stg-next small{font-size:8px;line-height:1.4}.stg-next b{font-size:19px}
@media(max-width:360px){#game-stage{gap:6px}.stg-rank{min-width:26px;padding:0 4px}.stg-next{min-width:64px;padding-left:6px}.stg-next small{font-size:7px}}

.stg-next .stg-approx{font-size:9px;font-style:normal;font-weight:700;margin:0 2px 0 0;color:inherit}
