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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    touch-action: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.container {
    max-width: 400px;
    margin: 0 auto;
    padding: 10px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

header {
    text-align: center;
    margin-bottom: 10px;
    width: 100%;
    flex-shrink: 0;
}

h1 {
    color: white;
    font-size: 2em;
    font-weight: 300;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.timer-container {
    background: rgba(255,255,255,0.9);
    border-radius: 15px;
    padding: 8px 16px;
    margin-bottom: 5px;
}

.timer {
    font-size: 1em;
    font-weight: 600;
    color: #333;
}

.game-container {
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

#mazeCanvas {
    border: 2px solid #333;
    border-radius: 8px;
    display: block;
    margin: 0 auto 10px;
    touch-action: none;
    background: white;
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(0,0,0,0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn:active {
    transform: translateY(0);
}



.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 50% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 300px;
    text-align: center;
    transform: translateY(-50%);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-content h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.modal-content p {
    color: #666;
    margin-bottom: 20px;
    font-size: 1.1em;
}

/* Адаптация для очень маленьких экранов */
@media (max-width: 320px) {
    .container {
        padding: 5px;
    }
    
    #mazeCanvas {
        width: 280px;
        height: 280px;
    }
    
    h1 {
        font-size: 1.5em;
        margin-bottom: 3px;
    }
    
    .timer-container {
        padding: 6px 12px;
    }
    
    .game-container {
        padding: 10px;
    }
}

/* Адаптация для горизонтальной ориентации */
@media (orientation: landscape) and (max-height: 500px) {
    .container {
        padding: 5px;
        justify-content: space-evenly;
    }
    
    header {
        margin-bottom: 5px;
    }
    
    h1 {
        font-size: 1.2em;
        margin-bottom: 3px;
    }
    
    .timer-container {
        padding: 4px 8px;
        margin-bottom: 3px;
    }
    
    .timer {
        font-size: 0.8em;
    }
    
    #mazeCanvas {
        width: 280px;
        height: 280px;
        margin-bottom: 5px;
    }
    
    .game-container {
        padding: 8px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 0.8em;
    }
} 