:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f3fb;
  color: #19172b;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --accent: #6252e7;
  --accent-strong: #4938c8;
  --accent-soft: #eeebff;
  --accent-rgb: 98 82 231;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #f4f3fb;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 4% 4%, rgb(137 111 255 / 18%), transparent 31rem),
    radial-gradient(circle at 96% 92%, rgb(63 191 177 / 13%), transparent 28rem),
    linear-gradient(155deg, #faf9ff 0%, #f2f3fb 52%, #f7f8fc 100%);
  color: #19172b;
}

body[data-invite-kind="group"] {
  --accent: #168f80;
  --accent-strong: #087466;
  --accent-soft: #e6f7f3;
  --accent-rgb: 22 143 128;
}

body[data-invite-kind="challenge"] {
  --accent: #d7653a;
  --accent-strong: #b94924;
  --accent-soft: #fff0e8;
  --accent-rgb: 215 101 58;
}

body::before,
body::after {
  position: fixed;
  z-index: 0;
  content: "";
  pointer-events: none;
}

body::before {
  inset: 0;
  opacity: .34;
  background-image:
    linear-gradient(rgb(92 78 173 / 6%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(92 78 173 / 6%) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 76%);
}

body::after {
  width: 17rem;
  height: 17rem;
  top: -7rem;
  right: -7rem;
  border: 1px solid rgb(var(--accent-rgb) / 12%);
  border-radius: 50%;
  box-shadow:
    0 0 0 2.6rem rgb(var(--accent-rgb) / 4%),
    0 0 0 5.2rem rgb(var(--accent-rgb) / 3%);
}

a {
  color: inherit;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 464px);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding:
    max(24px, env(safe-area-inset-top))
    20px
    max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-home {
  width: fit-content;
  margin: 0 0 20px 4px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 14px;
  background: linear-gradient(145deg, #9c51f4 0%, #6847ed 52%, #3f2bc5 100%);
  box-shadow: 0 10px 24px rgb(69 48 184 / 24%);
}

.brand-mark img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.brand-copy span {
  color: #737086;
  font-size: 12px;
  font-weight: 650;
}

.invite-card,
.home-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 90%);
  border-radius: 30px;
  background: rgb(255 255 255 / 92%);
  box-shadow:
    0 28px 70px rgb(51 43 104 / 14%),
    0 4px 16px rgb(51 43 104 / 7%),
    inset 0 0 0 1px rgb(80 68 145 / 5%);
  backdrop-filter: blur(18px);
  animation: card-in .48s cubic-bezier(.22, 1, .36, 1) both;
}

.invite-card::before,
.home-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  content: "";
  background: linear-gradient(90deg, var(--accent-strong), var(--accent), #9d78ff);
}

.invite-card::after,
.home-card::after {
  position: absolute;
  z-index: 0;
  width: 13rem;
  height: 13rem;
  top: -7rem;
  right: -6rem;
  border-radius: 50%;
  background: rgb(var(--accent-rgb) / 8%);
  content: "";
  pointer-events: none;
}

.card-inner {
  position: relative;
  z-index: 1;
  padding: 28px 26px 26px;
}

.context-row {
  display: flex;
  align-items: center;
  gap: 15px;
}

.invite-icon {
  width: 58px;
  height: 58px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(var(--accent-rgb) / 12%);
  border-radius: 19px;
  background: linear-gradient(145deg, #fff, var(--accent-soft));
  color: var(--accent-strong);
  box-shadow: 0 10px 22px rgb(var(--accent-rgb) / 12%);
}

.invite-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.context-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.eyebrow {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .085em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgb(var(--accent-rgb) / 10%);
}

.context-note {
  color: #767287;
  font-size: 13px;
  font-weight: 620;
}

.invite-copy {
  margin-top: 22px;
}

h1 {
  margin: 0;
  color: #19172b;
  font-size: clamp(29px, 8.3vw, 36px);
  font-weight: 830;
  letter-spacing: -.045em;
  line-height: 1.04;
}

.lead {
  max-width: 32ch;
  margin: 12px 0 0;
  color: #696679;
  font-size: 15px;
  line-height: 1.55;
}

.invite-code {
  margin-top: 20px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgb(var(--accent-rgb) / 14%);
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-soft), rgb(255 255 255 / 92%));
}

.invite-code span {
  color: #777286;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.invite-code output {
  color: var(--accent-strong);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: .055em;
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

.actions {
  margin-top: 22px;
  display: grid;
  gap: 10px;
}

.button {
  min-height: 52px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.button:focus-visible {
  outline: 3px solid rgb(var(--accent-rgb) / 28%);
  outline-offset: 3px;
}

.button.primary {
  justify-content: space-between;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 12px 24px rgb(var(--accent-rgb) / 23%);
  color: #fff;
}

.button-arrow {
  width: 27px;
  height: 27px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: rgb(255 255 255 / 15%);
  font-size: 17px;
  line-height: 1;
}

.button.secondary {
  border-color: rgb(var(--accent-rgb) / 10%);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary:hover {
  box-shadow: 0 15px 30px rgb(var(--accent-rgb) / 29%);
}

.button[aria-disabled="true"] {
  opacity: .48;
  pointer-events: none;
}

.status {
  margin: 14px 0 0;
  padding: 11px 12px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid #f0cbc5;
  border-radius: 13px;
  background: #fff5f3;
  color: #9e382b;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

.status-icon {
  width: 19px;
  height: 19px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #e16452;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.page-footer {
  margin-top: 18px;
  color: #817d90;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .02em;
  text-align: center;
}

.page-footer p {
  margin: 0;
}

.page-footer nav {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 12px;
}

.page-footer a {
  color: #5b566e;
  font-weight: 760;
  text-underline-offset: 3px;
}

.page-footer a:hover {
  color: var(--accent-strong);
}

.home-card .card-inner {
  padding: 31px 26px 27px;
}

.home-symbol {
  width: 76px;
  height: 76px;
  margin-bottom: 22px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(145deg, #9c51f4 0%, #6847ed 52%, #3f2bc5 100%);
  box-shadow: 0 16px 32px rgb(74 49 196 / 25%);
}

.home-symbol img {
  width: 47px;
  height: 47px;
  object-fit: contain;
}

.home-card .lead {
  max-width: 35ch;
}

.feature-list {
  margin: 23px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.feature-list li {
  padding: 9px 11px;
  border: 1px solid #e7e3f7;
  border-radius: 999px;
  background: #faf9ff;
  color: #5b566e;
  font-size: 12px;
  font-weight: 750;
}

.store-actions {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.store-actions .button {
  min-height: 50px;
  padding: 0 12px;
  font-size: 13px;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 380px) {
  .page-shell {
    padding-right: 15px;
    padding-left: 15px;
  }

  .card-inner {
    padding: 25px 21px 22px;
  }

  .brand-home {
    margin-left: 3px;
  }

  .invite-code {
    padding-right: 13px;
    padding-left: 13px;
  }
}

@media (max-height: 670px) {
  .page-shell {
    padding-top: 17px;
    padding-bottom: 17px;
  }

  .brand-home {
    margin-bottom: 14px;
  }

  .card-inner {
    padding-top: 23px;
    padding-bottom: 21px;
  }

  .invite-copy {
    margin-top: 17px;
  }

  .invite-code,
  .actions {
    margin-top: 16px;
  }

  .page-footer {
    margin-top: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
