/* ==========================================================================
   CSS DÉDIÉ : SUDOKU.PHP - Sudoku Junior
   Fichier : css/sudoku.css
   École de l'Enfant-Jésus - Morlanwelz
   ========================================================================== */

/* Styles du jeu Sudoku intégrés au design général du site */
  .game-container {
    background-color: #ffffff;
    border: 3px solid #62d0ff;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0px 8px 20px rgba(0,0,0,0.06);
  }

  .game-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    background-color: #fffde7;
    border: 2px solid #ffde59;
    border-radius: 15px;
    padding: 12px 18px;
    margin-bottom: 20px;
  }

  .back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #62d0ff;
    color: white !important;
    padding: 6px 14px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 13px;
    text-decoration: none !important;
    transition: all 0.2s ease;
  }

  .back-link:hover {
    background-color: #3cb8f2;
    transform: translateX(-2px);
  }

  .game-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }

  .stat-badge {
    background-color: white;
    border: 2px solid #ffde59;
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 13px;
    color: #333;
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .btn-icon {
    background-color: white;
    border: 2px solid #ddd;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
  }

  .btn-icon:hover {
    background-color: #f0f0f0;
    transform: scale(1.05);
  }

  /* Barre d'outils (Niveaux & Thèmes) */
  .toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    padding: 12px 15px;
    margin-bottom: 25px;
  }

  .btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }

  .lvl-btn, .theme-btn {
    background-color: white;
    border: 2px solid #cbd5e1;
    color: #475569;
    padding: 7px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Fredoka', sans-serif;
    transition: all 0.15s ease;
  }

  .lvl-btn:hover, .theme-btn:hover {
    background-color: #f1f5f9;
  }

  .lvl-btn.active {
    background-color: #62d0ff;
    border-color: #38bdf8;
    color: white;
    box-shadow: 0 3px 8px rgba(98, 208, 255, 0.4);
  }

  .theme-btn.active {
    background-color: #ff9ee5;
    border-color: #f472b6;
    color: white;
    box-shadow: 0 3px 8px rgba(255, 158, 229, 0.4);
  }

  .toggle-label {
    font-size: 13px;
    font-weight: bold;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
  }

  /* Zone principale : Grille + Clavier */
  .board-and-keypad {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    flex-wrap: wrap;
  }

  .board-section {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .grid-info {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: bold;
    color: #475569;
    margin-bottom: 8px;
  }

  /* Grille Sudoku */
  .sudoku-board {
    background-color: white;
    padding: 10px;
    border-radius: 20px;
    border: 4px solid #62d0ff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: inline-block;
  }

  .sudoku-grid {
    display: grid;
    gap: 2px;
  }

  .sudoku-cell {
    width: 50px;
    height: 50px;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: bold;
    color: #0f172a;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
  }

  .sudoku-cell.cell-9x9 {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .sudoku-cell.cell-6x6 {
    width: 45px;
    height: 45px;
    font-size: 20px;
  }

  .sudoku-cell.locked {
    background-color: #f1f5f9;
    color: #334155;
    font-weight: 900;
    cursor: default;
  }

  .sudoku-cell:hover:not(.locked) {
    background-color: #e0f2fe;
    transform: scale(1.04);
  }

  .sudoku-cell.selected {
    border: 3px solid #0284c7 !important;
    background-color: #bae6fd !important;
    transform: scale(1.05);
    z-index: 5;
  }

  .sudoku-cell.highlight-peer {
    background-color: #f0f9ff;
  }

  .sudoku-cell.highlight-same {
    background-color: #e0f2fe;
  }

  .sudoku-cell.error {
    background-color: #fecdd3 !important;
    color: #e11d48 !important;
  }

  .sudoku-cell.hint-given {
    background-color: #dcfce7 !important;
  }

  /* Bordures des sous-grilles */
  .border-box-right { border-right: 3px solid #62d0ff !important; }
  .border-box-bottom { border-bottom: 3px solid #62d0ff !important; }

  /* Boutons sous la grille */
  .action-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 15px;
  }

  .action-btn {
    background-color: #f8fafc;
    border: 2px solid #cbd5e1;
    color: #334155;
    padding: 8px 14px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    font-family: 'Fredoka', sans-serif;
    transition: all 0.2s ease;
  }

  .action-btn:hover {
    background-color: #e2e8f0;
    transform: translateY(-1px);
  }

  .action-btn.primary {
    background-color: #62d0ff;
    border-color: #38bdf8;
    color: white;
  }

  .action-btn.primary:hover {
    background-color: #3cb8f2;
  }

  .action-btn.warning {
    background-color: #ffde59;
    border-color: #ebd03f;
    color: #333;
  }

  .action-btn.warning:hover {
    background-color: #ffcf25;
  }

  .action-btn.success {
    background-color: #4ade80;
    border-color: #22c55e;
    color: white;
  }

  .action-btn.success:hover {
    background-color: #16a34a;
  }

  /* Clavier tactile de saisie */
  .keypad-section {
    background-color: #fffde7;
    border: 3px solid #ffde59;
    border-radius: 20px;
    padding: 15px;
    width: 260px;
    box-sizing: border-box;
    text-align: center;
  }

  .keypad-section h3 {
    font-size: 14px;
    color: #333;
    margin-bottom: 12px;
  }

  .keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .keypad-btn {
    background-color: white;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    padding: 10px 5px;
    font-size: 24px;
    font-weight: bold;
    color: #0284c7;
    cursor: pointer;
    font-family: 'Fredoka', sans-serif;
    transition: all 0.15s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  }

  .keypad-btn:hover {
    background-color: #e0f2fe;
    border-color: #38bdf8;
    transform: scale(1.05);
  }

  /* Modals (Victoire & Règles) */
  .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
  }

  .modal-card {
    background-color: white;
    border-radius: 20px;
    border: 4px solid #ffde59;
    padding: 25px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    position: relative;
  }

  .modal-card h2 {
    color: #0284c7;
    font-size: 24px;
    margin-bottom: 10px;
  }

  .modal-stats {
    background-color: #f8fafc;
    border-radius: 12px;
    padding: 12px;
    margin: 15px 0;
    font-size: 14px;
    font-weight: bold;
    color: #334155;
    text-align: left;
    line-height: 1.8;
  }

  .modal-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background-color: #4ade80;
    color: white;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    font-family: 'Fredoka', sans-serif;
    transition: all 0.2s ease;
  }

  .modal-btn:hover {
    background-color: #22c55e;
  }

  .hidden { display: none !important; }

  /* Style imprimable */
  @media print {
    #haut, #navbar, #bas, .no-print, .game-top-bar, .toolbar, .keypad-section, .action-buttons {
      display: none !important;
    }
    #corps {
      padding-top: 0 !important;
      margin: 0 !important;
    }
    .game-container {
      border: none !important;
      box-shadow: none !important;
    }
  }
