/* 8位像素风格 - 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Press Start 2P', monospace;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    image-rendering: pixelated;
}

.game-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    text-align: center;
}

/* 游戏标题 - 8位风格 */
.game-title {
    font-size: clamp(18px, 5vw, 28px);
    color: #ffd700;
    text-shadow: 
        3px 3px 0 #ff6b35,
        -1px -1px 0 #ff6b35,
        1px -1px 0 #ff6b35,
        -1px 1px 0 #ff6b35,
        0 4px 0 #c44d00;
    margin-bottom: 20px;
    animation: title-bounce 1s ease-in-out infinite;
}

@keyframes title-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* 游戏信息面板 */
.game-info {
    display: flex;
    justify-content: space-around;
    background: #2d2d44;
    border: 4px solid #4a4a6a;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 6px 0 #1a1a2e;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.label {
    font-size: clamp(8px, 2vw, 12px);
    color: #8a8aaa;
}

.value {
    font-size: clamp(16px, 4vw, 24px);
    color: #00ff88;
    text-shadow: 0 0 10px #00ff88;
}

/* 游戏板 - 3x3网格 */
.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px;
    background: linear-gradient(180deg, #4a7c59 0%, #3d6b4f 100%);
    border: 6px solid #2d5a3d;
    border-radius: 12px;
    box-shadow: 
        inset 0 -8px 0 rgba(0,0,0,0.3),
        0 8px 0 #1a3d28;
    margin-bottom: 20px;
}

/* 地鼠洞 */
.hole {
    aspect-ratio: 1;
    background: radial-gradient(ellipse at center, #1a1a1a 0%, #2d2d2d 70%, #3d3d3d 100%);
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 
        inset 0 8px 16px rgba(0,0,0,0.8),
        0 4px 0 rgba(0,0,0,0.3);
    transition: transform 0.1s;
}

.hole:active {
    transform: scale(0.95);
}

/* 地鼠 */
.mole {
    position: absolute;
    bottom: -100%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 80%;
    transition: bottom 0.15s ease-out;
    pointer-events: none;
}

.mole.show {
    bottom: 10%;
}

/* 像素地鼠 - 纯CSS实现 */
.mole-body {
    width: 100%;
    height: 100%;
    background: #8b6914;
    border-radius: 50% 50% 40% 40%;
    position: relative;
    box-shadow: inset 0 -10px 0 #6b5210;
}

/* 地鼠眼睛 */
.mole-body::before,
.mole-body::after {
    content: '';
    position: absolute;
    width: 20%;
    height: 20%;
    background: #fff;
    border-radius: 50%;
    top: 25%;
    box-shadow: inset 0 0 0 30% #000;
}

.mole-body::before {
    left: 20%;
}

.mole-body::after {
    right: 20%;
}

/* 地鼠鼻子 */
.mole-nose {
    position: absolute;
    width: 30%;
    height: 15%;
    background: #ff69b4;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translateX(-50%);
}

/* 地鼠被击中效果 */
.mole.hit {
    animation: hit-shake 0.3s ease-in-out;
}

@keyframes hit-shake {
    0%, 100% { transform: translateX(-50%) rotate(0); }
    25% { transform: translateX(-50%) rotate(-10deg); }
    75% { transform: translateX(-50%) rotate(10deg); }
}

.mole.hit .mole-body {
    background: #ff4444;
}

/* 得分动画 */
.score-popup {
    position: absolute;
    font-size: 20px;
    color: #ffd700;
    text-shadow: 2px 2px 0 #000;
    animation: score-float 0.8s ease-out forwards;
    pointer-events: none;
    z-index: 100;
}

@keyframes score-float {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(1.5);
    }
}

/* 控制按钮 */
.game-controls {
    margin-top: 10px;
}

.pixel-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(12px, 3vw, 16px);
    padding: 15px 30px;
    background: linear-gradient(180deg, #ff6b35 0%, #c44d00 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 
        0 6px 0 #8b3500,
        0 8px 10px rgba(0,0,0,0.3);
    transition: all 0.1s;
    text-shadow: 1px 1px 0 #000;
}

.pixel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 0 #8b3500,
        0 10px 15px rgba(0,0,0,0.3);
}

.pixel-btn:active {
    transform: translateY(4px);
    box-shadow: 
        0 2px 0 #8b3500,
        0 4px 5px rgba(0,0,0,0.3);
}

.pixel-btn:disabled {
    background: #666;
    box-shadow: 0 4px 0 #444;
    cursor: not-allowed;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: linear-gradient(180deg, #2d2d44 0%, #1a1a2e 100%);
    padding: 40px;
    border-radius: 16px;
    border: 6px solid #4a4a6a;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: modal-pop 0.3s ease-out;
}

@keyframes modal-pop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-content h2 {
    font-size: clamp(18px, 5vw, 28px);
    color: #ffd700;
    margin-bottom: 20px;
}

.modal-content p {
    font-size: clamp(10px, 3vw, 14px);
    color: #fff;
    margin-bottom: 15px;
}

#finalScore {
    color: #00ff88;
    font-size: clamp(16px, 4vw, 24px);
}

#newHighScore {
    color: #ffd700;
    animation: pulse 0.5s ease-in-out infinite;
}

#newHighScore.hidden {
    display: none;
}

/* BUG-001: 评级显示样式 */
.rating-display {
    margin: 15px 0;
    padding: 10px;
}

.rating-grade {
    font-size: 48px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 3px 3px 0 #ff6b35;
    animation: grade-pop 0.5s ease-out;
}

.rating-stars {
    font-size: 24px;
    margin: 10px 0;
}

.rating-title {
    font-size: 14px;
    color: #00ff88;
}

@keyframes grade-pop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

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

/* 响应式设计 */
@media (max-width: 480px) {
    .game-container {
        padding: 10px;
    }
    
    .game-board {
        gap: 10px;
        padding: 15px;
    }
    
    .game-info {
        padding: 10px;
    }
}

/* PC横屏适配 */
@media (min-width: 769px) and (orientation: landscape) {
    .game-container {
        max-width: 600px;
    }
    
    .game-board {
        gap: 20px;
        padding: 25px;
    }
}

/* 触摸反馈 */
@media (hover: none) {
    .hole:active {
        background: radial-gradient(ellipse at center, #2a2a2a 0%, #3d3d3d 70%, #4d4d4d 100%);
    }
}

/* 防止文本选择 */
.game-board, .pixel-btn {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
