* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    color: #333;
}

.container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    padding: 30px;
    max-width: 1000px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #4a5568;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.algorithm-selector {
    margin-bottom: 15px;
}

select, button, input {
    padding: 10px 15px;
    border: 2px solid #4299e1;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

button {
    background: #4299e1;
    color: white;
    border: none;
}

button:hover {
    background: #3182ce;
    transform: translateY(-2px);
}

button:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
}

.maze-container {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.cipher-section {
    flex: 1;
    min-width: 350px;
}

.maze-section {
    flex: 1;
    min-width: 350px;
}

.hint-commands {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.hint-command {
    width: 60px;
    height: 60px;
    border: 3px solid #4299e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    background: #e6fffa;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.command-input-section {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.command-input {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border: 2px solid #4299e1;
    border-radius: 8px;
    font-family: monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.maze-grid {
    display: grid;
    gap: 1px;
    margin-bottom: 20px;
    background: #2d3748;
    padding: 15px;
    border-radius: 10px;
    justify-content: center;
}

.maze-cell {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border-radius: 2px;
    transition: all 0.3s ease;
    position: relative;
}

.maze-cell.path {
    background: #e6fffa;
}

.maze-cell.wall {
    background: #2d3748;
    border: 1px solid #4a5568;
}

.maze-cell.start {
    background: #4299e1;
    color: white;
}

.maze-cell.finish {
    background: #f6ad55;
    color: white;
}

.maze-cell.player {
    background: #e53e3e;
    animation: pulse 1s infinite;
    color: white;
}

.maze-cell.visited {
    background: #c6f6d5;
}

.maze-cell.solution-path {
    background: #fbb6ce;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.controls {
    text-align: center;
    margin: 20px 0;
}

.cipher-info {
    background: #edf2f7;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-family: monospace;
    font-size: 14px;
}

.message {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: bold;
}

.success {
    background: #c6f6d5;
    color: #2f855a;
}

.error {
    background: #fed7d7;
    color: #c53030;
}

.hint {
    background: #bee3f8;
    color: #2b6cb0;
}

.stats {
    display: flex;
    justify-content: space-around;
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #4299e1;
}

.algorithm-info {
    background: #f0fff4;
    border: 1px solid #68d391;
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 13px;
}

@media (max-width: 768px) {
    .maze-container {
        flex-direction: column;
    }
    
    .maze-cell {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .hint-command {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}