.craps-game-container {
    position: fixed;
    top: 55px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 55px);
    margin: 0;
    padding: 0.5vh 0.5vh 1vh 0.5vh; /* Extra bottom padding to prevent cutoff */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #016D29; /* Casino green background */
    color: white;
    border-radius: 10px;
    border: 5px solid #dabd00; /* Wood-like border */
    font-size: 0.9em; /* Slightly smaller base font size */
}

/* Main game layout */
.game-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0; /* Allow shrinking */
}

.dice-area {
    background-color: #004d1a; /* Darker green */
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 10px;
    border: 2px solid #ccc;
    flex-shrink: 0;
}

#dice-container { /* Added style for visibility */
    min-height: 80px; /* Ensure it has height */
    display: block; /* Or inline-block, depending on layout */
    margin-bottom: 10px;
    position: relative; /* Make it a positioning context for dice */
    overflow: hidden; /* Prevent dice from going outside boundaries */
}

.dice-image {
    width: 60px; /* Adjust size as needed */
    height: 60px;
    /* margin: 0 10px; REMOVED */
    /* vertical-align: middle; REMOVED */
    position: absolute; /* Use absolute positioning */
    top: 50%; /* Center vertically */
    /* left: 50%; Will set individually for spacing */
    transform: translate(-50%, -50%); /* Center based on own dimensions */
    transition: top 0.3s ease-out, left 0.3s ease-out, transform 0.3s ease-out; /* Smooth transition back to center */
}

/* Centered positions for resting dice */
#die1 {
    left: calc(50% - 40px); /* Position die 1 left of center */
}
#die2 {
    left: calc(50% + 40px); /* Position die 2 right of center */
}

#point-marker {
    display: inline-block;
    background-color: black;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    margin-left: 20px;
    vertical-align: middle;
    border: 2px solid white;
}

 #point-marker.on {
    background-color: white;
    color: black;
    box-shadow: 0 0 10px yellow; /* Add glow effect when ON */
}

/* Dice Animation */
@keyframes tumble {
    0% { transform: rotate(0deg) scale(1); opacity: 1; }
    25% { transform: rotate(90deg) scale(1.1); opacity: 0.8; }
    50% { transform: rotate(180deg) scale(1); opacity: 1; }
    75% { transform: rotate(270deg) scale(1.1); opacity: 0.8; }
    100% { transform: rotate(360deg) scale(1); opacity: 1; }
}

.dice-image.rolling {
    /* animation: tumble 0.5s linear infinite; REMOVED - JS handles animation */
    transition: none; /* Disable transition during animation for jerky movement */
}

.betting-board {
    border: 3px solid #d4af37; /* Gold border */
    background-color: #005c2f; /* Slightly lighter green */
    padding: 2px;
    border-radius: 1px;
    display: grid;
    flex-shrink: 0;
    margin-bottom: 0; /* Remove bottom margin */
    /* UPDATED GRID LAYOUT */
    grid-template-columns: 1.5fr 3fr 1.5fr; /* Props | Center | Hardways */
    /* Added rows for ATS Bonus and Tracker */
    grid-template-rows: auto auto auto auto auto auto auto auto auto auto auto;
    grid-template-areas:
        "ats-bonus ats-bonus ats-bonus"
        "ats-tracker ats-tracker ats-tracker"
        "top-row top-row top-row"
        "props come hardways"
        "props field hardways"
        "props d-pass hardways"  /* Renamed to avoid conflict */
        "props pass hardways"
        "props pass-odds hop-bets"; /* MODIFIED: Added hop-bets area */
    grid-gap: 3px;
    position: relative;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
    flex-shrink: 0;
}

/* --- NEW Area Assignments --- */
.ats-bonus-area { grid-area: ats-bonus; }
.ats-tracker { grid-area: ats-tracker; }
.top-betting-row { grid-area: top-row; }
.prop-bets-left { grid-area: props; }
.tabbed-bets-right { 
    grid-area: hardways; 
    border: 1px solid #d4af37;
}
.come-area { grid-area: come; }
.field-area { grid-area: field; }
.dont-pass-area[data-bet-type="dont_pass"] { grid-area: d-pass; }
.pass-line-area { grid-area: pass; }
.pass-line-odds-area { grid-area: pass-odds; }
/* --- End NEW Area Assignments --- */

/* --- NEW ATS Styles --- */
.ats-bonus-area {
    display: flex;
    justify-content: space-around;
    background-color: #004d1a; /* Darker green */
    padding: 5px 3px;
    border-radius: 5px;
    border: 1px solid #a2a2a2;
    margin-bottom: 3px;
}
.ats-bet {
    flex: 1; /* Distribute space evenly */
    margin: 0 4px;
    padding: 10px 5px;
    font-size: 0.9em;
    line-height: 1.3;
    /* Inherits .bet-area styles for hover, cursor etc. */
}

.ats-tracker {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #004d1a; /* Darker green */
    padding: 4px 3px;
    border-radius: 5px;
    border: 1px solid #a2a2a2;
    margin-bottom: 3px;
    gap: 3px; /* Space between numbers */
}
.ats-number {
    display: inline-flex; /* Use inline-flex for centering */
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #555; /* Default grey */
    color: #ccc;
    font-weight: bold;
    font-size: 0.8em;
    border: 1px solid #888;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.ats-number.hit {
    background-color: #ffeb3b; /* Yellow when hit */
    color: black;
    border-color: white;
}
.ats-tracker-divider {
    width: 2px;
    height: 20px;
    background-color: #a2a2a2;
    margin: 0 8px;
}
/* Add new pulse animation */
@keyframes pulseAnimation {
    0% { box-shadow: 0 0 0 0 rgba(255, 235, 59, 0.7); }  
    70% { box-shadow: 0 0 10px 10px rgba(255, 235, 59, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 235, 59, 0); }
}
.ats-number.pulse {
    animation: pulseAnimation 1s infinite;
}
/* --- End NEW ATS Styles --- */

/* --- Styles for Top Row --- */
.top-betting-row {
    display: flex;
    width: 100%;
    gap: 5px; /* Gap between DC and Numbers */
    align-items: stretch; /* Make items same height */
}

/* Don't Come Bar (Left Side) */
.dont-come-area[data-bet-type="dont_come"] {
    /* REMOVED grid-area: dc-bar; */
    /* Adjust size and remove full width */
    width: auto; /* Let flexbox determine width */
    flex-basis: 110px; /* Reduced base width */
    flex-shrink: 0; /* Don't let it shrink */
    /* REMOVED width: 50%; */
    margin-bottom: 0; /* Remove margin, gap handles spacing */
    /* Keep other styles like padding, border, etc. */
    border: 2px solid white;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    background-color: #016D29;
    border-radius: 5px;
    box-sizing: border-box;
    flex-grow: 0; /* Keep explicit */
}

/* Place Bets (Numbers container - Right Side) */
.place-bets {
    /* REMOVED grid-area: numbers; */
    flex-grow: 1; /* Take remaining space */
    /* Keep display: flex and other internal styles */
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    /* Keep background transparent */
    background-color: transparent;
    margin-bottom: 0; /* Remove margin */
    padding: 0;
    border: none;
}

.prop-section {
    border: 2px solid #a2a2a2; /* Darker grey border */
    padding: 8px;
    text-align: center;
    flex-grow: 1;
    background-color: #016D29;
    border-radius: 5px;
    display: flex; /* Ensure flex properties apply */
    flex-direction: column; /* Stack header/content */
}

/* --- Updated One Roll Bets Grid --- */
.one-roll-bets {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 columns for the horn numbers */
    grid-template-rows: auto auto 1fr 1fr auto; /* Header, Seven, Horn Row 1, Horn Row 2, Any Craps/C&E */
    gap: 0; /* Remove gap between horn number boxes */
    /* flex-basis: 60%; REMOVED */
    align-items: stretch; /* Stretch items vertically */
    justify-items: stretch; /* Stretch items horizontally */
    min-height: 250px; /* Adjusted height */
    position: relative; /* Needed for absolute positioning of Horn bet */
}
.prop-header {
    font-weight: bold;
    grid-column: 1 / -1; /* Span all columns */
    margin-bottom: 5px;
    border-bottom: 1px solid white;
    padding-bottom: 3px;
    font-size: 0.9em;
    text-transform: uppercase;
}
/* New Grid Positions for One Roll Bets */
/* Any 7 above the horn numbers */
.one-roll-bets .seven { grid-column: 1 / -1; grid-row: 2; margin-bottom: 1px; font-size: 0.8em;} /* Spans both columns */

/* Horn number square */
.one-roll-bets .two { grid-column: 1 / 2; grid-row: 3; border-right: none; border-bottom: none;} /* Top Left */
.one-roll-bets .three { grid-column: 2 / 3; grid-row: 3; border-left: none; border-bottom: none; } /* Top Right */
.one-roll-bets .eleven { grid-column: 1 / 2; grid-row: 4; border-right: none; border-top: none; } /* Bottom Left */
.one-roll-bets .twelve { grid-column: 2 / 3; grid-row: 4; border-left: none; border-top: none; } /* Bottom Right */

/* Horn Bet Overlay */
.one-roll-bets .horn-bet {
    /* grid-column: 2 / 3; grid-row: 3; REMOVED */
    position: absolute;
    top: 50%; /* Adjust vertical position */
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1; /* Above number boxes */
    width: 25%; /* Adjusted width to be less likely to overlap text */
    height: 10%; /* Adjusted height */
    min-width: 35px; /* Ensure minimum clickable size */
    min-height: 35px;
    border: 1px solid yellow; /* Optional: highlight horn area */
    background-color: rgba(0, 92, 47, 0.8); /* Semi-transparent background */
    font-size: 0.8em;
}

/* Any Craps / Seven / C&E below the square */
.one-roll-bets .any-craps { grid-column: 1 / 2; grid-row: 5; margin-top: 1px; font-size: 0.8em;}
.one-roll-bets .c-and-e { grid-column: 2 / 3; grid-row: 5; margin-top: 1px; font-size: 0.8em;}

/* Removed old One Roll bet positioning */
/* .one-roll-bets .seven { grid-column: 1 / 3; grid-row: 1; } ... etc */


/* --- Updated Hardways Grid --- */
.hardways {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr 1fr;
    gap: 5px;
    min-height: 150px;
    min-width: 150px;
}
/* Keep hardway positions */
.hardways .hard-4 { grid-column: 1 / 2; grid-row: 2; }
.hardways .hard-6 { grid-column: 1 / 2; grid-row: 3; }
.hardways .hard-8 { grid-column: 2 / 3; grid-row: 3; }
.hardways .hard-10 { grid-column: 2 / 3; grid-row: 2; }
/* --- End Updated Hardways Grid --- */


/* .place-bets { grid-area: place; ... } */ /* Already assigned */
.place-bet-box {
    border: 2px solid #a2a2a2; /* Darker grey border */
    /* padding: 20px 10px; REMOVED - Handled by inner sections */
    font-weight: bold;
    min-width: 60px; /* Adjusted min-width */
    text-align: center;
    flex-grow: 1; /* Allow boxes to grow */
    margin: 0 3px; /* Add slight margin between boxes */
    border-radius: 4px;
    /* font-size: 1.3em; REMOVED - Set on .box-number-text */
    text-transform: uppercase; /* Match image */
    transition: background-color 0.3s ease, opacity 0.3s ease; /* Add opacity transition */
    display: flex; /* Use flexbox for vertical sections */
    flex-direction: column; /* Stack sections vertically */
    min-height: 100px; /* Ensure enough height */
    position: relative; /* Needed for puck */
    padding: 0; /* Remove padding from outer box */
}

/* Styles for Box Sections */
.box-top, .box-middle, .box-bottom {
    flex: 1; /* Each section takes equal height */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* For chip placement */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Subtle internal borders */
    width: 100%; /* Ensure full width */
}
.box-top { border-bottom: none; border-radius: 4px 4px 0 0; }
.box-middle { border-bottom: none; }
/* REVERTED: Back to horizontal row layout */
.box-bottom { display: flex; flex-direction: row; border-radius: 0 0 4px 4px; padding: 0; } /* Horizontal row */

/* REMOVED vertical stack styles */
/* .box-bottom-place, .box-bottom-buy { ... } */

/* RE-ADDED: Styles for horizontal split */
.box-bottom-left, .box-bottom-right {
    flex: 1; /* Split bottom horizontally */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* For chip placement */
    height: 100%; /* Ensure full height */
    min-height: 30px; /* Ensure minimum height */
}
.box-bottom-left {
    border-right: 1px solid rgba(255, 255, 255, 0.2); /* Separator line */
}
.box-bottom-right {
    border-right: none;
}

/* Make sub-sections clickable areas - Targets .bet-area */
.place-bet-box .bet-area { /* Target sub-sections that are bet areas */
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 30px; /* Ensure clickable height */
}
 .place-bet-box .bet-area:hover {
     background-color: #007a33; /* Slightly lighter green on hover */
 }

/* Style for P, B, L indicators */
.box-indicator {
    position: absolute;
    /* font-size: 0.7em; REMOVED */
    font-size: 0.65em; /* Slightly smaller for longer words */
    opacity: 0.6;
    font-weight: bold;
    color: #ddd;
    /* Adjust positioning */
    top: 2px;
    left: 3px;
}
/* Specific indicator positioning if needed - removed empty rulesets */


/* Style for the main Number Text */
.box-number-text {
    font-size: 1.3em; /* Original size */
    font-weight: bold;
    text-transform: uppercase;
}

/* Ensure the base .bet-area styles don't override box section layout */
.place-bet-box .bet-area {
    padding: 0; /* Reset padding */
    border: none; /* Reset border */
    /* display: flex; Already set by section styles */
    /* align-items: center; Already set by section styles */
    /* justify-content: center; Already set by section styles */
    flex-direction: initial; /* Reset flex-direction */
}

.place-bet-box.point-on-box {
    /* Style the middle section when point is ON */
    & .box-middle {
        background-color: #ffc107; /* Example: Yellow background */
        color: black;
        border: 3px solid red;
        box-shadow: 0 0 15px yellow; /* Add glow */
    }
}

.place-bet-box.bets-toggled-off { /* Apply to outer box */
    opacity: 0.7; /* Dim the whole box slightly */
    /* Apply inactive styles to specific clickable sub-areas when OFF */
    & .place-area, & .buy-area {
         cursor: not-allowed;
         pointer-events: none; /* Prevent clicks on Place/Buy when OFF */
         background-color: rgba(85, 85, 85, 0.5); /* Darker overlay */
    }
    /* Lay areas remain always active */
    & .lay-area {
         cursor: pointer;
         pointer-events: auto; /* Always allow clicks on Lay */
         background-color: transparent; /* No overlay for lay areas */
    }
    /* Come/DC areas remain active visually but handled by logic */
}

/* Remove old ON/OFF ::after style */
/* .place-bet-box::after { ... } */
/* .place-bet-box:not(.off)::after { ... } */
/* .place-bet-box.off::after { ... } */

/* Remove specific OFF styles if using the .bets-toggled-off approach */
/* .place-bet-box.off { ... } */

.come-area { 
    grid-area: come; 
    border: 2px solid white; 
    padding: 10px 10px 40px 10px; /* Match Pass Line padding */
    text-align: center; 
    font-size: 1.3em; /* Match Pass Line font size */
    font-weight: bold; 
    background-color: #016D29;
    border-radius: 5px;
}
.field-area {
    grid-area: field;
    border: 2px solid white;
    padding: 10px 10px 40px 10px; /* Match Pass Line padding */
    text-align: center;
    font-weight: bold;
    background-color: #016D29;
    font-size: 1.3em; /* Match Pass Line font size */
    line-height: 1.2;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative; /* For positioning payout text */
}
.field-numbers { 
    font-size: 0.9em; 
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    margin-top: 10px;
}

/* Align the middle text with the circle centers */
.field-numbers {
    align-items: center;
}

/* Ensure the middle text (3 · 4 · 9 · 10 · 11) aligns with circle centers */
.field-numbers > *:not(.field-number-container) {
    display: inline-flex;
    align-items: center;
    height: 20px; /* Match the circle height */
    line-height: 20px;
    vertical-align: middle;
    margin-top: -2px; /* Move text up slightly to align with circle centers */
}

.field-number-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 2px;
}

.field-number {
    position: relative;
    display: inline-block;
}

.field-number-2 {
    border: 2px solid #ffeb3b;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.field-number-12 {
    border: 2px solid #ffeb3b;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.field-payout-text {
    font-size: 0.6em;
    color: #ffeb3b;
    font-weight: bold;
    white-space: nowrap;
    text-align: center;
    margin-top: 2px;
}

.dont-come-area {
    border: 2px solid white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    background-color: #016D29;
    border-radius: 5px;
    /* Adjustments for being inside flex container */
    flex-grow: 1; /* Allow it to grow like other boxes */
    flex-basis: 0; /* Let flexbox determine size based on content/growth */
    min-width: 80px; /* Ensure it has some minimum width */
    margin: 0 3px; /* Match margin of place-bet-box */
}
.pass-line-area {
    grid-area: pass;
    border: 2px solid white;
    padding: 10px 10px 40px 10px; /* More padding bottom for odds */
    text-align: center;
    font-weight: bold;
    background-color: #016D29;
    font-size: 1.3em;
    border-radius: 5px;
    position: relative; /* Make it a positioning context */
}
.dont-pass-area {
    grid-area: dont-pass;
    border: 2px solid white;
    padding: 40px 15px 15px 15px; /* More padding top for odds */
    text-align: center;
    font-weight: bold;
    background-color: #016D29;
    border-radius: 5px; /* Rounded corners */
    position: relative; /* Make it a positioning context */
}

.bet-area {
    border: 1px solid #a2a2a2; /* Consistent border */
    padding: 4px; /* Further reduced padding */
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative; /* Needed for chip placement */
    min-height: 35px; /* Reduced minimum height */
    display: flex; /* Use flexbox for centering */
    align-items: center;
    justify-content: center;
    flex-direction: column; /* Stack text vertically if needed */
    font-size: 0.8em; /* Further reduced base font size */
}

.bet-area:hover {
    background-color: #007a33; /* Slightly lighter green on hover */
}

.controls-area {
    text-align: center;
}

.bankroll-display {
    font-size: 0.95em;
    font-weight: bold;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.1); /* Subtle background */
    padding: 4px;
    border-radius: 5px;
    margin-bottom: 5px;
}

/* --- Chip Deck and Chip Styles (Copied/Adapted) --- */
.chipDeck {
    position: relative;
    width: 310px;
    height: 55px;
    padding: 3px 0;
    border: 1px solid white;
    border-radius: 10px;
    box-shadow: inset -2px -4px rgb(0 0 0 / 20%);
    background-color: #eee; /* Lighter background for deck */
    margin: 5px auto; /* Center chip deck */
    z-index: 10;
    display: inline-block;
}

.cdChip {
    width: 35px;
    height: 35px;
    background-color: #fff;
    border: 5px solid;
    border-radius: 100%;
    display: inline-block;
    margin-left: 9px;
    color: #000;
    cursor: pointer;
    vertical-align: middle; /* Align chips vertically */
}

.cdChipSpan {
    display: block; /* Use block for centering */
    position: relative;
    top: 50%;
    transform: translateY(-50%); /* Vertical centering */
    width: 100%; /* Span takes full width */
    font-weight: bold;
    font-size: 13px;
    text-align: center;
}

.cdChipActive {
    position: relative;
    top: -4px;
    box-shadow: 0 4px rgb(0 0 0 / 20%);
    animation: chipShine 2s ease-in-out infinite;
}

@keyframes chipShine {
    0%, 100% {
        box-shadow: 0 4px rgb(0 0 0 / 20%), 0 0 10px rgba(255, 255, 255, 0.5), 0 0 20px rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px rgb(0 0 0 / 20%), 0 0 20px rgba(255, 255, 255, 0.9), 0 0 30px rgba(255, 255, 255, 0.6), 0 0 40px rgba(255, 255, 255, 0.4);
        transform: scale(1.05);
    }
}

.blueChip { border-color: rgb(77, 184, 255); }
.red { border-color: red; }
.green { border-color: green; }
.black { border-color: rgb(20, 20, 20); }
.purple { border-color: purple; }
.yellow { border-color: yellow; }

.placed-chip {
    width: 28px; /* Slightly larger chips */
    height: 28px;
    border-radius: 50%;
    position: absolute;
    /* border: 2px solid white; */
    box-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px; /* Slightly larger text */
    font-weight: bold;
    color: black; /* Default text color */
    z-index: 15; /* Ensure chips are above bet areas */
    /* Allow chips on numbers to be clickable for odds */
    /* pointer-events: none; REMOVED - Chips need to be clickable */
    pointer-events: auto; /* Ensure chips ARE clickable */
    /* Default position - centered (overridden below) */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Default center */
}

/* Stacking Offsets (Generic - might need refinement) */
/* .placed-chip[data-offset="1"] { transform: translate(-70%, -70%); } */
/* .placed-chip[data-offset="2"] { transform: translate(-30%, -70%); } */
/* .placed-chip[data-offset="3"] { transform: translate(-70%, -30%); } */
/* .placed-chip[data-offset="4"] { transform: translate(-30%, -30%); } */
/* Define new chip positions based on sub-section */

/* --- Chip Positioning within Number Box Sub-sections --- */

/* Top Section (Lay, DC Flat, DC Odds) */
.box-top .placed-chip[data-is-lay-bet="true"] {
    top: 50%; left: 50%; /* Center Lay chip */
    transform: translate(-50%, -50%);
}
.box-top .placed-chip[data-is-dc-flat="true"] {
    top: 50%; left: 25%; /* DC Flat top-left */
    transform: translate(-50%, -50%);
}
.box-top .placed-chip[data-is-dc-odds="true"] {
    top: 50%; left: 75%; /* DC Odds top-right */
    transform: translate(-50%, -50%);
}

/* Middle Section (Come Flat, Come Odds) */
.box-middle .placed-chip[data-is-come-flat="true"] {
    top: 50%; left: 25%; /* Come Flat middle-left */
    transform: translate(-50%, -50%);
}
.box-middle .placed-chip[data-is-come-odds="true"] {
    top: 50%; left: 75%; /* Come Odds middle-right */
    transform: translate(-50%, -50%);
}

/* REVERTED: Bottom Left Section (Place Bets) */
.box-bottom-left .placed-chip[data-is-place-bet="true"] {
    top: 50%; left: 50%; /* Center Place chip */
    transform: translate(-50%, -50%);
}

/* REVERTED: Bottom Right Section (Buy Bets) */
.box-bottom-right .placed-chip[data-is-buy-bet="true"] {
    top: 50%; left: 50%; /* Center Buy chip */
    transform: translate(-50%, -50%);
}
/* --- End Chip Positioning within Number Box Sub-sections --- */


.placed-chip.chip-1 { background-color: #4db8ff; border: 2px solid #007bff; } /* Blue */
.placed-chip.chip-5 { background-color: #ff4d4d; border: 2px solid #dc3545; } /* Red */
.placed-chip.chip-25 { background-color: #4dff4d; border: 2px solid #28a745; } /* Green */
.placed-chip.chip-100 { background-color: #333; border: 2px solid #000; color: white; } /* Black */
.placed-chip.chip-500 { background-color: purple; border: 2px solid purple; color: white; } /* Purple */
.placed-chip.chip-1000 { background-color: yellow; border: 2px solid #FFD700; color: black; } /* Yellow with gold-like border and black text */

/* Animated chips for payout animations */
.animated-chip {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 2px;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    line-height: 1;
    min-width: 40px;
    min-height: 40px;
}

/* Animated chip colors - match placed chip colors */
.animated-chip.chip-1 { background-color: #4db8ff; border-color: #007bff; color: #000; }
.animated-chip.chip-5 { background-color: #ff4d4d; border-color: #dc3545; color: #000; }
.animated-chip.chip-25 { background-color: #4dff4d; border-color: #28a745; color: #000; }
.animated-chip.chip-100 { 
    background-color: #333 !important; 
    background: #333 !important; 
    border-color: #000 !important; 
    color: white !important; 
}
.animated-chip.chip-100 * {
    color: white !important;
}
.animated-chip.chip-500 { background-color: purple; border-color: purple; color: white; }
.animated-chip.chip-1000 { background-color: yellow; border-color: #FFD700; color: black; }

#game-message {
    color: #ffeb3b; /* Yellow */
    font-weight: bold;
    min-height: 2em; /* Reserve space for messages */
}

/* Style for Odds Areas - Position behind Pass/Don't Pass */
/* REMOVED - Odds areas are gone
.odds-area {
    position: absolute;
    border: 1px dashed yellow; // More visible border
    cursor: pointer;
    z-index: 10; // Above board, below chips
    min-height: 30px; // Give it some clickable height
    background-color: rgba(0,0,0,0.1); // Slight background for visibility
}
*/

/* REMOVED Style for .pass-line-odds-area
.pass-line-odds-area {
    // Position behind the Pass Line Area
    bottom: 5px; // Position inside the bottom padding
    left: 5px;
    right: 5px;
    height: 30px;
}
*/

/* ... other styles ... */

/* Position DP Flat and Odds chips inside .dont-pass-area */
.dont-pass-area .placed-chip[data-is-dp-flat="true"] {
    top: 50%;
    left: 35%; /* Position flat bet left of center */
    transform: translate(-50%, -50%);
}
.dont-pass-area .placed-chip[data-is-dp-odds="true"] {
    top: 50%;
    left: 65%; /* Position odds bet right of center */
    transform: translate(-50%, -50%);
}

/* ADDED: Position Pass Line Flat and Odds chips inside .pass-line-area */
.pass-line-area .placed-chip[data-is-pass-flat="true"] {
    top: 40%; /* Move flat bet slightly up */
    left: 50%;
    transform: translate(-50%, -50%);
}
.pass-line-area .placed-chip[data-is-pass-odds="true"] {
    top: 90%; /* Position odds bet much lower below flat bet */
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Style for Odds Areas */
.odds-area {
    /* REMOVE absolute positioning from base class */
    /* position: absolute; */
    border: 1px dashed yellow;
    cursor: pointer;
    z-index: 10; /* Still useful if chips overlap slightly */
    min-height: 35px; /* Give it some clickable height */
    background-color: rgba(0,0,0,0.1);
    display: flex; /* Use flex for centering chips */
    align-items: center;
    justify-content: center;
    position: relative; /* Needed for absolute positioning of chips *within* it */
}

/* Override odds-area base styles for pass-line-odds-area to make it invisible */
.pass-line-odds-area.odds-area {
    border: none !important; /* Override yellow dashed border */
    background-color: transparent !important; /* Override background */
}

.pass-line-odds-area {
    grid-area: pass-odds; /* Assign to grid area */
    /* Remove absolute positioning properties */
    /* bottom: 5px; */
    /* left: 5px; */
    /* right: 5px; */
    /* height: 30px; */
    margin-top: 5px; /* Add space below the Pass Line */
    border: none; /* Remove border to make invisible */
    border-radius: 4px; /* Optional rounded corners */
    padding: 5px; /* Add some padding */
    font-size: 0.9em; /* Adjust size */
    background-color: transparent; /* Make background transparent */
    color: transparent; /* Hide text but keep container visible for chips */
    pointer-events: auto; /* Keep clickable */
    display: flex; /* Use flexbox for centering */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
}

/* Ensure chips are visible in the invisible area - override any parent opacity */
.pass-line-odds-area .placed-chip,
.pass-line-odds-area .placed-chip[data-is-pass-odds="true"] {
    opacity: 1 !important; /* Ensure chips are fully visible */
    visibility: visible !important; /* Ensure chips are visible */
    display: flex !important; /* Use flex to maintain centering */
}

/* Position chips centrally within the odds area by default */
.pass-line-odds-area .placed-chip[data-is-pass-odds="true"] {
    position: relative; /* Position relative to the flex container */
    top: auto; /* Reset absolute positioning */
    left: auto;
    transform: none; /* Reset transform */
    /* Add margin if multiple chips might stack */
    margin: 0 2px;
    /* Ensure chips are centered within the flex container */
    align-self: center;
}

/* REMOVED: Positioning for Odds within Pass Line Area */
/*
.pass-line-area .placed-chip[data-is-pass-flat="true"] {
    top: 40%; // Move flat bet slightly up
    left: 50%;
    transform: translate(-50%, -50%);
}
.pass-line-area .placed-chip[data-is-pass-odds="true"] {
    top: 90%; // Position odds bet much lower below flat bet
    left: 50%;
    transform: translate(-50%, -50%);
}
*/

/* Keep positioning for Flat bet within Pass Line Area */
.pass-line-area .placed-chip[data-is-pass-flat="true"] {
    top: 50%; /* Center it again */
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Keep positioning for DP Flat/Odds within Don't Pass Area */
.dont-pass-area .placed-chip[data-is-dp-flat="true"] {
    top: 50%;
    left: 35%;
    transform: translate(-50%, -50%);
}
.dont-pass-area .placed-chip[data-is-dp-odds="true"] {
    top: 50%;
    left: 65%;
    transform: translate(-50%, -50%);
}

/* Chip positioning within Number Boxes (.place-bet-box) */
/* Place Bet: Bottom Center */
.place-bet-box .placed-chip[data-is-place-bet="true"] {
    top: 90%; /* Lowered */
    left: 50%;
    transform: translate(-50%, -50%);
}

/* DC Flat: Top Left */
.place-bet-box .placed-chip[data-is-dc-flat="true"] {
    top: 10%; /* Raised */
    left: 25%;
    transform: translate(-50%, -50%);
}

/* DC Odds: Top Right */
.place-bet-box .placed-chip[data-is-dc-odds="true"] {
    top: 10%; /* Raised */
    left: 75%;
    transform: translate(-50%, -50%);
}

/* Come Flat: Middle Left - Keep as is */
.place-bet-box .placed-chip[data-is-come-flat="true"] {
    top: 50%;
    left: 25%;
    transform: translate(-50%, -50%);
}

/* Come Odds: Middle Right - Keep as is */
.place-bet-box .placed-chip[data-is-come-odds="true"] {
    top: 50%;
    left: 75%;
    transform: translate(-50%, -50%);
}

/* Style for Puck Marker */
.puck-marker {
    position: absolute;
    top: 2px; /* Position near top border */
    left: 50%;
    transform: translateX(-50%);
    width: 26px; /* Make smaller */
    height: 26px; /* Make smaller */
    /* background-color: black; Set in .on/.off */
    /* color: white; Set in .on/.off */
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px; /* Adjust font size slightly if needed */
    font-weight: bold;
    z-index: 25; /* Above chips */
    display: none; /* Start hidden, JS controls visibility */
}

.puck-marker.on {
    background-color: white; /* White background for ON */
    color: black;           /* Black text for ON */
    display: block;         /* Show when ON (controlled by JS) */
}

.puck-marker.off {
     background-color: black; /* Black background for OFF */
     color: white;           /* White text for OFF */
     /* display: block; JS will hide these unless it's the active 'OFF' state marker, if implemented */
     /* Let JS handle showing/hiding OFF pucks */
}

/* Style for inactive bets - Keep as is */
/* ... */

/* Modify the ON/OFF indicator logic (within the box text) - Keep as is */
/* ... */

/* Keep positioning for Flat bet within Pass Line Area */
.pass-line-area .placed-chip[data-is-pass-flat="true"] {
    top: 50%; /* Center it again */
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Keep positioning for DP Flat/Odds within Don't Pass Area */
.dont-pass-area .placed-chip[data-is-dp-flat="true"] {
    top: 50%;
    left: 35%;
    transform: translate(-50%, -50%);
}
.dont-pass-area .placed-chip[data-is-dp-odds="true"] {
    top: 50%;
    left: 65%;
    transform: translate(-50%, -50%);
}

/* Style for inactive bets */
.inactive {
    opacity: 0.5 !important; /* Make sure it overrides other opacity */
    cursor: not-allowed !important;
    /* Optional: add a grayscale filter? */
    /* filter: grayscale(80%); */
}
/* Ensure specific inactive chips/areas are not clickable */
.place-bet-box.inactive,
/* .odds-area.inactive, DEPRECATED - Only PL odds area exists */
.pass-line-odds-area.inactive, /* Target specific PL odds area */
.hardways .bet-area.inactive, /* Target inactive hardway areas */
.placed-chip.inactive[data-is-come-odds="true"],
.placed-chip.inactive[data-is-dc-odds="true"],
.placed-chip.inactive[data-is-pass-odds="true"],
/* .placed-chip.inactive[data-is-dp-odds="true"], DP Odds are inside DP area, not separately styled as inactive */
.placed-chip.inactive[data-is-hardway="true"] /* Target inactive hardway chips */
{
     pointer-events: none;
}

/* Changed selector and styles for OFF state */
.place-bet-box.bets-toggled-off::after {
    content: 'OFF' !important;
    background-color: #ccc !important; /* Grey background */
    color: #333; /* Dark grey text */
    /* Shared styles for positioning/padding */
    display: inline-block; /* Allow margin */
    margin-left: 5px;
    font-size: 0.8em;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 3px;
    vertical-align: middle; /* Align with box text */
}

/* Roll history - make compact and scrollable */
.roll-history-container {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 5px;
    padding-top: 0; /* Remove top padding */
    border-radius: 8px;
    border: 1px solid #ccc;
    width: 100%;
    flex-shrink: 0; /* Prevent shrinking */
    margin: 0; /* Remove all margins */
    margin-top: 0; /* Remove top margin */
}

.roll-history-container h6 {
    margin: 0; /* Remove margin from h6 */
    margin-bottom: 5px; /* Add small bottom margin for spacing from content */
    padding: 0; /* Remove padding */
}

.roll-history {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    max-height: 60px;
    overflow-y: auto;
    background-color: #fff;
    padding: 3px;
    border-radius: 5px;
}

/* Controls area - make compact */
.controls-area {
    margin-top: 3px;
    flex-shrink: 0; /* Prevent shrinking */
    padding-bottom: 3px;
}

/* Responsive adjustments - REMOVED: Using desktop version on all screen sizes */
/* All mobile media queries have been removed to use desktop layout on all devices */


.roll-history .dice-pair {
    display: inline-flex; /* Use inline-flex for better horizontal flow */
    align-items: center;
    /* background-color: #eee; */ /* Optional background for each pair */
     padding: 1px 3px; /* Smaller padding */
     border-radius: 3px;
     border: 1px solid #ddd;
     margin-right: 3px; /* Reduced space between pairs */
     margin-bottom: 3px; /* Reduced space below pairs if they wrap */
}


.roll-history img {
    width: 18px; /* Slightly smaller dice images */
    height: 18px;
    margin: 0 1px; /* Tiny space between dice in a pair */
    vertical-align: middle;
}

/* --- Chip Styles --- */
.chip-stack {
    position: relative;
    width: 310px;
    height: 55px;
    padding: 3px 0;
    border: 1px solid white;
    border-radius: 10px;
    box-shadow: inset -2px -4px rgb(0 0 0 / 20%);
    background-color: #eee; /* Lighter background for deck */
    margin: 10px auto; /* Center chip deck */
    z-index: 10;
    display: inline-block;
}

.cdChip {
    width: 35px;
    height: 35px;
    background-color: #fff;
    border: 5px solid;
    border-radius: 100%;
    display: inline-block;
    margin-left: 9px;
    color: #000;
    cursor: pointer;
    vertical-align: middle; /* Align chips vertically */
}

.cdChipSpan {
    display: block; /* Use block for centering */
    position: relative;
    top: 50%;
    transform: translateY(-50%); /* Vertical centering */
    width: 100%; /* Span takes full width */
    font-weight: bold;
    font-size: 13px;
    text-align: center;
}

.cdChipActive {
    position: relative;
    top: -4px;
    box-shadow: 0 4px rgb(0 0 0 / 20%);
    animation: chipShine 2s ease-in-out infinite;
}

@keyframes chipShine {
    0%, 100% {
        box-shadow: 0 4px rgb(0 0 0 / 20%), 0 0 10px rgba(255, 255, 255, 0.5), 0 0 20px rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px rgb(0 0 0 / 20%), 0 0 20px rgba(255, 255, 255, 0.9), 0 0 30px rgba(255, 255, 255, 0.6), 0 0 40px rgba(255, 255, 255, 0.4);
        transform: scale(1.05);
    }
}

.blueChip { border-color: rgb(77, 184, 255); }
.red { border-color: red; }
.green { border-color: green; }
.black { border-color: rgb(20, 20, 20); }
.purple { border-color: purple; }
.yellow { border-color: yellow; }

.placed-chip {
    width: 28px; /* Slightly larger chips */
    height: 28px;
    border-radius: 50%;
    position: absolute;
    /* border: 2px solid white; */
    box-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px; /* Slightly larger text */
    font-weight: bold;
    color: black; /* Default text color */
    z-index: 15; /* Ensure chips are above bet areas */
    /* Allow chips on numbers to be clickable for odds */
    /* pointer-events: none; REMOVED - Chips need to be clickable */
    pointer-events: auto; /* Ensure chips ARE clickable */
    /* Default position - centered (overridden below) */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Default center */
}

/* Stacking Offsets (Generic - might need refinement) */
/* .placed-chip[data-offset="1"] { transform: translate(-70%, -70%); } */
/* .placed-chip[data-offset="2"] { transform: translate(-30%, -70%); } */
/* .placed-chip[data-offset="3"] { transform: translate(-70%, -30%); } */
/* .placed-chip[data-offset="4"] { transform: translate(-30%, -30%); } */
/* Define new chip positions based on sub-section */

/* --- Chip Positioning within Number Box Sub-sections --- */

/* Top Section (Lay, DC Flat, DC Odds) */
.box-top .placed-chip[data-is-lay-bet="true"] {
    top: 50%; left: 50%; /* Center Lay chip */
    transform: translate(-50%, -50%);
}
.box-top .placed-chip[data-is-dc-flat="true"] {
    top: 50%; left: 25%; /* DC Flat top-left */
    transform: translate(-50%, -50%);
}
.box-top .placed-chip[data-is-dc-odds="true"] {
    top: 50%; left: 75%; /* DC Odds top-right */
    transform: translate(-50%, -50%);
}

/* Middle Section (Come Flat, Come Odds) */
.box-middle .placed-chip[data-is-come-flat="true"] {
    top: 50%; left: 25%; /* Come Flat middle-left */
    transform: translate(-50%, -50%);
}
.box-middle .placed-chip[data-is-come-odds="true"] {
    top: 50%; left: 75%; /* Come Odds middle-right */
    transform: translate(-50%, -50%);
}

/* REVERTED: Bottom Left Section (Place Bets) */
.box-bottom-left .placed-chip[data-is-place-bet="true"] {
    top: 50%; left: 50%; /* Center Place chip */
    transform: translate(-50%, -50%);
}

/* REVERTED: Bottom Right Section (Buy Bets) */
.box-bottom-right .placed-chip[data-is-buy-bet="true"] {
    top: 50%; left: 50%; /* Center Buy chip */
    transform: translate(-50%, -50%);
}
/* --- End Chip Positioning within Number Box Sub-sections --- */


.placed-chip.chip-1 { background-color: #4db8ff; border: 2px solid #007bff; } /* Blue */
.placed-chip.chip-5 { background-color: #ff4d4d; border: 2px solid #dc3545; } /* Red */
.placed-chip.chip-25 { background-color: #4dff4d; border: 2px solid #28a745; } /* Green */
.placed-chip.chip-100 { background-color: #333; border: 2px solid #000; color: white; } /* Black */
.placed-chip.chip-500 { background-color: purple; border: 2px solid purple; color: white; } /* Purple */
.placed-chip.chip-1000 { background-color: yellow; border: 2px solid #FFD700; color: black; } /* Yellow with gold-like border and black text */

/* Animated chips for payout animations */
.animated-chip {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 2px;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    line-height: 1;
    min-width: 40px;
    min-height: 40px;
}

/* Animated chip colors - match placed chip colors */
.animated-chip.chip-1 { background-color: #4db8ff; border-color: #007bff; color: #000; }
.animated-chip.chip-5 { background-color: #ff4d4d; border-color: #dc3545; color: #000; }
.animated-chip.chip-25 { background-color: #4dff4d; border-color: #28a745; color: #000; }
.animated-chip.chip-100 { 
    background-color: #333 !important; 
    background: #333 !important; 
    border-color: #000 !important; 
    color: white !important; 
}
.animated-chip.chip-100 * {
    color: white !important;
}
.animated-chip.chip-500 { background-color: purple; border-color: purple; color: white; }
.animated-chip.chip-1000 { background-color: yellow; border-color: #FFD700; color: black; }

#game-message {
    color: #ffeb3b; /* Yellow */
    font-weight: bold;
    min-height: 2em; /* Reserve space for messages */
}

/* Style for Odds Areas - Position behind Pass/Don't Pass */
/* REMOVED Style for .pass-line-odds-area
.pass-line-odds-area {
    // Position behind the Pass Line Area
    bottom: 5px; // Position inside the bottom padding
    left: 5px;
    right: 5px;
    height: 30px;
}
*/

/* ... other styles ... */

/* Position DP Flat and Odds chips inside .dont-pass-area */
.dont-pass-area .placed-chip[data-is-dp-flat="true"] {
    top: 50%;
    left: 35%; /* Position flat bet left of center */
    transform: translate(-50%, -50%);
}
.dont-pass-area .placed-chip[data-is-dp-odds="true"] {
    top: 50%;
    left: 65%; /* Position odds bet right of center */
    transform: translate(-50%, -50%);
}

/* ADDED: Position Pass Line Flat and Odds chips inside .pass-line-area */
.pass-line-area .placed-chip[data-is-pass-flat="true"] {
    top: 40%; /* Move flat bet slightly up */
    left: 50%;
    transform: translate(-50%, -50%);
}
.pass-line-area .placed-chip[data-is-pass-odds="true"] {
    top: 90%; /* Position odds bet much lower below flat bet */
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Style for Odds Areas */
.odds-area {
    /* REMOVE absolute positioning from base class */
    /* position: absolute; */
    border: 1px dashed yellow;
    cursor: pointer;
    z-index: 10; /* Still useful if chips overlap slightly */
    min-height: 35px; /* Give it some clickable height */
    background-color: rgba(0,0,0,0.1);
    display: flex; /* Use flex for centering chips */
    align-items: center;
    justify-content: center;
    position: relative; /* Needed for absolute positioning of chips *within* it */
}

/* Override odds-area base styles for pass-line-odds-area to make it invisible */
.pass-line-odds-area.odds-area {
    border: none !important; /* Override yellow dashed border */
    background-color: transparent !important; /* Override background */
}

.pass-line-odds-area {
    grid-area: pass-odds; /* Assign to grid area */
    /* Remove absolute positioning properties */
    /* bottom: 5px; */
    /* left: 5px; */
    /* right: 5px; */
    /* height: 30px; */
    margin-top: 5px; /* Add space below the Pass Line */
    border: none; /* Remove border to make invisible */
    border-radius: 4px; /* Optional rounded corners */
    padding: 5px; /* Add some padding */
    font-size: 0.9em; /* Adjust size */
    background-color: transparent; /* Make background transparent */
    color: transparent; /* Hide text but keep container visible for chips */
    pointer-events: auto; /* Keep clickable */
    display: flex; /* Use flexbox for centering */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
}

/* Ensure chips are visible in the invisible area - override any parent opacity */
.pass-line-odds-area .placed-chip,
.pass-line-odds-area .placed-chip[data-is-pass-odds="true"] {
    opacity: 1 !important; /* Ensure chips are fully visible */
    visibility: visible !important; /* Ensure chips are visible */
    display: flex !important; /* Use flex to maintain centering */
}

/* Position chips centrally within the odds area by default */
.pass-line-odds-area .placed-chip[data-is-pass-odds="true"] {
    position: relative; /* Position relative to the flex container */
    top: auto; /* Reset absolute positioning */
    left: auto;
    transform: none; /* Reset transform */
    /* Add margin if multiple chips might stack */
    margin: 0 2px;
    /* Ensure chips are centered within the flex container */
    align-self: center;
}

/* REMOVED: Positioning for Odds within Pass Line Area */
/*
.pass-line-area .placed-chip[data-is-pass-flat="true"] {
    top: 40%; // Move flat bet slightly up
    left: 50%;
    transform: translate(-50%, -50%);
}
.pass-line-area .placed-chip[data-is-pass-odds="true"] {
    top: 90%; // Position odds bet much lower below flat bet
    left: 50%;
    transform: translate(-50%, -50%);
}
*/

/* Keep positioning for Flat bet within Pass Line Area */
.pass-line-area .placed-chip[data-is-pass-flat="true"] {
    top: 50%; /* Center it again */
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Keep positioning for DP Flat/Odds within Don't Pass Area */
.dont-pass-area .placed-chip[data-is-dp-flat="true"] {
    top: 50%;
    left: 35%;
    transform: translate(-50%, -50%);
}
.dont-pass-area .placed-chip[data-is-dp-odds="true"] {
    top: 50%;
    left: 65%;
    transform: translate(-50%, -50%);
}

/* Chip positioning within Number Boxes (.place-bet-box) */
/* Place Bet: Bottom Center */
.place-bet-box .placed-chip[data-is-place-bet="true"] {
    top: 90%; /* Lowered */
    left: 50%;
    transform: translate(-50%, -50%);
}

/* DC Flat: Top Left */
.place-bet-box .placed-chip[data-is-dc-flat="true"] {
    top: 10%; /* Raised */
    left: 25%;
    transform: translate(-50%, -50%);
}

/* DC Odds: Top Right */
.place-bet-box .placed-chip[data-is-dc-odds="true"] {
    top: 10%; /* Raised */
    left: 75%;
    transform: translate(-50%, -50%);
}

/* Come Flat: Middle Left - Keep as is */
.place-bet-box .placed-chip[data-is-come-flat="true"] {
    top: 50%;
    left: 25%;
    transform: translate(-50%, -50%);
}

/* Come Odds: Middle Right - Keep as is */
.place-bet-box .placed-chip[data-is-come-odds="true"] {
    top: 50%;
    left: 75%;
    transform: translate(-50%, -50%);
}

/* Style for Puck Marker */
.puck-marker {
    position: absolute;
    top: 2px; /* Position near top border */
    left: 50%;
    transform: translateX(-50%);
    width: 26px; /* Make smaller */
    height: 26px; /* Make smaller */
    /* background-color: black; Set in .on/.off */
    /* color: white; Set in .on/.off */
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px; /* Adjust font size slightly if needed */
    font-weight: bold;
    z-index: 25; /* Above chips */
    display: none; /* Start hidden, JS controls visibility */
}

.puck-marker.on {
    background-color: white; /* White background for ON */
    color: black;           /* Black text for ON */
    display: block;         /* Show when ON (controlled by JS) */
}

.puck-marker.off {
     background-color: black; /* Black background for OFF */
     color: white;           /* White text for OFF */
     /* display: block; JS will hide these unless it's the active 'OFF' state marker, if implemented */
     /* Let JS handle showing/hiding OFF pucks */
}

/* Style for inactive bets - Keep as is */
/* ... */

/* Modify the ON/OFF indicator logic (within the box text) - Keep as is */
/* ... */

/* Keep positioning for Flat bet within Pass Line Area */
.pass-line-area .placed-chip[data-is-pass-flat="true"] {
    top: 50%; /* Center it again */
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Keep positioning for DP Flat/Odds within Don't Pass Area */
.dont-pass-area .placed-chip[data-is-dp-flat="true"] {
    top: 50%;
    left: 35%;
    transform: translate(-50%, -50%);
}
.dont-pass-area .placed-chip[data-is-dp-odds="true"] {
    top: 50%;
    left: 65%;
    transform: translate(-50%, -50%);
}

/* Style for inactive bets */
.inactive {
    opacity: 0.5 !important; /* Make sure it overrides other opacity */
    cursor: not-allowed !important;
    /* Optional: add a grayscale filter? */
    /* filter: grayscale(80%); */
}
/* Ensure specific inactive chips/areas are not clickable */
.place-bet-box.inactive,
/* .odds-area.inactive, DEPRECATED - Only PL odds area exists */
.pass-line-odds-area.inactive, /* Target specific PL odds area */
.hardways .bet-area.inactive, /* Target inactive hardway areas */
.placed-chip.inactive[data-is-come-odds="true"],
.placed-chip.inactive[data-is-dc-odds="true"],
.placed-chip.inactive[data-is-pass-odds="true"],
/* .placed-chip.inactive[data-is-dp-odds="true"], DP Odds are inside DP area, not separately styled as inactive */
.placed-chip.inactive[data-is-hardway="true"] /* Target inactive hardway chips */
{
     pointer-events: none;
}

/* Changed selector and styles for OFF state */
.place-bet-box.bets-toggled-off::after {
    content: 'OFF' !important;
    background-color: #ccc !important; /* Grey background */
    color: #333; /* Dark grey text */
    /* Shared styles for positioning/padding */
    display: inline-block; /* Allow margin */
    margin-left: 5px;
    font-size: 0.8em;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 3px;
    vertical-align: middle; /* Align with box text */
}

/* --- Responsiveness Adjustments - REMOVED: Using desktop version on all screen sizes --- */

.roll-history {
    background-color: #004d1a;  /* Dark green for consistency */
    color: white;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #ccc;
    max-height: 150px;  /* Limit height to prevent overflow */
    overflow-y: auto;  /* Make it scrollable if needed */
    margin: 10px 0;
}
.roll-history ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}
.roll-history li {
    padding: 5px 0;
    border-bottom: 1px solid #666;
}

.hop-bets-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; width: 100%; justify-content: center; margin-top: 5px; }
.hop-bets-grid { display: flex; flex-wrap: wrap; width: 100%; justify-content: center; margin-top: 5px; max-height: 90px; overflow: hidden; }
.hop-dice { width: 12px; height: 12px; margin: 0 1px; border: 1px solid #000; border-radius: 3px; background-color: #fff; color: #000; }

/* Tab Styles */
.tab-header {
    display: flex;
    border-bottom: 2px solid #d4af37;
    margin-bottom: 5px;
}

.tab-button {
    padding: 8px 15px;
    background-color: #005609;
    color: white;
    border: 1px solid #d4af37;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    margin-right: 5px;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s;
    flex: 1;
    text-align: center;
}

.tab-button:hover {
    background-color: #007a33;
}

.tab-button.active {
    background-color: #d4af37;
    color: #003d03;
    border-color: #d4af37;
    z-index: 1;
}

.tab-content {
    display: none;
    border: 1px solid #d4af37;
    border-top: none;
    padding: 5px;
    background-color: #016D29;
    
}

.tab-content.active {
    display: block;
}

/* Hop Bets Styling */
.hop-bets-section {
    padding: 10px 5px;
    position: relative;
    height: 290px;
    font-size: 1px;
}

.hop-bets-grid {
    border-color: #d4af37;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 5px;
    width: 100%;
    justify-content: center;
    margin-bottom: 5px;
}

.hop-bet {
    padding: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background-color: #016D29;
    position: relative;
    min-height: 30px;
}

.hop-dice-pair {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hop-dice {
    width: 18px;
    height: 18px;
    margin: 0 1px;
    border-radius: 3px;
}

.hardway-hop {
    background-color: rgba(255, 255, 255, 0.1);
}

.hop-payout {
    color: white;
    text-align: center;
    font-size: 0.9em;
    margin-top: 5px;
    font-size: 50px;
    font-weight: bold;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 2px;
    border-radius: 3px;
}

/* Mobile media queries for hop bets - REMOVED: Using desktop version on all screen sizes */

/* Remove duplicate hop-dice style */
.hop-dice { 
    width: 18px;
    height: 18px;
    margin: 0 1px;
    border-radius: 3px;
    display: inline-block !important;
}

/* Tab style fixes */
.tab-button {
    position: relative !important;
    z-index: 2000 !important;
    cursor: pointer !important;
    pointer-events: all !important;
}

.tab-header {
    position: relative;
    z-index: 20;
}



/* Hop bets styles */
.hop-bets-grid { 
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 5px !important;
    width: 100% !important;
    justify-content: center !important;
    margin-top: 5px !important;
    max-height: none !important;
    overflow: visible !important;
}

.hop-dice { 
    width: 20px !important;
    height: 20px !important;
    margin: 0 2px !important;
    border: none !important;
    background: none !important;
    display: inline-block !important;
}

.hop-dice-pair {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 5px !important;
}

.hop-bet {
    background-color: #016D29 !important;
    border: 1px solid #d4af37 !important;
    border-radius: 5px !important;
    padding: 5px !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: background-color 0.2s !important;
    min-height: 40px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.hop-bet:hover {
    background-color: #025a24 !important;
}

.hop-payout {
    color: white !important;
    text-align: center !important;
    font-size: 12px !important;
    margin-top: 5px !important;
    font-weight: bold !important;
    background-color: rgba(0, 0, 0, 0.2) !important;
    padding: 2px !important;
    border-radius: 3px !important;
}

/* Mobile media queries for hop bets - REMOVED: Using desktop version on all screen sizes */

.disabled-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

/* ============================================== */
/* MOBILE RESPONSIVE STYLES                       */
/* Scale desktop layout to fit mobile screens     */
/* ============================================== */

/* Tablets - slight scale */
@media screen and (max-width: 1024px) {
    .craps-game-container {
        transform: scale(0.85);
        transform-origin: top left;
        width: 117.6%; /* 100% / 0.85 to compensate for scale */
        height: auto;
        min-height: calc((100vh - 55px) / 0.85);
    }
}

/* Small tablets and large phones */
@media screen and (max-width: 768px) {
    .craps-game-container {
        transform: scale(0.65);
        transform-origin: top left;
        width: 153.8%; /* 100% / 0.65 */
        min-height: calc((100vh - 55px) / 0.65);
    }
}

/* Phones */
@media screen and (max-width: 600px) {
    .craps-game-container {
        transform: scale(0.5);
        transform-origin: top left;
        width: 200%; /* 100% / 0.5 */
        min-height: calc((100vh - 55px) / 0.5);
    }
}

/* Small phones */
@media screen and (max-width: 480px) {
    .craps-game-container {
        transform: scale(0.42);
        transform-origin: top left;
        width: 238%; /* 100% / 0.42 */
        min-height: calc((100vh - 55px) / 0.42);
    }
}

/* Very small phones */
@media screen and (max-width: 380px) {
    .craps-game-container {
        transform: scale(0.35);
        transform-origin: top left;
        width: 285.7%; /* 100% / 0.35 */
        min-height: calc((100vh - 55px) / 0.35);
    }
}

/* ============================================== */
/* LANDSCAPE ORIENTATION STYLES                   */
/* Scale desktop layout to fit landscape screens   */
/* ============================================== */

/* Landscape - Tablets and larger devices */
@media (orientation: landscape) and (min-width: 1024px) {
    .craps-game-container {
        transform: scale(0.95);
        transform-origin: top left;
        width: 105.3%; /* 100% / 0.95 */
        height: auto;
        min-height: calc((100vh - 55px) / 0.95);
    }
}

/* Landscape - Large tablets */
@media (orientation: landscape) and (min-width: 768px) and (max-width: 1023px) {
    .craps-game-container {
        transform: scale(0.85);
        transform-origin: top left;
        width: 117.6%; /* 100% / 0.85 */
        height: auto;
        min-height: calc((100vh - 55px) / 0.85);
    }
}

/* Landscape - Large phones and small tablets */
@media (orientation: landscape) and (min-width: 600px) and (max-width: 767px) {
    .craps-game-container {
        transform: scale(0.7);
        transform-origin: top left;
        width: 142.9%; /* 100% / 0.7 */
        height: auto;
        min-height: calc((100vh - 55px) / 0.7);
    }
}

/* Landscape - Medium phones */
@media (orientation: landscape) and (min-width: 480px) and (max-width: 599px) {
    .craps-game-container {
        transform: scale(0.6);
        transform-origin: top left;
        width: 166.7%; /* 100% / 0.6 */
        height: auto;
        min-height: calc((100vh - 55px) / 0.6);
    }
}

/* Landscape - Small phones */
@media (orientation: landscape) and (max-width: 479px) {
    .craps-game-container {
        transform: scale(0.5);
        transform-origin: top left;
        width: 200%; /* 100% / 0.5 */
        height: auto;
        min-height: calc((100vh - 55px) / 0.5);
    }
}

/* --- EV Calculator Styles --- */
.controls-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    margin-top: 0; /* Remove top margin */
    margin-bottom: 0; /* Remove bottom margin */
}

/* Mobile: Show combined view at bottom, hide split view */
.ev-category-section,
.ev-total-section {
    display: none;
}

.ev-mobile-section {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 0; /* Remove top margin */
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    min-height: 90px;
    overflow: hidden; /* Hide overflow on container, let inner list scroll */
    /* max-height will be set by JavaScript to extend to bottom */
}

.ev-mobile-section .ev-section-title {
    flex-shrink: 0;
    margin-bottom: 10px;
}

.ev-mobile-section .ev-category-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    /* Enable scrolling when content exceeds available space */
}

.ev-mobile-section .ev-total-display {
    flex-shrink: 0;
    margin-top: 10px;
}

/* Desktop/Landscape: Show split view around controls, hide mobile view */
@media (min-width: 1024px) and (orientation: landscape) {
    .controls-wrapper {
        flex-direction: row;
        align-items: stretch;
        gap: 6px;
        flex: 1 1 auto;
        min-height: 0;
        margin-bottom: 0;
        /* Allow wrapper to grow and fill remaining space */
    }

    .ev-category-section {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-width: 0;
        padding: 5px;
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 8px;
        border: 2px solid rgba(255, 255, 255, 0.3);
        min-height: 90px;
        overflow: hidden;
        flex-shrink: 0;
        /* max-height will be set by JavaScript to extend to bottom */
    }

    .ev-total-section {
        display: block;
        flex: 1;
        min-width: 0;
        padding: 5px;
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 8px;
        border: 2px solid rgba(255, 255, 255, 0.3);
        flex-shrink: 0;
        max-height: 160px;
        overflow-y: auto;
    }

    .controls-area {
        flex: 0 0 auto;
        min-width: clamp(250px, 25vw, 350px);
        flex-shrink: 0;
    }

    .ev-mobile-section {
        display: none;
    }
    
    /* Reduce spacing on desktop to fit content */
    .dice-area {
        margin-bottom: 5px;
        padding: 6px;
    }
    
    .betting-board {
        margin-bottom: 0; /* Remove bottom margin */
        padding: 2px;
    }
    
    .roll-history-container {
        margin: 0; /* Remove all margins */
        margin-top: 0; /* Remove top margin */
        padding: 3px;
    }
    
    .ev-section-title {
        font-size: 0.85em;
        margin-bottom: 5px;
    }
    
    .ev-category-item {
        padding: 4px 6px;
        font-size: 0.75em;
    }
    
    .ev-category-section .ev-section-title {
        flex-shrink: 0;
        margin-bottom: 5px;
    }
    
    .ev-category-section .ev-category-list {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        gap: 3px;
        /* Enable scrolling when content exceeds available space */
    }
    
    .ev-total-display {
        padding: 6px;
    }
    
    .ev-total-row {
        padding: 4px 0;
        font-size: 0.9em;
    }
    
    .bankroll-display {
        margin-bottom: 3px;
        padding: 2px;
        font-size: 0.85em;
    }
    
    .chipDeck {
        margin: 3px auto;
    }
    
    .action-buttons {
        margin-top: 3px;
    }
    
    .action-buttons .btn {
        font-size: 0.85em;
        padding: 4px 6px;
    }
}

/* Smaller desktop/laptop screens - use mobile layout and reduce spacing */
@media (min-width: 768px) and (max-width: 1023px) {
    .craps-game-container {
        padding: 0.2vh 0.2vh 1vh 0.2vh; /* Extra bottom padding */
        font-size: 0.8em;
    }
    
    .ev-category-section,
    .ev-total-section {
        display: none;
    }
    
    .ev-mobile-section {
        display: flex;
        flex-direction: column;
        margin-top: 2px;
        padding: 5px;
        min-height: 90px;
        overflow: hidden; /* Hide overflow on container, let inner list scroll */
        margin-bottom: 3px;
        /* max-height will be set by JavaScript to extend to bottom */
    }
    
    .ev-mobile-section .ev-category-list {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    /* Reduce spacing to fit content */
    .dice-area {
        margin-bottom: 4px;
        padding: 5px;
    }
    
    .betting-board {
        margin-bottom: 0; /* Remove bottom margin */
        padding: 2px;
        transform: scale(0.92);
        transform-origin: top center;
    }
    
    .roll-history-container {
        margin: 0; /* Remove all margins */
        margin-top: 0; /* Remove top margin */
        padding: 3px;
    }
    
    .controls-area {
        margin-top: 1px;
        margin-bottom: 1px;
    }
    
    .bankroll-display {
        margin-bottom: 2px;
        padding: 2px;
        font-size: 0.8em;
    }
    
    .chipDeck {
        margin: 2px auto;
        transform: scale(0.85);
    }
    
    .action-buttons {
        margin-top: 2px;
    }
    
    .action-buttons .btn {
        font-size: 0.75em;
        padding: 3px 5px;
    }
    
    .ev-category-item {
        padding: 3px 5px;
        font-size: 0.7em;
    }
    
    .ev-category-list {
        gap: 2px;
    }
    
    .ev-total-display {
        padding: 6px;
        margin-top: 3px;
    }
    
    .ev-total-row {
        padding: 3px 0;
        font-size: 0.85em;
    }
}

/* Medium desktop screens - adjust EV calculator height and spacing */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
    .craps-game-container {
        padding: 0.2vh 0.2vh 0.8vh 0.2vh; /* Extra bottom padding */
        font-size: 0.8em;
    }
    
    .ev-category-section {
        max-height: 120px;
        padding: 4px;
    }
    
    .ev-total-section {
        padding: 4px;
        max-height: 120px;
    }
    
    .dice-area {
        margin-bottom: 4px;
        padding: 5px;
    }
    
    .betting-board {
        margin-bottom: 0; /* Remove bottom margin */
        padding: 2px;
        transform: scale(0.95);
        transform-origin: top center;
    }
    
    .roll-history-container {
        margin: 0; /* Remove all margins */
        margin-top: 0; /* Remove top margin */
        padding: 2px;
    }
    
    .controls-wrapper {
        gap: 5px;
        margin-top: 0; /* Remove top margin */
        margin-bottom: 0; /* Remove bottom margin */
    }
    
    .ev-category-item {
        padding: 2px 4px;
        font-size: 0.65em;
        margin-bottom: 1px;
    }
    
    .ev-category-list {
        gap: 1px;
    }
    
    .ev-category-ev,
    .ev-category-edge {
        font-size: 0.7em;
        min-width: 70px;
    }
    
    .ev-section-title {
        font-size: 0.75em;
        margin-bottom: 3px;
    }
    
    .bankroll-display {
        margin-bottom: 2px;
        padding: 2px;
        font-size: 0.75em;
    }
    
    .action-buttons {
        margin-top: 2px;
    }
    
    .action-buttons .btn {
        font-size: 0.75em;
        padding: 3px 5px;
    }
    
    .chipDeck {
        margin: 2px auto;
        transform: scale(0.85);
    }
    
    .ev-total-display {
        padding: 5px;
    }
    
    .ev-total-row {
        padding: 2px 0;
        font-size: 0.8em;
    }
}

/* Tablet and smaller (up to 767px) */
@media (max-width: 767px) {
    .ev-category-values {
        flex-direction: column;
        align-items: flex-end;
        gap: 5px;
    }
    
    .ev-category-ev,
    .ev-category-edge {
        min-width: auto;
        font-size: 0.9em;
    }
}

.ev-section-title {
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
    color: #dabd00;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ev-category-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ev-category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    border-left: 3px solid #dabd00;
    font-size: 0.85em;
    flex-shrink: 0;
}

.ev-category-item:empty {
    display: none;
}

.ev-category-name {
    font-weight: bold;
    color: white;
    flex: 1;
}

.ev-category-values {
    display: flex;
    gap: 15px;
    align-items: center;
}

.ev-category-ev {
    color: #90EE90;
    font-weight: bold;
    min-width: 90px;
    text-align: right;
    font-size: 0.9em;
}

.ev-category-edge {
    color: #FFB6C1;
    font-weight: bold;
    min-width: 110px;
    text-align: right;
    font-size: 0.9em;
}

.ev-total-display {
    background-color: rgba(0, 0, 0, 0.4);
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #dabd00;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    min-height: 80px;
    align-items: stretch;
}

.ev-total-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    padding: 8px;
    border-radius: 4px;
    height: 100%;
    font-size: 0.95em;
}

.ev-label {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ev-value {
    font-weight: bold;
    font-size: 1.4rem;
}

#ev-total-value,
#ev-total-value-mobile {
    color: #90EE90;
}

#ev-house-edge-total,
#ev-house-edge-total-mobile {
    color: #FFB6C1;
}

/* Responsive adjustments for mobile */
@media (max-width: 1023px) or (orientation: portrait) {
    .ev-calculator-container {
        margin-top: 20px;
    }

    .ev-category-item {
        font-size: 0.8em;
        padding: 6px 10px;
    }

    .ev-category-values {
        gap: 10px;
        flex-direction: column;
        align-items: flex-end;
    }

    .ev-category-ev,
    .ev-category-edge {
        min-width: auto;
        font-size: 0.9em;
    }
}

