/* 打地鼠游戏样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

body {
    background-color: #f0f2f5;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

header h1 {
    font-size: 2rem;
    color: #4a148c;
    margin-bottom: 10px;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
    margin-bottom: 20px;
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.score, .timer, .level {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score h3, .timer h3, .level h3 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.score p, .timer p, .level p {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4a148c;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(3, 120px);
    grid-template-rows: repeat(3, 120px);
    gap: 10px;
    background-color: #8bc34a;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.hole {
    width: 120px;
    height: 120px;
    background-color: #5d4037;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.mole {
    width: 80%;
    height: 80%;
    background-color: #795548;
    border-radius: 50%;
    position: absolute;
    bottom: -80%;
    transition: bottom 0.1s;
    cursor: pointer;
}

.mole.active {
    bottom: 0;
}

.mole.hit {
    background-color: #e53935;
}

.mole::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 30%;
    background-color: #5d4037;
    border-radius: 50%;
}

.mole::after {
    content: '';
    position: absolute;
    top: 30%;
    left: 30%;
    width: 15%;
    height: 15%;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 40% 0 0 0 #fff;
}

.controls {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.difficulty-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.difficulty-btn {
    background-color: #4a148c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.difficulty-btn.active {
    background-color: #7b1fa2;
    font-weight: bold;
}

.difficulty-btn:hover {
    background-color: #7b1fa2;
}

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

button:hover {
    background-color: #7b1fa2;
}

.home-button {
    margin-top: 20px;
    background-color: #333;
}

.home-button:hover {
    background-color: #555;
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    display: none;
    z-index: 100;
}

.game-over h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.game-over p {
    margin-bottom: 20px;
}

.instructions {
    margin: 20px 0;
    text-align: center;
    max-width: 500px;
    line-height: 1.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .game-board {
        grid-template-columns: repeat(3, 100px);
        grid-template-rows: repeat(3, 100px);
    }
    
    .hole {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .game-board {
        grid-template-columns: repeat(3, 80px);
        grid-template-rows: repeat(3, 80px);
    }
    
    .hole {
        width: 80px;
        height: 80px;
    }
    
    .game-info {
        font-size: 0.9rem;
    }
}
