/* ロックステップの絵（#scene.scene-step の中だけ）。上 140px にはヒントがあるので何も置かない */
.scene-step{background:#bfe9e2}
.scene-step .step-stage{position:absolute;inset:0;overflow:hidden;background:linear-gradient(#bfe9e2 0,#8fd8cc 58%,#2a9d8f 58%,#21867a 100%)}
/* うらの背景は上にかさねて opacity で切りかえ（グラデーションは直接フェードできないため） */
.scene-step .step-stage::before{content:'';position:absolute;inset:0;background:linear-gradient(#ffe0b8 0,#ffc285 58%,#e76f51 58%,#c9563c 100%);opacity:0;transition:opacity .5s ease}
.scene-step .step-stage[data-bg="off"]::before{opacity:1}
/* 床のしま模様が流れて行進している感じ */
.scene-step .step-floor{position:absolute;left:0;right:0;top:58%;bottom:0;opacity:.18;background:repeating-linear-gradient(90deg,#fff 0 22px,transparent 22px 64px);animation:step-march 1s linear infinite}
@keyframes step-march{to{background-position:-64px 0}}
.scene-step .step-stage.pulse .step-floor{animation:step-march 1s linear infinite,step-flr .25s ease-out}
@keyframes step-flr{0%{opacity:.34}100%{opacity:.18}}

/* 上の段：「ここでたたく」の小節と、セクションの看板 */
.scene-step .step-top{position:absolute;top:146px;left:16px;right:16px;z-index:3;display:flex;flex-direction:column;align-items:center;gap:8px;max-width:460px;margin:0 auto}
.scene-step .step-grid{width:100%;--c:#2a9d8f}
.scene-step .step-grid[data-kind="off"]{--c:#e76f51}
.scene-step .step-glabel{font-weight:900;font-size:13px;line-height:1;margin:0 0 3px 2px;color:var(--ink)}
.scene-step .step-glabel::before{content:'▼ '}
.scene-step .step-cells{position:relative;display:grid;grid-template-columns:repeat(8,1fr);gap:3px;padding:3px;background:#fff;border:3px solid var(--ink);border-radius:12px;box-shadow:0 3px 0 var(--ink)}
.scene-step .step-cell{display:flex;align-items:center;justify-content:center;height:34px;border-radius:7px;font-weight:900;font-size:15px;color:#b9c4c6;background:#eef2f2;transition:background .2s,color .2s}
.scene-step .step-cell.and{font-size:12px}
/* 今のセクションの「たたくマス」：おもて＝1,3,5,7 マス目／うら＝2,4,6,8 マス目 */
.scene-step .step-grid[data-kind="on"] .step-cell:not(.and),
.scene-step .step-grid[data-kind="off"] .step-cell.and{background:var(--c);color:#fff;box-shadow:inset 0 -3px 0 rgba(0,0,0,.2)}
.scene-step .step-cell.flash{animation:step-cell .28s ease-out}
@keyframes step-cell{0%{background:#fff36b;color:var(--ink);transform:scale(1.18);box-shadow:0 0 0 3px #fff36b,0 0 14px 4px #ffe600}100%{transform:none}}
.scene-step .step-cursor{position:absolute;top:-5px;bottom:-5px;left:0;width:4px;margin-left:-2px;background:var(--ink);border-radius:2px;pointer-events:none}
.scene-step .step-cursor::before{content:'';position:absolute;top:-4px;left:50%;margin-left:-6px;border:6px solid transparent;border-top-color:var(--ink)}
/* 看板「おもて：ズンに合わせて」「うら：チャッに合わせて」 */
.scene-step .step-sign{text-align:center;max-width:100%}
.scene-step .step-sign span{display:inline-block;font-weight:900;font-size:clamp(19px,5.6vw,28px);line-height:1.2;padding:6px 16px;color:#fff;background:#2a9d8f;border:4px solid var(--ink);border-radius:16px;box-shadow:0 4px 0 var(--ink);white-space:nowrap}
.scene-step .step-sign[data-kind="off"] span{background:#e76f51}
.scene-step .step-sign.beat span{animation:step-beat .2s ease-out}
@keyframes step-beat{0%{scale:1.06}100%{scale:1}}
.scene-step .step-sign.swap{animation:step-swap .45s cubic-bezier(.2,.9,.3,1.3)}
@keyframes step-swap{0%{transform:scale(.4) rotate(-10deg)}60%{transform:scale(1.12)}100%{transform:none}}

/* 行進するマスコットの列（看板のすぐ下） */
.scene-step .step-row{position:absolute;left:4%;right:4%;top:max(30%,286px);bottom:42%;display:flex;justify-content:space-between;align-items:flex-end;z-index:1}
.scene-step .step-m{position:relative;width:21%;max-width:110px;transform-origin:50% 100%}
.scene-step .step-m img{width:100%;aspect-ratio:1;object-fit:contain;display:block;filter:drop-shadow(0 4px 0 rgba(0,0,0,.25))}
.scene-step .step-m.m1 img{filter:hue-rotate(110deg) saturate(1.3) drop-shadow(0 4px 0 rgba(0,0,0,.25))}
.scene-step .step-m.m2 img{filter:hue-rotate(220deg) saturate(1.3) drop-shadow(0 4px 0 rgba(0,0,0,.25))}
.scene-step .step-m.m3 img{filter:hue-rotate(300deg) saturate(1.3) drop-shadow(0 4px 0 rgba(0,0,0,.25))}
/* お手本：直前に足を上げて、たたく時刻にドン */
.scene-step .step-m.lift{transform:translateY(-12%) rotate(5deg);transition:transform .1s ease-out}
.scene-step .step-m.lift.l{transform:translateY(-12%) rotate(-5deg)}
.scene-step .step-m.stomp{animation:step-mr .3s ease-out}
.scene-step .step-m.stomp.l{animation-name:step-ml}
@keyframes step-mr{0%{transform:translateY(-12%) rotate(5deg)}30%{transform:translateY(3%) scale(1.14,.84)}100%{transform:none}}
@keyframes step-ml{0%{transform:translateY(-12%) rotate(-5deg)}30%{transform:translateY(3%) scale(1.14,.84)}100%{transform:none}}
/* ハイ×4 のカウントダウン吹き出し（列の上にかさねる） */
.scene-step .step-call{position:absolute;left:50%;top:0;z-index:2;transform:translateX(-50%) scale(.6);opacity:0;pointer-events:none;background:#fff;border:3px solid var(--ink);border-radius:14px;box-shadow:0 4px 0 var(--ink);padding:4px 10px;text-align:center;white-space:nowrap;transition:opacity .15s,transform .15s}
.scene-step .step-call.show{opacity:1;transform:translateX(-50%)}
.scene-step .step-hais{display:flex;gap:6px;justify-content:center}
.scene-step .step-hais b{font-weight:900;font-size:clamp(15px,4.6vw,20px);padding:0 6px;border-radius:8px;color:#c3cbcc}
.scene-step .step-hais b.on{color:#fff;background:var(--ink);animation:step-hai .25s ease-out}
@keyframes step-hai{0%{transform:scale(1.4)}100%{transform:none}}
.scene-step .step-next{font-weight:900;font-size:clamp(16px,5vw,22px);line-height:1.2;color:#2a9d8f}
.scene-step .step-call[data-next="off"] .step-next{color:#e76f51}
/* 足もとの土けむり（マスコットとしぐれちゃん） */
.scene-step .step-dust{position:absolute;left:10%;right:10%;bottom:-2%;height:16%;border-radius:50%;background:radial-gradient(ellipse,#fff 0 40%,transparent 70%);opacity:0;pointer-events:none}
.scene-step .step-m .step-dust{left:0;right:0;height:22%;bottom:-6%}
.scene-step .step-m.stomp .step-dust,.scene-step .step-you.stomp .step-dust{animation:step-dust .35s ease-out}
@keyframes step-dust{0%{opacity:.9;transform:scale(.5,.6)}100%{opacity:0;transform:scale(1.5,1)}}
/* しぐれちゃん（手前・あなた） */
.scene-step .step-you{position:absolute;left:50%;bottom:3%;width:40%;max-width:220px;margin-left:-20%;z-index:2;transform-origin:50% 100%}
@media (min-width:560px){.scene-step .step-you{margin-left:-110px}}
.scene-step .step-you img{width:100%;aspect-ratio:1;object-fit:contain;display:block;filter:drop-shadow(0 6px 0 rgba(0,0,0,.3))}
.scene-step .step-you.stomp{animation:step-yr .26s cubic-bezier(.2,.9,.3,1.2)}
.scene-step .step-you.stomp.l{animation-name:step-yl}
@keyframes step-yr{0%{transform:translateY(-14%) rotate(5deg)}50%{transform:translateY(1%) scale(1.08,.9)}100%{transform:none}}
@keyframes step-yl{0%{transform:translateY(-14%) rotate(-5deg)}50%{transform:translateY(1%) scale(1.08,.9)}100%{transform:none}}
/* ミス：つまずく */
.scene-step .step-you.trip{animation:step-trip .5s}
@keyframes step-trip{0%,100%{transform:none}20%{transform:translateX(-12%) rotate(-14deg)}45%{transform:translateX(10%) rotate(8deg)}70%{transform:translateX(-4%) rotate(-3deg)}}
.scene-step .step-you.twitch{animation:step-twitch .18s}
@keyframes step-twitch{50%{transform:translateY(-4%)}}
@media (prefers-reduced-motion:reduce){.scene-step .step-floor{animation:none}.scene-step .step-stage::before{transition-duration:.01s}}
