@font-face {
      font-family: 'Lalezar';
      font-style: normal;
      font-weight: 400;
      font-display: swap;
      src: url('../fonts/Lalezar-Regular.ttf') format('truetype');
    }
    @font-face {
      font-family: 'Estedad';
      font-style: normal;
      font-weight: 400;
      font-display: swap;
      src: url('../fonts/Estedad-Regular.woff2') format('woff2');
    }
    @font-face {
      font-family: 'Estedad';
      font-style: normal;
      font-weight: 700;
      font-display: swap;
      src: url('../fonts/Estedad-Bold.woff2') format('woff2');
    }
    @font-face {
      font-family: 'Estedad-Mad';
      font-style: normal;
      font-weight: 400;
      font-display: swap;
      src: url('../fonts/Estedad-Mad.woff2') format('woff2'),
           url('../fonts/Estedad-Mad.ttf') format('truetype');
    }
    @font-face {
      font-family: 'Vazirmatn';
      font-style: normal;
      font-weight: 400;
      font-display: swap;
      src: url('../fonts/Vazirmatn-Regular.ttf') format('truetype');
    }
    @font-face {
      font-family: 'Vazirmatn';
      font-style: normal;
      font-weight: 700;
      font-display: swap;
      src: url('../fonts/Vazirmatn-Bold.ttf') format('truetype');
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      user-select: none;
      -webkit-user-select: none;
    }

    html, body {
      width: 100%;
      height: 100%;
      background-color: #050508;
      color: #e0e0e0;
      font-family: 'Estedad', 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      overflow: hidden;
      display: flex;
      justify-content: center;
      align-items: center;
      direction: rtl;
    }

    button, input, select, textarea {
      font-family: 'Estedad', 'Vazirmatn', sans-serif;
    }

    #game-container {
      position: relative;
      width: 100vw;
      height: 100vh;
      max-width: 56.25vh; /* 9:16 aspect ratio */
      max-height: 177.77vw;
      aspect-ratio: 9 / 16;
      background-color: #020204;
      box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), 0 0 1px rgba(255, 255, 255, 0.1);
      display: flex;
      overflow: hidden;
    }

    .startup-splash {
      position: absolute;
      inset: 0;
      z-index: 2000;
      display: flex;
      align-items: center;
      justify-content: center;
      background: #020204;
      opacity: 1;
      pointer-events: auto;
      transition: opacity 0.2s ease;
    }

    .startup-splash img {
      display: block;
      width: auto;
      height: auto;
      max-width: 90%;
      max-height: 75%;
      object-fit: contain;
    }

    .startup-splash.is-hiding {
      opacity: 0;
      pointer-events: none;
    }

    @media (prefers-reduced-motion: reduce) {
      .startup-splash { transition: none; }
    }

    canvas {
      width: 100%;
      height: 100%;
      display: block;
      touch-action: none;
      cursor: crosshair;
    }
