:root {
  color: #2c171b;
  background: #f7f0e8;
  font-family:
    "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --brand-red: #b80f25;
  --brand-red-dark: #7f0719;
  --brand-gold: #f4c96d;
  --ink-soft: #786468;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 4%, rgb(247 193 92 / 38%), transparent 22rem),
    radial-gradient(circle at 94% 28%, rgb(184 15 37 / 12%), transparent 24rem),
    linear-gradient(155deg, #fffaf4 0%, #f8f0e8 52%, #eddad0 100%);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  width: 100%;
  max-width: 540px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    max(24px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(22px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.download-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgb(115 38 44 / 10%);
  border-radius: 30px;
  background: rgb(255 255 255 / 94%);
  box-shadow:
    0 30px 72px rgb(88 35 37 / 16%),
    0 5px 18px rgb(88 35 37 / 8%);
}

.brand-hero {
  position: relative;
  min-height: 214px;
  overflow: hidden;
  padding: 27px 24px 22px;
  color: #fff;
  background:
    radial-gradient(circle at 80% 12%, rgb(255 220 134 / 28%), transparent 12rem),
    linear-gradient(138deg, #d51a32 0%, #a50b21 54%, #760416 100%);
}

.brand-hero::after {
  position: absolute;
  right: -60px;
  bottom: -94px;
  width: 245px;
  height: 180px;
  border-radius: 50%;
  background: rgb(255 191 70 / 11%);
  content: "";
  transform: rotate(-18deg);
}

.hero-orbit {
  position: absolute;
  border: 1px solid rgb(255 224 160 / 19%);
  border-radius: 50%;
}

.hero-orbit-one {
  top: -92px;
  right: -105px;
  width: 290px;
  height: 290px;
}

.hero-orbit-two {
  top: -47px;
  right: -61px;
  width: 205px;
  height: 205px;
}

.brand-lockup {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 17px;
}

.brand-mark {
  width: 86px;
  height: 86px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 229 168 / 34%);
  border-radius: 26px;
  background: rgb(103 0 15 / 26%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 12%),
    0 15px 30px rgb(63 0 12 / 22%);
  backdrop-filter: blur(8px);
}

.brand-mark img {
  width: 80px;
  height: 80px;
  display: block;
  object-fit: contain;
}

.brand-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 7px;
  color: #ffe3a0;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.13em;
}

h1 {
  margin: 0;
  color: #fffaf0;
  font-size: clamp(25px, 6.7vw, 34px);
  line-height: 1.15;
  letter-spacing: 0.035em;
  text-shadow: 0 4px 16px rgb(66 0 10 / 25%);
}

.subtitle {
  margin: 7px 0 0;
  color: rgb(255 244 226 / 78%);
  font-size: 14px;
}

.release-row {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.release-row span {
  padding: 6px 10px;
  border: 1px solid rgb(255 231 179 / 22%);
  border-radius: 999px;
  color: #ffedc1;
  background: rgb(74 0 12 / 21%);
  font-size: 11px;
  font-weight: 700;
}

.card-content {
  padding: 22px 24px 24px;
}

.share-context-panel {
  margin-bottom: 15px;
  padding: 18px 17px;
  border: 1px solid #edc9a0;
  border-radius: 19px;
  background:
    radial-gradient(circle at 100% 0, rgb(244 201 109 / 24%), transparent 9rem),
    linear-gradient(135deg, #fffaf1, #fff5e7);
}

.share-context-kicker {
  margin: 0 0 5px;
  color: #9b6a34;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.1em;
}

.share-context-title {
  margin: 0;
  color: #7f0719;
  font-size: 21px;
  line-height: 1.35;
}

.share-target-row {
  margin-top: 13px;
  padding-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-top: 1px solid rgb(184 15 37 / 10%);
  color: #856e68;
  font-size: 12px;
}

.share-target-row span {
  flex: 0 0 auto;
}

.share-target-row strong {
  min-width: 0;
  color: #492b31;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.invite-panel {
  padding: 17px 17px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px 14px;
  border: 1px solid #efd3b2;
  border-radius: 19px;
  background: linear-gradient(135deg, #fffaf0, #fff4e5);
}

.invite-panel.is-invalid {
  border-color: #e7ddd8;
  background: #f8f5f2;
}

.invite-label {
  margin: 0 0 7px;
  color: #856e68;
  font-size: 12px;
  font-weight: 650;
}

.invite-code {
  color: #a70d23;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 31px;
  line-height: 1;
  letter-spacing: 0.14em;
}

.invite-panel.is-invalid .invite-code {
  color: #9b8f8c;
  font-family: inherit;
  font-size: 24px;
  letter-spacing: 0.04em;
}

.copy-button {
  min-width: 67px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #d64351;
  border-radius: 999px;
  color: #a30c21;
  background: rgb(255 255 255 / 86%);
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.copy-button:focus-visible,
.download-button:focus-visible {
  outline: 3px solid rgb(224 158 54 / 48%);
  outline-offset: 3px;
}

.alternate-download-button {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #e8c9c5;
  border-radius: 12px;
  color: #8c2330;
  background: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.alternate-download-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.invite-message {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  color: #7d6862;
  font-size: 12px;
  line-height: 1.55;
}

.download-button {
  min-height: 78px;
  margin-top: 15px;
  padding: 14px 17px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid rgb(255 219 147 / 14%);
  border-radius: 20px;
  color: #fff;
  background:
    linear-gradient(105deg, rgb(255 255 255 / 10%), transparent 35%),
    linear-gradient(135deg, #c91831, #8c081d);
  box-shadow: 0 15px 30px rgb(151 8 31 / 23%);
  text-decoration: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.download-button:active {
  transform: translateY(1px);
  box-shadow: 0 10px 22px rgb(151 8 31 / 22%);
}

.download-icon {
  width: 45px;
  height: 45px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #a50d22;
  background: linear-gradient(145deg, #fffaf0, #ffe5ae);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 58%);
  font-size: 27px;
  font-weight: 900;
  line-height: 1;
}

.download-copy {
  min-width: 0;
  flex: 1;
}

.download-copy strong,
.download-copy small {
  display: block;
}

.download-copy strong {
  font-size: 17px;
  line-height: 1.35;
}

.download-copy small {
  margin-top: 3px;
  color: rgb(255 255 255 / 76%);
  font-size: 12px;
}

.download-chevron {
  color: rgb(255 239 204 / 77%);
  font-size: 30px;
  line-height: 1;
}

.route-status {
  min-height: 33px;
  margin-top: 9px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  color: #756267;
  background: #f8f4f1;
  font-size: 11px;
  line-height: 1.4;
  word-break: break-all;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #d99a32;
  box-shadow: 0 0 0 4px rgb(217 154 50 / 12%);
}

.route-status[data-state="ready"] .status-dot {
  background: #2d9d66;
  box-shadow: 0 0 0 4px rgb(45 157 102 / 12%);
}

.route-status[data-state="fallback"] .status-dot {
  background: #bc7b2a;
  box-shadow: 0 0 0 4px rgb(188 123 42 / 12%);
}

.route-status[data-state="checking"] .status-dot {
  animation: status-pulse 1.25s ease-in-out infinite;
}

@keyframes status-pulse {
  50% {
    opacity: 0.35;
    transform: scale(0.78);
  }
}

.install-section {
  margin-top: 21px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h2 {
  margin: 0;
  color: #402b30;
  font-size: 16px;
}

.section-heading span {
  color: #9b888c;
  font-size: 11px;
  white-space: nowrap;
}

.steps {
  margin: 13px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  list-style: none;
}

.steps li {
  min-width: 0;
  padding: 13px 8px 12px;
  display: grid;
  justify-items: center;
  gap: 7px;
  border: 1px solid #eee4df;
  border-radius: 15px;
  color: #69565b;
  background: #fcfaf8;
  font-size: 12px;
  text-align: center;
}

.steps li span {
  white-space: nowrap;
}

.steps b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #a40d23;
  background: #fbe6df;
  font-size: 13px;
}

.security-note {
  margin-top: 18px;
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border: 1px solid #eee5de;
  border-radius: 16px;
  color: #79676b;
  background: #faf8f6;
  font-size: 11px;
  line-height: 1.6;
}

.shield {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #9f1023;
  background: #f9dfd9;
  font-size: 13px;
  font-weight: 900;
}

.security-note strong {
  color: #533f44;
}

.security-note p {
  margin: 3px 0 0;
}

footer {
  display: flex;
  justify-content: center;
  gap: 7px;
  color: #8b7679;
  font-size: 11px;
}

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

  .download-card {
    border-radius: 25px;
  }

  .brand-hero {
    min-height: 200px;
    padding: 24px 18px 19px;
  }

  .brand-mark {
    width: 74px;
    height: 74px;
    border-radius: 22px;
  }

  .brand-mark img {
    width: 70px;
    height: 70px;
  }

  .card-content {
    padding: 18px;
  }

  .invite-code {
    font-size: 28px;
  }

  .steps li {
    padding-right: 5px;
    padding-left: 5px;
  }
}

@media (max-height: 760px) and (min-width: 391px) {
  .page-shell {
    justify-content: flex-start;
  }
}

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