/* 像素打地鼠 - 像素风格样式 */

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

/* 像素字体 */
@font-face {
    font-family: 'PixelFont';
    src: local('Press Start 2P'), local('Courier New');
}

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(180deg, #87CEEB 0%, #98FB98 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    image-rendering: pixelated;
}

#game-container {
    position: relative;
    width: 480px;
    height: 640px;
    background: #2d5a27;
    border: 8px solid #1a3518;
    border-radius: 4px;
    box-shadow: 
        0 0 0 4px #4a7c44,
        0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 屏幕切换 */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.screen.active {
    display: flex;
}

.screen.overlay {
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
}

/* 主菜单 */
#menu-screen {
    background: linear-gradient(180deg, #87CEEB 0%, #98FB98 70%, #2d5a27 100%);
    padding: 20px;
}

.game-title {
    font-size: 32px;
    color: #8B4513;
    text-shadow: 
        3px 3px 0 #FFD700,
        -1px -1px 0 #5D3A1A,
        1px -1px 0 #5D3A1A,
        -1px 1px 0 #5D3A1A,
        1px 1px 0 #5D3A1A;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 14px;
    color: #5D3A1A;
    margin-bottom: 30px;
    opacity: 0.8;
}

.menu-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

/* 难度选择 */
.difficulty-selector {
    text-align: center;
}

.difficulty-selector label {
    display: block;
    color: #1a3518;
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: bold;
}

.difficulty-buttons {
    display: flex;
    gap: 10px;
}

.diff-btn {
    padding: 8px 16px;
    font-size: 12px;
    background: #d4a574;
    border: 3px solid #8B4513;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.1s;
}

.diff-btn:hover {
    background: #e8c49a;
}

.diff-btn.active {
    background: #FFD700;
    border-color: #B8860B;
    transform: scale(1.05);
}

/* 最高分显示 */
.high-score-display {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 4px;
    border: 3px solid #FFD700;
}

.high-score-display .label {
    color: #FFF;
    font-size: 14px;
}

.high-score-display .score-value {
    color: #FFD700;
    font-size: 24px;
    font-weight: bold;
    margin-left: 10px;
}

/* 像素按钮 */
.pixel-btn {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    padding: 12px 24px;
    background: #d4a574;
    border: 4px solid #8B4513;
    border-radius: 0;
    cursor: pointer;
    color: #3d2914;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 
        4px 4px 0 #5D3A1A,
        inset -2px -2px 0 rgba(0,0,0,0.2),
        inset 2px 2px 0 rgba(255,255,255,0.3);
    transition: all 0.05s;
    image-rendering: pixelated;
}

.pixel-btn:hover {
    background: #e8c49a;
    transform: translate(-1px, -1px);
    box-shadow: 
        5px 5px 0 #5D3A1A,
        inset -2px -2px 0 rgba(0,0,0,0.2),
        inset 2px 2px 0 rgba(255,255,255,0.3);
}

.pixel-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 
        2px 2px 0 #5D3A1A,
        inset -2px -2px 0 rgba(0,0,0,0.2),
        inset 2px 2px 0 rgba(255,255,255,0.3);
}

.pixel-btn.primary {
    background: #FFD700;
    border-color: #B8860B;
    color: #3d2914;
    box-shadow: 
        4px 4px 0 #8B6914,
        inset -2px -2px 0 rgba(0,0,0,0.2),
        inset 2px 2px 0 rgba(255,255,255,0.4);
}

.pixel-btn.primary:hover {
    background: #FFE44D;
    box-shadow: 
        5px 5px 0 #8B6914,
        inset -2px -2px 0 rgba(0,0,0,0.2),
        inset 2px 2px 0 rgba(255,255,255,0.4);
}

.pixel-btn.small {
    font-size: 12px;
    padding: 6px 12px;
}

/* 音效开关 */
.sound-toggle {
    margin-top: 10px;
}

#sound-toggle-btn {
    font-size: 12px;
    padding: 8px 16px;
}

.sound-icon {
    font-size: 16px;
}

/* 游戏界面 */
#game-screen {
    background: #87CEEB;
    justify-content: flex-start;
    padding: 0;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 15px;
    background: linear-gradient(180deg, #5D3A1A 0%, #3d2914 100%);
    border-bottom: 4px solid #2a1a0a;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 4px;
    border: 2px solid #8B4513;
}

.stat-label {
    font-size: 10px;
    color: #aaa;
    text-transform: uppercase;
}

.stat-value {
    font-size: 18px;
    color: #FFD700;
    font-weight: bold;
}

#current-score {
    min-width: 50px;
    text-align: center;
}

#time-left {
    color: #FF6B6B;
}

#time-left.warning {
    color: #FF0000;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#combo-count {
    color: #00FF00;
}

#combo-count.high {
    color: #FFD700;
    animation: glow 0.3s ease-in-out;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 5px #FFD700; }
    50% { text-shadow: 0 0 20px #FFD700, 0 0 30px #FFD700; }
}

/* 游戏画布 */
#game-canvas {
    display: block;
    background: linear-gradient(180deg, #87CEEB 0%, #87CEEB 40%, #228B22 40%, #228B22 100%);
    cursor: crosshair;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.game-footer {
    width: 100%;
    padding: 8px 15px;
    background: linear-gradient(180deg, #3d2914 0%, #5D3A1A 100%);
    border-top: 4px solid #2a1a0a;
    text-align: center;
}

.difficulty-indicator {
    color: #aaa;
    font-size: 12px;
}

#current-difficulty {
    color: #FFD700;
    font-weight: bold;
}

/* 暂停界面 */
.pause-content,
.gameover-content {
    background: linear-gradient(180deg, #4a7c44 0%, #2d5a27 100%);
    border: 6px solid #1a3518;
    border-radius: 4px;
    padding: 30px;
    text-align: center;
    box-shadow: 
        0 0 0 4px #6b9e65,
        0 8px 32px rgba(0, 0, 0, 0.5);
}

.pause-content h2,
.gameover-content h2 {
    color: #FFD700;
    font-size: 24px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 #8B4513;
}

.pause-content .pixel-btn,
.gameover-content .pixel-btn {
    margin: 10px;
}

/* 游戏结束统计 */
.final-stats {
    margin: 20px 0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.2);
}

.stat-row .label {
    color: #aaa;
    font-size: 14px;
}

.stat-row .value {
    color: #FFF;
    font-size: 18px;
    font-weight: bold;
}

.stat-row.new-record {
    border-bottom: none;
    justify-content: center;
    margin-top: 10px;
    animation: bounce 0.5s infinite alternate;
}

.stat-row.new-record .label {
    color: #FFD700;
    font-size: 18px;
}

@keyframes bounce {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

/* 分数弹出 */
#score-popups {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.score-popup {
    position: absolute;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 
        2px 2px 0 #000,
        -1px -1px 0 #000;
    animation: floatUp 0.8s ease-out forwards;
    pointer-events: none;
}

.score-popup.normal {
    color: #FFF;
}

.score-popup.combo {
    color: #FFD700;
}

.score-popup.golden {
    color: #FFD700;
    font-size: 24px;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(1.2);
    }
}

/* 击中反馈 */
.hit-flash {
    animation: hitFlash 0.2s ease-out;
}

@keyframes hitFlash {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.5); }
}

/* 响应式设计 */
@media (max-width: 500px) {
    #game-container {
        width: 100%;
        height: 100vh;
        border: none;
        border-radius: 0;
    }
    
    .game-title {
        font-size: 24px;
    }
    
    .stat-box {
        padding: 4px 6px;
    }
    
    .stat-value {
        font-size: 14px;
    }
}

/* 点击波纹效果 */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.3s ease-out forwards;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(2);
        opacity: 0;
    }
}