:root {
  --navy: #071944;
  --navy-deep: #020b25;
  --gold: #ffe568;
  --gold-deep: #d19a10;
  --red: #9b160e;
  --red-deep: #5d0908;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: "Noto Serif TC", "PingFang TC", "Microsoft JhengHei", serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

.gate-page {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 0;
  overflow-x: hidden;
  color: var(--gold);
  background: #020715;
}

.gate-stage {
  position: relative;
  width: min(100vw, 560px);
  aspect-ratio: 941 / 1672;
  overflow: hidden;
  background: var(--navy);
  box-shadow: 0 0 80px rgba(0,0,0,.75);
}

.gate-art { display: block; width: 100%; height: 100%; object-fit: cover; }

.gate-box {
  position: absolute;
  z-index: 2;
  top: 43.1%;
  left: 20.4%;
  width: 59.2%;
  height: 13.9%;
  display: grid;
  place-items: center;
  padding: 2.5% 4% 4.2%;
  background:
    radial-gradient(circle at 50% 0, rgba(34,93,166,.2), transparent 48%),
    linear-gradient(180deg, #092358, #06153c 72%, #030d2d);
  border: 0;
  outline: 0;
  box-shadow: inset 0 0 22px rgba(0,0,0,.72);
}

.gate-choice, .exit-panel { width: 100%; text-align: center; }

.gate-prompt {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(32px, 7.4vw, 44px);
  margin-bottom: clamp(9px, 2.4vw, 14px);
}

.gate-choice h1 {
  margin: 0;
  color: #ffeb77;
  font-size: clamp(18px, 4.6vw, 27px);
  font-weight: 900;
  letter-spacing: .065em;
  line-height: 1.15;
  -webkit-text-stroke: .45px #6d2600;
  text-shadow:
    0 1px 0 #fff8bd,
    0 2px 0 #b97008,
    0 3px 1px #4e1200,
    0 0 5px rgba(255,190,42,.48);
  white-space: nowrap;
}

.gate-actions {
  width: 88%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6%;
}

.gate-button {
  min-height: clamp(34px, 7.3vw, 43px);
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: .18em;
}

.gate-button {
  color: #fff278;
  border: 2px solid #f5b925;
  background: linear-gradient(180deg, #b72819, #7d0c0a 58%, #4f0607);
  box-shadow: inset 0 0 0 2px rgba(79,9,4,.72), inset 0 0 13px rgba(255,121,30,.25), 0 3px 7px rgba(0,0,0,.55);
  font-size: clamp(16px, 4.35vw, 24px);
  font-weight: 700;
  text-shadow: 0 2px 2px #671107;
}

.gate-button:active { transform: translateY(1px); }

.gate-choice[hidden], .exit-panel[hidden], .password-field[hidden] { display: none; }

.password-field {
  position: relative;
  display: block;
  width: 88%;
  padding: 2px;
  border: 2px solid #f4c847;
  border-radius: 5px;
  background: linear-gradient(135deg, #8a4100, #ffd95a 23%, #a85a04 50%, #ffe47b 77%, #8a4100);
  box-shadow: 0 2px 5px rgba(0,0,0,.5), 0 0 7px rgba(255,201,59,.42);
}

.password-field input {
  width: 100%;
  min-height: clamp(34px, 7vw, 41px);
  padding: 0 5%;
  color: #4d4a45;
  border: 1px solid rgba(126,76,7,.36);
  border-radius: 2px;
  outline: none;
  background: linear-gradient(180deg, #fff, #f7f4eb);
  box-shadow: inset 0 1px 4px rgba(70,55,25,.2);
  font-family: "Noto Serif TC", "PingFang TC", "Microsoft JhengHei", serif;
  font-size: clamp(14px, 3.6vw, 19px);
  letter-spacing: .08em;
  text-align: center;
}

.password-field input::placeholder { color: #8e8b84; opacity: 1; }
.password-field input:focus { border-color: #fff0a0; box-shadow: inset 0 1px 4px rgba(70,55,25,.2), 0 0 0 2px rgba(255,224,107,.24); }

.password-error {
  position: absolute;
  right: 2%;
  bottom: -1.5em;
  left: 2%;
  min-height: 1.2em;
  margin: 0;
  color: #ffd4b6;
  font-size: clamp(9px, 2.2vw, 12px);
  text-shadow: 0 1px 2px #260000;
}

.exit-panel p { margin: 0 0 5%; font-size: clamp(19px, 5vw, 30px); letter-spacing: .16em; }
.exit-panel small { color: rgba(240,223,155,.7); font-size: clamp(11px, 2.8vw, 15px); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (min-width: 620px) {
  .gate-page { padding: 26px 0; }
  .gate-stage { border-radius: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
