/* ========================================
   UPGRADES PAGE — VIBEEE Design System
   ======================================== */

/* Page Base */
.upgrades-body {
  color: var(--text-primary);
  font-family: var(--font-family);
}

/* ── Layout ── */
.page.upgrade {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.page__body {
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  background: #0f111761;
  /* border: 1px solid var(--border-subtle); */
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Header ── */
.page.upgrade .case-page-header {
  margin-bottom: 0;
  min-height: auto;
  overflow: hidden;
}

.page.upgrade .case-title-large {
  /* font-size: clamp(48px, 8vw, 100px); */
  -webkit-background-clip: text;
  background-clip: text;
}

/* ============================================
   MAIN UPGRADE AREA (selected items + wheel)
   ============================================ */
.upgrade__main {
  width: 100%;
  margin-bottom: var(--space-4);
}

.upgrade__wrapp {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 2vw, 2rem);
}

@media (max-width: 1000px) {
  .upgrade__wrapp {
    flex-wrap: wrap;
  }
}

@media (min-width: 1001px) {
  .upgrade__wrapp {
    justify-content: space-between;
  }
}

/* ── Item Slots (Left / Right) ── */
.upgrade__item {
  position: relative;
  width: min(300px, 100%);
  aspect-ratio: 1 / 0.95;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (min-width: 1001px) {
  .upgrade__item {
    width: clamp(260px, 24vw, 320px);
  }
}

.upgrade__item-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.35));
  opacity: 0.85;
}

.upgrade__item-bg--reverse {
  transform: scaleX(-1);
}

/* Skin display inside the slot */
.upgrade__item-skin {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 1.5vw, 1.5rem);
  z-index: 2;
  user-select: none;
}


.upgrade__item-skin .item__center {
  height: 55%;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upgrade__item-skin .item__image {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
  z-index: 2;
  position: relative;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

.upgrade__item-skin .item__rarity-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 14rem;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.25;
  z-index: 1;
}

.upgrade__item-skin .item__bottom {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  text-align: center;
  padding-top: var(--space-2);
}

.upgrade__item-skin .item__bottom .item__price.sum {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  margin-top: 4px;
}

.upgrade__item-skin .item__model {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.upgrade__item-skin .item__name {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Remove button on selected items — правый верхний угол, всегда виден */
.upgrade__item-skin .upgrade__item-remove {
  position: absolute;
  top: clamp(8px, 2vw, 16px);
  right: clamp(8px, 2vw, 16px);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  color: #fff;
}

.upgrade__item-skin .upgrade__item-remove svg {
  width: 14px;
  height: 14px;
}

.upgrade__item-skin .upgrade__item-remove:hover {
  background: rgba(239, 68, 68, 0.8);
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.08);
}

/* Empty state overlay */
.upgrade__item-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.upgrade__item-overlay .empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-tertiary);
}

.upgrade__item-overlay .empty .icon {
  width: 44px;
  height: 44px;
  opacity: 0.4;
}

.upgrade__item-overlay .empty span {
  font-size: var(--font-size-sm);
  color: var(--text-quaternary);
}

#inventory-empty-state,
#upgrade-empty-state {
  display: flex;
}

/* Icon masks */
.icon {
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  background-color: currentColor;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.icon-coin {
  color: #fbd506;
  mask-image: url('/assets/img/up/coin.svg');
}

.icon-skins {
  color: rgba(255, 255, 255, 0.75);
  mask-image: url('/assets/img/up/skins.svg');
}

/* Sum badge */
.sum {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: 0.85rem;
}

/* =====================
   CENTER WHEEL SECTION
   ===================== */
.upgrade__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  width: min(340px, 100%);
  flex-shrink: 1;
}

@media (max-width: 1000px) {
  .upgrade__center {
    order: -1;
    width: 100%;
  }
}

.upgrade__center-wrapp {
  position: relative;
  width: min(340px, 75vw);
  max-width: 340px;
}

.upgrade__center-wrapp::before {
  content: '';
  display: block;
  padding-top: 100%;
}

.upgrade__center-content,
.upgrade__center-progress {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.upgrade__center-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.3;
  pointer-events: none;
  transform-origin: center;
}

.upgrade__sphere {
  opacity: 0.65;
  animation: progressUpgrade 6s linear infinite;
}

@keyframes progressUpgrade {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.upgrade__center-coin {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.upgrade__center-coin-icon {
  width: 72px;
  height: 72px;
  opacity: 0.65;
  filter: drop-shadow(0 4px 8px rgba(251, 213, 6, 0.3));
  animation: float-coin 3s ease-in-out infinite;
}

@keyframes float-coin {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

.upgrade__center-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.upgrade__center-chances {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #390118 0%, #f44590 33%, #960643 66%, #d8085e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}

#wheelCanvas {
  position: relative;
  width: 80%;
  height: 80%;
  z-index: 3;
  display: block;
  background: transparent;
}

.upgrade__wheel-progress {
  display: none; /* rendered on canvas */
}

.upgrade__wheel-text {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  text-align: center;
  transition: color 0.3s;
}

.upgrade__wheel-text.wheel_empty {
  color: rgba(255, 255, 255, 0.45);
}

/* =====================
   CONTROLS (multiplier, button, fast toggle)
   ===================== */
.page__controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
  flex-wrap: wrap;
}

.page__controls-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  justify-content: flex-end;
}

@media (min-width: 851px) {
  .page__controls-left { flex: 1; }
}

.page__controls-left-desc {
  text-align: end;
  flex-direction: column;
  align-items: flex-end;
  display: none;
}

@media (min-width: 631px) {
  .page__controls-left-desc { display: flex; }
}

.page__controls-left-desc span {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.page__controls-left-desc p {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin: 0;
}

.page__controls-left-inner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border-radius: var(--radius-xl);
  height: 64px;
  padding-inline: var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.page__controls-button {
  width: 44px;
  height: 44px;
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--text-quaternary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.page__controls-button:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.page__controls-button.active {
  color: #fff;
  background: #ff005447;
  border-color: #ff005480;
  box-shadow: 0 0 15px rgba(255, 0, 84, 0.2);
}

.page__controls-button.active:hover {
  background: #ff0054;
  border-color: #ff0054;
  box-shadow: 0 0 20px rgba(255, 0, 84, 0.4);
}

/* Center button */
.page__controls-center {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 14rem;
}

@media (max-width: 850px) {
  .page__controls-center {
    order: -1;
    width: 100%;
  }
}

.page__controls-main-btn {
  width: 14rem;
  height: 64px;
  border-radius: 14px;
  background: linear-gradient(307deg, #b9134d 3.2%, #E91E63 99.71%);
  box-shadow: 0 0 20px rgba(255, 0, 84, 0.3);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  position: relative;
  overflow: hidden;
}

.page__controls-main-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(307deg, #d2285c 3.2%, #E91E63 99.71%);
  opacity: 0;
  transition: opacity 0.3s;
}

.page__controls-main-btn:hover::before {
  opacity: 1;
}

@media (min-width: 851px) {
  .page__controls-main-btn { width: 100%; }
}

.page__controls-main-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 30px rgba(255, 0, 84, 0.45);
}

.page__controls-main-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.page__controls-main-btn:disabled::before {
  display: none;
}

.page__controls-main-btn .btn__inner {
  width: 100%;
  padding: var(--space-3);
  position: relative;
  z-index: 1;
}

.page__controls-main-btn .btn__inner-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.page__controls-main-btn .btn__inner-left span {
  font-size: var(--font-size-base);
  font-weight: 700;
}

.page__controls-main-btn .btn__inner-left p {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
}

/* Right side toggle */
.page__controls-right {
  display: flex;
  justify-content: flex-start;
}

@media (min-width: 851px) {
  .page__controls-right { flex: 1; }
}

.page__controls-right-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  border-radius: var(--radius-xl);
  height: 64px;
  padding-inline: var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.page__controls-right-text {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.page__controls-right-text svg {
  width: 16px;
  height: 16px;
}

/* Checkbox toggle */
.checkbox {
  display: flex;
  align-items: center;
}

.checkbox input[type="checkbox"] {
  display: none;
}

.checkbox__button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.checkbox__button-el {
  width: 42px;
  height: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  position: relative;
  transition: all 0.2s;
}

.checkbox__button-el-inner {
  width: 18px;
  height: 18px;
  background: var(--text-quaternary);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 2px;
  transform: translateY(-50%);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.checkbox input:checked + .checkbox__button .checkbox__button-el {
  background: #ff005447;
  border-color: #ff005480;
}

.checkbox input:checked + .checkbox__button .checkbox__button-el-inner {
  left: calc(100% - 20px);
  background: #ff0054;
  box-shadow: 0 0 8px rgba(255, 0, 84, 0.4);
}

.checkbox__button-desc {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checkbox__button-desc span {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: #fff;
}

.checkbox__button-desc p {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin: 0;
}

/* ===================================
   INVENTORY / SHOP PANELS
   =================================== */
.upgrade__skins-wrapp {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-5);
  /* Remove the negative margin hack */
  width: 100%;
}

@media (max-width: 700px) {
  .upgrade__skins-wrapp {
    flex-direction: column;
  }
}

.upgrade__skins-wrapp-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.upgrade__skins-wrapp-title {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
}

/* Filter bar */
.cases__top-right {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}

.form-input {
  flex: 1;
  min-width: 120px;
}

.form-input__wrapp {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: border-color var(--transition-fast);
  height: 40px;
}

.form-input__wrapp:focus-within {
  border-color: var(--accent-primary);
}

.form-input__wrapp input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  width: 100%;
  outline: none;
}

.form-input__wrapp input::placeholder {
  color: var(--text-quaternary);
}

.form-input__icon {
  display: flex;
  align-items: center;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.form-input__icon svg {
  width: 16px;
  height: 16px;
}

.cases__prices {
  display: flex;
  gap: 2px;
  align-items: center;
  /* background: var(--bg-surface); */
  /* border: 1px solid var(--border-subtle); */
  border-radius: var(--radius-lg);
  padding: 2px;
  height: 40px;
}

.cases__prices input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: var(--font-size-xs);
  font-weight: 500;
  padding: 6px;
  width: 64px;
  text-align: center;
  outline: none;
}

.cases__prices input::-webkit-outer-spin-button,
.cases__prices input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cases__prices input[type=number] {
  -moz-appearance: textfield;
}

@media (max-width: 860px) {
  .upgrade__skins-wrapp-item .cases__prices {
    display: none;
  }
}

.upgrade__cases-price {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  border-radius: 12px;
  height: 40px;
  padding-inline: var(--space-3);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.upgrade__cases-price:hover {
  color: #ff0054;
  background: #ff005412;
  border-color: #ff005440;
}

.upgrade__cases-price svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}

/* Items grid inside panels */
.mines__inventory {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.mines__inventory-wrapp {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.mines__inventory-scroll {
  height: 100%;
  max-height: 440px;
  overflow-y: auto;
  padding: 10px;
  padding-right: calc(var(--space-2) + 5px);
  box-sizing: border-box;
}

.mines__inventory-scroll::-webkit-scrollbar {
  width: 5px;
}

.mines__inventory-scroll::-webkit-scrollbar-track {
  background: var(--bg-elevated);
  border-radius: 3px;
}

.mines__inventory-scroll::-webkit-scrollbar-thumb {
  background: var(--bg-surface);
  border-radius: 3px;
}

.mines__inventory-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--border-default);
}

/* Item grid */
.items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--space-2);
}

@media (max-width: 500px) {
  .items {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── ITEM CARD ── */
.upgrade__skins-wrapp-item .items .item {
  background: radial-gradient(65% 110% at 50% -38%, var(--rarity-color, #3e649f) 0%, color-mix(in srgb, var(--rarity-color, #3e649f) 9%, transparent) 100%),
              radial-gradient(33% 29% at 49% 37%, #000 0%, #12121e 100%),
              linear-gradient(180deg, color-mix(in srgb, var(--rarity-color, #3e649f) 80%, #000) 0%, color-mix(in srgb, var(--rarity-color, #3e649f) 62%, #000) 100%);
  border: 1px solid color-mix(in srgb, var(--rarity-color, #3e649f) 35%, transparent);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 155px;
}

.upgrade__skins-wrapp-item .items .item::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 60%;
  height: 2px;
  border-radius: 2rem;
  background: var(--rarity-color, #3e649f);
  box-shadow: 0 0 10px color-mix(in srgb, var(--rarity-color, #3e649f) 50%, transparent);
  z-index: 1;
}

.upgrade__skins-wrapp-item .items .item:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--rarity-color, #3e649f) 65%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--rarity-color, #3e649f) 25%, transparent);
}

.upgrade__skins-wrapp-item .items .item.selected {
  border-color: color-mix(in srgb, var(--rarity-color, #3e649f) 80%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--rarity-color, #3e649f) 50%, transparent),
              0 0 30px color-mix(in srgb, var(--rarity-color, #3e649f) 40%, transparent);
  transform: translateY(-3px) scale(1.02);
}

/* Price badge */
.upgrade__skins-wrapp-item .items .item .item__top {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
}

.upgrade__skins-wrapp-item .items .item .sum {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  padding: 3px 7px;
  border-radius: 5px;
}

.upgrade__skins-wrapp-item .items .item .sum img {
  width: 12px;
  height: 12px;
}

/* Item image */
.upgrade__skins-wrapp-item .items .item .item__center {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.upgrade__skins-wrapp-item .items .item .item__image {
  max-width: 88%;
  max-height: 88%;
  object-fit: contain;
}

/* Item name */
.upgrade__skins-wrapp-item .items .item .item__bottom {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 4px;
  margin-top: auto;
}

.upgrade__skins-wrapp-item .items .item .item__model {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.upgrade__skins-wrapp-item .items .item .item__name {
  font-size: 0.62rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  opacity: 0.85;
}

/* Empty state */
.withdraw__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-8);
  color: var(--text-tertiary);
  text-align: center;
}

.withdraw__empty svg {
  width: 40px;
  height: 40px;
  opacity: 0.4;
  color: var(--text-quaternary);
}

.withdraw__empty span {
  font-size: var(--font-size-sm);
  color: var(--text-quaternary);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

.pagination__button {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: var(--space-2) var(--space-3);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination__button:hover:not(:disabled) {
  color: #ff0054;
  background: #ff005412;
  border-color: #ff005440;
}

.pagination__button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination__button svg {
  width: 14px;
  height: 14px;
}

.pagination__current {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

/* ===================================
   UPGRADE RESULT OVERLAY
   =================================== */
.upgrade-result-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, background 0.4s ease, backdrop-filter 0.4s ease;
}

.upgrade-result-overlay.active {
  opacity: 1;
  pointer-events: all;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}

.upgrade-result-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  transform: scale(0.8);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.upgrade-result-overlay.active .upgrade-result-content {
  transform: scale(1);
}

/* Animated circle */
.upgrade-result-circle {
  position: relative;
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upgrade-result-circle-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid transparent;
  animation: resultRingPulse 2s ease-in-out infinite;
}

.upgrade-result-overlay.win .upgrade-result-circle-ring {
  border-color: #10b981;
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.3), inset 0 0 40px rgba(16, 185, 129, 0.08);
}

.upgrade-result-overlay.lose .upgrade-result-circle-ring {
  border-color: #ef4444;
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.3), inset 0 0 40px rgba(239, 68, 68, 0.08);
}

@keyframes resultRingPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.04); opacity: 0.85; }
}

/* Glow behind the circle */
.upgrade-result-circle-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0;
  animation: resultGlowIn 0.8s ease forwards 0.3s;
}

.upgrade-result-overlay.win .upgrade-result-circle-glow {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, transparent 70%);
}

.upgrade-result-overlay.lose .upgrade-result-circle-glow {
  background: radial-gradient(circle, rgba(239, 68, 68, 0.25) 0%, transparent 70%);
}

@keyframes resultGlowIn {
  to { opacity: 1; }
}

/* Item image inside the circle */
.upgrade-result-item-image {
  width: 160px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.5));
  z-index: 2;
  animation: resultItemFloat 2.5s ease-in-out infinite;
}

@keyframes resultItemFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* Text content */
.upgrade-result-text {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.upgrade-result-title {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.upgrade-result-overlay.win .upgrade-result-title {
  color: #10b981;
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.upgrade-result-overlay.lose .upgrade-result-title {
  color: #ef4444;
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.upgrade-result-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.upgrade-result-item-name {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-top: var(--space-1);
}

.upgrade-result-item-price {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: #fbd506;
}

.upgrade-result-item-price img {
  width: 16px;
  height: 16px;
}

/* Close button */
.upgrade-result-close {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-10);
  border-radius: 14px;
  border: none;
  color: #fff;
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.upgrade-result-overlay.win .upgrade-result-close {
  background: linear-gradient(135deg, #059669, #10b981);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.upgrade-result-overlay.lose .upgrade-result-close {
  background: linear-gradient(307deg, #b9134d 3.2%, #E91E63 99.71%);
  box-shadow: 0 0 20px rgba(255, 0, 84, 0.3);
}

.upgrade-result-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.3);
}

/* ===================================
   PARTICLES (for win celebration)
   =================================== */
.upgrade-result-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.upgrade-result-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0;
}

.upgrade-result-overlay.win .upgrade-result-particle {
  animation: particleFloat 2s ease-out forwards;
}

@keyframes particleFloat {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--px, 50px), var(--py, -100px)) scale(0);
    opacity: 0;
  }
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 1000px) {
  .upgrade__wrapp {
    flex-direction: column;
    align-items: center;
  }

  .upgrade__item {
    width: 100%;
    max-width: 280px;
  }

  .upgrade__center {
    order: -1;
    margin-top: 0;
  }
}

@media (max-width: 850px) {
  .page__controls {
    flex-direction: column;
  }

  .page__controls-center {
    order: -1;
    width: 100%;
  }
}
