/* Pre-Unity access gate — must match standalone PasswordGateController (see index.html script). */
:root {
  --gate-bg0: #0c1020;
  --gate-bg1: #1a2744;
  --gate-card: rgba(28, 36, 54, 0.96);
  --gate-card-border: rgba(255, 255, 255, 0.08);
  --gate-text: #eef1f8;
  --gate-muted: #9aa8c4;
  --gate-accent: #3d7eea;
  --gate-accent-hover: #5a94ff;
  --gate-error: #ff6b6b;
  --gate-input-bg: rgba(8, 12, 22, 0.95);
}

#gate-root {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px;
  box-sizing: border-box;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  background: radial-gradient(ellipse 120% 80% at 50% 20%, var(--gate-bg1) 0%, var(--gate-bg0) 55%, #060812 100%);
}

#gate-root::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 70%, rgba(61, 126, 234, 0.12) 0%, transparent 45%);
  pointer-events: none;
}

.gate-card {
  position: relative;
  width: min(440px, 100%);
  padding: 40px 36px 36px;
  border-radius: 16px;
  background: var(--gate-card);
  border: 1px solid var(--gate-card-border);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.gate-card.gate-shake {
  animation: gate-shake 0.35s ease-out;
}

@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.gate-title {
  margin: 0 0 8px;
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--gate-text);
  text-align: center;
}

.gate-sub {
  margin: 0 0 28px;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--gate-muted);
  text-align: center;
}

.gate-field-wrap {
  margin-bottom: 12px;
}

.gate-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gate-muted);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gate-input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  font-size: 1rem;
  color: var(--gate-text);
  background: var(--gate-input-bg);
  border: 1px solid rgba(61, 126, 234, 0.35);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.gate-input:focus {
  border-color: var(--gate-accent);
  box-shadow: 0 0 0 3px rgba(61, 126, 234, 0.2);
}

.gate-input::placeholder {
  color: rgba(154, 168, 196, 0.45);
}

.gate-error {
  min-height: 22px;
  margin: 10px 0 18px;
  font-size: 0.875rem;
  color: var(--gate-error);
  text-align: center;
}

.gate-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.gate-btn {
  flex: 1;
  min-width: 140px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, var(--gate-accent) 0%, #2f66c9 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(61, 126, 234, 0.35);
  transition: filter 0.15s, transform 0.1s;
}

.gate-btn:hover {
  filter: brightness(1.08);
}

.gate-btn:active {
  transform: scale(0.98);
}

.gate-btn:focus-visible {
  outline: 2px solid var(--gate-accent-hover);
  outline-offset: 2px;
}

#unity-container.gate-pending {
  display: none;
}
