/* Game Section Styles */
.game-section {
    padding: 40px 0;
    background-color: #f5f7fa;
}

/* Game Controls */
.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background-color: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
    gap: 20px;
}

.score-board {
    display: flex;
    gap: 40px;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

.score-value {
    font-size: 2rem;
    font-weight: 700;
    color: #4CAF50;
}

.control-buttons {
    display: flex;
    gap: 15px;
}

.control-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#pause-btn {
    background-color: #FF9800;
    color: white;
}

#restart-btn {
    background-color: #F44336;
    color: white;
}

#back-btn {
    background-color: #9E9E9E;
    color: white;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Game Instructions */
.game-instructions {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #4CAF50;
}

/* Category Statistics Area Styles */
.category-stats {
    margin-bottom: 20px;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-stats h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

.stat-item {
    color: white;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 80px;
    transition: transform 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-label {
    font-size: 14px;
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-count {
    font-size: 24px;
    font-weight: bold;
}

/* Game Area */
.game-area {
    position: relative;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 600px;
    background-image: url('../images/sky-bg.svg');
    background-size: cover;
    background-position: center;
}

/* Items Container */
.items-container {
    position: relative;
    width: 100%;
    height: 400px;
}

/* Falling Items */
.falling-item {
    position: absolute;
    width: 70px;
    height: 90px;
    border-radius: 10px;
    cursor: grab;
    z-index: 10;
    user-select: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.falling-item:active {
    cursor: grabbing;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.falling-item:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.falling-item i {
    margin-bottom: 5px;
    color: #333;
    font-size: 24px !important;
}

.falling-item span {
    word-break: break-word;
    white-space: normal;
    line-height: 1.2;
    font-weight: 600;
    font-size: 10px;
    text-align: center;
    color: #333;
}

/* Recycling Bins */
.bins-container {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-top: 2px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 10px;
}

.bin {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 120px;
    height: 150px;
    position: relative;
}

.bin:hover {
    transform: scale(1.1);
}

.bin-icon {
    width: 80px;
    height: 100px;
    margin-bottom: 10px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.bin-label {
    font-weight: 600;
    text-align: center;
}

/* Bin Colors */
.bin.paper .bin-icon {
    background-color: #f44336;
    border-radius: 10px 10px 0 0;
}

.bin.paper {
    color: #f44336;
}

.bin.plastic .bin-icon {
    background-color: #2196F3;
    border-radius: 10px 10px 0 0;
}

.bin.plastic {
    color: #2196F3;
}

.bin.glass .bin-icon {
    background-color: #FF9800;
    border-radius: 10px 10px 0 0;
}

.bin.glass {
    color: #FF9800;
}

.bin.metal .bin-icon {
    background-color: #9E9E9E;
    border-radius: 10px 10px 0 0;
}

.bin.metal {
    color: #9E9E9E;
}

.bin.organic .bin-icon {
    background-color: #8BC34A;
    border-radius: 10px 10px 0 0;
}

.bin.organic {
    color: #8BC34A;
}

.bin.hazardous .bin-icon {
    background-color: #9C27B0;
    border-radius: 10px 10px 0 0;
}

.bin.hazardous {
    color: #9C27B0;
}

/* Bin Animation for Correct Drop */
.bin.correct-drop {
    animation: binBounce 0.5s ease;
}

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

/* 特殊物品样式 */
.special-item {
    animation: pulse 1.5s infinite;
    transform-origin: center;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 15px currentColor; }
    50% { transform: scale(1.05); box-shadow: 0 0 25px currentColor, 0 0 40px rgba(255, 255, 255, 0.8); }
    100% { transform: scale(1); box-shadow: 0 0 15px currentColor; }
}

/* 混乱物品样式 */
.confusing-item {
    animation: confuse 3s infinite;
}

@keyframes confuse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; border-color: #FF5722; }
}

/* 倒计时计时器样式 */
.item-timer {
    animation: timerPulse 1s infinite;
}

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

/* 特殊消息样式 */
.special-message {
    font-family: 'Poppins', sans-serif;
    animation: slideIn 0.3s ease-out;
}

/* 连击指示 */
.combo-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

/* Game Messages */
.game-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 30px;
    border-radius: 15px;
    color: white;
    font-weight: 700;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.correct-message {
    background-color: #4CAF50;
}

.wrong-message {
    background-color: #F44336;
}

.message-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.message-icon {
    font-size: 3rem;
}

.message-text {
    font-size: 1.5rem;
}

.message-hint {
    font-size: 1.1rem;
    opacity: 0.9;
}

.message-hint span {
    font-weight: 700;
    text-decoration: underline;
}

/* Recycling Fact Popup */
.fact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.fact-modal.show {
    opacity: 1;
    visibility: visible;
}

.fact-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.fact-modal.show .fact-content {
    transform: translateY(0);
}

.fact-content h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 24px;
}

.fact-content p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.fact-close {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.fact-close:hover {
    background-color: #45a049;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

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

.modal-content h2 {
    margin-bottom: 30px;
    color: #4CAF50;
}

.final-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f5f7fa;
    border-radius: 10px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #4CAF50;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-secondary {
    display: inline-block;
    background-color: #9E9E9E;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #757575;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Animations */
@keyframes fall {
    from { transform: translateY(-100px) rotate(0deg); }
    to { transform: translateY(calc(100vh - 300px)) rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.5s ease;
}

/* Responsive Design */
@media (max-width: 992px) {
    .bins-container {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .game-area {
        min-height: 700px;
    }
}

@media (max-width: 768px) {
    .game-controls {
        flex-direction: column;
    }
    
    .score-board {
        gap: 30px;
    }
    
    .score-value {
        font-size: 1.5rem;
    }
    
    .control-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .bins-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bin {
        width: 100px;
        height: 130px;
    }
    
    .bin-icon {
        width: 60px;
        height: 80px;
    }
    
    .falling-item {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 576px) {
    .score-board {
        gap: 20px;
    }
    
    .modal-content {
        padding: 30px 20px;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    .game-area {
        min-height: 800px;
    }
}