.game-container {
  width: 100%;
  max-width: 800px;
  height: 450px;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  background: #fff;
  margin: 40px auto;
  touch-action: none;
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.screen.active {
  display: flex;
}

#start-screen,
#end-screen {
  background: linear-gradient(135deg, #f6fbff 0%, #e9f4fc 100%);
  background-image: radial-gradient(
      circle at 50% 50%,
      rgba(255, 255, 255, 0.8) 1px,
      transparent 1px
    ),
    linear-gradient(135deg, #f6fbff 0%, #e9f4fc 100%);
  background-size: 40px 40px, 100% 100%;
}

#game-screen {
  background-image: url('/images/snowy-bg.jpg');
  background-size: cover;
  background-position: center;
  display: none;
  z-index: 5;
}

#game-screen.active {
  display: block;
}

.content-box {
  text-align: center;
  padding: 40px;
  max-width: 700px;
}

.header-end-game,.intro-title {
  color: #222;
  margin-bottom: 20px;
  font-size: 28px;
  font-weight: 600;
}

.intro-text {
  color: #555;
  margin-bottom: 30px;
  line-height: 1.6;
  font-size: 16px;
}

.result-text {
  font-size: 22px;
  color: #333;
  margin-bottom: 10px;
}

.result-subtext {
  color: #666;
  font-size: 16px;
  margin-bottom: 30px;
}

#final-discount {
  color: #dd4631;
  font-weight: bold;
  font-size: 26px;
}

.game-ui-top {
  position: absolute;
  top: 20px; 
  left: 0;
  width: 100%;
  padding: 0 25px;
  display: flex;
  justify-content: space-between;
  z-index: 30; 
  pointer-events: none; 
}

.game-info {
  font-size: 20px;
  font-weight: 700;
  color: #fff; 
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6); 
}

.timer-bar-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 35;
}

.timer-bar-fill {
  height: 100%;
  width: 100%; 
  background: linear-gradient(
    90deg,
    #ffab40,
    #dd4631
  ); 
  transition: width 0.1s linear;
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 4px;
}


#items-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
}

.falling-item {
  position: absolute;
  width: 45px;
  height: 45px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.item-good {
  background-image: url('/images/giftbox.svg');
}

.item-trap {
  background-image: url('/images/snowball.svg');
}

#player {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 70px;
  background-image: url('/images/sleigh.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 25;
}

.snow-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1; 
  overflow: hidden;
  pointer-events: none;
}

.snow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  animation: snowfall linear infinite;
  background-image: radial-gradient(3px 3px at 20% 30%, #fff 50%, transparent),
    radial-gradient(3px 3px at 40% 70%, #fff 50%, transparent),
    radial-gradient(3px 3px at 60% 10%, #fff 50%, transparent),
    radial-gradient(3px 3px at 80% 50%, #fff 50%, transparent),
    radial-gradient(3px 3px at 10% 90%, #fff 50%, transparent);
  background-size: 200px 200px;
}

.snow-layer-1 {
  opacity: 0.8;
  animation-duration: 10s;
  background-size: 200px 200px;
}

.snow-layer-2 {
  opacity: 0.6;
  animation-duration: 15s;
  background-size: 300px 300px; 
  background-position: 50px 50px; 
}

.snow-layer-3 {
  opacity: 0.4;
  animation-duration: 20s;
  background-size: 400px 400px;
  background-position: 100px 100px;
}

@keyframes snowfall {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(450px);
  }
}

#coupon-container {
  display: none;
  margin-bottom: 20px;
}

.coupon-label {
  font-size: 14px;
  color: #666;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#coupon-code {
  background: #f0f4f8;
  border: 2px dashed #d9534f;
  color: #333;
  font-size: 24px;
  font-weight: 800;
  padding: 15px;
  border-radius: 8px;
  letter-spacing: 1px;
}

#fail-message {
  display: none;
  color: #333;
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 1.5;
}

.discount-highlight {
  color: #d9534f;
  font-weight: bold;
}
