body {
  margin: 0;
  font-family: sans-serif;
  display: flex;
  justify-content: center;
  align-items: start;
  min-height: 100vh;
  background-color: black;
}

#game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

#main-canvas {
  background-color: rgb(1, 32, 1);
}

#answer-input {
  width: 200px;
  height: 40px;
  font-size: 24px;
  margin-top: 10px;
  text-align: center;
  background-color: black;
  color: gray;
  border-style: none;
}
#answer-input:focus {
  outline: none;
}

#start-screen {
  position: absolute;
  width: 100%;
  height: 100vh;
  background-color: black;
  z-index: 10;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#start-image {
  width: 200px;
  margin-bottom: 20px;
  animation: floatUpDown 3s ease-in-out infinite;
}

#start-button {
  font-size: 24px;
  padding: 10px 20px;
  cursor: pointer;
  background-color: rgb(1, 32, 1);
  border-style: none;
}

#game-over {
  position: absolute;
  top: 50%;
  font-size: 48px;
  color: red;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.8);
  padding: 20px 40px;
  border: 2px solid red;
  border-radius: 10px;
  display: none;
}

#end-screen {
  position: absolute;
  width: 100%;
  height: 100vh;
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background-color: black;
  z-index: 10;
}

#end-image {
  width: 200px;
  margin-bottom: 20px;
}

h1{
  color:darkgreen;
}
#countdown-bar-wrapper,
#end-countdown-bar-wrapper,
#win-countdown-bar-wrapper {
  width: 600px;
  height: 20px;
  background-color: #444;
  margin-bottom: 10px;
}

#countdown-bar {
  width: 100%;
  height: 100%;
  background-color: rgb(1, 32, 1);
  transition: width 0.05s linear;
}

#end-countdown-bar {
  width: 100%;
  height: 100%;
  background-color: rgb(1, 32, 1);
  transition: width 0.05s linear;
}

#game-box {
  padding: 40px;
  background-color: #000a00;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

#win-screen {
  position: absolute;
  width: 100%;
  height: 100vh;
  background-color: black;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

#win-image {
  max-width: 200px;
}

#win-countdown-bar {
  width: 100%;
  height: 100%;
  background-color: rgb(1, 32, 1);
  transition: width 0.05s linear;
}


@keyframes floatUpDown {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px); /* how high it floats */
  }
}

#start-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  flex-direction: row;
}

#toggle-mode-button {
  font-size: 18px;
  padding: 8px 16px;
  margin-top: 10px;
  cursor: pointer;
  background-color: rgb(1, 32, 1);
  border-style: none;
}

#settings-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: black;
  padding: 20px;
  border-radius: 10px;
  color: white;
  box-shadow: 0 0 10px rgb(1, 32, 1);
  z-index: 1000;
}

.hidden {
  display: none;
}

#apply-settings,
#custom-settings,
#default-settings{
  background-color: rgb(1, 32, 1);
  border-style: none;
}

#mode-wrapper {
  position: relative;
  display: inline-block;
}

#settings-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: -48px; /* adjust spacing */
  font-size: 20px;
  padding: 8px;
  padding-top: 14px;
  width: 42px;
  border: none;
  border-radius: 6px;
  background-color: black;
  color: white;
  cursor: pointer;
}

#settings-popup input[type="number"]::-webkit-inner-spin-button,
#settings-popup input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
  background-color: black;
  border-color: gray;
  border-width: 1px;
  border-style:solid;
  color:rgb(1, 32, 1);
}

#settings-popup input[type="number"] {
  -moz-appearance: textfield;
  border: none;
  outline: none;
  background-color: black;
  border-color: gray;
  border-width: 1px;
  border-style:solid;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 16px;
  width: 100px;
  color:rgb(1, 32, 1);
}


#settings-header {
  cursor: move;
  background-color: black;
  padding: 8px;
  padding-top: 14px;
  margin: -20px -20px 10px -20px;
  border-radius: 10px 10px 0 0;
  font-weight: bold;
  user-select: none;
  color: darkgreen;
}

label {
  color: darkgreen;
}

#input-spawn-delay,
#input-falling-speed,
#input-number-equations{
  background-color: rgb(1, 32, 1);
  color:white;
}

.close-button {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #666;
}

.close-button:hover {
  color: #000;
}

#settings-close{
  color: darkgreen;
}
#settings-close:hover{
  color: green;
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background-color: black;
  border: 1px solid darkgreen;
  cursor: pointer;
  position: relative;
}

/* Dark green checkmark for 16x16 size */
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 4px;
  width: 4px;
  height: 8px;
  border: solid darkgreen;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
