body {
  overflow-x: hidden;
  font-family: 'Chelsea Market', sans-serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url('img/paper-texture.jpg');
  background-size: cover;
  background-position: center;
  box-sizing: border-box; /* fixed typo */
}
    
.game {
  text-align: center;
  padding: 1.5rem 2rem;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  margin: 0 auto;
  box-sizing: border-box;
}

.row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
  flex-wrap: wrap; /* keeps inputs from squishing */
}

.row input {
  flex: 1;
}

#letterInput {
  width: 50%;
}

#guessBtn {
  white-space: nowrap;
}

#resetBtn {
  margin: 0 auto;
  display: block;
}

h1 {
  margin: 0 0 1rem 0;
  font-size: 2.3rem;
  letter-spacing: 6px;
  text-shadow: 1px 1px #eee;
  border-bottom: 2px dashed #333;
  display: inline-block;
  padding-bottom: 0.5rem;
}

#wordDisplay {
  font: 700 2rem/1 monospace;
  letter-spacing: 0.4rem;
  margin: 1rem 0;
}

#message {
  font-size: 1.3rem;
  margin: 1rem 0;
  padding: 2%;
  color: #222;
  min-height: 1.5rem;
  font-style: italic;
}

.label {
  font-size: 1.2rem;
}

.row-label {
  font-size: 1.3rem;
  padding: 4%;
}

/* Hangman drawing */
#hangman {
  margin: 20px auto;
  width: 200px;
  max-width: 100%;
  height: 250px;
  position: relative;
}

.gallows {
  position: absolute;
  width: 120px;
  height: 210px;
  border-left: 5px solid black;
  border-top: 5px solid black;
  left: 20px;
  top: 0;
}

.rope {
  position: absolute;
  width: 2px;
  height: 30px;
  border-left: 4px solid black;
  top: 0;
  left: 135px;
}

.part {
  display: none;
  position: absolute;
  background: black;
}

.head {
  width: 40px;
  height: 40px;
  border: 4px solid black;
  border-radius: 50%;
  top: 30px;
  left: 115px;
  background: transparent;
}

.body {
  width: 4px;
  height: 62px;
  background: black;
  top: 77px;
  left: 135px;
}

.arm-left,
.arm-right {
  width: 4px;
  height: 45px;
  background: black;
  top: 90px;
}

.arm-left { 
  left: 134px;
  transform: rotate(30deg);
  transform-origin: top center;
} 

.arm-right {
  left: 135px;
  transform: rotate(-30deg);
  transform-origin: top center;
}

.leg-left,
.leg-right {
  width: 4px;
  height: 55px;
  background: black;
  top: 135px;
}

.leg-left {
  left: 135px;
  transform: rotate(15deg);
  transform-origin: top center;
}

.leg-right {
  left: 135px;
  transform: rotate(-15deg);
  transform-origin: top center;
}

/* Inputs & Buttons */
input, button {
  font-family: inherit;
  font-size: 1.3rem;
  padding: 0.8rem;
  margin: 0.2rem;
  border-radius: 6px;
  border: 2px dashed #333;
  background: #fafafa;
  cursor: pointer;
  transition: all 0.2s;
}

input:focus {
  outline: none;
  background: #fff;
  border-color: #000;
}

button:hover {
  background: #f0f0f0;
  transform: scale(1.05);
}

/* MOBILE QUERIES */
@media (max-width: 600px) {
  h1 {
    font-size: 2rem;
    letter-spacing: 2px;
  }

  #wordDisplay {
    font-size: 1.7rem;
    letter-spacing: 0.15rem;
    padding-bottom: 2%;
  }

  .game {
    padding: 1rem;
  }

  #message {
    font-size: 1.2rem; /* override only what changes */
  }

  .row {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 3%;
  }

  .row input {
    width: 100%;
    max-width: 250px;
    padding: 3%;
  }

  .row button {
    width: 40%;
    min-width: 120px;
    padding: 4%;
    font-size: 1rem;
  }

  #hangman {
    transform: scale(1);
    transform-origin: top center;
    margin: 10px auto;
  }

  input, button {
    font-size: 0.9rem; /* more reasonable than 0.4rem */
    padding: 0.3rem;
  }

  .row-label {
    font-size: 1rem;
  }
}

/* TABLET QUERIES */
@media (min-width: 601px) and (max-width: 900px) {
  h1 {
    font-size: 3.2rem;
    letter-spacing: 4px;
  }

  #wordDisplay {
    font-size: 2rem;
    letter-spacing: 0.25rem;
  }

  .game {
    padding: 1.5rem;
    max-width: 700px;
  }

  #message {
    font-size: 1.5rem;
  }

  #hangman {
    width: 170px;
    height: 220px;
  }

  input, button {
    font-size: 1.4rem;
    padding: 1rem;
  }

  .row {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }
}
