html.gate-locked #view,
html.gate-locked #boot,
html.gate-locked #ui {
  display: none !important;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(27, 20, 15, 0.62);
}

.gate[hidden] {
  display: none;
}

.gate-card {
  width: min(22rem, 100%);
  margin: 0;
  padding: 1.35rem 1.35rem 1.45rem;
  background: #f4efe4;
  color: #1b140f;
  border: 3px solid #1b140f;
  box-shadow: 6px 6px 0 #1b140f;
}

.gate-card.shake {
  animation: gate-shake 0.42s ease;
}

.gate-title {
  margin: 0 0 0.9rem;
  font-family: "Tide Pixel", "Courier New", "Liberation Mono", ui-monospace, monospace;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.6;
}

.gate-form {
  display: grid;
  gap: 0.55rem;
}

.gate-label {
  font-family: "Segoe UI", "Liberation Sans", "Nimbus Sans", "Avenir Next", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
}

.gate-input {
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.75rem;
  border: 3px solid #1b140f;
  background: #fff6ec;
  color: #1b140f;
  font: 1.05rem "Segoe UI", "Liberation Sans", "Nimbus Sans", "Avenir Next", sans-serif;
}

.gate-error {
  margin: 0.15rem 0 0;
  color: #922333;
  font-family: "Segoe UI", "Liberation Sans", "Nimbus Sans", "Avenir Next", sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
}

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

.gate-submit {
  justify-self: start;
  margin-top: 0.35rem;
  padding: 0.7rem 1.05rem;
  background: #922333;
  color: #fff6ec;
  border: 3px solid #1b140f;
  box-shadow: 4px 4px 0 #1b140f;
  font: 800 1rem "Segoe UI", "Liberation Sans", "Nimbus Sans", "Avenir Next", sans-serif;
  line-height: 1.2;
  cursor: pointer;
}

.gate-submit:hover,
.gate-submit:focus-visible {
  background: #f3ddb0;
  color: #1b140f;
}

.gate-reopen {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 70;
  display: inline-flex;
  padding: 0.28rem;
  background: #f4efe4;
  border: 2px solid #1b140f;
  cursor: pointer;
}

.gate-reopen img {
  width: 1.35rem;
  height: auto;
  display: block;
}

@keyframes gate-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-7px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gate-card.shake {
    animation: none;
  }
}
