/* ゲーム4「バドミントンラリー」の絵。すべて .scene-rally の下に閉じる */
.scene-rally .rally-stage { position: relative; width: 100%; height: 100%; min-height: 320px; overflow: hidden; pointer-events: none;
  background: linear-gradient(#ffe4ec 0 62%, #fff 62%); }
/* コート（床）とネット */
.scene-rally .rally-court { position: absolute; left: 0; right: 0; top: 62%; bottom: 0; background: #34d399;
  background-image: linear-gradient(90deg, transparent 49.4%, #fff 49.4% 50.6%, transparent 50.6%), linear-gradient(transparent 30%, #fff 30% 33%, transparent 33%); }
.scene-rally .rally-net { position: absolute; left: 50%; top: 44%; width: 8px; height: 22%; margin-left: -4px; background: #1e293b; border-radius: 4px; }
.scene-rally .rally-net::before { content: ''; position: absolute; left: -26px; right: -26px; top: 0; height: 46%;
  background: repeating-linear-gradient(90deg, rgba(30,41,59,.55) 0 2px, transparent 2px 8px), repeating-linear-gradient(rgba(30,41,59,.55) 0 2px, transparent 2px 8px);
  border-top: 5px solid #fff; }
/* 2人（足元はコートの線） */
.scene-rally .rally-player { position: absolute; bottom: 30%; width: 36%; max-width: 210px; transform-origin: 50% 100%; }
.scene-rally .rally-player img { display: block; width: 100%; }
.scene-rally .rally-opp { left: 2%; width: 30%; max-width: 170px; }
.scene-rally .rally-me { right: -2%; bottom: 22%; }
/* ラケット：大きさ・位置・角度はすべて JS（打点＝面の中心から作る）。下はしの中央＝手が回転の中心。
   --d = 面の幅。面は上はしに縦 1.15×--d の楕円、残りが柄（下 30% がグリップ） */
.scene-rally .rally-racket { --d: 44px; position: absolute; z-index: 1; transform-origin: 50% 100%;
  background: linear-gradient(#1e293b, #1e293b) 50% 100% / max(4px, calc(var(--d) * .1)) calc(100% - var(--d)) no-repeat; }
.scene-rally .rally-racket::before { content: ''; position: absolute; left: 0; top: 0; width: 100%; height: calc(var(--d) * 1.15); border-radius: 50%;
  border: max(4px, calc(var(--d) * .11)) solid #ef476f; box-sizing: border-box;
  background: repeating-linear-gradient(90deg, rgba(30,41,59,.45) 0 1.5px, transparent 1.5px 6px), repeating-linear-gradient(rgba(30,41,59,.45) 0 1.5px, transparent 1.5px 6px), rgba(255,255,255,.75); }
.scene-rally .rally-racket::after { content: ''; position: absolute; left: 50%; bottom: 0; width: max(7px, calc(var(--d) * .18)); height: 30%;
  transform: translateX(-50%); border-radius: 4px; background: #ef476f; border: 2px solid #1e293b; box-sizing: border-box; }
/* 振ったとき：体ごと小さくはねる（打った瞬間 0% は動かないので、面は打点のまま） */
.scene-rally .rally-player.rally-swing { animation: rally-hop .25s ease-out; }
@keyframes rally-hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-8px); } }
.scene-rally .rally-me.rally-oops { animation: rally-oops .5s ease-out; }
@keyframes rally-oops { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(10px) rotate(5deg); } 50% { transform: translateX(-6px); } }
/* 吹き出し「ピッ」 */
.scene-rally .rally-bubble { position: absolute; left: 40%; top: -26%; padding: 6px 14px; border: 4px solid #1e293b; border-radius: 18px;
  background: #fff; font-weight: 900; font-size: 22px; color: #ef476f; white-space: nowrap; opacity: 0; transform: scale(.4); }
.scene-rally .rally-bubble::after { content: ''; position: absolute; left: 14px; bottom: -14px; border: 8px solid transparent; border-top: 10px solid #1e293b; border-bottom: 0; }
.scene-rally .rally-bubble.rally-pop { animation: rally-pop .45s ease-out; }
@keyframes rally-pop { 0% { opacity: 1; transform: scale(.4); } 25% { opacity: 1; transform: scale(1.15); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1); } }
/* シャトル：上がコルク、下が白い円錐。left/top/transform は JS */
.scene-rally .rally-shuttle { position: absolute; width: 34px; height: 44px; display: none; z-index: 2; }
.scene-rally .rally-shuttle.rally-on { display: block; }
.scene-rally .rally-cork { position: absolute; left: 7px; top: 0; width: 20px; height: 18px; border-radius: 50% 50% 40% 40%; background: #ef476f; border: 3px solid #1e293b; box-sizing: border-box; }
.scene-rally .rally-skirt { position: absolute; left: 0; top: 12px; width: 34px; height: 32px; background: #1e293b;
  clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%); }
.scene-rally .rally-skirt::after { content: ''; position: absolute; inset: 3px 3px 0; background: repeating-linear-gradient(90deg, #fff 0 5px, #e2e8f0 5px 7px);
  clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%); }
/* 打った瞬間のはじけ */
.scene-rally .rally-spark { position: absolute; width: 70px; height: 70px; margin: -35px 0 0 -35px; border-radius: 50%; z-index: 1;
  border: 6px solid #fde047; animation: rally-spark .4s ease-out forwards; }
.scene-rally .rally-spark.rally-perfect { border-color: #ef476f; background: radial-gradient(circle, #fff59d 0 30%, transparent 32%); }
@keyframes rally-spark { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
@media (max-width: 400px) { .scene-rally .rally-bubble { font-size: 18px; } }
@media (prefers-reduced-motion: reduce) { .scene-rally .rally-player.rally-swing, .scene-rally .rally-me.rally-oops { animation: none !important; } }
