/* === MAZE ESCAPE GAME STYLES === */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* === HEADER === */
.game-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateX(-5px);
}

.game-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 12px;
}

.game-header h1 i {
    color: #f59e0b;
}

.game-stats {
    display: flex;
    gap: 20px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.1);
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    color: #374151;
}

.stat i {
    color: #6366f1;
}

/* === MAIN CONTENT === */
.game-main {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.game-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b, #475569);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(100, 116, 139, 0.3);
}

.difficulty-select {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* === MAZE CONTAINER === */
.maze-container {
    position: relative;
    display: flex;
    justify-content: center;
    margin: 20px 0;
    background: #1f2937;
    border-radius: 15px;
    padding: 20px;
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.3);
}

#mazeCanvas {
    border-radius: 10px;
    background: #111827;
    max-width: 100%;
    height: auto;
}

/* === GAME OVERLAY === */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.game-overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    color: white;
    padding: 40px;
}

.overlay-content h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #f59e0b;
}

.overlay-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* === INSTRUCTIONS === */
.game-instructions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 10px;
    border-left: 4px solid #6366f1;
}

.instruction-item i {
    color: #6366f1;
    font-size: 1.2rem;
}

.instruction-item span {
    font-weight: 500;
    color: #374151;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .game-container {
        padding: 10px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .game-stats {
        justify-content: center;
    }
    
    .game-controls {
        justify-content: center;
    }
    
    .game-header h1 {
        font-size: 1.5rem;
    }
    
    #mazeCanvas {
        width: 100%;
        max-width: 400px;
        height: 300px;
    }
    
    .game-instructions {
        grid-template-columns: 1fr;
    }
}

/* === ANIMATIONS === */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.btn:active {
    transform: scale(0.95);
}

.stat {
    animation: pulse 2s infinite;
}

/* === GAME STATES === */
.game-paused #mazeCanvas {
    filter: blur(3px);
    pointer-events: none;
}

.game-over .overlay-content {
    animation: pulse 1s ease-in-out;
}

.level-complete .overlay-content h2 {
    color: #10b981;
}

/* === LOADING ANIMATION === */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    animation: spin 1s linear infinite;
}