@import url("https://fonts.googleapis.com/css?family=Press+Start+2P");

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Press Start 2P", cursive;
  font-size: 16px;
  color: white;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button {
  outline: none;
  cursor: pointer;
  border: none;
  box-shadow: 3px 5px 0px 0px rgba(0, 0, 0, 0.75);
  background-color: white;
  border: 1px solid lightgray;
  user-select: none;
}

#counter {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.2em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  z-index: 100;
}

#sound-toggle {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 1.5em;
  cursor: pointer;
  z-index: 100;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#end {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  z-index: 200;
  background-color: rgba(0, 0, 0, 0.7);
}

.end-content {
  text-align: center;
  padding: 20px;
  background-color: #333;
  border-radius: 10px;
  max-width: 90%;
}

#end h2 {
  margin-bottom: 20px;
  font-size: 1.5em;
}

#end p {
  margin-bottom: 30px;
  font-size: 1.2em;
}

#retry {
  background-color: red;
  padding: 15px 30px;
  font-family: inherit;
  font-size: 1em;
  color: white;
  border-radius: 5px;
}

#controlls {
  position: absolute;
  width: 100%;
  bottom: 10px;
  display: flex;
  justify-content: center;
  z-index: 100;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 10px;
  width: 90%;
  max-width: 300px;
}

.control-btn {
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

#forward {
  grid-column: 1 / span 3;
}

/* Landscape orientation adjustments */
@media (orientation: landscape) {
  #counter {
    top: 5px;
    right: 5px;
    font-size: 1em;
  }
  
  #sound-toggle {
    top: 5px;
    left: 5px;
    font-size: 1.2em;
  }
  
  .controls-grid {
    max-width: 200px;
    gap: 5px;
  }
  
  .control-btn {
    height: 40px;
  }
  
  #retry {
    padding: 10px 20px;
    font-size: 0.8em;
  }
}

/* Larger screens */
@media (min-width: 768px) {
  #counter {
    font-size: 1.5em;
    top: 20px;
    right: 20px;
  }
  
  #sound-toggle {
    font-size: 2em;
    top: 20px;
    left: 20px;
  }
  
  .controls-grid {
    max-width: 400px;
    gap: 15px;
  }
  
  .control-btn {
    height: 80px;
  }
  
  #end h2 {
    font-size: 2em;
  }
  
  #end p {
    font-size: 1.5em;
  }
  
  #retry {
    padding: 20px 40px;
    font-size: 1.2em;
  }
}