/* --- Keno Game Styles --- */
#kenoGameSection {
    background: linear-gradient(120deg, #39275b 0%, #a198d7 100%);
    color: #fff8dc;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    height: auto;
    border: 4px solid #dab710;
    border-radius: 18px;
    box-shadow: 0 0 30px #dab71088;
    font-family: 'Orbitron', 'Arial Black', sans-serif;
}
.keno-grid,
.keno-number-grid {
    display: grid;
    grid-template-columns: repeat(10, 38px);
    gap: 7px;
    background: #2d1942;
    border: 4px solid #dab710;
    border-radius: 14px;
    box-shadow: 0 0 12px #dab71044;
  
    padding: 10px;
  
    justify-content: center;
    height: max-content;
}
.keno-grid button,
.keno-number-grid .keno-num-btn {
    background: #ffeb00;
    color: #39275b;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-weight: bold;
    padding:4px 4px;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: 0 2px 4px #dab71033;
    transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}
.keno-grid button:hover:not(:disabled),
.keno-number-grid .keno-num-btn:hover:not(:disabled) {
    background: #ffee93;
    color: #2d1942;
    box-shadow: 0 4px 10px #dab71050;
}
.keno-grid button.selected,
.keno-number-grid .keno-num-btn.selected {
    background: #fff8dc !important;
    color: #daae0c !important;
    border: 2px solid #dab710;
    box-shadow: 0 0 8px #dab710bb;
}
.keno-number-grid .keno-num-btn.drawn {
    background: #daae0c !important;
    color: #fff8dc !important;
    box-shadow: 0 0 10px #ffe031bb;
}

/* =========================================
   KENO "HIT" JACKPOT EFFECT (Red & Gold)
   ========================================= */

/* The Pulsing Glow Animation */
@keyframes kenoHitGlow {
    0% {
        box-shadow: 0 0 10px #e74c3c, 0 0 15px #f1c40f;
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 25px #e74c3c, 0 0 35px #f1c40f, inset 0 0 15px rgba(241, 196, 15, 0.6);
        transform: scale(1.15); /* Pops out at the player */
    }
    100% {
        box-shadow: 0 0 10px #e74c3c, 0 0 15px #f1c40f;
        transform: scale(1.05);
    }
}

/* 1. The Grid Button Hit */
.keno-number-grid .keno-num-btn.hit {
    background: linear-gradient(135deg, #e74c3c 0%, #900c3f 100%) !important; /* Rich Red */
    color: #f1c40f !important; /* Gold Text */
    border: 2px solid #f1c40f !important;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    animation: kenoHitGlow 0.6s infinite alternate !important; /* Rapid pulse */
    z-index: 10; /* Brings the scaling button to the front */
    position: relative;
}

/* Add a Gold Star badge to the top right of the button */
.keno-number-grid .keno-num-btn.hit::after {
    content: "★";
    position: absolute;
    top: -8px; 
    right: -6px;
    font-size: 1.2em;
    color: #f1c40f;
    text-shadow: 0 0 8px rgba(241, 196, 15, 0.8), 0 0 3px #000;
    pointer-events: none;
}

/* 2. The Results Tray Hit (Bottom Display) */
.drawn-num-bubble.hit {
    background: linear-gradient(135deg, #e74c3c 0%, #900c3f 100%) !important;
    color: #f1c40f !important;
    border: 2px solid #f1c40f !important;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    animation: kenoHitGlow 0.6s infinite alternate;
    font-weight: 900;
}
/* Game main layout */
#kenoGameSection .game-content {
    display: flex;
    flex-direction: row;
    max-width: 1200px;
    width: 100%;
    justify-content: center;
}

/* Controls with slot panel feel */
#kenoGameSection .game-controls {
    flex: 0 0 250px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(120deg, #453090 0%, #907ce2 100%);
    border-radius: 18px;
    border: 2.5px solid #dab710;
    box-shadow: 0 3px 16px #dab71022;
}
#kenoGameSection .game-controls .credit-display,
#kenoGameSection .game-controls .message-display {
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
    color: #dab710;
}

#kenoGameSection .game-controls .bet-input input {
    width: 100%;
    padding: 8px;
    border: 1px solid #dab710;
    border-radius: 8px;
    background-color: #fff8dc;
    color: #39275b;
    text-align: center;
    font-size: 1em;
}

#kenoGameSection .action-btn,
#kenoGameSection .secondary-btn,
#kenoGameSection .info-btn {
    padding: 12px 19px;
    border-radius: 9px;
    border: none;
    font-size: 1.1em;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    box-shadow: 0 2px 8px #dab71044;
    letter-spacing: 0.02em;
}
#kenoGameSection .action-btn {
    background: #dab710;
    color: #39275b;
    border: 2px solid #ffc700;
}
#kenoGameSection .action-btn:hover:not(:disabled) {
    background: #ffee93;
    color: #4b1c51;
}
#kenoGameSection .secondary-btn {
    background: #907ce2;
    color: #fff8dc;
    border: 2px solid #dab71099;
}
#kenoGameSection .secondary-btn:hover:not(:disabled) { background: #cabffd; }
#kenoGameSection .info-btn {
    background: #daae0c;
    color: #39275b;
    border: 2px solid #dab710;
}
#kenoGameSection .info-btn:hover:not(:disabled) { background: #fff7bf; color: #7b5f14; }
#kenoGameSection button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.keno-game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(120deg, #453090 0%, #907ce2 100%);
    border-radius: 18px;
    border: 2.5px solid #dab710;
    box-shadow: 0 3px 16px #dab71022;
}

.keno-game-area h3 {
    text-align: center;
    color: #dab710;
    margin-bottom: 10px;
    font-size: 1.35em;
}

.number-display {
    min-height: 50px;
    border: 2px solid #dab71099;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: center;
    background-color: #fff8dc;
}

.picked-num-bubble,
.drawn-num-bubble {
    padding: 6px 12px;
    background-color: #dab710;
    border-radius: 14px;
    color: #39275b;
    font-weight: bold;
    font-size: 1em;
    letter-spacing: 0.04em;
    border: 1.4px solid #f9a60255;
    box-shadow: 0 1px 4px #dab71044;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
#playKenoBtn {
    margin-top: 15px;
    align-self: center;
   
}

/* Keno Results Area */
.keno-results {
    text-align: center;
    font-size: 1.25em;
    font-weight: bold;
    padding: 10px;
    color: #dab710;
    background-color: #39275b55;
    border-radius: 9px;
    border: 2px solid #dab710;
    margin-top: 12px;
}

/* Modal overlays, as in your original */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
}
.modal.detailshow { display: flex; }
#kenoPaytableModal { display: none; }

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 2px solid #dab710;
    width: 80%;
    max-width: 540px;
    border-radius: 10px;
    box-shadow: 0 4px 20px 0 #dac71050, 0 10px 30px 0 #dab71020;
    font-size: 1.15em;
    animation-name: animatetop;
    animation-duration: 0.4s;
}
#kenoPaytableModal .modal-content {
    max-width: 600px;
    width: 90%;
}

#kenoPaytableContent.paytable-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1px;
    background-color: #dab710;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 15px;
}
#kenoPaytableContent .paytable-row { display: contents; }
#kenoPaytableContent .paytable-row > div {
    padding: 9px;
    background-color: #fff8dc;
    color: #39275b;
    text-align: center;
    font-size: 1.08em;
    border-bottom: 1px solid #dab71040;
}
#kenoPaytableContent .paytable-row.header-row > div {
    background-color: #dab710;
    color: #39275b;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 1;
}
#kenoPaytableContent .spots-cell {
    font-weight: bold;
    background-color: #ffe382;
}

/* Responsive Adjustments */
@media (max-width: 900px) {
    #kenoGameSection .game-content {
        flex-direction: column;
        align-items: center;
    }
    #kenoGameSection .game-controls, .keno-game-area {
        flex: none;
        width: 100%;
       
    }
    .keno-number-grid { max-width: 100vw; }
}
@media (max-width: 600px) {
    .keno-number-grid, .keno-grid {
        grid-template-columns: repeat(10, 1fr);
        gap: 3px;
        font-size: 0.8em;
    }
    #kenoGameSection .game-controls, .keno-game-area {
        max-width: 100vw;
        padding: 2px;
    }
    .number-display,
    .keno-results { font-size: 1em; }
}
.keno-grid button, .keno-number-grid .keno-num-btn {
    background: #ffeb00;
    color: #39275b;
    border: none;
    border-radius: 5px;
    font-family: inherit;
    font-weight: bold;
    padding: 4px 4px;
    font-size: 1.2em;
    cursor: pointer;
    box-shadow: 0 2px 4px #dab71033;
    transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}
.close-game-button {
    background: rgba(255,255,255,0.18);
    border: 1px solid #dab71099;
    color: #dab710;
    padding: 4px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    font-family: 'Orbitron', 'Arial Black', sans-serif;
    transition: background 0.2s;
    position: absolute;
    top: 10px; right: 10px;
}
.close-game-button:hover { background: #ffa7a766; color: #ffc700; }
.game-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
    z-index: 2;
    position: relative;
}
/* Normal number button (not picked, not drawn) */

/* Picked (selected by the player, but not yet drawn) */
.keno-num-btn.selected {
    background-color: #fff8dc !important;
    color: #daae0c !important;
    border: 2px solid #daae0c !important;
    box-shadow: 0 0 8px #daae0cbb;
    position: relative;
}
.keno-num-btn.selected::after {
    content: "✓";
    position: absolute;
    top: 4px; right: 7px;
    font-size: 1em;
    color: #daae0c;
    opacity: 0.8;
    pointer-events: none;
}

/* Drawn (number is among results) - even if not picked */
.keno-num-btn.drawn {
    background-color: #f39c12 !important; /* orange/gold */
    color: #fff8dc !important;
    border: 2.5px solid #fff8dc !important;
    box-shadow: 0 0 16px #f39c1244;
    position: relative;
}
.keno-num-btn.drawn::after {
    content: "*";
    position: absolute;
    top: 2px; left: 6px;
    font-size: 1.02em;
    color: #fff8dc;
    opacity: 0.7;
    pointer-events: none;
}

/* Both picked AND drawn: big contrast! */

.keno-num-btn.selected.drawn::after,
.keno-num-btn.drawn.selected::after {
    content: "★";
    position: absolute;
    top: 2px; left: 5px;
    font-size: 1.02em;
    color: #dab710;
    opacity: 1;
    pointer-events: none;
}

/* Optional - cursor for already drawn but not picked (non-interactive) */
.keno-num-btn.drawn:not(.selected),
.keno-num-btn.selected.drawn {
    cursor: default;
}
/* =========================================
   KENO SWEETALERT2 VIP RESULTS
   ========================================= */

/* The Main Popup Container */
.keno-swal-popup {
    border-radius: 20px !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8) !important;
    font-family: 'Montserrat', sans-serif;
}

/* Glowing Borders based on result */
.keno-win-border {
    border: 3px solid #f1c40f !important;
    box-shadow: 0 0 30px rgba(241, 196, 15, 0.4), inset 0 0 15px rgba(241, 196, 15, 0.2) !important;
}

.keno-loss-border {
    border: 2px solid #00ffff !important;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2) !important;
}

/* Titles */
.keno-swal-title-win {
    color: #f1c40f !important;
    font-family: 'Special Gothic Expanded One', sans-serif !important;
    font-size: 2em !important;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.6);
    letter-spacing: 2px;
}

.keno-swal-title-loss {
    color: #00ffff !important;
    font-family: 'Special Gothic Expanded One', sans-serif !important;
    letter-spacing: 1px;
}

/* Internal HTML Content */
.keno-result-modal p {
    font-size: 1.1em;
    margin: 10px 0;
    color: #ccc;
}

.highlight-gold {
    color: #f1c40f;
    font-weight: 900;
    font-size: 1.4em;
    text-shadow: 0 0 8px rgba(241, 196, 15, 0.5);
}

.highlight-cyan {
    color: #00ffff;
    font-weight: 900;
    font-size: 1.3em;
}

/* The Big Win Amount Box */
.win-amount-box {
    background: linear-gradient(135deg, #1a2a6c, #0d122b);
    border: 2px solid #f1c40f;
    border-radius: 12px;
    padding: 15px;
    font-size: 2.2em;
    font-weight: 900;
    color: #2ecc71; /* Casino Green for Money */
    margin-top: 15px;
    text-shadow: 0 0 15px rgba(46, 204, 113, 0.5);
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8);
    font-family: 'Orbitron', monospace;
}

.try-again-text {
    font-style: italic;
    color: #888 !important;
}

/* Custom Buttons */
.keno-swal-btn-win, .keno-swal-btn-loss {
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 900;
    font-size: 1.1em;
    cursor: pointer;
    border: none;
    letter-spacing: 1px;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 15px;
}

.keno-swal-btn-win {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: #0d122b;
    box-shadow: 0 5px 15px rgba(241, 196, 15, 0.4), 0 4px 0 #a04000;
}

.keno-swal-btn-win:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(241, 196, 15, 0.6), 0 4px 0 #a04000;
}

.keno-swal-btn-win:active {
    transform: translateY(4px);
    box-shadow: 0 0px 0 #a04000;
}

.keno-swal-btn-loss {
    background: transparent;
    color: #00ffff;
    border: 2px solid #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

.keno-swal-btn-loss:hover {
    background: rgba(0, 255, 255, 0.1);
    transform: translateY(-2px);
}