/* Independent excitement layer: aura, pops and results drama. Never covers lanes. */
#game { transition: box-shadow .45s ease; }
#game[data-juice="1"] { box-shadow: inset 0 0 34px color-mix(in srgb, var(--gold) 22%, transparent); }
#game[data-juice="2"] { box-shadow: inset 0 0 46px color-mix(in srgb, var(--gold) 34%, transparent); }
#game[data-juice="3"] { box-shadow: inset 0 0 60px color-mix(in srgb, var(--gold) 46%, transparent); }
#game[data-juice="4"] { box-shadow: inset 0 0 78px color-mix(in srgb, var(--gold) 60%, transparent); }
#game[data-fever="1"] { animation: juice-fever-aura 1.1s ease-in-out infinite; }
@keyframes juice-fever-aura {
  0%, 100% { box-shadow: inset 0 0 60px color-mix(in srgb, var(--blood-hot) 42%, transparent); }
  50% { box-shadow: inset 0 0 90px color-mix(in srgb, var(--gold) 62%, transparent); }
}
/* Hold notes pump the market: soft green pulse while a hold is ringing. */
#game[data-hold="1"] { animation: juice-hold-pump .9s ease-in-out infinite; }
@keyframes juice-hold-pump {
  0%, 100% { box-shadow: inset 0 0 40px color-mix(in srgb, var(--honest) 26%, transparent); }
  50% { box-shadow: inset 0 0 70px color-mix(in srgb, var(--honest) 44%, transparent); }
}
/* Power-up grab: a quick bright gold ring flash. */
#game.juice-power { animation: juice-power-flash .5s ease-out; }
@keyframes juice-power-flash {
  0% { box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--gold) 85%, transparent), inset 0 0 90px color-mix(in srgb, var(--gold) 50%, transparent); }
  100% { box-shadow: inset 0 0 0 0 transparent, inset 0 0 0 transparent; }
}
/* Streak counter and market-cap number pop on every hit. */
#gStreak.juice-pop { animation: juice-pop .22s cubic-bezier(.2, 1.6, .4, 1); }
#gScore.juice-pop { animation: juice-pop .18s cubic-bezier(.2, 1.6, .4, 1); }
#gScore.juice-up { animation: juice-flash-up .4s ease; }
#gScore.juice-down { animation: juice-flash-down .4s ease; }
@keyframes juice-pop { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }
@keyframes juice-flash-up { 0%, 60% { color: var(--honest); } 100% { color: inherit; } }
@keyframes juice-flash-down { 0%, 60% { color: var(--blood-hot); } 100% { color: inherit; } }
/* Results screen: the card slams in, the grade stamps, confetti on a new best. */
#gOver:not([hidden]) .gcard { animation: juice-slam .5s cubic-bezier(.2, 1.4, .3, 1) both; }
#gOver:not([hidden]) .grade { animation: juice-stamp .55s .25s cubic-bezier(.2, 1.8, .3, 1) both; }
#gOver:not([hidden]) .newbest:not([hidden]) { animation: juice-best-glow 1.2s ease-in-out infinite; }
@keyframes juice-slam { from { opacity: 0; transform: translateY(46px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes juice-stamp { from { opacity: 0; transform: scale(2.6) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes juice-best-glow {
  0%, 100% { text-shadow: 0 0 6px color-mix(in srgb, var(--gold) 70%, transparent); }
  50% { text-shadow: 0 0 22px var(--gold), 0 0 44px color-mix(in srgb, var(--gold) 60%, transparent); }
}
.juice-confetti {
  position: absolute; top: -14px; left: var(--x); width: 9px; height: 14px;
  background: var(--c); border-radius: 2px; pointer-events: none; z-index: 5;
  animation: juice-confetti-fall var(--t) cubic-bezier(.3, .4, .6, 1) var(--d) both;
}
@keyframes juice-confetti-fall {
  from { transform: translateY(0) rotate(0); opacity: 1; }
  to { transform: translateY(560px) rotate(var(--r)); opacity: 0; }
}
/* The "one more run" nudge under the results. */
#oNudge { margin: 6px 0 0; font: 700 14px var(--f-body); color: var(--gold); letter-spacing: 0; animation: juice-nudge 1.6s ease-in-out infinite; }
#oNudge:empty { display: none; }
#game .gstreak { display: block; max-width: 200px; white-space: normal; letter-spacing: 0; font-size: 10px; min-height: 24px; line-height: 12px; }
#game .powers { max-width: 260px; max-height: 30px; overflow: hidden; flex-wrap: nowrap; }
#game .chip { flex-shrink: 0; }
#game[data-overdrive="1"] .gscore > b { color: var(--volt); }
#game[data-overdrive="1"] #gMult { color: var(--volt); text-shadow: 0 0 12px var(--volt); }
#game[data-rocket="1"] #gMult { color: var(--gold); }
#game[data-overdrive="1"]:not(.og-on) { animation: juice-dex-aura .8s ease-in-out infinite; }
#game.juice-jackpot:not(.og-on) { animation: juice-jackpot .65s ease-out; }
#gMult.juice-pop { animation: juice-pop .35s ease-out; }
@keyframes juice-dex-aura {
  0%,100% { box-shadow: inset 0 0 32px color-mix(in srgb, var(--volt) 35%, transparent); }
  50% { box-shadow: inset 0 0 56px color-mix(in srgb, var(--honest) 45%, transparent); }
}
@keyframes juice-jackpot {
  0% { box-shadow: inset 0 0 0 5px var(--gold), inset 0 0 70px color-mix(in srgb, var(--gold) 50%, transparent); }
  50% { box-shadow: inset 0 0 0 2px var(--volt), inset 0 0 35px color-mix(in srgb, var(--volt) 35%, transparent); }
  100% { box-shadow: inset 0 0 0 0 transparent; }
}
@keyframes juice-nudge { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
/* Super celebrations stay in the perimeter and reserved HUD, never over notes. */
#game[data-super="1"]:not(.og-on) { animation: juice-super-aura .7s ease-in-out infinite; }
#game[data-super="1"] #gStreak { color: var(--gold); text-shadow: 0 0 10px var(--gold); }
#game[data-super="1"] #gMult { color: var(--honest); text-shadow: 0 0 14px var(--honest); }
#game[data-super="1"] .multbar i { background: var(--gold); box-shadow: 0 0 14px var(--gold); }
#game.juice-super-launch:not(.og-on) { animation: juice-super-launch 1.2s ease-out; }
@keyframes juice-super-aura {
  0%,100% { box-shadow: inset 0 0 0 3px var(--gold), inset 0 0 35px color-mix(in srgb, var(--gold) 38%, transparent); }
  50% { box-shadow: inset 0 0 0 3px var(--honest), inset 0 0 55px color-mix(in srgb, var(--honest) 40%, transparent); }
}
@keyframes juice-super-launch {
  0%,40%,80% { box-shadow: inset 0 0 0 6px var(--gold), inset 0 0 65px color-mix(in srgb, var(--gold) 45%, transparent); }
  20%,60%,100% { box-shadow: inset 0 0 0 3px var(--honest), inset 0 0 30px color-mix(in srgb, var(--honest) 30%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  #game[data-fever="1"], #game[data-hold="1"], #game.juice-power, #gStreak.juice-pop, #gScore.juice-pop, #gScore.juice-up, #gScore.juice-down,
  #gOver:not([hidden]) .gcard, #gOver:not([hidden]) .grade, #gOver:not([hidden]) .newbest:not([hidden]),
  .juice-confetti, #oNudge { animation: none; }
  #game[data-overdrive="1"]:not(.og-on), #game.juice-jackpot:not(.og-on), #gMult.juice-pop { animation: none; }
  #game[data-super="1"]:not(.og-on), #game.juice-super-launch:not(.og-on) { animation: none; }
}
