@font-face {
  font-family: 'Poppins';
  font-weight: 500;
  font-style: normal;
  src: url('/fonts/Poppins-Medium.ttf');
}

@font-face {
  font-family: 'Poppins';
  font-weight: 600;
  font-style: normal;
  src: url('/fonts/Poppins-SemiBold.ttf');
}

@font-face {
  font-family: 'Poppins';
  font-weight: 700;
  font-style: normal;
  src: url('/fonts/Poppins-Bold.ttf');
}

@font-face {
  font-family: 'Poppins';
  font-weight: 800;
  font-style: normal;
  src: url('/fonts/Poppins-ExtraBold.ttf');
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.25);
  }

  100% {
    transform: scale(1);
  }
}

:root {
  --background: floralwhite;
  --foreground: rgb(70, 70, 70);
  --glass: rgba(255, 250, 240, 0.9);
  --box-off: lightgray;
  --prompt-background: white;
  --prompt-foreground: rgb(32, 32, 32);

  @media (prefers-color-scheme: dark) {
    --background: #333;
    --foreground: snow;
    --glass: rgba(51, 51, 51, 0.9);
    --box-off: #595959;
  }

}

* {
  padding: 0;
  margin: 0;
}

html {
  overflow: hidden;
}

body {
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  background-color: var(--background);
  color: var(--foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.auto-height {
  height: auto !important;
}

.auto-overflow {
  overflow: auto !important;
}

.wordy {
  main {
    max-width: 500px;
    text-align: center;
    p {
      margin: 1em 0;
      a {
        text-decoration: none;
        color: fuchsia;
        &:hover {
          text-decoration: underline;
        }
      }
    }
  }
}

h1 {
  font-size: 2.5em;
  text-align: center;
  line-height: 1;
}

h1,
h2,
h3 {
  font-weight: 800;
}

select,
input,
textarea {
  font-size: inherit;
}

input {
  width: 80px;
}

textarea {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  border: 0;
}

button,
.knob {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.home-screen,
.play-screen,
.tutorial-screen {
  display: flex;
  flex-direction: column;

  button {
    border: 0;
    background-color: fuchsia;
    color: white;
    font-family: inherit;
    padding: 8px 25px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 22px;

    &.close,
    &[data-action="cancel"] {
      background-color: transparent;
      color: var(--prompt-foreground);
      font-weight: 700;
      opacity: 0.75;
      padding: 8px 15px;
    }

  }

}

.home-screen {
  gap: 20px;

  .buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .stats {
    font-size: 16px;
    display: flex;
    align-items: center;
    flex-direction: column;
    font-weight: 800;
    opacity: 0.4;
    line-height: 1.2;
  }

  .home-screen-foot {
    position: absolute;
    bottom: 50px;
    left: 20px;
    right: 20px;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;

    &[data-visible="false"] {
      display: none;
    }

    button {
      background-color: transparent;
      color: var(--prompt-foreground);
      font-weight: 700;
      padding: 0;
      font-size: 16px;
      opacity: 0.25;
    }

  }

}

.play-screen,
.tutorial-screen {
  align-items: center;
  gap: 40px;

  h1 {
    font-size: 2em;
  }

  .buttons {
    display: flex;
    gap: 10px;
  }

}

.tutorial-screen {
  padding-bottom: 150px;
}

.checker-screen {
  width: 1140px;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  padding: 40px 0;
}

.builder-screen {
  position: relative;

  .nudge {
    position: absolute;
    inset: 0;
    border: solid 120px red;
    opacity: 0.25;
    top: -120px;
    left: -120px;

    &.good {
      border-color: green;
    }

  }

  .status {
    position: fixed;
    top: 0;
    left: 0;
    font-size: 22px;
    background-color: white;
    padding: 20px;
  }

  .builder {
    position: relative;
    margin-bottom: 40px;
  }

  .inputs {
    display: flex;
    gap: 5px;
    position: relative;
  }

}

.knob {
  border: solid 8px black;
  position: absolute;
  box-sizing: border-box;
  transition: all .5s;
  border-radius: 100%;
  color: white;
  text-align: center;
  font-weight: 800;
  border-color: var(--box-off);
  background-color: var(--box-off);

  @media (min-width: 600px) {
    border-width: 10px;
  }

  &[data-animation="bounce"] {
    transition: all .5s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  &[data-box="0"] {
    border-color: var(--box-0);
    background-color: var(--box-0);
  }

  &[data-box="1"] {
    border-color: var(--box-1);
    background-color: var(--box-1);
  }

  &[data-box="2"] {
    border-color: var(--box-2);
    background-color: var(--box-2);
  }

  &[data-box="3"] {
    border-color: var(--box-3);
    background-color: var(--box-3);
  }

  &[data-box="4"] {
    border-color: var(--box-4);
    background-color: var(--box-4);
  }

  &[data-box="5"] {
    border-color: var(--box-5);
    background-color: var(--box-5);
  }

  &[data-box="6"] {
    border-color: var(--box-6);
    background-color: var(--box-6);
  }

  &[data-box="7"] {
    border-color: var(--box-7);
    background-color: var(--box-7);
  }

  &[data-state="off"] {
    opacity: 0.5;
    transform: rotate(-180deg);
    border-color: var(--box-off);
    background-color: var(--box-off);
  }

  &[data-state="highlight"] {
    animation: pulse 1s infinite;
  }

  &[data-visible="false"] {
    transform: scale(0);
  }

  &[data-visible="false"][data-state="off"] {
    transform: rotate(-180deg) scale(0);
  }

  &.star {
    background-color: black;
  }

  &:before,
  &:after {
    content: '';
    display: block;
    position: absolute;
  }

  &:after {
    width: 6px;
    height: 16px;
    border-radius: 3px;
    background-color: white;
    left: calc(50% - 3px);
    top: -2px;
  }

  &:before {
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.25);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 100%;
  }

}

.puzzle {
  position: relative;
}

.prompt {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
  background-color: var(--prompt-background);
  padding: 12px 15px;
  border-radius: 10px;
  box-shadow: rgba(0, 0, 0, 0.25) 0 0 10px;
  width: calc(100% - 20px);
  max-width: 500px;
  transition: all 0.25s;

  .prompt-head {
    text-align: center;
    padding: 8px 0 15px;

    h2 {
      font-size: 30px;
    }
  }

  .prompt-body {
    color: var(--prompt-foreground);
    padding-bottom: 20px;
    line-height: 1.2;

    .pro & {
      padding-left: 5px;
      padding-right: 5px;
      line-height: 1.3;
    }
  }

  .prompt-foot {
    display: flex;
    justify-content: end;
    gap: 10px;
  }

  &.pro {
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    padding: 15px;
  
    &[data-active="false"] {
      pointer-events: none;
      opacity: 0;
      transform: translate(-50%, -50%) scale(0);
    }
  }

}

.solved {
  background-color: var(--glass);
  backdrop-filter: blur(2px);
  position: absolute;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  transition: opacity .25s;

  h3 {
    font-size: 3em;
    line-height: 1;
    margin-bottom: 10px;
  }

  h2 {
    font-size: 2em;
    line-height: 1;
  }

  .solved-body {
    pointer-events: none;
  }

  .time {
    font-size: 22px;
  }

  .continue {
    font-weight: 500;
    font-size: 20px;
    padding-top: 30px;
  }

  &[data-state="disabled"] {
    display: none;
  }

}
