/* Maze Master Game Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #F59E0B;
    --primary-light: #FCD34D;
    --background: #FFFBEB;
    --surface: #FFFFFF;
    --text: #1E293B;
    --wall: #374151;
    --path: #FEF3C7;
    --player: #6366F1;
    --goal: #10B981;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, #EA580C 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#game-container {
    width: 100%;
    max-width: 450px;
    background: var(--surface);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

#game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--background);
}

.game-title {
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
}

.level-display,
.moves-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    color: #64748B;
}

.level-value,
.moves-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

#maze-container {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: var(--path);
}

#maze-canvas {
    border-radius: 8px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

#controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--background);
}

.control-row {
    display: flex;
    gap: 8px;
}

.control-btn {
    width: 60px;
    height: 60px;
    border: none;
    background: var(--surface);
    border-radius: 16px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.15s;
}

.control-btn:hover {
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
    background: var(--primary-light);
}

#instructions {
    text-align: center;
    padding: 12px;
    font-size: 13px;
    color: #64748B;
    background: var(--background);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--surface);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: popIn 0.4s ease;
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.stars {
    font-size: 48px;
    margin-bottom: 16px;
}

.modal-content h2 {
    font-size: 28px;
    color: var(--text);
    margin-bottom: 8px;
}

.modal-content p {
    color: #64748B;
    margin-bottom: 24px;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 32px;
}

.result-stat {
    display: flex;
    flex-direction: column;
}

.result-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.result-label {
    font-size: 14px;
    color: #64748B;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-primary,
.btn-secondary {
    padding: 14px 28px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #EA580C 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
    background: var(--background);
    color: var(--text);
    border: 2px solid #FDE68A;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}