/* ── SUPER LEAGUE ── CSS ────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Press Start 2P', 'Courier New', monospace;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

#gameCanvas {
  display: block;
  /* Scale to fit viewport while preserving 16:9 aspect ratio */
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  aspect-ratio: 16 / 9;

  /* Pixel-perfect rendering */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  image-rendering: -moz-crisp-edges;

  /* Subtle outer glow */
  box-shadow: 0 0 40px rgba(0, 80, 20, 0.5), 0 0 80px rgba(0, 40, 10, 0.3);
}

/* Loading screen fallback */
#loadingScreen {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #4488ff;
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  z-index: 999;
  transition: opacity 0.4s;
}

#loadingScreen.hidden {
  opacity: 0;
  pointer-events: none;
}

#loadingScreen .title {
  font-size: 24px;
  color: #ff4400;
  text-shadow: 0 0 20px #ff4400;
  margin-bottom: 32px;
  animation: pulse 1.5s ease-in-out infinite;
}

#loadingScreen .bar-wrap {
  width: 300px;
  height: 12px;
  background: #1a1a2a;
  border: 2px solid #4488ff;
  border-radius: 6px;
  overflow: hidden;
}

#loadingScreen .bar {
  height: 100%;
  background: linear-gradient(90deg, #2244cc, #4488ff);
  width: 0%;
  transition: width 0.2s;
  box-shadow: 0 0 8px #4488ff;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* Prevent text selection during play */
canvas {
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}
