/* Final wheel zone layer: visible inside the wheel and positioned at the bottom. */
.upgrade-core .wheel {
  width: 330px !important;
  height: 330px !important;
}

.upgrade-core .wheel::after {
  inset: 52px !important;
  z-index: 4 !important;
  display: block !important;
  content: '' !important;
  background: conic-gradient(
    from 0deg,
    #a339ff 0deg,
    #ffe02d 58deg,
    #edb516 116deg,
    #df4125 180deg,
    transparent 181deg 360deg
  ) !important;
  -webkit-mask: radial-gradient(farthest-side, transparent 0 78%, #000 79% 100%) !important;
  mask: radial-gradient(farthest-side, transparent 0 78%, #000 79% 100%) !important;
  transform: rotate(90deg) !important;
  transform-origin: center !important;
}

.upgrade-core .quick {
  position: relative !important;
  z-index: 14 !important;
  display: flex !important;
  width: 306px !important;
  min-height: 36px !important;
  align-items: center !important;
  gap: 4px !important;
  margin: 9px 0 0 !important;
  padding: 4px !important;
  border: 1px solid #3b3d43 !important;
  border-radius: 9px !important;
  background: #15161a !important;
  box-shadow: inset 0 1px rgba(255,255,255,.06), 0 7px 16px rgba(0,0,0,.3) !important;
}

.upgrade-core .quick button {
  height: 27px !important;
  min-width: 0 !important;
  flex: 1 1 0 !important;
  border: 1px solid transparent !important;
  border-radius: 6px !important;
  color: #e8e8eb !important;
  background: #25272c !important;
  font-size: 9px !important;
  font-weight: 800 !important;
}

.upgrade-core .quick button:hover,
.upgrade-core .quick button.active {
  border-color: #b7e842 !important;
  color: #fff !important;
  background: linear-gradient(180deg, #4b6020, #273517) !important;
  box-shadow: 0 0 10px rgba(183,232,66,.25) !important;
}

/* Water-like win zone instead of the rainbow fill. */
.upgrade-core .wheel::after {
  background:
    repeating-linear-gradient(112deg, rgba(255,255,255,.22) 0 7px, transparent 7px 18px),
    conic-gradient(from 90deg, #6ee7ff 0deg, #169ed7 90deg, #0a5e9f 180deg, transparent 181deg 360deg) !important;
  background-size: 220% 100%, 100% 100% !important;
  background-position: 0 0, 0 0 !important;
  background-blend-mode: screen !important;
  transform: translateY(170px) !important;
  animation: water-ring-flow 2.2s linear infinite !important;
}

@keyframes water-ring-flow {
  from { background-position: 0 0, 0 0; }
  to { background-position: 220% 0, 0 0; }
}

/* Restore the pointer rotation while spinning. */
.upgrade-core .pointer.rolling {
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  width: 26px !important;
  height: 28px !important;
  transform-origin: center !important;
  animation: uprust-pointer-spin 3.7s forwards !important;
}

/* Reference-style pointer: use the same slim needle artwork as the target
   wheel instead of rendering the old broad SVG triangle. */
.upgrade-core .pointer,
.upgrade-core .pointer.rolling {
  width: 56px !important;
  height: 56px !important;
  background: url('https://s3.upgrader.pro/cdn/fa/images/game/pointer.png') center / 160% 160% no-repeat !important;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.72)) drop-shadow(0 0 4px rgba(255,255,255,.48)) !important;
}

.upgrade-core .pointer path {
  display: none !important;
}

@keyframes uprust-pointer-spin {
  0% { transform: translate(-50%, -50%) rotate(180deg) translateY(-142px); }
  16% { transform: translate(-50%, -50%) rotate(var(--spin-a)) translateY(-142px); }
  58% { transform: translate(-50%, -50%) rotate(var(--spin-b)) translateY(-142px); }
  84% { transform: translate(-50%, -50%) rotate(var(--spin-c)) translateY(-142px); }
  100% { transform: translate(-50%, -50%) rotate(var(--arrow-to)) translateY(-142px); }
}

.upgrade-core .wheel-fill {
  inset: 82px !important;
  z-index: 5 !important;
}

.upgrade-core .wheel-fill::before {
  display: none !important;
  position: absolute !important;
  inset: -30px !important;
  z-index: 6 !important;
  border-radius: 50% !important;
  content: '' !important;
  background: conic-gradient(
    from 0deg,
    #a339ff 0deg,
    #ffe02d 58deg,
    #edb516 116deg,
    #df4125 180deg,
    transparent 181deg 360deg
  ) !important;
  -webkit-mask: radial-gradient(farthest-side, transparent 0 88%, #000 89% 100%) !important;
  mask: radial-gradient(farthest-side, transparent 0 88%, #000 89% 100%) !important;
  opacity: .92 !important;
  transform: rotate(90deg) !important;
  transform-origin: center !important;
}

.upgrade-core .tiny-chance-marker {
  display: none !important;
  visibility: hidden !important;
}

.upgrade-core .wheel-center {
  width: 140px !important;
  height: 140px !important;
  z-index: 8 !important;
}

.upgrade-core .tiny-chance-marker,
.upgrade-core #zone-label,
.upgrade-core .zone-label {
  display: none !important;
  visibility: hidden !important;
}

/* Reference geometry: large dark bezel, thick progress ring, compact center. */
.upgrade-core .wheel {
  width: 330px !important;
  height: 330px !important;
  overflow: visible !important;
  background: url('https://s3.upgrader.pro/cdn/fa/images/game/upgrade-circle-bg.svg') center / 100% 100% no-repeat !important;
  border: 0 !important;
  filter: none !important;
  box-shadow: none !important;
}

.upgrade-core .wheel::before {
  display: block !important;
  inset: 12px !important;
  border: 2px solid #202021 !important;
  border-radius: 50% !important;
  background: transparent !important;
  box-shadow: none !important;
}

.upgrade-core .wheel::after {
  display: block !important;
  inset: 20px !important;
  z-index: 3 !important;
  border-radius: 50% !important;
  content: '' !important;
  background: conic-gradient(
    from 180deg,
    #23d70c 0deg,
    #ebd215 calc(var(--chance) * 1.8deg * .6),
    #edb516 calc(var(--chance) * 1.8deg * .8),
    #df4125 calc(var(--chance) * 1.8deg),
    #202021 calc(var(--chance) * 1.8deg + 1deg) 360deg
  ) !important;
  -webkit-mask: radial-gradient(circle, transparent 0 101px, #000 102px 143px, transparent 144px) !important;
  mask: radial-gradient(circle, transparent 0 101px, #000 102px 143px, transparent 144px) !important;
  transform: none !important;
}

.upgrade-core .wheel-fill {
  display: block !important;
  inset: 62px !important;
  z-index: 4 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: radial-gradient(circle at 50% 22%, #3c3c3f, #19191b 72%) !important;
  box-shadow: inset 0 0 0 1px #303035, inset 0 0 24px rgba(0,0,0,.55) !important;
}

.upgrade-core .wheel-fill::before,
.upgrade-core .wheel-fill::after {
  display: none !important;
  content: none !important;
  animation: none !important;
}

.upgrade-core .wheel-center {
  width: 207px !important;
  height: 207px !important;
  z-index: 8 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  box-shadow: none !important;
}

.upgrade-core .wheel-center > .chevrons {
  display: none !important;
}

.upgrade-core .wheel-center strong {
  margin: 0 !important;
  color: transparent !important;
  background: linear-gradient(180deg, #ffe02d, #53db42) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  font-size: 36px !important;
  line-height: 1 !important;
}

.upgrade-core .wheel-center small {
  margin-top: 7px !important;
  color: transparent !important;
  background: linear-gradient(180deg, #ffe02d, #53db42) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: lowercase !important;
}

.upgrade-core .pointer {
  top: 50% !important;
  left: 50% !important;
  bottom: auto !important;
  z-index: 12 !important;
  width: 26px !important;
  height: 28px !important;
  color: #fff !important;
  filter: drop-shadow(0 2px 3px #000) !important;
  transform: translate(-50%, -50%) rotate(180deg) translateY(-140px);
}

/* Slimmer, cleaner win-zone ring. */
.upgrade-core .wheel::after {
  inset: 31px !important;
  -webkit-mask: radial-gradient(circle, transparent 0 112px, #000 113px 137px, transparent 138px) !important;
  mask: radial-gradient(circle, transparent 0 112px, #000 113px 137px, transparent 138px) !important;
}

/* Always-visible water at the bottom of the win ring. */
.upgrade-core .wheel-fill::before {
  display: block !important;
  position: absolute !important;
  inset: -30px !important;
  z-index: 6 !important;
  border: 24px solid #159ed7 !important;
  border-radius: 50% !important;
  content: '' !important;
  opacity: .95 !important;
  clip-path: inset(50% 0 0 0) !important;
  transform: translateY(170px) !important;
  animation: water-bob 1.8s ease-in-out infinite !important;
}

.upgrade-core .wheel::after {
  background: transparent !important;
  -webkit-mask: none !important;
  mask: none !important;
  transform: none !important;
  animation: none !important;
}

/* Clean final water layer: one compact animated pool at the bottom. */
.upgrade-core .wheel-fill {
  overflow: hidden !important;
}

.upgrade-core .wheel-fill::before {
  display: block !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 50% !important;
  width: 190px !important;
  height: calc(var(--chance) * 1.8px) !important;
  min-height: 0 !important;
  inset: auto auto 0 50% !important;
  z-index: 10 !important;
  border: 0 !important;
  border-radius: 22px 22px 10px 10px !important;
  content: '' !important;
  background: linear-gradient(180deg, #1daed8, #075b98) !important;
  box-shadow: 0 0 15px rgba(28,188,255,.5), inset 0 4px 8px rgba(181,244,255,.35) !important;
  clip-path: inset(0 round 22px) !important;
  transform: translateX(-50%) !important;
  animation: water-pool 1.9s ease-in-out infinite !important;
}

.upgrade-core .wheel-fill::after {
  display: block !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 50% !important;
  width: 150px !important;
  height: 4px !important;
  z-index: 11 !important;
  border-radius: 50% !important;
  content: '' !important;
  background: rgba(207,249,255,.75) !important;
  filter: blur(1px) !important;
  transform: translateX(-50%) !important;
  opacity: calc(var(--chance) * .01) !important;
  animation: water-ripple 1.25s ease-in-out infinite !important;
}

@keyframes water-pool {
  0%, 100% { transform: translateX(-50%) scaleX(.96); }
  50% { transform: translateX(-50%) scaleX(1.04); }
}

@keyframes water-ripple {
  0%, 100% { opacity: .35; transform: translateX(-50%) scaleX(.78); }
  50% { opacity: .9; transform: translateX(-50%) scaleX(1.08); }
}

/* The app writes the rotation inline; keep the rotation origin at wheel center. */
.upgrade-core .pointer {
  top: 50% !important;
  left: 50% !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) rotate(180deg) translateY(-140px);
  transform-origin: center !important;
}

@keyframes water-bob {
  0%, 100% { filter: brightness(.9) drop-shadow(0 0 5px rgba(38,190,255,.28)); }
  50% { filter: brightness(1.22) drop-shadow(0 0 12px rgba(38,190,255,.62)); }
}

/* Final wheel correction: the win zone is one percentage-driven arc. */
.upgrade-core .wheel-fill::before,
.upgrade-core .wheel-fill::after {
  display: none !important;
  content: none !important;
  animation: none !important;
}

.upgrade-core .wheel::after {
  inset: 20px !important;
  z-index: 4 !important;
  display: block !important;
  content: '' !important;
  background:
    repeating-linear-gradient(112deg, rgba(185,245,255,.2) 0 6px, transparent 6px 16px),
    conic-gradient(
      from calc(180deg - var(--half) * 1deg),
      #75eaff 0deg,
      #1aafd9 calc(var(--chance) * 1.8deg),
      #0875b4 calc(var(--chance) * 3.6deg),
      transparent calc(var(--chance) * 3.6deg + 1deg) 360deg
    ) !important;
  background-size: 220% 100%, 100% 100% !important;
  background-position: 0 0, 0 0 !important;
  background-blend-mode: screen !important;
  -webkit-mask: radial-gradient(circle, transparent 0 101px, #000 102px 143px, transparent 144px) !important;
  mask: radial-gradient(circle, transparent 0 101px, #000 102px 143px, transparent 144px) !important;
  transform: none !important;
  animation: water-arc-flow 2.4s linear infinite !important;
}

@keyframes water-arc-flow {
  from { background-position: 0 0, 0 0; }
  to { background-position: 220% 0, 0 0; }
}

/* Smooth water motion: no striped/grid texture. */
.upgrade-core .wheel::after {
  background:
    radial-gradient(ellipse at 18% 35%, rgba(210,250,255,.34), transparent 36%),
    radial-gradient(ellipse at 72% 66%, rgba(62,211,255,.3), transparent 42%),
    conic-gradient(
      from calc(180deg - var(--half) * 1deg),
      #75eaff 0deg,
      #169ed7 calc(var(--chance) * 1.8deg),
      #0875b4 calc(var(--chance) * 3.6deg),
      transparent calc(var(--chance) * 3.6deg + 1deg) 360deg
    ) !important;
  background-size: 180% 150%, 180% 150%, 100% 100% !important;
  background-position: 0 0, 100% 0, 0 0 !important;
  background-blend-mode: screen, screen, normal !important;
  animation: water-slosh 2.6s ease-in-out infinite !important;
}

@keyframes water-slosh {
  0%, 100% { background-position: 0 8%, 100% 0, 0 0; }
  50% { background-position: 100% 0, 0 12%, 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .upgrade-core .wheel::after,
  .upgrade-core .wheel-fill::before,
  .upgrade-core .wheel-fill::after {
    animation: none !important;
  }
}

/* Visible liquid wave over the bottom fill. */
.upgrade-core .wheel-fill::after {
  display: block !important;
  position: absolute !important;
  right: 4px !important;
  bottom: 4px !important;
  left: 4px !important;
  height: 24px !important;
  z-index: 12 !important;
  border-radius: 50% !important;
  content: '' !important;
  background: linear-gradient(180deg, #bff9ff, #28c8f2 45%, #087bb5) !important;
  clip-path: polygon(0 52%, 8% 30%, 17% 47%, 26% 68%, 35% 45%, 45% 20%, 55% 42%, 65% 70%, 75% 48%, 84% 26%, 93% 43%, 100% 30%, 100% 100%, 0 100%) !important;
  filter: blur(.35px) drop-shadow(0 0 7px rgba(46,205,255,.55)) !important;
  opacity: .95 !important;
  transform-origin: center bottom !important;
  animation: water-wave-bob 1.35s ease-in-out infinite !important;
}

/* Final water treatment: one slim moving stripe, no inner wave blob. */
.upgrade-core .wheel-fill::before {
  display: none !important;
  content: none !important;
  animation: none !important;
}

.upgrade-core .wheel-fill::after {
  display: none !important;
  content: none !important;
  animation: none !important;
}

@keyframes water-stripe {
  0%, 100% { transform: translateX(-18px) scaleX(.82); }
  50% { transform: translateX(18px) scaleX(1.08); }
}

@keyframes water-wave-bob {
  0%, 100% { transform: translateX(-5px) scaleX(.96) skewX(-2deg); }
  50% { transform: translateX(5px) scaleX(1.04) skewX(2deg); }
}

@media (min-width: 821px) {
  main.app > .toolbar {
    width: 374px !important;
    justify-content: center !important;
    margin: 0 auto 12px 0 !important;
    position: relative !important;
    top: 0 !important;
  }

  main.app > .toolbar .toolbar-action {
    width: auto !important;
    min-width: 0 !important;
    flex: 1 1 0 !important;
    gap: 6px !important;
    white-space: nowrap !important;
  }

  main.app > .toolbar .toolbar-action svg {
    display: block !important;
    flex: 0 0 15px !important;
    width: 15px !important;
    height: 15px !important;
    opacity: .9 !important;
  }

  .selection-panel {
    height: 420px !important;
    min-height: 420px !important;
    max-height: 420px !important;
  }

  .selection-panel .panel-items {
    min-height: 260px !important;
    max-height: 260px !important;
  }

  /* Keep both selection cards on the same top baseline. The center column is
     taller, so centering grid items makes the left and right cards drift. */
  main.app > .arena {
    align-items: start !important;
  }

  main.app > .arena > .selection-panel {
    align-self: start !important;
  }
}

/* The three desktop tracks overflow the arena by their fixed gap total.
   Match the control deck to the actual first track, not the arena's outer box. */
@media (min-width: 1151px) {
  main.app > .toolbar {
    transform: none !important;
    margin-left: 21px !important;
  }
}
