/* (Same CSS as before) */
body, html{

    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overscroll-behavior-y: none;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px;
}
h1 {
  text-align: center;
  margin-bottom: 10px;
}
#scoreboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  position: relative;
}
#scoreboard-spans{
  display: flex;
  gap: 10px;
  justify-content: center;
}
#scoreboard-buttons{
  display: flex;
  gap: 10px;
  justify-content: center; 
  display: none;
}
#scoreboard-spans {
  padding: 5px 10px;
  border: 1px solid #333;
  border-radius: 4px;
  background-color: #f5f5f5; 
}
#scoreboard-buttons button {
  cursor: pointer;
  background-color: #f0f0f0;
  border: 1px solid #666;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 16px;
}
#scoreboard-buttons button:hover{
    background-color: #ddd;
}

.grid-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position:relative;
    width: 100%;
    /*justify-content: center;*/
}

#game-grid, #game-grid-background {
  position: absolute;
  /*top: 50%;*/
  left: 50%;
  transform: translate(-50%, 0%);
  width: auto;
  height: auto;
  display: grid;
  grid-template-rows: repeat(6, 48px);
  grid-template-columns: repeat(7, 48px);
  gap: 2px;
  justify-content: center;
}
#game-grid {
  z-index: 1;
}
.grid-cell {
  width: 48px;
  height: 48px;
  border: 1px solid #bbb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  border-radius: 4px;
}

.red { background: #f94144; }
.green { background: #43aa8b; }
.blue { background: #3b82f6; }
.yellow { background: #f9c74f; }

/*
.bogus {
    background-color: #2a2a2a; 
    color: #fff; 
    border: 3px solid #ff6f61; 
    border-radius: 4px; 
    box-shadow: inset 0 0 5px #000; 
    cursor: not-allowed; 
    pointer-events: none; 
}
*/





.empty {
  background-color: #ccc;
  color: #000;
  pointer-events: none;
  cursor: not-allowed;
}
.chart-note{
    text-align: center;
    font-size: 0.85em;
    margin-top: 4px;
    color: #664;
}
#streak-display{
    display: flex;
    justify-content: space-around;
    margin-bottom: 10px;
}

#outcomeModal{
    display: none;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 10px;
}
.outcomeModal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}
/*
.modal-content {
  margin: 20% auto;
  padding: 20px;
  background: #fff;
  width: 40%;
  text-align: center;
  border-radius: 8px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
*/
.modal-content {
  max-height: 85vh; /* 80% of viewport height */
  overflow-y: auto; /* Enable vertical scroll */
  margin: 10vh auto;
  padding: 20px;
  background: #fff;
  width: 90%;
  max-width: 600px;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}



.outcomeMessage{
 margin-top:10px;
 margin-bottom:10px;
}

button#restartRefreshLevelButton {
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  background-color: #43aa8b;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 10px;
}

button#restartRefreshButton {
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  background-color: #43aa8b;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 10px;
}

button#restartButton {
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  background-color: #43aa8b;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}
button#restartLevel {
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  background-color: #43aa8b;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  display: none;
}






#modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
#color-modal {
  background-color: white;
  padding: 10px;
  border-radius: 6px;
  display: grid;
  grid-template-columns: repeat(4, 48px);
  gap: 5px;
  z-index: 1000;
}
.color-choice {
  width: 48px; 
  height: 48px;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.highlight {
  border-color: black !important;
}

/* Help icon styles */
#help-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

#help-icon button {
    font-size: 20px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
}

/* Modal styles */
.help-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.help-modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 50%;
    max-width: 99%;
    max-height: 90vh;
    overflow: auto;
    border-radius: 10px;
    box-shadow: 0px 0px 10px #000;a
    position: relative;
}

.help-modal-content .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.help-modal-content .close:hover,
.help-modal-content .close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}
.carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
}
.carousel-slide {
    display: none;
    text-align: center;
}
.carousel-slide.active {
    display: block;
}

#carouselHelpDiv{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

button.carouselHelpButton{
    display: block;
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 5px 10px;
    font-size: 16px;
    background-color: #43aa8b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
button.carouselHelpButton:hover {
    background-color: #3b9b7a;
}

body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f4f4f4;
    height: 100vh;
    margin: 0;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 100vh;
    margin-top: 0vh;
}


.scoreboard {
    width: 99%; /* Match the width of the parent container */
    text-align: center;
    max-width: 500px;
    min-height: 60%;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    
}

.scoreboard h1 {
    font-size: 36px;
    margin-bottom: 8px;
}

.highlights {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 20px;
    margin-top: 10px;
}

.highlights div {
    text-align: center;
    padding-left: 5px;
    padding-right: 5px;
}

.highlights p {
    font-size: 14px;
    margin: 0;
}

.highlights h2 {
    font-size: 24px;
    margin: 0;
    font-weight: bold;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.stats div {
    text-align: center;
    padding-left: 5px;
    padding-right: 5px;
}

.stats p {
    font-size: 14px;
    margin: 0;
}

.stats h2 {
    font-size: 20px;
    margin: 0;
    font-weight: bold;
}

.grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-top: 20px;
}

.grid div {
    width: 48px;
    height: 48px;
    background: #eee;
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.grid .yellow {
    background: #f9c74f;
}

.grid .green {
    background: #43aa8b;
}

.grid .red {
    background: #f94144;
}

.grid .blue {
    background: rgb(59,130,246); 
}

@keyframes flashingRedWiggle {
    0%, 100% {
        color: red;
        opacity: 1;
        transform: rotate(0deg);
    }
    25% {
        color: darkred;
        opacity: 0.5;
        transform: rotate(20deg);
    }
    50% {
        color: red;
        opacity: 1;
        transform: rotate(-20deg);
    }
    75% {
        color: darkred;
        opacity: 0.5;
        transform: rotate(10deg);
    }
}

.combined-animation {
    animation: flashingRedWiggle 3.3s infinite;
}




@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(20deg);
    }
    50% {
        transform: rotate(-20deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

@keyframes scale {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.animate-cluster {
    animation: wiggle 1.0s ease-in-out !important;
}

.test-animate {

    background-color: black;
    animation: wiggle 1.0 ease-in-out infinite;

}
.hidden {
    display: none;
}

.visible {
    display: block;
}



body.dark-mode {
  background-color: #121212;
  color: #ffffff;
}

body.dark-mode #scoreboard {
  background-color: #1e1e1e;
  color: #ffffff;
  border: 1px solid #333;
}

body.dark-mode #scoreboard-spans {
  background-color: #333333;
  border: 1px solid #444444;
}

body.dark-mode button {
  background-color: #43aa8b;
  color: #ffffff;
  border: 1px solid #444444;
}

body.dark-mode button:hover {
  background-color: #3b9b7a;
}

/* Dark mode styles for modals */
body.dark-mode .help-modal-content,
body.dark-mode .modal-content {
  background-color: #333; /* Dark background for modals */
  color: #fff; /* Ensure text is readable */
  border: 1px solid #555; /* Optional: Border to add separation */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); /* Darker shadow */
}

body.dark-mode .help-modal-content .close,
body.dark-mode .modal-content button {
  color: #fff;
}

body.dark-mode .modal-content button {
  background-color: #555; /* Darker background for buttons in modals */
  border: 1px solid #666;
}

body.dark-mode .modal-content button:hover {
  background-color: #666; /* Slightly lighter hover effect */
}



/* Dark mode toggle */
.dark-mode-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  justify-content: left;
}

.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196f3;
}

input:checked + .slider:before {
  transform: translateX(14px);
}

body.dark-mode .help-modal-content,
body.dark-mode .modal-content {
  transition: background-color 0.4s ease, color 0.4s ease;
}
/* Dark mode styles for the help icon button */
body.dark-mode #help-icon button {
  background-color: #333; /* Dark background for the button */
  color: #fff; /* Ensure the question mark is visible */
  border: 1px solid #555; /* Optional: Border to match the dark mode */
}

body.dark-mode #help-icon button:hover {
  background-color: #444; /* Slightly lighter hover effect */
}

.grid .bogus {
  width: 48px;
  height: 48px;
  display: inline-block;
  background: url('/static/images/stone.jpg');
  /*
  background:
    /* Top layer: repeating black speckles (dots) */
    radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(0,0,0,1) 50%, rgba(0,0,0,1) 100%);
    /* Bottom layer: deep red gradient */
    /*linear-gradient(45deg, #8b0000, #b22222);*/
  */
  border: 5px solid #222;
  box-shadow:
    inset 0 3px 6px rgba(0, 0, 0, 0.5), 
    inset 0 -3px 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  cursor: not-allowed;
}





body.dark-mode .grid .bogus {
  width: 48px;
  height: 48px;
  display: inline-block;
  background: url('/static/images/stone.jpg');
  /*
  background:
    /* Top layer: repeating black speckles (dots) */
    radial-gradient(circle, rgba(0,0,0,1) 0%, rgba(255,255,255,1) 50%, rgba(255,255,255,1) 100%);
    /* Bottom layer: deep red gradient */
    /*linear-gradient(45deg, #8b0000, #b22222);*/
  /* Dark red/black border for a “molten rock” edge */
  */
  border: 1px solid #300;
  /* Strong inset shadow to simulate a carved/heavy tile */
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  cursor: not-allowed;
}
#modalButtons{
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    
}




/* Collapsible menu */
.collapsible-container {
    margin-bottom: 10px;
}

/* Header for collapsible sections */
.collapsible-header {
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 5px;
}

.collapsible-header span {
    transition: transform 0.3s ease;
}

/* Collapsible content */
.collapsible-content {
    display: none;
    padding-left: 5px;  /* Adds indentation */
    font-size: 16px;
    text-align: left;  /* Align text to the left */
    /* border-left: 3px solid #ccc; */  /* Subtle left border for separation */
    margin-left: 0px;  /* Small margin for spacing */
    padding-top: 5px;
    padding-bottom: 5px;
}


.collapsible-content p {
    margin: 5px 0;
    line-height: 1.5;
}

/* Rotate triangle when expanded */
.collapsible-header.active span {
    transform: rotate(90deg);
}

/* Indent game mode descriptions */
.game-mode-description {
    padding-left: 20px;  /* Adjust the indentation */
    text-indent: -5px;   /* Fine-tunes the first-line alignment */
    font-size: 16px;
}


/* Highlight active game mode */
.active-mode {
    font-size: 14px;
    color: #43aa8b; /* Green for visibility */
    font-weight: bold;
    margin-left: 5px;
}

@keyframes collapseFade {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}

@keyframes collapseTrail {
    0% {
        background-color: rgba(255, 255, 255, 0);
        transform: translateY(0) scale(1);
    }
    50% {
        background-color: rgba(255, 255, 255, 0.3);
        transform: translateY(10px) scale(1.2);
    }
    100% {
        background-color: rgba(255, 255, 255, 0);
        transform: translateY(20px) scale(0);
    }
}

.collapsing {
    animation: collapseFade 0.5s ease-out forwards, collapseTrail 0.3s ease-in-out;
}


@keyframes fall {
    0% {
        transform: translateY(-20px);
        opacity: 0.8;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.falling {
    transition: transform 0.3s ease-out;
}


#scoreboard::after{
    content: "";
    display: block;
    height: 320px;;
}

.help-gif {
  /*display: block; */
  width: 100% !important;  /* Ensures it scales to fit the container */
  max-width: 90% !important;  /* Keeps it within the modal width */
  height: 300px !important;  /* Allows aspect ratio scaling */
  object-fit: contain !important; /* Ensures the entire image fits within the box */
  border-radius: 8px;
}



#refresh-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: fit-content;
    transform: translate(180%,-200%);
}

/*
#refresh-icon button::before {

    content: "\27F3";
    color: black;
    font-size: 30px;
}
*/
#refresh-logo{
    font-size: 25px;
    transform: translate(5%,-10%);
}


#refresh-icon button {
    background-color: #43aa8b;
    border: 1px solid #fff;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Refresh Modal */
#refreshModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

#lives-container {
    position: absolute;
    bottom: 20px; /* Offset slightly above the bottom */
    right: 75px;
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
}

#lives-container p {
    margin-right: 10px;
}
#game-mode-indicator {
    position: absolute;
    bottom: 10px; /* Offset slightly above the bottom */
    left: 72px;
    display: flex;
    align-items: center;
    font-size: 12px;
    font-style: italic;
    font-weight: bold;
    margin-right: 10px;
}


#lives-display {
    display: flex;
    gap: 5px;
}

.life-square {
    width: 20px;
    height: 20px;
    background-color: #43aa8b; /* Match green from grid */
    background-color: #43aa8b;
    border: 1px solid #fff;
    border-radius: 2px;
    display: inline-block;
}


#gameTypesContent a {

    color: #43aa8b;
    text-decoration: underline !important;

}
#gameTypesContent a:visited {

    color: #43aa8b;
}

.custom-dropdown {
    position: relative;
    display: inline-block;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    border-radius: 5px;
    background-color: #43aa8b;
    color: #333;
    user-select: none;
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px;
    border-radius: 5px;
}

.arrow {
    transition: transform 0.3s ease;
}

.rotate {
    transform: rotate(90deg); /* Rotate when active */
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #43aa8b;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    min-width: 100px;
    z-index: 10;
}

.dropdown-content a {
    display: block;
    padding: 6px 10px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-content a:hover {
    background: #ddd;
    color: #007BFF;
}

.show {
    display: block;
}

#loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    margin-top: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#resetConfirmButtons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

#resetConfirmButtons button {
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  background-color: #43aa8b;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

#resetConfirmButtons button:hover {
  background-color: #357e6b;
}



/* Mobile-specific adjustments */
@media screen and (max-width: 768px) {
  .help-gif {
    max-width: 100% !important;  /* Allows full width scaling */
    height: 180px !important; /* Reduce height for smaller screens */
  }
  #refresh-icon {
    transform: translate(-21%,-200%);
  }
  .help-gif {
    max-width: 100% !important;  /* Allows full width scaling */
    height: 180px !important; /* Reduce height for smaller screens */
  }
  #refresh-icon {
    transform: translate(180%,-200%);
  }
  .modal-content {
      width: 95%;
      margin: 60% auto;
  max-height: 80vh; /* 80% of viewport height */
  overflow-y: auto; /* Enable vertical scroll */
  padding: 20px;
  background: #fff;
  max-width: 600px;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  }
  .help-modal-content {
    width: 95%;
    position: relative;
    margin-top: 55%;
  }
  #game-mode-indicator{
    left: 72px;
  }
}

@media screen and (max-width: 480px) {
  .help-gif {
    max-width: 100% !important;  /* Ensures it doesn’t exceed container width */
    height: 144px !important; /* Further reduce height for small screens */
  }
  #refresh-icon {
    transform: translate(-21%,-200%);
  }
  .help-gif {
    max-width: 100% !important;  /* Ensures it doesn’t exceed container width */
    height: 144px !important; /* Further reduce height for small screens */
  }
  #refresh-icon {
    transform: translate(20%,-200%);
  }
  #lives-container {
    right: 53px;
  }
  .modal-content {
      width: 95%;
      margin: 60% auto;
  max-height: 80vh; /* 80% of viewport height */
  overflow-y: auto; /* Enable vertical scroll */
  padding: 20px;
  background: #fff;
  max-width: 600px;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  }
  .help-modal-content {
    width: 95%;
    position: relative;
    margin-top: 55%;
  }
  #game-mode-indicator{
    left: 60px;
  }
    
}
@media screen and (min-width: 390px) and (max-width: 480px) {
  .help-gif {
    max-width: 100% !important;  /* Ensures it doesn’t exceed container width */
    height: 144px !important; /* Further reduce height for small screens */
  }
  #refresh-icon {
    transform: translate(-21%,-200%);
  }
  .help-gif {
    max-width: 100% !important;  /* Ensures it doesn’t exceed container width */
    height: 144px !important; /* Further reduce height for small screens */
  }
  #refresh-icon {
    transform: translate(20%,-200%);
  }
  #lives-container {
    right: 53px;
  }
  .modal-content {
      width: 95%;
      margin: 60% auto;
  max-height: 80vh; /* 80% of viewport height */
  overflow-y: auto; /* Enable vertical scroll */
  padding: 20px;
  background: #fff;
  max-width: 600px;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  }
  .help-modal-content {
    width: 95%;
    position: relative;
    margin-top: 55%;
  }
  #game-mode-indicator{
    left: 30px;
  }
    
}
@media screen and (max-width: 390px) {
  .help-gif {
    max-width: 100% !important;  /* Ensures it doesn’t exceed container width */
    height: 144px !important; /* Further reduce height for small screens */
  }
  #refresh-icon {
    transform: translate(-25%,-200%);
  }
  #lives-container {
    right: 4px;
  }
  .modal-content {
      width: 95%;
      margin: 60% auto;
  max-height: 80vh; /* 80% of viewport height */
  overflow-y: auto; /* Enable vertical scroll */
  padding: 20px;
  background: #fff;
  max-width: 600px;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  }
  .help-modal-content {
    width: 95%;
    position: relative;
    margin-top: 55%;
  }
  #game-mode-indicator{
    left: 16px;
  }
    
}
@media screen and (max-width: 360px) {
  .help-gif {
    max-width: 100% !important;  /* Ensures it doesn’t exceed container width */
    height: 144px !important; /* Further reduce height for small screens */
  }
  #refresh-icon {
    transform: translate(-50%,-200%);
  }
  #lives-container {
    right: 4px;
  }
  .modal-content {
      width: 95%;
      margin: 60% auto;
  max-height: 80vh; /* 80% of viewport height */
  overflow-y: auto; /* Enable vertical scroll */
  padding: 20px;
  background: #fff;
  max-width: 600px;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  }
  .help-modal-content {
    width: 95%;
    position: relative;
    margin-top: 55%;
  }
  #game-mode-indicator{
    left: 4px;
  }
    
}

@media screen and (max-width: 375px) {
  .help-gif {
    max-width: 100% !important;  /* Ensures it doesn’t exceed container width */
    height: 144px !important; /* Further reduce height for small screens */
  }
  #refresh-icon {
    transform: translate(-40%,-200%);
  }
  #lives-container {
    right: 10px;
  }
  .modal-content {
      width: 95%;
      margin: 60% auto;
  max-height: 80vh; /* 80% of viewport height */
  overflow-y: auto; /* Enable vertical scroll */
  padding: 20px;
  background: #fff;
  max-width: 600px;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  }
  .help-modal-content {
    width: 95%;
    position: relative;
    margin-top: 55%;
  }
  #game-mode-indicator{
    left: 10px;
  }
    
}
