/* AGE-363: restrained atmospheric motion above the full, untransformed still. */
.deck-motion-layer {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  overflow: hidden; pointer-events: none; user-select: none; contain: layout paint;
  opacity: 0; transition: opacity 180ms ease; z-index: 1;
}
.deck-motion-layer[hidden] { display: none; }
.deck-motion-layer[data-running="true"] { opacity: 1; }
.deck-motion-layer i { position: absolute; display: block; pointer-events: none; animation-play-state: paused; }
.deck-motion-layer[data-running="true"] i { animation-play-state: running; }
.deck-motion-mote {
  left: var(--mote-x); top: var(--mote-y); width: var(--mote-size); height: var(--mote-size);
  border-radius: 50%; background: var(--motion-color); opacity: 0;
  box-shadow: 0 0 7px 1px color-mix(in srgb,var(--motion-color) 45%,transparent);
  animation: deck-mote-rise var(--mote-time) linear var(--mote-delay) infinite;
}
.deck-motion-mist {
  left: -12%; bottom: -15%; width: 124%; height: 45%; border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb,var(--motion-color) 7%,transparent), transparent 66%);
  animation: deck-mist-drift 26s ease-in-out infinite alternate;
}
.deck-motion-mist-2 { bottom: -25%; animation-duration: 33s; animation-delay: -12s; }
.deck-motion-layer[data-mood="regal"] .deck-motion-mist-2 {
  background: radial-gradient(ellipse,rgba(137,34,51,.13),transparent 68%);
}
@keyframes deck-mote-rise {
  0% { opacity: 0; transform: translate3d(0,22px,0); }
  18% { opacity: .42; }
  70% { opacity: .25; }
  100% { opacity: 0; transform: translate3d(16px,-62px,0); }
}
@keyframes deck-mist-drift {
  from { transform: translate3d(-4%,0,0); opacity: .6; }
  to { transform: translate3d(4%,-5%,0); opacity: 1; }
}
/* Entry only: hidden/inert dismissal and focus return stay immediate. */
#deck-artwork-panel:not([hidden]) { animation: deck-overlay-enter 160ms ease-out; }
#deck-hero-scene #deck-artwork-panel {
  top: var(--deck-tools-bottom,64px);
  max-height: calc(100% - var(--deck-tools-bottom,64px) - 12px);
}
#deck-hero-scene #deck-hero-details { max-height: calc(100% - var(--deck-tools-bottom,64px) - 20px); }
#card-search-panel:not([hidden]) .cs-panel { animation: card-record-enter 180ms cubic-bezier(.2,.7,.2,1); }
#card-search-panel .cs-section-acc[open] > :not(summary),
#card-search-panel .cs-more[open] > :not(summary) { animation: deck-digest-enter 140ms ease-out; }
#deck-hero-details { transition-timing-function: cubic-bezier(.2,.7,.2,1); }
.deck-hero-tools .btn { transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease; }
.deck-hero-tools { align-items: flex-start; }
.deck-hero-tools .btn:active { box-shadow: 0 1px 4px #0002; }
.deck-motion-toggle { white-space: nowrap; }
.deck-motion-toggle[hidden] { display: none; }
@keyframes deck-overlay-enter { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
@keyframes card-record-enter { from { opacity: .5; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes deck-digest-enter { from { opacity: .4; } to { opacity: 1; } }
@media (max-width:640px) {
  .deck-hero-tools .deck-hero-tool-group { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; }
  .deck-hero-tools .btn { min-height: 44px; }
  #card-search-panel:not([hidden]) .cs-panel { animation-name: card-record-enter-mobile; }
  @keyframes card-record-enter-mobile { from { opacity: .6; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  .deck-motion-layer,.deck-motion-toggle { display: none !important; }
  #deck-artwork-panel:not([hidden]),#card-search-panel:not([hidden]) .cs-panel,
  #card-search-panel .cs-section-acc[open] > :not(summary),
  #card-search-panel .cs-more[open] > :not(summary) { animation: none !important; }
  #deck-hero-details,.deck-hero-tools .btn { transition: none !important; }
}
@media print { .deck-motion-layer,.deck-motion-toggle { display: none !important; } }
