/* Title screen: the sign-in screen, the boot splash and the scene behind them (Oct 2026).
 *
 * One visual system for everything before the world appears. The splash and the sign-in screen
 * share .title-logo (same place, same size) and the lower slot (.auth-card / .boot-plaque), so
 * signing in reads as the card turning into the journey, not as a page swap.
 *
 * Layouts, chosen deliberately rather than by one fluid rule:
 *   phone portrait (default)      logo top, scene in the middle, card docked at the bottom
 *   tablet / narrow landscape     logo top, card centred below it
 *   desktop  (≥900px landscape)   logo left over the scene, card on the right
 *   short landscape (≤520px tall) logo left, card right and scrollable, compact spacing
 *
 * Loaded after every other stylesheet; scoped to #title-scene, #splash and #auth-screen so the
 * game UI is untouched. Theme tokens are on :root under --t-* for future front-end screens. */

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(../assets/fonts/cinzel-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2212;
}

:root {
  --t-gold: #e3bd62;
  --t-gold-hi: #f6dc97;
  --t-gold-lo: #a97a2c;
  --t-ink: #efe9d6;
  --t-muted: #a9b4a2;
  --t-card: rgba(18, 25, 21, .94);
  --t-card-2: rgba(27, 37, 30, .94);
  --t-line: rgba(227, 189, 98, .38);
  --t-field: #0c120e;
  --t-field-line: #3b4f3d;
  --t-ok: #8fc98a;
  --t-bad: #f08a62;
  --t-radius: 18px;
  --t-display: 'Cinzel', 'Trajan Pro', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  --t-safe-t: env(safe-area-inset-top, 0px);
  --t-safe-b: env(safe-area-inset-bottom, 0px);
  --t-safe-l: env(safe-area-inset-left, 0px);
  --t-safe-r: env(safe-area-inset-right, 0px);
}

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

/* ------------------------------------------------------------------ the scene */
/* Above the game screen (whose HUD reaches z 71) so nothing of the half-built world shows
   through the translucent splash; below the sign-in screen (85) and the splash (90). */
.title-scene {
  position: fixed; inset: 0; z-index: 80; overflow: hidden; pointer-events: none;
  /* Fallback until (or instead of) the art: the same sky the canvas will draw. */
  background: linear-gradient(180deg, #1c1a46 0%, #64386c 52%, #e98456 78%, #3a5038 78.2%, #1a2420 100%);
  transition: opacity .45s ease;
}
.title-scene[data-tod="night"] { background: linear-gradient(180deg, #070a1e 0%, #121c40 50%, #2c3e66 76%, #1c2c2c 76.2%, #0c1418 100%); }
.title-scene[data-tod="day"]   { background: linear-gradient(180deg, #4074b0 0%, #7eacd0 50%, #e4d6a8 76%, #5e8442 76.2%, #32502a 100%); }
.title-scene[data-tod="dawn"]  { background: linear-gradient(180deg, #262e5c 0%, #8a5c80 50%, #f6aa7a 76%, #4e6a40 76.2%, #243426 100%); }
.title-scene.ts-leaving { opacity: 0; }
.ts-layer {
  position: absolute; image-rendering: pixelated; image-rendering: crisp-edges;
  opacity: 0; transition: opacity .6s ease; will-change: transform;
}
.title-scene.ts-ready .ts-layer { opacity: 1; }
/* Signing in: a slow push toward the road while the card leaves. */
.title-scene.ts-depart .ts-far { transition: transform 1.6s cubic-bezier(.2, .6, .2, 1), opacity .6s; transform: scale(1.03) !important; }
.title-scene.ts-depart .ts-mid,
.title-scene.ts-depart .ts-fx { transition: transform 1.6s cubic-bezier(.2, .6, .2, 1), opacity .6s; transform: scale(1.07) translateY(1.5%) !important; transform-origin: 60% 55%; }

/* A soft vignette keeps the logo and card legible over any time of day. */
.title-scene::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(5, 8, 14, .45) 0%, transparent 55%),
    linear-gradient(180deg, transparent 55%, rgba(5, 8, 10, .35) 100%);
}

body.title-on #auth-screen,
body.title-on .splash { background: transparent; }
#auth-screen { z-index: 85; }

/* ------------------------------------------------------------------ shared title layout */
#auth-screen,
.splash {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: calc(var(--t-safe-t) + 4vh) calc(var(--t-safe-r) + 12px) calc(var(--t-safe-b) + 12px) calc(var(--t-safe-l) + 12px);
  gap: 16px;
  color: var(--t-ink);
}
#auth-screen.hidden, .splash.hidden { display: none !important; }
#auth-screen {
  overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.title-logo { text-align: center; flex: 0 0 auto; pointer-events: none; }
.title-logo .brand {
  margin: 0; font-family: var(--t-display); font-weight: 700;
  font-size: clamp(40px, 12.5vw, 64px); line-height: .95; letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--t-gold);
  /* Engraved gold: a light top edge, a dark carved outline, a long soft drop. Readable on the
     brightest day sky and the darkest night. */
  filter: drop-shadow(0 1px 0 #3a2508) drop-shadow(0 0 1px #2a1a06) drop-shadow(0 6px 14px rgba(0, 0, 0, .55));
}
.title-logo .brand-word {
  display: inline-block;
  /* Paint the entire word, even when its heading is in a narrow grid column. */
  background: linear-gradient(180deg, var(--t-gold-hi) 0%, var(--t-gold) 48%, var(--t-gold-lo) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
/* A thin rule with a waystone diamond under the wordmark. */
.title-logo .brand::after {
  content: ''; display: block; height: 10px; margin: 8px auto 0; width: min(62%, 260px);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0 10 5 5 10 0 5Z' fill='%23e3bd62'/%3E%3C/svg%3E") center / 10px 10px no-repeat,
    linear-gradient(90deg, transparent, rgba(227, 189, 98, .85) 30%, rgba(227, 189, 98, .85) 70%, transparent) center / 100% 1px no-repeat;
  -webkit-text-fill-color: initial;
}
.title-logo .tagline {
  text-align: inherit;
  margin: 10px 0 0; font-size: 15px; font-style: italic; letter-spacing: .02em;
  color: rgba(246, 238, 214, .92); text-shadow: 0 1px 2px rgba(0, 0, 0, .85), 0 0 12px rgba(0, 0, 0, .5);
}

/* Entrance: logo rises, card follows. Short, once. */
@keyframes t-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes t-card { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
#auth-screen .title-logo { animation: t-rise .7s .05s cubic-bezier(.2, .7, .2, 1) both; }
#auth-screen .auth-card { animation: t-card .6s .18s cubic-bezier(.2, .7, .2, 1) both; }
.splash .title-logo .brand, .splash .title-logo .tagline { animation: none; }
.splash .boot-plaque { animation: t-card .45s cubic-bezier(.2, .7, .2, 1) both; }

/* ------------------------------------------------------------------ the card ("the ledger") */
#auth-screen .auth-card {
  position: relative; width: 100%; max-width: 420px; flex: 0 0 auto;
  margin: 0; padding: 20px 20px 14px;
  background: linear-gradient(180deg, var(--t-card-2), var(--t-card) 38%);
  border: 1px solid var(--t-line); border-radius: var(--t-radius);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .55),
    inset 0 1px 0 rgba(255, 236, 190, .10),
    inset 0 0 0 4px rgba(0, 0, 0, .18),
    0 22px 60px rgba(0, 0, 0, .55);
  transition: opacity .35s ease, transform .35s ease;
}
/* Corner fittings, like the brass corners on a field ledger. */
#auth-screen .auth-card::before,
#auth-screen .auth-card::after {
  content: ''; position: absolute; width: 16px; height: 16px; pointer-events: none;
  border: 2px solid var(--t-gold); opacity: .75;
}
#auth-screen .auth-card::before { top: 6px; left: 6px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
#auth-screen .auth-card::after { top: 6px; right: 6px; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }

.auth-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: 0 4px 14px; }
.auth-head-text { min-width: 0; }
.auth-title {
  margin: 0; font-family: var(--t-display); font-weight: 600; font-size: 21px; letter-spacing: .03em;
  color: var(--t-gold-hi); overflow-wrap: anywhere;
}
.auth-sub { margin: 4px 0 0; font-size: 14px; color: var(--t-muted); line-height: 1.4; }

/* Language: a compact globe + select, not a full-width row. */
#auth-screen .auth-language {
  position: relative; flex: 0 0 auto; margin: 0; display: flex; align-items: center;
  color: var(--t-muted);
}
#auth-screen .auth-language .lp-globe { position: absolute; left: 9px; width: 16px; height: 16px; pointer-events: none; }
#auth-screen .auth-language select {
  min-width: 0; width: 104px; height: 36px; padding: 0 8px 0 30px;
  border: 1px solid var(--t-field-line); border-radius: 10px; background: var(--t-field);
  color: var(--t-ink); font-size: 13px; text-overflow: ellipsis; cursor: pointer;
}
#auth-screen .auth-language select:focus-visible { outline: 2px solid var(--t-gold); outline-offset: 2px; }

/* Tabs: a segmented control with a sliding plate. */
#auth-screen .tabs {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  margin: 0 0 16px; padding: 4px; border-radius: 13px;
  background: rgba(0, 0, 0, .32); border: 1px solid rgba(255, 255, 255, .06);
}
#auth-screen .tabs::before {
  content: ''; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px);
  border-radius: 10px; background: linear-gradient(180deg, #33452f, #26362a);
  border: 1px solid rgba(227, 189, 98, .55); box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  transition: transform .28s cubic-bezier(.3, .7, .2, 1);
}
#auth-screen .tabs:has(#tab-register.active)::before { transform: translateX(100%); }
#auth-screen .tab {
  position: relative; z-index: 1; flex: none; min-height: 42px; padding: 8px 6px;
  border: 0; border-radius: 10px; background: transparent;
  color: var(--t-muted); font: 600 15px/1.2 inherit; font-family: inherit; cursor: pointer;
  transition: color .2s;
}
#auth-screen .tab.active { color: var(--t-ink); background: transparent; border: 0; }
#auth-screen .tab:hover { color: var(--t-ink); }
#auth-screen .tab:focus-visible { outline: 2px solid var(--t-gold); outline-offset: 1px; }
@supports not selector(:has(*)) {
  #auth-screen .tabs::before { display: none; }
  #auth-screen .tab.active { background: #2c3d2c; box-shadow: inset 0 0 0 1px rgba(227, 189, 98, .55); }
}

/* Fields */
#auth-form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-pw { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; row-gap: 6px; align-items: end; }
.field-pw > .field-label { grid-column: 1; grid-row: 1; }
.field-pw > #auth-forgot { grid-column: 2; grid-row: 1; padding: 0 2px; font-size: 13px; line-height: 1.3; }
.field-pw > .field-box, .field-pw > .field-hint { grid-column: 1 / -1; }
.field-label { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: #cfd6c6; padding-left: 2px; }
.field-box {
  position: relative; display: flex; align-items: center;
  border: 1px solid var(--t-field-line); border-radius: 12px; background: var(--t-field);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.field-box:focus-within {
  border-color: var(--t-gold);
  box-shadow: 0 0 0 3px rgba(227, 189, 98, .22), 0 0 18px rgba(227, 189, 98, .10);
  background: #0f1712;
}
.field-icon { width: 18px; height: 18px; margin-left: 13px; flex: 0 0 auto; color: #7f8f7c; transition: color .18s; }
.field-box:focus-within .field-icon { color: var(--t-gold); }
#auth-form .field-box input[type=text],
#auth-form .field-box input[type=password] {
  flex: 1; min-width: 0; height: 50px; padding: 0 12px; margin: 0;
  border: 0; border-radius: 12px; background: transparent; box-shadow: none; outline: none;
  color: var(--t-ink); font-size: 16px; /* 16px: iOS never zooms the page on focus */
}
/* The visible label does the job; the placeholder only shows in the compact landscape layout,
   where the labels are visually hidden to fit a 390px-tall screen. */
#auth-form .field-box input::placeholder { color: transparent; }
/* Chrome's autofill paints its own pale background; keep it in the theme. */
#auth-form .field-box input:-webkit-autofill {
  -webkit-text-fill-color: var(--t-ink); caret-color: var(--t-ink);
  -webkit-box-shadow: 0 0 0 40px var(--t-field) inset; transition: background-color 9999s;
}
.pw-toggle {
  flex: 0 0 auto; display: grid; place-items: center; width: 46px; height: 46px; margin-right: 2px;
  border: 0; border-radius: 10px; background: transparent; color: #8d9b89; cursor: pointer;
}
.pw-toggle svg { width: 20px; height: 20px; }
.pw-toggle .eye-shut { display: none; }
.pw-toggle[aria-pressed="true"] .eye-open { display: none; }
.pw-toggle[aria-pressed="true"] .eye-shut { display: block; }
.pw-toggle:hover { color: var(--t-ink); }
.pw-toggle:focus-visible { outline: 2px solid var(--t-gold); outline-offset: -2px; }
.field-ok { width: 0; overflow: hidden; }

/* Hints belong to account creation; sign-in stays clean. Not colour alone: each state has a glyph. */
.field-hint { margin: 0; padding-left: 2px; font-size: 12.5px; line-height: 1.35; color: var(--t-muted); display: none; }
.auth-card.mode-register .field-hint { display: block; }
.field-hint.field-warn { display: block; color: #f2c46a; }
.field-hint.field-warn::before { content: '⚠ '; }
.field-hint.hidden { display: none !important; }
.field.is-valid .field-hint { color: var(--t-ok); }
.field.is-valid .field-hint::before { content: '✓ '; }
.field.is-invalid .field-hint { color: var(--t-bad); }
.field.is-invalid .field-hint::before { content: '✕ '; }
.field.is-invalid .field-box { border-color: rgba(240, 138, 98, .7); }
.auth-card.mode-register .field.is-valid .field-ok {
  width: 22px; margin-right: 12px; height: 22px; border-radius: 50%;
  background: rgba(143, 201, 138, .16); color: var(--t-ok);
  display: grid; place-items: center; font-size: 13px;
}
.auth-card.mode-register .field.is-valid .field-ok::before { content: '✓'; }

/* Remember / forgot / age rows */
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
#auth-screen .check {
  display: inline-flex; align-items: center; gap: 9px; min-height: 36px;
  font-size: 14px; color: #c4ccbc; cursor: pointer; user-select: none;
}
#auth-screen .check input {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; margin: 0;
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #5d7059; background: var(--t-field);
  display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s;
}
#auth-screen .check input::after { content: ''; width: 10px; height: 6px; border: 2.5px solid #1d1406; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
#auth-screen .check input:checked { background: var(--t-gold); border-color: var(--t-gold); }
#auth-screen .check input:checked::after { opacity: 1; }
#auth-screen .check input:focus-visible { outline: 2px solid var(--t-gold); outline-offset: 2px; }
.link-btn {
  border: 0; background: none; padding: 8px 2px; color: #e2c47e; font: inherit; font-size: 14px;
  text-decoration: underline; text-decoration-color: rgba(226, 196, 126, .4); text-underline-offset: 3px; cursor: pointer;
}
.link-btn:hover { color: var(--t-gold-hi); text-decoration-color: currentColor; }
.link-btn:focus-visible { outline: 2px solid var(--t-gold); outline-offset: 2px; border-radius: 4px; }
.auth-card.mode-register #auth-forgot { display: none; }

/* Messages: an icon and a tinted box, never just red text. Empty = takes no space. */
#auth-screen .auth-msg { margin: 0; min-height: 0; text-align: left; font-size: 14px; line-height: 1.4; }
#auth-screen .auth-msg:empty, #auth-screen .auth-msg.error:empty { display: none; }
#auth-screen .auth-msg.error {
  display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border-radius: 10px;
  color: #ffd9c9; background: rgba(210, 104, 63, .14); border: 1px solid rgba(240, 138, 98, .35);
  animation: t-shake .32s ease;
}
#auth-screen .auth-msg.error::before { content: '!'; flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #2a1206; background: var(--t-bad); margin-top: 1px; }
@keyframes t-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 60% { transform: translateX(3px); } }

/* The call to action */
#auth-screen .cta {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 54px; margin: 2px 0 0; padding: 0 18px;
  border: 1px solid #f4d488; border-radius: 13px; cursor: pointer;
  font-family: var(--t-display); font-weight: 700; font-size: 18px; letter-spacing: .06em;
  color: #2a1906; text-decoration: none; text-shadow: 0 1px 0 rgba(255, 238, 190, .5);
  background: linear-gradient(180deg, #f3d283 0%, #e1b154 48%, #c18d34 100%);
  box-shadow: inset 0 1px 0 rgba(255, 250, 230, .65), inset 0 -2px 0 rgba(120, 76, 18, .45), 0 6px 18px rgba(0, 0, 0, .35), 0 0 0 1px rgba(0, 0, 0, .45);
  transition: filter .15s, transform .1s, box-shadow .2s;
}
#auth-screen .cta:hover { filter: brightness(1.07); box-shadow: inset 0 1px 0 rgba(255, 250, 230, .65), inset 0 -2px 0 rgba(120, 76, 18, .45), 0 8px 24px rgba(227, 189, 98, .25), 0 0 0 1px rgba(0, 0, 0, .45); }
#auth-screen .cta:active { transform: translateY(1px); filter: brightness(.97); }
#auth-screen .cta:focus-visible { outline: 3px solid #fff3cf; outline-offset: 3px; }
#auth-screen .cta:disabled { cursor: progress; filter: saturate(.7) brightness(.92); }
.cta-spin { display: none; width: 22px; height: 22px; }
.cta-spin svg { width: 100%; height: 100%; animation: t-compass 1.6s cubic-bezier(.45, .05, .55, .95) infinite; }
@keyframes t-compass { 0% { transform: rotate(-30deg); } 50% { transform: rotate(40deg); } 100% { transform: rotate(-30deg); } }
#auth-screen .cta.is-busy .cta-spin { display: block; }
#auth-screen .cta.is-busy .cta-label { opacity: .85; }

/* Google + divider */
#auth-screen .google-auth { margin-top: 14px; gap: 12px; }
#auth-screen .auth-or { border-top-color: rgba(255, 255, 255, .12); }
#auth-screen .auth-or span { background: #141c17; color: #8f9a8a; padding: 0 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }

/* Recovery panel: swaps in for the form inside the same card. */
.auth-recover { display: flex; flex-direction: column; gap: 12px; padding: 2px 4px 4px; outline: none; }
.auth-recover .auth-sub { margin: 0; }
.recover-ways { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.recover-ways li {
  padding: 11px 12px 11px 14px; border-radius: 11px; font-size: 14px; line-height: 1.45; color: #d7dccd;
  background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .07); border-left: 3px solid var(--t-gold);
}
.recover-ways strong { color: var(--t-gold-hi); }
.recover-back { align-self: center; }
.auth-card.show-recover .auth-head,
.auth-card.show-recover .tabs,
.auth-card.show-recover #auth-form,
.auth-card.show-recover #google-auth { display: none !important; }

/* Footer: Discord, privacy, build. Quiet. */
.auth-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .07);
}
#auth-screen .auth-discord {
  margin: 0; padding: 8px 12px; min-height: 40px; border-radius: 10px; font-size: 14px;
  border: 1px solid rgba(88, 101, 242, .35); color: #c9cdf5; background: rgba(88, 101, 242, .08);
}
#auth-screen .auth-discord:hover { color: #fff; background: rgba(88, 101, 242, .22); border-color: #5865f2; }
#auth-screen .auth-discord:focus-visible { outline: 2px solid #8f97ff; outline-offset: 2px; }
.auth-legal { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; color: #77836f; }
.auth-legal a { color: #9aa691; text-underline-offset: 3px; }
.auth-legal a:hover { color: var(--t-ink); }
.auth-build:not(:empty)::before { content: '· '; }

/* Notices other code inserts into the card (app update gate, can't-reach-server). */
#auth-screen .auth-update-msg { margin: 2px 4px 12px; padding: 12px 14px; border-radius: 11px; background: rgba(227, 189, 98, .10); border: 1px solid rgba(227, 189, 98, .3); }
#auth-screen #boot-trouble, #auth-screen #auth-update-block { margin-bottom: 14px; }
#auth-screen #boot-trouble .primary, #auth-screen #auth-update-block .primary { width: 100%; min-height: 48px; }

/* Leaving for the world: the card sinks away as the splash takes its place. */
#auth-screen.t-leaving .auth-card { opacity: 0; transform: translateY(14px) scale(.985); pointer-events: none; }
#auth-screen.t-leaving .title-logo { opacity: 1; }

/* ------------------------------------------------------------------ the boot plaque (splash) */
.splash .boot-plaque {
  width: 100%; max-width: 420px; flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 20px 16px; border-radius: var(--t-radius);
  background: linear-gradient(180deg, rgba(27, 37, 30, .86), rgba(16, 22, 19, .9));
  border: 1px solid var(--t-line);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 236, 190, .08), 0 22px 60px rgba(0, 0, 0, .5);
}
.splash .splash-dots { margin: 4px 0 2px; gap: 12px; }
.splash .splash-dots span { width: 9px; height: 9px; border-radius: 1px; transform: rotate(45deg); background: var(--t-gold); }
@keyframes t-marker { 0%, 100% { opacity: .25; transform: rotate(45deg) scale(.8); } 50% { opacity: 1; transform: rotate(45deg) scale(1.15); } }
.splash .splash-dots span { animation: t-marker 1.2s ease-in-out infinite; }
.splash .boot-bar { width: 100%; margin-top: 8px; height: 8px; border-radius: 4px; background: rgba(0, 0, 0, .4); box-shadow: inset 0 0 0 1px rgba(227, 189, 98, .25); }
.splash .boot-fill { background: linear-gradient(90deg, #a97a2c, var(--t-gold) 70%, var(--t-gold-hi)); border-radius: 4px; }
.splash .boot-bar.indeterminate .boot-fill {
  background: linear-gradient(90deg, rgba(227, 189, 98, .3) 0 28%, var(--t-gold) 50%, rgba(227, 189, 98, .3) 72% 100%);
  background-size: 220% 100%;
}
.splash .boot-status { color: #e8e2cc; font-size: 14px; }
.splash .boot-steps li.active::before, .splash .boot-steps li.done::before { border-color: var(--t-gold); }
.splash .boot-steps li.done::before { background: var(--t-gold); }
.splash .boot-steps { color: rgba(255, 255, 255, .38); }
.splash .boot-tip { margin-top: 16px; color: rgba(236, 230, 206, .8); min-height: 2.9em; }
.splash .boot-tip-label { color: var(--t-gold); }
.splash .boot-build { position: static; margin-top: 8px; color: rgba(255, 255, 255, .3); }
.splash .boot-slow { color: #f2c46a; }

/* ------------------------------------------------------------------ phone portrait details */
@media (max-width: 759px) {
  #auth-screen, .splash { padding-top: calc(var(--t-safe-t) + 5vh); }
  /* Globe-only language button: the select keeps its accessible name and native picker, its
     text is hidden so the greeting gets the card's full width. */
  #auth-screen .auth-language select { width: 44px; height: 40px; padding: 0; color: transparent; }
  #auth-screen .auth-language select option { color: #111; }
  #auth-screen .auth-language .lp-globe { left: 13px; width: 18px; height: 18px; color: #c9d1c0; }
  #auth-screen .auth-card { padding: 18px 18px 12px; }
  .auth-title { font-size: 20px; }
  .auth-head { margin-bottom: 12px; }
  #auth-screen .tabs { margin-bottom: 14px; }
  #auth-form { gap: 10px; }
  #auth-screen .auth-card, .splash .boot-plaque { max-width: 460px; }
}
/* Small phones (iPhone SE and friends): give the form the room. */
@media (max-height: 700px) and (max-width: 759px) {
  .auth-sub { display: none; }
  #auth-screen, .splash { padding-top: calc(var(--t-safe-t) + 18px); gap: 10px; }
  .title-logo .brand { font-size: clamp(34px, 10.5vw, 48px); }
  .title-logo .brand::after { margin-top: 6px; }
  .title-logo .tagline { font-size: 13.5px; margin-top: 6px; }
  #auth-screen .auth-card { padding: 16px 16px 10px; }
  .auth-head { margin-bottom: 10px; }
  .auth-title { font-size: 19px; }
  .auth-sub { font-size: 13px; }
  #auth-screen .tabs { margin-bottom: 12px; }
  #auth-form { gap: 9px; }
  #auth-form .field-box input[type=text], #auth-form .field-box input[type=password] { height: 46px; }
  #auth-screen .cta { min-height: 50px; }
  .auth-foot { margin-top: 10px; padding-top: 8px; }
}
@media (max-height: 600px) and (max-width: 759px) {
  .title-logo .tagline { display: none; }
  .auth-sub { display: none; }
}

/* ------------------------------------------------------------------ tablet */
@media (min-width: 760px) {
  #auth-screen, .splash { justify-content: center; gap: 4vh; padding-top: calc(var(--t-safe-t) + 6vh); padding-bottom: calc(var(--t-safe-b) + 6vh); }
  .title-logo .brand { font-size: 76px; }
  .title-logo .tagline { font-size: 17px; }
  #auth-screen .auth-card { padding: 24px 26px 16px; }
}

/* ------------------------------------------------------------------ desktop: scene-first, card right */
@media (min-width: 900px) and (orientation: landscape) and (min-height: 521px) {
  #auth-screen, .splash {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 420px);
    align-items: center; justify-items: start; gap: 6vw;
    padding: calc(var(--t-safe-t) + 6vh) calc(var(--t-safe-r) + 7vw) calc(var(--t-safe-b) + 6vh) calc(var(--t-safe-l) + 7vw);
  }
  .title-logo { text-align: left; align-self: start; margin-top: 4vh; min-width: 0; width: 100%; container-type: inline-size; }
  .title-logo .brand { font-size: clamp(64px, 7.4vw, 112px); font-size: clamp(14px, 15cqi, 112px); }
  .title-logo .brand::after { margin-left: 0; width: min(70%, 340px); background-position: 0 50%, 0 50%, 0 50%; }
  .title-logo .brand::after {
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0 10 5 5 10 0 5Z' fill='%23e3bd62'/%3E%3C/svg%3E") 0 50% / 10px 10px no-repeat,
      linear-gradient(90deg, rgba(227, 189, 98, .85) 0%, rgba(227, 189, 98, .85) 55%, transparent) 14px 50% / 100% 1px no-repeat;
  }
  .title-logo .tagline { font-size: 19px; margin-top: 14px; }
  #auth-screen .auth-card, .splash .boot-plaque { justify-self: end; width: 100%; max-width: 420px; }
}

/* ------------------------------------------------------------------ short landscape (phones on their side) */
@media (orientation: landscape) and (max-height: 520px) {
  #auth-screen, .splash {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
    align-items: center; gap: 4vw;
    padding: calc(var(--t-safe-t) + 10px) calc(var(--t-safe-r) + 16px) calc(var(--t-safe-b) + 10px) calc(var(--t-safe-l) + 16px);
  }
  #auth-screen { align-items: start; }
  .title-logo { text-align: left; align-self: start; margin-top: 4px; min-width: 0; width: 100%; container-type: inline-size; }
  /* The card has its own minimum width; size the word against its remaining column. */
  .title-logo .brand { font-size: clamp(36px, 7vw, 58px); font-size: clamp(14px, 15cqi, 58px); }
  .title-logo .brand::after { margin-left: 0; }
  #auth-screen .auth-card { padding: 14px 16px 8px; align-self: start; }
  .auth-head { margin-bottom: 8px; }
  .auth-sub { display: none; }
  #auth-screen .tabs { margin-bottom: 10px; }
  #auth-form { gap: 8px; }
  .field-pw > #auth-forgot { margin-bottom: -2px; }
  #auth-form .field-label {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  #auth-form .field-box input::placeholder { color: #75836e; }
  #auth-form .field-box input[type=text], #auth-form .field-box input[type=password] { height: 44px; }
  #auth-screen .tab { min-height: 36px; padding: 6px; }
  #auth-screen .check { min-height: 32px; }
  #auth-screen .cta { min-height: 48px; }
  .auth-foot { margin-top: 8px; padding-top: 8px; }
  #auth-screen .auth-discord { min-height: 36px; padding: 6px 10px; }
  .splash .boot-plaque { padding: 14px 16px 10px; }
  .splash .boot-tip { display: none; }
}

/* ------------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  #auth-screen .title-logo, #auth-screen .auth-card { animation: none; }
  #auth-screen .tabs::before, #auth-screen .auth-card, .title-scene, .ts-layer { transition: none; }
  .cta-spin svg, .splash .splash-dots span, .splash .boot-plaque { animation: none; }
  #auth-screen .auth-msg.error { animation: none; }
  .title-scene.ts-depart .ts-far, .title-scene.ts-depart .ts-mid, .title-scene.ts-depart .ts-fx { transform: none !important; }
}

html[dir="rtl"] .title-logo { text-align: center; }
html[dir="rtl"] .auth-row, html[dir="rtl"] .auth-head { direction: rtl; }
