.background_container {
  background-color: #005000;
  background-image: url(/images/site-backgrounds/classy-fabric.png);
  position: relative;
}

.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 0 0 10px;
}

.trumpIcon {
  color: white;
  font-size: 2.5em;
  text-align: center;
}

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

.background_container::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 11px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0));
  pointer-events: none;
  z-index: 50;
}

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

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

.template-game-card-other,
.template-game-card-user,
.game-card,
.filler-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;
  -webkit-user-drag: none;
  user-drag: none;
  user-select: none;
}

.hand-user {
  width: 480px;
  left: 50%;
  transform: translateX(-50%);
}

.template-game-card-user,
.hand-user > .game-card,
.hand-user > .filler-card {
  width: 104px;
  height: 150px;
  margin-left: -76px;
}

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

.hand-0 .game-card {
  box-shadow: -1px 1px 1px rgba(0, 0, 0, 0.15);
}

.hand.hand-user,
.hand.hand-other {
  text-align: center;
}

.card-unplayable {
  filter: brightness(0.8) saturate(0.7);
}

#deck .game-card {
  margin-left: 35px;
  margin-top: 50px;
  position: absolute;
}

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

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

.bridge-bid {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 8px;
  text-align: center;
  font-size: 0.86em;
  font-weight: 700;
  line-height: 1.2;
}

.bridge-bid-separator {
  display: inline-block;
  margin: 0 2px;
}
.bridge-bid-user {
  position: static;
  align-self: flex-start;
}

.name-user {
  bottom: 23px;
  left: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.name-user .name-user-text {
  display: block;
  margin-right: 0;
}

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

.hand-0 {
  transform: translateX(-50%) rotate(0deg);
  top: 540px;
  left: 50%;
}

.bridge-bid-1 {
  left: 5px;
  top: 110px;
}

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

.hand-1 {
  left: 146px;
  top: 150px;
  transform: rotate(90deg);
  transform-origin: top left;
  text-align: left;
}

.bridge-bid-2 {
  left: 120px;
  top: 16px;
}

.name-2 {
  left: 175px;
  top: 16px;
  cursor: pointer;
}

.hand-2 {
  left: 50%;
  top: 46px;
  transform: translateX(-50%) rotate(180deg);
  text-align: left;
}

.bridge-bid-3 {
  top: 510px;
  left: 596px;
}

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

.hand-3 {
  top: 498px;
  transform: rotate(270deg);
  transform-origin: top left;
  left: 503px;
  text-align: left;
}

.flip-image {
  transform: scaleX(-1);
}

#deck,
#trick,
#dealButton {
  position: absolute;
  width: 138px;
  height: 207px;
  top: 225px;
  left: 256px;
  z-index: 100;
}

#dealButton {
  z-index: 1000;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

#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%);
}

#trick div {
  display: inline-block;
  position: absolute;
}

#trick .game-card {
  margin: 0;
}

.trick-hand-0,
.trick-hand-1,
.trick-hand-2,
.trick-hand-3 {
  width: 69px;
  height: 100px;
}

#trick .trick-hand-0 {
  top: 50%;
  left: 25%;
  border: 0 solid white;
}

#trick .trick-hand-1 {
  top: 25%;
  left: 0;
  border: 0 solid white;
}

#trick .trick-hand-2 {
  top: 0;
  left: 25%;
  border: 0 solid white;
}

#trick .trick-hand-3 {
  top: 25%;
  left: 50%;
  border: 0 solid white;
}

body {
  overflow-x: hidden;
}

.bridge-panel {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 300px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px;
  z-index: 1040;
  pointer-events: auto;
  color: #fff;
  display: none;
}

#bridgeScoreModal {
  z-index: 4000 !important;
}

.bridge-clickable {
  cursor: pointer;
}

.hand .game-card.bridge-suit-start {
  box-shadow: -1px 1px 6px rgba(0, 0, 0, 0.5);
}

.bridge-score-line {
  position: relative;
  height: 1px;
  background: #1f2429;
}

.bridge-controls .btn {
  margin-right: 6px;
  margin-bottom: 6px;
}

.bridge-bid-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 8px;
  align-items: center;
}

.bridge-bid-cell {
  min-width: 42px;
  padding: 4px 6px;
  text-align: center;
  font-weight: 700;
  line-height: 1.1;
  background: #ffffff !important;
  border: 1px solid #cfd3d7 !important;
}

.bridge-bid-cell:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bridge-bid-red {
  color: #c91818 !important;
}

.bridge-bid-dark {
  color: #1f2429 !important;
}

.bridge-suit-red {
  color: #ff6b6b;
}

.bridge-suit-black {
  color: #1f2429;
  text-shadow: 0 0 10px white;
}

.bridge-trump-center {
  position: absolute;
  left: 50%;
  top: 196px;
  transform: translateX(-50%);
  font-size: 14.5rem;
  font-weight: 700;
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
  line-height: 1;
  text-align: center;
  min-width: 90px;
}

.bridge-call-badge {
  position: absolute;
  min-width: 58px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #d4d8dc;
  color: #1f2429;
  font-size: 0.9em;
  font-weight: 700;
  z-index: 1040;
  display: none;
  padding: 0 10px;
  pointer-events: none;
}

.bridge-call-0 {
  left: 294px;
  top: 500px;
}

.bridge-call-1 {
  left: 75px;
  top: 300px;
}

.bridge-call-2 {
  left: 294px;
  top: 58px;
}

.bridge-call-3 {
  left: 515px;
  top: 300px;
}

.bridge-winning-bid {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 70px;
  height: 34px;
  line-height: 34px;
  text-align: center;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #d4d8dc;
  color: #1f2429;
  font-size: 1.05em;
  font-weight: 700;
  z-index: 1300;
  display: none;
  padding: 0 12px;
  pointer-events: none;
}

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

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

  .side_container {
    width: 100px;
  }
}

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

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

  .name-1 {
    top: 198px;
    left: 80px;
  }

  .hand-1 {
    left: 40px;
    top: 86px;
  }

  .name-2 {
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
  }

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

  .name-3 {
    top: 162px;
    left: unset;
    right: 66px;
    width: auto;
    transform-origin: right;
  }

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

  #deck .game-card {
    width: 42px;
    height: 61px;
  }

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

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

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

  #deck,
  #trick,
  #dealButton {
    left: 50%;
    transform: translateX(-50%);
  }

  .bridge-call-0 {
    left: 50%;
    transform: translateX(-50%);
    top: 444px;
  }

  .bridge-call-1 {
    left: -8px;
    top: 230px;
    transform: rotate(90deg);
  }

  .bridge-call-2 {
    left: 50%;
    top: 58px;
    transform: translateX(-50%);
  }

  .bridge-call-3 {
    left: unset;
    right: -8px;
    top: 234px;
    transform: rotate(270deg);
  }

  .bridge-bid-0 {
    position: absolute;
    right: -40px;
  }

  .bridge-bid-1 {
    top: 364px;
    left: 1px;
  }

  .bridge-bid-2 {
    top: 9px;
    left: calc(50% + 62px);
  }

  .bridge-bid-3 {
    top: 364px;
    left: unset;
    right: 1px;
  }

  #trick {
    top: 146px;
  }

  /* Smaller opponent cards on mobile */
  .template-game-card-other,
  .hand-other .game-card,
  .hand-other .filler-card {
    width: 40px;
    height: 59px;
    margin-left: -28px;
  }

  .template-game-card-user,
  .hand-0 .game-card,
  .hand-0 .filler-card,
  .hand-2 .game-card,
  .hand-2 .filler-card {
    width: 55px;
    height: 80px;
    margin-left: -38px;
  }

  #msg {
    top: 330px;
    left: 50%;
    width: 90%;
    height: 29px;
    font-size: 0.9em;
    text-align: center;
    transform: translateX(-50%);
  }

  .bridge-trump-center {
    top: 142px;
    font-size: 12rem;
  }

  #bridgeRoundSummary td,
  #bridgeRoundSummary th {
    font-size: 12px;
    padding: 0.25rem;
  }

  #bridgeRoundSummary p {
    font-size: 14px;
  }
}

@media (max-width: 420px) {
  #bridgeRoundSummary td,
  #bridgeRoundSummary th {
    padding: 0;
  }
}
