

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #F1EAFF;
  color: #333;
  overflow-x: hidden;
}

/* main menu page styles */
/* styles for the welcome heading on the main menu */
body > h1:first-child {
  text-align: center;
  color: #67729D;
  margin-top: 40px;
  padding: 0 20px;
  font-size: 2rem;
}

body > p:first-of-type {
  text-align: center;
  color: #333;
  font-size: 1.2rem;
  margin: 20px 0;
  padding: 0 20px;
}

#logout-btn {
  display: block;
  margin: 30px auto;
  padding: 12px 24px;
  background-color: #67729D;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: background-color 0.3s ease;
  min-height: 44px;
}

#logout-btn:hover {
  background-color: #5b6589;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  margin-top: 90px;
  padding: 20px;
  text-align: center;
}

.header {
  background-color: #E7BCDE;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.header h1 {
  color: #67729D;
  margin: 0;
}

#game-area {
  background-color: #BB9CC0;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  margin-bottom: 20px;
  color: #fff;
}

#word-display {
  font-size: 2em;
  letter-spacing: 0.2em;
  margin-bottom: 15px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

#hint-display {
  font-style: italic;
  margin-bottom: 20px;
}

#guess-form input[type="text"] {
  padding: 10px;
  font-size: 1em;
  width: 60px;
  text-align: center;
  border: 2px solid #67729D;
  border-radius: 8px;
  outline: none;
}

.btn {
  background-color: #67729D;
  color: #fff;
  border: none;
  padding: 10px 20px;
  margin-left: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.btn:hover {
  background-color: #5b6589;
}

#liv {
  position: fixed;
  top: 20px;
  right: 20px;
  font-size: 24px;
  z-index: 1000;
  padding: 5px 10px;
  background-color: rgba(241, 234, 255, 0.9);
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}



#message-display {
  margin: 10px 0;
  font-weight: bold;
}

#restart-btn {
  margin-top: 20px;
}

.hidden {
  display: none;
}

#talking-animal {
  position: fixed;
  bottom: 20px;
  left: 20px;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  z-index: 1000;
  max-width: calc(100vw - 40px);
}


#animal-image {
  width: 80px;
  height: auto;
  flex-shrink: 0;
}

#speech-bubble {
  background-color: #fff;
  border: 2px solid #BB9CC0;
  padding: 10px 15px;
  border-radius: 12px;
  color: #333;
  max-width: 300px;
  text-align: left;
  font-size: 0.95em;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  flex: 1;
  min-width: 0;
}

#speech-bubble::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 20px;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 10px solid #fff;
}


body.login-signup-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}


.form-container {
  background-color: #E7BCDE;
  padding: 40px 30px;
  border-radius: 16px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
  width: 320px;
  max-width: 90vw;
  text-align: center;
  margin: 20px;
}

.form-container h1 {
  color: #67729D;
  margin-bottom: 25px;
  font-weight: 700;
  font-size: 1.8rem;
}

.form-container form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 20px;
}

.form-container input[type="text"]{
      padding: 12px 15px;
  font-size: 1rem;
  border: 2px solid #67729D;
  border-radius: 10px;
  outline: none;
  text-align: center;
  transition: border-color 0.3s ease;
}
.form-container input[type="password"] {
  padding: 12px 15px;
  font-size: 1rem;
  border: 2px solid #67729D;
  border-radius: 10px;
  outline: none;
  text-align: center;
  transition: border-color 0.3s ease;
}


.btn {
  background-color: #67729D;
  color: #fff;
  font-weight: bold;
  padding: 12px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn:hover {
  background-color: #5b6589;
}

#formMessage {
  font-weight: bold;
  color: #BB9CC0;
  min-height: 1.2em;
}

/* styles for revealed letters in the word display */
/* uses light green background to show correct letters */
.letter-reveal {
  transition: background-color 0.5s ease;
  background-color: #d4f5d4;
  padding: 4px;
  margin: 2px;
  border-radius: 4px;
}


.letter-input {
  padding: 8px;
  font-size: 1em;
  min-width: 30px;
  width: auto;
  text-align: center;
  border: 2px solid #67729D;
  border-radius: 8px;
  outline: none;
  flex: 0 0 auto;
}


ul {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

ul li {
  width: 100%;
  max-width: 300px;
  text-align: center;
}

.btn-link {
  display: block;
  background-color: #67729D;
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.btn-link:hover {
  background-color: #5b6589;
}

.timer {
  font-size: 18px;
  font-weight: bold;
  color: #67729D;
  background-color: #F1EAFF;
  padding: 6px 12px;
  border-radius: 10px;
  margin-top: 10px;
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}


/* progress indicator styles */
/* shows how many words have been completed */
.progress {
  position: fixed;
  top: 60px;
  right: 20px;
  font-size: 16px;
  background-color: #E7BCDE;
  padding: 5px 10px;
  border-radius: 5px;
  z-index: 1000;
}

.completion-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.letter-input:focus {
  border-color: #E7BCDE;
  box-shadow: 0 0 5px rgba(231, 188, 222, 0.8);
  outline: none;
}

#talking-animal {
  transition: opacity 0.5s ease;
}

#word-display h2 {
  color: #67729D;
  margin-bottom: 10px;
}

#word-display p {
  font-size: 1.2em;
  margin-top: 0;
}


.homebutton {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

.homelink {
  display: block;
  padding: 8px 15px;
  background: #67729D;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-family: sans-serif;
}

.homelink:hover {
  background: #5b6589;
}

/* responsive design styles */
/* mobile first approach means base styles work for mobile */
/* then we add styles for larger screens */

/* small mobile devices */
/* styles for phones with screen width up to 480 pixels */
@media screen and (max-width: 480px) {
  .container {
    margin-top: 120px;
    padding: 15px;
  }

  .header {
    padding: 15px;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  #game-area {
    padding: 15px;
  }

  #word-display {
    font-size: 1.2em;
    letter-spacing: 0.1em;
    gap: 2px;
  }

  .letter-input {
    padding: 6px;
    font-size: 0.9em;
    min-width: 25px;
  }

  .letter-reveal {
    padding: 2px;
    margin: 1px;
    font-size: 0.9em;
  }

  #liv {
    top: 10px;
    right: 10px;
    font-size: 16px;
    padding: 4px 8px;
  }

  .progress {
    top: 50px;
    right: 10px;
    font-size: 12px;
    padding: 4px 8px;
  }

  .timer {
    font-size: 14px;
    padding: 4px 8px;
    position: fixed;
    top: 80px;
    right: 10px;
    z-index: 1000;
  }

  #talking-animal {
    bottom: 10px;
    left: 10px;
    gap: 8px;
    flex-direction: column;
    align-items: flex-start;
  }

  #animal-image {
    width: 50px;
  }

  #speech-bubble {
    max-width: calc(100vw - 80px);
    font-size: 0.85em;
    padding: 8px 12px;
  }

  #speech-bubble::before {
    left: 20px;
    top: -10px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #fff;
    border-top: none;
  }

  .homebutton {
    bottom: 10px;
    right: 10px;
  }

  .homelink {
    padding: 6px 12px;
    font-size: 0.9em;
  }

  .form-container {
    padding: 30px 20px;
    width: calc(100vw - 40px);
  }

  .login-form {
    padding: 30px 20px;
    width: calc(100vw - 40px);
    max-width: 90vw;
  }

  .login-form h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }

  .form-container h1 {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }

  .btn {
    padding: 14px;
    font-size: 1rem;
    /* minimum height for touch friendly buttons */
    min-height: 44px;
  }

  .btn-link {
    padding: 14px 20px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #guess-form input[type="text"] {
    width: 50px;
    padding: 8px;
    font-size: 0.9em;
  }

  body.login-signup-page {
    padding: 20px;
    align-items: flex-start;
    padding-top: 40px;
  }

  ul li {
    max-width: 100%;
  }

  #hint-display {
    font-size: 0.9em;
    padding: 0 10px;
  }

  #message-display {
    font-size: 0.9em;
    padding: 0 10px;
  }

  .completion-options {
    flex-direction: column;
    align-items: stretch;
  }

  .completion-options .btn {
    width: 100%;
    margin: 5px 0;
  }

  body > h1:first-child {
    font-size: 1.5rem;
    margin-top: 20px;
  }

  body > p:first-of-type {
    font-size: 1rem;
    margin: 15px 0;
  }

  #logout-btn {
    margin: 20px auto;
    width: calc(100% - 40px);
    max-width: 300px;
  }
}

/* medium mobile devices */
/* styles for larger phones and small tablets */
/* screen width between 481 and 768 pixels */
@media screen and (min-width: 481px) and (max-width: 768px) {
  .container {
    margin-top: 100px;
    padding: 18px;
  }

  #word-display {
    font-size: 1.5em;
    letter-spacing: 0.15em;
  }

  .letter-input {
    min-width: 28px;
    padding: 7px;
  }

  #liv {
    font-size: 20px;
    padding: 5px 8px;
  }

  .progress {
    font-size: 14px;
  }

  .timer {
    font-size: 16px;
  }

  #animal-image {
    width: 60px;
  }

  #speech-bubble {
    max-width: 250px;
  }

  .form-container {
    width: 90%;
    max-width: 400px;
  }

  .login-form {
    width: 90%;
    max-width: 400px;
  }

  body > h1:first-child {
    font-size: 1.8rem;
  }

  body > p:first-of-type {
    font-size: 1.1rem;
  }
}

/* tablet devices */
/* styles for tablets with screen width between 769 and 1024 pixels */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .container {
    max-width: 90%;
    margin-top: 100px;
  }

  #word-display {
    font-size: 1.8em;
  }

  #talking-animal {
    gap: 12px;
  }

  #animal-image {
    width: 70px;
  }
}

/* large screen devices */
/* styles for desktop computers and large tablets */
/* ensures elements do not spread too far apart */
@media screen and (min-width: 1200px) {
  .container {
    max-width: 900px;
  }

  #word-display {
    font-size: 2.2em;
  }
}

/* landscape orientation styles */
/* special adjustments for mobile devices in landscape mode */
/* when screen height is limited */
@media screen and (max-height: 600px) and (orientation: landscape) {
  .container {
    margin-top: 60px;
    padding: 10px;
  }

  #liv {
    top: 5px;
    right: 5px;
    font-size: 14px;
  }

  .progress {
    top: 35px;
    right: 5px;
    font-size: 11px;
  }

  .timer {
    top: 60px;
    right: 5px;
    font-size: 12px;
  }

  #talking-animal {
    bottom: 5px;
    left: 5px;
  }

  #animal-image {
    width: 40px;
  }

  #speech-bubble {
    font-size: 0.8em;
    padding: 6px 10px;
  }

  .homebutton {
    bottom: 5px;
    right: 5px;
  }

  body.login-signup-page {
    padding-top: 20px;
  }
}

/* touch device optimizations */
/* ensures buttons and inputs are large enough for touch interaction */
/* applies to devices that use touch instead of mouse */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .btn-link,
  .homelink {
    min-height: 44px;
    min-width: 44px;
  }

  .letter-input {
    min-height: 44px;
    font-size: 1.1em;
  }

  #guess-form input[type="text"] {
    min-height: 44px;
  }
}

/* new code for updating login signup UI */

/* for login */
.login-form {
  background-color: #E7BCDE;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
  width: 320px;
  max-width: 90vw;
  text-align: center;
  margin: 20px;
}

.login-form h2 {
  color: #67729D;
  margin-bottom: 25px;
  font-size: 1.8rem;
}

.login-form input {
  display: block;
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 15px;
  font-size: 1rem;
  border: 2px solid #BB9CC0;
  border-radius: 10px;
  background-color: #F1EAFF;
  outline: none;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.login-form input:focus {
  border-color: #67729D;
  box-shadow: 0 0 0 3px rgba(103, 114, 157, 0.2);
}

.login-form button {
  width: 100%;
  padding: 12px;
  background-color: #67729D;
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-top: 10px;
}

.login-form button:hover {
  background-color: #5b6589;
}

.login-form .form-footer {
  margin-top: 20px;
  color: #67729D;
}

.login-form a {
  color: #67729D;
  font-weight: bold;
  text-decoration: none;
}

.login-form a:hover {
  text-decoration: underline;
}

#login-message {
  margin-top: 15px;
  font-weight: bold;
  min-height: 1.2em;
  color: red;
}










/* for signup.. */
.form-container {
  background-color: #E7BCDE;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
  width: 320px;
  text-align: center;
  animation: fadeIn 0.5s ease-out;
}

.form-container h1 {
  color: #67729D;
  margin-bottom: 25px;
  font-size: 1.8rem;
}

#signup-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#signup-form input {
  padding: 12px 15px;
  font-size: 1rem;
  border: 2px solid #BB9CC0;
  border-radius: 10px;
  background-color: #F1EAFF;
  outline: none;
  transition: all 0.3s ease;
}

#signup-form input:focus {
  border-color: #67729D;
  box-shadow: 0 0 0 3px rgba(103, 114, 157, 0.2);
}

#signup-form button {
  background-color: #67729D;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-top: 5px;
}

#signup-form button:hover {
  background-color: #5b6589;
}

#signup-message {
  min-height: 20px;
  margin: 15px 0;
  font-weight: bold;
  color: #67729D;
}

.form-container p {
  color: #67729D;
}

.form-container a {
  color: #67729D;
  font-weight: bold;
  text-decoration: none;
  transition: color 0.3s ease;
}

.form-container a:hover {
  color: #5b6589;
  text-decoration: underline;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}



/* media queries for smaller screens */
@media (max-width: 600px) {
  .container {
    margin-top: 80px;
  }

  #word-display {
    font-size: 1.5rem;
    letter-spacing: 0.1em;
  }

  .letter-input {
    width: 25px;
    font-size: 1rem;
  }

  #talking-animal {
    flex-direction: column;
    align-items: center;
  }

  #speech-bubble {
    max-width: 100%;
  }

  #liv, #prog, #timer-display {
    position: static;
    margin-bottom: 10px;
    display: inline-block;
  }
}

@media (max-width: 400px) {
  #word-display {
    font-size: 1.2rem;
  }

  .letter-input {
    width: 20px;
    padding: 5px;
  }

  .btn {
    padding: 8px 15px;
    font-size: 0.9rem;
  }
}
