/* Base styles - Consolidated from all previous CSS files */
:root {
    /* Colors */
    --accent-color: #FFD700;
    --table-color: #006400;
    --dark-overlay: rgba(0, 0, 0, 0.6);
    --text-color: #ffffff;
    --error-color: #ff4444;
    --success-color: #00C851;

    /* Sizes */
    --card-width: 70px;
    --card-height: 100px;
    --card-width-mobile: 60px;
    --card-height-mobile: 84px;
    --base-font-size: 16px;
    --base-font-size-mobile: 14px;
    
    /* Typography */
    --heading-font: 'Times New Roman', serif;
    --body-font: 'Arial', sans-serif;

    /* Spacing */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 40px;

    /* Assets */
    --felt-texture: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Cpath d='M1 3h1v1H1V3zm2-2h1v1H3V1z' fill='rgba(0,0,0,.15)'/%3E%3C/svg%3E");
}

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

body {
    font-family: var(--body-font);
    line-height: 1.5;
    color: var(--text-color);
    background-color: #121212;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: var(--base-font-size);
    background-image: linear-gradient(to bottom, #1a1a1a, #121212);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    color: var(--accent-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

h1 {
    text-align: center;
    margin-bottom: 15px;
    color: var(--accent-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-family: 'Times New Roman', serif;
    letter-spacing: 2px;
}

h2 {
    color: var(--accent-color);
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Game container */
.game-container {
    background: var(--table-color);
    background-image: var(--felt-texture);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), inset 0 0 60px rgba(0, 0, 0, 0.4);
    position: relative;
    transform-origin: top left;
    width: 800px;
    height: 600px;
    overflow: hidden;
    border: 8px solid #8B4513;
}

/* Casino table border details */
.game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid rgba(255, 215, 0, 0.2);
    border-radius: 10px;
    pointer-events: none;
}

/* Decorative wooden rim at bottom */
.game-container::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 20px;
    background: #8B4513;
    z-index: 0;
    box-shadow: 0 -5px 10px rgba(0,0,0,0.3);
    opacity: 0.5;
}

/* Table */
.table {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    height: 270px;
    margin-top: -10px;
    padding-bottom: 10px;
    background: var(--table-color);
    background-image: var(--felt-texture);
    border-radius: 15px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
    border: 5px solid #8B4513;
}

/* Add decorative elements */
.table::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    pointer-events: none;
}

/* Position labels */
.position-label {
    position: absolute;
    color: var(--accent-color);
    font-weight: bold;
    font-size: 18px;
    font-family: 'Times New Roman', serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    z-index: 15;
}

.dealer-label {
    top: 5px;
    left: 5px;
}

.player-label {
    bottom: 5px;
    left: 5px;
}

.dealer-area, .player-area {
    height: 150px;
    position: relative;
    padding-top: 5px;
}

/* Add playing area markers */
.dealer-area::after, .player-area::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 100px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    z-index: 0;
}

.score {
    display: inline-block;
    background: var(--dark-overlay);
    padding: 5px 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    z-index: 10;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.hand {
    display: flex;
    position: relative;
    height: 120px;
    width: 100%;
    margin-top: -10px;
}

/* Cards */
.card {
    width: var(--card-width);
    height: var(--card-height);
    background: white;
    border-radius: 5px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
    position: relative;
    color: black;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px;
    transition: transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    transform-origin: center bottom;
    z-index: 5;
}

.card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 215, 0, 0.5);
    z-index: 10;
}

.card.face-down {
    background: linear-gradient(135deg, #0b6e99 25%, #083d56 25%, #083d56 50%, #0b6e99 50%, #0b6e99 75%, #083d56 75%);
    background-size: 20px 20px;
    color: transparent;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6);
}

.value {
    font-size: calc(var(--base-font-size) * 1.2);
    font-weight: bold;
    font-family: 'Times New Roman', serif;
}

.suit {
    font-size: calc(var(--base-font-size) * 1.8);
    text-align: center;
}

.suit-hearts, .suit-diamonds {
    color: #e60000;
}

.suit-clubs, .suit-spades {
    color: #000000;
}

/* Betting */
.balance {
    margin: 10px 0;
    font-weight: bold;
    font-size: calc(var(--base-font-size) * 1.1);
    color: var(--accent-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    background: var(--dark-overlay);
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.bet-area {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 10px 0;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.bet-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 5px 0;
}

/* Chips */
.chip {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    border: 3px dashed rgba(255, 255, 255, 0.4);
}

.chip::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.chip:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 215, 0, 0.4);
}

.chip:active {
    transform: scale(0.95);
}

.chip-1 {
    background: white;
    color: black;
}

.chip-5 {
    background: red;
    color: white;
}

.chip-25 {
    background: green;
    color: white;
}

.chip-100 {
    background: black;
    color: white;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
    position: relative;
    z-index: 20;
}

button {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    background: var(--accent-color);
    color: #333;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button:hover:not(:disabled) {
    background: #FFC107;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
}

button:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

button:disabled {
    background: #333;
    color: #888;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

/* Info card */
.info-card {
    background: var(--dark-overlay);
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.3);
    position: relative;
    z-index: 5;
}

.info-title {
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 5px;
    font-size: calc(var(--base-font-size) * 1.1);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.info-details {
    font-size: calc(var(--base-font-size) * 0.9);
    opacity: 0.9;
}

/* Deck */
#deck-container {
    width: 100px;
    height: 150px;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 50;
    border-radius: 5px;
}

.deck-cards {
    position: relative;
    width: 100%;
    height: 100%;
}

.deck-card {
    position: absolute;
    width: var(--card-width);
    height: var(--card-height);
    transition: all 0.5s ease, opacity 0.3s ease;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    background: linear-gradient(135deg, #0b6e99 25%, #083d56 25%, #083d56 50%, #0b6e99 50%, #0b6e99 75%, #083d56 75%);
    background-size: 20px 20px;
    backface-visibility: hidden;
}

.deck-count {
    position: absolute;
    bottom: -20px;
    width: 100%;
    text-align: center;
    font-weight: bold;
    color: white;
    background: var(--dark-overlay);
    border-radius: 10px;
    padding: 2px 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes dealCard {
    0% {
        transform: translate(100px, -100px) rotate(20deg) scale(1);
        opacity: 0;
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }
    20% {
        opacity: 1;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    }
    100% {
        transform: translate(0, 0) rotate(0) scale(1);
        opacity: 1;
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
    }
}

@keyframes flipCard {
    0% {
        transform: rotateY(0deg);
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
    }
    50% {
        transform: rotateY(90deg);
        box-shadow: 0 0 1px rgba(0, 0, 0, 0.5);
    }
    100% {
        transform: rotateY(0deg);
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
    }
}

.card-dealing {
    animation: dealCard 0.6s cubic-bezier(0.2, 0.8, 0.2, 1.2) forwards;
    backface-visibility: hidden;
    will-change: transform, opacity;
}

.card-flipping {
    animation: flipCard 0.3s ease-in-out;
    backface-visibility: hidden;
    will-change: transform;
    transform-style: preserve-3d;
}

/* Win amount animation */
.win-amount {
    animation: floatUp 1.5s ease-out forwards;
    font-family: 'Arial', sans-serif;
    text-shadow: 0 0 5px gold, 0 0 10px gold;
}

/* Table decorations */
.table-decoration {
    position: absolute;
    pointer-events: none;
    opacity: 0.15;
    z-index: 1;
}

.table-decoration.spade {
    bottom: 20px;
    left: 20px;
    font-size: 50px;
}

.table-decoration.heart {
    top: 20px;
    right: 20px;
    font-size: 50px;
}

.table-decoration.diamond {
    top: 20px;
    left: 20px;
    font-size: 50px;
}

.table-decoration.club {
    bottom: 20px;
    right: 20px;
    font-size: 50px;
}

/* Audio controls */
.audio-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
}

#music-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--dark-overlay);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
    padding: 0;
    opacity: 0.7;
}

#music-toggle:hover {
    transform: scale(1.1);
    opacity: 1;
    box-shadow: 0 0 10px var(--accent-color);
}

/* Media queries for mobile */
@media (max-width: 767px) {
    /* Update variables for mobile */
    :root {
        --card-width: var(--card-width-mobile);
        --card-height: var(--card-height-mobile);
        --base-font-size: var(--base-font-size-mobile);
    }

    .game-container {
        width: 100%;
        height: 100vh;
        padding: var(--spacing-sm);
        border-width: 4px;
    }
    
    .table {
        height: 45vh;
        gap: var(--spacing-sm);
    }
    
    .dealer-area, .player-area {
        height: 45%;
    }
    
    .bet-area {
        gap: 8px;
        padding: 5px;
        position: fixed;
        bottom: 80px;
        left: 0;
        right: 0;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }
    
    .chip {
        width: 45px;
        height: 45px;
        font-size: 0.9em;
        margin: 0 auto;
    }
    
    .controls {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: var(--spacing-sm);
        background: var(--dark-overlay);
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xs);
    }
    
    .controls button {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .info-card {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        padding: var(--spacing-sm);
        font-size: 0.9em;
        background: linear-gradient(var(--dark-overlay), transparent);
    }
    
    #deck-container {
        width: 80px;
        height: 120px;
        right: 10px;
        transform: translateY(-50%) scale(0.8);
    }
    
    .hand {
        transform: scale(0.9);
        margin-top: -10px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    .table-decoration {
        display: none;
    }
    
    .position-label {
        font-size: 16px;
    }
}
