:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #131f1e;
  color: #f5eee0;
  --muted: #bdc7bd;
  --gold: #efc491;
  --line: #3e534b;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.gate { min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 500px); }
.village {
  position: relative;
  overflow: hidden;
  background: linear-gradient(0deg,#142120e8 0%,transparent 26%),
              url("./brambleford-at-dusk.png") 43% center / cover;
}
.village::before, .entry::before {
  position: absolute;
  content: "";
  inset: 18px;
  border: 37px solid transparent;
  border-image: url("./oath-frame.png") 245 fill / 37px / 0 stretch;
  pointer-events: none;
}
.logo {
  position: absolute;
  z-index: 1;
  inset: 10% 0 auto;
  display: block;
  margin-inline: auto;
  width: min(43%, 390px);
  max-height: 48%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 22px #081612bf);
}
.location { position: absolute; left: clamp(24px, 4vw, 65px); bottom: 28px; color: #f4d6b0; font: 1.2rem Georgia, serif; }
.location span { color: #a48968; padding: 0 8px; }
.entry {
  margin: auto 0;
  padding: 48px clamp(28px, 5vw, 70px);
  background: linear-gradient(140deg,#1b2a25,#131f1e 65%);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid #9e7c53;
  margin: 18px;
  margin-left: 0;
  min-height: calc(100% - 36px);
  box-shadow: inset 0 0 0 3px #142120, inset 0 0 0 4px #6c5539, 0 10px 25px #081513;
  position: relative;
}
.entry::before { inset: -5px; border-width: 28px; border-image-width: 28px; }
.crest { display: grid; place-items: center; height: 1px; background: linear-gradient(90deg,transparent,#c59a64,transparent); margin: 7px 0 25px; }
.crest span { width: 12px; height: 12px; border: 1px solid var(--gold); transform: translateY(-6px) rotate(45deg); background: #9c7849; box-shadow: 0 0 0 3px #1b2a25; }
h1, h2 { font-family: Georgia, serif; font-weight: 400; }
h1 { font-size: clamp(2.2rem, 3.6vw, 3.15rem); line-height: 1.04; letter-spacing: -.04em; margin: 8px 0 12px; }
.intro, .existing, .success p { color: var(--muted); line-height: 1.55; }
.intro { margin: 0 0 24px; }
form { display: grid; }
.modes { display: grid; grid-template-columns: 1fr 1.5fr; gap: 6px; margin-bottom: 23px; }
.modes button, #sign-out {
  margin: 0; background: #1a2925; box-shadow: inset 0 0 0 2px #172321;
  color: #f3e3c7; justify-content: center; border-color: #746141; font: 600 .86rem "Segoe UI", system-ui, sans-serif;
}
.modes button[aria-pressed="true"], .modes button:hover, #sign-out:hover { background: #31443c; border-color: #dfb882; }
.invite-field { display: grid; margin-top: 12px; }
#password { margin-bottom: 5px; }
label { font-size: .88rem; font-weight: 650; margin-bottom: 6px; }
input, button { font: inherit; width: 100%; border-radius: 5px; min-height: 46px; }
input { background: #101d1a; color: #fcf5e9; border: 1px solid #8c7453; box-shadow: inset 0 1px 5px #0b1513; padding: 8px 11px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.help { font-size: .78rem; color: var(--muted); margin: 6px 0 15px; }
button {
  margin-top: 19px; padding: 10px 14px; color: #211c15; border: 1px solid #f2ca95;
  cursor: pointer; font: bold 1.03rem Georgia, serif; background: linear-gradient(#f7d7a2,#bb8c52);
  display: flex; justify-content: space-between; align-items: center; box-shadow: inset 0 0 0 2px #7f633a72, 0 3px 0 #6c5032;
}
button:hover { background: #efc491; }
button:disabled { opacity: .65; cursor: wait; }
.launcher {
  color: #211c15;
  background: linear-gradient(#f7d7a2,#bb8c52);
  font: 1.02rem Georgia, serif;
  padding: 12px 10px;
  border: 1px solid #91734e;
  box-shadow: inset 0 0 0 2px #1c2822;
  text-align: center;
  text-underline-offset: 3px;
}
.launcher:hover { background: #f7d7a2; }
.existing { margin: 8px 0 20px; font-size: .85rem; }
.error { color: #ffc1af; margin: 12px 0 0; font-size: .9rem; }
.download-panel { display: grid; }
@media (max-width: 740px) {
  .gate { display: flex; flex-direction: column; }
  .village { min-height: clamp(205px, 38svh, 300px); background-position: 43% 54%; }
  .village::before { inset: 7px; border-width: 22px; border-image-width: 22px; }
  .logo { max-height: 70%; width: min(59%,255px); }
  .location { bottom: 12px; left: 23px; margin: 0; font-size: .92rem; }
  .entry { margin: 0 9px 9px; min-height: auto; padding: 26px max(24px, 7vw) 35px; }
}
