   /* ---------------------------------------------------
       CSS
    --------------------------------------------------- */
    body {
        font-family: sans-serif;
        margin: 20px;
        background: #f0f0f0;
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
      }
  
      .left-panel {
        display: flex;
        flex-direction: column;
        gap: 10px;
      }
  
      /* Palette */
      #tile-palette {
        width: 200px;
        min-height: 400px;
        border: 2px dashed #888;
        padding: 10px;
      }
      #tile-palette.highlight-palette {
        outline: 2px solid green;
      }
  
      /* 8×8 board, each cell 50×50 */
      #puzzle-board {
        width: 400px;
        height: 400px;
        position: relative;
        border: 2px solid #333;
        display: grid;
        grid-template-columns: repeat(8, 50px);
        grid-template-rows: repeat(8, 50px);
      }
  
      /* Each cell of the board */
      .board-cell {
        box-sizing: border-box;
      }
      .board-cell.highlight-drop {
        outline: 2px solid blue;
      }
  
      /* Vertical borders after column 3 and 5 */
      .board-cell:nth-child(8n+11),
      .board-cell:nth-child(8n+13) {
        border-right: 1px solid #ccc;
      }
  
      /* Horizontal borders after row 3 and 5 */
      .board-cell:nth-child(n+18):nth-child(-n+23),
      .board-cell:nth-child(n+34):nth-child(-n+39) {
        border-bottom: 1px solid #ccc;
      }
  
      /* Add black background to outer cells */
      .board-cell:nth-child(-n+8),
      .board-cell:nth-child(n+57):not(:nth-child(60)):not(:nth-child(61)),
      .board-cell:nth-child(8n+1),
      .board-cell:nth-child(8n) {
        background-color: black;
      }
  
      .tile {
          width: 100px;
          height: 100px;
          position: relative;
          overflow: visible;
          border: 1px solid #444;
          cursor: move;
          margin-bottom: 10px;
          background-color: #ccc;
          transition: transform 0.3s ease;
      }
  
      .tile[data-from="board"] {
        position: absolute;
        transition: left 0.3s ease, top 0.3s ease, opacity 2s ease;
    }
  
      .rotate-btn {
        position: absolute;
        top: -15px;
        right: -15px;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: white;
        border: 2px solid #444;
        cursor: pointer;
        display: none;
        z-index: 100;
        font-size: 18px;
        padding: 0;
        line-height: 1;
      }
      .tile:hover .rotate-btn {
        display: block;
      }
      .rotate-btn:hover {
        background: #eee;
      }
  
      /* Colors for each tile */
      .tile[data-id="1"] .tile-square {
        background-color: rgb(255, 87, 51);
      }
      .tile[data-id="2"] .tile-square {
        background-color: rgb(106, 90, 205);
      }
      .tile[data-id="3"] .tile-square {
        background-color: rgb(50, 205, 50);
      }
      .tile[data-id="4"] .tile-square {
        background-color: rgb(255, 215, 0);
      }
      .tile[data-id="5"] .tile-square {
        background-color: rgb(238, 130, 238);
      }
      .tile[data-id="6"] .tile-square {
        background-color: rgb(30, 144, 255);
      }
      .tile[data-id="7"] .tile-square {
        background-color: rgb(255, 165, 0);
      }
      .tile[data-id="8"] .tile-square {
        background-color: rgb(220, 20, 60);
      }
  
      .tile-square {
        position: absolute;
        width: 50px;
        height: 50px;
        box-sizing: border-box;
        z-index: 1; /* Above parent tile */
      }
  
     
  
      .buttons {
        margin-top: 10px;
        margin-bottom: 50px;
      }
  
      .buttons button {
        margin-right: 10px;
      }
  
     /* Replace the existing toast-related CSS */
  .toast-container {
    position: fixed;
    top: 20px;  /* Changed from 50% to 20px */
    left: 50%;
    transform: translateX(-50%);  /* Only transform X axis now */
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
  }
  
  .toast {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(-20px);  /* Start slightly above final position */
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: auto;
    text-align: center;
    min-width: 200px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  }
  
  .toast.show {
    opacity: 1;
    transform: translateY(0);  /* Slide down to final position */
  }
  
  .toast.success {
    background: rgba(40, 167, 69, 0.9);
  }
  
  .toast.error {
    background: rgba(220, 53, 69, 0.9);
  }
  
  .toast.info {
    background: rgba(23, 162, 184, 0.9);
  }

  .puzzle-controls {
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
  }
  
  .difficulty-buttons {
    display: flex;
    gap: 10px;
  }
  
  .difficulty-btn {
    padding: 8px 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f0f0f0;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .difficulty-btn:hover {
    background: #e0e0e0;
  }
  
  .difficulty-btn.active {
    background: #007bff;
    color: white;
    border-color: #0056b3;
  }
  
  #puzzle-selector {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    min-width: 200px;
  }
  
  #puzzle-selector:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
  }