:root {
    --card-width: 64px;
    --card-width-rotate: 128px;
}
html, body {
    padding: 0;
    margin: 0;
    width: 100%;
    overflow-x: hidden;
    background-color: #165041;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: url("../imgs/cards/bk.jpg");
    background-position: center center;
    background-repeat: no-repeat;
}

#fiveandthrees {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

#fiveandthrees #board, #fiveandthrees #player {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
}

#fiveandthrees #deck {
    padding-top: 50px;
    height: 523px;
    background-image: url("../imgs/cards/table.png");
    background-position: center center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 0 0 1099px;
    align-items: center;
    justify-content: center;
}
#fiveandthrees #deck #cards {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 320px;
}
#fiveandthrees #deck #controls {
    gap: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 70px;
}

#fiveandthrees #deck #controls .btn-new-game {
    display: block;
    background-image: url("../imgs/cards/button-new.png");
    background-position: top;
    background-repeat: no-repeat;
    width: 222px;
    height: 78px;
}
#fiveandthrees #deck #controls .btn-knocking {
    display: block;
    background-image: url("../imgs/cards/button-knock.png");
    background-position: top;
    background-repeat: no-repeat;
    width: 222px;
    height: 78px;
}
#fiveandthrees #deck #controls .btn-submit{
    display: block;
    background-image: url("../imgs/cards/button-setup.png");
    background-position: top;
    background-repeat: no-repeat;
    width: 222px;
    height: 78px;
}

#fiveandthrees #scoreboard {
    position: absolute;
    top: 10px;
    left: 10px;
    display: block;
    width: 327px;
    z-index: 5;
    background-image: url("../imgs/cards/scoreboard.png");
    background-repeat: no-repeat;
    color: #fff;
    padding-top: 49px;
}
#fiveandthrees #scoreboard-scores {
    width: 100%;
    background-color: #292444;
    background-image: url("../imgs/cards/scoreboard-border.png");
    background-repeat: repeat-y;
}
#fiveandthrees #scoreboard-footer {
    position: relative;
    margin-top: -5px;
    height: 19px;
    width: 100%;
    background-image: url("../imgs/cards/scoreboard-bottom.png");
    background-position: top;
    background-repeat: no-repeat;
}
#fiveandthrees #scoreboard table {
    margin-left: 11px;
    border-collapse: collapse;
    border: none;
    width: calc(100% - 24px);
}
#fiveandthrees #scoreboard table tbody {
    width: 100%;
}
#fiveandthrees #scoreboard th, #fiveandthrees #scoreboard td {
    padding: 0 0 0 5px;
    margin: 0;
    border: none;
}
#fiveandthrees #scoreboard .player-img {
    text-align: center;
    width: 41px;
    padding: 0;
}
#fiveandthrees #scoreboard .player-img img {
    margin: 0;
}
#fiveandthrees #scoreboard table tbody tr:nth-child(odd) {
    background-color: #292444;
    padding: 0;
}
#fiveandthrees #scoreboard table tbody tr:nth-child(even) {
    background-color: #313654;
    padding: 0;
}

#fiveandthrees #player {
    flex-direction: column;
    z-index: 10;    
}

#fiveandthrees #player #hand {
    flex: 1 1 auto;
    display: flex;
    column-gap: 0px;
    row-gap: 0px;
    align-content: center;
    justify-content: center;
    flex-wrap: wrap;
    flex-direction: row;
    padding-top: 10px;
}

#fiveandthrees #player #hand .card {
    position: relative;
}

#fiveandthrees #deck .deck-placeholder {
    display: block;
}

#fiveandthrees #game table {
    width: 100%;
    color: #fff;
}

#fiveandthrees .card, #fiveandthrees .placeholder {
    display: inline-flex;
    background: none;
    border: none;
    width: var(--card-width);
    cursor: pointer;
    padding: 0;
    margin: 0;
    font-size: 0;
    border-radius: 5px;
    overflow: hidden;
}

#fiveandthrees .row {
    display: flex;
    width: 100%;
    flex: 1;
    flex-direction: column;
}

#fiveandthrees .row.hide {
    display: none;
}

#fiveandthrees .col-full {
    width: 100%;
    display: flex;
    flex-direction: row;
    flex: 1;
}

@media (min-width: 576px) {
  #fiveandthrees .modal-dialog {
    max-width: 500px;
    margin: 1.75rem auto;
  }
}

@media only screen and (max-width: 810px) {
    #fiveandthrees #board {
        height: 260px;
    }

    #fiveandthrees #player {
        margin-top: 260px;
    }

    #fiveandthrees .card, #fiveandthrees .placeholder {
        width: calc(var(--card-width) - 20px);
    }

    #fiveandthrees #deck .card {
        margin-left: calc((var(--card-width) - 20px) * -1);
    }
}

@media only screen and (max-height: 315px) {
    #fiveandthrees .card, #fiveandthrees .placeholder {
        width: calc(var(--card-width) - 40px);
    }

    #fiveandthrees #deck .card {
        margin-left: calc((var(--card-width) - 40px) * -1);
    }
}

#fiveandthrees #deck .card-lower {
    margin-top: -40px;
}

#fiveandthrees #deck .card-higher {
    margin-top: 40px;
}

#fiveandthrees .card-highlight {
    border: 4px solid #F8B133;
    background-color: #F8B133;
}

#fiveandthrees .card-warn {
    border: 4px solid #D23136;
}

#fiveandthrees #deck img, #fiveandthrees #hand img {
    width: var(--card-width);
    margin: 0;
}

#fiveandthrees .text-center {
    text-align: center;
}

#fiveandthrees .text-left {
    text-align: left;
}

#fiveandthrees .player-turn {
    background-color: #2B8ACA;
}

#fiveandthrees td.last-card-col {
    width: 50px;
    text-align: center;
}

#fiveandthrees .last-card, #fiveandthrees .winner, #fiveandthrees .knocking {
    display: none;
    cursor: pointer;
}

#fiveandthrees #game-info {
    display: none;
    background-color: #fff;
    border: 0;
    border-top: 2px solid #000;
    margin-top: 10px;
    width: calc(100% - 10px);
    height: 300px;
    overflow-y: scroll;
}

#fiveandthrees #game-info p {
    margin: 0;
    padding: 0;
}

#fiveandthrees button {
    border: 0;
    text-transform: uppercase;
    font-weight: bold;
    cursor: pointer;
    background: none;
}

#fiveandthrees .no-players {
    display: flex;
    width: calc(100% - 10px);
}

#fiveandthrees .no-players span {
    color: #fff;
    padding-top: 15px;
    flex: auto;
}

#fiveandthrees form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#fiveandthrees .form-input {
    display: inline-block;
    width: 60px;
    margin-top: 10px;
    background-color: #fff;
    border: 2px solid #000;
    height: 35px;
}

#fiveandthrees .modal .form-input, #fiveandthrees .modal .btn-new-game {
    width: 100%;
}

#fiveandthrees .modal .row.break {
    margin-bottom: 20px;
}

#fiveandthrees .modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1060;
  display: none;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
  background-color: #000;
}

#fiveandthrees .modal.fade {
  transition: opacity .15s linear;
}

#fiveandthrees .modal.show .modal-dialog {
  transform: none;
}
#fiveandthrees .modal.fade .modal-dialog {
  transition: transform .3s ease-out;
  transform: translate(0,-50px);
}

#fiveandthrees .modal-dialog {
  position: relative;
  width: auto;
  margin: 3.75rem auto;
  pointer-events: none;
}

#fiveandthrees .modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0,0,0,.2);
  border-radius: .3rem;
  outline: 0;
}

#fiveandthrees .modal-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem;
  border-bottom: 1px solid #dee2e6;
  border-top-left-radius: calc(.3rem - 1px);
  border-top-right-radius: calc(.3rem - 1px);
}

#fiveandthrees .modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1rem;
}

#fiveandthrees .modal-footer {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  padding: .75rem;
  border-top: 1px solid #dee2e6;
  border-bottom-right-radius: calc(.3rem - 1px);
  border-bottom-left-radius: calc(.3rem - 1px);
}

#fiveandthrees #dominoes-left,
#fiveandthrees #dominoes-left .dominoes,
#fiveandthrees #dominoes-right,
#fiveandthrees #dominoes-right .dominoes {
    display: flex;
}
#fiveandthrees #dominoes-left .dominoes {
    flex-direction: row-reverse;
}

#fiveandthrees .dominoes .rotate-left {
    width: var(--card-width-rotate);
    -webkit-transform: rotate(90deg);
    -moz-transform: rotate(90deg);
    -ms-transform: rotate(90deg);
    transform: rotate(90deg);
}
#fiveandthrees .dominoes .rotate-left img {
    margin-left: calc(var(--card-width) / 2) !important;
}

#fiveandthrees .dominoes .rotate-right {
    width: var(--card-width-rotate);
    -webkit-transform: rotate(-90deg);
    -moz-transform: rotate(-90deg);
    -ms-transform: rotate(-90deg);
    transform: rotate(-90deg);
}
#fiveandthrees .dominoes .rotate-right img {
    margin-left: calc(var(--card-width) / 2) !important;
}