/* 盤面、通知、チュートリアル、重要イベントのキーフレーム。 */

.player-match-setup.is-menu-switching[data-menu-scope="both"] :is(.player-match-loadout, .player-match-opponents),
.player-match-setup.is-menu-switching[data-menu-scope="deck"] .player-match-loadout,
.player-match-setup.is-menu-switching[data-menu-scope="opponents"] .player-match-opponents,
.player-trade-screen.is-menu-switching .player-trade-body {
  animation: menu-frame-glow 240ms ease-out;
}

.player-match-setup.is-menu-switching[data-menu-scope="both"] :is(.player-match-deck-preview, .player-match-opponent-list),
.player-match-setup.is-menu-switching[data-menu-scope="deck"] .player-match-deck-preview,
.player-match-setup.is-menu-switching[data-menu-scope="opponents"] .player-match-opponent-list,
.player-trade-screen.is-menu-switching .player-trade-body > * {
  animation: menu-content-in 200ms cubic-bezier(.2, .7, .3, 1);
}

@keyframes menu-frame-glow {
  0% { box-shadow: inset 0 0 0 1px rgba(236, 211, 141, .65), inset 0 0 22px rgba(219, 187, 104, .13); }
  100% { box-shadow: inset 0 0 0 1px transparent, inset 0 0 22px transparent; }
}

@keyframes menu-content-in {
  0% { opacity: .45; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  :is(.player-match-setup, .player-trade-screen).is-menu-switching * {
    animation: none !important;
  }
}

:is(.player-match-setup, .player-communication).is-entering,
.load-overlay.is-match-setup-entering {
  animation: match-setup-panel-in 420ms cubic-bezier(0.18, 0.9, 0.24, 1) both;
}

.load-overlay.is-match-intro .load-match-intro > :not(.load-match-intro-turn-order) {
  animation: match-intro-portrait-in 480ms cubic-bezier(0.18, 0.9, 0.24, 1) both;
}

.load-overlay.is-match-intro .load-match-intro > .load-match-intro-portrait-wrap {
  animation: match-intro-portrait-in 480ms cubic-bezier(0.18, 0.9, 0.24, 1) both,
    match-intro-portrait-pulse 1500ms ease-in-out infinite;
}

@keyframes match-intro-portrait-in {
  0% { opacity: 0; transform: translateY(18px) scale(0.82); filter: brightness(1.8); }
  70% { opacity: 1; transform: translateY(-2px) scale(1.03); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: brightness(1); }
}

@keyframes match-intro-portrait-pulse {
  0%, 100% { box-shadow: 0 0 0 5px rgba(224, 184, 78, 0.1), 0 0 28px rgba(224, 184, 78, 0.22); }
  50% { box-shadow: 0 0 0 8px rgba(224, 184, 78, 0.13), 0 0 44px rgba(224, 184, 78, 0.42); }
}

:is(.player-match-setup, .player-communication).is-entering::before,
.load-overlay.is-match-setup-entering::before {
  content: "";
  position: absolute;
  inset: -35%;
  z-index: 5;
  background:
    linear-gradient(
      112deg,
      transparent 43%,
      rgba(142, 216, 211, 0.08) 47%,
      rgba(255, 239, 182, 0.72) 49.5%,
      rgba(255, 255, 255, 0.9) 50%,
      rgba(255, 222, 128, 0.28) 51.5%,
      transparent 56%
    );
  opacity: 0;
  transform: translateX(-68%);
  pointer-events: none;
  animation: match-setup-light-sweep 560ms ease-out both;
}

:is(.player-match-setup, .player-communication).is-entering .player-match-setup-header,
:is(.player-match-setup, .player-communication).is-entering .player-match-setup-body,
.player-match-setup.is-entering .player-match-setup-footer {
  animation: match-setup-content-in 360ms ease-out both;
}

:is(.player-match-setup, .player-communication).is-entering .player-match-setup-header {
  animation-delay: 55ms;
}

.player-shop-doors { display: none; position: absolute; inset: 0; z-index: 8; perspective: 1100px; pointer-events: none; }
.player-shop.is-entering .player-shop-doors { display: block; }
.player-shop-door {
  position: absolute; top: 0; bottom: 0; width: 50%; backface-visibility: hidden;
  background: linear-gradient(105deg, #192b29, #233b35 48%, #152723);
  box-shadow: inset 0 0 0 1px #b4a27880, inset 0 0 28px #0005;
  animation: shop-door-left-open 620ms cubic-bezier(.25, .5, .35, 1) both;
}
.player-shop-door::before { content: ""; position: absolute; inset: 14px; border: 1px solid #b4a27840; }
.player-shop-door::after {
  content: ""; position: absolute; top: calc(50% - 17px); right: 17px; width: 5px; height: 34px;
  border-radius: 3px; background: linear-gradient(90deg, #8e7746, #e1ce94, #a68f55); box-shadow: 1px 1px 3px #0006;
}
.player-shop-door-left { left: 0; transform-origin: left center; }
.player-shop-door-right { right: 0; transform-origin: right center; animation-name: shop-door-right-open; }
.player-shop-door-right::after { right: auto; left: 17px; }
@keyframes shop-door-left-open {
  0% { transform: rotateY(0); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: rotateY(-100deg); opacity: 0; }
}
@keyframes shop-door-right-open {
  0% { transform: rotateY(0); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: rotateY(100deg); opacity: 0; }
}

:is(.player-match-setup, .player-communication).is-entering .player-match-setup-body {
  animation-delay: 90ms;
}

.player-match-setup.is-entering .player-match-setup-footer {
  animation-delay: 135ms;
}

.first-launch-opening.is-entering {
  animation: match-setup-panel-in 420ms cubic-bezier(0.18, 0.9, 0.24, 1) both;
}

.first-launch-opening.is-entering::before {
  content: "";
  position: absolute;
  inset: -35%;
  z-index: 4;
  background:
    linear-gradient(
      112deg,
      transparent 43%,
      rgba(142, 216, 211, 0.08) 47%,
      rgba(255, 239, 182, 0.72) 49.5%,
      rgba(255, 255, 255, 0.9) 50%,
      rgba(255, 222, 128, 0.28) 51.5%,
      transparent 56%
    );
  opacity: 0;
  transform: translateX(-68%);
  pointer-events: none;
  animation: match-setup-light-sweep 560ms ease-out both;
}

@keyframes title-start-ready {
  0%, 100% { filter: brightness(1); }
  40% { filter: brightness(1.25); box-shadow: inset 0 1px #fff1bf66, 0 0 24px #e5c27b59; }
}
#titleScreen.title-ready-flash :is(.title-panel, .title-logo-art) { animation: none; }
#titleScreen.title-ready-flash .title-action-primary { animation: title-start-ready 920ms ease-out both; }
@media (prefers-reduced-motion: reduce) {
  #titleScreen.title-ready-flash .title-action-primary { animation: none; }
  #titleLoadStatus { transition: none; }
  .load-overlay.is-match-intro .load-match-intro > :not(.load-match-intro-turn-order),
  .load-overlay.is-match-intro .load-match-intro-portrait-wrap { animation: none; }
}

.first-launch-opening.is-entering :is(.first-launch-portrait-wrap, .first-launch-dialog) {
  animation: match-setup-content-in 360ms ease-out both;
}

.first-launch-opening.is-entering .first-launch-dialog {
  animation-delay: 70ms;
}

.first-launch-opening.is-entering .first-launch-dialog.is-content-changing {
  animation: match-setup-content-in 260ms ease-out both;
  animation-delay: 0ms;
}

@keyframes match-setup-panel-in {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.975);
    filter: brightness(0.78);
  }

  62% {
    opacity: 1;
    transform: translateY(-2px) scale(1.004);
    filter: brightness(1.12);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
}

:is(#firstLaunchOpening, #prologueEnding, #academyEventDialogue, #academyEventEnding).is-entering { animation: first-launch-scene-in 650ms ease-out both; }
:is(#firstLaunchOpening, #prologueEnding, #academyEventDialogue, #academyEventEnding).is-entering::before { display: none; }
:is(#firstLaunchOpening, #prologueEnding, #academyEventDialogue, #academyEventEnding).is-entering .first-launch-portrait-wrap { animation: none; }
:is(#firstLaunchOpening, #prologueEnding, #academyEventDialogue, #academyEventEnding) .first-launch-portrait { animation-duration: 650ms; }
:is(#firstLaunchOpening, #prologueEnding, #academyEventDialogue, #academyEventEnding) .first-launch-portrait.is-pose-changing { animation-duration: 360ms; }
:is(#firstLaunchOpening, #prologueEnding, #academyEventDialogue, #academyEventEnding).is-entering .first-launch-dialog { animation: first-launch-depth-dialog-in 650ms ease-out 100ms both; }
:is(#firstLaunchOpening, #prologueEnding, #academyEventDialogue, #academyEventEnding).is-entering .first-launch-dialog.is-content-changing { animation: first-launch-depth-dialog-in 260ms ease-out both; }
#firstLaunchOpening.is-entering .first-launch-dialog.is-content-changing { animation: none; }
@media (max-width: 860px) and (orientation: portrait) {
  #prologueEnding.is-entering .first-launch-dialog.is-content-changing { animation: none; }
}
:is(#firstLaunchOpening, #prologueEnding, #academyEventDialogue, #academyEventEnding) .first-launch-scenery { animation: first-launch-scenery-in 1600ms ease-out both; }
:is(#firstLaunchOpening, #prologueEnding, #academyEventDialogue, #academyEventEnding) .first-launch-motes i { animation: first-launch-mote-drift 14s ease-in-out infinite; }
:is(#firstLaunchOpening, #prologueEnding, #academyEventDialogue, #academyEventEnding) .first-launch-motes i:nth-child(2) { animation-delay: -4s; animation-duration: 17s; }
:is(#firstLaunchOpening, #prologueEnding, #academyEventDialogue, #academyEventEnding) .first-launch-motes i:nth-child(3) { animation-delay: -9s; animation-duration: 19s; }
:is(#firstLaunchOpening, #prologueEnding, #academyEventDialogue, #academyEventEnding) .first-launch-motes i:nth-child(4) { animation-delay: -6s; animation-duration: 15s; }

@keyframes first-launch-scene-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes first-launch-depth-dialog-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes first-launch-scenery-in {
  from { transform: scale(1.045); }
  to { transform: scale(1); }
}
@keyframes first-launch-mote-drift {
  0%, 100% { opacity: 0.1; transform: translate(0, 10px); }
  45% { opacity: 0.65; }
  65% { opacity: 0.35; transform: translate(12px, -22px); }
}

@media (prefers-reduced-motion: reduce) {
  :is(#firstLaunchOpening, #prologueEnding, #academyEventDialogue, #academyEventEnding).is-entering,
  :is(#firstLaunchOpening, #prologueEnding, #academyEventDialogue, #academyEventEnding) .first-launch-portrait,
  :is(#firstLaunchOpening, #prologueEnding, #academyEventDialogue, #academyEventEnding) .first-launch-scenery,
  :is(#firstLaunchOpening, #prologueEnding, #academyEventDialogue, #academyEventEnding) .first-launch-motes i,
  :is(#firstLaunchOpening, #prologueEnding, #academyEventDialogue, #academyEventEnding).is-entering .first-launch-dialog { animation: none !important; }
  :is(#firstLaunchOpening, #prologueEnding, #academyEventDialogue, #academyEventEnding) .first-launch-action { transition: none; }
}

@keyframes match-setup-light-sweep {
  0%,
  14% {
    opacity: 0;
    transform: translateX(-68%);
  }

  34% {
    opacity: 0.9;
  }

  74%,
  100% {
    opacity: 0;
    transform: translateX(68%);
  }
}

@keyframes match-setup-content-in {
  0% {
    opacity: 0;
    transform: translateY(9px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .player-shop.is-entering .player-shop-doors { display: none; }
  :is(.player-match-setup, .player-communication).is-entering,
  :is(.player-match-setup, .player-communication).is-entering::before,
  :is(.player-match-setup, .player-communication).is-entering .player-match-setup-header,
  :is(.player-match-setup, .player-communication).is-entering .player-match-setup-body,
  .player-match-setup.is-entering .player-match-setup-footer,
  .load-overlay.is-match-setup-entering,
  .load-overlay.is-match-setup-entering::before,
  .first-launch-opening.is-entering,
  .first-launch-opening.is-entering::before,
  .first-launch-opening.is-entering :is(.first-launch-portrait-wrap, .first-launch-dialog),
  .first-launch-opening.is-entering .first-launch-dialog.is-content-changing {
    animation: none !important;
  }
}

@keyframes commander-action-glow {
  0%,
  100% {
    border-color: #e7b84f;
    box-shadow:
      inset 0 1px 0 rgba(255, 252, 218, 0.3),
      0 0 0 1px rgba(255, 213, 105, 0.18),
      0 0 10px rgba(255, 174, 42, 0.4),
      0 3px 9px rgba(0, 0, 0, 0.28);
  }

  50% {
    border-color: #ffe28a;
    box-shadow:
      inset 0 1px 0 rgba(255, 254, 229, 0.48),
      0 0 0 2px rgba(255, 222, 126, 0.26),
      0 0 23px rgba(255, 190, 55, 0.82),
      0 4px 12px rgba(0, 0, 0, 0.32);
  }
}

@media (prefers-reduced-motion: reduce) {
  .actions .commander-select-action,
  .actions .commander-designate-action {
    animation: none !important;
  }
}

@keyframes phase-notice {
  0% {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }

  16%,
  72% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-6px) scale(0.99);
  }
}

@keyframes phase-notice-in {
  0% {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes levelup-notice-in {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.92);
  }

  60% {
    opacity: 1;
    transform: translateY(0) scale(1.04);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes special-notice-in {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
    filter: brightness(1.25);
  }

  64% {
    opacity: 1;
    transform: translateY(0) scale(1.04);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1.04);
  }
}

@keyframes effect-notice-in {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.94);
    filter: brightness(1.16);
  }

  64% {
    opacity: 1;
    transform: translateY(0) scale(1.035);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1.02);
  }
}

@keyframes awaken-notice-in {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.84);
    filter: brightness(1.35);
  }

  45% {
    opacity: 1;
    transform: translateY(-2px) scale(1.08);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1.08);
  }
}

@keyframes finish-notice-in {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.9);
  }

  60% {
    opacity: 1;
    transform: translateY(0) scale(1.08);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes notice-out {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-7px) scale(0.99);
    filter: brightness(1);
  }
}

@keyframes mobile-context-pop {
  0% {
    opacity: 0;
    transform: translateY(4px) scale(0.96);
    filter: blur(1px);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes game-start-overlay {
  0% {
    opacity: 0;
    background: rgba(0, 0, 0, 0);
  }

  12%,
  72% {
    opacity: 1;
    background: radial-gradient(circle at 50% 46%, rgba(255, 225, 154, 0.08), rgba(0, 0, 0, 0.14) 56%, rgba(0, 0, 0, 0.24));
  }

  100% {
    opacity: 0;
    background: rgba(0, 0, 0, 0);
  }
}

@keyframes game-start-overlay-in {
  0% {
    opacity: 0;
    background: rgba(0, 0, 0, 0);
  }

  100% {
    opacity: 1;
    background: radial-gradient(circle at 50% 46%, rgba(255, 225, 154, 0.08), rgba(0, 0, 0, 0.14) 56%, rgba(0, 0, 0, 0.24));
  }
}

@keyframes game-start-overlay-out {
  0% {
    opacity: 1;
    background: radial-gradient(circle at 50% 46%, rgba(255, 225, 154, 0.08), rgba(0, 0, 0, 0.14) 56%, rgba(0, 0, 0, 0.24));
  }

  100% {
    opacity: 0;
    background: rgba(0, 0, 0, 0);
  }
}

@keyframes game-start-copy {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.82);
    filter: brightness(1.4) blur(1px);
  }

  18% {
    opacity: 1;
    transform: translateY(0) scale(1.06);
    filter: brightness(1.28) blur(0);
  }

  42%,
  74% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    filter: brightness(0.95);
  }
}

@keyframes game-start-copy-in {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.82);
    filter: brightness(1.4) blur(1px);
  }

  55% {
    opacity: 1;
    transform: translateY(0) scale(1.06);
    filter: brightness(1.28) blur(0);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
}

@keyframes game-start-copy-out {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    filter: brightness(0.95);
  }
}

@keyframes duel-copy-sheen {
  0% {
    opacity: 0;
    transform: translateX(-160%) skewX(-16deg);
  }

  24% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateX(320%) skewX(-16deg);
  }
}

@keyframes notice-card-sheen {
  0% {
    opacity: 0;
    transform: translateX(0) skewX(-16deg);
  }

  22% {
    opacity: 0.82;
  }

  100% {
    opacity: 0;
    transform: translateX(360%) skewX(-16deg);
  }
}

@keyframes game-start-slash-a {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-8deg) scaleX(0);
  }

  18% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-8deg) scaleX(1);
  }

  62% {
    opacity: 0.72;
    transform: translate(-50%, -50%) rotate(-8deg) scaleX(0.9);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-8deg) scaleX(0.3);
  }
}

@keyframes game-start-slash-b {
  0%,
  8% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(8deg) scaleX(0);
  }

  28% {
    opacity: 0.9;
    transform: translate(-50%, -50%) rotate(8deg) scaleX(0.82);
  }

  64% {
    opacity: 0.58;
    transform: translate(-50%, -50%) rotate(8deg) scaleX(0.76);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(8deg) scaleX(0.26);
  }
}

@keyframes unit-call-pop {
  0% {
    opacity: 1;
    transform: translateY(-7px) scale(1.055);
    box-shadow: 0 0 0 rgba(255, 225, 154, 0);
  }

  28% {
    opacity: 1;
    transform: translateY(1px) scale(0.98);
    box-shadow:
      0 0 0 2px rgba(255, 225, 154, 0.52),
      0 0 22px rgba(255, 225, 154, 0.32);
  }

  58% {
    transform: translateY(0) scale(1.012);
    box-shadow:
      0 0 0 1px rgba(255, 225, 154, 0.22),
      0 4px 12px rgba(255, 218, 121, 0.14);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(255, 225, 154, 0);
  }
}

@keyframes unit-call-flash {
  0% {
    opacity: 0;
    transform: scale(0.98);
  }

  28% {
    opacity: 0.9;
    transform: scale(1);
  }

  58% {
    opacity: 0.42;
    transform: scale(1.025);
  }

  100% {
    opacity: 0;
    transform: scale(1.045);
  }
}

@keyframes unit-vanguard-reveal {
  0% {
    opacity: 0.82;
    transform: translateY(5px) rotateY(-12deg) scale(0.96);
    filter: brightness(0.92);
  }

  38% {
    opacity: 1;
    transform: translateY(-4px) rotateY(8deg) scale(1.04);
    filter: brightness(1.16);
    box-shadow:
      0 0 0 2px rgba(255, 235, 168, 0.48),
      0 0 24px rgba(255, 235, 168, 0.32);
  }

  100% {
    opacity: 1;
    transform: translateY(0) rotateY(0) scale(1);
    filter: brightness(1);
    box-shadow: 0 0 0 rgba(255, 235, 168, 0);
  }
}

@keyframes unit-vanguard-reveal-flash {
  0% {
    opacity: 0;
    transform: scale(0.68);
  }

  32% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.16);
  }
}

@keyframes unit-level-up-lift {
  0% {
    transform: translateY(-5px) scale(1.04);
    filter: brightness(1.04) saturate(1);
  }

  26% {
    transform: translateY(1px) scale(0.985);
    filter: brightness(1.2) saturate(1.08);
    box-shadow:
      0 0 0 1px rgba(255, 232, 155, 0.58),
      0 0 20px rgba(255, 214, 101, 0.32),
      var(--shadow-card-polished);
  }

  68% {
    transform: translateY(0) scale(1.012);
    filter: brightness(1.07) saturate(1.04);
  }

  100% {
    transform: translateY(0) scale(1);
    filter: brightness(1) saturate(1);
    box-shadow: var(--shadow-card-polished);
  }
}

@keyframes unit-level-up-flash {
  0% {
    opacity: 0;
    transform: scale(0.97);
  }

  26% {
    opacity: 0.95;
    transform: scale(1);
  }

  58% {
    opacity: 0.48;
    transform: scale(1.045);
  }

  100% {
    opacity: 0;
    transform: scale(1.055);
  }
}

@keyframes unit-level-up-badge {
  0% {
    transform: scale(0.82);
    filter: brightness(0.92);
  }

  30% {
    transform: scale(1.28);
    filter: brightness(1.35);
    box-shadow:
      0 0 0 2px rgba(255, 241, 188, 0.58),
      0 0 14px rgba(255, 218, 104, 0.72);
  }

  62% {
    transform: scale(1.08);
    filter: brightness(1.12);
  }

  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes unit-position-pulse {
  0% {
    transform: scale(0.98);
  }

  45% {
    transform: scale(1.035);
    box-shadow:
      0 0 0 2px rgba(104, 208, 200, 0.42),
      0 0 16px rgba(104, 208, 200, 0.24);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(104, 208, 200, 0);
  }
}

@keyframes unit-position-flash {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }

  40% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.06);
  }
}

@keyframes unit-attack-call {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(255, 210, 104, 0);
  }

  48% {
    transform: translate(var(--unit-forward-x, 0), -4px) scale(1.045);
    box-shadow:
      0 0 0 2px rgba(255, 210, 104, 0.46),
      0 0 20px rgba(255, 210, 104, 0.28);
  }

  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(255, 210, 104, 0);
  }
}

@keyframes unit-target-call {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(255, 122, 104, 0);
  }

  42% {
    transform: translate(var(--unit-brace-x, 0), 3px) scale(1.025);
    box-shadow:
      0 0 0 2px rgba(255, 122, 104, 0.42),
      0 0 18px rgba(255, 122, 104, 0.24);
  }

  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(255, 122, 104, 0);
  }
}

@keyframes unit-battle-call-flash {
  0% {
    opacity: 0;
    transform: scale(0.78) rotate(-4deg);
  }

  30% {
    opacity: 1;
    transform: scale(1) rotate(-2deg);
  }

  100% {
    opacity: 0;
    transform: scale(1.12) rotate(0deg);
  }
}

@keyframes unit-battle-target-flash {
  0% {
    opacity: 0;
    transform: scale(0.94);
  }

  30% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.07);
  }
}

@keyframes unit-block-step {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(125, 188, 255, 0);
  }

  34% {
    transform: translate(var(--unit-block-x, 0), -3px) scale(1.04);
    box-shadow:
      0 0 0 2px rgba(125, 188, 255, 0.46),
      0 0 20px rgba(125, 188, 255, 0.25);
  }

  68% {
    transform: translate(var(--unit-block-x-soft, 0), 1px) scale(1.01);
  }

  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(125, 188, 255, 0);
  }
}

@keyframes unit-block-flash {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }

  34% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

@keyframes card-draw-pop {
  0% {
    opacity: 0.62;
    transform: translateY(-12px) scale(0.9);
    box-shadow: 0 0 0 rgba(255, 225, 154, 0);
  }

  36% {
    opacity: 1;
    transform: translateY(2px) scale(1.045);
    box-shadow:
      0 0 0 2px rgba(255, 225, 154, 0.44),
      0 0 18px rgba(255, 225, 154, 0.28);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(255, 225, 154, 0);
  }
}

@keyframes pile-count-draw-in {
  0% {
    opacity: 0;
    transform: translateY(72%) scale(0.86);
  }

  34%,
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pile-count-draw-out {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  34%,
  100% {
    opacity: 0;
    transform: translateY(-72%) scale(0.86);
  }
}

@keyframes pile-draw-source-flash {
  0%,
  100% {
    border-color: var(--line-soft);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  28% {
    border-color: rgba(255, 226, 142, 0.92);
    box-shadow:
      inset 0 0 12px rgba(255, 232, 158, 0.2),
      0 0 15px rgba(255, 214, 105, 0.34);
  }
}

@keyframes life-protection-glow {
  0%, 100% { box-shadow: none; }
  20%, 55% { box-shadow: inset 0 0 12px rgba(134, 228, 255, .45), 0 0 18px rgba(134, 228, 255, .65); }
}

@media (prefers-reduced-motion: reduce) {
  .pile.pile-visual-life-protected { animation: none; }
  .card.card-visual-cost-reveal::after { animation-duration: 160ms; }
}

@keyframes pile-draw-destination-pop {
  0% {
    color: inherit;
    filter: none;
    transform: scale(0.82);
  }

  34% {
    color: #fff1b8;
    filter: drop-shadow(0 0 7px rgba(255, 218, 116, 0.72));
    transform: scale(1.18);
  }

  100% {
    color: inherit;
    filter: none;
    transform: scale(1);
  }
}

@keyframes life-card-draw-out {
  0% {
    width: var(--life-icon-width);
    margin-inline-start: 0;
    border-inline-width: 1px;
    opacity: 1;
    filter: brightness(1);
    transform: skewY(-5deg) translateY(0) rotate(0) scale(1);
  }

  30% {
    width: var(--life-icon-width);
    margin-inline-start: 0;
    border-inline-width: 1px;
    opacity: 1;
    filter: brightness(1.75) drop-shadow(0 0 7px rgba(255, 224, 134, 0.8));
    transform: skewY(-5deg) translateY(-3px) rotate(4deg) scale(1.12);
  }

  72% {
    width: 0;
    margin-inline-start: var(--life-draw-final-margin, 0px);
    border-inline-width: 0;
    opacity: 0;
    filter: brightness(1.45) drop-shadow(0 0 5px rgba(255, 224, 134, 0.48));
    transform: skewY(-5deg) translateY(-7px) rotate(8deg) scale(0.72);
  }

  100% {
    width: 0;
    margin-inline-start: var(--life-draw-final-margin, 0px);
    border-inline-width: 0;
    opacity: 0;
    filter: none;
    transform: skewY(-5deg) translateY(-7px) rotate(8deg) scale(0.64);
  }
}

@keyframes life-empty-mark-draw-in {
  0%,
  42% {
    opacity: 0;
    transform: scale(0.72);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pile-count-current,
  .pile-count-previous,
  .pile.pile-visual-draw-source,
  .hand-zone.pile-visual-draw-destination .zone-count,
  .grave-pile-button.pile-visual-draw-destination > .pile-count-static,
  .life-icon.life-icon-draw-out,
  .life-empty-mark.life-empty-mark-draw-in {
    animation-duration: 120ms !important;
  }
}

@keyframes hand-card-draw-pop {
  0% {
    opacity: 0.62;
    transform:
      translateY(calc((var(--hand-card-lift, 0px) * var(--hand-card-lift-direction, 1)) - 12px))
      rotate(calc(var(--hand-card-rotate, 0deg) * var(--hand-card-rotate-direction, 1)))
      scale(0.9);
    box-shadow: 0 0 0 rgba(255, 225, 154, 0);
  }

  36% {
    opacity: 1;
    transform:
      translateY(calc((var(--hand-card-lift, 0px) * var(--hand-card-lift-direction, 1)) + 2px))
      rotate(calc(var(--hand-card-rotate, 0deg) * var(--hand-card-rotate-direction, 1)))
      scale(1.045);
    box-shadow:
      0 0 0 2px rgba(255, 225, 154, 0.44),
      0 0 18px rgba(255, 225, 154, 0.28);
  }

  100% {
    opacity: 1;
    transform:
      translateY(calc(var(--hand-card-lift, 0px) * var(--hand-card-lift-direction, 1)))
      rotate(calc(var(--hand-card-rotate, 0deg) * var(--hand-card-rotate-direction, 1)))
      scale(1);
    box-shadow: 0 0 0 rgba(255, 225, 154, 0);
  }
}

@keyframes card-cost-place {
  0% {
    opacity: 1;
    transform: translateY(-5px) scale(1.04);
    box-shadow: 0 0 0 rgba(116, 206, 160, 0);
  }

  30% {
    opacity: 1;
    transform: translateY(1px) scale(0.975);
    box-shadow:
      0 0 0 2px rgba(116, 206, 160, 0.42),
      0 0 18px rgba(116, 206, 160, 0.24);
  }

  65% {
    transform: translateY(0) scale(1.008);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(116, 206, 160, 0);
  }
}

@keyframes card-placement-flash {
  0% { opacity: 0; }
  30% { opacity: 0.95; }
  100% { opacity: 0; }
}

@keyframes effect-target-confirm {
  0% { opacity: 0; }
  18%, 55% { opacity: 1; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .unit.unit-visual-call,
  .unit.unit-visual-level-up,
  .unit.unit-visual-level-up .level-badge,
  .card.card-visual-cost {
    animation: none !important;
  }

  .unit.unit-visual-call::after,
  .unit.unit-visual-level-up::after,
  .card.card-visual-cost::after {
    animation: card-placement-flash 160ms ease-out both !important;
    animation-delay: var(--unit-visual-delay, 0ms) !important;
  }
}

@keyframes progress-level-ready {
  0% {
    color: #fff4c7;
    filter: brightness(0.92) saturate(0.9);
    transform: scale(0.94);
    box-shadow: 0 0 0 rgba(174, 231, 255, 0);
  }

  34% {
    color: #ecfbff;
    border-color: rgba(174, 231, 255, 0.96);
    background: rgba(27, 66, 79, 0.98);
    filter: brightness(1.24) saturate(1.12);
    transform: scale(1.18);
    box-shadow:
      0 0 0 2px rgba(174, 231, 255, 0.46),
      0 0 16px rgba(174, 231, 255, 0.58);
  }

  100% {
    filter: none;
    transform: scale(1);
    box-shadow: 0 0 0 rgba(174, 231, 255, 0);
  }
}

@keyframes progress-level-blocked {
  0%, 100% {
    color: #fff4c7;
    filter: none;
    transform: scale(1);
    box-shadow: 0 0 0 rgba(174, 231, 255, 0);
  }

  28%, 62% {
    color: #ecfbff;
    border-color: rgba(174, 231, 255, 0.96);
    background: rgba(27, 66, 79, 0.98);
    filter: brightness(1.25) saturate(1.12);
    transform: scale(1.16);
    box-shadow:
      0 0 0 2px rgba(174, 231, 255, 0.42),
      0 0 16px rgba(174, 231, 255, 0.58);
  }
}

@keyframes progress-badge-blocked {
  0%, 100% {
    color: #e8f8ff;
    filter: none;
    transform: scale(1);
  }

  28%, 62% {
    color: #ffffff;
    border-color: rgba(174, 231, 255, 1);
    filter: brightness(1.24) saturate(1.12);
    transform: scale(1.09);
    box-shadow:
      0 0 0 2px rgba(174, 231, 255, 0.42),
      0 0 18px rgba(174, 231, 255, 0.58),
      0 5px 16px rgba(0, 0, 0, 0.28);
  }
}

@keyframes cost-payable-chip-bump {
  0% {
    transform: translateY(0) scale(1);
    filter: brightness(1) saturate(1);
  }

  36% {
    transform: translateY(-2px) scale(1.08);
    filter: brightness(1.22) saturate(1.18);
    box-shadow:
      0 0 0 2px rgba(174, 231, 255, 0.26),
      0 0 14px rgba(174, 231, 255, 0.24);
  }

  66% {
    transform: translateY(0) scale(1.03);
    filter: brightness(1.14) saturate(1.08);
  }

  100% {
    transform: translateY(0) scale(1);
    filter: brightness(1) saturate(1);
  }
}

@keyframes cost-set-cancelable-pulse {
  0%,
  100% {
    opacity: 0.46;
  }

  50% {
    opacity: 0.78;
  }
}

@keyframes position-change-cancelable-pulse {
  0%,
  100% {
    opacity: 0.42;
  }

  50% {
    opacity: 0.72;
  }
}

@keyframes card-weapon-zone-out {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: brightness(1);
  }

  55% {
    opacity: 0.68;
    transform: translate(
      calc(var(--card-zone-out-x, 8px) * 0.55),
      calc(var(--card-zone-out-y, -5px) * 0.55)
    ) scale(0.99);
    filter: brightness(1.08);
  }

  100% {
    opacity: 0;
    transform: translate(var(--card-zone-out-x, 8px), var(--card-zone-out-y, -5px)) scale(0.985);
    filter: brightness(0.9) blur(0.5px);
  }
}

@keyframes source-card-lift {
  0% {
    transform: translateY(calc(var(--hand-card-lift, 0px) * var(--hand-card-lift-direction, 1))) rotate(calc(var(--hand-card-rotate, 0deg) * var(--hand-card-rotate-direction, 1))) scale(1);
    filter: brightness(1);
  }

  28% {
    transform: translateY(calc(var(--hand-card-lift, 0px) * var(--hand-card-lift-direction, 1) - 3px)) rotate(calc(var(--hand-card-rotate, 0deg) * var(--hand-card-rotate-direction, 1))) scale(1.025);
    filter: brightness(1.16) saturate(1.08);
  }

  100% {
    transform: translateY(calc(var(--hand-card-lift, 0px) * var(--hand-card-lift-direction, 1))) rotate(calc(var(--hand-card-rotate, 0deg) * var(--hand-card-rotate-direction, 1))) scale(1);
    filter: brightness(1);
  }
}

@keyframes source-card-flash {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }

  34% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

@keyframes hpbar-trail-decrease {
  0%,
  18% {
    width: var(--hp-from);
    opacity: 1;
    filter: brightness(1.28);
  }

  72% {
    width: var(--hp-to);
    opacity: 0.92;
  }

  100% {
    width: var(--hp-to);
    opacity: 0;
    filter: brightness(1);
  }
}

@keyframes hpbar-current-decrease {
  0%,
  18% {
    width: var(--hp-from);
  }

  72%,
  100% {
    width: var(--hp-to);
  }
}

/* 戦闘ダメージは着弾済みなので、効果ダメージ用の冒頭の静止時間を置かない。 */
@keyframes hpbar-battle-current-decrease {
  0% {
    width: var(--hp-from);
  }

  72%,
  100% {
    width: var(--hp-to);
  }
}

@keyframes hpbar-current-increase {
  0%,
  18% {
    width: var(--hp-from);
  }

  72%,
  100% {
    width: var(--hp-to);
  }
}

@keyframes hp-damage-wash {
  0% {
    opacity: 0;
  }

  26% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes hp-recovery-wash {
  0% {
    opacity: 0;
  }

  28% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes effect-damage-number {
  0% {
    transform: translate(-50%, 8px) scale(0.58);
    opacity: 0;
  }

  24% {
    transform: translate(-50%, -2px) scale(1.18);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -20px) scale(0.96);
    opacity: 0;
  }
}

@keyframes effect-recovery-number {
  0% {
    transform: translate(-50%, 8px) scale(0.58);
    opacity: 0;
  }

  24% {
    transform: translate(-50%, -2px) scale(1.16);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -20px) scale(0.98);
    opacity: 0;
  }
}

@keyframes board-unit-effect-damage-destroyed {
  0%,
  18% {
    transform: translateX(0) scale(1);
    opacity: 1;
    filter: saturate(1) brightness(1.22);
  }

  30% {
    transform: translateX(-3px) scale(1.02);
    filter: saturate(0.72) brightness(0.9);
  }

  42% {
    transform: translateX(3px) scale(1.01);
  }

  100% {
    transform: translateY(8px) scale(0.94);
    opacity: 0;
    filter: saturate(0.3) brightness(0.54);
  }
}

@keyframes board-unit-effect-break-destroyed {
  0%,
  18% {
    transform: translateX(0) scale(1.02);
    opacity: 1;
    filter: saturate(1.18) brightness(1.36);
  }

  28% {
    transform: translateX(-4px) rotate(-1deg) scale(1.025);
  }

  38% {
    transform: translateX(4px) rotate(1deg) scale(1.015);
  }

  100% {
    transform: translateY(10px) rotate(-2deg) scale(0.88);
    opacity: 0;
    filter: saturate(0.24) brightness(0.42);
  }
}

@keyframes card-effect-break {
  0%,
  20% {
    transform: translateX(0) scale(1.035);
    opacity: 1;
    filter: saturate(1.2) brightness(1.42);
  }

  30% {
    transform: translateX(-5px) rotate(-1.5deg) scale(1.035);
  }

  40% {
    transform: translateX(5px) rotate(1.5deg) scale(1.02);
  }

  100% {
    transform: translateY(10px) rotate(-3deg) scale(0.84);
    opacity: 0;
    filter: saturate(0.18) brightness(0.38);
  }
}

@keyframes effect-break-flash {
  0% {
    transform: scale(0.86);
    opacity: 0;
  }

  18%,
  42% {
    transform: scale(1);
    opacity: 1;
  }

  100% {
    transform: scale(1.08);
    opacity: 0;
  }
}

@keyframes effect-break-label-pop {
  0% {
    transform: translate(-50%, 5px) scale(0.72);
    opacity: 0;
  }

  22%,
  58% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -18px) scale(0.92);
    opacity: 0;
  }
}

@keyframes rest-badge-pop {
  0% {
    transform: translateY(-4px) scale(0.72);
    opacity: 0;
  }

  36% {
    transform: translateY(0) scale(1.18);
    opacity: 1;
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes unit-active-flash {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }

  34% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

@keyframes target-candidate-breathe {
  0%,
  100% {
    box-shadow:
      0 0 0 2px rgba(159, 220, 255, 0.46),
      0 0 13px rgba(159, 220, 255, 0.24),
      0 0 26px rgba(255, 225, 154, 0.1);
  }

  50% {
    box-shadow:
      0 0 0 3px rgba(159, 220, 255, 0.72),
      0 0 23px rgba(159, 220, 255, 0.42),
      0 0 34px rgba(255, 225, 154, 0.18);
  }
}

@keyframes card-selection-breathe {
  0%,
  100% {
    box-shadow:
      0 0 0 2px rgba(255, 225, 154, 0.5),
      0 0 16px rgba(255, 225, 154, 0.3),
      0 8px 20px rgba(0, 0, 0, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.12),
      inset 0 -18px 26px rgba(0, 0, 0, 0.18);
  }

  50% {
    box-shadow:
      0 0 0 2px rgba(255, 225, 154, 0.76),
      0 0 22px rgba(255, 225, 154, 0.48),
      0 0 34px rgba(116, 232, 158, 0.12),
      0 8px 20px rgba(0, 0, 0, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.14),
      inset 0 -18px 26px rgba(0, 0, 0, 0.18);
  }
}

@keyframes special-stack-source-pulse {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.32);
  }

  30% {
    transform: translateY(-3px) scale(1.025);
    box-shadow:
      0 0 0 2px rgba(255, 225, 154, 0.32),
      0 0 24px rgba(255, 225, 154, 0.28),
      0 16px 42px rgba(0, 0, 0, 0.32);
  }

  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.32);
  }
}

@keyframes card-weapon-zone-return {
  0% {
    opacity: 0;
    transform: translateX(var(--card-zone-in-x, 8px)) scale(0.965);
    filter: brightness(1.08) blur(0.5px);
  }

  48% {
    opacity: 1;
    transform: translateX(calc(var(--card-zone-in-x, 8px) * -0.18)) scale(1.025);
    filter: brightness(1.12);
  }

  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: brightness(1);
  }
}

@keyframes hand-card-weapon-zone-return {
  0% {
    opacity: 0;
    transform:
      translateX(var(--card-zone-in-x, 8px))
      translateY(calc(var(--hand-card-lift, 0px) * var(--hand-card-lift-direction, 1)))
      rotate(calc(var(--hand-card-rotate, 0deg) * var(--hand-card-rotate-direction, 1)))
      scale(0.965);
    filter: brightness(1.08) blur(0.5px);
  }

  48% {
    opacity: 1;
    transform:
      translateX(calc(var(--card-zone-in-x, 8px) * -0.18))
      translateY(calc(var(--hand-card-lift, 0px) * var(--hand-card-lift-direction, 1)))
      rotate(calc(var(--hand-card-rotate, 0deg) * var(--hand-card-rotate-direction, 1)))
      scale(1.025);
    filter: brightness(1.12);
  }

  100% {
    opacity: 1;
    transform:
      translateX(0)
      translateY(calc(var(--hand-card-lift, 0px) * var(--hand-card-lift-direction, 1)))
      rotate(calc(var(--hand-card-rotate, 0deg) * var(--hand-card-rotate-direction, 1)))
      scale(1);
    filter: brightness(1);
  }
}

@keyframes board-unit-battle-destroyed {
  0% {
    opacity: 1;
    transform: scale(0.98);
    filter: saturate(0.65) brightness(0.78);
  }

  24% {
    opacity: 1;
    transform: scale(0.98);
    filter: saturate(0.65) brightness(0.78);
  }

  44% {
    opacity: 1;
    transform: scale(1.02);
    filter: saturate(0.62) brightness(0.74);
  }

  56% {
    opacity: 0.96;
    transform: translateX(-6px) rotate(-3deg) scale(0.98);
    filter: saturate(0.54) brightness(0.68);
  }

  68% {
    opacity: 0.68;
    transform: translateX(4px) translateY(3px) rotate(2deg) scale(0.94);
    filter: saturate(0.42) brightness(0.62);
  }

  84% {
    opacity: 0.16;
    transform: translateY(14px) rotate(-2deg) scale(0.82);
    filter: saturate(0.3) brightness(0.52) blur(0.5px);
  }

  100% {
    opacity: 0;
    transform: translateY(18px) rotate(-3deg) scale(0.74);
    filter: saturate(0.2) brightness(0.42) blur(1.2px);
  }
}

@keyframes card-zone-flash {
  0% {
    opacity: 0;
    transform: scale(0.82);
  }

  34% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

@keyframes rarity-card-foil {
  0% {
    opacity: 0;
    transform: translateX(-72%) rotate(7deg);
  }

  24% {
    opacity: 0.62;
  }

  62% {
    opacity: 0.28;
  }

  100% {
    opacity: 0;
    transform: translateX(72%) rotate(7deg);
  }
}

@keyframes rarity-ur-sparkle {
  0% {
    opacity: 0;
    transform: scale(0.94);
  }

  18% {
    opacity: 1;
  }

  36% {
    opacity: 0.32;
  }

  56% {
    opacity: 0.98;
  }

  74% {
    opacity: 0.42;
  }

  100% {
    opacity: 0;
    transform: scale(1.05);
  }
}

@keyframes rarity-title-copper {
  0%,
  100% {
    text-shadow:
      0 0 4px rgba(245, 153, 82, 0.2),
      0 0 1px rgba(44, 21, 10, 0.48);
  }

  38% {
    text-shadow:
      0 0 7px rgba(255, 193, 135, 0.34),
      0 0 1px rgba(44, 21, 10, 0.48);
  }
}

@keyframes rarity-title-silver {
  0%,
  100% {
    text-shadow:
      0 0 5px rgba(221, 244, 255, 0.28),
      0 0 1px rgba(35, 48, 61, 0.44);
  }

  38% {
    text-shadow:
      0 0 8px rgba(238, 250, 255, 0.44),
      0 0 1px rgba(35, 48, 61, 0.44);
  }
}

@keyframes rarity-title-gold {
  0%,
  100% {
    text-shadow:
      0 0 6px rgba(255, 221, 93, 0.38),
      0 0 10px rgba(255, 174, 38, 0.16),
      0 0 1px rgba(58, 35, 0, 0.5);
  }

  38% {
    text-shadow:
      0 0 9px rgba(255, 234, 128, 0.56),
      0 0 13px rgba(255, 185, 42, 0.2),
      0 0 1px rgba(58, 35, 0, 0.5);
  }
}

@keyframes levelup-notice {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.92);
  }

  18% {
    opacity: 1;
    transform: translateY(0) scale(1.04);
  }

  30%,
  76% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-6px) scale(0.99);
  }
}

@keyframes special-notice {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
    filter: brightness(1.25);
  }

  14% {
    opacity: 1;
    transform: translateY(0) scale(1.04);
  }

  28%,
  84% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1.04);
  }

  100% {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    filter: brightness(1);
  }
}

@keyframes effect-notice {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.94);
    filter: brightness(1.16);
  }

  14% {
    opacity: 1;
    transform: translateY(0) scale(1.035);
  }

  28%,
  84% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1.02);
  }

  100% {
    opacity: 0;
    transform: translateY(-7px) scale(0.985);
    filter: brightness(1);
  }
}

@keyframes awaken-notice {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.84);
    filter: brightness(1.35);
  }

  10% {
    opacity: 1;
    transform: translateY(-2px) scale(1.08);
  }

  22% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1.08);
  }

  78% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-10px) scale(1.02);
    filter: brightness(1);
  }
}

@keyframes finish-notice {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.9);
  }

  18% {
    opacity: 1;
    transform: translateY(0) scale(1.08);
  }

  36%,
  78% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

@keyframes tutorial-cost-highlight-pulse {
  0%, 100% { filter: brightness(1.02) saturate(1.02); }
  50% { filter: brightness(1.35) saturate(1.15); }
}

@keyframes tutorial-highlight-pulse {
  0%,
  100% {
    filter: brightness(1.02) saturate(1.02);
    transform: translateY(0) scale(1);
  }

  50% {
    filter: brightness(1.16) saturate(1.1);
    transform: translateY(-3px) scale(1.02);
  }
}

@keyframes tutorial-highlight-ring {
  0%,
  100% {
    opacity: 0.42;
    transform: scale(0.98);
  }

  50% {
    opacity: 0.95;
    transform: scale(1.04);
  }
}

@keyframes special-event-commander-veil {
  0% {
    opacity: 0;
  }

  16%,
  72% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes special-event-commander-unit {
  0% {
    filter: brightness(0.94) saturate(0.88);
  }

  22%,
  70% {
    filter: brightness(1.24) saturate(1.12);
  }

  100% {
    filter: brightness(1) saturate(1);
  }
}

@keyframes special-event-commander-ring {
  0% {
    opacity: 0;
    transform: scale(1.16);
  }

  22% {
    opacity: 1;
    transform: scale(1);
  }

  62% {
    opacity: 0.9;
    transform: scale(1.025);
  }

  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

@keyframes special-event-fallen-wash {
  0% {
    opacity: 0;
  }

  18%,
  54% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes special-event-awaken-unit {
  0% {
    filter: brightness(0.78) saturate(0.74);
    box-shadow: var(--shadow-card-polished);
  }

  43% {
    filter: brightness(0.88) saturate(0.86);
    box-shadow:
      0 0 0 1px rgba(255, 225, 133, 0.32),
      0 0 20px rgba(214, 172, 65, 0.34),
      var(--shadow-card-polished);
  }

  49% {
    filter: brightness(1.7) saturate(1.22);
    box-shadow:
      0 0 0 2px rgba(255, 241, 184, 0.92),
      0 0 34px rgba(245, 206, 100, 0.92),
      var(--shadow-card-polished);
  }

  66% {
    filter: brightness(1.14) saturate(1.12);
    box-shadow:
      0 0 0 1px rgba(255, 229, 145, 0.44),
      0 0 18px rgba(232, 191, 82, 0.38),
      var(--shadow-card-polished);
  }

  100% {
    filter: brightness(1) saturate(1);
    box-shadow: var(--shadow-card-polished);
  }
}

@keyframes special-event-awaken-seal {
  0%,
  40% {
    opacity: 1;
  }

  47% {
    opacity: 1;
    filter: brightness(1.45);
  }

  57%,
  100% {
    opacity: 0;
    filter: brightness(1);
  }
}

@keyframes special-event-awaken-emblem {
  0% {
    opacity: 0;
    transform: scale(1.42) rotate(-18deg);
    filter:
      brightness(0.82)
      blur(1px)
      drop-shadow(0 0 4px rgba(255, 229, 145, 0.2));
  }

  12% {
    opacity: 0.78;
  }

  43% {
    opacity: 1;
    transform: scale(0.82) rotate(8deg);
    filter:
      brightness(1.18)
      blur(0)
      drop-shadow(0 0 8px rgba(255, 232, 155, 0.9))
      drop-shadow(0 0 20px rgba(229, 177, 62, 0.52));
  }

  49% {
    opacity: 1;
    transform: scale(0.74) rotate(10deg);
    filter:
      brightness(1.75)
      blur(0)
      drop-shadow(0 0 11px rgba(255, 244, 197, 1))
      drop-shadow(0 0 28px rgba(242, 198, 82, 0.72));
  }

  59%,
  100% {
    opacity: 0;
    transform: scale(0.6) rotate(14deg);
    filter:
      brightness(1.15)
      blur(1.4px)
      drop-shadow(0 0 14px rgba(255, 235, 163, 0.34));
  }
}

@keyframes special-event-awaken-flash {
  0%,
  43% {
    opacity: 0;
    transform: scale(0.38);
  }

  49% {
    opacity: 1;
    transform: scale(1);
  }

  62%,
  100% {
    opacity: 0;
    transform: scale(1.28);
  }
}

@keyframes special-event-awaken-veil {
  0% {
    opacity: 0;
  }

  10%,
  43% {
    opacity: 1;
  }

  62%,
  100% {
    opacity: 0;
  }
}

/* ブラウザ標準のドラッグ画像で、カード外へ出るバッジや影を切らせない。 */
body > .card-drag-preview {
  position: fixed !important;
  top: -10000px !important;
  left: -10000px !important;
  z-index: 2147483647 !important;
  display: block !important;
  width: calc(var(--drag-preview-card-width) + var(--drag-preview-padding) + var(--drag-preview-padding)) !important;
  min-width: 0 !important;
  max-width: none !important;
  height: calc(var(--drag-preview-card-height) + var(--drag-preview-padding) + var(--drag-preview-padding)) !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  filter: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  overflow: visible !important;
  pointer-events: none !important;
  isolation: isolate;
}

body > .card-drag-preview::before,
body > .card-drag-preview::after {
  content: none !important;
  display: none !important;
}

body > .card-drag-preview > .card-drag-preview-card {
  position: absolute !important;
  top: var(--drag-preview-padding) !important;
  left: var(--drag-preview-padding) !important;
  z-index: 1 !important;
  flex: none !important;
  width: var(--drag-preview-card-width) !important;
  min-width: var(--drag-preview-card-width) !important;
  max-width: var(--drag-preview-card-width) !important;
  height: var(--drag-preview-card-height) !important;
  min-height: var(--drag-preview-card-height) !important;
  max-height: var(--drag-preview-card-height) !important;
  margin: 0 !important;
  transform: none !important;
  transform-origin: center !important;
  transition: none !important;
  animation: none !important;
  overflow: visible !important;
}

body > .card-drag-preview > .card-drag-preview-card .level-badge {
  z-index: 3 !important;
}

/* iOS WebKitのfixed要素を使ったドラッグ画像化を避け、透明背景を保つ。 */
body > .card-drag-preview.mobile-webkit-drag-preview {
  position: absolute !important;
  top: var(--drag-preview-top) !important;
  left: var(--drag-preview-left) !important;
  background: transparent !important;
  background-color: transparent !important;
  isolation: auto;
}

body > .card-drag-preview.mobile-webkit-drag-preview > .card-drag-preview-card {
  filter: none !important;
  outline: 0 !important;
  box-shadow: none !important;
  will-change: auto !important;
}
