* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex;
    flex-direction: column;
}

/* Banner */
.banner {
    background: linear-gradient(135deg, #0a5f0a 0%, #064206 100%);
    padding: 8px 20px;
    text-align: center;
    border-bottom: 3px solid #FFD700;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    margin-bottom: 15px;
}

.banner h1 {
    color: #FFD700;
    font-size: 24px;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    letter-spacing: 2px;
}

/* Navigation Menu */
.main-nav {
    margin-top: 10px;
}

.main-nav > ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.main-nav > ul > li {
    position: relative;
}

.main-nav > ul > li > a {
    color: #FFD700;
    text-decoration: none;
    padding: 8px 16px;
    display: block;
    font-weight: bold;
    font-size: 14px;
    transition: background-color 0.3s;
}

.main-nav > ul > li > a:hover {
    background-color: rgba(255, 215, 0, 0.2);
    border-radius: 5px;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.95);
    min-width: 220px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    border-radius: 5px;
    margin-top: 5px;
    z-index: 1000;
    border: 2px solid #FFD700;
    list-style: none;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 15px;
}

.dropdown-menu li {
    display: block;
    list-style: none;
}

.dropdown-menu li a {
    color: #FFD700;
    padding: 12px 20px;
    border-radius: 0;
    display: block;
    text-decoration: none;
    white-space: nowrap;
}

.dropdown-menu li a:hover {
    background-color: rgba(255, 215, 0, 0.3);
    border-radius: 0;
}

.dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
    display: block;
    opacity: 1;
    visibility: visible;
}

.blackjack-table {
    width: 100%;
    height: 53vh;
    background: radial-gradient(ellipse at center, #0a5f0a 0%, #064206 100%);
    border: 12px solid #8B4513;
    border-radius: 50%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.5);
    margin: 0px 10px 5px 10px;
}

/* Below Table Container */
.below-table {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 15px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    gap: 12px;
    flex-wrap: wrap;
    height: 34vh;
    overflow-y: auto;
}

/* Card Counting Display */
.count-display {
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 15px;
    border-radius: 10px;
    color: #fff;
    font-size: 12px;
    border: 2px solid #FFD700;
    flex: 1;
    min-width: 200px;
}

.count-item {
    margin: 5px 0;
}

.count-label {
    font-weight: bold;
    color: #FFD700;
}

.count-value {
    margin-left: 10px;
    font-size: 18px;
    color: #00FF00;
}

/* Hint Button */
.hint-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: none;
    border-radius: 25px;
    color: #000;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.hint-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.4);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
}

.modal-content {
    background-color: #1a1a1a;
    margin: 2% auto;
    padding: 20px;
    border: 2px solid #FFD700;
    border-radius: 10px;
    width: 90%;
    max-width: 900px;
    color: #fff;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #fff;
}

.modal-content h2 {
    text-align: center;
    color: #FFD700;
    margin-bottom: 20px;
}

.strategy-chart {
    overflow-x: auto;
}

.strategy-chart table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.strategy-chart th,
.strategy-chart td {
    border: 1px solid #444;
    padding: 8px;
    text-align: center;
    font-size: 12px;
}

.strategy-chart th {
    background-color: #333;
    color: #FFD700;
    font-weight: bold;
}

.strategy-chart td:first-child {
    background-color: #2a2a2a;
    font-weight: bold;
    color: #FFD700;
}

.hit {
    background-color: #8B0000;
    color: #fff;
    font-weight: bold;
}

.stand {
    background-color: #006400;
    color: #fff;
    font-weight: bold;
}

.double {
    background-color: #DAA520;
    color: #000;
    font-weight: bold;
}

.split {
    background-color: #4169E1;
    color: #fff;
    font-weight: bold;
}

.legend {
    margin-top: 15px;
    padding: 10px;
    background-color: #2a2a2a;
    border-radius: 5px;
}

.legend p {
    margin: 5px 0;
    font-size: 14px;
}

/* Game Area */
.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    padding-bottom: 100px;
}

.dealer-section,
.player-section {
    text-align: center;
}

.dealer-section h2,
.player-section h2 {
    color: #FFD700;
    font-size: 13px;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hand {
    min-height: 70px;
    display: flex;
    gap: 5px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.card {
    width: 48px;
    height: 67px;
    background: white;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
    position: relative;
    transition: transform 0.3s;
    animation: dealCard 0.5s ease-out;
}

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

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

.card.red {
    color: #DC143C;
}

.card.black {
    color: #000;
}

.card-back {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
}

.card-value {
    font-size: 15px;
}

.card-suit {
    font-size: 12px;
}

.score {
    margin-top: 5px;
    margin-bottom: 100px;
    font-size: 18px;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Controls */
.controls {
    position: absolute;
    bottom: 15px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.game-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.game-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#hit-btn {
    background: linear-gradient(135deg, #DC143C, #8B0000);
    color: white;
}

#stand-btn {
    background: linear-gradient(135deg, #228B22, #006400);
    color: white;
}

#double-btn {
    background: linear-gradient(135deg, #FFD700, #DAA520);
    color: #000;
}

#split-btn {
    background: linear-gradient(135deg, #FF8C00, #FF6347);
    color: white;
}

#deal-btn {
    background: linear-gradient(135deg, #4169E1, #1e3c72);
    color: white;
}

.game-btn:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 10px rgba(0,0,0,0.4);
}

.game-btn:not(:disabled):active {
    transform: translateY(-1px);
}

/* Betting Area */
.betting-area {
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 15px;
    border-radius: 10px;
    border: 2px solid #FFD700;
    flex: 1;
    min-width: 300px;
}

.chips-display {
    text-align: center;
    margin-bottom: 8px;
}

.chips-display h3 {
    color: #FFD700;
    font-size: 16px;
}

.bet-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin: 8px 0;
    flex-wrap: wrap;
}

.bet-controls label {
    color: #fff;
    font-weight: bold;
    font-size: 12px;
}

#bet-amount {
    padding: 6px;
    width: 80px;
    border-radius: 5px;
    border: 2px solid #FFD700;
    font-size: 14px;
    text-align: center;
}

.chip-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    width: 45px;
    height: 45px;
    font-size: 11px;
}

#bet-10 {
    background: linear-gradient(135deg, #fff, #ccc);
    color: #000;
}

#bet-25 {
    background: linear-gradient(135deg, #DC143C, #8B0000);
    color: #fff;
}

#bet-50 {
    background: linear-gradient(135deg, #4169E1, #1e3c72);
    color: #fff;
}

#bet-100 {
    background: linear-gradient(135deg, #FFD700, #DAA520);
    color: #000;
}

.chip-btn:hover {
    transform: scale(1.1);
}

.current-bet {
    text-align: center;
    color: #00FF00;
    font-size: 18px;
    font-weight: bold;
    margin-top: 10px;
}

/* Message Display */
.message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 30px 50px;
    border-radius: 15px;
    color: #FFD700;
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    display: none;
    border: 3px solid #FFD700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    z-index: 100;
}

.message.show {
    display: block;
    animation: messagePopup 0.5s ease-out;
}

@keyframes messagePopup {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Reset Button */
.reset-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 100px);
    padding: 15px 40px;
    background: linear-gradient(135deg, #FF4500, #8B0000);
    border: 2px solid #FFD700;
    border-radius: 10px;
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    transition: transform 0.2s;
    z-index: 101;
}

.reset-btn:hover {
    transform: translate(-50%, 100px) scale(1.05);
}

/* Tutorial */
.tutorial {
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 15px;
    border-radius: 10px;
    color: #fff;
    border: 2px solid #FFD700;
    flex: 2;
    min-width: 300px;
}

.tutorial h3 {
    color: #FFD700;
    margin-bottom: 8px;
    font-size: 14px;
}

.tutorial p {
    margin: 4px 0;
    font-size: 11px;
    line-height: 1.4;
}

/* Responsive adjustments */
@media (max-height: 700px) {
    .banner h1 {
        font-size: 20px;
    }

    .banner {
        padding: 6px 15px;
        margin-bottom: 50px;
    }

    .blackjack-table {
        height: 60vh;
    }

    .below-table {
        height: 37vh;
    }

    .game-area {
        gap: 10px;
        margin-top: 15px;
        padding-bottom: 40px;
    }
}

@media (max-width: 1200px) {
    .below-table {
        flex-direction: column;
        padding: 10px 15px;
    }

    .betting-area,
    .count-display,
    .tutorial {
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    .banner h1 {
        font-size: 18px;
        letter-spacing: 1px;
    }

    .banner {
        padding: 6px 10px;
        margin-bottom: 20px;
    }

    .blackjack-table {
        height: 50vh;
    }

    .below-table {
        height: 39vh;
    }

    .card {
        width: 50px;
        height: 70px;
        font-size: 14px;
    }

    .card-value {
        font-size: 16px;
    }

    .card-suit {
        font-size: 12px;
    }

    .game-btn {
        padding: 8px 15px;
        font-size: 12px;
    }

    .game-area {
        gap: 20px;
        margin-top: 5px;
        padding-bottom: 80px;
    }
}
