/* juice changes 4, 5, 6, 8, 9, 11. Tokens only (check-css). Numbers that JS reads live in js/tuning.js (feel). */

/* 4: a purchase in a panel answers on its own card (classes re-applied after every re-render with a negative delay) */
.btn.sunk {
  animation: buySink 0.28s ease-out both;
}
@keyframes buySink {
  0%,
  40% {
    transform: translateY(var(--space-2)) scale(0.92);
    filter: brightness(0.8);
  }
  100% {
    transform: none;
    filter: none;
  }
}
.card.jb {
  animation: buyLine 0.4s ease-out both;
}
@keyframes buyLine {
  0% {
    outline: var(--stroke-3) solid var(--c-text);
    outline-offset: 0;
  }
  100% {
    outline: var(--stroke-3) solid transparent;
    outline-offset: var(--space-3);
  }
}
.pips i.pip-new,
.lvbar b.pip-new {
  animation: pipIn 0.5s var(--ease-spring) both;
}
@keyframes pipIn {
  0% {
    transform: scale(0.2);
  }
  55% {
    transform: scale(1.7);
  }
  100% {
    transform: none;
  }
}

/* 5: frenzy stamp (center of the room, under the HUD, at most 60% of its width), the total that flies home, the meter's last second */
.stamp {
  position: absolute;
  left: 50%;
  top: 30%;
  z-index: calc(var(--z-hud) - 1);
  transform: translateX(-50%);
  max-width: 60%;
  pointer-events: none;
  text-align: center;
}
.stamp b {
  display: block;
  font-size: var(--font-3xl);
  line-height: 1;
  color: var(--c-gold);
  -webkit-text-stroke: var(--outline-text) var(--c-ink);
  paint-order: stroke fill;
  white-space: nowrap;
  animation: stampIn 0.9s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
@keyframes stampIn {
  0% {
    transform: scale(2.4) rotate(-6deg);
    opacity: 0;
  }
  14% {
    transform: scale(0.9) rotate(-3deg);
    opacity: 1;
  }
  24% {
    transform: scale(1.06) rotate(-3deg);
  }
  34%,
  80% {
    transform: scale(1) rotate(-3deg);
    opacity: 1;
  }
  100% {
    transform: scale(1.12) rotate(-3deg);
    opacity: 0;
  }
}
:where([data-layout='desk'], [data-layout='tab']) .stamp b {
  font-size: calc(var(--font-3xl) * 1.6);
}
.fz-total {
  position: fixed;
  z-index: calc(var(--z-hud) - 1);
  pointer-events: none;
  transform: translate(-50%, -50%);
  will-change: transform;
}
.fz-total > div {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5) var(--space-2) var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--c-scrim-strong);
  border: var(--stroke-3) solid var(--c-gold);
  box-shadow: var(--halo-gold);
}
.fz-total b {
  font-size: var(--font-2xl);
  line-height: 1;
  color: var(--c-gold);
  -webkit-text-stroke: var(--outline-text) var(--c-ink);
  paint-order: stroke fill;
  white-space: nowrap;
}
#hype.ending::after {
  content: '';
  position: absolute;
  inset: calc(-1 * var(--space-3));
  border: var(--stroke-3) solid var(--c-gold);
  border-radius: var(--radius-pill);
  pointer-events: none;
  animation: endRing 1s linear both;
}
@keyframes endRing {
  from {
    transform: scale(1.18);
    opacity: 1;
  }
  to {
    transform: scale(1);
    opacity: 0.15;
  }
}

/* 6: target ceremony card (stamped, stars [0,2,1]); base level up in the HUD; what it unlocked */
.tcard {
  position: absolute;
  left: 50%;
  top: 18%;
  z-index: var(--z-toast);
  transform: translateX(-50%);
  width: max-content;
  max-width: 86%;
  pointer-events: auto;
}
.tc-in {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-xl);
  background: var(--g-window);
  border: var(--stroke-3) solid var(--c-gold);
  box-shadow: var(--shadow-float), var(--halo-gold);
  text-align: center;
  animation: tcIn 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
@keyframes tcIn {
  0% {
    transform: scale(1.75) rotate(-4deg);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  62% {
    transform: scale(0.94) rotate(1deg);
  }
  100% {
    transform: none;
    opacity: 1;
  }
}
.tc-title {
  font-size: var(--font-xl);
  line-height: var(--lh-tight);
  color: var(--c-gold);
  -webkit-text-stroke: var(--outline-text) var(--c-ink);
  paint-order: stroke fill;
}
.tc-name {
  font-size: var(--font-md);
  color: var(--c-text);
}
.tc-prize {
  font-size: var(--font-md);
  color: var(--c-text-2);
}
.tc-stars {
  display: flex;
  gap: var(--space-3);
}
.tc-stars .st {
  opacity: 0.18;
  filter: grayscale(1);
  transform: scale(0.7);
}
.tc-stars .st.on {
  opacity: 1;
  filter: none;
  transform: none;
  animation: starIn 0.36s var(--ease-spring) both;
}
.tc-stars .s1.on {
  animation-name: starInBig;
} /* the middle star comes last and lands biggest */
@keyframes starIn {
  0% {
    transform: scale(2.2) rotate(-20deg);
    opacity: 0;
  }
  60% {
    transform: scale(0.9);
    opacity: 1;
  }
  100% {
    transform: none;
  }
}
@keyframes starInBig {
  0% {
    transform: scale(2.8) rotate(20deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.12);
    opacity: 1;
  }
  100% {
    transform: scale(1.08);
  }
}
.tcard.out {
  opacity: 0;
  transition: opacity 0.3s;
}
.tcard.calm .tc-stars .st {
  opacity: 1;
  filter: none;
  transform: none;
}
.pill.lvup {
  animation: baseGlow 1.4s ease-out both;
}
@keyframes baseGlow {
  0%,
  40% {
    box-shadow: var(--halo-gold);
    border-color: var(--c-gold);
  }
  100% {
    box-shadow: none;
  }
}
.pill.lvup #baseBar {
  background: linear-gradient(90deg, var(--c-gold), var(--c-gold-pale));
  transition: width 0.45s var(--ease-out);
}
#baseLv.jump {
  display: inline-block;
  animation: lvJump 0.45s var(--ease-spring) both;
}
@keyframes lvJump {
  0% {
    transform: translateY(var(--space-3)) scale(0.6);
    opacity: 0;
  }
  60% {
    transform: translateY(calc(-1 * var(--space-2))) scale(1.25);
    opacity: 1;
  }
  100% {
    transform: none;
  }
}
.tab.hint-new,
.card.hint-new {
  outline: var(--stroke-3) solid var(--c-accent);
  outline-offset: var(--space-1);
  animation: hintPulse 1.2s ease-in-out 4;
}
.pill.got {
  animation: gotGem 0.3s var(--ease-spring);
}
@keyframes gotGem {
  50% {
    transform: scale(var(--juice-pop, 1.1));
  }
}

/* 8: live toast: the icon wobbles twice, a shine runs across once, a life bar empties; achievements wear gold.
   Desktop: anchored in the dark band above the room art, beside the hype meter (never over the art's monitors or the Lab plaque) */
#ticker.tk-on .tk-ico {
  animation: tkWobble 0.7s ease-in-out 0.12s both;
}
@keyframes tkWobble {
  0%,
  100% {
    transform: none;
  }
  20% {
    transform: rotate(-6deg) scale(1.08);
  }
  40% {
    transform: rotate(6deg) scale(1.08);
  }
  60% {
    transform: rotate(-6deg);
  }
  80% {
    transform: rotate(6deg);
  }
}
#ticker.tk-on::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, var(--c-shine) 50%, transparent 62%) no-repeat;
  background-size: 260% 100%;
  animation: tkShine 0.8s ease-out 0.2s both;
}
@keyframes tkShine {
  from {
    background-position: 130% 0;
  }
  to {
    background-position: -30% 0;
  }
}
#ticker.tk-on::after {
  content: '';
  position: absolute;
  left: var(--space-5);
  right: var(--space-5);
  bottom: var(--space-1);
  height: var(--stroke-3);
  border-radius: var(--radius-pill);
  background: var(--c-gold);
  transform-origin: left center;
  pointer-events: none;
  animation: tkLife var(--tk-life, 2.5s) linear both;
}
#ticker.tk-undo::after {
  display: none;
} /* Undo has its own pausable clock */
@keyframes tkLife {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}
#ticker.tk-ach {
  border-color: var(--c-gold);
  box-shadow: var(--shadow-float), var(--halo-gold);
}
#ticker.tk-ach .tk-ico {
  width: var(--ico-lg);
  height: var(--ico-lg);
}
:where([data-layout='desk']:not([data-size~='n'])) #ticker {
  top: var(--space-3);
  max-width: min(34%, 360px);
}
@media (min-aspect-ratio: 21/9) {
  :where([data-layout='desk']:not([data-size~='n'])) #ticker {
    max-width: min(46%, 640px);
  }
} /* 21:9 / 32:9: the longest notice (de, fr) stays on two lines in the dark band instead of three over the art */

/* 11: closing a window: 0.15 s exit (.open is already gone) */
#modal.closing:not(.open) {
  display: flex;
  pointer-events: none;
  animation: modalOut 0.15s ease-in both;
}
#modal.closing:not(.open) > * {
  animation: modalCardOut 0.15s ease-in both;
}
@keyframes modalOut {
  to {
    opacity: 0;
  }
}
@keyframes modalCardOut {
  to {
    transform: scale(0.92) translateY(var(--space-4));
  }
}
/* End of css/juice.css */
