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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 20px;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fdbb2d, #b21f1f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.game-info {
    display: flex;
    gap: 20px;
    font-size: 1.2rem;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

button {
    background: linear-gradient(to right, #1a2a6c, #b21f1f);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

button:active {
    transform: translateY(0);
}

.maze-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

#maze {
    display: grid;
    grid-template-columns: repeat(15, 30px);
    grid-template-rows: repeat(15, 30px);
    gap: 1px;
    background-color: #333;
    border: 2px solid #555;
    border-radius: 5px;
    overflow: hidden;
}

.cell {
    width: 30px;
    height: 30px;
    background-color: #1a1a1a;
}

.wall {
    background-color: #2c3e50;
}

.path {
    background-color: #1a1a1a;
}

.start {
    background-color: #2ecc71;
}

.exit {
    background-color: #e74c3c;
}

.player {
    background-color: #3498db;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.hint-path {
    background-color: rgba(243, 156, 18, 0.3);
}

.instructions {
    text-align: center;
    margin-top: 10px;
}

kbd {
    background-color: #333;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #555;
    font-family: monospace;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #1a2a6c, #b21f1f);
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: modalAppear 0.3s ease;
}

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

.close {
    color: #fff;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #fdbb2d;
}

.tutorial-steps {
    position: relative;
    min-height: 300px;
}

.step {
    display: none;
}

.step.active {
    display: block;
}

.step h3 {
    margin-bottom: 15px;
    font-size: 1.8rem;
    color: #fdbb2d;
}

.step p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.controls-demo {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.key {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.step-indicators {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    transition: background-color 0.3s;
}

.indicator.active {
    background-color: #fdbb2d;
}

.next-btn, .prev-btn, .start-btn {
    margin-top: 10px;
    margin-right: 10px;
}

#win-modal .modal-content {
    text-align: center;
}

#win-modal h2 {
    color: #fdbb2d;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    #maze {
        grid-template-columns: repeat(15, 20px);
        grid-template-rows: repeat(15, 20px);
    }
    
    .cell {
        width: 20px;
        height: 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .game-info {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    header {
        flex-direction: column;
        gap: 10px;
    }
    
    .game-controls {
        flex-wrap: wrap;
    }
    
    #maze {
        grid-template-columns: repeat(15, 18px);
        grid-template-rows: repeat(15, 18px);
    }
    
    .cell {
        width: 18px;
        height: 18px;
    }
}