@import url(https://fonts.googleapis.com/css?family=Walter+Turncoat); 

:root {
    --bg-color: #123a22;
    --key-bg-color: #2f754b;
    --key-active-bg-color: #1e6239;
    --modal-bg-color: #1e6239;
    --text-color: #E8E8E8;
    --font-type: "Walter Turncoat",cursive;
    --num-of-scores: 8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10 and IE 11 */
    user-select: none; /* Standard syntax */ 
}

html, body {
  overscroll-behavior-y: none; 
  overscroll-behavior: none;
}

/*----------BOARD----------*/

body {
    color: var(--text-color);
    font-family: var(--font-type);
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100dvh;
    width: 100dvw;
    background-color: var(--bg-color);
}

.board {
    width: 100dvw;
    height: 100dvh;
}


/*----------META----------*/

.meta {
    height: 15%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    position: relative;
}

.meta::before {
    position: absolute;
    content: '';
    background-color: var(--text-color);
    width: 100%;
    height: .25rem;
    top: 40%;
    transform: translate(0, -50%);
}

.meta::after {
    position: absolute;
    content: '';
    background-color: var(--text-color);
    width: 100%;
    height: .25rem;
    top: 100%;
    transform: translate(0, -50%);
}

.team {
    width: 42.5%;
    height: 60%;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.team input {
    font-size: 2.75rem;
    color: var(--text-color);
    font-family: var(--font-type);
    font-weight: bold;
    width: 100%;
    text-align: center;
    background: none;
    border: none;
    text-transform: uppercase;
    opacity: .5;
}

.team input:focus {
  background: none;
  border: none;
  outline-width: 0;
}

.team .active {
    opacity: 1;
}

.legs {
    height: 66.6%;
    width: 100%;
    position: absolute;
    display: flex;
    bottom: 100%;
    justify-content: flex-start;
    align-items: center;
}

.leg {
    height: 75%;
    aspect-ratio: 1/1;
    border: .5rem solid var(--text-color);
    margin: 0 .25rem;
}

.legs .won {
    background-color: var(--text-color);
}

.game-type {
    width: 15%;
    height: 60%;
    font-size: 3.5rem;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-type::before {
    position: absolute;
    content: '';
    background-color: var(--text-color);
    height: 100%;
    width: .25rem;
    right: 100%;
    transform: translate(50%, 0);
}

.game-type::after {
    position: absolute;
    content: '';
    background-color: var(--text-color);
    height: 100%;
    width: .25rem;
    left: 100%;
    transform: translate(-50%, 0);
}

.swap {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 2.75rem;
    font-size: 1.75rem;
    background-color: var(--key-bg-color);
    top: 100%;
    padding: .5rem;
    transform: translate(0, -75%);
    text-transform: uppercase;
    z-index: 1;
}

/*----------GAME----------*/

/*----------501----------*/


.board-501 {
    height: 85%;
    position: relative;
}

.game {
    height: 65%;
    position: relative;
    display: flex;
}

.game::before {
    position: absolute;
    content: '';
    background-color: var(--text-color);
    height: 100%;
    width: .25rem;
    left: 50%;
    transform: translate(-50%, 0);
}

.game::after {
    position: absolute;
    content: '';
    background-color: var(--text-color);
    width: 100%;
    height: .25rem;
    top: 100%;
    transform: translate(0, -50%);
}

.scores {
    height: 100%;
    width: 50%;
    display: flex;
}

.score-section {
    height: 100%;
    width: 40%;
    position: relative;
}

.score-section::before {
    position: absolute;
    content: '';
    background-color: var(--text-color);
    height: 100%;
    width: .25rem;
    left: 100%;
    transform: translate(-50%, 0);
}

.score-section:last-of-type::before {
    left:0;
}

.score {
    height: calc(75% / (var(--num-of-scores) - 1));
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    position: relative;
}

.score:last-of-type {
  height: 25%;
  font-size: 7rem;
}

.score::after {
    content: '';
    position: absolute;
    width: 90%;
    height: .5rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: .5rem;
    background-color: var(--text-color);
}

.points-left-section {
    height: 100%;
    width: 60%;
}

.points-left {
    height: calc(75% / (var(--num-of-scores) - 1));
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    position: relative;
}

.points-left:last-of-type {
  height: 25%;
  font-size: 10rem;
}

.points-left:not(:last-of-type)::after {
    content: '';
    position: absolute;
    width: 90%;
    height: .5rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: .5rem;
    background-color: var(--text-color);
}

.points-left:not(:nth-last-child(-n + 8)) {
  display: none;
}

.score:not(:nth-last-child(-n+8)) {
  display: none;
}

.input-section {
  height: 35%;
  width: 100%;
  font-family: Arial, sans-serif;
  font-weight: normal;
  display: flex;
  justify-content: center;
  align-items: center;

  position: relative;
}

.keypad-left {
  flex-basis: 33%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: .75rem;
  gap: 3%;
}

.numkey {
  background-color: var(--key-bg-color);
  border: none;
  border-radius: .3rem;
  font-size: 2.5rem;
  color: white;
}

.numkey:active {
  background-color: var(--key-active-bg-color);
}

.wide {
  grid-column: span 2;
}

.keypad-right {
  flex-basis: 33%;
  height: 100%;
  padding: .75rem;
  gap: 3%;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  grid-template-columns: repeat(2, 1fr);
}

.input-field {
  grid-row: 1;
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.left-score {
  grid-row: 1;
  grid-column: 2;
}

.enter {
  grid-row: 4;
  grid-column: 1;
}

.undo {
  grid-row: 4;
  grid-column: 2;
}


/*----------TACTICS----------*/

.board-tt {
    height: 85%;
    position: relative;
}

.tt-game {
  height:90%;
  display: flex;
  position: relative;
}

.tt-game::after {
  position: absolute;
  content: '';
  background-color: var(--text-color);
  width: 100%;
  height: .25rem;
  top: 100%;
  transform: translate(0, -50%);
}


.tt-nums {
  width: 10%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.tt-nums::before {
  content: '';
  background-color: var(--text-color);
  height: 100%;
  width: .25rem;
  position: absolute;
  right: 100%;
}

.tt-nums::after {
  content: '';
  background-color: var(--text-color);
  height: 100%;
  width: .25rem;
  position: absolute;
  left: 100%;
}

.tt_num {
  height: 8.33%;
  font-size: 3.75rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* .tt-nums::before, .tt-nums::after, .tt-score-section::after {
  content: '';
  background-color: #E8E8E8;
  height: 100%;
  width: .25rem;
  position: absolute;
}

.tt-nums::before {
  right: 100%;
}

.tt-nums::after {
  left: 100%;
} */

.tt-score-section {
  width: 20%;
  position: relative;
}

.tt-cross-section {
  width: 25%;
}

.tt-score-section::after {
  content: '';
  background-color: var(--text-color);
  height: 100%;
  width: .25rem;
  position: absolute;
  left: 100%;
  top: 0%;
  transform: translate(-50%);
}

.tt-score-section:last-of-type::after {
  left: 0%;
}

.cross {
  height: 8.33%;
  display: flex;
  align-items: center;
  margin: 0 15%;
  font-size: 4.5rem;
  letter-spacing: .5rem;
  text-transform: uppercase;
  text-align: center;
}

.tt-score-section .score:last-of-type::after {
  content: none;
}

.line {
  text-decoration: line-through;
  text-decoration-thickness: .8rem;
}


/*----------TACTICS-INPUT----------*/


.tt-input {
  display: flex;
  height: 10%;
  position: relative;
  align-items: center;
}

.tt-input-left {
  flex-basis: 50%;
  height: 100%;
  padding: 2%;
}

.tt-input-field {
  height: 100%;
  background-color: var(--key-bg-color);
  border-radius: .3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2%;
  font-size: 1.5rem;
}

.tt-input-right {
  display: flex;
  flex-basis: 50%;
  height: 100%;
  justify-content: space-around;
  font-family: Arial, sans-serif;
}

.tt-input-right .left {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2%;
}

.tt-input-right .right {
  display: flex;
  flex-direction: column;
  padding: 2%;
  gap: 2%;
}

.tt-key {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--key-bg-color);
  padding: 0 2rem;
  border-radius: .3rem;
  font-size: 1.5rem;
}


/*----------MENU----------*/

.menu-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100dvw;
    height: 100dvh;
    background-color: var(--bg-color);
    opacity: .5;
}

.menu {
  position: absolute;
  display: flex;
  background-color: var(--modal-bg-color);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  min-width: 50%;
  border-radius: 5%;
  font-family: Arial, sans-serif;
}

.menu h1 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-transform: uppercase;
}

.start-menu {
  font-size: 2rem;
  display: flex;
  flex-direction: column;
}

.mid-menu, .end-menu {
    display: flex;
    flex-direction: column; 
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1rem;
}

.row select {
  font-size: 2rem;
  font-weight: bold;
  width: 10rem;
  background-color: var(--bg-color);
  color: var(--text-color);
  text-align: center;
  border: none;
  border-radius: .3rem;
}

.row select option {
  font-size: 1rem;
}

.row select:active {
  border: none;
}

.menu-key {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1.75rem;
    border-radius: .3rem;
    padding: .5rem;
}

  .no-longpress {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }

.invisible {
    display: none;
}

@media screen and (max-height: 992px) {
  :root {
    --num-of-scores: 7;
  }
  .points-left:not(:nth-last-child(-n + 7)) {
    display: none;
  }

  .score:not(:nth-last-child(-n+7)) {
    display: none;
  }
}

@media screen and (max-height: 768px) {
  :root {
    --num-of-scores: 6;
  }
  .points-left:not(:nth-last-child(-n + 6)) {
    display: none;
  }

  .score:not(:nth-last-child(-n + 6)) {
    display: none;
  }

  .leg {
    border: .3rem solid var(--text-color);
  }
  .board-501 .game {
    height: 55%;
  }

  .input-section {
    height: 45%;
  }

}






@media screen and (max-width: 992px) {
  .points-left:last-of-type {
    font-size: 6.75rem;
  }
  .score:last-of-type {
    font-size: 4.5rem;
  }
}

@media screen and (max-width: 768px) {
  .points-left:last-of-type {
    font-size: 4.5rem;
  }
  .score:last-of-type {
    font-size: 3rem;
  }
}