:root {
  --transition-duration: 0.5s;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* THEME COLORS */
.theme-light :focus-visible {
  outline: none;
  -webkit-box-shadow: 0px 0px 2px 6px #B2DFDB;
  -moz-box-shadow: 0px 0px 2px 6px #B2DFDB;
  box-shadow: 0px 0px 2px 6px #B2DFDB;
}

.theme-dark :focus-visible {
  outline: none;
  -webkit-box-shadow: 0px 0px 2px 6px #6EACDA;
  -moz-box-shadow: 0px 0px 2px 6px #6EACDA;
  box-shadow: 0px 0px 2px 6px #6EACDA;
}

.theme-light #overlay_light_theme {
  background-color: #EAFCFC;
  background: linear-gradient(135deg, #EAFCFC, #87D3CD, #EAFCFC);
  opacity: 1;
}

.theme-dark #overlay_dark_theme {
  background-color: #6EACDA;
  background: linear-gradient(135deg, #6EACDA, #03346E, #6EACDA);
  opacity: 1;
}

body.theme-light,
.theme-light main {
  background-color: #FFF;
}

body.theme-dark,
.theme-dark main {
  background-color: #818FB4;
}

.theme-light #timer {
  background-color: #B2DFDB;
  color: #004D4D;
  border-color: transparent;
}

.theme-dark #timer {
  background-color: #BBB;
  color: #000;
  border-color: #333;
}

.theme-light #prestart_progress_bar {
  background-color: #87D3CD;
}

.theme-dark #prestart_progress_bar {
  background-color: #6EACDA;
}

.theme-light button {
  border-color: transparent;
}

.theme-dark button {
  border-color: #333 !important;
}

.theme-light #buttons_container button:hover {
  background-color: #00796b;
}

.theme-light #buttons_container button.active {
  background-color: #00796b;
}

.theme-dark #buttons_container button:hover {
  background-color: #6EACDA;
  color: #000;
}

.theme-dark #buttons_container button.active {
  background-color: #6EACDA;
  color: #000;
}

.theme-light #theme_btn {
  color: #333;
}

.theme-dark #theme_btn {
  color: #fff;
}
/* end theme colors */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

html {
  font-size: 16px;
  font-family: Tahoma, Helvetica, Arial, sans-serif;
  letter-spacing: 1px;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
}

.overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity var(--transition-duration) ease-in-out;
}

main {
  position: relative;
  margin-inline: auto;
  padding: 20px 15px 55px;
  text-align: center;
  transition: background-color var(--transition-duration) ease-in-out;
  height: fit-content;
}

h1 {
  font-size: 2.25rem;
  font-weight: 900;
  margin-top: 0;
  margin-bottom: 1rem;
}

 fieldset {
  padding: 0;
  border: none;
  margin: 0;
 }

.site-description {
  font-size: 1rem;
  margin: 0 auto 1rem;
  width: 85%;
}

#timer {
  font-size: 2.25rem;
  font-weight: bold;
  margin: 15px 0;
  padding: 15px 25px;
  border-width: 2px;
  border-style: solid;
  border-radius: 10px;
  display: inline-flex;
  gap: 6px;
  transition: background-color var(--transition-duration), color var(--transition-duration), border-color var(--transition-duration);
}

.colon {
  display: flex;
}

.colon span {
  line-height: 1;
}

#alert_text {
  font-size: 1.5rem;
  font-weight: bold;
  /* display: none; */
  margin-top: 0;
  margin-bottom: 10px;
  min-height: 30px;
}

#prestart_progress_bar_container {
  width: 100%;
  max-width: 250px;
  background-color: #ddd;
  height: 10px;
  margin-inline: auto;
  margin-bottom: 10px;
  visibility: hidden;
  border-radius: 12px;
}

#prestart_progress_bar {
  width: 0%;
  height: 100%;
  border-radius: 12px;
}

button {
  background-color: #333;
  color: #fff;
  margin: 8px;
  border-width: 2px;
  border-style: solid;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.2rem;
  letter-spacing: 1px;
  transition: background-color var(--transition-duration), color var(--transition-duration), border-color var(--transition-duration);
}

button:disabled:not(#buttons_container button.active) {
  background-color: #bbb !important;
  cursor: not-allowed;
  color: #333;
  border-color: #bbb;
}

.utility-btn {
  background: #333;
  border-color: #333;
  transition: opacity var(--transition-duration);
  padding: 8px 16px;
  font-size: 1rem;
}

.utility-btn:hover:not(button:disabled) {
  opacity: .8;
}

#buttons_container {
  max-width: 260px;
  margin-inline: auto;
  margin-top: 15px;
  display: grid;
  /* grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); */
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  justify-items: center;
}

#buttons_container button {
  width: 50px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

#buttons_container button:disabled {
  cursor: not-allowed;
}

/* #footer {
  display: flex;
  justify-content: center;
} */

#footer p {
  margin: 0;
  font-size: .75rem;
}

#theme_btn {
  padding: 8px 12px;
  background: transparent;
  border: none;
  font-size: 1.25rem;
  transition: color var(--transition-duration) ease-in-out;
}

#theme_btn:hover {
  text-decoration: underline;
}

.footer-theme-info {
  max-width: 290px;
  margin-inline: auto;
}



/* BREAKPOINTS */
@media (min-width: 375px) {
  main {
    padding-top: 42px;
  }

  .site-description {
    font-size: 1.2rem;
  }
}

@media (min-width: 415px) {
  .site-description {
    width: 78%;
  }

  #buttons_container {
    max-width: 350px;
  }

  #buttons_container button {
    width: 60px;
    height: 56px;
  }
}

@media (min-width: 465px) {
  .site-description {
    width: 70%;
  }
}

@media (min-width: 525px) {
  .site-description {
    width: 62%;
  }
}

@media (min-width: 550px) {
  .site-description {
    width: 58%;
  }

  #buttons_container {
    max-width: 400px;
  }
  
  #buttons_container button {
    width: 66px;
    height: 62px;
  }

  .footer-theme-info {
    max-width: 315px;
  }
}

@media (min-width: 620px) {
  h1 {
    font-size: 2.75rem;
  }

  .site-description {
    font-size: 1.25rem;
    width: 90%;
    max-width: 475px;
    margin-bottom: 1.5rem;
  }
}


@media (min-width: 680px) {
  .utility-btn {
    padding: 8px 24px;
    font-size: 1.25rem;
  }

  #buttons_container {
    /* max-width: 650px; */
    max-width: 500px;
    /* grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); */
    grid-template-columns: repeat(5, 1fr);
    grid-row-gap: 6px;
  }

  #buttons_container button {
    width: 70px;
    height: 62px;
  }

  .footer-theme-info {
    max-width: 442px;
  }
}


@media (min-width: 950px) {
  body {
    padding-block: 50px;
    background-color: #B0E4E0;
  }

  .overlay {
    display: block;
  }

  main {
    max-width: 860px;
    padding: 55px 30px;
    border-radius: 12px;
    box-shadow: 10px 10px 30px 10px rgba(0, 0, 0, 0.2);
    height: auto;
  }

  h1 {
    margin-bottom: 1.25rem;
  }

  #theme_btn {
    padding: 8px 12px;
    font-size: 1.25rem;
  }

  #timer {
    font-size: 2.5rem;
    margin: 20px 0;
  }

  /* #alert_text {
    margin-bottom: 34px;
  } */

  #prestart_progress_bar_container {
    margin-bottom: 15px;
  }
}
