@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap');

/* Background : dégradé radial bleu foncé avec centre légèrement plus clair */
html, body {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Chakra Petch', sans-serif;
  background: radial-gradient(circle, #3f51b5 0%, #1a237e 100%);
  color: #ffffff;
  text-align: center;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Conteneur principal */
#container, body {
  padding: 15px;
  max-width: 400px;
  margin: auto;
}

/* Logo cliquable */
header img {
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 auto;
  display: block;
}

/* Onglets (gélules) identiques à Banana4Scale */
.tabs {
  position: relative;
  display: flex;
  justify-content: space-between;
  background: linear-gradient(to top, #ffffff, #bbdefb);
  width: 100%;
  font-size: 1.1em;
  border-radius: 30px;
  box-shadow: 0 0 1px rgba(0,0,0,0.15), 0 6px 12px rgba(0,0,0,0.15);
  padding: 0.2rem;
  overflow: hidden;
  margin-bottom: 15px;
}

.tabs input[type="radio"] {
  display: none;
}

.tabs label.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 44px;
  font-size: 1rem;
  font-weight: bold;
  text-transform: uppercase;
  background-color: transparent;
  border-radius: 9999px;
  cursor: pointer;
  margin: 0 5px;
  z-index: 2;
  transition: color 0.3s ease-in-out;
  color: #0d274d;
  font-family: 'Chakra Petch', sans-serif;
}

.tabs input[type="radio"]:checked + label {
  color: #ffffff;
}

.glider {
  position: absolute;
  top: 2px;
  left: 4px;
  width: calc(50% - 8px);
  height: calc(100% - 4px);
  background: linear-gradient(to top, #1565c0, #1e88e5);
  border-radius: 30px;
  transition: left 0.4s ease-in-out;
  z-index: 1;
}

/* Contenu des onglets */
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* Onglet "Bingos" */
#predefined .top-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
#predefined .top-controls select,
#predefined .top-controls button {
  flex: 1;
  padding: 6px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
  font-family: 'Chakra Petch', sans-serif;
}
#predefined .top-controls select {
  background: #ffffff;
  color: #0d274d;
}
#predefined .top-controls button {
  background: linear-gradient(to top, #1565c0, #1e88e5);
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}
#predefined .top-controls button:hover {
  background: linear-gradient(to top, #0d47a1, #1565c0);
}
#predefined .stats {
  margin-bottom: 8px;
  font-size: 14px;
  font-family: 'Chakra Petch', sans-serif;
}
#predefined .action-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
#predefined .action-buttons button {
  flex: 1;
  padding: 6px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(to top, #1565c0, #1e88e5);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.3s;
  font-family: 'Chakra Petch', sans-serif;
}
#predefined .action-buttons button:hover {
  background: linear-gradient(to top, #0d47a1, #1565c0);
}

/* Grille de bingo */
#gridContainer {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
  margin: 8px auto;
}
.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 4px;
  width: 100%;
  height: 100%;
}
.cell {
  background: linear-gradient(to bottom, #ffffff, #e3f2fd);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  font-size: 10px;
  font-family: 'Open Sans', sans-serif;
  font-weight: 700;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0d274d;
  cursor: pointer;
  user-select: none;
  word-break: break-word;
}
.cell.selected {
  background: linear-gradient(to top, #1565c0, #1e88e5);
  color: #ffffff;
  font-family: 'Open Sans', sans-serif;
}

/* Texte "BINGO" */
#bingoText {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 48px;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(0,0,0,0.8);
  letter-spacing: 1px;
  font-weight: 900;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
}
@keyframes popIn {
  0% { transform: translate(-50%, -50%) scale(0) rotateX(90deg); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.3) rotateX(0deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1) rotateX(0deg); opacity: 1; }
}

/* Onglet "Créer mon bingo" - Formulaire */
#createForm {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
#createForm input {
  width: 355px;
  padding: 8px;
  font-size: 14px;
  border: 1px solid #1565c0;
  border-radius: 30px;
  font-family: 'Chakra Petch', sans-serif;
  color: #0d274d;
}

/* Bouton de validation du formulaire */
.submit-btn {
  margin-top: 8px;
  padding: 8px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(to top, #1565c0, #1e88e5);
  color: #ffffff;
  cursor: pointer;
  font-family: 'Chakra Petch', sans-serif;
  transition: background 0.3s;
}
.btn {
  margin-top: 8px;
  padding: 8px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(to top, #1565c0, #1e88e5);
  color: #ffffff;
  cursor: pointer;
  font-family: 'Chakra Petch', sans-serif;
  transition: background 0.3s;
}
.submit-btn:hover {
  background: linear-gradient(to top, #0d47a1, #1565c0);
}
/* Conteneur pour gérer la flèche personnalisée */
.select-container {
  position: relative;
  display: inline-block;
}

/* Conteneur du select pour la position relative et la flèche */
.select-container {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 300px; /* Ajustez la largeur maximum selon vos besoins */
}
/* Conteneur pour aligner le select et le bouton sur une même ligne */
.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 8px; /* Espace entre le select et le bouton */
}

/* Conteneur du select pour gérer la flèche personnalisée */
.select-container {
  position: relative;
  display: inline-block;
}

/* Style du select en mode gélule, plus compact et moins large */
select.select-pill {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 150px; /* Largeur réduite */
  padding: 6px 30px 6px 12px; /* Padding droit pour laisser la place à la flèche */
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 50px;
  background-color: #fff;  /* Fond clair, à ajuster selon la nav */
  color: #333;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Focus : pour une meilleure accessibilité */
select.select-pill:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

/* Flèche personnalisée positionnée dans le conteneur */
.select-container::after {
  content: '\25BC'; /* Code Unicode de la flèche vers le bas */
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 12px;
  color: #333;
}

/* Zone de résultat custom */
#createResult {
  display: none;
  flex-direction: column;
  align-items: center;
}
#customTitle {
  font-size: 16px;
  margin-bottom: 4px;
  font-family: 'Chakra Petch', sans-serif;
}
#shareBoxCustom,
#shareBoxCustom2 {
  width: 100%;
  padding: 8px;
  background: linear-gradient(to top, #1565c0, #1e88e5);
  color: #ffffff;
  text-align: center;
  margin-bottom: 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Chakra Petch', sans-serif;
}
#customStats {
  margin-bottom: 8px;
  font-size: 14px;
  font-family: 'Chakra Petch', sans-serif;
}
#customActions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
#customActions button {
  flex: 1;
  padding: 8px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(to top, #1565c0, #1e88e5);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.3s;
  font-family: 'Chakra Petch', sans-serif;
}
#customActions button:hover {
  background: linear-gradient(to top, #0d47a1, #1565c0);
}
