/* KubberX Mobile App Shell — 1GO-style responsive UI */

:root {
    --app-bg: #1a1d21;
    --app-surface: #25282c;
    --app-surface-2: #2f3338;
    --app-green: #76e176;
    --app-green-bright: #c8f542;
    --app-yellow: #f7d358;
    --app-text-muted: #8b929a;
    --app-nav-h: 4.25rem;
    --app-header-h: 3.25rem;
    --app-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Download + menu header row: desktop only */
.kx-desktop-shell-top { display: none !important; }

@media (max-width: 1023px) {
    body.kx-app .kx-desktop-wide,
    body.kx-app .kx-desktop-only,
    body.kx-app .kx-page-desktop-fallback { display: none !important; }

    body.kx-app {
        background: var(--app-bg) !important;
        background-image: none !important;
        padding-bottom: calc(var(--app-nav-h) + var(--app-safe-bottom) + 0.5rem);
    }
}

.kx-flash-toast {
    transition: opacity 0.5s ease;
}

.kx-fcm-toast {
    position: fixed;
    top: calc(var(--app-header-h, 52px) + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: min(22rem, calc(100vw - 1.5rem));
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 0.875rem;
    background: linear-gradient(135deg, #1a2e1a, #0f1f12);
    border: 1px solid rgba(118, 225, 118, 0.35);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    animation: kxFcmToastIn 0.25s ease;
}
.kx-fcm-toast-out {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.kx-fcm-toast-inner { flex: 1; min-width: 0; }
.kx-fcm-toast-title {
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--app-yellow, #f5d547);
    margin-bottom: 0.15rem;
}
.kx-fcm-toast-body {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.35;
}
.kx-fcm-toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}
@keyframes kxFcmToastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

body.kx-app .page-container {
    max-width: 100%;
    padding: 0.75rem 0.875rem 1rem;
}

/* Download strip (shown on desktop via .kx-desktop-shell-top) */
.app-dl-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    background: linear-gradient(90deg, #1a3d1a, #0f2810);
    border-bottom: 1px solid rgba(118, 225, 118, 0.2);
    font-size: 0.7rem;
}
    .app-dl-bar.hidden { display: none; }
    .app-dl-btn {
        margin-left: auto;
        padding: 0.35rem 0.75rem;
        background: var(--app-yellow);
        color: #111;
        border-radius: 999px;
        font-weight: 800;
        font-size: 0.65rem;
        border: none;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        line-height: 1.2;
    }

    /* App header */
    .app-header {
        position: sticky;
        top: 0;
        z-index: 180;
        background: var(--app-surface);
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .app-header-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: var(--app-header-h);
        padding: 0 0.875rem;
        gap: 0.5rem;
    }
    .app-header .kx-logo-img { height: 1.75rem; width: 1.75rem; }
    .app-header-brand { font-weight: 900; font-size: 0.95rem; letter-spacing: 0.02em; }
    .app-hot-badge {
        font-size: 0.55rem;
        font-weight: 800;
        padding: 0.15rem 0.4rem;
        border-radius: 0.25rem;
        background: #c0392b;
        color: #fff;
    }
    .app-btn-signin {
        font-size: 0.75rem;
        color: var(--app-text-muted);
        font-weight: 600;
    }
    .app-btn-signup {
        padding: 0.4rem 0.85rem;
        background: var(--app-green);
        color: #111;
        border-radius: 0.5rem;
        font-size: 0.7rem;
        font-weight: 800;
    }

    /* Logged-in user bar */
    .app-userbar {
        display: flex;
        align-items: center;
        gap: 0.45rem;
        padding: 0.45rem 0.875rem;
        background: var(--app-surface);
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    .app-userbar-guest-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-left: auto;
    }
    .app-userbar-logo {
        display: flex;
        align-items: center;
        flex-shrink: 0;
        text-decoration: none;
        border: none;
        padding: 0;
        background: transparent;
        cursor: pointer;
        border-radius: 0.5rem;
        transition: box-shadow 0.22s ease, transform 0.18s ease;
    }
    .app-userbar-logo:active {
        transform: scale(0.94);
    }
    .app-userbar-logo.is-open img,
    [data-kx-drawer-trigger].is-open .kx-logo-img {
        box-shadow: 0 0 0 2px rgba(118, 225, 118, 0.55);
        border-radius: 50%;
    }
    .app-userbar-logo img {
        height: 2rem;
        width: 2rem;
        object-fit: contain;
    }
    .app-balance-pill {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 0.35rem;
        background: var(--app-surface-2);
        border: none;
        border-radius: 999px;
        padding: 0.25rem 0.35rem 0.25rem 0.65rem;
        font-size: 0.78rem;
        font-weight: 700;
        color: #fff;
        cursor: pointer;
    }
    .app-balance-amount { pointer-events: none; }
    .app-balance-plus {
        width: 1.5rem;
        height: 1.5rem;
        border-radius: 50%;
        background: var(--app-green);
        color: #111;
        font-weight: 900;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        font-size: 1rem;
        line-height: 1;
    }
    .app-userbar-icons {
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: 0.3rem;
        flex-shrink: 0;
    }
    .app-profile-btn {
        width: 2rem;
        height: 2rem;
        border-radius: 50%;
        border: 2px solid rgba(118, 225, 118, 0.35);
        padding: 0;
        overflow: hidden;
        background: transparent;
        cursor: pointer;
        flex-shrink: 0;
    }
    .app-icon-btn {
        width: 2rem;
        height: 2rem;
        border-radius: 0.5rem;
        background: var(--app-surface-2);
        border: none;
        color: #fff;
        font-size: 0.85rem;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        cursor: pointer;
        text-decoration: none;
    }
    .app-icon-btn-lottie {
        width: 1.35rem;
        height: 1.35rem;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: none;
    }
    .app-icon-btn-lottie .lottie-container {
        width: 100%;
        height: 100%;
    }
    .app-icon-btn .badge {
        position: absolute;
        top: -2px;
        right: -2px;
        min-width: 1rem;
        height: 1rem;
        padding: 0 0.2rem;
        background: #e74c3c;
        border-radius: 999px;
        font-size: 0.55rem;
        font-weight: 800;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .app-chip-tag {
        font-size: 0.55rem;
        font-weight: 800;
        padding: 0.2rem 0.45rem;
        border-radius: 0.35rem;
        white-space: nowrap;
    }
    .app-chip-hot { background: #c0392b; color: #fff; }
    .app-hotevent-btn {
        flex-shrink: 0;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }
    .app-hotevent-chip {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 2rem;
        min-height: 2rem;
    }
    .app-hotevent-img {
        height: 1.35rem;
        width: auto;
        max-width: 4.5rem;
        object-fit: contain;
        flex-shrink: 0;
        display: block;
        border-radius: 0.35rem;
    }
    .app-hotevent-live {
        position: absolute;
        top: -0.2rem;
        right: -0.35rem;
        padding: 0.08rem 0.28rem;
        border-radius: 999px;
        background: #e74c3c;
        color: #fff;
        font-size: 0.45rem;
        font-weight: 900;
        letter-spacing: 0.04em;
        line-height: 1.2;
        box-shadow: 0 0 0 2px var(--app-surface);
        animation: app-hotevent-pulse 1.8s ease-in-out infinite;
    }
    @keyframes app-hotevent-pulse {
        0%, 100% { transform: scale(1); opacity: 1; }
        50% { transform: scale(1.05); opacity: 0.92; }
    }

    /* Hot event page */
    .kx-hotevent-wrap {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding-bottom: 1rem;
    }
    .kx-hotevent-hero {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 1rem;
        border-radius: 0.85rem;
        background: linear-gradient(145deg, #7f1d1d 0%, #431407 55%, #1f2937 100%);
        border: 1px solid rgba(255, 255, 255, 0.06);
    }
    .kx-hotevent-hero-tag {
        font-size: 0.62rem;
        font-weight: 700;
        color: #fca5a5;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }
    .kx-hotevent-hero-title {
        margin-top: 0.2rem;
        font-size: 1.2rem;
        font-weight: 900;
    }
    .kx-hotevent-hero-count {
        text-align: right;
        padding: 0.45rem 0.6rem;
        border-radius: 0.65rem;
        background: rgba(252, 165, 165, 0.12);
        border: 1px solid rgba(252, 165, 165, 0.22);
        min-width: 4rem;
    }
    .kx-hotevent-hero-count span {
        display: block;
        font-size: 0.58rem;
        color: var(--app-text-muted);
        text-transform: uppercase;
    }
    .kx-hotevent-hero-count strong {
        display: block;
        margin-top: 0.15rem;
        font-size: 1.1rem;
        color: #fca5a5;
    }
    .kx-hotevent-list {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    .kx-hotevent-card {
        border-radius: 0.85rem;
        overflow: hidden;
        background: var(--app-surface);
        border: 1px solid rgba(255, 255, 255, 0.06);
    }
    .kx-hotevent-card-media {
        position: relative;
        aspect-ratio: 16 / 9;
        overflow: hidden;
        background: #111;
    }
    .kx-hotevent-card-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .kx-hotevent-card-overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.72) 100%);
    }
    .kx-hotevent-card-badges {
        position: absolute;
        top: 0.55rem;
        left: 0.55rem;
        display: flex;
        gap: 0.35rem;
        flex-wrap: wrap;
        z-index: 1;
    }
    .kx-hotevent-badge {
        padding: 0.18rem 0.45rem;
        border-radius: 999px;
        font-size: 0.55rem;
        font-weight: 900;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }
    .kx-hotevent-badge.hot {
        background: #e74c3c;
        color: #fff;
    }
    .kx-hotevent-badge.live {
        background: rgba(118, 225, 118, 0.18);
        color: var(--app-green);
        border: 1px solid rgba(118, 225, 118, 0.35);
    }
    .kx-hotevent-card-body {
        padding: 0.85rem;
    }
    .kx-hotevent-card-sub {
        font-size: 0.58rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        color: var(--app-green);
        margin-bottom: 0.25rem;
    }
    .kx-hotevent-card-body h3 {
        font-size: 1rem;
        font-weight: 900;
        line-height: 1.2;
        margin-bottom: 0.35rem;
    }
    .kx-hotevent-card-prize {
        font-size: 0.85rem;
        font-weight: 800;
        color: #fbbf24;
        margin-bottom: 0.65rem;
    }
    .kx-hotevent-card-btn {
        display: inline-flex;
        align-items: center;
        padding: 0.5rem 0.95rem;
        border-radius: 0.55rem;
        background: var(--app-green);
        color: #111;
        font-size: 0.72rem;
        font-weight: 900;
        text-decoration: none;
    }
    .kx-hotevent-empty {
        text-align: center;
        padding: 2rem 1rem;
        background: var(--app-surface);
        border-radius: 0.85rem;
        color: var(--app-text-muted);
    }
    .kx-hotevent-empty-icon {
        width: 4rem;
        height: auto;
        margin: 0 auto 0.75rem;
        opacity: 0.9;
    }
    .kx-hotevent-empty p {
        font-size: 0.9rem;
        font-weight: 800;
        color: #fff;
    }
    .kx-hotevent-empty span {
        display: block;
        margin-top: 0.25rem;
        font-size: 0.68rem;
    }
    .kx-hotevent-empty-btn {
        display: inline-block;
        margin-top: 0.85rem;
        padding: 0.5rem 1rem;
        border-radius: 0.55rem;
        background: var(--app-green);
        color: #111;
        font-size: 0.72rem;
        font-weight: 900;
        text-decoration: none;
    }

    .app-chip-vip { background: linear-gradient(135deg,#ffd700,#b8860b); color: #111; }

    /* Promo hero */
    .app-home-categories {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding-bottom: 0.5rem;
    }
    .app-home-category {
        margin: 0;
    }
    .app-live-bets {
        margin: 0.25rem 0 1rem;
        padding: 0.85rem 0.75rem 0.75rem;
        border-radius: 0.85rem;
        background: var(--app-surface);
        border: 1px solid rgba(255, 255, 255, 0.06);
    }
    .app-live-bets-title {
        margin: 0 0 0.65rem;
        font-size: 0.82rem;
        font-weight: 800;
        color: #fff;
    }
    .app-live-bets-tabs {
        display: flex;
        gap: 0.35rem;
        margin-bottom: 0.65rem;
    }
    .app-live-bets-tab {
        border: none;
        border-radius: 999px;
        padding: 0.38rem 0.65rem;
        background: transparent;
        color: rgba(255, 255, 255, 0.72);
        font-size: 0.62rem;
        font-weight: 700;
        cursor: pointer;
        font-family: inherit;
        white-space: nowrap;
    }
    .app-live-bets-tab.active {
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
    }
    .app-live-bets-table {
        border-radius: 0.65rem;
        overflow: hidden;
        background: rgba(0, 0, 0, 0.18);
    }
    .app-live-bet-head,
    .app-live-bet-row {
        display: grid;
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.45rem;
        padding: 0.55rem 0.65rem;
    }
    .app-live-bet-head {
        font-size: 0.58rem;
        font-weight: 700;
        color: rgba(255, 255, 255, 0.42);
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    .app-live-bet-head span:last-child,
    .app-live-bet-profit {
        text-align: right;
    }
    .app-live-bets-scroll {
        max-height: 16.5rem;
        overflow-y: auto;
        overflow-x: hidden;
        scroll-behavior: smooth;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: y proximity;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
    }
    .app-live-bets.is-auto-scroll .app-live-bets-scroll {
        scroll-behavior: auto;
    }
    .app-live-bets-scroll::-webkit-scrollbar {
        width: 0.22rem;
    }
    .app-live-bets-scroll::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.18);
        border-radius: 999px;
    }
    .app-live-bet-row {
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
        font-size: 0.62rem;
        scroll-snap-align: start;
        transition: background-color 0.25s ease, opacity 0.25s ease;
    }
    .app-live-bet-row:last-child {
        border-bottom: none;
    }
    .app-live-bet-game {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        min-width: 0;
    }
    .app-live-bet-game img,
    .app-live-bet-game-fallback {
        width: 1.15rem;
        height: 1.15rem;
        border-radius: 0.25rem;
        flex-shrink: 0;
        object-fit: cover;
    }
    .app-live-bet-game-fallback {
        display: block;
        background:
            linear-gradient(135deg, rgba(59, 130, 246, 0.85) 0 48%, transparent 48%),
            linear-gradient(225deg, rgba(168, 85, 247, 0.85) 0 48%, transparent 48%),
            rgba(255, 255, 255, 0.08);
    }
    .app-live-bet-game-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: rgba(255, 255, 255, 0.88);
        font-weight: 600;
    }
    .app-live-bet-player {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: rgba(255, 255, 255, 0.62);
    }
    .app-live-bet-profit {
        font-weight: 800;
        white-space: nowrap;
    }
    .app-live-bet-profit.is-win {
        color: #86efac;
    }
    .app-live-bet-profit.is-zero {
        color: rgba(255, 255, 255, 0.72);
    }
    .app-live-bets.is-loading .app-live-bets-scroll {
        opacity: 0.72;
    }
    /* ── Mobile hero banner slider (redesigned) ── */
    .kx-hero-slider {
        margin: 0.65rem 0 0.85rem;
        position: relative;
    }
    .kx-hero-segments {
        display: flex;
        gap: 0.3rem;
        margin-bottom: 0.5rem;
        padding: 0 0.1rem;
    }
    .kx-hero-segment {
        flex: 1;
        height: 3px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.12);
        overflow: hidden;
        cursor: pointer;
    }
    .kx-hero-segment-fill {
        display: block;
        height: 100%;
        width: 0;
        border-radius: inherit;
        background: linear-gradient(90deg, var(--app-green-bright), var(--app-green));
        box-shadow: 0 0 8px rgba(200, 245, 66, 0.45);
    }
    .kx-hero-segment.is-done .kx-hero-segment-fill {
        width: 100%;
        animation: none;
    }
    @keyframes kxHeroSegmentFill {
        from { width: 0; }
        to { width: 100%; }
    }
    .kx-hero-viewport {
        overflow: hidden;
        border-radius: 1.1rem;
        touch-action: pan-y;
    }
    .kx-hero-track {
        display: flex;
        transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
        will-change: transform;
    }
    .kx-hero-slide {
        position: relative;
        flex: 0 0 100%;
        min-height: 10.5rem;
        border-radius: 1.1rem;
        overflow: hidden;
        border: 1px solid rgba(118, 225, 118, 0.14);
        box-shadow:
            0 4px 24px rgba(0, 0, 0, 0.35),
            inset 0 1px 0 rgba(255, 255, 255, 0.06);
        isolation: isolate;
    }
    .kx-hero-slide--image {
        min-height: 0;
        aspect-ratio: 16 / 6.5;
    }
    .kx-hero-slide--image .kx-hero-img {
        animation: none;
        transform: none;
    }
    .kx-hero-slide-link {
        position: absolute;
        inset: 0;
        z-index: 5;
        border-radius: inherit;
    }
    .kx-hero-media {
        position: absolute;
        inset: 0;
        z-index: 0;
    }
    .kx-hero-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transform: scale(1.02);
        animation: kxHeroKenBurns 12s ease-in-out infinite alternate;
    }
    @keyframes kxHeroKenBurns {
        from { transform: scale(1.02); }
        to { transform: scale(1.08); }
    }
    .kx-hero-fallback-bg {
        position: absolute;
        inset: 0;
        background:
            radial-gradient(ellipse 80% 60% at 85% 80%, rgba(247, 211, 88, 0.18) 0%, transparent 55%),
            radial-gradient(ellipse 60% 50% at 15% 20%, rgba(118, 225, 118, 0.2) 0%, transparent 50%),
            linear-gradient(145deg, #0a1a10 0%, #142818 45%, #0d1f14 100%);
    }
    .kx-hero-gradient {
        position: absolute;
        inset: 0;
        background:
            linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.05) 35%, rgba(0, 0, 0, 0.72) 100%),
            linear-gradient(90deg, rgba(8, 18, 12, 0.88) 0%, rgba(8, 18, 12, 0.45) 55%, rgba(8, 18, 12, 0.15) 100%);
        pointer-events: none;
    }
    .kx-hero-shine {
        position: absolute;
        top: -40%;
        left: -20%;
        width: 45%;
        height: 140%;
        background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.07) 50%, transparent 60%);
        transform: rotate(8deg);
        pointer-events: none;
        animation: kxHeroShine 5s ease-in-out infinite;
    }
    @keyframes kxHeroShine {
        0%, 100% { opacity: 0.3; transform: rotate(8deg) translateX(-10%); }
        50% { opacity: 0.7; transform: rotate(8deg) translateX(30%); }
    }
    .kx-hero-noise {
        position: absolute;
        inset: 0;
        opacity: 0.04;
        background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
        pointer-events: none;
    }
    .kx-hero-body {
        position: relative;
        z-index: 2;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        min-height: 10.5rem;
        padding: 0.85rem 0.95rem 1rem;
        max-width: 72%;
        pointer-events: none;
    }
    .kx-hero-badges {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        margin-bottom: 0.4rem;
    }
    .kx-hero-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
        padding: 0.2rem 0.55rem;
        border-radius: 999px;
        font-size: 0.58rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }
    .kx-hero-badge--live {
        background: rgba(118, 225, 118, 0.15);
        color: var(--app-green-bright);
        border: 1px solid rgba(118, 225, 118, 0.35);
    }
    .kx-hero-badge--glass {
        background: rgba(255, 255, 255, 0.08);
        color: rgba(255, 255, 255, 0.9);
        border: 1px solid rgba(255, 255, 255, 0.12);
        backdrop-filter: blur(6px);
    }
    .kx-hero-badge--gold {
        background: rgba(247, 211, 88, 0.15);
        color: var(--app-yellow);
        border: 1px solid rgba(247, 211, 88, 0.3);
    }
    .kx-hero-pulse {
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: var(--app-green-bright);
        box-shadow: 0 0 6px var(--app-green-bright);
        animation: kxHeroPulse 1.4s ease-in-out infinite;
    }
    @keyframes kxHeroPulse {
        0%, 100% { opacity: 1; transform: scale(1); }
        50% { opacity: 0.5; transform: scale(0.85); }
    }
    .kx-hero-eyebrow {
        margin: 0 0 0.2rem;
        font-size: 0.62rem;
        font-weight: 700;
        letter-spacing: 0.14em;
        color: var(--app-green);
        text-transform: uppercase;
    }
    .kx-hero-title {
        margin: 0;
        font-size: 1.2rem;
        font-weight: 900;
        line-height: 1.15;
        letter-spacing: -0.02em;
        color: #fff;
        text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    }
    .kx-hero-title em {
        font-style: normal;
        color: var(--app-yellow);
    }
    .kx-hero-prize {
        margin: 0.35rem 0 0;
        font-size: 1.05rem;
        font-weight: 900;
        color: var(--app-green-bright);
        text-shadow: 0 0 20px rgba(200, 245, 66, 0.35);
        letter-spacing: -0.01em;
    }
    .kx-hero-progress {
        margin-top: 0.55rem;
        max-width: 9.5rem;
    }
    .kx-hero-progress-meta {
        display: flex;
        justify-content: space-between;
        font-size: 0.58rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 0.45);
        margin-bottom: 0.25rem;
    }
    .kx-hero-progress-meta span:last-child {
        color: var(--app-green-bright);
    }
    .kx-hero-progress-bar {
        height: 3px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.1);
        overflow: hidden;
    }
    .kx-hero-progress-bar span {
        display: block;
        height: 100%;
        border-radius: inherit;
        background: linear-gradient(90deg, #5cb85c, var(--app-green-bright));
        box-shadow: 0 0 6px rgba(200, 245, 66, 0.4);
    }
    .kx-hero-cta {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        margin-top: 0.65rem;
        padding: 0.45rem 0.85rem;
        width: fit-content;
        border-radius: 0.55rem;
        background: linear-gradient(135deg, var(--app-green-bright) 0%, #9ed63f 100%);
        color: #0a1408;
        font-size: 0.72rem;
        font-weight: 900;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        box-shadow: 0 4px 14px rgba(200, 245, 66, 0.28);
        pointer-events: auto;
        position: relative;
        z-index: 6;
    }
    .kx-hero-cta--inline {
        pointer-events: none;
    }
    .kx-hero-deco {
        position: absolute;
        right: -0.25rem;
        bottom: -0.25rem;
        width: 42%;
        max-width: 7.5rem;
        height: 75%;
        opacity: 0.92;
        pointer-events: none;
        z-index: 1;
        filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
    }
    .kx-hero-footer {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        margin-top: 0.55rem;
    }
    .kx-hero-counter {
        font-size: 0.68rem;
        font-weight: 700;
        color: rgba(255, 255, 255, 0.45);
        letter-spacing: 0.08em;
        min-width: 2.5rem;
        text-align: center;
    }
    .kx-hero-nav {
        width: 1.85rem;
        height: 1.85rem;
        border-radius: 0.5rem;
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.05);
        color: rgba(255, 255, 255, 0.7);
        font-size: 1.1rem;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background 0.2s, color 0.2s, border-color 0.2s;
    }
    .kx-hero-nav:active {
        background: rgba(118, 225, 118, 0.2);
        border-color: rgba(118, 225, 118, 0.35);
        color: var(--app-green-bright);
    }

    /* Legacy promo aliases (auth screens) */
    .app-promo-wrap {
        margin: 0.75rem 0;
        overflow: hidden;
    }

    /* Section head */
    .app-section-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: 1rem 0 0.65rem;
    }
    .app-section-head h3 {
        font-size: 0.95rem;
        font-weight: 800;
    }
    .app-section-head a {
        font-size: 0.75rem;
        color: var(--app-text-muted);
        font-weight: 600;
    }

    /* Home — lottery horizontal scroll (mobile + desktop) */
    .app-home-lottery {
        margin-bottom: 1rem;
    }
    .app-lottery-scroll {
        display: flex;
        gap: 0.65rem;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 0.125rem;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
        padding: 0.1rem 0.125rem 0.15rem;
        margin: 0 -0.125rem;
        scrollbar-width: none;
        -ms-overflow-style: none;
        cursor: grab;
    }
    .app-lottery-scroll.is-infinite {
        scroll-snap-type: none;
    }
    .app-lottery-scroll.is-dragging {
        cursor: grabbing;
        scroll-snap-type: none;
        user-select: none;
    }
    .app-lottery-scroll.is-dragging a {
        pointer-events: none;
    }
    .app-lottery-scroll::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }
    .app-lottery-scroll .app-lottery-tile--scroll {
        flex: 0 0 auto;
        width: clamp(8.25rem, 42vw, 11.5rem);
        min-width: clamp(8.25rem, 42vw, 11.5rem);
        max-width: 11.5rem;
        scroll-snap-align: start;
    }
    @media (min-width: 768px) {
        .app-lottery-scroll .app-lottery-tile--scroll {
            width: clamp(9.5rem, 22vw, 12.5rem);
            min-width: clamp(9.5rem, 22vw, 12.5rem);
            max-width: 12.5rem;
        }
    }
    .app-lottery-scroll .app-lottery-tile--scroll .app-lottery-tile-thumb {
        aspect-ratio: 3 / 4;
    }

    /* Jackpot horizontal scroll */
    .app-jackpot-scroll {
        display: flex;
        gap: 0.65rem;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
        scrollbar-width: none;
    }
    .app-jackpot-scroll::-webkit-scrollbar { display: none; }
    .app-jackpot-card {
        flex: 0 0 72%;
        max-width: 16rem;
        scroll-snap-align: start;
        background: var(--app-surface);
        border-radius: 0.75rem;
        padding: 0.75rem;
        border: 1px solid rgba(255,255,255,0.06);
    }
    .app-jackpot-card img, .app-jackpot-card .lottie-wrap {
        width: 3.5rem;
        height: 3.5rem;
        border-radius: 0.5rem;
        object-fit: cover;
    }
    .app-jackpot-amt {
        font-size: 1.1rem;
        font-weight: 900;
        color: var(--app-green-bright);
    }
    .app-jackpot-timer {
        font-size: 0.65rem;
        color: var(--app-text-muted);
        font-variant-numeric: tabular-nums;
    }

    /* Game grids */
    .app-games-2 {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.65rem;
    }
    .app-games-3 {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    .app-game-tile {
        --app-game-accent: #176b3a;
        position: relative;
        display: block;
        text-decoration: none;
        color: inherit;
        border-radius: 14px;
        overflow: hidden;
        background: var(--app-game-accent);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .app-game-tile[data-category="fishing"] {
        --app-game-accent: #0f6ec7;
    }
    .app-game-tile[data-category="table"] {
        --app-game-accent: #3d3480;
    }
    .app-game-tile[data-category="crash"] {
        --app-game-accent: #c41e78;
    }
    .app-game-tile-inner {
        display: block;
        line-height: 0;
    }
    .app-game-tile-thumb {
        width: 100%;
        position: relative;
        overflow: hidden;
        background: var(--app-game-accent);
    }
    .app-game-tile-thumb img {
        width: 100%;
        height: auto;
        display: block;
        vertical-align: top;
    }
    .app-game-tile:active {
        transform: scale(0.97);
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.32);
    }
    .app-game-tile-fallback {
        width: 100%;
        aspect-ratio: 3 / 4;
        min-height: 5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.75rem;
        background: rgba(0, 0, 0, 0.15);
    }

    /* Lottery page — casino-style contest tiles */
    .kx-lottery-page .app-games-3 {
        padding-bottom: 0.5rem;
    }
    .kx-lottery-page .app-games-3 .app-casino-empty {
        grid-column: 1 / -1;
        text-align: center;
        padding: 2.5rem 1rem;
    }
    .app-lottery-tile {
        --lottery-accent: #176b3a;
        position: relative;
        display: block;
        text-decoration: none;
        color: #fff;
        border-radius: 16px;
        overflow: hidden;
        background: var(--lottery-accent);
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        -webkit-tap-highlight-color: transparent;
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
    .app-lottery-tile.is-live {
        border-color: rgba(200, 245, 66, 0.45);
        box-shadow:
            0 0 0 1px rgba(200, 245, 66, 0.25),
            0 10px 28px rgba(0, 0, 0, 0.38);
    }
    .app-lottery-tile[data-category="kerala"] {
        --lottery-accent: #0f6ec7;
    }
    .app-lottery-tile[data-category="dear"] {
        --lottery-accent: #c41e78;
    }
    .app-lottery-tile:active {
        transform: scale(0.97);
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.32);
    }
    .app-lottery-tile-inner {
        display: block;
        line-height: 0;
    }
    .app-lottery-tile-thumb {
        position: relative;
        width: 100%;
        aspect-ratio: 3 / 4;
        overflow: hidden;
        background: linear-gradient(160deg, var(--lottery-accent), rgba(0, 0, 0, 0.55));
    }
    .app-lottery-tile-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transform: scale(1.02);
        transition: transform 0.35s ease;
    }
    .app-lottery-tile:active .app-lottery-tile-thumb img {
        transform: scale(1.06);
    }
    .app-lottery-tile-shine {
        position: absolute;
        inset: 0;
        z-index: 1;
        pointer-events: none;
        background:
            linear-gradient(145deg, rgba(255, 255, 255, 0.12) 0%, transparent 38%),
            linear-gradient(0deg, rgba(0, 0, 0, 0.15) 0%, transparent 42%),
            linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.88) 100%);
    }
    .app-lottery-tile-fallback {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 2rem;
        background: linear-gradient(160deg, var(--lottery-accent), rgba(0, 0, 0, 0.45));
    }
    .app-lottery-tile-cat {
        position: absolute;
        top: 0.45rem;
        left: 0.45rem;
        z-index: 3;
        display: inline-flex;
        align-items: center;
        padding: 0.22rem 0.55rem;
        border-radius: 999px;
        background: linear-gradient(180deg, #f5d76e, #c9a227);
        color: #1a1200;
        font-size: 0.6rem;
        font-weight: 900;
        letter-spacing: 0.05em;
        line-height: 1;
        text-transform: uppercase;
        max-width: calc(100% - 0.9rem);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    }
    .app-lottery-tile-glass {
        position: absolute;
        inset: auto 0.35rem 0.35rem;
        z-index: 3;
        padding: 0.45rem 0.5rem 0.5rem;
        border-radius: 0.65rem;
        background: rgba(8, 12, 10, 0.72);
        border: 1px solid rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        line-height: 1.2;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    }
    .app-lottery-tile-name {
        margin: 0;
        font-size: 0.62rem;
        font-weight: 800;
        line-height: 1.25;
        color: #fff;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .app-lottery-tile-prize-row {
        display: flex;
        flex-direction: column;
        gap: 0.05rem;
        margin-top: 0.28rem;
    }
    .app-lottery-tile-prize-label {
        font-size: 0.48rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: rgba(200, 245, 66, 0.72);
    }
    .app-lottery-tile-prize {
        font-size: 0.78rem;
        font-weight: 900;
        color: #e8ff9a;
        letter-spacing: 0.01em;
        text-shadow: 0 0 12px rgba(200, 245, 66, 0.35);
    }
    .app-lottery-tile-meta {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.35rem;
        margin-top: 0.38rem;
        padding-top: 0.35rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
    .app-lottery-tile-entry {
        display: inline-flex;
        align-items: center;
        padding: 0.28rem 0.55rem;
        border-radius: 999px;
        background: linear-gradient(135deg, var(--app-green-bright) 0%, var(--app-green) 100%);
        font-size: 0.5rem;
        font-weight: 900;
        color: #0a1408;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        box-shadow: 0 2px 10px rgba(200, 245, 66, 0.28);
        border: 1px solid rgba(255, 255, 255, 0.12);
    }
    .app-lottery-tile-entry.is-free {
        background: linear-gradient(135deg, var(--app-green-bright) 0%, #b8e84a 100%);
        color: #0a1408;
        box-shadow: 0 2px 10px rgba(200, 245, 66, 0.35);
    }
    .app-lottery-scroll .app-lottery-tile-glass {
        padding: 0.38rem 0.42rem 0.42rem;
    }
    .app-lottery-scroll .app-lottery-tile-name {
        font-size: 0.54rem;
    }
    .app-lottery-scroll .app-lottery-tile-prize {
        font-size: 0.68rem;
    }
    .app-lottery-scroll .app-lottery-tile-entry {
        font-size: 0.46rem;
        padding: 0.24rem 0.5rem;
    }

    /* Casino page mobile */
    .app-page-top {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 0.875rem;
    }
    .app-page-title {
        flex: 1;
        text-align: center;
        font-size: 0.95rem;
        font-weight: 800;
        letter-spacing: 0.05em;
    }
    .app-page-link {
        font-size: 0.7rem;
        font-weight: 700;
        color: var(--app-text-muted);
        text-decoration: none;
        white-space: nowrap;
    }
    .app-back-btn {
        width: 2.25rem;
        height: 2.25rem;
        border-radius: 0.5rem;
        background: var(--app-surface);
        border: none;
        color: #fff;
        font-size: 1.1rem;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
    }
    .app-search {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        background: var(--app-surface);
        border-radius: 0.65rem;
        padding: 0.65rem 0.85rem;
        margin-bottom: 0.65rem;
    }
    .app-search input {
        flex: 1;
        background: transparent;
        border: none;
        color: #fff;
        font-size: 0.85rem;
        outline: none;
    }
    .app-search input::placeholder { color: var(--app-text-muted); }
    .app-filter-tabs {
        display: flex;
        gap: 0.35rem;
        overflow-x: auto;
        margin-bottom: 0.65rem;
        scrollbar-width: none;
    }
    .app-filter-tab {
        flex-shrink: 0;
        padding: 0.45rem 0.75rem;
        border-radius: 0.5rem;
        background: var(--app-surface);
        font-size: 0.7rem;
        font-weight: 700;
        color: var(--app-text-muted);
        border: none;
    }
    .app-filter-tab.active {
        background: var(--app-green);
        color: #111;
    }

    .app-casino-toolbar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        margin-bottom: 0.65rem;
    }
    .app-casino-select-wrap {
        display: block;
        min-width: 0;
    }
    .app-casino-select {
        width: 100%;
        appearance: none;
        -webkit-appearance: none;
        background: var(--app-surface);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 0.65rem;
        color: #fff;
        font-size: 0.72rem;
        font-weight: 700;
        padding: 0.62rem 1.75rem 0.62rem 0.75rem;
        outline: none;
        background-image:
            linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.55) 50%),
            linear-gradient(135deg, rgba(255,255,255,0.55) 50%, transparent 50%);
        background-position:
            calc(100% - 14px) calc(50% - 2px),
            calc(100% - 9px) calc(50% - 2px);
        background-size: 5px 5px, 5px 5px;
        background-repeat: no-repeat;
    }
    .app-casino-select:focus {
        border-color: rgba(118, 225, 118, 0.45);
        box-shadow: 0 0 0 2px rgba(118, 225, 118, 0.12);
    }
    .app-casino-empty {
        text-align: center;
        color: var(--app-text-muted);
        font-size: 0.78rem;
        font-weight: 600;
        padding: 1.5rem 0.75rem 0.5rem;
    }
    .app-casino-empty.hidden { display: none; }
    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    /* Bottom nav */
    .app-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 200;
        height: calc(var(--app-nav-h) + var(--app-safe-bottom));
        padding-bottom: var(--app-safe-bottom);
        background: rgba(30, 33, 37, 0.94);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35);
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        padding-left: 0.35rem;
        padding-right: 0.35rem;
    }
    .app-nav-item {
        flex: 1;
        min-width: 0;
        max-width: 4.75rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        gap: 0.2rem;
        color: var(--app-text-muted);
        font-size: 0.5625rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        border: none;
        background: none;
        padding: 0.4rem 0.2rem 0.55rem;
        text-decoration: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.22s ease;
    }
    .app-nav-item .nav-label {
        line-height: 1;
        transition: color 0.22s ease, font-weight 0.22s ease;
    }
    .app-nav-item .nav-icon-chip {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 2.65rem;
        height: 1.85rem;
        padding: 0 0.45rem;
        border-radius: 999px;
        transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.18s ease;
    }
    .app-nav-item.active {
        color: var(--app-green-bright);
    }
    .app-nav-item.active .nav-label {
        color: var(--app-green);
        font-weight: 800;
    }
    .app-nav-item.active .nav-icon-chip {
        background: linear-gradient(135deg, rgba(118, 225, 118, 0.28), rgba(118, 225, 118, 0.1));
        box-shadow:
            0 0 0 1px rgba(118, 225, 118, 0.38),
            0 6px 16px rgba(118, 225, 118, 0.18);
    }
    .app-nav-item:active .nav-icon-chip {
        transform: scale(0.94);
    }
    .app-nav-item .nav-icon {
        width: 1.45rem;
        height: 1.45rem;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        overflow: hidden;
    }
    .app-nav-item .material-symbols-rounded {
        font-size: 1.35rem;
        line-height: 1;
        color: rgba(255, 255, 255, 0.42);
        font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
        transition: color 0.22s ease, font-variation-settings 0.22s ease;
    }
    .app-nav-item.active .material-symbols-rounded {
        color: var(--app-green-bright);
        font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24;
    }
    .app-nav-item .nav-icon-lottie {
        width: 1.45rem;
        height: 1.45rem;
        display: block;
        opacity: 0.55;
        filter: grayscale(1) brightness(1.15);
        transition: opacity 0.22s ease, filter 0.22s ease;
    }
    .app-nav-item.active .nav-icon-lottie {
        opacity: 1;
        filter: none;
    }
    .app-nav-item .nav-icon-lottie .lottie-container {
        width: 100%;
        height: 100%;
    }
    .app-nav-center {
        flex: 0 0 3.75rem;
        position: relative;
        margin-top: -1.25rem;
    }
    .app-nav-fab {
        width: 3.75rem;
        height: 3.75rem;
        border-radius: 50%;
        border: 3px solid var(--app-surface);
        position: relative;
        overflow: hidden;
        background: transparent;
        padding: 0;
        box-shadow: 0 4px 16px rgba(0,0,0,0.4);
        display: block;
        text-decoration: none;
    }
    .app-nav-fab .app-nav-fab-lottie,
    .app-nav-fab .lottie-container {
        width: 100%;
        height: 100%;
    }

    /* Side drawer */
    .app-drawer-overlay {
        position: fixed;
        inset: 0;
        z-index: 250;
        background: rgba(0,0,0,0.6);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s, visibility 0.25s;
    }
    .app-drawer-overlay.open { opacity: 1; visibility: visible; }
    .app-drawer {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 260;
        width: min(88vw, 20rem);
        background: var(--app-bg);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .app-drawer.open { transform: translateX(0); }
    .app-drawer-close {
        position: absolute;
        top: 0.65rem;
        right: 0.65rem;
        z-index: 2;
        width: 1.75rem;
        height: 1.75rem;
        border-radius: 50%;
        border: none;
        background: rgba(255, 255, 255, 0.08);
        color: rgba(255, 255, 255, 0.7);
        font-size: 1.1rem;
        line-height: 1;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .app-drawer-body {
        flex: 1;
        padding: 0.85rem 0.65rem 1rem;
        overflow-y: auto;
        scrollbar-width: thin;
    }
    .app-drawer-games {
        display: flex;
        flex-direction: column;
        gap: 0.15rem;
        background: var(--app-surface);
        border-radius: 0.75rem;
        padding: 0.35rem;
        margin-bottom: 0.5rem;
    }
    .app-drawer-list {
        display: flex;
        flex-direction: column;
        gap: 0.1rem;
        margin-bottom: 0.5rem;
    }
    .app-drawer-item {
        display: flex;
        align-items: center;
        gap: 0.55rem;
        width: 100%;
        padding: 0.58rem 0.55rem;
        border: none;
        border-radius: 0.55rem;
        background: transparent;
        font-size: 0.78rem;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.92);
        text-align: left;
        text-decoration: none;
        cursor: pointer;
        transition: background 0.18s ease;
    }
    .app-drawer-games .app-drawer-item:hover,
    .app-drawer-list .app-drawer-item:hover {
        background: rgba(255, 255, 255, 0.04);
    }
    .app-drawer-item--featured {
        background: linear-gradient(90deg, rgba(118, 225, 118, 0.32), rgba(118, 225, 118, 0.06)) !important;
        color: var(--app-green-bright);
        font-weight: 800;
    }
    .app-drawer-item--featured .material-symbols-rounded {
        color: var(--app-green-bright);
        font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24;
    }
    .app-drawer-icon {
        width: 1.35rem;
        height: 1.35rem;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        color: rgba(255, 255, 255, 0.55);
    }
    .app-drawer-icon .material-symbols-rounded {
        font-size: 1.15rem;
        width: 1.15rem;
        height: 1.15rem;
        color: inherit;
    }
    .app-drawer-icon-emoji {
        font-size: 1rem;
        line-height: 1;
    }
    .app-drawer-icon-spin {
        width: 1.5rem;
        height: 1.5rem;
    }
    .app-drawer-icon-spin .lottie-container {
        width: 100%;
        height: 100%;
    }
    .app-drawer-badge {
        margin-left: auto;
        font-size: 0.55rem;
        font-weight: 800;
        padding: 0.12rem 0.38rem;
        border-radius: 0.3rem;
        background: var(--app-yellow);
        color: #111;
        letter-spacing: 0.01em;
        flex-shrink: 0;
    }
    .app-drawer-green {
        color: var(--app-green);
        font-weight: 800;
    }
    .app-drawer-card {
        display: flex;
        align-items: center;
        gap: 0.55rem;
        width: 100%;
        padding: 0.72rem 0.75rem;
        margin-bottom: 0.45rem;
        background: var(--app-surface);
        border-radius: 0.65rem;
        font-size: 0.78rem;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.92);
        text-decoration: none;
        border: none;
        cursor: pointer;
        transition: background 0.18s ease;
    }
    .app-drawer-card:hover {
        background: var(--app-surface-2);
    }
    .app-drawer-card--webapp {
        justify-content: flex-start;
    }
    .app-drawer-card-action {
        margin-left: auto;
        display: flex;
        align-items: center;
        color: rgba(255, 255, 255, 0.45);
    }
    .app-drawer-card-action .material-symbols-rounded {
        font-size: 1.1rem;
        width: 1.1rem;
        height: 1.1rem;
    }
    .app-drawer-community {
        background: var(--app-surface);
        border-radius: 0.65rem;
        padding: 0.85rem 0.65rem;
        margin: 0.35rem 0 0.45rem;
        text-align: center;
    }
    .app-drawer-community h3 {
        font-size: 0.72rem;
        font-weight: 700;
        color: rgba(255, 255, 255, 0.55);
        margin: 0;
        letter-spacing: 0.02em;
    }
    .app-drawer-socials {
        display: flex;
        justify-content: center;
        gap: 0.4rem;
        margin-top: 0.65rem;
        flex-wrap: wrap;
    }
    .app-drawer-socials a {
        width: 2.1rem;
        height: 2.1rem;
        border-radius: 0.45rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.52rem;
        font-weight: 800;
        color: #fff;
        text-decoration: none;
        letter-spacing: -0.02em;
    }
    .app-drawer-socials .tg { background: #29b6f6; }
    .app-drawer-socials .fb { background: #1d4ed8; }
    .app-drawer-socials .ig { background: linear-gradient(45deg, #f09433, #dc2743); }
    .app-drawer-socials .wa { background: #22c55e; }
    .app-drawer-socials .yt { background: #dc2626; }
    .app-drawer-version {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.65rem 0.75rem;
        background: var(--app-surface);
        border-radius: 0.65rem;
        font-size: 0.7rem;
        font-weight: 600;
        color: var(--app-text-muted);
    }

    /* Auth pages — see global auth styles at end of file */
    .app-field {
        margin-bottom: 0.85rem;
    }
    .app-field-row {
        display: flex;
        gap: 0;
        background: var(--app-surface-2);
        border-radius: 0.65rem;
        overflow: hidden;
        border: 1px solid rgba(255,255,255,0.06);
    }
    .app-field-prefix {
        padding: 0.85rem 0.65rem;
        font-size: 0.85rem;
        color: var(--app-text-muted);
        border-right: 1px solid rgba(255,255,255,0.08);
    }
    .app-field input {
        flex: 1;
        padding: 0.85rem;
        background: transparent;
        border: none;
        color: #fff;
        font-size: 0.85rem;
        outline: none;
    }
    .app-field input::placeholder { color: var(--app-text-muted); }
    .app-field-single {
        background: var(--app-surface-2);
        border-radius: 0.65rem;
        border: 1px solid rgba(255,255,255,0.06);
        display: flex;
        align-items: center;
    }
    .app-field-single input { flex: 1; padding: 0.85rem; background: transparent; border: none; color: #fff; font-size: 0.85rem; outline: none; }
    .app-btn-primary {
        width: 100%;
        padding: 0.85rem;
        background: var(--app-green);
        color: #111;
        border: none;
        border-radius: 0.65rem;
        font-weight: 800;
        font-size: 0.95rem;
        margin-top: 0.5rem;
    }
    .app-link-row {
        display: flex;
        justify-content: space-between;
        font-size: 0.75rem;
        margin: 0.5rem 0 1rem;
    }
    .app-link-row a { color: var(--app-green); font-weight: 600; }

    /* Wallet modal mobile style */
    .wallet-cash-box {
        background: var(--app-surface-2);
        border-radius: 0.65rem;
        padding: 1rem;
        margin-bottom: 0.65rem;
    }
    .wallet-cash-box label { font-size: 0.7rem; color: var(--app-text-muted); }
    .wallet-cash-amt { font-size: 1.75rem; font-weight: 900; color: var(--app-green); }
    .wallet-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem;
        margin-top: 1rem;
    }
    .wallet-btn-deposit {
        background: var(--app-green);
        color: #111;
        font-weight: 800;
        padding: 0.85rem;
        border-radius: 0.65rem;
        border: none;
        font-size: 0.85rem;
    }
    .wallet-btn-withdraw {
        background: var(--app-yellow);
        color: #111;
        font-weight: 800;
        padding: 0.85rem;
        border-radius: 0.65rem;
        border: none;
        font-size: 0.85rem;
    }

    /* Quest page */
    .app-quest-card {
        background: var(--app-surface);
        border-radius: 0.65rem;
        padding: 0.85rem;
        margin-bottom: 0.65rem;
    }
    .app-quest-progress {
        height: 0.35rem;
        background: rgba(255,255,255,0.08);
        border-radius: 999px;
        overflow: hidden;
        margin: 0.5rem 0;
    }
    .app-quest-progress span {
        display: block;
        height: 100%;
        background: var(--app-green);
        border-radius: 999px;
    }
    .app-quest-claim {
        padding: 0.35rem 0.85rem;
        border-radius: 0.5rem;
        font-size: 0.7rem;
        font-weight: 800;
        border: none;
    }
    .app-quest-claim.active { background: var(--app-green); color: #111; }
    .app-quest-claim.disabled { background: var(--app-surface-2); color: var(--app-text-muted); }

    /* Quest page — modern UI */
    .kx-quest-wrap {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding-bottom: 0.5rem;
    }
    .kx-quest-hero {
        background: linear-gradient(145deg, rgba(118, 225, 118, 0.16), rgba(37, 40, 44, 0.95));
        border: 1px solid rgba(118, 225, 118, 0.22);
        border-radius: 1rem;
        padding: 1rem 0.9rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    }
    .kx-quest-hero-top {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.75rem;
    }
    .kx-quest-hero-tag {
        font-size: 0.62rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--app-green);
        margin: 0 0 0.2rem;
    }
    .kx-quest-hero-title {
        font-size: 1.15rem;
        font-weight: 900;
        margin: 0;
        line-height: 1.2;
    }
    .kx-quest-hero-badge {
        text-align: right;
        background: rgba(0, 0, 0, 0.28);
        border-radius: 0.65rem;
        padding: 0.45rem 0.65rem;
        border: 1px solid rgba(255, 255, 255, 0.08);
        flex-shrink: 0;
    }
    .kx-quest-hero-badge-label {
        display: block;
        font-size: 0.55rem;
        color: var(--app-text-muted);
        font-weight: 700;
        margin-bottom: 0.1rem;
    }
    .kx-quest-hero-badge strong {
        font-size: 1rem;
        color: var(--app-green-bright);
        font-weight: 900;
    }
    .kx-quest-hero-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.45rem;
        margin-top: 0.85rem;
    }
    .kx-quest-hero-stats div {
        background: rgba(0, 0, 0, 0.22);
        border-radius: 0.55rem;
        padding: 0.5rem 0.35rem;
        text-align: center;
    }
    .kx-quest-hero-stats span {
        display: block;
        font-size: 1rem;
        font-weight: 900;
        color: #fff;
        line-height: 1.1;
    }
    .kx-quest-hero-stats small {
        display: block;
        font-size: 0.55rem;
        color: var(--app-text-muted);
        margin-top: 0.15rem;
        font-weight: 600;
    }
    .kx-quest-hero-reset {
        margin: 0.65rem 0 0;
        font-size: 0.62rem;
        color: rgba(255, 255, 255, 0.45);
        font-weight: 600;
    }
    .kx-quest-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.35rem;
        background: var(--app-surface);
        border-radius: 0.75rem;
        padding: 0.35rem;
    }
    .kx-quest-tab {
        border: none;
        background: transparent;
        color: var(--app-text-muted);
        font-size: 0.68rem;
        font-weight: 700;
        border-radius: 0.55rem;
        padding: 0.55rem 0.35rem;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.15rem;
    }
    .kx-quest-tab.active {
        background: linear-gradient(135deg, rgba(118, 225, 118, 0.28), rgba(118, 225, 118, 0.08));
        color: var(--app-green-bright);
        box-shadow: inset 0 0 0 1px rgba(118, 225, 118, 0.25);
    }
    .kx-quest-panel { display: none; flex-direction: column; gap: 0.65rem; }
    .kx-quest-panel.active { display: flex; }
    .kx-quest-card {
        display: flex;
        gap: 0.75rem;
        background: var(--app-surface);
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 0.85rem;
        padding: 0.85rem;
        position: relative;
        overflow: hidden;
    }
    .kx-quest-card--ready {
        border-color: rgba(118, 225, 118, 0.35);
        box-shadow: 0 8px 24px rgba(118, 225, 118, 0.08);
    }
    .kx-quest-card--claimed { opacity: 0.72; }
    .kx-quest-card-icon {
        width: 2.75rem;
        height: 2.75rem;
        border-radius: 0.75rem;
        background: linear-gradient(145deg, rgba(118, 225, 118, 0.18), rgba(255, 255, 255, 0.04));
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.35rem;
        flex-shrink: 0;
    }
    .kx-quest-card-body { flex: 1; min-width: 0; }
    .kx-quest-card-head {
        display: flex;
        justify-content: space-between;
        gap: 0.5rem;
        align-items: flex-start;
    }
    .kx-quest-card-head h3 {
        font-size: 0.85rem;
        font-weight: 800;
        margin: 0;
        line-height: 1.25;
    }
    .kx-quest-card-head p {
        font-size: 0.65rem;
        color: var(--app-text-muted);
        margin: 0.2rem 0 0;
        line-height: 1.35;
    }
    .kx-quest-reward-chip {
        flex-shrink: 0;
        background: rgba(247, 211, 88, 0.15);
        color: var(--app-yellow);
        border: 1px solid rgba(247, 211, 88, 0.35);
        border-radius: 999px;
        padding: 0.2rem 0.5rem;
        font-size: 0.62rem;
        font-weight: 900;
        white-space: nowrap;
    }
    .kx-quest-progress-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 0.65rem;
        font-size: 0.62rem;
        color: var(--app-text-muted);
        font-weight: 600;
    }
    .kx-quest-progress-row strong {
        color: #fff;
        font-size: 0.68rem;
    }
    .kx-quest-progress {
        height: 0.42rem;
        background: rgba(255, 255, 255, 0.07);
        border-radius: 999px;
        overflow: hidden;
        margin-top: 0.35rem;
    }
    .kx-quest-progress span {
        display: block;
        height: 100%;
        border-radius: 999px;
        background: linear-gradient(90deg, var(--app-green), var(--app-green-bright));
        transition: width 0.35s ease;
    }
    .kx-quest-card-foot {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        margin-top: 0.65rem;
    }
    .kx-quest-claim-btn {
        border: none;
        background: var(--app-green);
        color: #111;
        font-size: 0.72rem;
        font-weight: 900;
        border-radius: 999px;
        padding: 0.45rem 0.9rem;
        cursor: pointer;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .kx-quest-claim-btn.ghost {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
    }
    .kx-quest-claim-btn:disabled {
        opacity: 0.65;
        cursor: wait;
    }
    .kx-quest-status-pill {
        font-size: 0.65rem;
        font-weight: 800;
        border-radius: 999px;
        padding: 0.35rem 0.65rem;
    }
    .kx-quest-status-pill.claimed {
        background: rgba(118, 225, 118, 0.15);
        color: var(--app-green);
    }
    .kx-quest-status-pill.progress {
        background: rgba(255, 255, 255, 0.06);
        color: var(--app-text-muted);
    }
    .kx-quest-go-link {
        font-size: 0.68rem;
        font-weight: 800;
        color: var(--app-green);
        text-decoration: none;
    }
    .kx-quest-empty {
        text-align: center;
        color: var(--app-text-muted);
        font-size: 0.78rem;
        padding: 1.5rem 0.75rem;
        background: var(--app-surface);
        border-radius: 0.75rem;
    }

    /* Notifications inbox */
    .kx-notify-page {
        padding-bottom: 1rem;
    }
    .kx-notify-wrap {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    .kx-notify-hero {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 1rem;
        border-radius: 0.85rem;
        background: linear-gradient(145deg, #1f3b5f 0%, #162033 100%);
        border: 1px solid rgba(255, 255, 255, 0.06);
    }
    .kx-notify-hero-tag {
        font-size: 0.62rem;
        font-weight: 700;
        color: #7dd3fc;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }
    .kx-notify-hero-title {
        margin-top: 0.2rem;
        font-size: 1.2rem;
        font-weight: 900;
        line-height: 1.15;
    }
    .kx-notify-hero-badge {
        text-align: right;
        padding: 0.45rem 0.6rem;
        border-radius: 0.65rem;
        background: rgba(125, 211, 252, 0.12);
        border: 1px solid rgba(125, 211, 252, 0.22);
        min-width: 4.5rem;
    }
    .kx-notify-hero-badge span {
        display: block;
        font-size: 0.58rem;
        color: var(--app-text-muted);
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }
    .kx-notify-hero-badge strong {
        display: block;
        margin-top: 0.15rem;
        font-size: 1.1rem;
        color: #7dd3fc;
    }
    .kx-notify-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    .kx-notify-mark-all,
    .kx-notify-enable-push {
        border: none;
        border-radius: 999px;
        padding: 0.42rem 0.8rem;
        font-size: 0.68rem;
        font-weight: 800;
        cursor: pointer;
    }
    .kx-notify-mark-all {
        background: rgba(255, 255, 255, 0.06);
        color: #fff;
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
    .kx-notify-enable-push {
        background: rgba(118, 225, 118, 0.14);
        color: var(--app-green);
        border: 1px solid rgba(118, 225, 118, 0.28);
    }
    .kx-notify-list {
        display: flex;
        flex-direction: column;
        gap: 0.55rem;
    }
    .kx-notify-item {
        display: flex;
        align-items: flex-start;
        gap: 0.65rem;
        padding: 0.8rem;
        border-radius: 0.75rem;
        background: var(--app-surface);
        border: 1px solid rgba(255, 255, 255, 0.05);
        text-decoration: none;
        color: inherit;
        position: relative;
        transition: background 0.15s ease, border-color 0.15s ease;
    }
    .kx-notify-item:not(.is-read) {
        border-color: rgba(118, 225, 118, 0.18);
        background: linear-gradient(145deg, rgba(118, 225, 118, 0.08), rgba(37, 40, 44, 1));
    }
    .kx-notify-item-icon {
        width: 2.1rem;
        height: 2.1rem;
        border-radius: 0.55rem;
        background: rgba(255, 255, 255, 0.06);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    .kx-notify-item-icon .material-symbols-rounded {
        font-size: 1.1rem;
        color: var(--app-green);
    }
    .kx-notify-item-body {
        flex: 1;
        min-width: 0;
    }
    .kx-notify-item-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.5rem;
    }
    .kx-notify-item-head strong {
        font-size: 0.78rem;
        line-height: 1.25;
    }
    .kx-notify-item-head small {
        flex-shrink: 0;
        font-size: 0.58rem;
        color: var(--app-text-muted);
    }
    .kx-notify-item-text {
        display: block;
        margin-top: 0.25rem;
        font-size: 0.68rem;
        color: var(--app-text-muted);
        line-height: 1.35;
    }
    .kx-notify-dot {
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
        width: 0.45rem;
        height: 0.45rem;
        border-radius: 50%;
        background: var(--app-green);
        box-shadow: 0 0 0 3px rgba(118, 225, 118, 0.18);
    }
    .kx-notify-empty {
        text-align: center;
        padding: 2rem 1rem;
        background: var(--app-surface);
        border-radius: 0.75rem;
        color: var(--app-text-muted);
    }
    .kx-notify-empty-icon {
        width: 4.5rem;
        height: 4.5rem;
        margin: 0 auto 0.75rem;
    }
    .kx-notify-empty p {
        font-size: 0.85rem;
        font-weight: 800;
        color: #fff;
    }
    .kx-notify-empty span {
        display: block;
        margin-top: 0.25rem;
        font-size: 0.68rem;
    }
    .kx-quest-wrap--gift .kx-quest-hero {
        background: linear-gradient(145deg, #4c1d95 0%, #312e81 55%, #1f2937 100%);
    }

    /* Referral invitation */
    .app-invite-hero {
        background: linear-gradient(180deg, #1a4020, #0d2818);
        border-radius: 0.75rem;
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    .app-spin-wheel {
        width: 10rem;
        height: 10rem;
        margin: 1rem auto;
        border-radius: 50%;
        overflow: hidden;
        border: 4px solid var(--app-green);
        background: var(--app-surface);
    }
    .app-spin-wheel .lottie-container {
        width: 100%;
        height: 100%;
    }

    body.kx-app .vault-loader { display: none !important; }
    body.kx-app main { min-height: auto; }

@media (min-width: 1024px) {
    body.kx-app {
        background:
            radial-gradient(ellipse 80% 50% at 50% -10%, rgba(118, 225, 118, 0.08), transparent 55%),
            #0c0d10 !important;
        padding-bottom: 0;
    }

    .kx-app-frame {
        max-width: 26.25rem;
        width: 100%;
        margin: 1.25rem auto;
        min-height: calc(100vh - 2.5rem);
        background: var(--app-bg);
        position: relative;
        overflow: hidden;
        isolation: isolate;
        border-radius: 1.25rem;
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.06),
            0 24px 80px rgba(0, 0, 0, 0.55);
        padding-bottom: calc(var(--app-nav-h) + var(--app-safe-bottom) + 0.5rem);
    }

    .kx-desktop-shell-top { display: block !important; }
    .app-dl-bar.kx-desktop-shell-top { display: flex !important; }

    .app-bottom-nav {
        max-width: 26.25rem;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        border-radius: 0 0 1.25rem 1.25rem;
    }

    /* Drawer + overlay stay inside the phone frame (not full viewport) */
    .app-drawer-overlay {
        position: absolute;
        inset: 0;
    }

    .app-drawer {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 88%;
        max-width: none;
        margin-left: 0;
    }

    .kx-tx-detail,
    .kx-profile-avatar-panel {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;
        max-width: none;
        width: 100%;
        transform: translateX(100%);
    }
    .kx-tx-detail.open,
    .kx-profile-avatar-panel.open {
        transform: translateX(0);
    }
}

/* Auth pages — centered mobile column on all viewports */
.app-auth-wrap {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--app-bg);
    display: flex;
    flex-direction: column;
    max-width: 28rem;
    margin: 0 auto;
}
.app-auth-promo {
    position: relative;
    overflow: hidden;
    padding: 0.85rem 1rem 1.4rem;
    background: linear-gradient(155deg, #08160e 0%, #143322 48%, #0d2818 100%);
    border-bottom: 1px solid rgba(118, 225, 118, 0.14);
}
.app-auth-promo-glow {
    position: absolute;
    top: -2.5rem;
    right: -1.5rem;
    width: 11rem;
    height: 11rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 245, 66, 0.2) 0%, transparent 68%);
    pointer-events: none;
}
.app-auth-promo-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
    position: relative;
    z-index: 2;
}
.app-auth-promo-brand {
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.24em;
    color: var(--app-green-bright);
}
.app-auth-promo-top-spacer {
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
}
.app-auth-promo-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 6.75rem;
    gap: 0.65rem;
    align-items: center;
    position: relative;
    z-index: 2;
}
.app-auth-promo-copy {
    min-width: 0;
}
.app-auth-promo-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #111;
    background: linear-gradient(90deg, var(--app-green-bright), var(--app-yellow));
    margin-bottom: 0.5rem;
}
.app-auth-promo-title {
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1.15;
    color: #fff;
    margin: 0 0 0.4rem;
}
.app-auth-promo-sub {
    font-size: 0.74rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.74);
    margin: 0;
}
.app-auth-promo-ref {
    display: inline-flex;
    margin-top: 0.5rem;
    padding: 0.22rem 0.55rem;
    border-radius: 0.4rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--app-green);
    background: rgba(118, 225, 118, 0.1);
    border: 1px solid rgba(118, 225, 118, 0.28);
}
.app-auth-promo-art {
    width: 6.75rem;
    height: 6.75rem;
    border-radius: 50%;
    border: 2px solid rgba(118, 225, 118, 0.35);
    background: rgba(0, 0, 0, 0.22);
    overflow: hidden;
    box-shadow: 0 0 28px rgba(118, 225, 118, 0.16);
    justify-self: end;
}
.app-auth-promo .app-promo-tag {
    font-size: 0.65rem;
    color: var(--app-green);
    font-weight: 600;
}
.app-auth-promo .app-auth-back,
.app-auth-promo .close-x {
    position: static;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.14);
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.app-auth-promo .app-auth-back .material-symbols-rounded,
.app-auth-promo .close-x .material-symbols-rounded {
    font-size: 1.25rem;
    width: 1.25rem;
    height: 1.25rem;
}
.app-auth-promo .app-auth-back:hover,
.app-auth-promo .close-x:hover {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.28);
    transform: translateX(-1px);
}
.app-auth-form {
    flex: 1;
    background: var(--app-surface);
    border-radius: 1.25rem 1.25rem 0 0;
    margin-top: -0.65rem;
    padding: 1.35rem 1rem 2rem;
    box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.38);
    position: relative;
    z-index: 3;
}
.app-auth-form h1 {
    font-size: 1.35rem;
    font-weight: 900;
    margin: 0 0 0.25rem;
    color: #fff;
}
.app-auth-form-head {
    margin-bottom: 1rem;
}
.app-auth-form-head p {
    margin: 0;
    font-size: 0.74rem;
    color: var(--app-text-muted);
    line-height: 1.4;
}
.app-auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    padding: 0.35rem;
    margin-bottom: 1rem;
    border-radius: 0.75rem;
    background: var(--app-surface-2);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.app-auth-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.65rem 0.5rem;
    border: none;
    border-radius: 0.55rem;
    background: transparent;
    color: var(--app-text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.app-auth-tab .material-symbols-rounded {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
}
.app-auth-tab.is-active {
    background: linear-gradient(135deg, rgba(118, 225, 118, 0.22), rgba(200, 245, 66, 0.14));
    color: var(--app-green-bright);
    box-shadow: inset 0 0 0 1px rgba(118, 225, 118, 0.28);
}
.app-auth-alert {
    margin-bottom: 0.85rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.6rem;
    font-size: 0.78rem;
    line-height: 1.35;
}
.app-auth-alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.22);
}
.app-auth-alert-success {
    background: rgba(118, 225, 118, 0.1);
    color: var(--app-green);
    border: 1px solid rgba(118, 225, 118, 0.22);
}
.app-auth-form-body {
    display: block;
}
.app-auth-panel.hidden {
    display: none;
}
.app-field-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}
.app-field { margin-bottom: 0.85rem; }
.app-field-row,
.app-field-single {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.app-field-row:focus-within,
.app-field-single:focus-within {
    border-color: rgba(118, 225, 118, 0.45);
    box-shadow: 0 0 0 3px rgba(118, 225, 118, 0.12);
}
.app-field-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-right: 0.15rem;
    border: none;
    background: transparent;
    color: var(--app-text-muted);
    cursor: pointer;
}
.app-field-icon-btn .material-symbols-rounded {
    font-size: 1.1rem;
    width: 1.1rem;
    height: 1.1rem;
}
.app-otp-send-btn {
    flex-shrink: 0;
    margin-right: 0.35rem;
    padding: 0.45rem 0.7rem;
    border: none;
    border-radius: 0.45rem;
    background: rgba(118, 225, 118, 0.14);
    color: var(--app-green-bright);
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}
.app-otp-send-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.app-otp-status {
    min-height: 1.1rem;
    margin: -0.35rem 0 0.75rem;
    font-size: 0.72rem;
    text-align: center;
    color: var(--app-text-muted);
}
.app-otp-status.is-success { color: var(--app-green); }
.app-otp-status.is-error { color: #fca5a5; }
.app-btn-primary {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--app-green-bright), var(--app-green));
    color: #111;
    border: none;
    border-radius: 0.7rem;
    font-weight: 900;
    font-size: 0.92rem;
    margin-top: 0.25rem;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(118, 225, 118, 0.22);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.app-btn-primary:active {
    transform: scale(0.98);
}
.app-link-row {
    display: flex;
    justify-content: flex-end;
    font-size: 0.74rem;
    margin: -0.15rem 0 0.85rem;
}
.app-link-row a,
.app-auth-muted-link {
    color: var(--app-green);
    font-weight: 600;
    text-decoration: none;
}
.app-auth-footer {
    margin-top: 1.35rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    font-size: 0.8rem;
    color: var(--app-text-muted);
}
.app-auth-footer a {
    color: var(--app-green-bright);
    font-weight: 800;
    text-decoration: none;
    margin-left: 0.25rem;
}
.app-field-row {
    display: flex;
    gap: 0;
    background: var(--app-surface-2);
    border-radius: 0.65rem;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}
.app-field-prefix {
    padding: 0.85rem 0.65rem;
    font-size: 0.85rem;
    color: var(--app-text-muted);
    border-right: 1px solid rgba(255,255,255,0.08);
}
.app-field input {
    flex: 1;
    width: 100%;
    padding: 0.85rem;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
}
.app-field input::placeholder { color: var(--app-text-muted); }
.app-field-single {
    background: var(--app-surface-2);
    border-radius: 0.65rem;
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
}
.app-field-single input {
    flex: 1;
    padding: 0.85rem;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
}
.app-gift-label {
    font-size: 0.7rem;
    color: var(--app-text-muted);
    margin: 1rem 0 0.5rem;
}
.app-gift-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}
.app-gift-card {
    position: relative;
    background: var(--app-surface-2);
    border: 2px solid transparent;
    border-radius: 0.65rem;
    padding: 0.65rem;
    text-align: center;
    cursor: pointer;
}
.app-gift-card.active {
    border-color: #ff9800;
}
.app-gift-card img, .app-gift-card .gift-icon {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 auto 0.35rem;
    font-size: 1.75rem;
}
.app-gift-card p {
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.2;
}
.app-gift-tag {
    position: absolute;
    bottom: 0.35rem;
    right: 0.35rem;
    font-size: 0.55rem;
    font-weight: 800;
    padding: 0.15rem 0.35rem;
    border-radius: 0.25rem;
}
.app-gift-tag.active { background: #ff9800; color: #111; }
.app-gift-tag.apply { background: var(--app-green); color: #111; }
.app-signup-check {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.72rem;
    color: var(--app-text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.45;
    min-height: 2.5rem;
}
.app-signup-check input[type="checkbox"] {
    width: 1.05rem;
    height: 1.05rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
    accent-color: var(--app-green);
    cursor: pointer;
}
.app-signup-check .app-legal-link {
    color: var(--app-green);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.app-signup-check .app-legal-link:hover {
    color: var(--app-green-bright);
}
.app-invite-toggle {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--app-text-muted);
    font-size: 0.75rem;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    cursor: pointer;
}
.app-mobile-draw {
    display: block;
    background: var(--app-surface);
    border-radius: 0.65rem;
    padding: 0.85rem;
    margin-bottom: 0.65rem;
    border: 1px solid rgba(255,255,255,0.06);
}
.app-mobile-draw h4 {
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}
.app-mobile-draw .prize {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--app-green);
    margin-bottom: 0.5rem;
}
.app-mobile-draw .join-btn {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    background: var(--app-green);
    color: #111;
    border-radius: 0.5rem;
    font-size: 0.7rem;
    font-weight: 800;
}
.app-result-card {
    background: var(--app-surface);
    border-radius: 0.65rem;
    padding: 0.85rem;
    margin-bottom: 0.65rem;
    border: 1px solid rgba(255,255,255,0.06);
}
.app-result-card h4 {
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
}
.app-result-digits {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin: 0.5rem 0;
}
.app-result-digits span {
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--app-surface-2);
    border-radius: 0.35rem;
    font-weight: 800;
    font-size: 0.85rem;
}
.app-explore-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}
.app-explore-tile {
    background: var(--app-surface);
    border-radius: 0.65rem;
    padding: 1rem 0.75rem;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.06);
}
.app-explore-tile .icon { font-size: 1.75rem; margin-bottom: 0.35rem; }
.app-explore-tile h4 { font-size: 0.75rem; font-weight: 800; }
.app-explore-tile p { font-size: 0.6rem; color: var(--app-text-muted); margin-top: 0.15rem; }

/* Contest detail page */
.kx-contest-page-wrap {
    --kx-cplay-buy-h: 4.5rem;
    padding-bottom: calc(var(--kx-cplay-buy-h) + 1.25rem + env(safe-area-inset-bottom, 0px));
}
body.kx-app .kx-contest-page-wrap {
    /* Body already clears bottom nav; add buy-bar + pager clearance so tickets aren't covered. */
    padding-bottom: calc(var(--kx-cplay-buy-h) + 1.75rem + env(safe-area-inset-bottom, 0px));
}
.kx-contest-page {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.kx-cplay-scroll-pad {
    height: calc(var(--kx-cplay-buy-h) + 0.75rem);
    flex-shrink: 0;
    pointer-events: none;
}

/* —— Play page (clean contest UX) —— */
.kx-cplay-hero {
    display: grid;
    grid-template-columns: 7.25rem 1fr;
    gap: 0.85rem;
    align-items: start;
    position: relative;
    padding-top: 0.15rem;
}
.kx-cplay-back {
    position: absolute;
    top: -0.15rem;
    left: 0;
    z-index: 3;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
}
.kx-cplay-back-icon {
    font-size: 1.1rem !important;
}
.kx-cplay-cover {
    width: 7.25rem;
    aspect-ratio: 1 / 1;
    border-radius: 1rem;
    overflow: hidden;
    background: var(--app-surface);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    margin-top: 1.85rem;
}
.kx-cplay-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.kx-cplay-cover-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #1f6b3d, #0d1f14);
    color: var(--app-green-bright);
}
.kx-cplay-cover-fallback .material-symbols-outlined {
    font-size: 2.2rem;
}
.kx-cplay-intro {
    min-width: 0;
    padding-top: 1.85rem;
}
.kx-cplay-intro-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.kx-cplay-cat {
    margin: 0;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(200, 245, 66, 0.75);
}
.kx-cplay-status {
    flex-shrink: 0;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.22rem 0.45rem;
    border-radius: 999px;
    background: rgba(118, 225, 118, 0.14);
    color: var(--app-green-bright);
    border: 1px solid rgba(118, 225, 118, 0.28);
}
.kx-cplay-title {
    margin: 0 0 0.65rem;
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1.2;
    color: #fff;
    letter-spacing: -0.02em;
}
.kx-cplay-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    margin-bottom: 0.7rem;
}
.kx-cplay-metric {
    min-width: 0;
}
.kx-cplay-metric span {
    display: block;
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--app-text-muted);
    margin-bottom: 0.12rem;
}
.kx-cplay-metric strong {
    display: block;
    font-size: 0.78rem;
    font-weight: 900;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kx-cplay-fill-track {
    height: 0.38rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.kx-cplay-fill-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #76e176, #c8f542);
    transition: width 0.35s ease;
}
.kx-cplay-fill-meta {
    margin: 0.35rem 0 0;
    font-size: 0.62rem;
    color: var(--app-text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}
.kx-cplay-fill-meta strong {
    color: #fff;
    font-weight: 800;
}

.kx-cplay-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem;
    padding: 0.28rem;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.kx-cplay-tab {
    border: none;
    background: transparent;
    color: var(--app-text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    border-radius: 0.7rem;
    padding: 0.68rem 0.5rem;
    cursor: pointer;
}
.kx-cplay-tab.active {
    background: var(--app-surface);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.kx-contest-panel {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
}
.kx-contest-panel.active {
    display: flex;
}

.kx-cplay-block {
    background: var(--app-surface);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    padding: 0.95rem 1rem;
}
.kx-cplay-block h2 {
    margin: 0 0 0.75rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--app-text-muted);
}
.kx-cplay-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    position: relative;
}
.kx-cplay-timeline::before {
    content: '';
    position: absolute;
    left: 0.35rem;
    top: 0.35rem;
    bottom: 0.35rem;
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
}
.kx-cplay-timeline li {
    display: grid;
    grid-template-columns: 0.75rem 1fr;
    gap: 0.7rem;
    align-items: start;
}
.kx-cplay-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.45);
    margin-top: 0.15rem;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}
.kx-cplay-timeline li.is-done .kx-cplay-dot {
    background: rgba(148, 163, 184, 0.55);
    border-color: rgba(148, 163, 184, 0.65);
    box-shadow: none;
}
.kx-cplay-timeline li.is-current .kx-cplay-dot {
    background: var(--app-green-bright);
    border-color: var(--app-green-bright);
    box-shadow: 0 0 0 3px rgba(200, 245, 66, 0.18);
}
.kx-cplay-timeline li.is-upcoming .kx-cplay-dot {
    background: transparent;
    border-color: rgba(148, 163, 184, 0.45);
}
.kx-cplay-timeline em {
    display: block;
    font-style: normal;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--app-text-muted);
    margin-bottom: 0.12rem;
}
.kx-cplay-timeline strong {
    font-size: 0.82rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.72);
}
.kx-cplay-timeline li.is-done strong {
    color: rgba(255, 255, 255, 0.55);
}
.kx-cplay-timeline li.is-current em {
    color: var(--app-green-bright);
}
.kx-cplay-timeline li.is-current strong {
    color: #fff;
}
.kx-cplay-timeline li.is-upcoming strong {
    color: rgba(255, 255, 255, 0.45);
}
.kx-cplay-equal-prize {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.85rem 0.95rem;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, rgba(118, 225, 118, 0.12), rgba(200, 245, 66, 0.05));
    border: 1px solid rgba(118, 225, 118, 0.22);
}
.kx-cplay-equal-prize strong {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--app-green-bright);
    letter-spacing: -0.02em;
}
.kx-cplay-equal-prize span {
    font-size: 0.72rem;
    color: var(--app-text-muted);
}
.kx-cplay-prize-list,
.kx-cplay-winner-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.kx-cplay-prize-list li,
.kx-cplay-winner-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.78rem;
}
.kx-cplay-prize-list li:last-child,
.kx-cplay-winner-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.kx-cplay-prize-list span {
    color: var(--app-text-muted);
}
.kx-cplay-winner-list li > div {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.kx-cplay-winner-list li span {
    font-size: 0.62rem;
    color: var(--app-text-muted);
}
.kx-cplay-winner-list em {
    font-style: normal;
    font-weight: 900;
    color: var(--app-green-bright);
}
.kx-cplay-muted {
    margin: 0;
    font-size: 0.74rem;
    color: var(--app-text-muted);
}
.kx-cplay-empty[hidden],
.kx-cplay-empty.hidden {
    display: none !important;
}

.kx-cplay-tickets {
    background: var(--app-surface);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    padding: 0.85rem;
    gap: 0.65rem;
}
.kx-cplay-wallet {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border-radius: 0.75rem;
    background: rgba(118, 225, 118, 0.08);
    border: 1px solid rgba(118, 225, 118, 0.18);
    font-size: 0.72rem;
    color: var(--app-text-muted);
}
.kx-cplay-wallet strong {
    color: var(--app-green-bright);
    font-weight: 900;
}
.kx-cplay-mine {
    padding: 0.55rem 0.7rem;
    border-radius: 0.75rem;
    background: rgba(125, 211, 252, 0.08);
    border: 1px solid rgba(125, 211, 252, 0.18);
}
.kx-cplay-mine p {
    margin: 0 0 0.35rem;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--app-text-muted);
}
.kx-cplay-mine-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.kx-cplay-mine-list span {
    padding: 0.2rem 0.45rem;
    border-radius: 0.4rem;
    background: rgba(125, 211, 252, 0.16);
    color: #bae6fd;
    font-size: 0.68rem;
    font-weight: 800;
}
.kx-cplay-hint {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--app-text-muted);
    text-align: center;
}
.kx-cplay-hint strong {
    color: var(--app-green-bright);
}
.kx-cplay-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.kx-cplay-search {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    background: var(--app-bg);
    color: #fff;
    font-size: 0.78rem;
    padding: 0.65rem 0.8rem;
    outline: none;
}
.kx-cplay-search:focus {
    border-color: rgba(200, 245, 66, 0.45);
}
.kx-cplay-legend {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}
.kx-cplay-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--app-text-muted);
}
.kx-cplay-legend span::before {
    content: '';
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 0.18rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.kx-cplay-legend .is-open::before {
    background: rgba(134, 239, 172, 0.28);
    border-color: rgba(134, 239, 172, 0.55);
}
.kx-cplay-legend .is-sold::before {
    background: rgba(248, 113, 113, 0.25);
    border-color: rgba(248, 113, 113, 0.45);
}
.kx-cplay-legend .is-mine::before {
    background: rgba(125, 211, 252, 0.28);
    border-color: rgba(125, 211, 252, 0.5);
}
.kx-cplay-grid-wrap {
    overflow: hidden;
}
.kx-contest-ticket-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.35rem;
    min-height: 12rem;
}
.kx-contest-ticket-chip {
    border: 1px solid rgba(134, 239, 172, 0.35);
    border-radius: 0.55rem;
    background: rgba(134, 239, 172, 0.1);
    color: #ecfdf5;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    padding: 0.55rem 0.2rem;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
    min-height: 2.15rem;
}
.kx-contest-ticket-chip.is-sold {
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(127, 29, 29, 0.35);
    color: rgba(254, 202, 202, 0.55);
    text-decoration: line-through;
    cursor: not-allowed;
}
.kx-contest-ticket-chip.is-mine {
    border-color: rgba(125, 211, 252, 0.55);
    background: rgba(12, 74, 110, 0.45);
    color: #bae6fd;
    cursor: default;
}
.kx-contest-ticket-chip.is-locked {
    border-color: rgba(148, 163, 184, 0.2);
    background: rgba(30, 41, 59, 0.35);
    color: rgba(148, 163, 184, 0.45);
    cursor: not-allowed;
    opacity: 0.65;
}
.kx-contest-ticket-chip.is-selected {
    border-color: rgba(200, 245, 66, 0.9);
    background: rgba(200, 245, 66, 0.22);
    color: #ecfccb;
    box-shadow: 0 0 0 1px rgba(200, 245, 66, 0.4), 0 6px 16px rgba(200, 245, 66, 0.12);
    transform: translateY(-1px);
}
.kx-contest-ticket-chip.is-empty {
    visibility: hidden;
    pointer-events: none;
    border: none;
    background: transparent;
}
.kx-contest-ticket-chip:active:not(:disabled):not(.is-empty) {
    transform: scale(0.97);
}
.kx-cplay-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}
.kx-cplay-page-btn {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--app-bg);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.kx-cplay-page-btn .material-symbols-outlined {
    font-size: 1.25rem;
}
.kx-cplay-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.kx-cplay-page-info {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--app-text-muted);
    min-width: 6.5rem;
    text-align: center;
}

.kx-contest-buy-bar.kx-cplay-buy {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--app-nav-h, 4.25rem) + env(safe-area-inset-bottom, 0px));
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: var(--kx-cplay-buy-h, 4.5rem);
    padding: 0.75rem 0.95rem;
    background: rgba(12, 16, 14, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
    box-sizing: border-box;
}
.kx-contest-buy-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.kx-contest-buy-label {
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--app-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
#kxContestSelectedTicket {
    font-size: 0.92rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    color: var(--app-green-bright);
}
.kx-cplay-buy-btn {
    flex-shrink: 0;
    min-width: 8.5rem;
    justify-content: center;
}

@media (min-width: 420px) {
    .kx-cplay-hero {
        grid-template-columns: 8.5rem 1fr;
    }
    .kx-cplay-cover {
        width: 8.5rem;
    }
    .kx-contest-ticket-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
@media (min-width: 640px) {
    .kx-contest-buy-bar.kx-cplay-buy {
        max-width: 40rem;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 0.95rem 0.95rem 0 0;
    }
    .kx-contest-ticket-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }
}

/* Legacy class hooks kept for JS compatibility */
.kx-contest-ticket-summary,
.kx-contest-ticket-legend,
.kx-contest-ticket-toolbar,
.kx-contest-pagination,
.kx-contest-hero,
.kx-contest-tabs,
.kx-contest-card {
    /* superseded by kx-cplay-* */
}
