/* Empêche tout scroll horizontal */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

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

/* Canvas du jeu */
#game {
  display: block;
  margin: 0 auto;
  background: #000;
  border: 2px solid #fff;

  width: min(400px, 100%);
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;

  touch-action: none;        /* empêche scroll/zoom dans le canvas */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* HUD */
.hud {
  color: #fff;

  width: min(400px, 100%);
  max-width: 100%;
  margin: 12px auto 0;
  padding: 0 12px;

  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;

  overflow-x: hidden; /* ✅ coupe tout débordement interne */
}

/* Ligne d'état */
.line {
  width: 100%;
  max-width: 100%;
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* Scoreline : doit pouvoir casser (sinon scroll) */
.scoreline{
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 10px;      /* row-gap / column-gap */
  text-align: center;
  font-size: 16px;
  opacity: 0.95;
  overflow-x: hidden;
}

.scoreline .item{
  white-space: nowrap; /* chaque item reste compact */
}

.scoreline .sep{
  opacity: 0.6;
  user-select: none;
}

/* Optionnel : évite qu'un span impose une largeur */
.scoreline span {
  max-width: 100%;
}

.status {
  min-height: 22px;
}

.btn {
  background: transparent;
  color: #fff;
  border: 1px solid #fff;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.btn:hover {
  background: rgba(255,255,255,0.1);
}

/* Leaderboard */
.leaderboard {
  width: min(400px, 100%);
  max-width: 100%;
  margin: 12px auto 0;
  padding: 0 12px;
  color: #fff;
  overflow-x: hidden;
}

@media (max-width: 360px){
  .scoreline .sep{ display:none; }
}
