html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #0a0a0a;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  position: fixed;
  inset: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

#unity-container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  pointer-events: none;
}

#unity-canvas {
  display: block;
  background: #000;
  touch-action: none;
  width: auto;
  height: auto;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

#unity-canvas.is-ready {
  opacity: 1;
  pointer-events: auto;
}

#lex-gate[hidden],
#lex-gate [hidden] {
  display: none !important;
}

#lex-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 42rem 34rem at 112% -8%, #ffc53d 0%, #ff7a14 36%, #ff4e00 56%, transparent 58%),
    #0a0a0a;
  color: #fff7ee;
  pointer-events: auto;
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
}

.gate-card {
  width: min(20.5rem, 100%);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

/* Logo colours (navy + black) need a light plate on the dark gate. */
.gate-card .brand-plate {
  align-self: center;
  margin-bottom: 2rem;
  padding: 0.7rem 1rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.gate-card .brand-plate img {
  display: block;
  width: 11rem;
  height: auto;
}

@media (max-height: 560px) {
  .gate-card .brand-plate { margin-bottom: 1rem; padding: 0.45rem 0.7rem; }
  .gate-card .brand-plate img { width: 7.5rem; }
}

.gate-title {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  text-align: center;
}

#lex-gate .hint {
  margin: 0 0 1.6rem;
  text-align: center;
  color: #9a9188;
  font-size: 0.92rem;
}

.gate-label {
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: none;
  color: #9a9188;
  margin-top: 0.9rem;
}

#lex-code, #lex-name {
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 122, 20, 0.35);
  border-radius: 0;
  color: #fff7ee;
  padding: 0.7rem 0;
  font-size: 1.05rem;
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
  outline: none;
  pointer-events: auto;
  caret-color: #ffc53d;
}

#lex-code:focus, #lex-name:focus {
  border-bottom-color: #ff7a14;
}

#lex-code {
  font-size: 1.55rem;
  text-align: center;
  letter-spacing: 0.32em;
}

#lex-gate-submit {
  margin-top: 1.8rem;
  background: linear-gradient(118deg, #ff4e00 0%, #ff7a14 42%, #ffc53d 100%);
  color: #0a0a0a;
  border: 0;
  border-radius: 0;
  padding: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  pointer-events: auto;
  cursor: pointer;
}

.gate-error {
  color: #e23b22;
  font-size: 0.85rem;
  min-height: 1.1em;
  margin: 0.6rem 0 0;
}

.gate-code-field {
  display: flex;
  flex-direction: column;
}

.gate-eyebrow {
  margin: 0 0 0.5rem;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ffc53d;
}

#lex-gate-submit {
  font-size: 1.05rem;
  padding: 1.05rem;
}

#lex-gate-submit:disabled {
  opacity: 0.6;
}

.gate-loading {
  margin-top: 1.8rem;
}

.gate-progress {
  height: 4px;
  background: rgba(255, 247, 238, 0.12);
  overflow: hidden;
}

.gate-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ff4e00 0%, #ff7a14 45%, #ffc53d 100%);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.gate-loading-text {
  margin: 0.8rem 0 0;
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: #9a9188;
}
