* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 20px 15px 80px;
  background: linear-gradient(135deg, #8b0000, #b22222);
  color: #fff;
}

/* Title */
h2 {
  text-align: center;
  color: gold;
  margin-bottom: 20px;
  letter-spacing: 2px;
  font-weight: bold;
  text-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

/* Containers */
#modeSelection,
#mainCalc {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

/* Card */
.mode-selection,
.calc {
  background: #a30000;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border: 2px solid gold;
}

/* Mode buttons */
.mode-buttons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* Calculator grid (3 per row) */
.calc_button {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

/* General buttons */
button {
  width: 100%;
  padding: 18px 0;
  font-size: 18px;
  border-radius: 14px;
  border: none;
  font-weight: bold;
  background: linear-gradient(145deg, gold, #ffcc00);
  color: #8b0000;
  box-shadow: 0 4px 0 #b8860b;
  transition: all 0.15s ease;
}

button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #b8860b;
}

/* Special buttons full width */
.calc-btn {
  grid-column: span 3;
  background: linear-gradient(145deg, #00c853, #00e676);
  color: white;
  box-shadow: 0 4px 0 #1b5e20;
}

.clear-btn {
  grid-column: span 3;
  background: linear-gradient(145deg, #ff1744, #ff5252);
  color: white;
  box-shadow: 0 4px 0 #b71c1c;
}

/* Back button */
.back-btn {
  background: linear-gradient(145deg, gold, #ffcc00);
  margin-bottom: 10px;
}

/* Selected numbers */
#selectedNumbers {
  border: 2px solid gold;
  padding: 14px;
  border-radius: 12px;
  background: #7a0000;
  min-height: 50px;
  font-size: 16px;
  color: gold;
}

/* Results */
.results {
  margin-top: 20px;
}

#variantsOutput {
  border: 2px solid gold;
  padding: 12px;
  border-radius: 12px;
  background: #7a0000;
  max-height: 220px;
  overflow-y: auto;
  font-size: 14px;
  color: gold;
}

/* Hidden */
.hidden {
  display: none !important;
}

/* Fade animation */
.calc,
.mode-selection {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal Overlay */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(139, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

/* Modal Box */
.modal-content {
  background: #a30000;
  padding: 30px 25px;
  border-radius: 20px;
  border: 3px solid gold;
  text-align: center;
  width: 85%;
  max-width: 350px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  animation: popIn 0.3s ease;
}

/* Modal Title */
.modal-content h2 {
  color: gold;
  margin-bottom: 15px;
}

/* Modal Message */
#modalMessage {
  color: gold;
  font-size: 18px;
  margin-bottom: 20px;
}

/* Close Button */
.modal-close {
  background: linear-gradient(145deg, gold, #ffcc00);
  color: #8b0000;
  font-weight: bold;
}

/* Pop-in animation for modal */
@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Shake animation */
@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
  100% { transform: translateX(0); }
}

/* Glow effect */
.glow {
  box-shadow: 0 0 20px gold, 0 0 30px gold, 0 0 40px gold;
}

/* Confetti canvas */
#confettiCanvas {
  position: fixed;
  pointer-events: none;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
}

#donationModal img {
  max-width: 100%;   /* Don't exceed the modal width */
  height: auto;      /* Keep aspect ratio */
  border-radius: 12px; /* Optional: make it look nicer */
  margin: 15px 0;    /* Some spacing around it */
  display: block;    /* Center with auto margins if needed */
  margin-left: auto;
  margin-right: auto;
}
