#splash-screen {
  padding-top: 60px;  
  display: flex;
    flex-direction: column;
    justify-content:flex-start;
    align-items:center;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Verdana, Geneva, Tahoma, sans-serif;
    background-image: url(./images/hdsplashscreen.jpg);
   background-repeat: no-repeat;
   background-position: center center;
  background-size: 100% 100%;
  min-height: 100vh;
  width: 100vw;
    color: white;
    text-shadow: 
        2px 2px 4px rgba(2, 8, 25, 0.9),
        0 0 8px rgba(0, 0, 0, 0.6);
    line-height: 35px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-y: auto;
}

#game-over {
 padding-top: 60px;
  background-image: url(./images/game-over.jpg);
  background-repeat: no-repeat;
  background-position: center center;
 background-size: 100% 100%;
 min-height: 100vh;
 width: 100vw;
  display: flex;
    flex-direction: column;
    justify-content:flex-start;
    align-items:center;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Verdana, Geneva, Tahoma, sans-serif;
    font-size: clamp(1.2em, 2.5vw, 1.8em);
    color: white;
    text-shadow: 
        3px 3px 0px rgba(255, 255, 255, 0.1),
        5px 5px 15px rgba(32, 32, 43, 0.9),
        0 0 20px rgba(0, 0, 0, 0.7);
    text-align: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-weight: 600;
    overflow-y: auto;
}

#win-game {
  background-image: url(./images/splash-picture.jpg);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 100% 100%;
  min-height: 100vh;
  width: 100vw;
  display: flex;
    flex-direction: column;
    justify-content:center;
    align-items:center;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Verdana, Geneva, Tahoma, sans-serif;
    font-size: clamp(1.5em, 3vw, 2.5em);
    color: white;
    text-shadow: 
        2px 2px 0px rgba(255, 255, 255, 0.1),
        4px 4px 8px rgba(32, 32, 43, 0.9),
        0 0 15px rgba(0, 0, 0, 0.6);
    text-align: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-weight: 600;
}

#pause-screen {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
    flex-direction: column;
    justify-content:flex-start;
    align-items:center;
    padding-top: 15vh;
    padding-bottom: 5vh;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Verdana, Geneva, Tahoma, sans-serif;
    font-size: clamp(1.2em, 2.5vw, 1.8em);
    color: white;
    text-shadow: 
        2px 2px 4px rgba(2, 8, 25, 0.9),
        0 0 8px rgba(0, 0, 0, 0.6);
    text-align: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-weight: 600;
    z-index: 2000;
}

#pause-scoreboard {
  background: rgba(0, 0, 0, 0.8);
  border-radius: 15px;
  padding: 20px;
  margin: 20px 0;
  max-width: 500px;
  font-size: clamp(0.9em, 2vw, 1.2em);
}

#game-over-scoreboard {
  background: rgba(0, 0, 0, 0.8);
  border-radius: 15px;
  padding: 20px;
  margin: 20px 0;
  max-width: 500px;
  font-size: clamp(0.9em, 2vw, 1.2em);
  color: white;
  text-shadow: 
      2px 2px 4px rgba(2, 8, 25, 0.9),
      0 0 8px rgba(0, 0, 0, 0.6);
}

#game-over-scoreboard h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: clamp(1.1em, 2.5vw, 1.4em);
}

#game-over-scoreboard p {
  font-size: clamp(0.8em, 1.8vw, 1.1em);
  line-height: 1.4;
}

.pause-buttons {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

#resume-game, #pause-main-screen {
  background-image: url(./images/cute-button.jpeg);
  border-radius: 65px;
  min-width: 140px;
  min-height: 140px;
  padding: clamp(15px, 2.5vw, 25px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-align: center;
  line-height: 1.2;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  font-size: clamp(25px, 4vw, 45px);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Verdana, Geneva, Tahoma, sans-serif;
  font-weight: 700;
  border: 3px solid #ff69b4;
  cursor: pointer;
  color: #2c1810;
  text-shadow: 
    1px 1px 0px rgba(255, 255, 255, 0.9),
    2px 2px 4px rgba(255, 255, 255, 0.6),
    0px 0px 1px rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 6px 12px rgba(255, 105, 180, 0.4),
    0 3px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  transform: translateY(0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}



.title-text {
    color: #ff69b4;
    font-size: clamp(100px, 15vw, 200px);
    text-align: center;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Verdana, Geneva, Tahoma, sans-serif;
    text-shadow: 
        0 0 20px rgba(255, 105, 180, 0.8),
        3px 3px 0px rgba(255, 20, 147, 0.7),
        6px 6px 10px rgba(32, 32, 43, 0.9),
        0 0 40px rgba(255, 255, 255, 0.3);
    margin: 40px 0 30px 0;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: 2px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
    -webkit-text-stroke: 0px transparent;
    animation: sparkleGlow 3s ease-in-out infinite;
}
  h2 {
    padding-top: 20px;
    margin-top: 0;
    text-align: center;
  }
  
  h3 {
    text-align: center;
  }
.buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding-top: 30px;
    gap: 30px;
    flex-wrap: wrap;
    z-index: 50;
    position: relative;
}

#start-button {
  background-image: url(./images/cute-button.jpeg);
  border-radius: 50%;
  padding: clamp(20px, 3vw, 30px);
  background-size: cover;
  font-size: clamp(25px, 4vw, 45px);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Verdana, Geneva, Tahoma, sans-serif;
  font-weight: 700;
  border: 3px solid #ff69b4;
  margin-right: 20px;
  min-width: 150px;
  min-height: 150px;
  cursor: pointer;
  z-index: 100;
  position: relative;
  display: block;
  pointer-events: auto;
  color: #2c1810;
  text-shadow: 
    1px 1px 0px rgba(255, 255, 255, 0.9),
    2px 2px 4px rgba(255, 255, 255, 0.6),
    0px 0px 1px rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 6px 12px rgba(255, 105, 180, 0.4),
    0 3px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  transform: translateY(0);
  /* HD text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#start-button:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 8px 16px rgba(255, 105, 180, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3);
  border-color: #ff1493;
}

#start-button:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 
    0 3px 6px rgba(255, 105, 180, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.2);
  outline: none;
}

#sound {
  background-image: url(./images/cute-button.jpeg);
  border-radius: 50%;
  padding: clamp(20px, 3vw, 30px);
  background-size: cover;
  font-size: clamp(25px, 4vw, 45px);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Verdana, Geneva, Tahoma, sans-serif;
  font-weight: 700;
  border: 3px solid #ff69b4;
  margin-right: 20px;
  min-width: 150px;
  min-height: 150px;
  cursor: pointer;
  z-index: 100;
  position: relative;
  display: block;
  pointer-events: auto;
  color: #2c1810;
  text-shadow: 
    1px 1px 0px rgba(255, 255, 255, 0.9),
    2px 2px 4px rgba(255, 255, 255, 0.6),
    0px 0px 1px rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 6px 12px rgba(255, 105, 180, 0.4),
    0 3px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  transform: translateY(0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#sound:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 8px 16px rgba(255, 105, 180, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3);
  border-color: #ff1493;
}

#sound:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 
    0 3px 6px rgba(255, 105, 180, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.2);
  outline: none;
}

#mute {
  background-image: url(./images/cute-button.jpeg);
  border-radius: 50%;
  padding: clamp(25px, 4vw, 35px);
  background-size: cover;
  font-size: clamp(30px, 5vw, 55px);
  border: 3px solid #ff69b4;
  min-width: 180px;
  min-height: 180px;
  cursor: pointer;
  color: #2c1810;
  text-shadow: 
    0px 0px 1px rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 3px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  transform: translateY(0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#mute:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 8px 16px rgba(255, 105, 180, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3);
  border-color: #ff1493;
}

#mute:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 
    0 3px 6px rgba(255, 105, 180, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.2);
  outline: none;
}

#restart {
  background-image: url(./images/cute-button.jpeg);
  border-radius: 50%;
  padding: clamp(20px, 3vw, 30px);
  background-size: cover;
  font-size: clamp(25px, 4vw, 45px);
  border: 3px solid #ff69b4;
  margin-right: 20px;
  min-width: 150px;
  min-height: 150px;
  cursor: pointer;
  color: #2c1810;
  text-shadow: 
    1px 1px 0px rgba(255, 255, 255, 0.9),
    2px 2px 4px rgba(255, 255, 255, 0.6),
    0px 0px 1px rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 6px 12px rgba(255, 105, 180, 0.4),
    0 3px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  transform: translateY(0);
}

#restart:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 8px 16px rgba(255, 105, 180, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3);
  border-color: #ff1493;
}

#restart:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 
    0 3px 6px rgba(255, 105, 180, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.2);
  outline: none;
}

#win-start {
  background-image: url(./images/cute-button.jpeg);
  border-radius: 50%;
  padding: clamp(20px, 3vw, 30px);
  background-size: cover;
  font-size: clamp(25px, 4vw, 45px);
  border: 3px solid #ff69b4;
  margin-right: 20px;
  min-width: 150px;
  min-height: 150px;
  cursor: pointer;
  color: #2c1810;
  text-shadow: 
    1px 1px 0px rgba(255, 255, 255, 0.9),
    2px 2px 4px rgba(255, 255, 255, 0.6),
    0px 0px 1px rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 6px 12px rgba(255, 105, 180, 0.4),
    0 3px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  transform: translateY(0);
}

#win-start:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 8px 16px rgba(255, 105, 180, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3);
  border-color: #ff1493;
}

#win-start:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 
    0 3px 6px rgba(255, 105, 180, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.2);
  outline: none;
}

#main-screen {
  background-image: url(./images/cute-button.jpeg);
  border-radius: 50%;
  padding: clamp(20px, 3vw, 30px);
  background-size: cover;
  font-size: clamp(25px, 4vw, 45px);
  border: 3px solid #ff69b4;
  margin-right: 20px;
  min-width: 150px;
  min-height: 150px;
  cursor: pointer;
  z-index: 100;
  position: relative;
  display: block;
  pointer-events: auto;
  color: #2c1810;
  text-shadow: 
    1px 1px 0px rgba(255, 255, 255, 0.9),
    2px 2px 4px rgba(255, 255, 255, 0.6),
    0px 0px 1px rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 6px 12px rgba(255, 105, 180, 0.4),
    0 3px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  transform: translateY(0);
}

#main-screen:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 8px 16px rgba(255, 105, 180, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3);
  border-color: #ff1493;
}

#main-screen:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 
    0 3px 6px rgba(255, 105, 180, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.2);
  outline: none;
}

#clear-scores {
  background-image: url(./images/cute-button.jpeg);
  border-radius: 50%;
  padding: clamp(20px, 3vw, 30px);
  background-size: cover;
  font-size: clamp(25px, 4vw, 45px);
  border: 3px solid #ff69b4;
  margin-right: 20px;
  min-width: 150px;
  min-height: 150px;
  cursor: pointer;
  z-index: 100;
  position: relative;
  display: block;
  pointer-events: auto;
  color: #2c1810;
  text-shadow: 
    1px 1px 0px rgba(255, 255, 255, 0.9),
    2px 2px 4px rgba(255, 255, 255, 0.6),
    0px 0px 1px rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 6px 12px rgba(255, 105, 180, 0.4),
    0 3px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  transform: translateY(0);
}

#clear-scores:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 8px 16px rgba(255, 105, 180, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3);
  border-color: #ff1493;
}

#clear-scores:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 
    0 3px 6px rgba(255, 105, 180, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.2);
  outline: none;
}

.win-buttons, .game-over-buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding-top: 30px;
    gap: 30px;
    flex-wrap: wrap;
    z-index: 50;
    position: relative;
}

#pause {
  background-image: url(./images/cute-button.jpeg);
  border-radius: 50%;
  padding: clamp(25px, 4vw, 35px);
  background-size: cover;
  font-size: clamp(30px, 5vw, 55px);
  border: 3px solid #ff69b4;
  margin-right: 20px;
  min-width: 180px;
  min-height: 180px;
  cursor: pointer;
  color: #2c1810;
  text-shadow: 
    0px 0px 1px rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 3px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  transform: translateY(0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#pause:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 8px 16px rgba(255, 105, 180, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3);
  border-color: #ff1493;
}

#pause:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 
    0 3px 6px rgba(255, 105, 180, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.2);
  outline: none;
}

#game-over-main {
  background-image: url(./images/cute-button.jpeg);
  border-radius: 50%;
  padding: clamp(20px, 3vw, 30px);
  background-size: cover;
  font-size: clamp(25px, 4vw, 45px);
  border: 3px solid #ff69b4;
  margin-right: 20px;
  min-width: 150px;
  min-height: 150px;
  cursor: pointer;
  z-index: 100;
  position: relative;
  display: block;
  pointer-events: auto;
  color: #2c1810;
  text-shadow: 
    1px 1px 0px rgba(255, 255, 255, 0.9),
    2px 2px 4px rgba(255, 255, 255, 0.6),
    0px 0px 1px rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 6px 12px rgba(255, 105, 180, 0.4),
    0 3px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  transform: translateY(0);
}

#game-over-main:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 8px 16px rgba(255, 105, 180, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3);
  border-color: #ff1493;
}

#game-over-main:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 
    0 3px 6px rgba(255, 105, 180, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.2);
  outline: none;
}


#side-buttons {
  position: relative;
  margin-top: 20px;
  display: none; /* Hidden by default */
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 30px;
  z-index: 1000;
}

#game {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    position: relative;
}



body {
    background-color: pink;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Prevent scrolling during gameplay */
    height: 100vh;
    width: 100vw;
    touch-action: manipulation; /* Prevent zoom on mobile */
    user-select: none; /* Prevent text selection */
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    /* HD text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-smooth: always;
    -webkit-text-stroke: 0.01em transparent;
    /* Prevent overscroll behavior on mobile */
    overscroll-behavior: none;
    -webkit-overscroll-behavior: none;
}

/* Allow clicks on buttons */
button {
    touch-action: manipulation;
    pointer-events: auto;
    cursor: pointer;
    border: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    /* HD text rendering for all buttons */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Verdana, Geneva, Tahoma, sans-serif;
    font-weight: 700;
}

/* FORCE ALL GAME BUTTONS TO BE OVAL SHAPED - HIGHEST PRIORITY */
#start-button, #sound, #mute, #restart, #win-start, #main-screen, #clear-scores, #pause, #game-over-main {
    border-radius: 65px !important;
    min-width: 140px !important;
    min-height: 140px !important;
    padding: clamp(15px, 2.5vw, 25px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    text-align: center !important;
    line-height: 1.2 !important;
    background-image: url(./images/cute-button.jpeg) !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}

/* Ensure splash screen buttons are clickable */
#splash-screen button {
    touch-action: manipulation;
    pointer-events: auto;
    cursor: pointer;
    z-index: 100;
    position: relative;
    border: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* Ensure all game buttons are clickable */
#start-button, #sound, #mute, #restart, #win-start, #main-screen, #clear-scores, #pause, #game-over-main {
    touch-action: manipulation !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 100 !important;
    position: relative !important;
    border: none !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    display: block !important;
}

/* Blinking animation for click to start text */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Sparkly glowing animation for title text */
@keyframes sparkleGlow {
    0% {
        text-shadow: 
            0 0 20px rgba(255, 105, 180, 0.8),
            3px 3px 0px rgba(255, 20, 147, 0.7),
            6px 6px 10px rgba(32, 32, 43, 0.9),
            0 0 40px rgba(255, 255, 255, 0.3);
        filter: brightness(1);
    }
    25% {
        text-shadow: 
            0 0 28px rgba(255, 105, 180, 0.95),
            3px 3px 0px rgba(255, 20, 147, 0.85),
            6px 6px 10px rgba(32, 32, 43, 0.9),
            0 0 55px rgba(255, 255, 255, 0.4),
            0 0 65px rgba(255, 182, 193, 0.3);
        filter: brightness(1.07);
    }
    50% {
        text-shadow: 
            0 0 35px rgba(255, 105, 180, 1.1),
            3px 3px 0px rgba(255, 20, 147, 0.9),
            6px 6px 10px rgba(32, 32, 43, 0.9),
            0 0 70px rgba(255, 255, 255, 0.5),
            0 0 80px rgba(255, 182, 193, 0.4),
            0 0 90px rgba(255, 20, 147, 0.25);
        filter: brightness(1.15);
    }
    75% {
        text-shadow: 
            0 0 28px rgba(255, 105, 180, 0.95),
            3px 3px 0px rgba(255, 20, 147, 0.85),
            6px 6px 10px rgba(32, 32, 43, 0.9),
            0 0 55px rgba(255, 255, 255, 0.4),
            0 0 65px rgba(255, 182, 193, 0.3);
        filter: brightness(1.07);
    }
    100% {
        text-shadow: 
            0 0 20px rgba(255, 105, 180, 0.8),
            3px 3px 0px rgba(255, 20, 147, 0.7),
            6px 6px 10px rgba(32, 32, 43, 0.9),
            0 0 40px rgba(255, 255, 255, 0.3);
        filter: brightness(1);
    }
}

/* Responsive canvas */
#canvas {
    max-width: 90vw;
    max-height: 80vh;
    width: 90vw;
    height: 80vh;
    object-fit: contain;
    border: 2px solid pink !important;
    /* HD canvas rendering for high FPS */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: optimizeSpeed;
    -ms-interpolation-mode: nearest-neighbor;
    /* Hardware acceleration for better performance */
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

/* Mobile game container and canvas */
@media (max-width: 768px) {
    #game {
        padding: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }
    
    #canvas {
        max-height: 60vh !important;
        max-width: 95vw !important;
        width: 95vw !important;
        height: 60vh !important;
        object-fit: contain;
        margin-top: 2vh;
        /* Mobile performance optimizations */
        transform: translateZ(0);
        will-change: transform;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    #side-buttons {
        position: relative;
        margin-top: 1vh;
        gap: 20px;
        z-index: 1000;
        justify-content: center;
    }
    
    #mute, #pause {
        min-width: 90px !important;
        min-height: 90px !important;
        font-size: clamp(14px, 4vw, 20px) !important;
        padding: clamp(12px, 3vw, 18px) !important;
        border-radius: 40px !important;
        background-color: rgba(255, 255, 255, 0.95) !important;
        border: 3px solid #ff69b4 !important;
        box-shadow: 0 6px 12px rgba(0,0,0,0.3) !important;
        color: #2c1810 !important;
        font-weight: bold !important;
    }
}

/* Landscape mode specific adjustments */
@media (orientation: landscape) {
    #game {
        padding: 0;
        height: 100vh;
    }
    
    #canvas {
        max-height: 85vh;
        max-width: 100vw;
        width: 100vw;
        height: 85vh;
        object-fit: contain;
        margin-top: 8vh;
    }
}

@media (max-width: 768px) {
    .title-text {
        font-size: clamp(60px, 12vw, 120px);
        margin: 20px 0 20px 0;
    }
    
    .buttons {
        flex-direction: row;
        padding-top: 20px;
        gap: 20px;
        justify-content: center;
    }
    
    #start-button, #sound, #mute, #restart, #win-start, #main-screen, #clear-scores, #pause, #game-over-main {
        min-width: 110px !important;
        min-height: 110px !important;
        font-size: clamp(14px, 4vw, 20px);
        margin-right: 0;
        padding: clamp(12px, 2vw, 16px) !important;
        /* Keep oval shape on mobile */
        border-radius: 55px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        text-align: center !important;
        line-height: 1.2 !important;
        background-image: url(./images/cute-button.jpeg) !important;
        background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
        box-shadow: 
            0 4px 8px rgba(0,0,0,0.2),
            0 2px 4px rgba(0,0,0,0.1),
            inset 0 1px 2px rgba(255,255,255,0.2),
            inset 0 -1px 2px rgba(0,0,0,0.1);
    }
    
    .win-buttons, .game-over-buttons {
        flex-direction: row;
        padding-top: 20px;
        gap: 20px;
        justify-content: center;
    }
    
    #side-buttons {
        flex-direction: row;
        gap: 12px;
        padding: 5px;
        margin-top: 10px;
        justify-content: center;
    }
    
    #splash-screen, #game-over, #win-game {
        padding-top: 20px;
    }
    
    #splash-screen h2 {
        font-size: clamp(18px, 4vw, 24px);
        padding-top: 10px;
        margin: 10px 0;
    }
    
    #splash-screen h3 {
        font-size: clamp(12px, 3vw, 16px);
        padding: 5px;
        line-height: 1.2;
        margin: 5px 0;
    }
    
    #canvas {
        max-height: 98vh !important;
        max-width: 98vw;
        height: 98vh !important;
    }
    
    #game {
        padding: 5px;
    }
}

@media (max-width: 480px) {
    .title-text {
        font-size: clamp(50px, 10vw, 90px);
        margin: 15px 0 15px 0;
    }
    
    .buttons {
        flex-direction: row;
        gap: 15px;
        justify-content: center;
    }
    
    #start-button, #sound, #mute, #restart, #win-start, #main-screen, #clear-scores, #pause, #game-over-main {
        min-width: 120px !important;
        min-height: 120px !important;
        font-size: clamp(14px, 3.5vw, 18px);
        padding: clamp(12px, 2vw, 16px) !important;
        /* Keep oval shape on mobile */
        border-radius: 45px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        text-align: center !important;
        line-height: 1.2 !important;
        background-image: url(./images/cute-button.jpeg) !important;
        background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
        box-shadow: 
            0 3px 6px rgba(0,0,0,0.2),
            0 2px 3px rgba(0,0,0,0.1),
            inset 0 1px 2px rgba(255,255,255,0.2),
            inset 0 -1px 2px rgba(0,0,0,0.1);
    }
    
    .win-buttons, .game-over-buttons {
        flex-direction: row;
        gap: 15px;
        justify-content: center;
    }
    
    #canvas {
        max-height: 95vh;
        max-width: 96vw;
    }
    
    #side-buttons {
        bottom: 15px;
        gap: 8px;
    }
    
    #splash-screen h2 {
        font-size: clamp(16px, 4vw, 20px);
        padding-top: 5px;
        margin: 5px 0;
    }
    
    #splash-screen h3 {
        font-size: clamp(10px, 2.5vw, 14px);
        padding: 3px;
        line-height: 1.1;
        margin: 3px 0;
    }
    
    #game-over, #win-game {
        font-size: clamp(14px, 3vw, 18px);
        padding-top: 10px;
    }
    
    #game-over h1, #win-game h2 {
        font-size: clamp(16px, 4vw, 22px);
        margin: 10px 0;
    }
}

/* iPhone 16 Pro Max and similar large phones */
@media (max-width: 430px) and (max-height: 932px) {
    .title-text {
        font-size: clamp(40px, 8vw, 70px);
        margin: 10px 0 10px 0;
    }
    
    #splash-screen {
        padding-top: 10px;
    }
    
    #splash-screen h2 {
        font-size: clamp(14px, 3.5vw, 18px);
        padding-top: 3px;
        margin: 3px 0;
    }
    
    #splash-screen h3 {
        font-size: clamp(9px, 2vw, 12px);
        padding: 2px;
        line-height: 1.0;
        margin: 2px 0;
    }
    
    .buttons {
        padding-top: 15px;
        gap: 12px;
        flex-direction: row;
    }
    
    #start-button, #sound, #mute, #restart, #win-start, #main-screen, #clear-scores, #pause, #game-over-main {
        min-width: 110px !important;
        min-height: 110px !important;
        font-size: clamp(12px, 3vw, 16px);
        padding: clamp(10px, 1.5vw, 14px) !important;
        /* Keep oval shape on mobile */
        border-radius: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        text-align: center !important;
        line-height: 1.2 !important;
        background-image: url(./images/cute-button.jpeg) !important;
        background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
        box-shadow: 
            0 2px 4px rgba(0,0,0,0.2),
            0 1px 2px rgba(0,0,0,0.1),
            inset 0 1px 2px rgba(255,255,255,0.2),
            inset 0 -1px 2px rgba(0,0,0,0.1);
    }
    
    .win-buttons, .game-over-buttons {
        padding-top: 15px;
        gap: 12px;
        flex-direction: row;
    }
    
    #canvas {
        max-height: 92vh;
        max-width: 94vw;
    }
    
    #side-buttons {
        gap: 8px;
        margin-top: 8px;
        justify-content: center;
    }
    
    #game-over, #win-game {
        padding-top: 5px;
    }
    
    #game-over h1, #win-game h2 {
        font-size: clamp(14px, 3vw, 18px);
        margin: 5px 0;
    }
    
    #score {
        font-size: clamp(12px, 2.5vw, 16px);
    }
}

/* Landscape orientation support */
@media (orientation: landscape) and (max-height: 500px) {
    .title-text {
        font-size: clamp(20px, 4vw, 40px);
        margin: 1px 0 1px 0;
    }
    
    #splash-screen {
        padding-top: 1px;
        padding-bottom: 1px;
        overflow: hidden;
        justify-content: space-between;
        height: 100vh;
    }
    
    #splash-screen h2 {
        font-size: clamp(8px, 2vw, 12px);
        padding-top: 0px;
        margin: 1px 0;
    }
    
    #splash-screen h3 {
        font-size: clamp(6px, 1.4vw, 9px);
        padding: 0px;
        line-height: 0.8;
        margin: 0px 0;
        max-width: 98vw;
        text-align: center;
    }
    
    .buttons {
        padding-top: 1px;
        gap: 8px;
        flex-direction: row;
        margin-bottom: 2px;
    }
    
    #start-button, #sound, #mute, #restart, #win-start, #main-screen, #clear-scores, #pause, #game-over-main {
        min-width: 55px !important;
        min-height: 55px !important;
        font-size: clamp(8px, 2vw, 12px) !important;
        padding: clamp(6px, 0.8vw, 10px) !important;
        /* Keep oval shape on mobile */
        border-radius: 25px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        text-align: center !important;
        line-height: 1.2 !important;
        background-image: url(./images/cute-button.jpeg) !important;
        background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
        box-shadow: 
            0 2px 4px rgba(0,0,0,0.15),
            0 1px 2px rgba(0,0,0,0.1),
            inset 0 1px 2px rgba(255,255,255,0.15),
            inset 0 -1px 2px rgba(0,0,0,0.1);
    }
    
    .win-buttons, .game-over-buttons {
        padding-top: 10px;
        gap: 15px;
        flex-direction: row;
    }
    
    #canvas {
        max-height: 75vh;
        max-width: 90vw;
    }
    
    #side-buttons {
        gap: 10px;
        margin-top: 8px;
        justify-content: center;
    }
    
    #game-over, #win-game {
        padding-top: 20px;
    }
    
    #game-over h1, #win-game h2 {
        font-size: clamp(12px, 3vw, 16px);
        margin: 5px 0;
    }
    
    #score {
        font-size: clamp(10px, 2vw, 14px);
    }
}

/* Specific landscape support for mobile phones */
@media (orientation: landscape) and (max-width: 932px) and (max-height: 430px) {
    .title-text {
        font-size: clamp(18px, 4vw, 35px);
        margin: 0px 0 0px 0;
    }
    
    #splash-screen {
        padding-top: 1px;
        padding-bottom: 1px;
        overflow: hidden;
        justify-content: space-between;
        height: 100vh;
    }
    
    #pause-screen {
        padding-top: 1vh !important;
        padding-bottom: 1vh !important;
        font-size: clamp(0.8em, 2vw, 1.2em) !important;
    }
    
    #pause-screen h2 {
        font-size: clamp(1em, 3vw, 1.5em) !important;
        margin: 5px 0 !important;
    }
    
    #pause-scoreboard {
        max-height: 20vh !important;
        padding: 10px !important;
        margin: 5px 0 !important;
        font-size: clamp(0.7em, 1.5vw, 1em) !important;
    }
    
    .pause-buttons {
        margin-top: 5px !important;
        margin-bottom: 5px !important;
        gap: 10px !important;
    }
    
    #resume-game, #pause-main-screen {
        min-width: 70px !important;
        min-height: 70px !important;
        font-size: clamp(8px, 2vw, 12px) !important;
        padding: clamp(6px, 0.8vw, 10px) !important;
    }
    
    #splash-screen h2 {
        font-size: clamp(7px, 1.5vw, 10px);
        padding-top: 0px;
        margin: 0px 0;
    }
    
    #splash-screen h3 {
        font-size: clamp(5px, 1vw, 8px);
        padding: 0px;
        line-height: 0.7;
        margin: 0px 0;
        max-width: 98vw;
        text-align: center;
    }
    
    .buttons {
        padding-top: 1px;
        gap: 5px;
        margin-bottom: 1px;
    }
    
    #start-button, #sound, #mute, #restart, #win-start, #main-screen, #clear-scores, #pause, #game-over-main {
        min-width: 80px !important;
        min-height: 80px !important;
        font-size: clamp(9px, 2vw, 12px);
        padding: clamp(6px, 0.8vw, 10px) !important;
        /* Keep oval shape on mobile */
        border-radius: 30px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        text-align: center !important;
        line-height: 1.2 !important;
        background-image: url(./images/cute-button.jpeg) !important;
        background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
        box-shadow: 
            0 1px 3px rgba(0,0,0,0.15),
            0 1px 2px rgba(0,0,0,0.1),
            inset 0 1px 1px rgba(255,255,255,0.15),
            inset 0 -1px 1px rgba(0,0,0,0.1);
    }
    
    .win-buttons, .game-over-buttons {
        padding-top: 5px;
        gap: 10px;
    }
    
    #canvas {
        max-height: 45vh !important;
        max-width: 100vw !important;
        width: 100vw !important;
        height: 45vh !important;
    }
    
    #side-buttons {
        margin-top: 2vh !important;
        gap: 20px !important;
    }
    
    #mute, #pause {
        min-width: 75px !important;
        min-height: 75px !important;
        font-size: clamp(10px, 2.5vw, 16px) !important;
        padding: clamp(8px, 1.8vw, 12px) !important;
        border-radius: 35px !important;
        background-color: rgba(255, 255, 255, 0.95) !important;
        border: 3px solid #ff69b4 !important;
        box-shadow: 0 4px 8px rgba(0,0,0,0.4) !important;
        color: #2c1810 !important;
        font-weight: bold !important;
    }
    
    #side-buttons {
        bottom: 15px;
        gap: 6px;
    }
    
    #game-over, #win-game {
        padding-top: 5px;
    }
    
    #game-over h1, #win-game h2 {
        font-size: clamp(14px, 3vw, 18px);
        margin: 5px 0;
    }
    
    #score {
        font-size: clamp(12px, 2.5vw, 16px);
    }
}

/* Enhanced touch controls for landscape */
@media (orientation: landscape) and (max-width: 932px) {
    body {
        touch-action: manipulation; /* Keep consistent with portrait */
    }
    
    #splash-screen {
        padding-top: 3px !important;
        padding-bottom: 8px !important;
        overflow-y: auto !important;
        justify-content: flex-start !important;
    }
    
    #splash-screen h2 {
        font-size: clamp(9px, 2.2vw, 13px) !important;
        margin: 2px 0 !important;
    }
    
    #splash-screen h3 {
        font-size: clamp(7px, 1.5vw, 10px) !important;
        line-height: 0.85 !important;
        margin: 1px 0 !important;
        max-width: 96vw !important;
    }
    
    .buttons {
        padding-top: 3px !important;
        gap: 6px !important;
        margin-bottom: 8px !important;
    }
    
    #canvas {
        touch-action: none; /* Disable default touch actions on canvas */
        max-height: 50vh !important;
        max-width: 100vw !important;
        width: 100vw !important;
        height: 50vh !important;
        margin-top: 0.5vh !important;
    }
    
    #side-buttons {
        margin-top: 3vh !important;
        gap: 25px !important;
    }
    
    #mute, #pause {
        min-width: 90px !important;
        min-height: 90px !important;
        font-size: clamp(12px, 3vw, 18px) !important;
        padding: clamp(10px, 2vw, 16px) !important;
        border-radius: 40px !important;
        background-color: rgba(255, 255, 255, 0.95) !important;
        border: 3px solid #ff69b4 !important;
        box-shadow: 0 5px 10px rgba(0,0,0,0.4) !important;
        color: #2c1810 !important;
        font-weight: bold !important;
    }
    
    #pause-screen {
        padding-top: 2vh !important;
        padding-bottom: 2vh !important;
        overflow-y: auto !important;
    }
    
    #pause-scoreboard {
        max-height: 30vh !important;
        overflow-y: auto !important;
        margin: 10px 0 !important;
    }
    
    .pause-buttons {
        margin-top: 10px !important;
        margin-bottom: 10px !important;
        gap: 15px !important;
    }
    
    #resume-game, #pause-main-screen {
        min-width: 80px !important;
        min-height: 80px !important;
        font-size: clamp(10px, 2.5vw, 14px) !important;
        padding: clamp(8px, 1vw, 12px) !important;
    }
    
    /* Hide address bar on mobile browsers in landscape */
    html {
        height: 100%;
        overflow: hidden;
    }
    
    /* Ensure full screen usage in landscape */
    #game {
        height: 100vh;
        width: 100vw;
        overflow: hidden;
        position: fixed;
        top: 0;
        left: 0;
        touch-action: none;
    }
    
    /* Adjust side buttons for landscape - only when game is active and on mobile */
    #side-buttons {
        position: relative;
        margin-top: 3px;
        flex-direction: row;
        gap: 8px;
        justify-content: center;
    }
}

/* Desktop/larger screens - below canvas */
@media (min-width: 933px) {
    #side-buttons {
        position: relative;
        display: none; /* Hidden by default */
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 20px;
        margin-top: 20px;
        z-index: 1000;
    }
}

/* Better canvas scaling for landscape */
@media (orientation: landscape) and (max-height: 500px) {
    #canvas {
        max-height: 55vh;
        max-width: 100vw;
        margin-top: 0.5vh;
    }
}

/* High performance optimizations for all screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #splash-screen, #game-over, #win-game {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
        image-rendering: optimizeSpeed;
    }
}

/* Mobile landscape fullscreen canvas */
@media (orientation: landscape) and (max-width: 932px) {
    #canvas {
        width: 100vw !important;
        height: 50vh !important;
        max-width: 100vw !important;
        max-height: 50vh !important;
        object-fit: contain;
        margin-top: 0.5vh;
    }
    
    #game {
        height: 100vh;
        padding: 0;
        margin: 0;
        overflow: hidden;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
    }
    
    #side-buttons {
        position: relative;
        flex-direction: row;
        gap: 25px;
        margin-top: 3vh;
        justify-content: center;
        z-index: 1000;
    }
    
    #mute, #pause {
        min-width: 100px !important;
        min-height: 100px !important;
        font-size: clamp(14px, 3.5vw, 20px) !important;
        padding: clamp(12px, 2.5vw, 18px) !important;
        border-radius: 45px !important;
        background-color: rgba(255, 255, 255, 0.95) !important;
        border: 4px solid #ff69b4 !important;
        box-shadow: 0 6px 12px rgba(0,0,0,0.4) !important;
        color: #2c1810 !important;
        font-weight: bold !important;
    }
}

/* Very small phones optimization */
@media (max-width: 375px) {
    #canvas {
        max-height: 65vh !important;
        max-width: 92vw !important;
        width: 92vw !important;
        height: 65vh !important;
        margin-top: 3vh !important;
    }
    
    #start-button, #sound, #mute, #restart, #win-start, #main-screen, #clear-scores, #pause, #game-over-main {
        min-width: 100px !important;
        min-height: 100px !important;
        font-size: clamp(12px, 3vw, 16px) !important;
        padding: clamp(10px, 1.5vw, 14px) !important;
    }
    
    .title-text {
        font-size: clamp(45px, 8vw, 75px) !important;
    }
}

/* Very small phones in landscape */
@media (orientation: landscape) and (max-width: 667px) and (max-height: 375px) {
    .title-text {
        font-size: clamp(15px, 3vw, 25px) !important;
        margin: 0px 0 0px 0 !important;
    }
    
    #splash-screen {
        padding-top: 0px !important;
        padding-bottom: 0px !important;
        overflow: hidden !important;
        justify-content: space-between !important;
        height: 100vh !important;
    }
    
    #splash-screen h2 {
        font-size: clamp(6px, 1.2vw, 8px) !important;
        margin: 0px 0 !important;
        padding-top: 0 !important;
    }
    
    #splash-screen h3 {
        font-size: clamp(4px, 0.8vw, 6px) !important;
        line-height: 0.6 !important;
        margin: 0px 0 !important;
        padding: 0px !important;
        max-width: 98vw !important;
    }
    
    .buttons {
        padding-top: 0px !important;
        gap: 3px !important;
        margin-bottom: 0px !important;
    }
    
    #start-button, #sound {
        min-width: 45px !important;
        min-height: 45px !important;
        font-size: clamp(6px, 1vw, 8px) !important;
        padding: clamp(4px, 0.6vw, 6px) !important;
        border-radius: 20px !important;
    }
    
    #canvas {
        max-height: 40vh !important;
        max-width: 100vw !important;
        width: 100vw !important;
        height: 40vh !important;
        margin-top: 0.2vh !important;
    }
    
    #side-buttons {
        margin-top: 2vh !important;
        gap: 15px !important;
    }
    
    #mute, #pause {
        min-width: 65px !important;
        min-height: 65px !important;
        font-size: clamp(9px, 2.2vw, 14px) !important;
        padding: clamp(7px, 1.5vw, 11px) !important;
        border-radius: 30px !important;
        background-color: rgba(255, 255, 255, 0.95) !important;
        border: 3px solid #ff69b4 !important;
        box-shadow: 0 3px 6px rgba(0,0,0,0.4) !important;
        color: #2c1810 !important;
        font-weight: bold !important;
    }
}

/* Medium landscape phones optimization */
@media (orientation: landscape) and (max-width: 812px) and (max-height: 430px) {
    .title-text {
        font-size: clamp(16px, 3.5vw, 30px) !important;
        margin: 0px 0 0px 0 !important;
    }
    
    #splash-screen {
        padding-top: 1px !important;
        padding-bottom: 1px !important;
        overflow: hidden !important;
        justify-content: space-between !important;
        height: 100vh !important;
    }
    
    #splash-screen h2 {
        font-size: clamp(6px, 1.5vw, 9px) !important;
        margin: 0px 0 !important;
        padding-top: 0px !important;
    }
    
    #splash-screen h3 {
        font-size: clamp(5px, 1vw, 7px) !important;
        line-height: 0.65 !important;
        margin: 0px 0 !important;
        padding: 0px !important;
        max-width: 98vw !important;
    }
    
    .buttons {
        padding-top: 1px !important;
        gap: 3px !important;
        margin-bottom: 1px !important;
    }
    
    #start-button, #sound {
        min-width: 50px !important;
        min-height: 50px !important;
        font-size: clamp(7px, 1.3vw, 10px) !important;
        padding: clamp(5px, 0.8vw, 8px) !important;
        border-radius: 22px !important;
    }
}

/* Control instructions visibility */
.desktop-controls {
    display: inline;
}

.mobile-controls {
    display: none;
}

@media (max-width: 768px) {
    .desktop-controls {
        display: none;
    }
    
    .mobile-controls {
        display: inline;
        color: yellow;
        font-weight: bold;
    }
}

/* Ensure mobile controls stay visible in landscape mode */
@media (orientation: landscape) and (max-width: 932px) {
    .desktop-controls {
        display: none;
    }
    
    .mobile-controls {
        display: inline;
        color: yellow;
        font-weight: bold;
    }
}

/* Portrait mode optimization */
@media (orientation: portrait) {
    #canvas {
        max-width: 95vw !important;
        max-height: 65vh !important;
        width: 95vw !important;
        height: 65vh !important;
        margin-top: 2vh !important;
        object-fit: contain;
    }
    
    #game {
        height: 100vh !important;
        overflow: hidden;
        padding: 0;
        margin: 0;
    }
    
    #splash-screen {
        padding-top: 10px !important;
        min-height: 100vh;
        justify-content: flex-start !important;
    }
    
    .buttons {
        padding-top: 10px !important;
        margin-bottom: 15px;
    }
    
    #start-button, #sound, #mute, #restart, #win-start, #main-screen, #clear-scores, #pause, #game-over-main {
        min-width: 120px !important;
        min-height: 120px !important;
        font-size: clamp(14px, 3.5vw, 18px) !important;
        padding: clamp(12px, 2vw, 16px) !important;
        border-radius: 45px !important;
    }
    
    #side-buttons {
        margin-top: 1vh !important;
        gap: 15px !important;
    }
}

/* Landscape mode optimization */
@media (orientation: landscape) {
    #canvas {
        max-width: 100vw;
        max-height: 60vh;
        margin: 1vh auto 0 auto;
    }
    
    #game {
        height: 100vh;
        padding: 0;
        margin: 0;
        overflow: hidden;
    }
    
    .title-text {
        font-size: clamp(25px, 5vw, 50px);
        margin: 2px 0 2px 0;
    }
    
    #side-buttons {
        bottom: 20px;
    }
    
    #splash-screen {
        padding-top: 2px;
        padding-bottom: 2px;
        overflow: hidden;
        justify-content: space-between;
        height: 100vh;
    }
    
    .buttons {
        padding-top: 2px;
        margin-bottom: 5px;
    }
    
    #start-button, #sound, #mute, #restart, #win-start, #main-screen, #clear-scores, #pause, #game-over-main {
        min-width: 60px !important;
        min-height: 60px !important;
        font-size: clamp(8px, 2vw, 12px) !important;
        padding: clamp(6px, 1vw, 10px) !important;
        border-radius: 25px !important;
    }
    
    #pause-screen {
        padding-top: 5vh !important;
        padding-bottom: 5vh !important;
        overflow-y: auto !important;
    }
    
    #resume-game, #pause-main-screen {
        min-width: 60px !important;
        min-height: 60px !important;
        font-size: clamp(8px, 2vw, 12px) !important;
        padding: clamp(6px, 1vw, 10px) !important;
    }
}

/* Specific mobile optimizations */
@media (max-width: 768px) {
    #canvas {
        image-rendering: crisp-edges;
        image-rendering: pixelated;
        /* Enhanced touch performance for iPhone */
        touch-action: none;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
        /* Improve touch responsiveness */
        -webkit-transform: translateZ(0);
        -moz-transform: translateZ(0);
        -ms-transform: translateZ(0);
        -o-transform: translateZ(0);
        transform: translateZ(0);
        /* Hardware acceleration for smoother touch */
        -webkit-backface-visibility: hidden;
        -moz-backface-visibility: hidden;
        -ms-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-perspective: 1000;
        -moz-perspective: 1000;
        -ms-perspective: 1000;
        perspective: 1000;
        /* Prevent scrolling on canvas */
        overflow: hidden;
        position: relative;
    }
    
    #game {
        touch-action: none;
        -webkit-overflow-scrolling: none;
        overflow: hidden;
        position: relative;
        /* Hardware acceleration for game container */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform;
    }
    
    /* iPhone specific optimizations */
    body {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        /* Prevent iOS scroll bounce */
        overscroll-behavior: none;
        -webkit-overscroll-behavior: none;
        /* Prevent pull-to-refresh */
        -webkit-overflow-scrolling: touch;
        position: fixed;
        width: 100%;
        height: 100%;
    }
}
