:root {
  --base-color:#6A00FA;
  --second-color:#A9FA00;
  --third-color:#FAD500;
  --fourth-color:#573D7A;
  --fifth-color:#677A3D;
  --sixth-color: #7A713D;
}

body {
  background-color: var(--base-color);
  font-family: "Roboto";
  color: var(--third-color);
}



th {
  width: 20%;
  font-size: medium;
}

h2 {
  margin:auto;
  width:fit-content;
  max-width: 70vw;
  color: var(--third-color);
  text-align: center;
}

span {
  margin:auto;
  color: var(--third-color);
  
}

span#info {
  visibility:hidden;
}

select {
  font-size:medium;
  color:var(--third-color);
  background-color: var(--base-color);
  font-size:medium;
  
  
}

.selected_filter {
  background-color: var(--fourth-color);
  border: 1px solid;
  border-radius: 8px;
}

.multiplier_table {
  width:100%;
  border:3px solid;
  border-color:var(--fifth-color); 
  margin:5px auto; 
  font-size:medium;
  color:var(--third-color);
  text-align: left;
  border-radius: 8px;
}

.leaderboard {
  /* table-layout: fixed; */
  width:100%;
  border:3px solid;
  border-color:var(--fifth-color); 
  margin:auto; 
  font-size:small;
  color:var(--third-color);
  text-align: center;
  border-radius: 8px;
}

.leaderboard td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 1;
  max-width: 25vw;
}
.hold_animation {
  animation: scale_down_up 0.2s ease-out forwards; 
  /* transition: transform 0.2s ease-out; */

}

@keyframes scale_down_up {

  0%, 100% {
    scale: 1;
  }
  
  50% {
    scale: 0.98;
  }
}



.login {
  width: 100%;
  height: 100vh;
  display:flex;
  align-items: center;
  text-align: center;
  vertical-align: middle;
  
}
.bet_selected {
  background-color: var(--fourth-color);

}

div.buttons, div.balance {
  width: 100%;
  display: flex;
  margin:auto;
}


.menu_button {
  font-size: clamp(16px, 6vw, 8vw);
  border-radius: 6px;
  background: none;
  margin: auto 5px;
  background-size: contain; /* or 'cover' */
  background-repeat: no-repeat;
  background-position: center;
  cursor:pointer;
  width:12vw;
  height:12vw;
}

.button {
  align-items: center;
  appearance: none;
  background-image: radial-gradient(100% 100% at 100% 0, var(--fourth-color) 0, var(--base-color) 100%);
  border: 0;
  border-radius: 6px;
  box-shadow: rgba(45, 35, 66, .4) 0 2px 4px,rgba(45, 35, 66, .3) 0 7px 13px -3px,rgba(58, 65, 111, .5) 0 -3px 0 inset;
  box-sizing: border-box;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  height: 48px;
  justify-content: center;
  line-height: 1;
  list-style: none;
  overflow: hidden;
  padding-left: 16px;
  padding-right: 16px;
  margin: 3px auto;
  position: relative;
  text-align: left;
  text-decoration: none;
  transition: box-shadow .15s,transform .15s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  min-width: 100px;
  white-space: nowrap;
  will-change: box-shadow,transform;
  font-size: 18px;
}

.button:focus {
  box-shadow: var(--sixth-color) 0 0 0 1.5px inset, rgba(45, 35, 66, .4) 0 2px 4px, rgba(45, 35, 66, .3) 0 7px 13px -3px, var(--sixth-color) 0 -3px 0 inset;
}
.button:hover {
  /* box-shadow: rgba(45, 35, 66, .4) 0 4px 8px, rgba(45, 35, 66, .3) 0 7px 13px -3px, var(--sixth-color) 0 -3px 0 inset; */
  transform: translateY(-2px);
}
.button:active {
  box-shadow: #3c4fe0 0 3px 7px inset;
  transform: translateY(2px);
}

.title {
  width: 100%;
  display: flex;
  margin:var(--tg-content-safe-area-inset-top) auto auto;
}
.hand, .held {
    display:flex;
    width: 100%;
    margin:auto;
}

.held-caption {
  width: 18%;
  margin: auto 1%;
  display:flex;
  color: var(--third-color);
  visibility:hidden;
}
.flip-card {
    background-color: transparent;
    width: 18vw;
    height: 27vw; /* Proportion of 1x1.5
    perspective: 1000px; /* Remove this if you don't want the 3D effect */
    margin: 5px auto;
    transition: transform 0.3s;
    cursor:pointer;
  }
  
  /* This container is needed to position the front and back side */
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transform-style: preserve-3d;
    transition: transform 0.2s;
    
  }

  .flip-animation {
    transition: transform 0.3s linear;
    transform: rotateY(180deg);
    
  }
  
  /* Position the front and back side */
  .flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    border-radius: 10px;
    box-shadow: 2px 2px dimgray;
  }
  
  /* Style the front side (fallback if image is missing) */
  .flip-card-front {
    background-color: whitesmoke;
    display:grid;
    align-items: center;
    color: black;
    font-size:clamp(30px, 4vw, 4vw);
    vertical-align: middle;
    height:100%;
    transform: rotateY(180deg);
    font-family: "Agency FB";
    font-weight: bold;
  }
  
  /* Style the back side */
  .flip-card-back {
    background-image: url('/static/videopoker/card_back_180.jpg');
    background-size:cover;
    background-repeat: round;
    color: white;
  }

  .row_combination {
    background-color: var(--second-color) !important;
    color:var(--fourth-color);
    
  }
  tr:nth-child(even) {
    background-color: var(--fourth-color);
  }

  .red {
    color:red;
  }

  
.modal-backdrop {
  display:flex;
  position: fixed; 
  z-index: 1; 
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  overflow: auto; 
  background-color: rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  vertical-align: middle;
  
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}
.modal-backdrop.active .modal-content {
  transform: scale(1);
  opacity: 1;
  
}


.close {
  color: var(--second-color);
  float: right;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 2px 2px 2px var(--fourth-color);
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

.modal-content {
  border-radius: 10px;
  background-color: var(--base-color);
  margin: auto;
  padding: 5px 10px;
  border: 1px solid var(--third-color);
  width: clamp(200px, 80vw, 700px);
  transform: scale(0.7);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.table_prices {
  margin: 20px auto;
  border:1px solid var(--third-color);
  border-radius: 10px;
  background-color: var(--base-color);
  color:var(--third-color);
  box-shadow: 5px 5px 5px var(--fourth-color);
  min-width: 275px;
  
}
.table_prices > tbody > tr > th {
  width:fit-content;
}

.table_prices > tbody > tr {
  border: 1px solid var(--second-color);
  margin: 5px 5px 5px 5px;
  
}
.table_prices > tbody > tr > td {
  width: fit-content;
  padding: 5px;
  border-color: var(--second-color);
  text-align: center;
}

.container {
  display: flex;
  flex-direction: column;
}

.button-container {
  justify-content: space-evenly;
  display: flex;
  flex-direction: row;
}

/* Top three leaders section */

.top-winners {
  display: flex;
  justify-content: center;
  align-items: flex-end; /* Aligns items to bottom */
  padding: 10px;
}

.winner-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  padding-bottom: 5px;
  border-radius: 8px;
  background: var(--fourth-color);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  max-width: 22%;
  width:30%;
  margin: auto 2vw;
}

/* First place styling */
.winner-card.first-place {
  padding-top: 30px; /* Extra padding for crown */
  transform: scale(1.1); /* Make it slightly larger */
  z-index: 2; /* Ensure it's above others */
  
}

/* Second place styling */
.winner-card.second-place {
  margin-top: 30px; /* Push it down */
  
}

/* Third place styling */
.winner-card.third-place {
  margin-top: 30px; /* Push it down */
  
}

.crown-icon {
  position: absolute;
  top: -5px;
  width: 48px;
  height: 48px;
}

.avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
 
}

.avatar.placement-1 { 
  border: 5px solid #FFD700;
  width: 60px; /* Slightly larger */
  height: 60px;
}
.avatar.placement-2 { border: 5px solid #C0C0C0; }
.avatar.placement-3 { border: 5px solid #CD7F32; }

.name {
  font-weight: bold;
  margin-bottom: 5px;
  text-align: center;
  font-size: clamp(10px, 14px, 24px);
}


.amount {
  
  font-size:clamp(10px, 14px, 8vw);;
  text-align: center;
}

.first-place .amount {
  font-weight: bold;
}

.position {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

.first-place .position {
  width: 28px; /* Slightly larger */
  height: 28px;
}

.position.placement-1 { background: #FFD700; }
.position.placement-2 { background: #C0C0C0; }
.position.placement-3 { background: #CD7F32; }

/* End of Top three leaders section*/

@media (orientation: landscape) {
        .multiplier_table {
          width:50%;
          font-size:x-small;
        }

        .leaderboard {
          /* table-layout: fixed; */
          width:50%;
          font-size:medium;
        }

        .hand, .held {
          width: 50vw;
      }

      div.buttons, div.balance {
        width: 50%;
      }

      .total-bet {
        font-size: clamp(12px, 2vw, 16px);
        padding: 3px 10px;
      }

      .flip-card {
        width: 9vw;
        height: 13vw; 
      }

      
      .menu_button {
        width:5vw;
        height:5vw;
        font-size: clamp(16px, 30px, 5vw);
      }

      .title {
        width:50%;
        margin:5px auto auto auto;
      }

      .container {
        flex-direction: row-reverse;
      }
      
      .button-container {
        flex-direction: column;
        margin-left: 10px;
        width: 25%;
      }

      h2 {
        font-size: medium;
      }

      .top-winners {
        width:50%;
        margin:auto;
      }
      
}
