* {
    box-sizing: border-box;
    user-select: none;
    -webkit-touch-callout: none;
    font-family: 'Microsoft YaHei', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background: #1a1a2e;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    height: 100vh;
    max-height: 800px;
    background-color: #4CAF50;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: rgba(0,0,0,0.3);
}

.stats {
    display: flex;
    gap: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    padding: 5px 10px;
    font-size: 13px;
}

.stat-value {
    font-weight: bold;
    color: #d32f2f;
}

.stat-unit {
    color: #999;
    font-size: 11px;
}

.progress-container {
    position: absolute;
    top: 55px;
    left: 10px;
    right: 10px;
    height: 6px;
    background: rgba(0,0,0,0.3);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: #4CAF50;
    border-radius: 3px;
}

.leaderboard {
    position: absolute;
    top: 75px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    padding: 8px 10px;
    min-width: 130px;
    font-size: 11px;
}

.leaderboard h3 {
    margin: 0 0 5px 0;
    font-size: 11px;
    color: #FFD700;
    font-weight: normal;
}

#topRecord {
    margin: 0 0 5px 0;
    color: #fff;
    font-size: 11px;
}

.leaderboard-list {
    max-height: 100px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    color: #ccc;
    font-size: 10px;
}

.leaderboard-rank {
    color: #FFD700;
    margin-right: 5px;
}

.leaderboard-name {
    flex: 1;
}

.leaderboard-dist {
    color: #4CAF50;
}

.controls-hint {
    position: absolute;
    bottom: 15px;
    width: 100%;
    text-align: center;
}

.hint-box {
    display: inline-block;
    background: rgba(0,0,0,0.5);
    padding: 6px 12px;
    color: #fff;
    font-size: 11px;
}

#victoryScreen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    width: 80%;
    border-radius: 4px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    pointer-events: auto;
}

.hidden {
    display: none !important;
}

.victory-header {
    background: #d32f2f;
    padding: 12px 10px;
    position: relative;
}

.victory-header h1 {
    margin: 0;
    font-size: 16px;
    color: #fff;
    padding-right: 30px;
}

.victory-stats {
    padding: 12px;
}

.victory-stats > p {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 12px;
}

.final-result {
    background: #1a1a2e;
    padding: 12px;
}

.result-value {
    font-size: 32px;
    font-weight: bold;
    color: #4CAF50;
}

.result-unit {
    color: #4CAF50;
}

.result-time {
    font-size: 11px;
    color: #888;
}

.victory-form {
    padding: 0 12px 15px;
}

input {
    width: 100%;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

.button-group {
    display: flex;
    gap: 8px;
}

button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 3px;
    font-size: 13px;
    cursor: pointer;
}

.btn-primary {
    background: #4CAF50;
    color: #fff;
}

.btn-secondary {
    background: #eee;
    color: #666;
}

.close-x {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 3px;
    font-size: 16px;
    color: #fff;
    cursor: pointer;
    pointer-events: auto;
}

.music-player {
    position: absolute;
    bottom: 60px;
    right: 10px;
    pointer-events: auto;
    z-index: 100;
}

.player-btn {
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.8);
    border: none;
    border-radius: 3px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

/* 电脑端适配 */
@media (min-width: 500px) {
    body {
        padding: 0;
        background: #0a0a15;
    }

    #game-container {
        max-width: none;
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }
}
