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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    max-width: 500px;
    width: 100%;
    text-align: center;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

h1 {
    color: #333;
    margin-bottom: 0;
}

.share-btn {
    background-color: #9b59b6;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.share-btn svg {
    margin-right: 2px;
}

.share-btn:hover {
    background-color: #8e44ad;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(142, 68, 173, 0.3);
}

.score-container {
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: bold;
    color: #555;
}

#score {
    color: #e74c3c;
}

canvas {
    background-color: #ecf0f1;
    border: 2px solid #2c3e50;
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

.controls {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

#restart-btn {
    background-color: #e74c3c;
}

#restart-btn:hover {
    background-color: #c0392b;
}

.instructions {
    margin-top: 30px;
    text-align: left;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.instructions h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #333;
}

.instructions p {
    margin-bottom: 8px;
    color: #555;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* 移动设备适配 */
@media (max-width: 500px) {
    canvas {
        width: 300px;
        height: 300px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
    }
    
    .share-btn {
        position: absolute;
        top: 0;
        right: 0;
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    button {
        width: 100%;
        max-width: 200px;
    }
}