/* 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. The look of the default (iso, theme A) screen
   is in ui-modern-a-screens.css; this file keeps the layout, the poster and the entrance motion for every theme. */
/* Backdrop: a still of the iso city (auth-ui.js sets the src). A slow push-in, the card and the story rise once. */
#intro-bg { overflow: hidden; background: #0b0e14; }
#intro-bg #intro-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 58% 50%;
  transform-origin: 50% 40%; animation: auth-drift 28s cubic-bezier(.2, .6, .25, 1) both; }
/* First paint, before any script: the brand on the dark ground (index.html). The still lies over it once loaded; it is the page's LCP. */
#intro-bg .landing-splash { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: #f3e7d0; font: 700 46px/1 Georgia, 'Times New Roman', serif; letter-spacing: .08em; }
#intro-bg .landing-splash img { width: 72px; height: 72px; }
@keyframes auth-drift { from { transform: scale(1.09); } to { transform: scale(1); } }
@keyframes auth-rise { from { opacity: 0; transform: translateY(16px); } }
#auth:not([hidden]) .auth-card { animation: auth-rise .7s .08s cubic-bezier(.2, .7, .25, 1) both; }
#auth:not([hidden]) .auth-story { animation: auth-rise .9s .22s cubic-bezier(.2, .7, .25, 1) both; }
@media (orientation: portrait) { #intro-bg #intro-poster { object-position: 50% 0; transform-origin: 50% 20%; } }
@media (prefers-reduced-motion: reduce) { #intro-bg #intro-poster, #auth:not([hidden]) :is(.auth-card, .auth-story) { animation: none; } }
/* The reel (auth-ui.js): two clips over the still. The incoming one (.top) fades in above the other, which then pauses under it. */
#intro-bg video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
#intro-bg video.on { opacity: 1; }
#intro-bg video.top { z-index: 1; }
#intro-bg:has(video.on) #intro-poster { visibility: hidden; transition: visibility 0s 1.2s; } /* under a clip the still (and its push-in) stops painting, once the first fade is over */
body:has(#auth:not([hidden])) #intro-bg::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; /* the veil stays above the reel's clips */
  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);
  grid-template-rows: minmax(min-content, 1fr) auto; align-items: center; gap: clamp(36px, 7vw, 116px); row-gap: 20px; /* row 2: the page footer; min-content because the overflow:hidden card would else shrink to 0 and sit on it */
  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; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
#auth .brand-lockup { margin: 0; gap: 8px; }
#auth .brand-lockup img { width: 48px; height: 48px; }
#auth .auth-brand-name { color: #342414; font: 700 25px/1 var(--font-display); letter-spacing: -.02em; }
#auth .auth-card-promise { margin: 14px 0 25px; color: #785c3d; font: 500 14px/1.4 var(--font-body); }
#auth .auth-guest { margin: -10px 0 20px; }
#auth .auth-guest button {
  box-sizing: border-box; width: 100%; min-height: 42px; padding: 8px 10px; /* same look as the active .auth-tabs button.on */
  border: 6px solid transparent; border-image-source: url('ui/buttonSquare_beige.png'); border-image-slice: 6; border-image-repeat: stretch; border-radius: 0;
  background: var(--btn-beige); box-shadow: none; color: var(--ink); font: 700 13px/1.2 var(--font-body);
}
#auth .auth-guest button:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
#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;
}
@media (hover: hover) { #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 12px/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 16px/1.3 var(--font-body);
}
@media (hover: hover) { #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);
}
@media (hover: hover) { #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 12px/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-apple { grid-column: 1 / -1; border-color: #000; background: #000; color: #fff; font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
#auth .apple-logo { font: 24px/1 -apple-system, BlinkMacSystemFont, sans-serif; }
@media (hover: hover) { #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: 12px; 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 12px/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 12px/1.45 var(--font-body); }
#auth .register-consent a { color: #6d4c2b; }
#auth .auth-social-terms { margin: 10px 0 0; font: 400 12px/1.45 var(--font-body); text-align: center; overflow-wrap: anywhere; }
#auth .auth-social-terms a { color: #6d4c2b; text-decoration: underline; text-underline-offset: 2px; }
#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 12px/1.45 var(--font-body); }
/* store buttons: quiet secondary row under the shield note; they wrap to one per line on a narrow card */
#auth .auth-card-footer .auth-stores { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
#auth .auth-stores[hidden] { display: none; }
#auth .auth-card-footer .auth-store { display: inline-flex; flex: 1 1 150px; align-items: center; justify-content: center; gap: 7px; box-sizing: border-box; min-width: 0; min-height: 40px; padding: 6px 10px;
  border: 1px solid #cdbb9c; border-radius: 10px; background: rgba(255, 253, 248, .6); color: #4e3a27; text-align: center; text-decoration: none; overflow-wrap: anywhere; font: 600 12px/1.25 var(--font-body); }
#auth .auth-store img, #auth .auth-store svg { flex: none; width: 18px; height: 18px; }
@media (hover: hover) { #auth .auth-card-footer .auth-store:hover { background: #fffdf8; } }
#auth .auth-card-footer .auth-store:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

@media (max-width: 850px) {
  body:has(#auth:not([hidden])) #intro-bg::after { background: linear-gradient(180deg, rgba(25, 31, 27, .78), rgba(29, 34, 29, .66) 38%, rgba(32, 31, 26, .68)); }
  #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: 12px; }
  #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; }
}
@media (max-width: 850px) and (max-height: 700px) {
  #auth .auth-story { display: none; }
  #auth.auth-shell { justify-content: flex-start; } /* centre via the card's auto margins: centred overflow would push the card top (brand, Oyuna Bak) above a scrollable area */
  #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; }
}
/* Page footer (2026-11-04): the info / legal links and the maker credit sit on the backdrop, centred under the card and the story, not in the card.
*/
#auth.auth-shell .auth-page-footer { grid-column: 1 / -1; align-self: end; display: grid; justify-items: center; justify-content: center; gap: 2px 28px; margin: 0; padding: 0;
  text-align: center; color: rgba(255, 255, 255, .72); font: 500 12.5px/1.4 var(--font-body); text-shadow: 0 1px 2px rgba(0, 0, 0, .85), 0 0 10px rgba(0, 0, 0, .7), 0 0 22px rgba(0, 0, 0, .45); }
#auth.auth-shell .auth-page-footer :is(.auth-site-links, .auth-legal-links) { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; margin: 0; padding: 0; border: 0; font: inherit; }
#auth.auth-shell .auth-page-footer a { color: rgba(255, 255, 255, .72); font: 500 12.5px/1.4 var(--font-body); text-decoration: none; }
@media (hover: hover) { #auth.auth-shell .auth-page-footer a:hover { color: #fff; } }
#auth.auth-shell .auth-page-footer a:focus-visible { color: #fff; outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
#auth.auth-shell .auth-page-footer .made-by { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 11px; color: rgba(255, 255, 255, .6); }
#auth.auth-shell .auth-page-footer .made-by img { display: block; flex: none; width: 12px; height: 16px; }
#auth.auth-shell .auth-page-footer .made-by strong { color: rgba(255, 255, 255, .85); font-weight: 700; }
@media (hover: hover) { #auth.auth-shell .auth-page-footer .made-by:hover strong { color: #fff; } }
@media (min-width: 1101px) { #auth.auth-shell .auth-page-footer { grid-template-columns: repeat(2, auto); } }
@media (max-width: 850px) { #auth.auth-shell .auth-page-footer { flex: none; width: min(100%, 470px); margin: auto auto 0; padding-top: 8px; } }
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; } }
/* "Yapımcı ssilistre.dev" (in the centred page footer): fades in a moment after the card, the mark settles in (~500 ms), then drifts a few px; transform/opacity only, none under reduced motion. */
#auth.auth-shell .auth-page-footer .made-by { animation: made-by-in .5s ease-out .6s both; }
@keyframes made-by-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes made-by-settle { 0% { opacity: 0; transform: scale(.4) rotate(-24deg); } 60% { opacity: 1; transform: scale(1.18) rotate(6deg); } 100% { opacity: 1; transform: none; } }
@keyframes made-by-drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5px); } }
#auth.auth-shell .auth-page-footer .made-by img { animation: made-by-settle .5s cubic-bezier(.2, .9, .3, 1.2) 1s both, made-by-drift 3.6s ease-in-out 1.7s infinite; }
@media (prefers-reduced-motion: reduce) { #auth.auth-shell .auth-page-footer .made-by, #auth.auth-shell .auth-page-footer .made-by img { animation: none; } }
/* Password recovery (2026-11-02): the forgot / new-password views share the card; [hidden] must beat the display rules above. */
#auth :is(.auth-tabs, .auth-form-ok, .auth-link)[hidden], #auth .turnstile.off { display: none; }
#auth .auth-form-lead { margin: 0 0 16px; color: #4e3a27; font: 500 14px/1.5 var(--font-body); overflow-wrap: anywhere; }
#auth .auth-form-title { margin-bottom: 14px; font: 700 18px/1.3 var(--font-body); }
#auth .auth-link-row { margin: 0 0 12px; text-align: right; }
#auth .auth-link-row:last-child { margin: 12px 0 0; text-align: center; }
#auth .auth-link { display: inline-block; max-width: 100%; min-height: 32px; margin: 0; padding: 4px 2px; border: 0; background: none; color: #6d4c2b;
  font: 600 13px/1.4 var(--font-body); text-decoration: underline; text-underline-offset: 2px; cursor: var(--cursor-pointer, pointer); overflow-wrap: anywhere; }
@media (pointer: coarse) { #auth .auth-link { min-height: 44px; } }
#auth .auth-form-ok { margin: 0 0 10px; padding: 9px 11px; border: 1px solid #a9cfae; border-radius: 8px; background: #eef8ee; color: #24502b; font: 600 12px/1.4 var(--font-body); }
/* a #reset= link opened while signed in: the screen sits over the running game */
#auth.auth-shell.auth-over { z-index: 50; background: rgba(7, 9, 12, .94); }
