/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 容器样式 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 屏幕样式 */
.screen {
    display: none;
    width: 100%;
    text-align: center;
}

.screen.active {
    display: block;
}

/* 标题样式 */
h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #1d1d1f 0%, #434344 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #1d1d1f;
}

h3 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 16px;
    color: #1d1d1f;
}

/* 菜单容器样式 */
.menu-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.menu-item {
    margin-bottom: 32px;
}

/* 按钮组样式 */
.button-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    font-size: 16px;
    color: #0071e3;
    background: transparent;
    border: 1px solid #0071e3;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 8px;
}

.btn:hover {
    background: rgba(0, 113, 227, 0.1);
}

.btn.active {
    background: #0071e3;
    color: white;
}

.btn.primary {
    background: #0071e3;
    color: white;
    font-weight: 500;
}

.btn.primary:hover {
    background: #0077ed;
}

/* 游戏容器样式 */
.game-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.game-area {
    background: #ffffff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 双人模式布局样式 - 暂时隐藏，后续添加 */
.game-container.double-mode {
    grid-template-columns: 1fr 1fr 300px;
}

.player2-area {
    display: none;
}

/* 计分板样式 */
.score-board {
    text-align: center;
    margin-bottom: 32px;
}

#score {
    font-size: 48px;
    font-weight: 700;
    color: #0071e3;
}

/* 玩家2计分板样式 - 暂时隐藏，后续添加 */
.player2-score-board {
    display: none;
}

/* 统计信息样式 */
.stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: #ffffff;
    border-radius: 12px;
    font-size: 16px;
}

/* 游戏结束界面样式 */
.final-stats {
    max-width: 400px;
    margin: 0 auto 32px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 控制说明样式 */
.toggle-hint-btn {
    margin-top: 16px;
    padding: 8px 16px;
    font-size: 14px;
    color: #0071e3;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: auto;
}

.toggle-hint-btn:hover {
    color: #0077ed;
}

.toggle-hint-btn::after {
    content: '▼';
    font-size: 12px;
    transition: transform 0.3s ease;
}

.toggle-hint-btn.active::after {
    transform: rotate(180deg);
}

.control-hint {
    margin-top: 16px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease;
    opacity: 0;
    position: relative;
    z-index: 100;
    width: 100%;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
    visibility: hidden;
}

.control-hint:not(.collapsed) {
    height: auto;
    opacity: 1;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    visibility: visible;
}

.control-hint h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.control-hint h3::after {
    content: '按 ESC 或点击外部区域关闭';
    font-size: 12px;
    color: #86868b;
    font-weight: normal;
    background: rgba(0, 0, 0, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #ffffff;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.control-item:hover {
    transform: translateY(-2px);
}

.control-item .key {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f7;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    font-weight: 500;
    color: #1d1d1f;
}

.control-item .action {
    color: #1d1d1f;
}

.keyboard-hint,
.gamepad-hint {
    display: none;
    animation: fadeIn 0.3s ease;
}

.keyboard-hint.active,
.gamepad-hint.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 提示弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 16px;
    color: #1d1d1f;
}

.modal-content p {
    margin-bottom: 24px;
    color: #1d1d1f;
    line-height: 1.5;
}

.modal-content .btn {
    min-width: 120px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        grid-template-columns: 1fr;
    }
    
    /* 双人模式响应式布局 - 暂时隐藏，后续添加 */
    .game-container.double-mode {
        grid-template-columns: 1fr;
    }
    
    .player2-area {
        display: none;
    }
    
    .player2-score-board {
        display: none;
    }
    
    .menu-container {
        padding: 20px;
    }
    
    h1 {
        font-size: 36px;
    }
    
    h2 {
        font-size: 24px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .control-grid {
        grid-template-columns: 1fr;
    }
    
    .control-hint {
        max-width: 320px;
    }
    
    .control-hint:not(.collapsed) {
        padding: 16px;
    }
    
    .control-hint h3::after {
        display: none;
    }
    
    .toggle-hint-btn::before {
        display: none;
    }
    
    .modal-content {
        padding: 20px;
        width: 95%;
    }
}

/* 手柄状态显示 */
.gamepad-status {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
    text-align: center;
    min-height: 20px;
    transition: all 0.3s ease;
}

.gamepad-status.connected {
    color: #4CAF50;
}

.gamepad-status.disconnected {
    color: #f44336;
}

.gamepad-status.unsupported {
    color: #ff9800;
}

/* 控制按钮样式优化 */
.control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.control-btn i {
    font-size: 18px;
}

.control-btn span {
    font-size: 16px;
} 