body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a5c1a, #0a380a);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

#game-container {
    background: rgba(0, 60, 0, 0.8);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    max-width: 800px;
    width: 100%;
}

#dealer-area, #player-area {
    margin-bottom: 30px;
    min-height: 200px;
}

.hand-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
}

.card {
    font-family: 'Arial', sans-serif;
    background-color: white;
    border-radius: 10px;
    display: inline-block;
    margin-right: 10px; /* Add some space between cards */
    padding: 0px 0px;
    width: 120px;
    height: 168px;
    opacity: 1;
    line-height: 168px;
    overflow: hidden;
    transform: scaleX(0.9) scaleY(1);
    box-shadow: 0px 0px 25px rgba(0,0,0,0.2);
    position: relative; /* Change from absolute to relative */
    background-size: cover;
    background-position: center;
}

.hand {
    display: flex; /* Use flexbox for horizontal alignment */
    justify-content: flex-start;
    align-items: center;
    min-height: 180px; /* Ensure enough space for cards */
}

.active-hand {
    box-shadow: 0 0 10px 5px rgba(255, 255, 0, 0.5);
}

.inactive-hand {
    opacity: 0.7;
}

.deck {
    visibility: hidden; /* Hide the deck */
}

.card-placeholder {
    width: 100px;
    height: 140px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px);
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-placeholder {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
}

#controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

#controls button {
    background-color: #4CAF50;
    border: none;
    color: white;
    padding: 12px 24px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-weight: bold;
}

#controls button:hover {
    background-color: #45a049;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#controls button:active {
    transform: translateY(1px);
}

#controls button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#betting-area {
    margin: 20px 0;
    text-align: center;
}

#bet-display {
    font-size: 18px;
    margin-bottom: 10px;
}

#bet-chips {
    min-height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#chip-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.chip {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.chip:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.chip[data-value="10"] { background: linear-gradient(135deg, #ff4136, #85144b); }
.chip[data-value="25"] { background: linear-gradient(135deg, #2ecc40, #3d9970); }
.chip[data-value="50"] { background: linear-gradient(135deg, #0074d9, #001f3f); }
.chip[data-value="100"] { background: linear-gradient(135deg, #111111, #aaaaaa); }

.chip:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#bet-chips .chip {
    cursor: pointer;
    transition: transform 0.2s ease;
}

#bet-chips .chip:hover {
    transform: scale(1.1);
}

#deal-button {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    font-size: 18px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#deal-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#notification-area {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
    margin-bottom: 20px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(-20px);
}

#notification-area.visible {
    opacity: 1;
    transform: translateY(0);
}

#notification-message {
    margin: 0;
}

#stats {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
}

#welcome-screen, #rules-modal {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
}

#welcome-screen h1 {
    font-size: 3em;
    margin-bottom: 30px;
}

#welcome-screen button, #rules-modal button {
    margin: 10px;
    padding: 15px 30px;
    font-size: 18px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #2c3e50;
    color: #ecf0f1;
    margin: 15% auto;
    padding: 30px;
    border: 1px solid #34495e;
    width: 80%;
    max-width: 600px;
    border-radius: 15px;
}

.modal-content h2 {
    color: #3498db;
}

@keyframes dealCard {
    0% {
        transform: translateY(-100px) rotateY(180deg);
        opacity: 0;
    }
    100% {
        transform: translateY(0) rotateY(0);
        opacity: 1;
    }
}

.dealt-card {
    animation: dealCard 0.5s ease-out;
}

@keyframes flyToBoard {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(0, -100px) scale(1.2); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes flyOffBoard {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(100px, -100px) scale(0.8); }
    100% { transform: translate(200px, 0) scale(0); }
}

@media (max-width: 768px) {
    #game-container {
        padding: 15px;
    }
    .card, .card-placeholder {
        width: 80px;
        height: 112px;
    }
    #controls {
        flex-wrap: wrap;
    }
    .chip {
        width: 50px;
        height: 50px;
        font-size: 14px;
    }
}

.deck {
    width: 100px;
    height: 140px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background-image: url('cards/back.svg');
    background-size: cover;
}


.flying-card {
    width: 100px;
    height: 140px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: absolute;
    z-index: 101;
    transition: left 0.5s ease-out, top 0.5s ease-out;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

@keyframes leafSpin {
    0% {
        transform: translateZ(-100px) rotateY(0deg) rotateX(0deg);
    }
    25% {
        transform: translateZ(-100px) rotateY(90deg) rotateX(5deg);
    }
    50% {
        transform: translateZ(-100px) rotateY(180deg) rotateX(0deg);
    }
    75% {
        transform: translateZ(-100px) rotateY(270deg) rotateX(-5deg);
    }
    100% {
        transform: translateZ(-100px) rotateY(360deg) rotateX(0deg);
    }
}

.animated-dialog {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 18px;
    text-align: center;
    z-index: 1000;
    visibility: hidden;
}

@keyframes bounceInUp {
    0%, 60%, 75%, 90%, 100% {
        transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    }
    0% {
        opacity: 0;
        transform: translate3d(-50%, 3000px, 0);
    }
    60% {
        opacity: 1;
        transform: translate3d(-50%, -20px, 0);
    }
    75% {
        transform: translate3d(-50%, 10px, 0);
    }
    90% {
        transform: translate3d(-50%, -5px, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

@keyframes fadeOutUp {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate3d(-50%, -100%, 0);
    }
}