* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at top, #16213e 0%, #0b1020 38%, #04060d 100%);
  color: #f5f7ff;
  font-family: Arial, Helvetica, sans-serif;
}

.game-shell {
  width: min(100%, 980px);
}

.game-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  letter-spacing: 0.14em;
}

.hud {
  display: flex;
  gap: 20px;
  font-size: 1rem;
  white-space: nowrap;
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  border: 3px solid #8cf7ff;
  box-shadow:
    0 0 20px rgba(140, 247, 255, 0.35),
    inset 0 0 20px rgba(140, 247, 255, 0.08);
  background: #02040b;
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 900 / 650;
  background: #02040b;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(1, 4, 12, 0.76);
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  width: min(100%, 430px);
  padding: 28px;
  text-align: center;
  border: 2px solid #8cf7ff;
  background: rgba(6, 13, 29, 0.96);
  box-shadow: 0 0 25px rgba(140, 247, 255, 0.2);
}

.overlay-card h2 {
  margin: 0 0 14px;
  font-size: 2rem;
}

.overlay-card p {
  margin: 0 0 22px;
  line-height: 1.6;
  color: #cad8ff;
}

button {
  border: 0;
  padding: 12px 28px;
  background: #8cf7ff;
  color: #06111a;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.12);
}

.controls {
  margin: 12px 0 0;
  text-align: center;
  color: #aebad7;
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  body {
    padding: 10px;
  }

  .game-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .hud {
    width: 100%;
    justify-content: space-between;
  }

  .controls {
    font-size: 0.8rem;
  }
}

/* Lien de retour vers le site, ajoute par-dessus le jeu. */
.retour-site {
    position: fixed;
    top: 10px;
    left: 12px;
    margin: 0;
    z-index: 10;
    font-size: 14px;
}
.retour-site a {
    color: inherit;
    opacity: 0.8;
}
.retour-site a:hover {
    opacity: 1;
    text-decoration: underline;
}
