/* The menu's motion (src/ui/intro.js has the rest): the loading screen's entrance on the first start - it plays from the
   page's first style, no script needed - and the pieces the script moves. Transform and opacity only (the compositor
   runs them while the page's thread decodes the packs); nothing loops but the bar's sheen while it loads; none under
   prefers-reduced-motion. */

/* ---------------- the logo in layers (tools/logo/build.py: one box, one part each) */
.logo.stack { display: grid; }
.logo.stack > img { grid-area: 1 / 1; }
.logo.stack .l-mark { transform-origin: 5.2% 50%; }   /* the mark's centre in the lockup's box */
.logo.stack .l-flash { filter: none; opacity: 0; pointer-events: none; }

/* ---------------- the first start: the screen comes on like a tube, the logo is assembled, the bar slides in */
#screen-loading.boot { z-index: 22; }
#screen-loading.boot:not(.go) { visibility: hidden; }   /* until the first frame is on screen (index.html adds .go) */
body:has(> #screen-loading.boot) > #app { visibility: hidden; }   /* (the game behind would show past the tube's line) */
#screen-loading.go { animation: crt-on .5s cubic-bezier(.2, .8, .2, 1) both; }
#screen-loading.go::before { content: ''; position: fixed; inset: 0; z-index: 1; background: #fff1e8; pointer-events: none;
  animation: crt-flash .7s ease-out both; }
#screen-loading.go .l-mark { animation: l-drop .58s .44s cubic-bezier(.2, .75, .25, 1) both; }
#screen-loading.go .l-crimson { animation: l-left .62s .6s cubic-bezier(.16, .84, .3, 1) both; }
#screen-loading.go .l-front { animation: l-right .62s .68s cubic-bezier(.16, .84, .3, 1) both; }
#screen-loading.go .l-flash { animation: l-flash .55s 1.18s ease-out both; }
#screen-loading.go .brand { animation: l-thud .26s 1.2s ease-out both; }
#screen-loading.go .byline { animation: spread .55s 1.26s cubic-bezier(.16, .84, .3, 1) both; }
#screen-loading.go .bar { animation: spread .5s 1.38s cubic-bezier(.16, .84, .3, 1) both; }
#screen-loading.go #load-text { animation: fade-in .45s 1.5s ease-out both; }
/* a later loading (a match's packs, a rejoin): its backdrop covers at once - the started match is already drawn under
   it, messages and all (the user, 2026-10-27: "na ułamek sekundy widać już mapę gry z komunikatami") - and only its
   logo, bar and line fade in */
#screen-loading:not(.boot) > * { animation: fade-in .22s ease-out; }
@keyframes crt-on { 0% { transform: scale(.2, .003); } 38% { transform: scale(1, .003); } 100% { transform: none; } }
@keyframes crt-flash { 0%, 40% { opacity: .92; } 100% { opacity: 0; } }
@keyframes l-drop { 0% { opacity: 0; transform: translateY(-70px) scale(1.7); } 55% { opacity: 1; } 80% { transform: translateY(5px) scale(.97); }
  100% { opacity: 1; transform: none; } }
@keyframes l-left { 0% { opacity: 0; transform: translateX(-130px); } 100% { opacity: 1; transform: none; } }
@keyframes l-right { 0% { opacity: 0; transform: translateX(150px); } 100% { opacity: 1; transform: none; } }
@keyframes l-flash { 0% { opacity: 0; } 16% { opacity: .6; } 100% { opacity: 0; } }
@keyframes l-thud { 0% { transform: translateY(5px); } 100% { transform: none; } }
@keyframes spread { 0% { opacity: 0; transform: scaleX(.15); } 100% { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* the bar's sheen while it fills */
#load-fill { position: relative; overflow: hidden; }
#load-fill::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 140px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 228, 210, .5), transparent); animation: sheen 1.5s linear infinite; }
@keyframes sheen { from { transform: translateX(-140px); } to { transform: translateX(900px); } }

/* ---------------- what the script adds for a moment (ui/intro.js), over everything, never in the way of a click */
.cf-fly { position: fixed; z-index: 45; transform-origin: 0 0; pointer-events: none; }
.cf-fly > img { width: 100%; height: auto; }
/* the old dialogs' opening: an outline growing from the box's centre, then a scan line down the content */
.cf-frame { position: fixed; z-index: 45; pointer-events: none; border: 1px solid #ff8a66; border-radius: 4px;
  box-shadow: 0 0 14px rgba(255, 90, 60, .55), inset 0 0 14px rgba(255, 90, 60, .25); }
.cf-scan { position: fixed; z-index: 45; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 150, 120, .9) 18%, #fff3ea 50%, rgba(255, 150, 120, .9) 82%, transparent);
  box-shadow: 0 0 12px 2px rgba(255, 90, 60, .55); }
/* the gleam across the start button once the menu is up */
#btn-start { position: relative; overflow: hidden; }
.cf-glint { position: absolute; top: 0; bottom: 0; left: 0; width: 90px; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 236, 222, .42), transparent); }
/* the landing's glow behind the menu head's logo */
.cf-glow { position: absolute; left: 50%; top: -40px; width: 820px; max-width: 100vw; height: 170px; transform: translateX(-50%); pointer-events: none;
  z-index: -1; background: radial-gradient(ellipse at 50% 50%, rgba(255, 86, 56, .34), transparent 68%); }
/* the chosen tab's plate sliding from the tab before - inside the tabs' box, UNDER the buttons, so the arriving tab's name
   and icon stay readable while it slides (the user, 2026-10-27: the text vanished for a moment) */
.cf-plate { position: absolute; z-index: 0; pointer-events: none; border-radius: 4px; transform-origin: 0 0; }
.tabs > button { position: relative; z-index: 1; }
.tabs button.cf-arriving { background: transparent; box-shadow: none; }
@media (hover: hover) { .tabs button.cf-arriving:hover { background: transparent; box-shadow: none; } }
/* the windows open with the outline (ui/intro.js) instead of the plain pop */
.motion .modal-box { animation: none; }

@media (prefers-reduced-motion: reduce) {
  #screen-loading, #screen-loading *, #screen-loading::before, #load-fill::after { animation: none !important; }
  #screen-loading.go::before { display: none; }
}
