@import url('https://fonts.googleapis.com/css2?family=Mountains+of+Christmas:wght@400;700&family=Poppins:wght@100;200;300;400;500;600&display=swap');

:root{
  /* Hauteurs kiosque */
  --top-gap: clamp(6px, 1vh, 14px);
  --footer-h: clamp(64px, 10vh, 90px);

  /* Grille : on gardera un nb de colonnes cohérent via JS (recommandé) */
  --grid-cols: 10;

  /* Taille cellule : calculée en "safe" (mise à jour par JS possible) */
  --cell: 44px;

  /* Boule */
  --ball: clamp(200px, 37vh, 420px);
}

*{ margin:0; padding:0; box-sizing:border-box; font-family:'Poppins',sans-serif; }

html, body{
  height: 100%;
  overflow: hidden; /* ✅ no scroll */
}

body{
  display:flex;
  flex-direction: column;
  align-items:center;
  justify-content:flex-start;

  background: url("../img/bg.jpg") center/cover no-repeat;
  color:#fff;
  user-select:none;
      padding-bottom: calc(var(--footer-h) + env(safe-area-inset-bottom));

}

/* Logo */
.logo{
  margin-top: var(--top-gap);
  width: clamp(160px, 24vw, 520px);
}

/* Progress */
.progress-container{
  width: min(900px, 92vw);
  margin: var(--top-gap) auto 0;
}

#progressBar{
  width:0%;
  height:100%;
  transition: width linear;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Bandeau fin de partie */
.game-finished{
  position: fixed;
  top: 10vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: clamp(13px, 2vw, 18px);
  font-weight: 700;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  max-width: 92vw;
}

/* ✅ ZONE JEU : prend toute la place restante entre top et footer */
#content{
  width: min(1400px, 96vw);
  flex: 1;
  min-height: 0; /* important pour éviter overflow */
  display:flex;
  justify-content: space-evenly;
  align-items: center;
  gap: clamp(10px, 2vw, 26px);
  margin-top: var(--top-gap);
  padding: 0 8px;
}

/* Grille */
.gridnumber{
  width: min(60vw, 860px);
  height: 100%;
  min-height: 0;

  display:grid;
  gap: clamp(6px, 1.2vw, 10px);
  justify-content:center;
  align-content:center;

  /* ✅ colonnes fixes "kiosque" */
  grid-template-columns: repeat(var(--grid-cols), var(--cell));
}

/* Cellules */
.gridnumber .choice{
  width: var(--cell);
  height: var(--cell);
  border-radius: 10px;
  border: 1px solid #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition: .2s ease;
  box-shadow: rgba(0, 0, 0, 0.75) 0px 25px 20px -20px;
  backdrop-filter: blur(5px);
  font-size: clamp(12px, 1.3vw, 18px);
}

.gridnumber .choice:hover{
  background: rgb(40, 82, 98);
  transform: scale(1.08);
}

.gridnumber .choice.disabled{
  background: rgb(233 24 24);
  animation: 2s animScale 0s 1;
}

@keyframes animScale{
  0%{ transform: scale(1,1) translateY(0); background: rgb(255, 165, 0); }
  10%{ transform: scale(1.1,.9) translateY(0); background: rgb(255, 165, 0); }
  30%{ transform: scale(.9,1.1) translateY(-5px); background: rgb(0, 68, 150); }
  50%{ transform: scale(1,1) translateY(0); }
  100%{ transform: scale(1,1) translateY(0); }
}

/* Tirage */
.contenttirage{
  width: min(420px, 34vw);
  height: 100%;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height: 0;
}

.tirage{ display:none; }

/* Boule */
.boule1{
  width: var(--ball);
  height: var(--ball);
  border-radius: 50%;
  display:flex;
  justify-content:center;
  box-shadow: 0 0 12px 5px #ffffff;
  background:#d126ca;
}

.boule-red    { background-color:#e74c3c; }
.boule-orange { background-color:#e67e22; }
.boule-yellow { background-color:#f1c40f; }
.boule-green  { background-color:#2ecc71; }
.boule-blue   { background-color:#3498db; }

.boule2{
  width: 90%;
  padding: clamp(10px, 2vw, 24px);
  display:flex;
  align-items:center;
  justify-content:center;
}

@keyframes popBounce{
  0%{ transform: scale(0); opacity:0; }
  60%{ transform: scale(1.2); opacity:1; }
  100%{ transform: scale(1); }
}

.boule2 span{
  width: calc(var(--ball) * 0.78);
  height: calc(var(--ball) * 0.78);
  border-radius: 50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background: radial-gradient(circle at 30% 30%, #ffffff, #dcdcdc);

  font-size: clamp(52px, 9vw, 170px);
  font-weight: 800;
  color:#2c3e50;
  text-shadow: 0px 2px 4px rgba(0,0,0,0.6);

  box-shadow:
    inset -4px -4px 10px rgba(255,255,255,0.8),
    inset 4px 4px 10px rgba(0,0,0,0.2),
    0px 0px 20px 5px rgba(255,255,255,0.3);

  animation: popBounce .4s ease-out;
}

.modal{ color:#000; }

/* ✅ CONTROLS BAR (footer) */
.footer{
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--footer-h);
  z-index: 2000;

  display:flex;
  justify-content:center;
  align-items:center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 12px;

  background: rgba(0,0,0,0.28);
  backdrop-filter: blur(6px);

  opacity: 1;
  transform: translateY(0);
  transition: opacity .25s ease, transform .25s ease;
}

.footer.is-hidden{
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.footer button{ margin:0; }

/* Ribbon démo */
.ribbon-demo{
  position: fixed;
  top: 125px;
  left: -15px;
  width: 200px;
  background: red;
  color: white;
  text-align: center;
  font-weight: bold;
  padding: 5px 0;
  z-index: 9999;
  transform: rotate(-45deg);
  transform-origin: 0 0;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
  font-size: 14px;
  line-height: 1;
}

/* ✅ TABLETTE / PETIT ÉCRAN : on empile sans scroll */
@media (max-width: 900px){
  #content{
    flex-direction: column;
    justify-content: center;
    gap: 10px;
  }

  .gridnumber{
    width: min(96vw, 720px);
    height: auto;
  }

  .contenttirage{
    width: 100%;
    height: auto;
  }

  :root{
    --ball: clamp(190px, 28vh, 320px);
  }
}

/* Très petit écran : boutons plus compacts */
@media (max-width: 420px){
  .footer .btn{
    padding: 8px 10px;
    font-size: 14px;
  }
}

#physicalUndo.btn-outline-light{
  border-color: rgba(255,255,255,.25) !important;
  background: rgba(255,255,255,.06) !important;
}
#physicalUndo:disabled{
  opacity: .45;
}
