/* 像素跑酷 - 8位像素风格样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

@font-face {
    font-family: 'PixelFont';
    src: local('Courier New'), local('monospace');
}

body {
    font-family: 'PixelFont', 'Courier New', monospace;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

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

.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.screen.hidden {
    display: none;
}

/* 像素风格边框 */
.pixel-border {
    background: linear-gradient(135deg, #16213e 0%, #1a1a2e 100%);
    border: 4px solid #0f3460;
    box-shadow: 
        0 0 0 4px #1a1a2e,
        0 0 0 8px #0f3460,
        inset 0 0 20px rgba(0, 0, 0, 0.5),
        0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 30px 40px;
    text-align: center;
    max-width: 90vw;
}

/* 标题样式 */
.game-title {
    font-size: 2.5rem;
    color: #e94560;
    text-shadow: 
        4px 4px 0 #0f3460,
        -2px -2px 0 #533483;
    margin-bottom: 5px;
    letter-spacing: 4px;
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.subtitle {
    font-size: 0.9rem;
    color: #533483;
    letter-spacing: 8px;
    margin-bottom: 20px;
}

/* 像素按钮 */
.pixel-btn {
    font-family: 'PixelFont', 'Courier New', monospace;
    font-size: 1.1rem;
    padding: 12px 30px;
    margin: 8px;
    background: linear-gradient(180deg, #0f3460 0%, #16213e 100%);
    border: 3px solid #e94560;
    color: #eaeaea;
    cursor: pointer;
    position: relative;
    transition: all 0.1s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.pixel-btn:hover {
    background: linear-gradient(180deg, #e94560 0%, #c73659 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 0 #533483;
}

.pixel-btn:active {
    transform: translateY(2px);
    box-shadow: none;
}

.pixel-btn.small {
    font-size: 0.9rem;
    padding: 8px 20px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 15px;
}

/* 统计信息 */
.stats {
    margin: 15px 0;
    font-size: 1.1rem;
    color: #ffd93d;
}

.instructions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #0f3460;
    font-size: 0.85rem;
    color: #888;
    line-height: 1.8;
}

/* 游戏界面 */
#game-screen {
    justify-content: flex-start;
    padding: 10px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 600px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 3px solid #0f3460;
    margin-bottom: 10px;
    z-index: 10;
}

.score-display, .speed-display {
    font-size: 1rem;
    color: #ffd93d;
}

#game-canvas {
    border: 4px solid #0f3460;
    box-shadow: 
        0 0 0 4px #1a1a2e,
        0 0 0 8px #533483,
        0 8px 32px rgba(0, 0, 0, 0.5);
    background: #16213e;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    max-width: 95vw;
    max-height: 65vh;
}

.game-footer {
    margin-top: 10px;
    z-index: 10;
}

/* 游戏结束 */
.final-score {
    margin: 15px 0;
    font-size: 1.1rem;
    color: #b8b8b8;
}

.final-score p {
    margin: 8px 0;
}

.new-record {
    color: #ffd93d !important;
    font-size: 1.3rem !important;
    animation: recordPulse 0.5s ease-in-out infinite;
}

@keyframes recordPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 移动端适配 */
@media (max-width: 480px) {
    .game-title {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 0.7rem;
        letter-spacing: 4px;
    }
    
    .pixel-btn {
        font-size: 1rem;
        padding: 10px 25px;
    }
    
    .pixel-border {
        padding: 20px;
        margin: 10px;
    }
    
    .game-header {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .instructions {
        font-size: 0.75rem;
    }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
    .game-title {
        font-size: 1.5rem;
    }
    
    .pixel-border {
        padding: 15px 25px;
    }
    
    #game-canvas {
        max-height: 70vh;
    }
    
    .game-header {
        padding: 5px 15px;
    }
}

/* 触控反馈 */
@media (hover: none) {
    .pixel-btn:active {
        background: linear-gradient(180deg, #e94560 0%, #c73659 100%);
        transform: scale(0.95);
    }
}
