/* Page blanche, titre noir, zone de jeu 16:9 dans un cadre noir de 4 px. */
:root {
  --cadre: 4px;
  --marge: 16px;
}

/* Silkscreen Bold (OFL, voir assets/polices/Silkscreen-OFL.txt) : police pixel du titre. */
@font-face {
  font-family: "Silkscreen";
  src: url("assets/polices/Silkscreen-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: block;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: #fff;
  color: #000;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 var(--marge) var(--marge);
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

/* Taille en multiples de 8 px (la grille de Silkscreen) pour garder des pixels nets. */
h1 {
  margin: 24px 0 20px;
  font-family: "Silkscreen", monospace;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
  text-align: center;
  -webkit-font-smoothing: none;
  font-smooth: never;
}
@media (min-width: 560px) { h1 { font-size: 24px; } }
@media (min-width: 760px) { h1 { font-size: 32px; } }
@media (min-width: 1200px) { h1 { font-size: 40px; } }

#scene {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* La taille exacte est posée par main.js (multiple entier de 512×288 quand c'est possible). */
/* content-box : le ratio 16:9 s'applique à la zone de jeu, sans le cadre. */
#cadre {
  position: relative;
  box-sizing: content-box;
  width: calc(100% - 2 * var(--cadre));
  max-width: calc(512px * 3);
  aspect-ratio: 16 / 9;
  border: var(--cadre) solid #000;
  background: #fff;
}

#jeu {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  outline: none;
}

#chargement {
  position: absolute;
  left: 25%;
  right: 25%;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  background: #fff;
  border: 1px solid #000;
}

#progression {
  width: 0;
  height: 100%;
  background: #000;
  transition: width 0.15s linear;
}

#message {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1em;
  text-align: center;
  font-size: 0.95rem;
}

#message[hidden] { display: none; }

#aide {
  margin: 0.8em 0 0;
  font-size: 0.9rem;
  color: #666;
  text-align: center;
}
