#kofiLinkContainer {
  text-align: center;
  margin-top: 20px;
}

.kofi-button {
  display: inline-block;
  background-color: #FF5E5B;
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 16px;
  text-decoration: none;
  font-weight: bold;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.kofi-button:hover {
  background-color: #e14b49;
  transform: translateY(-2px);
}
#kofiLinkContainer {
  text-align: center;
  margin-top: 20px;
}

.kofi-button {
  display: inline-block;
  background-color: #382c52;
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 16px;
  font-family: inherit;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 0 4px rgba(0,0,0,0.2);
  transition: background-color 0.2s ease;
}

.kofi-button:hover {
  background-color: #4a3966;
}

/* Tab Buttons */
.tab-buttons button {
  background: linear-gradient(to bottom right, #f5c6d0, #ffeff4);
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-family: 'Arial', sans-serif;
  font-weight: bold;
  font-size: 12px;
  color: #3a3a3a;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-buttons button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.tab-buttons button.selected {
  background: linear-gradient(to bottom right, #ffb6c1, #f08ca3);
  color: #fff;
}

.tab-buttons {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 4px;
  margin-bottom: 12px;
  overflow-x: auto;
}

/* Wormpedia Entry */
.wormpedia-entry {
  background: #fff;
  border: 1px solid #ddd;
  padding: 14px;
  margin: 8px 0;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.wormpedia-entry h3 {
  margin: 0;
  font-size: 18px;
}

.wormpedia-entry .tooltip {
  font-style: italic;
  font-size: 13px;
  color: #666;
}

/* Modal Styling */
#wormpediaModal .modal-content {
  background: white;
  padding: 20px;
  width: 90%;
  max-width: 600px;
  height: 80vh;
  overflow-y: auto;
  border-radius: 10px;
  position: relative;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

#wormpediaContent {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 6px;
  margin-top: 15px;
}

/* Close Button */
#closeWormpediaButton {
  margin-top: 20px;
  background-color: #8FBC8F;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 16px;
  width: 100%;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#closeWormpediaButton:hover {
  background-color: #7AA87A;
}

/* ============================
   DARK MODE SUPPORT
   ============================ */
body.dark-mode #wormpediaModal .modal-content {
  background-color: #1e1e1e;
  color: #f0f0f0;
  border: 1px solid #333;
}

body.dark-mode .wormpedia-entry {
  background: #2a2a2a;
  border: 1px solid #444;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

body.dark-mode .wormpedia-entry .tooltip {
  color: #ccc;
}

body.dark-mode .tab-buttons button {
  background: linear-gradient(to bottom right, #333, #444);
  color: #eee;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

body.dark-mode .tab-buttons button.selected {
  background: linear-gradient(to bottom right, #ff6b8b, #bb3c4f);
  color: #fff;
}

body.dark-mode #closeWormpediaButton {
  background-color: #556b2f;
}

body.dark-mode #closeWormpediaButton:hover {
  background-color: #6b8f3a;
}

/* Dark Scrollbars */
body.dark-mode #wormpediaContent::-webkit-scrollbar {
  width: 10px;
}
body.dark-mode #wormpediaContent::-webkit-scrollbar-track {
  background: #1e1e1e;
}
body.dark-mode #wormpediaContent::-webkit-scrollbar-thumb {
  background-color: #444;
  border-radius: 6px;
  border: 2px solid #1e1e1e;
}

/* Firefox Scrollbar */
body.dark-mode #wormpediaContent {
  scrollbar-width: thin;
  scrollbar-color: #444 #1e1e1e;
}
.effect-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

.effect-preview {
  background-color: #f0f0f0;
  border: 2px solid transparent;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: border 0.3s, box-shadow 0.3s;
}

.effect-preview.active {
  border-color: #8FBC8F;
  box-shadow: 0 0 10px #8FBC8F;
}

body.dark-mode .effect-preview {
  background-color: #2a2a2a;
  color: white;
}
#effectToggleContainer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}
@media (min-width: 400px) {
  #effectToggleContainer {
    grid-template-columns: repeat(3, 1fr);
  }
}
@keyframes shimmer {
  0% { opacity: 1; filter: brightness(1); }
  50% { opacity: 0.85; filter: brightness(1.4); }
  100% { opacity: 1; filter: brightness(1); }
}

.particle.gold {
  animation: shimmer 1.2s infinite ease-in-out;
}

/* Add to your global stylesheet */
@keyframes shimmerTwinkle {
  0%, 100% {
    opacity: 1;
    filter: drop-shadow(0 0 2px #f6e27f);
  }
  50% {
    opacity: 0.5;
    filter: drop-shadow(0 0 6px #fff9c4);
  }
}

.particle.gold {
  background-color: #f6e27f !important; /* Pale gold */
  animation: shimmerTwinkle 1.4s infinite ease-in-out;
  box-shadow: 0 0 6px rgba(255, 255, 200, 0.7);
  border-radius: 3px;
}
@keyframes ghostFade {
  from {
    opacity: 0.2;
  }
  to {
    opacity: 0.7;
  }
}
body.bone-grunt-active.dark-mode #gruntButton {
  background: linear-gradient(to bottom, #fefefe, #cccccc);
  color: #222;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  border: 2px solid #aaa;
}
.particle.gummy {
  width: 40px;
  height: 8px;
  border-radius: 10px;
  background: linear-gradient(to right, yellow 50%, blue 50%);
  animation: gummyWiggle 1.6s ease-in-out infinite;
  box-shadow: 0 0 3px rgba(0,0,0,0.2);
}

@keyframes gummyWiggle {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(3deg); }
}
.effect-preview .label {
  color: #333 !important;
}
.particle.cyber {
  background: linear-gradient(90deg, #00f7ff 0%, #c600ff 100%);
  box-shadow: 0 0 8px #0ff, 0 0 12px #c6f;
  border-radius: 6px;
  animation: cyberPulse 1.2s infinite alternate;
}

@keyframes cyberPulse {
  0% { filter: brightness(1) drop-shadow(0 0 2px #0ff); }
  100% { filter: brightness(1.5) drop-shadow(0 0 6px #0ff); }
}
.particle.cyber {
  background: linear-gradient(to right, black, #39ff14);
  box-shadow: 0 0 6px #39ff14;
  filter: brightness(1.2);
  border-radius: 3px;
  position: relative;
  image-rendering: pixelated;
  z-index: 998;
}

/* Binary digits that float up */
.cyber-binary {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #39ff14;
  font-family: monospace;
  animation: floatUpBinary 0.8s ease-out forwards;
  opacity: 0.8;
}

@keyframes floatUpBinary {
  0% {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) translateY(-20px);
    opacity: 0;
  }
}
#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 997; /* behind UI, ahead of dirt */
}
#profileModal {
  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;
  animation: fadeInTop 0.3s ease-out forwards;
}

#profileModal .modal-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  text-align: center;
  display: flex;
  flex-direction: column;
  animation: slideInFromRight 0.3s ease-out;
}

#profileModal input[type="text"] {
  padding: 10px;
  font-size: 16px;
  border-radius: 6px;
  border: 1px solid #ccc;
  margin: 10px 0;
  width: 100%;
}

#profileModal button {
  background-color: #8FBC8F;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
}

#profileModal button:hover {
  background-color: #7AA87A;
}
body.dark-mode #profileModal .modal-content {
  background-color: #1a1a1a;
  color: #fff;
}

body.dark-mode #profileModal input[type="text"] {
  background-color: #2a2a2a;
  color: #fff;
  border: 1px solid #444;
}
#profileModal .modal-content {
  box-sizing: border-box;
}

#profileModal input[type="text"] {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}
.leaderboard-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
}

.leaderboard-tab {
  padding: 8px 16px;
  border-radius: 6px;
  background-color: #8FBC8F;
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.leaderboard-tab:hover {
  background-color: #7AA87A;
}

.leaderboard-tab.active {
  background-color: #4a734a;
}

#leaderboardContent {
  text-align: left;
  max-height: 400px;
  overflow-y: auto;
}

.leaderboard-entry {
  padding: 6px 0;
  border-bottom: 1px solid #eee;
  font-size: 16px;
}

.leaderboard-entry span {
  font-weight: bold;
  color: #4a734a;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

#gameContainer {
  height: 100%;
  display: flex;
  flex-direction: column;
}

