/* RELOAD23 contracts page */
.contracts-page {
  min-height: 100vh;
  padding: 120px 20px 80px;
  background: var(--bg, #0b100c);
}

.contracts-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.contracts-head {
  margin-bottom: 24px;
}

.contracts-kicker {
  margin: 0 0 8px;
  color: #7cc242;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.contracts-head h1 {
  margin: 0 0 8px;
  color: #f2f6f2;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  text-transform: uppercase;
}

.contracts-head p {
  margin: 0;
  max-width: 680px;
  color: #9aa69c;
  font-size: 14px;
  line-height: 1.6;
}

.contracts-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.contracts-card {
  border: 1px solid rgba(124, 194, 66, 0.16);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(17, 26, 19, 0.96), rgba(10, 16, 12, 0.98));
  padding: 20px;
}

.contracts-card h2 {
  margin: 0 0 10px;
  color: #eef5ef;
  font-size: 20px;
}

.contracts-lead {
  margin: 0 0 18px;
  color: #97a49a;
  font-size: 13px;
  line-height: 1.55;
}

.contract-slots {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.contract-slot {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  overflow: hidden;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: #647066;
  font: inherit;
  cursor: default;
}

.contract-slot.is-filled {
  border-style: solid;
  border-color: rgba(235, 75, 75, 0.42);
  background: rgba(235, 75, 75, 0.06);
  cursor: pointer;
}

.contract-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.contract-slot__plus {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 24px;
  line-height: 1;
}

.contract-slot__empty {
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contracts-count {
  margin: 0 0 12px;
  color: #9aa69c;
  font-size: 12px;
}

.contracts-count strong {
  color: #eef5ef;
}

.contracts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(124, 194, 66, 0.55);
  border-radius: 6px;
  background: #7cc242;
  color: #0b100c;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.contracts-btn:hover {
  filter: brightness(1.06);
}

.contracts-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.contracts-odds {
  margin: 12px 0 0;
  color: #7f8b81;
  font-size: 11px;
  line-height: 1.5;
}

.contracts-inventory {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: 62vh;
  overflow-y: auto;
  padding-right: 4px;
}

.contracts-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  color: #8b968d;
  font-size: 11px;
}

.contracts-page-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  color: #d6e0d8;
  font: inherit;
  cursor: pointer;
}

.contracts-page-btn:hover:not(:disabled) {
  border-color: rgba(124, 194, 66, 0.55);
  color: #b9ef7f;
}

.contracts-page-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.contract-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: #dfe7e1;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.contract-item:hover {
  border-color: rgba(235, 75, 75, 0.38);
}

.contract-item.is-selected {
  border-color: rgba(235, 75, 75, 0.7);
  background: rgba(235, 75, 75, 0.08);
}

.contract-item:disabled {
  opacity: 0.45;
  cursor: default;
}

.contract-item__media {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 5px;
  background: #0a120c;
}

.contract-item__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.contract-item__fallback {
  display: grid;
  place-items: center;
  height: 100%;
  color: #aeb9b0;
  font-size: 20px;
}

.contract-item__count {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #7cc242;
  color: #0b100c;
  font-size: 10px;
  font-weight: 700;
}

.contract-item strong {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  color: var(--rarity, #eb4b4b);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: normal;
}

.contract-item small {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  color: #7f8b81;
  font-size: 10px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.contracts-history {
  margin-top: 18px;
}

.contract-history-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #9aa69c;
  font-size: 12px;
}

.contract-history-row:last-child {
  border-bottom: 0;
}

.contract-history-row strong {
  color: #e6efe8;
}

.contract-history-row__muted {
  margin-left: auto;
  color: #737e76;
}

.contracts-empty,
.contracts-error {
  color: #8b968d;
  font-size: 13px;
  line-height: 1.55;
}

.contracts-guest {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  padding: 36px 24px;
}

.contracts-guest__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border: 1px solid rgba(124, 194, 66, 0.4);
  border-radius: 50%;
  color: #b9ef7f;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 30px;
  font-weight: 700;
}

.contracts-guest p {
  margin: 0 auto 18px;
  max-width: 400px;
  color: #8b968d;
  font-size: 13px;
  line-height: 1.55;
}

.contract-result {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 42%, rgba(124, 194, 66, 0.16), transparent 42%),
    rgba(2, 6, 3, 0.86);
  backdrop-filter: blur(6px);
  animation: contract-result-overlay 320ms ease-out both;
}

.contract-result[hidden] {
  display: none;
}

.contract-result__card {
  position: relative;
  isolation: isolate;
  width: min(440px, 100%);
  overflow: hidden;
  padding: 32px 28px 28px;
  border: 1px solid rgba(124, 194, 66, 0.48);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 12%, rgba(124, 194, 66, 0.13), transparent 46%),
    linear-gradient(180deg, #101a12, #090f0b);
  text-align: center;
  box-shadow:
    0 26px 90px rgba(0, 0, 0, 0.65),
    0 0 46px rgba(124, 194, 66, 0.16),
    inset 0 0 34px rgba(124, 194, 66, 0.04);
  animation: contract-result-in 620ms cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

.contract-result__card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.16) 47%, transparent 62%);
  transform: translateX(-130%);
  pointer-events: none;
  animation: contract-shine 1000ms 300ms ease-out both;
}

.contract-result__content {
  position: relative;
  z-index: 2;
}

.contract-result__rays {
  position: absolute;
  left: 50%;
  top: 40%;
  z-index: 0;
  width: 780px;
  height: 780px;
  margin: -390px 0 0 -390px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(124, 194, 66, 0.2) 0deg 7deg,
    transparent 7deg 25deg
  );
  -webkit-mask-image: radial-gradient(circle, #000 0 24%, transparent 66%);
  mask-image: radial-gradient(circle, #000 0 24%, transparent 66%);
  opacity: 0.55;
  pointer-events: none;
  animation: contract-rays-spin 16s linear infinite;
}

.contract-result__glow {
  position: absolute;
  left: 50%;
  top: 37%;
  z-index: 0;
  width: 300px;
  height: 300px;
  margin: -150px 0 0 -150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(185, 239, 127, 0.35), rgba(124, 194, 66, 0.1) 44%, transparent 68%);
  filter: blur(7px);
  pointer-events: none;
  animation: contract-glow-pulse 1700ms ease-in-out infinite alternate;
}

.contract-result__spark {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 1;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #d7ffb0;
  box-shadow: 0 0 8px #7cc242, 0 0 16px rgba(124, 194, 66, 0.7);
  opacity: 0;
  pointer-events: none;
  animation: contract-spark 1700ms var(--d) ease-out infinite;
}

.contract-result__card h2 {
  margin: 0 0 16px;
  color: #eef5ef;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 30px;
  text-transform: uppercase;
  animation: contract-reward-text 600ms 220ms ease-out both;
}

.contract-result__card img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  margin: 0 0 10px;
  filter: drop-shadow(0 16px 34px rgba(124, 194, 66, 0.3));
  animation: contract-reward-pop 900ms 180ms cubic-bezier(0.18, 1.35, 0.35, 1) both;
}

.contract-result__card strong {
  display: block;
  margin-bottom: 8px;
  color: #ff7777;
  font-size: 15px;
  animation: contract-reward-text 650ms 420ms ease-out both;
}

.contract-result__detail {
  margin: 0 0 18px;
  color: #8b968d;
  font-size: 11px;
  animation: contract-reward-text 650ms 500ms ease-out both;
}

.contract-result__content .contracts-btn {
  animation: contract-reward-text 650ms 600ms ease-out both;
}

.contract-anim {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, rgba(124, 194, 66, 0.12), rgba(4, 9, 6, 0.94) 54%, #040906 100%);
  animation: contract-anim-in 220ms ease-out both;
}

.contract-anim__stage {
  width: min(760px, 92vw);
  text-align: center;
}

.contract-anim__ring {
  width: 190px;
  height: 190px;
  margin: 0 auto 28px;
  border: 2px solid rgba(124, 194, 66, 0.55);
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(124, 194, 66, 0.28), inset 0 0 34px rgba(124, 194, 66, 0.12);
  animation: contract-ring-pulse 900ms ease-in-out infinite alternate;
}

.contract-anim__items {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 130px;
  perspective: 700px;
}

.contract-anim__item {
  width: 98px;
  height: 98px;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid rgba(235, 75, 75, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 0 18px rgba(235, 75, 75, 0.08);
  animation: contract-item-float 1200ms cubic-bezier(0.34, 1.56, 0.64, 1) infinite alternate;
  animation-delay: calc(var(--i) * 90ms);
}

.contract-anim__item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.contract-anim__item span {
  color: #ff9a9a;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 30px;
  font-weight: 700;
}

.contract-anim__text {
  margin: 22px 0 0;
  color: #b9ef7f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: contract-text-pulse 900ms ease-in-out infinite alternate;
}

.contract-anim.is-done .contract-anim__item {
  animation: contract-item-burn 520ms cubic-bezier(0.22, 0.9, 0.24, 1) both;
}

.contract-anim.is-done .contract-anim__ring {
  animation: contract-ring-flash 520ms ease-out both;
}

.contract-anim.is-done .contract-anim__text {
  animation: none;
  opacity: 0;
}

.contract-result__card {
  animation: contract-result-in 520ms cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

@keyframes contract-anim-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes contract-ring-pulse {
  from {
    transform: scale(0.92);
    opacity: 0.55;
  }
  to {
    transform: scale(1.06);
    opacity: 1;
  }
}

@keyframes contract-item-float {
  from {
    transform: translateY(12px) rotateY(-14deg) rotate(-2deg) scale(0.94);
    opacity: 0.78;
  }
  to {
    transform: translateY(-14px) rotateY(14deg) rotate(2deg) scale(1.04);
    opacity: 1;
  }
}

@keyframes contract-item-burn {
  0% {
    transform: translateY(-14px) scale(1.04) rotate(2deg);
    opacity: 1;
    filter: brightness(1);
  }
  55% {
    transform: translateY(0) scale(0.72) rotate(0deg);
    opacity: 0.8;
    filter: brightness(2.1);
  }
  100% {
    transform: translateY(0) scale(0.1) rotate(0deg);
    opacity: 0;
    filter: brightness(3);
  }
}

@keyframes contract-ring-flash {
  0% {
    transform: scale(1);
    border-color: rgba(124, 194, 66, 0.7);
    box-shadow: 0 0 30px rgba(124, 194, 66, 0.28);
  }
  45% {
    transform: scale(1.24);
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 80px rgba(185, 239, 127, 0.55), inset 0 0 50px rgba(185, 239, 127, 0.3);
  }
  100% {
    transform: scale(0.4);
    opacity: 0;
  }
}

@keyframes contract-text-pulse {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

@keyframes contract-result-in {
  from {
    transform: scale(0.72) translateY(18px);
    opacity: 0;
    filter: blur(5px);
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes contract-result-overlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes contract-rays-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes contract-glow-pulse {
  from {
    transform: scale(0.86);
    opacity: 0.55;
  }
  to {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes contract-spark {
  0% {
    transform: translateY(0) scale(0.4);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: translateY(-46px) scale(0.1);
    opacity: 0;
  }
}

@keyframes contract-shine {
  from { transform: translateX(-130%); }
  to { transform: translateX(130%); }
}

@keyframes contract-reward-pop {
  0% {
    transform: scale(0.28) rotate(-16deg) translateY(30px);
    opacity: 0;
    filter: blur(10px) drop-shadow(0 0 0 rgba(124, 194, 66, 0));
  }
  52% {
    transform: scale(1.12) rotate(3deg) translateY(-4px);
    opacity: 1;
    filter: blur(0) drop-shadow(0 18px 38px rgba(124, 194, 66, 0.42));
  }
  76% {
    transform: scale(0.96) rotate(-1deg) translateY(2px);
  }
  100% {
    transform: scale(1) rotate(0deg) translateY(0);
    opacity: 1;
    filter: drop-shadow(0 16px 34px rgba(124, 194, 66, 0.35));
  }
}

@keyframes contract-reward-text {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .contracts-page {
    padding-top: 100px;
  }

  .contracts-layout {
    grid-template-columns: 1fr;
  }

  .contracts-inventory {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 360px;
  }

  .contract-anim__item {
    width: 60px;
    height: 60px;
    padding: 4px;
  }

  .contract-anim__items {
    gap: 6px;
  }

  .contract-anim__ring {
    width: 140px;
    height: 140px;
    margin-bottom: 20px;
  }
}
