* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.screen {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    justify-content: center;
    align-items: center;
}

.screen.active {
    display: flex;
}

/* 登录界面 */
.login-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    min-width: 300px;
}

.login-container h1 {
    color: #667eea;
    margin-bottom: 30px;
}

.login-container input {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.login-container input:focus {
    outline: none;
    border-color: #667eea;
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-bottom: 10px;
    min-height: 20px;
}

.login-container button {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-container button:hover {
    background: #5568d3;
}

/* 皮肤选择界面 */
.skin-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    min-width: 400px;
}

.skin-container h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.skin-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.skin-item {
    padding: 20px;
    border: 3px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.skin-item:hover {
    transform: scale(1.05);
}

.skin-item.selected {
    border-color: #667eea;
    background: #f0f4ff;
}

.skin-item .skin-preview {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
    border-radius: 50%;
}

.skin-item .skin-name {
    font-size: 14px;
    color: #333;
}

/* 游戏界面 */
#game-screen {
    background: #000;
}

#game-canvas {
    display: block;
    background: #1a1a1a;
}

#game-ui {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 18px;
}

#score-display, #length-display {
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
}

#leaderboard {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    min-width: 200px;
}

#leaderboard h3 {
    margin-bottom: 10px;
    font-size: 16px;
}

#leaderboard-list {
    list-style-position: inside;
    font-size: 14px;
}

#leaderboard-list li {
    margin-bottom: 5px;
}

#network-status {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border-radius: 5px;
}

#network-status.hidden {
    display: none;
}

/* 游戏结束界面 */
.gameover-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    min-width: 300px;
}

.gameover-container h2 {
    color: #e74c3c;
    margin-bottom: 20px;
}

#final-score, #final-rank {
    font-size: 20px;
    margin-bottom: 15px;
    color: #333;
}

#final-score span, #final-rank span {
    font-weight: bold;
    color: #667eea;
}

.hidden {
    display: none !important;
}
