---
import LoadingSpinner from "@components/LoadingSpinner.astro";

export const prerender = false;
---

<!doctype html>
<html lang="en" class="w-full h-full">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Game</title>
    <script src="https://cdn.jsdelivr.net/npm/@ruffle-rs/ruffle@0.1.0-nightly.2024.9.19/ruffle.min.js" is:inline></script>
    <script type="module" src="/flash/instantiateFlash.js" is:inline defer></script>
    <link rel="stylesheet" href="/unity/index.css" />
  </head>
  <body>
    <div id="loader" class="loading">
      <LoadingSpinner />
    </div>
    <div id="gameContainer" class="game hidden"></div>
  </body>
</html>

<style>
  body {
    width: 100%;
    height: 100%;
    background-color: #1f2937;
    color: #f3f4f6;
  }

  .loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    height: 100%;
  }

  .game {
    width: 100%;
    height: 100%;
    background-color: #fff;
  }

  .hidden {
    display: none;
  }
</style>
