html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: sans-serif;
  touch-action: manipulation;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  background-color: #414141;
  top: 0;
  left: 0;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#scoreboard {
  display: grid;
  height: 100vh;
  width: 100vw;
  text-align: center;
}

.score {
  position: relative;

  div {
    overflow: hidden;
  }

  div[font-idx='1'] {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  div[font-idx='2'] {
    position: absolute;
    bottom: 0;
    right: 20px;
  }
}

#option-stack {
  display: grid;
}

.button {
  transition: all ease 200ms;
  background: none;
  color: inherit;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;

  font-size: 3vw;
  font-weight: 700;
  text-align: center;

  &:hover {
    cursor: pointer;
    filter: brightness(70%);
  }

  &:not(.small-img) img {
    padding: 0.5rem;
    max-height: 80%;
    max-width: 80%;
  }

  &.fill-width {
    min-width: 100%;
    box-shadow: inset 0 0 1px 2px rgba(0, 0, 0, 0.3);
  }

  &.small-img {
    height: 30px;
    border-radius: 4px;
    padding-inline: 10px;

    img {
      max-height: 90%;
    }
  }

  &.button-settings {
    width: fit-content;
    font-size: 20px;
    padding-inline: 8px;
    padding-block: 4px;
    font-weight: 400;
    border-radius: 4px;
  }

  &.button-delete {
    font-size: 25px;
    padding-inline: 8px;
    padding-block: 4px;
    font-weight: 400;
    border-radius: 4px;
  }
}

.bg-lighter {
  background-color: #cad5e2;
}

.bg-light {
  background-color: #99a1af;
}

.bg-dark {
  background-color: #45556c;
}

.bg-darker {
  background-color: #101828;
}

.bg-red {
  background-color: oklch(50.5% 0.213 27.518);
}

.bg-purple {
  background-color: oklch(71.4% 0.203 305.504);
}

.hidden {
  display: none;
}

.button-group {
  display: flex;
  gap: 8px;
}

.text-sm {
  font-size: 14px;
}

dialog {
  max-height: 300px;
  min-height: 200px;
  width: 450px;
  overflow-y: scroll;
  padding: 10px;
  border-radius: 15px;
  color: white;
  padding: 0;
  border-color: black;

  .close-button {
    position: sticky;
    top: 0;
    left: 0;
    border-radius: 10px;
    padding-inline: 10px;
    font-size: 20px;
    height: 30px;
    width: 30px;
  }

  h2 {
    font-size: 30px;
  }

  .flex-center {
    flex-direction: column;
    gap: 15px;
  }
}

.setting-list {
  display: flex;
  flex-direction: column;

  h3 {
    display: block;
    font-size: 20px;
    text-align: left;
  }
}

.font-bold {
  font-weight: 600;
}

.text-green {
  color: rgb(29, 203, 29);
}
.version {
  color: rgb(150, 150, 150);
  font-weight: 600;
}

.setting-block {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: #1a263d;
  border: 1px solid grey;
  border-radius: 5px;
  margin-bottom: 10px;
  min-width: 55%;
}

.setting-option {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: 230px;
  font-size: 17px;
}

.team-option {
  display: flex;
  gap: 10px;
}

.score-team {
  padding-inline: 5px;
  padding-block: 2px;
  border-radius: 3px;
}

.game-played {
  display: grid;
  gap: 5px;
  justify-content: space-between;
  grid-template-rows: 1fr;
  grid-template-columns: 34% 18% 34% 14%;
  align-items: center;
  overflow-x: hidden;
  min-width: 325px;
  button {
    width: fit-content;
    height: fit-content;
    margin-right: 5px;
  }

  &:not(:last-child) {
    border-bottom: 1px solid grey;
    padding-bottom: 5px;
  }
}

#team-list {
  h3 {
    border-radius: 4px;
    padding: 4px;
    width: fit-content;
  }
}

.number-input {
  text-align: center;
  color: black;
  background: white;
  font-size: 30px;
  width: 150px;
}

.space-bottom {
  margin-bottom: 20px;
}

@media (orientation: portrait) {
  .button-score {
    font-size: 6vw;
  }

  #whistle {
    grid-column: span 1 / span 1;
  }

  #scoreboard {
    grid-auto-flow: column;
    grid-template-columns: 85% 15%;
    grid-template-rows: repeat(7, minmax(0, 1fr));
  }

  .score {
    grid-row: span 3 / span 3;
  }

  :root {
    --opm-size-1: 34vh;
    --opm-size-2: 8vh;
    --hwy-size-1: 34vh;
    --hwy-size-2: 8vh;
    --mak-size-1: 34vh;
    --mak-size-2: 8vh;
    --man-size-1: 36vh;
    --man-size-2: 9vh;
  }

  .score-digits {
    font-size: 34vh;
  }

  .border-rb {
    border-bottom: 4px solid black;
  }

  .border-lt {
    border-top: 4px solid black;
  }

  #option-stack {
    grid-auto-flow: column;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: repeat(1, minmax(0, 1fr));
  }

  .rotate-with {
    rotate: 90deg;
  }
}

@media (orientation: landscape) {
  .button-score {
    font-size: 4vw;
  }

  #whistle {
    grid-row: span 2 / span 2;
  }

  #scoreboard {
    grid-auto-flow: row;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: 85% 15%;
  }

  .score {
    grid-column: span 3 / span 3;
  }

  :root {
    --opm-size-1: 34vw;
    --opm-size-2: 8vw;
    --hwy-size-1: 34vw;
    --hwy-size-2: 8vw;
    --mak-size-1: 34vw;
    --mak-size-2: 8vw;
    --man-size-1: 36vw;
    --man-size-2: 9vw;
  }

  .border-rb {
    border-right: 4px solid black;
  }

  .border-lt {
    border-left: 4px solid black;
  }

  #option-stack {
    grid-auto-flow: row;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    grid-template-rows: repeat(6, minmax(0, 1fr));
  }
}

@font-face {
  src: url(./fonts/OverpassMono.woff2);
  font-family: OverpassMono;
}
@font-face {
  src: url(./fonts/HighwayGothic.woff2);
  font-family: HighwayGothic;
}
@font-face {
  src: url(./fonts/Monomakh.woff2);
  font-family: Monomakh;
}
@font-face {
  src: url(./fonts/Monomaniac.woff2);
  font-family: Monomaniac;
}
