@charset "utf-8";

#stage {
	position: relative;
	width: 100%;
	height: 515px;
	background: #fafdff;
	overflow: hidden;
}

.phase {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.9s ease;
	pointer-events: none;
}

.phase.active {
	opacity: 1;
}

/* ============ Phase A: 説明が浮かぶ ============ */

#phaseA {
	background: linear-gradient(180deg, #eaf7ff 0%, #ffffff 100%);
}

.setsumei-wrap {
	position: absolute;
	top: 15px;
	left: 0px;
	z-index: 10;
	width: 600px;
	pointer-events: none;
}

.setsumei {
	width: 600px;
	animation: floatUD 3.6s ease-in-out infinite;
}

.setsumei img {
	width: 100%;
	display: block;
	filter: drop-shadow(0 8px 10px rgba(0,60,110,0.12));
}

@keyframes floatUD {
	0%   { transform: translateY(0)    rotate(-1.5deg); }
	25%  { transform: translateY(-14px) rotate(1deg); }
	50%  { transform: translateY(-4px)  rotate(2deg); }
	75%  { transform: translateY(-16px) rotate(-1deg); }
	100% { transform: translateY(0)    rotate(-1.5deg); }
}

/* ============ Phase B: うさぎが跳ねてくる ============ */

#phaseB {
	background: linear-gradient(180deg, #cdeffd 0%, #e8fbee 45%, #d9f3bd 70%, #a9dd83 100%);
}

.b-path {
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 30%;
	height: 60%;
	background: linear-gradient(180deg, rgba(210,235,180,0) 0%, #c7e6a0 100%);
	clip-path: polygon(46% 0%, 54% 0%, 78% 100%, 22% 100%);
	transform: translateX(-50%);
	opacity: 0.6;
}

.b-shadow {
	position: absolute;
	left: 50%;
	bottom: 10%;
	width: 90px;
	height: 18px;
	margin-left: -45px;
	background: radial-gradient(ellipse, rgba(0,0,0,0.28) 0%, rgba(0,0,0,0) 70%);
	border-radius: 50%;
}

.b-shadow.run {
	animation: shadowGrow 8s ease-in-out 1;
}

@keyframes shadowGrow {
	0%   { transform: scale(0.15); opacity: 0.15; }
	50%  { transform: scale(1.1);  opacity: 0.55; }
	56%  { transform: scale(1.1);  opacity: 0.55; }
	100% { transform: scale(1.1);  opacity: 0.55; }
}

.bunny {
	position: absolute;
	left: 50%;
	bottom: 12%;
	width: 160px;
	height: 341px;
	margin-left: -80px;
}

.bunny.run {
	animation: approach 8s ease-in-out 1;
	animation-fill-mode: forwards;
}

@keyframes approach {
	0%    { transform: translate(0px, -300px) scale(0.16, 0.16); }
	5.04% { transform: translate(-5px, -335px) scale(0.20, 0.23); }
	10.08% { transform: translate(5px, -290px) scale(0.24, 0.20); }
	15.12% { transform: translate(-8px, -320px) scale(0.30, 0.35); }
	20.16% { transform: translate(8px, -260px) scale(0.36, 0.30); }
	25.2%  { transform: translate(-11px, -290px) scale(0.46, 0.54); }
	30.24% { transform: translate(11px, -215px) scale(0.55, 0.46); }
	35.28% { transform: translate(-13px, -245px) scale(0.68, 0.80); }
	40.32% { transform: translate(13px, -150px) scale(0.82, 0.68); }
	45.36% { transform: translate(-8px, -170px) scale(0.95, 1.10); }
	50.4%  { transform: translate(8px, -60px) scale(1.08, 0.94); }
	53.76% { transform: translate(-3px, -75px) scale(1.15, 1.24); }
	56%    { transform: translate(0px, 0px) scale(1.2, 1.2); }
	100%   { transform: translate(0px, 0px) scale(1.2, 1.2); }
}

.b-frame {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	display: block;
	filter: drop-shadow(0 6px 6px rgba(0,0,0,0.18));
	opacity: 0;
}

.b-frame.f1 {
	opacity: 1;
}

.b-frame.run.f1 {
	animation: bf1 8s linear 1;
	animation-fill-mode: forwards;
}

.b-frame.run.f2 {
	animation: bf2 8s linear 1;
	animation-fill-mode: forwards;
}

.b-frame.run.f3 {
	animation: bf3 8s linear 1;
	animation-fill-mode: forwards;
}

@keyframes bf1 {
	0% { opacity: 1; }
	59.7% { opacity: 1; }
	60% { opacity: 0; }
	63.7% { opacity: 0; }
	64% { opacity: 1; }
	85.7% { opacity: 1; }
	86% { opacity: 0; }
	89.7% { opacity: 0; }
	90% { opacity: 1; }
	100% { opacity: 1; }
}

@keyframes bf2 {
	0% { opacity: 0; }
	59.7% { opacity: 0; }
	60% { opacity: 1; }
	61.7% { opacity: 1; }
	62% { opacity: 0; }
	85.7% { opacity: 0; }
	86% { opacity: 1; }
	87.7% { opacity: 1; }
	88% { opacity: 0; }
	100% { opacity: 0; }
}

@keyframes bf3 {
	0% { opacity: 0; }
	61.7% { opacity: 0; }
	62% { opacity: 1; }
	63.7% { opacity: 1; }
	64% { opacity: 0; }
	87.7% { opacity: 0; }
	88% { opacity: 1; }
	89.7% { opacity: 1; }
	90% { opacity: 0; }
	100% { opacity: 0; }
}

/* ============ Phase C: 海になってクラゲ・金魚 ============ */

#phaseC {
	background: linear-gradient(180deg, #cdeffd 0%, #eafff0 60%, #d9f7c9 100%);
}

#phaseC.water {
	background: linear-gradient(180deg, #1a5f8f 0%, #2f8fc4 35%, #6fc2e6 70%, #b6e6f5 100%);
}

#phaseC .water-bg {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, #1a5f8f 0%, #2f8fc4 35%, #6fc2e6 70%, #b6e6f5 100%);
	transform: translateY(100%);
	transition: transform 1.4s cubic-bezier(.4,0,.2,1);
}

#phaseC.water .water-bg {
	transform: translateY(0%);
}

#phaseC.drain .water-bg {
	transform: translateY(100%);
	transition: transform 1.4s cubic-bezier(.6,0,1,.4);
}

.bubble {
	position: absolute;
	bottom: -40px;
	border-radius: 50%;
	background: rgba(255,255,255,0.35);
}

.bubble.run {
	animation: rise linear infinite;
}

@keyframes rise {
	0%   { transform: translateY(0) translateX(0); opacity:0.6; }
	100% { transform: translateY(-550px) translateX(20px); opacity:0; }
}

.kurage-wrap {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.kurage {
	position: relative;
	width: 190px;
}

.kurage.run {
	animation: sway 4.5s ease-in-out infinite;
}

@keyframes sway {
	0%   { transform: translateY(0) rotate(-4deg); }
	25%  { transform: translateY(-22px) rotate(2deg); }
	50%  { transform: translateY(-6px) rotate(5deg); }
	75%  { transform: translateY(-26px) rotate(-2deg); }
	100% { transform: translateY(0) rotate(-4deg); }
}

.kurage img {
	width:100%;
	display:block;
	filter: drop-shadow(0 10px 14px rgba(0,0,20,0.25));
}

.kingyo-path {
	position:absolute;
	top:60%;
	width:150px;
}

.kingyo-path.run {
	animation: swimAcross 9s linear infinite;
}

@keyframes swimAcross {
	0%   { left:108%; top:64%; }
	25%  { left:62%;  top:74%; }
	50%  { left:32%;  top:58%; }
	75%  { left:-8%;  top:70%; }
	100% { left:-30%; top:62%; }
}

.kingyo-wiggle {
	width:100%;
	height:100%;
	transform-origin: 80% 50%;
}

.kingyo-wiggle.run {
	animation: wiggle 0.9s ease-in-out infinite;
}

@keyframes wiggle {
	0% { transform: rotate(-3deg) skewY(2deg); }
	50% { transform: rotate(3deg) skewY(-2deg); }
	100% { transform: rotate(-3deg) skewY(2deg); }
}

.kingyo-wiggle img {
	width:100%;
	display:block;
	filter: drop-shadow(0 8px 10px rgba(0,20,40,0.25));
}

/* ============ Phase D: カエルがぴょこぴょこ ============ */

#phaseD {
	background: linear-gradient(180deg, #cdeffd 0%, #eafff0 60%, #d9f7c9 100%);
}

.d-ground {
	position:absolute;
	bottom:0;
	width:100%;
	height:14%;
	background:#8bd98b;
	border-top:4px solid #6cbf6c;
}

.d-shadow {
	position:absolute;
	bottom:12%;
	width:140px;
	height:26px;
	left:50%;
	margin-left:-70px;
	background: radial-gradient(ellipse, rgba(0,0,0,0.28) 0%, rgba(0,0,0,0) 70%);
	border-radius:50%;
}

.d-shadow.run {
	animation: dshadow 1.1s cubic-bezier(.45,0,.55,1) infinite;
}

@keyframes dshadow {
	0% { transform:scale(1); opacity:0.6; }
	35% { transform:scale(0.5); opacity:0.25; }
	50% { transform:scale(0.42); opacity:0.18; }
	65% { transform:scale(0.5); opacity:0.25; }
	100% { transform:scale(1); opacity:0.6; }
}

.d-frog {
	position:relative;
	width:150px;
	transform-origin: bottom center;
}

.d-frog-wrap {
	position:absolute;
	inset:0;
	display:flex;
	align-items:flex-end;
	justify-content:center;
}

.d-frog.run {
	animation: djump 1.1s cubic-bezier(.45,0,.55,1) infinite;
}

@keyframes djump {
	0%   { transform: translateY(0) scaleX(1) scaleY(1); }
	10%  { transform: translateY(0) scaleX(1.08) scaleY(0.9); }
	35%  { transform: translateY(-150px) scaleX(0.95) scaleY(1.08) rotate(-4deg); }
	50%  { transform: translateY(-180px) scaleX(0.95) scaleY(1.08) rotate(0deg); }
	65%  { transform: translateY(-150px) scaleX(0.95) scaleY(1.08) rotate(4deg); }
	88%  { transform: translateY(0) scaleX(1.08) scaleY(0.9); }
	100% { transform: translateY(0) scaleX(1) scaleY(1); }
}

.d-frog img {
	width:100%;
	display:block;
	filter: drop-shadow(0 6px 8px rgba(0,0,0,0.15));
}

/* ============ レスポンシブ対応 ============ */

@media screen and (max-width: 834px) {
    #stage {
        height: clamp(220px, 50vw, 380px);
    }

    .setsumei-wrap,
    .bunny,
    .b-shadow,
    .kurage,
    .kingyo-path,
    .d-frog,
    .d-shadow {
        zoom: 0.65;
    }
}

/* 700px以下 */
@media screen and (max-width: 700px) {
    .setsumei-wrap,
    .bunny,
    .b-shadow,
    .kurage,
    .kingyo-path,
    .d-frog,
    .d-shadow {
        zoom: 0.6;
    }
}

/* 600px以下 */
@media screen and (max-width: 600px) {
    .setsumei-wrap,
    .bunny,
    .b-shadow,
    .kurage,
    .kingyo-path,
    .d-frog,
    .d-shadow {
        zoom: 0.55;
    }
}

/* 480px以下 */
@media screen and (max-width: 480px) {
    .setsumei-wrap,
    .bunny,
    .b-shadow,
    .kurage,
    .kingyo-path,
    .d-frog,
    .d-shadow {
        zoom: 0.45;
    }
}

/* 375px以下 */
@media screen and (max-width: 375px) {
    .setsumei-wrap,
    .bunny,
    .b-shadow,
    .kurage,
    .kingyo-path,
    .d-frog,
    .d-shadow {
        zoom: 0.38;
    }
}

/* 320px以下 */
@media screen and (max-width: 320px) {
    .setsumei-wrap,
    .bunny,
    .b-shadow,
    .kurage,
    .kingyo-path,
    .d-frog,
    .d-shadow {
        zoom: 0.32;
    }
}