body {
    margin: 0;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    -webkit-user-select: none;
    user-select: none;
    overflow-x: hidden;
}

h1 {
    color: white;
    margin: 0 0 10px 0;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.instructions {
    color: white;
    margin-bottom: 20px;
    font-size: 1.1em;
    text-align: center;
}

#gameCanvas {
    background: #e8dcc4;
    border: 5px solid #8b7355;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    cursor: grab;
    border-radius: 8px;
    touch-action: none;
    max-width: 100%;
    height: auto;
}

#gameCanvas:active {
    cursor: grabbing;
}

.level-picker {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.level-btn {
    padding: 12px 24px;
    font-size: 1em;
    font-weight: bold;
    background: white;
    border: 3px solid white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    color: #667eea;
}

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

.level-btn.active {
    background: #667eea;
    color: white;
}

.level-btn.solved {
    position: relative;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border-color: #4CAF50;
}

.level-btn.solved::after {
    content: '✓';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #FFD700;
    color: #333;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.info-link {
    margin-bottom: 15px;
    text-align: center;
}

.info-link a {
    color: white;
    text-decoration: none;
    font-size: 1em;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    transition: all 0.3s;
    display: inline-block;
}

.info-link a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

/* Victory Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
}

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

.modal-content h2 {
    margin: 0 0 20px 0;
    font-size: 2.5em;
    color: #667eea;
}

.modal-content p {
    margin: 0 0 30px 0;
    font-size: 1.2em;
    color: #666;
}

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

.modal-btn {
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    background: #e0e0e0;
    color: #333;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.modal-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-btn.primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a4292 100%);
}
