/* Content Section Styles */
#content-container {
    background-color: rgba(0, 0, 0, 0.3); /* Semi-transparent dark background */
    padding: 20px 0;
    color: #f0f0f0; /* Light text color for contrast */
}

#content-container h2, #content-container h3 {
    color: #ffffff; /* White headers */
    margin-bottom: 1rem;
}

#content-container h2 {
    font-size: 2em; /* Larger for main section titles */
    border-bottom: 2px solid #00ccff; /* Accent color border */
    padding-bottom: 0.5rem;
    margin-top: 1.5rem;
}

#content-container h3 {
    font-size: 1.5em; /* Slightly smaller for sub-headings */
    color: #ccffcc; /* Light green for step titles */
}

#content-container p {
    line-height: 1.6;
    margin-bottom: 1rem;
    font-family: 'Roboto', sans-serif;
}

#content-container article {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: rgba(10, 10, 22, 0.5); /* Darker, slightly transparent background for articles */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

#content-container ul {
    list-style-type: disc;
    padding-left: 25px;
    font-family: 'Roboto', sans-serif;
}

#content-container ul li {
    margin-bottom: 0.5rem;
}

#content-container .max-w-7xl {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Game Container Responsive Styles */
.game-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Canvas Responsive Styles */
#gameCanvas {
    width: 100%;
    height: auto;
    min-height: 400px;
    max-height: 600px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: block;
    max-width: 100%;
}

/* Control Buttons Responsive Layout */
#controlButtons {
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1rem;
}

#controlButtons button {
    min-width: 120px;
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

/* Player Labels Responsive */
.player-label {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}

/* Bag Counters Responsive */
.bag-counter {
    flex-shrink: 0;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    min-width: 80px;
}

/* Modal Responsive Styles */
.modal-container {
    padding: 1rem;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

/* Bidding Overlay Responsive */
#biddingOverlay .bg-white {
    max-width: 95vw;
    margin: 1rem;
}

#biddingOverlay .flex {
    gap: 0.5rem;
}

.bid-btn {
    min-width: 50px;
    padding: 0.75rem;
    font-size: 0.9rem;
}

/* Rules Modal Responsive */
#rulesModal .bg-white {
    max-width: 95vw;
    max-height: 90vh;
    margin: 1rem;
}

/* Game Stats Responsive */
#gameStats {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

#gameStats > div {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: white;
    font-weight: 500;
}

/* Header Responsive */
header h1 {
    font-size: clamp(1.5rem, 4vw, 3rem);
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Media Queries for Different Screen Sizes */

/* Extra Small Devices (phones, 576px and down) */
@media (max-width: 575.98px) {
    .game-container {
        padding: 0 0.5rem;
    }
    
    #gameCanvas {
        min-height: 300px;
        border-radius: 8px;
    }
    
    #controlButtons {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    #controlButtons button {
        width: 100%;
        max-width: 250px;
        font-size: 0.8rem;
        padding: 0.6rem 1rem;
    }
    
    .bag-counter {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
        min-width: 70px;
    }
    
    .player-label {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    #biddingOverlay .flex {
        grid-template-columns: repeat(auto-fit, minmax(45px, 1fr));
        display: grid;
        gap: 0.3rem;
    }
    
    .bid-btn {
        padding: 0.6rem 0.3rem;
        font-size: 0.8rem;
        min-width: 45px;
    }
    
    #gameStats > div {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    header {
        padding: 0.75rem 0.5rem;
    }
    
    #content-container h2 {
        font-size: 1.5rem;
    }
    
    #content-container h3 {
        font-size: 1.2rem;
    }
    
    #content-container article {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    #gameCanvas {
        min-height: 350px;
    }
    
    #controlButtons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    #controlButtons button {
        flex: 1;
        min-width: 110px;
        max-width: 150px;
    }
    
    .bag-counter {
        font-size: 0.8rem;
    }
    
    #biddingOverlay .flex {
        grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
        display: grid;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    #gameCanvas {
        min-height: 450px;
    }
    
    #controlButtons button {
        min-width: 130px;
        font-size: 1rem;
    }
    
    .bag-counter {
        font-size: 0.9rem;
    }
    
    .player-label {
        font-size: 1rem;
        padding: 0.6rem 1.2rem;
    }
    
    #biddingOverlay .flex {
        display: flex;
        flex-wrap: wrap;
    }
    
    .bid-btn {
        min-width: 60px;
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .game-container {
        max-width: 1000px;
    }
    
    #gameCanvas {
        min-height: 500px;
    }
    
    #controlButtons button {
        min-width: 140px;
        font-size: 1.1rem;
        padding: 1rem 2rem;
    }
    
    .bag-counter {
        font-size: 1rem;
        padding: 0.6rem 1rem;
    }
    
    .player-label {
        font-size: 1.1rem;
        padding: 0.7rem 1.4rem;
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .game-container {
        max-width: 1200px;
    }
    
    #gameCanvas {
        min-height: 550px;
        max-height: 600px;
    }
    
    #controlButtons button {
        min-width: 150px;
        font-size: 1.2rem;
        padding: 1.2rem 2.5rem;
    }
    
    .bag-counter {
        font-size: 1.1rem;
        padding: 0.7rem 1.2rem;
    }
    
    .player-label {
        font-size: 1.2rem;
        padding: 0.8rem 1.6rem;
    }
    
    #content-container h2 {
        font-size: 2.5rem;
    }
    
    #content-container h3 {
        font-size: 1.8rem;
    }
}

/* Landscape Orientation for Mobile Devices */
@media (max-height: 500px) and (orientation: landscape) {
    header {
        padding: 0.5rem;
    }
    
    header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    #gameStats {
        margin-bottom: 0.5rem;
    }
    
    #gameStats > div {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    #gameCanvas {
        min-height: 250px;
    }
    
    #controlButtons {
        margin-bottom: 0.5rem;
    }
    
    #controlButtons button {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .player-label {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* High DPI / Retina Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #gameCanvas {
        /* Simplified high DPI handling */
        image-rendering: auto;
    }
}

/* Canvas DPI and scaling fixes */
#gameCanvas {
    /* Ensure proper canvas scaling */
    max-width: 100%;
    height: auto;
    display: block;
}

/* Additional canvas optimization for mobile */
@media (max-width: 768px) {
    #gameCanvas {
        /* Simplified mobile canvas styling */
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        transform: translateZ(0);
    }
}

/* Print Styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }
    
    .game-container, 
    #controlButtons, 
    #gameCanvas {
        display: none !important;
    }
    
    #content-container {
        background: white !important;
        color: black !important;
    }
    
    #content-container h2,
    #content-container h3 {
        color: black !important;
        border-color: black !important;
    }
}