/* 像素厨师冲刺 - 游戏样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    border: 3px solid #ffeb3b;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255, 235, 59, 0.5);
    background: #fff8e1;
    max-width: 100%;
    max-height: 100%;
}

#gameUI {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#gameUI > * {
    pointer-events: auto;
}

.score-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #ffeb3b;
    font-size: 14px;
    line-height: 1.6;
}

.score-panel div {
    margin-bottom: 5px;
}

.score-panel .score {
    color: #4caf50;
    font-weight: bold;
}

.score-panel .timer {
    color: #ff5722;
}

.score-panel .level {
    color: #2196f3;
}

.score-panel .combo {
    color: #9c27b0;
}

.game-modes {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.mode-btn {
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ffeb3b;
    color: #ffeb3b;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    transition: all 0.3s;
}

.mode-btn:hover {
    background: #ffeb3b;
    color: #000;
}

.mode-btn.active {
    background: #ffeb3b;
    color: #000;
    box-shadow: 0 0 10px rgba(255, 235, 59, 0.8);
}

.controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
}

.control-btn {
    padding: 10px 20px;
    background: linear-gradient(145deg, #d32f2f, #b71c1c);
    border: 2px solid #ffeb3b;
    color: #ffeb3b;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.control-btn:hover {
    background: linear-gradient(145deg, #f44336, #d32f2f);
    box-shadow: 0 6px 12px rgba(255, 235, 59, 0.4);
    transform: translateY(-2px);
}

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

/* 订单板样式 */
.order-board {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid #ffeb3b;
    border-radius: 8px;
    padding: 15px;
    min-width: 200px;
}

.order-board h3 {
    color: #ffeb3b;
    margin-bottom: 10px;
    font-size: 16px;
}

.order-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #ffeb3b;
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 8px;
    position: relative;
}

.order-item .dish-name {
    color: #fff;
    font-weight: bold;
    font-size: 12px;
}

.order-item .time-limit {
    color: #ff5722;
    font-size: 10px;
    margin-top: 4px;
}

.order-item .timer-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.order-item .timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #ffeb3b, #ff5722);
    transition: width 0.1s linear;
}

/* 烹饪区域样式 */
.cooking-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 300px;
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid #ffeb3b;
    border-radius: 8px;
    display: none;
}

.cooking-area.active {
    display: block;
}

.cooking-station {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px solid #fff;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
}

.cooking-station:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.cooking-station.active {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.3);
}

/* 食材样式 */
.ingredient {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: linear-gradient(145deg, #8bc34a, #4caf50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.ingredient:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.6);
}

.ingredient.selected {
    border-color: #ffeb3b;
    background: linear-gradient(145deg, #ffeb3b, #ffc107);
    transform: scale(1.2);
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(145deg, #d32f2f, #b71c1c);
    border: 3px solid #ffeb3b;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 235, 59, 0.5);
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    color: #ffeb3b;
    margin-bottom: 20px;
    font-size: 24px;
    text-shadow: 0 0 10px rgba(255, 235, 59, 0.8);
}

.modal-content p {
    margin-bottom: 15px;
    font-size: 16px;
    color: #ffffff;
}

.modal-content span {
    color: #4caf50;
    font-weight: bold;
}

#restartFromModal {
    margin-top: 20px;
    width: 100%;
}

/* 完成效果 */
.combo-effect {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffeb3b;
    font-size: 28px;
    font-weight: bold;
    z-index: 40;
    text-shadow: 0 0 15px rgba(255, 235, 59, 0.8);
    animation: comboFade 1s ease-out forwards;
    pointer-events: none;
}

@keyframes comboFade {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* 成就通知 */
.achievement-notification {
    position: absolute;
    top: 20%;
    right: 20px;
    background: linear-gradient(145deg, #4caf50, #2e7d32);
    border: 2px solid #ffeb3b;
    border-radius: 8px;
    padding: 15px;
    color: #fff;
    font-weight: bold;
    z-index: 50;
    animation: achievementSlide 3s ease-out forwards;
    pointer-events: none;
}

@keyframes achievementSlide {
    0% { transform: translateX(100%); opacity: 0; }
    20% { transform: translateX(0); opacity: 1; }
    80% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .score-panel {
        font-size: 12px;
        padding: 10px;
    }
    
    .game-modes {
        top: 10px;
        right: 10px;
    }
    
    .mode-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .controls {
        bottom: 10px;
        gap: 10px;
    }
    
    .control-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .order-board {
        left: 10px;
        min-width: 150px;
        padding: 10px;
    }
    
    .order-board h3 {
        font-size: 14px;
    }
    
    .order-item {
        padding: 6px;
        margin-bottom: 6px;
    }
}

@media (max-width: 480px) {
    .score-panel {
        top: 5px;
        left: 5px;
        font-size: 10px;
        padding: 8px;
    }
    
    .game-modes {
        flex-direction: column;
        top: 5px;
        right: 5px;
        gap: 5px;
    }
    
    .mode-btn {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .controls {
        bottom: 5px;
        gap: 5px;
    }
    
    .control-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .order-board {
        left: 5px;
        min-width: 120px;
        padding: 8px;
    }
    
    .order-board h3 {
        font-size: 12px;
    }
    
    .order-item {
        padding: 4px;
        margin-bottom: 4px;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .modal-content h2 {
        font-size: 20px;
    }
    
    .modal-content p {
        font-size: 14px;
    }
}