/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 1000px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
}

/* 游戏标题 */
.game-title {
    font-size: 2.5rem;
    color: #4a5568;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* 游戏信息栏 */
.game-info {
    display: flex;
    justify-content: space-around;
    background: #f7fafc;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.info-label {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 5px;
}

.info-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2d3748;
}

/* 游戏容器 */
.game-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    overflow: hidden;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

/* 游戏面板 */
.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1;
    background: #8bc34a;
    border-radius: 15px;
    padding: 20px;
}

/* 地鼠洞 */
.hole {
    position: relative;
    background: #6d4c41;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.hole::before {
    content: '';
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 30%;
    background: #5d4037;
    border-radius: 50% 50% 0 0;
}

/* 地鼠 */
.mole {
    position: absolute;
    bottom: -100%;
    width: 70%;
    height: 70%;
    background: #8d6e63;
    border-radius: 50% 50% 0 0;
    transition: bottom 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.mole::before {
    content: '';
    position: absolute;
    top: 20%;
    width: 20%;
    height: 20%;
    background: #212121;
    border-radius: 50%;
    box-shadow: 40px 0 0 #212121;
}

.mole::after {
    content: '';
    position: absolute;
    top: 45%;
    width: 15%;
    height: 10%;
    background: #ff5722;
    border-radius: 50%;
}

.mole.active {
    bottom: 0;
}

.mole.hit {
    background: #ff5722;
    animation: hitAnimation 0.5s ease;
}

.mole.missed {
    background: #f44336;
    animation: missedAnimation 0.5s ease;
}

/* 锤子 */
.hammer {
    position: fixed;
    width: 60px;
    height: 60px;
    font-size: 2rem;
    pointer-events: none;
    z-index: 100;
    transform-origin: center;
    transition: transform 0.1s ease;
}

.hammer.hitting {
    transform: rotate(-45deg);
}

/* 动画效果 */
@keyframes hitAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes missedAnimation {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

/* 控制面板 */
.control-section {
    margin-bottom: 20px;
}

.control-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    min-width: 100px;
}

.btn-primary {
    background: #4299e1;
    color: white;
}

.btn-primary:hover {
    background: #3182ce;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
    transform: translateY(-2px);
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
    transform: translateY(-2px);
}

/* 难度选择 */
.difficulty-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.difficulty-select {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-select:hover {
    border-color: #cbd5e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 游戏说明 */
.game-instructions {
    background: #f7fafc;
    border-radius: 10px;
    padding: 20px;
    text-align: left;
}

.game-instructions h3 {
    color: #2d3748;
    margin-bottom: 15px;
    text-align: center;
}

.game-instructions ul {
    list-style-type: disc;
    padding-left: 20px;
    color: #4a5568;
    line-height: 1.6;
}

.game-instructions li {
    margin-bottom: 8px;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    color: #2d3748;
    margin-bottom: 20px;
}

.modal-content p {
    font-size: 1.2rem;
    color: #4a5568;
    margin-bottom: 15px;
}

.win-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .game-title {
        font-size: 2rem;
    }
    
    .game-info {
        gap: 5px;
    }
    
    .info-item {
        min-width: 60px;
    }
    
    .info-label {
        font-size: 0.8rem;
    }
    
    .info-value {
        font-size: 1.2rem;
    }
    
    .game-board {
        gap: 15px;
        padding: 15px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        min-width: 90px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.8rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .game-board {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 10px;
        padding: 10px;
    }
    
    .control-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .difficulty-selector {
        flex-direction: column;
        gap: 10px;
    }
}