/* =========================================================
   KENO
   ========================================================= */

.keno-page {
    min-height: calc(100vh - 75px);

    padding: 40px 7% 70px;

    background:
        radial-gradient(
            circle at 75% 15%,
            rgba(100, 75, 190, 0.10),
            transparent 35%
        );
}


/* =========================================================
   HEADER
   ========================================================= */

.keno-header {
    max-width: 1200px;

    margin: 0 auto 30px;

    display: flex;

    align-items: flex-start;

    gap: 25px;
}

.keno-back {
    margin-top: 4px;

    text-decoration: none;

    color: #858995;

    border: 1px solid #292d38;

    background: #101219;

    padding: 10px 14px;

    border-radius: 8px;

    font-size: 13px;

    transition: 0.2s;
}

.keno-back:hover {
    color: white;

    border-color: #4a4f5c;
}

.keno-header h1 {
    font-size: 38px;

    margin-top: 4px;
}

.keno-description {
    color: #717682;

    margin-top: 7px;
}


/* =========================================================
   LAYOUT
   ========================================================= */

.keno-layout {
    max-width: 1200px;

    margin: auto;

    display: grid;

    grid-template-columns: 300px 1fr;

    gap: 25px;
}


/* =========================================================
   PANEL
   ========================================================= */

.keno-panel {
    background:
        linear-gradient(
            180deg,
            #11141c,
            #0d0f15
        );

    border: 1px solid #242833;

    border-radius: 14px;

    padding: 22px;

    height: fit-content;

    position: sticky;

    top: 95px;
}

.keno-panel h2 {
    font-size: 21px;
}

.panel-subtitle {
    color: #686d79;

    font-size: 12px;

    margin-top: 5px;
}


/* =========================================================
   MODE TABS
   ========================================================= */

.mode-tabs {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 5px;

    margin-top: 20px;

    padding: 4px;

    background: #0b0d12;

    border: 1px solid #252934;

    border-radius: 9px;
}

.mode-tab {
    border: none;

    padding: 10px;

    border-radius: 6px;

    background: transparent;

    color: #666c78;

    font-size: 10px;

    font-weight: 900;

    letter-spacing: .7px;

    cursor: pointer;

    transition: .2s;
}

.mode-tab:hover {
    color: white;
}

.mode-tab.active {
    color: white;

    background: #252a34;

    box-shadow:
        0 3px 12px rgba(0,0,0,.25);
}


/* =========================================================
   BET
   ========================================================= */

.keno-panel label {
    display: block;

    color: #858996;

    font-size: 12px;

    margin-top: 24px;

    margin-bottom: 8px;
}

.bet-input,
.auto-input {
    height: 44px;

    display: flex;

    background: #171a22;

    border: 1px solid #292d38;

    border-radius: 8px;

    overflow: hidden;
}

.bet-input input,
.auto-input input {
    width: 100%;

    border: none;

    outline: none;

    background: transparent;

    color: white;

    padding: 12px;

    font-size: 14px;
}

.bet-input span,
.auto-input span {
    display: flex;

    align-items: center;

    padding: 0 11px;

    color: #666b77;

    font-size: 10px;
}


/* =========================================================
   QUICK BET
   ========================================================= */

.quick-bets {
    display: grid;

    grid-template-columns:
        1fr 1fr 1fr;

    gap: 6px;

    margin-top: 7px;
}

.quick-bets button {
    height: 31px;

    border-radius: 6px;

    border: 1px solid #292d38;

    background: #13161d;

    color: #777c88;

    cursor: pointer;

    font-size: 10px;

    transition: 0.2s;
}

.quick-bets button:hover {
    color: white;

    border-color: #484d59;
}


/* =========================================================
   SELECTION
   ========================================================= */

.selection-info {
    margin-top: 20px;

    padding: 11px 13px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    background: #151821;

    border: 1px solid #252934;

    border-radius: 8px;
}

.selection-info span {
    color: #707581;

    font-size: 11px;
}

.selection-info strong {
    color: white;

    font-size: 14px;
}


/* =========================================================
   RISK
   ========================================================= */

.setting-title {
    color: #858995;

    font-size: 12px;

    margin-top: 20px;

    margin-bottom: 8px;
}

.risk-buttons {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 6px;
}

.risk-button {
    padding: 9px 5px;

    background: #13161d;

    border: 1px solid #292d38;

    color: #696e7a;

    border-radius: 7px;

    cursor: pointer;

    font-size: 10px;

    transition: 0.2s;
}

.risk-button:hover {
    color: white;

    border-color: #464b58;
}

.risk-button.active {
    color: white;

    background: #20242d;

    border-color: #5a606c;

    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.04);
}


/* =========================================================
   AUTO SETTINGS
   ========================================================= */

.auto-settings {
    display: none;
}

.auto-settings.show {
    display: block;
}

.auto-info {
    margin-top: 20px;

    padding: 11px 13px;

    background: #151821;

    border: 1px solid #252934;

    border-radius: 8px;
}

.auto-info span {
    display: block;

    color: #666c77;

    font-size: 9px;

    margin-bottom: 4px;
}

.auto-info strong {
    color: #a8adb8;

    font-size: 11px;
}

.auto-stop-title {
    color: #858995;

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 1px;

    margin-top: 20px;

    margin-bottom: -10px;
}

.auto-settings small {
    display: block;

    color: #555a65;

    font-size: 9px;

    margin-top: 5px;
}


/* =========================================================
   ACTIONS
   ========================================================= */

.action-buttons {
    display: grid;

    grid-template-columns:
        1fr;

    gap: 7px;

    margin-top: 13px;
}

.secondary-button {
    padding: 10px 5px;

    border-radius: 7px;

    border: 1px solid #292d38;

    background: #11141a;

    color: #777c88;

    cursor: pointer;

    font-size: 10px;

    transition: 0.2s;
}

.secondary-button:hover {
    color: white;

    border-color: #4a4f5c;
}


/* =========================================================
   PAYTABLE
   ========================================================= */

.paytable {
    margin-top: 18px;

    border: 1px solid #252934;

    border-radius: 9px;

    overflow: hidden;

    background: #11141a;
}

.paytable-header {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    padding: 9px 11px;

    background: #151821;

    border-bottom: 1px solid #252934;

    color: #5f6470;

    font-size: 9px;

    letter-spacing: 0.7px;
}

.paytable-row {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    padding: 8px 11px;

    border-bottom: 1px solid #1e222b;

    font-size: 10px;

    transition: .15s;
}

.paytable-row:last-child {
    border-bottom: none;
}

.paytable-row span:first-child {
    color: #777c88;
}

.paytable-row span:last-child {
    color: white;

    text-align: right;

    font-weight: 700;
}

.paytable-row.active {
    background: rgba(100, 150, 110, 0.10);
}

.paytable-row.active span:first-child,
.paytable-row.active span:last-child {
    color: #a0d6ad;
}

.payout-preview {
    margin-left: 5px;

    color: #777e89;

    font-size: 9px;

    font-weight: 600;
}


/* =========================================================
   PLAY
   ========================================================= */

.play-button,
.auto-start-button {
    width: 100%;

    margin-top: 15px;

    padding: 14px;

    border: none;

    border-radius: 8px;

    font-size: 13px;

    font-weight: 900;

    cursor: pointer;

    transition:
        transform .2s,
        background .2s;
}

.play-button {
    background: white;

    color: #08090d;
}

.play-button:hover {
    background: #e8e8e8;

    transform: translateY(-2px);
}

.play-button:disabled {
    opacity: .45;

    cursor: not-allowed;

    transform: none;
}

.auto-start-button {
    margin-top: 8px;

    background: #171b22;

    border: 1px solid #303642;

    color: #8f96a3;
}

.auto-start-button:hover {
    color: white;

    border-color: #535a67;
}

.auto-start-button.running {
    background: #29191d;

    border-color: #69373d;

    color: #ef8e96;
}


/* =========================================================
   AUTO STATS
   ========================================================= */

.auto-running {
    display: none;

    grid-template-columns: 1fr 1fr;

    gap: 7px;

    margin-top: 8px;
}

.auto-running.show {
    display: grid;
}

.auto-running div {
    padding: 9px;

    background: #11141a;

    border: 1px solid #242833;

    border-radius: 7px;
}

.auto-running span {
    display: block;

    color: #5f6470;

    font-size: 8px;

    margin-bottom: 3px;
}

.auto-running strong {
    color: #a8adb8;

    font-size: 11px;
}


/* =========================================================
   LAST WIN
   ========================================================= */

.last-win {
    margin-top: 12px;

    padding: 11px 13px;

    display: flex;

    justify-content: space-between;

    align-items: center;

    background: #151821;

    border-radius: 8px;
}

.last-win span {
    color: #666b76;

    font-size: 10px;
}

.last-win strong {
    color: #8bd09f;

    font-size: 14px;
}


/* =========================================================
   GAME AREA
   ========================================================= */

.keno-game-area {
    min-width: 0;

    background:
        radial-gradient(
            circle at 50% 15%,
            rgba(100, 80, 180, 0.08),
            transparent 40%
        ),
        #0b0d12;

    border: 1px solid #20242d;

    border-radius: 16px;

    padding: 30px 35px;

    min-height: 650px;
}


/* =========================================================
   GAME TOP
   ========================================================= */

.game-top {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 24px;
}

.game-label {
    color: #656a76;

    font-size: 9px;

    letter-spacing: 2px;

    margin-bottom: 5px;
}

.game-top h2 {
    font-size: 19px;
}

.draw-status {
    padding: 8px 11px;

    border-radius: 7px;

    background: #14171e;

    border: 1px solid #292d38;

    color: #747985;

    font-size: 9px;

    font-weight: 800;

    letter-spacing: .5px;
}

.draw-status.drawing {
    color: #d0c68c;

    border-color: #625d40;
}

.draw-status.win {
    color: #91d2a0;

    border-color: #385a43;
}

.draw-status.lose {
    color: #e17c84;

    border-color: #60373b;
}


/* =========================================================
   NUMBER BOARD
   ========================================================= */

.number-board {
    display: grid;

    grid-template-columns:
        repeat(8, 1fr);

    gap: 9px;

    padding: 16px;

    background:
        linear-gradient(
            180deg,
            #10131a,
            #0e1016
        );

    border: 1px solid #232731;

    border-radius: 13px;
}


/* =========================================================
   NUMBER TILE
   ========================================================= */

.keno-number {
    aspect-ratio: 1 / 1;

    min-height: 48px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 9px;

    background:
        linear-gradient(
            145deg,
            #1b1f28,
            #14171e
        );

    border: 1px solid #2b303b;

    color: #858a96;

    font-size: 14px;

    font-weight: 800;

    cursor: pointer;

    transition:
        transform .15s,
        background .15s,
        border-color .15s,
        color .15s,
        box-shadow .15s;
}

.keno-number:hover {
    transform: translateY(-2px);

    color: white;

    border-color: #505663;
}


/* SELECTED = VERY OBVIOUS */

.keno-number.selected {
    color: #eaffef;

    border: 2px solid #79bd89;

    background:
        linear-gradient(
            145deg,
            #315a3d,
            #203b29
        );

    box-shadow:
        0 0 0 2px rgba(90,160,105,.12),
        0 0 18px rgba(83,160,105,.16),
        inset 0 0 12px rgba(120,190,135,.08);

    transform: scale(.97);
}


/* DRAWN NORMAL */

.keno-number.drawn {
    color: #858b96;

    background:
        linear-gradient(
            145deg,
            #252932,
            #1a1d25
        );

    border-color: #3c414c;
}


/* DRAWN + SELECTED = GREEN */

.keno-number.drawn.selected {
    color: #caffd3;

    background:
        linear-gradient(
            145deg,
            #39704b,
            #244631
        );

    border: 2px solid #78c38b;

    box-shadow:
        0 0 0 2px rgba(100,190,120,.16),
        0 0 25px rgba(83,160,105,.30);
}


/* HIT */

.keno-number.hit {
    color: #d0ffd8;

    background:
        linear-gradient(
            145deg,
            #438357,
            #285536
        );

    border: 2px solid #8bdd9c;

    box-shadow:
        0 0 25px rgba(83,160,105,.32);

    animation: hitPulse .45s ease;
}


/* SELECTED BUT MISSED */

.keno-number.missed {
    color: #ffb0b6;

    border: 2px solid #754148;

    background:
        linear-gradient(
            145deg,
            #40272b,
            #28191c
        );

    box-shadow:
        0 0 12px rgba(180,70,80,.12);
}

.keno-number.draw-animation {
    animation: numberFlash .35s ease;
}


/* =========================================================
   DRAW AREA
   ========================================================= */

.draw-area {
    margin-top: 27px;

    padding: 20px;

    background: #0f1117;

    border: 1px solid #20242d;

    border-radius: 11px;
}

.draw-title {
    color: #5f6470;

    font-size: 9px;

    letter-spacing: 1.8px;

    text-align: center;

    margin-bottom: 15px;
}

.draw-balls {
    min-height: 58px;

    display: flex;

    justify-content: center;

    align-items: center;

    flex-wrap: wrap;

    gap: 8px;
}

.draw-placeholder {
    color: #4d525e;

    font-size: 11px;

    text-align: center;
}


/* =========================================================
   DRAW BALL
   ========================================================= */

.draw-ball {
    width: 46px;

    height: 46px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background:
        radial-gradient(
            circle at 35% 25%,
            #303642,
            #171a22 70%
        );

    border: 1px solid #454a56;

    color: white;

    font-size: 12px;

    font-weight: 900;

    box-shadow:
        0 6px 18px rgba(0,0,0,.3);

    animation: ballAppear .35s ease both;
}

.draw-ball.hit {
    background:
        radial-gradient(
            circle at 35% 25%,
            #4e9b65,
            #203a29 75%
        );

    border-color: #81c792;

    color: #d0ffd7;

    box-shadow:
        0 0 18px rgba(80,150,100,.28);
}


/* =========================================================
   RESULT
   ========================================================= */

.result-message {
    text-align: center;

    margin-top: 16px;

    min-height: 18px;

    color: #6b707b;

    font-size: 12px;

    font-weight: 700;
}

.result-message.win {
    color: #8fd19e;
}

.result-message.lose {
    color: #df7d85;
}


/* =========================================================
   STATS
   ========================================================= */

.game-stats {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 9px;

    margin-top: 12px;
}

.stat-card {
    padding: 12px;

    background: #101219;

    border: 1px solid #20242d;

    border-radius: 8px;
}

.stat-card span {
    display: block;

    color: #5f6470;

    font-size: 9px;

    margin-bottom: 5px;
}

.stat-card strong {
    font-size: 15px;

    color: white;
}


/* =========================================================
   HISTORY
   ========================================================= */

.history-section {
    margin-top: 35px;

    border-top: 1px solid #20242d;

    padding-top: 24px;
}

.history-header {
    display: flex;

    align-items: center;

    justify-content: space-between;
}

.history-header p {
    color: #656a76;

    font-size: 10px;

    letter-spacing: 2px;
}

.history-header h2 {
    margin-top: 5px;

    font-size: 18px;
}

.history-header button {
    background: transparent;

    border: 1px solid #292d38;

    color: #707581;

    padding: 8px 11px;

    border-radius: 7px;

    font-size: 11px;

    cursor: pointer;
}

.history-header button:hover {
    color: white;

    border-color: #4a4f5c;
}


/* =========================================================
   HISTORY ITEMS
   ========================================================= */

.history-list {
    margin-top: 15px;

    display: flex;

    flex-direction: column;

    gap: 7px;
}

.empty-history {
    padding: 25px;

    text-align: center;

    color: #4f545f;

    background: #0f1118;

    border: 1px solid #20242d;

    border-radius: 8px;

    font-size: 12px;
}

.history-item {
    min-height: 54px;

    display: grid;

    grid-template-columns:
        100px
        1fr
        80px
        90px;

    align-items: center;

    gap: 12px;

    padding: 8px 13px;

    background: #101219;

    border: 1px solid #20242d;

    border-radius: 8px;
}

.history-hits {
    font-size: 15px;

    font-weight: 900;
}

.history-picks {
    color: #696e7a;

    font-size: 10px;
}

.history-result {
    font-size: 11px;

    font-weight: 800;
}

.history-win {
    color: #8bd09f;
}

.history-lose {
    color: #e17b83;
}

.history-payout {
    text-align: right;

    color: #858a95;

    font-size: 11px;
}


/* =========================================================
   POPUP
   ========================================================= */

.popup-overlay {
    position: fixed;

    inset: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    background: rgba(0,0,0,.65);

    backdrop-filter: blur(5px);

    opacity: 0;

    visibility: hidden;

    transition: .2s;

    z-index: 9999;
}

.popup-overlay.show {
    opacity: 1;

    visibility: visible;
}

.popup {
    width: min(380px, calc(100% - 30px));

    padding: 25px;

    background:
        linear-gradient(
            180deg,
            #171a22,
            #101219
        );

    border: 1px solid #303541;

    border-radius: 14px;

    text-align: center;

    box-shadow:
        0 25px 70px rgba(0,0,0,.5);

    transform: translateY(10px) scale(.97);

    transition: .2s;
}

.popup-overlay.show .popup {
    transform: translateY(0) scale(1);
}

.popup-icon {
    width: 44px;

    height: 44px;

    margin: 0 auto 14px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background: #392327;

    border: 1px solid #713b40;

    color: #ff9299;

    font-weight: 900;
}

.popup h3 {
    font-size: 17px;
}

.popup p {
    color: #777c88;

    font-size: 12px;

    line-height: 1.5;

    margin-top: 7px;
}

.popup button {
    width: 100%;

    margin-top: 18px;

    padding: 11px;

    border: none;

    border-radius: 7px;

    background: white;

    color: #090a0e;

    font-weight: 800;

    cursor: pointer;
}


/* =========================================================
   FLOATING AUTO CONTROL
   ========================================================= */

.auto-floating {
    position: fixed;

    right: 22px;

    bottom: 22px;

    z-index: 5000;

    display: flex;

    align-items: center;

    gap: 14px;

    padding: 10px 11px 10px 14px;

    background:
        linear-gradient(
            180deg,
            #171a22,
            #101219
        );

    border: 1px solid #303541;

    border-radius: 12px;

    box-shadow:
        0 15px 45px rgba(0,0,0,.45);

    backdrop-filter: blur(10px);
}

.auto-floating-status {
    display: flex;

    align-items: center;

    gap: 9px;
}

.auto-floating-status strong {
    display: block;

    color: #b2b7c0;

    font-size: 11px;
}

.auto-floating-status small {
    display: block;

    color: #606671;

    font-size: 9px;

    margin-top: 2px;
}

.auto-dot {
    width: 8px;

    height: 8px;

    border-radius: 50%;

    background: #555b66;
}

.auto-dot.running {
    background: #76c78a;

    box-shadow:
        0 0 10px rgba(100,200,120,.5);

    animation: autoPulse 1s infinite;
}

.auto-floating button {
    min-width: 75px;

    border: 1px solid #343a45;

    background: #20242d;

    color: #d5d8dd;

    border-radius: 7px;

    padding: 9px 11px;

    font-size: 10px;

    font-weight: 900;

    cursor: pointer;
}

.auto-floating button:hover {
    background: #2a2f39;

    color: white;
}

.auto-floating button.running {
    background: #382024;

    border-color: #6b3940;

    color: #f0949b;
}


/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes ballAppear {

    from {
        opacity: 0;

        transform:
            scale(.4)
            translateY(-15px);
    }

    to {
        opacity: 1;

        transform:
            scale(1)
            translateY(0);
    }

}

@keyframes numberFlash {

    0% {
        transform: scale(.8);

        opacity: .4;
    }

    60% {
        transform: scale(1.12);
    }

    100% {
        transform: scale(1);

        opacity: 1;
    }

}

@keyframes hitPulse {

    0% {
        transform: scale(.9);
    }

    50% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }

}

@keyframes autoPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .4;
    }

}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 950px) {

    .keno-layout {
        grid-template-columns: 1fr;
    }

    .keno-panel {
        position: static;
    }

}

@media (max-width: 700px) {

    .keno-page {
        padding: 25px 15px 50px;
    }

    .keno-header {
        flex-direction: column;

        gap: 15px;
    }

    .keno-game-area {
        padding: 22px 15px;
    }

    .number-board {
        grid-template-columns:
            repeat(5, 1fr);

        gap: 7px;

        padding: 10px;
    }

    .keno-number {
        min-height: 42px;

        font-size: 12px;
    }

    .game-stats {
        grid-template-columns:
            1fr 1fr;
    }

    .history-item {
        grid-template-columns:
            60px
            1fr
            70px;
    }

    .history-payout {
        display: none;
    }

    .auto-floating {
        right: 10px;

        bottom: 10px;

        left: 10px;

        justify-content: space-between;
    }

}

@media (max-width: 450px) {

    .number-board {
        grid-template-columns:
            repeat(4, 1fr);
    }

    .draw-ball {
        width: 39px;

        height: 39px;
    }

}