:root { color-scheme: dark; }
html, body { margin: 0; height: 100%; background: #05070c; overflow: hidden; }
#canvas { display: block; width: 100vw; height: 100vh; outline: none; }
#status { position: fixed; left: 0; right: 0; bottom: 24px; text-align: center; font: 14px/1.4 system-ui, sans-serif; color: #cfd6e4;
          text-shadow: 0 1px 2px #000; pointer-events: none; display: none; }

/* ---------------------------------------------------------------- loading screen
   A dark ground that is lighter in the middle, the logo, a bar and two lines under it : how far ( "Loading… 62%" )
   and what is being done. Nothing of the game's art. */
#loader { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; overflow: hidden;
          background: radial-gradient(circle at 50% 44%, #1b5a9e 0%, #0e2f5c 34%, #07162c 68%, #040a16 100%);
          transition: opacity .45s ease; }
#loader.done { opacity: 0; pointer-events: none; }
#loader-box { width: min(86vw, 560px); display: flex; flex-direction: column; align-items: center; }
#loader-logo { display: block; width: min(100%, 520px); height: auto; filter: drop-shadow(0 18px 34px rgba(0, 0, 0, .55));
               animation: loader-float 3.6s ease-in-out infinite alternate; }
@keyframes loader-float { from { transform: translateY(4px); } to { transform: translateY(-6px); } }

/* the bar : a dark groove, the progress in the logo's sky blue with a light running over it */
#loader-track { position: relative; width: min(100%, 380px); height: 22px; margin-top: 34px; border-radius: 999px; overflow: hidden;
                background: #06101f; box-shadow: inset 0 2px 5px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .08); }
#loader-bar { position: absolute; inset: 2px; border-radius: 999px; transform-origin: 0 50%; transform: scaleX(0); will-change: transform;
              background: linear-gradient(180deg, #8fe6ff 0%, #2fb0ff 42%, #1583e6 100%);
              box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }
#loader-bar::after { content: ""; position: absolute; inset: 0; width: 30%;
                     background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent);
                     animation: loader-shine 1.6s linear infinite; }
@keyframes loader-shine { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

#loader-pct { margin-top: 20px; color: #fff; font: 800 22px/1.1 "Segoe UI", system-ui, sans-serif; letter-spacing: .02em;
              font-variant-numeric: tabular-nums; text-shadow: 0 2px 4px rgba(0, 0, 0, .6); }
#loader-text { margin-top: 8px; min-height: 18px; color: #8fb4dc; font: 600 13px/1.4 "Segoe UI", system-ui, sans-serif;
               letter-spacing: .03em; white-space: nowrap; }
#loader-text.error { color: #ff9a8a; white-space: normal; text-align: center; }

@media (prefers-reduced-motion: reduce) { #loader-logo, #loader-bar::after { animation: none; } }
@media (max-height: 420px) { #loader-logo { width: min(100%, 300px); } #loader-track { margin-top: 16px; } #loader-pct { margin-top: 10px; font-size: 18px; } }
