body {
  font-family: 'Courier New', Courier, monospace; /* Mimics thermal printer font */
  background-color: #f4f4f4;
  color: #333;
  text-align: center;
  margin: 20px;
}

#webcam-container {
  margin: 20px auto;
  width: 300px; /* Fixed width for the container */
  height: 500px; /* Fixed height to match overlay proportions */
  overflow: hidden;
  border: 1px solid #333;
  background-color: #fff;
  position: relative; /* Needed for positioning child elements */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensures the video fills the container */
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1; /* Behind the overlay */
}

#overlay-image {
  width: 100%; /* Match the width of the container */
  height: 100%; /* Match the height of the container */
  position: absolute; /* Overlay on top of the video */
  top: 0;
  left: 0;
  z-index: 2; /* Above the video */
  pointer-events: none; /* Prevent interactions with the overlay */
}

button {
  padding: 10px 20px;
  font-size: 16px;
  font-family: 'Courier New', Courier, monospace;
  cursor: pointer;
  margin: 20px auto;
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 5px;
  display: inline-block;
}

button:hover {
  background-color: #555;
}

#fortune-container {
  overflow: hidden;
  white-space:normal;
  background-color: white;
  border: 1px solid #333;
  width: 350px;
  margin: 20px auto;
  padding: 5px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  text-align: center;
  font-family: monospace;
}

#fortune-text {
  white-space: normal; /* Ensure normal wrapping */
  word-wrap: break-word; /* Break long words to fit the container */
  overflow-wrap: break-word; /* Alternative for word breaking */
  word-break: break-word; /* Force long words to break */
  width: 100%; /* Ensure it fits within the container */
  max-width: 340px; /* Match the container width */
  overflow: hidden; /* Prevent overflow */
  padding: 10px; /* Add padding for readability */
  text-align: center; /* Center align text */
  font-size: 14px; /* Adjust font size */
  line-height: 1.5; /* Improve readability */
  box-sizing: border-box; /* Include padding in width calculation */
}


#ascii-art {
  display: block; /* Ensure it displays properly */
  margin-top: 20px; /* Add space between the fortune and the ASCII art */
  text-align: center; /* Center align the ASCII art */
  white-space: pre-wrap; /* Preserve ASCII formatting */
}



h1 {
  font-family: 'Courier New', Courier, monospace;
}

#play-again-button {
  padding: 10px 20px;
  font-size: 16px;
  font-family: 'Courier New', Courier, monospace;
  cursor: pointer;
  margin: 20px auto;
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 5px;
  display: none; /* Initially hidden */
}

#play-again-button:hover {
  background-color: #555;
}
