/* ゲーム3 まねっこピアノ（.scene-echo の中だけ） */
.scene-echo { position: relative; }
/* 上 140px はヒント・判定の表示。残りの高さの真ん中に全体を置く */
.scene-echo .echo-wrap { box-sizing: border-box; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 140px 8px 16px; user-select: none; -webkit-user-select: none; }
.scene-echo .echo-teacher, .scene-echo .echo-player { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.scene-echo .echo-mascot { width: 96px; height: 96px; object-fit: contain; }
.scene-echo .echo-sigure { width: 130px; height: 130px; object-fit: contain; transition: transform .25s ease-out; }
.scene-echo .echo-label { font-weight: 800; font-size: 18px; padding: 2px 14px; border-radius: 999px; border: 3px solid #cbd5e1; color: #94a3b8; background: #fff; transition: all .15s; }
.scene-echo .echo-label.t.on { border-color: #2563eb; color: #fff; background: #3b82f6; box-shadow: 0 0 0 4px rgba(59,130,246,.3); }
.scene-echo .echo-label.p.on { border-color: #d97706; color: #3b2a00; background: #fbbf24; box-shadow: 0 0 0 4px rgba(251,191,36,.35); transform: scale(1.12); }

/* 背の低い画面では少し詰める */
@media (max-height: 700px) {
  .scene-echo .echo-wrap { gap: 10px; }
  .scene-echo .echo-mascot { width: 80px; height: 80px; }
  .scene-echo .echo-sigure { width: 110px; height: 110px; }
  .scene-echo .echo-kb { height: 116px; }
}

/* 鍵盤（白鍵8個） */
.scene-echo .echo-kb { display: flex; gap: 3px; width: 100%; max-width: 420px; height: 130px; padding: 6px; background: #1e293b; border-radius: 10px; }
.scene-echo .echo-key { position: relative; flex: 1; background: #fff; border-radius: 0 0 8px 8px; border-bottom: 10px solid #cbd5e1;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; font-weight: 800; font-size: 14px; color: #475569;
  transition: transform .06s, border-bottom-width .06s, background .12s; }
.scene-echo .echo-key.down-t, .scene-echo .echo-key.down-p { transform: translateY(6px); border-bottom-width: 4px; }
.scene-echo .echo-key.down-t { background: #60a5fa; color: #fff; }
.scene-echo .echo-key.down-p { background: #fcd34d; color: #3b2a00; }
.scene-echo .echo-key.glow { animation: echo-glow .5s ease-out; }
.scene-echo .echo-key.miss { animation: echo-grey .6s steps(2, jump-none) 1; }
@keyframes echo-glow { 0% { box-shadow: 0 0 0 0 rgba(251,191,36,.9); } 100% { box-shadow: 0 0 22px 10px rgba(251,191,36,0); } }
@keyframes echo-grey { 0%, 40%, 80% { background: #94a3b8; color: #fff; } 20%, 60%, 100% { background: #fff; } }

/* 拍の点 */
.scene-echo .echo-beats { display: flex; gap: 14px; }
.scene-echo .echo-beats i { width: 14px; height: 14px; border-radius: 50%; background: #cbd5e1; transition: transform .08s, background .08s; }
.scene-echo .echo-beats i.on { background: #3b82f6; transform: scale(1.4); }
.scene-echo .my-turn .echo-beats i.on { background: #f59e0b; }

/* しぐれちゃん：自分の番で前に出る */
.scene-echo .echo-player.front .echo-sigure { transform: translateY(-14px) scale(1.15); }
.scene-echo .echo-sigure.hop { animation: echo-hop .25s ease-out; }
.scene-echo .echo-sigure.wobble { animation: echo-wobble .25s ease-out; }
@keyframes echo-hop { 50% { translate: 0 -16px; } }
@keyframes echo-wobble { 25% { rotate: -5deg; } 75% { rotate: 5deg; } }

/* 当たり＝縦の色フラッシュ、ミス＝横ゆれ */
.scene-echo.echo-flash::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to bottom, rgba(251,191,36,.35), rgba(251,191,36,0)); animation: echo-fade .25s ease-out forwards; }
@keyframes echo-fade { to { opacity: 0; } }
.scene-echo.echo-shake { animation: echo-shake .3s; }
@keyframes echo-shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
