/* The boot splash index.html shows until the app's first view: the shared YouTD orb loader, each tower element a round
   orb that rises into the row and plays its element's effect in turn. A plain stylesheet rather than inline CSS because
   the page's Content-Security-Policy forbids inline styles; it loads in parallel with the app's own CSS, which blocks
   first paint anyway. Once the app is up the splash is hidden, not removed, and shows again while a click leaves for
   another YouTD app. */
/* No scrollbar or gutter beside the splash, so the row is centred in the full viewport as on the other YouTD apps. */
html:has(> body > #d-splash:not([hidden])) { overflow-y: hidden !important; scrollbar-gutter: auto !important; background-color: #0b0907 !important; }
#d-splash { position: fixed; inset: 0; z-index: 1001; display: grid; place-items: center; background-color: #0b0907; }
#d-splash[hidden] { display: none; }
#d-splash .row { --size: min(max(2.5vw, 40px), 8vw); display: flex; gap: calc(var(--size) * .4); }
#d-splash .el {
  width: var(--size); height: var(--size); border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 calc(var(--size) * .3) color-mix(in srgb, var(--c) 55%, transparent), 0 3px 8px rgb(0 0 0 / .6);
  opacity: 0; animation: youtd-splash-row 3s ease-in-out infinite, var(--fx) 3s ease-in-out infinite;
}
/* The icon at 118%, as the other apps draw it as a background, which crops its bevel inside the circle. */
#d-splash .el img { display: block; width: 118%; height: 118%; margin: -9%; }
#d-splash .el:nth-child(2) { animation-delay: .15s; }
#d-splash .el:nth-child(3) { animation-delay: .3s; }
#d-splash .el:nth-child(4) { animation-delay: .45s; }
#d-splash .el:nth-child(5) { animation-delay: .6s; }
#d-splash .el:nth-child(6) { animation-delay: .75s; }
#d-splash .el:nth-child(7) { animation-delay: .9s; }
#d-splash .el:nth-child(8) { animation-delay: 1.05s; }
#d-splash .nature { --c: #80ff00; --fx: youtd-orb-nature; }
#d-splash .fire { --c: #ff5300; --fx: youtd-orb-fire; }
#d-splash .ice { --c: #00ffff; --fx: youtd-orb-ice; }
#d-splash .storm { --c: #8080ff; --fx: youtd-orb-storm; }
#d-splash .iron { --c: #c0c0c0; --fx: youtd-orb-iron; }
#d-splash .astral { --c: #ffff80; --fx: youtd-orb-astral; }
#d-splash .darkness { --c: #8a5300; --fx: youtd-orb-darkness; }
#d-splash .arcane { --c: #ff77ff; --fx: youtd-orb-arcane; }
@keyframes youtd-splash-row {
  0% { opacity: 0; transform: scale(.85); }
  40% { opacity: 1; transform: scale(1); }
  65% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(.9); }
}
@keyframes youtd-orb-nature { 0%, 30% { rotate: -8deg; filter: saturate(.6); } 55%, 100% { rotate: 0deg; filter: none; } }
@keyframes youtd-orb-fire { 0%, 35%, 65%, 100% { filter: none; } 50% { filter: brightness(1.45) saturate(1.4); } }
@keyframes youtd-orb-ice { 0%, 30% { filter: blur(1px) saturate(.4) brightness(1.3); } 58%, 100% { filter: none; } }
@keyframes youtd-orb-storm { 0%, 38%, 58%, 100% { filter: none; } 42% { filter: brightness(1.7) saturate(.6); } 46% { filter: brightness(1.05); } 51% { filter: brightness(1.5) saturate(.7); } }
@keyframes youtd-orb-iron { 0%, 30% { translate: 0 -6%; } 46% { translate: 0 1.5%; } 56%, 100% { translate: 0 0; } }
@keyframes youtd-orb-astral { 0%, 36%, 64%, 100% { filter: none; } 50% { filter: brightness(1.55) saturate(.7); } }
@keyframes youtd-orb-darkness { 0%, 36%, 64%, 100% { filter: none; scale: 1; } 48% { filter: brightness(.5); scale: 1.06; } }
@keyframes youtd-orb-arcane { 0%, 35%, 75%, 100% { translate: 0 0; } 48% { translate: 0 -5%; } 62% { translate: 0 2%; } }
/* The forum's slider bar (core .loading-indicator-container in the eeve colours) over a route change; it stays above the
   splash once that takes over. */
#youtd-bar { position: fixed; top: 0; left: 0; z-index: 1002; width: 100%; height: 3px; background-color: #3c3316; }
#youtd-bar[hidden] { display: none; }
#youtd-bar div { height: 100%; background-color: #d7981f; transform: scaleX(0); transform-origin: left; }
#youtd-bar.loading div { animation: youtd-bar-load .3s ease-in forwards, youtd-bar-still 10s linear .3s forwards; }
#youtd-bar.done { opacity: 0; transition: opacity .4s ease .4s; }
#youtd-bar.done div { transform: scaleX(1); transition: transform .4s ease-out; }
@keyframes youtd-bar-load { to { transform: scaleX(.8); } }
@keyframes youtd-bar-still { from { transform: scaleX(.8); } to { transform: scaleX(.9); } }
@media (prefers-reduced-motion: reduce) {
  #d-splash .el { animation: none; opacity: 1; }
}
/* The Elements palette's stone charcoal, so the splash does not flash the ember black. */
html[data-palette='elements']:has(> body > #d-splash:not([hidden])) { background-color: #0d0e10 !important; }
html[data-palette='elements'] #d-splash { background-color: #0d0e10; }
