/* —— Ekipman yükseltme FX · şans döner → sonuç —— */
.upfx {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 8, 18, 0.9);
  opacity: 0;
  transition: opacity 0.38s ease;
  pointer-events: all;
}
@supports (backdrop-filter: blur(1px)) {
  @media (pointer: fine) {
    .upfx { backdrop-filter: blur(6px); background: rgba(2, 8, 18, 0.84); }
  }
}
.upfx.is-in { opacity: 1; }
.upfx.is-out {
  opacity: 0;
  transition-duration: 0.38s;
}

.upfx-panel {
  position: relative;
  width: min(100%, 310px);
  padding: 26px 18px 22px;
  border-radius: 22px;
  text-align: center;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(80, 120, 180, 0.24), transparent 55%),
    linear-gradient(180deg, #1c2e44 0%, #0d1826 100%);
  border: 1px solid rgba(246, 196, 69, 0.32);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  transform: translateY(10px) scale(0.96);
  opacity: 0.9;
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.32s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}
.upfx.is-in .upfx-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.upfx.is-out .upfx-panel {
  transform: translateY(8px) scale(0.97);
  opacity: 0;
}
.upfx.is-ok .upfx-panel {
  border-color: rgba(61, 220, 110, 0.5);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 0 36px rgba(61, 220, 110, 0.16);
}
.upfx.is-fail .upfx-panel {
  border-color: rgba(255, 120, 100, 0.45);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 0 32px rgba(255, 80, 70, 0.14);
}

.upfx-glow {
  position: absolute;
  inset: -20% -10% auto;
  z-index: 0;
  height: 40%;
  background: radial-gradient(ellipse at center, rgba(246, 196, 69, 0.18), transparent 70%);
  pointer-events: none;
  opacity: 0.45;
  transition: opacity 0.4s ease, background 0.4s ease;
}
.upfx.is-charge .upfx-glow {
  animation: upfxGlowPulse 1.05s ease-in-out infinite;
}
.upfx-panel.rarity-rare .upfx-glow {
  background: radial-gradient(ellipse at center, rgba(246, 196, 69, 0.3), transparent 70%);
}
.upfx-panel.rarity-legendary .upfx-glow {
  background: radial-gradient(ellipse at center, rgba(224, 64, 64, 0.28), transparent 70%);
}
.upfx.is-ok .upfx-glow {
  opacity: 1;
  background: radial-gradient(ellipse at center, rgba(90, 255, 150, 0.32), rgba(246, 196, 69, 0.1), transparent 72%);
  animation: none;
}
.upfx.is-fail .upfx-glow {
  opacity: 0.95;
  background: radial-gradient(ellipse at center, rgba(255, 80, 70, 0.32), transparent 70%);
  animation: none;
}

.upfx-icon {
  position: relative;
  z-index: 3;
  isolation: isolate;
  width: 104px;
  height: 104px;
  margin: 0 auto 8px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #05080e;
  border: 2px solid #8fa0b8;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 10px 24px rgba(0, 0, 0, 0.45);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.upfx-icon.rarity-common {
  border-color: #d8dee8;
  box-shadow: 0 0 0 1px rgba(40, 48, 64, 0.45), 0 0 12px rgba(220, 228, 240, 0.28), 0 10px 24px rgba(0, 0, 0, 0.45);
}
.upfx-icon.rarity-uncommon {
  border-color: #4eb8ff;
  box-shadow: 0 0 0 1px rgba(0, 40, 80, 0.45), 0 0 14px rgba(78, 184, 255, 0.35), 0 10px 24px rgba(0, 0, 0, 0.45);
}
.upfx-icon.rarity-rare {
  border-color: #f6c445;
  box-shadow: 0 0 0 1px rgba(80, 50, 0, 0.55), 0 0 16px rgba(246, 196, 69, 0.48), 0 10px 24px rgba(0, 0, 0, 0.45);
}
.upfx-icon.rarity-legendary {
  border-color: #e04040;
  box-shadow: 0 0 0 1px rgba(60, 10, 10, 0.55), 0 0 16px rgba(220, 48, 48, 0.48), 0 10px 24px rgba(0, 0, 0, 0.45);
}
.upfx.is-charge .upfx-icon {
  animation: upfxPulse 0.85s ease-in-out infinite;
}
.upfx.is-ok .upfx-icon {
  transform: scale(1.05);
  animation: none;
}
.upfx.is-fail .upfx-icon {
  animation: none;
}
.upfx-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upfx-name {
  position: relative;
  z-index: 2;
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 800;
  color: rgba(247, 241, 228, 0.78);
  letter-spacing: 0.02em;
}
.upfx-rar {
  position: relative;
  z-index: 2;
  display: inline-block;
  margin: 0 0 12px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.upfx-rar.rarity-common {
  color: #d8dee8;
  border-color: rgba(216, 222, 232, 0.35);
  background: rgba(216, 222, 232, 0.08);
}
.upfx-rar.rarity-uncommon {
  color: #7fd0ff;
  border-color: rgba(78, 184, 255, 0.4);
  background: rgba(78, 184, 255, 0.1);
}
.upfx-rar.rarity-rare {
  color: #ffe08a;
  border-color: rgba(246, 196, 69, 0.5);
  background: rgba(246, 196, 69, 0.12);
}
.upfx-rar.rarity-legendary {
  color: #ff8a8a;
  border-color: rgba(224, 64, 64, 0.5);
  background: rgba(224, 64, 64, 0.12);
}

.upfx-lv {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  font-weight: 900;
}
.upfx-from,
.upfx-to {
  min-width: 72px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 18px;
  letter-spacing: 0.02em;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f7f1e4;
  transition: background 0.35s ease, color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, opacity 0.35s ease, transform 0.35s ease;
}
.upfx-to {
  position: relative;
}
.upfx-to b {
  display: block;
  font-weight: 900;
}
.upfx.is-charge .upfx-to-n { display: none; }
.upfx.is-ok .upfx-to-q,
.upfx.is-fail .upfx-to-q { display: none; }
.upfx.is-charge .upfx-to {
  color: #ffe08a;
  border-style: dashed;
  border-color: rgba(246, 196, 69, 0.7);
  animation: upfxBlink 0.7s steps(1) infinite;
}
.upfx-arrow {
  font-size: 20px;
  color: rgba(246, 196, 69, 0.9);
  transition: color 0.3s ease;
}
.upfx.is-ok .upfx-from {
  opacity: 0.45;
  transform: scale(0.94);
}
.upfx.is-ok .upfx-to {
  color: #0b2a16;
  background: linear-gradient(180deg, #9dffc0, #3ddc6e);
  border-color: rgba(255, 255, 255, 0.35);
  border-style: solid;
  box-shadow: 0 0 16px rgba(61, 220, 110, 0.45);
  opacity: 1;
  transform: scale(1.05);
  animation: none;
}
.upfx.is-ok .upfx-arrow { color: #3ddc6e; }
.upfx.is-fail .upfx-to {
  color: #ffb0a4;
  border-color: rgba(255, 120, 100, 0.5);
  border-style: solid;
  background: rgba(255, 70, 60, 0.14);
  text-decoration: line-through;
  opacity: 0.78;
  animation: none;
}
.upfx.is-fail .upfx-from {
  border-color: rgba(246, 196, 69, 0.55);
  box-shadow: 0 0 10px rgba(246, 196, 69, 0.22);
}
.upfx.is-fail .upfx-arrow { color: #ff7a6a; }

/* —— Şans şeridi —— */
.upfx-reel {
  position: relative;
  z-index: 2;
  height: 32px;
  width: 168px;
  margin: 0 auto 12px;
  overflow: hidden;
  border-radius: 10px;
  background: #03050a;
  border: 1px solid rgba(246, 196, 69, 0.5);
  box-shadow:
    inset 0 0 12px rgba(0, 0, 0, 0.7),
    0 0 12px rgba(246, 196, 69, 0.12);
}
.upfx-reel-mask {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(3, 5, 10, 0.92) 0%,
    transparent 28%,
    transparent 72%,
    rgba(3, 5, 10, 0.92) 100%
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.upfx-reel-track {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  will-change: transform;
}
.upfx-reel b {
  flex: 0 0 32px;
  height: 32px;
  line-height: 32px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-align: center;
}
.upfx-reel b.is-go { color: #8dffb0; text-shadow: 0 0 8px rgba(61, 220, 110, 0.35); }
.upfx-reel b.is-stay { color: #ff9a8c; text-shadow: 0 0 8px rgba(255, 80, 70, 0.28); }
.upfx.is-ok .upfx-reel {
  border-color: rgba(61, 220, 110, 0.65);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.7), 0 0 14px rgba(61, 220, 110, 0.22);
}
.upfx.is-fail .upfx-reel {
  border-color: rgba(255, 120, 100, 0.6);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.7), 0 0 14px rgba(255, 80, 70, 0.2);
}

.upfx-meter {
  position: relative;
  z-index: 2;
  height: 7px;
  margin: 0 auto 14px;
  width: 82%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.upfx-meter i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5ec8ff, #f6c445, #ffe56a);
  box-shadow: 0 0 10px rgba(246, 196, 69, 0.45);
}
.upfx.is-ok .upfx-meter i {
  width: 100%;
  background: linear-gradient(90deg, #3ddc6e, #9dffc0);
}
.upfx.is-fail .upfx-meter i {
  width: 100%;
  background: linear-gradient(90deg, #ff5a4a, #ff9a6a);
}

.upfx-title {
  position: relative;
  z-index: 2;
  display: block;
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #f7f1e4;
  text-transform: uppercase;
  transition: color 0.3s ease, text-shadow 0.3s ease, font-size 0.3s ease;
}
.upfx.is-charge .upfx-title {
  font-size: 14px;
  letter-spacing: 0.14em;
  color: rgba(247, 241, 228, 0.8);
}
.upfx.is-ok .upfx-title {
  color: #8dffb0;
  text-shadow: 0 0 16px rgba(61, 220, 110, 0.45);
}
.upfx.is-fail .upfx-title {
  color: #ff9a8c;
  text-shadow: 0 0 14px rgba(255, 80, 70, 0.35);
}

.upfx-sub {
  position: relative;
  z-index: 2;
  display: block;
  font-style: normal;
  font-size: 13px;
  font-weight: 800;
  color: rgba(247, 241, 228, 0.62);
}
.upfx-gain {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 10px auto 0;
  padding: 7px 10px;
  width: fit-content;
  max-width: 100%;
  border-radius: 10px;
  background: rgba(61, 220, 110, 0.1);
  border: 1px solid rgba(61, 220, 110, 0.35);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.upfx-gain[hidden] { display: none; }
.upfx-gain span {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(180, 255, 205, 0.75);
}
.upfx-gain b {
  font-size: 14px;
  color: rgba(247, 241, 228, 0.55);
}
.upfx-gain i {
  font-style: normal;
  color: #7dffb0;
}
.upfx-gain em {
  font-style: normal;
  font-size: 16px;
  color: #eafff2;
}
.upfx-gain strong {
  margin-left: 2px;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 12px;
  color: #0b2a16;
  background: linear-gradient(180deg, #b6ffd0, #3ddc6e);
}

.upfx-sparks {
  position: absolute;
  left: 50%;
  top: 78px;
  z-index: 1;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
}
.upfx.is-charge .upfx-sparks { display: none; }
.upfx.is-ok .upfx-sparks { opacity: 1; }
.upfx-spark {
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffe56a;
  box-shadow: 0 0 6px #f6c445;
  opacity: 0;
  transform: rotate(var(--a)) translateY(0) scale(0.4);
}
.upfx.is-ok .upfx-spark {
  animation: upfxSpark var(--d, 0.85s) ease-out both;
}
.upfx.is-ok .upfx-spark:nth-child(odd) { background: #8dffb0; box-shadow: 0 0 6px #3ddc6e; }
.upfx.is-ok .upfx-spark:nth-child(3n) { background: #fff; width: 4px; height: 4px; }

@keyframes upfxSpin {
  to { transform: rotate(360deg); }
}
@keyframes upfxBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.28; }
}
@keyframes upfxPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@keyframes upfxGlowPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.85; }
}
@keyframes upfxSpark {
  0% {
    opacity: 0.9;
    transform: rotate(var(--a)) translateY(0) scale(0.45);
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(-68px) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .upfx.is-charge .upfx-rings b,
  .upfx.is-charge .upfx-icon,
  .upfx.is-charge .upfx-to,
  .upfx.is-charge .upfx-glow,
  .upfx.is-ok .upfx-spark {
    animation: none !important;
  }
  .upfx.is-in .upfx-panel { transform: none; opacity: 1; }
}
