/* ===== LUCKY JET – FULL CSS ===== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    background: #0F0F1A;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: 0;
    margin: 0 auto;
}

/* PWA container */
.main-wrapper {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
    background: #0F0F1A;
    padding: 8px;
}

@media(max-width:768px) {
    .main-wrapper {
        display: block;
        position: relative;
        width: 100%;
        max-width: none;
        left: auto;
        margin-left: 0;
        margin-right: 0;
        min-height: 100vh;
        padding: 8px;
    }
}

@media(min-width:769px) {
    body {
        max-width: 480px;
        margin: 0 auto;
        box-shadow: 0 0 50px rgba(0, 0, 0, .8);
    }
}

/* ===== HEADER ===== */
.lj-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #12122A;
    border-bottom: 1px solid #1C1C3E;
    position: sticky;
    top: -8px;
    margin: -8px -8px 8px -8px;
    z-index: 50;
}

.lj-logo {
    max-width: 35%;
    display: flex;
    align-items: center;
}

.lj-logo img {
    max-width: 100%;
    height: auto;
    max-height: 22px;
    object-fit: contain;
}

.lj-hdr-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-bal-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1C1C3E;
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid #2A2A50;
}

.nav-bal-amt {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.nav-currency {
    font-size: 12px;
    color: #A0A0B5;
    font-weight: 600;
}

.lj-tool-btn {
    width: 36px;
    height: 36px;
    background: #1C1C3E;
    border: 1px solid #2A2A50;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
}

.lj-tool-btn:active {
    background: #2A2A50;
}

/* ===== HISTORY STRIP ===== */
.lj-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: #12122A;
    border-bottom: 1px solid #1C1C3E;
    overflow: hidden;
}

.lj-pill-hist {
    width: 34px;
    height: 28px;
    background: #1C1C3E;
    border: 1px solid #2A2A50;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    flex-shrink: 0;
    color: #767697;
    font-size: 11px;
    position: relative;
}

.lj-pill-hist-arrow {
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 5px solid #767697;
}

.lj-pills-track {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    flex: 1;
    scrollbar-width: none;
}

.lj-pills-track::-webkit-scrollbar {
    display: none;
}

.hist-icon-btn {
    width: 34px;
    height: 28px;
    background: #1C1C3E;
    border: 1px solid #2A2A50;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.hist-icon-btn img {
    width: 14px;
    opacity: .7;
}

/* Pills */
.lj-pill {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    text-align: center;
    min-width: 50px;
    flex-shrink: 0;
}

.lj-pill-blue {
    background: rgba(59, 130, 246, .15);
    color: #60A5FA;
    border: 1px solid rgba(59, 130, 246, .3);
}

.lj-pill-purple {
    background: rgba(139, 92, 246, .15);
    color: #A78BFA;
    border: 1px solid rgba(139, 92, 246, .3);
}

.lj-pill-gold {
    background: rgba(245, 158, 11, .15);
    color: #FBBF24;
    border: 1px solid rgba(245, 158, 11, .3);
}

/* ===== HISTORY MODAL ===== */
.hist-modal {
    display: none;
    position: absolute;
    top: 95px;
    left: 10px;
    right: 10px;
    background: #12122A;
    border: 1px solid #2A2A50;
    border-radius: 14px;
    z-index: 60;
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.hist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.close-hist {
    color: #767697;
    cursor: pointer;
    font-size: 16px;
}

.hist-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hist-grid .lj-pill {
    font-size: 11px;
    padding: 4px 8px;
    min-width: auto;
}

/* ===== GAME STAGE ===== */
.lj-stage {
    position: relative;
    width: auto;
    aspect-ratio: 16/9;
    background: radial-gradient(ellipse 90% 60% at 50% 110%, rgba(80, 63, 255, 0.07) 0%, transparent 70%), linear-gradient(180deg, #04040F 0%, #08081E 100%);
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid #2A2A50;
    box-shadow: 0 6px 40px rgba(80, 63, 255, 0.14);
    margin: 10px;
}

.lj-bg-stars {
    position: absolute;
    inset: 0;
    background: url('../../images/luckyjet/stars.png') repeat center center;
    background-size: cover;
    animation: twinkle 4s linear infinite alternate;
    pointer-events: none;
    opacity: 0.6;
}

@keyframes twinkle {
    0% {
        opacity: .5
    }

    100% {
        opacity: 1
    }
}

.lj-inner-line-x {
    display: none;
}

.lj-inner-line-y {
    display: none;
}

.lj-border-left {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: url('../../images/luckyjet/left.svg') no-repeat right bottom;
    background-size: contain;
    z-index: 3;
    pointer-events: none;
}

.lj-border-bottom {
    display: none;
}

.lj-clouds {
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 200%;
    height: 70px;
    background: url('../../images/luckyjet/clouds.svg') repeat-x;
    background-size: auto 100%;
    animation: moveLeft 20s linear infinite;
    z-index: 1;
    opacity: 0.55;
    pointer-events: none;
}

@keyframes moveLeft {
    from {
        transform: translateX(0)
    }

    to {
        transform: translateX(-50%)
    }
}

.anim-off .lj-clouds {
    animation-play-state: paused;
}

#ljCvs {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* Multiplier – vertically centred, left side */
.lj-mult {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    font-size: 52px;
    font-weight: 900;
    color: #A78BFA;
    text-shadow: 0 0 40px rgba(167, 139, 250, .75), 0 0 80px rgba(122, 92, 250, .4);
    z-index: 5;
    display: none;
    letter-spacing: -1px;
    line-height: 1;
}

/* Flew Away */
.lj-flew {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 5;
    display: none;
}

.lj-flew-mult { font-size:50px; font-weight:800; color:#8A5AFA; }
.lj-flew-txt { font-size:14px; font-weight:800; color:#fff; letter-spacing:2px; margin-top:5px;}

/* Loader */
.lj-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 5;
}

.lj-loader-icon {
    width: 60px;
    height: 60px;
}

.lj-wait-lbl {
    font-size: 14px;
    font-weight: 700;
    color: #A0A0B5;
    margin: 10px 0;
    line-height: 1.4;
}

.lj-bar-bg {
    width: 180px;
    height: 6px;
    background: #1C1C3E;
    border-radius: 6px;
    margin: 0 auto;
    overflow: hidden;
}

.lj-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #503FFF, #A23DF5);
    border-radius: 6px;
    transition: width .3s linear;
}

/* Anim off */
.anim-off .lj-bg-stars {
    display: none;
}

/* ===== BET PANELS ===== */
.lj-panels { padding:0 10px; display:flex; flex-direction:column; gap:10px; }
.lj-panel { background:transparent; border-radius:14px; overflow:hidden; border:1px solid #26264A; display:flex; flex-direction:column;}
.lj-panel-top { background:#11111F; padding:8px 12px; }
.lj-auto-row { display:flex; align-items:center; justify-content:space-between; }
.lj-chk-wrap { display:flex; align-items:center; gap:8px; cursor:pointer; }
input[type="checkbox"].lj-chk { display: none !important; }
.lj-chk-box { width:20px; height:20px; background:#1C1C3E; border-radius:5px; display:flex; align-items:center; justify-content:center; transition:0.2s;}
.lj-chk:checked + .lj-chk-box { background: #7E3AF2 url('../images/luckyjet/auto.png') no-repeat center center; background-size: 12px; } /* Need to adjust URL path for auto.png, but I can use an SVG or keep it */
.lj-chk-lbl { font-size:12px; color:#767697; font-weight:600; }
.lj-aw-input-wrap { display:flex; align-items:center; background:#1C1C3E; border-radius:6px; padding:0 8px; height:26px; }
.lj-aw-x { color:#A0A0B5; font-weight:700; font-size:13px; margin-right:2px;}
.lj-aw-input { background:transparent; border:none; color:#fff; font-weight:700; width:35px; text-align:center; font-size:13px; outline:none;}

.lj-panel-bottom { background:#1A1A32; padding:10px 12px; }
.lj-bet-controls { display:flex; gap:10px; align-items:stretch; width:100%; }

.lj-left-col { flex: 1; min-width: 0; background: #0F1023; border-radius: 12px; padding: 6px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid #1C1C3E; transition: opacity 0.2s;}
.lj-stepper { display:flex; align-items:center; justify-content:space-between; height:34px; margin-bottom:2px; }
.lj-stp-btn { width:34px; height:100%; background:#1E1E3C; border-radius:6px; border:none; display:flex; align-items:center; justify-content:center; font-size:20px; color:#767697; cursor:pointer;}
.lj-stp-btn:active { background:#2A2A4A; }
.lj-amt-input { flex:1; min-width:0; background:transparent; border:none; color:#fff; font-size:20px; font-weight:800; text-align:center; outline:none;}
.lj-divider { width: 100%; height: 1px; background: #1C1C3E; margin: 3px 0; }
.lj-qbs { display:flex; gap:4px; height:26px; }
.lj-qb { flex:1; min-width:0; background:#1E1E3C; border-radius:5px; border:none; color:#6B6B8F; font-size:10px; font-weight:700; cursor:pointer; display:flex; align-items:center; justify-content:center;}
.lj-qb:active { background:#2A2A4A; color:#fff; }

.lj-right-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lj-action-btn { width:100%; height:100%; border-radius:12px; border: 1px solid #000; font-family:'Montserrat',sans-serif; cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center; transition:transform 0.1s, opacity 0.1s; box-shadow:none !important; }
.lj-action-btn:active { transform: scale(0.97); }

.lj-btn-bet { background: linear-gradient(90deg, #503FFF 0%, #A23DF5 100%); color: #fff; font-weight: 900; font-size: 20px; letter-spacing: 1px;}
.lj-btn-cancel { background: linear-gradient(90deg, #FF3B55 0%, #FF1A36 100%); color: #fff; font-weight: 900; font-size: 20px; letter-spacing: 1px; display: none; }
.lj-btn-wait { background: #1C1C3E; color: #A0A0B5; border: 1px solid #2A2A50; font-weight: 800; font-size: 16px; letter-spacing: 1px; display: none; }
.lj-btn-withdraw { background: linear-gradient(90deg, #FFB229 0%, #F57C00 100%); color: #fff; display: none; line-height: 1.2; }
.lj-wd-amt { font-size:18px; font-weight:900; }
.lj-wd-txt { font-size:11px; font-weight:800; letter-spacing:1px; }

/* ==================================================
   TABS & BETS TABLES
   ================================================== */
.lj-tabs { display:flex; margin-top:15px; border-bottom:1px solid #1A1A32; padding: 0 10px; background:#0F0F1A;}
.lj-tab { flex:1; text-align:center; padding:12px; color:#A0A0B5; font-weight:700; font-size:14px; cursor:pointer; border-radius:8px 8px 0 0;}
.lj-tab.active { background:#16162D; color:#fff; }

.lj-tab-content { padding: 10px; }
.lj-tb-meta { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; color:#A0A0B5; font-size:12px;}
.lj-tb-total span { color:#fff; font-weight:bold; font-size:16px; display:block; }
.lj-tb-preround { border:1px solid #2A2A50; border-radius:20px; padding:5px 10px; display:flex; align-items:center; gap:5px; cursor:pointer; font-weight:600;}

/* ALL BETS ROW */
.lj-all-row { background: #1A1A32; border-radius: 12px; padding: 10px; display: flex; align-items: center; justify-content:space-between; margin-bottom: 6px; }
.lj-all-av { width: 30px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 12px; margin-right: 8px; color: #fff; flex-shrink: 0;}
.lj-all-user { width: 55px; color: #8B8BA3; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0;}
.lj-all-amt { width: auto; min-width: 60px; color: #fff; font-size: 12px; font-weight: 600; text-align: right; margin-right: 8px; white-space: nowrap; flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; }
.lj-all-mult { flex: 1; display: flex; justify-content: center; align-items: center; min-width: 50px; }
.lj-all-win { width: auto; min-width: 70px; text-align: right; color: #E6961C; font-size: 12px; font-weight: 700; white-space: nowrap; flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; }
.lj-all-win.none { color: #A0A0B5; font-weight: normal; }

/* MY BETS ROW */
.lj-my-row { background: #1A1A32; border-radius: 12px; padding: 10px 10px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; border: 1px solid #2A2A50;}
.lj-my-time { color: #8B8BA3; font-size: 11px; font-weight: 500; display:flex; flex-direction:column; line-height:1.3; flex-shrink:0;}
.lj-my-amt { color: #fff; font-size: 12px; font-weight: 600; width:auto; min-width:55px; text-align:right; white-space:nowrap; flex-shrink:1; overflow:hidden; text-overflow:ellipsis; margin-right: 5px; }
.lj-my-mult { flex: 1; display: flex; justify-content: center; min-width: 45px; margin-right: 5px; }
.lj-my-win { color: #fff; font-size: 12px; font-weight: 600; width:auto; min-width:65px; text-align:right; white-space:nowrap; flex-shrink:1; overflow:hidden; text-overflow:ellipsis;}
.lj-my-icons { display: flex; gap: 4px; flex-shrink:0; margin-left: 5px;}
.lj-my-ic { background: #222240; width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #666; font-size: 10px; cursor: pointer;}

/* ==================================================
   WINNING POPUP
   ================================================== */
.lj-pops { position:fixed; top:60px; left:50%; transform:translateX(-50%); z-index:100; display:flex; flex-direction:column; gap:6px; align-items:center; pointer-events:none; }
.lj-pop { background:#16162D; border:1px solid #7E3AF2; border-radius:10px; padding:8px 8px 8px 20px; min-width: 300px; justify-content: space-between; display:flex; align-items:center; gap:14px; animation: popIn 0.3s ease, popOut 0.3s ease 2.7s forwards; pointer-events:none; box-shadow:0 10px 30px rgba(0,0,0,0.5);}
.lj-pop-left { display:flex; flex-direction:column; gap:2px; white-space: nowrap; }
.lj-pop-label { font-size:10px; color:rgba(255, 255, 255, 0.6); font-weight:500; white-space: nowrap; }
.lj-pop-mult { font-size:16px; font-weight:900; color:#fff; white-space: nowrap; }
.lj-pop-right { background:linear-gradient(90deg, #7E3AF2, #A855F7); border-radius:6px; padding:8px 16px; text-align:center; display:flex; flex-direction:column; align-items:center; justify-content:center; white-space: nowrap; }
.lj-pop-amt { font-size:15px; font-weight:900; color:#fff; white-space: nowrap; line-height:1; margin-bottom:4px;}
.lj-pop-txt { font-size:10px; font-weight:500; color:rgba(255, 255, 255, 0.9); white-space: nowrap; line-height:1;}

@keyframes popIn { from { opacity:0; transform:translateY(-15px) scale(0.95); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes popOut { from { opacity:1; transform:translateY(0) scale(1); } to { opacity:0; transform:translateY(-15px) scale(0.95); } }


/* ===== SIDE MENU ===== */
.lj-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}

.lj-menu-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.lj-side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: #12122A;
    z-index: 901;
    transform: translateX(-100%);
    transition: transform .3s ease;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #1C1C3E;
}

.lj-side-menu.open {
    transform: translateX(0);
}

.lj-menu-header {
    padding: 20px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #1C1C3E;
}

.lj-menu-av {
    width: 36px;
    height: 36px;
    background: #7E3AF2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
}

.lj-menu-uid {
    color: #A0A0B5;
    font-size: 12px;
    font-weight: 600;
    flex: 1;
}

.lj-menu-close {
    color: #767697;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
}

.lj-menu-items {
    padding: 15px;
    flex: 1;
    overflow-y: auto;
}

.lj-menu-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.lj-menu-icon {
    color: #7E3AF2;
    margin-right: 10px;
    width: 18px;
    text-align: center;
}

.lj-menu-toggle span {
    font-size: 13px;
    font-weight: 600;
    color: #E0E0F0;
    display: flex;
    align-items: center;
}

.lj-menu-link {
    padding: 12px 0;
    font-size: 13px;
    font-weight: 600;
    color: #E0E0F0;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.lj-menu-link:active {
    color: #A78BFA;
}

/* Toggle switch */
.lj-switch {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.lj-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.lj-slider {
    position: absolute;
    inset: 0;
    background: #2A2A50;
    border-radius: 22px;
    cursor: pointer;
    transition: background .3s;
}

.lj-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #767697;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all .3s;
}

.lj-switch input:checked+.lj-slider {
    background: #7E3AF2;
}

.lj-switch input:checked+.lj-slider::before {
    transform: translateX(18px);
    background: #fff;
}

/* ===== MODALS ===== */
.lj-modal-wrap {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.lj-modal-wrap {
    display: none;
}

.lj-modal {
    background: #12122A;
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    border: 1px solid #1C1C3E;
    overflow: hidden;
    max-height: 85vh;
    margin: auto;
    display: flex;
    flex-direction: column;
}

.lj-modal-header {
    padding: 15px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0F0F1A;
    border-bottom: 1px solid #1C1C3E;
    font-size: 14px;
    font-weight: 700;
}

.lj-modal-close {
    color: #767697;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
}

.lj-modal-content {
    padding: 18px;
    overflow-y: auto;
    color: #E0E0F0;
    font-size: 13px;
    line-height: 1.6;
    flex: 1;
}

.lj-img-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.lj-img-row img {
    flex: 1;
    max-width: 33%;
    border-radius: 10px;
    object-fit: cover;
}

/* Round details */
.lj-rd-val-wrap {
    display: flex;
    align-items: center;
    background: #1A1A32;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #2A2A50;
    gap: 8px;
}

.lj-rd-val {
    font-size: 13px;
    word-break: break-all;
}

.lj-rd-field {
    margin-bottom: 10px;
}

.lj-copy-btn {
    color: #7E3AF2;
    cursor: pointer;
    margin-left: 8px;
    flex-shrink: 0;
}

/* ===== SCROLLBAR GLOBAL ===== */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-thumb {
    background: #2A2A50;
    border-radius: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* Hide number spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}