* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #050816;
  color: #f5f7ff;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  overflow: hidden;
}

.game-shell {
  width: min(100vw, 1100px);
  padding: 12px;
}

.hud {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  justify-content: center;
  margin-bottom: 10px;
  font-weight: 700;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 120px);
  margin: 0 auto;
  background: #02050f;
  border: 2px solid #46507a;
  box-shadow: 0 0 24px rgba(80, 110, 255, 0.15);
}

.controls {
  margin: 8px 0 0;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.75;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 5, 15, 0.82);
  z-index: 10;
}

.hidden {
  display: none;
}

.panel {
  width: min(92vw, 760px);
  padding: 28px;
  background: #0d132b;
  border: 2px solid #5966a6;
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.panel h2 {
  margin-top: 0;
}

.upgrade-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.upgrade-card,
#restartButton {
  border: 2px solid #7182d8;
  background: #141d42;
  color: white;
  padding: 18px;
  cursor: pointer;
  font: inherit;
}

.upgrade-card {
  min-height: 140px;
}

.upgrade-card strong,
.upgrade-card span {
  display: block;
}

.upgrade-card strong {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.upgrade-card:hover,
#restartButton:hover {
  background: #22306c;
}

.upgrade-card:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

#restartButton {
  padding: 12px 24px;
}

@media (max-width: 700px) {
  .upgrade-grid {
    grid-template-columns: 1fr;
  }
}

/* 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;
}
