:root {
  --primary-color: #1affd5;
  --secondary-color: #1a66ff;
  --accent-color: #ff66ff;
  --background-dark: #0a0a1a;
  --background-light: #14142b;
  --text-light: #e4e4f9;
  --text-dark: #a3a3bf;
}

/* General Styling */
body {
  margin: 0;
  padding: 0;
  font-family: 'Arial', sans-serif;
  color: var(--text-light);
  text-align: center;
  overflow-y: auto;
  background: linear-gradient(135deg, var(--background-dark), var(--background-light));
}

/* Loader Modal */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, var(--background-dark), var(--background-light));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  color: var(--text-light);
}

.loader.show {
  visibility: visible;
  opacity: 1;
}

/* Loader Design */
.loader {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.loaderSpinner {
  position: relative;
  width: 80px;
  height: 80px;
}

.spinnerCore {
  position: absolute;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border-radius: 50%;
  animation: corePulse 1.5s infinite ease-in-out;
}

.spinnerRings {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 5px solid rgba(255, 255, 255, 0.1);
  border-top: 5px solid var(--primary-color);
  border-right: 5px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}

.loader h2 {
  margin-top: 20px;
  font-size: 1.5rem;
  font-family: 'Orbitron', sans-serif;
  color: var(--text-light);
  animation: fadeIn 2s ease-in-out infinite;
}

/* Animations */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes corePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 15px var(--primary-color);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 0 30px var(--accent-color);
  }
}

@keyframes fadeIn {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
  canvas {
    display: block;
  }
  
  /* Intro Screen */
  #intro-screen {
    display: flex;
    height: 100vh;
    width: 100vw; /* Ensure it spans the entire viewport width */
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    color: #ffffff;
    text-align: center;
    overflow: hidden; /* Hide overflow content */
  }
  
  #intro-screen h1 {
    font-size: 2.5rem;
    margin-top: 20%;
    margin-bottom: 20px;
    color: #0004ff;
    text-shadow: 0 0 10px #4b0041, 0 0 20px #000838;
  }
  
  #intro-screen p {
    font-size: 1.2rem;
    margin-bottom: 20px;
  }
  
  #intro-screen button {
    font-size: 1.5rem;
    padding: 15px 25px;
    border: none;
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
  }
  
  #intro-screen button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px #218838, 0 0 20px #28a745;
  }
  
/* Floating Energy */
#floating-container {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 100;
  }
  
  .floating-energy {
    color: #4caf50;
    font-size: 1.5rem;
    font-weight: bold;
    animation: floatingEnergy 1s ease-out forwards;
    z-index: 9998; /* Ensure it appears above the button but below notifications */
  }
  
  @keyframes floatingEnergy {
    0% {
      transform: translateY(0);
      opacity: 1;
    }
    100% {
      transform: translateY(-50px);
      opacity: 0;
    }
  }
  
  /* App Styling */
  #app {
    max-width: 800px;
    margin: auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
  }
  
  header h1 {
    font-size: 2.5rem;
    color: #ffcc00;
    text-shadow: 0 0 5px #ff9900, 0 0 10px #ff9900;
  }
  
  header p {
    font-size: 1.2rem;
    margin: 10px 0 20px;
  }
  
  .highlighted {
    font-size: 3rem;
    font-weight: bold;
    color: #4caf50;
    text-shadow: 0 0 10px #4caf50, 0 0 20px #4caf50;
  }
  

  /* Prestige Section */
#prestige {
    background: linear-gradient(135deg, #1e1e1e, #2c3e50);
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
    border: 2px solid #333;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    color: white;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  
  #prestige:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 15px #ffcc00, 0 0 30px #ff9900;
  }
  
  #prestige h2 {
    color: #ffcc00;
    text-shadow: 0 0 5px #ff9900, 0 0 10px #ffcc00;
  }
  
  #prestige button {
    font-size: 1rem;
    padding: 10px 15px;
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    color: black;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
  }
  
  #prestige button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 10px #ffcc00, 0 0 20px #ff9900;
  }
  
  #prestige button:disabled {
    background: #555;
    color: #ccc;
    cursor: not-allowed;
  }
  
  /* Achievements */
  .achievement {
    background: #2c3e50;
    color: white;
    padding: 15px;
    margin: 10px;
    border-radius: 10px;
    border: 2px solid #4caf50;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  
  .achievement:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 15px #4caf50, 0 0 30px #66bb6a;
  }

/* Buttons */
.main-button, .prestige-button, .buy-button {
    font-size: 1.2rem;
    padding: 10px 15px;
    margin: 10px;
    border: none;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    z-index: 200; /* Added to ensure button is clickable */
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
  }
  
  .main-button:hover, .prestige-button:hover:not(:disabled), .buy-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 10px #0056b3, 0 0 20px #007bff;
  }
  .prestige-button:disabled {
    background: #555;
    cursor: not-allowed;
  }
  
  .buy-button:disabled {
    background: #616161;
    color: #ff0000;
    font-weight: bold;
    cursor: not-allowed;
  }
  

  .upgrade {
    background: linear-gradient(135deg, #1e1e1e, #2c3e50);
    color: white;
    padding: 15px;
    margin: 10px;
    border-radius: 10px;
    border: 2px solid #333;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  
  .upgrade:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 15px #007bff, 0 0 30px #0056b3;
  }
  
  .upgrade p {
    margin: 5px 0;
    font-size: 1rem;
  }
  
  .upgrade button {
    font-size: 1rem;
    padding: 10px 15px;
    margin-top: 10px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
  }
  
  .upgrade button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px #0056b3, 0 0 20px #007bff;
  }
  
/* Notifications */
#notifications-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    z-index: 9999;
    pointer-events: none;
  }
  
  .notification {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1e1e1e;
    color: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.3s ease-out, fadeOut 5s ease-in forwards;
    opacity: 0.95;
    z-index: 9999; /* Ensure notifications appear above everything */
    text-align: center; /* Center-align the text */
    min-width: 200px; /* Ensure the notification box has some width */
  }
  
  .notification.success {
    border-left: 6px solid #4caf50;
    background: linear-gradient(135deg, #43a047, #66bb6a);
  }
  
  .notification.info {
    border-left: 6px solid #2196f3;
    background: linear-gradient(135deg, #1e88e5, #42a5f5);
  }
  
  .notification.warning {
    border-left: 6px solid #ff9800;
    background: linear-gradient(135deg, #f57c00, #ffb74d);
  }
  
  .notification.error {
    border-left: 6px solid #f44336;
    background: linear-gradient(135deg, #e53935, #ef5350);
  }
  .notification.prestige {
    border-left: 6px solid #ffcd82;
    background: linear-gradient(135deg, #c9843f, #ffd596);
  }
  
  .notification p {
    margin: 0;
    flex-grow: 1;
    text-align: center;
    padding-left: 10px;
  }
  
  .notification .icon {
    font-size: 1.5rem;
    margin-right: 10px;
    color: white;
  }

  @keyframes slideDown {
    from {
      transform: translateY(-20px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 0.95;
    }
  }
  
  @keyframes fadeOut {
    to {
      opacity: 0;
      transform: translateY(-10px);
    }
  }

/* Footer Styling */
footer {
    background: linear-gradient(135deg, #1e1e1e, #2c3e50);
    color: #ffffff;
    padding: 15px;
    text-align: center;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.5);
    border-top: 2px solid #3e4e5e;
    margin-top: 20px; /* Creates separation from the main content */
    border-radius: 0 0 10px 10px; /* Matches app background's corners */
  }
  
  footer p {
    margin: 0;
    font-size: 0.9rem;
    color: #b0bec5;
  }
  
  footer p span {
    font-weight: bold;
    color: #ffcc00;
    text-shadow: 0 0 5px #ff9900;
  }
  
  footer .return-button {
    margin-top: 10px;
    display: inline-block;
    font-size: 1rem;
    padding: 10px 20px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
  }
  
  footer .return-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px #0056b3, 0 0 20px #007bff;
  }

/* Info Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }
  
  .modal-content {
    position: relative;
    background: #1e1e1e;
    color: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  }
  
  .modal-content h2 {
    margin-top: 0;
    color: #ffcc00;
  }
  
  .modal-content ul {
    text-align: left;
    margin: 10px 0;
    padding-left: 20px;
  }
  
  .modal-content p {
    margin: 10px 0;
  }
  
  .close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    background: transparent;
    border: none;
    outline: none;
    transition: color 0.2s ease-in-out;
  }
  
  .close-button:hover {
    color: #ffcc00;
  }

  .modal-content label {
    display: block;
    margin-top: 15px;
    font-size: 14px;
  }
  
  .modal-content input[type="range"] {
    width: 100%;
    margin: 5px 0;
  }
  
  pre {
    text-align: left;
    background: #272727;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
  }

  .achievement-effect {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 15px 30px;
    border-radius: 10px;
    animation: fadeInOut 3s ease-in-out;
    z-index: 10000;
  }
  
  @keyframes fadeInOut {
    0%, 100% {
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.9);
    }
    50% {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }
  }
  
  .event-positive {
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #4caf50, #81c784);
    color: white;
    font-size: 1.2rem;
    padding: 10px 20px;
    border-radius: 10px;
    animation: slideIn 3s ease-in-out;
    z-index: 10000;
  }
  
  .event-negative {
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f44336, #e57373);
    color: white;
    font-size: 1.2rem;
    padding: 10px 20px;
    border-radius: 10px;
    animation: slideIn 3s ease-in-out;
    z-index: 10000;
  }
  
  @keyframes slideIn {
    0% {
      opacity: 0;
      transform: translateX(-50%) translateY(-20px);
    }
    50% {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }
    100% {
      opacity: 0;
      transform: translateX(-50%) translateY(20px);
    }
  }
  
  #settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
  }
  
  .settings-container {
    position: relative;
    background: #1e1e1e;
    color: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  }
  
  .settings-container h2 {
    margin-bottom: 20px;
  }
  
  .settings-container label {
    display: block;
    margin: 10px 0 5px;
  }
  
  .settings-container input,
  .settings-container select {
    width: 100%;
    margin-bottom: 15px;
  }
  
  .close-button {
    background: #f44336;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
  }
  