* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    font-family: "Microsoft Yahei", sans-serif;
}

body {
    min-height: 100vh;
    background: radial-gradient(circle at 30% 20%, #0a1033, #000000);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px;
    color: #fff;
}

.game-container {
    position: relative;
    width: 100%;
    height: 100%;
    background-image: url("/static/imgs/game/star-bg-ec9e3d4409984dffad0aca35ce397440.jpg");
    background-size: cover;
}

.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, #050a20, #000);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    gap: 24px;
    padding: 20px;
}

.start-screen.hide {
    display: none;
}

.title {
    font-size: 42px;
    background: linear-gradient(90deg, #0ff, #fc0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 20px rgba(0, 200, 255, 0.5);
    text-align: center;
}

.desc {
    font-size: 16px;
    color: #aaf;
    line-height: 1.6;
    max-width: 520px;
}

.btn-start {
    padding: 14px 36px;
    background: linear-gradient(135deg, #00ccff, #0066ff);
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 150, 255, 0.5);
    transition: all 0.2s;
}

.btn-start:hover {
    transform: scale(1.05);
}

.btn-start:active {
    transform: scale(0.98);
}

.game-wrap {
    top: 78px;
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
}

.top-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(0, 30, 80, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid #2af;
}

.stat-item {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffec8b;
    text-shadow: 0 0 6px #0ff;
}

#gameCanvas {
    width: 100%;
    aspect-ratio: 10 / 7;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 180, 255, 0.3), 0 10px 40px rgba(0, 0, 0, 0.7);
    background: #020520;
    display: block;
}

.tip-text {
    font-size: 2rem;
    color: #aaffff;
    padding: 6px 16px;
    background: rgba(0, 50, 120, 0.4);
    border-radius: 30px;
    text-align: center;
}

.btn-reset, .btn-pause {
    padding: 8px 22px;
    border: none;
    border-radius: 30px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset {
    background: linear-gradient(135deg, #ff5577, #cc2244);
    box-shadow: 0 3px 10px rgba(255, 80, 100, 0.4);
}

.btn-pause {
    background: linear-gradient(135deg, #ffcc00, #ff9500);
    box-shadow: 0 3px 10px rgba(255, 204, 0, 0.4);
}

.btn-reset:active, .btn-pause:active {
    transform: scale(0.96);
}

.pause-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    z-index: 100;
}

.pause-modal.show {
    display: flex;
}

.pause-text {
    font-size: 36px;
    color: #ffc800;
    text-shadow: 0 0 20px #f90;
    font-weight: bold;
    text-align: center;
}

.level-up-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(135deg, #ffcc00, #ff6600);
    color: #000;
    padding: 30px 50px;
    border-radius: 20px;
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 165, 0, 1);
    z-index: 999;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.level-up-modal.show {
    transform: translate(-50%, -50%) scale(1);
}

@media (max-width: 768px) {
    .stat-item {
        font-size: 0.85rem;
    }

    .tip-text {
        font-size: 0.8rem;
    }

    .top-bar {
        padding: 8px 12px;
    }

    .level-up-modal {
        font-size: 18px;
        padding: 20px 30px;
    }

    .title {
        font-size: 28px;
    }

    .pause-text {
        font-size: 26px;
    }
}
