/* Title screen (title_scene.js): the running scene fills the screen, the logo bounces on top, a tap enters. */
#title-screen { position: fixed; inset: 0; z-index: 2000; overflow: hidden; background: #0b0e24; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; transition: opacity .6s ease, transform .6s ease; }
#title-screen.leaving { opacity: 0; transform: scale(1.06); pointer-events: none; }
#title-screen .ts-scene { position: absolute; left: 0; top: 0; image-rendering: pixelated; }
.ts-logo { position: absolute; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 9vh); text-align: center; font-family: Pixelify, serif; line-height: .9; pointer-events: none; animation: ts-drop .9s cubic-bezier(.3, 1.5, .5, 1) both; }
.ts-logo span { display: inline-block; animation: ts-bob 2.4s ease-in-out infinite, ts-glint 4.8s linear infinite; animation-delay: calc(var(--i) * -.14s), calc(var(--i) * .09s); }
.ts-la, .ts-big { color: #f6a43c; text-shadow:
  3px 0 #1a0d04, -3px 0 #1a0d04, 0 3px #1a0d04, 0 -3px #1a0d04, 3px 3px #1a0d04, -3px 3px #1a0d04, 3px -3px #1a0d04, -3px -3px #1a0d04,
  0 7px #5a2a0c, 3px 7px #1a0d04, -3px 7px #1a0d04, 0 10px #1a0d04, 0 14px 14px rgba(0, 0, 0, .55); }
.ts-la { font-size: min(10vw, 52px); margin-bottom: .1em; transform: rotate(-4deg); color: #ffd27a; }
.ts-big { font-size: min(19vw, 104px); letter-spacing: .02em; }
.ts-purse { position: absolute; top: calc(env(safe-area-inset-top) + 12px); right: 14px; display: flex; align-items: center; gap: 6px; font-family: Digits, monospace; font-size: 15px; color: #ffe08a; text-shadow: 2px 2px 0 #1a0d04; opacity: 0; transition: opacity .5s; pointer-events: none; }
.ts-purse i { width: 10px; height: 12px; background: #f2b33a; border: 2px solid #6b3d0e; border-radius: 50%; box-shadow: inset 2px 0 0 #fff0a0; }
#title-screen.ready .ts-purse { opacity: 1; }
.ts-tap { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 7vh); text-align: center; font-family: Pixelify, serif; font-size: min(5.4vw, 26px); color: #efe9de; text-shadow: 2px 0 #1a0d04, -2px 0 #1a0d04, 0 2px #1a0d04, 0 -2px #1a0d04, 0 4px 0 #1a0d04; pointer-events: none; }
.ts-go { display: none; animation: ts-blink 1.2s steps(2, jump-none) infinite; }
.ts-wait { opacity: .75; }
#title-screen.ready .ts-go { display: inline; }
#title-screen.ready .ts-wait { display: none; }
@keyframes ts-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-.07em); } }
@keyframes ts-glint { 0%, 86%, 100% { filter: none; } 90% { filter: brightness(1.45) saturate(1.2); } }
@keyframes ts-drop { from { transform: translateY(-60vh); } to { transform: none; } }
@keyframes ts-blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .ts-logo, .ts-logo span, .ts-go { animation: none; } }

/* Signing in (auth_ui.js): the road keeps running, the logo rises, a stone panel holds the form. */
#title-screen.signin { cursor: default; }
#title-screen.signin .ts-tap, #title-screen.signin .ts-purse { display: none; }
#title-screen .ts-logo { transition: top .5s ease, transform .5s ease; }
#title-screen.signin .ts-logo { top: calc(env(safe-area-inset-top) + 2vh); transform: scale(.58); transform-origin: 50% 0; animation: none; }
.ts-panel { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; width: 100%; max-width: 460px;
  max-height: calc(100% - env(safe-area-inset-top) - min(17vh, 120px)); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 6px 16px calc(env(safe-area-inset-bottom) + 18px); touch-action: pan-y; cursor: auto;
  border-style: solid; border-width: 12px 12px 0; border-image: url("assets/ui/frame.png") 6 / 12px 12px 0 repeat; image-rendering: pixelated;
  background: linear-gradient(rgba(42, 45, 48, .97), rgba(30, 33, 35, .98)); color: var(--ink); font-family: var(--text);
  animation: au-rise .35s ease-out both; }
@keyframes au-rise { from { transform: translateY(60px); opacity: 0; } }
.au-title { display: inline-block; margin: 14px 0 8px; padding: 1px 8px 2px; border: 8px solid transparent; border-image: url("assets/ui/sign.png") 4 fill / 8px round;
  color: #141617; font-family: Pixelify, serif; font-size: 1.1rem; text-shadow: 0 1px 0 rgba(230, 232, 234, .35); filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .35)); }
.au-intro { margin: 4px 0 10px; line-height: 1.45; color: #ddd6c8; }
.au-sub { margin: 16px 0 2px; font-family: Pixelify, serif; font-size: .95rem; color: var(--gold); font-weight: 400; }
.au-form { display: flex; flex-direction: column; gap: 2px; }
.au-form > .btn { margin-top: 10px; }
.au-field { display: block; margin: 8px 0 0; font-size: .9rem; color: #c9c4b8; }
.au-field span { display: block; margin-bottom: 3px; }
.au-input { width: 100%; padding: 11px 12px; border: 2px solid var(--edge); border-radius: 0; background: #17191b; color: var(--ink); font: 1rem var(--text);
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, .45), 0 0 0 1px #474c51; -webkit-user-select: text; user-select: text; touch-action: manipulation; }
.au-input:focus { outline: none; box-shadow: inset 0 2px 0 rgba(0, 0, 0, .45), 0 0 0 2px var(--gold); }
.au-note { margin: 4px 0 0; font-size: .82rem; line-height: 1.4; color: var(--muted); }
.au-err { min-height: 1.2em; margin: 8px 0 0; color: #ffaea3; font-size: .9rem; }
.au-err:empty { min-height: 0; margin: 0; }
.au-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin: 12px 0 2px; }
.au-link { padding: 6px 2px; border: 0; background: none; color: var(--gold); font: .95rem var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.au-new { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 2px dashed #474c51; text-align: center; color: #c9c4b8; }
.au-classes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.au-class { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px; border: 2px solid #474c51; background: rgba(20, 22, 23, .5);
  color: var(--ink); text-align: center; cursor: pointer; opacity: .6; filter: grayscale(.7); transition: opacity .15s, filter .15s; }
.au-class.on { opacity: 1; filter: none; border-color: var(--gold); box-shadow: inset 0 0 0 1px #6b3d0e, 0 0 10px rgba(242, 155, 58, .25); }
.au-class b { font-family: Pixelify, serif; font-weight: 400; font-size: .95rem; }
.au-class small { font-size: .74rem; line-height: 1.3; color: var(--muted); }
.au-preview { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 16px; padding: 8px; border: 2px dashed #6b5a2c; background: rgba(60, 48, 16, .25); }
.au-preview small { color: #d9c48a; font-size: .78rem; }
.au-google { margin: 6px 0 2px; }
.au-google-btn { display: flex; justify-content: center; min-height: 44px; }
.au-or { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; color: var(--muted); font-size: .85rem; }
.au-or::before, .au-or::after { content: ""; flex: 1; border-top: 2px dashed #474c51; }
.au-tag { float: right; font-family: var(--pixel); font-size: .82rem; color: var(--muted); }
.au-tag.ok { color: var(--ok); }
.au-tag.bad { float: none; display: block; margin-top: 2px; color: #ffaea3; font-family: var(--text); }
