:root {
    --table-bg: #0a6c2f;
    --table-border: #5a3a22;
    --felt-green: #074f22;
    --text-color: #f0f0f0;
    --gold-color: #ffd700;
    --dark-wood: #3d2a1a;
    --button-primary-bg: #d4af37;
    --button-secondary-bg: #555;
    --font-title: 'Playfair Display', serif;
    --font-main: 'Lato', sans-serif;
}

body {
    background-color: var(--dark-wood);
    color: var(--text-color);
    font-family: var(--font-main);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

#game-table {
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    max-height: 800px;
    background: radial-gradient(circle, var(--table-bg), var(--felt-green));
    border: 15px solid var(--table-border);
    border-radius: 150px;
    box-shadow: 0 0 30px rgba(0,0,0,0.7), inset 0 0 25px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    position: relative;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 50px;
    color: var(--gold-color);
}

header h1 {
    font-family: var(--font-title);
    font-size: 2.5em;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.5);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

#wallet {
    font-size: 1.5em;
    background: rgba(0,0,0,0.3);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid var(--gold-color);
}

main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

.area { min-height: 180px; }
.hand {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 150px;
    perspective: 1000px;
}

.hand .card:not(:first-child) { margin-left: -50px; }

.card {
    width: 100px;
    height: 145px;
    background: #fff;
    color: #111;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    transition: transform 0.5s ease;
    border: 1px solid #aaa;
    font-size: 2.5em;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card.hidden { background: repeating-linear-gradient(45deg, #a00, #a00 10px, #d00 10px, #d00 20px); }
.card.red { color: #d32f2f; }
.card::before, .card::after {
    content: attr(data-content);
    position: absolute;
    font-size: 0.6em;
    line-height: 1;
}
.card::before { top: 8px; left: 8px; }
.card::after { bottom: 8px; right: 8px; transform: rotate(180deg); }

.score-box {
    background: rgba(0,0,0,0.4);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 1.1em;
    display: inline-block;
    margin-bottom: 10px;
    border: 1px solid rgba(255,255,255,0.2);
}

#player-hands-container {
    display: flex;
    justify-content: center;
    gap: 40px;
}
.player-hand-area {
    padding: 10px;
    border-radius: 10px;
    transition: all 0.3s ease;
}
.player-hand-area.active-hand {
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 15px var(--gold-color);
}


#game-notifications { text-align: center; min-height: 60px; }
#game-result {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--gold-color);
    text-shadow: 2px 2px 5px #000;
}
.insurance-prompt {
    background: rgba(0,0,0,0.7);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--gold-color);
}

footer {
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.action-button, .control-button {
    background: var(--button-secondary-bg);
    color: var(--text-color);
    border: 2px solid #333;
    padding: 12px 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin: 5px;
    text-transform: uppercase;
}
.action-button:hover:not(:disabled) {
    background-color: #777;
    transform: translateY(-2px);
}
.action-button.primary {
    background: var(--button-primary-bg);
    color: #111;
    border-color: var(--gold-color);
}
.action-button.primary:hover:not(:disabled) {
    background-color: #fbec5d;
}
.action-button:disabled {
    background-color: #333;
    color: #777;
    cursor: not-allowed;
    border-color: #222;
}

.action-button.strategy-suggestion {
    box-shadow: 0 0 15px 5px #00ffff;
}

.betting-chips { display: flex; gap: 10px; margin: 10px 0; }
.chip {
    width: 60px; height: 60px;
    border-radius: 50%;
    border: 4px double #ccc;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}
.chip:hover { transform: scale(1.1); }
.chip.c10 { background: #d32f2f; }
.chip.c25 { background: #1976d2; }
.chip.c100 { background: #388e3c; }
.chip.c500 { background: #5e35b1; }

/* Modals */
.modal-hidden { display: none; }
.modal {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
}
.modal-content {
    background: var(--dark-wood);
    padding: 30px; border-radius: 10px;
    border: 2px solid var(--gold-color);
    max-width: 600px;
    position: relative;
}
.close-modal-button {
    position: absolute; top: 10px; right: 15px;
    background: none; border: none; font-size: 2em; color: var(--text-color);
}
#stats-content { text-align: left; }
#stats-content p { font-size: 1.2em; margin: 10px 0; }
#stats-content strong { color: var(--gold-color); }