body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
    background-color: #1b1b1b;
    color: #f8f8f8;
    padding: 20px;
}

h2 {
    margin-bottom: 15px;
    font-size: 28px;
    color: #ffd700; 
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.8); 
}

#dealer-cards, #your-cards {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background-color: #2d2d2d;
    border-radius: 15px;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.7); 
    margin: 15px auto;
    width: fit-content;
}

#dealer-cards img, #your-cards img {
    height: 180px;
    width: 130px;
    border-radius: 10px;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.8); 
    border: 2px solid #ffd700; 
}

button {
    width: 150px;
    height: 55px;
    font-size: 22px;
    margin: 20px;
    border: none;
    border-radius: 30px;
    background-color: #e74c3c; 
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.4); 
}

button:hover {
    background-color: #c0392b; 
    transform: translateY(-5px); 
    box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.7);
}

#results {
    font-size: 26px;
    margin-top: 25px;
    color: #00ff99; 
    text-shadow: 1px 1px 10px rgba(0, 255, 153, 0.8); 
}

#dealer-sum, #your-sum {
    font-size: 22px;
    font-weight: bold;
    margin-top: 10px;
    color: #ffd700; 
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
}

#hidden {
    border-radius: 10px;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.8);
    border: 2px solid #ffd700;
}

#balance-container {
    margin: 20px auto;
    font-family: Arial, sans-serif;
    display: flex;
    align-items: center; 
    justify-content: center; 
    max-width: 400px; 
    gap: 20px;
}

#balance-container h2 {
    margin: 0; 
    font-size: 24px;
    color: #ffd700; 
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
}

#balance {
    font-size: 24px;
}

#current-bet-container {
    display: none;
    margin: 10px auto;
    font-family: Arial, sans-serif;
    text-align: center;
    max-width: 400px;
}

#current-bet-container h2 {
    margin: 0;
    font-size: 24px;
    color: #ffd700; 
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
}

#add-funds-container {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #ddd;
    background-color: #fff;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

#add-funds-container h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

#add-funds-container input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    width: 80%;
    box-sizing: border-box;
    margin-bottom: 20px;
    outline: none;
}

#add-funds-container input:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

#add-funds-container button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    margin: 0 10px;
    color: #fff;
    transition: background-color 0.3s ease;
}

#confirm-add {
    background-color: #28a745;
}

#confirm-add:hover {
    background-color: #218838;
}

#cancel-add {
    background-color: #dc3545;
}

#cancel-add:hover {
    background-color: #c82333;
}

#bet-container {
    margin: 20px auto;
    font-family: Arial, sans-serif;
    text-align: center;
    max-width: 350px; 
    background-color: #2d2d2d; 
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

#bet-container h3 {
    margin-bottom: 20px;
    color: #ffd700; 
    font-size: 24px;
    font-weight: bold;
}

#bet-input {
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 18px;
    width: calc(100% - 50px); 
    margin-bottom: 20px;
    outline: none;
}

#bet-input:focus {
    border-color: #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

#place-bet {
    padding: 12px 30px;
    border: none;
    border-radius: 30px;
    font-size: 20px;
    cursor: pointer;
    color: #fff;
    background-color: #e74c3c; 
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#place-bet:hover {
    background-color: #c0392b; 
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

#your-hands {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hand {
    margin: 15px;
    text-align: center;
}

.hand h3 {
    font-size: 22px;
    color: #ffd700;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
}

.hand .cards {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.hand .cards img {
    height: 180px;
    width: 130px;
    border-radius: 10px;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.8);
    border: 2px solid #ffd700;
}

.ending-icons {
    position: fixed; 
    top: 50%;
    right: 20px; 
    transform: translateY(-50%); 
}

.ending-icons a {
    margin: 1rem 0; 
    display: block;
    text-decoration: none; 
}

.ending-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px; 
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.25); 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); 
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.ending-icons i {
    font-size: 30px;
    color: #1E90FF; 
    transition: color 0.3s ease; 
}

.ending-icons a:hover i {
    color: white; 
}

.ending-icon-container:hover {
    transform: scale(1.1);
    background-color: #1E90FF;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3); 
}

h1 {
    text-align: center;
    transition: transform 0.3s ease, color 0.3s ease;
}

h1:hover {
    transform: scale(1.05);
    color: #1E90FF;
}

/* Responsive adjustments for smaller devices */
@media (max-width: 768px) {
    /* 1. Hide the <h1> title */
    h1 {
        display: none;
    }

    .ending-icons {
        position: static; /* Remove fixed positioning */
        transform: none;  /* Reset transform */
        display: flex;
        justify-content: center;
        margin: 20px 0;
    }

    .ending-icon-container {
        margin: 0 10px;
    }

    button#hit,
    button#stay,
    button#double,
    button#split {
        width: 40%;
        margin: 10px 2%; /* 5px top/bottom, 2.5% left/right */
        padding: 10px 0;
        font-size: 18px;
        border-radius: 25px;
        box-sizing: border-box;
        display: inline-block;
    }

    #balance-container {
        max-width: 300px;        /* Reduce the maximum width */
        gap: 10px;               /* Decrease the gap between elements */
        padding: 10px 15px;      /* Add some padding for better spacing */
        margin-top: -2.5rem;
        margin-bottom: -1.75rem;
    }

    /* 2. Reduce Font Size of Balance Text */
    #balance-container h2 {
        font-size: 20px;         /* Smaller font size */
        text-align: center;      /* Center the text */
    }

    /* 3. Adjust the Balance Number Font Size */
    #balance {
        font-size: 20px;         /* Smaller font size */
    }

    #dealer-cards, #your-cards {
        margin-bottom: -1.75rem;
    }
}