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

/* 隐藏 iPad Safari 全屏顶部横条提示 */
::-webkit-full-screen-top-bar {
    display: none !important;
}

/* 全屏时隐藏顶部提示区域 */
.game-container.fullscreen-mode {
    padding-top: 0 !important;
}

/* 尝试隐藏 iPad 全屏时的滑动手势提示 */
@supports (-webkit-touch-callout: none) {
    .game-container.fullscreen-mode::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 20px;
        background: transparent;
        z-index: 9999;
        pointer-events: none;
    }
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

body.fullscreen-body {
    padding: 0;
}

.game-container {
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 25px;
    max-width: 900px;
    width: 100%;
}

/* 全屏模式 */
.game-container.fullscreen-mode {
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    background: transparent !important;
    box-shadow: none;
}

.game-container.fullscreen-mode.webkit {
    height: -webkit-fill-available;
}

.game-container.fullscreen-mode .game-header {
    margin-bottom: 3px;
}

.game-container.fullscreen-mode .game-header h1 {
    font-size: 18px;
    margin-bottom: 2px;
}

.game-container.fullscreen-mode .help-link {
    display: none;
}

.game-container.fullscreen-mode .player-info {
    margin-top: 2px;
}

.game-container.fullscreen-mode .player-info input {
    padding: 2px;
    width: 80px;
    font-size: 12px;
}

.game-container.fullscreen-mode .game-controls {
    margin-bottom: 3px;
    flex-wrap: wrap;
    justify-content: center;
}

.game-container.fullscreen-mode .game-controls button {
    padding: 4px 10px;
    font-size: 12px;
}

.game-container.fullscreen-mode .game-settings {
    margin-bottom: 3px;
    flex-wrap: wrap;
    justify-content: center;
}

.game-container.fullscreen-mode .setting-item {
    gap: 5px;
}

.game-container.fullscreen-mode .setting-item label {
    font-size: 12px;
}

.game-container.fullscreen-mode .setting-item input[type="number"] {
    width: 50px;
    padding: 2px;
}

.game-container.fullscreen-mode .setting-item input[type="range"] {
    width: 60px;
}

.game-container.fullscreen-mode .game-canvas-container {
    margin-bottom: 3px;
}

.game-container.fullscreen-mode #game-canvas {
    max-height: 85vh;
    width: auto;
    pointer-events: auto;
}

.game-container.fullscreen-mode .game-stats {
    margin-bottom: 3px;
    position: fixed;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.85);
    padding: 4px 15px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 150;
    max-width: 90%;
}

.game-container.fullscreen-mode .stat-item {
    padding: 2px 10px;
    min-width: 50px;
    font-size: 12px;
}

/* 全屏模式：隐藏不需要的元素 */
.game-container.fullscreen-mode .game-header,
.game-container.fullscreen-mode .player-info,
.game-container.fullscreen-mode .game-settings,
.game-container.fullscreen-mode .records-container {
    display: none !important;
}

/* 全屏模式：只显示功能按钮和信息按钮区域 */
.game-container.fullscreen-mode .game-controls {
    display: flex !important;
    position: fixed;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    background: rgba(255,255,255,0.85);
    padding: 3px 10px;
    border-radius: 8px;
    pointer-events: auto;
    max-width: 95%;
}

.game-container.fullscreen-mode .game-controls button {
    padding: 3px 8px;
    font-size: 11px;
    min-width: auto;
}

/* 全屏模式：画布容器全屏显示 */
.game-container.fullscreen-mode .game-canvas-container {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    justify-content: center;
    align-items: center;
    z-index: 1;
    pointer-events: auto;
    margin: 0;
    padding: 0;
}

.game-container.fullscreen-mode #game-canvas {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
}

/* 虚拟控制键提示 */
.vc-tip {
    color: #f39c12;
    font-size: 12px;
    text-align: center;
    padding: 5px;
    background: rgba(0,0,0,0.7);
    border-radius: 5px;
}

/* 非全屏模式下的提示 */
.virtual-controls:not(.fullscreen) .vc-tip {
    display: block !important;
}

/* 全屏模式下虚拟控制键（仅触摸设备显示） */
.game-container.fullscreen-mode .virtual-controls.show {
    display: flex;
    position: fixed;
    right: 10px;
    bottom: 20px;
    z-index: 100;
    flex-direction: column;
    gap: 5px;
}

/* 解锁屏幕按钮 */
.unlock-btn {
    padding: 8px 16px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    align-self: center;
}

.unlock-btn:hover {
    background: #c0392b;
}

/* 全屏模式下解锁按钮位置 */
.game-container.fullscreen-mode .unlock-btn {
    position: fixed;
    top: 10px;
    right: 10px;
}

.game-container.fullscreen-mode .vc-btn {
    width: 70px;
    height: 70px;
    font-size: 30px;
}

/* 移动设备全屏横屏模式 */
@media (max-width: 900px) and (orientation: landscape) {
    .game-container.mobile-fullscreen {
        height: 100vh;
        height: 100dvh;
        padding: 5px 10px;
    }

    .game-container.mobile-fullscreen .game-header,
    .game-container.mobile-fullscreen .game-settings,
    .game-container.mobile-fullscreen .game-stats,
    .game-container.mobile-fullscreen .records-container {
        display: none !important;
    }

    .game-container.mobile-fullscreen .game-canvas-container {
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0;
    }

    .game-container.mobile-fullscreen #game-canvas {
        max-height: 90vh;
        max-width: 95vw;
    }

    .game-container.mobile-fullscreen .game-controls {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-bottom: 5px;
        padding: 5px;
    }

    .game-container.mobile-fullscreen .game-controls button {
        padding: 5px 10px;
        font-size: 12px;
    }

    .game-container.mobile-fullscreen .virtual-controls {
        bottom: 10px;
    }

    .game-container.mobile-fullscreen .vc-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* 旋转屏幕提示 */
.rotate-hint {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
}

.rotate-hint.show {
    display: flex;
}

.rotate-icon {
    font-size: 80px;
    color: #fff;
    animation: rotateAnim 1.5s ease-in-out infinite;
}

.rotate-text {
    font-size: 24px;
    color: #fff;
    text-align: center;
}

@keyframes rotateAnim {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

/* 竖屏时显示旋转提示 */
@media (max-width: 900px) and (orientation: portrait) {
    .game-container.mobile-fullscreen ~ .rotate-hint {
        display: flex;
    }

    .game-container.mobile-fullscreen .game-canvas-container {
        max-height: 50vh;
    }

    .game-container.mobile-fullscreen .virtual-controls {
        position: relative;
        margin-top: 10px;
    }
}

/* 正常模式样式 */
.game-header {
    text-align: center;
    margin-bottom: 15px;
}

.game-header h1 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 32px;
}

.help-link {
    display: inline-block;
    padding: 6px 14px;
    background-color: #27ae60;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.help-link:hover {
    background-color: #219a52;
    transform: scale(1.05);
}

.player-info {
    margin-top: 8px;
}

.player-info label {
    font-weight: bold;
    color: #555;
}

.player-info input {
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    width: 180px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.player-info input:focus {
    outline: none;
    border-color: #667eea;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    position: relative;
    z-index: 100;
}

.game-controls button {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.game-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.game-controls button:active {
    transform: translateY(0);
}

.game-controls button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.game-settings {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-item label {
    font-weight: bold;
    color: #555;
    font-size: 16px;
}

.setting-item select {
    padding: 6px 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.setting-item select:focus {
    outline: none;
    border-color: #667eea;
}

.setting-item input[type="number"] {
    padding: 6px 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    width: 80px;
    font-size: 14px;
}

.setting-item input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.setting-item input[type="range"] {
    width: 100px;
    cursor: pointer;
}

.setting-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.setting-item span {
    min-width: 25px;
    font-weight: bold;
    color: #667eea;
    font-size: 15px;
}

.game-canvas-container {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

#game-canvas {
    border: 3px solid #2c3e50;
    border-radius: 8px;
    background-color: #ecf0f1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.stat-item {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 15px 30px;
    border-radius: 10px;
    min-width: 160px;
    text-align: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-item span:last-child {
    color: white;
    font-size: 22px;
    margin-left: 8px;
}

.records-container {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
}

.records-container h2 {
    text-align: center;
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 18px;
}

.records-columns {
    display: flex;
    gap: 20px;
}

.records-column {
    flex: 1;
    min-width: 0;
}

.records-column h3 {
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 10px;
    text-align: center;
}

.records-column .record-item {
    max-height: 150px;
    overflow-y: auto;
}

#records-list {
    max-height: 150px;
    overflow-y: auto;
}

.record-item {
    padding: 8px;
    margin-bottom: 5px;
    background-color: white;
    border-radius: 4px;
    border-left: 4px solid #667eea;
    font-size: 14px;
}

.record-item.highlight {
    background-color: #e3f2fd;
}

.record-item strong {
    color: #2c3e50;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 24px;
}

.modal-content .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-content .close:hover {
    color: #333;
}

/* 成就系统样式 */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.achievement-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: transform 0.3s;
}

.achievement-card.unlocked {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.achievement-card.locked {
    opacity: 0.6;
}

.achievement-card:hover {
    transform: scale(1.02);
}

.achievement-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.achievement-name {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 16px;
}

.achievement-desc {
    font-size: 13px;
    color: #666;
}

.achievement-status {
    margin-top: 8px;
    font-size: 12px;
    font-weight: bold;
}

.achievement-status.unlocked {
    color: #27ae60;
}

.achievement-status.locked {
    color: #999;
}

/* 皮肤系统样式 */
.skin-section {
    margin-bottom: 25px;
}

.skin-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
}

.skin-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.skin-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s;
}

.skin-option:hover {
    background-color: #f0f0f0;
}

.skin-option input {
    display: none;
}

.skin-option input:checked + .skin-preview {
    border: 3px solid #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.skin-preview {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #ddd;
}

.green-preview {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.blue-preview {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.red-preview {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.rainbow-preview {
    background: linear-gradient(135deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
}

/* 新增蛇身颜色 */
.purple-preview { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.orange-preview { background: linear-gradient(135deg, #e67e22, #d35400); }
.pink-preview { background: linear-gradient(135deg, #fd79a8, #e84393); }
.yellow-preview { background: linear-gradient(135deg, #f1c40f, #f39c12); }
.cyan-preview { background: linear-gradient(135deg, #00cec9, #00b894); }

.food-circle-preview {
    background: radial-gradient(circle, #e74c3c 50%, #c0392b 100%);
    border-radius: 50%;
}

.food-star-preview {
    color: #f1c40f;
    font-size: 30px;
    text-shadow: 0 0 10px #f1c40f;
}

.food-heart-preview {
    color: #e91e63;
    font-size: 30px;
    text-shadow: 0 0 10px #e91e63;
}

/* 新增食物预览 */
.food-fish-preview, .food-bug-preview, .food-apple-preview, .food-diamond-preview, .food-candy-preview, .food-cookie-preview { font-size: 24px; }
.food-diamond-preview { text-shadow: 0 0 10px #3498db; }

.bg-grid-preview {
    background: linear-gradient(#bdc3c7 1px, transparent 1px),
                linear-gradient(90deg, #bdc3c7 1px, transparent 1px),
                #ecf0f1;
    background-size: 10px 10px;
}

.bg-solid-preview {
    background-color: #ecf0f1;
}

.bg-gradient-preview {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

/* 新增背景预览 */
.bg-forest-preview { background: linear-gradient(135deg, #a8e6cf 0%, #88d8b0 100%); }
.bg-ocean-preview { background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%); }
.bg-sunset-preview { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }
.bg-night-preview { background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%); }
.bg-pastel-preview { background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); }

/* 音效设置样式 */
.sound-section {
    margin-bottom: 20px;
}

.sound-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.sound-option:hover {
    background-color: #f0f0f0;
}

.sound-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.sound-option span {
    font-size: 16px;
    color: #2c3e50;
}

.save-btn {
    width: 100%;
    padding: 15px;
    margin-top: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* 道具显示 */
.powerup-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 10px;
}

.powerup-badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.powerup-badge.speed-up {
    background-color: #f39c12;
}

.powerup-badge.speed-down {
    background-color: #9b59b6;
}

.powerup-badge.invincible {
    background-color: #e74c3c;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 游戏结束弹窗样式 */
.game-over-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.game-over-modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-over-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    color: white;
    min-width: 300px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.game-over-content h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.game-over-content p {
    font-size: 18px;
    margin: 10px 0;
}

.game-over-content .score-display {
    font-size: 48px;
    font-weight: bold;
    margin: 20px 0;
}

.new-record {
    color: #ffd700;
    font-size: 24px;
    animation: bounce 0.5s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 成就/速度提示动画 */
.achievement-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    color: #333;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
    z-index: 2000;
    animation: flashAchievement 2s ease-in-out forwards;
    display: none;
}

.achievement-notification.speed {
    background: linear-gradient(135deg, #f39c12 0%, #e74c3c 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(243, 156, 18, 0.5);
}

.achievement-notification.show {
    display: block;
}

@keyframes flashAchievement {
    0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* 登录/注册面板 */
.auth-content {
    max-width: 400px;
    text-align: center;
}

.auth-content h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.auth-content input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.auth-content input:focus {
    outline: none;
    border-color: #667eea;
}

.auth-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.guest-btn {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%) !important;
    margin-top: 5px;
}

.guest-btn:hover {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%) !important;
}

.auth-content p {
    margin-top: 15px;
    color: #666;
}

.auth-content a {
    color: #667eea;
    text-decoration: none;
}

.auth-content hr {
    margin: 20px 0;
    border: none;
    border-top: 1px solid #ddd;
}

.auth-content .hint {
    font-size: 12px;
    color: #999;
    margin: 5px 0;
}

.auth-content .error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 10px;
}

.auth-content .remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    margin: 10px 0;
    cursor: pointer;
}

.auth-content .remember-me input {
    width: auto;
    margin: 0;
}

.auth-content .clear-credentials-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 10px;
}

.auth-content .clear-credentials-btn:hover {
    background: #c0392b;
}

#game-container.show {
    display: block;
}

/* 用户信息显示 */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.user-info span {
    color: #667eea;
    font-weight: bold;
}

.logout-btn {
    padding: 5px 10px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

.change-pass-btn {
    padding: 5px 10px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    margin-right: 5px;
}

.change-pass-btn:hover {
    background: #2980b9;
}

/* 管理员面板 */
.admin-section {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.admin-section h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 16px;
}

.admin-section ul {
    list-style: none;
    padding: 0;
}

.admin-section li {
    padding: 8px;
    margin: 5px 0;
    background: white;
    border-radius: 4px;
    font-size: 14px;
}

/* 响应式调整 */
@media (max-width: 600px) {
    .game-settings {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .game-controls {
        flex-wrap: wrap;
    }

    .game-stats {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .stat-item {
        width: 80%;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .skin-options {
        gap: 10px;
    }

    .skin-preview {
        width: 40px;
        height: 40px;
    }
}

/* ==================== 虚拟控制键 ==================== */
.virtual-controls {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 15px;
    z-index: 50;
}

.virtual-controls.show {
    display: flex;
}

.vc-cross {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.vc-row {
    display: flex;
    gap: 5px;
}

.vc-row-top {
    margin-bottom: 5px;
}

.vc-row-middle {
    display: flex;
    justify-content: center;
}

.vc-btn {
    width: 65px;
    height: 65px;
    font-size: 28px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.vc-btn:active {
    transform: scale(0.92);
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
}

/* ==================== 响应式布局 ==================== */
/* 平板设备 */
@media (max-width: 900px) {
    .game-container {
        width: 95%;
        padding: 15px;
    }

    #game-canvas {
        width: 100%;
        height: auto;
        max-width: 700px;
    }

    .game-controls {
        flex-wrap: wrap;
        gap: 8px;
    }

    .game-controls button {
        padding: 8px 12px;
        font-size: 14px;
    }

    .stat-item {
        min-width: 100px;
        padding: 10px 15px;
    }

    .records-columns {
        flex-direction: column;
    }
}

/* 手机设备 */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .game-container {
        width: 100%;
        padding: 10px;
        border-radius: 10px;
    }

    .game-header h1 {
        font-size: 24px;
    }

    .game-header .help-link {
        font-size: 12px;
    }

    .player-info {
        flex-direction: column;
        gap: 5px;
    }

    .player-info input {
        width: 100%;
    }

    .game-controls {
        gap: 5px;
    }

    .game-controls button {
        padding: 8px 10px;
        font-size: 12px;
        flex: 1 1 45%;
    }

    .game-settings {
        padding: 10px;
    }

    .setting-item {
        flex: 1 1 100%;
    }

    #game-canvas {
        max-width: 100%;
    }

    .game-stats {
        gap: 10px;
    }

    .stat-item {
        min-width: 80px;
        padding: 8px 12px;
        font-size: 14px;
    }

    .records-container h2 {
        font-size: 20px;
    }

    .records-column h3 {
        font-size: 16px;
    }

    .record-item {
        padding: 8px;
        font-size: 12px;
    }

    /* 手机上显示虚拟控制键 */
    .virtual-controls {
        display: flex;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
        padding: 15px;
    }

    .skin-section h3 {
        font-size: 16px;
    }

    .skin-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .skin-option {
        padding: 5px;
    }

    .skin-preview {
        width: 35px;
        height: 35px;
    }
}

/* 超小屏幕 */
@media (max-width: 400px) {
    .game-header h1 {
        font-size: 20px;
    }

    .game-controls button {
        font-size: 11px;
        padding: 6px 8px;
    }

    .stat-item {
        min-width: 60px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .vc-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* ============================================
   多人游戏样式
   ============================================ */

/* 选项卡按钮 */
#multiplayer-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    background: #e0e0e0;
    color: #333;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #d0d0d0;
}

.tab-btn.active {
    background: #667eea;
    color: white;
}

/* 选项卡内容 */
.tab-content {
    display: none;
    padding: 15px 0;
}

.tab-content.active {
    display: block;
}

/* 房间设置 */
.room-settings {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.room-settings h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.room-settings .setting-item {
    margin-bottom: 10px;
}

.room-settings label {
    display: inline-block;
    width: 100px;
    color: #555;
}

.room-settings input,
.room-settings select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 房间列表 */
.room-list {
    max-height: 300px;
    overflow-y: auto;
}

.room-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 10px;
}

.room-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.room-name {
    font-weight: bold;
    color: #333;
}

.room-host,
.room-players {
    font-size: 13px;
    color: #666;
}

.join-room-btn {
    padding: 8px 15px;
    font-size: 13px;
}

.empty-hint {
    text-align: center;
    color: #888;
    padding: 30px;
}

/* 等待大厅 */
.lobby-info {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.lobby-info h3 {
    margin-top: 0;
}

.lobby-info p {
    margin: 5px 0;
}

.player-list {
    margin-bottom: 15px;
}

.player-list h3 {
    margin-bottom: 10px;
}

.player-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.player-list li {
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-name {
    flex: 1;
}

.host-badge {
    background: #ffd700;
    color: #333;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.you-badge {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.lobby-actions {
    display: flex;
    gap: 10px;
}

.lobby-actions button {
    flex: 1;
}

/* 多人游戏结算 */
#mp-result-content {
    text-align: center;
}

.mp-result-scores {
    margin-bottom: 20px;
}

.mp-result-scores h3 {
    margin-bottom: 15px;
}

.mp-player-score {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 5px;
}

.mp-total-score {
    margin-top: 20px;
    padding: 15px;
    background: #667eea;
    color: white;
    border-radius: 8px;
}

.mp-total-score h3 {
    margin: 0;
}

/* 游戏中的多人玩家指示器 */
.mp-players-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
}
