:root {
  --invite-bg: #070b14;
  --invite-panel: rgba(15, 23, 42, 0.88);
  --invite-line: rgba(148, 163, 184, 0.2);
  --invite-text: #f8fafc;
  --invite-muted: #9cabc1;
  --invite-cyan: #38bdf8;
  --invite-gold: #facc15;
  --invite-green: #34d399;
}

* {
  box-sizing: border-box;
}

body {
  color: var(--invite-text);
  background:
    radial-gradient(circle at 12% 14%, rgba(14, 165, 233, 0.15), transparent 28rem),
    radial-gradient(circle at 86% 22%, rgba(250, 204, 21, 0.09), transparent 25rem),
    var(--invite-bg);
}

.shared-invite-entry body {
  background:
    radial-gradient(circle at 50% 18%, rgba(250, 204, 21, 0.16), transparent 32rem),
    radial-gradient(circle at 15% 36%, rgba(14, 165, 233, 0.1), transparent 26rem),
    var(--invite-bg);
}

button,
input {
  font: inherit;
}

.invite-page {
  min-height: calc(100vh - var(--site-nav-height));
  overflow: hidden;
}

.invite-wrap {
  width: min(1080px, 100%);
  margin: 0 auto;
}

.invite-hero {
  position: relative;
  padding: 66px 24px 54px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.invite-hero::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent);
  content: "";
  pointer-events: none;
}

.invite-hero-content {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 58px;
  align-items: center;
}

.invite-kicker {
  display: inline-flex;
  margin-bottom: 16px;
  padding: 7px 13px;
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-radius: 999px;
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.12);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.invite-hero h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 70px);
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.invite-hero h1 em {
  color: var(--invite-gold);
  font-style: normal;
}

.default-intro > p,
.shared-intro > p {
  max-width: 650px;
  margin: 20px 0 0;
  color: #cbd5e1;
  font-size: 16px;
  line-height: 1.8;
}

.invite-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.invite-benefits li {
  padding: 7px 11px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.55);
  font-size: 12px;
  font-weight: 700;
}

.invite-reward {
  display: grid;
  gap: 10px;
  padding: 25px;
  border: 1px solid rgba(250, 204, 21, 0.34);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(250, 204, 21, 0.13), rgba(15, 23, 42, 0.9));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.26);
}

.invite-reward span {
  color: #fde68a;
  font-size: 13px;
  font-weight: 800;
}

.invite-reward strong {
  font-size: 21px;
}

.invite-reward small {
  margin-top: 5px;
  color: var(--invite-muted);
  line-height: 1.55;
}

.shared-only {
  display: none;
}

.shared-invite-entry .default-intro,
.shared-invite-entry .default-reward,
.shared-invite-entry .maker-card,
.shared-invite-entry .invite-explain {
  display: none;
}

.shared-invite-entry .shared-intro {
  display: block;
}

.shared-invite-entry .shared-reward {
  display: grid;
  border-color: rgba(250, 204, 21, 0.62);
  background: linear-gradient(145deg, rgba(250, 204, 21, 0.2), rgba(15, 23, 42, 0.94));
}

.hero-invite-code {
  color: #fef08a;
  font-size: clamp(28px, 4vw, 38px) !important;
  letter-spacing: 0.12em;
}

.invite-main {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  padding: 46px 24px 24px;
}

.invite-card,
.invite-explain {
  border: 1px solid var(--invite-line);
  border-radius: 18px;
  background: var(--invite-panel);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.invite-card {
  padding: 24px;
}

.shared-invite-entry .invite-main {
  grid-template-columns: minmax(0, 520px);
  justify-content: center;
  padding-top: 38px;
}

.shared-invite-entry .qr-card {
  border-color: rgba(250, 204, 21, 0.55);
  background: linear-gradient(160deg, rgba(250, 204, 21, 0.11), rgba(15, 23, 42, 0.94) 45%);
  box-shadow: 0 24px 80px rgba(250, 204, 21, 0.09);
}

.shared-invite-entry .qr-card .step-number {
  background: linear-gradient(135deg, #fde047, #f59e0b);
}

.card-heading {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-bottom: 22px;
}

.step-number {
  display: grid;
  flex: none;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #07111f;
  background: linear-gradient(135deg, var(--invite-cyan), #7dd3fc);
  font-weight: 900;
}

.card-label {
  margin: 0 0 3px;
  color: var(--invite-cyan);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.card-heading h2,
.invite-explain h2 {
  margin: 0;
  font-size: 22px;
}

.shared-code-chip {
  margin: -6px 0 20px;
  padding: 13px 16px;
  border: 1px solid rgba(250, 204, 21, 0.36);
  border-radius: 12px;
  background: rgba(250, 204, 21, 0.09);
  text-align: center;
}

.shared-invite-entry .shared-code-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.shared-code-chip span {
  color: #fde68a;
  font-size: 13px;
  font-weight: 800;
}

.shared-code-chip strong {
  color: #fef08a;
  font-size: 21px;
  letter-spacing: 0.1em;
}

.qr-shell {
  position: relative;
  width: min(100%, 280px);
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  border: 8px solid #fff;
  border-radius: 16px;
  background: #fff;
}

.qr-shell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.shared-invite-entry .qr-shell img {
  visibility: hidden;
}

.shared-invite-entry .qr-shell.is-ready img {
  visibility: visible;
}

.qr-loading,
.qr-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 20px;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.94);
  text-align: center;
}

.qr-loading[hidden],
.qr-error[hidden],
.text-link[hidden] {
  display: none;
}

.qr-error {
  color: #172033;
}

.qr-error b {
  font-size: 15px;
}

.qr-error p {
  max-width: 210px;
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

.qr-error button {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  padding: 0 16px;
  cursor: pointer;
  color: #422006;
  background: #fde047;
  font-weight: 900;
}

.qr-loading span {
  width: 32px;
  height: 32px;
  border: 3px solid #bae6fd;
  border-top-color: #0284c7;
  border-radius: 50%;
  animation: invite-spin 0.8s linear infinite;
}

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

.qr-status {
  min-height: 22px;
  margin: 17px 0 8px;
  color: #dbeafe;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
}

.qr-status.is-error,
.form-message.is-error {
  color: #fda4af;
}

.text-link,
.preview-link {
  display: block;
  width: fit-content;
  margin: 0 auto;
  color: #7dd3fc;
  font-size: 13px;
  text-underline-offset: 3px;
}

.shared-entry-steps {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(250, 204, 21, 0.18);
}

.shared-invite-entry .shared-entry-steps {
  display: flex;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
}

.shared-entry-steps span {
  padding: 6px 9px;
  border-radius: 999px;
  color: #fef3c7;
  background: rgba(250, 204, 21, 0.09);
  font-size: 12px;
  font-weight: 700;
}

.maker-step {
  padding: 17px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.36);
}

.maker-step + .maker-step {
  margin-top: 16px;
}

.maker-step-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 14px;
}

.maker-step-heading > b {
  display: grid;
  flex: none;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #082f49;
  background: #7dd3fc;
  font-size: 16px;
}

.maker-step-heading span {
  color: var(--invite-cyan);
  font-size: 11px;
  font-weight: 900;
}

.maker-step-heading h3 {
  margin: 2px 0 0;
  font-size: 16px;
}

.paste-step {
  border: 2px solid rgba(56, 189, 248, 0.52);
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.14), rgba(2, 6, 23, 0.64));
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.04);
}

.copy-id-guide {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.65);
}

.copy-id-guide img {
  display: block;
  width: 100%;
  height: auto;
}

.copy-id-guide figcaption {
  padding: 10px 13px;
  color: #bae6fd;
  font-size: 12px;
  line-height: 1.55;
}

.invite-form label {
  display: block;
  margin-bottom: 8px;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 800;
}

.input-row,
.result-link-row {
  display: flex;
  gap: 9px;
}

.input-row input,
.result-link-row input {
  min-width: 0;
  flex: 1;
  height: 52px;
  padding: 0 13px;
  border: 2px solid rgba(125, 211, 252, 0.5);
  border-radius: 10px;
  outline: none;
  color: #f8fafc;
  background: #020617;
  font-size: 15px;
}

.input-row input::placeholder {
  color: #71809a;
}

.input-row input:focus,
.result-link-row input:focus {
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.primary-button,
.copy-button {
  min-height: 52px;
  border: 0;
  border-radius: 10px;
  padding: 0 18px;
  cursor: pointer;
  color: #07111f;
  background: linear-gradient(135deg, var(--invite-cyan), #67e8f9);
  font-size: 14px;
  font-weight: 900;
}

.primary-button:disabled,
.copy-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.privacy-note,
.form-message {
  margin: 9px 0 0;
  color: var(--invite-muted);
  font-size: 12px;
  line-height: 1.55;
}

.form-message {
  min-height: 19px;
}

.share-result {
  margin-top: 19px;
  padding: 18px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 13px;
  background: rgba(52, 211, 153, 0.07);
}

.share-result[hidden] {
  display: none;
}

.result-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.result-title > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #052e24;
  background: var(--invite-green);
  font-weight: 900;
}

.result-title small {
  color: #6ee7b7;
  font-weight: 700;
}

.result-title h3 {
  margin: 2px 0 0;
  font-size: 16px;
}

.result-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(110, 231, 183, 0.22);
  border-radius: 10px;
  background: rgba(2, 44, 34, 0.42);
}

.result-code span {
  color: #a7f3d0;
  font-size: 12px;
  font-weight: 800;
}

.result-code strong {
  color: #6ee7b7;
  font-size: 18px;
  letter-spacing: 0.09em;
}

.result-link-row input {
  color: #bae6fd;
  font-size: 13px;
}

.copy-button {
  color: #052e24;
  background: #6ee7b7;
}

.preview-link {
  margin: 11px 0 0;
}

.invite-explain {
  margin: 0 auto 58px;
  padding: 25px;
}

.explain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 19px;
}

.explain-grid article {
  padding: 17px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.35);
}

.explain-grid span {
  color: var(--invite-gold);
  font-size: 12px;
  font-weight: 900;
}

.explain-grid h3 {
  margin: 7px 0;
  font-size: 16px;
}

.explain-grid p {
  margin: 0;
  color: var(--invite-muted);
  font-size: 13px;
  line-height: 1.65;
}

@media (max-width: 760px) {
  .invite-hero {
    padding: 42px 18px 36px;
  }

  .invite-hero-content,
  .invite-main {
    grid-template-columns: 1fr;
  }

  .invite-hero-content {
    gap: 25px;
  }

  .invite-main {
    padding: 26px 14px 16px;
  }

  .maker-card {
    order: 1;
  }

  .qr-card {
    order: 2;
  }

  .invite-page.has-invite-code .qr-card {
    order: 1;
  }

  .invite-page.has-invite-code .maker-card {
    order: 2;
  }

  .explain-grid {
    grid-template-columns: 1fr;
  }

  .invite-explain {
    margin: 0 14px 38px;
  }
}

@media (max-width: 480px) {
  .invite-hero h1 {
    font-size: 40px;
  }

  .invite-card {
    padding: 19px;
  }

  .input-row,
  .result-link-row {
    flex-direction: column;
  }

  .primary-button,
  .copy-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qr-loading span {
    animation: none;
  }
}
