@import url('https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css');
@import url('https://fonts.googleapis.com/css2?family=Architects+Daughter&family=Itim&family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');

a{
    font-size: inherit;
    color: inherit;
    text-decoration: none;
}

noscript{
    font-size: 5rem;
}


:root{
    --table-background-color: 130, 100%, 98.5%;
    --table-border-color: 0, 0%, 15%;
    --table-row-height: 1.5rem;
}

body, #game{
    width: 100%;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    font-family: 'Lato', sans-serif;
}
body{
    background-image: url(https://img.freepik.com/premium-photo/dark-green-poker-table-felt-soft-rough-textile-material-background-texture-close-up_273651-358.jpg);
    background-color: rgb(29,104,16);
    background-size: cover;
}

h1{
  color: white;
  font-size: 3rem;
  font-family: 'Architects Daughter', cursive;
}

h3{
  color: white;
  font-size: 2rem;
  font-family: 'Architects Daughter', cursive;
}

span#currentPlayer, span#rolls{
  font-weight: 600;
}


a{
    aspect-ratio: 5/1;
    width: min(80%, 20rem);
    background-color: hsla(0, 0%, 100%, 0.15);
    border: solid white 3px;
    border-radius: 2rem;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    display: grid;
    place-items: center;
}

#game .buttons{
    display: flex;
    gap: 0.5rem;
}

#game .buttons button{
    padding: 0.5rem 2rem;
    border-radius: 0.5rem;
    background-color: #89cff0;
    color: white;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    -webkit-box-shadow: 0px 5px 0px 0px rgba(0,0,0,0.75);
    -moz-box-shadow: 0px 5px 0px 0px rgba(0,0,0,0.75);
    box-shadow: 0px 5px 0px 0px rgba(0,0,0,0.75);
    transform-origin: 50% 50%;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.2s ease, transform 0.3s ease-in-out;
}

#game .buttons button:hover{
  transform: translateY(2px) scale(1.05);
  color: black;
  background-color: #FBF5AC;
  -webkit-box-shadow: 0px 5px 0px 0px rgb(129, 129, 129);
  -moz-box-shadow: 0px 5px 0px 0px rgb(129, 129, 129);
  box-shadow: 0px 5px 0px 0px rgb(129, 129, 129);
}

#game table{
    max-width: 90%;
    background-color: hsl(var(--table-background-color));
    font-family: 'Itim', cursive;
}

#game table tr{
    height: var(--table-row-height);
    display: flex;
    flex-direction: row;
}

#game table tr>:first-child{
    flex-grow: 0;
    flex-shrink: 0;
    width: 150px;
    padding-left: 5px;
    padding-right: 0px;
    justify-content: start;
}

#game table tr>*{
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0rem 0.5rem;
    height: var(--table-row-height);
    border: solid hsl(var(--table-border-color)) 1px;
}

#game table tr.highlight{
    background-color: hsla(0, 0%, 0%, 0.3);
    font-weight: 700;
}

.dice{
    margin: 0% 5%;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.die {
    position: relative;
    width: 100px;
    height: 100px;
    transform-style: preserve-3d;
    transition: transform 1s ease-out; 
    will-change: transform;
  }

.die.hold>*{
    background-color: hsl(0, 0%, 90%);
}

.die.hold .dot{
    background-color: hsl(1, 85%, 55%);
    box-shadow: inset 2px 2px hsl(350, 96%, 33%);
}
  
  .dot {
    position: absolute;
    width: 20px;
    height: 20px;
    margin: -10px 5px 5px -10px;
    border-radius: 20px;
    background-color: #f25f5c;
    box-shadow: inset 2px 2px #d90429;
  }
  
  .side {
    position: absolute;
    background-color: #ffF;
    border-radius:5px;
    width: 100px;
    height: 100px;
    border: 1px solid #e5e5e5;
    text-align: center;
    line-height: 2em;
  }
  
  .side:nth-child(1) {
    transform: translateZ(3.1em); }
  
  .side:nth-child(6) {
    transform: rotateY(90deg) translateZ(3.1em); }
  
  .side:nth-child(3) {
    transform: rotateY(-90deg) translateZ(3.1em); }
  
  .side:nth-child(4) {
    transform: rotateX(90deg) translateZ(3.1em); }
  
  .side:nth-child(5) {
    transform: rotateX(-90deg) translateZ(3.1em); }
  
  .side:nth-child(2) {
    transform: rotateY(-180deg) translateZ(3.1em); }
  
  .show-1 {
    transform: rotateX(720deg) rotateZ(-720deg); }
  
  .show-2 {
    transform: rotateX(-900deg) rotateZ(1080deg); }
  
  .show-6 {
    transform: rotateY(-450deg) rotateZ(-1440deg); }
  
  .show-3 {
    transform: rotateY(810deg) rotateZ(720deg); }
  
  .show-4 {
    transform: rotateX(-810deg) rotateZ(-1080deg); }
  
  .show-5 {
    transform: rotateX(450deg) rotateZ(-720deg); }
  
  .two-1, .three-1, .four-1, .five-1, .six-1 {
    top: 20%;
    left: 20%; 
  }
  
  .four-3, .five-3, .six-4 {
    top: 20%;
    left: 80%; }
  
  .one-1, .three-2, .five-5 {
    top: 50%;
    left: 50%; }
  
  .four-2, .five-2, .six-3 {
    top: 80%;
    left: 20%; }
  
  .two-2, .three-3, .four-4, .five-4, .six-6 {
    top: 80%;
    left: 80%; }
  
  .six-2 {
    top: 50%;
    left: 20%; }
  
  .six-5 {
    top: 50%;
    left: 80%; 
  }
  

#game th.currentPlayer{
    background-color: hsla(187, 93%, 67%, 0.8);
}

#game td.currentPlayer:not(.highlight td){
    background-color: hsla(187, 93%, 67%, 0.1);
}

#game th.nextPlayer{
    background-color: hsla(65, 43%, 67%, 0.3);
}

#game td.nextPlayer:not(.highlight td){
    background-color: hsla(65, 43%, 67%, 0.1);
}

#game th.previousPlayer{
    background-color: hsla(275, 43%, 67%, 0.3);
}

#game td.previousPlayer:not(.highlight td){
    background-color: hsla(275, 43%, 67%, 0.1);
}

#game tr td.potential.currentPlayer{
    background-color: hsla(187, 88%, 67%, 0.3);
    cursor: pointer;
}


#game{
    display: none;
}

body.started #game{
    display: flex;
}

body.started #startGame{
    display: none;
}

#startGame{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

#startGame table.input{
    width: min(90%, 30rem);
    background-color: hsl(var(--table-background-color));
    border: solid hsl(var(--table-border-color)) 2px 0.2rem;
    border-radius: 0.2rem;
    padding: 1rem;
}

#startGame table tr{
    display: grid;
    grid-template-columns: auto min(40%, 150px);
    text-align: left;
}

#startGame table thead tr:first-of-type{
    font-weight: 700;
    padding: 0rem 0.75rem;
    margin-bottom: -1rem;
}

#startGame table tr>*{
    padding: 0.75rem;
}

#startGame table tbody tr{
    border-top: solid hsl(var(--table-border-color)) 1px;
}

#startGame table input{
    width: calc(100% - 2rem);
    height: 100%;
    border: solid hsla(var(--table-border-color), 0.2) 1px;
    border-radius: 2rem;
    padding: 0rem 1rem;
    background-color: hsla(0, 0%, 800%, 1);
}

#startGame table thead button{
    width: 100%;
    height: 2.5rem;
    background-color: hsla(0, 0%, 40%, 1);
    border: solid white 3px;
    border-radius: 2rem;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: grid;
    place-items: center;
}

#startGame table tbody button{
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: grid;
    place-items: center;
    border: solid hsla(var(--table-border-color), 0.2) 1px;
    background-color: hsla(0, 0%, 0%, 0.01);
}

#startGame table tbody h5{
    height: 100%;
    width: 100%;
    padding-left: 0.5rem;
    display: flex;
    align-items: center;
    line-break: anywhere;
}

#startGame table tbody button img{
    aspect-ratio: 1/1;
    height: 1.5rem;
}

#startGame #startButton{
    width: min(90%, 15rem);
    height: 3rem;
    background-color: hsla(0, 0%, 40%, 1);
    border: solid white 2px;
    border-radius: 2rem;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: grid;
    place-items: center;
}

@media (max-width: 986px) {
    #game th:not(.nextPlayer):not(.previousPlayer):not(.currentPlayer):not(:first-child), 
    #game td:not(.nextPlayer):not(.previousPlayer):not(.currentPlayer):not(:first-child){
        display: none;
    }
}

@media (max-width: 500px) {
    #game th:not(.currentPlayer):not(:first-child), #game td:not(.currentPlayer):not(:first-child){
        display: none;
    }
}