
/* Custom styles adapted for the Quartz theme */
:root {
    --quartz-primary: #593196;
    --quartz-secondary: #18b2b2;
    --quartz-dark: #343f56;
    --quartz-light: #f8f9fa;
    --navbar-height: 0px; /* CSS variable for navbar height, updated by JS */
}

html, body {
    height: 100%; /* Ensure html and body take full height of the viewport */
    margin: 0;
    overflow-x: hidden; /* Prevent horizontal scrolling always */
    overflow-y: hidden; /* Prevent scrolling on desktop by default */
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center; /* Center horizontally */
    align-items: center;    /* Center vertically for the main game content */
    flex-direction: column; /* Allows navbar and game-console to stack for layout */
    background-color: var(--bs-body-bg);
    box-sizing: border-box;
    min-height: 100vh; /* Ensure body takes full viewport height */
    padding: 0.5rem; /* Overall side padding for the body */
    padding-top: var(--navbar-height); /* Set by JS to push content below navbar */
}

.game-console {
    background: linear-gradient(to bottom, #212529, #343f56);
    border: 5px solid var(--quartz-secondary);
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(24, 178, 178, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.5);
    padding: 1.5rem;
    width: 100%;
    max-width: 900px; /* Consistent max-width */
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: 1;

    margin-top: auto; /* Auto margins for vertical centering within flex container */
    margin-bottom: auto;
    flex-grow: 1; /* Allow it to grow to fill available vertical space */
    /* Calculate max-height to ensure it fits, accounting for body padding and its own margins */
    max-height: calc(100vh - var(--navbar-height) - 1rem - 40px); /* 1rem for body top/bottom padding, 40px for .game-console's inferred vertical margin (padding + margins + buffer) */
}

.playing-surface {
    background-color: var(--quartz-dark);
    border-radius: 15px;
    padding: 1rem;
    border: 3px solid #495057;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-around;
}

.hand-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex-grow: 1;
    justify-content: center;
}

.hand-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.hand-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-grow: 1;
    min-height: 90px;
}

.hand-label {
    font-size: 1.0rem;
    color: var(--quartz-light);
    text-transform: uppercase;
}

.score-display {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--quartz-light);
    background-color: rgba(0,0,0,0.3);
    padding: 3px 10px;
    border-radius: 10px;
    border: 2px solid var(--quartz-secondary);
}

.card {
    width: 65px;
    height: 97.5px;
    background-color: white;
    border-radius: 8px;
    border: 1px solid #333;
    color: black;
    font-size: 1.7rem;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.4);
    position: relative;
}

.card.hidden {
    background: #212529;
    border: 2px solid var(--quartz-secondary);
}

.card.hidden::before {
    content: '?';
    font-size: 2.5rem;
    color: var(--quartz-secondary);
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}

.card .suit { font-size: 1.2rem; line-height: 1; }
.card.red { color: #e95420; }
.card.black { color: #212121; }
.card-top { align-self: flex-start; }
.card-bottom { align-self: flex-end; transform: rotate(180deg); }

.actions-panel, .betting-panel, .info-panel {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 0.8rem 1.5rem;
    border-radius: 15px;
    margin-top: 0.8rem;
}
.actions-panel{
    border-top: 3px solid var(--quartz-secondary);
}
.betting-panel, .info-panel {
    border-top: 2px solid #212529;
}

.action-button, .bet-button {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.1s ease-in-out;
    padding: 0.6rem 0;
    font-size: 1.1rem;
    width: 100%;
}

/* Adjustments for better fit with reduced paddings */
.actions-panel .row.g-2 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}
.betting-panel .row.g-2 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}


.status-message {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: var(--quartz-secondary);
    font-size: 2rem;
    padding: 1.5rem;
    border-radius: 15px;
    border: 4px solid var(--quartz-secondary);
    z-index: 100;
    text-align: center;
    display: none;
    width: 90%;
    max-width: 400px; /* Limit width for better readability */
    box-shadow: 0 0 20px rgba(24, 178, 178, 0.7);
}

/* Using the exact info-display styles and structure from Craps */
.info-display {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--quartz-light);
    text-align: center;
}
.info-display span {
    color: var(--quartz-secondary);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    html, body {
        overflow-y: auto; /* Allow scrolling on mobile */
        height: auto; /* Allow height to adjust to content */
    }
    body {
        align-items: flex-start; /* On mobile, align items to the top to respect padding-top */
        padding: 0.5rem;
    }
    .game-console {
        padding: 1rem;
        margin-top: 1rem; /* Consistent margin for mobile too */
        margin-bottom: 10px; /* Adjust bottom margin for mobile */
        flex-shrink: 0;
        max-height: initial;
    }
    .hand-area { min-height: 105px; gap: 5px; }
    .card { width: 60px; height: 90px; font-size: 1.5rem; }
    .card .suit { font-size: 1rem; }
    .card.hidden::before { font-size: 2.5rem; }
    .action-button { font-size: 1rem; padding: 0.75rem 0; }
    .bet-button { font-size: 0.8rem; padding: 0.75rem 0; }
    .info-display { font-size: 1rem; } /* Ensure smaller font for info display on mobile */
    .actions-panel, .betting-panel, .info-panel { padding: 0.75rem; margin-top: 0.5rem; }
    .status-message { font-size: 1.5rem; padding: 1rem; }
}

