body {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #e0f2f7, #f8bbd0);
  font-family: "Cute Font", "Helvetica Neue", sans-serif;
  color: #4a148c;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  position: relative;
  overflow-y: auto;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 1rem;
  box-sizing: border-box;
}

#game-container {
  width: 100%;
  max-width: 400px;
  height: 610px;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.game-inner-container {
  background-color: #fff3e0;
  width: 100%;
  height: 100%;
}

canvas {
  background-color: #fffde7;
  border-radius: 20px;
  width: 100%;
  height: 100%;
  position: relative;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: calc(100% - 2rem);
  padding: 0.7rem 1rem;
  background-color: #fce4ec;
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 15px;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  transition: all 0.3s ease;
  position: relative;
}

.title-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.title-container h1 {
  font-size: 1.6rem;
  margin: 0;
  font-weight: 700;
  color: #f48fb1;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.version {
  font-size: 0.8em;
  margin-left: 0.5rem;
  color: #6a1b9a;
}

.score-container {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 30px;
  position: relative;
  flex-direction: column;
}

.score-inner-container {
  display: flex;
  align-items: center;
  gap: 5px;
}

.options-popup-container {
  position: absolute;
  bottom: 0;
  right: 0px;
}

.score-container i {
  font-size: 1.3rem;
  color: #ff6f00;
  text-shadow: 0 0 5px rgba(255, 111, 0, 0.7);
}

#score {
  font-weight: 700;
  color: #ff6f00;
}

.animate {
  animation: scale 0.3s ease-in-out;
}

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

.timeout-bar {
  height: 1rem;
  background-color: #fce4ec;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.timeout-container {
  width: 80%;
  max-width: 300px;
}

.timeout-progress {
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, #ff6f00, #f06292);
  transition: width 0.3s linear;
}

.overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 224, 230, 0.8);
  color: #4a148c;
  font-size: 2.2rem;
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
  padding: 2rem;
  z-index: 20;
  display: none;
  animation: fadeIn 0.3s ease-in-out;
  border-radius: 20px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.overlay button {
  margin-top: 2rem;
  padding: 1rem 2rem;
  font-size: 1.2rem;
  background-color: #ff6f00;
  color: white;
  border: none;
  border-radius: 10px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.overlay button:hover {
  background-color: #e65100;
  transform: scale(1.05);
}

#copyright {
  font-size: 0.7rem;
  color: #6a1b9a;
  text-align: center;
  margin-top: 0.5rem;
  font-weight: 400;
}

#copyright a {
  color: #6a1b9a;
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

#copyright a:hover {
  color: #f06292;
}

#copyright i {
  font-size: 1.2em;
  margin-right: 0.3rem;
}

@media (max-width: 480px) {
  .container {
    padding: 0.5rem;
  }
  .title-container h1 {
    font-size: 1.4rem;
  }
  .score-container,
  .timeout-container {
    font-size: 1rem;
  }
  .timeout-bar {
    width: 80px;
  }
  .overlay {
    font-size: 1.7rem;
  }
  .overlay button {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }
}

@media screen and (max-height: 700px) {
  .container {
    max-height: 100vh;
  }

  #game-container {
    height: 800px;
  }
}

#high-stack-line,
#highest-stack-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 10;
  pointer-events: none;
  /* background: linear-gradient(to right, #ff6f00, #f06292); */
  box-shadow: 0 0 5px rgba(240, 98, 146, 0.5);
}

.options-btn {
  cursor: pointer;
  font-size: 1.5em;
  color: #6a1b9a;
  transition: color 0.3s ease;
}

.options-btn:hover {
  color: #ff6f00;
}

#optionsPopup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 250px;
  background-color: #fce4ec;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#optionsPopup h3 {
  margin: 0 0 10px 0;
  color: #4a148c;
}

#optionsPopup .slider-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

#optionsPopup .slider-container label {
  font-size: 0.9em;
  color: #4a148c;
  text-align: center;
}

#optionsPopup input[type="range"] {
  width: 100%;
  accent-color: #ff6f00;
}

#closeOptions {
  margin-top: 10px;
  padding: 5px 10px;
  background-color: #ff6f00;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.sound-volume-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  width: 100%;
}

.highscore-container {
  font-size: 0.9rem;
}

.sound-volume-container label {
  font-size: 1rem;
  color: #4a148c;
}

.game-timeout-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  top: 1rem;
  display: flex;
  padding: 0.5rem;
  box-sizing: border-box;
  z-index: 10;
  justify-content: center;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
}
.logo-container img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  margin-right: 10px;
}
.title-container {
  display: flex;
  align-items: center;
  gap: 5px;
}
