/* General body styling */
body {
  font-family: Arial, sans-serif;
  text-align: center;
  margin: 20px;
  touch-action: manipulation;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Center button container */
#buttonContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

/* Grunt button default */
#gruntButton {
  background-color: #8FBC8F;
  color: white;
  border: none;
  padding: 15px 30px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 5px;
  user-select: none;
  margin-top: 15px;
  transition: background-color 0.2s;
}
#gruntButton:hover {
  background-color: #7AA87A;
}

/* Prestige / Shop Buttons */
button {
  font-family: inherit;
}
#prestigeButton, #openShopButton, #openCosmeticsButton {
  background-color: #5cb85c;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
}
#openShopButton { background-color: #FFD700; color: black; }
#openShopButton:hover { background-color: #FFC107; }
#openCosmeticsButton { background-color: #8FBC8F; }

button:hover {
  filter: brightness(0.95);
}

/* Stats & Upgrades */
#statsContainer {
  margin-top: 20px;
}
#upgradeContainer {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.upgradeBox {
  background-color: rgba(255, 255, 255, 0.50); /* Soft white with a little see-through */
  border: 2px solid #8FBC8F;
  border-radius: 8px;
  padding: 10px;
  min-width: 150px;
  text-align: left;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); /* subtle depth */
  backdrop-filter: blur(2px); /* Optional: softens dirt behind */
}

ul {
  list-style: none;
  padding: 0;
}
li {
  margin: 10px 0;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: #f9f9f9;
  cursor: pointer;
}
li:hover {
  background-color: #E6FFE6;
  color: #8FBC8F;
}

/* Nightcrawler Shop Modal */
#nightcrawlerShopModal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
#nightcrawlerShopContent {
  background: white;
  padding: 20px;
  border-radius: 10px;
  width: 600px;
  max-width: 90%;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  text-align: center;
}
#shopSections {
  display: flex;
  gap: 20px;
  justify-content: space-between;
}
#cosmeticSection, #gameplaySection {
  flex: 1;
  text-align: left;
}
#cosmeticItems button, #gameplayItems button, #closeShopButton {
  background-color: #8FBC8F;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 5px;
  margin-top: 10px;
  cursor: pointer;
}
#closeShopButton {
  width: 100%;
  margin-top: 20px;
}
#cosmeticItems button:hover,
#gameplayItems button:hover,
#closeShopButton:hover {
  background-color: #7AA87A;
}

/* Cosmetic Modal */
#cosmeticsModal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}
#cosmeticsModal .modal-content {
  max-width: 500px;
  background: white;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}
#cosmeticsModal button {
  background-color: #8FBC8F;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  width: 100%;
  margin-top: 20px;
}
#cosmeticsModal button:hover {
  background-color: #7AA87A;
}

/* Cosmetic Toggle + Skin Preview */
#skinContainer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0;
}
.skin-preview {
  border: 2px solid transparent;
  padding: 10px;
  border-radius: 8px;
  background: #f5f5f5;
  cursor: pointer;
  transition: border 0.3s, box-shadow 0.3s;
}
.skin-preview:hover {
  border-color: #8FBC8F;
}
.skin-preview.active {
  border-color: #8FBC8F;
  box-shadow: 0 0 10px #8FBC8F;
}

#effectToggleContainer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

/* Toggle Styles */
.toggle-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.toggle-container input {
  display: none;
}
.toggle-container .slider {
  position: relative;
  width: 40px;
  height: 20px;
  background-color: #ccc;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.3s;
}
.toggle-container .slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  transition: transform 0.3s;
}
.toggle-container input:checked + .slider {
  background-color: #8FBC8F;
}
.toggle-container input:checked + .slider::before {
  transform: translateX(20px);
}

/* Grunt Skins */
body.cosmic-grunt-active #gruntButton {
  background: radial-gradient(circle, #6b1fff, #1b0038, #000000);
  box-shadow: 0 0 15px #6b1fff;
  color: #fff;
  border: 2px solid #6b1fff;
}
body.molten-grunt-active #gruntButton {
  background: linear-gradient(45deg, #ff4500, #ff8c00);
  box-shadow: 0 0 15px #ff4500;
  color: white;
}
body.slime-grunt-active #gruntButton {
  background: radial-gradient(circle, #7FFF00, #228B22);
  box-shadow: 0 0 10px #7FFF00;
  color: white;
}
body.cyber-grunt-active #gruntButton {
  background: linear-gradient(135deg, #00ffff, #0047ab);
  box-shadow: 0 0 12px #00ffff;
  color: white;
}
body.rainbow-grunt-active #gruntButton {
  background: linear-gradient(270deg, red, orange, yellow, green, blue, indigo, violet);
  background-size: 600% 600%;
  animation: rainbowPulse 3s ease infinite;
  color: white;
}
@keyframes rainbowPulse {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
body.bone-grunt-active #gruntButton {
  background: #fff;
  color: #333;
  border: 2px dashed #aaa;
}

/* Particle styling */
.particle-wrapper {
  position: absolute;
  width: 6px;
  height: 6px;
  pointer-events: none;
  z-index: 1000;
}
.particle {
  width: 22px;
  height: 6px;
  border-radius: 10px;
  pointer-events: none;
}


/* SPIN while flying */
@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes wiggleWrapper {
  0%   { transform: rotateZ(0deg); }
  25%  { transform: rotateZ(5deg); }
  50%  { transform: rotateZ(0deg); }
  75%  { transform: rotateZ(-5deg); }
  100% { transform: rotateZ(0deg); }
}
.wiggle-wrapper {
  animation: wiggleWrapper 1s ease-in-out infinite;
}





/* NEW DIRT OVERLAY STYLE */
#dirtOverlay {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background-color: #3a2f1d;
  opacity: 0.9;
  pointer-events: none;
  z-index: -1;
  transition: height 0.5s ease;
  background-image:
    radial-gradient(circle, #4b3a25 10%, transparent 11%),
    radial-gradient(circle, #5c402a 10%, transparent 11%),
    radial-gradient(circle, #362512 10%, transparent 11%);
  background-size: 30px 30px;
  background-position:
    0 0,
    15px 15px,
    7px 23px;
  animation: dirtDrift 3s ease-in-out infinite;
  overflow: visible;
}

#dirtOverlay::before {
  content: '';
  position: absolute;
  top: -32px;
  left: 0;
  width: 100%;
  height: 32px;
  background-repeat: repeat-x;
  background-size: 96px 32px;
  background-image: url("data:image/svg+xml;utf8,\
    <svg xmlns='http://www.w3.org/2000/svg' width='96' height='32' viewBox='0 0 96 32'>\
      <rect x='0' y='16' width='8' height='16' fill='%233a2f1d'/>\
      <rect x='8' y='12' width='8' height='20' fill='%233a2f1d'/>\
      <rect x='16' y='20' width='8' height='12' fill='%233a2f1d'/>\
      <rect x='24' y='10' width='8' height='22' fill='%233a2f1d'/>\
      <rect x='32' y='18' width='8' height='14' fill='%233a2f1d'/>\
      <rect x='40' y='14' width='8' height='18' fill='%233a2f1d'/>\
      <rect x='48' y='22' width='8' height='10' fill='%233a2f1d'/>\
      <rect x='56' y='8' width='8' height='24' fill='%233a2f1d'/>\
      <rect x='64' y='18' width='8' height='14' fill='%233a2f1d'/>\
      <rect x='72' y='12' width='8' height='20' fill='%233a2f1d'/>\
      <rect x='80' y='20' width='8' height='12' fill='%233a2f1d'/>\
      <rect x='88' y='16' width='8' height='16' fill='%233a2f1d'/>\
    </svg>");
  pointer-events: none;
  z-index: -1;
}





@keyframes dirtDrift {
  0% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
  100% { transform: translateY(0); }
}

/* Dirt Meter UI */
#dirtMeterUI {
  position: fixed;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.6);
  padding: 8px 12px;
  border-radius: 8px;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 14px;
  z-index: 10;
}
#digOutButton {
  margin-left: 10px;
  padding: 4px 10px;
  background: #694421;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
#digOutButton:hover {
  background: #8d5a2b;
}

/* General Modal Overlay */
.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

/* Modal Content Box */
.modal-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  width: 80%;
  max-width: 500px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  text-align: left;
}

/* Changelog Modal Close Button */
#changelogModal button {
  background-color: #8FBC8F;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  width: 100%;
  margin-top: 15px;
}
#changelogModal button:hover {
  background-color: #7AA87A;
}
/* Slide-in animations */
@keyframes slideInFromLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInFromRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Modal slide-ins */
#nightcrawlerShopModal {
  animation: slideInFromLeft 0.4s ease forwards;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
}

#cosmeticsModal .modal-content {
  animation: slideInFromRight 0.3s ease-out forwards;
  display: flex;
  flex-direction: column;
}

/* Cosmetic modal skin preview styles */
.skin-preview.cosmic {
  background: radial-gradient(circle, #6b1fff, #1b0038, #000000);
  color: #fff;
}
.skin-preview.molten {
  background: linear-gradient(45deg, #ff4500, #ff8c00);
  color: white;
}
.skin-preview.slime {
  background: radial-gradient(circle, #7FFF00, #228B22);
  color: white;
}
.skin-preview.cyber {
  background: linear-gradient(135deg, #00ffff, #0047ab);
  color: white;
}
.skin-preview.rainbow {
  background: linear-gradient(270deg, red, orange, yellow, green, blue, indigo, violet);
  color: white;
}
.skin-preview.bone {
  background: #fff;
  color: #333;
  border: 2px dashed #aaa;
}

/* Extra particle animations */
@keyframes explode {
  0% {
    opacity: 1;
    transform: scale(1) translate(0, 0);
  }
  100% {
    opacity: 0;
    transform: scale(1) translate(calc(200px * var(--dirX)), calc(200px * var(--dirY)));
  }
}

body.dirt-heavy {
  --text-contrast: rgba(255, 255, 255, 0.95);
}
#versionTag {
  position: fixed;
  bottom: 5px;
  right: 10px;
  font-size: 12px;
  font-family: Arial, sans-serif;
  color: #444;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
  z-index: 999;
  cursor: pointer;
  transition: color 0.3s, background-color 0.3s;
}
body.dirt-heavy #versionTag {
  color: #fff;
  background-color: rgba(0, 0, 0, 0.6);
  text-shadow: 0 0 4px rgba(0,0,0,0.8);
}
.covered {
  color: #fff !important;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}
/* Nightcrawler Shop Modal - slide in from left */
#nightcrawlerShopModal {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 400px; /* Adjust width as needed */
  background-color: rgba(0, 0, 0, 0.5); /* Dimmed background */
  display: none;
  z-index: 1000;
  animation: slideInFromLeft 0.4s ease forwards;
  justify-content: flex-start;
  align-items: stretch;
  flex-direction: column;
}


/* Nightcrawler Shop Inner Content */
#nightcrawlerShopContent {
  background-color: white;
  padding: 20px;
  height: 100%;
  overflow-y: auto;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.2);
}

/* Cosmetics Modal - slide in from right */
#cosmeticsModal {
  position: fixed;
  top: 0;
  left: auto !important;
  right: 0;
  height: 100%;
  width: 400px;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: row;
  justify-content: flex-end;
  align-items: stretch;
  z-index: 1001;
}

/* Cosmetics Inner Panel */
#cosmeticsModal .modal-content {
  background: white;
  height: 100%;
  width: 100%;
  max-width: 400px;
  padding: 20px;
  overflow-y: auto;
  animation: slideInFromRight 0.3s ease-out forwards;
  display: flex;
  flex-direction: column;
}
@keyframes slideInFromLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInFromRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0%);
    opacity: 1;
  }
}

.covered {
  color: #ffffff !important;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

#openAchievementsButton {
  position: fixed;
  top: 10px;
  right: 10px;
  background-color: #8FBC8F;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 0 4px rgba(0,0,0,0.2);
  transition: background-color 0.2s ease;
}
#openAchievementsButton:hover {
  background-color: #7AA87A;
}
#achievementsModal {
  display: none;
  position: fixed;
  z-index: 1001;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

#achievementsModal .modal-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  width: 80%;
  max-width: 700px;
  max-height: 80vh;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  text-align: left;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Grid layout for achievements */
#achievementItems {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 15px;
}

/* Each achievement entry */
.achievement-entry {
  padding: 10px;
  border-radius: 6px;
  background-color: #f5f5f5;
  border: 1px solid #ccc;
  font-size: 14px;
  line-height: 1.4;
}
.achievement-entry strong {
  font-size: 15px;
  color: #4a734a;
}
.achievement-entry em {
  color: #aaa;
}

/* Styled Close button */
#closeAchievementsButton {
  background-color: #8FBC8F;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  margin-top: 20px;
  font-size: 16px;
}
#closeAchievementsButton:hover {
  background-color: #7AA87A;
}
#toastContainer {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none; /* prevent interference */
}

.toast {
  background-color: #8FBC8F;
  color: white;
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  font-size: 14px;
  max-width: 300px;
  text-align: center;
  opacity: 0;
  transform: translateY(30px);
  animation: toastSlideIn 0.4s ease-out forwards;
  pointer-events: auto;
  position: relative;
}

@keyframes toastSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast.fade-out {
  animation: toastFadeOut 0.6s ease forwards;
}

@keyframes toastFadeOut {
  to {
    opacity: 0;
    transform: translateY(30px);
  }
}
#achievementsModal .modal-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  width: 80%;
  max-width: 700px;
  max-height: 80vh;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  text-align: left;
  display: flex;
  flex-direction: column;
}

.achievement-scroll-area {
  overflow-y: auto;
  flex-grow: 1;
  margin-top: 15px;
  margin-bottom: 10px;
}

#achievementItems {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  padding-right: 10px; /* spacing for scrollbar */
}

#closeAchievementsButton {
  background-color: #8FBC8F;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  width: 100%;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  background-clip: padding-box;
  z-index: 2;
}
#closeAchievementsButton:hover {
  background-color: #7AA87A;
}

.achievement-entry.new-achievement {
  border-color: gold;
  box-shadow: 0 0 10px gold;
  animation: glowPulse 1.2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%   { box-shadow: 0 0 5px gold; }
  50%  { box-shadow: 0 0 15px gold; }
  100% { box-shadow: 0 0 5px gold; }
}
#toastContainer {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none; /* prevent interference */
}
.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;

  background-color: #333;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  font-family: Arial, sans-serif;
  font-size: 14px;
  text-align: center;

  max-width: 350px;
  min-width: 220px;
  word-wrap: break-word;
  opacity: 0.95;
  pointer-events: none;
}

.toast strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.toast small {
  font-size: 13px;
  line-height: 1.3;
}

.toast.fade-out {
  animation: toastFadeOut 0.6s ease forwards;
}




.toast.green {
  background: #4CAF50 !important;
}

.toast.purple {
  background: #6f42c1 !important;
}

.toast.red {
  background: #c0392b !important;
}

.toast.sky {
  background: #00bfff !important; /* 💙 Sky Blue */
}



/* Fade-in from top */
@keyframes fadeInTop {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade-in from bottom */
@keyframes fadeInBottom {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade-out animation */
.fade-out {
  opacity: 0 !important;
  transition: opacity 0.6s ease, transform 0.6s ease;
  transform: translateY(0px);
}
/* Fix for achievement toasts */
#toastContainer .toast {
  position: relative; /* Let it flow within #toastContainer */
  left: unset;
  transform: none;
}

#systemToastContainer {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

#toastContainer .toast {
  position: relative; /* So it stacks inside container */
  left: auto;
  transform: none;
  margin-top: 10px;
}

/* 🔼 Top System Toasts */
.system-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;

  background-color: #333;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  font-family: Arial, sans-serif;
  font-size: 14px;
  text-align: center;

  max-width: 350px;
  min-width: 220px;
  word-wrap: break-word;
  opacity: 0.95;
  pointer-events: none;
}

/* 🔽 Bottom Achievement Toasts */
.achievement-toast {
  position: relative;
  left: auto;
  transform: none;
  margin-top: 10px;

  background-color: #8FBC8F;
  color: white;
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  font-size: 14px;
  max-width: 300px;
  text-align: center;
  pointer-events: auto;
}

#toastContainer,
#systemToastContainer {
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

#systemToastContainer .toast {
  position: relative;
  left: auto;
  transform: none;
  margin-top: 10px;

  max-width: 350px;
  min-width: 220px;
  word-wrap: break-word;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  background-color: #333;
  color: white;
  opacity: 0.95;
  text-align: center;
  pointer-events: none;
}

/* Settings Modal Grid */
.settings-grid {
  text-align: center;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.grid-item {
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  padding: 20px 10px;
  border-radius: 10px;
  font-size: 24px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.grid-item:hover {
  background-color: #e6ffe6;
}

.grid-item small {
  font-size: 14px;
  margin-top: 6px;
  color: #444;
}

/* Optional Dark Mode Theme (toggle via JS class) */
body.dark-mode {
  background-color: #221133;
  color: white;
}
body.dark-mode .modal-content {
  background-color: #2f1a4c;
  color: white;
}
body.dark-mode .grid-item {
  background-color: #3a2a55;
  border-color: #555;
}
body.dark-mode .grid-item:hover {
  background-color: #4a3966;
}
/* 🌙 Dark Mode Text Tweaks */
body.dark-mode,
body.dark-mode p,
body.dark-mode span,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode button,
body.dark-mode li,
body.dark-mode small,
body.dark-mode label,
body.dark-mode strong,
body.dark-mode em {
  color: #fff !important;
}

/* 🌙 Upgrade Buttons Dark Mode Styling */
body.dark-mode li {
  background-color: #1a0e26; /* dark purple */
  color: #ffffff;
  border-color: #444;
}

body.dark-mode li:hover {
  background-color: #29133d;
  color: #8FBC8F; /* optional: match your theme's green accent */
}

/* 🌙 Dark Mode - Nightcrawler Shop */
body.dark-mode #nightcrawlerShopContent {
  background-color: #1a1a1a;
  color: #fff;
}

/* 🌙 Dark Mode - Cosmetics Modal */
body.dark-mode #cosmeticsModal .modal-content {
  background-color: #1a1a1a;
  color: #fff;
}

/* 🌙 Dark Mode - Achievements Modal */
body.dark-mode #achievementsModal .modal-content {
  background-color: #1a1a1a;
  color: #fff;
}

/* 🌙 Dark Mode - Common modal buttons, excluding modal-close-button */
body.dark-mode .modal-content button:not(.modal-close-button),
body.dark-mode #nightcrawlerShopContent button:not(.modal-close-button) {
  background-color: #2a2a2a;
  color: #fff;
  border: none;
}

body.dark-mode .modal-content button:not(.modal-close-button):hover,
body.dark-mode #nightcrawlerShopContent button:not(.modal-close-button):hover {
  background-color: #3a3a3a;
}


body.dark-mode .modal-content button:hover,
body.dark-mode #nightcrawlerShopContent button:hover {
  background-color: #3a3a3a;
}

/* Optional: Cosmetic skin previews contrast */
body.dark-mode .skin-preview {
  background-color: #2a2a2a;
  color: #fff;
}
/* 🌙 Dark Mode - Locked Achievement Entries */
body.dark-mode .achievement-entry {
  background-color: #2a2a2a;
  color: #ccc;
  border-color: #444;
}

/* Make sure <em> and <small> inside locked achievements are readable too */
body.dark-mode .achievement-entry em,
body.dark-mode .achievement-entry small {
  color: #aaa;
}

/* 🌙 Scrollbar styling for dark mode (Edge, Chrome, Safari) */
body.dark-mode .achievement-scroll-area::-webkit-scrollbar {
  width: 10px;
}

body.dark-mode .achievement-scroll-area::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 6px;
}

body.dark-mode .achievement-scroll-area::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 6px;
  border: 2px solid #1a1a1a;
}

body.dark-mode .achievement-scroll-area::-webkit-scrollbar-thumb:hover {
  background: #666;
}
/* About Modal Specific Styles */
.about-modal-content {
  text-align: center;
  padding: 30px;
}

.about-modal-content h1 {
  font-size: 36px;
  margin-bottom: 5px;
}

.about-version {
  font-size: 12px;
  color: #777;
  margin-top: -5px;
  margin-bottom: 20px;
}

.about-modal-content h3 {
  font-size: 20px;
  margin-bottom: 20px;
  color: #4a734a;
}

.about-blurb {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 30px;
  color: #333;
}

body.dark-mode .about-blurb {
  color: #ccc;
}

body.dark-mode .about-version {
  color: #aaa;
}
button.close-modal-button {
  background-color: #8FBC8F;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  width: 100%;
  margin-top: 20px;
  transition: background-color 0.2s ease;
}

button.close-modal-button:hover {
  background-color: #7AA87A;
}

.modal-close-button {
  background-color: #8FBC8F;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  width: 100%;
  margin-top: 20px;
  transition: background-color 0.2s ease;
}

.modal-close-button:hover {
  background-color: #7AA87A;
}
body.dark-mode .modal-close-button,
body.dark-mode button.modal-close-button {
  background-color: #8FBC8F !important;
  color: white !important;
}

body.dark-mode .modal-close-button:hover,
body.dark-mode button.modal-close-button:hover {
  background-color: #7AA87A !important;
}body.dark-mode button.close-modal-button,
body.dark-mode .close-modal-button {
  background-color: #8FBC8F !important;
  color: white !important;
}

body.dark-mode button.close-modal-button:hover,
body.dark-mode .close-modal-button:hover {
  background-color: #7AA87A !important;
}

body.dark-mode #changelogArticle::-webkit-scrollbar {
  width: 10px;
}

body.dark-mode #changelogArticle::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 6px;
}

body.dark-mode #changelogArticle::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 6px;
  border: 2px solid #1a1a1a;
}

body.dark-mode #changelogArticle::-webkit-scrollbar-thumb:hover {
  background: #666;
}

#openSettingsButton {
  position: fixed;
  top: 10px;
  left: 10px;
  background-color: #8FBC8F;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 0 4px rgba(0,0,0,0.2);
  transition: background-color 0.2s ease;
}

#openSettingsButton:hover {
  background-color: #7AA87A;
}


#openSettingsButton:hover {
  background-color: #7AA87A;
}
#openSettingsButton,
#openAchievementsButton {
  font-family: inherit;
  font-size: 14px;
  color: white;
  background-color: #8FBC8F;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 4px rgba(0,0,0,0.2);
  transition: background-color 0.2s ease;
}

#openSettingsButton:hover,
#openAchievementsButton:hover {
  background-color: #7AA87A;
}
body.dark-mode #openSettingsButton,
body.dark-mode #openAchievementsButton {
  background-color: #4a734a;
  color: white;
}

.purchase-multiplier {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 10px;
}

.multiplier-button {
  background-color: #8FBC8F;
  color: white;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.multiplier-button:hover {
  background-color: #7AA87A;
}

.multiplier-button.selected {
  background-color: #4a3966; /* Dark purple */
}

body.dark-mode .multiplier-button {
  background-color: #4a734a;
}

body.dark-mode .multiplier-button:hover {
  background-color: #3a5a3a;
}

body.dark-mode .multiplier-button.selected {
  background-color: #8FBC8F; /* Keep the selected one green for contrast in dark mode */
}
.upgradeBox .upgrade-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.purchase-multiplier {
  display: flex;
  gap: 6px;
}

.purchase-multiplier .multiplier-button {
  background-color: #8FBC8F;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 14px;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.purchase-multiplier .multiplier-button:hover {
  background-color: #7AA87A;
}

.purchase-multiplier .multiplier-button.selected {
  background-color: #4b2c5e; /* Dark purple selected */
}
li.unaffordable {
  opacity: 0.5;
  pointer-events: none;
  background-color: #eee;
  color: #aaa;


