/* ----------------------------
   Global - Christmas Theme
---------------------------- */
body {
  font-family: 'Georgia', serif;
  background: url("../assets/images/background/noel.jpeg") no-repeat center center fixed;
  background-size: cover;
  color: white;
  text-align: center;
  min-height: 100vh;
  overflow-x: hidden;
}

h1 {
  color: #ffd700;
  text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000, 0 0 30px #ff0000;
  font-size: 2.5em;
  margin-bottom: 10px;
}

h2, h3 {
  color: #90ee90;
  text-shadow: 0 0 5px #228b22;
}

#game {
  display: flex;
  justify-content: center;
  margin-top: 40px;
  gap: 40px;
}

/* ----------------------------
   Falling Snow Animation
---------------------------- */
.snowflake {
  position: fixed;
  top: -10px;
  color: white;
  font-size: 1.5em;
  text-shadow: 0 0 5px #fff;
  animation: fall linear infinite;
  pointer-events: none;
  z-index: 9998;
}

@keyframes fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0.3;
  }
}

/* ----------------------------
   Clicker button - Festive Glow
---------------------------- */
.mainbutton {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background-image: url("../assets/images/button/natan.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 0 30px #ff0000, 0 0 60px #00ff00, 0 0 90px #ffd700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  z-index: 1;
  border: 4px solid #ffd700;
  animation: christmasGlow 2s ease-in-out infinite alternate;
}

@keyframes christmasGlow {
  0% {
    box-shadow: 0 0 30px #ff0000, 0 0 60px #00ff00;
  }
  100% {
    box-shadow: 0 0 50px #00ff00, 0 0 80px #ff0000;
  }
}

.mainbutton:hover {
  transform: scale(1.1);
  box-shadow: 0 0 50px #ffd700, 0 0 80px #ff0000, 0 0 100px #00ff00;
}

.mainbutton:active {
  transform: scale(0.95);
  box-shadow: 0 0 20px #ff0000;
}

.animate {
  animation: pop 0.2s linear;
}

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

.big {
  font-size: 48px;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 0 10px #ffd700, 0 0 20px #ff0000;
}

/* ----------------------------
   Right panel / buttons - Christmas Colors
---------------------------- */
#right {
  text-align: left;
}

button {
  display: block;
  width: 220px;
  padding: 12px;
  margin: 10px 0;
  background: linear-gradient(135deg, #1a472a 0%, #2d5a3d 50%, #1a472a 100%);
  color: #ffd700;
  border: 2px solid #ffd700;
  border-radius: 12px;
  cursor: pointer;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  box-shadow: 0 4px 15px rgba(0, 100, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: all 0.2s ease;
}

button:hover {
  background: linear-gradient(135deg, #8b0000 0%, #cc0000 50%, #8b0000 100%);
  border-color: #90ee90;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 0, 0, 0.5);
}

button:active {
  transform: translateY(0);
}

.section {
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.5);
  padding: 15px;
  border-radius: 15px;
  border: 2px solid rgba(255, 215, 0, 0.3);
}

/* ----------------------------
   Skin Shop panel - Christmas
---------------------------- */
#skinShop {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 30px;
  border-radius: 20px;
  border: 3px solid #ffd700;
  box-shadow: 0 0 40px rgba(255, 0, 0, 0.5), 0 0 60px rgba(0, 255, 0, 0.3);
  display: none;
  z-index: 999;
}

#skinShop>div {
  display: flex;
  gap: 20px;
}

/* ----------------------------
   Chest buttons - Festive
---------------------------- */
.chest {
  width: 120px;
  height: 120px;
  border: 3px solid #ffd700;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chest:hover {
  transform: scale(1.15);
  box-shadow: 0 8px 30px rgba(255, 0, 0, 0.7), 0 0 20px #ffd700;
}

.chest.commun {
  background-image: url("../assets/images/chest/commun.png");
}

.chest.rare {
  background-image: url("../assets/images/chest/rare.png");
}

.chest.epic {
  background-image: url("../assets/images/chest/epic.png");
}

.chest.ancient {
  background-image: url("../assets/images/chest/ancient.png");
}

/* ----------------------------
   Achievements panel - Christmas
---------------------------- */
#achievements_btn {
  margin-top: 20px;
  background: linear-gradient(135deg, #8b0000 0%, #cc0000 50%, #8b0000 100%);
  border: 2px solid #ffd700;
}

#achievements_btn:hover {
  background: linear-gradient(135deg, #1a472a 0%, #2d5a3d 50%, #1a472a 100%);
}

.panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #1a1a2e 0%, #0d1520 100%);
  width: 420px;
  padding: 25px;
  border-radius: 20px;
  border: 3px solid #ffd700;
  display: none;
  text-align: left;
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.3), 0 0 80px rgba(255, 0, 0, 0.2);
  z-index: 999;
}

#achievements_list {
  max-height: 300px;
  overflow-y: auto;
}

.achievement {
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1a472a 0%, #0d2818 100%);
  border: 2px solid rgba(255, 215, 0, 0.3);
}

.achievement.locked {
  opacity: 0.4;
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

.unlocked_flash {
  animation: christmasFlash 0.8s ease-out;
}

@keyframes christmasFlash {
  0% {
    background: linear-gradient(135deg, #ffd700 0%, #ff0000 100%);
    box-shadow: 0 0 30px #ffd700;
  }
  100% {
    background: linear-gradient(135deg, #1a472a 0%, #0d2818 100%);
  }
}

#achievements_panel {
  display: none;
  background: linear-gradient(135deg, #1a1a2e 0%, #0d1520 100%);
  color: white;
  padding: 20px;
  border-radius: 15px;
  margin-top: 10px;
  border: 3px solid #ffd700;
}

/* ----------------------------
   Popup (center screen) - Christmas
---------------------------- */
.achievement-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  background: linear-gradient(135deg, #8b0000 0%, #cc0000 100%);
  color: #ffd700;
  padding: 25px 40px;
  border-radius: 20px;
  border: 4px solid #ffd700;
  font-size: 22px;
  font-weight: bold;
  text-shadow: 0 0 10px #ffd700, 0 2px 4px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 9999;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.achievement-popup.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* GACHA ANIMATION CONTAINER */
#gachaAnimation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  flex-direction: column;
  transition: opacity 0.5s;
}

.gacha-hidden {
  opacity: 0;
  pointer-events: none;
}

.gacha-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(139, 0, 0, 0.9), rgba(0, 50, 0, 0.95));
  backdrop-filter: blur(4px);
}

.gacha-chest {
  width: 180px;
  height: 180px;
  background-image: url("../assets/images/chest/commun.png");
  background-size: contain;
  background-repeat: no-repeat;
  animation: spinChest 1.2s linear infinite;
  z-index: 2;
}

@keyframes spinChest {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}

.gacha-flash {
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #ffd700, #ff0000);
  border-radius: 50%;
  opacity: 0;
  filter: blur(20px);
  z-index: 1;
}

.gacha-result {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 3;
  animation: popIn 0.4s ease forwards;
}

#gachaSkinReveal {
  width: 200px;
  height: 200px;
  object-fit: contain;
  border: 4px solid #ffd700;
  border-radius: 50%;
  box-shadow: 0 0 30px #ffd700;
}

#gachaText {
  font-size: 28px;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 0 10px #ff0000, 0 2px 4px rgba(0,0,0,0.8);
}

@keyframes popIn {
  0% { transform: scale(0.1); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Stats styling */
#right p {
  color: #90ee90;
  text-shadow: 0 0 5px rgba(144, 238, 144, 0.5);
}

#right p span {
  color: #ffd700;
  font-weight: bold;
}

/* ----------------------------
   Floating Numbers
---------------------------- */
.floating-number {
  position: fixed;
  font-size: 24px;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 0 10px #ff0000, 2px 2px 4px rgba(0,0,0,0.8);
  pointer-events: none;
  z-index: 10000;
  animation: floatUp 1s ease-out forwards;
}

.floating-number.auto-income {
  font-size: 18px;
  color: #90ee90;
  text-shadow: 0 0 8px #228b22;
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-80px) scale(1.3);
  }
}

/* ----------------------------
   Click Particles
---------------------------- */
.click-particle {
  position: fixed;
  font-size: 20px;
  pointer-events: none;
  z-index: 10000;
  animation: particleBurst 0.8s ease-out forwards;
}

@keyframes particleBurst {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(
      calc(cos(var(--angle)) * var(--distance)),
      calc(sin(var(--angle)) * var(--distance) - 50px)
    ) scale(0.5) rotate(360deg);
  }
}

/* ----------------------------
   Screen Shake
---------------------------- */
.shake {
  animation: shakeIt 0.1s ease-in-out;
}

@keyframes shakeIt {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ----------------------------
   Upgrade Button States
---------------------------- */
button.can-afford {
  background: linear-gradient(135deg, #1a472a 0%, #2d8a4d 50%, #1a472a 100%) !important;
  border-color: #90ee90 !important;
  box-shadow: 0 0 15px rgba(144, 238, 144, 0.6), inset 0 1px 0 rgba(255,255,255,0.2);
  animation: affordPulse 1.5s ease-in-out infinite alternate;
}

@keyframes affordPulse {
  0% { box-shadow: 0 0 10px rgba(144, 238, 144, 0.4); }
  100% { box-shadow: 0 0 25px rgba(144, 238, 144, 0.8); }
}

button.cannot-afford {
  opacity: 0.6;
  filter: grayscale(30%);
}

button.cannot-afford:hover {
  transform: none;
  cursor: not-allowed;
}

/* ----------------------------
   Left Panel Styling
---------------------------- */
#left {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ----------------------------
   Bonus Info Display
---------------------------- */
.bonus-info {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.7);
  padding: 15px;
  border-radius: 10px;
  border: 2px solid #ffd700;
  color: #90ee90;
  font-size: 14px;
  z-index: 100;
}

.bonus-info span {
  color: #ffd700;
  font-weight: bold;
}

/* ----------------------------
   Legendary Upgrades Section
---------------------------- */
.legendary-section {
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.9) 0%, rgba(75, 0, 130, 0.9) 100%) !important;
  border: 3px solid #ffd700 !important;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.legendary-section h2 {
  color: #ffd700 !important;
  text-shadow: 0 0 10px #ffd700;
}

.legendary-btn {
  background: linear-gradient(135deg, #4a0080 0%, #800080 50%, #4a0080 100%) !important;
  border: 2px solid #ffd700 !important;
  color: #ffd700 !important;
  font-weight: bold;
  text-shadow: 0 0 5px #ffd700;
}

.legendary-btn:hover {
  background: linear-gradient(135deg, #6a0dad 0%, #9932cc 50%, #6a0dad 100%) !important;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.legendary-btn.can-afford {
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
  border-color: #90ee90 !important;
}

.legendary-btn.cannot-afford {
  opacity: 0.5;
  filter: grayscale(50%);
}
