* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;

    min-height: 100vh;
}


body {
    background: radial-gradient(circle at 20% 30%, #1a0c0c 0%, #0a0505 100%);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 10px;

    position: relative;
}

.xlgame-bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

.xlgame-card {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(145deg, #1f1a1a 0%, #120d0d 100%);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 215, 0, 0.2);
}

.xlgame-header {
    padding: 20px 16px;
    text-align: center;
    background: linear-gradient(135deg, #000000 0%, #2a1a1a 100%);
    color: #ffd966;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    border-bottom: 2px solid #d4af37;
}

.xlgame-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ffcc00, #ff6600, #ffcc00, transparent);
    animation: xlgame-shimmer 2s infinite;
}

@keyframes xlgame-shimmer {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.xlgame-logo {
    font-size: 52px;
    font-weight: 900;
    letter-spacing: -2px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    animation: xlgame-logo-bounce 2.2s ease-in-out infinite;
}

.xlgame-logo a {
    text-decoration: none;
    display: inline-block;
}

.xlgame-logo span:first-child {
    color: #FF9800;
    text-shadow: 0 0 8px rgba(255, 77, 77, 0.6);
}

.xlgame-logo span:last-child {
    color: #ffcc00;
    text-shadow: 0 0 12px rgba(255, 204, 0, 0.8);
}

@keyframes xlgame-logo-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.xlgame-subtitle {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #e6b422;
    text-shadow: 0 1px 2px black;
}

.xlgame-game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 14px;
    gap: 12px;
}

.xlgame-grid-wrap {
    padding: 14px;
    border: 2px dashed rgba(212, 175, 55, 0.5);
    border-radius: 28px;
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.xlgame-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.xlgame-num {
    aspect-ratio: 1;
    border: none;
    border-radius: 24px;
    font-size: 26px;
    font-weight: 900;
    color: #ffd966;
    cursor: pointer;
    background: linear-gradient(145deg, #2c1e1e, #1a1010);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 215, 0, 0.2);
    transition: all 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    position: relative;
    overflow: hidden;
    text-shadow: 0 2px 3px black;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: xlgame-gentleFloat 2.2s infinite ease-in-out;
    animation-delay: calc(var(--xlgame-delay, 0) * 0.1s);
    border: 1px solid rgba(212, 175, 55, 0.4);
}

.xlgame-num:nth-child(1) {
    --xlgame-delay: 0;
}

.xlgame-num:nth-child(2) {
    --xlgame-delay: 1;
}

.xlgame-num:nth-child(3) {
    --xlgame-delay: 2;
}

.xlgame-num:nth-child(4) {
    --xlgame-delay: 3;
}

.xlgame-num:nth-child(5) {
    --xlgame-delay: 4;
}

.xlgame-num:nth-child(6) {
    --xlgame-delay: 5;
}

.xlgame-num:nth-child(7) {
    --xlgame-delay: 6;
}

.xlgame-num:nth-child(8) {
    --xlgame-delay: 7;
}

.xlgame-num:nth-child(9) {
    --xlgame-delay: 8;
}

@keyframes xlgame-gentleFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-4px);
    }
}

.xlgame-num::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255, 200, 50, 0.15), transparent);
    border-radius: 24px;
    pointer-events: none;
}

.xlgame-num:active {
    transform: scale(0.94);
    animation: none;
}

.xlgame-num.xlgame-active {
    background: linear-gradient(145deg, #e6a017, #c47d0a);
    color: #1a0c0c;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    transform: scale(1.08);
    box-shadow: 0 0 28px rgba(255, 200, 0, 0.7), inset 0 1px 2px rgba(255, 255, 200, 0.6);
    border-color: #ffcc44;
    animation: xlgame-activePulse 0.6s infinite alternate, xlgame-gentleFloat 1.5s infinite ease-in-out;
}

@keyframes xlgame-activePulse {
    0% {
        box-shadow: 0 0 12px rgba(255, 200, 0, 0.6);
        transform: scale(1.06);
        background: linear-gradient(145deg, #e6a017, #c47d0a);
    }

    100% {
        box-shadow: 0 0 32px rgba(255, 180, 0, 0.9);
        transform: scale(1.1);
        background: linear-gradient(145deg, #ffb82e, #e69500);
    }
}

.xlgame-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    flex-shrink: 0;
}

.xlgame-box {
    padding: 16px 12px;
    border-radius: 22px;
    text-align: center;
    background: linear-gradient(135deg, #2a1a1a, #1f1212);
    color: #ffd966;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
    border: 1px solid #b8860b;
    transition: all 0.2s;
    animation: xlgame-boxBreathing 2.5s infinite ease-in-out;
}

@keyframes xlgame-boxBreathing {

    0%,
    100% {
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
        transform: scale(1);
        border-color: #b8860b;
    }

    50% {
        box-shadow: 0 12px 28px rgba(212, 175, 55, 0.3);
        transform: scale(1.01);
        border-color: #ffcc44;
    }
}

.xlgame-box .xlgame-title {
    font-size: 13px;
    font-weight: 700;
    opacity: 0.9;
    color: #e6b422;
}

.xlgame-box .xlgame-value {
    margin-top: 6px;
    font-size: 36px;
    font-weight: 900;
    color: #ff4d4d;
    text-shadow: 0 0 6px rgba(255, 77, 77, 0.4);
}

.xlgame-target {
    color: #ffcc00 !important;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.6) !important;
}

.xlgame-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    flex-shrink: 0;
}

.xlgame-btn {
    height: 56px;
    border: none;
    border-radius: 28px;
    font-size: 16px;
    font-weight: 800;
    color: #1a0c0c;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    animation: xlgame-btnFloat 2s infinite ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

@keyframes xlgame-btnFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-3px);
    }
}

.xlgame-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.25);
    transition: left 0.4s;
}

.xlgame-btn:active::before {
    left: 100%;
}

.xlgame-clear {
    background: linear-gradient(135deg, #b52e2e, #8b1a1a);
    color: #ffd966;
    border-bottom: 2px solid #ffcc00;
}

.xlgame-new {
    background: linear-gradient(135deg, #FFEB3B, #ffe9b2);
    color: #000000;
    border-bottom: 2px solid #ff4d4d;
}


.xlgame-message {
    margin: 0;
    padding: 14px;
    border-radius: 40px;
    background: linear-gradient(135deg, #2b0000, #150000);
    border: 2px solid #ffcc44;
    text-align: center;
    font-size: 16px;
    font-weight: 900;
    color: #ffcc00;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;

    animation: xlgame-advPulse 0.8s infinite ease-in-out alternate;
}

@keyframes xlgame-advPulse {
    0% {
        border-color: #ffcc00;
        color: #ffcc00;
        transform: scale(0.96);
        box-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
        text-shadow: 0 0 4px rgba(255, 204, 0, 0.5);
    }

    100% {
        border-color: #ff3333;
        color: #fff;
        transform: scale(1.04);
        box-shadow: 0 0 25px rgba(255, 51, 51, 0.8);
        text-shadow: 0 0 12px rgba(255, 255, 255, 0.9), 0 0 20px #ff3333;
        background: linear-gradient(135deg, #400000, #200000);
    }
}


.xlgame-win {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: xlgame-fadeIn 0.3s ease-out;
    backdrop-filter: blur(8px);
    padding: 20px;
}

.xlgame-win.show {
    display: flex;
}

.xlgame-winbox {
    background: linear-gradient(135deg, #2a1a1a, #0f0909);
    padding: 40px 25px;
    border-radius: 35px;
    text-align: center;
    box-shadow: 0 0 40px rgba(255, 77, 77, 0.4), 0 20px 40px black;
    animation: xlgame-popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid #ffcc00;
    width: 100%;
    max-width: 360px;
}

@keyframes xlgame-popIn {
    0% {
        transform: scale(0.2) rotateZ(-10deg);
        opacity: 0;
    }

    60% {
        transform: scale(1.1) rotateZ(2deg);
    }

    100% {
        transform: scale(1) rotateZ(0);
        opacity: 1;
    }
}

.xlgame-jackpot {
    font-size: 56px;
    font-weight: 900;
    background: linear-gradient(135deg, #ff4d4d, #ffaa00);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: xlgame-pulse 0.5s ease-in-out infinite;
}

@keyframes xlgame-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.xlgame-winbox h2 {
    color: #ffcc66;
    margin-top: 10px;
    margin-bottom: 25px;
    font-size: 22px;
    font-weight: 900;
    text-shadow: 0 2px 5px black;
}


.xlgame-win-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.xlgame-win-btn {
    width: 100%;
    height: 52px;
    text-decoration: none;
}

.xlgame-btn-claim {
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    color: #000;
    box-shadow: 0 0 15px rgba(255, 153, 0, 0.6);
    border-bottom: 3px solid #cc6600;
}

.xlgame-btn-claim:hover {
    background: linear-gradient(135deg, #ffee33, #ffaa00);
    box-shadow: 0 0 25px rgba(255, 153, 0, 0.9);
}

.xlgame-btn-replay {
    background: linear-gradient(135deg, #444, #222);
    color: #ffd966;
    border: 1px solid #ffcc00;
    border-bottom: 3px solid #111;
}

.xlgame-effect-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1999;
}


@media (max-width: 480px) {
    body {
        padding: 10px 6px;
    }

    .xlgame-card {
        border-radius: 16px;
    }

    .xlgame-header {
        padding: 14px 10px;
    }

    .xlgame-logo {
        font-size: 44px;
    }

    .xlgame-subtitle {
        font-size: 12px;
    }

    .xlgame-game-area {
        padding: 10px;
        gap: 10px;
    }

    .xlgame-grid-wrap {
        padding: 10px;
        border-radius: 20px;
    }

    .xlgame-grid {
        gap: 10px;
    }

    .xlgame-num {
        font-size: 22px;
        border-radius: 18px;
    }

    .xlgame-box {
        padding: 12px 8px;
        border-radius: 16px;
    }

    .xlgame-box .xlgame-value {
        font-size: 30px;
    }

    .xlgame-btn {
        height: 50px;
        font-size: 15px;
        border-radius: 25px;
    }

    .xlgame-message {
        font-size: 14px;
        padding: 12px;
    }

    .xlgame-winbox {
        padding: 30px 20px;
        border-radius: 25px;
    }

    .xlgame-jackpot {
        font-size: 48px;
    }

    .xlgame-winbox h2 {
        font-size: 15px;
    }
}

#xlgame-bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1999999999999;
    display: block;
    background: transparent;
}