* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

.game-title {
    text-align: center;
    margin-bottom: 1em;
}

.game-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6em;
    margin-bottom: 1em;
}

.join-game {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

#gameCode {
    width: 12em;
}

#boardContainer, #controlls {
    max-width: 500px;
    margin: 0 auto 1em;
    padding: 0;
}

.control-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.control-actions .nes-select {
    flex-grow: 1;
}

.control-actions #rollDiceButton {
    flex-shrink: 0;
}

#board {
    display: grid;
    grid-template-columns: repeat(5, auto);
    gap: 5px;
    justify-content: center;
}

.badge-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

#diceContainer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1em;
/*  background: linear-gradient(to bottom, #222, #333);*/
}

.cell {
    width: 10em;
    height: 10em;
    border: 3px solid #333;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 0.5em;
    text-align: center;
}

.white { background-color: white; }
.black { background-color: black; }
.red {  background-color: red; }
.kept {
    background-color: lightgreen;
}


/* OTHER STYLES */

* {
  box-sizing: border-box;
}


[class$="face"] {
  margin: 0.2em;
  padding: 0.4em;
  background-color: #e7e7e7;
  width: 5em;
  height: 5em;
  object-fit: contain;
  box-shadow:
    inset 0 5px white, 
    inset 0 -5px #bbb,
    inset 5px 0 #d7d7d7, 
    inset -5px 0 #d7d7d7;
  border-radius: 10%;
}

.pip {
  display: block;
  border-radius: 50%;
  width: 1em;
  height: 1em;
  margin: 0.1em;
  background-color: #333;
  box-shadow: inset 0 3px #111, inset 0 -3px #555;
}

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

.second-face {
  display: flex;
  justify-content: space-between;
}

.second-face .pip:nth-of-type(2) {
  align-self: flex-end;
}

.third-face {
  display: flex;
  justify-content: space-between;
}
  
.third-face .pip:nth-of-type(2) {
  align-self: center;
}

.third-face .pip:nth-of-type(3) {
  align-self: flex-end;
}

.fourth-face, .sixth-face, .fifth-face {
  display: flex;
  justify-content: space-between;
}

.fourth-face .column, .sixth-face .column, .fifth-face .column {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.fifth-face .column:nth-of-type(2) {
  justify-content: center;
}

.loader {
  width: 54px;
  height: 54px;
  position: relative;
  border-radius: 4px;
  background-color: #fff;
  background-image:
    radial-gradient(circle 5px , #FF3D00 100%, transparent 0),
    radial-gradient(circle 5px , #FF3D00 100%, transparent 0),
    radial-gradient(circle 5px , #FF3D00 100%, transparent 0),
    radial-gradient(circle 5px , #FF3D00 100%, transparent 0),
    radial-gradient(circle 5px , #FF3D00 100%, transparent 0),
    radial-gradient(circle 5px , #FF3D00 100%, transparent 0);
  background-repeat: no-repeat;
  animation: move 4s linear infinite, rotate 2s linear infinite;
}

@keyframes rotate {
  0%, 20% { transform: rotate(0deg) }
  30%, 40% { transform: rotate(90deg) }
  50%, 60% { transform: rotate(180deg) }
  70%, 80% { transform: rotate(270deg) }
  90%, 100% { transform: rotate(360deg) }
}

@keyframes move {
  0%, 9% { background-position: -12px -15px, -12px 0px, -12px 15px, 12px -15px, 12px 0px, 12px 15px; }
  10%, 25% { background-position: 0px -15px, -12px 0px, -12px 15px, 34px -15px, 12px 0px, 12px 15px; }
  30%, 45% { background-position: 0px -34px, -12px -10px, -12px 12px, 34px -15px, 12px -10px, 12px 12px; }
  50%, 65% { background-position: 0px -34px, -12px -34px, -12px 12px, 34px -12px, 0px -10px, 12px 12px; }
  70%, 85% { background-position: 0px -34px, -12px -34px, 0px 12px, 34px -12px, 0px -10px, 34px 12px; }
  90%, 100% { background-position: 0px -34px, -12px -34px, 0px 0px, 34px -12px, 0px 0px, 34px 12px; }
}
