/* ------------------------------------------------------ Global ------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f3f3f3;
    text-align: center;
    color: #333;
    margin: 0;
}

/* ------------------------------------------------------ Landing Page ------------------------------------------------------------------------------------------------------------------------------------------------------------------ */

@keyframes smoothVibrate {
    0%, 100% { transform: translateY(-1px); }
    50% { transform: translateY(1px); }
}
  
@keyframes strongVibrate {
    0% { transform: translate(-1px, -1px); }
    25% { transform: translate(1px, 1px); }
    50% { transform: translate(-1px, 1px); }
    75% { transform: translate(1px, -1px); }
    100% { transform: translate(-1px, -1px); }
}

@keyframes fall {
    to {
        transform: translateY(100vh);
    }
}

#pageTitle {
    text-align: center;
    margin: 20px 0;
}

#pageTitle h1 {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Playfair Display', serif; 
    font-size: 6em; 
    text-shadow: 3px 3px 4px rgba(0, 0, 0, 0.8); 
    letter-spacing: 4px; 
    text-transform: uppercase; 
    background: -webkit-linear-gradient(45deg, #ffe259, #fffd8b); 
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 20px;
}

#rainContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.raindrop {
    position: absolute;
    width: 2px;
    height: 15px;
    background: rgba(255, 255, 255, 0.6);
    bottom: 100%;
    animation: fall linear infinite;
}

#startContainer {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100vw; 
    height: 100vh; 
    display: flex;
    justify-content: center; 
    align-items: center; 
    overflow: hidden;
    background-image: url("outside.jpg");
    background-size: cover;
    display: flex;
    flex-direction: column;
}


  
#startGame {
    padding: 20px 40px;
    font-size: 2em;
    color: white;
    background-image: linear-gradient(45deg, #ff0241, #2c01c6);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 15px 15px rgba(0, 0, 0, 0.418);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
    z-index: 1;
    animation: smoothVibrate 0.5s infinite alternate;
}
  
#startGame:hover {
    animation: strongVibrate 0.1s infinite alternate;
    transform: translateY(-3px);
    box-shadow: 0 15px 15px rgba(0, 0, 0, 0.418);
    transform: scale(0.55);  
}
  
#startGame:active {
    transform: translateY(2px);
    box-shadow: 0 15px 15px rgba(0, 0, 0, 0.418);
}
  
#startGame::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 300%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: all 0.7s ease;
    z-index: -1;
}
  
#startGame:hover::before {
    left: 100%;
}

/* ------------------------------------------------------ Budget set page ------------------------------------------------------------------------------------------------------------*/

#initialBudgetPrompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    display: none; 
    justify-content: center;
    align-items: center;
}


#initialBudgetBackground {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("inside.jpg");
    background-size: cover;
    filter: blur(8px) brightness(0.5);
    z-index: -1;
}

#initialBudgetContent {
    z-index: 20; 
    text-align: center;
    color: white;
    padding: 20px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.8); 
}

#initialBudget {
    width: 80%;
    padding: 10px;
    margin: 10px 0;
    border: 2px solid #fff;
    border-radius: 5px;
    background-color: white;
    color: black;
    text-align: center;

}

#setBudget {
    padding: 10px 20px;
    font-size: 1em;
    color: white;
    background-image: linear-gradient(45deg, #ff0241, #2c01c6);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s, box-shadow 0.3s;
}

#setBudget:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

#minBudget {
    transition: color 0.3s, text-shadow 0.3s;
}

.minBudgetError {
    color: red;
    text-shadow: 0 0 5px red;
}

/* ------------------------------------------------------ Game page ------------------------------------------------------------------------------------------------------------------------------------------------------------------ */

@keyframes rotateBackground {
    0% {
      background-position: 0% 50%;
    }
    100% {
      background-position: 100% 50%;
    }
}

#gameWrapper {
    width: 100%; 
    max-width: 800px; 
    margin: 30px auto;
    padding: 0px;
    display: none;
    background-color: #000000; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    justify-content: center; 
    align-items: center; 
    min-height: 100%;
    overflow: hidden;
}

#gameWrapper.visible {
    display: block;
}

#lives{
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6em;
}

#buyLife{
    background-color: red;
    color: white;
    border-radius: 50%;
    font-size: 1.2rem;
    padding: 2px 7px;
    cursor: pointer;
    align-items: center;
}

#livesSpan{
    font-size: 1.2rem;
    color: white;
    margin-left: 5px;
    margin-left: 20px;
}

#gameBackground {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: -0.5px;
    background-image: url("inside.jpg");
    background-size: cover;
    filter: blur(2px) brightness(0.3);
    z-index: 1; 
}

#gameContainer {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 30px auto;
    padding: 20px;
    border-radius: 10px;
    background: rgb(2,0,36);
    background: radial-gradient(circle, rgba(2,0,36,1) 0%, rgba(22,4,40,1) 0%, rgba(21,7,50,1) 8%, rgba(37,9,50,1) 36%, rgba(47,13,47,1) 62%, rgba(39,6,97,1) 85%, rgba(9,20,36,1) 100%);
    background-size: 400% 400%; 
    animation: rotateBackground 6s linear infinite;
    z-index: 2; 
    transition: opacity 10s;
    color: white;
    border: 1px solid rgba(179, 170, 170, 0.725);
    box-shadow: 0 20px 20px rgba(0, 0, 0, 0.751);
}

#gameContainer, #gameOverScreen {
    transition: opacity 5s;
}

#exitButton{
    position: absolute; 
    top: 10px; right: 10px; 
    background-color: red; 
    color: black; 
    padding: 5px 10px; 
    cursor: pointer;
    border-radius: 50%;
    font-weight: 900;
    opacity: 0.9;
    transition: 0.3s;
}

#exitButton:hover{
    opacity: 1;
    background-color: black;
    color: red;
    transition: 0.3s;
}

#gameControls button {
    margin: 5px;
    padding: 10px 20px;
    border: none;
    background-color: #4CAF50;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

#gameControls button:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

.hand {
    display: flex;
    justify-content: center;
    margin: 10px;
    padding: 10px;
    border: 1px solid #1a0a0a61;
    min-height: 120px;
    background: linear-gradient(to bottom, #2e2c3b, #1f1010f1);
    border-radius: 5px;
    box-shadow: 0 3px 4px rgba(0, 0, 0, 0.57); 
}

#playerInfo {
    font-size: 1.1em; 
}

#playerInfo > div {
    margin-bottom: 0.5em; 
    padding: 0.2em 0; 
}

#budget, #lives, #currentBetD , .score {
    background-color: rgba(255, 255, 255, 0.1); 
    border-radius: 5px;
    margin: 0 0.5em; 
    box-shadow: 0 3px 4px rgba(0, 0, 0, 0.57); 
    font-size: 1em; 
}

#canvasLives {
    display: inline-block;
    vertical-align: middle;
    margin-left: 10px;
    margin-top: -15px;
    height: 50px; 
}

#budget {
    color: #0f0; 
    margin-top: 1.6em;
    font-weight: bold;
}

.score {
    border-radius: 5px;
    font-size: 1.2em; 
    color: #2ECC71; 
    margin: 0.5em; 
}

.card {
    color: inherit;
    font-size: 1rem;
    font-weight: bold;
    border: 2px solid black;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin: 0rem 0.5rem ;
    cursor: pointer;
    width: 70px; 
    height: 100px; 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: relative; 
}

#messageBox {
    font-size: 1.2em; 
    padding: 15px;
    border: 1px solid #F1C40F; 
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.7); 
    color: #7DCEA0; 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); 
    margin: 0.5em;
}
 
button{
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); 
}

button:disabled {
    opacity: 0.8;
    background-color: #bbb !important; 
    cursor: not-allowed !important; 
}

button:disabled:hover {
    transform: none !important; 
}

#resetGame{
    background-color: rgb(151, 22, 22) !important;
}

#newRound{
    background-color: rgb(226, 95, 8) !important;
}

@media (max-width: 768px) {
    #gameWrapper {
        width: 95%; 
        padding: 15px;
    }

    #gameWrapper, #gameContainer, #playerInfo, #gameControls button {
        font-size: 0.9em; 
    }
}

@media (max-width: 480px) { 
    #gameWrapper {
        width: 100%;
        padding: 10px;
    }
    #gameWrapper, #gameContainer, #playerInfo, #gameControls button {
        font-size: 0.8em; 
    }
}
/* ------------------------------------------------------ GameOver  ------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

#gameOverScreen {
    display: none;
    flex-direction: column; 
    justify-content: center;
    align-items: center; 
    background: radial-gradient(circle, darkred 0%, rgba(2,0,36,1) 100%);
    color: white;
    text-align: center;
    font-weight: bold;
    transition: opacity 5s;
    opacity: 0;
    font-size: 2em;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    text-shadow: 0 10px 15px rgba(0, 0, 0, 0.7);
}
#gameOverScreen.visible {
    opacity: 1;
} 
#gameOverScreen h1 {
    margin-bottom: 0.4em; 
}

#gameOverScreen p {
    margin-bottom: 2em; 
}

#startNewGame{
    padding: 10px 20px;
    font-size: 1em;
    color: white;
    background: rgb(2,0,36);
    background: radial-gradient(circle, rgba(2,0,36,1) 0%, rgba(22,4,40,1) 0%, rgba(21,7,50,1) 8%, rgba(37,9,50,1) 36%, rgba(47,13,47,1) 62%, rgba(39,6,97,1) 85%, rgba(9,20,36,1) 100%);    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s, box-shadow 0.3s;
}

#startNewGame:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}