:root {
  --glass-fill: rgb(255 255 255 / 0.09);
  --glass-sheen: linear-gradient(135deg, rgb(255 255 255 / 0.22), rgb(255 255 255 / 0.03) 40%, rgb(255 255 255 / 0.1));
  --glass-rim:
    inset 0 1px 0 rgb(255 255 255 / 0.5),
    inset 1px 0 0 rgb(255 255 255 / 0.18),
    inset -1px 0 0 rgb(255 255 255 / 0.08),
    inset 0 -1px 0 rgb(255 255 255 / 0.06);
  --glass-blur: blur(24px) saturate(1.9);
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  background: #000;
  color: #fff;
  font: 15px/1.35 -apple-system, system-ui, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.stage {
  position: fixed;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100vh;
}

/* Glass */
.glass {
  position: relative;
  isolation: isolate;
  background: var(--glass-sheen), var(--glass-fill);
  box-shadow: var(--glass-rim), 0 12px 40px rgb(0 0 0 / 0.35);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(115deg, rgb(255 255 255 / 0.32), transparent 35%, transparent 65%, rgb(255 255 255 / 0.14));
  -webkit-mask: linear-gradient(#000, transparent 70%);
  mask: linear-gradient(#000, transparent 70%);
  pointer-events: none;
}

/* Chrome */
.chrome {
  position: fixed;
  inset: 0;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  pointer-events: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  pointer-events: auto;
  transition: opacity 0.35s var(--spring), transform 0.5s var(--spring), filter 0.35s, visibility 0.35s;
}

.actions.is-hidden {
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  filter: blur(6px);
  visibility: hidden;
  pointer-events: none;
}

.is-app .pill--browser {
  display: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font: inherit;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.35);
  cursor: pointer;
  transition: transform 0.25s var(--spring), background-color 0.25s;
}

.pill:active {
  transform: scale(0.94);
  background-color: rgb(255 255 255 / 0.22);
}

.pill[hidden] {
  display: none;
}

.picker {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.hint {
  position: absolute;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  width: max-content;
  max-width: min(88vw, 430px);
  margin: 0;
  padding: 12px 20px;
  border-radius: 999px;
  transform: translateX(-50%);
  color: rgb(255 255 255 / 0.92);
  text-align: center;
  text-wrap: balance;
  transition: opacity 0.5s var(--spring), transform 0.6s var(--spring), filter 0.5s, display 0.6s allow-discrete;
}

.hint[hidden] {
  display: none;
  opacity: 0;
  transform: translate(-50%, 12px) scale(0.94);
  filter: blur(8px);
}

@starting-style {
  .hint:not([hidden]) {
    opacity: 0;
    transform: translate(-50%, 12px) scale(0.94);
    filter: blur(8px);
  }
}

/* Unavailable */
.unavailable {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding:
    max(28px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  background:
    radial-gradient(120% 80% at 20% 0%, rgb(120 140 190 / 0.35), transparent 60%),
    radial-gradient(90% 70% at 90% 100%, rgb(200 150 120 / 0.25), transparent 60%),
    #0b0d12;
  overflow-y: auto;
  touch-action: pan-y;
}

.unavailable[hidden] {
  display: none;
}

.unavailable__body {
  width: min(100%, 520px);
  margin-block: auto;
  padding: 32px 28px;
  border-radius: 40px;
}

.unavailable h1 {
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.unavailable p {
  margin: 0;
  color: rgb(255 255 255 / 0.78);
  font-size: 17px;
  line-height: 1.5;
}

.unavailable p.unavailable__status {
  margin-top: 12px;
  font-size: 15px;
}

.unavailable .pill {
  margin-top: 20px;
}

.unavailable__link {
  display: inline-block;
  margin-top: 24px;
  color: rgb(255 255 255 / 0.7);
  text-underline-offset: 3px;
}

/* Cards */
.card {
  width: min(400px, calc(100vw - 24px));
  max-width: none;
  margin: auto auto max(12px, env(safe-area-inset-bottom));
  padding: 28px 24px 24px;
  border: 0;
  border-radius: 40px;
  color: #fff;
  outline: none;
  overflow: visible;
  transition:
    opacity 0.35s var(--spring),
    transform 0.55s var(--spring),
    filter 0.35s,
    display 0.55s allow-discrete,
    overlay 0.55s allow-discrete;
}

.card:not([open]) {
  opacity: 0;
  transform: translateY(32px) scale(0.92);
  filter: blur(12px);
}

@starting-style {
  .card[open] {
    opacity: 0;
    transform: translateY(32px) scale(0.92);
    filter: blur(12px);
  }
}

.card::backdrop {
  background: rgb(0 0 0 / 0.2);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.card__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  border-radius: 22px;
  color: #fff;
}

.card__icon svg {
  width: 34px;
  height: 34px;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.card p {
  margin: 0 0 24px;
  color: rgb(255 255 255 / 0.78);
  font-size: 17px;
  line-height: 1.45;
  text-wrap: pretty;
}

.card__button {
  width: 100%;
  min-height: 56px;
  padding: 16px 20px;
  border: 0;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.98), rgb(255 255 255 / 0.86));
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -1px 0 rgb(0 0 0 / 0.06),
    0 8px 24px rgb(0 0 0 / 0.25);
  color: #0d0f14;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  cursor: pointer;
  transition: transform 0.25s var(--spring);
}

.card__button:active {
  transform: scale(0.97);
}

.card__button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.steps {
  display: grid;
  gap: 12px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgb(255 255 255 / 0.9);
  font-size: 16px;
  line-height: 1.4;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--glass-sheen), var(--glass-fill);
  box-shadow: var(--glass-rim);
  font-size: 14px;
  font-weight: 700;
}

@media (prefers-reduced-transparency: reduce) {
  .glass {
    background: rgb(28 30 36 / 0.94);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .actions,
  .pill,
  .hint,
  .card,
  .card__button {
    transition: none;
  }
}
