@import url(https://fonts.googleapis.com/css?family=Gloria+Hallelujah);

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Gloria Hallelujah', cursive;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f8f8f8;
  height: 100vh;
}
ul, li {
  list-style: none;
}

.container {
  height: 552px;
  width: 422px;
  position: relative;
  margin: 20px auto;
  overflow: hidden;
  background: #fff;
  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
  border-radius: 14px;
}

canvas {
  height: 552px;
  width: 422px;
  display: block;
  background: url(./imgs/vCoBB.png) top left;
}

/* ScoreBoard */
#scoreBoard {
  width: 420px;
  height: 50px;
  background: rgba(177, 196, 201, 0.7);
  position: absolute;
  top: -3px;
  left: 0;
  z-index: -1;
  border-image: url(./imgs/YXNA9.png) 100 5 round;
}

#scoreBoard p {
  font-size: 20px;
  line-height: 47px;
  margin: 0 0 0 5px;
  padding: 0;
}

/* Hide preloaded image more safely */
img#sprite {
  width: 1px;
  height: 1px;
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

/* Menus */
#mainMenu, #gameOverMenu {
  height: 100%;
  width: 100%;
  text-align: center;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

#gameOverMenu {
  visibility: hidden;
}

/* Titles */
h1, h2, h3 {
  font-weight: normal;
  margin: 0;
  color: #39393a;
}

h1 {
  font-size: 60px;
}

h3 {
  font-size: 10px;
  text-align: right;
  margin: 0 20px 0 0;
}

h3 a {
  color: #ee5b21;
  text-decoration: none;
}

/* Play + Restart buttons */
.button {
  width: 105px;
  height: 31px;
  background: url(./imgs/Q3sLW2.png) 0 0 no-repeat;
  display: block;
  color: #000;
  font-size: 12px;
  line-height: 31px;
  text-decoration: none;
  position: absolute;
  left: 50%;
  bottom: 50px;
  margin-left: -53px;
  text-align: center;
}
.gameover_box{
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 14px;
  height: 100%;
}
.gameover_box .button{
  position: unset;
  margin: 0;
}
.button.tweet {
  bottom: 100px;
  background-position: 0 -90px;
}

.button.fb {
  bottom: 150px;
  background-position: 0 -60px;
}

/* Arrow key icons */
.info {
  position: absolute;
  right: 20px;
  bottom: 0;
  margin: 0;
  color: black;
}

.info .key {
  width: 16px;
  height: 16px;
  background: url(./imgs/b6ySa2.png) no-repeat;
  text-indent: -9999px;
  display: inline-block;
}

.info .key.left {
  background-position: -92px -621px;
}

.info .key.right {
  background-position: -92px -641px;
}

/* 👇 Thêm style input name */
#mainMenu input#playerName {
  margin-top: 10px;
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #ccc;
  outline: none;
  width: 60%;
  max-width: 240px;
  text-align: center;
  font-family: 'Gloria Hallelujah', cursive;
}


/* Leaderboard Popup */
#leaderboardPopup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  width: 300px;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  z-index: 999;
  font-family: Arial, sans-serif;
}

#leaderboardPopup h2 {
  margin-top: 0;
  font-size: 20px;
  text-align: center;
}

#leaderboardPopup ul{
  padding-left: 20px;
  margin-top: 10px;
  max-height: 200px;
  overflow-y: auto;
  list-style: none;
}

#leaderboardPopup button {
  margin-top: 10px;
  background: #ff5555;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 8px 16px;
  cursor: pointer;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.btn-leaderboard{
  bottom: 300px;
}
#mobileControls {
  display: none;
  position: fixed;
  bottom: 10px;
  width: 100%;
  text-align: center;
  z-index: 999;
}

#mobileControls button {
  width: 80px;
  height: 50px;
  margin: 0 20px;
  font-size: 24px;
  border: none;
  border-radius: 8px;
  background: #4caf50;
  color: white;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}



@media (max-width: 480px) {

.btn-leaderboard{
  bottom: 5%;
}
.btn-play{
  bottom: 80px;
}

  canvas {
    width: 100% !important;
    height: 100%;
  }
.container{
  height: 100svh;
  border-radius: unset;
}
  #scoreBoard {
    width: 100%;
    height: 40px;
    font-size: 14px;
  }

  #scoreBoard p {
    line-height: 36px;
    font-size: 16px;
  }

  input#playerName {
    width: 90%;
    font-size: 16px;
  }

 

  #leaderboardContainer {
    max-height: 150px;
    overflow-y: auto;
    font-size: 12px;
  }

  h1 {
    font-size: 36px;
  }

  .info {
    font-size: 12px;
    text-align: center;
    right: 0;
    left: 0;
  }

  .info .key {
    transform: scale(0.8);
  }
}
