/* Experimental Castle Duels scene. The original is preserved at tag workshop-v1. */
.castle-workshop .workshop-art {
  background-image: url('assets/castle-workshop/background.webp');
}

.conveyor-character {
  position: absolute;
  left: 2%;
  top: 42.2%;
  width: 14%;
  aspect-ratio: 1;
}
.conveyor-orange { transform: translate(17%, -11%); }
.conveyor-blue { transform: translate(100%, -28%); }
.conveyor-bear { transform: translate(183%, -38%); }
.character-figure {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 84%;
  animation: mage-idle 4.2s ease-in-out infinite;
}
.conveyor-blue .character-figure { animation: mage-hop 7s ease-in-out infinite; animation-delay: -3s; }
.conveyor-bear .character-figure { animation: bear-idle 6.5s ease-in-out infinite; }
.conveyor-blue .character-shadow { animation: hop-shadow 7s ease-in-out infinite; animation-delay: -3s; }
.character-shadow {
  position: absolute;
  bottom: 14%;
  left: 24%;
  width: 52%;
  height: 6%;
  border-radius: 50%;
  background: #13232180;
  filter: blur(4px);
}
.spell-orb {
  position: absolute;
  right: -10%;
  top: -3%;
  width: 49%;
  animation: spell-drift 4.2s ease-in-out infinite;
}
.spell-warm > img { filter: hue-rotate(-145deg) saturate(1.2); }
.spell-orb > img { display: block; width: 100%; height: auto; }
.conveyor-blue .spell-orb { animation-delay: -1.9s; }

.chamber-light { position: absolute; inset: 0; pointer-events: none; }
.chamber-light-ring {
  position: absolute; border: 2px solid #dcfff6; border-radius: 50%;
  box-shadow: 0 0 7px 2px #b1ffef, 0 0 16px 4px #35ffcc, inset 0 0 8px 1px #66ffe0;
  mix-blend-mode: screen; opacity: .2;
  animation: chamber-light-pulse 9s ease-in-out infinite;
}
.ring-upper { left: 49.1%; top: 19.1%; width: 14.3%; height: 4.5%; }
.ring-lower { left: 51.5%; top: 24.9%; width: 10.3%; height: 3.2%; animation-delay: -1.3s; }
.ring-base { left: 53%; top: 29.5%; width: 7%; height: 2%; animation-delay: -2.6s; }
.chamber-light-wash {
  position: absolute; left: 49%; top: 17%; width: 15%; height: 18%;
  background: radial-gradient(ellipse, #b0ffe980, #54ffe540 40%, transparent 72%);
  mix-blend-mode: screen; opacity: .2;
  animation: chamber-light-pulse 9s ease-in-out infinite;
  animation-delay: -1.8s;
}
@keyframes chamber-light-pulse {
  0%, 100% { opacity: .12; }
  50% { opacity: .65; }
}
.chamber-content {
  position: absolute;
  left: 48%;
  top: 8.8%;
  width: 16.5%;
  height: 17.7%;
  overflow: hidden;
  border-radius: 13% 13% 24% 24%;
  isolation: isolate;
}
.chamber-content img { position: absolute; object-fit: contain; animation: chamber-float 5.5s ease-in-out infinite; animation-delay: var(--float-delay, 0s); }
.chamber-rider, .chamber-mage-upgraded, .chamber-summon { z-index: 1; }
.chamber-rider { right: 0; bottom: 1%; width: 56%; filter: saturate(.9) brightness(.96); }
.chamber-content .chamber-mage-upgraded { left: 4%; top: 12%; width: 43%; animation-name: chamber-mage-float; animation-duration: 6.2s; --float-delay: -2s; filter: saturate(.9) brightness(.96); }
.chamber-summon {
  position: absolute; left: 13%; bottom: 12%; width: 27%; aspect-ratio: 3.1;
  overflow: hidden; border: 2px solid #914327; border-radius: 9px;
  box-shadow: 0 3px 0 #65351c, 0 5px 8px #28cfcc25;
  transform: rotate(8deg); background: #ffc525;
  animation: chamber-button-float 5.4s ease-in-out infinite;
  animation-delay: -1.3s;
}
.chamber-summon img { position: static; display: block; width: 100%; height: 100%; object-fit: fill; animation: none; }
.chamber-vortex { position: absolute; z-index: 0; left: 38%; top: 22%; width: 27%; aspect-ratio: 1; animation: spell-drift 4.8s ease-in-out infinite; animation-delay: -2s; }
.chamber-vortex img { inset: 0; width: 100%; animation: none; }
.vortex-ring { position: absolute; inset: 22% 4%; border: 1px solid #a9faffaa; border-radius: 50%; box-shadow: 0 0 6px #4defff80; transform: rotate(-28deg); }
.vortex-ring-gold { inset: 6% 25%; border-color: #ffde8799; box-shadow: 0 0 5px #ffd57460; transform: rotate(32deg); }
.chamber-content::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, #c9faff22, transparent 18%, #a3f4ef0a 55%, #dafaff26 91%, transparent);
  border-radius: inherit;
  z-index: 3;
}

@keyframes mage-idle {
  0%, 100% { transform: rotate(-2deg); }
  40% { transform: rotate(2.5deg) scaleY(1.02); }
  70% { transform: rotate(-.5deg); }
}
@keyframes mage-hop {
  0%, 55%, 83%, 100% { transform: translateY(0) scale(1); }
  60% { transform: scale(1.04, .94); }
  67% { transform: translateY(-7%) rotate(-3deg) scale(.98, 1.02); }
  74% { transform: scale(1.04, .95); }
  79% { transform: translateY(-1%); }
}
@keyframes hop-shadow {
  0%, 55%, 83%, 100% { transform: scaleX(1); opacity: .85; }
  67% { transform: scaleX(.7); opacity: .45; }
  74% { transform: scaleX(1.07); opacity: .9; }
}
@keyframes bear-idle {
  0%, 38%, 75%, 100% { transform: rotate(0) scale(1); }
  48% { transform: rotate(-2deg) scale(1.015, .98); }
  58% { transform: rotate(1.5deg) scale(.99, 1.025); }
  67% { transform: rotate(-.7deg); }
}
@keyframes spell-drift {
  0%, 100% { transform: translate(-4%, 4%) scale(.85) rotate(-8deg); }
  25% { transform: translate(7%, -9%) scale(1.06) rotate(7deg); }
  60% { transform: translate(-6%, -15%) scale(.95) rotate(-5deg); }
  82% { transform: translate(-10%, -3%) scale(.8) rotate(10deg); }
}
@keyframes chamber-float {
  0%, 100% { transform: translate(0, 1%) rotate(-1deg); }
  30% { transform: translate(-1.5%, -2%) rotate(1.5deg); }
  65% { transform: translate(1%, -1%) rotate(-.5deg); }
  82% { transform: translate(.5%, 1.5%) rotate(.5deg); }
}
@keyframes chamber-mage-float {
  0%, 100% { transform: translate(-1%, 1%) rotate(-2deg); }
  28% { transform: translate(2%, -4%) rotate(2.5deg); }
  55% { transform: translate(0, -2%) rotate(-1deg); }
  78% { transform: translate(-2%, 2%) rotate(1deg); }
}
@keyframes chamber-button-float {
  0%, 100% { transform: translate(0, 2%) rotate(8deg); }
  35% { transform: translate(2%, -12%) rotate(5deg); }
  70% { transform: translate(-1%, -4%) rotate(10deg); }
}
/* Draw the native star texture only during short SparkBurstFX bursts. */
.spell-fx { position: absolute; inset: 0; pointer-events: none; }
.spell-fx canvas { position: absolute; width: 240%; height: 240%; left: -70%; top: -70%; }
.ambience-paused .workshop-art *,
.workshop-offscreen .workshop-art *,
.workshop-hidden .workshop-art * { animation-play-state: paused; }

@media(prefers-reduced-motion:reduce) {
  .spell-fx { display: none; }
}
