.background_container {
  background-color: #005000;
  background-image: url(/images/site-backgrounds/classy-fabric.png);
  min-height: 700px;
}

.side_container {
  position: absolute;
  z-index: 1001;
}

h1.headline {
  color: white;
  font-weight: 300;
  font-size: 1.5em;
  z-index: 100;
  text-align: center;
  padding: 10px 0px 0px 10px;
}

.table_container {
  width: 650px;
  height: 650px;
  margin: 0 405px 0 auto;
  position: relative;
}

.ad-container {
  position: absolute;
  top: 100px;
  right: 10px;
}

.controls {
  position: absolute;
  left: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}

.controls .btn.is-active {
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

#msg {
  border-radius: 5px;
  text-align: center;
  position: absolute;
  width: 327px;
  height: 32px;
  top: 443px;
  left: 161px;
  z-index: 100;
}

#msg .inner {
  position: relative;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.hand {
  border: 0 solid white;
  position: absolute;
  z-index: 10;
  width: 250px;
  border-radius: 3px;
}

.name {
  display: inline-block;
  position: absolute;
  font-weight: bold;
}

.name-0 {
  transform: rotate(0deg);
  bottom: 0;
  left: 248px;
}

.hand-0 {
  transform: rotate(0deg);
  top: 515px;
  left: 220px;
  z-index: 101;
}

.name-1 {
  left: 56px;
  top: 110px;
  transform: rotate(90deg);
  transform-origin: top left;
}

.hand-1 {
  left: 85px;
  top: 220px;
  transform: rotate(90deg);
  transform-origin: top left;
  text-align: left;
  width: 165px;
}

.name-2 {
  left: 135px;
  top: 22px;
  cursor: pointer;
}

.hand-2 {
  left: 220px;
  top: 22px;
  transform: rotate(180deg);
  text-align: left;
  width: 165px;
}

.name-3 {
  top: 234px;
  transform: rotate(270deg);
  left: 414px;
  width: 400px;
}

.hand-3 {
  top: 346px;
  transform: rotate(270deg);
  transform-origin: top left;
  left: 566px;
  text-align: left;
  width: 165px;
}

.score-label {
  font-size: 0.8em;
  opacity: 0.8;
}

.game-card {
  position: relative;
  width: 69px;
  height: 100px;
  margin-left: -46px;
  margin-top: 0;
  transition:
    top 0.2s ease,
    left 0.2s ease,
    transform 0.2s ease;
  transform-origin: 50% 80%;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.hand .game-card:first-of-type {
  margin-left: 0px;
}

.hand-0 .game-card {
  cursor: pointer;
}

.hand-1 .game-card,
.hand-2 .game-card,
.hand-3 .game-card {
  width: 44px;
  height: 64px;
  margin-left: -30px;
}

.game-card.selected {
  box-shadow: 0 0 0 2px #ffe58f;
}

.game-card.meld-candidate {
  box-shadow: 0 0 0 2px rgba(123, 255, 178, 0.8);
}

#deck,
#discard {
  position: absolute;
  width: auto;
  height: auto;
  top: 310px;
  left: 230px;
  z-index: 100;
}

#discard {
  left: 354px;
}

#dealButton {
  position: absolute;
  top: 225px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  width: 138px;
}

.deck-card,
.discard-card {
  width: 69px;
  height: 100px;
}

.deck-card-empty {
  opacity: 0.5;
}

.deck-count {
  position: absolute;
  left: 18px;
  top: 104px;
  font-size: 0.8em;
  opacity: 0.9;
}

#tableMelds {
  position: absolute;
  top: 94px;
  left: 120px;
  width: 420px;
  height: 220px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: center;
}

.table-meld {
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.15);
}

.table-meld.selected {
  border-color: #ffe58f;
  box-shadow: 0 0 0 2px rgba(255, 229, 143, 0.4);
}

.mini-card {
  width: 36px;
  height: 52px;
}

.move-card {
  position: fixed;
  z-index: 2000;
  pointer-events: none;
  will-change: transform, left, top, width, height;
}

.opponent-avatar {
  display: inline-block;
  width: 32px;
  height: 32px;
  margin-right: 6px;
  vertical-align: middle;
}

#rummyScoreModal .rounds table {
  width: 100%;
  margin: 1rem 0;
}

#rummyScoreModal .rounds th,
#rummyScoreModal .rounds td {
  padding: 0.4rem 0.5rem;
  text-align: center;
}

#rummyScoreModal .rounds thead th {
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
}

#rummyScoreModal .rounds tfoot td {
  border-top: 2px solid #dee2e6;
  font-weight: 600;
}

@media (min-width: 1460px) {
  .table_container {
    margin: 0 auto;
  }
}

@media (max-width: 1050px) {
  h1.headline {
    font-size: 18px;
  }

  .side_container {
    width: 100px;
  }

  .controls .btn {
    font-size: 12px;
  }

  #rummyScoreModal .rounds table {
    font-size: 12px;
  }

  #rummyScoreModal .rounds th,
  #rummyScoreModal .rounds td {
    padding: 0.25rem;
  }
}

@media (max-width: 919px) {
  .table_container {
    margin: 0 auto;
  }
}

@media (max-width: 650px) {
  .table_container {
    width: 100%;
    overflow-x: hidden;
  }

  #deck,
  #discard {
    left: 50%;
  }

  #deck {
    transform: translateX(calc(-50% - 60px));
  }

  .deck-count {
    left: 8px;
    top: -18px;
  }

  #discard {
    transform: translateX(calc(-50% + 10px));
  }

  .name-1 {
    top: 80px;
  }

  .hand-1 {
    left: 40px;
  }

  .name-2 {
    top: 6px;
  }

  .hand-2 {
    top: 44px;
    left: 100px;
  }

  .name-3 {
    top: 138px;
    left: unset;
    right: -16px;
    width: auto;
  }

  .hand-3 {
    top: 320px;
    left: calc(100% - 40px);
  }

  .deck-card,
  .discard-card {
    width: 42px;
    height: 61px;
  }

  .hand-1 .game-card,
  .hand-2 .game-card,
  .hand-3 .game-card {
    width: 35px;
    height: 51px;
    margin-left: -24px;
  }

  .name-user {
    top: 470px;
    bottom: unset;
    left: 50%;
    transform: translateX(calc(30px - 50%));
  }

  .hand-user .game-card {
    width: 55px;
    height: 80px;
    margin-left: -38px;
  }

  .hand-user {
    width: auto;
    left: 50%;
    transform: translateX(calc(30px - 50%));
    top: 390px;
    z-index: 101;
  }

  #tableMelds {
    top: 94px;
    left: 50px;
    right: 50px;
    height: 220px;
    width: auto;
  }

  .mini-card {
    width: 30px;
    height: 43px;
  }

  #msg {
    font-size: 11px;
    top: unset;
    bottom: 136px;
    left: 0;
    width: 100%;
  }

  .controls {
    bottom: 160px;
    left: 8px;
    z-index: 101;
  }
}
