:root {
  --page-bg: #eceade;
  --maroon: #76201f;
  --gold: #f4b63d;
  --ink: #2b2b2b;
  --muted: #a7a7ab;
  --line: #d1d1d1;
  --card: #ffffff;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  background: var(--area-background);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Sukhumvit Set", "Prompt", Arial, sans-serif;
}

/* Lock the document itself. Only content inside a future panel may scroll intentionally. */
body {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

button, input { font: inherit; }
button { cursor: pointer; }

/* One fixed phone canvas: full visible height on phones, phone-like size on larger screens. */
.app-shell {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 500px;
  height: min(100vh, 900px);
  height: min(100dvh, 900px);
  min-height: 0;
  max-height: 100vh;
  max-height: 100dvh;
  margin: 0;
  background: var(--page-bg);
  overflow: hidden !important;
  overscroll-behavior: none;
  box-shadow: 0 0 28px color-mix(in srgb, var(--area-text) 8%, transparent);
}

.welcome-section {
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
  padding: max(10px, env(safe-area-inset-top)) clamp(18px, 5.2vw, 26px) max(10px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.brand-row {
  width: 100%;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2.5vw, 14px);
}

.brand-mark {
  width: clamp(105px, 31vw, 142px);
  max-height: 18dvh;
  height: auto;
  object-fit: contain;
  flex: 0 1 auto;
}

.welcome-title {
  min-width: 0;
  /* padding-top: clamp(10px, 2.4dvh, 18px); */
  /* text-align: left; */
}

.welcome-title h1 {
  margin: 0;
  color: var(--maroon);
  font-size: clamp(18px, 5vw, 30px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.8px;
  text-align: center;
}

.character-wrap {
  width: 100%;
  min-height: 0;
  flex: 1 1 0;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: clamp(2px, .8dvh, 6px);
  overflow: hidden;
}

.character {
  width: auto;
  height: 100%;
  max-width: 76%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.tagline {
  flex: 0 0 auto;
  margin: clamp(3px, .8dvh, 10px) 0 clamp(6px, 1.5dvh, 18px);
  text-align: center;
  font-size: clamp(14px, 4vw, 18px);
  line-height: 1.35;
  letter-spacing: clamp(.8px, .42vw, 1.8px);
  font-weight: 400;
  text-transform: none;
}

.find-character-btn {
  text-decoration: none;
  width: 90%;
  min-height: clamp(50px, 9dvh, 74px);
  flex: 0 0 auto;
  border: 1.8px solid var(--area-line);
  border-radius: 40px;
  background: var(--gold);
  color: var(--maroon);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 4vw, 22px);
  padding: 7px 12px;
  font-size: clamp(16px, 4.5vw, 20px);
  font-weight: 700;
  transition: transform .15s ease, box-shadow .15s ease;
}

.find-character-btn:active,
.return-btn:active { transform: scale(.99); }

.find-character-btn:hover {
  box-shadow: 0 7px 16px color-mix(in srgb, var(--area-text) 12%, transparent);
}

.target-icon {
  width: clamp(38px, 12vw, 55px);
  height: clamp(38px, 12vw, 55px);
  position: relative;
  border-radius: 50%;
  flex: 0 0 auto;
}

.target-ring {
  position: absolute;
  inset: 50% auto auto 50%;
  border: 1px solid var(--area-line);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.ring-1 { width: 100%; height: 100%; }
.ring-2 { width: 71%; height: 71%; }
.ring-3 { width: 43%; height: 43%; }
.target-dot {
  position: absolute;
  width: 16%;
  height: 16%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--area-surface);
  border-radius: 50%;
}

.login-card {
  width: 90%;
  flex: 0 0 auto;
  margin-top: clamp(10px, 2dvh, 20px);
  padding: clamp(12px, 2.6dvh, 22px) clamp(20px, 5.2vw, 26px) 15px;
  background: var(--card);
  border: 1.8px solid var(--area-line);
  border-radius: 28px;
  position: relative;
}

.login-head {
  min-height: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: clamp(5px, 1.2dvh, 12px);
}
img.mini-logo {
    width: 100%;
}
.mini-mark {
  width: 34px;
  height: 34px;
  position: relative;
  flex: 0 0 auto;
}

.mini-mark span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  border: 1.6px solid var(--area-line);
  transform: translate(-50%, -50%) rotate(30deg);
  background: transparent;
}

.mini-mark span:nth-child(2) { width: 18px; height: 10px; transform: translate(-50%, -50%) rotate(30deg); }
.mini-mark span:nth-child(3) { width: 10px; height: 18px; transform: translate(-50%, -50%) rotate(30deg); }

.account-note {
  color: var(--maroon);
  font-size: clamp(12px, 4vw, 16px);
  text-align: right;
  white-space: nowrap;
  margin-top: -2px;
}

.field {
  display: block;
  width: 100%;
}

.field input {
  width: 100%;
  border: 0;
  border-bottom: 1.2px solid var(--line);
  outline: none;
  padding: clamp(7px, 1.3dvh, 10px) 0 clamp(8px, 1.5dvh, 12px);
  color: var(--area-text);
  background: transparent;
  font-size: 16px;
}

.field input::placeholder { color: var(--muted); opacity: 1; }
.field input:focus { border-bottom-color: var(--maroon); }

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  margin-top: clamp(4px, 1dvh, 11px);
}

.forgot-btn {
  border: 0;
  background: transparent;
  color: var(--maroon);
  font-size: 15px;
  font-weight: 600;
  padding: 9px 0 11px;
}

.return-btn {
  display: block;
  min-width: min(225px, 85%);
  min-height: 44px;
  margin: clamp(12px, 3.8dvh, 38px) auto -28px;
  padding: 10px 18px;
  border-radius: 28px;
  border: 1.8px solid var(--area-line);
  background: var(--maroon);
  color: var(--area-dark-button-text);
  font-size: 17px;
  font-weight: 700;
  transition: transform .15s ease, box-shadow .15s ease;
}

.return-btn:hover { box-shadow: 0 7px 14px color-mix(in srgb, var(--area-text) 18%, transparent); }

.dev-note {
  width: 100%;
  min-height: 12px;
  flex: 0 0 auto;
  margin: 8px 0 0;
  color: var(--maroon);
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
}

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

/* The account placeholder is also kept inside the phone viewport. */
.register-page {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: max(18px, env(safe-area-inset-top)) clamp(22px, 6vw, 32px) max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.register-step {
  color: var(--maroon);
  font-weight: 800;
  letter-spacing: 1.5px;
}

.register-page span {
  
  font-size: clamp(38px, 7vw, 42px);
  
  
}
.register-page h1 {
  color: var(--home-ink);
  font-size: clamp(29px, 6vw, 33px);
  line-height: 1.5;
  margin: auto 0 0px;
      font-weight: 300;
}
.register-page .register-blurb {
  color: var(--home-ink);
  font-size: clamp(12px, 2vw, 15px);
  line-height: 1.3;
  margin: auto 0 15px;
      font-weight: 300;
    text-align: center;
}

.register-page p { line-height: 1.5; color: var(--area-text); margin: 0; }

.register-back-btn {
  flex: 0 0 auto;
  margin-top: 24px;
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 15px 20px;
  border-radius: 30px;
  border: 1.5px solid var(--area-line);
  background: var(--maroon);
  color: var(--area-dark-button-text);
  font-weight: 700;
}

@media (max-height: 740px) {
  .brand-mark { width: clamp(100px, 28vw, 124px); max-height: 16dvh; }
  .welcome-title { padding-top: 10px; }
  .welcome-title h1 { font-size: clamp(24px, 5.7vw, 32px); }
  .tagline { margin-bottom: 8px; }
  .login-card { padding-top: 10px; padding-bottom: 12px; margin-top: 10px; }
  .login-head { margin-bottom: 4px; }
  .return-btn { margin-top: 16px; }
}

@media (max-height: 620px) {
  .welcome-section { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .brand-mark { width: 88px; max-height: 15dvh; }
  .welcome-title { padding-top: 6px; }
  .welcome-title h1 { font-size: 22px; }
  .tagline { font-size: 13px; line-height: 1.22; margin: 2px 0 5px; }
  .find-character-btn { min-height: 44px; font-size: 15px; }
  .target-icon { width: 34px; height: 34px; }
  .login-card { padding: 8px 16px 10px; margin-top: 7px; border-radius: 21px; }
  .login-head { min-height: 24px; }
  .mini-mark { width: 26px; height: 26px; }
  .field input { padding: 5px 0 6px; font-size: 14px; }
  .password-row { margin-top: 2px; }
  .forgot-btn { padding: 5px 0 6px; font-size: 13px; }
  .return-btn { min-height: 36px; margin-top: 10px; margin-bottom: -22px; padding: 6px 12px; font-size: 14px; }
  .dev-note { margin-top: 5px; font-size: 11px; }
}


/* Final viewport guard: these screens are app-like, not scrollable web documents. */
html, body {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

.app-shell,
.welcome-section,
.questionnaire-page,
.character-result-page,
.register-page {
  min-height: 0;
  overflow: hidden !important;
}

@media (max-height: 700px) {
  .app-shell { height: 100vh; height: 100dvh; }
  .welcome-section { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .character-wrap { margin-top: 0; margin-bottom: 0; }
  .tagline { margin-top: 2px; margin-bottom: 6px; line-height: 1.25; }
  .find-character-btn { min-height: 44px; }
  .login-card { margin-top: 8px; }
  .dev-note { margin-top: 3px; }
}

@media (max-height: 560px) {
  .brand-row { max-height: 17dvh; }
  .brand-mark { width: 76px; max-height: 13dvh; }
  .welcome-title { padding-top: 3px; }
  .welcome-title h1 { font-size: 20px; line-height: 1.04; }
  .tagline { font-size: 12px; line-height: 1.15; margin: 1px 0 4px; }
  .find-character-btn { min-height: 39px; padding-top: 4px; padding-bottom: 4px; font-size: 14px; }
  .target-icon { width: 30px; height: 30px; }
  .login-card { padding: 6px 14px 8px; margin-top: 5px; }
  .login-head { min-height: 20px; margin-bottom: 2px; }
  .mini-mark { width: 23px; height: 23px; }
  .account-note { font-size: 9px; }
  .field input { padding: 4px 0 5px; font-size: 14px; }
  .password-row { margin-top: 0; }
  .forgot-btn { font-size: 12px; padding: 4px 0 5px; }
  .return-btn { min-height: 32px; margin-top: 7px; margin-bottom: -20px; padding: 5px 10px; font-size: 13px; }
}

/* Login result feedback */
.dev-note.is-success { color: var(--area-text); }
