@import url('https://fonts.googleapis.com/css2?family=Jersey+15&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Jersey+20&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: url('../assets/img/cursor-reg.png'), pointer;
}

* button:hover {
    cursor: url('../assets/img/cursor-button.png'), pointer;
}

body {
    background-image: url('../assets/img/pixel-casino-floor-bg.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    font-family: "Jersey 20", monospace;
    min-height: 100dvh;
    letter-spacing: .09rem;
    display: flex;
    flex-direction: column;
    color: #fff;
  }

h1 {
    font-size: 3.3rem;
    letter-spacing: .16rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.2rem;
    letter-spacing: .1rem;
}

#main-content, #home-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* Bet Selection and Selectors */
#bet-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin: 16px;
}

#bet-selectors {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 24px;
    margin: 3px;
    filter: drop-shadow(rgb(3, 3, 3) 1rem 1rem 13px);
}

#bet-selectors img {
    width: 65px;
    cursor: url('../assets/img/cursor-button.png'), pointer;
}

#bet-selectors img:hover {
    transform: scale(1.2)
}

/* Player Actions like Hit or Stand */
#actions {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
    max-width: 216px;
}

#actions button {
    background-color: #4DB7D1;
    color: #fff;
    font-size: 1rem;
    font-family: "Jersey 15", monospace;
    min-width: 100px;
    min-height: 64px;
    padding: 18px;
    letter-spacing: .06rem;
    border-radius: 7px;
    border: none;
}

#actions #double {
    background-color: #F5A614;
}

#actions #split {
    background-color: #EF6CD7;
}

#actions button:hover {
    transform: scale(1.1)
}

/* INACTIVE BUTTON STATES FOR ACTIONS */
#actions button:disabled {
    opacity: 0.3;
}

#actions button:disabled:hover {
    transform: none;
    cursor: url('../assets/img/cursor-reg.png'), pointer;
}

/* Instructions, help/mute icon */
#instructions {
    display: none;
    flex-direction: column;
    max-width: 410px;
    padding: 24px 32px;
    margin-top: 10px;
    gap: 8px;
    align-items: center;
    background-color: rgb(0, 0, 0);
}

#instructions ul {
    padding: 7px 30px;
}

#info-button, #mute-button, #music-button {
    cursor: url('../assets/img/cursor-button.png'), pointer;
    margin: 5px;
    height: 18px;
}

#info-button:hover, #mute-button:hover, #music-button:hover {
    transform: scale(1.2);
}

/* Play Buttons Div, play and play again */
.play {
    background-color: #cb2222;
    color: #fff;
    font-size: 1.08rem;
    font-family: "Jersey 15", monospace;
    padding: 16px 20px;
    letter-spacing: .06rem;
    border-radius: 7px;
    cursor: pointer;
    border: none;
}

.play:hover {
    transform: scale(1.1)
}

#start-game {
    margin-top: 10px;
}

#play-again-buttons {
    display: none;
    flex-direction: row;
    gap: 16px;
    margin: 14px 0px;
    align-items: center;
    justify-content: center;
}

#play-again.play {
    padding: 20px 15px;
}

#change-bet {
    background-color: #777777;
    color: #fff;
    font-size: 1.08rem;
    font-family: "Jersey 15", monospace;
    padding: 20px 15px;
    letter-spacing: .06rem;
    border-radius: 7px;
    border: none;
}

#change-bet:hover {
    transform: scale(1.1);
}

/* Main Logos */
#large-logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin: 30px 18px 8px;
    filter: drop-shadow(rgb(3, 3, 3) 1rem 1rem 20px);
}

#large-logo img {
    width: 38px;
    transform: rotate(-11deg);
}

#small-logo img {
    width: 18px;
    transform: rotate(-11deg);
}

#small-logo {
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 5px;
}

/* Top Bar and Top bar buttons */
#top-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#top-bar {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background-color: black;
    min-height: 50px;
}

#reset-wallet {
    display: none;
    background-color: #000;
    cursor: url('../assets/img/cursor-button.png'), pointer;
}

#reset-wallet:hover {
    transform: scale(1.1);
}

/* Home Bank and Game Bank Sections (bet, wallet) */
#home-bank {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: space-around;
    align-items: center;
    margin: 14px;
}

    #home-bank h3 {
        font-size: 3rem;
    }

#game-bank {
    display: none;
    flex-direction: row;
    gap: 20px;
    justify-content: space-around;
    align-items: center;
    margin: 6px 0;
}

    #game-bank h3 {
        font-size: 1.8rem;
    }

.wallet-icon, .chip-icon {
    width: 40px;
}

/* Game Table - Dealer vs Player */
.score-section {
    display: none;
    flex-direction: row;
    gap: 8px;
}

#home-score {
    padding: 20px;
    font-size: 1.4rem;
}

#split-view-1 {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
}

#split-view-2 {
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 4px;
}

#player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin: 2px;
}

#dealer {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin: 2px;
    gap: 4px;
}

#dealer h3 {
    display: none;
}

#player-total, #dealer-total, #splitHand-total {
    font-size: 1.2rem;
    background-color: black;
    color: white;
    padding: 4px 7.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#player-total span, #dealer-total span, #splitHand-total span {
    background-color: red;
    padding: 2px;
    font-size: .6rem;
}

#dealer-cards, #player-cards, #splitHand-cards {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    min-width: 130px;
    max-width: 340px;
}

#result {
    color: rgb(255, 255, 255);
    display: none;
    padding: 10px;
}

#result h2 {
    text-align: center;
    font-size: 1.8rem;
}

/* Game screen rows */
#game-table-column-1, #game-table-column-2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#game-table-column-2 {
    gap: 10px;
}

#game-table-column-1 {
    gap: 22px;
    padding: 22px;
}

#game-table-column-1 p {
    margin: 10px 0 0 0;
    font-size: 1rem;
}

#game-table {
    display: none;
    flex-direction: column;
    align-items: center;
    background-color: rgba(17, 17, 17, 0.974);
    border: 6px double #000000;
    border-radius: 30px;
    margin-top: 10px;
    padding: 12px;
    min-width: 390px;
}

/* Card images */
.card {
    width: 58px;
    padding: 2px;
}

.card:hover {
    transform: scale(1.45);
}

/* Temp message and fade in/fade out */
#temp-msg {
    display: none;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transition: opacity 0.8s ease;
    margin-top: 9px;
    background-color: black;
    padding: 8px;
}
  
#temp-msg.fade-in {
    opacity: 1;
}

#temp-msg.fade-out {
    opacity: 0;
}

/* This highlights the cards section when splitting cards */
.cards-border {
    border: 3px solid rgb(255, 255, 182);
    padding: 6px 15px;
}

/* ! CARD FLIP ANIMATION */
.card-container {
    background-color: transparent;
    width: 58px;
    perspective: 1000px; /* 3D effect */
  }
  
  /* add this class when needing to flip */
  .flip-card-inner {
    position: relative;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    transform: rotateY(180deg);
  }
  
  /* position the front and back side */
  .flip-card-back, .flip-card-front {
    position: absolute;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
  }
  
  /* shows the back side by rotating the front card */
  .flip-card-front {
    transform: rotateY(180deg);
  }

  @media screen and (max-width: 431px) {
    .card {
        width: 50px;
    }

    .card-container {
        width: 50px;
      }

    #result h2 {
        text-align: center;
        font-size: 1.8rem;
    }

    #player-total, #dealer-total, #splitHand-total {
        font-size: .95rem
    }

    #game-bank h3 {
        font-size: 1.6rem;
    }

    .wallet-icon, .chip-icon {
        width: 30px;
    }

    #game-table {
        display: none;
        flex-direction: column;
        align-items: center;
        background-color: rgba(17, 17, 17, 0.974);
        border: 6px double #000000;
        border-radius: 30px;
        max-width: 370px;
        min-width: 330px;
    }

    #game-table-column-2 {
        padding: 8px;
    }

    #game-table-column-1 {
        padding: 4px;
    }

    #actions button {
        background-color: #4DB7D1;
        min-width: 92px;
        min-height: 60px;
        padding: 15px;
    }

    #actions {
        max-width: 196px;
        gap: 12px;
    }

    #dealer-cards, #player-cards, #splitHand-cards {
        max-width: 265px;
    }
}

