/* Custom Properties and Styling Variables */
:root {
    /* Color Palette */
    --color-wood-dark: #2a1608;
    --color-wood-med: #4a2b16;
    --color-wood-light: #704728;
    --color-wood-highlight: #a67246;
    
    --color-parchment-base: #f4ebd0;
    --color-parchment-shadow: #e0d0b0;
    --color-parchment-dark: #c8b088;
    
    --color-gold: #e5b842;
    --color-gold-dark: #b88a14;
    --color-gold-light: #f3d87b;
    
    --color-bullet: #1e1e1e;
    --color-crimson: #8a1f1f;
    --color-forest: #2b5c37;
    
    /* Layout spacing (Responsive) */
    --slot-spacing: 320px;
    --carton-width: 240px;
    --carton-height: 400px;
    --character-height: 200px;
    --lift-distance: -240px;
}

@media (max-width: 900px) {
    :root {
        --slot-spacing: 210px;
        --carton-width: 140px;
        --carton-height: 233px;
        --character-height: 116px;
        --lift-distance: -140px;
    }
}

@media (max-width: 580px) {
    :root {
        --slot-spacing: 155px;
        --carton-width: 120px;
        --carton-height: 200px;
        --character-height: 100px;
        --lift-distance: -120px;
    }
}

@media (max-width: 430px) {
    :root {
        --slot-spacing: 120px;
        --carton-width: 95px;
        --carton-height: 158px;
        --character-height: 80px;
        --lift-distance: -100px;
    }
}

@media (max-width: 365px) {
    :root {
        --slot-spacing: 102px;
        --carton-width: 82px;
        --carton-height: 136px;
        --character-height: 68px;
        --lift-distance: -90px;
    }
}

/* Reset and Core Layout */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Special Elite', monospace;
    background-color: var(--color-wood-dark);
    /* Load background.png as the main background */
    background-image: linear-gradient(rgba(15, 8, 3, 0.45), rgba(15, 8, 3, 0.65)), url('background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #ffd8a0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Bullet Holes Layer */
.bullet-holes-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

.bullet-hole {
    position: absolute;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, #000 20%, #222 40%, transparent 60%);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.9;
    animation: blastHole 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.bullet-hole::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    transform: translate(-50%, -50%);
    background-image: 
        repeating-radial-gradient(circle, transparent, transparent 4px, rgba(255, 255, 255, 0.1) 5px, rgba(255, 255, 255, 0.15) 6px, transparent 7px),
        linear-gradient(45deg, transparent 49%, rgba(255, 255, 255, 0.25) 50%, transparent 51%),
        linear-gradient(-45deg, transparent 49%, rgba(255, 255, 255, 0.25) 50%, transparent 51%),
        linear-gradient(90deg, transparent 49%, rgba(255, 255, 255, 0.25) 50%, transparent 51%),
        linear-gradient(0deg, transparent 49%, rgba(255, 255, 255, 0.25) 50%, transparent 51%);
    pointer-events: none;
}

.muzzle-flash {
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255, 230, 150, 0.9) 10%, rgba(255, 100, 30, 0.6) 40%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 1;
    pointer-events: none;
    z-index: 10000;
    animation: flashDecay 0.1s ease-out forwards;
}

@keyframes blastHole {
    to { transform: translate(-50%, -50%) scale(1); }
}

@keyframes flashDecay {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

/* Master Game Container */
.game-container {
    width: 100%;
    max-width: 1200px;
    min-height: 90vh;
    margin: 20px;
    display: flex;
    flex-direction: column;
    background: rgba(10, 5, 2, 0.75);
    border: 8px double var(--color-wood-highlight);
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), inset 0 0 100px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    overflow: hidden;
}

/* Header styling */
.game-header {
    background-color: var(--color-parchment-base);
    background-image: 
        radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.25), transparent),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.015) 2px, rgba(0, 0, 0, 0.015) 4px);
    border-bottom: 4px solid var(--color-wood-med);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: inset 0 -5px 15px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.35);
}

.logo-container {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    max-width: 260px;
}

.logo-container a {
    display: flex;
    align-items: center;
    width: 100%;
    transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.2s ease;
}

.logo-container a:hover {
    transform: scale(1.04);
    opacity: 0.85;
}

.jugg-logo {
    width: 100%;
    height: auto;
    max-height: 52px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

.game-title {
    font-family: 'Rye', serif;
    font-size: 3.2rem;
    color: var(--color-wood-dark);
    text-shadow: 
        1px 1px 0px rgba(255, 255, 255, 0.95),  
        0px 2px 4px rgba(0, 0, 0, 0.25);
    flex: 2 1 350px;
    text-align: right;
    letter-spacing: 1.5px;
}

@media (max-width: 768px) {
    .game-header {
        justify-content: center;
        text-align: center;
        padding: 10px 15px;
    }
    .game-title {
        text-align: center;
        font-size: 2rem;
    }
    .logo-container {
        justify-content: center;
        max-width: 180px;
    }
}

/* Main Content Area */
.game-main {
    flex: 1;
    display: flex;
    position: relative;
}

@media (max-width: 900px) {
    .game-main {
        flex-direction: column-reverse;
    }
}

/* Sidebar Score & Info */
.game-info {
    width: 170px;
    background: linear-gradient(to right, rgba(20, 10, 4, 0.9), rgba(15, 8, 3, 0.85));
    border-right: 4px solid var(--color-wood-med);
    padding: 25px 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-shrink: 0;
    z-index: 10;
}

.game-info .wood-btn {
    width: 100%;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .game-info {
        width: 100%;
        border-right: none;
        border-top: 4px solid var(--color-wood-med);
        padding: 15px;
        flex-direction: row;
        gap: 10px;
        align-items: center;
        justify-content: center;
    }
    .game-info .wood-btn {
        width: auto;
        flex: 1;
    }
}
}

/* Bandit Stash / Stats Panel */
.bandit-stash-panel {
    background: rgba(42, 22, 8, 0.4);
    border: 3px double var(--color-wood-highlight);
    border-radius: 6px;
    padding: 18px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6);
    flex: 1 1 240px;
}

.badge-header {
    font-family: 'Rye', serif;
    font-size: 1.15rem;
    color: var(--color-gold);
    border-bottom: 2px dashed var(--color-wood-highlight);
    padding-bottom: 8px;
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: 1px;
}

.ledger-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Smokum', serif;
    font-size: 1.6rem;
}

.stat-label {
    color: var(--color-parchment-dark);
}

.stat-value {
    color: #fff;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

#bounty-val {
    color: var(--color-gold-light);
}

/* Rules notice board (Parchment scroll style) */
.rules-board {
    background-color: var(--color-parchment-base);
    background-image: 
        radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.15), transparent),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.02) 2px, rgba(0, 0, 0, 0.02) 4px);
    border: 1px solid var(--color-parchment-dark);
    border-radius: 2px;
    box-shadow: 
        3px 3px 0px rgba(0, 0, 0, 0.15),
        inset 0 0 40px rgba(92, 58, 33, 0.25);
    padding: 20px;
    color: #2c1a0c;
    flex: 2 1 240px;
    display: flex;
    flex-direction: column;
    transform: rotate(-0.5deg);
    position: relative;
    border-left: 5px solid var(--color-parchment-dark);
    border-right: 5px solid var(--color-parchment-dark);
}

.rules-board::before {
    content: '📌';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    filter: drop-shadow(1px 2px 1px rgba(0,0,0,0.4));
}

.rules-title {
    font-family: 'Rye', serif;
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 12px;
    color: var(--color-wood-dark);
    border-bottom: 1px solid var(--color-parchment-dark);
    padding-bottom: 6px;
}

.rules-list {
    list-style: none;
    font-size: 0.85rem;
    line-height: 1.45;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.rules-list li {
    position: relative;
    padding-left: 15px;
}

.rules-list li::before {
    content: '★';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-wood-light);
    font-size: 0.75rem;
}

.rules-footer {
    font-family: 'Smokum', serif;
    font-size: 1.3rem;
    text-align: center;
    margin-top: 15px;
    color: var(--color-crimson);
}

.side-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 100%;
}

@media (max-width: 900px) {
    .rules-board {
        display: none; /* Collapsed into modal for mobile */
    }
    .side-controls {
        flex: 1 1 150px;
        justify-content: center;
    }
}

/* Wood Button styles */
.wood-btn {
    font-family: 'Smokum', serif;
    background: linear-gradient(to bottom, var(--color-wood-light), var(--color-wood-med));
    border: 3px solid var(--color-wood-dark);
    border-top-color: var(--color-wood-highlight);
    border-bottom-color: #120903;
    border-radius: 4px;
    color: var(--color-parchment-base);
    text-shadow: 0 2px 2px #000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    user-select: none;
}

.wood-btn:hover {
    background: linear-gradient(to bottom, var(--color-wood-highlight), var(--color-wood-light));
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 5px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.wood-btn:active {
    background: linear-gradient(to bottom, var(--color-wood-dark), var(--color-wood-med));
    transform: translateY(2px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.wood-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-sm {
    padding: 10px 15px;
    font-size: 1.2rem;
}

.btn-lg {
    padding: 15px 35px;
    font-size: 1.8rem;
    font-family: 'Rye', serif;
    letter-spacing: 2px;
}

.mobile-only {
    display: none;
}

@media (max-width: 900px) {
    .mobile-only {
        display: block;
    }
}

/* Gameboard Area */
.game-board {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px;
    background-size: cover;
    background-position: center;
}

.board-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 30%, rgba(10, 5, 2, 0.65) 90%);
    pointer-events: none;
    z-index: 1;
}

.game-prompt-container {
    z-index: 2;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.game-prompt {
    font-family: 'Smokum', serif;
    font-size: 2.2rem;
    color: var(--color-gold);
    text-shadow: 0 3px 5px rgba(0,0,0,0.9), 0 0 15px rgba(229, 184, 66, 0.4);
    background: rgba(18, 9, 3, 0.85);
    border: 2px solid var(--color-wood-highlight);
    border-radius: 4px;
    padding: 10px 30px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    min-width: 280px;
    animation: promptPulse 2s infinite ease-in-out;
}

@keyframes promptPulse {
    0%, 100% { opacity: 0.95; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
}

@media (max-width: 580px) {
    .game-prompt {
        font-size: 1.6rem;
        padding: 6px 15px;
    }
}

/* Saloon Table / Shelf */
.saloon-table {
    position: relative;
    width: 100%;
    height: 480px;
    margin-top: auto;
    z-index: 2;
}

.table-surface {
    position: absolute;
    bottom: 50px;
    left: 5%;
    width: 90%;
    height: 80px;
    background: linear-gradient(to bottom, var(--color-wood-light) 0%, var(--color-wood-med) 30%, var(--color-wood-dark) 100%);
    border-radius: 20px / 10px;
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.7),
        inset 0 10px 20px rgba(255, 255, 255, 0.15),
        inset 0 -10px 20px rgba(0, 0, 0, 0.6);
    border-top: 3px solid var(--color-wood-highlight);
}

.table-wood-lip {
    position: absolute;
    bottom: 35px;
    left: 4%;
    width: 92%;
    height: 20px;
    background: #1c0e05;
    border-radius: 10px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.8);
    border-bottom: 2px solid rgba(255,255,255,0.05);
}

/* Cartons Container and Wrappers */
.cartons-container {
    position: absolute;
    bottom: 95px; /* Sits on top of table surface */
    left: 0;
    width: 100%;
    height: var(--carton-height);
}

.carton-wrapper {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: var(--carton-width);
    height: var(--carton-height);
    transform: translateX(-50%) translateX(calc(var(--slot-index) * var(--slot-spacing)));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    z-index: 2;
}

.carton-wrapper.clickable .carton-img {
    cursor: pointer;
}

/* Character Hidden Container */
.character-container {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: var(--character-height);
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    pointer-events: none;
    overflow: visible;
}

.juggirl-img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transform: scale(0.85);
    opacity: 0;
    filter: drop-shadow(0 5px 8px rgba(0,0,0,0.6));
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.carton-wrapper.has-girl.lifted .juggirl-img {
    opacity: 1;
    transform: scale(1);
}

/* Milk Carton Visual */
.carton-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 3;
    pointer-events: auto;
    filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 0.75));
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1), filter 0.5s ease;
}

/* Raised/Lifted Milk Carton state */
.carton-wrapper.lifted .carton-img {
    transform: translateY(var(--lift-distance));
    filter: drop-shadow(0 35px 25px rgba(0, 0, 0, 0.55));
}

/* Custom interactive hover scale for cartons */
.carton-wrapper.clickable:hover .carton-img {
    transform: scale(1.04);
    filter: drop-shadow(0 20px 20px rgba(0, 0, 0, 0.8));
}

.carton-wrapper.clickable.lifted:hover .carton-img {
    transform: translateY(var(--lift-distance)) scale(1.04);
}

/* Shadows indicator at the bottom of cartons */
.shadow-indicator {
    position: absolute;
    bottom: -5px;
    width: 80%;
    height: 15px;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.6) 0%, transparent 70%);
    z-index: 2;
    pointer-events: none;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.carton-wrapper.lifted .shadow-indicator {
    transform: scale(0.6);
    opacity: 0.35;
}

/* Bottom Controls */
.action-container {
    display: flex;
    justify-content: center;
    padding-top: 20px;
    z-index: 5;
}

@media (max-width: 900px) {
    .saloon-table {
        height: 340px;
    }
}

@media (max-width: 580px) {
    .saloon-table {
        height: 220px;
    }
}

/* Modular Overlay Modals */
.overlay-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.parchment-scroll {
    position: relative;
    width: 90%;
    max-width: 450px;
    background-color: var(--color-parchment-base);
    border: 5px double var(--color-parchment-dark);
    border-radius: 4px;
    padding: 35px 25px 25px;
    color: #2c1a0c;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6), inset 0 0 50px rgba(92, 58, 33, 0.3);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 10;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--color-wood-dark);
}

/* Results Wanted Poster Modal */
.results-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.wanted-poster-container {
    z-index: 10;
    transform: rotateX(20deg) translateY(-50px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.results-modal.active .wanted-poster-container {
    transform: rotateX(0deg) translateY(0);
    opacity: 1;
}

/* Wanted Poster design */
.wanted-poster {
    position: relative;
    width: 420px;
    background-color: var(--color-parchment-base);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(224, 208, 176, 0.4), transparent),
        radial-gradient(circle at 80% 80%, rgba(200, 176, 136, 0.4), transparent),
        repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(0, 0, 0, 0.015) 1px, rgba(0, 0, 0, 0.015) 3px);
    border: 3px solid #3c2a1c;
    outline: 8px solid var(--color-parchment-base);
    outline-offset: 4px;
    border-radius: 3px;
    padding: 30px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.9), 
        inset 0 0 60px rgba(92, 58, 33, 0.3),
        5px 15px 0px rgba(0,0,0,0.25);
    color: #2c1a0c;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transform: rotate(-1.5deg);
    animation: wantedPosterSway 4s ease-in-out infinite alternate;
}

@keyframes wantedPosterSway {
    0% { transform: rotate(-2deg); }
    100% { transform: rotate(1deg); }
}

@media (max-width: 500px) {
    .wanted-poster {
        width: 320px;
        padding: 20px 15px;
        outline-width: 5px;
    }
}

/* Stamp graphics on wanted poster */
.poster-stamp {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    transform: rotate(20deg);
    pointer-events: none;
    z-index: 5;
    opacity: 0.85;
}

.poster-stamp.stamp-win {
    border: 4px double var(--color-forest);
    color: var(--color-forest);
    background: rgba(43, 92, 55, 0.08);
}

.poster-stamp.stamp-lose {
    border: 4px double var(--color-crimson);
    color: var(--color-crimson);
    background: rgba(138, 31, 31, 0.08);
}

.poster-header {
    font-family: 'Rye', serif;
    font-size: 3.5rem;
    letter-spacing: 4px;
    color: #1e1208;
    line-height: 1;
    margin-bottom: 5px;
    font-weight: bold;
}

.poster-subheader {
    font-family: 'Rye', serif;
    font-size: 1.1rem;
    letter-spacing: 2px;
    color: #4c3320;
    border-bottom: 3px double #3c2a1c;
    width: 90%;
    padding-bottom: 8px;
    margin-bottom: 20px;
}

.poster-target {
    width: 160px;
    height: 180px;
    background-color: var(--color-parchment-shadow);
    border: 2px solid #5c3c24;
    padding: 8px;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.poster-photo-frame {
    width: 100%;
    height: 100%;
    background-color: #dfd2b5;
    border: 1px solid #c0b090;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.poster-photo {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    filter: sepia(0.8) contrast(1.1) brightness(0.9);
}

.poster-details {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 25px;
}

.poster-outcome-title {
    font-family: 'Rye', serif;
    font-size: 2.2rem;
    letter-spacing: 1px;
}

.results-modal.win .poster-outcome-title {
    color: var(--color-forest);
}

.results-modal.lose .poster-outcome-title {
    color: var(--color-crimson);
}

.poster-outcome-desc {
    font-family: 'Special Elite', monospace;
    font-size: 0.9rem;
    color: #4a3525;
    line-height: 1.35;
    max-width: 90%;
}

.reward-box {
    margin-top: 10px;
    border: 2px dashed #4a3525;
    padding: 8px 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: rgba(0,0,0,0.02);
}

.reward-label {
    font-size: 0.8rem;
    color: #705844;
    letter-spacing: 1px;
}

.reward-value {
    font-family: 'Smokum', serif;
    font-size: 2rem;
    font-weight: bold;
    color: #1e1208;
}

.results-modal.win .reward-value {
    color: #b3860d;
}

.results-modal.lose .reward-value {
    color: var(--color-crimson);
}

.poster-actions {
    width: 100%;
}

.play-again-btn {
    width: 90%;
    padding: 12px 25px;
    font-size: 1.5rem;
    font-family: 'Rye', serif;
    letter-spacing: 1px;
}

/* Helper Utilities */
.hidden {
    display: none !important;
}

/* Gold coins falling effect (CSS particles) */
.coin-particle {
    position: fixed;
    width: 15px;
    height: 15px;
    background-color: var(--color-gold);
    border: 1px solid var(--color-gold-dark);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10001;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Mobile Optimizations */
.game-container {
    user-select: none;
    -webkit-user-select: none;
}

.carton-img, .juggirl-img, .jugg-logo {
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
}

.carton-img {
    pointer-events: auto;
}

.wood-btn, .carton-img {
    touch-action: manipulation;
}

@media (max-width: 580px) {
    .game-container {
        margin: 0;
        border-width: 4px;
        border-radius: 0;
        width: 100vw;
        min-height: 100svh;
        height: 100svh;
        display: flex;
        flex-direction: column;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .game-board {
        padding: 12px 8px;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    .game-header {
        padding: 6px 12px;
        gap: 8px;
    }
    .logo-container {
        max-width: 130px;
        margin-bottom: 2px;
    }
    .game-title {
        font-size: 1.5rem;
    }
    .saloon-table {
        height: 250px;
        margin-top: auto;
    }
    .table-surface {
        bottom: 25px;
        height: 55px;
    }
    .table-wood-lip {
        bottom: 15px;
        height: 12px;
    }
    .cartons-container {
        bottom: 60px;
    }
    .action-container {
        padding-top: 8px;
        padding-bottom: 4px;
    }
    .btn-lg {
        padding: 10px 22px;
        font-size: 1.35rem;
    }
    .game-info {
        padding: 8px 10px 14px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
        gap: 8px;
    }
    .btn-sm {
        padding: 8px 10px;
        font-size: 0.95rem;
    }
}

@media (max-width: 430px) {
    .game-title {
        font-size: 1.3rem;
    }
    .logo-container {
        max-width: 110px;
    }
    .saloon-table {
        height: 200px;
    }
    .table-surface {
        bottom: 20px;
        height: 45px;
    }
    .table-wood-lip {
        bottom: 12px;
        height: 10px;
    }
    .cartons-container {
        bottom: 48px;
    }
    .btn-lg {
        padding: 8px 18px;
        font-size: 1.15rem;
    }
    .btn-sm {
        padding: 6px 8px;
        font-size: 0.85rem;
    }
}

@media (max-width: 365px) {
    .game-title {
        font-size: 1.15rem;
    }
    .logo-container {
        max-width: 95px;
    }
    .saloon-table {
        height: 175px;
    }
    .table-surface {
        bottom: 15px;
        height: 40px;
    }
    .table-wood-lip {
        bottom: 8px;
        height: 8px;
    }
    .cartons-container {
        bottom: 38px;
    }
    .btn-lg {
        padding: 6px 14px;
        font-size: 1.05rem;
    }
    .btn-sm {
        padding: 4px 6px;
        font-size: 0.75rem;
    }
}
