.invite-gate {
  position: absolute;
  inset: 0;
  z-index: 1300;
  overflow: auto;
  overscroll-behavior: contain;
  background: #fffdf7;
  color: #07161b;
}

.invite-gate[hidden] {
  display: none;
}

body.invite-gate-open .bottom-nav {
  visibility: hidden !important;
  pointer-events: none !important;
}

.invite-page {
  width: 100%;
  min-height: 100%;
  padding: 22px 20px max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 0;
}

.invite-brand-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.invite-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #07161b;
  font-size: 19px;
  font-weight: 900;
}

.invite-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.invite-beta-label {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1.5px solid #141414;
  border-radius: 999px;
  background: #ffd85a;
  color: #141414;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.invite-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 30px 24px;
}

.invite-heading-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 66px;
  align-items: end;
  gap: 16px;
  margin-bottom: 24px;
}

.invite-heading-row h2 {
  margin: 0;
  color: #07161b;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: 0;
}

.invite-heading-row p {
  margin: 8px 0 0;
  max-width: 30ch;
  color: #4e6067;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.48;
}

.invite-mascot {
  width: 66px;
  height: 66px;
  display: block;
  object-fit: contain;
}

.invite-form {
  display: grid;
  gap: 10px;
}

.invite-field-label {
  color: #07161b;
  font-size: 13px;
  font-weight: 800;
}

.invite-code-input {
  width: 100%;
  min-width: 0;
  height: 58px;
  padding: 0 15px;
  border: 2px solid #141414;
  border-radius: 12px;
  outline: none;
  background: #fffefa;
  color: #07161b;
  box-shadow: 0 4px 0 #d9d8d1;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.invite-code-input::placeholder {
  color: #8a969a;
  opacity: 1;
}

.invite-code-input:focus-visible {
  border-color: #07515c;
  box-shadow: 0 4px 0 #8fe2e8, 0 0 0 3px rgba(24, 200, 213, 0.18);
}

.invite-code-input[aria-invalid="true"] {
  border-color: #b83a31;
  box-shadow: 0 4px 0 #efb9b4;
}

.invite-primary,
.invite-secondary {
  width: 100%;
  min-height: 54px;
  border: 2px solid #141414;
  border-radius: 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.invite-primary {
  margin-top: 4px;
  background: #18c8d5;
  color: #07161b;
  box-shadow: 0 6px 0 #141414;
}

.invite-secondary {
  background: #fffefa;
  color: #07515c;
  box-shadow: 0 4px 0 #141414;
}

.invite-primary:active,
.invite-secondary:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #141414;
}

.invite-primary:disabled,
.invite-secondary:disabled {
  cursor: wait;
  opacity: 0.58;
}

.invite-feedback {
  min-height: 21px;
  margin: 1px 0 0;
  color: #b32f27;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}

.invite-request-row {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #d8ddda;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.invite-request-copy strong,
.invite-request-copy span {
  display: block;
}

.invite-request-copy strong {
  color: #07161b;
  font-size: 13px;
  font-weight: 850;
}

.invite-request-copy span {
  margin-top: 2px;
  color: #4e6067;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.invite-request-action {
  min-height: 40px;
  padding: 0 13px;
  border: 1.5px solid #141414;
  border-radius: 10px;
  background: #fffefa;
  color: #07515c;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.invite-state-panel {
  display: grid;
  justify-items: center;
  text-align: center;
}

.invite-state-panel[hidden],
.invite-entry-panel[hidden] {
  display: none;
}

.invite-state-mascot {
  width: 92px;
  height: 92px;
  object-fit: contain;
  margin-bottom: 16px;
}

.invite-state-panel h2 {
  margin: 0;
  color: #07161b;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.16;
}

.invite-state-panel p {
  margin: 9px auto 0;
  max-width: 29ch;
  color: #4e6067;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
}

.invite-state-panel .invite-secondary {
  margin-top: 24px;
}

.invite-loading-mark {
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border: 4px solid #d7eeee;
  border-top-color: #07515c;
  border-radius: 50%;
  animation: invite-spin 700ms linear infinite;
}

.invite-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 24px;
  color: #617176;
  font-size: 10.5px;
  font-weight: 650;
  text-align: center;
}

.invite-footnote svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: #07515c;
}

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

@media (max-width: 360px) {
  .invite-page {
    padding-inline: 17px;
  }

  .invite-main {
    padding-block: 24px 20px;
  }

  .invite-heading-row {
    grid-template-columns: minmax(0, 1fr) 58px;
    gap: 11px;
  }

  .invite-heading-row h2 {
    font-size: 27px;
  }

  .invite-mascot {
    width: 58px;
    height: 58px;
  }

  .invite-request-row {
    grid-template-columns: 1fr;
  }

  .invite-request-action {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .invite-loading-mark {
    animation-duration: 1400ms;
  }

  .invite-primary,
  .invite-secondary {
    transition: none;
  }
}
