.download-page {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 36rem;
  flex: 1 0 auto;
  padding: clamp(3rem, 6vw, 5rem) 1rem;
  overflow: hidden;
  isolation: isolate;
  text-align: center;
}

.download-page__container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
}

.download-page__back-row {
  display: flex;
  margin-bottom: 1rem;
}

.download-page__back {
  display: inline-flex;
  min-width: 0;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--apkdone-border);
  border-radius: 999px;
  color: var(--apkdone-ink) !important;
  background: var(--apkdone-surface);
  box-shadow: 0 0.25rem 0.875rem rgba(18, 20, 22, 0.06);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-decoration: none !important;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.download-page__back svg {
  flex: 0 0 1.25rem;
}

.download-page__back span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-page__card {
  position: relative;
  padding: clamp(2rem, 5vw, 3rem);
  border: 1px solid var(--apkdone-border);
  border-radius: 1.5rem;
  background: var(--apkdone-surface);
  box-shadow:
    0 1.5rem 4rem rgba(18, 20, 22, 0.08),
    0 0 0 1px rgba(18, 20, 22, 0.015);
}

.download-page__image {
  width: clamp(8.5rem, 18vw, 11rem);
  height: clamp(8.5rem, 18vw, 11rem);
  margin: 0 auto 1.75rem;
}

.download-page__image img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 1.25rem;
  object-fit: contain;
  box-shadow: 0 0.75rem 2rem rgba(18, 20, 22, 0.1);
}

.download-page__title {
  margin: 0;
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  line-height: 1.4;
}

.download-page__android {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.75rem 0 0;
  color: var(--apkdone-ink);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.4;
  opacity: 0.62;
}

.download-page__android-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 1.1rem;
}

.download-page__action {
  width: 100%;
  margin-top: 1.75rem;
}

.download-wait-label {
  display: block;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  opacity: 0.65;
}

#waiting {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
}

.download-timer {
  position: relative;
  display: block;
  width: 6rem;
  height: 6rem;
  padding: 1rem;
  border-radius: 50%;
  color: #fff;
  background: var(--apkdone-accent);
  box-shadow:
    0 0.25rem 1rem var(--apkdone-accent-ring),
    0 0 0 0.5rem var(--apkdone-accent-ring);
  font-size: 3rem;
  font-weight: 700;
  line-height: 4rem;
}

.download-timer::after {
  position: absolute;
  inset: 0;
  content: "";
  border: 0.18rem solid transparent;
  border-top-color: rgba(255, 255, 255, 0.82);
  border-right-color: rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  animation: download-timer-spin 1.25s linear infinite;
}

.download-page__button {
  min-width: min(100%, 18rem);
  min-height: 3.75rem;
  height: auto !important;
  padding: 0.875rem 1.5rem !important;
  border-radius: 999px !important;
  font-size: 1rem !important;
  line-height: 1.5 !important;
  white-space: normal;
}

.download-page__error {
  padding: 0.875rem 1rem;
  border: 1px solid #d55e5e;
  border-radius: 0.75rem;
  color: #9a3535;
  background: rgba(213, 94, 94, 0.08);
  font-size: 0.875rem;
  font-weight: 700;
}

.download-telegram-cta-wrap {
  display: flex;
  width: 100%;
  justify-content: center;
  margin-top: 1.5rem;
}

.download-telegram-cta {
  display: inline-flex;
  max-width: 100%;
  min-height: 3.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  color: #fff !important;
  background: #2ca5e0;
  box-shadow: 0 0.5rem 1.25rem rgba(19, 115, 160, 0.28);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none !important;
  transition:
    background-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.download-telegram-cta__icon {
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 1.5rem;
  place-items: center;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.download-telegram-cta__icon svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.download-telegram-cta__icon rect {
  display: none;
}

.download-telegram-cta__label {
  min-width: 0;
  text-align: center;
  white-space: normal;
}

.download-page__background {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.download-page__orb {
  position: absolute;
  top: -18rem;
  width: 40rem;
  height: 40rem;
  border-radius: 50%;
  opacity: 0.46;
}

.download-page__orb--one {
  left: calc(50% - 34rem);
  background: radial-gradient(circle, rgba(250, 122, 72, 0.16), transparent 68%);
  animation: download-orb-one 10s ease-in-out infinite;
}

.download-page__orb--two {
  left: calc(50% - 20rem);
  background: radial-gradient(circle, rgba(44, 165, 224, 0.1), transparent 68%);
}

.download-page__orb--three {
  left: calc(50% - 6rem);
  background: radial-gradient(circle, rgba(104, 203, 91, 0.12), transparent 68%);
  animation: download-orb-three 10s ease-in-out infinite;
}

@keyframes download-timer-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes download-orb-one {
  50% {
    transform: translateX(7rem);
  }
}

@keyframes download-orb-three {
  50% {
    transform: translateX(-7rem);
  }
}

@media (hover: hover) {
  .download-page__back:hover {
    border-color: var(--apkdone-primary-200);
    box-shadow: 0 0.5rem 1.25rem rgba(18, 20, 22, 0.1);
    transform: translateY(-1px);
  }

  .download-telegram-cta:hover {
    background: #2296cf;
    box-shadow: 0 0.7rem 1.5rem rgba(19, 115, 160, 0.34);
    transform: translateY(-2px);
  }
}

.download-page__back:focus-visible,
.download-telegram-cta:focus-visible,
.download-page__button:focus-visible {
  outline: 3px solid var(--apkdone-primary-700);
  outline-offset: 3px;
}

.download-telegram-cta:active {
  background: #1e88bd;
  transform: translateY(1px);
}

html.darkmod .download-page__card,
html.darkmod .download-page__back {
  box-shadow: 0 1.25rem 3.5rem rgba(0, 0, 0, 0.28);
}

html.darkmod .download-page__error {
  color: #ffb0b0;
  background: rgba(213, 94, 94, 0.14);
}

@media (max-width: 575px) {
  .download-page {
    min-height: 31rem;
    padding: 1.5rem 0.75rem 2.5rem;
  }

  .download-page__back-row {
    margin: 0 0.25rem 0.75rem;
  }

  .download-page__back {
    max-width: 100%;
  }

  .download-page__card {
    padding: 1.75rem 1rem 2rem;
    border-radius: 1.25rem;
  }

  .download-page__image {
    width: 8rem;
    height: 8rem;
    margin-bottom: 1.5rem;
  }

  .download-page__image img {
    border-radius: 1rem;
  }

  .download-page__title {
    font-size: 1.0625rem;
  }

  .download-telegram-cta {
    width: 100%;
    padding-right: 0.875rem;
    padding-left: 0.875rem;
  }

  .download-page__button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .download-page__orb,
  .download-timer::after {
    animation: none;
  }

  .download-page__back,
  .download-telegram-cta {
    transition: none;
  }
}
