* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#gameCanvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    cursor: none;
}

/* 菜单样式 */
.menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.menu-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    max-width: 500px;
}

.menu-content h1 {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

#playerName {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border: 2px solid #ddd;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

#playerName:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    width: 100%;
    padding: 15px;
    font-size: 20px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: scale(1.05);
}

.btn-primary:active {
    transform: scale(0.95);
}

.instructions {
    margin-top: 30px;
    text-align: left;
    background: #f5f5f5;
    padding: 20px;
    border-radius: 10px;
}

.instructions h3 {
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
}

.instructions p {
    margin: 8px 0;
    color: #555;
    font-size: 16px;
}

/* 游戏UI */
.game-ui {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.game-ui > * {
    pointer-events: auto;
}

.hidden {
    display: none !important;
}

.top-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-info, .level-info {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.player-info {
    display: flex;
    gap: 20px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.level-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#levelDisplay {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
}

.exp-bar {
    width: 200px;
    height: 20px;
    background: #ddd;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #667eea;
}

.exp-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 0%;
}

/* 排行榜 */
.leaderboard {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 200px;
}

.leaderboard h3 {
    color: #667eea;
    margin-bottom: 10px;
    text-align: center;
    font-size: 16px;
}

#leaderboardList {
    font-size: 14px;
    color: #333;
}

#leaderboardList div {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

#leaderboardList div:last-child {
    border-bottom: none;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
}

.leaderboard-rank {
    font-weight: bold;
    color: #667eea;
}

/* 游戏结束 */
.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
    min-width: 350px;
}

.game-over h2 {
    color: #667eea;
    font-size: 36px;
    margin-bottom: 20px;
}

.game-over p {
    font-size: 20px;
    color: #333;
    margin: 10px 0;
}

#restartBtn {
    margin-top: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .exp-bar {
        width: 150px;
    }

    .leaderboard {
        top: auto;
        bottom: 20px;
        right: 20px;
    }
}
