/* ===== OVERLAY ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.overlay.hidden {
  display: none;
}

.popup-box {
  background: linear-gradient(160deg, #1e5c34, #143d24);
  border: 2px solid #FFD700;
  border-radius: 20px;
  padding: 28px 22px;
  width: 92%;
  max-width: 440px;
  text-align: center;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.2), 0 8px 32px rgba(0, 0, 0, 0.5);
  max-height: 90vh;
  overflow-y: auto;
}

.popup-box h2 {
  font-size: 22px;
  color: #FFD700;
  margin-bottom: 6px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.popup-step {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 1px;
  margin-bottom: 20px;
  text-transform: uppercase;
}

/* ===== NUMBER SELECTOR ===== */
.number-selector {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: 14px 0;
}

.number-selector span {
  font-size: 44px;
  font-weight: bold;
  min-width: 56px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.btn-round {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #FFE44D, #FFD700);
  color: #1a472a;
  font-size: 26px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 0 #B8960C, 0 6px 12px rgba(0, 0, 0, 0.3);
  transition: transform .1s, box-shadow .1s;
}

/* ===== NAME INPUT ===== */
.name-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 14px;
  padding: 12px 16px;
  margin: 12px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-emoji {
  font-size: 28px;
}

.name-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: white;
  font-family: inherit;
  font-size: 18px;
  font-weight: bold;
}

.name-input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* ===== HEARTS PICKER ===== */
.hearts-picker {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 6px;
}

.heart-btn {
  background: none;
  border: none;
  font-size: 30px;
  cursor: pointer;
  transition: transform .15s;
  padding: 4px;
}

.heart-btn:active {
  transform: scale(1.3);
}

/* ===== BUTTONS ===== */
.btn-main {
  width: 100%;
  padding: 15px;
  border-radius: 50px;
  border: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
  transition: transform .1s, box-shadow .1s;
}

.btn-main:active {
  transform: translateY(3px);
  box-shadow: none !important;
}

.btn-gold {
  background: linear-gradient(145deg, #FFE44D, #FFD700);
  color: #1a472a;
  box-shadow: 0 5px 0 #B8960C, 0 8px 16px rgba(0, 0, 0, 0.3);
}

.btn-gray {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.label-small {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

/* ===== JOKER OVERLAY ===== */
.joker-choice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.joker-choice-btn {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  border: 2px solid rgba(123, 47, 190, 0.5);
  background: rgba(123, 47, 190, 0.15);
  color: white;
  font-family: inherit;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all .2s;
  text-align: left;
}

.joker-choice-btn:hover {
  background: rgba(123, 47, 190, 0.35);
  border-color: #9B4FDE;
}

.joker-choice-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.joker-choice-btn .jc-icon {
  font-size: 24px;
}

.joker-choice-btn .jc-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: normal;
  margin-top: 2px;
}

/* ===== TARGET OVERLAY ===== */
.target-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.target-btn {
  width: 100%;
  padding: 13px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
  color: white;
  font-family: inherit;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all .2s;
  text-align: left;
}

.target-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ===== WIN OVERLAY ===== */
.win-trophy {
  font-size: 72px;
  margin-bottom: 10px;
}

.win-name {
  font-size: 32px;
  font-weight: bold;
  color: #FFD700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  margin-bottom: 6px;
}

.win-sub {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 20px;
}

/* ===== TOGGLE ===== */
.toggle-group {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 10px 0 6px;
}

.toggle-btn {
  flex: 1;
  padding: 10px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.6);
  font-family: inherit;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: all .2s;
}

.toggle-btn.active {
  background: linear-gradient(145deg, #FFE44D, #FFD700);
  color: #1a472a;
  border-color: transparent;
  box-shadow: 0 3px 0 #B8960C;
}


/* ===== GAME TOPBAR ===== */
.game-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 4px 0 10px;
  gap: 8px;
}

.btn-home {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.65);
  border-radius: 50px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-home:hover { background: rgba(255,255,255,0.14); }

/* Undo : unifié, remplace .btn-undo, .casin-undo-btn, etc. */
.btn-undo {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.65);
  border-radius: 50px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-undo:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ===== GAME BOTTOMBAR ===== */
.game-bottombar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 10px;
  margin-top: 12px;
}

/* Faute — à gauche */
.btn-fault {
  flex: 1;
  padding: 13px;
  border-radius: 50px;
  border: 1px solid rgba(220, 50, 50, 0.45);
  background: rgba(180, 30, 30, 0.25);
  color: #ff7070;
  font-family: inherit;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-fault:hover { background: rgba(180,30,30,0.4); }

/* Suivant — à droite */
.btn-next {
  flex: 1;
  padding: 13px;
  border-radius: 50px;
  border: none;
  background: linear-gradient(145deg, #1976D2, #0D47A1);
  color: white;
  font-family: inherit;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 0 #0a2f6b;
  transition: transform 0.1s;
}
.btn-next:active { transform: translateY(2px); box-shadow: none; }

/* Quand "Suivant" est seul (pas de faute), il prend toute la largeur */
.btn-next.full { flex: unset; width: 100%; }
