:root {
  color-scheme: light;
  --ink: #15231f;
  --muted: #66716d;
  --paper: #f4f0e7;
  --surface: rgba(255, 255, 255, 0.82);
  --line: rgba(21, 35, 31, 0.12);
  --green: #1f5c48;
  --green-deep: #153f33;
  --sage: #d9e5d8;
  --sand: #eadfc9;
  --error: #a2352e;
  --success: #176846;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(255, 255, 255, 0.95), transparent 34%),
    radial-gradient(circle at 92% 88%, rgba(195, 214, 197, 0.72), transparent 35%),
    var(--paper);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(42px, 10vh, 86px);
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: white;
  background: var(--green);
  letter-spacing: 0;
  font-family: Georgia, serif;
  font-size: 17px;
}

.panel {
  padding: clamp(28px, 7vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(37, 52, 45, 0.1);
  backdrop-filter: blur(16px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 800;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(30px, 8vw, 42px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.12;
}

h2 {
  margin-bottom: 10px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 28px;
  font-weight: 500;
}

.lede {
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.verify-form label {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 700;
}

.pin-row {
  position: relative;
}

.pin-row input {
  width: 100%;
  height: 64px;
  padding: 0 82px 0 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.34em;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.pin-row input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(31, 92, 72, 0.1);
}

.pin-row input::placeholder {
  color: #aab1ae;
  letter-spacing: 0.24em;
}

.icon-button {
  position: absolute;
  top: 50%;
  right: 10px;
  min-width: 58px;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  color: var(--green);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  transform: translateY(-50%);
}

.hint {
  margin: 9px 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.primary-button,
.secondary-button {
  min-height: 54px;
  border: 0;
  border-radius: 15px;
  font-weight: 750;
  cursor: pointer;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 20px;
  color: white;
  background: var(--green);
  box-shadow: 0 12px 24px rgba(31, 92, 72, 0.18);
}

.primary-button:active,
.door-button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.56;
}

.status {
  min-height: 21px;
  margin: 15px 0 -7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.status.error {
  color: var(--error);
}

.status.success {
  color: var(--success);
}

.controls-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.text-button {
  padding: 8px 0 8px 16px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}

.door-grid {
  display: grid;
  gap: 14px;
}

.door-button {
  display: grid;
  grid-template-columns: 64px 1fr 24px;
  align-items: center;
  gap: 15px;
  width: 100%;
  min-height: 105px;
  padding: 18px;
  border: 1px solid rgba(21, 35, 31, 0.08);
  border-radius: 20px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.door-button:hover {
  box-shadow: 0 10px 28px rgba(28, 46, 39, 0.09);
}

.door-button.lobby {
  background: linear-gradient(135deg, #e6eee3, #d7e5da);
}

.door-button.basement {
  background: linear-gradient(135deg, #f2e8d5, #e8dbc1);
}

.floor {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(21, 35, 31, 0.12);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 22px;
}

.door-copy {
  display: grid;
  gap: 5px;
}

.door-copy strong {
  font-size: 18px;
}

.door-copy small {
  color: var(--muted);
  letter-spacing: 0.08em;
  font-size: 9px;
  font-weight: 700;
}

.arrow {
  color: var(--green);
  font-size: 20px;
}

.unlock-status {
  margin-top: 18px;
  text-align: center;
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 28px;
  color: #7b837f;
  font-size: 11px;
}

.secure-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(23, 104, 70, 0.1);
}

dialog {
  width: min(calc(100% - 36px), 420px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  color: var(--ink);
  background: transparent;
  box-shadow: 0 26px 90px rgba(14, 27, 22, 0.3);
}

dialog::backdrop {
  background: rgba(10, 20, 17, 0.48);
  backdrop-filter: blur(5px);
}

.dialog-card {
  padding: 28px;
  border-radius: 24px;
  background: #fbfaf7;
}

.dialog-card > p:not(.eyebrow) {
  margin-bottom: 24px;
  color: var(--muted);
  line-height: 1.65;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
}

.dialog-actions .primary-button {
  justify-content: center;
}

.secondary-button {
  color: var(--ink);
  background: #ebece9;
}

.danger {
  background: var(--green-deep);
}

[hidden] {
  display: none !important;
}

@media (max-width: 370px) {
  .shell {
    padding-inline: 14px;
  }

  .panel {
    padding: 24px;
    border-radius: 23px;
  }

  .door-button {
    grid-template-columns: 54px 1fr 18px;
    padding: 14px;
  }

  .floor {
    width: 50px;
    height: 50px;
    font-size: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

