html {
  scrollbar-gutter: stable;
}

body.modal-open {
  overflow: hidden;
}

.platform-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 90ms linear, visibility 0s linear 90ms;
}

.platform-modal.is-open {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.platform-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 2, 7, 0.92);
}

.platform-modal__panel {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 56px 58px 32px;
  color: #fafafa;
  text-align: center;
  background:
    radial-gradient(circle at 78% 85%, rgba(255, 51, 187, 0.10), transparent 32%),
    #09080d;
  border: 1px solid #30293d;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.68);
  transform: translateY(6px);
  transition: transform 110ms cubic-bezier(.16, 1, .3, 1);
  contain: layout paint;
}

.platform-modal.is-open .platform-modal__panel {
  transform: translateY(0);
}

.platform-modal__close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 38px;
  height: 38px;
  color: #b0abba;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: color 150ms ease, transform 150ms ease;
}

.platform-modal__close:hover {
  color: #fff;
  transform: rotate(4deg) scale(1.08);
}

.platform-modal__step {
  margin-bottom: 8px;
  color: #b0abba;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.platform-modal__title {
  font-family: "Anton", sans-serif;
  font-size: clamp(36px, 6vw, 58px);
  line-height: 1;
  letter-spacing: -0.025em;
}

.platform-modal__description {
  max-width: 560px;
  margin: 18px auto 34px;
  color: #b0abba;
  font-size: 15px;
  line-height: 1.55;
}

.platform-modal__description strong {
  color: #fafafa;
}

.platform-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.platform-option {
  position: relative;
  display: flex;
  min-height: 250px;
  padding: 30px 22px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fafafa;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid #30293d;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.platform-option:hover {
  border-color: rgba(255, 51, 187, 0.6);
  background: rgba(255, 51, 187, 0.06);
  transform: translateY(-3px);
}

.platform-option.is-selected {
  border-color: #ff33bb;
  background: rgba(255, 51, 187, 0.10);
  box-shadow: inset 0 0 0 1px #ff33bb, 0 0 28px rgba(255, 51, 187, 0.12);
}

.platform-option:focus-visible,
.checkout-button:focus-visible,
.platform-modal__close:focus-visible,
.platform-modal__back:focus-visible {
  outline: 2px solid #00ffff;
  outline-offset: 3px;
}

.platform-option__icon {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin-bottom: 22px;
  color: #fff;
  background: #2b2a2f;
  font-family: "Anton", sans-serif;
  font-size: 29px;
  font-style: italic;
}

.platform-option__icon--xbox {
  letter-spacing: -0.08em;
}

.platform-option__name {
  font-family: "Anton", sans-serif;
  font-size: 22px;
  letter-spacing: 0.01em;
}

.platform-option__detail {
  margin-top: 5px;
  color: #b0abba;
  font-size: 14px;
}

.platform-option__check {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #09080d;
  background: #ff33bb;
  border-radius: 50%;
  font-weight: 800;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 160ms ease, transform 160ms ease;
}

.platform-option.is-selected .platform-option__check {
  opacity: 1;
  transform: scale(1);
}

.checkout-button {
  width: 100%;
  margin-top: 24px;
  padding: 19px 20px;
  color: #fff;
  background: #ff33bb;
  font-family: "Anton", sans-serif;
  font-size: 17px;
  letter-spacing: 0.10em;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(255, 51, 187, 0.20);
  transition: filter 150ms ease, transform 150ms ease, opacity 150ms ease;
}

.checkout-button:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-2px);
}

.checkout-button:disabled {
  color: #77717d;
  background: #3a1731;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.72;
}

.platform-modal__back {
  margin-top: 22px;
  color: #b0abba;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: color 150ms ease;
}

.platform-modal__back:hover {
  color: #fff;
}

@media (max-width: 640px) {
  .platform-modal {
    align-items: end;
    padding: 0;
  }

  .platform-modal__panel {
    width: 100%;
    max-height: 92vh;
    padding: 48px 18px 24px;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
  }

  .platform-modal__title {
    font-size: 38px;
  }

  .platform-modal__description {
    margin: 14px auto 24px;
    font-size: 13px;
  }

  .platform-options {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .platform-option {
    min-height: 130px;
    padding: 18px;
  }

  .platform-option__icon {
    width: 54px;
    height: 54px;
    margin-bottom: 10px;
    font-size: 21px;
  }

  .platform-option__name {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .platform-modal,
  .platform-modal__panel,
  .platform-option,
  .platform-option__check {
    transition: none;
  }
}
