/* Login and registration landing. Loaded after the game HUD styles so this screen can use
   the same palette without inheriting the small in-game map card layout. */
body:has(#auth:not([hidden])) #intro-bg::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(24, 32, 29, .88), rgba(31, 38, 32, .58) 48%, rgba(32, 31, 26, .37));
}
#auth.auth-shell {
  box-sizing: border-box; position: fixed; inset: 0; top: 0; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  align-items: center; gap: clamp(36px, 7vw, 116px);
  width: 100%; max-width: none; height: 100dvh; max-height: none;
  margin: 0; padding: max(30px, env(safe-area-inset-top)) clamp(26px, 7vw, 110px) max(30px, env(safe-area-inset-bottom));
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  border: 0; border-image: none; border-radius: 0; background: transparent;
  backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; transform: none;
}
#auth .auth-story { max-width: 610px; color: #fff8e8; text-shadow: 0 2px 14px rgba(19, 24, 20, .38); }
#auth .auth-story-kicker {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px;
  color: #f0d9aa; font: 700 12px/1.3 var(--font-body); letter-spacing: .17em; text-transform: uppercase;
}
#auth .auth-story-kicker::before { content: ''; width: 27px; height: 1px; background: #e6ca92; }
#auth .auth-story h1 {
  max-width: 11ch; margin: 0 0 20px; color: #fff8e8;
  font: 700 clamp(39px, 5.1vw, 76px)/1.08 var(--font-display); letter-spacing: -.045em;
}
#auth .auth-story-lead { max-width: 49ch; margin: 0 0 34px; color: #fff2dc; font: 400 clamp(15px, 1.4vw, 18px)/1.6 var(--font-body); }
#auth .auth-story-features { display: grid; gap: 0; max-width: 490px; margin: 0; padding: 0; list-style: none; }
#auth .auth-story-features li { display: flex; align-items: baseline; gap: 16px; padding: 13px 0; border-top: 1px solid rgba(255, 239, 205, .27); }
#auth .auth-story-features li > span { flex: none; color: #e9c77f; font: 700 12px/1 var(--font-display); }
#auth .auth-story-features p { margin: 0; color: #fff3df; font: 500 14px/1.45 var(--font-body); }
#auth .auth-story-features b { color: inherit; }

#auth .auth-card {
  position: relative; box-sizing: border-box; width: 100%; padding: clamp(23px, 3vw, 36px);
  overflow: hidden; color: var(--ink); text-shadow: none;
  border: 8px solid transparent; border-radius: 0;
  border-image-source: url('ui/panel_beige.png');
  border-image-slice: 8;
  border-image-repeat: stretch;
  background: var(--surface);
  box-shadow: 0 24px 75px rgba(15, 22, 21, .34), inset 0 1px rgba(255,255,255,.55);
}
#auth .auth-card-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#auth .brand-lockup { margin: 0; gap: 8px; }
#auth .brand-lockup img { width: 38px; height: 38px; }
#auth .auth-brand-name { color: #342414; font: 700 25px/1 var(--font-display); letter-spacing: -.02em; }
#auth .auth-language { display: flex; align-items: center; gap: 5px; margin: 0; color: #674e34; font: 600 11px/1.2 var(--font-body); }
#auth .auth-language select {
  width: 116px; max-width: 116px; min-height: 38px; margin: 0; padding: 6px 7px;
  border: 1px solid #cdbb9b; border-radius: 8px; background: #fffdf8; color: #342414;
  font: 600 12px/1 var(--font-body);
}
#auth .auth-card-promise { margin: 14px 0 25px; color: #785c3d; font: 500 14px/1.4 var(--font-body); }
#auth .auth-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: 0 0 25px; padding: 6px;
  border: 6px solid transparent; border-radius: 0;
  border-image-source: url('ui/panelInset_beige.png'); border-image-slice: 6; border-image-repeat: stretch;
  background: var(--surface-inset); }
#auth .auth-tabs button {
  min-width: 0; min-height: 42px; padding: 8px 10px; border: 0; border-image: none; border-radius: 0;
  background: transparent; box-shadow: none; color: var(--muted); font: 700 13px/1.2 var(--font-body);
}
#auth .auth-tabs button.on {
  border: 6px solid transparent;
  border-image-source: url('ui/buttonSquare_beige.png'); border-image-slice: 6; border-image-repeat: stretch;
  background: var(--btn-beige); color: var(--ink); box-shadow: none;
}
#auth .auth-tabs button:hover:not(.on) { background: rgba(255, 253, 248, .55); }
#auth form { margin: 0; }
#auth .turnstile { display: flex; justify-content: center; margin: 0 0 18px; min-height: 65px; }
#auth form label { display: block; margin: 0 0 15px; color: #4e3a27; font: 700 13px/1.4 var(--font-body); }
#auth form label .hint { display: block; margin: 4px 0 0; font: 400 11px/1.4 var(--font-body); }
#auth form input {
  box-sizing: border-box; display: block; width: 100%; min-height: 48px; margin: 7px 0 0; padding: 6px 9px;
  border: 6px solid transparent; border-radius: 0;
  border-image-source: url('ui/panelInset_beige.png'); border-image-slice: 6; border-image-repeat: stretch;
  background: #fffdf8; color: var(--ink);
  font: 500 15px/1.3 var(--font-body);
}
#auth form input:hover { filter: brightness(.985); }
#auth form input:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
#auth form button[type=submit] {
  width: 100%; min-height: 49px; margin-top: 8px; padding: 8px 15px;
  border: 8px solid transparent; border-image: none; border-radius: 0;
  border-image-source: url('ui/buttonLong_beige.png'); border-image-slice: 8; border-image-repeat: stretch;
  background: var(--btn-beige); color: var(--ink);
  box-shadow: none; font: 700 14px/1.2 var(--font-body);
}
#auth form button[type=submit]:hover:enabled { filter: brightness(1.05); }
#auth form button[type=submit]:active:enabled { border-image-source: url('ui/buttonLong_beige_pressed.png'); filter: brightness(.95); }
#auth form button[type=submit]:disabled { opacity: .7; cursor: wait; }
#auth .auth-form-error { margin: 0 0 10px; padding: 9px 11px; border: 1px solid #d7a79a; border-radius: 8px;
  background: #fff0ea; color: #78301f; font: 600 12px/1.4 var(--font-body); }
#auth .auth-social { margin-top: 18px; }
#auth .auth-social-divider { display: flex; align-items: center; gap: 12px; margin: 0 0 12px;
  color: #786247; font: 600 11px/1.2 var(--font-body); text-align: center; }
#auth .auth-social-divider::before, #auth .auth-social-divider::after { content: ''; flex: 1; height: 1px; background: #dfd2bc; }
#auth .auth-social-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
#auth .auth-provider { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; min-height: 48px;
  padding: 8px 10px; border: 1px solid #747775; border-radius: 8px; background: #fff; color: #1f1f1f;
  text-align: center; text-decoration: none; font: 600 12px/1.2 var(--font-body); }
#auth .auth-provider img { flex: none; width: 20px; height: 20px; }
#auth .auth-provider-steam { border-color: #3f4b59; background: #263440; color: #fff; }
#auth .auth-provider:hover[href] { box-shadow: 0 3px 12px rgba(37, 33, 25, .15); }
#auth .auth-provider[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
#auth .auth-provider small { display: block; font-size: 9px; font-weight: 500; }
#auth #auth-social-error { margin: 10px 0 0; }
#auth .register-consent { display: grid; grid-template-columns: 18px 1fr; gap: 3px 8px; margin: 3px 0 14px; font: 400 11px/1.45 var(--font-body); }
#auth .register-consent input { box-sizing: border-box; width: 16px; min-width: 16px; height: 16px; min-height: 16px;
  margin: 2px 0 0; padding: 0; box-shadow: none; accent-color: #76502d; }
#auth .register-consent label { margin: 0; font: 400 11px/1.45 var(--font-body); }
#auth .register-consent a { color: #6d4c2b; }
#auth .auth-card-footer { margin-top: 25px; padding-top: 16px; border-top: 1px solid #e0d2bc; }
#auth .auth-card-footer p { margin: 0 0 10px; color: #765d41; font: 400 11px/1.45 var(--font-body); }
#auth .auth-card-footer :is(.auth-site-links, .auth-legal-links) { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; padding: 0; border: 0; }
#auth .auth-card-footer .auth-site-links { margin-bottom: 6px; }
#auth .auth-card-footer a { color: #6d4c2b; font: 700 11px/1.4 var(--font-body); text-underline-offset: 3px; }

@media (max-width: 850px) {
  body:has(#auth:not([hidden])) #intro-bg::after { background: linear-gradient(180deg, rgba(25, 31, 27, .74), rgba(29, 34, 29, .44) 38%, rgba(32, 31, 26, .56)); }
  #auth.auth-shell { display: flex; flex-direction: column; justify-content: flex-start; gap: 16px;
    padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom)); }
  #auth .auth-story { width: min(100%, 470px); margin: 0 auto; }
  #auth .auth-story-kicker { margin-bottom: 9px; font-size: 10px; }
  #auth .auth-story h1 { max-width: 24ch; margin-bottom: 0; font-size: clamp(26px, 7vw, 36px); line-height: 1.18; }
  #auth .auth-story-lead, #auth .auth-story-features { display: none; }
  #auth .auth-card { flex-shrink: 0; width: min(100%, 470px); margin: 0 auto; padding: 22px; }
  #auth .auth-card-promise { margin: 12px 0 18px; }
  #auth .auth-tabs { margin-bottom: 19px; }
}
@media (max-width: 360px) { #auth .auth-social-options { grid-template-columns: 1fr; } }
@media (max-width: 390px) {
  #auth.auth-shell { padding-inline: 12px; }
  #auth .auth-card { padding: 18px; }
  #auth .auth-brand-name { font-size: 21px; }
  #auth .auth-language span { display: none; }
  #auth .auth-language select { width: 103px; }
}
@media (max-width: 850px) and (max-height: 700px) {
  #auth .auth-story { display: none; }
  #auth.auth-shell { justify-content: center; }
  #auth .auth-card { margin-block: auto; }
}
@media (max-height: 560px) and (min-width: 851px) {
  #auth.auth-shell { align-items: start; }
  #auth .auth-story-features { display: none; }
}
body.keyboard-open #auth.auth-shell { top: var(--visible-top, 0px); height: var(--visible-h, 100dvh); max-height: none; }
@media (prefers-reduced-motion: reduce) { #auth form button[type=submit] { transition: none; } }
