    /* Apply box-sizing globally */
*, *::before, *::after {
  box-sizing: border-box;
}
    
    /* 
     * 1) Overall Page Style 
     */
     body {
        margin: 0;
        padding: 20px;
        box-sizing: border-box;
        font-family: sans-serif;
        /* Example gradient background */
        background: linear-gradient(to right, #1f4489, #38a1db);
        color: #fff;
      }
  
      /*
      #title-bar {
       * 2) Main App Container: holds board + side panels
       */
      #app-container {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
        gap: 20px;
        max-width: 1400px;
        margin: 0 auto;
      }

      #title-bar {
        text-align: center;
        padding-top: 10px;
        padding-bottom: 5px;
        font-size: 24px;
        font-weight: bold;
        color: white;
      }
      
  
      /* 
       * 3) Side Panels (tiles, scores, etc.)
       *    We reuse this style for left "tiles" panel and right "scores" panel
       */
      .side-panel {
        background-color: rgba(51, 51, 51, 0.7);
        padding: 10px;
        /*box-shadow: 0 4px 8px rgba(0,0,0,0.3);*/
        border-radius: 4px;
        width:550px; /* Enough width for 60px squares */
        overflow: auto; /* Add scrollbars if tiles overflow */
      }
  
      
  
      .side-panel h2 {
        margin-top: 0;
        margin-bottom: 10px;
      }

      /* Parent container becomes a flexbox */
.tiles-columns {
  display: flex;
  flex-direction: row; /* Horizontal alignment */
  width: 100%;         /* Ensure full width of parent */
}

/* Column 1: Vertical title */
.column-title {
  writing-mode: vertical-rl; /* Rotate text vertically */
  transform: rotate(180deg); /* Adjust direction for readability */
  text-align: center;        /* Center text within the column */
  width: 25%;                /* Take up 1/4 of the width */
  display: flex;             /* Flexbox for centering */
  justify-content: center;   /* Center horizontally */
  align-items: center;       /* Center vertically */
  background-color: rgba(51, 51, 51, 0.2); /* Optional styling */
}

/* Column 2: Tiles container */
.column-tiles {
  width: 100% !important;
  padding: 5px; /* Match padding with #board-container */
  background-color: rgba(51, 51, 51, 0.7); /* Matches desktop style */

  border-radius: 4px; /* Adds rounded corners */
}


/*TRIED THIS TO PREVENT TEXT CURSOR DOES IT WORK???) */

#board-container, .board-cell, .tile-cell {
  pointer-events: auto; /* Ensures interactions are still enabled */
  outline: none; /* Removes focus outline */
}


  
      /* 
       * 4) Board Container (8×8), total 600×600 
       * => Each cell is about 75×75 minus the 2px gap.
       */
      #board-container {
        position: relative;
        display: grid;
        grid-template-columns: repeat(8, 1fr);
        grid-template-rows: repeat(8, 1fr);
        gap: 2px;
       /*background-color: #222;*/
        /*border: 4px solid #555;
        border-radius: 8px;*/
        /*box-shadow: 0 8px 16px rgba(0,0,0,0.5);*/
        width: 650px;
        height: 650px;
        aspect-ratio: 1 / 1;                   /* Enforce square board */
      }
  
      /* 
       * Each cell in the board 
       */
      .board-cell {
        background-color: rgba(51, 51, 51, 0.7);        /* Default empty color */
        border-radius: 4px;
        /*box-shadow: inset 0 0 3px rgba(0,0,0,0.5);*/
        
        cursor: pointer;
        aspect-ratio: 1 / 1;                   /* Enforce square board */
      }
  
      /* 
  
  
      /*
       * 6) Each "tile" block
       */
      .tile {
        margin-bottom: 20px;
        justify-content: center;
        display: block; /* so each tile is on its own line */
      }
  
      /* 
       * 7) The squares making up each tile: 60×60 
       *    We'll also use a "glossy" style. 
       */
      .tile-cell {
        width: 40px;
        height: 40px;
        border-radius: 4px;
        margin: 1px;
        display: inline-block;
        background: #f66; /* fallback; JS overwrites color anyway */
        /*
        background-image: linear-gradient(
          to bottom,
          rgba(255,255,255,0.6) 0%,
          rgba(255,255,255,0.1) 40%,
          rgba(0,0,0,0.2) 100%
        );
        */
        box-shadow: 0 2px 2px rgba(0,0,0,0.4) inset,
                    0 2px 4px rgba(0,0,0,0.4);
        cursor: pointer;
      }
  
      /* Highlight the anchor square */
      .anchor-selected {
        outline: 3px solid white;
        outline-offset: -3px;
      }
      
      .tile-cell[style*="background-color: #FFFFF0"].anchor-selected,
      .tile-cell[style*="background-color: rgb(255, 255, 240)"].anchor-selected {
        outline: 3px solid red;
      }
      
      #tiles-panel h2 {
        text-align: center;
        font-weight: normal;
        padding-top: 20px;
        padding-bottom: 15px;
      }
  
      /* 
       * 8) Score Container 
       */
      #score-container h2 {
        margin-top: 10px;
        margin-bottom: 10px;
        text-align: center;
        font-weight: normal;
      }
      #score-value {
        font-size: 1.6em;
        text-align: center;
        color: #ffdc73;
        margin-bottom: 10px;       
      }

      #high-score-value {
        text-align: center;
        font-size: 1.6em;
        color: #ffdc73;
        padding-bottom: 20px;
        margin-bottom: 25px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);        
      }

      #current-score-label {
        text-align: center;
    }

    #high-score-label {
      text-align: center;
  }
  
    

      /* Add this to your styles.css */
#level-display {
  font-size: 1.4em;
  margin-bottom: 5px;
  padding-top: 20px;

  color: #ffdc73;
  text-align: center;

  /*border-bottom: 1px solid rgba(255, 255, 255, 0.2);*/
}

#level-progress-container {
  width: 100%;
  height: 20px;
  background-color: #ccc;
  border: 1px solid #888;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}

#level-progress-bar {
  height: 100%;
  width: 0%;
  background-color: #ff0063;
  transition: width 0.3s ease;
}


/*makes the button for powerup blast mode red */

.activeblastmode {
  background-color: #ff4444 !important;
  color: white !important;
}

/* General button styles */
#power-ups-container button {
  position: relative; /* Allow positioning of inner text */
  background-size: cover;
  background-position: center;
  width: 70px; /* Square button */
  height: 70px;
  border: 2px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  color: white; /* Default text color */
  font-size: 20px;
  font-weight: bold;
  display: flex;
  justify-content: right;
  align-items: last baseline;
  overflow: hidden; /* Ensure inner elements don't overflow */
}

#power-ups-container div {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Two buttons per row */
  gap: 10px; /* Space between buttons */
  justify-items: center; /* Center the buttons horizontally */
  align-items: center; /* Center the buttons vertically */
  margin-bottom: 20px;
}

#power-ups-container h2 {
  text-align: center;
  font-weight: normal;
  padding-bottom: 10px;

}




/* Blast button */
#blast-btn {
  background-image: url('img/eraser.png');
}

/* Random Blast button */
#random-blast-btn {
  background-image: url('img/random.png');
}

/* Mega Blast button */
#mega-blast-btn {
  background-image: url('img/megablast.png');
}

/* Tile Swap button */
#tile-swap-btn {
  background-image: url('img/swap.png');
  background-color: transparent; /* Ensure transparency */
}

/* Hover effect for all buttons */
#power-ups-container button:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Disabled state */
#power-ups-container button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Active state (optional for blast mode) */
#blast-btn.active {
  border-color: #ff4444;
  box-shadow: 0 0 10px #ff4444;
}

.helper-highlight {
  background-color: rgba(0, 255, 0, 0.0); /* Light green */
  border: 2px solid yellow;
}


/* Container for the helper toggle */
.helper-container {
  display: flex;
  align-items: center; /* Center items vertically */
  justify-content: center; /* Center items horizontally (optional) */
  padding: 20px 0; /* Padding above and below */  
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);

}

/* Label for the helper */
.helper-label {
  margin-right: 10px; /* Space between text and slider */
  font-size: 22px; /* Adjust as needed */
  font-weight:normal;/* Optional for emphasis */
  color: white; /* Text color */
}

/* The switch container */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

/* Hide the checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc; /* Off state */
  transition: 0.4s;
  border-radius: 34px; /* Rounded slider */
}

/* The slider "circle" */
.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%; /* Circle shape */
}

/* When the input is checked, change the slider color */
input:checked + .slider {
  background-color: #ff0063; /* On state */
}

/* Move the circle to the right */
input:checked + .slider:before {
  transform: translateX(26px);
}



  
      /*
       * 9) Blink effect for line clears
       */
      @keyframes blink {
        0%   { opacity: 1; }
        50%  { opacity: 0; }
        100% { opacity: 1; }
      }
      .blink {
        animation: blink 0.6s linear infinite;
      }

      .sparkle-effect {
        animation: sparkle 0.6s ease-in-out;
      }
      
      /* Example keyframes */
      @keyframes sparkle {
        0%   { transform: scale(1);   filter: brightness(100%); }
        50%  { transform: scale(1.1); filter: brightness(200%); }
        100% { transform: scale(1);   filter: brightness(100%); }
      }

      /*animation for boardblast single row select */

      @keyframes boardPulse {
        0% { opacity: 1; }
        50% { opacity: 0.6; }
        100% { opacity: 1; }
      }
      
      .board-pulse {
        animation: boardPulse 1.5s infinite;

      }


      /*megaplast explosion*/

      @keyframes explode {
        0% {
          transform: scale(1);
          opacity: 1;
        }
        50% {
          transform: scale(1.5);
          opacity: 0.7;
        }
        100% {
          transform: scale(0);
          opacity: 0;
        }
      }
      
      .board-cell.explode {
        animation: explode 0.6s ease-out forwards; /* Match the duration in the setTimeout */
      }
      
      
/* Dissolve in  for title update for power ups and alerts*/
@keyframes dissolveIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Dissolve out */
@keyframes dissolveOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Pulse effect */
@keyframes pulseRed {
  0% {
    color: #FF0B41; /* Red Munsell */
    text-shadow: 0 0 5px #FF0B41, 0 0 10px #FF0B41;
  }
  50% {
    color: #FF4F64; /* Brighter red */
    text-shadow: 0 0 15px #FF4F64, 0 0 30px #FF4F64;
  }
  100% {
    color: #FF0B41; /* Red Munsell */
    text-shadow: 0 0 5px #FF0B41, 0 0 10px #FF0B41;
  }
}

/* Classes for the animation */
.title-dissolve-in {
  animation: dissolveIn 1s forwards;
}

.title-dissolve-out {
  animation: dissolveOut 1s forwards;
}

.title-pulse-red {
  animation: pulseRed 1s infinite; /* Pulse continuously */
}



/*for game over window*/
/* Modal Background */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent black */
  display: flex;
  justify-content: center;
  align-items: flex-start; /* Align content to the top */
  padding-top: 100px; /* Add padding at the top */
  z-index: 1000; /* Ensure it appears above other elements */
  opacity: 0;
  pointer-events: none; /* Make it un clickable by default */
  transition: opacity 0.3s ease;
}


/* Show Modal */
.modal.show {
  opacity: 1;
  pointer-events: auto;
}

/* Modal Content */
.modal-content {
  background-color: rgba(51, 51, 51, 0.9);
  padding: 20px;
  border-radius: 4px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
}

/* Game Over Title */
#game-over-title {
  color: #FF0B41; /* Red Munsell */
  font-size: 2rem;
  margin-bottom: 10px;
}

/* Final Score Message */
#final-score-message {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

/* Restart Button */
#restart-button {
  background-color: #38a1db; /* Blue */
  color: white;
  height: 250px;
  width: 250px;
  border: none;
  padding: 10px 20px;
  font-size: 3rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#restart-button:hover {
  background-color: #1f4489; /* Darker Blue */
}


/* for screens 800 height plus */
/* for screens 800 height plus */
/* for screens 800 height plus */
@media screen and (min-height: 800px) {

  body #title-bar {
    font-size: 24px;
    padding-top: 30px;
  }

  #app-container {
    padding-top: 20px;
  }

  body #level-display {
    font-size: 1.2em;
  }
  
      /*levles bar design*/    
  body #level-progress-container {
        height: 15px;

      }
  body #current-score-label, #high-score-label {
    font-size: 1em;
  }

  body #high-score-label {
    font-size: 1em;
  }

  body #power-ups-container{
    padding-top: 10px;
    padding-bottom: 5px;
  }
  
  body #power-ups-container button {
    width: 50px;
    height: 50px;
  }
  

 
}


/* for screens 900 height plus */
/* for screens 900 height plus */
/* for screens 900 height plus */


@media screen and (min-height: 900px) {

  body #app-container {
    min-height: calc(100vh - 175px); /* Adjust for any padding/margin */
 
}

body #title-bar {
  font-size: 24px;
  padding-top: 30px;
}

#app-container {
  padding-top: 20px;
}

body #level-display {
  font-size: 1.2em;
}

    /*levles bar design*/    
body #level-progress-container {
      height: 15px;

    }
body #current-score-label, #high-score-label {
  font-size: 1em;
}

body #high-score-label {
  font-size: 1em;
}

body #power-ups-container{
  padding-top: 10px;
  padding-bottom: 5px;
}

body #power-ups-container button {
  width: 50px;
  height: 50px;
}


}



/* Adjust layout specifically for phones in portrait mode */
@media screen and (max-width: 600px) {
  /* Reset the container first */
  body {
    padding: 10px;
  }

  #app-container {
    display: flex;
    flex-direction: column;
    justify-content:space-between; /* Distributes space between items */
    min-height: calc(100vh - 140px); /* Adjust for any padding/margin */
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  /* Adjust each panel */
  .side-panel,
  #tiles-panel,
  #scores-panel {
    width: 100% !important;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
  }

  /* Make the board responsive */
  #board-container {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1/1;
    max-width: 100vmin; /* Use viewport units */
  }

  /* Adjust the tiles display */
  .tiles-columns {
    flex-direction: column;
  }

  
  
  
    /* Compact helper toggle */
    .helper-container {
      display: none;
      padding: 5px 0;
    }
  
    .helper-label {
      font-size: 16px;
      margin-right: 5px;
    }
  
    /* Make toggle switch smaller */
    .switch {
      width: 40px;
      height: 24px;
    }
  
    .slider:before {
      height: 18px;
      width: 18px;
      left: 3px;
      bottom: 3px;
    }
  
    input:checked + .slider:before {
      transform: translateX(16px);
    }
  
    /* Compact score display */
    #score-container {
      padding: 1px;
    }
  
    /* Remove scores title */
    #score-container h2 {
      display: none;
    }

    #power-ups-container h2 {
      display: none;
    
    
    }
    #level-display {
      font-size: 1em;
      margin: 0; /* Remove extra margins */
      padding: 0; /* Remove padding */
      line-height: 1.2; /* Ensure compact line spacing */
      color: #ffdc73;
      text-align: center;
    }
    
        /*levles bar design*/    
    #level-progress-container {
          width: 100%;
          height: 10px;
          background-color: #ccc;
          border: 1px solid #888;
          border-radius: 4px;
          overflow: hidden;
          margin-bottom: 3px;
        }
  
    /* Make scores inline */
    #score-container {
      display: flex;
      flex-direction: column;
      gap: 5px;
    }
  
    .scores-row {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 20px;
      margin-bottom: 5px;
    }
  
    #current-score-label, #high-score-label {
      display: flex;
      align-items: center;
      gap: 5px;
      font-size: 0.7em;
    }
  
    #score-value, #high-score-value {
      font-size: 1em;
      margin: 0;
      padding: 0;

        border-bottom: none; /* Remove border for high score */
      
    }
  
    /* Make power-up buttons smaller */
    #power-ups-container button {
      width: 40px;
      height: 40px;
      position: relative; /* Allow positioning of inner text */
      color: white; /* Default text color */
      font-size: 15px;
      font-weight:bolder;
      text-shadow: 2px 2px 4px #000000;

    }
  
    #power-ups-container div {
      gap: 5px;
      margin-bottom: 0px;
    }
  
    /* Remove TILES title and background */
    .column-title {
      display: none;
    }
  
    #tiles-panel {
      order: 2;
      background: none;
      padding: 0;
    }
  


    #scores-panel {
      order: 0;

    }

    #br-desktop-only {
      display: none;

    }

  
    /* Make the board responsive */
    #board-container {
      order: 1;
    }
    
  
    /* Horizontal tiles layout */
    #tiles-container {
      display: flex;
      flex-direction: row;
      gap: 5px;
      overflow-x: auto;
      width: 100%;
      height: 120px;
      justify-content: center;
      padding: 10px; /* Same padding as desktop */



    }


  
    .tile {
      flex-shrink: 0;
      margin-bottom: 0;
      margin-right: 5px;
    }

    .tile-cell {
      width: 20px;            /* Smaller for mobile */
      height: 20px;           /* Smaller for mobile */
      border-radius: 2px;     /* Proportionally smaller radius */
      margin: 0.5px;          /* Smaller margin for mobile */
      box-shadow: 0 1px 1px rgba(0,0,0,0.4) inset,
                 0 1px 2px rgba(0,0,0,0.4);
  }

  #title-bar {
    text-align: center;
    padding-top: 5px;
    padding-bottom: 5px;
    font-size: 16px;
    font-weight: bold;
    color: white;
  }




  }


  
