/* Tail Crew brand: the loading screen (index.html #loading, driven by js/loadscreen.js) and the brand mark.
   Loaded after style.css, so these rules replace the old spinning-ball loader. */

#loading {
  --ld-fill: 0;
  display: grid; place-content: center; justify-items: center; gap: clamp(10px, 2.4vmin, 18px);
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background:
    radial-gradient(60vmax 60vmax at 18% 12%, rgba(255, 122, 31, .1), transparent 60%),
    radial-gradient(60vmax 60vmax at 86% 14%, rgba(255, 210, 63, .07), transparent 60%),
    radial-gradient(60vmax 60vmax at 88% 92%, rgba(58, 160, 232, .12), transparent 60%),
    radial-gradient(60vmax 60vmax at 12% 90%, rgba(63, 191, 106, .08), transparent 60%),
    radial-gradient(circle at 50% 40%, #24398f, #0e1630 62%);
  font-family: Nunito, system-ui, sans-serif; color: #fff; text-align: center; overflow: hidden;
  visibility: visible; transition: opacity .6s ease, visibility 0s;
}
#loading.hide { visibility: hidden; transition: opacity .6s ease, visibility 0s .6s; }
#loading > * { transition: transform .6s cubic-bezier(.2, .7, .2, 1), filter .6s ease; }
#loading.hide > * { transform: scale(1.06); filter: blur(3px); }

/* the mark: the ball with its four tails, on a soft halo that breathes */
.ld-mark { position: relative; width: clamp(132px, 44vmin, 248px); aspect-ratio: 1; }
.ld-mark::before { content: ''; position: absolute; inset: 8%; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(156, 192, 255, .42), rgba(156, 192, 255, 0) 68%); animation: ld-breathe 2.8s ease-in-out infinite; }
.ld-mark .tc-mark { width: 100%; height: 100%; display: block; filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .4)); animation: ld-bob 2.8s ease-in-out infinite; }
/* before js/loadscreen.js fills it in: a plain ball, so the first paint is never empty */
.ld-mark:empty::after { content: ''; position: absolute; inset: 30%; border-radius: 50%; border: 4px solid #0b1638;
  background: radial-gradient(circle at 50% 50%, #fff 0 12%, #0b1638 12% 19%, transparent 19%), linear-gradient(#e8323a 0 46%, #0b1638 46% 54%, #f4f6fb 54%); }
@keyframes ld-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes ld-breathe { 0%, 100% { opacity: .7; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.04); } }

.ld-word { margin: -4px 0 0; font: 400 clamp(26px, 6.4vmin, 40px)/1 'Lilita One', Nunito, sans-serif; letter-spacing: 1.5px;
  color: #ffd23f; background: linear-gradient(#fff6b8, #ffd23f 50%, #ff9a1c); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 #2443c9) drop-shadow(0 2px 0 #0b1638); }

/* progress: real model counts when the game reports them (js/loadscreen.js), a gentle sweep otherwise */
.ld-bar { position: relative; width: min(280px, calc(64 * var(--uvw, 1vw))); height: 10px; border-radius: 99px; overflow: hidden;
  background: rgba(8, 14, 40, .7); box-shadow: inset 0 0 0 1.5px rgba(160, 190, 255, .22), 0 1px 0 rgba(255, 255, 255, .06); }
.ld-bar i { position: absolute; inset: 0; border-radius: inherit; transform-origin: 0 50%; transform: scaleX(var(--ld-fill));
  background: linear-gradient(90deg, #ff7a1f, #ffd23f 36%, #3fbf6a 68%, #3aa0e8); transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
.ld-bar i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  background-size: 40% 100%; background-repeat: no-repeat; animation: ld-gleam 1.6s ease-in-out infinite; }
#loading.ld-indet .ld-bar i { transform: none; width: 34%; animation: ld-sweep 1.4s ease-in-out infinite; }
@keyframes ld-gleam { from { background-position: -60% 0; } to { background-position: 160% 0; } }
@keyframes ld-sweep { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

.ld-place { min-height: 1.2em; margin-bottom: -2px; font-weight: 900; font-size: 15px; letter-spacing: .3px; color: #ffd23f; }
#loading-text { min-height: 1.3em; font-weight: 900; font-size: 13px; letter-spacing: .5px; color: #a3b3d9; font-variant-numeric: tabular-nums; }
.ld-tip { margin: 2px 0 0; max-width: min(36ch, calc(86 * var(--uvw, 1vw))); min-height: 2.7em; font-weight: 800; font-size: 14px; line-height: 1.35; color: #d6e2ff;
  transition: opacity .35s ease, transform .35s ease; }
.ld-tip b { color: #ffd23f; font-weight: 900; }
.ld-tip.out { opacity: 0; transform: translateY(4px); }

/* phones held sideways: everything in one compact column, the mark a little smaller */
@media (orientation: landscape) and (max-height: 500px) {
  #loading { gap: 8px; }
  .ld-mark { width: clamp(104px, calc(34 * var(--uvh, 1vh)), 150px); }
  .ld-tip { min-height: 1.4em; }
}

@media (prefers-reduced-motion: reduce) {
  #loading *, #loading *::before, #loading *::after { animation: none !important; }
  #loading.ld-indet .ld-bar i { width: 100%; opacity: .45; }
  #loading.hide > * { transform: none; filter: none; }
}
html.reduce-motion #loading *, html.reduce-motion #loading *::before, html.reduce-motion #loading *::after { animation: none !important; }
html.reduce-motion #loading.ld-indet .ld-bar i { width: 100%; opacity: .45; }

/* ---------------------------------------------------------------- the dark theme with a small, clean fire
   (loading screen, character list, update prompt): near-black navy, a warm glow along the bottom, a low row of small
   flickering flames and a few embers. All CSS: .fl-floor holds the flames (<i> with --x, --s, --d, --w). */
.fl-floor { position: fixed; left: 0; right: 0; bottom: 0; height: 120px; z-index: -1; pointer-events: none; overflow: hidden; }
.fl-floor::before { content: ''; position: absolute; left: -10%; right: -10%; bottom: -60px; height: 180px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 110, 30, .38), rgba(200, 50, 10, .14) 55%, transparent); animation: fl-glow 2.4s ease-in-out infinite alternate; }
.fl-floor i { position: absolute; bottom: -8px; left: var(--x); width: calc(var(--s) * .5); height: var(--s); transform-origin: 50% 100%; mix-blend-mode: screen;
  border-radius: 50% 50% 45% 45% / 85% 85% 15% 15%; filter: blur(1.6px);
  background: radial-gradient(46% 70% at 50% 92%, #fffdf0 0%, #ffe39a 16%, #ffab45 36%, rgba(255, 96, 24, .7) 58%, rgba(170, 30, 10, 0) 78%);
  animation: fl-lick var(--d) ease-in-out var(--w) infinite alternate; }
/* a taller, dimmer, redder layer behind: the fire has depth */
.fl-floor i.bk { width: calc(var(--s) * .62); filter: blur(3px); opacity: .7;
  background: radial-gradient(48% 72% at 50% 92%, rgba(255, 170, 70, .9) 0%, rgba(255, 90, 20, .7) 34%, rgba(160, 24, 8, .35) 62%, rgba(120, 10, 0, 0) 80%); }
@keyframes fl-lick { 0% { transform: scale(1, .78) skewX(-4deg); } 30% { transform: scale(.9, 1.08) skewX(3deg); } 55% { transform: scale(1.05, .86) skewX(-2deg); }
  80% { transform: scale(.94, 1.14) skewX(4deg); } 100% { transform: scale(1, .92) skewX(-3deg); } }
@keyframes fl-glow { from { opacity: .75; } to { opacity: 1; } }
.fl-embers { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.fl-embers b { position: absolute; left: var(--x); bottom: 30px; width: 3px; height: 3px; border-radius: 50%; background: #ffd27a; box-shadow: 0 0 6px 1px rgba(255, 150, 40, .8);
  animation: fl-rise var(--d) linear var(--w) infinite; }
@keyframes fl-rise { 0% { transform: translate3d(0, 0, 0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translate3d(var(--dx), -42vh, 0); opacity: 0; } }

/* the loading screen in that theme */
#loading { background: radial-gradient(120% 70% at 50% 100%, rgba(120, 36, 8, .55), transparent 60%), linear-gradient(180deg, #070a18 0%, #05060d 70%, #0d0705 100%); }
.ld-mark::before { background: radial-gradient(circle, rgba(255, 170, 80, .28), rgba(255, 140, 50, 0) 68%); }
.ld-word { filter: drop-shadow(0 3px 0 #5a1d0a) drop-shadow(0 2px 0 #150806); }
.ld-bar { background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.ld-bar i { background: linear-gradient(90deg, #ff5a1f, #ff9f1c 50%, #ffd23f); }
#loading-text { color: #b9b2c4; } .ld-tip { color: #e6dfe9; }

/* the other title screens in the same dark theme: the trainer creator, the update prompt, the plain title backdrop */
#title { background: radial-gradient(120% 60% at 50% 100%, rgba(120, 36, 8, .45), transparent 60%), linear-gradient(180deg, #070a18 0%, #05060d 70%, #0d0705 100%); }
#title::before, #title::after { display: none; }
.cc-card { background: rgba(7, 10, 28, .78); border: 1px solid rgba(255, 255, 255, .12); border-radius: 24px; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.cc h2 { font: 400 28px/1.1 'Lilita One', Nunito, sans-serif; color: #ffd23f; letter-spacing: .5px; }
.cc-g { border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .05); }
.cc-g.on { background: #fff; color: #0a0f24; border-color: #fff; }
.cc-base { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); }
.cc-base.on { border-color: #ffd23f; box-shadow: 0 0 0 1px #ffd23f inset, 0 0 22px rgba(255, 159, 28, .25); }
.cc-field { color: #d9d3e3; }
.cc-field input { border: 1px solid rgba(255, 255, 255, .16); background: rgba(4, 6, 15, .7); border-radius: 12px; min-height: 48px; }
.cc-field input:focus { outline: none; border-color: #ffd23f; box-shadow: 0 0 0 3px rgba(255, 210, 63, .25); }
.cc-row { color: #d9d3e3; }
.cc-sw button, .cc-custom { border-color: rgba(0, 0, 0, .5); }
.cc-actions .cc-next { border: 0; border-radius: 16px; min-height: 50px; font: 900 17px Nunito, sans-serif; color: #2b1800; background: linear-gradient(180deg, #ffe066, #ff9f1c); box-shadow: 0 10px 30px rgba(255, 159, 28, .35); }
.cc-tcard { background: linear-gradient(180deg, #fff8e6, #f1dfb2); border: 2px solid #e2b23a; border-radius: 18px; }
#update-lock { background: rgba(4, 5, 12, .8); }
#update-lock .ul-card { background: rgba(10, 12, 26, .92); border: 1px solid rgba(255, 210, 63, .4); }
#update-lock .btn { border: 0; border-radius: 16px; font: 900 17px Nunito, sans-serif; color: #2b1800; background: linear-gradient(180deg, #ffe066, #ff9f1c); }
#update-lock p { color: #d9d3e3; } #update-lock small { color: #b9b2c4; }
