:root {
      --primary-color: #4f46e5;
      --bg-color: #f8fafc;
      --cell-bg: #ffffff;
      --cell-given: #e2e8f0;
      --cell-selected: #e0e7ff;
      --text-color: #1e293b;
      --border-color: #cbd5e1;
      --success-color: #22c55e;
      --primary2: #3b82f6;
      --border: #cbd5e1;
      --radius: 6px;
    }
                   
    .controls {
        display: flex;
        gap: 8px;
        margin-top: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .container {
      width: 100%;
      max-width:30rem!important;
      display: flex;
      flex-direction: column;
      gap: 20px;
      align-items: center;
    }               

    .status {
      font-size: 0.9rem;
      color: #64748b;
      text-transform: capitalize;
    }

    /* Le Coeur du Système: La Grille CSS */
    .grid-container {
      width: 100%;
      aspect-ratio: 1 / 1;
      background: #ffffff;
      padding: 15px;
      border-radius: 12px;
      box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
      display: grid;
      /* Taille 5 = 5 cases + 4 espaces intermédiaires */
      grid-template-columns: repeat(4, 1fr 0.4fr) 1fr;
      grid-template-rows: repeat(4, 1fr 0.4fr) 1fr;
    }

    /* Les cases de jeu */
    .cell {
      background-color: var(--cell-bg);
      border: 2px solid var(--border-color);
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.5rem;
      font-weight: bold;
      cursor: pointer;
      user-select: none;
      transition: all 0.2s ease;
      outline: none;
    }

    .cell:focus-visible, .cell.selected {
      border-color: var(--primary-color);
      background-color: var(--cell-selected);
    }

    .cell.given {
      background-color: var(--cell-given);
      color: #475569;
      cursor: not-allowed;
    }
    
    .cell.success {
      border-color: var(--success-color);
      background-color: #f0fdf4;
      color: var(--success-color);
    }

    /* Les éléments d'inégalité */
    .inequality {
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.2rem;
      font-weight: 800;
      color: #94a3b8;
      user-select: none;
    }

    .inequality.vertical {
      transform: rotate(90deg);
    }

    /* Le Pavé Numérique Horizontal */
    .pad {
      display: flex;
      width: 100%;
      gap: 8px;
    }

    .pad-btn {
      flex: 1;
      height: 50px;
      border: none;
      background-color: #ffffff;
      border-radius: 8px;
      font-size: 1.2rem;
      font-weight: bold;
      color: var(--text-color);
      cursor: pointer;
      box-shadow: 0 1px 3px rgb(0 0 0 / 0.1);
      transition: all 0.1s ease;
    }

    .pad-btn:active {
      transform: scale(0.95);
      background-color: #f1f5f9;
    }

    .pad-btn.clear {
      flex: 1.5;
      background-color: #fee2e2;
      color: #ef4444;
    }
     button {
        background: var(--primary2);
        color: white;
        border: none;
        padding: 10px;
        border-radius: var(--radius);
        font-size: 1rem;
        cursor: pointer;
        transition: background 0.2s ease, transform 0.1s ease;
        letter-spacing: 1px!important;
    }

    button:hover {
        background: #1d4ed8;
    }

    button:active {
        transform: scale(0.96);
    }

    button:disabled {
        background: #94a3b8;
        cursor: not-allowed;
        opacity: 0.6;
    }

    button:disabled:hover {
        background: #94a3b8;
        transform: none;
    }

    #rulesBtn {
        background: #6366f1;
        font-weight: 600;
        padding: 10px 14px;
    }

    #rulesBtn:hover {
        background: #4f46e5;
    }
    
    .pad-btn:hover {
        background: white;
    }
	.btn-icon {
  position: relative;
  /* tes styles de bouton */
}
.mytooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #222;
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.btn-icon:hover .mytooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
    /* Modal */
    .modal {
        display: none;
        position: fixed;
        z-index: 1000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        animation: fadeIn 0.3s ease;
    }

    .modal.show {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .modal-content {
        background: white;
        padding: 30px;
        border-radius: 12px;
        max-width: 500px;
        width: 90%;
        max-height: 80vh;
        overflow-y: auto;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
        animation: slideUp 0.3s ease;
    }

    .modal-content h3 {
        margin-top: 0;
        color: var(--primary);
        font-size: 1.5rem;
    }

    .modal-content ul {
        line-height: 1.8;
        padding-left: 20px;
    }

    .modal-content li {
        margin-bottom: 10px;
    }

    .close-modal {
        background: #64748b;
        margin-top: 20px;
        width: 100%;
    }

    .close-modal:hover {
        background: #475569;
    }

    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    @keyframes slideUp {
        from {
            transform: translateY(30px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    @keyframes bounce {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.1); }
    }
	/* responsive grid */
@media (max-width: 768px) {
    
	.btn {
  padding: 12px 15px;
  font-size: 0.75rem;
	}
	.controls {  
  gap: 10px;
	}
    .container {
     
      max-width:390px!important;
     }
}