/* ============================================
   经典坦克大战 - 全局样式
   ============================================ */

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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 屏幕管理 */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

.screen.overlay {
    background: rgba(0, 0, 0, 0.85);
    z-index: 100;
}

/* 开始菜单 */
.game-title {
    font-size: 4rem;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(255, 200, 0, 0.8),
                 0 0 40px rgba(255, 100, 0, 0.6);
    margin-bottom: 0.5rem;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { text-shadow: 0 0 20px rgba(255, 200, 0, 0.8); }
    to { text-shadow: 0 0 30px rgba(255, 200, 0, 1),
                      0 0 60px rgba(255, 100, 0, 0.8); }
}

.game-subtitle {
    font-size: 1.5rem;
    color: #aaa;
    margin-bottom: 3rem;
    letter-spacing: 0.5rem;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.menu-btn {
    padding: 1rem 3rem;
    font-size: 1.3rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 250px;
    text-transform: uppercase;
    letter-spacing: 0.2rem;
}

.menu-btn.primary {
    background: linear-gradient(135deg, #ff6b35, #f7c948);
    color: #1a1a2e;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.menu-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.6);
}

.menu-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.menu-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.menu-btn.danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.menu-btn.danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(231, 76, 60, 0.6);
}

.help-panel {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
    max-width: 500px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.help-panel h3 {
    margin-bottom: 1rem;
    color: #f7c948;
}

.help-panel ul {
    list-style: none;
    margin-bottom: 1rem;
}

.help-panel li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.help-panel li:last-child {
    border-bottom: none;
}

.tip {
    color: #aaa;
    font-style: italic;
    margin-bottom: 1rem;
}

.hidden {
    display: none !important;
}

/* 游戏画面布局 */
#game-wrapper {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

#side-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 150px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #f7c948;
}

#canvas-container {
    position: relative;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

#game-canvas {
    display: block;
    background: #000;
}

/* 模态框通用样式 */
.modal {
    background: rgba(0, 0, 0, 0.9);
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

.modal h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #f7c948;
}

.modal p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #ccc;
}

#gameover-stats {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

#gameover-stats p {
    margin: 0.5rem 0;
    font-size: 1.3rem;
}

#gameover-stats span {
    color: #f7c948;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .game-title {
        font-size: 3rem;
    }
    
    #side-panel {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stat-item {
        min-width: 100px;
    }
}

@media (max-width: 768px) {
    .game-title {
        font-size: 2rem;
    }
    
    .menu-btn {
        min-width: 200px;
        padding: 0.8rem 2rem;
        font-size: 1.1rem;
    }
    
    .modal {
        padding: 2rem;
    }
    
    .modal h2 {
        font-size: 1.8rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.screen.active .modal {
    animation: fadeIn 0.3s ease-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
