/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Courier New", monospace;
  background-color: #ffffff;
  color: #171717;
  line-height: 1.6;
}

.main-container {
  min-height: 100vh;
  background-color: #ffffff;
}

/* Game Section */
.game-section {
  position: relative;
  height: 60vh;
  width: 100%; 
  background-color: #9f4e9e;
  display: flex;
  flex-direction: column;
  border-bottom: 2px solid #eee;
}

.game-canvas {
  touch-action: none;
  image-rendering: pixelated;
  max-width: 100%;
  max-height: 60vh;
  cursor: pointer;
  background: #f4f6f0; /* Sky blue background */
  -webkit-tap-highlight-color: transparent; /* Remove blue tap highlight on mobile */
  -webkit-touch-callout: none; /* Disable callout on iOS */
  -webkit-user-select: none; /* Disable text selection */
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
} 

/* Overlay screens */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.hidden {
  display: none !important;
}

/* Menu Screen */
.menu-screen {
  background: linear-gradient(to bottom, #e0f2fe, #f0f9ff);
  background-color: rgba(255, 255, 255, 0.9);
}

.game-title {
  font-size: 3rem;
  font-weight: bold;
  color: #475569;
  margin-bottom: 1.5rem;
  text-align: center;
  font-family: "Courier New", monospace;
}

.start-button {
  width: 100%;
  max-width: 300px;
  background-color: #9f4e9e;
  color: white;
  font-weight: bold;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-size: 1.25rem;
  border: none;
  margin-bottom: 1.5rem;
  cursor: pointer;
  transition: background-color 0.2s;
  font-family: "Courier New", monospace;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

.start-button:hover {
  background-color: #a0329e;
}

.instructions {
  text-align: center;
}

.instructions p {
  color: #64748b;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
  font-family: "Courier New", monospace;
}

/* formButton Screen */
.game-over-screen {
  text-align: center;
  background-color: rgba(0, 0, 0, 0.7);
}

.game-over-title {
  font-size: 4rem;
  font-weight: bold;
  color: white;
  margin-bottom: 1rem;
  font-family: "Courier New", monospace;
}

.final-score {
  font-size: 1.25rem;
  color: white;
  margin-bottom: 0.5rem;
  font-family: "Courier New", monospace;
}

.encouragement {
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
  font-family: "Courier New", monospace;
}

.encouragement.good {
  color: #fb923c;
}

.encouragement.try-again {
  color: #f87171;
}

.restart-button {
  background-color: #2563eb;
  color: white;
  font-weight: bold;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-size: 1.25rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  font-family: "Courier New", monospace;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

.restart-button:hover {
  background-color: #1d4ed8;
}

.form-button {
  background-color: #9f4e9e;
  color: white;
  font-weight: bold;
  padding: 1rem 2.5rem;
  margin-bottom: 1.25rem;
  border-radius: 0.75rem;
  font-size: 1.8rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  font-family: "Courier New", monospace;
  margin-top: 0.75rem;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.form-button:hover {
  background-color: #a0329e;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.4);
}

/* Game UI */
.game-ui {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.score-display {
  position: absolute;
  top: 1rem;
  right: 1rem;
  text-align: right;
}

.current-score {
  color: #374151;
  font-size: 1.125rem;
  font-weight: bold;
  font-family: "Courier New", monospace;
}

.high-score {
  color: #6b7280;
  font-size: 0.875rem;
  font-family: "Courier New", monospace;
}

.game-info {
  position: absolute;
  top: 1rem;
  left: 1rem;
}

.speed-display,
.time-display {
  color: #475569;
  font-size: 0.75rem;
  font-family: "Courier New", monospace;
}

.game-instructions {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.game-instructions p {
  font-size: 0.75rem;
  color: #6b7280;
  font-family: "Courier New", monospace;
}

/* Form Section */
.form-section {
  width: 100%;
  min-height: 100vh;
  background-color: #f3f4f6;
  display: flex;
  flex-direction: column;
}

.form-iframe {
  width: 100%;
  height: 180vh;
  border: none;
  background-color: #f3f4f6;
  overflow: visible;
}

/* Responsive Design */
@media (max-width: 768px) {
  .game-title {
    font-size: 2rem;
  }

  .game-over-title {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 2rem;
  }

  .start-button,
  .restart-button {
    font-size: 1rem;
    padding: 0.625rem 1.5rem;
  }

  .form-button {
    font-size: 1.75rem;
    padding: 0.75rem 2rem;
  }

  .instructions p {
    font-size: 0.75rem;
  }
}
