/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1B5E20;
    --secondary-color: #2E7D32;
    --accent-color: #FFD700;
    --text-color: #FFFFFF;
    --background-color: #0D47A1;
    --table-color: #1B5E20;
    --primary-font: Georgia, serif;
    --secondary-font: Arial, sans-serif;
    --chip-color-1: #FF5722;
    --chip-color-2: #2196F3;
    --chip-color-3: #4CAF50;
    --chip-color-4: #FF9800;
    --chip-color-5: #9C27B0;
}

body {
    font-family: var(--primary-font);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--table-color) 100%);
    color: var(--text-color);
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    transition: all 0.3s ease;
}

.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styles */
.game-header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
    position: relative;
}

/* Language Picker Styles */
.language-picker {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.language-dropdown {
    position: relative;
}

.language-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    color: var(--text-color);
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--primary-font);
    font-size: 0.9em;
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: space-between;
}

.language-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.language-arrow {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.language-dropdown.active .language-arrow {
    transform: rotate(180deg);
}

.language-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 5px;
    overflow: hidden;
}

.language-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    padding: 10px 16px;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: rgba(255, 215, 0, 0.1);
    color: var(--accent-color);
}

.language-option.active {
    background: rgba(255, 215, 0, 0.2);
    color: var(--accent-color);
    font-weight: bold;
}

.language-option.active::after {
    content: " ✓";
    float: right;
}

/* Responsive language picker */
@media (max-width: 768px) {
    .language-picker {
        position: fixed;
        top: 10px;
        right: 10px;
        z-index: 2001;
    }

    .language-button {
        padding: 6px 12px;
        font-size: 0.8em;
        min-width: 100px;
    }

    .language-menu {
        min-width: 100px;
    }

    .language-option {
        padding: 8px 12px;
        font-size: 0.8em;
    }
}

/* Table Cards Section */
.table-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.table-info h2 {
    color: var(--accent-color);
    margin-bottom: 10px;
}

.table-info p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
}

.table-cards {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    min-height: 120px;
}

.table-cards .card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.table-cards .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.table-cards .card.selected {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5);
    border: 2px solid var(--accent-color);
}


.card.selectable {
    cursor: pointer;
    outline: 2px dashed rgba(255, 215, 0, 0.5);
    outline-offset: 4px;
}

.card.selected {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
    transform: scale(1.05);
}

.game-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 35px;
}

.game-header h1 {
    font-size: 3rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
}

.game-info {
    display: none;
}

.game-info > div {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* Game Area Layout */
.game-area {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
}



/* Central Poker Table - Only for table cards */
.poker-table {
    position: relative;
    background: radial-gradient(ellipse at center, rgba(0, 100, 50, 0.3) 0%, rgba(0, 50, 25, 0.5) 100%);
    border-radius: 40px;
    border: 6px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 5;
}

/* Landscape Mode - Horizontal Table */
.poker-table[data-orientation="landscape"] {
    width: 600px;
    height: 400px;
    padding: 40px 60px;
}

/* Portrait Mode - Vertical Table */
.poker-table[data-orientation="portrait"] {
    width: 400px;
    height: 600px;
    padding: 60px 40px;
}

/* Desktop: Make poker table span full width */
@media (min-width: 1025px) {
    .poker-table[data-orientation="landscape"] {
        width: 100%;
        height: 400px;
        padding: 40px 60px;
    }

    .poker-table[data-orientation="portrait"] {
        width: 95%;
        max-width: 800px;
        height: 400px;
        padding: 40px 60px;
    }
}

/* Table Surface - Simplified for cards only */
.table-surface {
    background: rgba(0, 100, 50, 0.2);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}







.dealer-info {
    text-align: center;
    margin-bottom: 15px;
}

.dealer-info h2 {
    color: #ffd700;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.dealer-chips, .dealer-score {
    font-size: 0.9rem;
    margin: 5px 0;
    color: #cccccc;
}

.dealer-hand {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    min-height: 100px;
    align-items: center;
}

.dealer-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Players Section */
.players-section {
    grid-column: 1 / -1;
}

.player-positions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.player-1-section {
    grid-column: 1 / -1;
}

.player-slot {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 250px;
    width: 100%;
    backdrop-filter: blur(10px);
}

.player-external {
    width: 100%;
    margin: 10px 0 0 0;
}

.player-external.position-1 {
    width: 100%;
}

.player-external.position-2,
.player-external.position-3,
.player-external.position-4,
.player-external.position-5,
.player-external.position-6 {
    width: 100%;
    margin-top: 5px;
}



.player-slot:hover {
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.player-slot.active {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    background: rgba(255, 215, 0, 0.1);
}

.player-info {
    text-align: center;
    margin-bottom: 0;
}

.player-info h3 {
    color: #ffd700;
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.player-lives, .player-score {
    font-size: 0.85rem;
    margin: 3px 0;
    color: #cccccc;
}

.player-lives .lives-count {
    color: #ff6b6b;
    font-weight: bold;
}

.player-lives .lives-count[data-lives="3"] {
    color: #4ecdc4;
}

.player-lives .lives-count[data-lives="2"] {
    color: #ffa500;
}

.player-lives .lives-count[data-lives="1"] {
    color: #ff6b6b;
}

.player-status {
    height: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    color: #ffd700;
}

/* Hide player-status for other players (AI players) */
#player-2 .player-status,
#player-3 .player-status,
#player-4 .player-status {
    display: none;
}

.player-hand {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 15px 0;
    min-height: 80px;
    flex-wrap: wrap;
    border-radius: 15px;
    transition: border 0.3s ease;
}

/* Hand Cards Hover Effect - Same as table cards */
.player-hand .card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.player-hand .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

/* Hand Cards Selected Effect - Same as table cards */
.player-hand .card.selected {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5);
    border: 2px solid var(--accent-color);
}

/* Hand Cards Selectable Effect - Same as table cards */
.player-hand .card.selectable {
    cursor: pointer;
    outline: 2px dashed rgba(255, 215, 0, 0.5);
    outline-offset: 4px;
}

/* Betting Area */
.betting-area {
    margin: 15px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.current-bet {
    text-align: center;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ffd700;
}

.betting-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bet-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    cursor: pointer;
}

.bet-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffd700;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.bet-buttons {
    display: flex;
    gap: 5px;
}

.bet-btn {
    flex: 1;
    padding: 6px 8px;
    background: #228b22;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.2s;
}

.bet-btn:hover {
    background: #32cd32;
}

.player-slot:not(#player-1) .card {
    width: 60px;
    height: 84px;
}



.player-slot:not(#player-1) {
    min-height: auto;
}

.hidden {
    display: none;
}

/* Player Actions */
.player-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    margin-top: auto;
    justify-content: center;
}

/* Deck Section */
.deck-section {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.deck, .discard-pile {
    width: 80px;
    height: 110px;
    border-radius: 8px;
    position: relative;
    cursor: pointer;
}

.deck {
    background: rgba(0, 0, 139, 0.3);
    border: 2px solid #4169e1;
}

.discard-pile {
    background: rgba(139, 0, 0, 0.3);
    border: 2px solid #dc143c;
}

/* Button Styles */
.action-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.action-btn.primary {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, #ffed4e, #ffd700);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 215, 0, 0.4);
}

.action-btn.secondary {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.action-btn.secondary:hover {
    background: linear-gradient(135deg, #495057, #6c757d);
    transform: translateY(-2px);
}

.action-btn:not(:disabled):not(.primary):not(.secondary) {
    background: linear-gradient(135deg, #ffffff, #f8f9fa) !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.action-btn:not(:disabled):not(.primary):not(.secondary):hover {
    background: linear-gradient(135deg, #f8f9fa, #ffffff) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

/* Specific styling for player action buttons */
.pass-btn:not(:disabled),
.swap-one-btn:not(:disabled),
.swap-all-btn:not(:disabled),
.close-btn:not(:disabled) {
    background: linear-gradient(135deg, #ffffff, #f8f9fa) !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.pass-btn:not(:disabled):hover,
.swap-one-btn:not(:disabled):hover,
.swap-all-btn:not(:disabled):hover,
.close-btn:not(:disabled):hover {
    background: linear-gradient(135deg, #f8f9fa, #ffffff) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.action-btn:disabled {
    background: #666;
    color: #999;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.hit-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.hit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #20c997, #28a745);
}

.stand-btn {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
    color: white;
}

.stand-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #e74c3c, #dc3545);
}

/* Game Messages */
.game-messages {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.message-display {
    text-align: center;
    font-size: 1.1rem;
    color: #ffd700;
    font-weight: bold;
}

/* Settings Panel */
.game-settings {
    display:none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.settings-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.9);
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    background: #ffd700;
    transform: rotate(90deg);
}

.settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border-radius: 15px;
    padding: 30px;
    min-width: 350px;
    max-width: 500px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    display: none !important;
    backdrop-filter: blur(10px);
    z-index: 2001;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.settings-panel.active {
    display: block !important;
}

.settings-panel h3 {
    color: #ffd700;
    margin-bottom: 15px;
    text-align: center;
}

.setting-group {
    margin-bottom: 15px;
}

/* Settings modal specific styles */
.settings-modal-content {
    max-width: 500px;
}

.settings-modal-content .modal-body {
    padding: 30px;
}

.settings-modal-content .setting-group {
    margin-bottom: 20px;
}

.settings-modal-content .setting-group label {
    display: block;
    font-size: 1em;
    margin-bottom: 8px;
}

.settings-modal-content .setting-group label span {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

/* Mobile responsive settings panel */
@media (max-width: 768px) {
    .settings-panel {
        min-width: 90%;
        max-width: 90%;
        padding: 20px;
    }

    .settings-modal-content {
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    .settings-panel {
        min-width: 95%;
        max-width: 95%;
        padding: 15px;
    }

    .settings-modal-content {
        max-width: 98%;
    }

    .settings-modal-content .modal-body {
        padding: 20px;
    }
}

.setting-group label {
    display: block;
    margin-bottom: 5px;
    color: #cccccc;
}

.setting-group input,
.setting-group select {
    width: 100%;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    margin-top: 5px;
}

.setting-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    opacity: 1;
}

.setting-group input::-webkit-input-placeholder {
    color: rgba(255, 255, 255, 0.6);
    opacity: 1;
}

.setting-group input::-moz-placeholder {
    color: rgba(255, 255, 255, 0.6);
    opacity: 1;
}

.setting-group select option {
    background: #1B5E20;
    color: white;
    padding: 8px;
}

.setting-group select:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .game-table {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
        gap: 15px;
    }

    .dealer-section {
        grid-column: 1;
        grid-row: 1;
    }

    .players-section {
        grid-column: 1;
        grid-row: 3;
        grid-template-columns: repeat(2, 1fr);
    }

    .deck-section {
        grid-column: 1;
        grid-row: 2;
        flex-direction: row;
        justify-content: center;
    }
}

/* Responsive Layout with External Players */
@media (max-width: 1024px) {
    .poker-table[data-orientation="landscape"] {
        width: 500px;
        height: 320px;
        padding: 30px 40px;
    }

    .poker-table[data-orientation="portrait"] {
        width: 320px;
        height: 500px;
        padding: 40px 30px;
    }

    .player-external {
        width: 240px;
    }

    .player-slot {
        max-width: 220px;
        min-height: 160px;
        padding: 12px;
    }

}

@media (max-width: 768px) {
    .game-container {
        padding: 0;
    }

    .game-area {
        padding: 10px 0;
        min-height: auto;
    }

    .game-header {
        padding: 10px 0;
        margin-bottom: 15px;
    }

    .game-header h1 {
        font-size: 1.8rem;
    }

    .poker-table[data-orientation="landscape"] {
        width: 100%;
        height: auto;
        padding: 0;
        border-radius: 30px;
    }

    .poker-table[data-orientation="portrait"] {
        width: 100%;
        height: auto;
        padding: 0;
        border-radius: 30px;
    }

    .player-external {
        width: 200px;
    }

    .player-slot {
        max-width: 180px;
        min-height: 140px;
        padding: 8px;
    }


    .table-surface h2 {
        font-size: 1.2rem;
    }

    .table-surface {
        padding: 15px 0;
    }

    .table-surface p {
        font-size: 0.8rem;
    }

    .table-cards {
        min-height: auto;
        margin: 15px 0;
    }

    .game-info {
        flex-direction: column;
        gap: 10px;
    }



}

@media (max-width: 480px) {
    .game-container {
        padding: 0;
    }



    .game-area {
        padding: 5px 0;
        min-height: auto;
    }

    .game-header {
        padding: 5px 0;
        margin-bottom: 10px;
    }

    .poker-table {
        width: 100%;
        height: auto;
        padding: 0;
        border-radius: 20px;
    }

    .player-seat {
        width: 110px;
    }

    .poker-table .player-slot {
        max-width: 100px;
        min-height: 130px;
        padding: 8px;
    }

    .player-seat.position-1,
    .player-seat.position-3 {
        bottom: -40px;
        top: -40px;
    }

    .player-seat.position-2,
    .player-seat.position-4 {
        right: -60px;
        left: -60px;
    }

    .table-surface {
        min-width: 200px;
        max-width: 250px;
        padding: 12px 0;
    }

    .table-cards {
        min-height: auto;
        margin: 10px 0;
    }

    .table-surface h2 {
        font-size: 1rem;
    }

    .table-surface p {
        font-size: 0.7rem;
    }

}

/* Dealer Indicator */
.player-slot.is-dealer::before {
    content: '👑';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 1.5rem;
    z-index: 10;
    animation: dealerGlow 2s infinite;
}

.player-slot.is-dealer {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

@keyframes dealerGlow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Save/Load Panel */
.save-load-section {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 15px;
    margin-top: 15px;
}

.save-load-section h4 {
    color: #ffd700;
    margin-bottom: 10px;
    font-size: 1rem;
}

.save-controls, .load-controls {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.save-controls input, .load-controls select {
    flex: 1;
    min-width: 120px;
}

.auto-save-controls {
    font-size: 0.85rem;
}

.auto-save-controls input[type="checkbox"] {
    margin-right: 5px;
}

/* Player Elimination Indicator */
.player-slot.eliminated {
    opacity: 0.5;
    filter: grayscale(100%);
    border-color: #666;
}

.player-slot.eliminated::after {
    content: '❌ ELIMINATED';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 20;
}

/* Tournament Mode Styles */
.tournament-mode .game-header {
    border-bottom-color: #ffd700;
}

.tournament-mode .game-header h1::after {
    content: ' 🏆 Tournament';
    font-size: 1.5rem;
    color: #ffd700;
}

/* Side Bets Styling */
.side-bets-area {
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 10px;
}

.side-bets-panel {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    padding: 5px;
}

.side-bets-panel summary {
    cursor: pointer;
    font-weight: bold;
    color: #ffd700;
    padding: 5px;
    text-align: center;
    border-radius: 3px;
    background: rgba(255, 215, 0, 0.1);
}

.side-bets-panel summary:hover {
    background: rgba(255, 215, 0, 0.2);
}

.side-bet-options {
    padding: 10px 5px 5px;
}

.side-bet-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
    padding: 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    font-size: 0.8rem;
}

.side-bet-item.jackpot {
    background: linear-gradient(45deg, rgba(255, 215, 0, 0.1), rgba(255, 193, 7, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.side-bet-item label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 5px;
}

.side-bet-check {
    width: 14px;
    height: 14px;
}

.side-bet-amount {
    width: 45px;
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.7rem;
}

.jackpot-amount {
    color: #ffd700;
    font-weight: bold;
    font-size: 0.7rem;
}

/* Insurance Area */
.insurance-area {
    margin-top: 10px;
    padding: 8px;
    background: rgba(0, 100, 200, 0.2);
    border-radius: 5px;
    border: 1px solid rgba(0, 150, 255, 0.3);
}

.insurance-options {
    display: flex;
    gap: 5px;
}

.insurance-btn {
    flex: 1;
    padding: 4px 6px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.insurance-btn:hover {
    background: linear-gradient(135deg, #0056b3, #007bff);
    transform: translateY(-1px);
}

.insurance-btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

/* Loan Button */
.loan-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    font-size: 0.8rem;
    padding: 6px 10px;
}

.loan-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #20c997, #28a745);
}

/* Betting Analytics */
.betting-analytics {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 10px;
    padding: 15px;
    min-width: 250px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.betting-analytics.visible {
    display: block;
}

.analytics-header {
    color: #ffd700;
    text-align: center;
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: bold;
}

.analytics-row {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    font-size: 0.85rem;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.analytics-value {
    color: #ffd700;
    font-weight: bold;
}

.analytics-positive {
    color: #28a745;
}

.analytics-negative {
    color: #dc3545;
}

/* Progressive Jackpot Display */
.jackpot-display {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #000;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    animation: jackpotPulse 2s infinite;
    z-index: 1000;
}

@keyframes jackpotPulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
}

/* Game Statistics */
.game-stats {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 15px;
    min-width: 200px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    display: none;
}

.game-stats.visible {
    display: block;
}

.game-stats h4 {
    color: #ffd700;
    margin-bottom: 10px;
    text-align: center;
}

.stat-line {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    font-size: 0.9rem;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

.bounce {
    animation: bounce 0.6s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes bounce {
    0%, 20%, 60%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    80% { transform: translateY(-5px); }
}

.theme-panel {
    position: fixed;
    top: 0;
    right: -350px; /* Start off-screen */
    width: 300px;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    border-left: 2px solid rgba(255, 215, 0, 0.3);
    padding: 20px;
    backdrop-filter: blur(10px);
    transition: right 0.3s ease-in-out;
    z-index: 1001; /* Higher than settings panel */
    overflow-y: auto;
}

.theme-panel.active {
    right: 0; /* Slide in */
}

.achievements-panel {
    position: fixed;
    top: 0;
    left: -350px; /* Start off-screen */
    width: 300px;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    border-right: 2px solid rgba(255, 215, 0, 0.3);
    padding: 20px;
    backdrop-filter: blur(10px);
    transition: left 0.3s ease-in-out;
    z-index: 1001; /* Higher than settings panel */
    overflow-y: auto;
}

.achievements-panel.active {
    left: 0; /* Slide in */
}

.rules-panel {
    position: fixed;
    top: 0;
    right: -350px; /* Start off-screen */
    width: 300px;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    border-left: 2px solid rgba(255, 215, 0, 0.3);
    padding: 20px;
    backdrop-filter: blur(10px);
    transition: right 0.3s ease-in-out;
    z-index: 1001; /* Higher than other panels */
    overflow-y: auto;
}

.rules-panel.active {
    right: 0; /* Slide in */
}


.player-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.player-info-header .player-lives {
    text-align: left;
}

.player-info-header h3 {
    text-align: center;
    flex-grow: 1;
}

.player-info-header .player-score {
    text-align: right;
}

#player-1 .player-score {
    display: block;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

/* Help modal needs higher z-index to appear above flying cards */
.help-modal {
    z-index: 2500 !important;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: 2px solid var(--accent-color);
    border-radius: 15px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

.modal-header {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    text-align: center;
    position: relative;
}

.modal-header h2 {
    color: var(--accent-color);
    font-size: 1.8em;
    margin: 0;
}

.modal-header button {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 2rem;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.modal-header button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-50%) rotate(90deg);
}

.modal-body {
    padding: 30px;
    color: var(--text-color);
    font-size: 1.1em;
    line-height: 1.6;
}

.modal-footer {
    padding: 20px 30px;
    text-align: center;
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    background: rgba(0, 0, 0, 0.1);
}

.modal-footer .action-btn {
    font-size: 1.2em;
    padding: 12px 30px;
    min-width: 200px;
}

#round-results-content {
    white-space: pre-line;
}

/* Centered player names in round results */
.centered-player-name {
    text-align: center;
    margin: 8px 0;
    font-weight: bold;
    font-size: 1.1em;
}

/* Life icons styling */
.life-icons {
    font-size: 1.1em;
    letter-spacing: 2px;
    display: inline-block;
    vertical-align: middle;
}

.life-icons.eliminated {
    font-size: 1.2em;
    color: #ff4444;
    animation: pulse 2s ease-in-out infinite;
}

/* Animation for eliminated players */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Game Over Modal Styles */
.game-over-modal-content {
    max-width: 700px;
    background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 50%, #4CAF50 100%);
    border: 3px solid var(--accent-color);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.winner-announcement {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.winner-announcement h3 {
    font-size: 2.2em;
    color: var(--accent-color);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.winner-subtitle {
    font-size: 1.2em;
    color: var(--text-color);
    margin: 0;
    opacity: 0.9;
}

.game-summary {
    margin-top: 20px;
}

.game-summary h4 {
    color: var(--accent-color);
    font-size: 1.4em;
    margin-bottom: 15px;
    text-align: center;
}

.rounds-summary {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.player-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
    transition: all 0.3s ease;
}

.player-summary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.player-summary.winner {
    background: rgba(255, 215, 0, 0.2);
    border-left-color: #FFD700;
    font-weight: bold;
}

.player-name {
    font-size: 1.1em;
    color: var(--text-color);
}

.player-summary.winner .player-name {
    color: var(--accent-color);
}

.rounds-won {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--accent-color);
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    min-width: 50px;
    text-align: center;
}

.crown-icon {
    margin-right: 8px;
    font-size: 1.2em;
}

/* Table Card Replacement Animation */
.table-cards-replacing {
    animation: cardFlip 1.5s ease-in-out;
}

@keyframes cardFlip {
    0% { transform: scale(1); opacity: 1; }
    25% { transform: scale(0.9) rotateY(90deg); opacity: 0.7; }
    50% { transform: scale(0.8) rotateY(180deg); opacity: 0.3; }
    75% { transform: scale(0.9) rotateY(270deg); opacity: 0.7; }
    100% { transform: scale(1) rotateY(360deg); opacity: 1; }
}

.table-card-new {
    animation: newCardDeal 0.6s ease-out;
}

@keyframes newCardDeal {
    0% {
        transform: translateY(-50px) rotateX(90deg) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translateY(-10px) rotateX(45deg) scale(0.95);
        opacity: 0.7;
    }
    100% {
        transform: translateY(0) rotateX(0deg) scale(1);
        opacity: 1;
    }
}

/* New Table Card Highlight Animation */
.table-card-highlight {
    animation: cardSwapHighlight 2s ease-out;
}

@keyframes cardSwapHighlight {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.8);
        border-color: var(--accent-color);
        transform: scale(1);
    }
    15% {
        box-shadow: 0 0 20px 8px rgba(255, 215, 0, 0.7);
        border-color: var(--accent-color);
        transform: scale(1.08);
    }
    30% {
        box-shadow: 0 0 30px 12px rgba(255, 215, 0, 0.5);
        border-color: var(--accent-color);
        transform: scale(1.05);
    }
    50% {
        box-shadow: 0 0 25px 10px rgba(255, 215, 0, 0.4);
        border-color: var(--accent-color);
        transform: scale(1.02);
    }
    70% {
        box-shadow: 0 0 15px 6px rgba(255, 215, 0, 0.3);
        border-color: var(--accent-color);
        transform: scale(1.01);
    }
    85% {
        box-shadow: 0 0 8px 3px rgba(255, 215, 0, 0.2);
        border-color: var(--accent-color);
        transform: scale(1.005);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
        border-color: transparent;
        transform: scale(1);
    }
}

/* Smooth transitions for card swap visibility changes */
.table-card, .hand-card {
    transition: opacity 0.3s ease;
}

/* Empty slot styling during card animations */
.empty-slot {
    border: 2px dashed rgba(255, 255, 255, 0.3) !important;
    background: rgba(0, 0, 0, 0.2) !important;
    box-shadow: none !important;
    outline: none !important;
    outline-offset: 0 !important;
    transform: none !important;
}

/* Welcome Modal Specific Styles */
.welcome-modal-content {
    max-width: 700px !important;
    max-height: 90vh !important;
}

.welcome-instructions {
    text-align: left;
}

.welcome-instructions h3 {
    color: var(--accent-color);
    font-size: 1.4em;
    margin-bottom: 20px;
    text-align: center;
}

.instruction-section {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.instruction-section h4 {
    color: var(--accent-color);
    font-size: 1.2em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.instruction-section p {
    margin-bottom: 10px;
}

.instruction-section ul {
    margin-left: 20px;
    margin-top: 10px;
}

.instruction-section li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.instruction-section strong {
    color: var(--accent-color);
}

/* Welcome Modal Footer */
.welcome-modal-content .modal-footer {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.dont-show-again {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
}

.dont-show-again input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-color);
}

.dont-show-again label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

#start-playing-btn {
    background: linear-gradient(45deg, var(--accent-color), #FFA000);
    color: #000;
    font-weight: bold;
    text-shadow: none;
    transition: all 0.3s ease;
}

#start-playing-btn:hover {
    background: linear-gradient(45deg, #FFA000, var(--accent-color));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

/* Responsive adjustments for welcome modal */
@media (max-width: 768px) {
    .welcome-modal-content {
        max-width: 95% !important;
        margin: 10px;
    }

    .instruction-section {
        padding: 10px;
        margin-bottom: 15px;
    }

    .instruction-section h4 {
        font-size: 1.1em;
    }

    .modal-body {
        padding: 20px;
    }
}

/* Footer Styles */
.game-footer {
    margin-top: auto;
    padding: 20px 0 10px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
}

.footer-content {
    opacity: 0.7;
    font-size: 0.9rem;
    line-height: 1.4;
}

.footer-content p {
    margin: 5px 0;
    color: var(--text-color);
}

.footer-content strong {
    color: var(--accent-color);
    font-weight: 600;
}

.footer-content a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.footer-content a:hover {
    color: var(--gold-color);
    text-decoration: underline;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

/* Mobile footer adjustments */
@media (max-width: 768px) {
    .game-footer {
        padding: 15px 0 5px 0;
        margin-top: 20px;
    }

    .footer-content {
        font-size: 0.8rem;
    }
}

/* Desktop Sidebar Menu */
.desktop-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.desktop-sidebar.show {
    left: 0;
}

.desktop-sidebar-header {
    padding: 25px 20px;
    background: var(--accent-color);
    color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.desktop-sidebar-header h3 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.desktop-close-menu-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 5px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.desktop-close-menu-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.desktop-sidebar-content {
    padding: 30px 20px;
}

.desktop-menu-item {
    display: block;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: none;
    padding: 18px 20px;
    margin-bottom: 12px;
    border-radius: 8px;
    text-align: left;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--primary-font);
    font-weight: 500;
    border-left: 4px solid transparent;
}

.desktop-menu-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(8px);
    border-left-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.desktop-menu-item:active {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(4px);
}

/* Desktop menu trigger button */
.desktop-menu-trigger {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    color: var(--text-color);
    padding: 10px 12px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 999;
    backdrop-filter: blur(5px);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.desktop-menu-trigger:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.desktop-menu-trigger:active {
    transform: translateY(0);
}

/* Overlay for sidebar */
.desktop-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.desktop-sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Hide desktop sidebar on mobile devices */
@media (max-width: 768px) {
    .desktop-sidebar,
    .desktop-menu-trigger,
    .desktop-sidebar-overlay {
        display: none !important;
    }
}

/* Adjust main content when sidebar is open */
.main-content-shifted {
    margin-left: 300px;
    transition: margin-left 0.3s ease;
}

@media (max-width: 1200px) {
    .main-content-shifted {
        margin-left: 0;
    }
}





