@import url('https://fonts.googleapis.com/css2?family=Creepster&family=Roboto:wght@700&display=swap');

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Roboto', sans-serif;
    background-color: #1a1a1a;
    color: #fff;
    overflow: hidden;
}

#game-container {
    width: 100%;
    height: 100vh;
    position: relative;
    background: url('../assets/images/map.png') no-repeat center center;
    background-size: cover;
    overflow: hidden;
}

#player {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: url('../assets/images/cowboy.png') no-repeat center center;
    background-size: contain;
    z-index: 1000;
}

.enemy-word {
    position: absolute;
    font-size: 28px;
    font-weight: bold;
    color: #4CAF50;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 0 5px #4CAF50;
    transition: all 0.1s;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.5s;
}

.enemy-word.visible {
    opacity: 1;
}

.enemy-word span {
    transition: color 0.2s;
}

.enemy-word span.hit {
    color: #FF6347;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 0 10px #FF6347;
}

.enemy-word.dazed {
    animation: daze 0.5s ease-in-out;
}

.bullseye {
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, red 0%, red 30%, white 30%, white 60%, red 60%, red 100%);
    border-radius: 50%;
}

@keyframes daze {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px) rotate(-5deg); }
    75% { transform: translateX(5px) rotate(5deg); }
}

#typed-word {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 36px;
    font-family: 'Creepster', cursive;
    color: #FFD700;
    text-shadow: 0 0 10px #FFD700;
}

#score, #total-score, #wave, #words-left, #accuracy {
    position: absolute;
    font-size: 32px;
    font-family: 'Creepster', cursive;
    color: #FF6347;
    text-shadow: 0 0 5px #FF6347;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 10px;
}

#score { top: 10px; right: 10px; }
#total-score { top: 50px; right: 10px; }
#wave { top: 10px; left: 10px; }
#words-left { top: 50px; left: 10px; font-size: 24px; }
#accuracy { top: 90px; right: 10px; }

#game-over, #wave-complete {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-family: 'Roboto', sans-serif;
    display: none;
    text-align: center;
    color: #FFFFFF;
    text-shadow: 0 0 10px #000000;
    z-index: 2000;
}

#game-over {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 0 20px #FF6347;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#game-over h2 {
    margin: 0 0 20px 0;
    font-size: 64px;
    font-weight: bold;
}

#final-score, #final-accuracy {
    font-size: 36px;
    margin-bottom: 20px;
}

#wave-complete {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#wave-complete h2 {
    margin: 0 0 20px 0;
}

#next-wave-btn, #restart-btn {
    font-family: 'Roboto', sans-serif;
    font-size: 24px;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: #FFFFFF;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

#next-wave-btn:hover, #restart-btn:hover {
    background-color: #45a049;
}

.bullet {
    position: absolute;
    width: 20px;
    height: 20px;
    background: url('../assets/images/bullet.png') no-repeat center center;
    background-size: contain;
    z-index: 999;
}

.blood-splatter {
    position: absolute;
    width: 100px;
    height: 100px;
    background: url('../assets/images/bloodAni1.gif') no-repeat center center;
    background-size: contain;
    pointer-events: none;
    z-index: 1001;
}

#mute-btn, #pause-btn {
    position: absolute;
    bottom: 10px;
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    padding: 5px 10px;
    background-color: #4CAF50;
    color: #FFFFFF;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

#start-game-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    font-family: 'Roboto', sans-serif;
    font-size: 24px;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: #FFFFFF;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

#mute-btn:hover, #pause-btn:hover, #start-game-btn:hover {
    background-color: #45a049;
}

#mute-btn { left: 10px; }
#pause-btn { right: 10px; }

#wave-cleared {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-family: 'Roboto', sans-serif;
    text-align: center;
    color: #FFFFFF;
    text-shadow: 0 0 10px #000000;
    z-index: 2001;
    display: none;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 20px;
}

#wave-cleared p {
    margin: 10px 0;
    font-size: 36px;
}

#debug-info {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: #FFD700;
    padding: 5px 10px;
    border-radius: 5px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
}

#volume-control {
    position: absolute;
    bottom: 50px;
    left: 10px;
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 5px;
}

#volume-slider {
    width: 100px;
    margin-left: 10px;
}

#virtual-keyboard {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 10px 5px;
    box-sizing: border-box;
    z-index: 1000;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  margin-bottom: 5px;
}

.key {
  font-family: 'Roboto', sans-serif;
  font-size: 20px;
  padding: 12px 0;
  margin: 0 2px;
  background-color: #4CAF50;
  color: #FFFFFF;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
  touch-action: manipulation;
  flex-grow: 1;
  min-width: 8%;
  text-align: center;
}

.key:hover, .key:active {
  background-color: #45a049;
}

#backspace {
  min-width: 12%;
}
.hidden {
  display: none;
}

/* Adjust the game container to make room for the keyboard on mobile */
@media (max-width: 768px) {
    #game-container {
        height: calc(100vh - var(--keyboard-height, 240px));
        transition: height 0.3s ease;
    }

    #player {
        width: 70px;
        height: 70px;
        bottom: 20px; /* Adjust as needed */
    }

    .enemy-word {
        font-size: 22px;
    }

    #typed-word {
        font-size: 26px;
        bottom: 10px; /* Adjust as needed */
    }

    #score, #total-score, #wave, #words-left, #accuracy {
        font-size: 20px;
    }

    #game-over, #wave-complete {
        font-size: 34px;
    }

    #game-over h2 {
        font-size: 42px;
    }

    #final-score, #final-accuracy {
        font-size: 26px;
    }
}
@media (max-width: 320px) {
    .enemy-word {
        font-size: 20px;
    }

    #typed-word {
        font-size: 24px;
    }

    #score, #total-score, #wave, #words-left, #accuracy {
        font-size: 18px;
    }
}
@media (max-width: 768px) {
    .mobile-hide {
        display: none !important;
    }

    #game-container {
        padding-top: 10px; /* Add some top padding to compensate for removed elements */
    }

    #typed-word {
        top: 10px; /* Adjust the position of the typed word */
    }
}
