body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #28a745; /* Green felt look */
    color: #fff;
    margin: 0;
    padding: 20px;
}

.game-container {
    background-color: #1a6f32;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    text-align: center;
    width: 100%;
    max-width: 800px;
}

h1 {
    color: #ffd700; /* Gold */
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

h2 {
    color: #eee;
    margin-top: 20px;
    margin-bottom: 15px;
}

.game-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: bold;
    color: #eee;
}

.hand {
    display: flex;
    justify-content: center;
    gap: 10px;
    min-height: 120px; /* Placeholder for cards */
    margin-bottom: 20px;
}

.card {
    background-color: #fff;
    color: #000;
    border: 1px solid #000;
    border-radius: 8px;
    width: 80px;
    height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    font-size: 1.8em;
    font-weight: bold;
    position: relative;
}

.card.red {
    color: #e74c3c; /* Red for Heart/Diamond */
}

.card-value {
    font-size: 1.2em;
}

.card-suit {
    font-size: 1.8em;
}

.card.face-down {
    background-color: #000080; /* Dark blue for back */
    color: #fff;
    font-size: 0.8em;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Bet Controls */
.bet-controls {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.bet-controls label {
    font-size: 1.1em;
    font-weight: bold;
}

.bet-controls input[type="number"] {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
    width: 80px;
    text-align: center;
    font-size: 1em;
    background-color: #f0f0f0;
    color: #333;
}

.controls button, .bet-controls button, .game-info-buttons button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 25px;
    margin: 0 5px; /* Adjust margin for more buttons */
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px #0056b3;
}

.controls button:hover, .bet-controls button:hover, .game-info-buttons button:hover {
    background-color: #0056b3;
    transform: translateY(1px);
}

.controls button:active, .bet-controls button:active, .game-info-buttons button:active {
    background-color: #004085;
    transform: translateY(3px);
    box-shadow: 0 1px #004085;
}

.controls button:disabled, .bet-controls button:disabled, .game-info-buttons button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    box-shadow: 0 4px #999999;
}

.game-messages p {
    font-size: 1.4em;
    min-height: 40px; /* Placeholder */
    margin-top: 20px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.hidden {
    display: none;
}

/* New div for info buttons */
.game-info-buttons {
    margin-top: 20px;
    margin-bottom: 20px;
}


/* Inventory Styling */
.inventory-area {
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
}

.inventory {
    display: flex;
    justify-content: center;
    gap: 10px; /* Smaller gap for 5 slots */
    min-height: 100px;
    flex-wrap: wrap; /* Allows wrapping if space is tight */
}

.joker-slot {
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    width: 85px; /* Slightly smaller for 5 slots */
    height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 0.9em;
    color: #ccc;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.3);
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.joker-slot.empty::before {
    content: 'Joker Slot';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.5);
}

.joker-slot.has-joker {
    background-color: #f39c12; /* Orange for Joker */
    border: 2px solid #e67e22;
    color: #fff;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
    font-size: 1em;
}

.joker-slot.has-joker::before {
    display: none;
}

.joker-slot.has-joker .joker-name {
    font-size: 0.9em;
    text-align: center;
    line-height: 1.2;
}

.joker-slot.has-joker .joker-effect {
    font-size: 0.7em;
    text-align: center;
    margin-top: 5px;
}

/* Highscore Styling */
.highscore-area {
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
}

.highscore-area h2 {
    margin-bottom: 15px;
}

#highscore-list {
    list-style: none; /* Remove default bullet points */
    padding: 0;
    margin: 0 auto;
    max-width: 300px;
}

#highscore-list li {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 8px 15px;
    margin-bottom: 5px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    font-size: 1.1em;
    color: #eee;
}

#highscore-list li:nth-child(1) {
    background-color: #ffd700; /* Gold for 1st place */
    color: #333;
    font-weight: bold;
}
#highscore-list li:nth-child(2) {
    background-color: #c0c0c0; /* Silver for 2nd place */
    color: #333;
}
#highscore-list li:nth-child(3) {
    background-color: #cd7f32; /* Bronze for 3rd place */
    color: #eee;
}

/* Modal Styling */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.7); /* Black w/ opacity */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #1a6f32;
    margin: auto;
    padding: 30px;
    border: 1px solid #888;
    border-radius: 15px;
    width: 80%;
    max-width: 700px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    position: relative;
    color: #fff;
    text-align: left;
}

.modal-content h2, .modal-content h3 {
    color: #ffd700;
    text-align: center;
    margin-bottom: 15px;
}

.modal-content ul {
    list-style-type: disc;
    margin-left: 20px;
    margin-bottom: 15px;
}

.modal-content li {
    margin-bottom: 8px;
}

.modal-content p {
    font-size: 1em;
    line-height: 1.5;
    margin-bottom: 10px;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

/* Joker Shop Specific Styles */
#joker-shop-modal .modal-content {
    max-width: 600px; /* Adjust width for shop */
}

#shop-offers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.shop-item {
    background-color: rgba(255, 255, 255, 0.15);
    border: 2px solid #ffd700; /* Gold border for shop items */
    border-radius: 10px;
    padding: 15px;
    width: 160px; /* Fixed width for shop items */
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.shop-item h4 {
    color: #fff;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.shop-item p {
    font-size: 0.9em;
    color: #eee;
    flex-grow: 1; /* Allows effect text to take space */
    margin-bottom: 10px;
}

.shop-item .buy-button {
    background-color: #28a745; /* Green buy button */
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease;
}

.shop-item .buy-button:hover {
    background-color: #218838;
}

.shop-item .buy-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.shop-money-display {
    font-size: 1.2em;
    font-weight: bold;
    color: #ffd700;
    margin-top: 15px;
}


/* Responsive adjustments for smaller screens */
@media (max-width: 600px) {
    .game-container {
        padding: 15px;
    }
    .hand {
        gap: 5px;
    }
    .card {
        width: 60px; /* Smaller for mobile view */
        height: 90px;
        font-size: 1.2em;
    }
    .controls button, .bet-controls button, .game-info-buttons button {
        padding: 8px 12px;
        font-size: 0.9em;
        margin: 0 4px;
    }
    .joker-slot {
        width: 65px; /* Smaller for mobile view */
        height: 70px;
        font-size: 0.7em;
    }
    .joker-slot.empty::before {
        font-size: 0.6em;
    }
    .game-stats {
        font-size: 1em;
    }
    .bet-controls input {
        width: 60px;
    }
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    .shop-item {
        width: 120px; /* Smaller for mobile shop items */
        padding: 10px;
        font-size: 0.8em;
    }
    .shop-item .buy-button {
        padding: 6px 10px;
        font-size: 0.9em;
    }
}