/* 1. Variables & Setup */
:root {
  --primary-blue: #14a053;
  --bg-pink: #1b372b;
  --white: #ffffff;
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

/* 2. Layout */
body {
  display: flex;
  align-items: center;      /* Centers horizontally */
  justify-content: center;   /* Centers vertically */
  flex-direction: column;
  
  /* These two lines are the fix */
  height: 100vh;            /* Forces body to take full screen height */
  margin: 0;                /* Removes default browser margins */
  
  background: var(--bg-pink);
  padding: 20px;
  overflow: hidden;         /* Prevents accidental scrolling */
}

/* 3. Typography & Titles */
h1 {
  /* Using clamp to scale font between 1.2rem and 1.8rem based on screen size */
  font-size: clamp(1.2rem, 5vw, 1.8rem); 
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 0.8rem 2rem;
  color: var(--primary-blue);
  background-color: var(--white);
  border-radius: 50px;
  box-shadow: var(--shadow);
  width: auto;
  max-width: 90%; /* Keeps it from hitting screen edges on mobile */
}

/* 4. Main Game Container */
.container {
  text-align: center;
  padding: 1.5rem; /* Reduced slightly for mobile comfort */
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow);
  width: 100%;
  /* This is the key: it stays 400px on desktop but shrinks to 100% on mobile */
  max-width: 400px; 
}

.container h2 {
  font-size: clamp(1rem, 4vw, 1.25rem);
  color: var(--primary-blue);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.container .guess {
  color: var(--primary-blue);
  font-size: 1.1rem;
  margin: 0.8rem 0;
  min-height: 1.5rem; /* Prevents container from jumping when text appears */
}

.container .chances {
  color: #555;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

/* 5. Form Elements */
.container input {
  font-size: 1.2rem;
  padding: 0 1rem;
  text-align: center;
  width: 100%;
  height: 50px;
  margin: 1rem 0;
  border: 2.5px solid #ddd;
  border-radius: 8px;
  outline: none;
  transition: var(--transition);
  /* Prevents iOS from zooming in on input focus */
  appearance: none; 
}

.container input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 8px rgba(20, 70, 160, 0.2);
}

input:disabled {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

/* Hiding Spinners */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* 6. Buttons */
.checkBtn {
  font-size: 1.1rem;
  width: 100%;
  margin: 1rem 0;
  padding: 12px;
  color: var(--white);
  background: var(--primary-blue);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
  /* Ensures easy tapping on mobile (Minimum touch target size) */
  min-height: 48px; 
}

.checkBtn:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 15px rgba(20, 70, 160, 0.3);
}

.checkBtn:active {
  transform: scale(0.98);
}

/* 7. Small Screen Adjustments */
@media (max-width: 350px) {
  .container {
    padding: 1rem;
  }
  h1 {
    padding: 0.6rem 1.5rem;
  }
}