* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #1a1a1a;
  color: #ffffff;
  font-family: "Press Start 2P", system-ui;
  transition: background-color 0.4s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* State Classes */
.win-state {
  background-color: #2e7d32 !important;
}
.lose-state {
  background-color: #8b0000 !important;
}

.header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10rem;
  margin-top: 3rem;
}

.header h1 {
  font-size: 2.5rem;
}

.header p {
  color: #ffcc00;
}

#guess-input {
  padding: 1.5rem;
  font-size: 1.8rem;
  background: none;
  border: 4px solid #ffffff;
  color: white;
  text-align: center;
  outline: none;
  width: 10rem;
  font-family: inherit;
}

/* Golden border when clicking the input */
#guess-input:focus {
  border-color: #ffcc00;
}

.mystery-box {
  padding: 2rem;
  width: 100%;
  margin: 4rem 0;
  font-size: 4rem;
  text-align: center;
  border-top: 5px solid #ffcc00;
  border-bottom: 5px solid #ffcc00;
}

.container {
  display: flex;
  justify-content: center;
  gap: 8rem;
}

.message {
  margin-bottom: 2.3rem;
  color: #ffcc00;
}

.guess-section,
.results {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.check-btn,
.again {
  padding: 1rem 1.5rem;
  cursor: pointer;
  font-family: inherit;
  background-color: #ffffff;
  color: #1a1a1a;
  border: none;
}

.check-btn:hover,
.again:hover {
  background-color: #ffcc00;
}

.blink {
  animation: blinker 0.8s linear infinite;
}

@keyframes blinker {
  0% {
    color: #ffffff;
  }
  50% {
    color: transparent; /* Text disappears, border stays */
  }
  100% {
    color: #ffffff;
  }
}

/* Your existing mystery-box styles */
.mystery-box {
  padding: 2rem;
  width: 100%;
  margin: 4rem 0;
  font-size: 4rem;
  text-align: center;
  border-top: 5px solid #ffcc00; /* This stays solid now */
  border-bottom: 5px solid #ffcc00; /* This stays solid now */
  transition: all 0.2s ease;
}

/* --- Responsive Styles (1200px and below) --- */
@media (max-width: 1200px) {
  .header {
    position: relative; /* Now the header acts as the anchor */
    flex-direction: column;
    gap: 1rem;
    padding-top: 4rem; /* Space so title doesn't hit the button */
  }

  .again {
    position: absolute; /* Button becomes relative to the header corner */
    top: -1.5rem;
    left: -3.5rem;
  }

  .container {
    flex-direction: column;
    gap: 3rem;
    margin-top: 2rem;
  }

  .guess-section {
    order: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #guess-input {
    align-self: center;
    margin-bottom: 1rem;
  }

  .results {
    order: 2;
    text-align: center;
  }

  .mystery-box {
    margin: 2.5rem 0;
    font-size: 3.5rem;
  }
}
@media (max-width: 800px) {
  .again {
    top: -1rem;
    left: -2.5rem;
  }
}
/* Extra small screens (Phones) */
@media (max-width: 480px) {
  /* 1. Header Adjustments */
  .header {
    padding-top: 4.5rem; /* Space for the absolute 'Again' button */
  }

  .header h1 {
    font-size: 1.1rem; /* Your requested size */
    margin-bottom: 0.5rem;
  }

  .header p {
    font-size: 0.7rem; /* Shrink the "Between 1-20" text */
  }

  .again {
    padding: 0.6rem 1rem;
    font-size: 0.7rem;
    margin: 0.8rem;
  }

  /* 2. Mystery Box Adjustment */
  .mystery-box {
    margin: 1.5rem 0; /* Reduced margin */
    padding: 1.2rem;
    font-size: 2.5rem; /* Smaller number box */
    border-top-width: 3px;
    border-bottom-width: 3px;
  }

  /* 3. Container & Sections */
  .container {
    gap: 1.8rem; /* Tighter gap between input and results */
    margin-top: 1rem;
  }

  #guess-input {
    width: 8rem;
    padding: 1rem; /* Reduced padding for smaller screens */
    font-size: 1.4rem;
  }

  .check-btn {
    padding: 1rem; /* Keep padding equal to input */
    font-size: 0.8rem;
    width: 8rem;
  }

  /* 4. Results/Score Section */
  .results {
    gap: 0.8rem; /* Bring score lines closer together */
  }

  .results p {
    font-size: 0.8rem; /* Shrink "Message", "Score", and "Highscore" */
  }
}
