:root {
  --rhc-black: #080906;
  --rhc-panel: #11120f;
  --rhc-panel-2: #181a15;
  --rhc-neon: #ccff00;
  --rhc-neon-soft: rgba(204, 255, 0, 0.16);
  --rhc-silver: #d4d0c9;
  --rhc-muted: #85867f;
  --rhc-line: rgba(212, 208, 201, 0.19);
  --rhc-danger: #ff6b61;
}

#wallet-gate,
#wallet-gate * {
  box-sizing: border-box;
}

#wallet-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  overflow: auto;
  color: var(--rhc-silver);
  background:
    radial-gradient(circle at 28% 50%, rgba(204, 255, 0, 0.1), transparent 30%),
    linear-gradient(rgba(212, 208, 201, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 208, 201, 0.045) 1px, transparent 1px),
    #070805;
  background-size: auto, 42px 42px, 42px 42px, auto;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: opacity 240ms ease, visibility 240ms ease;
}

#wallet-gate[hidden] {
  display: none;
}

#wallet-gate.is-leaving {
  opacity: 0;
  visibility: hidden;
}

.auth-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(270px, 0.78fr) minmax(420px, 1.22fr);
  width: min(980px, 94vw);
  min-height: min(620px, 90vh);
  overflow: hidden;
  border: 1px solid rgba(204, 255, 0, 0.35);
  border-radius: 22px;
  background: rgba(12, 13, 10, 0.96);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.72), 0 0 42px rgba(204, 255, 0, 0.07);
}

.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.06), transparent 18%, transparent 80%, rgba(204,255,0,.04));
}

.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 38px 34px 30px;
  overflow: hidden;
  border-right: 1px solid var(--rhc-line);
  background:
    radial-gradient(circle at 50% 28%, rgba(204, 255, 0, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,.025), transparent 50%),
    #0a0b08;
}

.auth-brand::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  left: 50%;
  top: 43%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(212, 208, 201, 0.14);
  border-radius: 50%;
  box-shadow:
    0 0 0 42px rgba(212, 208, 201, 0.035),
    0 0 0 90px rgba(204, 255, 0, 0.025);
}

.auth-brand-top,
.auth-brand-copy,
.auth-brand-foot {
  position: relative;
  z-index: 1;
}

.auth-kicker,
.auth-eyebrow {
  color: var(--rhc-neon);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.auth-mark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.09em;
}

.auth-mark-ring {
  position: relative;
  width: 30px;
  height: 30px;
  border: 2px solid var(--rhc-neon);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(204, 255, 0, 0.24);
}

.auth-mark-ring::before,
.auth-mark-ring::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rhc-neon);
}

.auth-mark-ring::before { top: -4px; left: 10px; }
.auth-mark-ring::after { right: -4px; bottom: 6px; }

.auth-brand-copy h1 {
  margin: 0 0 16px;
  color: #fff;
  font-size: clamp(30px, 3.5vw, 52px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-align: left;
}

.auth-brand-copy h1 span {
  display: block;
  color: var(--rhc-neon);
}

.auth-brand-copy p {
  max-width: 290px;
  margin: 0;
  color: #9b9d95;
  font-size: 14px;
  line-height: 1.65;
  text-align: left;
}

.auth-network-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.auth-network-line span {
  padding: 7px 9px;
  border: 1px solid var(--rhc-line);
  border-radius: 999px;
  color: #afb1aa;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.auth-brand-foot {
  color: #5f615c;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
}

.auth-main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 38px 42px 34px;
  background: linear-gradient(180deg, rgba(255,255,255,.018), transparent 44%);
}

.auth-steps {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
}

.auth-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #666861;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.auth-step b {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #42443e;
  border-radius: 50%;
  font-size: 10px;
}

.auth-step.active { color: #fff; }
.auth-step.active b {
  border-color: var(--rhc-neon);
  color: #080906;
  background: var(--rhc-neon);
  box-shadow: 0 0 16px rgba(204, 255, 0, 0.22);
}

.auth-step-line {
  width: 54px;
  height: 1px;
  background: #353730;
}

.auth-view {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.auth-view.is-hidden { display: none; }

.auth-view h2 {
  margin: 2px 0 10px;
  color: #fff;
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-align: left;
}

.auth-subtitle {
  margin: 0 0 28px;
  color: #898b84;
  font-size: 13px;
  line-height: 1.6;
  text-align: left;
}

.auth-wallet-card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 14px;
  margin: 4px 0 24px;
  padding: 15px 16px;
  border: 1px solid var(--rhc-line);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
}

.auth-wallet-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #0a0b08;
  background: var(--rhc-neon);
  font-size: 18px;
  font-weight: 900;
}

.auth-wallet-card strong,
.auth-wallet-card small {
  display: block;
  text-align: left;
}

.auth-wallet-card strong { color: #fff; font-size: 13px; }
.auth-wallet-card small { margin-top: 3px; color: #74766f; font-size: 10px; }

.auth-chain-badge {
  padding: 6px 9px;
  border: 1px solid rgba(204,255,0,.4);
  border-radius: 999px;
  color: var(--rhc-neon);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
}

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

.auth-button {
  appearance: none;
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  color: #0a0b08;
  background: var(--rhc-neon);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .02em;
  transition: transform 150ms ease, opacity 150ms ease, box-shadow 150ms ease;
}

.auth-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(204,255,0,.16);
}

.auth-button:active:not(:disabled) { transform: translateY(0); }
.auth-button:disabled { cursor: not-allowed; opacity: .38; }

.auth-button.secondary {
  border-color: var(--rhc-line);
  color: #c3c5bd;
  background: rgba(255,255,255,.035);
}

.auth-button.link {
  min-height: 34px;
  color: #85877f;
  background: transparent;
  font-size: 10px;
}

.auth-privacy {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin: 14px 2px 0;
  color: #6e7069;
  font-size: 10px;
  line-height: 1.5;
  text-align: left;
}

.auth-privacy i {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--rhc-neon);
  box-shadow: 0 0 10px rgba(204,255,0,.4);
}

.auth-profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.auth-address-pill {
  overflow: hidden;
  padding: 7px 10px;
  border: 1px solid var(--rhc-line);
  border-radius: 999px;
  color: #a8aaa2;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: 4px 0 20px;
}

.avatar-option {
  position: relative;
  min-width: 0;
  padding: 9px 7px 10px;
  border: 1px solid var(--rhc-line);
  border-radius: 13px;
  cursor: pointer;
  color: var(--rhc-silver);
  background: rgba(255,255,255,.025);
  font: inherit;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.avatar-option:hover { transform: translateY(-2px); border-color: rgba(204,255,0,.42); }
.avatar-option.selected {
  border-color: var(--rhc-neon);
  background: var(--rhc-neon-soft);
  box-shadow: 0 0 0 1px rgba(204,255,0,.1) inset;
}

.avatar-option.locked,
.avatar-option.locked:hover {
  cursor: not-allowed;
  opacity: .62;
  transform: none;
  border-color: rgba(212,208,201,.11);
  background: rgba(255,255,255,.012);
}

.avatar-option.locked img {
  filter: grayscale(.8) brightness(.58) drop-shadow(0 7px 10px rgba(0,0,0,.5));
}

.avatar-lock {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 3px 5px;
  border: 1px solid rgba(212,208,201,.22);
  border-radius: 999px;
  color: #a2a39d;
  background: rgba(8,9,6,.82);
  font-size: 6px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .08em;
}

.avatar-option img {
  display: block;
  width: 62px;
  height: 62px;
  margin: 0 auto 8px;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 7px 10px rgba(0,0,0,.5));
}

.avatar-option strong,
.avatar-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-option strong { color: #f5f5f1; font-size: 10px; }
.avatar-option small { margin-top: 3px; color: #74766f; font-size: 8px; }

.auth-field { margin: 0 0 16px; }
.auth-field label {
  display: flex;
  justify-content: space-between;
  margin: 0 0 8px;
  color: #bec0b8;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .05em;
  text-align: left;
}

.auth-field label span { color: #666861; font-weight: 650; letter-spacing: 0; }

.auth-input-wrap { position: relative; }
.auth-input {
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 44px 0 15px;
  border: 1px solid var(--rhc-line);
  border-radius: 12px;
  outline: none;
  color: #fff;
  background: #0a0b08;
  font: inherit;
  font-size: 14px;
  user-select: text;
  -webkit-user-select: text;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.auth-input:focus {
  border-color: rgba(204,255,0,.65);
  box-shadow: 0 0 0 3px rgba(204,255,0,.08);
}

.auth-input-state {
  position: absolute;
  right: 15px;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translateY(-50%);
  border: 1px solid #5f615b;
  border-radius: 50%;
}

.auth-input-state.available { border-color: var(--rhc-neon); background: var(--rhc-neon); box-shadow: 0 0 12px rgba(204,255,0,.5); }
.auth-input-state.taken { border-color: var(--rhc-danger); background: var(--rhc-danger); }

.auth-hint {
  min-height: 18px;
  margin-top: 7px;
  color: #696b64;
  font-size: 9px;
  line-height: 1.5;
  text-align: left;
}

.auth-hint.good { color: var(--rhc-neon); }
.auth-hint.bad { color: var(--rhc-danger); }

.auth-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: #85877f;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.auth-status.error { color: var(--rhc-danger); }
.auth-status.success { color: var(--rhc-neon); }

.auth-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 7px;
  vertical-align: -2px;
  border: 2px solid rgba(8,9,6,.28);
  border-top-color: #080906;
  border-radius: 50%;
  animation: auth-spin .7s linear infinite;
}

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

@media (max-width: 850px) {
  #wallet-gate { padding: 14px; }
  .auth-shell { grid-template-columns: 225px minmax(390px, 1fr); min-height: 540px; }
  .auth-brand { padding: 26px 22px; }
  .auth-main { padding: 26px 28px 24px; }
  .auth-brand-copy h1 { font-size: 34px; }
  .auth-brand-copy p { font-size: 12px; }
  .auth-steps { margin-bottom: 20px; }
  .avatar-option img { width: 50px; height: 50px; }
}

@media (max-width: 650px) {
  .auth-shell { display: block; width: min(520px, 96vw); min-height: auto; }
  .auth-brand { display: none; }
  .auth-main { min-height: min(610px, 92vh); padding: 24px 22px; }
  .avatar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
