:root {
  /* Custom Colors */
  --black: #000;
  --dark-gray: #434446;
  --jasmyn-pink: #ff9d8d;

  --fall-sky: #5b6d7f;
  --fall-clouds: #5b646f;
  --fall-twilight-sun: #ffefa6;

  /* Theme One */
  --background-color-one: var(--black);
  --modal-background-one: var(--dark-gray);
  --accent-color-one: var(--jasmyn-pink);

  /* Theme Two */
  --background-color-two: var(--fall-sky);
  --modal-background-two: var(--fall-clouds);
  --accent-color-two: var(--fall-twilight-sun);

  /* Theme Three */
  --background-color-three: dodgerblue;
  --modal-background-three: slateblue;
  --accent-color-three: white;
}

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

body {
  font-family: "Pixelify Sans", sans-serif;
}

.theme-one {
  background: var(--background-color-one);
  color: var(--accent-color-one);
}

.theme-two {
  background: var(--background-color-two);
  color: var(--accent-color-two);
}

.theme-three {
  background: var(--background-color-three);
  color: var(--accent-color-three);
}

h2 {
  font-size: clamp(25px, 8vw, 60px);
}

body,
h3 {
  font-size: clamp(16px, 4.5vw, 32px);
}

select {
  cursor: pointer;
  font-size: inherit;
}

a,
button {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  cursor: pointer;
}

img {
  max-width: 100%;
}

fieldset {
  border: 0;
}

input[type="text"],
select {
  font-size: inherit;
  padding: 2px 5px;
}

input[type="text"] {
  border: 0;
}

.theme-one input[type="text"] {
  background-color: var(--accent-color-one);
}

.theme-two input[type="text"] {
  background-color: var(--accent-color-two);
}

.theme-three input[type="text"] {
  background-color: var(--accent-color-three);
}

input[type="radio"] {
  appearance: none;
  border: 1px solid var(--black);
  border-radius: 50%;
  cursor: pointer;
  height: clamp(13px, 3vw, 20px);
  transition: all 150ms ease-in-out;
  width: clamp(13px, 3vw, 20px);
}

.theme-one input[type="radio"] {
  border-color: var(--accent-color-one);
}

.theme-two input[type="radio"] {
  border-color: var(--accent-color-two);
}

.theme-three input[type="radio"] {
  border-color: var(--accent-color-three);
}

.theme-one input[type="radio"]:checked {
  background: var(--accent-color-one);
}

.theme-two input[type="radio"]:checked {
  background: var(--accent-color-two);
}

.theme-three input[type="radio"]:checked {
  background: var(--accent-color-three);
}

input[type="radio"]:not(:checked):hover {
  opacity: 0.5;
}

.theme-one input[type="radio"]:not(:checked):hover {
  background: var(--accent-color-one);
}

.theme-two input[type="radio"]:not(:checked):hover {
  background: var(--accent-color-two);
}

.theme-three input[type="radio"]:not(:checked):hover {
  background: var(--accent-color-three);
}

select {
  appearance: base-select;
}

select::picker(select) {
  appearance: base-select;
}

.theme-one select:hover {
  background: var(--background-color-one);
}

.theme-two select:hover {
  background: var(--background-color-two);
}

.theme-three select:hover {
  background: var(--background-color-three);
}

.saved-games-dropdown-label:hover + select {
  background: initial;
}

.theme-one select option::checkmark {
  color: var(--accent-color-one);
}

.theme-two select option::checkmark {
  color: var(--accent-color-two);
}

.theme-three select option::checkmark {
  color: var(--accent-color-three);
}

.theme-one select option {
  background: var(--modal-background-one);
  color: var(--accent-color-one);
}

.theme-two select option {
  background: var(--modal-background-two);
  color: var(--accent-color-two);
}

.theme-three select option {
  background: var(--modal-background-three);
  color: var(--accent-color-three);
}

.theme-one select option:hover {
  background: var(--background-color-one);
}

.theme-two select option:hover {
  background: var(--background-color-two);
}

.theme-three select option:hover {
  background: var(--background-color-three);
}

.error-message.hidden {
  visibility: hidden;
}

.error-message {
  color: red;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  font-weight: bold;
  text-transform: capitalize;
}

.no-display.no-display.no-display.no-display {
  display: none;
}

.modal-container {
  color: inherit;
  max-width: 600px;
  position: fixed;
  margin: auto;
  top: 10%;
  width: 90vw;
}

.theme-one .modal-container {
  background-color: var(--modal-background-one);
}

.theme-two .modal-container {
  background-color: var(--modal-background-two);
}

.theme-three .modal-container {
  background-color: var(--modal-background-three);
}

::backdrop {
  opacity: 0.7;
}

.theme-one ::backdrop {
  background-color: var(--background-color-one);
}

.theme-two ::backdrop {
  background-color: var(--background-color-two);
}

.theme-three ::backdrop {
  background-color: var(--background-color-three);
}

.modal-container.load-game-modal-container,
.modal-container.settings-modal-container,
.modal-container.save-game-modal-container,
.modal-container.pause-modal-container {
  padding: 10px;
}

.modal-container.load-game-modal-container[open],
.modal-container.settings-modal-container[open],
.modal-container.save-game-modal-container[open] {
  display: flex;
}

.modal-container.load-game-modal-container,
.modal-container.settings-modal-container,
.modal-container.save-game-modal-container {
  align-items: center;
  flex-direction: column;
}

.modal-container.save-game-modal-container {
  justify-content: space-between;
}

.modal-container.settings-modal-container {
  margin-bottom: min(6.25vw, 42px);
}

.close-modal-button {
  align-self: flex-start;
  background: none;
  border: 1px solid var(--black);
  border-radius: 4px;
  padding: 5px 8px;
}

.theme-one .close-modal-button {
  border-color: var(--accent-color-one);
  color: var(--accent-color-one);
}

.theme-two .close-modal-button {
  border-color: var(--accent-color-two);
  color: var(--accent-color-two);
}

.theme-three .close-modal-button {
  border-color: var(--accent-color-three);
  color: var(--accent-color-three);
}

.no-games-to-display-heading {
  font-size: 2rem;
  margin-top: 20px;
}

.no-high-score-heading {
  margin-bottom: 1em;
}

.update-settings-form {
  margin-top: 10px;
}

.update-settings-main-heading {
  margin-bottom: 10px;
  text-align: center;
}

.update-settings-form > fieldset {
  margin-bottom: 10px;
}

.update-settings-form > fieldset > legend {
  border-bottom: 1px solid var(--black);
  margin-bottom: 5px;
}

.theme-one .update-settings-form > fieldset > legend {
  border-color: var(--accent-color-one);
}

.theme-two .update-settings-form > fieldset > legend {
  border-color: var(--accent-color-two);
}

.theme-three .update-settings-form > fieldset > legend {
  border-color: var(--accent-color-three);
}

.radio-options-container,
.radio-option {
  align-items: center;
  display: flex;
}

.radio-options-container {
  gap: 2vw;
}

.radio-option {
  gap: 1vw;
}

.key-control-options-heading {
  margin: 20px 0 10px;
  text-align: center;
}

.key-controls-container,
.key-control-container {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
}

.key-controls-container {
  gap: 10px;
}

.key-control-container {
  gap: 5px;
}

.update-settings-submit-button,
.load-game-submit-button,
.delete-saved-game-button,
.delete-all-saved-games-button,
.confirm-button,
.close-confirmation-modal-button,
.save-game-submit-button,
.high-score-form-submit-button {
  margin: 20px 0;
  padding: 10px 20px;
}

.update-settings-submit-button {
  width: 100%;
}

.load-game-modal-container {
  justify-content: space-around;
}

.load-game-form {
  align-items: center;
  display: flex;
  flex-direction: column;
}

.saved-games-dropdown-container {
  display: flex;
  flex-direction: column;
}

.saved-games-dropdown-label {
  font-size: 1.5em;
  margin-bottom: 5px;
}

.delete-buttons {
  align-items: center;
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.load-game-submit-button {
  width: 100%;
}

.confirmation-modal-content-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  height: 100%;
  justify-content: center;
  margin: auto;
  text-align: center;
  width: 75%;
}

.confirmation-buttons {
  display: flex;
  flex-direction: column;
}

.save-game-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.save-game-label,
.save-game-input,
.save-game-submit-button {
  width: 100%;
}

.save-game-label {
  display: inline-block;
}

.main-heading {
  font-optical-sizing: auto;
  font-size: clamp(50px, 18vw, 120px);
  font-style: normal;
  font-weight: 500;
  margin: auto;
  padding: 0.25em 0;
  width: max-content;
}

.main-container {
  margin: auto;
  max-width: 600px;
  width: 90%;
}

.main-menu-container,
.play-game-container,
.high-scores-container {
  display: flex;
  justify-content: center;
}

.main-menu-container,
.high-scores-container,
.main-container.play-game-container.flex-col {
  flex-direction: column;
}

.main-menu-container,
.high-scores-container {
  align-items: center;
}

.main-menu-image-container {
  margin: 20px 0;
}

.menu-buttons,
.nav-buttons {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.menu-buttons {
  width: 100%;
}

.high-scores-container > .menu-buttons {
  margin: 40px 0;
}

.theme-one .menu-button {
  background: var(--accent-color-one);
  color: var(--background-color-one);
}

.theme-two .menu-button {
  background: var(--accent-color-two);
  color: var(--background-color-two);
}

.theme-three .menu-button {
  background: var(--accent-color-three);
  color: var(--background-color-three);
}

.menu-button:hover {
  cursor: pointer;
}

.menu-button > a,
.menu-button > span {
  display: inline-block;
  padding: 10px;
  width: 100%;
}

.high-scores-table,
.high-scores-table-heading,
.high-scores-table-field {
  border: 1px solid var(--black);
}

.theme-one .high-scores-table,
.theme-one .high-scores-table-heading,
.theme-one .high-scores-table-field {
  border-color: var(--accent-color-one);
}

.theme-two .high-scores-table,
.theme-two .high-scores-table-heading,
.theme-two .high-scores-table-field {
  border-color: var(--accent-color-two);
}

.theme-three .high-scores-table,
.theme-three .high-scores-table-heading,
.theme-three .high-scores-table-field {
  border-color: var(--accent-color-three);
}

.high-scores-table {
  border-collapse: collapse;
  margin-bottom: 20px;
  width: 100%;
}

.high-scores-table-heading,
.high-scores-table-field {
  padding: 10px 0;
  text-align: center;
}

.high-scores-table-heading {
  font-size: clamp(28px, 4.5vw, 40px);
}

.high-scores-number-field,
.sub-heading-span-text {
  font-family: Arial, Helvetica, sans-serif;
}

.game-grid-container,
.game-details-container {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.game-details-container {
  align-items: center;
  justify-content: space-between;
  padding: 0 3%;
}

.sub-headers-container,
.controller-container {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
}

.sub-headers-container {
  align-items: flex-start;
}

.level-heading,
.total-score-heading,
.rows-cleared-heading {
  align-items: center;
  display: flex;
  justify-content: flex-start;
  width: 100%;
}

.sub-heading-span-text {
  font-size: clamp(12px, 4vw, 32px);
  margin-left: 0.5vw;
}

#canvas {
  background: var(--black);
  border: 1px solid #fff;
}

.theme-one #canvas {
  border-color: var(--accent-color-one);
}

.theme-two #canvas {
  border-color: var(--accent-color-two);
}

.theme-three #canvas {
  border-color: var(--accent-color-three);
}

.preview-img-container {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: 25vw;
  justify-content: center;
  max-height: 170px;
  max-width: 170px;
  width: 25vw;
}

.preview-img {
  object-fit: cover;
  width: 100%;
}

.controller-row-one,
.controller-row-two,
.controller-row-three {
  display: flex;
  width: 100%;
}

.controller-container {
  gap: 10px;
}

.controller-row-one,
.controller-row-three {
  justify-content: center;
}

.controller-row-two {
  justify-content: space-between;
}

.controller-button {
  align-items: center;
  border-radius: 100%;
  display: flex;
  font-size: inherit;
  height: 9.375vw;
  justify-content: center;
  max-height: 70px;
  max-width: 70px;
  width: 9.375vw;
}

.theme-one .controller-button {
  background: var(--accent-color-one);
}

.theme-two .controller-button {
  background: var(--accent-color-two);
}

.theme-three .controller-button {
  background: var(--accent-color-three);
}

.controller-button:hover {
  cursor: pointer;
}

.button-icon {
  width: 50%;
}

.player-score-container {
  pointer-events: none;
}

.player-name-form {
  border: 1px solid var(--black);
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
  padding: 10px;
}

.theme-one .player-name-form {
  border-color: var(--accent-color-one);
}

.theme-two .player-name-form {
  border-color: var(--accent-color-two);
}

.theme-three .player-name-form {
  border-color: var(--accent-color-three);
}

.high-score-heading {
  text-align: center;
}

.high-score-name-label,
.high-score-player-score-label {
  display: inline-block;
  width: 100%;
}

.high-score-name-input,
.high-score-player-score-input {
  width: 100%;
}

@media screen and (max-width: 300px) {
  .main-container {
    width: 100%;
  }

  .menu-buttons {
    width: 90%;
  }

  .game-details-container {
    padding: 0;
  }
}

@media screen and (min-width: 400px) {
  .game-details-container {
    padding: 0 7%;
  }
}

@media screen and (min-width: 768px) {
  .main-heading.main-menu-heading {
    margin-bottom: 20vh;
  }

  .main-menu-container {
    flex-direction: row;
    gap: 5vw;
  }

  .main-menu-image-container {
    margin: 0;
  }
}
