:root {
  color-scheme: light;
  --forest: #315f28;
  --forest-deep: #24491f;
  --sage: #769152;
  --gold: #c9a34f;
  --ink: #3d3425;
  --muted: #736956;
  --paper: #fff8e7;
  --paper-soft: #f8f1dd;
  --danger: #9b392f;
  --shadow: 0 24px 65px rgba(10, 25, 20, 0.34), 0 4px 12px rgba(51, 37, 20, 0.2);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-width: 320px; min-height: 100%; }

body {
  background: #152820;
  color: var(--ink);
  font-family: "Nunito", system-ui, sans-serif;
}

button, input { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }

.material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "liga";
}

.gate-shell {
  position: relative;
  width: min(100%, 834px);
  min-height: 1194px;
  margin: 0 auto;
  overflow: hidden;
  background: #182c25;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.35);
}

.gate-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.unlock-card {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 414px;
  width: 666px;
  min-height: 708px;
  transform: translateX(-50%);
  padding: 104px 54px 26px;
  border: 1px solid rgba(187, 150, 74, 0.46);
  border-radius: 30px 30px 16px 16px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.family-portraits {
  position: absolute;
  z-index: 3;
  top: -88px;
  left: 50%;
  width: 520px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 150px 1fr 150px;
  align-items: end;
  gap: 22px;
}

.portrait-choice {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--forest-deep);
  cursor: pointer;
}

.portrait-choice img {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid var(--paper);
  box-shadow: 0 0 0 3px var(--gold), 0 9px 24px rgba(49, 41, 22, 0.25);
}

.portrait-choice strong {
  min-width: 122px;
  padding: 5px 12px;
  border: 1px solid rgba(180, 140, 61, 0.35);
  border-radius: 999px;
  background: var(--paper);
  font-family: "Lora", Georgia, serif;
  font-size: 18px;
}

.portrait-choice.is-selected img { box-shadow: 0 0 0 5px #608c3d, 0 9px 24px rgba(49, 41, 22, 0.25); }

.family-keys {
  align-self: center;
  width: 100%;
  height: 126px;
  object-fit: cover;
  object-position: center;
  mix-blend-mode: multiply;
}

.unlock-copy { text-align: center; }
.eyebrow { margin: 0 0 7px; color: #96783d; font-size: 10px; font-weight: 900; letter-spacing: .16em; }
.unlock-copy h1 { margin: 0; color: var(--forest-deep); font-family: "Lora", Georgia, serif; font-size: 35px; line-height: 1.15; letter-spacing: -.02em; }
.unlock-copy > p { margin: 8px 0 0; font-family: "Lora", Georgia, serif; font-size: 17px; }
.unlock-copy > small { display: block; margin: 13px auto 0; max-width: 430px; color: var(--muted); font-size: 12px; line-height: 1.45; }

.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0 18px; }
.role-button {
  position: relative;
  min-height: 74px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 17px;
  border: 2px solid rgba(87, 116, 62, 0.24);
  border-radius: 18px;
  background: #fffaf0;
  color: var(--forest-deep);
  font-family: "Lora", Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}
.role-button > .material-symbols-rounded:first-child { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #eef0d9; font-size: 22px; }
.role-button .check-mark { opacity: 0; color: var(--forest); font-size: 24px; }
.role-button.is-selected { border-color: #638b45; background: #f4f4dc; box-shadow: 0 0 0 3px rgba(99, 139, 69, 0.14); }
.role-button.is-selected .check-mark { opacity: 1; }
.role-prompt { margin: -7px 0 13px; color: #8a6630; font-size: 11px; font-weight: 800; text-align: center; }
.role-prompt.is-selected { color: var(--forest); }

fieldset { margin: 0; padding: 0; border: 0; text-align: center; }
legend { width: 100%; color: var(--forest-deep); font-family: "Lora", Georgia, serif; font-size: 17px; font-weight: 700; }
.code-help { margin: 3px 0 10px; color: var(--muted); font-size: 11px; }
.single-code-field {
  width: min(100%, 420px);
  min-height: 62px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
  padding: 0 12px 0 16px;
  border: 2px solid rgba(116, 98, 55, 0.28);
  border-radius: 16px;
  background: #fffdf5;
}
.single-code-field:focus-within { outline: 3px solid rgba(201, 163, 79, 0.34); border-color: var(--gold); }
.single-code-field > .material-symbols-rounded { color: var(--forest); font-size: 23px; }
.single-code-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--forest-deep);
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  letter-spacing: .34em;
  caret-color: var(--forest);
}
.single-code-field input::placeholder { color: #9b927c; font-size: 15px; font-weight: 700; letter-spacing: .08em; }
.single-code-field button { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #efe7d1; color: var(--forest-deep); cursor: pointer; }

.remember-choice { width: fit-content; display: flex; align-items: center; gap: 8px; margin: 13px auto 14px; color: var(--muted); font-size: 12px; cursor: pointer; }
.remember-choice input { width: 19px; height: 19px; accent-color: var(--forest); }
.remember-choice .material-symbols-rounded { font-size: 19px; color: var(--forest); }

.unlock-button {
  width: 100%;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 0;
  border-radius: 999px;
  background: #4e7c31;
  box-shadow: 0 7px 0 #315722, 0 12px 24px rgba(38, 75, 30, 0.25);
  color: #fffdf0;
  font-family: "Lora", Georgia, serif;
  font-size: 21px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.unlock-button:hover { transform: translateY(-2px); }
.unlock-button:active { transform: translateY(4px); box-shadow: 0 3px 0 #315722, 0 7px 15px rgba(38, 75, 30, 0.22); }
.unlock-button:disabled { cursor: not-allowed; opacity: .55; transform: none; box-shadow: 0 4px 0 #546b45; }
.unlock-button .material-symbols-rounded { font-size: 27px; }
.form-status { min-height: 21px; margin: 9px 0 0; color: var(--danger); font-size: 12px; font-weight: 800; text-align: center; }
.form-status.is-success { color: var(--forest); }

.public-link { width: fit-content; display: flex; align-items: center; gap: 5px; margin: 0 auto; color: var(--forest); font-family: "Lora", Georgia, serif; font-size: 13px; font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.public-link .material-symbols-rounded { font-size: 18px; }

.trust-row { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 13px; color: #4e6840; font-size: 11px; }
.trust-row > span { display: flex; align-items: center; gap: 6px; }
.trust-row .material-symbols-rounded { font-size: 18px; }
.trust-row i { height: 20px; border-left: 1px solid rgba(102, 95, 68, 0.34); }

:focus-visible { outline: 3px solid #edc25e; outline-offset: 4px; }

@media (max-width: 700px) {
  .gate-shell { min-height: 1180px; }
  .gate-art { object-position: center top; }
  .unlock-card { top: 350px; width: calc(100% - 28px); min-height: 780px; padding: 88px 22px 24px; }
  .family-portraits { top: -68px; width: calc(100% - 42px); grid-template-columns: 95px 1fr 95px; gap: 7px; }
  .portrait-choice img { width: 88px; height: 88px; border-width: 4px; }
  .portrait-choice strong { min-width: 85px; padding: 4px 8px; font-size: 13px; }
  .family-keys { height: 90px; }
  .unlock-copy h1 { font-size: 28px; }
  .unlock-copy > p { font-size: 15px; }
  .role-switch { gap: 9px; }
  .role-button { min-height: 67px; padding: 9px; font-size: 15px; }
  .role-button > .material-symbols-rounded:first-child { display: none; }
  .single-code-field { min-height: 58px; }
  .single-code-field input { font-size: 22px; }
  .unlock-button { min-height: 61px; font-size: 18px; }
  .trust-row { gap: 9px; font-size: 9px; }
}

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