:root {
    --bg-dark: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --primary: #3b82f6;
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --table-blue: #1e3a8a;
    --table-border: #0f172a;
    --card-width: 65px;
    --card-height: 95px;
}

body {
    background-color: var(--bg-dark);
    color: white;
    font-family: 'Outfit', sans-serif;
    margin: 0;
    overflow-x: hidden;
    user-select: none;
}

.game-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative;
    z-index: 10;
}

.game-header { text-align: center; }
.game-header h1 { font-size: 2.5rem; margin: 1rem 0 0 0; }

.panel {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    margin: 2rem auto;
    text-align: center;
}

.btn-group { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem; }

/** Table Area */
.poker-table {
    background: var(--table-blue);
    border: 12px solid var(--table-border);
    border-radius: 120px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 450px;
    box-shadow: inset 0 0 60px rgba(0,0,0,0.8), 0 10px 30px rgba(0,0,0,0.5);
    position: relative;
}

.player-spot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 0 1rem;
    transition: opacity 0.3s;
}
.opponent-spot { margin-bottom: 2rem; }
.my-spot { margin-top: 2rem; }

.dimmed { opacity: 0.4; }

.player-info {
    text-align: center;
    background: rgba(0,0,0,0.4);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    min-width: 120px;
}

.player-info h3 { margin: 0 0 0.2rem 0; font-size: 1rem; color: #cbd5e1; }
.chips { color: #fbbf24; font-weight: 700; font-size: 1.2rem; }
.bet { color: #38bdf8; font-size: 0.9rem; margin-top: 0.2rem; font-weight: bold; }

.hand { display: flex; gap: 5px; justify-content: center; }

.community-cards {
    min-height: var(--card-height);
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 12px;
    border: 1px dashed rgba(255,255,255,0.2);
    display: flex; gap: 5px;
}

.center-table {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.pot-display {
    background: rgba(0,0,0,0.6);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: 900;
    color: #fbbf24;
    border: 1px solid #fbbf24;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
}

.dealer-btn {
    width: 30px; height: 30px;
    background: white; color: black;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 1.2rem;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
    position: absolute;
}
#enemy-dealer-btn { right: 2rem; top: 0; }
#my-dealer-btn { left: 2rem; bottom: 0; }


/** Action Bar */
.action-bar {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem;
    background: var(--panel-bg);
    padding: 1rem; border-radius: 12px; margin-top: 1rem;
    border: 1px solid var(--glass-border);
}

.action-btn {
    padding: 0.8rem 1.5rem;
    border: none; border-radius: 8px;
    font-size: 1.1rem; font-weight: 700; cursor: pointer;
    color: white; font-family: inherit;
    transition: transform 0.1s;
}
.action-btn:active { transform: scale(0.95); }
.action-btn:disabled { opacity: 0.5; filter: grayscale(1); cursor: not-allowed; }

.fold-btn { background: #ef4444; }
.call-btn { background: #3b82f6; flex: 1; min-width: 150px; }
.raise-btn { background: #10b981; }

.raise-container {
    display: flex; align-items: center; gap: 0.5rem; flex: 2;
    background: rgba(0,0,0,0.3); padding: 0.5rem; border-radius: 8px;
}
input[type=range] { flex: 1; }
.raise-amt { font-weight: bold; color: #fbbf24; min-width: 40px; text-align: right; }

/** Cards CSS */
.card {
    width: var(--card-width);
    height: var(--card-height);
    background: white;
    border-radius: 6px;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.4);
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px;
    box-sizing: border-box;
    position: relative;
    border: 1px solid #ccc;
    font-family: Arial, sans-serif;
    animation: deal 0.3s ease-out;
}
@keyframes deal { 0% { opacity: 0; transform: translateY(-20px) scale(0.8); } 100% { opacity: 1; transform: translateY(0) scale(1); } }

.card.red { color: #ef4444; }
.card.black { color: #0f172a; }

.card-top {
    font-size: 1rem; font-weight: bold; line-height: 1;
    display: flex; flex-direction: column; align-items: center; align-self: flex-start;
}
.card-bottom {
    font-size: 1rem; font-weight: bold; line-height: 1;
    display: flex; flex-direction: column; align-items: center; align-self: flex-end;
    transform: rotate(180deg);
}
.card-suit { font-size: 1.1rem; }
.card-center {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    opacity: 0.3;
}

.card.back {
    background: #7f1d1d;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.1) 10px, rgba(255,255,255,0.1) 20px);
    border: 2px solid white;
}
.card.back * { display: none; }

.hidden { display: none !important; }

@media (max-width: 600px) {
    :root {
        --card-width: 45px;
        --card-height: 65px;
    }
    .poker-table { padding: 1rem; border-radius: 60px; min-height: 350px; border-width: 6px; }
    .card-center { font-size: 1.2rem; }
    .action-btn { font-size: 0.9rem; padding: 0.6rem 1rem; }
    .player-spot { flex-direction: column; gap: 0.5rem; }
    .opponent-spot { flex-direction: column-reverse; } /* hand above info */
}
