/* 動畫：transform／opacity；「減少動畫」時全部即時完成 */

.screen.is-entering [data-enter] { animation: rise .55s var(--ease) both; }
.screen.is-entering [data-enter]:nth-child(2) { animation-delay: 50ms; }
.screen.is-entering [data-enter]:nth-child(3) { animation-delay: 100ms; }
.screen.is-entering [data-enter]:nth-child(4) { animation-delay: 150ms; }
.screen.is-entering [data-enter]:nth-child(5) { animation-delay: 200ms; }
/* 窄螢幕：焦點遊戲區內有固定在底部的「開始」鍵，入場只淡入，避免 transform 令它暫時跟隨移動 */
@media (max-width: 760px) { .screen.is-entering .hero[data-enter] { animation-name: fade-in; } }
.screen.is-entering .profile-card { animation: pop-in .5s var(--ease-spring) both; animation-delay: calc(var(--i, 0) * 60ms + 120ms); }
.screen.is-entering .tile { animation: tile-in .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms + 120ms); }
.screen.is-entering .dock-btn { animation: pop-in .45s var(--ease-spring) both; }
.screen.is-entering .dock-btn:nth-child(2) { animation-delay: 60ms; }
.screen.is-entering .dock-btn:nth-child(3) { animation-delay: 120ms; }
.screen.is-entering .dock-btn:nth-child(4) { animation-delay: 180ms; }

/* 首次載入開機畫面 */
body.is-ready .screen-boot:not(.is-entering) .boot-disc { animation: emblem-in 1s .5s var(--ease) both; }
body.is-ready .screen-boot:not(.is-entering) .boot-title,
body.is-ready .screen-boot:not(.is-entering) .boot-school { animation: rise .8s .9s var(--ease) both; }
body.is-ready .screen-boot:not(.is-entering) .power-btn,
body.is-ready .screen-boot:not(.is-entering) .boot-hint { animation: rise .8s 1.15s var(--ease) both; }
body.is-ready .screen-boot:not(.is-entering) .boot-block { animation: block-in .7s var(--ease-spring) both, float 5s 1.6s ease-in-out infinite; }
body.is-ready .screen-boot:not(.is-entering) .boot-block.b2 { animation-delay: .75s, 1.8s; }
body.is-ready .screen-boot:not(.is-entering) .boot-block.b3 { animation-delay: .85s, 2s; }
body.is-ready .screen-boot:not(.is-entering) .boot-block.b4 { animation-delay: .95s, 2.2s; }
body.is-ready .screen-boot:not(.is-entering) .boot-block.b1 { animation-delay: .65s, 1.6s; }

@keyframes draw-line { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes block-in { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }
@keyframes bounce-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-12px); opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(18px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes tile-in { from { opacity: 0; translate: 46px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes emblem-in { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes power-press { 40% { transform: scale(.8); } to { transform: scale(1); } }
@keyframes pulse-ring { 0% { opacity: .5; transform: scale(.94); } 70%, 100% { opacity: 0; transform: scale(1.12); } }
@keyframes aurora { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(6vw, 4vh) scale(1.12); } 100% { transform: translate(-4vw, -3vh) scale(.95); } }
@keyframes kenburns { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.08) translate(-1.2%, -1%); } }
@keyframes twinkle { from { opacity: .25; } to { opacity: .65; } }
@keyframes halo-breathe { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes title-shine { 0%, 55% { background-position: 100% 0; } 85%, 100% { background-position: -60% 0; } }
@keyframes press-start { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes ring-breathe { 0%, 100% { box-shadow: 0 0 22px 2px rgba(255, 255, 255, .28); } 50% { box-shadow: 0 0 38px 8px rgba(255, 255, 255, .5); } }
@keyframes hero-in { from { opacity: 0; transform: translateX(-18px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes pulse-dot { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after, .reduce-motion ::backdrop {
  animation-duration: .001ms !important;
  animation-delay: 0s !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}
.reduce-motion .power-btn::after, .reduce-motion .play-btn::after { display: none; }
@media (prefers-reduced-motion: reduce) {
  html:not(.js-motion) *, html:not(.js-motion) *::before, html:not(.js-motion) *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
