/* v4 game feel: coin press/spring, crit shake, frenzy meter, crew, next-goal, gps trickle, rare ring, popup windows, settings, affordability. Motion uses transform/opacity only. */
button.coin { transition: transform .26s cubic-bezier(.3,1.9,.5,1); }
button.coin:hover { transform: scale(1.025); }
button.coin.pressed { transform: scale(.925) rotate(var(--tilt, 0deg)); transition: transform .05s ease-out; }
button.coin:not(.pressed):active { transform: scale(var(--rel, 1.04)); }

.stage__flash { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 45%, rgba(255,230,150,.55), transparent 62%); }
.stage__flash.on { animation: sflash .4s ease-out; }
@keyframes sflash { 0% { opacity: 1; } 100% { opacity: 0; } }
.stage.shake { animation: shake .3s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake { 10%, 90% { transform: translate3d(-1px,0,0); } 20%, 80% { transform: translate3d(3px,1px,0); } 30%, 50%, 70% { transform: translate3d(-5px,-1px,0); } 40%, 60% { transform: translate3d(5px,1px,0); } }
.stage.frenzy .coin-halo { animation: breathe .7s ease-in-out infinite; filter: hue-rotate(-18deg) saturate(1.6); }
.stage.frenzy button.coin { filter: drop-shadow(0 22px 26px rgba(0,0,0,.7)) drop-shadow(0 0 60px rgba(255,120,30,.8)); }

.float.crit { font-size: 40px; color: #ff4d2e; text-shadow: 0 0 16px rgba(255,80,30,.95), var(--ink); animation-duration: 1.2s; }

.combo { width: min(340px, 80%); margin: 6px auto 0; opacity: 0; transition: opacity .25s; text-align: center; }
.combo.show { opacity: 1; }
.combo__l { display: block; font: 700 12px var(--font-game); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-shadow: var(--ink); }
.combo.active .combo__l { color: #ff9a2e; }
.combo__bar { display: block; height: 10px; margin-top: 3px; border: 1px solid #000; background: rgba(0,0,0,.65); box-shadow: inset 0 0 0 1px #5a4a22; overflow: hidden; }
.combo__bar i { display: block; height: 100%; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, #b87a12, #ffd25a); will-change: transform; }
.combo.active .combo__bar i { background: linear-gradient(90deg, #ff5a1f, #ffb83a); }

/* visible workforce */
.crew { display: flex; justify-content: center; align-items: flex-end; gap: 6px; flex-wrap: wrap; min-height: 46px; margin-top: 8px; max-width: 100%; position: relative; }
.crew:empty { min-height: 0; }
.crew[data-more]:not([data-more=""])::after { content: attr(data-more); align-self: center; color: var(--muted); font-size: 13px; }
.crew__m { position: relative; width: 38px; height: 38px; animation: crewbob 2.4s ease-in-out infinite; animation-delay: var(--d, 0s); }
.crew__m img { width: 100%; height: 100%; display: block; border: 1px solid #000; box-shadow: 0 0 0 1px #6b5a2a, 0 3px 6px rgba(0,0,0,.6); }
.crew__m b { position: absolute; right: -2px; bottom: -3px; padding: 0 3px; font: 700 11px/14px var(--font-game); background: rgba(0,0,0,.85); color: #fff; border: 1px solid #5a4a22; }
.crew__m.in { animation: crewin .5s cubic-bezier(.2,1.6,.4,1), crewbob 2.4s ease-in-out .5s infinite; }
.crew__m.pop { animation: crewpop .35s cubic-bezier(.2,1.6,.4,1), crewbob 2.4s ease-in-out .35s infinite; }
@keyframes crewbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes crewin { 0% { transform: translateY(-40px) scale(.2); opacity: 0; } 100% { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes crewpop { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* next unlock tracker */
.next { list-style: none; margin: 8px auto 0; padding: 0; width: min(430px, 96%); display: grid; gap: 4px; }
.next:empty { display: none; }
.next li { display: grid; grid-template-columns: 22px minmax(0,1fr) 90px auto; align-items: center; gap: 8px; padding: 3px 8px; background: rgba(0,0,0,.55); border: 1px solid rgba(255,210,90,.18); font-size: 13px; }
.next img { border: 1px solid #000; }
.nx__t { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.nx__t small { color: var(--muted); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.nx__t b { font-weight: 400; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx__bar { height: 8px; background: #000; border: 1px solid #5a4a22; overflow: hidden; }
.nx__bar i { display: block; height: 100%; width: 100%; transform-origin: left; background: linear-gradient(90deg, #8a5a0a, #ffd25a); transition: transform .35s ease-out; }
.nx__c, .nx__d { color: var(--gold); font-size: 12px; text-align: right; }
.nx__d { grid-column: 3 / 5; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* rare spawn: silver elite frame, timer ring, nameplate */
.rare img { border: 3px solid #c9d2dc; box-shadow: 0 0 0 1px #3a4350, 0 0 22px rgba(190,215,255,.85), inset 0 0 8px rgba(255,255,255,.5); border-radius: 4px; }
.rare__ring { position: absolute; left: 50%; top: 50%; width: 118%; height: 118%; margin: -59% 0 0 -59%; transform: rotate(-90deg); pointer-events: none; }
.rare__ring circle { fill: none; stroke: #cfe3ff; stroke-width: 3; stroke-linecap: round; filter: drop-shadow(0 0 4px #9cc4ff); }
.rare__tag { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); padding: 0 8px; font: 700 11px/16px var(--font-game); letter-spacing: .12em; text-transform: uppercase; color: #dfe8f5; background: #1a2230; border: 1px solid #aab8cc; white-space: nowrap; }

/* popup windows (loot + welcome back) */
.gr-popup { position: absolute; z-index: 30; left: 50%; top: 42%; width: min(360px, 92%); transform: translate(-50%, -50%); }
.gr-popup[hidden] { display: none; }
.gr-popup.in { animation: popin .35s cubic-bezier(.2,1.5,.4,1); }
@keyframes popin { 0% { opacity: 0; transform: translate(-50%, -46%) scale(.86); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.loot-rows { list-style: none; margin: 0; padding: 14px 18px 6px; display: grid; gap: 6px; }
.loot-rows li { display: flex; align-items: center; gap: 10px; padding: 4px 6px; background: rgba(0,0,0,.4); animation: lootin .35s calc(var(--i, 0) * .12s) both ease-out; }
.loot-rows .lt { display: flex; flex-direction: column; }
.loot-rows b { font-weight: 400; }
.loot-rows .q4 b { color: #a335ee; }
.loot-rows .q5 b { color: #ff8000; }
.loot-rows small { color: var(--muted); }
@keyframes lootin { 0% { opacity: 0; transform: translateX(-16px); } 100% { opacity: 1; transform: none; } }
.loot-money { padding: 4px 20px 16px; text-align: right; }
.mail { padding: 16px 20px 18px; display: grid; gap: 12px; justify-items: center; text-align: center; }
.mail p { margin: 0; }
.mail__att { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: rgba(0,0,0,.45); border: 1px solid #5a4a22; }
.mail__gold { font: 700 26px var(--font-game); color: var(--gold); text-shadow: var(--ink); }
.mail__gold small { font-size: 14px; color: var(--muted); }

/* merchant money row pulses when you spend */
#merchant-money.spend { animation: spendtick .5s ease-out; }
@keyframes spendtick { 0% { transform: scale(1.12); opacity: .6; } 100% { transform: scale(1); opacity: 1; } }

/* settings */
.opts { display: grid; gap: 6px; margin: 10px 0; }
.opt { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.opt input { width: 16px; height: 16px; accent-color: #c8961a; }

/* affordability at a glance, plus hover and press states */
.gr-slot.cant .gr-slot__price { opacity: .75; filter: saturate(.7) brightness(.85); }
.gr-slot:not(.cant) .gr-slot__price { text-shadow: 0 0 8px rgba(255,235,160,.55); }
.gr-slot:not(.cant):hover { filter: brightness(1.12); }
.gr-slot:active:not(.cant) { transform: translateY(1px) scale(.99); }
.gr-btn:active:not(:disabled), [data-tab]:active, [data-mtab]:active { transform: translateY(1px); filter: brightness(.9); }
.tabpanel:not([hidden]) { animation: tabin .22s ease-out; }
@keyframes tabin { 0% { opacity: 0; transform: translateY(4px); } 100% { opacity: 1; transform: none; } }

html.reduce-fx .stage.shake, html.reduce-fx .stage__flash, html.reduce-fx .crew__m, html.reduce-fx .coin-halo, html.reduce-fx .tabpanel, html.reduce-fx .rare, html.reduce-fx .gr-popup.in { animation: none !important; }
html.reduce-fx button.coin { transition: none; }
@media (prefers-reduced-motion: reduce) { .stage.shake, .stage__flash, .crew__m, .tabpanel, .gr-popup.in, .loot-rows li { animation: none !important; } button.coin { transition: none; } }
@media (max-width: 760px) { .next li { grid-template-columns: 22px minmax(0,1fr) 64px auto; } .crew__m { width: 32px; height: 32px; } }

/* v5: per-source earn canvas, coin aura from talents */
#earn-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 25; }
.coin-aura { position: absolute; inset: -6%; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .8s, box-shadow .8s; box-shadow: 0 0 60px 14px var(--aura, transparent), inset 0 0 40px var(--aura, transparent); }
.coin-aura.on { opacity: var(--aura-a, .35); }
html.reduce-fx #earn-canvas { opacity: .9; }

/* v6: real WoW coin icons for every particle coin, real glow texture for the coin halo */
.fx-coin.c1 { background-image: url(../assets/fx/inv_misc_coin_01.png); }
.fx-coin.c2 { background-image: url(../assets/fx/inv_misc_coin_02.png); }
.fx-coin.c3 { background-image: url(../assets/fx/inv_misc_coin_03.png); }
.fx-coin.c4 { background-image: url(../assets/fx/inv_misc_coin_04.png); }
.fx-coin.c5 { background-image: url(../assets/fx/inv_misc_coin_05.png); }
.fx-coin.c6 { background-image: url(../assets/fx/inv_misc_coin_06.png); }
.coin-halo { background: #ffc24d; -webkit-mask: url(../assets/fx/glow.png) center / contain no-repeat; mask: url(../assets/fx/glow.png) center / contain no-repeat; }
.coin-aura { background: var(--aura, transparent); -webkit-mask: url(../assets/fx/glow.png) center / contain no-repeat; mask: url(../assets/fx/glow.png) center / contain no-repeat; box-shadow: none; }

/* v6 rare spawn: real WoW artifact item border + glow texture; the plain CSS border and drawn glow are gone */
.rare img { border: 0; box-shadow: none; border-radius: 0; }
.rare__frame { position: absolute; inset: -6px; background: url(../assets/ui/loottab-set-itemborder-artifact.png) center / 100% 100% no-repeat; pointer-events: none; z-index: 1; }
.rare__glow { position: absolute; inset: -70%; background: #d8e8ff; -webkit-mask: url(../assets/fx/glow.png) center / contain no-repeat; mask: url(../assets/fx/glow.png) center / contain no-repeat; opacity: .75; pointer-events: none; animation: breathe 2s ease-in-out infinite; }
.rare__ring circle { stroke: #ffd27a; filter: none; }
