/*--------------
  Global
---------------*/

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* {
  margin: 0 auto;
  padding: 0;
  border: none;
  box-sizing: border-box;
}

body {
  height: 100vh;
  font-family: 'Press Start 2P', cursive, sans-serif;
  background: linear-gradient(360deg, #1C1C1C 10%, #494949 360%);
  color: #8acc25;
}

/* Use a table to display the rules text */

td {
  font-size: 2em;
}

td:nth-child(1) {
    text-align: left;
}

td:nth-child(2) {
    text-align: right;
    padding-left: 4em;
}

/* Use flexbox for the main layout of the screen */

.flex {
  display: flex;
}

/* Styled 'weapon-button' as shown in the example here:
   https://www.w3schools.com/howto/howto_css_icon_buttons.asp
*/

.weapon-button {
  background-color: #05aa6d;
  /* Remove borders */
  border: none;
  border-radius: 5px;
  /* White text */
  color: white;
  /* Some padding */
  padding: 5px 15px;
  /* Set a font size */
  font-size: 16px;
  cursor: pointer;
}

/* Place "YOUR MOVE!" in a circle based on the example shown by Armand at
   https://stackoverflow.com/questions/4801181/vertically-and-horizontally-centering-text-in-circle-in-css-like-iphone-notific
*/

.circle {
  background: #527a16;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: sans-serif;
  font-size: 27px;
  color: black;
  text-align: center;
  margin-top: 4em;
}

/* Initial Form handling */

.form-container {
  display: flex;
  font-size: 90%;
}

.header-margin-for-form {
  margin: 2em 0;
  text-align: center;
  font-size: 100%;
}

.show-form {
  display: block;
  font-size: 75%;
}

.left-margin {
  margin-left: 1em;
}

/* Add some spacing to the 'challenge' text */

#challenge-text p {
  margin: 1em;
}

.playername-control {
  border: 2px solid #000;
  padding: 10px;
  padding: 4px 10px;
  border-radius: 4px;
  box-sizing: border-box;
  margin: 1em 1em;
  text-transform: capitalize;
  width: 25%;
}

/* Align the words 'Rounds' and 'Random' */

#align-rounds {
  margin: 0 1em 1em 28px;
}

#align-random {
  margin: 0 2em 0 2px;
  line-height: 2em;
}

/* Aligned the radio buttons horizontally as shown by Paulie_D at
   https://stackoverflow.com/questions/31145973/how-to-align-radio-buttons-horizontally-below-labels
*/

#rounds-radio-group .radio-wrap {
  display: inline-block;
}

#rounds-radio-group label {
  display: block;
  text-align: center;
  margin: 0 0.2em;
}

#rounds-radio-group input[type="radio"] {
  display: block;
  margin: 0.5em auto;
}

/* === End of Paulie_D code === */

input[type=submit],
.playagain-button {
  padding: 5px 15px;
  background: #6725cc;
  color: white;
  font-size: 140%;
  border: 0 none;
  cursor: pointer;
  border-radius: 5px;
}

input[type=submit] {
    margin: 2em auto;
}

.playagain-button {
  display: block;
  text-align: center;
}

/* Rules Text Handling */

.rules-container {
  font-family: "Krona One", Arial, Tahoma, sans-serif;
  color: #fff;
  text-align: center;
  font-size: 17px;
}

.rules-header {
  font-size: 2em;
}

#rules-part-2 {
  font-size: 16px;
}

.video-container {
  display: block;
  font-family: "Krona One", Arial, Tahoma, sans-serif;
  color: #fff;
  text-align: center;
  font-size: 0.875em;
}

/* Hide the game area to begin with */

.show-game {
  display: none;
}

.header-margin-for-game {
  margin-top: 1em;
  text-align: center;
}

.side-margins {
  margin: 0 20vw;
}

.column-centre-aligned {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1em;
}

/* Handle the length of the player's name */

.column-centre-aligned h2 {
  font-size: 100%;
}

/* This is how the image of each character/weapon will be shown */

img {
  width: 14vw;
  height: 14vw;
  object-fit: cover;
  object-position: top;
}

.hide-element {
  visibility: hidden;
}

.display-message {
  text-align: center;
  margin-top: 1em;
}

.final-score-message {
  text-align: center;
  margin: 2em;
  line-height: 2em;
}

/* No line and no blue colour */

.a, .a:link, a:visited, a {
  text-decoration: none;
  color: #8acc25;
}

.centre-error-message {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.error-message-style {
  padding: 16px;
  /* Lightgray */
  background-color: #d3d3d3;
  font-family: "Times New Roman", Times, serif;
  color: #000;
}

.centre-error-message h1,
.centre-error-message h2 {
  font-size: 100%;
}


/* ================= MEDIA QUERIES ================= */

@media (min-width: 960px) {

  .rules-container {
    font-size: 17px;
  }  

  td {
    font-size: 1.5em;
  }

  input[type=submit] {
    margin: 1em auto;
  }

  #lets-play-button {
    font-size: 2.8em;
  }  

  .final-score-message {
    font-size: 120%;
  }

}

@media (min-width: 768px) {
   
  .header-margin-for-form {
      margin: 1em 0;
  }

  .rules-container {
    font-size: 10px;
  }

  #lets-play-button {
    font-size: 2em;
  }
    
}

@media (max-width: 960px) {

  h1,
  h2 {
    font-size: 75%;
  }

  .header-margin-for-game {
    font-size: 110%;
  }

  /* Create more width */

  .side-margins {
    margin: 0 10vw;
  }

  #lets-play-button {
    margin: 1em auto;
  }   

}

@media (max-width: 840px) {

  img {
    width: 24vw;
    height: 24vw;
  }

  .playername-control {
    width: 30%;
  }

}

@media (max-width: 768px) {

  img {
    width: 34vw;
    height: 34vw;
    object-fit: cover;
    object-position: top;
  }

  .rules-container {
    font-size: 10px;
  }

  input[type=submit],
  .playagain-button {
    font-size: 3em;
  }

  /* Handle the length of the player's name */

  .column-centre-aligned h2 {
    font-size: 75%;
  } 

}

@media (max-width: 650px) {

  /* Handle the spacing of the weapon buttons */

  .flex {
    justify-content: space-between;
  }

  .weapon-button {
    margin: 1em 0;
    max-width: min-content;
    font-size: 75%;
  }

}

@media (max-width: 625px) {

    * {
      font-size: 84%;
    }
  
    h1,
    h2 {
        font-size: 160%;
    }

    .header-margin-for-form {
        font-size: 200%;
    }

    .show-form {
        font-size: 180%;
    }

    /* Align the words 'Rounds' and 'Random' */

    #align-rounds {
        margin-left: 12px;
    }

    #align-random {
        margin-left: -4px;
    }

    .rules-container * {
        font-size: 17px;
    }

    #rules-part-2 {
        font-size: 14px;
    }

}

@media (max-width: 540px) {

  /* Align the word 'Rounds' */
    
  #align-rounds {
    margin-left: 10px;
  }

  .rules-header {
    font-size: 150%;
  }
    
  table {
    width: 90%;
  }

  td:nth-child(1) {
    text-align: left;
    font-size: 80%;
  }

  td:nth-child(2) {
    text-align: right;
    padding: 0;
    font-size: 80%;
  }

  #lets-play-button {
    margin: 0 auto;
    font-size: 2em;
  }  

}

@media (max-width: 480px) {

  h1, 
  h2 {
    font-size: 150%;
  }

  .header-margin-for-form {
    font-size: 150%;
  }

  .show-form {
    font-size: 180%;
  }

  .rules-container {
    font-size: 17px;
  }
  
  .rules-header {
    font-size: 100%;
  }
  
}

@media (max-width: 415px) {

  #lets-play-button {
    margin: 0 auto;
    font-size: 1em;
  }

}

@media (max-width: 390px) {

  .form-container {
    font-size: 70%;
  }

  .rules-container * {
    font-size: 12px;
  }

  .rules-header {
    font-size: 12px;
  }

  #lets-play-button {
    margin: 0 auto;
    font-size: 0.7em;
  }

  .header-margin-for-game {
    font-size: 100%;
  }

  /* Handle the spacing of the weapon buttons on mobile phones */

  .flex {
    flex-wrap: wrap;
    justify-content: space-between;
  } 

  .weapon-button {
    font-size: 180%;
    padding: 5px 20px;
    flex: 0 0 100%;
    max-width: 80px;
  }

}

@media (max-width: 325px) {

  /* Handle the spacing of the weapon buttons on mobile phones */

  .weapon-button {
    font-size: 150%;
    max-width: 65px;
  }

  /* After testing with https://ui.dev/amiresponsive
     The YOUR MOVE! needs to be smaller
  */

  .circle {
    width: 90px;
    height: 90px;
    font-size: 18px;
  }

}

/* Handle Galaxy Fold */

@media (max-width: 280px) {

  .header-margin-for-game {
    font-size: 85%;
  }

}

/* MEDIA QUERIES REGARDING HEIGHT */

/* Handle Nest Hub: Height 600px */

@media (max-height: 601px) and (min-width: 460px) {

  .header-margin-for-form {
    font-size: 100%;
  }  

  .show-form p {
    margin: 0;
  }

  .rules-container {
    font-size: 75%;
  }

  #rules-part-2 {
    font-size: 200%;
  }

  input[type=submit] {
    margin: 1em auto;
  }

}
